module.exports = "(function(t,e,i){var a=i(5894),n=i(7358),s=i(9133),c=i(4810);t.exports={initialize:function(){this.__state={actions:{},actionState:{}},this.on(n.DATA_LOADED,this.__loadData),this.on(n.ACTION_EXECUTED,this.__initializeActionState),this.on(n.SET_CHANGE_APPLIER,this.__setChangeApplier),this.on(n.REMOVE_ACTION_STATE,this.__removeActionState)},__loadData:function(t){var e=this;a.isEmpty(t.data.layers)||(a.each(t.data.layers,(function(t){var i;if(t.changes){var n=\"layerId:\"+t.id;i={id:n,layerId:t.id,changeSet:t.changes,type:\"layer\"},s.deepFreeze(i),e.__state.actions[n]=i}a.each(t.experiments,(function(n){if(n.changes){var c=\"experimentId:\"+n.id;i={id:c,layerId:t.id,experimentId:n.id,changeSet:n.changes,type:\"experiment\"},s.deepFreeze(i),e.__state.actions[c]=i}a.each(n.variations,(function(c){a.each(c.actions,(function(a){var r=a.pageId||a.viewId,o=n.id+\":\"+c.id+\":\"+r;i={id:o,layerId:t.id,experimentId:n.id,variationId:c.id,pageId:r,changeSet:a.changes,type:\"variation\"},s.deepFreeze(i),e.__state.actions[o]=i}))}))}))})),this.emitChange())},__initializeActionState:function(t){var e=t.actionId;a.isUndefined(e)||this.__state.actionState[e]||(this.__state.actionState[e]={})},__setChangeApplier:function(t){var e=t.actionId,i=t.changeId;if(!this.__state.actionState[e])return c.warn(\"Action Data / Attempted to set changeApplier for inactive action: \",e),void 0;this.__state.actionState[e][i]=t.changeApplier},__removeActionState:function(t){delete this.__state.actionState[t.actionId]},get:function(t){return s.safeReference(this.__state.actions[t])},getActionState:function(t){return s.safeReference(this.__state.actionState[t])},getByChangeId:function(t){return a.find(this.__state.actions,{changeSet:[{id:t}]})},getAllActionIdsByPageId:function(t){return a.map(a.filter(this.__state.actions,{pageId:t}),\"id\")},getChangeApplier:function(t,e){var i=this.__state.actionState[e];if(i)return i[t]},getExperimentVariationActions:function(t,e){return s.safeReference(a.filter(this.__state.actions,{experimentId:t,variationId:e}))},getLayerActions:function(t){return s.safeReference(a.filter(this.__state.actions,{id:\"layerId:\"+t}))},getExperimentActions:function(t){return s.safeReference(a.filter(this.__state.actions,{id:\"experimentId:\"+t}))},getAll:function(){return s.safeReference(a.values(this.__state.actions))}}})";