I had the pleasure to contribute to building tools for sample size planning for moderated mediation analysis as part of the R package WebPower. Uppon loading this package in R, one can conduct power analysis for Models 7, 8, 14, 15, and 58 as mentioned in the book Introduction to Mediation, Moderation, and Conditional Process Analysis by Andrew F. Hayes. Correspondingly, R functions wp.modmed.m7, wp.modmed.m8, wp.modmed.m14, wp.modmed.m15, wp.modmed.m58 can be used for such analysis.
Using model 7 as an example, the code can be used below to find out power when sample size $n = 100$. The function returns statistical power for the indirect effect, direct effect, and moderation effect.
When conducting power analysis, one can test power at different sample sizes and then plot sample sizes versus power to find out at what sample size, power would reach a desirable level.
# get power at a sequence of sample sizes res <- sapply(n <- seq(50,1500,20), function(x) wp.modmed.m7(n = x, a1 =0.33, cp =0.311, b1 =0.777, c1 =-0.079, c2 =0.081, sigx_w =0.5, nrep =1000, alpha =0.05, simulation_method ="MC", power_method ="product", MCrep =1000, sige12 =1, sige22 =1, ncore =5))