/*! phoscon-app 2023-07-31 */

const{Machine:Machine,actions:actions}=XState,{interpret:interpret}=XStateInterpreter,{choose:choose}=actions;export const getMachine=(views,constants,factorys)=>{const stateHandlerMap={overviewFactory:factorys.overviewHandlerFactory(views.overviewView,views.bottomView,constants),emptyviewFactory:factorys.emptyHandlerFactory(views.emptyView,views.bottomView,constants),detailsviewFactory:factorys.detailsHandlerFactory(views.detailsView,views.bottomView,constants)};let machine=Machine({id:"plugsMachine",initial:"overview",states:{overview:{on:{OVERVIEW:"overview",DETAILS:"details",EMPTY:"empty",ROW_CLICKED:{actions:["callOverviewFactory"]},SCAN:{actions:["callOverviewFactory"]}},onEntry:["callOverviewFactory"],onExit:["callOverviewFactory"]},empty:{on:{OVERVIEW:"overview",DETAILS:"details",EMPTY:"empty",SCAN:{actions:["callEmptyviewFactory"]}},onEntry:["callEmptyviewFactory"],onExit:["callEmptyviewFactory"]},details:{on:{OVERVIEW:"overview",DETAILS:"details",EMPTY:"empty",SCAN:{actions:["callDetailsviewFactory"]},SELECT_GROUP_CHANGED:{actions:["callDetailsviewFactory"]},DELETE_CLICKED:{actions:["callDetailsviewFactory"]}},onEntry:["callDetailsviewFactory"],onExit:["callDetailsviewFactory"]}}},{actions:{callOverviewFactory:stateHandlerMap.overviewFactory,callEmptyviewFactory:stateHandlerMap.emptyviewFactory,callDeleteviewFactory:stateHandlerMap.deleteviewFactory,callDetailsviewFactory:stateHandlerMap.detailsviewFactory}}),service=interpret(machine).onTransition(state=>{console.log("machine event: "+state.event.type)});return service.start(),{machine:machine,service:service}};