Well-posedness and ergodicity of functional stochastic partial differential equations with Markovian switching | Synapse