/*! For license information please see loader.js.LICENSE.txt */ (()=>{var e={251305:(e,t,r)=>{"use strict";var n=r(487956);function i(e,t){return void 0===t&&(t=!0),e&&"object"==typeof e?function(e,t){return Object.keys(e).forEach((function(r){e[r]=i(e[r],t)})),e}(e,t):Array.isArray(e)?function(e,t){return e.forEach((function(r,n){e[n]=i(r,t)})),e}(e,t):n.is(e,t)?n.parse(e):e}e.exports=i},487956:(e,t)=>{"use strict";var r=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;t.parse=function(e){var t=[1,5,6,7,11,12],n=r.exec(e),i=0;if(!n)return new Date(e);for(var s,o=0;s=t[o];o++)n[s]=parseInt(n[s],10)||0;n[2]=parseInt(n[2],10)||1,n[3]=parseInt(n[3],10)||1,n[2]--,n[8]=n[8]?(n[8]+"00").substring(0,3):0," "===n[4]?i=(new Date).getTimezoneOffset():"Z"!==n[9]&&n[10]&&(i=60*n[11]+n[12],"+"===n[10]&&(i=0-i));var a=Date.UTC(n[1],n[2],n[3],n[5],n[6]+i,n[7],n[8]);return new Date(a)},t.is=function(e,t){return"string"==typeof e&&((!t||!1!==/^\d{4}-\d{2}-\d{2}/.test(e))&&r.test(e))}},122399:(e,t,r)=>{"use strict";r.d(t,{V:()=>i});var n=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/,i=e=>n.test(e)},859557:(e,t,r)=>{"use strict";r.d(t,{S:()=>l});var n=r(47169),i=r(649189),s=r.n(i),o=r(324819),a=r(122399),c=s().noConflict?s().noConflict():s();class l{constructor(){(0,n.Z)(this,"userId",this.djb2Hash("anonymous"));var e=this.getCookie("sessionId"),t=this.getCookie("userId");this.sessionId=e&&this.isValidSessionCookie(e)?e:this.createNewSession(),this.setCookie("sessionId",this.sessionId,7),this.userId=t||this.createNewUser(),this.setCookie("userId",this.userId,7)}getCookie(e){return c.get("".concat("atlassian-csm-widget","-").concat(e))}setCookie(e,t,r){c.set("".concat("atlassian-csm-widget","-").concat(e),t,{expires:r,path:"/",sameSite:"strict"})}setUserId(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"anonymous",t=this.djb2Hash(e);this.userId!==t&&(this.logout(),this.userId=this.createNewUser(e),this.sessionId=this.createNewSession())}createNewSession(){var e=(0,o.v4)();return this.setCookie("sessionId",e,7),e}isValidSessionCookie(e){return(0,a.V)(e)}createNewUser(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"anonymous",t=this.djb2Hash(e);return this.setCookie("userId",t,7),t}getSessionId(){return this.sessionId}saveConversationId(e){this.setCookie("conversationId",e,2)}removeConversationId(){c.remove("atlassian-csm-widget-conversationId")}getSavedConversationId(){return this.getCookie("conversationId")}logout(){document.cookie.split(";").forEach(e=>{var t=e.split("=")[0].trim();t.startsWith("atlassian-csm-widget")&&c.remove(t)})}djb2Hash(e){for(var t=5381,r=0;r>>0).toString(36)}}},213737:(e,t,r)=>{"use strict";r.d(t,{U:()=>n});var n={"color.100":"--csm-color-100","color.200":"--csm-color-200","color.300":"--csm-color-300","color.400":"--csm-color-400","color.500":"--csm-color-500","color.600":"--csm-color-600","color.700":"--csm-color-700","color.800":"--csm-color-800","color.900":"--csm-color-900","color.1000":"--csm-color-1000","color.icon":"--csm-color-icon","color.brand":"--csm-color-brand","color.brand.hover":"--csm-color-brand-hover","color.brand.active":"--csm-color-brand-active","color.brand.text":"--csm-color-brand-text","color.brand.hover.text":"--csm-color-brand-hover-text","color.brand.active.text":"--csm-color-brand-active-text","border.radius.lg":"--csm-border-radius-lg","border.radius.md":"--csm-border-radius-md","border.radius.sm":"--csm-border-radius-sm","border.radius.container":"--csm-border-radius-container","border.radius.widget":"--csm-border-radius-widget","space.lg":"--csm-space-lg","space.md":"--csm-space-md","space.sm":"--csm-space-sm"}},729580:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s});var n=r(213737);function i(e){if(!(e in n.U))throw Error("CSM Variable does not exist");return n.U[e]}function s(e,t){if(!(e in n.U))throw Error("CSM Token is not found");return Boolean(t)?"var(".concat(i(e),", ").concat(t,")"):"var(".concat(i(e),")")}},312779:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>a});var n=r(47169),i=r(711279),s=r(435146),o=r(288296);class a{constructor(e,t,r){if((0,n.Z)(this,"getCurrentInteractionSessionId",()=>this.featureEnabled&&this.interactionSessionTracking?this.interactionSessionTracking.getCurrentInteractionSessionId():null),(0,n.Z)(this,"getPreviousInteractionSessionId",()=>this.featureEnabled&&this.interactionSessionTracking?this.interactionSessionTracking.getPreviousInteractionSessionId():null),(0,n.Z)(this,"getBridge",()=>this.featureEnabled&&this.safeSessionStorage?this.safeSessionStorage.getItem("interactionSession.bridge"):null),(0,n.Z)(this,"getInteractionSource",()=>this.featureEnabled&&this.safeSessionStorage?this.safeSessionStorage.getItem("interactionSession.source"):null),this.featureEnabled=(0,i.fg)("analytics_cross_product_interaction_tracking"),this.featureEnabled){this.interactionSessionTracking=s.Z.getInstance();var a=!1;this.interactionSessionTracking&&e&&(this.interactionSessionTracking.setAnalyticsCallback(e.analyticsEventCallback),a=this.interactionSessionTracking.setInteractionSessionId(e.persistedSessionId)),this.safeSessionStorage=new o.Z,a&&(t&&this.safeSessionStorage.setItem("interactionSession.bridge",t),r&&this.safeSessionStorage.setItem("interactionSession.source",r))}}}},175986:(e,t,r)=>{"use strict";r.d(t,{v:()=>n});var n="xpis"},435146:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(720086);class i{static getInstance(){var e;try{"analyticsInteractionSesssionTrackingClient"in window||(window.analyticsInteractionSesssionTrackingClient=new n.ZP),e=window.analyticsInteractionSesssionTrackingClient}catch(e){console.error("Error initialising InteractionSessionTracking - ".concat(e instanceof Error?e.message:String(e)))}return e}}},720086:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>o});var n=r(47169),i=r(288296),s=/^\d+$/;class o{constructor(){(0,n.Z)(this,"analyticsReady",!1),(0,n.Z)(this,"generateNewSessionId",e=>{var t=this.safeSessionStorage.getItem("interactionSession.id"),r=e||Date.now().toString();return t===r?t:(this.safeSessionStorage.setItem("interactionSession.id",r),e?this.safeSessionStorage.removeItem("interactionSession.id.prev"):t?(this.safeSessionStorage.setItem("interactionSession.id.prev",t),this.sendInteractionSessionEvent("renewed")):this.sendInteractionSessionEvent("started"),document.dispatchEvent(new Event("interactionSessionIdUpdated")),r)}),(0,n.Z)(this,"updateSessionExpiry",()=>{var e=Date.now()+this.sessionExpiryTime;return this.safeSessionStorage.setItem("interactionSession.expiry",e.toString()),e}),(0,n.Z)(this,"debouncedUpdateSessionExpiry",e=>{var{updateSessionExpiry:t}=this;e{t()},this.sessionExpiryDebounce))}),this.sessionExpiryTime=18e5,this.sessionExpiryDebounce=5e3,this.sessionExpiryDebounceThresholdPercentage=.9,this.safeSessionStorage=new i.Z}getCurrentInteractionSessionId(){if(!this.analyticsReady)return null;var e=this.safeSessionStorage.getItem("interactionSession.id"),t=parseInt(this.safeSessionStorage.getItem("interactionSession.expiry")||"0",10)||0;return this.debouncedUpdateSessionExpiry(t),!e||t<=Date.now()||Number.isNaN(t)?this.generateNewSessionId():e}getPreviousInteractionSessionId(){return this.analyticsReady?this.safeSessionStorage.getItem("interactionSession.id.prev"):null}setInteractionSessionId(e){return!(!this.analyticsReady||!this.validateSessionId(e))&&(this.generateNewSessionId(e),this.debouncedUpdateSessionExpiry(0),!0)}setAnalyticsCallback(e){this.analyticsReady||("function"==typeof e?(this.sendEventCallback=e,this.analyticsReady=!0):this.analyticsReady=!1)}validateSessionId(e){return!!(e&&s.test(e)&&parseInt(e,10)<=Date.now())}sendInteractionSessionEvent(e){this.sendEventCallback&&this.sendEventCallback({action:e,actionSubject:"interactionSession",source:"interactionComponent",tags:["navigationExperiences"]})}}},97831:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(47169);const i=new class{constructor(){(0,n.Z)(this,"data",{}),(0,n.Z)(this,"length",0),(0,n.Z)(this,"setItem",(e,t)=>(this.data[e]=t,this.length=Object.keys(this.data).length,t)),(0,n.Z)(this,"getItem",e=>e in this.data?this.data[e]:null),(0,n.Z)(this,"removeItem",e=>(e in this.data&&delete this.data[e],this.length=Object.keys(this.data).length,null)),(0,n.Z)(this,"clear",()=>{this.data={},this.length=0}),(0,n.Z)(this,"key",e=>Object.keys(this.data)[e])}}},288296:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(97831),i=r(569896);const s=class extends i.ZP{constructor(e){var t;try{t=window.sessionStorage||n.Z}catch(e){t=n.Z}super(t,e)}}},569896:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>a});var n=r(47169),i=r(97831),s=function(e){return e.DEV="dev",e.LOCAL="local",e.PROD="prod",e.STAGING="staging",e}({});function o(e){if(!e)return!1;try{var t="awc.storage.support";e.setItem(t,"test_value");var r=e.getItem(t);return e.removeItem(t),"test_value"===r}catch(e){return!1}}class a{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.Z)(this,"getStore",()=>this.store),(0,n.Z)(this,"getItem",e=>this.store.getItem(this.createKey(e))),(0,n.Z)(this,"removeItem",e=>this.store.removeItem(this.createKey(e))),(0,n.Z)(this,"setItem",(e,t)=>{try{this.store.setItem(this.createKey(e),t)}catch(r){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(r)&&(this.swapToInMemory(),this.store.setItem(this.createKey(e),t))}}),(0,n.Z)(this,"swapToInMemory",()=>{if(this.store!==i.Z&&"undefined"!=typeof window){var e,t=Object.keys(this.store||{});o(window.awcInMemoryStorageFallback)?e=window.awcInMemoryStorageFallback:(e=i.Z,window.awcInMemoryStorageFallback||(window.awcInMemoryStorageFallback=i.Z)),t.forEach(t=>{if(0===t.indexOf(this.getPrefix())){var r=this.store.getItem(t);r&&e.setItem(t,r)}}),this.store=e}}),(0,n.Z)(this,"clear",()=>this.store.clear()),(0,n.Z)(this,"key",e=>this.store.key(e)),(0,n.Z)(this,"getPrefix",()=>this.prefix),(0,n.Z)(this,"createKey",e=>this.prefix?"".concat(this.getPrefix(),".").concat(e):e),this.options=t;var r=[];(void 0===t.useStoragePrefix||t.useStoragePrefix)&&r.push("awc"),t.envPrefix&&t.envPrefix!==s.PROD&&r.push(t.envPrefix),this.prefix=r.join("-"),o(e)?this.store=e:this.swapToInMemory()}}},543860:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>A});var n=r(47169),i=r(966945),s=r(319494),o=r(202056),a=r(129489),c=r(369382),l=r(136174),u=r(122431),d=r(663100),h=r(32794),g=r(213918),p=r(784377),v=r(510669),f=r(183781),m=r(144022),y=r(863243),_=r(972080),b=r(706544),w=r(224330),E=r(893104),I=r(230059),O=r(36536),S=r(820951),C=r(970859);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t{T.callback(t,e)}}static callback(e,t){var r=e.getStatusCode();r>=200&&r<=299?e.getEventResponseList().forEach(e=>{t.warn("Validation report for event with message ID %s:\n",e.getMessageId(),e)}):400===r||404===r?(t.warn("GASv3 submission failed with HTTP Status Code %d: %s",e.getStatusCode(),e.getMessage()),e.getEventResponseList().forEach(e=>{t.warn("Event with message ID %s:\n",e.getMessageId(),e)})):(t.log("GASv3 submission failed with HTTP Status Code %d: %s",e.getStatusCode(),e.getMessage()),e.eventResponseList.forEach(e=>{t.debug("Event with message ID %s:\n",e.getMessageId(),e)}))}}class A{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,n.Z)(this,"_useStargate",e=>null==e||e),(0,n.Z)(this,"_changeInternalUserId",(e,t)=>{this._eventProcessor.getUser().setUserId(e),t&&t!==this._eventProcessor.getUser().getAnonymousId()&&this._eventProcessor.getUser().setAnonymousId(t)}),(0,n.Z)(this,"_createSubproductGetter",e=>(0,o.Z)(e,"Cannot get subproduct from the callback. Proceeding without it.")),(0,n.Z)(this,"_createEmbeddedProductGetter",e=>(0,o.Z)(e,"Cannot get embeddedProduct from the callback. Proceeding without it.")),(0,n.Z)(this,"_getLastScreenEvent",()=>{try{return JSON.parse(this._safeSessionStorage.getItem("last.screen.event")||"")}catch(e){return this._safeSessionStorage.removeItem("last.screen.event"),null}}),(0,n.Z)(this,"_setLastScreenEvent",e=>{this._safeSessionStorage.setItem("last.screen.event",JSON.stringify({name:e.name,attributes:e.attributes}))}),(0,n.Z)(this,"_shouldEventBeDelayed",e=>{if(!e.tags||-1===e.tags.indexOf("measurement"))return!1;var t=!1!==e.highPriority;return this._eventDelayQueue.isDelayingLowPriorityEvents()&&!t}),(0,n.Z)(this,"_fireEvent",(e,t,r,n)=>{switch(t.eventType){case i.a7.UI:case i.a7.OPERATIONAL:case i.a7.TRACK:return this._eventProcessor.track(e,t,r,n);case i.a7.SCREEN:return this._eventProcessor.page(e,t,r,n);case i.a7.IDENTIFY:return this._eventProcessor.identify(e,t,r,n);default:throw new Error("No handler has been defined for events of type ".concat(t.eventType))}}),(0,n.Z)(this,"_fireDelayedEvent",(e,t,r,n)=>{try{this._changeInternalUserId(n.userId,n.anonymousId),t.tags=[...t.tags||[],"sentWithDelay"],this._fireEvent(e,t,r,void 0)}finally{this._changeInternalUserId(this._userInfo.userId,this._userInfo.anonymousId)}}),(0,n.Z)(this,"_delayEvent",(e,t,r,n,i)=>{this._eventDelayQueue.push(e,t,r,n),i&&i()}),(0,n.Z)(this,"_processEvent",(e,t,r,n)=>(this._testingCache.saveEvent(t),this._shouldEventBeDelayed(t)?(this._delayEvent(e,t,r,this._userInfo,n),Promise.resolve()):this._fireEvent(e,t,r,n))),(0,n.Z)(this,"setEmbeddedProduct",e=>{this._internalProductInfo.embeddedProduct=this._createEmbeddedProductGetter(e),this.resetUIViewedTimers()}),(0,n.Z)(this,"clearEmbeddedProduct",()=>{this._internalProductInfo.embeddedProduct=this._createEmbeddedProductGetter(null)}),(0,n.Z)(this,"setSubproduct",e=>{this._internalProductInfo.subproduct=this._createSubproductGetter(e),this.resetUIViewedTimers()}),(0,n.Z)(this,"setOriginTracingHandlers",e=>{var t=this._originTracing.handleOriginParameters(e,this._historyReplaceFn);Object.keys(t).forEach(e=>{void 0!==t[e].taskSessionId&&this._task.createTaskSessionWithProvidedId(e,t[e].taskSessionId)});var r={};return Object.keys(t).forEach(e=>{t[e].originTracingAttributes?r[e]=t[e].originTracingAttributes:console.warn("Handling method for origin parameter ".concat(e," has not returned any attributes"))}),Object.keys(t).length>0?this.sendOperationalEvent({action:"landed",actionSubject:"origin",source:"webClient",attributes:{originTracesLanded:r}},()=>{}):Promise.resolve()}),(0,n.Z)(this,"setTenantInfo",(e,t)=>{if(!e)throw new Error("Missing tenantIdType");if(e!==i.ox.NONE&&!t)throw new Error("Missing tenantId");if(!(0,i.P9)(i.ox,e))throw new Error("Invalid tenantIdType '".concat(e,"', ")+"must be an tenantType: [".concat((0,i.TT)(i.ox),"]"));this._tenantInfo={tenantIdType:e,tenantId:t},this._eventProcessor.refreshMetadata(this._userInfo,this._tenantInfo)}),(0,n.Z)(this,"clearTenantInfo",()=>{this._tenantInfo={},this._eventProcessor.refreshMetadata(this._userInfo,this._tenantInfo)}),(0,n.Z)(this,"setOrgInfo",e=>{if(!e)throw new Error("Missing orgId");this._orgInfo={orgId:e}}),(0,n.Z)(this,"clearOrgInfo",()=>{this._orgInfo={}}),(0,n.Z)(this,"setWorkspaceInfo",e=>{if(!e)throw new Error("Missing workspaceId");this._workspaceInfo={workspaceId:e}}),(0,n.Z)(this,"clearWorkspaceInfo",()=>{this._workspaceInfo={}}),(0,n.Z)(this,"setUserInfo",(e,t)=>{(0,d.wT)(e,t),this._changeInternalUserId(t),this._userInfo={userIdType:e,userId:t,anonymousId:this._eventProcessor.getUser().getAnonymousId()},this._eventProcessor.refreshMetadata(this._userInfo,this._tenantInfo)}),(0,n.Z)(this,"clearUserInfo",()=>{this._changeInternalUserId(void 0),this._userInfo={anonymousId:this._eventProcessor.getUser().getAnonymousId()},this._eventProcessor.refreshMetadata(this._userInfo,this._tenantInfo)}),(0,n.Z)(this,"setAlias",(e,t)=>{if(!e)throw new Error("Missing aliasType");if(!(0,i.P9)(i.kB,e))throw new Error("Invalid aliasType '".concat(e,"', ")+"must be an aliasType: [".concat((0,i.TT)(i.kB),"]"));this._aliases[e]=t}),(0,n.Z)(this,"clearAlias",()=>{this._aliases={}}),(0,n.Z)(this,"setGroup",(e,t)=>{if(!e)throw new Error("Missing groupType");if(!(0,i.P9)(i.kW,e))throw new Error("Invalid groupType '".concat(e,"', ")+"must be an groupType: [".concat((0,i.TT)(i.kW),"]"));this._groups[e]=t}),(0,n.Z)(this,"clearGroup",()=>{this._groups={}}),(0,n.Z)(this,"getAnonymousId",()=>this._userInfo.anonymousId),(0,n.Z)(this,"getCurrentSessionId",()=>this._sessionTracking.getCurrentSessionId()),(0,n.Z)(this,"setUIViewedAttributes",e=>{if(!e)throw new Error("Missing uiViewedAttributes");if("object"!=typeof e||Array.isArray(e))throw new Error("Invalid uiViewedAttributes type, should be a non array object");this._uiViewedAttributes=P({},e)}),(0,n.Z)(this,"getUIViewedAttributes",()=>this._uiViewedAttributes),(0,n.Z)(this,"clearUIViewedAttributes",()=>{this._uiViewedAttributes={}}),(0,n.Z)(this,"sendIdentifyEvent",(e,t,r)=>{this.setUserInfo(e,t);var n={userIdType:e,eventType:i.a7.IDENTIFY};return this._processEvent(t,n,this._context,r)}),(0,n.Z)(this,"sendPageEvent",(e,t)=>this.sendScreenEvent(e,t)),(0,n.Z)(this,"sendScreenEvent",(e,t,r)=>{var n,i,s,o;"object"==typeof e?(n=e.name,i=e.attributes,s=e.containers,o=e.tags):(n=e,i=r),(0,d.iO)(n),(0,d.OW)(s);var a=P({name:n},(0,l.xU)(this._internalProductInfo,this._tenantInfo,this._userInfo,i,e.nonPrivacySafeAttributes,o,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this._task.getAllTaskSessions(),this._crossProductInteractionTracking.getInteractionSession(),this._orgInfo,this._pageLoadId,this._workspaceInfo,e,s,this._aliases,this._groups));return this._setLastScreenEvent(a),this._processEvent(n,a,this._context,(0,S.Z)(t,a))}),(0,n.Z)(this,"sendTrackEvent",(e,t)=>{(0,d.TE)(e);var r=(0,l.$Q)(this._internalProductInfo,this._tenantInfo,this._userInfo,e,i.a7.TRACK,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this._task.getAllTaskSessions(),this._crossProductInteractionTracking.getInteractionSession(),this._orgInfo,this._pageLoadId,this._workspaceInfo,this._aliases,this._groups);return this._processEvent((0,l.pe)(e),r,this._context,(0,S.Z)(t,r))}),(0,n.Z)(this,"sendUIEvent",(e,t)=>{(0,d.M0)(e);var r=(0,l.$Q)(this._internalProductInfo,this._tenantInfo,this._userInfo,e,i.a7.UI,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this._task.getAllTaskSessions(),this._crossProductInteractionTracking.getInteractionSession(),this._orgInfo,this._pageLoadId,this._workspaceInfo,this._aliases,this._groups);return this._processEvent((0,l.pe)(e),r,this._context,(0,S.Z)(t,r))}),(0,n.Z)(this,"sendOperationalEvent",(e,t)=>{(0,d.AE)(e);var r=(0,l.$Q)(this._internalProductInfo,this._tenantInfo,this._userInfo,e,i.a7.OPERATIONAL,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this._task.getAllTaskSessions(),this._crossProductInteractionTracking.getInteractionSession(),this._orgInfo,this._pageLoadId,this._workspaceInfo,this._aliases,this._groups);return this._processEvent((0,l.pe)(e),r,this._context,(0,S.Z)(t,r))}),(0,n.Z)(this,"startUIViewedEvent",e=>{this.stopUIViewedEvent(),this._uiViewedEvent=new E.Z(this._internalProductInfo,()=>({embeddedProduct:this._internalProductInfo.embeddedProduct(),subproduct:this._internalProductInfo.subproduct(),tenantIdType:this._tenantInfo.tenantIdType,tenantId:this._tenantInfo.tenantId,userId:this._userInfo.userId,lastScreenEvent:this._getLastScreenEvent(),attributes:this._uiViewedAttributes}),t=>this.sendUIEvent(t,e)),this._uiViewedEvent.start()}),(0,n.Z)(this,"stopUIViewedEvent",()=>{this._uiViewedEvent&&(this._uiViewedEvent.stop(),this._uiViewedEvent=null)}),(0,n.Z)(this,"resetUIViewedTimers",()=>{this._uiViewedEvent&&this._uiViewedEvent.resetTimers()}),(0,n.Z)(this,"startApdexEvent",e=>{this._apdexEvent.start(e)}),(0,n.Z)(this,"getApdexStart",e=>this._apdexEvent.getStart(e)),(0,n.Z)(this,"stopApdexEvent",(e,t)=>{this._apdexEvent.stop(e,t)}),(0,n.Z)(this,"startLowPriorityEventDelay",(e,t)=>{this._eventDelayQueue.startLowPriorityEventDelay(e,t)}),(0,n.Z)(this,"stopLowPriorityEventDelay",()=>{this._eventDelayQueue.stopLowPriorityEventDelay()}),(0,n.Z)(this,"onEvent",(e,t)=>{if(!t)throw new Error("Missing analyticsData");if(!t.eventType)throw new Error("Missing analyticsData.eventType");if(t.eventType===i.a7.TRACK)return this.sendTrackEvent(t);if(t.eventType===i.a7.UI)return this.sendUIEvent(t);if(t.eventType===i.a7.OPERATIONAL)return this.sendOperationalEvent(t);if(t.eventType===i.a7.SCREEN)return this.sendScreenEvent(t.name,null,t.attributes);if(t.eventType===i.a7.IDENTIFY)return this.sendIdentifyEvent(t.userIdType,t.userId);throw new Error("Invalid analyticsData.eventType '".concat(t.eventType,"', ")+"must be an eventType: [".concat((0,i.TT)(i.a7),"]"))}),(0,n.Z)(this,"setResponseCallback",e=>{this._eventProcessor.setResponseCallback(e)}),!e)throw new Error("Missing productInfo");if(!e.env)throw new Error("Missing productInfo.env");if(!e.product)throw new Error("Missing productInfo.product");if(!(0,i.P9)(i.gq,e.env))throw new Error("Invalid productInfo.env '".concat(e.env,"', ")+"must be an envType: [".concat((0,i.TT)(i.gq),"]"));if(e.perimeter&&!(0,i.P9)(i.T_,e.perimeter))throw new Error("Invalid productInfo.perimeter '".concat(e.perimeter,"', ")+"must be an perimeterType: [".concat((0,i.TT)(i.T_),"]"));if(e.origin){if(!(0,i.P9)(i.mO,e.origin))throw new Error("Invalid productInfo.origin '".concat(e.origin,"', ")+"must be an originType: [".concat((0,i.TT)(i.mO),"]"))}else e.origin=i.mO.WEB;e.platform?(0,d.Ct)(e):e.platform=e.origin===i.mO.WEB?i.qZ.WEB:i.qZ.DESKTOP,this._logger=t.logger||console,this._internalProductInfo=P(P({},e),{},{subproduct:this._createSubproductGetter(e.subproduct),embeddedProduct:this._createEmbeddedProductGetter(e.embeddedProduct)}),this._tenantInfo={},this._orgInfo={},this._uiViewedAttributes={},null!=e&&e.embeddedContext&&(this._embeddedContext=e.embeddedContext,(0,c.P)(this._embeddedContext)&&this.setUIViewedAttributes({embeddedType:this._embeddedContext.embeddedType,embeddedFromProduct:this._embeddedContext.embeddedFromProduct,embeddedFromSubproduct:this._embeddedContext.embeddedFromSubproduct,embeddedFromTopLevelDomain:this._embeddedContext.embeddedFromTopLevelDomain}),(0,c.N)(this._embeddedContext)&&this.setUIViewedAttributes({embeddedType:this._embeddedContext.embeddedType,embeddedFromTopLevelDomain:this._embeddedContext.embeddedFromTopLevelDomain})),this._context=(0,l.rJ)(this._internalProductInfo),this._safeSessionStorage=new y.Z;var r=this._useStargate(t.useStargate),O=t.apiHost||(0,f.R)({useStargate:r,env:e.env,useLegacyUrl:t.useLegacyUrl,perimeter:e.perimeter,ic:e.ic,envOverride:e.envOverride}),k=t.apiHostProtocol||"https",A=t.minRetryDelay||1e3,x=void 0!==t.maxRetryAttempts&&Number.isInteger(t.maxRetryAttempts)&&t.maxRetryAttempts>=0?t.maxRetryAttempts+1:void 0,D={maxRetryDelay:6e4,minRetryDelay:A,backoffFactor:2,flushWaitMs:t.flushWaitInterval,flushBeforeUnload:t.flushBeforeUnload,maxAttempts:x},j="awc-".concat(e.env),R=t.disableCookiePersistence||!1,L=(t.metadataClientFactory||g.z.Factory)(k,O,e.product);this._eventProcessor=new h.Z({apiHost:O,apiHostProtocol:k,product:e.product,retryQueuePrefix:j,retryQueueOptions:D,xidPromiseGetter:()=>(0,C.H)(t.xidConsent,t.xidPromiseFn),logger:this._logger,metadataClient:L,disableCookiePersistence:R,responseCallback:T.getCallback(this._logger),env:e.env,perimeter:e.perimeter,enableMetadataCalls:this.metadataCallsEnabled(t),enableEventCalls:this.eventCallsEnabled(t)}),this._userInfo={anonymousId:this._eventProcessor.getUser().getAnonymousId(null==t?void 0:t.customAnonymousIdGenerator)},this._pageVisibility=new v.Z,this._tabTracking=new _.Z,this._sessionTracking=new m.ZP({sessionExpiryTime:t.sessionExpiryTime,onNewSessionStarted:t.onNewSessionStarted}),this._task=new b.Z,this._originTracing=new p.Z,this._apdexEvent=new s.Z(this.sendOperationalEvent,this._pageVisibility),this._historyReplaceFn="function"==typeof t.historyReplaceFn?t.historyReplaceFn:I.f,this._eventDelayQueue=new u.Z(this._fireDelayedEvent,t.delayQueueCompressors||[]),this._testingCache=new w.Z(t.isSynthetic,t.enableTestingCache),this._pageLoadId=crypto.randomUUID(),this._workspaceInfo={},this._aliases={},this._groups={},this._crossProductInteractionTracking=new a.Z(this.sendOperationalEvent),this._crossProductInteractionTracking.validateInteractionSession()}metadataCallsEnabled(e){return"boolean"==typeof e.disableMetadataCalls?!e.disableMetadataCalls:!O.Q.isGeminiVREnvironment()&&!O.Q.areFetchCallsDisabled()}eventCallsEnabled(e){return"boolean"==typeof e.disableEventCalls?!e.disableEventCalls:!O.Q.isGeminiVREnvironment()&&!O.Q.areFetchCallsDisabled()}setEventValidationMode(e){this._context.context.validationMode=e}get task(){return this._task}get _productInfo(){return this._internalProductInfo}}},966945:(e,t,r)=>{"use strict";r.d(t,{AW:()=>l,Nw:()=>d,P9:()=>v,TT:()=>p,T_:()=>f,W5:()=>g,a7:()=>i,bi:()=>c,gq:()=>n,jM:()=>u,kB:()=>m,kW:()=>y,mO:()=>o,ox:()=>a,qZ:()=>s,uB:()=>h});var n=function(e){return e.LOCAL="local",e.DEV="dev",e.STAGING="staging",e.PROD="prod",e}({}),i=function(e){return e.TRACK="track",e.UI="ui",e.OPERATIONAL="operational",e.SCREEN="screen",e.IDENTIFY="identify",e}({}),s=function(e){return e.MAC="mac",e.LINUX="linux",e.WINDOWS="windows",e.DESKTOP="desktop",e.WEB="web",e.MOBILE_WEB="mobileWeb",e}({}),o=function(e){return e.DESKTOP="desktop",e.WEB="web",e}({}),a=function(e){return e.CLOUD_ID="cloudId",e.ORG_ID="orgId",e.OPSGENIE_CUSTOMER_ID="opsgenieCustomerId",e.HALP_TEAM_ID="halpTeamId",e.LOOM_ORG_ID="loomOrgId",e.TRANSACTION_ACCOUNT_ID="transactionAccountId",e.TRELLO_WORKSPACE_ID="trelloWorkspaceId",e.JA_WORKSPACE_ID="jiraAlignWorkspaceId",e.STUDIO_WORKSPACE_ID="studioWorkspaceId",e.NONE="none",e}({}),c=function(e){return e.FIRST_PARTY="FIRST_PARTY",e.THIRD_PARTY="THIRD_PARTY",e}({}),l=function(e){return e.ATLASSIAN_ACCOUNT="atlassianAccount",e.HASHED_EMAIL="hashedEmail",e.LOOM="loom",e.TRELLO="trello",e.OPSGENIE="opsgenie",e.JA_USER_ID="jiraAlign",e.HALP="halp",e}({}),u=function(e){return e.TRANSITION="transition",e.INITIAL_LOAD="initialLoad",e}({}),d=Object.freeze([s.DESKTOP,s.MAC,s.LINUX,s.WINDOWS]),h=Object.freeze([s.WEB,s.MOBILE_WEB]),g=function(e){return e.ATL_ORIGIN="atlOrigin",e}({});function p(e){return Object.values(e)}function v(e,t){return Object.values(e).indexOf(t)>-1}var f=function(e){return e.C5="c5",e.COMMERCIAL="commercial",e.FEDRAMP_MODERATE="fedramp-moderate",e.FEDRAMP_HIGH="fedramp-high",e}({}),m=function(e){return{}}(),y=function(e){return e.TRANSACTION_ACCOUNT_ID="transactionAccountId",e}({})},319494:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(47169),i=r(966945),s=r(510669),o=r(145105);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{var{task:t,taskId:r}=e;return r?"".concat(t,".").concat(r):t}),(0,n.Z)(this,"_getEventTimingByName",e=>{var t=this._performance.getEntriesByName(e);return t[t.length-1]}),(0,n.Z)(this,"_getApdexFields",e=>{var t=this._getApdexTimings(e),r=this._calculateApdex({duration:t.duration,threshold:e.threshold});return c(c({},t),{},{apdex:r})}),(0,n.Z)(this,"_getApdexTimings",e=>{var t=this._getEventKey(e),r="".concat(t,"-start"),n=e.startTime||this._getStartTime(e,r),i=e.stopTime||this._getStopTime();return this._cleanApdexState(t),{startTime:n,stopTime:i,duration:i-n}}),(0,n.Z)(this,"_getStartTime",(e,t)=>{var r,n=this._performance.getTimeOrigin();e.type===i.jM.INITIAL_LOAD?r=n:r=n+this._getEventTimingByName(t).startTime;return r}),(0,n.Z)(this,"_getStopTime",()=>this._performance.getTimeOrigin()+this._performance.now()),(0,n.Z)(this,"_cleanApdexState",e=>{this._performance.clearMarks("".concat(e,"-start")),this._performance.clearMarks("".concat(e,"-stop")),this._startedEvents.delete(e)}),(0,n.Z)(this,"_getVisibilityFields",e=>{var t;if(e.type===i.jM.INITIAL_LOAD)t=!this._wasPreviouslyHidden;else if(e.type===i.jM.TRANSITION){var r=this._getEventKey(e);t=this._isActiveEvents.get(r)}return(e.startTime||e.stopTime)&&(t=!this._pageVisibility.getIsHidden()),{isActiveTab:t}}),(0,n.Z)(this,"_calculateApdex",e=>{var{duration:t,threshold:r=this._threshold}=e;return t<=r?1:t<=4*r?.5:0}),(0,n.Z)(this,"_validateStartEvent",e=>{if(!e)throw new Error('Missing "event" in Apdex start event');if(!e.task)throw new Error('Missing "task" in Apdex start event');if("string"!=typeof e.task)throw new Error('Invalid "task" in Apdex start event');if(e.taskId&&"string"!=typeof e.taskId)throw new Error('Invalid "taskId" in Apdex start event')}),(0,n.Z)(this,"_validateStopEvent",e=>{if(!e)throw new Error('Missing "event" in Apdex stop event');if(!e.task)throw new Error('Missing "task" in Apdex stop event');if("string"!=typeof e.task)throw new Error('Invalid "task" in Apdex stop event');if(e.taskId&&"string"!=typeof e.taskId)throw new Error('Invalid "taskId" in Apdex stop event');if(!e.type)throw new Error('Missing "type" in Apdex stop event');if(e.type&&!(0,i.P9)(i.jM,e.type))throw new Error('Invalid "type" in Apdex stop event');if(e.threshold&&"number"!=typeof e.threshold)throw new Error('Invalid "threshold" in Apdex stop event');if(!e.startTime&&e.type===i.jM.TRANSITION){var t=this._getEventKey(e);if(!this._startedEvents.has(t))throw new Error('Apdex event transition "'.concat(t,'" was not started'))}if(e.startTime&&!("number"==typeof e.startTime&&e.startTime>=0))throw new Error('Invalid "startTime" in Apdex stop event');if(e.stopTime&&"number"!=typeof e.stopTime)throw new Error('Invalid "stopTime" in Apdex stop event');if(e.stopTime<=e.startTime)throw new Error('"stopTime" should be greater than "startTime" in Apdex stop event')}),(0,n.Z)(this,"_shouldSendEvent",e=>!!e&&"number"==typeof e.apdex),(0,n.Z)(this,"_sendEvent",(e,t)=>{this._shouldSendEvent(e)&&this._onEvent({source:"ui",action:"readyForUser",actionSubject:"ui",attributes:c(c({},e.additionalAttributes),{},{task:e.task,taskId:e.taskId,type:e.type,threshold:e.threshold||this._threshold,apdex:e.apdex,startTime:e.startTime,stopTime:e.stopTime,duration:e.duration,isActiveTab:e.isActiveTab})},t)}),!e)throw new Error("Missing onEvent callback");if("function"!=typeof e)throw new Error("Invalid onEvent, must be function");if(!(t instanceof s.Z))throw new Error("Invalid pageVisibility, must be PageVisibility class");this._startedEvents=new Map,this._performance=new o.Z,this._onEvent=e,this._threshold=1e3,this._wasPreviouslyHidden=t.getIsHidden(),this._isActiveEvents=new Map,this._pageVisibility=t,this._pageVisibility.addCallback("apdexEvent",e=>{this.onVisibilityChange(!e)})}start(e){if(this._validateStartEvent(e),this._performance.isAvailable()){var t=this._getEventKey(e),r="".concat(t,"-start");this._startedEvents.set(t,!0),this._isActiveEvents.set(t,!this._pageVisibility.getIsHidden()),this._performance.clearMarks(r),this._performance.mark(r)}}getStart(e){if(this._validateStartEvent(e),this._performance.isAvailable()){var t=this._getEventKey(e),r="".concat(t,"-start");return this._getEventTimingByName(r)}}stop(e,t){if(this._validateStopEvent(e),this._performance.isAvailable()){var r=this._getApdexFields(e),n=this._getVisibilityFields(e);this._sendEvent(c(c(c({},e),r),n),t)}}onVisibilityChange(e){e||(this._wasPreviouslyHidden=!0,Array.from(this._isActiveEvents.keys()).forEach(e=>this._isActiveEvents.set(e,!1)))}}},35933:(e,t,r)=>{"use strict";r.d(t,{T:()=>n,q:()=>o});var n=function(e){return e.AWC_TLD_TEST="AWC_TLD_TEST",e.AWC_ANALYTICS_DEBUG="AWC_ANALYTICS_DEBUG",e.AJS_ANONYMOUS_ID="AJS_ANONYMOUS_ID",e}({});class i{constructor(e,t){this.key=e,this.options=t}getAttributes(){return this.options}getKey(){return this.key}}var s=()=>{try{return window&&window.location&&"https:"===window.location.protocol}catch(e){return!1}},o={[n.AWC_TLD_TEST]:new i("__awc_tld_test__",{expires:365,secure:s(),path:"/"}),[n.AWC_ANALYTICS_DEBUG]:new i("atlassian_analytics_debug",{expires:365,secure:s(),path:"/"}),[n.AJS_ANONYMOUS_ID]:new i("ajs_anonymous_id",{expires:365,secure:s(),path:"/"})}},806614:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(47169),i=r(649189),s=r.n(i),o=r(35933),a=r(219645),c=r(907672);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t{"use strict";r.d(t,{Z:()=>i});var n=r(93837);class i{constructor(){this.safeStorage=new n.Z({useStoragePrefix:!1})}set(e,t){return this.safeStorage.setItem(e,t),t}get(e){return this.safeStorage.getItem(e)||void 0}remove(e){this.safeStorage.removeItem(e)}}},907672:(e,t,r)=>{"use strict";r.d(t,{Xh:()=>c,mT:()=>u});var n=r(649189),i=r.n(n),s=r(802432),o=r.n(s),a=r(35933),c=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!e&&!("file:"===location.protocol||"chrome-extension:"===location.protocol)},l=a.q.AWC_TLD_TEST.getKey(),u=o()(()=>{if("undefined"==typeof location)return"";for(var{hostname:e}=location,t=e.split("."),r=1;r<=t.length;r++){var n=t.slice(-1*r),s=".".concat(n.join("."));if(i().set(l,"tld_test",{domain:s}),"tld_test"===i().get(l))return i().remove(l,{domain:s}),s}return e})},202056:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=(e,t)=>()=>{if((e=>"function"==typeof e)(e))try{return e()}catch(e){return void console.error("".concat(t," - ").concat(e instanceof Error?e.message:String(e)))}return e}},129489:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(175986),i=r(312779),s=r(711279),o=r(230059),a=(e,t)=>t===n.v;class c{constructor(e){if(this.featureEnabled=(0,s.fg)("analytics_cross_product_interaction_tracking"),this.urlValidation={result:!0,interactionSessionBlob:""},this.sendEventCallback=e,this.featureEnabled){var t,r,c,l=(0,o.Z)(a),u=n.v in l?l[n.v]:null;if(u)try{var d=JSON.parse(atob(u));d.bridge&&d.id&&d.source?(t=d.bridge,r=d.id,c=d.source):(this.urlValidation.result=!1,this.urlValidation.interactionSessionBlob=u)}catch(e){this.urlValidation.result=!1,this.urlValidation.interactionSessionBlob=u}var h={analyticsEventCallback:e,persistedSessionId:r};this.analyticsCrossProductInteractionClient=new i.ZP(h,t,c)}}getInteractionSession(){return this.featureEnabled&&this.analyticsCrossProductInteractionClient?{bridge:this.analyticsCrossProductInteractionClient.getBridge(),id:this.analyticsCrossProductInteractionClient.getCurrentInteractionSessionId(),prevId:this.analyticsCrossProductInteractionClient.getPreviousInteractionSessionId(),source:this.analyticsCrossProductInteractionClient.getInteractionSource()}:{bridge:null,id:null,prevId:null,source:null}}validateInteractionSession(){this.urlValidation.result||this.sendEventCallback({action:"corrupted",actionSubject:"interactionSession",attributes:{interactionSessionBlob:this.urlValidation.interactionSessionBlob},source:"interactionComponent",tags:["navigationExperiences"]})}}},369382:(e,t,r)=>{"use strict";r.d(t,{N:()=>s,P:()=>i});var n=r(966945),i=e=>e.embeddedType===n.bi.FIRST_PARTY&&void 0!==e.embeddedFromProduct,s=e=>e.embeddedType===n.bi.THIRD_PARTY&&void 0!==e.embeddedFromTopLevelDomain},136174:(e,t,r)=>{"use strict";r.d(t,{$Q:()=>P,_5:()=>E,pe:()=>O,rJ:()=>k,xU:()=>I});var n=r(47169),i=r(711279),s=r(966945),o=r(821140);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t0}function b(e,t){return _(t)?{[e]:t}:void 0}function w(e){if(_(e))return b("containers",function(e){var t={};return Object.keys(e).forEach(r=>{var n=e[r];t[r]={id:n.id,type:n.type}}),t}(e))}function E(e,t){return c({containerType:e.containerType,containerId:e.containerId,source:e.source,objectType:e.objectType,objectId:e.objectId,actionSubject:e.actionSubject,action:e.action,actionSubjectId:e.actionSubjectId,attributes:e.attributes,nonPrivacySafeAttributes:e.nonPrivacySafeAttributes,tags:e.tags,highPriority:e.highPriority,eventType:t},w(e.containers))}function I(e,t,r,n,i,o,a,m,_,E,I,O,S,C,k,P,T){var A=y(e),x=l(t),D=u(r),j=d(I),R=h(S),L={title:"",path:"",url:"",referrer:"",search:"",eventType:s.a7.SCREEN};return c(c(c(c(c(c(c(c(c(c(c(c(c({},A),x),D),j),L),function(e){return b("attributes",e)}(n)),function(e){return b("nonPrivacySafeAttributes",e)}(i)),w(k)),v(C)),{},{tags:o,tabId:a,sessionId:m,taskSessions:_},f(E)),{},{pageLoadId:O},R),g(P)),p(T))}function O(e){return"".concat(e.actionSubject," ").concat(e.action)}var S=function(e){return e.QUIET="quiet",e.STANDARD="standard",e.COMPLETE="complete",e}({});function C(e){var t=e.env;return void 0===t||t.includes("prod")?S.QUIET:S.COMPLETE}function k(e){var t=window.screen||{};return{context:{locale:e.locale,screen:{width:t.width,height:t.height,density:window.devicePixelRatio},library:{name:"analytics.js",version:"0.70.2"},validationMode:C(e)}}}function P(e,t,r,n,i,s,o,a,m,_,b,w,I,O){var S=y(e,function(e){var{env:t,product:r,subproduct:n,version:i,origin:s,platform:o}=e;return{env:t,product:r,subproduct:n,version:i,origin:s,platform:o}}(n)),C=l(t),k=d(_),P=h(w),T=u(r),A=E(n,i);return c(c(c(c(c(c(c(c(c(c({},S),C),k),T),A),v(n)),{},{tabId:s,sessionId:o,taskSessions:a},f(m)),{},{pageLoadId:b},P),g(I)),p(O))}},207280:(e,t,r)=>{"use strict";r.d(t,{B:()=>o});var n=r(47169),i=r(663100),s=r(126143);class o{constructor(e,t){if((0,n.Z)(this,"canCompress",e=>{try{return e&&(0,i.v7)(e.eventType)&&this.predicate(e)}catch(e){return!1}}),(0,n.Z)(this,"compress",e=>{var[t,r]=(0,s.uK)(e,e=>this.canCompress(e)),n=this.compressFn(t);if(!n)throw new Error("No events were returned from the compression function");return n.forEach(e=>{(0,i.WS)(e.eventType),(0,i.wC)(e)}),n.concat(r)}),"function"!=typeof e)throw new Error("Invalid predicate, must be a function that accepts an event and returns a boolean");if("function"!=typeof t)throw new Error("Invalid compressFn, must be a function that both accepts and returns an array of events");this.predicate=e,this.compressFn=t}}},156778:(e,t,r)=>{"use strict";r.d(t,{F:()=>n,L:()=>i});var n=1e4,i=3e4},150303:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(47169),i=r(136174),s=r(126143),o=r(207280);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];if((0,n.Z)(this,"canCompress",e=>this.compressionRules.some(t=>t.canCompress(e))),(0,n.Z)(this,"compress",e=>this.createGroups(e).reduce((e,t)=>{var r=this.compressGroup(t);return e.concat(r)},[])),(0,n.Z)(this,"createGroups",e=>e.reduce((e,t)=>{var r,n=this.compressionRules.find(e=>e.canCompress(t));if(n){var o=(0,i._5)(t,t.eventType);r=(0,s.CE)(t,Object.keys(o))}var a=e.find(e=>n===e.compressor&&(0,s.fS)(r,e.contextFields));return a?a.events.push(t):e.push({contextFields:r,compressor:n,events:[t]}),e},[])),(0,n.Z)(this,"compressGroup",e=>{if(!e.compressor)return e.events;try{return e.compressor.compress(e.events).map(t=>c(c({},t),e.contextFields))}catch(t){return e.events}}),!Array.isArray(e))throw new Error("Event compressors must be constructed with an array of CompressionRules");if(!e.every(e=>e instanceof o.B))throw new Error("Event compressors can only be constructed with instances of CompressionRule");this.compressionRules=e}}},122431:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(47169),i=r(156778),s=r(754409),o=r(667454);class a{constructor(e,t){var r=this;(0,n.Z)(this,"push",(e,t,r,n)=>{this.delayQueue.push(e,t,r,n)}),(0,n.Z)(this,"startLowPriorityEventDelay",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.F,t=arguments.length>1?arguments[1]:void 0;if(Number.isNaN(e)||e<=0)throw new Error("Invalid timeout period: ".concat(e,", must be a number greater than 0"));r.delayTimeout&&clearTimeout(r.delayTimeout);var n=e?Math.min(e,i.L):i.L;r.delayCallback=t,r.delayTimeout=setTimeout(()=>r.stopLowPriorityEventDelay(o.e.TIMEOUT),n),r.delayQueue.cancelFlush(),r.isDelaying=!0})),(0,n.Z)(this,"stopLowPriorityEventDelay",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.e.MANUAL;r.delayTimeout&&(clearTimeout(r.delayTimeout),r.delayTimeout=void 0),r.delayQueue.startFlush(),r.isDelaying=!1,null===(e=r.delayCallback)||void 0===e||e.call(r,t),r.delayCallback=void 0})),(0,n.Z)(this,"isDelayingLowPriorityEvents",()=>this.isDelaying),this.isDelaying=!1,this.delayQueue=new s.Z(e,t)}}},754409:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(47169),i=r(136174),s=r(126143),o=r(150303);class a{constructor(e,t){(0,n.Z)(this,"push",(e,t,r,n)=>{this.eventArgs.push({identifier:e,builtEvent:t,context:r,userInfo:n})}),(0,n.Z)(this,"size",()=>this.eventArgs.length),(0,n.Z)(this,"startFlush",()=>{try{this.eventArgs=this.compressEventArgs(this.eventArgs)}catch(e){console.warn("Failed to perform compression on the delayed analytics events. "+"Error: ".concat(e.message,". Sending ").concat(this.eventArgs.length," uncompressed events instead"))}this.flushNextBatch()}),(0,n.Z)(this,"cancelFlush",()=>{this.flushBatchTimeout&&(clearTimeout(this.flushBatchTimeout),this.flushBatchTimeout=null)}),(0,n.Z)(this,"flushNextBatch",()=>{this.eventArgs.splice(0,7).forEach(e=>this.processFn(e.identifier,e.builtEvent,e.context,e.userInfo)),this.eventArgs.length>0?this.flushBatchTimeout=setTimeout(()=>this.flushNextBatch(),100):this.flushBatchTimeout=null}),(0,n.Z)(this,"compressEventArgs",e=>{var[t,r]=(0,s.uK)(e,e=>this.compressor.canCompress(e.builtEvent)),n=t.reduce((e,t)=>{var r=e.find(e=>(0,s.fS)(e.userInfo,t.userInfo)&&(0,s.fS)(e.context,t.context));return r?r.eventArgs.push(t):e.push({userInfo:t.userInfo,context:t.context,eventArgs:[t]}),e},[]).reduce((e,t)=>{try{var r=t.eventArgs.map(e=>e.builtEvent),n=this.compressor.compress(r).map(e=>({identifier:(0,i.pe)(e),builtEvent:e,userInfo:t.userInfo,context:t.context}));return e.concat(n)}catch(e){return console.warn("Failed to compress some analytics events. "+"Error: ".concat(e.message,". Sending ").concat(t.eventArgs.length," uncompressed events instead")),t.eventArgs}},[]);return r.forEach(e=>n.push(e)),n}),this.processFn=e,this.flushBatchTimeout=null,this.eventArgs=[],this.compressor=new o.Z(t)}}},667454:(e,t,r)=>{"use strict";r.d(t,{e:()=>n});var n=function(e){return e.TIMEOUT="timeout",e.MANUAL="manual",e}({})},663100:(e,t,r)=>{"use strict";r.d(t,{AE:()=>g,Ct:()=>v,M0:()=>h,OW:()=>o,TE:()=>d,WS:()=>c,iO:()=>u,v7:()=>a,wC:()=>l,wT:()=>p});var n=r(966945),i=r(821140),s=Object.freeze([n.a7.OPERATIONAL,n.a7.TRACK,n.a7.UI]);function o(e){if(e){if(e&&e.constructor!==Object)throw new Error("properties.containers must be an Object");Object.values(e).forEach(e=>function(e){if(!(0,i.P)(e))throw new Error("properties.containers must be an Object");if(!("id"in e))throw new Error("properties.containers is missing field 'id'");if("string"!=typeof e.id)throw new Error("properties.containers.id must be of type String");if("type"in e&&"string"!=typeof e.type)throw new Error("properties.containers.type must be of type String")}(e))}}function a(e){switch(e){case n.a7.OPERATIONAL:case n.a7.TRACK:case n.a7.UI:return!0;default:return!1}}function c(e){if(!a(e))throw new Error("Invalid action event type: ".concat(e,", must be one of: [").concat(s,"]"));return!0}function l(e){if(!e)throw new Error("Missing event");if(!e.source)throw new Error("Missing event.source");if(!e.actionSubject)throw new Error("Missing event.actionSubject");if(!e.action)throw new Error("Missing event.action");o(e.containers)}function u(e){if(!e)throw new Error("Missing name")}function d(e){l(e)}function h(e){l(e)}function g(e){l(e)}function p(e,t){if(!e)throw new Error("Missing userIdType");if(!t)throw new Error("Missing userId");if(!(0,n.P9)(n.AW,e))throw new Error("Invalid userIdType '".concat(e,"', ")+"must be an userType: [".concat((0,n.TT)(n.AW),"]"))}function v(e){if(!(0,n.P9)(n.qZ,e.platform))throw new Error("Invalid productInfo.platform '".concat(e.platform,"', ")+"must be a platformType: [".concat((0,n.TT)(n.qZ),"]"));if(e.origin===n.mO.DESKTOP&&!(0,n.P9)(n.Nw,e.platform))throw new Error("Invalid productInfo.platform '".concat(e.platform,"', ")+"must be one of [mac, linux, windows]");if(e.origin===n.mO.WEB&&!(0,n.P9)(n.uB,e.platform))throw new Error("Invalid productInfo.platform '".concat(e.platform,"', must be one of [web, mobileWeb]"))}},509541:(e,t,r)=>{"use strict";r.d(t,{M:()=>n});var n=()=>"undefined"!=typeof document?document:null},65570:(e,t,r)=>{"use strict";r.d(t,{q:()=>n});var n=new Map([[200,"OK"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Timeout"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Payload Too Large"],[414,"URI Too Long"],[415,"Unsupported Media Type"],[416,"Requested range not satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Timeout"],[505,"HTTP Version not supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[508,"Loop Detected"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"],[-1,"Unknown Status"]])},197167:(e,t,r)=>{"use strict";r.d(t,{FH:()=>s,Gm:()=>n,sq:()=>i,vA:()=>o});var n=1e4,i=6e4,s=6e5,o=10},32794:(e,t,r)=>{"use strict";r.d(t,{Z:()=>b});var n=r(718950),i=r(47169),s=r(531472),o=r(467800),a=r(202136),c=r(197167),l=r(65570),u=r(141533),d=r(360229),h=r(532645),g=r(229815);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t(e.msg.sentAt=c,e.msg)),sentAt:c,metadata:p};try{var m=yield(0,u.p)({url:h,batch:f,timeout:r.options.requestTimeout});r.lastSendEventsError=null,r.lastUrlFallbackError=null,r.metrics.subtractFromMetrics(o),t(null,m),yield r.invokeLocalResponseCallbackAsync(e,m,null)}catch(n){if(n instanceof d.kp&&[429,503].includes(n.statusCode))r.lastSendEventsError=new d.Nn("ServerBusyError",n);else{var y=n instanceof Error&&d.kd.includes(n.name)?n.name:"Unknown";r.lastSendEventsError=new d.Nn(y,n),r.useUrlFromMetadata=!1;var[_,b]=r.getEventUrl(l);b&&b!==g&&(r.lastUrlFallbackError=r.lastSendEventsError)}t(n,null),yield r.invokeLocalResponseCallbackAsync(e,null,n)}}}));return function(t,r){return e.apply(this,arguments)}}()),this.options=v(v({},e),{},{requestTimeout:e.requestTimeout||c.Gm,retryQueueOptions:e.retryQueueOptions||{},logger:e.logger||console,disableCookiePersistence:e.disableCookiePersistence||!1,env:e.env,perimeter:e.perimeter||"",enableMetadataCalls:"boolean"!=typeof e.enableMetadataCalls||e.enableMetadataCalls,enableEventCalls:"boolean"!=typeof e.enableEventCalls||e.enableEventCalls}),this.user=new h.Z(null===(t=this.options)||void 0===t?void 0:t.disableCookiePersistence),this.xidPromiseCallback=e.xidPromiseGetter(),this.gasv3BatchUrl="".concat(e.apiHostProtocol,"://").concat(e.apiHost,"/batch"),this.metrics=(0,o.Z)(),this.responseCallback=e.responseCallback,this.resilienceQueue=(0,s.Z)(e.retryQueuePrefix,e.product,this.options.retryQueueOptions,this.options.logger),this.metadataClient=e.metadataClient,this.useUrlFromMetadata=!0,this.lastSendEventsError=null,this.lastUrlFallbackError=null,setInterval(()=>{this.useUrlFromMetadata=!0},6e5),this.resilienceQueue.start(this.sendEvents)}getUser(){return this.user}track(e,t,r,i){var s=this;return(0,n.Z)((function*(){var n=v(v({},s.buildBaseEvent(r,d.$q.TRACK,t)),{},{type:d.$q.TRACK,properties:(0,g.G)(t),event:e}),o=v(v({},n),{},{messageId:s.createMessageId()}),a=s.packageEvent(o);yield s.enqueueEvent(a),i&&i()}))()}page(e,t,r,i){var s=this;return(0,n.Z)((function*(){var n=v(v({},s.buildBaseEvent(r,d.$q.PAGE,t)),{},{type:d.$q.PAGE,properties:(0,g.G)(t),name:e}),o=v(v({},n),{},{messageId:s.createMessageId()}),a=s.packageEvent(o);yield s.enqueueEvent(a),i&&i()}))()}identify(e,t,r,i){var s=this;return(0,n.Z)((function*(){var e=v(v({},s.buildBaseEvent(r,d.$q.IDENTIFY,t)),{},{type:d.$q.IDENTIFY,traits:(0,g.G)(t)}),n=v(v({},e),{},{messageId:s.createMessageId()}),o=s.packageEvent(n);yield s.enqueueEvent(o),i&&i()}))()}enqueueEvent(e){var t=this;return(0,n.Z)((function*(){t.options.enableMetadataCalls&&t.metadataClient.start(!1),yield t.resilienceQueue.addItem(e)}))()}buildBaseEvent(e,t,r){var n=(0,g.G)(e);return{context:(0,g.r)(n),timestamp:(new Date).toISOString(),type:t,userId:this.user.getUserId(),anonymousId:r.anonymousId||this.user.getAnonymousId()}}createMessageId(){return"ajs-".concat(crypto.randomUUID())}packageEvent(e){var{apiHost:t,apiHostProtocol:r}=this.options;return{headers:{"Content-Type":"text/plain"},msg:e,url:"".concat(r,"://").concat(t,"/").concat(e.type.charAt(0))}}getEventUrl(e){var t=null!=e&&e.url?e.url:this.gasv3BatchUrl,r=this.useUrlFromMetadata?t:this.gasv3BatchUrl;return[r,t===this.gasv3BatchUrl?null:r!==t]}cleanLibraryMetadata(e){if(null!==e&&"object"==typeof e)for(var t in e)if("props"!==t){var r=e[t];null==r||"number"==typeof r&&0===r?delete e[t]:Array.isArray(r)?0===r.length?delete e[t]:r.forEach(e=>{this.cleanLibraryMetadata(e)}):"object"==typeof r&&this.cleanLibraryMetadata(e[t])}}invokeLocalResponseCallbackAsync(e,t,r){var i=this;return(0,n.Z)((function*(){var n=i.responseCallback;if(n){var s=null;if(t){var o,a;try{a=yield t.clone().json()}catch(e){}(a=a||{}).code=Number.parseInt(a.code)>0?Number.parseInt(a.code):t.status,a.success=a.success||a.code>=200&&a.code<=299,s=new f(a.success,a.validationErrors||new Map,new m((null===(o=a.message)||void 0===o?void 0:o.error)||""),a.code,a.validationReports||null)}!r||r instanceof Error||(r=new Error(String(r))),n(w.toAnalyticsResponse(e||[],r||null,s))}}))()}attachXIDs(e){var t=this;return(0,n.Z)((function*(){return t.xidPromiseCallback?(0,a.e)(e,t.xidPromiseCallback):Promise.resolve(e)}))()}setResponseCallback(e){this.responseCallback=e}refreshMetadata(e,t){this.metadataClient.userInfo=e,this.metadataClient.tenantInfo=t}}class w{static toAnalyticsResponse(e,t,r){var n=[];if(null!==r){var i,[s,o]=[r.code,r.success];if(s>=200&&s<=299)return null===(i=r.validationReports)||void 0===i||i.forEach(t=>{var r=e.find(e=>e.msg.messageId===t.messageId);r&&n.push(new _(r.msg.messageId,t.results,r.msg))}),new y(o,s,l.q.get(s),n);if(s>=400&&s<=499){var a,c=null!==(null===(a=r.message)||void 0===a?void 0:a.error)?r.message.error:l.q.has(s)?l.q.get(s):l.q.get(-1);return e.forEach(e=>{n.push(new _(e.msg.messageId,[],e.msg))}),new y(o,s,c,n)}}else if(null!=t&&t.message){var u=t.message.match(w.http_error_regex);if(u)return e.forEach(e=>{n.push(new _(e.msg.messageId,[],e.msg))}),new y(!1,Number(u[1]),u[2],n)}return e.forEach(e=>{n.push(new _(e.msg.messageId,[],e.msg))}),new y(!1,-1,l.q.get(-1),n)}}(0,i.Z)(w,"http_error_regex",/HTTP Error\s([0-9]{3})\s\((.+)\)/)},54666:(e,t,r)=>{"use strict";r.d(t,{e:()=>l});var n=r(47169),i=r(718950),s=r(802432),o=r.n(s),a=r(360229);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var l=function(){var e=(0,i.Z)((function*(e,t,r,i){var s,o,l,h,g=u(r,i),p=d(e),v=e+"?"+new URLSearchParams({product:"".concat(t.product),userId:"".concat((null===(s=t.userInfo)||void 0===s?void 0:s.userId)||""),userIdType:"".concat((null===(o=t.userInfo)||void 0===o?void 0:o.userIdType)||""),tenantId:"".concat((null===(l=t.tenantInfo)||void 0===l?void 0:l.tenantId)||""),tenantIdType:"".concat((null===(h=t.tenantInfo)||void 0===h?void 0:h.tenantIdType)||"")}).toString(),f=yield fetch(v,function(e){for(var t=1;t{var r=new AbortController;return setTimeout(()=>{r.abort()},e||3e4),null==t||t.addEventListener("abort",()=>{r.abort()}),r},d=o()(e=>new URL(e).origin===location.origin?{}:{mode:"cors",credentials:"include"})},213918:(e,t,r)=>{"use strict";r.d(t,{z:()=>y});var n,i=r(718950),s=r(47169),o=r(476542),a=r(217555),c=r(491164),l=r(197047),u=r(74552),d=r(183781),h=r(36536),g=r(197167),p=r(54666),v=r(360229);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t{this._scheduler.schedule({immediate:!0})},y.INITIAL_REFRESH_DELAY))}stop(){var e;this._isEnabled&&(this._hasBeenStopped=!0,this._isEnabled=!1,this.stopNetworkStatusMonitor(),this._scheduler.stop(),null===(e=this._fetchAbortController)||void 0===e||e.abort(),this.resetPropertyChangeRefresh())}startNetworkStatusMonitor(){this._networkStatus||(this._networkStatus=new o.Z(e=>{e===u.y.OFFLINE?this._scheduler.stop():this._isEnabled&&this._scheduler.schedule({immediate:null===this._metadataInfo})}))}stopNetworkStatusMonitor(){this._networkStatus&&(this._networkStatus.removeListeners(),this._networkStatus=null)}refreshMetadataAsync(){var e=this;return(0,i.Z)((function*(){var t;if(h.Q.areFetchCallsDisabled()||!e._isEnabled)return Promise.resolve();null===(t=e._fetchAbortController)||void 0===t||t.abort(),e._fetchAbortController=new AbortController;var r=e._fetchAbortController.signal;e._lastFetchRequestCount=e._scheduler.getFailureCount(),yield(0,p.e)(e._url,{product:e._product,userInfo:e._userInfo,tenantInfo:e._tenantInfo},g.sq,r).then(function(){var t=(0,i.Z)((function*(t){var r=yield t.json();e._metadataInfo=v.CC.fromJson(r),e._lastFetchRequestCount++,e._requestStatus="FETCHED",e._lastErrorReason=null}));return function(e){return t.apply(this,arguments)}}()).catch(t=>{if(!r.aborted)throw e._requestStatus="FAILED",t instanceof v.kp&&[429,503].includes(t.statusCode)?e._lastErrorReason="ServerBusyError":e._lastErrorReason=t instanceof Error&&v.kd.includes(t.name)?t.name:"Unknown",t})}))()}getMetadataAsync(){return Promise.resolve(this._metadataInfo)}get status(){return this._requestStatus}get lastErrorReason(){return this._lastErrorReason}get lastFetchRequestCount(){return this._lastFetchRequestCount}get userInfo(){return this._userInfo}set userInfo(e){var t,r;(null===(t=this._userInfo)||void 0===t?void 0:t.userId)===(null==e?void 0:e.userId)&&(null===(r=this._userInfo)||void 0===r?void 0:r.userIdType)===(null==e?void 0:e.userIdType)||(this._userInfo=e,this.schedulePropertyChangeRefresh())}get tenantInfo(){return this._tenantInfo}set tenantInfo(e){var t,r;(null===(t=this._tenantInfo)||void 0===t?void 0:t.tenantId)===(null==e?void 0:e.tenantId)&&(null===(r=this._tenantInfo)||void 0===r?void 0:r.tenantIdType)===(null==e?void 0:e.tenantIdType)||(this._tenantInfo=e,this.schedulePropertyChangeRefresh())}get metrics(){return{host:this._metadataHost,status:this.status,lastErrorReason:this.lastErrorReason,lastRefreshRequestCount:this.lastFetchRequestCount}}scheduleCallback(e){var t=this;return(0,i.Z)((function*(){var r;if((null===(r=t._networkStatus)||void 0===r?void 0:r.getNetworkStatus())!==u.y.OFFLINE)try{yield t.refreshMetadataAsync(),e(l.h.SUCCESS),t._scheduler.schedule()}catch(t){e(l.h.ERROR)}else e(l.h.NOOP)}))()}schedulePropertyChangeRefresh(){this._isEnabled&&(this.resetPropertyChangeRefresh(),this._propertyChangeRefreshTimeout=setTimeout(()=>{this.resetPropertyChangeRefresh(),this._scheduler.schedule({immediate:!0})},g.vA))}resetPropertyChangeRefresh(){this._propertyChangeRefreshTimeout&&(clearTimeout(this._propertyChangeRefreshTimeout),this._propertyChangeRefreshTimeout=null)}buildOptions(e){return{backoffFactor:(null==e?void 0:e.backoffFactor)||a.A.backoffFactor,backoffJitterPercentage:void 0!==(null==e?void 0:e.backoffJitterPercentage)?e.backoffJitterPercentage:a.A.backoffJitterPercentage,batchFlushSize:(null==e?void 0:e.batchFlushSize)||a.A.batchFlushSize,flushBeforeUnload:(null==e?void 0:e.flushBeforeUnload)||a.A.flushBeforeUnload,flushWaitMs:(null==e?void 0:e.flushWaitMs)||a.A.flushWaitMs,maxItems:(null==e?void 0:e.maxItems)||a.A.maxItems,maxAttempts:(null==e?void 0:e.maxAttempts)||a.A.maxAttempts,maxRetryDelay:(null==e?void 0:e.maxRetryDelay)||a.A.maxRetryDelay,minRetryDelay:(null==e?void 0:e.minRetryDelay)||a.A.minRetryDelay}}}n=y,(0,s.Z)(y,"INITIAL_REFRESH_DELAY",1),(0,s.Z)(y,"Factory",(e,t,r)=>new n(e,t,r))},141533:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var n=r(47169),i=r(718950),s=r(802432),o=r.n(s),a=r(360229);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var l=function(){var e=(0,i.Z)((function*(e){var t,r=null===(t=u(e))||void 0===t?void 0:t.signal,i=d(e.url),s=yield fetch(e.url,function(e){for(var t=1;t=500&&s.status<600)throw new a.kp("HTTP Error ".concat(s.status," (").concat(s.statusText,")"),s.status,s.statusText);return s}));return function(t){return e.apply(this,arguments)}}(),u=e=>{if(e.abortController)return e.abortController;if(e.timeout){var t=new AbortController;return setTimeout(()=>{t.abort()},e.timeout),t}},d=o()(e=>new URL(e).origin===location.origin?{}:{mode:"cors",credentials:"include"})},360229:(e,t,r)=>{"use strict";r.d(t,{$q:()=>i,CC:()=>s,Nn:()=>n,kd:()=>a,kp:()=>o});class n{constructor(e,t){this.reason=e,this.message=t instanceof Error?t.message:null,this.statusCode=t instanceof o?t.statusCode:null}}var i=function(e){return e.IDENTIFY="identify",e.PAGE="page",e.TRACK="track",e}({});class s{constructor(e,t){this.props=e,this.url=t}static fromJson(e){var t,r="string"==typeof(t=null==e?void 0:e.url)||t instanceof String?e.url.trim():"";return new s((null==e?void 0:e.props)||null,r.startsWith("http")?r:null)}}class o extends Error{constructor(e,t,r){super(e),this.statusCode=t,this.statusText=r}}var a=["FetchError","AbortError","TypeError"]},532645:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(755001),i=r(806614),s=r(35933),o=r(93837);class a{constructor(e){this.store=new o.Z({useStoragePrefix:!1}),this.cookie=new i.Z(e)}getUserId(){return this.userId||null}setUserId(e){this.userId=e}getAnonymousId(e){return this.getAnonymousIdFromLocalStorageAndUpdateCookieIfStale()||this.getAnonymousIdFromCookieAndUpdateLocalStorage()||this.generateNewAnonymousId(e)}setAnonymousId(e){var t=JSON.stringify(e);return this.cookie.set(s.T.AJS_ANONYMOUS_ID,t),this.lastAnonymousIdCookieUpdate=Date.now(),this.store.setItem(s.q.AJS_ANONYMOUS_ID.getKey(),t)}getAnonymousIdFromStorage(e){var t="LOCAL_STORAGE"===e?this.store.getItem(s.q.AJS_ANONYMOUS_ID.getKey()):this.cookie.get(s.T.AJS_ANONYMOUS_ID);if(t){var r={type:"UNSAFE",anonymousId:t};try{var n=JSON.parse(t);return n&&"string"==typeof n?{type:"SAFE",anonymousId:n}:r}catch(e){return r}}return{type:"NOT_FOUND"}}getAnonymousIdFromLocalStorageAndUpdateCookieIfStale(){var e=this.getAnonymousIdFromStorage("LOCAL_STORAGE"),t=!1;switch((!this.lastAnonymousIdCookieUpdate||(0,n.Z)(new Date,new Date(this.lastAnonymousIdCookieUpdate))>=7)&&(t=!0),e.type){case"SAFE":return t&&this.setAnonymousId(e.anonymousId),e.anonymousId;case"UNSAFE":return e.anonymousId;case"NOT_FOUND":default:return null}}getAnonymousIdFromCookieAndUpdateLocalStorage(){var e=this.getAnonymousIdFromStorage("COOKIE");switch(e.type){case"SAFE":case"UNSAFE":return this.store.setItem(s.q.AJS_ANONYMOUS_ID.getKey(),JSON.stringify(e.anonymousId)),e.anonymousId;case"NOT_FOUND":default:return null}}generateNewAnonymousId(e){var t=("function"==typeof e?e:()=>crypto.randomUUID())();return this.setAnonymousId(t),t}}},229815:(e,t,r)=>{"use strict";r.d(t,{G:()=>l,r:()=>c});var n=r(47169),i=r(251305),s=r.n(i);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;ta(a({},e.context),{},{userAgent:navigator.userAgent}),l=e=>{var t=u(e,"$.properties");return s()(t)},u=(e,t)=>{var r=(e,t,n,i)=>{if(null===e||"object"!=typeof e)return e;if(i>512)return{_depthLimitExceeded:!0,message:"Object nesting depth limit exceeded at path '".concat(n,"' with depth '").concat(i,"'")};if(t.has(e)){var s=t.get(e);return{_circularReference:!0,message:"Circular reference to object at original path '".concat(s,"' detected at path '").concat(n,"'"),originalPath:s}}t.set(e,n);var o={};return Object.keys(e).forEach(s=>{var a=e[s];if(void 0!==a)if(Array.isArray(a)){var c=[];a.forEach((e,o)=>{var a=r(e,t,"".concat(n,".").concat(s,"[").concat(o,"]"),i+1);void 0!==a&&c.push(a)}),o[s]=c}else{var l=r(a,t,"".concat(n,".").concat(s),i+1);void 0!==l&&(o[s]=l)}}),t.delete(e),o};return r(e,new Map,t,0)}},276997:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(31512),i=r(628599),s=Object.values(n.i);const o=e=>{if("string"!=typeof e||0===e.length)return 0;try{var t=Object.keys(localStorage).filter(t=>t&&t.startsWith("".concat(e,"."))||!1).map(e=>e.split(".")).filter(e=>3===e.length&&s.includes(e[2])).reduce((e,t)=>{var[,r,n]=t;return void 0===e[r]&&(e[r]={}),e[r][n]=!0,e},{}),r=Object.keys(t).filter(e=>!0!==t[e][n.i.ACK]);return r.forEach(t=>{var{queue:r,inProgress:n,reclaimStart:s,reclaimEnd:o}=(0,i._)(e,t);localStorage.removeItem(n),localStorage.removeItem(r),localStorage.removeItem(s),localStorage.removeItem(o)}),r.length}catch(e){}return 0}},155458:(e,t,r)=>{"use strict";r.d(t,{Z:()=>g});var n=r(47169),i=r(718950),s=r(31512),o=r(628599);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;tnew Promise(t=>{setTimeout(t,e)}),u=function(){var e=(0,i.Z)((function*(e,t){var{ack:r,reclaimStart:n,reclaimEnd:i}=e.storageKeys,o=Date.now();if(localStorage.setItem(n,e.reclaimProcessId),localStorage.setItem(r,o.toString()),yield l(s._.RECLAIM_WAIT),Date.now()>o+s._.RECLAIM_WAIT_THRESHOLD||localStorage.getItem(n)!==e.reclaimProcessId)throw new Error("Took to long to callback, reclaim abandonded. After reclaimStart.");if(localStorage.setItem(i,e.reclaimProcessId),yield l(s._.RECLAIM_WAIT),Date.now()>o+s._.RECLAIM_WAIT_THRESHOLD||localStorage.getItem(n)!==e.reclaimProcessId||localStorage.getItem(i)!==e.reclaimProcessId)throw new Error("Took to long to callback, reclaim abandonded. After reclaimEnd.");return d(e,t)}));return function(t,r){return e.apply(this,arguments)}}(),d=function(){var e=(0,i.Z)((function*(e,t){var{queue:r,inProgress:n}=e.storageKeys,i=JSON.parse(localStorage.getItem(r)||"[]"),s=JSON.parse(localStorage.getItem(n)||"{}"),o=[...i,...Object.entries(s).map(e=>{var[t,r]=e;return c(c({},r),{},{attemptNumber:r.attemptNumber+1,id:t})})];if(o.length>0){var a=yield t(o);if("successful"===a.status)h(e.storageKeys);else if("partial"===a.status){var l=o.filter(e=>!a.acceptedItemIds.includes(e.id));return localStorage.removeItem(n),localStorage.setItem(r,JSON.stringify(l)),{fullReclaim:!1}}}else h(e.storageKeys);return{fullReclaim:!0}}));return function(t,r){return e.apply(this,arguments)}}(),h=e=>{localStorage.removeItem(e.queue),localStorage.removeItem(e.inProgress),localStorage.removeItem(e.reclaimEnd),localStorage.removeItem(e.reclaimStart),localStorage.removeItem(e.ack)};const g=function(){var e=(0,i.Z)((function*(e,t){if("string"!=typeof e||0===e.length)return{fullReclaims:0,partialReclaims:0,failedReclaims:0};var r=crypto.randomUUID(),n=(e=>{try{return Object.keys(localStorage).filter(t=>t.startsWith(e)).map(e=>e.split(".")).filter(t=>{if(3===t.length&&t[0]===e&&t[2]===s.i.ACK)try{var r=localStorage.getItem(t.join("."));if(r){var n=parseInt(r);return s._.RECLAIM_TIMEOUT+ne[1])}catch(e){}return[]})(e).map(n=>u({queuePrefix:e,reclaimProcessId:r,storageKeys:(0,o._)(e,n)},t)),i=yield Promise.allSettled(n),a=i.filter(e=>"rejected"===e.status),c=i.filter(e=>"fulfilled"===e.status).map(e=>e.value),l=c.filter(e=>e.fullReclaim),d=c.filter(e=>!e.fullReclaim);return{failedReclaims:a.length,partialReclaims:d.length,fullReclaims:l.length}}));return function(t,r){return e.apply(this,arguments)}}()},31512:(e,t,r)=>{"use strict";r.d(t,{_:()=>i,i:()=>n});var n=function(e){return e.IN_PROGRESS="inProgress",e.QUEUE="queue",e.RECLAIM_START="reclaimStart",e.RECLAIM_END="reclaimEnd",e.ACK="ack",e}({}),i=function(e){return e[e.RECLAIM_TIMEOUT=1e4]="RECLAIM_TIMEOUT",e[e.RECLAIM_WAIT=500]="RECLAIM_WAIT",e[e.RECLAIM_WAIT_THRESHOLD=2e3]="RECLAIM_WAIT_THRESHOLD",e}({})},628599:(e,t,r)=>{"use strict";r.d(t,{_:()=>i});var n=r(31512),i=(e,t)=>({[n.i.ACK]:"".concat(e,".").concat(t,".").concat(n.i.ACK),[n.i.QUEUE]:"".concat(e,".").concat(t,".").concat(n.i.QUEUE),[n.i.IN_PROGRESS]:"".concat(e,".").concat(t,".").concat(n.i.IN_PROGRESS),[n.i.RECLAIM_START]:"".concat(e,".").concat(t,".").concat(n.i.RECLAIM_START),[n.i.RECLAIM_END]:"".concat(e,".").concat(t,".").concat(n.i.RECLAIM_END)})},126143:(e,t,r)=>{"use strict";r.d(t,{CE:()=>a,Cw:()=>n,D9:()=>o,GM:()=>s,ei:()=>i,fS:()=>c,uK:()=>l});var n=(e,t)=>Object.keys(e).reduce((r,n)=>(r[t(e[n],n,e)]=e[n],r),{}),i=(e,t)=>t.reduce((t,r)=>(r in e&&(t[r]=e[r]),t),{}),s=(e,t)=>Object.keys(e).filter(r=>!t(e[r],r)).reduce((t,r)=>(t[r]=e[r],t),{}),o=(e,t)=>Object.keys(e).filter(r=>t(e[r],r)).reduce((t,r)=>(t[r]=e[r],t),{}),a=(e,t)=>Object.keys(e).filter(e=>t.indexOf(e)<0).reduce((t,r)=>(t[r]=e[r],t),{}),c=(e,t)=>{if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(!e||!t||"object"!=typeof e&&"object"!=typeof t)return e===t;if(e.prototype!==t.prototype)return!1;var r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>c(e[r],t[r]))},l=(e,t)=>e.reduce((e,r,n,i)=>(e[t(r,n,i)?0:1].push(r),e),[[],[]])},784377:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(47169),i=r(966945),s=r(230059);class o{constructor(){(0,n.Z)(this,"handleOriginParameters",(e,t)=>{var r=Object.keys(e);if(!(r.length>0))throw new Error("Empty parameter mapping provided");var n=r.filter(e=>Object.values(i.W5).indexOf(e)<0);if(n.length>0)throw new Error("Invalid Origin Tracing Parameter(s) supplied: ".concat(n.join(),"!"));var o=(0,s.Z)((e,t)=>r.indexOf(t)>=0,t);return Object.keys(o).map(t=>({[t]:e[t](o[t])})).reduce((e,t)=>Object.assign(e,t),{})}),this._originStore={}}}},510669:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(47169);class i{constructor(){(0,n.Z)(this,"_bindEventListeners",()=>{document.addEventListener(this._visibilityChange,this._handleVisibilityChange,!1)}),(0,n.Z)(this,"_handleVisibilityChange",()=>{var e=document[this._hidden];this._isHidden=e,this._callbacks.forEach(t=>t(e))}),this._isHidden=!1,this._callbacks=new Map,this._hidden=void 0,this._visibilityChange=void 0,"undefined"!=typeof document&&(void 0!==document.hidden?(this._isHidden=document.hidden,this._hidden="hidden",this._visibilityChange="visibilitychange"):void 0!==document.msHidden?(this._isHidden=document.msHidden,this._hidden="msHidden",this._visibilityChange="msvisibilitychange"):void 0!==document.webkitHidden&&(this._isHidden=document.webkitHidden,this._hidden="webkitHidden",this._visibilityChange="webkitvisibilitychange"),void 0!==document.addEventListener&&void 0!==this._hidden&&this._bindEventListeners())}addCallback(e,t){if("string"!=typeof e)throw new Error("Invalid name, must be string");if("function"!=typeof t)throw new Error("Invalid callback, must be function");this._callbacks.set(e,t)}removeCallback(e){this._callbacks.has(e)&&this._callbacks.delete(e)}getIsHidden(){return this._isHidden}}},145105:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(){this._performance=window.performance}clearMarks(){this._performance&&this._performance.clearMarks&&this._performance.clearMarks(...arguments)}mark(){this._performance&&this._performance.mark&&this._performance.mark(...arguments)}getEntriesByName(){return this._performance&&this._performance.getEntriesByName?this._performance.getEntriesByName(...arguments):[]}getTimeOrigin(){return this._performance&&(this._performance.timeOrigin||this._performance.timing)?this._performance.timeOrigin||this._performance.timing.navigationStart:0}now(){return this._performance&&this._performance.now?this._performance.now():Date.now?Date.now():+new Date}isAvailable(){return!!(this._performance&&this._performance.clearMarks&&this._performance.mark&&this._performance.getEntriesByName&&this._performance.timing)}}},467800:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(47169),i=r(74552);class s{constructor(){(0,n.Z)(this,"itemsDiscardedByRetry",0),(0,n.Z)(this,"eventCount",0),(0,n.Z)(this,"itemsDiscardedByOverflow",0),(0,n.Z)(this,"resilienceMechanism",i.b.INDEXEDDB),(0,n.Z)(this,"localstorageNumberOfQueuesPurged",0),(0,n.Z)(this,"localstorageNumberOfFullReclaims",0),(0,n.Z)(this,"localstorageNumberOfPartialReclaims",0),(0,n.Z)(this,"localstorageNumberOfFailedReclaims",0)}addToItemsDiscardedByRetryCounter(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.itemsDiscardedByRetry+=e}addToEventCount(){this.eventCount++}addToItemsDiscardedByOverflowCounter(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.itemsDiscardedByOverflow+=e}setResilienceMechanism(e){this.resilienceMechanism=e}addToReclaimMetrics(e){this.localstorageNumberOfFullReclaims+=e.fullReclaims,this.localstorageNumberOfPartialReclaims+=e.partialReclaims,this.localstorageNumberOfFailedReclaims+=e.failedReclaims}addToPurgedQueuesMetrics(e){this.localstorageNumberOfQueuesPurged+=e}subtractFromMetrics(e){this.itemsDiscardedByRetry=this.subtractFromCount(this.itemsDiscardedByRetry,e.itemsDiscardedByRetry),this.eventCount=this.subtractFromCount(this.eventCount,e.eventCount),this.itemsDiscardedByOverflow=this.subtractFromCount(this.itemsDiscardedByOverflow,e.itemsDiscardedByOverflow),this.localstorageNumberOfFullReclaims=this.subtractFromCount(this.localstorageNumberOfFullReclaims,e.fullReclaims),this.localstorageNumberOfPartialReclaims=this.subtractFromCount(this.localstorageNumberOfPartialReclaims,e.partialReclaims),this.localstorageNumberOfFailedReclaims=this.subtractFromCount(this.localstorageNumberOfFailedReclaims,e.failedReclaims),this.localstorageNumberOfQueuesPurged=this.subtractFromCount(this.localstorageNumberOfQueuesPurged,e.localstorageQueuesPurged)}subtractFromCount(e,t){return Math.max(e-(t||0),0)}getMetricsPayload(){return{itemsDiscardedByRetry:this.itemsDiscardedByRetry,eventCount:this.eventCount,itemsDiscardedByOverflow:this.itemsDiscardedByOverflow,resilienceMechanism:this.resilienceMechanism,localstorageQueuesPurged:this.localstorageNumberOfQueuesPurged,fullReclaims:this.localstorageNumberOfFullReclaims,partialReclaims:this.localstorageNumberOfPartialReclaims,failedReclaims:this.localstorageNumberOfFailedReclaims}}}var o=null;const a=()=>(o||(o=new s),o)},476542:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(74552);class i{constructor(e){this._networkChangeCallback=e,"undefined"!=typeof window&&(window.addEventListener("offline",()=>this._networkChangeCallback(n.y.OFFLINE)),window.addEventListener("online",()=>this._networkChangeCallback(n.y.ONLINE)))}removeListeners(){"undefined"!=typeof window&&(window.addEventListener("offline",()=>this._networkChangeCallback(n.y.OFFLINE)),window.addEventListener("online",()=>this._networkChangeCallback(n.y.ONLINE)))}getNetworkStatus(){return window.navigator.onLine?n.y.ONLINE:n.y.OFFLINE}}},217555:(e,t,r)=>{"use strict";r.d(t,{A:()=>y,Z:()=>_});var n=r(718950),i=r(47169),s=r(276997),o=r(155458),a=r(964537),c=r(784163),l=r(362593),u=r(467800),d=r(476542),h=r(491164),g=r(197047),p=r(74552);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t{e===p.y.OFFLINE?this.scheduler.stop():this.checkEventCountAndReschedule()})}start(e){this.batchFlushCallback=e,this.longPollingScheduler.schedule()}stop(){this.scheduler.stop(),this.longPollingScheduler.stop()}addItem(e){var t=this;return(0,n.Z)((function*(){var r=JSON.parse(JSON.stringify(e)),{numberOfEvictedItems:n}=yield t.resilience.addItem(r,{},c.rS.EVICT);t.scheduler.schedule(),t.metricsCollector.addToEventCount(),n>0&&t.metricsCollector.addToItemsDiscardedByOverflowCounter(n)}))()}getGlobalRetryCount(){return this.scheduler.getFailureCount()}scheduleCallback(e){var t=this;return(0,n.Z)((function*(){if(t.networkStatus.getNetworkStatus()!==p.y.OFFLINE)try{var r=yield t.resilience.processItems(t.flush.bind(t),t.options.batchFlushSize);e(r)}catch(t){if(t.name===l.R)return void e(g.h.ERROR)}finally{yield t.checkEventCountAndReschedule()}else e(g.h.NOOP)}))()}checkEventCountAndReschedule(){var e=this;return(0,n.Z)((function*(){var t=yield e.resilience.getItemCount();t>0&&e.scheduler.schedule({immediate:t>=e.options.batchFlushSize})}))()}scheduleLongCallBack(e){var t=this;return(0,n.Z)((function*(){var r=(0,s.Z)(t.queuePrefix);t.metricsCollector.addToPurgedQueuesMetrics(r);var i=yield(0,o.Z)(t.queuePrefix,function(){var e=(0,n.Z)((function*(e){var r=e.map(e=>({item:e.item,retryAttempts:e.attemptNumber,id:e.id})),{items:n}=yield t.resilience.bulkAddItem(r,c.rS.IGNORE);return n.length===r.length?{status:"successful"}:{status:"partial",acceptedItemIds:n.map(e=>e.id)}}));return function(t){return e.apply(this,arguments)}}());t.metricsCollector.addToReclaimMetrics(i),yield t.checkEventCountAndReschedule(),e(g.h.SUCCESS),t.longPollingScheduler.schedule()}))()}flush(e,t){this.metricsCollector.setResilienceMechanism(this.resilience.storeType());var{batchFlushCallback:r}=this;if(!r)throw new Error("batchFlushCallback has not been set. Call PullBatchableQueue#start first.");return new Promise((n,i)=>{if(e.length<=0)n(g.h.NOOP);else{var s=e.map(e=>{var t=e.item;return e.retryAttempts>0&&t.msg&&(t.msg._metadata||(t.msg._metadata={}),t.msg._metadata.failedAttempts=e.retryAttempts),t});r(s,e=>{e?(t.numberOfDeletedItems>0&&this.metricsCollector.addToItemsDiscardedByRetryCounter(t.numberOfDeletedItems),i(e)):n(g.h.SUCCESS)})}})}buildOptions(e){return{backoffFactor:(null==e?void 0:e.backoffFactor)||y.backoffFactor,backoffJitterPercentage:void 0!==(null==e?void 0:e.backoffJitterPercentage)?e.backoffJitterPercentage:y.backoffJitterPercentage,batchFlushSize:(null==e?void 0:e.batchFlushSize)||y.batchFlushSize,flushBeforeUnload:(null==e?void 0:e.flushBeforeUnload)||y.flushBeforeUnload,flushWaitMs:(null==e?void 0:e.flushWaitMs)||y.flushWaitMs,maxItems:(null==e?void 0:e.maxItems)||y.maxItems,maxAttempts:(null==e?void 0:e.maxAttempts)||y.maxAttempts,maxRetryDelay:(null==e?void 0:e.maxRetryDelay)||y.maxRetryDelay,minRetryDelay:(null==e?void 0:e.minRetryDelay)||y.minRetryDelay}}}},531472:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(217555);const i=(e,t,r,i)=>new n.Z(e,t,r||{},i)},307381:(e,t,r)=>{"use strict";r.d(t,{E2:()=>i,fb:()=>o});var n=r(47169),i=function(e){return e.IDLE="idle",e.RUNNING="running",e.COMPLETED="completed",e.TIMED_OUT="timedOut",e}({}),s=function(e){return e.EXECUTE="execute",e.COMPLETE="complete",e.TIMEOUT="timeout",e}({});class o{constructor(e){if((0,n.Z)(this,"timeoutHandle",void 0),(0,n.Z)(this,"callbackStatus",i.IDLE),!(e>0))throw new Error("CallbackWithTimeout requires timeout period higher than 0");this.timeoutPeriod=e}transitionCallbackStatus(e,t){switch(e){case i.IDLE:case i.TIMED_OUT:case i.COMPLETED:t===s.EXECUTE&&(this.callbackStatus=i.RUNNING);break;case i.RUNNING:switch(t){case s.COMPLETE:this.callbackStatus=i.COMPLETED;break;case s.TIMEOUT:this.callbackStatus=i.TIMED_OUT}break;default:this.callbackStatus=e}}executeCallbackWithTimeout(e,t,r){"undefined"!=typeof window&&(this.transitionCallbackStatus(this.callbackStatus,s.EXECUTE),this.timeoutHandle=window.setTimeout(()=>{this.transitionCallbackStatus(this.callbackStatus,s.TIMEOUT),r()},this.timeoutPeriod),e(e=>{this.cancelTimeout(),this.getCallbackStatus()!==i.TIMED_OUT&&(this.transitionCallbackStatus(this.callbackStatus,s.COMPLETE),t(e))}))}getCallbackStatus(){return this.callbackStatus}cancelTimeout(){"undefined"!=typeof window&&this.timeoutPeriod>0&&this.timeoutHandle&&(window.clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0)}}},491164:(e,t,r)=>{"use strict";r.d(t,{Z:()=>g});var n=r(47169),i=r(307381),s=r(197047),o=1e3,a=3e4,c=2,l=0,u=500,d=5e3,h=function(e){return e[e.NONE=0]="NONE",e[e.IMMEDIATE=1]="IMMEDIATE",e[e.WAIT=2]="WAIT",e}({});class g{constructor(e,t){var r=this;(0,n.Z)(this,"schedule",(function(){var{immediate:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"undefined"!=typeof window&&(r.operationInFlight?e?r.queuedSchedule=h.IMMEDIATE:r.queuedSchedule!==h.IMMEDIATE&&(r.queuedSchedule=h.WAIT):(e||r.options.waitInterval<=0)&&0===r.failureCount?(r.clearTimeout(),r.run()):r.failureCount>0&&null===r.scheduledTimeout?r.scheduledTimeout=window.setTimeout(r.run,r.calculateBackoff()):null===r.scheduledTimeout&&(r.scheduledTimeout=window.setTimeout(r.run,r.options.waitInterval)))})),(0,n.Z)(this,"stop",()=>{this.clearTimeout(),this.queuedSchedule=h.NONE}),(0,n.Z)(this,"getFailureCount",()=>this.failureCount),(0,n.Z)(this,"getCallbackStatus",()=>this.callbackTimer.getCallbackStatus()),(0,n.Z)(this,"clearTimeout",()=>{"undefined"!=typeof window&&null!==this.scheduledTimeout&&(window.clearTimeout(this.scheduledTimeout),this.scheduledTimeout=null)}),(0,n.Z)(this,"run",()=>{this.operationInFlight=!0,this.clearTimeout();try{this.callbackTimer.executeCallbackWithTimeout(this.callback,this.done,()=>this.done(s.h.ERROR))}catch(e){this.done(e)}}),(0,n.Z)(this,"done",e=>{this.operationInFlight=!1,e===s.h.ERROR||this.callbackTimer.getCallbackStatus()===i.E2.TIMED_OUT?(this.failureCount++,this.clearTimeout()):e===s.h.SUCCESS&&(this.failureCount=0),this.processQueuedSchedule()}),(0,n.Z)(this,"processQueuedSchedule",()=>{if(this.queuedSchedule!==h.NONE){var e=this.queuedSchedule===h.IMMEDIATE;this.queuedSchedule=h.NONE,this.schedule({immediate:e})}else this.failureCount>0&&this.schedule()}),(0,n.Z)(this,"calculateBackoff",()=>{var{minRetryDelay:e,maxRetryDelay:t,backoffFactor:r,backoffJitterPercentage:n}=this.options,i=e*r**this.failureCount;if(n){var s=Math.random(),o=Math.floor(s*n*i);Math.floor(10*s)<5?i-=o:i+=o}return Number(Math.min(i,t).toPrecision(1))}),this.options={minRetryDelay:e.minRetryDelay||o,maxRetryDelay:e.maxRetryDelay||a,backoffFactor:e.backoffFactor||c,backoffJitterPercentage:e.backoffJitterPercentage||l,waitInterval:void 0!==e.waitInterval?e.waitInterval:u,callbackTimeoutPeriod:e.callbackTimeoutPeriod||d},this.scheduledTimeout=null,this.failureCount=0,this.callback=t,this.operationInFlight=!1,this.queuedSchedule=h.NONE,this.callbackTimer=new i.fb(this.options.callbackTimeoutPeriod)}}},197047:(e,t,r)=>{"use strict";r.d(t,{h:()=>n});var n=function(e){return e[e.NOOP=0]="NOOP",e[e.SUCCESS=1]="SUCCESS",e[e.ERROR=2]="ERROR",e}({})},74552:(e,t,r)=>{"use strict";r.d(t,{b:()=>n,y:()=>i});var n=function(e){return e.INDEXEDDB="indexeddb",e.MEMORY="memory",e}({}),i=function(e){return e[e.ONLINE=0]="ONLINE",e[e.OFFLINE=1]="OFFLINE",e}({})},743113:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var n=r(718950),i=r(784163),s=r(41915),o=r(630083),a=r(42921),c=r(967565),l=r(140257);class u{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.namespace=e,this.options=(0,l.YR)(t),!e||0===e.length||"string"!=typeof e)throw new Error("Invalid namespace provided");this.resilience=this.getResilienceMechanism(e,t)}getResilienceMechanism(e,t){if(!t.useMemory)try{return new a.Z(e,t)}catch(e){var r;if(!(e instanceof s.Z))null===(r=t.logger)||void 0===r||r.warn("Attempted to create IndexedDbResilience but failed. Using memory instead.")}return new c.Z(this.namespace,t)}addItem(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.rS.ABANDON;return this.runOrFailOver(()=>this.resilience.addItem(e,t,r))}bulkAddItem(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.rS.ABANDON;return this.runOrFailOver(()=>this.resilience.bulkAddItem(e,t))}getItems(e){return this.runOrFailOver(()=>this.resilience.getItems(e))}deleteItems(e){return this.runOrFailOver(()=>this.resilience.deleteItems(e))}getItemCount(){return this.runOrFailOver(()=>this.resilience.getItemCount())}processItems(e,t){return this.runOrFailOver(()=>this.resilience.processItems(e,t))}storeType(){return this.resilience.storeType()}runOrFailOver(e){var t=this;return(0,n.Z)((function*(){try{return yield e()}catch(r){if((0,o.n)(r))throw r;return t.resilience.storeType()===i.Pc.INDEXEDDB&&(yield t.failOver()),e()}}))()}failOver(){var e=this;return(0,n.Z)((function*(){var t=e.resilience,r=new c.Z(e.namespace,e.options);e.resilience=r;try{var{items:n}=yield t.getItems(e.options.maxEventLimit);if(n.length>0){var s=(yield r.bulkAddItemWrapperType(n,i.rS.IGNORE)).items.map(e=>e.id);yield t.deleteItems(s)}}catch(t){e.options.logger.warn("Unexpected error from ResilienceDb, switching to MemoryDb")}}))()}}},42921:(e,t,r)=>{"use strict";r.d(t,{Z:()=>y});var n=r(613613),i=r(718950),s=r(47169),o=r(784163),a=r(661424),c=r(41915),l=r(439402),u=r(630083),d=r(362593),h=r(676592),g=r(140257),p=["item"],v=["items"];function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};if((0,s.Z)(this,"startDB",(0,i.Z)((function*(){return new Promise(function(){var e=(0,i.Z)((function*(e,r){if("undefined"!=typeof window){var n=window.setTimeout(()=>{t.logger.warn("IndexedDB timed out."),r(new c.Z)},o.Fw),i=window.indexedDB.open(o.g,1);i.onupgradeneeded=e=>{if(0!==e.oldVersion)throw new Error("We cannot upgrade the database. Do not do this.");var t=i.result.createObjectStore(o.ws,{keyPath:"id"});t.createIndex(o.HN,o.HN,{unique:!1}),t.createIndex(o.py,o.py,{unique:!1}),t.createIndex(o.HW,o.HW,{unique:!1}),t.createIndex(o.dr,["namespace","timeAdded"],{unique:!1})},i.onerror=function(){r(new c.Z)};try{return yield(0,g.Mt)(i),e(i.result)}catch(e){t.logger.warn("IndexedDB failed to initialise.",e),r(new c.Z)}finally{window.clearTimeout(n)}}else t.logger.warn("IndexedDB failed to initialise. No 'window' object."),r(new c.Z)}));return function(t,r){return e.apply(this,arguments)}}())}))),(0,s.Z)(this,"addItem",function(){var e=(0,i.Z)((function*(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.rS.ABANDON,{logger:i,namespace:s}=t,a=(0,g.Zc)(e,s,r),{objectStore:c}=yield t.getObjectStoreAndTransaction("readwrite");if(n===o.rS.IGNORE)throw new l.Z(n,"IndexedDbConnector#addItem");try{if(!a.namespace||0===a.namespace.length||"string"!=typeof a.namespace)throw new Error("Namespace not specified");var d=yield t.globalEventLimitGuard.insertItems(c,[a],n);if(1===d.items.length)return{item:d.items[0],numberOfEvictedItems:d.numberOfEvictedItems};throw new Error("Incorrect number of items added. Expected: 1, got: ".concat(d.items.length))}catch(e){if((0,u.n)(e))throw e;throw i.log("Failed to add item to table",e),new Error("Request to add item to table failed")}}));return function(t){return e.apply(this,arguments)}}()),(0,s.Z)(this,"bulkAddItem",function(){var e=(0,i.Z)((function*(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.rS.ABANDON,{logger:i,namespace:s}=t,a=e.map(e=>{var{item:t}=e,r=(0,n.Z)(e,p);return(0,g.Zc)(t,s,r)}),{objectStore:c}=yield t.getObjectStoreAndTransaction("readwrite");try{return yield t.globalEventLimitGuard.insertItems(c,a,r)}catch(e){if((0,u.n)(e))throw e;throw i.log("Failed to add item to table",e),new Error("Request to add item to table failed")}}));return function(t){return e.apply(this,arguments)}}()),(0,s.Z)(this,"getItems",(0,i.Z)((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.$q,r=e>0?e:a.$q,{logger:n}=t,s=t.options.maxAttempts,{transaction:c,objectStore:l}=yield t.getObjectStoreAndTransaction("readwrite"),u=l.index(o.HN),d=IDBKeyRange.upperBound(Date.now()),h=u.openCursor(d),p=yield new Promise(function(){var e=(0,i.Z)((function*(e,t){var i=[],o=0;h.onerror=e=>{n.error("Failed to open cursor:",e),t("Failed to open cursor")},h.onsuccess=t=>{var c=t.target.result;if(c){var l=m({},c.value);i.push(l);var u=c.value;if(u.retryAttempts+=1,u.timeToBeProcessedAfter=Date.now()+a.N4,u.retryAttempts>=s){++o;var d=c.delete();(0,g.kZ)(d,n)}else{var h=c.update(u);(0,g.kZ)(h,n)}i.lengtht.deleteItem(n,e));yield(0,g._c)(r,t.logger),yield Promise.all(i)}catch(e){throw t.logger.warn("Failed to delete items from indexeddb.",e),e}}));return function(t){return e.apply(this,arguments)}}()),(0,s.Z)(this,"getItemCount",(0,i.Z)((function*(){var{transaction:e,objectStore:r}=yield t.getObjectStoreAndTransaction("readonly"),n=r.index(o.HN),i=IDBKeyRange.upperBound(Date.now()),s=n.count(i),a=yield(0,g.Mt)(s);return yield(0,g._c)(e,t.logger),a.target.result}))),(0,s.Z)(this,"processItems",function(){var e=(0,i.Z)((function*(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.$q,i=yield t.getItems(r),{items:s}=i,o=(0,n.Z)(i,v);try{var c=yield e(s,o),l=s.map(e=>e.id);return yield t.deleteItems(l),c}catch(e){throw new d.Z(e)}}));return function(t){return e.apply(this,arguments)}}()),(0,s.Z)(this,"deleteItem",function(){var e=(0,i.Z)((function*(e,r){var{logger:n}=t;try{yield(0,g.Mt)(e.delete(r))}catch(e){throw n.error("Failed to delete item:",r,e),e}}));return function(t,r){return e.apply(this,arguments)}}()),(0,s.Z)(this,"getObjectStoreAndTransaction",function(){var e=(0,i.Z)((function*(e){var r=(yield t.db).transaction(o.ws,e),n=r.objectStore(o.ws);return{transaction:r,objectStore:n}}));return function(t){return e.apply(this,arguments)}}()),this.options=(0,g.YR)(r),this.namespace=e,this.logger=this.options.logger,!window.indexedDB)throw new c.Z;this.db=this.startDB(),this.db.catch(()=>{}),this.globalEventLimitGuard=new h.Z(this.options.maxEventLimit,this.namespace,this.logger,this.deleteItem)}storeType(){return o.Pc.INDEXEDDB}}},676592:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(718950),i=r(47169),s=r(784163),o=r(572424),a=r(140257);class c{constructor(e,t,r,o){var c=this;if((0,i.Z)(this,"deleteOldestNEvents",function(){var e=(0,n.Z)((function*(e,t){var r,n=e.index(s.dr),i=IDBKeyRange.bound([c.namespace,0],[c.namespace,Date.now()]),o=n.getAllKeys(i,t),l=yield(0,a.Mt)(o),u=null==l||null===(r=l.target)||void 0===r?void 0:r.result;if(u&&Array.isArray(u)&&u.length>0)try{var d=u.map(t=>c.deleteItemHandler(e,t));yield Promise.all(d)}catch(e){throw c.logger.warn("Failed to delete items from indexeddb.",e),e}}));return function(t,r){return e.apply(this,arguments)}}()),!(e>0))throw Error("Event Limit has to be set higher than 1");this.eventLimit=e,this.namespace=t,this.logger=r,this.deleteItemHandler=o}insertItems(e,t){var r=arguments,i=this;return(0,n.Z)((function*(){var n=r.length>2&&void 0!==r[2]?r[2]:s.rS.ABANDON,o=[...t],c=0;switch(n){case s.rS.ABANDON:yield i.throwIfNotEnoughSpace(e,t.length);break;case s.rS.EVICT:c=yield i.evictIfNotEnoughSpace(e,t.length);break;case s.rS.IGNORE:yield i.calculateHowManyEventsWeCanAdd(e,o)}var l=o.map(t=>(0,a.Mt)(e.add(t)));return yield Promise.all(l),yield(0,a._c)(e.transaction,i.logger),{items:o,numberOfEvictedItems:c}}))()}throwIfNotEnoughSpace(e,t){var r=this;return(0,n.Z)((function*(){var n=yield r.calculateFreeSpace(e);if(n{"use strict";r.d(t,{Z:()=>f});var n=r(47169),i=r(613613),s=r(718950),o=r(784163),a=r(661424),c=r(439402),l=r(362593),u=r(173012),d=r(140257),h=["item"],g=["items"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};this.namespace=e,this.memoryStore=[],this.options=(0,d.YR)(t),this.globalEventLimitGuard=new u.Z(this.options.maxEventLimit,{addItems:this.addItems.bind(this),getItemCount:this.getItemCount.bind(this),evictEventsIfNeeded:this.evictEventsIfNeeded.bind(this)})}addItem(e){var t=arguments,r=this;return(0,s.Z)((function*(){var n=t.length>1&&void 0!==t[1]?t[1]:{},i=t.length>2&&void 0!==t[2]?t[2]:o.rS.ABANDON;if(i===o.rS.IGNORE)throw new c.Z(i,"IndexedDbConnector#addItem");var s=(0,d.Zc)(e,r.namespace,n),a=yield r.globalEventLimitGuard.insertItemsToMemoryStore([s],i);return Promise.resolve({item:a.items[0],numberOfEvictedItems:a.numberOfEvictedItems})}))()}bulkAddItem(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.rS.ABANDON,r=e.map(e=>{var{item:t}=e,r=(0,i.Z)(e,h);return(0,d.Zc)(t,this.namespace,r)});return this.bulkAddItemWrapperType(r,t)}bulkAddItemWrapperType(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.rS.ABANDON;return Promise.resolve(this.globalEventLimitGuard.insertItemsToMemoryStore(e,t))}getItems(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.$q;return Promise.resolve(this.synchronousGetItems(e))}synchronousGetItems(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.$q,t=e>0?e:a.$q,r=Date.now(),n=[],i=[];for(var s of this.memoryStore)if(s.timeToBeProcessedAfter<=r&&(n.push(v({},s)),s.timeToBeProcessedAfter+=a.N4,s.retryAttempts+=1,s.retryAttempts>=this.options.maxAttempts&&i.push(s)),n.length>=t)break;return i.forEach(e=>{var t=this.memoryStore.indexOf(e);this.memoryStore.splice(t,1)}),{items:n,numberOfDeletedItems:i.length}}deleteItems(e){return this.memoryStore=this.memoryStore.filter(t=>!e.includes(t.id)),Promise.resolve(void 0)}getItemCount(){var e=Date.now(),t=this.memoryStore.filter(t=>t.timeToBeProcessedAfter<=e).length;return Promise.resolve(t)}processItems(e,t){var r=this;return(0,s.Z)((function*(){var n=r.synchronousGetItems(t),{items:s}=n,o=(0,i.Z)(n,g),a=s.map(e=>e.id);try{var c=yield e(s,o);return yield r.deleteItems(a),c}catch(e){throw new l.Z(e)}}))()}storeType(){return o.Pc.MEMORY}addItems(e){this.memoryStore.push(...e),this.memoryStore.sort((function(e,t){return e.timeAdded-t.timeAdded}))}evictEventsIfNeeded(e){var t=this.memoryStore.length;if(t>e){var r=t-e;return this.memoryStore.splice(0,r),r}return 0}}},173012:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(718950),i=r(47169),s=r(784163),o=r(572424);class a{constructor(e,t){if((0,i.Z)(this,"insertItemsToMemoryStore",(e,t)=>{switch(t){case s.rS.ABANDON:return this.handleAbandonIfLimitWillExceedPolicy(e);case s.rS.EVICT:return Promise.resolve(this.handleEvictOldestIfLimitExceededPolicy(e));case s.rS.IGNORE:return this.handleAddAsManyAsPossible(e)}}),!(e>0))throw Error("Event Limit has to be set higher than 1");this.eventLimit=e,this.memoryItemHandlers=t}handleAbandonIfLimitWillExceedPolicy(e){var t=this;return(0,n.Z)((function*(){if((yield t.memoryItemHandlers.getItemCount())+e.length>t.eventLimit)throw new o.Z(s.Pc.MEMORY);return t.memoryItemHandlers.addItems(e),{items:e,numberOfEvictedItems:0}}))()}handleEvictOldestIfLimitExceededPolicy(e){return this.memoryItemHandlers.addItems(e),{items:e,numberOfEvictedItems:this.memoryItemHandlers.evictEventsIfNeeded(this.eventLimit)}}handleAddAsManyAsPossible(e){var t=this;return(0,n.Z)((function*(){var r=t.eventLimit-(yield t.memoryItemHandlers.getItemCount()),n=r>e.length?e:e.slice(0,r);return t.memoryItemHandlers.addItems(n),{items:n,numberOfEvictedItems:0}}))()}}},784163:(e,t,r)=>{"use strict";r.d(t,{Fw:()=>l,HN:()=>o,HW:()=>a,Pc:()=>u,dr:()=>n,g:()=>i,py:()=>c,rS:()=>d,ws:()=>s});var n="namespace-timeAdded",i="analytics-web-client",s="analytics-resilience",o="timeToBeProcessedAfter",a="timeAdded",c="retryAttempts",l=15e3,u=function(e){return e.INDEXEDDB="indexeddb",e.MEMORY="memory",e}({}),d=function(e){return e.IGNORE="ignore",e.ABANDON="abandon",e.EVICT="evict",e}({})},661424:(e,t,r)=>{"use strict";r.d(t,{$q:()=>n,N4:()=>i,gt:()=>s,js:()=>o});var n=7,i=6e4,s=10,o=5e3},572424:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i,w:()=>n});var n="AbandonWriteError";class i extends Error{constructor(e){super("Event Limit reached. Abandoning write to: ".concat(e)),Object.setPrototypeOf(this,i.prototype),this.name=n}}},362593:(e,t,r)=>{"use strict";r.d(t,{R:()=>n,Z:()=>i});var n="CallbackProcessingError";class i extends Error{constructor(e){var t=e&&"object"==typeof e&&"toString"in e&&"function"==typeof e.toString&&e.toString();super("Error thrown while processing events in callback: ".concat(t||"string"==typeof e&&e||"Argument passed to CallbackProcessingError was not an Error or string.")),Object.setPrototypeOf(this,i.prototype),this.name=n}}},439402:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i,y:()=>n});var n="InvalidPolicyError";class i extends Error{constructor(e,t){super("Method '".concat(t,"' cannot be called with policy '").concat(e,"'.")),this.name=n}}},41915:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n extends Error{constructor(){super("window.indexeddb is undefined."),Object.setPrototypeOf(this,n.prototype),this.name="NoIndexedDbError"}}},630083:(e,t,r)=>{"use strict";r.d(t,{n:()=>o});var n=r(572424),i=r(362593),s=r(439402),o=e=>{if(e&&"object"==typeof e&&"name"in e){var t=e;return"string"==typeof t.name&&(t.name===n.w||t.name===i.R||t.name===s.y)}return!1}},964537:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>n});const n=r(743113).Z},140257:(e,t,r)=>{"use strict";r.d(t,{Mt:()=>o,YR:()=>s,Zc:()=>i,_c:()=>a,kZ:()=>c});var n=r(661424),i=(e,t,r)=>{var{id:n,retryAttempts:i,timeToProcessOffset:s}=r;return{item:e,id:n||crypto.randomUUID(),retryAttempts:i||0,timeToBeProcessedAfter:Date.now()+(s||0),namespace:t,timeAdded:Date.now()}},s=e=>({logger:e.logger||console,useMemory:e.useMemory||!1,maxAttempts:e.maxAttempts||n.gt,maxEventLimit:e.maxEventLimit||n.js}),o=e=>new Promise((t,r)=>{e.onsuccess=e=>{t(e)},e.onerror=e=>{r(e)}}),a=(e,t)=>{try{"function"==typeof e.commit&&e.commit()}catch(e){throw t.error("Failed to force commit transaction:",e),e}return(e=>new Promise((t,r)=>{e.oncomplete=()=>{t()},e.onerror=e=>{r(e)},e.onabort=e=>{r(e)}}))(e)},c=(e,t)=>{e.onerror=e=>{t.warn("Error thrown from request:",e)}}},183781:(e,t,r)=>{"use strict";r.d(t,{R:()=>i,z:()=>s});var n=r(966945);function i(e){var{useStargate:t,env:r,useLegacyUrl:i,perimeter:s,ic:o,envOverride:a}=e;if(o){if(i)throw Error("IC is set but useLegacyUrl is true.");throw Error("IC is set but no apiHost provided.")}return s===n.T_.FEDRAMP_MODERATE?(e=>{var{useStargate:t,env:r,useLegacyUrl:i,envOverride:s}=e;if(r===n.gq.LOCAL||r===n.gq.DEV)throw Error("No LOCAL or DEV environments for FedRAMP.");if(r===n.gq.PROD&&s)throw Error("Cannot override to FedRAMP Sandbox for Prod.");return t?i?r===n.gq.PROD?"api.atlassian-us-gov-mod.com/gasv3/api/v1":"api.stg.atlassian-us-gov-mod.com/gasv3/api/v1":window.location.host+"/gateway/api/gasv3/api/v1":r===n.gq.PROD?"as.atlassian-us-gov-mod.com/api/v1":"as.staging.atl-paas-us-gov-mod.net/api/v1"})({useStargate:t,env:r,useLegacyUrl:i,envOverride:a}):(e=>{var{useStargate:t,env:r,useLegacyUrl:i}=e;return t?i?r===n.gq.PROD?"api-private.atlassian.com/gasv3/api/v1":"api-private.stg.atlassian.com/gasv3/api/v1":window.location.host+"/gateway/api/gasv3/api/v1":r===n.gq.PROD?"as.atlassian.com/api/v1":"as.staging.atl-paas.net/api/v1"})({useStargate:t,env:r,useLegacyUrl:i})}function s(e){var{apiHost:t}=e;return t===window.location.host+"/gateway/api/gasv3/api/v1"}},144022:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>a});var n=r(47169),i=r(93837),s=/^\d+$/,o=()=>{};class a{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.Z)(this,"_generateNewSessionId",()=>{var e=Date.now().toString();return this._safeLocalStorage.setItem("session.id",e),this._onNewSessionStarted&&this._onNewSessionStarted(),e}),(0,n.Z)(this,"_updateSessionExpiry",()=>{var e=Date.now()+this._sessionExpiryTime;return this._safeLocalStorage.setItem("session.expiry",e.toString()),e}),(0,n.Z)(this,"_debouncedUpdateSessionExpiry",e=>{var{_updateSessionExpiry:t}=this;e{t()},this._sessionExpiryDebounce))}),this._sessionExpiryTime=e.sessionExpiryTime||18e5,this._sessionExpiryDebounce=e.sessionExpiryDebounce||5e3,this._sessionExpiryDebounceThresholdPercentage=e.sessionExpiryDebounceThresholdPercentage||.9,this._onNewSessionStarted=e.onNewSessionStarted?e.onNewSessionStarted:o,this._safeLocalStorage=new i.Z}getCurrentSessionId(){var e=this._safeLocalStorage.getItem("session.id"),t=parseInt(this._safeLocalStorage.getItem("session.expiry")||"0",10)||0;return this._debouncedUpdateSessionExpiry(t),!e||t<=Date.now()||Number.isNaN(t)?this._generateNewSessionId():s.test(e)?e:this._generateNewSessionId()}}},585169:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(47169);const i=new class{constructor(){(0,n.Z)(this,"_data",{}),(0,n.Z)(this,"length",0),(0,n.Z)(this,"setItem",(e,t)=>(this._data[e]=t,this.length=Object.keys(this._data).length,t)),(0,n.Z)(this,"getItem",e=>e in this._data?this._data[e]:null),(0,n.Z)(this,"removeItem",e=>(e in this._data&&delete this._data[e],this.length=Object.keys(this._data).length,null)),(0,n.Z)(this,"clear",()=>{this._data={},this.length=0}),(0,n.Z)(this,"key",e=>Object.keys(this._data)[e])}}},93837:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(585169),i=r(921642);const s=class extends i.ZP{constructor(e){var t;try{t=window.localStorage||n.Z}catch(e){t=n.Z}super(t,e)}}},863243:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(585169),i=r(921642);const s=class extends i.ZP{constructor(e){var t;try{t=window.sessionStorage||n.Z}catch(e){t=n.Z}super(t,e)}}},921642:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>a});var n=r(47169),i=r(966945),s=r(585169);function o(e){if(!e)return!1;try{var t="awc.storage.support";e.setItem(t,"test_value");var r=e.getItem(t);return e.removeItem(t),"test_value"===r}catch(e){return!1}}class a{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.Z)(this,"getStore",()=>this._store),(0,n.Z)(this,"getItem",e=>this._store.getItem(this.createKey(e))),(0,n.Z)(this,"removeItem",e=>this._store.removeItem(this.createKey(e))),(0,n.Z)(this,"setItem",(e,t)=>{try{this._store.setItem(this.createKey(e),t)}catch(r){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(r)&&(this.swapToInMemory(),this._store.setItem(this.createKey(e),t))}}),(0,n.Z)(this,"swapToInMemory",()=>{if(this._store!==s.Z&&"undefined"!=typeof window){var e,t=Object.keys(this._store||{});o(window.awcInMemoryStorageFallback)?e=window.awcInMemoryStorageFallback:(e=s.Z,window.awcInMemoryStorageFallback||(window.awcInMemoryStorageFallback=s.Z)),t.forEach(t=>{if(0===t.indexOf(this.getPrefix())){var r=this._store.getItem(t);r&&e.setItem(t,r)}}),this._store=e}}),(0,n.Z)(this,"clear",()=>this._store.clear()),(0,n.Z)(this,"key",e=>this._store.key(e)),(0,n.Z)(this,"getPrefix",()=>this._prefix),(0,n.Z)(this,"createKey",e=>this._prefix?"".concat(this.getPrefix(),".").concat(e):e),this.options=t;var r=[];(void 0===t.useStoragePrefix||t.useStoragePrefix)&&r.push("awc"),t.envPrefix&&t.envPrefix!==i.gq.PROD&&r.push(t.envPrefix),this._prefix=r.join("-"),o(e)?this._store=e:this.swapToInMemory()}}},972080:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(47169),i=r(863243);class s{constructor(){(0,n.Z)(this,"_generateNewTabId",()=>{var e=crypto.randomUUID();return this._safeSessionStorage.setItem("tab.id",e),e}),this._safeSessionStorage=new i.Z}getCurrentTabId(){var e=this._safeSessionStorage.getItem("tab.id");return e||(e=this._generateNewTabId()),e}}},706544:(e,t,r)=>{"use strict";r.d(t,{Z:()=>h});var n=r(47169),i=r(972124),s=r(966945),o=r(126143),a=r(863243),c=r(230059);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;tnull===this._safeSessionStorage.getItem("taskSessions")||null===this._safeSessionStorage.getItem(d)||parseInt(this._safeSessionStorage.getItem(d)||"0",10)t.split("awc.")[1]),(0,n.Z)(this,"_isTaskSessionQueryParam",(e,t)=>t.startsWith("awc.")),(0,n.Z)(this,"getAllTaskSessions",()=>{try{return JSON.parse(this._safeSessionStorage.getItem("taskSessions")||"")}catch(e){return{}}}),(0,n.Z)(this,"_writeToSessionStorage",e=>{try{this._safeSessionStorage.setItem("taskSessions",JSON.stringify(e))}catch(e){}}),(0,n.Z)(this,"_appendTaskSessions",e=>{var t=this.getAllTaskSessions(),r=null===t?e:Object.assign(t,e);this._writeToSessionStorage(r)}),(0,n.Z)(this,"_safelyRemoveKey",(e,t)=>null===e?{}:(delete e[t],e)),(0,n.Z)(this,"createTaskSession",e=>{var t=crypto.randomUUID(),r={};return r[e]=t,this._appendTaskSessions(r),t}),(0,n.Z)(this,"createTaskSessionWithProvidedId",(e,t)=>{if("string"!=typeof t)throw new TypeError("invalid taskSessionId, must be string");var r={};r[e]=t,this._appendTaskSessions(r)}),(0,n.Z)(this,"completeTaskSession",e=>{var t=this.getAllTaskSessions(),r=this._safelyRemoveKey(t,e);this._writeToSessionStorage(r)}),(0,n.Z)(this,"formatTaskSessionQueryString",e=>{var{uri:t,includedTaskSessions:r}=e,{url:n,query:a}=(0,i.parseUrl)(t),c=this.getAllTaskSessions(),l=r?(0,o.ei)(c,r):(0,o.CE)(c,Object.values(s.W5));if(0===Object.keys(l).length)return t;var d=u(u({},(0,o.Cw)(l,(e,t)=>"awc."+t)),a);return"".concat(n,"?").concat((0,i.stringify)(d))}),(0,n.Z)(this,"stripQueryParameters",()=>{var e=(0,o.Cw)((0,c.Z)(this._isTaskSessionQueryParam),this._removeTaskSessionPrefix);this._appendTaskSessions(e)});var e=Date.now();this._safeSessionStorage=new a.Z;try{this._taskSessionsNotRecentlyInitialised(e)&&(this._writeToSessionStorage({}),this._safeSessionStorage.setItem(d,e.toString()))}catch(e){}}}},224330:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(649189),i=r.n(n),s=r(35933),o=r(36536),a=s.q.AWC_ANALYTICS_DEBUG.getKey();class c{constructor(e,t){this._syntheticFlagOverride="boolean"==typeof e?e:void 0,this._enableTestingCache="boolean"==typeof t?t:void 0,this._isDebugCookieEnabled=c.getDebugCookie(),this.bind()}saveEvent(e){try{if(!e)return;this.bind(),this.addSyntheticTag(e),this.cache(e)}catch(e){}}bind(){this.shouldCacheEvent()&&"undefined"!=typeof window&&!window.testAnalytics&&(window.testAnalytics={eventCache:[],events:()=>window.testAnalytics.eventCache,clear:()=>{window.testAnalytics.eventCache=[];try{localStorage.removeItem("awc.ui.viewed.last.sent"),localStorage.removeItem("awc-staging.ui.viewed.last.sent"),localStorage.removeItem("awc-dev.ui.viewed.last.sent"),localStorage.removeItem("awc-local.ui.viewed.last.sent")}catch(e){}}})}cache(e){this.shouldCacheEvent()&&"undefined"!=typeof window&&window.testAnalytics&&(window.testAnalytics.eventCache.length>=100&&(window.testAnalytics.eventCache=window.testAnalytics.eventCache.slice(1,window.testAnalytics.eventCache.length)),window.testAnalytics.eventCache.push(e))}addSyntheticTag(e){this.shouldSetSyntheticFlag()&&(e.tags instanceof Array?e.tags.includes("synthetic")||e.tags.push("synthetic"):e.tags=["synthetic"])}shouldCacheEvent(){return this._enableTestingCache?this._enableTestingCache:this._isDebugCookieEnabled}shouldSetSyntheticFlag(){if(void 0!==this._syntheticFlagOverride)return this._syntheticFlagOverride;var e=o.Q.getSyntheticFlagOverride();return void 0!==e?e:this.shouldCacheEvent()}static getDebugCookie(){try{return!0===JSON.parse(i().get(a)||"false")}catch(e){i().remove(a)}return!1}}const l=c},893104:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(613613),i=r(47169),s=r(966945),o=r(509541),a=r(93837),c=["embeddedProduct"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};if((0,i.Z)(this,"start",()=>{this._startInterval(),this._bindEventListeners()}),(0,i.Z)(this,"stop",()=>{this._stopInterval(),this._unbindEventListeners()}),(0,i.Z)(this,"resetTimers",()=>{this._intervalId&&(this.stop(),this.start())}),(0,i.Z)(this,"_bindEventListeners",()=>{"undefined"!=typeof window&&(window.addEventListener("focus",this._focusListener),window.addEventListener("blur",this._blurListener))}),(0,i.Z)(this,"_unbindEventListeners",()=>{"undefined"!=typeof window&&(window.removeEventListener("focus",this._focusListener),window.removeEventListener("blur",this._blurListener))}),(0,i.Z)(this,"_startInterval",()=>{clearInterval(this._intervalId),this._intervalId=setInterval(this._handleInterval,this._delay)}),(0,i.Z)(this,"_stopInterval",()=>{this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null)}),(0,i.Z)(this,"_getProductKey",(e,t)=>{var r=e;return t&&(r+="-".concat(t)),r}),(0,i.Z)(this,"_getLastSentTimestamp",(e,t,r)=>(((this._parseLocalStorageData(this._storageKey)||{})[r]||{})[t]||{})[e]||null),(0,i.Z)(this,"_parseLocalStorageData",e=>{var t=this._safeLocalStorage.getItem(e);try{return JSON.parse(t||"")}catch(t){return this._safeLocalStorage.removeItem(e),null}}),(0,i.Z)(this,"_getMalformedLastSentTimestamp",(e,t,r)=>{var n=t||"NOT_SET";return(((this._parseLocalStorageData(this._malformedEventStorageKey)||{})[r||"NOT_SET"]||{})[n]||{})[e]||null}),(0,i.Z)(this,"_setLastSentTimestamp",(e,t,r)=>{var n=this._parseLocalStorageData(this._storageKey)||{},i=n[r]||{},s=i[t]||{};s[e]=Date.now(),i[t]=s,n[r]=i,this._safeLocalStorage.setItem(this._storageKey,JSON.stringify(n))}),(0,i.Z)(this,"_setMalformedLastSentTimestamp",(e,t,r)=>{var n=this._parseLocalStorageData(this._malformedEventStorageKey)||{},i=r||"NOT_SET",s=t||"NOT_SET",o=n[i]||{},a=o[s]||{};a[e]=Date.now(),o[s]=a,n[i]=o,this._safeLocalStorage.setItem(this._malformedEventStorageKey,JSON.stringify(n))}),(0,i.Z)(this,"_shouldSendEvent",(e,t,r,n)=>{var i=(0,o.M)();if(i&&!i.hasFocus())return"FocusLost";if(t!==s.ox.NONE&&!r||!n){var a=Date.now()-this._getMalformedLastSentTimestamp(e,r,n);return null===a||a>this._throttle?"UserOrTenantIncomplete":"MalformedUiViewedRateLimited"}var c=Date.now()-this._getLastSentTimestamp(e,r,n);return null===c||c>this._throttle?"EligibleToSend":"UiViewedRateLimited"}),(0,i.Z)(this,"_handleInterval",()=>{var e=this._getContext(),{embeddedProduct:t}=e,r=(0,n.Z)(e,c);this._sendEvent(this._product,r),t&&this._sendEvent(t,r,!0)}),(0,i.Z)(this,"_sendEvent",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{subproduct:n,tenantIdType:i,tenantId:s,userId:o,lastScreenEvent:a,attributes:c}=t,u=l._getProductKey(e,n),d=l._shouldSendEvent(u,i,s,o);switch(d){case"EligibleToSend":l._setLastSentTimestamp(u,s,o),l._onEvent(l._createEvent(e,n,r,a,c,"ui","viewed"));break;case"UserOrTenantIncomplete":l._setMalformedLastSentTimestamp(u,s,o),l._onEvent(l._createEvent(e,n,r,a,c,"malformed","uiviewed"))}})),(0,i.Z)(this,"_createEvent",(e,t,r,n,i,s,o)=>{var a={product:e,source:"ui",action:o,actionSubject:s,attributes:i};return r&&(a.subproduct=null,a.version=null,a.attributes=u(u({},a.attributes),{},{embeddedInEnv:this._productInfo.env,embeddedInProduct:this._productInfo.product,embeddedInSubproduct:t,embeddedInVersion:this._productInfo.version,embeddedInOrigin:this._productInfo.origin,embeddedInPlatform:this._productInfo.platform})),n&&(a.attributes=u(u({},a.attributes),{},{lastScreenEvent:{name:n.name,attributes:n.attributes}})),a}),!e)throw new Error("Missing productInfo");if(!e.product)throw new Error("Missing productInfo.product");if(!t)throw new Error("Missing getContext callback");if("function"!=typeof t)throw new Error("Invalid getContext, must be function");if(!r)throw new Error("Missing onEvent callback");if("function"!=typeof r)throw new Error("Invalid onEvent, must be function");this._productInfo=e,this._product=e.product,this._getContext=t,this._onEvent=r,this._delay=d.delay||2e3,this._throttle=d.throttle||36e5,this._storageKey=d.storageKey||"ui.viewed.last.sent",this._malformedEventStorageKey=d.malformedStorageKey||"malformed.uiviewed.last.sent",this._safeLocalStorage=new a.Z({envPrefix:this._productInfo.env}),this._focusListener=()=>{this._startInterval()},this._blurListener=()=>{this._stopInterval()}}}},230059:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o,f:()=>s});var n=r(972124),i=r(126143),s=e=>window.history.replaceState({},"",e);const o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=window.location.href,o=window.location.hash,a=""!==o?r.replace(o,""):r,{url:c,query:l}=(0,n.parseUrl)(a),u=(0,i.D9)(l,e);if(Object.keys(u).length>0){var d=(0,i.GM)(l,e);if(Object.keys(d).length>0){var h="".concat(c,"?").concat((0,n.stringify)(d)).concat(o);t(h)}else t("".concat(c).concat(o))}return u}},821140:(e,t,r)=>{"use strict";function n(e){return!0==(null!==(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function i(e){if(!1===n(e))return!1;var t=e.constructor;if("function"!=typeof t)return!1;var r=t.prototype;return!1!==n(r)&&"isPrototypeOf"in r}r.d(t,{P:()=>i})},36536:(e,t,r)=>{"use strict";r.d(t,{Q:()=>i});var n=r(47169);class i{static isGeminiVREnvironment(){try{for(var e in{})if(e.startsWith("__gemini_")&&e.endsWith("__"))return!0}catch(e){}return!1}static areMetadataCallsDisabled(){return this.areFetchCallsDisabled()||this.getGlobalBooleanProperty(i.DISABLE_METADATA_CALLS_PROPERTY)}static areEventCallsDisabled(){return this.areFetchCallsDisabled()||this.getGlobalBooleanProperty(i.DISABLE_EVENT_CALLS_PROPERTY)}static areFetchCallsDisabled(){return this.getGlobalBooleanProperty(i.DISABLE_FETCH_CALLS_PROPERTY)}static getSyntheticFlagOverride(){return this.getGlobalTriStateProperty(i.SYNTHETIC_FLAG_OVERRIDE_PROPERTY)}static getGlobalBooleanProperty(e){return!!{}.hasOwnProperty(e)&&!0==={}[e]}static getGlobalTriStateProperty(e){if({}.hasOwnProperty(e)){var t={}[e];if("boolean"==typeof t)return t}}}(0,n.Z)(i,"DISABLE_METADATA_CALLS_PROPERTY","__awc_disable_metadata_calls__"),(0,n.Z)(i,"DISABLE_EVENT_CALLS_PROPERTY","__awc_disable_event_calls__"),(0,n.Z)(i,"DISABLE_FETCH_CALLS_PROPERTY","__awc_disable_fetch_calls__"),(0,n.Z)(i,"SYNTHETIC_FLAG_OVERRIDE_PROPERTY","__awc_synthetic_flag_override__")},820951:(e,t,r)=>{"use strict";function n(e,t){return e&&"function"==typeof e?()=>{e(t)}:null}r.d(t,{Z:()=>n})},202136:(e,t,r)=>{"use strict";r.d(t,{e:()=>l});var n=r(718950),i=r(47169),s=r(360229);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;tc(e,r))}catch(t){return e}}))).apply(this,arguments)}},970859:(e,t,r)=>{"use strict";r.d(t,{H:()=>i});var n=r(140541),i=(e,t)=>{if(e&&t&&"function"==typeof t){return Promise.race([t().catch(()=>()=>(0,n.JI)()),new Promise(e=>{setTimeout(()=>e(()=>(0,n.RG)()),n.Ih)})])}}},140541:(e,t,r)=>{"use strict";r.d(t,{Ih:()=>i,JI:()=>o,RG:()=>s});var n=r(643295),i=5e3,s=()=>[{type:n.C.XC,state:"TIMEOUT"},{type:n.C.UID,state:"TIMEOUT"}],o=()=>[{type:n.C.XC,state:"UNKNOWN"},{type:n.C.UID,state:"UNKNOWN"}]},643295:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});var n=function(e){return e.XC="xc",e.UID="uid",e}({})},317180:(e,t,r)=>{"use strict";r.d(t,{K:()=>b});var n=r(613613),i=r(718950),s=r(47169),o=r(340029),a=r(318661),c=r(846059),l=r(189120),u=r(77607),d=r(35731),h=r(438198),g=r(969634),p=r(793050),v=r(304522),f=r(449312),m=["sdkKey","environment","updateUserCompletionCallback","perimeter"];function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};(0,s.Z)(this,"initPromise",null),(0,s.Z)(this,"initCompleted",!1),(0,s.Z)(this,"initWithDefaults",!1),(0,s.Z)(this,"hasCheckGateErrorOccurred",!1),(0,s.Z)(this,"hasGetExperimentErrorOccurred",!1),(0,s.Z)(this,"hasGetExperimentValueErrorOccurred",!1),(0,s.Z)(this,"hasGetLayerErrorOccurred",!1),(0,s.Z)(this,"hasGetLayerValueErrorOccurred",!1),(0,s.Z)(this,"subscriptions",new a.Z),(0,s.Z)(this,"dataAdapter",new h.E),(0,s.Z)(this,"statsigValuesUpdated",()=>{this.user&&this.statsigClient.updateUserSync(this.user,{disableBackgroundCacheRefresh:!0}),this.subscriptions.anyUpdated()}),this.overrideAdapter=t||new g.h(e)}initialize(e,t,r){var n=this;return(0,i.Z)((function*(){var i=(0,v.bN)(e);if(n.initPromise)return(0,v.Ak)(i,n.initOptions)||console.warn("Feature Gates client already initialized with different options. New options were not applied."),n.initPromise;var s=performance.now();return n.initOptions=i,n.initPromise=n.init(i,t,r).then(()=>{n.initCompleted=!0,n.initWithDefaults=!0}).finally(()=>{var e=performance.now()-s;n.fireClientEvent(s,e,"initialize",n.initCompleted,i.apiKey)}),n.initPromise}))()}initializeWithProvider(e,t,r,n){var s=this;return(0,i.Z)((function*(){var i=(0,v.bN)(e);if(s.initPromise)return(0,v.Ak)(i,s.initOptions)||console.warn("Feature Gates client already initialized with different options. New options were not applied."),s.initPromise;var o=performance.now();return s.initOptions=i,s.provider=t,s.provider.setClientVersion(f.R),s.provider.setApplyUpdateCallback&&s.provider.setApplyUpdateCallback(s.applyUpdateCallback.bind(s)),s.initPromise=s.initWithProvider(i,t,r,n).then(()=>{s.initCompleted=!0,s.initWithDefaults=!0}).finally(()=>{var e=performance.now()-o;s.fireClientEvent(o,e,"initializeWithProvider",s.initCompleted,t.getApiKey?t.getApiKey():void 0)}),s.initPromise}))()}applyUpdateCallback(e){try{(this.initCompleted||this.initWithDefaults)&&(this.assertInitialized(this.statsigClient),this.dataAdapter.setBootstrapData(e.experimentValues),this.dataAdapter.setData(JSON.stringify(e.experimentValues)),this.statsigValuesUpdated())}catch(e){console.warn("Error when attempting to apply update",e)}}fireClientEvent(e,t,r,n){var i,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;null===(i=this.initOptions.analyticsWebClient)||void 0===i||i.then(i=>{var o=_({targetApp:this.initOptions.targetApp,clientVersion:f.R,success:n,startTime:e,totalTime:t},s&&{apiKey:s});i.sendOperationalEvent({action:r,actionSubject:"featureGatesClient",attributes:o,tags:["measurement"],source:"@atlaskit/feature-gate-js-client"})}).catch(e=>{this.initOptions.environment!==p.kA.Production&&console.error("Analytics web client promise did not resolve",e)})}initializeFromValues(e,t,r){var n=arguments,s=this;return(0,i.Z)((function*(){var i=n.length>3&&void 0!==n[3]?n[3]:{},o=(0,v.bN)(e);if(s.initPromise)return(0,v.Ak)(o,s.initOptions)||console.warn("Feature Gates client already initialized with different options. New options were not applied."),s.initPromise;Object.prototype.hasOwnProperty.call(i,"has_updates")||(i.has_updates=!0);var a=performance.now();return s.initOptions=o,s.initPromise=s.initFromValues(o,t,r,i).then(()=>{s.initCompleted=!0,s.initWithDefaults=!0}).finally(()=>{var e=performance.now()-a;s.fireClientEvent(a,e,"initializeFromValues",s.initCompleted)}),s.initPromise}))()}assertInitialized(e){if(!e)throw new Error("Client must be initialized before using this method")}updateUser(e,t,r){var n=this;return(0,i.Z)((function*(){n.assertInitialized(n.statsigClient);var i=(0,v.bN)(e);yield n.updateUserUsingInitializeValuesProducer(()=>d.ZP.fetchExperimentValues(i,t,r).then(e=>{var{experimentValues:t,customAttributes:r}=e;return{experimentValues:t,customAttributesFromFetch:r}}),t,r)}))()}updateUserWithProvider(e,t){var r=this;return(0,i.Z)((function*(){if(r.assertInitialized(r.statsigClient),!r.provider)throw new Error("Cannot update user using provider as the client was not initialised with a provider");yield r.provider.setProfile(r.initOptions,e,t),yield r.updateUserUsingInitializeValuesProducer(()=>r.provider.getExperimentValues(),e,t)}))()}updateUserWithValues(e,t){var r=arguments,n=this;return(0,i.Z)((function*(){var i=r.length>2&&void 0!==r[2]?r[2]:{};n.assertInitialized(n.statsigClient);yield n.updateUserUsingInitializeValuesProducer(()=>Promise.resolve({experimentValues:i,customAttributesFromFetch:t}),e,t)}))()}initializeCalled(){return null!=this.initPromise}initializeCompleted(){return this.initCompleted}checkGate(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{this.assertInitialized(this.statsigClient);var{fireGateExposure:r=!0}=t;return this.statsigClient.checkGate(e,{disableExposureLog:!r})}catch(t){return this.hasCheckGateErrorOccurred||(console.warn({msg:"An error has occurred checking the feature gate. Only the first occurrence of this error is logged.",gateName:e,error:t}),this.hasCheckGateErrorOccurred=!0),!1}}isGateExist(e){try{return this.assertInitialized(this.statsigClient),!this.statsigClient.getFeatureGate(e,{disableExposureLog:!0}).details.reason.includes("Unrecognized")}catch(e){return console.error("Error occurred when trying to check FeatureGate: ".concat(e)),!0}}isExperimentExist(e){try{return this.assertInitialized(this.statsigClient),!this.statsigClient.getExperiment(e,{disableExposureLog:!0}).details.reason.includes("Unrecognized")}catch(e){return console.error("Error occurred when trying to check Experiment: ".concat(e)),!0}}manuallyLogGateExposure(e){this.assertInitialized(this.statsigClient),this.statsigClient.checkGate(e)}getExperiment(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{this.assertInitialized(this.statsigClient);var{fireExperimentExposure:r=!0}=t;return c.z.fromExperiment(this.statsigClient.getExperiment(e,{disableExposureLog:!r}))}catch(t){return this.hasGetExperimentErrorOccurred||(console.warn({msg:"An error has occurred getting the experiment. Only the first occurrence of this error is logged.",experimentName:e,error:t}),this.hasGetExperimentErrorOccurred=!0),new c.z(e,{},"",{time:Date.now(),reason:u.p.Error})}}getExperimentValue(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.getExperiment(e,n);try{var{typeGuard:s}=n;return i.get(t,r,s)}catch(t){return this.hasGetExperimentValueErrorOccurred||(console.warn({msg:"An error has occurred getting the experiment value. Only the first occurrence of this error is logged.",experimentName:e,defaultValue:r,options:n,error:t}),this.hasGetExperimentValueErrorOccurred=!0),r}}manuallyLogExperimentExposure(e){this.assertInitialized(this.statsigClient),this.statsigClient.getExperiment(e)}manuallyLogLayerExposure(e,t){var r;this.assertInitialized(this.statsigClient),null===(r=this.statsigClient.getLayer(e))||void 0===r||r.get(t)}shutdownStatsig(){this.assertInitialized(this.statsigClient),this.statsigClient.shutdown()}overrideGate(e,t){var r;(this.overrideAdapter.overrideGate(e,t),this.user)&&(null===(r=this.statsigClient)||void 0===r||r.updateUserSync(this.user,{disableBackgroundCacheRefresh:!0}));this.statsigValuesUpdated()}clearGateOverride(e){this.overrideAdapter.removeGateOverride(e),this.statsigValuesUpdated()}overrideConfig(e,t){this.overrideAdapter.overrideDynamicConfig(e,t),this.statsigValuesUpdated()}clearConfigOverride(e){this.overrideAdapter.removeDynamicConfigOverride(e),this.statsigValuesUpdated()}setOverrides(e){this.overrideAdapter.setOverrides(e),this.statsigValuesUpdated()}getOverrides(){return this.overrideAdapter.getOverrides()}clearAllOverrides(){this.overrideAdapter.removeAllOverrides(),this.statsigValuesUpdated()}isCurrentUser(e,t){return(0,v.Ak)(this.currentIdentifiers,e)&&(0,v.Ak)(this.currentAttributes,t)}onGateUpdated(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.subscriptions.onGateUpdated(e,n=>{var{fireGateExposure:i=!0}=r;i&&this.manuallyLogGateExposure(e);try{t(n)}catch(t){console.warn("Error calling callback for gate ".concat(e," with value ").concat(n),t)}},this.checkGate.bind(this),r)}onExperimentValueUpdated(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.subscriptions.onExperimentValueUpdated(e,t,r,t=>{var{fireExperimentExposure:r=!0}=i;r&&this.manuallyLogExperimentExposure(e);try{n(t)}catch(r){console.warn("Error calling callback for experiment ".concat(e," with value ").concat(t),r)}},this.getExperimentValue.bind(this),i)}onAnyUpdated(e){return this.subscriptions.onAnyUpdated(e)}init(e,t,r){var n=this;return(0,i.Z)((function*(){var i,s,o=_({},e);try{var a=d.ZP.fetchClientSdk(e).then(e=>o.sdkKey=e.clientSdkKey),c=d.ZP.fetchExperimentValues(e,t,r),[,l]=yield Promise.all([a,c]);i=l.experimentValues,s=l.customAttributes}catch(e){throw e instanceof Error&&console.error("Error occurred when trying to fetch the Feature Gates client values, error: ".concat(null==e?void 0:e.message)),console.warn("Initialising Statsig client without values"),yield n.initFromValues(o,t,r),e}return n.initFromValues(o,t,s,i)}))()}initWithProvider(e,t,r,n){var s=this;return(0,i.Z)((function*(){var i,o,a=_(_({},e),{},{disableCurrentPageLogging:!0});try{yield t.setProfile(e,r,n);var c=t.getClientSdkKey().then(e=>a.sdkKey=e),l=t.getExperimentValues(),[,u]=yield Promise.all([c,l]);i=u.experimentValues,o=u.customAttributesFromFetch}catch(e){throw e instanceof Error&&console.error("Error occurred when trying to fetch the Feature Gates client values, error: ".concat(null==e?void 0:e.message)),console.warn("Initialising Statsig client without values"),yield s.initFromValues(a,r,n),e}return s.initFromValues(a,r,o,i)}))()}initFromValues(e,t,r){var s=arguments,a=this;return(0,i.Z)((function*(){var i,c=s.length>3&&void 0!==s[3]?s[3]:{};a.overrideAdapter.initFromStoredOverrides(),a.currentIdentifiers=t,a.currentAttributes=r;var l=(0,v.Lb)(e);l.sdkKey||(l.sdkKey="client-default-key"),null!==(i=l.networkConfig)&&void 0!==i&&i.logEventUrl||(l.networkConfig=_(_({},l.networkConfig),{},{logEventUrl:"https://xp.atlassian.com/v1/rgstr"})),l.perimeter===p.Au.FEDRAMP_MODERATE&&(l.disableLogging=!0);var{sdkKey:u,environment:d,updateUserCompletionCallback:h,perimeter:g}=l,f=(0,n.Z)(l,m);a.user=(0,v.at)(t,r);var y=_(_({},f),{},{environment:{tier:d},includeCurrentPageUrlWithEvents:!1,dataAdapter:a.dataAdapter,overrideAdapter:a.overrideAdapter,logEventCompressionMode:o.LogEventCompressionMode.Forced});t.stableId?o.StableID.setOverride(t.stableId,u):y.disableStableID=!0;try{a.statsigClient=new o.StatsigClient(u,a.user,y),a.dataAdapter.setBootstrapData(c),yield a.statsigClient.initializeAsync()}catch(e){throw e instanceof Error&&console.error("Error occurred when trying to initialise the Statsig client, error: ".concat(null==e?void 0:e.message)),console.warn("Initialising Statsig client with default sdk key and without values"),a.statsigClient=new o.StatsigClient("client-default-key",a.user,y),a.dataAdapter.setBootstrapData(),yield a.statsigClient.initializeAsync(),a.initWithDefaults=!0,e}}))()}updateUserUsingInitializeValuesProducer(e,t,r){var n=this;return(0,i.Z)((function*(){if(n.assertInitialized(n.statsigClient),!n.initPromise)throw new Error("The client must be initialized before you can update the user.");if(n.isCurrentUser(t,r))return n.initPromise;var s=n.initPromise;try{yield n.initPromise}catch(e){}var o=e(),a=n.updateStatsigClientUser(o,t,r);return n.initPromise=a.catch((0,i.Z)((function*(){n.initPromise=s,n.provider&&(yield n.provider.setProfile(n.initOptions,n.currentIdentifiers,n.currentAttributes))}))),a}))()}updateStatsigClientUser(e,t,r){var n=this;return(0,i.Z)((function*(){var i,s,o,a;n.assertInitialized(n.statsigClient);try{o=yield e,a=(0,v.at)(t,o.customAttributesFromFetch)}catch(e){var c,l,u=e instanceof Error?e.message:JSON.stringify(e);throw null===(c=(l=n.initOptions).updateUserCompletionCallback)||void 0===c||c.call(l,!1,u),e}var d=!0,h=null;try{n.dataAdapter.setBootstrapData(o.experimentValues),n.user=a,n.user&&(yield n.statsigClient.updateUserAsync(n.user))}catch(e){d=!1,h=String(e)}if(null===(i=n.initOptions)||void 0===i||null===(s=i.updateUserCompletionCallback)||void 0===s||s.call(i,d,h),!d)throw new Error("Failed to update user. An unexpected error occured.");n.currentIdentifiers=t,n.currentAttributes=r,n.subscriptions.anyUpdated()}))()}getPackageVersion(){return f.R}getLayer(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{this.assertInitialized(this.statsigClient);var{fireLayerExposure:r=!0}=t;return l.m.fromLayer(this.statsigClient.getLayer(e,{disableExposureLog:!r}))}catch(t){return this.hasGetLayerErrorOccurred||(console.warn({msg:"An error has occurred getting the layer. Only the first occurrence of this error is logged.",layerName:e,error:t}),this.hasGetLayerErrorOccurred=!0),l.m.fromLayer((0,o._makeLayer)(e,{reason:"Error"},null))}}getLayerValue(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.getLayer(e,n);try{var{typeGuard:s}=n;return i.get(t,r,s)}catch(t){return this.hasGetLayerValueErrorOccurred||(console.warn({msg:"An error has occurred getting the layer value. Only the first occurrence of this error is logged.",layerName:e,defaultValue:r,options:n,error:t}),this.hasGetLayerValueErrorOccurred=!0),r}}}},179105:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>g});var n,i=r(47169),s=r(317180),o=r(449312);class a{static isGateExists(e){return this.client.isGateExist(e)}static isExperimentExists(e){return this.client.isExperimentExist(e)}}n=a,(0,i.Z)(a,"client",new s.K),(0,i.Z)(a,"hasCheckGateErrorOccurred",!1),(0,i.Z)(a,"hasGetExperimentValueErrorOccurred",!1),(0,i.Z)(a,"checkGate",(e,t)=>{try{if("undefined"!=typeof window&&window.__CRITERION__&&"function"==typeof window.__CRITERION__.getFeatureFlagOverride){var r=window.__CRITERION__.getFeatureFlagOverride(e);if(void 0!==r)return r}}catch(t){n.hasCheckGateErrorOccurred||(console.warn({msg:"An error has occurred checking the feature gate from criterion override. Only the first occurrence of this error is logged.",gateName:e,error:t}),n.hasCheckGateErrorOccurred=!0)}return n.client.checkGate(e,t)}),(0,i.Z)(a,"getExperimentValue",(e,t,r,i)=>{try{if("undefined"!=typeof window&&window.__CRITERION__&&"function"==typeof window.__CRITERION__.getExperimentValueOverride){var s=window.__CRITERION__.getExperimentValueOverride(e,t);if(null!=s)return s}}catch(t){return n.hasGetExperimentValueErrorOccurred||(console.warn({msg:"An error has occurred getting the experiment value from criterion override. Only the first occurrence of this error is logged.",experimentName:e,defaultValue:r,options:i,error:t}),n.hasGetExperimentValueErrorOccurred=!0),r}return n.client.getExperimentValue(e,t,r,i)}),(0,i.Z)(a,"initializeCalled",n.client.initializeCalled.bind(n.client)),(0,i.Z)(a,"initializeCompleted",n.client.initializeCompleted.bind(n.client)),(0,i.Z)(a,"initialize",n.client.initialize.bind(n.client)),(0,i.Z)(a,"initializeWithProvider",n.client.initializeWithProvider.bind(n.client)),(0,i.Z)(a,"initializeFromValues",n.client.initializeFromValues.bind(n.client)),(0,i.Z)(a,"manuallyLogGateExposure",n.client.manuallyLogGateExposure.bind(n.client)),(0,i.Z)(a,"getExperiment",n.client.getExperiment.bind(n.client)),(0,i.Z)(a,"manuallyLogExperimentExposure",n.client.manuallyLogExperimentExposure.bind(n.client)),(0,i.Z)(a,"manuallyLogLayerExposure",n.client.manuallyLogLayerExposure.bind(n.client)),(0,i.Z)(a,"shutdownStatsig",n.client.shutdownStatsig.bind(n.client)),(0,i.Z)(a,"overrideGate",n.client.overrideGate.bind(n.client)),(0,i.Z)(a,"clearGateOverride",n.client.clearGateOverride.bind(n.client)),(0,i.Z)(a,"overrideConfig",n.client.overrideConfig.bind(n.client)),(0,i.Z)(a,"clearConfigOverride",n.client.clearConfigOverride.bind(n.client)),(0,i.Z)(a,"setOverrides",n.client.setOverrides.bind(n.client)),(0,i.Z)(a,"getOverrides",n.client.getOverrides.bind(n.client)),(0,i.Z)(a,"clearAllOverrides",n.client.clearAllOverrides.bind(n.client)),(0,i.Z)(a,"isCurrentUser",n.client.isCurrentUser.bind(n.client)),(0,i.Z)(a,"onGateUpdated",n.client.onGateUpdated.bind(n.client)),(0,i.Z)(a,"onExperimentValueUpdated",n.client.onExperimentValueUpdated.bind(n.client)),(0,i.Z)(a,"onAnyUpdated",n.client.onAnyUpdated.bind(n.client)),(0,i.Z)(a,"updateUser",n.client.updateUser.bind(n.client)),(0,i.Z)(a,"updateUserWithProvider",n.client.updateUserWithProvider.bind(n.client)),(0,i.Z)(a,"updateUserWithValues",n.client.updateUserWithValues.bind(n.client)),(0,i.Z)(a,"getPackageVersion",n.client.getPackageVersion.bind(n.client)),(0,i.Z)(a,"getLayer",n.client.getLayer.bind(n.client)),(0,i.Z)(a,"getLayerValue",n.client.getLayerValue.bind(n.client));var c=a;if("undefined"!=typeof window)if(void 0===window.__FEATUREGATES_JS__)window.__FEATUREGATES_JS__=a;else{var l,u,d=(null===(l=c=window.__FEATUREGATES_JS__)||void 0===l||null===(u=l.getPackageVersion)||void 0===u?void 0:u.call(l))||"4.10.0 or earlier";if(d!==o.R){var h="Multiple versions of FeatureGateClients found on the current page.\n The currently bound version is ".concat(d," when module version ").concat(o.R," was loading.");console.warn(h)}}const g=c},438198:(e,t,r)=>{"use strict";r.d(t,{E:()=>c});var n=r(718950),i=r(47169),s=r(340029);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";r.d(t,{J:()=>a,h:()=>l});var n=r(47169),i=r(970999);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;tt+":"+e;class l{constructor(e){this._overrides={gates:{},configs:{},layers:{}},this._djb2Map=new Map,this._localStorageKey=e}parseStoredOverrides(e){try{var t=window.localStorage.getItem(e);return t?JSON.parse(t):{gates:{},configs:{},layers:{}}}catch(e){return{gates:{},configs:{},layers:{}}}}mergeOverrides(){for(var e={gates:{},configs:{},layers:{}},t=arguments.length,r=new Array(t),n=0;n{"use strict";r.d(t,{z:()=>i});var n=r(304522);class i{static fromExperiment(e){var t,r,s,o=new i(e.name,e.value,e.ruleID,(0,n.qX)(e.details),(0,n.eO)(null!==(t=null===(r=e.__evaluation)||void 0===r?void 0:r.secondary_exposures)&&void 0!==t?t:[]),null!==(s=e.groupName)&&void 0!==s?s:void 0);return o.experiment=e,o}constructor(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;this.value=t,this._name=e,this._ruleID=r,this._secondaryExposures=i,this._allocatedExperimentName=s,this._evaluationDetails=n,this._onDefaultValueFallback=o}get(e,t,r){var n,i=this.getValue(e,t);if(null==i)return t;var s,o=Array.isArray(t)?"array":typeof t,a=Array.isArray(i)?"array":typeof i;return r?r(i)?(this.fireExposure(e),i):(null===(s=this._onDefaultValueFallback)||void 0===s||s.call(this,this,e,o,a),t):null==t||o===a?(this.fireExposure(e),i):(null===(n=this._onDefaultValueFallback)||void 0===n||n.call(this,this,e,o,a),t)}getValue(e,t){return null==e?this.value:(null==t&&(t=null),null==this.value[e]?t:(this.fireExposure(e),this.value[e]))}fireExposure(e){this.experiment&&this.experiment.get(e)}}},189120:(e,t,r)=>{"use strict";r.d(t,{m:()=>i});var n=r(304522);class i{static fromLayer(e){var t,r,s,o,a,c;return new i(e.name,e.__value,e.ruleID,(0,n.qX)(e.details),(t,r)=>e.get(r),(0,n.eO)(null!==(t=null===(r=e.__evaluation)||void 0===r?void 0:r.secondary_exposures)&&void 0!==t?t:[]),(0,n.eO)(null!==(s=null===(o=e.__evaluation)||void 0===o?void 0:o.undelegated_secondary_exposures)&&void 0!==s?s:[]),null===(a=e.__evaluation)||void 0===a?void 0:a.allocated_experiment_name,null===(c=e.__evaluation)||void 0===c?void 0:c.explicit_parameters)}constructor(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[];this._logParameterFunction=i,this._name=e,this._value=JSON.parse(JSON.stringify(null!=t?t:{})),this._ruleID=null!=r?r:"",this._evaluationDetails=n,this._secondaryExposures=s,this._undelegatedSecondaryExposures=o,this._allocatedExperimentName=a,this._explicitParameters=c}get(e,t,r){var n=this._value[e];if(null==n)return t;var i=()=>(this._logLayerParameterExposure(e),n);return r?r(n)?i():t:null==t||typeof n==typeof t&&Array.isArray(t)===Array.isArray(n)?i():t}getValue(e,t){null==t&&(t=null);var r=this._value[e];return null!=r&&this._logLayerParameterExposure(e),null!=r?r:t}_logLayerParameterExposure(e){var t;null===(t=this._logParameterFunction)||void 0===t||t.call(this,this,e)}}},77607:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var n=function(e){return e.Error="Error",e.LocalOverride="LocalOverride",e.Unrecognized="Unrecognized",e.Uninitialized="Uninitialized",e.NetworkNotModified="NetworkNotModified",e.Network="Network",e.InvalidBootstrap="InvalidBootstrap",e.Bootstrap="Bootstrap",e.Cache="Cache",e.Unknown="Unknown",e}({})},35731:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>l});var n=r(47169),i=r(718950),s=r(793050),o=r(449312),a=r(801787);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}class l{static fetchClientSdk(e){var t=this;return(0,i.Z)((function*(){var{targetApp:r}=e,n="/api/v2/frontend/clientSdkKey/".concat(r);try{return yield t.fetchRequest(n,"GET",e)}catch(e){if(e instanceof Error)throw e;throw Error("Failed to retrieve client sdk key")}}))()}static fetchExperimentValues(e,t,r){var n=this;return(0,i.Z)((function*(){var i={identifiers:t,customAttributes:r,targetApp:e.targetApp};try{return yield n.fetchRequest("/api/v2/frontend/experimentValues","POST",e,i)}catch(e){if(e instanceof Error)throw e;throw Error("Failed to retrieve experiment values")}}))()}static handleResponseError(e){return(0,i.Z)((function*(){if(!e.ok){var t=yield e.text();throw new a.V("Non 2xx response status received, status: ".concat(e.status,", body: ").concat(JSON.stringify(t)))}if(204===e.status)throw new a.V("Unexpected 204 response")}))()}static extractResponseBody(e){return(0,i.Z)((function*(){var t=yield e.text();return JSON.parse(t)}))()}static getBaseUrl(e){var t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return"/gateway/api/flags";if(t===s.Au.FEDRAMP_MODERATE)switch(e){case s.kA.Production:return"https://api.atlassian-us-gov-mod.com/flags";case s.kA.Staging:return"https://api.stg.atlassian-us-gov-mod.com/flags";default:throw new Error('Invalid environment "'.concat(e,'" for "').concat(t,'" perimeter'))}else{if(t!==s.Au.COMMERCIAL)throw new Error('Invalid perimeter "'.concat(t,'"'));switch(e){case s.kA.Development:return"https://api.dev.atlassian.com/flags";case s.kA.Staging:var n=this.getApiUrl(r);return null!==n?n:"https://api.stg.atlassian.com/flags";default:var i=this.getApiUrl(r);return null!==i?i:"https://api.atlassian.com/flags"}}}static fetchRequest(e,t,r,s){var a=this;return(0,i.Z)((function*(){var i,u=l.getBaseUrl(r.environment,r.useGatewayURL,r.perimeter,r.isolationContextId),d=r.fetchTimeoutMs||5e3;if(AbortSignal.timeout)i=AbortSignal.timeout(d);else if(AbortController){var h=new AbortController;i=h.signal,setTimeout(()=>h.abort(),d)}var g=yield fetch("".concat(u).concat(e),function(e){for(var t=1;t{"use strict";r.d(t,{V:()=>n});class n extends Error{constructor(e){super(e)}}},793050:(e,t,r)=>{"use strict";r.d(t,{Au:()=>i,kA:()=>n});var n=function(e){return e.Development="development",e.Staging="staging",e.Production="production",e}({}),i=function(e){return e.COMMERCIAL="commercial",e.FEDRAMP_MODERATE="fedramp-moderate",e}({})},304522:(e,t,r)=>{"use strict";r.d(t,{Ak:()=>h,Lb:()=>p,at:()=>g,bN:()=>d,eO:()=>m,qX:()=>f});var n=r(613613),i=r(47169),s=r(666251),o=r(77607),a=r(793050),c=["api","disableCurrentPageLogging","loggingIntervalMillis","loggingBufferMaxSize","localMode","eventLoggingApi","eventLoggingApiForRetries","disableLocalStorage","ignoreWindowUndefined","disableAllLogging","initTimeoutMs","disableNetworkKeepalive","overrideStableID","disableErrorLogging","disableAutoMetricsLogging"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;tu({perimeter:(0,s.n)()?a.Au.FEDRAMP_MODERATE:a.Au.COMMERCIAL},e),h=(e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;var r=Object.entries(e),n=Object.entries(t);if(r.length!==n.length)return!1;var i=(e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)};r.sort(i),n.sort(i);for(var s=0;s{var r={customIDs:e,custom:t};return e.atlassianAccountId&&(r.userID=e.atlassianAccountId),r},p=e=>{var{api:t,disableCurrentPageLogging:r,loggingIntervalMillis:i,loggingBufferMaxSize:s,localMode:o,eventLoggingApi:a,eventLoggingApiForRetries:l,disableLocalStorage:d,ignoreWindowUndefined:h,disableAllLogging:g,initTimeoutMs:p,disableNetworkKeepalive:v,overrideStableID:f,disableErrorLogging:m,disableAutoMetricsLogging:y}=e;return u(u({},(0,n.Z)(e,c)),{},{networkConfig:{api:t,logEventUrl:a?a+"rgstr":void 0,logEventFallbackUrls:l?[l]:void 0,preventAllNetworkTraffic:o||!h&&"undefined"==typeof window},includeCurrentPageUrlWithEvents:!r,loggingIntervalMs:i,loggingBufferMaxSize:s,disableStorage:void 0===d?o:d,disableLogging:void 0===g?o:g})},v=Object.entries(o.p).map(e=>{var[t,r]=e;return[t.toLowerCase(),r]}),f=e=>{var t,r,n,i=e.reason.toLowerCase();return{reason:null!==(t=null===(r=v.find(e=>{var[t]=e;return i.includes(t)}))||void 0===r?void 0:r[1])&&void 0!==t?t:o.p.Unknown,time:null!==(n=e.receivedAt)&&void 0!==n?n:Date.now()}},m=e=>e.map(e=>"string"==typeof e?{gate:e}:e)},449312:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});var n="0.70.2"},318661:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(47169),i=r(404399),s=r.n(i);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{var i=r(e,a(a({},n),{},{fireGateExposure:!1}));this.eventToValue.get(t)!==i&&(this.eventToValue.set(t,i),t(i))};return this.emitter.on(e,s),()=>{this.emitter.off(e,s)}}onExperimentValueUpdated(e,t,r,n,i,s){var o="".concat(e,".").concat(t),c=i(e,t,r,a(a({},s),{},{fireExperimentExposure:!1}));void 0===this.eventToValue.get(n)&&this.eventToValue.set(n,c);var l=()=>{var o=i(e,t,r,a(a({},s),{},{fireExperimentExposure:!1}));this.eventToValue.get(n)!==o&&(this.eventToValue.set(n,o),n(o))};return this.emitter.on(o,l),()=>{this.emitter.off(o,l)}}onAnyUpdated(e){return this.emitter.on("@all-features",e),()=>{this.emitter.off("@all-features",e)}}anyUpdated(){this.emitter.emit("@all-features"),this.emitter.eventNames().filter(e=>"@all-features"!==e).forEach(e=>{this.emitter.emit(e)})}}},732726:(e,t,r)=>{"use strict";var n,i;r.d(t,{f:()=>o});var s=!(void 0!==(null===globalThis||void 0===globalThis||null===(n=globalThis.process)||void 0===n||null===(n=n.env)||void 0===n?void 0:n.JEST_WORKER_ID))&&"production"!==(null===globalThis||void 0===globalThis||null===(i=globalThis.process)||void 0===i||null===(i=i.env)||void 0===i?void 0:i.NODE_ENV),o=function(){s&&console.debug(...arguments)}},711279:(e,t,r)=>{"use strict";r.d(t,{fg:()=>i});var n=r(478247);function i(e){return(0,n.Nf)(e)}},478247:(e,t,r)=>{"use strict";r.d(t,{Nf:()=>g});var n=r(179105),i=r(732726),s=r(13158),o="__PLATFORM_FEATURE_FLAGS__",a=void 0!==s&&void 0!==s.env,c=!!a&&"true"===s.env.ENABLE_PLATFORM_FF,l=!!a&&"true"===s.env.STORYBOOK_ENABLE_PLATFORM_FF,u=c||l,d={booleanResolver:void 0},h="undefined"!=typeof window?window:globalThis;function g(e){if(u)return(0,i.f)('[%s]: The feature flags were enabled while running tests. The flag "%s" will be always enabled.',"@atlaskit/platform-feature-flags",e),!0;try{var t,r,s;if(void 0===(null===(t=h[o])||void 0===t?void 0:t.booleanResolver)||null===(null===(r=h[o])||void 0===r?void 0:r.booleanResolver))return n.ZP.checkGate(e);var a=null===(s=h[o])||void 0===s?void 0:s.booleanResolver(e);return"boolean"!=typeof a?(console.warn("".concat(e," resolved to a non-boolean value, returning false for safety")),!1):a}catch(e){return!1}}h[o]=h[o]||d},672557:(e,t,r)=>{"use strict";r.d(t,{wS:()=>n});var n="fedramp-moderate"},666251:(e,t,r)=>{"use strict";r.d(t,{n:()=>i});var n=r(672557);function i(){var e,t=globalThis,r=t.MICROS_PERIMETER||t.UNSAFE_ATL_CONTEXT_BOUNDARY;if(r)return r===n.wS;var i=null===(e=t.location)||void 0===e||null===(e=e.hostname)||void 0===e?void 0:e.match(/atlassian-us-gov-mod\.(com|net)|atlassian-us-gov\.(com|net)|atlassian-fex\.(com|net)|atlassian-stg-fedm\.(com|net)/);return!!i&&i.length>0}},408340:(e,t,r)=>{"use strict";r.d(t,{UC:()=>n,ro:()=>s,zK:()=>i});var n='\n\t\n',i='\n\t\n',s='\n\n'},438189:(e,t,r)=>{"use strict";r.d(t,{I:()=>c});var n=r(718950),i=r(47169),s=r(192982),o=r(408340),a=["before-loading","loading","ready","acaw-hidden"];class c{constructor(e){(0,i.Z)(this,"hasAddedAnimationElements",!1),this.element=document.createElement("button"),this.element.id="acaw-chat-bubble",this.element.setAttribute("aria-label","Open chat"),this.element.innerHTML='\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t',this.element.addEventListener("click",e)}onOpen(){this.element.setAttribute("aria-label","Hide chat")}onClose(){this.element.setAttribute("aria-label","Open chat")}performLoadingAnimation(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{duration:2800};return this.addAnimationElements(),(0,s.xT)([(0,n.Z)((function*(){e.setAppearance("before-loading"),yield(0,s.mE)()})),(0,n.Z)((function*(){e.setAppearance("loading"),t&&("duration"in t&&(yield(0,s._v)(t.duration)),"waitForPromise"in t&&(yield t.waitForPromise))})),(0,n.Z)((function*(){return e.setAppearance("ready")}))],()=>{this.setAppearance("ready")})}hide(){this.setAppearance("acaw-hidden")}show(){this.setAppearance("ready")}addAnimationElements(){if(!this.hasAddedAnimationElements){var e=document.createElement("style");e.innerHTML='\n\t\t#acaw-chat-bubble.before-loading,\n\t\t#acaw-chat-bubble.loading {\n\t\t\tbackground: white;\n\t\t}\n\t\t#acaw-chat-bubble.before-loading {\n\t\t\topacity: 0;\n\t\t}\n\t\t#acaw-chat-bubble.before-loading .acaw-bubble-ai-bg,\n\t\t#acaw-chat-bubble.before-loading .acaw-ellipsis,\n\t\t#acaw-chat-bubble.before-loading .acaw-ai-glow,\n\t\t#acaw-chat-bubble.ready .acaw-bubble-ai-bg,\n\t\t#acaw-chat-bubble.ready .acaw-ellipsis,\n\t\t#acaw-chat-bubble.ready .acaw-ai-glow {\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.5s, visibility 0.5s;\n\t\t}\n\t\t#acaw-chat-bubble.before-loading .acaw-icon__open,\n\t\t#acaw-chat-bubble.before-loading .acaw-icon__close,\n\t\t#acaw-chat-bubble.loading .acaw-icon__open,\n\t\t#acaw-chat-bubble.loading .acaw-icon__close {\n\t\t\topacity: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t#acaw-chat-bubble.loading {\n\t\t\topacity: 1;\n\t\t}\n\t\t#acaw-chat-bubble.loading .acaw-bubble-ai-bg,\n\t\t#acaw-chat-bubble.loading .acaw-ellipsis,\n\t\t#acaw-chat-bubble.loading .acaw-ai-glow {\n\t\t\ttransition: opacity 0.5s;\n\t\t}\n\t\t#acaw-chat-bubble.loading .acaw-ai-glow {\n\t\t\ttransition: opacity 0.6s 0.5s;\n\t\t}\n\t\t.acaw-animation-elements {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: stretch;\n\t\t}\n\t\t.acaw-ai-border__circle {\n\t\t\tmix-blend-mode: lighten;\n\t\t}\n\t\t@property --acaw-ai-glow-angle {\n\t\t\tsyntax: "";\n\t\t\tinherits: true;\n\t\t\tinitial-value: 0deg;\n\t\t}\n\t\t@keyframes acaw_rotate {\n\t\t\tfrom {\n\t\t\t\ttransform: rotate(0deg);\n\t\t\t}\n\t\t\tto {\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t}\n\t\t}\n\t\t@keyframes acaw_gradient_angle {\n\t\t\tfrom {\n\t\t\t\t--acaw-ai-glow-angle: 0deg;\n\t\t\t}\n\t\t\tto {\n\t\t\t\t--acaw-ai-glow-angle: 360deg;\n\t\t\t}\n\t\t}\n\t\t.acaw-bubble-ai-bg {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground: white;\n\t\t}\n\t\t.acaw-bubble-ai-bg .acaw-ai-border__gradient {\n\t\t\tbackground: conic-gradient(from var(--acaw-ai-glow-angle, 45deg), #BF63F3, #FFA900 25%, #0469FF 67%, #0065FF, #BF63F3);\n\t\t\tanimation: 2s linear 0s infinite normal none running acaw_gradient_angle;\n\t\t}\n\t\t.acaw-ai-glow {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\topacity: 0.5;\n\t\t\tfilter: blur(8px);\n\t\t\tanimation: 2s linear 0s infinite normal none running acaw_rotate;\n\t\t}\n\t\t.acaw-ellipsis {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tmargin: auto;\n\t\t}\n\t\t.acaw-ai-border,\n\t\t.acaw-ai-glow .acaw-ai-border__gradient {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t.acaw-ai-border,\n\t\t.acaw-ai-border foreignObject {\n\t\t\tdisplay: flex;\n\t\t\talign-items: stretch;\n\t\t}\n\t\t.acaw-ai-border__gradient {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground: conic-gradient(from 45deg, #BF63F3, #FFA900 25%, #0469FF 67%, #0065FF, #BF63F3);\n\t\t}\n\t\t',document.head.appendChild(e);var t=document.createElement("span");t.classList.add("acaw-animation-elements"),t.innerHTML=[o.UC,o.zK,o.ro].join(""),this.element.appendChild(t),this.hasAddedAnimationElements=!0}}setAppearance(e){this.element.classList.remove(...a),this.element.classList.add(e)}}},127932:(e,t,r)=>{"use strict";r.d(t,{h:()=>o});var n=r(718950),i=r(192982),s=r(461048);class o{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"👋 Hi, you can get help with any of our products using this AI‑powered chat.";this.element=document.createElement("div"),this.element.innerHTML=e,this.element.setAttribute("style","padding:12px; max-width:416px; background-color: #F0F1F2; line-height:1.43; font-weight:400; color:#172B4D; border-radius: 6px; position: fixed; opacity: 0; box-shadow: 0px 0px 1px rgba(9, 30, 66, 0.31), 0px 8px 12px rgba(9, 30, 66, 0.15);"),this.element.style.bottom="".concat(s.vO+s._N+s.rz,"px"),this.element.style.right="".concat(s.GP,"px")}performAnimation(e){var t=this;return(0,i.xT)([(0,n.Z)((function*(){yield(0,i._v)(e.delay)})),(0,n.Z)((function*(){yield(0,i.mE)(),t.fadeIn(),"duration"in e&&(yield(0,i._v)(e.duration)),"waitForPromise"in e&&(yield e.waitForPromise)})),()=>{this.fadeOut()}],()=>{this.fadeOut(!0)})}fadeIn(){this.element.style.transition="opacity 0.8s ease-in-out, visibility 0.4s ease-in-out",this.element.style.opacity="1",this.element.style.visibility="visible"}fadeOut(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.element.style.transition=e?"opacity 0.2s ease-in-out, visibility 0.2s ease-in-out":"opacity 0.4s ease-in-out, visibility 0.4s ease-in-out",this.element.style.opacity="0",this.element.style.pointerEvents="none",this.element.style.visibility="hidden"}}},677344:(e,t,r)=>{"use strict";r.d(t,{I9:()=>d,gG:()=>h,pT:()=>g});var n=r(47169),i=r(192982);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t{var e=window.localStorage.getItem("@atlassian/conversation-assistant-widget-installer__discovery");return e?JSON.parse(e):{lastDiscoveryVariantSeen:null,lastDiscoveryVariantSeenTimestamp:null,hasSeenAutoConversation:!1,hasClickedWidgetToggleButton:!1,hasFocusedWidget:!1}},u=e=>{try{(e=>{window.localStorage.setItem("@atlassian/conversation-assistant-widget-installer__discovery",JSON.stringify(e))})(o(o({},l()),e))}catch(e){}},d=()=>{if(a)return a;try{var{lastDiscoveryVariantSeen:e}=l(),t=e?c.findIndex(t=>t===e):-1;return a=c[t+1]}catch(e){return}},h=e=>{u({lastDiscoveryVariantSeen:e,lastDiscoveryVariantSeenTimestamp:Date.now()})},g=(0,i.yv)(()=>{u({hasClickedWidgetToggleButton:!0})});(0,i.yv)(()=>{u({hasFocusedWidget:!0})})},983796:(e,t,r)=>{"use strict";r.d(t,{G:()=>y});var n=r(47169),i=r(859557),s=r(653070),o=r(60346),a=r(438189),c=r(931595),l=r(581172),u=r(127932),d=r(677344),h=r(192982),g=r(461048),p=r(413672),v=r(563874);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"native",t=arguments.length>1?arguments[1]:void 0;(0,n.Z)(this,"widgetScriptLoaded",!1),(0,n.Z)(this,"hasOpened",!1),this.entrypointScriptSrc=t,this.addStyles(),this.analyticsService=new l.y,window.atlassianWidgetAnalyticsWebClient=this.analyticsService.client,this.isOpen=!1,this.conversationAssistantWidget=document.createElement("div"),this.conversationAssistantWidget.id="atlassian-conversation-assistant-widget",this.chatBubble=new a.I(this.onBubbleClick.bind(this)),this.chatPanel=new c.N,document.body.appendChild(this.conversationAssistantWidget),this.conversationAssistantWidget.appendChild(this.chatBubble.element),this.conversationAssistantWidget.appendChild(this.chatPanel.element),"iframe"===e?this.loadWidgetIframe():this.loadWidgetScript(),window.toggleJCSChat=this.toggleChat.bind(this),this.isOpenChangeEvent=new CustomEvent("jscChatWidgetVisibilityChange",{detail:{isOpen:this.isOpen}}),"iframe"!==e&&(this.activeDiscoverySequence=this.performDiscoverySequence())}performDiscoverySequence(){var e=(0,d.I9)();switch(e&&((0,d.gG)(e),this.analyticsService.sendUIEvent({action:"shown",actionSubject:"discoverySequence",actionSubjectId:"jcsChatWidget",attributes:m({variant:e},(0,s.b)()),source:"CSMAI",tags:["atlaskit"]})),e){case"autopop":return this.performAutopopupDiscovery();case"coaching_nudge":return this.performCoachingNudgeDiscovery();default:return this.chatBubble.performLoadingAnimation()}}performAutopopupDiscovery(){return(0,h.xT)([()=>this.chatBubble.performLoadingAnimation(),()=>Promise.all([this.waitForWidgetScript(),(0,h._v)(1e3)]),()=>{this.hasOpened||this.autoOpen({trigger:"discoverySequence"})}])}performCoachingNudgeDiscovery(){return(0,h.xT)([()=>this.chatBubble.performLoadingAnimation(),()=>{var e=new u.h;return this.conversationAssistantWidget.appendChild(e.element),e.performAnimation({delay:100,duration:7600})}])}autoOpen(e){var{trigger:t}=e;this.isOpen||(this.toggleChat(),this.analyticsService.sendUIEvent({action:"auto-opened",actionSubject:"jcs-chat-widget",attributes:m({isOpen:this.isOpen,trigger:t},(0,s.b)()),source:"CSMAI",tags:["atlaskit"]}))}onBubbleClick(){this.toggleChat(),this.analyticsService.sendTrackEvent({action:"clicked",actionSubject:"jcs-chat-widget-bubble",attributes:m({isOpen:this.isOpen},(0,s.b)()),source:"CSMAI",tags:["atlaskit"]}),(0,d.pT)()}toggleChat(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isOpen=null!=t?t:!this.isOpen,this.hasOpened||(this.hasOpened=Boolean(this.isOpen)),null===(e=this.activeDiscoverySequence)||void 0===e||e.cancel(),this.conversationAssistantWidget.classList.toggle("open",this.isOpen),this.chatBubble[this.isOpen?"onOpen":"onClose"](),this.isOpenChangeEvent.detail.isOpen=this.isOpen,window.dispatchEvent(this.isOpenChangeEvent)}onceInstallerMounted(e){return window.addEventListener("jscChatWidgetInstallerMounted",()=>{e()},{once:!0})}waitForWidgetScript(){return new Promise(e=>{if(this.widgetScriptLoaded)return e();this.onceInstallerMounted(()=>{e()})})}getIframeSrc(){var e,t,r,n=document.querySelector("script[data-jcs-widget]");if(!this.entrypointScriptSrc)throw new Error("Entrypoint script src could not be determined");var i=new URL(this.entrypointScriptSrc),s=new URLSearchParams(i.search),o=null==n?void 0:n.dataset,a=null!==(e=s.get("site"))&&void 0!==e?e:null==o?void 0:o.jcsSite,c=null!==(t=s.get("siteId"))&&void 0!==t?t:null==o?void 0:o.jcsSiteId,l=s.get("widgetId"),u=new URLSearchParams;if(c&&u.set("siteId",c),l&&u.set("widgetId",l),a){var d="https://".concat(a);return"".concat(d).concat("/csm/widget","?").concat(u)}var[h,g]=null!==(r=/^(https?:\/\/.*?\/)/.exec(i.href))&&void 0!==r?r:[];if(!g)throw new Error("Could not determine base URL from entrypoint script src");return"".concat(g,"?").concat(u)}loadWidgetIframe(){var e=new i.S,t=new p.h(this.chatPanel.element,this.getIframeSrc());this.iframe=t,t.on("ready",()=>{t.send("init",{sessionId:e.getSessionId(),tenantId:void 0,conversationId:e.getSavedConversationId(),uiConfig:{},analyticsContext:{}})}),t.on("CLOSE_WIDGET",()=>{this.toggleChat()}),this.iframe.on("message:started",t=>{var{conversationId:r}=t;e.saveConversationId(r)})}loadWidgetScript(){var e=document.createElement("script");e.src="".concat(o.eG.assetsUrl||"","/index-").concat("0.70.2",".js"),e.async=!0,document.body.appendChild(e);var t=document.createElement("div");t.id="jcs-chat-widget-app",this.chatPanel.element.appendChild(t),this.analyticsService.sendTrackEvent({action:"loaded",actionSubject:"jcs-chat-widget",attributes:(0,s.b)(),source:"CSMAI",tags:["atlaskit"]}),this.onceInstallerMounted(()=>{this.widgetScriptLoaded=!0})}addStyles(){var e=(0,v.NV)(),t=document.createElement("style");t.innerHTML="\n\t\t\t#jcs-chat-widget-app {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\t/* remove this style when the widget styling is fixed */\n\t\t\t#jcs-chat-widget-app > div {\n\t\t\t\twidth: 100% !important;\n\t\t\t\theight: 100% !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t}\n\t\t\t#acaw-chat-bubble {\n\t\t\t\twidth: ".concat(g._N,"px;\n\t\t\t\theight: ").concat(g._N,"px;\n\t\t\t\tborder-radius: ").concat(e.chatBubble.borderRadius,";\n\t\t\t\tbackground-color: ").concat(e.chatBubble.backgroundColor,";\n\t\t\t\tcolor: ").concat(e.chatBubble.color,";\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tcursor: pointer;\n\t\t\t\tz-index: 2147483000;\n\t\t\t\tposition: fixed;\n\t\t\t\tbox-shadow: ").concat(e.chatBubble.boxShadow,";\n\t\t\t\tbottom: ").concat(g.vO,"px;\n\t\t\t\tright: ").concat(g.GP,"px;\n\t\t\t\ttransition: transform 167ms cubic-bezier(0.33, 0, 0, 1), opacity 0.5s, background-color 0.2s, color 0.2s;\n\t\t\t\ttransform-origin: center center;\n\t\t\t\tborder: none;\n\t\t\t\tz-index: 399;\n\t\t\t}\n\t\t\t#acaw-chat-bubble:focus-visible {\n\t\t\t\tbox-shadow: ").concat(e.chatBubble.focusBoxShadow,";\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t\t#atlassian-conversation-assistant-widget.open #acaw-chat-bubble {\n\t\t\t\tbackground-color: ").concat(e.chatBubble.backgroundColor,";\n\t\t\t\tcolor: ").concat(e.chatBubble.openColor,";\n\t\t\t}\n\n\t\t\t#acaw-chat-bubble.acaw-hidden {\n\t\t\t\topacity: 0;\n\t\t\t\ttransform: scale(0);\n\t\t\t}\n\t\t\t#acaw-chat-bubble:hover {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t}\n\t\t\t#acaw-chat-panel {\n\t\t\t\tposition: fixed;\n\t\t\t\tbottom: ").concat(g.vO+g._N+g.rz,"px;\n\t\t\t\tright: ").concat(g.GP,"px;\n\t\t\t\ttransform-origin: right bottom;\n\t\t\t\theight: min(").concat(g.wh,"px, calc(100% - ").concat(2*g.vO+g._N+g.rz,"px));\n\t\t\t\tmin-height: 80px;\n\t\t\t\twidth: ").concat(e.chatPanel.width,";\n\t\t\t\tmax-height: ").concat(g.wh,"px;\n\t\t\t\tborder-radius: ").concat(e.chatPanel.borderRadius,";\n\t\t\t\toverflow: hidden;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tbox-shadow: ").concat(e.chatPanel.boxShadow,";\n\t\t\t\topacity: 0;\n\t\t\t\ttransform: translateX(0) scale(0);\n\t\t\t\ttransition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out, visibility 300ms;\n\t\t\t\tpointer-events: none;\n\t\t\t\tvisibility: hidden;\n\t\t\t\tz-index: 399;\n\t\t\t}\n\t\t\t#atlassian-conversation-assistant-widget #acaw-chat-bubble.acaw-hidden + #acaw-chat-panel {\n\t\t\t\ttransform: translateX(50%) scale(1);\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\t.acaw-icon__open {\n\t\t\t\ttransition: all 0.2s ease-in-out;\n\t\t\t}\n\t\t\t.acaw-icon__close {\n\t\t\t\ttransition: all 0.3s ease-in-out;\n\t\t\t}\n\t\t\t.acaw-icon__open {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\t.acaw-icon__close {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\t.acaw-icon-container {\n\t\t\t\tposition: absolute;\n\t\t\t\toverflow: hidden;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tborder-radius: 50%;\n\t\t\t\tinset: 0;\n\t\t\t\tcolor: ").concat(e.chatBubble.iconColor,";\n\t\t\t}\n\t\t\t#atlassian-conversation-assistant-widget.open #acaw-chat-panel {\n\t\t\t\topacity: 1;\n\t\t\t\ttransform: translateX(0) scale(1);\n\t\t\t\tpointer-events: all;\n\t\t\t\tvisibility: visible;\n\t\t\t}\n\t\t\t#atlassian-conversation-assistant-widget.open .acaw-icon__close {\n\t\t\t\ttransform: translateY(-").concat(g._N,"px);\n\t\t\t}\n\t\t\t#atlassian-conversation-assistant-widget.open .acaw-icon__open {\n\t\t\t\topacity: 1;\n\t\t\t\ttransition-delay: 0.2s;\n\t\t\t}\n\n\n\t\t\t/* The below are to fix SAC styling due to the use of rem in ADS button component */\n\t\t\tdiv[data-testid='csm-ai.main-header.close-chat-modal.rating-screen'] button,\n\t\t\tdiv[data-testid='csm-ai.main-header.close-chat-modal.feedback-screen'] button\n\t\t\t{\n\t\t\t\theight: 100% !important;\n\t\t\t}\n\n\t\t\t[data-testid='response-feedback-button-container'] button {\n \t\t\tpadding: 12px;\n\t\t\t}\n\n\t\t\t[data-testid='csm-ai.main-header.buttons'] button {\n \t\t\tpadding: 12px;\n\t\t\t}\n\n\t\t\t[data-testid='csm-ai.chat-input-container'] button {\n \t\t\t padding: 12px;\n\t\t\t}\n\t\t"),document.head.appendChild(t)}}},192982:(e,t,r)=>{"use strict";r.d(t,{_v:()=>s,mE:()=>i,xT:()=>a,yv:()=>c});var n=r(718950),i=()=>new Promise(e=>{return t=e,void requestAnimationFrame(()=>{requestAnimationFrame(t)});var t}),s=e=>new Promise(t=>setTimeout(t,e)),o=e=>null!==e&&"object"==typeof e&&"waitFor"in e&&"cancel"in e&&"function"==typeof e.waitFor&&"function"==typeof e.cancel,a=(e,t)=>{var r,i,s,a=!1,c=new Promise(function(){var t=(0,n.Z)((function*(t){i=t;var s=function*(){if(a)return 0;var e,t,i=c();if(r=void 0,"object"==typeof(e=i)&&null!==e&&"then"in e&&"function"==typeof e.then&&(i=yield i),!i)return 1;if(Array.isArray(i)&&i.every(o)){var s=i;i={waitFor:(t=(0,n.Z)((function*(){yield Promise.all(s.map(e=>e.waitFor()))})),function(){return t.apply(this,arguments)}),cancel:()=>{for(var e of s)e.cancel()}}}o(i)&&(r=i.cancel,yield i.waitFor())};for(var c of e)if(0===(yield*s()))break;return t()}));return function(e){return t.apply(this,arguments)}}());return{waitFor:(s=(0,n.Z)((function*(){yield c})),function(){return s.apply(this,arguments)}),cancel:()=>{var e;a||(null===(e=r)||void 0===e||e(),null==t||t(),a=!0,i())}}},c=e=>{var t=!1;return function(){if(!t)return t=!0,e(...arguments)}}},931595:(e,t,r)=>{"use strict";r.d(t,{N:()=>n});class n{constructor(){this.element=document.createElement("div"),this.element.id="acaw-chat-panel"}}},461048:(e,t,r)=>{"use strict";r.d(t,{GP:()=>a,_N:()=>s,rz:()=>c,vO:()=>o,wh:()=>l});var n=r(973629),i=(0,n.wG)()||(0,n.cX)(),s=i?54:64,o=i?32:20,a=i?32:20,c=14,l=704},223942:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var n="CSM_WIDGET"},111739:(e,t,r)=>{"use strict";r.d(t,{o:()=>l});var n=r(613613),i=r(404399),s=r(494491),o=r(223942),a=r(51918),c=["namespace"],l=e=>{var{target:t,origin:r}=e;if(!t)throw new Error("Target not available");var l=new i.EventEmitter,u=(0,s.ak)(window,{type:"message",listener:e=>{if((0,a.L)(e.data)&&(!e.source||t===e.source)){var r=e.data,{namespace:i}=r,s=(0,n.Z)(r,c);"payload"in s?l.emit(s.type,s.payload):l.emit(s.type)}}});return{send:function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s(l.on(e,t),()=>{l.off(e,t)}),destroy:()=>{u(),l.removeAllListeners()}}}},51918:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var n=r(223942),i=e=>Boolean("object"==typeof e&&e&&"type"in e&&"string"==typeof e.type&&"namespace"in e&&e.namespace===n.A)},413672:(e,t,r)=>{"use strict";r.d(t,{h:()=>i});var n=r(111739);class i{constructor(e,t){this.url=new URL(t);var r=document.createElement("iframe");if(r.src=t,r.style.width="100%",r.style.height="100%",r.style.border="none",r.style.display="block",r.title="Support Widget",r.allow="clipboard-read; clipboard-write *",this.element=r,e.appendChild(this.element),!this.element.contentWindow)throw new Error("Failed to create iframe");var{send:i,on:s}=(0,n.o)({target:this.element.contentWindow,origin:this.url.origin});this.on=s,this.send=i}}},581172:(e,t,r)=>{"use strict";r.d(t,{y:()=>a});var n=r(543860),i=r(966945),s=r(60346),o=r(973629);class a{constructor(){this.client=this.getAnalyticsWebClient()}sendTrackEvent(e){this.client&&this.client.sendTrackEvent(e)}sendUIEvent(e){this.client&&this.client.sendUIEvent(e)}sendOperationalEvent(e){this.client&&this.client.sendOperationalEvent(e)}getAnalyticsWebClient(){try{var e,t,r=(0,o.wG)()||(0,o.cX)(),a=new n.ZP({product:r?"csm":"sac",env:s.eG.env,origin:i.mO.WEB});if(s.eG.config.orgId?a.setTenantInfo(i.ox.ORG_ID,s.eG.config.orgId):s.eG.config.siteId&&a.setTenantInfo(i.ox.CLOUD_ID,s.eG.config.siteId),null!==(e=window.atlassianWidgetConfig)&&void 0!==e&&e.aaId)a.setUserInfo(i.AW.ATLASSIAN_ACCOUNT,null===(t=window.atlassianWidgetConfig)||void 0===t?void 0:t.aaId);return a}catch(e){return}}}},653070:(e,t,r)=>{"use strict";r.d(t,{b:()=>n});var n=()=>({pageUrl:"".concat(window.location.hostname).concat(window.location.pathname),pageDomain:window.location.hostname,pagePath:window.location.pathname,pageTitle:document.title})},60346:(e,t,r)=>{"use strict";r.d(t,{eG:()=>n});var n={baseUrl:"https://jcs-chat-widget.atlassian.com",assetsUrl:"https://jcs-chat-widget.atlassian.com/assets",env:"prod",config:{siteId:"fc6104b4-0280-498f-9a44-cf44642b7dc8",product:"jira",experienceId:"csm-ai",assistanceServiceConfig:{headers:{"X-Cloudid":"fc6104b4-0280-498f-9a44-cf44642b7dc8"}}}}},563874:(e,t,r)=>{"use strict";r.d(t,{NV:()=>o});var n=r(729580),i=r(973629),s="rgba(12, 102, 228, 1)",o=((0,n.Q)("color.100"),(0,n.Q)("color.1000"),(0,n.Q)("color.300"),(0,n.Q)("color.1000"),(0,n.Q)("color.100"),(0,n.Q)("color.800"),(0,n.Q)("color.400"),(0,n.Q)("color.1000"),(0,n.Q)("color.600"),()=>(0,i.wG)()?{searchFieldButton:{defaultBg:"rgba(77, 72, 224, 1)",hoverBg:"rgba(77, 72, 224, 1)",activeBg:"rgba(40, 38, 89, 1)",shadowColor:"rgba(159, 146, 236, 0.4)"},chatBubble:{borderRadius:"20px",backgroundColor:"white",color:"rgb(98, 93, 245)",boxShadow:"0px 0px 12px rgba(30, 31, 33, 0.15), 0px 0px 1px rgba(30, 31, 33, 0.31)",focusBoxShadow:"0px 0px 12px rgba(30, 31, 33, 0.15), 0px 0px 1px rgba(30, 31, 33, 0.31), 0 0 0px 2px rgba(176, 173, 255, 1)",openColor:"white",iconColor:"rgb(98, 93, 245)"},chatPanel:{width:"460px",borderRadius:"24px",boxShadow:"0px 8px 12px rgba(30, 31, 33, 0.15), 0px 0px 1px rgba(30, 31, 33, 0.31)"}}:(0,i.cX)()?{searchFieldButton:{defaultBg:"rgba(0, 124, 128, 1)",hoverBg:"rgba(0, 79, 81, 1)",activeBg:"rgba(0, 50, 51, 1)",shadowColor:"rgba(217, 242, 242, 1)"},chatBubble:{borderRadius:"20px",backgroundColor:"rgba(0, 79, 81, 1)",color:"white",boxShadow:"0px 0px 12px rgba(30, 31, 33, 0.15), 0px 0px 1px rgba(30, 31, 33, 0.31)",focusBoxShadow:"0px 0px 12px rgba(30, 31, 33, 0.15), 0px 0px 1px rgba(30, 31, 33, 0.31), 0 0 0px 2px #79D0D2",openColor:"white",iconColor:"rgba(210, 254, 255, 1)"},chatPanel:{width:"460px",borderRadius:"24px",boxShadow:"0px 8px 12px rgba(30, 31, 33, 0.15), 0px 0px 1px rgba(30, 31, 33, 0.31)"}}:{searchFieldButton:{defaultBg:s,hoverBg:s,activeBg:s,shadowColor:s},chatBubble:{borderRadius:"50%",backgroundColor:s,color:"#fff",boxShadow:"none",focusBoxShadow:"white",openColor:s,iconColor:"white"},chatPanel:{width:"400px",borderRadius:"5px",boxShadow:"rgba(0, 0, 0, 0.16) 0px 5px 40px"}})},973629:(e,t,r)=>{"use strict";r.d(t,{cX:()=>i,wG:()=>n});var n=()=>["localhost","support.loom.com","loom-landing.vercel.app","loom.com","boysenberryinc.atlassian.net","csm-ai-exp-test.jira-dev.com","jcs-loom-staging.jira-dev.com","customer-service.jira-dev.com"].includes(window.location.hostname),i=()=>["mvalentino3.jira-dev.com","csm-leadership-circle.jira-dev.com","leadershipcircle.atlassian.net","support.center.leadershipcircle.com"].includes(window.location.hostname)},258215:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var r=t.type,n=t.listener,i=t.options;return e.addEventListener(r,n,i),function(){e.removeEventListener(r,n,i)}}},494491:(e,t,r)=>{"use strict";t.ak=void 0;var n=r(432070);Object.defineProperty(t,"ak",{enumerable:!0,get:function(){return n.bind}});var i=r(258215)},422774:(e,t,r)=>{"use strict";function n(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}r.d(t,{Z:()=>n})},496256:(e,t,r)=>{"use strict";function n(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}r.d(t,{Z:()=>n})},366818:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(422774),i=r(884602),s=r(496256);function o(e,t){(0,s.Z)(2,arguments);var r=(0,i.Z)(e),o=(0,i.Z)(t),a=r.getTime()-(0,n.Z)(r),c=o.getTime()-(0,n.Z)(o);return Math.round((a-c)/864e5)}},755001:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(600907),i=r(366818),s=r(496256);function o(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function a(e,t){(0,s.Z)(2,arguments);var r=(0,n.Z)(e),a=(0,n.Z)(t),c=o(r,a),l=Math.abs((0,i.Z)(r,a));r.setDate(r.getDate()-c*l);var u=Number(o(r,a)===-c),d=c*(l-u);return 0===d?0:d}},884602:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(600907),i=r(496256);function s(e){(0,i.Z)(1,arguments);var t=(0,n.Z)(e);return t.setHours(0,0,0,0),t}},600907:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(36655),i=r(496256);function s(e){(0,i.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,n.Z)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},61133:e=>{"use strict";var t=new RegExp("(%[a-f0-9]{2})|([^%]+?)","gi"),r=new RegExp("(%[a-f0-9]{2})+","gi");function n(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],n(r),n(i))}function i(e){try{return decodeURIComponent(e)}catch(s){for(var r=e.match(t)||[],i=1;i{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,s||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i{"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),s=0;s{var n,i;!function(s){if(void 0===(i="function"==typeof(n=s)?n.call(t,r,t,e):n)||(e.exports=i),!0,e.exports=s(),!!0){var o=window.Cookies,a=window.Cookies=s();a.noConflict=function(){return window.Cookies=o,a}}}((function(){function e(){for(var e=0,t={};e{"use strict";var t=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function r(e,r){if(e.length!==r.length)return!1;for(var n=0;n{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var a,c=[],l=!1,u=-1;function d(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&h())}function h(){if(!l){var e=o(d);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u1)for(var r=1;r{"use strict";const n=r(434111),i=r(61133),s=r(354867),o=r(686068),a=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function u(e,t){return t.decode?i(e):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function h(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function g(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function p(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"colon-list-separator":return(e,r,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const i="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!i&&u(r,e).includes(e.arrayFormatSeparator);r=s?u(r,e):r;const o=i||s?r.split(e.arrayFormatSeparator).map(t=>u(t,e)):null===r?r:u(r,e);n[t]=o};case"bracket-separator":return(t,r,n)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=r?u(r,e):r);const s=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>u(t,e));void 0!==n[t]?n[t]=[].concat(n[t],s):n[t]=s};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const i of e.split("&")){if(""===i)continue;let[e,o]=s(t.decode?i.replace(/\+/g," "):i,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:u(o,t),r(u(e,t),o,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=g(r[e],t);else n[e]=g(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=h,t.parse=p,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",i,"]"].join("")]:[...r,[l(t,e),"[",l(i,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),":list="].join("")]:[...r,[l(t,e),":list=",l(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[l(r,e),t,l(i,e)].join("")]:[[n,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),i={};for(const t of Object.keys(e))r(t)||(i[t]=e[t]);const s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map(r=>{const i=e[r];return void 0===i?"":null===i?l(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":i.reduce(n(r),[]).join("&"):l(r,t)+"="+l(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:p(h(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const n=d(e.url).split("?")[0]||"",i=t.extract(e.url),s=t.parse(i,{sort:!1}),o=Object.assign(s,e.query);let c=t.stringify(o,r);c&&(c="?"+c);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u="#"+(r[a]?l(e.fragmentIdentifier,r):e.fragmentIdentifier)),`${n}${c}${u}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);const{url:i,query:s,fragmentIdentifier:c}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:o(s,r),fragmentIdentifier:c},n)},t.exclude=(e,r,n)=>{const i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},354867:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},434111:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},324819:(e,t,r)=>{var n=r(598633),i=r(72516),s=i;s.v1=n,s.v4=i,e.exports=s},80026:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,i=t;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},351814:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},598633:(e,t,r)=>{var n,i,s=r(351814),o=r(80026),a=0,c=0;e.exports=function(e,t,r){var l=t&&r||0,u=t||[],d=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==d||null==h){var g=s();null==d&&(d=n=[1|g[0],g[1],g[2],g[3],g[4],g[5]]),null==h&&(h=i=16383&(g[6]<<8|g[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:c+1,f=p-a+(v-c)/1e4;if(f<0&&void 0===e.clockseq&&(h=h+1&16383),(f<0||p>a)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,c=v,i=h;var m=(1e4*(268435455&(p+=122192928e5))+v)%4294967296;u[l++]=m>>>24&255,u[l++]=m>>>16&255,u[l++]=m>>>8&255,u[l++]=255&m;var y=p/4294967296*1e4&268435455;u[l++]=y>>>8&255,u[l++]=255&y,u[l++]=y>>>24&15|16,u[l++]=y>>>16&255,u[l++]=h>>>8|128,u[l++]=255&h;for(var _=0;_<6;++_)u[l+_]=d[_];return t||o(u)}},72516:(e,t,r)=>{var n=r(351814),i=r(80026);e.exports=function(e,t,r){var s=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var a=0;a<16;++a)t[s+a]=o[a];return t||i(o)}},425369:(e,t,r)=>{"use strict";var n,i,s;Object.defineProperty(t,"__esModule",{value:!0}),t._getInstance=t._getStatsigGlobalFlag=t._getStatsigGlobal=void 0;const o=r(483482);t._getStatsigGlobal=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:u}catch(e){return u}};t._getStatsigGlobalFlag=e=>(0,t._getStatsigGlobal)()[e];t._getInstance=e=>{const r=(0,t._getStatsigGlobal)();return e?r.instances&&r.instances[e]:(r.instances&&Object.keys(r.instances).length>1&&o.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."),r.firstInstance)};const a="undefined"!=typeof window?window:{},c={},l="undefined"!=typeof globalThis?globalThis:{},u=null!==(s=null!==(i=null!==(n=a.__STATSIG__)&&void 0!==n?n:c.__STATSIG__)&&void 0!==i?i:l.__STATSIG__)&&void 0!==s?s:{instance:t._getInstance};a.__STATSIG__=u,c.__STATSIG__=u,l.__STATSIG__=u},761925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;const n=r(107162);function i(e,t,r){var i;if(r)return r(e,t);const s=t&&t.customIDs?t.customIDs:{},o=["uid:"+(null!==(i=null==t?void 0:t.userID)&&void 0!==i?i:""),"cids:"+Object.keys(s).sort((e,t)=>e.localeCompare(t)).map(e=>`${e}-${s[e]}`).join(","),"k:"+e];return(0,n._DJB2)(o.join("|"))}t._getUserStorageKey=i,t._getStorageKey=function(e,t,r){return t?i(e,t,r):(0,n._DJB2)("k:"+e)}},786443:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},774918:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;const i=r(483482),s=r(149009),o=r(574238),a=r(481485),c=r(752918);function l(e,t,r,n){return{source:e,data:t,receivedAt:Date.now(),stableID:r,fullUserHash:(0,o._getFullUserHash)(n)}}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 u}attach(e,t,r){this._sdkKey=e,this._options=t}getDataSync(e){const t=e&&(0,o._normalizeUser)(e,this._options),r=this._getCacheKey(t),n=this._inMemoryCache.get(r,t);if(n&&this._getIsCacheValueValid(n))return n;const i=this._loadFromCache(r);return i&&this._getIsCacheValueValid(i)?(this._inMemoryCache.add(r,i),this._inMemoryCache.get(r,t)):null}setData(e,t){const r=t&&(0,o._normalizeUser)(t,this._options),n=this._getCacheKey(r);this._inMemoryCache.add(n,l("Bootstrap",e,null,r))}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===s.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,t,r){return n(this,void 0,void 0,(function*(){a.Storage.isReady()||(yield a.Storage.isReadyResolver());const n=null!=e?e:this.getDataSync(t),s=[this._fetchAndPrepFromNetwork(n,t,r)];return(null==r?void 0:r.timeoutMs)&&s.push(new Promise(e=>setTimeout(e,r.timeoutMs)).then(()=>(i.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(s)}))}_prefetchDataImpl(e,t){return n(this,void 0,void 0,(function*(){const r=e&&(0,o._normalizeUser)(e,this._options),n=this._getCacheKey(r),i=yield this._getDataAsyncImpl(null,r,t);i&&this._inMemoryCache.add(n,Object.assign(Object.assign({},i),{source:"Prefetch"}))}))}_fetchAndPrepFromNetwork(e,t,r){return n(this,void 0,void 0,(function*(){var n;const o=null!==(n=null==e?void 0:e.data)&&void 0!==n?n:null,a=null!=e&&this._isCachedResultValidFor204(e,t),u=yield this._fetchFromNetwork(o,t,r,a);if(!u)return i.Log.debug("No response returned for latest value"),null;const d=(0,c._typedJsonParse)(u,"has_updates","Response"),h=this._getSdkKey(),g=s.StableID.get(h);let p=null;if(!0===(null==d?void 0:d.has_updates))p=l("Network",u,g,t);else{if(!o||!1!==(null==d?void 0:d.has_updates))return null;p=l("NetworkNotModified",o,g,t)}const v=this._getCacheKey(t);return this._inMemoryCache.add(v,p),this._writeToCache(v,p),p}))}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(i.Log.error(this._adapterName+" is not attached to a Client"),"")}_loadFromCache(e){var t;const r=null===(t=a.Storage.getItem)||void 0===t?void 0:t.call(a.Storage,e);if(null==r)return null;const n=(0,c._typedJsonParse)(r,"source","Cached Result");return n?Object.assign(Object.assign({},n),{source:"Cache"}):null}_writeToCache(e,t){a.Storage.setItem(e,JSON.stringify(t)),this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e){var t;const r=null!==(t=(0,a._getObjectFromStorage)(this._lastModifiedStoreKey))&&void 0!==t?t:{};r[e]=Date.now();const n=d(r,10);n&&(delete r[n],a.Storage.removeItem(n)),(0,a._setObjectInStorage)(this._lastModifiedStoreKey,r)}},t._makeDataAdapterResult=l;class u{constructor(){this._data={}}get(e,t){var r;const n=this._data[e],s=null==n?void 0:n.stableID,o=null===(r=null==t?void 0:t.customIDs)||void 0===r?void 0:r.stableID;return o&&s&&o!==s?(i.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):n}add(e,t){const r=d(this._data,9);r&&delete this._data[r],this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function d(e,t){const r=Object.keys(e);return r.length<=t?null:r.reduce((t,r)=>{const n=e[t],i=e[r];return"object"==typeof n&&"object"==typeof i?i.receivedAt{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Diagnostics=void 0;const r=new Map;function n(e,t,r,n){return Object.assign({key:r,action:t,step:n,timestamp:Date.now()},e)}function i(e,t){var n;const i=null!==(n=r.get(e))&&void 0!==n?n:[];i.push(t),r.set(e,i)}function s(e,t){if(t in e)return e[t]}t.Diagnostics={_getMarkers:e=>r.get(e),_markInitOverallStart:e=>{i(e,n({},"start","overall"))},_markInitOverallEnd:(e,t,r)=>{i(e,n({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:r},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{i(e,n(t,"start","initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{i(e,n(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{i(e,n({},"start","initialize","process"))},_markInitProcessEnd:(e,t)=>{i(e,n(t,"end","initialize","process"))},_clearMarkers:e=>{r.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:s(e,"code"),name:s(e,"name"),message:s(e,"message")}},_getDiagnosticsData(e,r,n,i){var s;return{success:!0===(null==e?void 0:e.ok),statusCode:null==e?void 0:e.status,sdkRegion:null===(s=null==e?void 0:e.headers)||void 0===s?void 0:s.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:r,error:t.Diagnostics._formatError(i)}},_enqueueDiagnosticsEvent(e,r,n,i){const s=t.Diagnostics._getMarkers(n);if(null==s||s.length<=0)return-1;const o=s[s.length-1].timestamp-s[0].timestamp;t.Diagnostics._clearMarkers(n);const a=function(e,t){return{eventName:"statsig::diagnostics",user:e,value:null,metadata:t,time:Date.now()}}(e,{context:"initialize",markers:s.slice(),statsigOptions:i});return r.enqueue(a),o}}},885383:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;const n=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"];t._fetchTxtRecords=function(e){return r(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:n});if(!t.ok){const e=new Error("Failed to fetch TXT records from DNS");throw e.name="DnsTxtFetchError",e}const r=yield t.arrayBuffer();return function(e){const t=e.findIndex((t,r)=>r<200&&"="===String.fromCharCode(t)&&i.includes(String.fromCharCode(e[r-1])));if(-1===t){const e=new Error("Failed to parse TXT records from DNS");throw e.name="DnsTxtParseError",e}let r="";for(let n=t-1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},146837:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundary=t.EXCEPTION_ENDPOINT=void 0;const i=r(483482),s=r(961480),o=r(788559);t.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";function a(e){return e instanceof Error?e:"string"==typeof e?new Error(e):new Error("An unknown error occurred.")}function c(e){if(!e)return{};const t={};return Object.entries(e).forEach(([e,r])=>{switch(typeof r){case"number":case"bigint":case"boolean":t[String(e)]=r;break;case"string":r.length<50?t[String(e)]=r:t[String(e)]="set";break;case"object":"environment"===e?t.environment=r:"networkConfig"===e?t.networkConfig=r:t[String(e)]=null!=r?"set":"unset"}}),t}t.ErrorBoundary=class{constructor(e,t,r,n){this._sdkKey=e,this._options=t,this._emitter=r,this._lastSeenError=n,this._seen=new Set}wrap(e){try{const t=e;(function(e){const t=new Set;let r=Object.getPrototypeOf(e);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).filter(e=>"function"==typeof(null==r?void 0:r[e])).forEach(e=>t.add(e)),r=Object.getPrototypeOf(r);return Array.from(t)})(t).forEach(r=>{const n=t[r];"$EB"in n||(t[r]=(...t)=>this._capture(r,()=>n.apply(e,t)),t[r].$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=a(e))}_capture(e,t){try{const r=t();return r&&r instanceof Promise?r.catch(t=>this._onError(e,t)):r}catch(t){return this._onError(e,t),null}}_onError(e,r){try{i.Log.warn("Caught error in "+e,{error:r});(()=>n(this,void 0,void 0,(function*(){var n,i,l,u,d,h,g;const p=r||Error("[Statsig] UnknownError"),v=p instanceof Error,f=v?p.name:"No Name",m=a(p);if(this._lastSeenError=m,this._seen.has(f))return;if(this._seen.add(f),null===(i=null===(n=this._options)||void 0===n?void 0:n.networkConfig)||void 0===i?void 0:i.preventAllNetworkTraffic)return void(null===(l=this._emitter)||void 0===l||l.call(this,{name:"error",error:r,tag:e}));const y=s.SDKType._get(this._sdkKey),_=o.StatsigMetadataProvider.get(),b=v?p.stack:function(e){try{return JSON.stringify(e)}catch(e){return"[Statsig] UnknownError"}}(p),w=Object.assign({tag:e,exception:f,info:b,statsigOptions:c(this._options)},Object.assign(Object.assign({},_),{sdkType:y})),E=null!==(h=null===(d=null===(u=this._options)||void 0===u?void 0:u.networkConfig)||void 0===d?void 0:d.networkOverrideFunc)&&void 0!==h?h:fetch;yield E(t.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(y),"STATSIG-SDK-VERSION":String(_.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(w)}),null===(g=this._emitter)||void 0===g||g.call(this,{name:"error",error:r,tag:e})})))().then(()=>{}).catch(()=>{})}catch(e){}}}},335308:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},729748:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35101:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;const i=r(761925),s=r(107162),o=r(483482),a=r(929464),c=r(935407),l=r(346400),u=r(718435),d=r(481485),h=r(154144),g=r(58678),p={},v="startup",f="gained_focus";class m{static _safeFlushAndForget(e){var t;null===(t=p[e])||void 0===t||t.flush().catch(()=>{})}static _safeRetryFailedLogs(e){var t;null===(t=p[e])||void 0===t||t._retryFailedLogs(f)}constructor(e,t,r,n){var i,s;this._sdkKey=e,this._emitter=t,this._network=r,this._options=n,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=null!==(i=null==n?void 0:n.loggingEnabled)&&void 0!==i?i:!0===(null==n?void 0:n.disableLogging)?u.LoggingEnabledOption.disabled:u.LoggingEnabledOption.browserOnly,(null==n?void 0:n.loggingEnabled)&&void 0!==n.disableLogging&&o.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=null!==(s=null==n?void 0:n.loggingBufferMaxSize)&&void 0!==s?s:100;const c=null==n?void 0:n.networkConfig;this._logEventUrlConfig=new h.UrlConfiguration(a.Endpoint._rgstr,null==c?void 0:c.logEventUrl,null==c?void 0:c.api,null==c?void 0:c.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&&m._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(e){var t;const r=null!==(t=this._nonExposedChecks[e])&&void 0!==t?t:0;this._nonExposedChecks[e]=r+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e;const t=(0,c._isServerEnv)();t&&"always"!==(null===(e=this._options)||void 0===e?void 0:e.loggingEnabled)||(p[this._sdkKey]=this,t||(0,g._subscribeToVisiblityChanged)(e=>{"background"===e?m._safeFlushAndForget(this._sdkKey):"foreground"===e&&m._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(v),this._startBackgroundFlushInterval())}stop(){return n(this,void 0,void 0,(function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete p[this._sdkKey],yield this.flush()}))}flush(){return n(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(()=>m._safeFlushAndForget(this._sdkKey),200))}_shouldLogEvent(e){var t;if("always"!==(null===(t=this._options)||void 0===t?void 0:t.loggingEnabled)&&(0,c._isServerEnv)())return!1;if(!(0,l._isExposureEvent)(e))return!0;const r=e.user?e.user:{statsigEnvironment:void 0},n=(0,i._getUserStorageKey)(this._sdkKey,r),s=e.metadata?e.metadata:{},o=[e.eventName,n,s.gate,s.config,s.ruleID,s.allocatedExperiment,s.parameterName,String(s.isExplicitParameter),s.reason].join("|"),a=this._lastExposureTimeMap[o],u=Date.now();return!(a&&u-a<6e5)&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[o]=u,!0)}_sendEvents(e){return n(this,void 0,void 0,(function*(){var t,r;if("disabled"===this._loggingEnabled)return this._saveFailedLogsToStorage(e),!1;try{const n=(0,g._isUnloading)()&&this._network.isBeaconSupported()&&null==(null===(r=null===(t=this._options)||void 0===t?void 0:t.networkConfig)||void 0===r?void 0:r.networkOverrideFunc);this._emitter({name:"pre_logs_flushed",events:e});return(n?this._sendEventsViaBeacon(e):yield this._sendEventsViaPost(e)).success?(this._emitter({name:"logs_flushed",events:e}),!0):(o.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(e),!1)}catch(e){return o.Log.warn("Failed to flush events."),!1}}))}_sendEventsViaPost(e){return n(this,void 0,void 0,(function*(){var t;const r=yield this._network.post(this._getRequestData(e)),n=null!==(t=null==r?void 0:r.code)&&void 0!==t?t:-1;return{success:n>=200&&n<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:{[a.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){o.Log.warn("Unable to save failed logs to storage")}}_retryFailedLogs(e){const t=this._getStorageKey();(()=>n(this,void 0,void 0,(function*(){d.Storage.isReady()||(yield d.Storage.isReadyResolver());const r=(0,d._getObjectFromStorage)(t);if(!r)return;e===v&&d.Storage.removeItem(t);(yield this._sendEvents(r))&&e===f&&d.Storage.removeItem(t)})))().catch(()=>{o.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return"statsig.failed_logs."+(0,s._DJB2)(this._sdkKey)}_normalizeAndAppendEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);const t={},r=this._getCurrentPageUrl();r&&(t.statsigMetadata={currentPage:r});const n=Object.assign(Object.assign({},e),t);o.Log.debug("Enqueued Event:",n),this._queue.push(n)}_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,c._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var e,t;const r=null!==(t=null===(e=this._options)||void 0===e?void 0:e.loggingIntervalMs)&&void 0!==t?t:1e4,n=setInterval(()=>{const e=p[this._sdkKey];e&&e._flushIntervalId===n?m._safeFlushAndForget(this._sdkKey):clearInterval(n)},r);this._flushIntervalId=n}}t.EventLogger=m},107162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getSortedObject=t._DJB2Object=t._DJB2=void 0;const n=r(16853);t._DJB2=e=>{let t=0;for(let r=0;r>>0)};t._DJB2Object=(e,r)=>(0,t._DJB2)(JSON.stringify((0,t._getSortedObject)(e,r)));t._getSortedObject=(e,r)=>{if(null==e)return null;const i=Object.keys(e).sort(),s={};return i.forEach(i=>{const o=e[i];0!==r&&"object"===(0,n._typeOf)(o)?s[i]=(0,t._getSortedObject)(o,null!=r?r-1:r):s[i]=o}),s}},442947:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},483482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0;function r(e){return e.unshift("[Statsig]"),e}t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...e){n.level>=t.LogLevel.Info&&console.info(" INFO ",...r(e))}static debug(...e){n.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...r(e))}static warn(...e){n.level>=t.LogLevel.Warn&&console.warn(" WARN ",...r(e))}static error(...e){n.level>=t.LogLevel.Error&&console.error(" ERROR ",...r(e))}}t.Log=n,n.level=t.LogLevel.Warn},959479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const r=new Set([]),n=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,i){let s=`${e}|${t}`;if(!i)return s;for(const e of Object.keys(i)){if(n.has(e))return;r.has(e)?s+=`|${e}=true`:s+=`|${e}=${i[e]}`}return s}},929464:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},557695:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=void 0,r(425369);const i=r(425369),s=r(734746),o=r(483482),a=r(929464),c=r(471009),l=r(869447),u=r(961480),d=r(935407),h=r(966232),g=r(149009),p=r(320464),v=r(788559),f=r(718435),m=r(58678),y=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 c.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(!_(e))return!1;const t=this._getInternalRequestArgs("POST",e),r=this._getPopulatedURL(t),n=navigator;return n.sendBeacon.bind(n)(r,t.body)}post(e){return n(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 n(this,void 0,void 0,(function*(){var t,r,i,c;if(!_(e))return null;if(this._netConfig.preventAllNetworkTraffic)return null;const{method:l,body:u,retries:d,attempt:h}=e,g=e.urlConfig.endpoint;if(this._isRateLimited(g))return o.Log.warn(`Request to ${g} was blocked because you are making requests too frequently.`),null;const v=null!=h?h:1,f="undefined"!=typeof AbortController?new AbortController:null,b=setTimeout(()=>{null==f||f.abort(`Timeout of ${this._timeout}ms expired.`)},this._timeout),E=this._getPopulatedURL(e);let I=null;const O=(0,m._isUnloading)();try{const r={method:l,body:u,headers:Object.assign({},e.headers),signal:null==f?void 0:f.signal,priority:e.priority,keepalive:O};!function(e,t){if(e.urlConfig.endpoint!==a.Endpoint._initialize)return;s.Diagnostics._markInitNetworkReqStart(e.sdkKey,{attempt:t})}(e,v);const n=this._leakyBucket[g];n&&(n.lastRequestTime=Date.now(),this._leakyBucket[g]=n);const i=null!==(t=this._netConfig.networkOverrideFunc)&&void 0!==t?t:fetch;if(I=yield i(E,r),clearTimeout(b),!I.ok){const e=yield I.text().catch(()=>"No Text"),t=new Error(`NetworkError: ${E} ${e}`);throw t.name="NetworkError",t}const o=yield I.text();return w(e,I,v,o),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:o,code:I.status}}catch(t){const s=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"}(f,t),a=(null==(S=f)?void 0:S.signal.aborted)&&"string"==typeof S.signal.reason&&S.signal.reason.includes("Timeout")||!1;w(e,I,v,"",t);if((yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,s,a))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!d||v>d||!y.has(null!==(r=null==I?void 0:I.status)&&void 0!==r?r:500)){null===(i=this._emitter)||void 0===i||i.call(this,{name:"error",error:t,tag:p.ErrorTag.NetworkError,requestArgs:e});const r=`A networking error occurred during ${l} request to ${E}.`;return o.Log.error(r,s,t),null===(c=this._errorBoundary)||void 0===c||c.attachErrorIfNoneExists(r),null}return yield function(e){return n(this,void 0,void 0,(function*(){yield new Promise(t=>setTimeout(t,Math.min(e*e*500,3e4)))}))}(v),this._sendRequest(Object.assign(Object.assign({},e),{retries:d,attempt:v+1}))}var S}))}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t||!0!==(null==e?void 0:e.disableCompression)||(t=f.LogEventCompressionMode.Disabled),t||(t=f.LogEventCompressionMode.Enabled),t}_isRateLimited(e){var t;const r=Date.now(),n=null!==(t=this._leakyBucket[e])&&void 0!==t?t:{count:0,lastRequestTime:r},i=r-n.lastRequestTime,s=Math.floor(.05*i);return n.count=Math.max(0,n.count-s),n.count>=50||(n.count+=1,n.lastRequestTime=r,this._leakyBucket[e]=n,!1)}_getPopulatedURL(e){var t;const r=null!==(t=e.fallbackUrl)&&void 0!==t?t:e.urlConfig.getUrl();e.urlConfig.endpoint!==a.Endpoint._initialize&&e.urlConfig.endpoint!==a.Endpoint._download_config_specs||(this._lastUsedInitUrl=r);const n=Object.assign({[a.NetworkParam.SdkKey]:e.sdkKey,[a.NetworkParam.SdkType]:u.SDKType._get(e.sdkKey),[a.NetworkParam.SdkVersion]:v.SDK_VERSION,[a.NetworkParam.Time]:String(Date.now()),[a.NetworkParam.SessionID]:h.SessionID.get(e.sdkKey)},e.params),i=Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&");return`${r}${i?"?"+i:""}`}_tryEncodeBody(e){var t;const r=(0,d._getWindowSafe)(),n=e.body;if(e.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof n&&null==(0,i._getStatsigGlobalFlag)("no-encode")&&(null==r?void 0:r.btoa))try{e.body=r.btoa(n).split("").reverse().join(""),e.params=Object.assign(Object.assign({},null!==(t=e.params)&&void 0!==t?t:{}),{[a.NetworkParam.StatsigEncoded]:"1"})}catch(t){o.Log.warn("Request encoding failed for "+e.urlConfig.getUrl(),t)}}_tryToCompressBody(e){return n(this,void 0,void 0,(function*(){var t;const r=e.body;if("string"==typeof r&&function(e,t){if(!e.isCompressable)return!1;if(null!=(0,i._getStatsigGlobalFlag)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return!1;const r=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,n=!0===l.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case f.LogEventCompressionMode.Disabled:return!1;case f.LogEventCompressionMode.Enabled:return!(r&&!n);case f.LogEventCompressionMode.Forced:return!0;default:return!1}}(e,this._options))try{const n=(new TextEncoder).encode(r),i=new CompressionStream("gzip"),s=i.writable.getWriter();s.write(n).catch(o.Log.error),s.close().catch(o.Log.error);const c=i.readable.getReader(),l=[];let u;for(;!(u=yield c.read()).done;)l.push(u.value);const d=l.reduce((e,t)=>e+t.length,0),h=new Uint8Array(d);let g=0;for(const e of l)h.set(e,g),g+=e.length;e.body=h,e.params=Object.assign(Object.assign({},null!==(t=e.params)&&void 0!==t?t:{}),{[a.NetworkParam.IsGzipped]:"1"})}catch(t){o.Log.warn("Request compression failed for "+e.urlConfig.getUrl(),t)}}))}_getInternalRequestArgs(e,t){const r=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),n=Object.assign(Object.assign({},t),{method:e,fallbackUrl:r});return"data"in t&&b(n,t.data),n}};const _=e=>!!e.sdkKey||(o.Log.warn("Unable to make request without an SDK key"),!1),b=(e,t)=>{const{sdkKey:r,fallbackUrl:n}=e,i=g.StableID.get(r),s=h.SessionID.get(r),o=u.SDKType._get(r);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},v.StatsigMetadataProvider.get()),{stableID:i,sessionID:s,sdkType:o,fallbackUrl:n})}))};function w(e,t,r,n,i){e.urlConfig.endpoint===a.Endpoint._initialize&&s.Diagnostics._markInitNetworkReqEnd(e.sdkKey,s.Diagnostics._getDiagnosticsData(t,r,n,i))}},471009:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;const i=r(885383),s=r(107162),o=r(483482),a=r(481485);function c(e,t){var r;const n=null!==(r=null==e?void 0:e.toLowerCase())&&void 0!==r?r:"";return t||n.includes("uncaught exception")||n.includes("failed to fetch")||n.includes("networkerror when attempting to fetch resource")}function l(e){return"statsig.network_fallback."+(0,s._DJB2)(e)}function u(e,t){const r=l(e);t&&0!==Object.keys(t).length?a.Storage.setItem(r,JSON.stringify(t)):a.Storage.removeItem(r)}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 r;const n=null===(r=this._fallbackInfo)||void 0===r?void 0:r[t.endpoint];n&&(n.expiryTime=Date.now()+6048e5,u(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:n})))}getActiveFallbackUrl(e,t){var r,n;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let i=this._fallbackInfo;null==i&&(i=null!==(r=function(e){const t=l(e),r=a.Storage.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return o.Log.error("Failed to parse FallbackInfo"),null}}(e))&&void 0!==r?r:{},this._fallbackInfo=i);const s=i[t.endpoint];return!s||Date.now()>(null!==(n=s.expiryTime)&&void 0!==n?n:0)||t.getChecksum()!==s.urlConfigChecksum?(delete i[t.endpoint],this._fallbackInfo=i,u(e,this._fallbackInfo),null):s.url?s.url:null}tryFetchUpdatedFallbackInfo(e,t,r,i){return n(this,void 0,void 0,(function*(){var n,s;try{if(!c(r,i))return!1;const s=null==t.customUrl&&null==t.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(t):t.fallbackUrls,o=this._pickNewFallbackUrl(null===(n=this._fallbackInfo)||void 0===n?void 0:n[t.endpoint],s);return!!o&&(this._updateFallbackInfoWithNewUrl(e,t,o),!0)}catch(e){return null===(s=this._errorBoundary)||void 0===s||s.logError("tryFetchUpdatedFallbackInfo",e),!1}}))}_updateFallbackInfoWithNewUrl(e,t,r){var n,i,s;const o={urlConfigChecksum:t.getChecksum(),url:r,expiryTime:Date.now()+6048e5,previous:[]},a=t.endpoint,c=null===(n=this._fallbackInfo)||void 0===n?void 0:n[a];c&&o.previous.push(...c.previous),o.previous.length>10&&(o.previous=[]);const l=null===(s=null===(i=this._fallbackInfo)||void 0===i?void 0:i[a])||void 0===s?void 0:s.url;null!=l&&o.previous.push(l),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[a]:o}),u(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return n(this,void 0,void 0,(function*(){var t;const r=this._dnsQueryCooldowns[e.endpoint];if(r&&Date.now()1){let e=r[1];e.endsWith("/")&&(e=e.slice(0,-1)),n.push(`https://${e}${o}`)}}return n}))}_pickNewFallbackUrl(e,t){var r;if(null==t)return null;const n=new Set(null!==(r=null==e?void 0:e.previous)&&void 0!==r?r:[]),i=null==e?void 0:e.url;let s=null;for(const e of t){const t=e.endsWith("/")?e.slice(0,-1):e;if(!n.has(e)&&t!==i){s=t;break}}return s}},t._isDomainFailure=c},468348:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},664318:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},869447:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;const r={};t.SDKFlags={setFlags:(e,t)=>{r[e]=t},get:(e,t)=>{var n,i;return null!==(i=null===(n=r[e])||void 0===n?void 0:n[t])&&void 0!==i&&i}}},961480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;const r={};let n;t.SDKType={_get:e=>{var t;return(null!==(t=r[e])&&void 0!==t?t:"js-mono")+(null!=n?n:"")},_setClientType(e,t){r[e]=t},_setBindingType(e){n&&"-react"!==n||(n="-"+e)}}},935407:(e,t,r)=>{"use strict";var n=r(13158);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 r=(0,t._getWindowSafe)();return null!==(e=null==r?void 0:r.document)&&void 0!==e?e:null};t._isServerEnv=()=>{if(null!==(0,t._getDocumentSafe)())return!1;const e=void 0!==n&&null!=n.versions&&null!=n.versions.node;return"string"==typeof EdgeRuntime||e};t._addWindowEventListenerSafe=(e,r)=>{const n=(0,t._getWindowSafe)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(e,r)};t._addDocumentEventListenerSafe=(e,r)=>{const n=(0,t._getDocumentSafe)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(e,r)};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"}},966232:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;const n=r(425369),i=r(761925),s=r(483482),o=r(481485),a=r(704314),c={};function l(e,t){return setTimeout(()=>{var t;const r=null===(t=(0,n._getStatsigGlobal)())||void 0===t?void 0:t.instance(e);r&&r.$emt({name:"session_expired"})},t)}function u(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=u(e);return(0,o._getObjectFromStorage)(t)}(e);const r=Date.now();t||(t={sessionID:(0,a.getUUID)(),startTime:r,lastUpdate:r});return{data:t,sdkKey:e}}(e));return function(e){const t=Date.now(),r=e.data,n=e.sdkKey;if(function({lastUpdate:e}){return Date.now()-e>18e5}(r)||function({startTime:e}){return Date.now()-e>144e5}(r)){r.sessionID=(0,a.getUUID)(),r.startTime=t;const e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(n);e&&e.$emt({name:"session_expired"})}r.lastUpdate=t,function(e,t){const r=u(t);try{(0,o._setObjectInStorage)(r,e)}catch(e){s.Log.warn("Failed to save SessionID")}}(r,e.sdkKey),clearTimeout(e.idleTimeoutID),clearTimeout(e.ageTimeoutID);const i=t-r.startTime;return e.idleTimeoutID=l(n,18e5),e.ageTimeoutID=l(n,144e5-i),e}(c[e])},overrideInitialSessionID:(e,t)=>{c[t]=function(e,t){const r=Date.now();return{data:{sessionID:e,startTime:r,lastUpdate:r},sdkKey:t}}(e,t)}}},761657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._fastApproxSizeOf=void 0;t._fastApproxSizeOf=(e,r)=>{let n=0;const i=Object.keys(e);for(let s=0;s=r)return n}return n}},149009:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StableID=void 0;const n=r(761925),i=r(483482),s=r(935407),o=r(481485),a=r(704314),c={},l={},u={};function d(e){return"statsig.stable_id."+(0,n._getStorageKey)(e)}function h(e,t){const r=d(t);try{(0,o._setObjectInStorage)(r,e)}catch(e){i.Log.warn("Failed to save StableID to storage")}}function g(e,t){if(!l[t]||!document)return;const r=new Date;r.setFullYear(r.getFullYear()+1),document.cookie=`${p(t)}=${encodeURIComponent(e)}; expires=${r.toUTCString()}; path=/`}function p(e){return"statsig.stable_id."+(0,n._getStorageKey)(e)}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(u[e])return null;if(null!=c[e])return c[e];let t=null;return t=function(e){if(!l[e]||null==(0,s._getDocumentSafe)())return null;const t=document.cookie.split(";");for(const r of t){const[t,n]=r.trim().split("=");if(t===p(e))return decodeURIComponent(n)}return null}(e),null!=t?(c[e]=t,h(t,e),t):(t=function(e){const t=d(e);return(0,o._getObjectFromStorage)(t)}(e),null==t&&(t=(0,a.getUUID)()),h(t,e),g(t,e),c[e]=t,t)},setOverride:(e,t)=>{c[t]=e,h(e,t),g(e,t)},_setCookiesEnabled:(e,t)=>{l[e]=t},_setDisabled:(e,t)=>{u[e]=t}}},394084:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,r(425369);const i=r(425369),s=r(146837),o=r(35101),a=r(483482),c=r(959479),l=r(935407),u=r(966232),d=r(149009),h=r(718435),g=r(481485);t.StatsigClientBase=class{constructor(e,t,r,n){var c,h,p,v;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const f=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),(null==n?void 0:n.disableStorage)&&g.Storage._setDisabled(!0),(null==n?void 0:n.initialSessionID)&&u.StatsigSession.overrideInitialSessionID(n.initialSessionID,e),(null==n?void 0:n.storageProvider)&&g.Storage._setProvider(n.storageProvider),(null==n?void 0:n.enableCookies)&&d.StableID._setCookiesEnabled(e,n.enableCookies),(null==n?void 0:n.disableStableID)&&d.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=n?n:{},this._memoCache={},this.overrideAdapter=null!==(c=null==n?void 0:n.overrideAdapter)&&void 0!==c?c:null,this._logger=new o.EventLogger(e,f,r,n),this._errorBoundary=new s.ErrorBoundary(e,n,f),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),r.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,n,r),this.storageProvider=g.Storage,null===(v=null===(p=null===(h=this.overrideAdapter)||void 0===h?void 0:h.loadFromStorage)||void 0===p?void 0:p.call(h))||void 0===v||v.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),function(e,t){var r;if((0,l._isServerEnv)())return;const n=(0,i._getStatsigGlobal)(),s=null!==(r=n.instances)&&void 0!==r?r:{},o=t;null!=s[e]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys.");s[e]=o,n.firstInstance||(n.firstInstance=o);n.instances=s,__STATSIG__=n}(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,g.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(h.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return n(this,void 0,void 0,(function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()}))}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){if(this._listeners[e]){const r=this._listeners[e].indexOf(t);-1!==r&&this._listeners[e].splice(r,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;const r=t=>{try{t(e)}catch(r){if(!0===t.__isInternal)return void this._errorBoundary.logError("__emit:"+e.name,r);a.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=>r(e)),null===(t=this._listeners["*"])||void 0===t||t.forEach(r)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,r){!0!==(null==r?void 0:r.disableExposureLog)?this._logger.enqueue(t):this._logger.incrementNonExposureCount(e)}_memoize(e,t){return(r,n)=>{if(this._options.disableEvaluationMemoization)return t(r,n);const i=(0,c.createMemoKey)(e,r,n);return i?(i in this._memoCache||(Object.keys(this._memoCache).length>=3e3&&(this._memoCache={}),this._memoCache[i]=t(r,n)),this._memoCache[i]):t(r,n)}}}},320464:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},862098:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},346400:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;const r=(e,t,r,n,s)=>(r.bootstrapMetadata&&(n.bootstrapMetadata=r.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:i(r,n),secondaryExposures:s,time:Date.now()});t._isExposureEvent=({eventName:e})=>"statsig::gate_exposure"===e||"statsig::config_exposure"===e||"statsig::layer_exposure"===e;function n(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}t._createGateExposure=(e,t,i)=>{var s,o,a;const c={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return null!=(null===(s=t.__evaluation)||void 0===s?void 0:s.version)&&(c.configVersion=t.__evaluation.version),r("statsig::gate_exposure",e,t.details,c,n(null!==(a=null===(o=t.__evaluation)||void 0===o?void 0:o.secondary_exposures)&&void 0!==a?a:[],i))},t._mapExposures=n;t._createConfigExposure=(e,t,i)=>{var s,o,a,c;const l={config:t.name,ruleID:t.ruleID};return null!=(null===(s=t.__evaluation)||void 0===s?void 0:s.version)&&(l.configVersion=t.__evaluation.version),null!=(null===(o=t.__evaluation)||void 0===o?void 0:o.passed)&&(l.rulePassed=String(t.__evaluation.passed)),r("statsig::config_exposure",e,t.details,l,n(null!==(c=null===(a=t.__evaluation)||void 0===a?void 0:a.secondary_exposures)&&void 0!==c?c:[],i))};t._createLayerParameterExposure=(e,t,i,s)=>{var o,a,c,l,u,d,h;const g=t.__evaluation,p=!0===(null===(o=null==g?void 0:g.explicit_parameters)||void 0===o?void 0:o.includes(i));let v="",f=null!==(a=null==g?void 0:g.undelegated_secondary_exposures)&&void 0!==a?a:[];p&&(v=null!==(c=g.allocated_experiment_name)&&void 0!==c?c:"",f=null!==(l=g.secondary_exposures)&&void 0!==l?l:[]);const m=null===(u=t.__evaluation)||void 0===u?void 0:u.parameter_rule_ids,y={config:t.name,parameterName:i,ruleID:null!==(d=null==m?void 0:m[i])&&void 0!==d?d:t.ruleID,allocatedExperiment:v,isExplicitParameter:String(p)};return null!=(null===(h=t.__evaluation)||void 0===h?void 0:h.version)&&(y.configVersion=t.__evaluation.version),r("statsig::layer_exposure",e,t.details,y,n(f,s))};const i=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},788559:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.21.1";let r={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>r,add:e=>{r=Object.assign(Object.assign({},r),e)}}},718435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingEnabledOption=t.LogEventCompressionMode=void 0,t.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},t.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},888899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0;const n=r(483482),i=r(16853);function s(e,t,r,n){var i;return{name:e,details:t,ruleID:null!==(i=null==r?void 0:r.rule_id)&&void 0!==i?i:"",__evaluation:r,value:n}}function o(e,t,r){var n;const i=null!==(n=null==r?void 0:r.value)&&void 0!==n?n:{};return Object.assign(Object.assign({},s(e,t,r,i)),{get:a(e,null==r?void 0:r.value)})}function a(e,t,r){return(s,o)=>{var a;const c=null!==(a=null==t?void 0:t[s])&&void 0!==a?a:null;return null==c?null!=o?o:null:null==o||(0,i._isTypeMatch)(c,o)?(null==r||r(s),c):(n.Log.warn(`Parameter type mismatch. '${e}.${s}' was found to be type '${typeof c}' but fallback/return type is '${typeof o}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=o?o:null)}}t._makeFeatureGate=function(e,t,r){var n;return Object.assign(Object.assign({},s(e,t,r,!0===(null==r?void 0:r.value))),{idType:null!==(n=null==r?void 0:r.id_type)&&void 0!==n?n:null})},t._makeDynamicConfig=o,t._makeExperiment=function(e,t,r){var n;const i=o(e,t,r);return Object.assign(Object.assign({},i),{groupName:null!==(n=null==r?void 0:r.group_name)&&void 0!==n?n:null})},t._makeLayer=function(e,t,r,n){var i,o;return Object.assign(Object.assign({},s(e,t,r,void 0)),{get:a(e,null==r?void 0:r.value,n),groupName:null!==(i=null==r?void 0:r.group_name)&&void 0!==i?i:null,__value:null!==(o=null==r?void 0:r.value)&&void 0!==o?o:{}})},t._mergeOverride=function(e,t,r,n){return Object.assign(Object.assign(Object.assign({},e),t),{get:a(e.name,r,n)})},t._makeTypedGet=a},110771:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},932095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0;t.createUpdateDetails=(e,t,r,n,i,s)=>({duration:r,source:t,success:e,error:n,sourceUrl:i,warnings:s}),t.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},574238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getFullUserHash=t._normalizeUser=void 0;const n=r(107162),i=r(483482);t._normalizeUser=function(e,t,r){try{const n=JSON.parse(JSON.stringify(e));return null!=t&&null!=t.environment?n.statsigEnvironment=t.environment:null!=r&&(n.statsigEnvironment={tier:r}),n}catch(e){return i.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},t._getFullUserHash=function(e){return e?(0,n._DJB2Object)(e):null}},481485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._setObjectInStorage=t._getObjectFromStorage=t.Storage=void 0;const n=r(483482),i=r(935407),s={},o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>s[e]?s[e]:null,setItem:(e,t)=>{s[e]=t},removeItem:e=>{delete s[e]},getAllKeys:()=>Object.keys(s)};let a=null;try{const e=(0,i._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>e.localStorage.getItem(t),setItem:(t,r)=>e.localStorage.setItem(t,r),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch(e){n.Log.warn("Failed to setup localStorageProvider.")}let c=null!=a?a:o,l=c;function u(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return t.Storage._setProvider(o),null;if(e instanceof Error&&"QuotaExceededError"===e.name){const r=t.Storage.getAllKeys().filter(e=>e.startsWith("statsig."));e.message=`${e.message}. Statsig Keys: ${r.length}`}throw e}}t.Storage={isReady:()=>l.isReady(),isReadyResolver:()=>l.isReadyResolver(),getProviderName:()=>l.getProviderName(),getItem:e=>u(()=>l.getItem(e)),setItem:(e,t)=>u(()=>l.setItem(e,t)),removeItem:e=>l.removeItem(e),getAllKeys:()=>l.getAllKeys(),_setProvider:e=>{c=e,l=e},_setDisabled:e=>{l=e?o:c}},t._getObjectFromStorage=function(e){const r=t.Storage.getItem(e);return JSON.parse(null!=r?r:"null")},t._setObjectInStorage=function(e,r){t.Storage.setItem(e,JSON.stringify(r))}},752918:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;const n=r(483482);t._typedJsonParse=function(e,t,r){try{const r=JSON.parse(e);if(r&&"object"==typeof r&&t in r)return r}catch(e){}return n.Log.error("Failed to parse "+r),null}},16853:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._isTypeMatch=t._typeOf=void 0,t._typeOf=function(e){return Array.isArray(e)?"array":typeof e},t._isTypeMatch=function(e,t){const r=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return r(e)===r(t)}},704314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let 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,r=>{let n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===r?n:7&n|8).toString(16)})}},154144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;const n=r(107162),i=r(929464),s={[i.Endpoint._initialize]:"i",[i.Endpoint._rgstr]:"e",[i.Endpoint._download_config_specs]:"d"};t.UrlConfiguration=class{constructor(e,t,r,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=s[e],t&&(this.customUrl=t),!t&&r&&(this.customUrl=r.endsWith("/")?`${r}${e}`:`${r}/${e}`),n&&(this.fallbackUrls=n);const o=i.NetworkDefault[e];this.defaultUrl=`${o}/${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,n._DJB2)(this.customUrl+t)}}},58678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;const n=r(935407),i=[];let s="foreground",o=!1;t._isCurrentlyVisible=()=>"foreground"===s;t._isUnloading=()=>o;t._subscribeToVisiblityChanged=e=>{i.unshift(e)};t._notifyVisibilityChanged=e=>{e!==s&&(s=e,i.forEach(t=>t(e)))},(0,n._addWindowEventListenerSafe)("focus",()=>{o=!1,(0,t._notifyVisibilityChanged)("foreground")}),(0,n._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)("background")),(0,n._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?"foreground":"background")}),(0,n._addWindowEventListenerSafe)((0,n._getUnloadEvent)(),()=>{o=!0,(0,t._notifyVisibilityChanged)("background")})},970999:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,r(425369);const s=r(425369),o=r(734746);Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return o.Diagnostics}});const a=r(35101);Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return a.EventLogger}});const c=r(483482);Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return c.Log}});const l=r(788559),u=r(481485);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return u.Storage}}),i(r(425369),t),i(r(761925),t),i(r(786443),t),i(r(774918),t),i(r(734746),t),i(r(237358),t),i(r(146837),t),i(r(335308),t),i(r(729748),t),i(r(107162),t),i(r(442947),t),i(r(483482),t),i(r(959479),t),i(r(929464),t),i(r(557695),t),i(r(468348),t),i(r(664318),t),i(r(935407),t),i(r(961480),t),i(r(966232),t),i(r(761657),t),i(r(149009),t),i(r(394084),t),i(r(320464),t),i(r(862098),t),i(r(346400),t),i(r(788559),t),i(r(718435),t),i(r(888899),t),i(r(35442),t),i(r(110771),t),i(r(574238),t),i(r(481485),t),i(r(752918),t),i(r(16853),t),i(r(154144),t),i(r(704314),t),i(r(58678),t),i(r(932095),t),i(r(869447),t),Object.assign((0,s._getStatsigGlobal)(),{Log:c.Log,SDK_VERSION:l.SDK_VERSION})},29309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;const n=r(970999);function i(e,t){null==e||e.forEach(e=>{delete t[e]})}t._resolveDeltasResponse=function(e,t){const r=(0,n._typedJsonParse)(t,"checksum","DeltasEvaluationResponse");if(!r)return{hadBadDeltaChecksum:!0};const s=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,r)),o=(0,n._DJB2Object)({feature_gates:s.feature_gates,dynamic_configs:s.dynamic_configs,layer_configs:s.layer_configs},2);return o===r.checksumV2?JSON.stringify(s):{hadBadDeltaChecksum:!0,badChecksum:o,badMergedConfigs:s,badFullResponse:r.deltas_full_response}}},165335:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(970999);t.default=class{constructor(e){this._sdkKey=e,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,n._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(e,t){var r;if(!e)return!1;const i=(0,n._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),n.SDKFlags.setFlags(this._sdkKey,null!==(r=i.sdk_flags)&&void 0!==r?r:{})),!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)}getConfigList(){var e;return(null===(e=this._values)||void 0===e?void 0:e.dynamic_configs)?Object.values(this._values.dynamic_configs).map(e=>e.name):[]}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 r={};return t.user&&(r.user=t.user),t.sdkInfo&&(r.generatorSDKInfo=t.sdkInfo),r.lcut=t.time,r}_getDetailedStoreResult(e,t){let r=null;return e&&(r=e[t]?e[t]:e[(0,n._DJB2)(t)]),{result:r,details:this._getDetails(null==r)}}_setWarningState(e,t){var r,i;const s=n.StableID.get(this._sdkKey);if((null===(r=e.customIDs)||void 0===r?void 0:r.stableID)===s||!(null===(i=e.customIDs)||void 0===i?void 0:i.stableID)&&!s){if("user"in t){const r=t.user,i=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,n._getFullUserHash)(i)!==(0,n._getFullUserHash)(r)&&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,r;const n=this.getCurrentSourceDetails();let i=n.reason;const s=null!==(t=n.warnings)&&void 0!==t?t:[];if("Bootstrap"===this._source&&s.length>0&&(i+=s[0]),"Uninitialized"!==i&&"NoValues"!==i){i=`${i}:${e?"Unrecognized":"Recognized"}`}const o="Bootstrap"===this._source&&null!==(r=this._bootstrapMetadata)&&void 0!==r?r:void 0;return o&&(n.bootstrapMetadata=o),Object.assign(Object.assign({},n),{reason:i})}}},725030:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(970999),s=r(29309);class o extends i.NetworkCore{constructor(e,t){super(e,t);const r=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new i.UrlConfiguration(i.Endpoint._initialize,null==r?void 0:r.initializeUrl,null==r?void 0:r.api,null==r?void 0:r.initializeFallbackUrls)}fetchEvaluations(e,t,r,s,o){return n(this,void 0,void 0,(function*(){var n,a,c,l,u,d;const h=t?(0,i._typedJsonParse)(t,"has_updates","InitializeResponse"):null;let g={user:s,hash:null!==(c=null===(a=null===(n=this._option)||void 0===n?void 0:n.networkConfig)||void 0===a?void 0:a.initializeHashAlgorithm)&&void 0!==c?c:"djb2",deltasResponseRequested:!1,full_checksum:null};if(null==h?void 0:h.has_updates){const e=(null==h?void 0:h.hash_used)!==(null!==(d=null===(u=null===(l=this._option)||void 0===l?void 0:l.networkConfig)||void 0===u?void 0:u.initializeHashAlgorithm)&&void 0!==d?d:"djb2");g=Object.assign(Object.assign({},g),{sinceTime:o&&!e?h.time:0,previousDerivedFields:"derived_fields"in h&&o?h.derived_fields:{},deltasResponseRequested:!0,full_checksum:h.full_checksum,partialUserMatchSinceTime:e?0:h.time})}return this._fetchEvaluations(e,h,g,r)}))}_fetchEvaluations(e,t,r,i){return n(this,void 0,void 0,(function*(){var n,o;const a=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:r,retries:2,isStatsigEncodable:!0,priority:i});if(204===(null==a?void 0:a.code))return'{"has_updates": false}';if(200!==(null==a?void 0:a.code))return null!==(n=null==a?void 0:a.body)&&void 0!==n?n:null;if(!0!==(null==t?void 0:t.has_updates)||!0!==(null===(o=a.body)||void 0===o?void 0:o.includes('"is_delta":true'))||!0!==r.deltasResponseRequested)return a.body;const c=(0,s._resolveDeltasResponse)(t,a.body);return"string"==typeof c?c:this._fetchEvaluations(e,t,Object.assign(Object.assign(Object.assign({},r),c),{deltasResponseRequested:!1}),i)}))}}t.default=o},694593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;const n=r(970999),i={disableExposureLog:!0};function s(e){return null==e||!1===e.disableExposureLog}function o(e,t){return null!=t&&!(0,n._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(e,t,r){return(a,c)=>{if(null==t)return c;const l=t[a];if(null==l||null!=c&&(0,n._typeOf)(c)!==l.param_type)return c;switch(l.ref_type){case"static":return function(e,t){return e.value}(l);case"gate":return function(e,t,r){return e.getFeatureGate(t.gate_name,s(r)?void 0:i).value?t.pass_value:t.fail_value}(e,l,r);case"dynamic_config":return function(e,t,r,n){const a=e.getDynamicConfig(t.config_name,s(n)?void 0:i).get(t.param_name);return o(a,r)?r:a}(e,l,c,r);case"experiment":return function(e,t,r,n){const a=e.getExperiment(t.experiment_name,s(n)?void 0:i).get(t.param_name);return o(a,r)?r:a}(e,l,c,r);case"layer":return function(e,t,r,n){const a=e.getLayer(t.layer_name,s(n)?void 0:i).get(t.param_name);return o(a,r)?r:a}(e,l,c,r);default:return c}}}},714343:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(970999),s=r(165335),o=r(725030),a=r(694593),c=r(951676);class l extends i.StatsigClientBase{static instance(e){const t=(0,i._getStatsigGlobal)().instance(e);return t instanceof l?t:(i.Log.warn((0,i._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new l(null!=e?e:"",{}))}constructor(e,t,r=null){var n,a;i.SDKType._setClientType(e,"javascript-client");const l=new o.default(r,e=>{this.$emt(e)});super(e,null!==(n=null==r?void 0:r.dataAdapter)&&void 0!==n?n:new c.StatsigEvaluationsDataAdapter,l,r),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.getConfigList=this._memoize(i.MemoPrefix._configList,this._getConfigListImpl.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 s.default(e),this._network=l,this._user=this._configureUser(t,r),this._sdkInstanceID=(0,i.getUUID)();const u=null!==(a=null==r?void 0:r.plugins)&&void 0!==a?a:[];for(const e of u)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 n(this,void 0,void 0,(function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise}))}updateUserSync(e,t){const r=performance.now();try{return this._updateUserSyncImpl(e,t,r)}catch(e){const t=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(t,r)}}_updateUserSyncImpl(e,t,r){var n;const s=[...null!==(n=this._store.getWarnings())&&void 0!==n?n:[]];this._resetForUser(e);const o=this.dataAdapter.getDataSync(this._user);null==o&&s.push("NoCachedValues"),this._store.setValues(o,this._user),this._finalizeUpdate(o);const a=null==t?void 0:t.disableBackgroundCacheRefresh;return!0===a||null==a&&"Bootstrap"===(null==o?void 0:o.source)||this._runPostUpdate(null!=o?o:null,this._user),(0,i.createUpdateDetails)(!0,this._store.getSource(),performance.now()-r,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),s)}updateUserAsync(e,t){return n(this,void 0,void 0,(function*(){const r=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,r)}}))}_updateUserAsyncImpl(e,t){return n(this,void 0,void 0,(function*(){this._resetForUser(e);const r=this._user;i.Diagnostics._markInitOverallStart(this._sdkKey);let n=this.dataAdapter.getDataSync(r);if(this._store.setValues(n,this._user),this._setStatus("Loading",n),n=yield this.dataAdapter.getDataAsync(n,r,t),r!==this._user)return(0,i.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let s=!1;null!=n&&(i.Diagnostics._markInitProcessStart(this._sdkKey),s=this._store.setValues(n,this._user),i.Diagnostics._markInitProcessEnd(this._sdkKey,{success:s})),this._finalizeUpdate(n),s||(this._errorBoundary.attachErrorIfNoneExists(i.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),i.Diagnostics._markInitOverallEnd(this._sdkKey,s,this._store.getCurrentSourceDetails());const o=i.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,i.createUpdateDetails)(s,this._store.getSource(),o,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,r){const n="string"==typeof e?{eventName:e,value:t,metadata:r}:e;this.$emt({name:"log_event_called",event:n}),this._logger.enqueue(Object.assign(Object.assign({},n),{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 n(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 r;return(0,i.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!==(r=this._store.getWarnings())&&void 0!==r?r:[]])}_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 r;const n=(0,i._normalizeUser)(e,t),s=null===(r=n.customIDs)||void 0===r?void 0:r.stableID;return s&&i.StableID.setOverride(s,this._sdkKey),n.analyticsOnlyMetadata=Object.assign(Object.assign({},n.analyticsOnlyMetadata),this._possibleFirstTouchMetadata),n}_getFeatureGateImpl(e,t){var r,n;const{result:s,details:o}=this._store.getGate(e),a=(0,i._makeFeatureGate)(e,o,s),c=null===(n=null===(r=this.overrideAdapter)||void 0===r?void 0:r.getGateOverride)||void 0===n?void 0:n.call(r,a,this._user,t),l=null!=c?c:a;return this._enqueueExposure(e,(0,i._createGateExposure)(this._user,l,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:l}),l}_getDynamicConfigImpl(e,t){var r,n;const{result:s,details:o}=this._store.getConfig(e),a=(0,i._makeDynamicConfig)(e,o,s),c=null===(n=null===(r=this.overrideAdapter)||void 0===r?void 0:r.getDynamicConfigOverride)||void 0===n?void 0:n.call(r,a,this._user,t),l=null!=c?c:a;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,l,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:l}),l}_getExperimentImpl(e,t){var r,n,s,o;const{result:a,details:c}=this._store.getConfig(e),l=(0,i._makeExperiment)(e,c,a);null!=l.__evaluation&&(l.__evaluation.secondary_exposures=(0,i._mapExposures)(null!==(n=null===(r=l.__evaluation)||void 0===r?void 0:r.secondary_exposures)&&void 0!==n?n:[],this._store.getExposureMapping()));const u=null===(o=null===(s=this.overrideAdapter)||void 0===s?void 0:s.getExperimentOverride)||void 0===o?void 0:o.call(s,l,this._user,t),d=null!=u?u:l;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,d,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:d}),d}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,t){var r,n,s;const{result:o,details:a}=this._store.getLayer(e),c=(0,i._makeLayer)(e,a,o),l=null===(n=null===(r=this.overrideAdapter)||void 0===r?void 0:r.getLayerOverride)||void 0===n?void 0:n.call(r,c,this._user,t);(null==t?void 0:t.disableExposureLog)&&this._logger.incrementNonExposureCount(e);const u=(0,i._mergeOverride)(c,l,null!==(s=null==l?void 0:l.__value)&&void 0!==s?s:c.__value,r=>{(null==t?void 0:t.disableExposureLog)||this._enqueueExposure(e,(0,i._createLayerParameterExposure)(this._user,u,r,this._store.getExposureMapping()),t)});return this.$emt({name:"layer_evaluation",layer:u}),u}_getParameterStoreImpl(e,t){var r,n;const{result:i,details:s}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);const o={name:e,details:s,__configuration:i,get:(0,a._makeParamStoreGetter)(this,i,t)},c=null===(n=null===(r=this.overrideAdapter)||void 0===r?void 0:r.getParamStoreOverride)||void 0===n?void 0:n.call(r,o,t);return null!=c&&(o.__configuration=c.config,o.details=c.details,o.get=(0,a._makeParamStoreGetter)(this,c.config,t)),o}}t.default=l},951676:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;const i=r(970999),s=r(725030);class o extends i.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,r){super.attach(e,t,r),null!==r&&r instanceof s.default?this._network=r:this._network=new s.default(null!=t?t:{})}getDataAsync(e,t,r){return this._getDataAsyncImpl(e,(0,i._normalizeUser)(t,this._options),r)}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,r,i){return n(this,void 0,void 0,(function*(){var n;const s=yield null===(n=this._network)||void 0===n?void 0:n.fetchEvaluations(this._getSdkKey(),e,null==r?void 0:r.priority,t,i);return null!=s?s:null}))}_getCacheKey(e){var t;const r=(0,i._getStorageKey)(this._getSdkKey(),e,null===(t=this._options)||void 0===t?void 0:t.customUserCacheKeyFunc);return`${i.DataAdapterCachePrefix}.${this._cacheSuffix}.${r}`}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,i._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=o},340029:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0;const s=r(970999),o=r(714343);t.StatsigClient=o.default,i(r(970999),t);const a=Object.assign((0,s._getStatsigGlobal)(),{StatsigClient:o.default});t.default=a},718950:(e,t,r)=>{"use strict";function n(e,t,r,n,i,s,o){try{var a=e[s](o),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(i,s){var o=e.apply(t,r);function a(e){n(o,i,s,a,c,"next",e)}function c(e){n(o,i,s,a,c,"throw",e)}a(void 0)}))}}r.d(t,{Z:()=>i})},47169:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(723744);function i(e,t,r){return(t=(0,n.Z)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},613613:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(166017);function i(e,t){if(null==e)return{};var r,i,s=(0,n.Z)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i{"use strict";function n(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}r.d(t,{Z:()=>n})},964562:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(36655);function i(e,t){if("object"!=(0,n.Z)(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=(0,n.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},723744:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(36655),i=r(964562);function s(e){var t=(0,i.Z)(e,"string");return"symbol"==(0,n.Z)(t)?t:t+""}},36655:(e,t,r)=>{"use strict";function n(e){return(n="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})(e)}r.d(t,{Z:()=>n})}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";new(r(983796).G)})()})();