module.exports = "(function(e,t,a){var i=a(5894),s=a(7358);e.exports={initialize:function(){this.__state={inRumSample:!1,id:null,src:null,RumHost:null,data:{extras:{}},apis:{},DOMObservation:{},featuresNeeded:{}},this.on(s.SET_RUM_DATA,this.__set),this.on(s.RECORD_API_USAGE,this.__updateAPIUsage),this.on(s.INITIALIZE_CHANGE_METRICS,this.__initializeChangeMetrics),this.on(s.RECORD_ACTIVATION_TYPE_USAGE,this.__updatePageActivationTypeUsage),this.on(s.RECORD_AUDIENCE_USAGE,this.__updateAudienceUsage),this.on(s.RECORD_CHANGE_MACROTASK_RATE,this.__recordChangeMacrotaskRate),this.on(s.RECORD_CHANGE_OVERHEATED,this.__recordChangeOverheated),this.on(s.RECORD_CHANGE_TYPE_USAGE,this.__updateChangeTypeUsage),this.on(s.RECORD_DOM_OBSERVATION_OCCURENCE,this.__recordDOMObservationOccurence),this.on(s.RECORD_INTEGRATION_USAGE,this.__updateIntegrationUsage),this.on(s.RECORD_LAYER_FEATURE_USAGE,this.__updateLayerFeatureUsage),this.on(s.RECORD_LAYER_POLICY_USAGE,this.__updateLayerPolicyUsage),this.on(s.RECORD_VIEW_FEATURE_USAGE,this.__updateViewFeatureUsage),this.on(s.RECORD_VIEWS_INITIALLY_ACTIVATED_COUNT,this.__updateViewsInitiallyActivatedCount),this.on(s.RECORD_VISITOR_ID_LOCATOR_USAGE,this.__updateVisitorIdLocatorUsage),this.on(s.RECORD_VISITOR_ID_ERROR,this.__recordVisitorIdError),this.on(s.RECORD_STICKY_BUCKETING_FEATURE,this.__updateStickyBucketingFeatureUsage)},__set:function(e){i.merge(this.__state,e),this.emitChange()},__updateAPIUsage:function(e){this.__state.apis[e.methodName]||(this.__state.apis[e.methodName]=0),this.__state.apis[e.methodName]++,this.emitChange()},__initializeChangeMetrics:function(){i.isUndefined(this.__state.data.extras.changeMacrotaskRate)&&(this.__state.data.extras.changeMacrotaskRate=0),i.isUndefined(this.__state.data.extras.numOverheatedChanges)&&(this.__state.data.extras.numOverheatedChanges=0)},__recordChangeMacrotaskRate:function(e){i.isUndefined(this.__state.data.extras.changeMacrotaskRate)&&(this.__state.data.extras.changeMacrotaskRate=0),e.changeMacrotaskRate>this.__state.data.extras.changeMacrotaskRate&&(this.__state.data.extras.changeMacrotaskRate=e.changeMacrotaskRate),this.emitChange()},__recordChangeOverheated:function(){i.isUndefined(this.__state.data.extras.numOverheatedChanges)&&(this.__state.data.extras.numOverheatedChanges=0),this.__state.data.extras.numOverheatedChanges++,this.emitChange()},__recordDOMObservationOccurence:function(e){this.__state.DOMObservation[e.counterName]||(this.__state.DOMObservation[e.counterName]=0),this.__state.DOMObservation[e.counterName]++,this.emitChange()},__extendFeaturesNeeded:function(e,t,a){i.isUndefined(this.__state.featuresNeeded[e])&&(this.__state.featuresNeeded[e]={});var s=this.__state.featuresNeeded[e];i.each(t,(function(e){s[e]||(s[e]={}),s[e][a]||(s[e][a]=!0)}))},__updateIntegrationUsage:function(e){this.__extendFeaturesNeeded(\"integrations\",e.integrations,e.layerId)},__updateChangeTypeUsage:function(e){this.__extendFeaturesNeeded(\"changeTypes\",e.changeTypes,e.layerId)},__updatePageActivationTypeUsage:function(e){this.__extendFeaturesNeeded(\"activationTypes\",[e.activationType],e.entityId),this.emitChange()},__updateViewFeatureUsage:function(e){this.__extendFeaturesNeeded(\"viewFeatures\",e.featuresUsed,e.entityId),this.emitChange()},__updateLayerFeatureUsage:function(e){this.__extendFeaturesNeeded(\"layerFeatures\",[e.feature],e.entityId),this.emitChange()},__updateLayerPolicyUsage:function(e){this.__extendFeaturesNeeded(\"policy\",[e.policy],e.layerId),this.emitChange()},__updateAudienceUsage:function(e){this.__extendFeaturesNeeded(\"audiences\",e.audienceTypes,e.layerId),this.emitChange()},__updateViewsInitiallyActivatedCount:function(e){this.__state.data.extras.viewsInitiallyActivatedCount=e.viewsInitiallyActivatedCount,this.emitChange()},__updateVisitorIdLocatorUsage:function(e){this.__extendFeaturesNeeded(\"visitorIdLocatorType\",[e.visitorIdLocatorType],e.entityId),this.emitChange()},__recordVisitorIdError:function(e){this.__state.data.extras.errorCustomVisitorId=e.isError,this.emitChange()},__updateStickyBucketingFeatureUsage:function(e){this.__extendFeaturesNeeded(\"stickyBucketing\",[e.feature],e.id)},getSampleRum:function(){return this.__state.inRumSample},getRumId:function(){return this.__state.id},getRumHost:function(){return this.__state.RumHost},getApiData:function(){return this.__state.apis},getDOMObservationData:function(){return this.__state.DOMObservation},getRumData:function(){return i.cloneDeep(this.__state.data)},getScriptSrc:function(){return this.__state.src},getFeaturesNeededData:function(){var e=this.__state.featuresNeeded,t={};return i.forOwn(e,(function(e,a){var s=i.keys(e);i.isEmpty(s)||(t[a]={}),i.forEach(s,(function(s){t[a][s]=i.keys(e[s]).length}))})),t}}})";