@wix/himalaya-cli 0.2052.0 → 0.2053.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/dist/cli.mjs +2 -1
  2. package/package.json +2 -2
  3. package/templates/beauty-salon/dev/index.ts +1109 -147
  4. package/templates/beauty-salon/l10n/ar.json +122 -6
  5. package/templates/beauty-salon/l10n/cs.json +122 -6
  6. package/templates/beauty-salon/l10n/da.json +122 -6
  7. package/templates/beauty-salon/l10n/de.json +122 -6
  8. package/templates/beauty-salon/l10n/el.json +122 -6
  9. package/templates/beauty-salon/l10n/en.json +81 -9
  10. package/templates/beauty-salon/l10n/es.json +122 -6
  11. package/templates/beauty-salon/l10n/fi.json +122 -6
  12. package/templates/beauty-salon/l10n/fr.json +122 -6
  13. package/templates/beauty-salon/l10n/he.json +96 -5
  14. package/templates/beauty-salon/l10n/hu.json +122 -6
  15. package/templates/beauty-salon/l10n/id.json +122 -6
  16. package/templates/beauty-salon/l10n/it.json +122 -6
  17. package/templates/beauty-salon/l10n/ja.json +122 -6
  18. package/templates/beauty-salon/l10n/ko.json +122 -6
  19. package/templates/beauty-salon/l10n/lt.json +122 -6
  20. package/templates/beauty-salon/l10n/nl.json +122 -6
  21. package/templates/beauty-salon/l10n/no.json +122 -6
  22. package/templates/beauty-salon/l10n/pl.json +122 -6
  23. package/templates/beauty-salon/l10n/pt.json +122 -6
  24. package/templates/beauty-salon/l10n/ru.json +122 -6
  25. package/templates/beauty-salon/l10n/sv.json +122 -6
  26. package/templates/beauty-salon/l10n/th.json +122 -6
  27. package/templates/beauty-salon/l10n/tr.json +122 -6
  28. package/templates/beauty-salon/l10n/uk.json +122 -6
  29. package/templates/beauty-salon/l10n/vi.json +122 -6
  30. package/templates/beauty-salon/l10n/zh.json +122 -6
  31. package/templates/beauty-salon/tier5-src/_shared/about-text.ts +8 -0
  32. package/templates/beauty-salon/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  33. package/templates/branded-lite/dev/index.ts +1589 -143
  34. package/templates/branded-lite/l10n/ar.json +46 -6
  35. package/templates/branded-lite/l10n/cs.json +46 -6
  36. package/templates/branded-lite/l10n/da.json +46 -6
  37. package/templates/branded-lite/l10n/de.json +46 -6
  38. package/templates/branded-lite/l10n/el.json +46 -6
  39. package/templates/branded-lite/l10n/en.json +46 -11
  40. package/templates/branded-lite/l10n/es.json +46 -6
  41. package/templates/branded-lite/l10n/fi.json +46 -6
  42. package/templates/branded-lite/l10n/fr.json +46 -6
  43. package/templates/branded-lite/l10n/he.json +34 -5
  44. package/templates/branded-lite/l10n/hu.json +46 -6
  45. package/templates/branded-lite/l10n/id.json +46 -6
  46. package/templates/branded-lite/l10n/it.json +46 -6
  47. package/templates/branded-lite/l10n/ja.json +46 -6
  48. package/templates/branded-lite/l10n/ko.json +46 -6
  49. package/templates/branded-lite/l10n/lt.json +46 -6
  50. package/templates/branded-lite/l10n/nl.json +46 -6
  51. package/templates/branded-lite/l10n/no.json +46 -6
  52. package/templates/branded-lite/l10n/pl.json +46 -6
  53. package/templates/branded-lite/l10n/pt.json +46 -6
  54. package/templates/branded-lite/l10n/ru.json +46 -6
  55. package/templates/branded-lite/l10n/sv.json +46 -6
  56. package/templates/branded-lite/l10n/th.json +46 -6
  57. package/templates/branded-lite/l10n/tr.json +46 -6
  58. package/templates/branded-lite/l10n/uk.json +46 -6
  59. package/templates/branded-lite/l10n/vi.json +46 -6
  60. package/templates/branded-lite/l10n/zh.json +46 -6
  61. package/templates/branded-lite/tier5-src/_shared/about-text.ts +8 -0
  62. package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +247 -34
  63. package/templates/community-club/dev/index.ts +1362 -155
  64. package/templates/community-club/l10n/ar.json +123 -12
  65. package/templates/community-club/l10n/cs.json +123 -12
  66. package/templates/community-club/l10n/da.json +123 -12
  67. package/templates/community-club/l10n/de.json +123 -12
  68. package/templates/community-club/l10n/el.json +123 -12
  69. package/templates/community-club/l10n/en.json +86 -15
  70. package/templates/community-club/l10n/es.json +123 -12
  71. package/templates/community-club/l10n/fi.json +123 -12
  72. package/templates/community-club/l10n/fr.json +123 -12
  73. package/templates/community-club/l10n/he.json +102 -10
  74. package/templates/community-club/l10n/hu.json +123 -12
  75. package/templates/community-club/l10n/id.json +123 -12
  76. package/templates/community-club/l10n/it.json +123 -12
  77. package/templates/community-club/l10n/ja.json +123 -12
  78. package/templates/community-club/l10n/ko.json +123 -12
  79. package/templates/community-club/l10n/lt.json +123 -12
  80. package/templates/community-club/l10n/nl.json +123 -12
  81. package/templates/community-club/l10n/no.json +123 -12
  82. package/templates/community-club/l10n/pl.json +123 -12
  83. package/templates/community-club/l10n/pt.json +123 -12
  84. package/templates/community-club/l10n/ru.json +123 -12
  85. package/templates/community-club/l10n/sv.json +123 -12
  86. package/templates/community-club/l10n/th.json +123 -12
  87. package/templates/community-club/l10n/tr.json +123 -12
  88. package/templates/community-club/l10n/uk.json +123 -12
  89. package/templates/community-club/l10n/vi.json +123 -12
  90. package/templates/community-club/l10n/zh.json +123 -12
  91. package/templates/community-club/tier5-src/_shared/about-text.ts +8 -0
  92. package/templates/community-club/tier5-src/_shared/detail-presence.ts +51 -0
  93. package/templates/community-club/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  94. package/templates/events-meetups/dev/index.ts +1362 -155
  95. package/templates/events-meetups/l10n/ar.json +123 -12
  96. package/templates/events-meetups/l10n/cs.json +123 -12
  97. package/templates/events-meetups/l10n/da.json +123 -12
  98. package/templates/events-meetups/l10n/de.json +123 -12
  99. package/templates/events-meetups/l10n/el.json +123 -12
  100. package/templates/events-meetups/l10n/en.json +86 -15
  101. package/templates/events-meetups/l10n/es.json +123 -12
  102. package/templates/events-meetups/l10n/fi.json +123 -12
  103. package/templates/events-meetups/l10n/fr.json +123 -12
  104. package/templates/events-meetups/l10n/he.json +102 -10
  105. package/templates/events-meetups/l10n/hu.json +123 -12
  106. package/templates/events-meetups/l10n/id.json +123 -12
  107. package/templates/events-meetups/l10n/it.json +123 -12
  108. package/templates/events-meetups/l10n/ja.json +123 -12
  109. package/templates/events-meetups/l10n/ko.json +123 -12
  110. package/templates/events-meetups/l10n/lt.json +123 -12
  111. package/templates/events-meetups/l10n/nl.json +123 -12
  112. package/templates/events-meetups/l10n/no.json +123 -12
  113. package/templates/events-meetups/l10n/pl.json +123 -12
  114. package/templates/events-meetups/l10n/pt.json +123 -12
  115. package/templates/events-meetups/l10n/ru.json +123 -12
  116. package/templates/events-meetups/l10n/sv.json +123 -12
  117. package/templates/events-meetups/l10n/th.json +123 -12
  118. package/templates/events-meetups/l10n/tr.json +123 -12
  119. package/templates/events-meetups/l10n/uk.json +123 -12
  120. package/templates/events-meetups/l10n/vi.json +123 -12
  121. package/templates/events-meetups/l10n/zh.json +123 -12
  122. package/templates/events-meetups/tier5-src/_shared/about-text.ts +8 -0
  123. package/templates/events-meetups/tier5-src/_shared/detail-presence.ts +51 -0
  124. package/templates/events-meetups/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  125. package/templates/gym-fitness/dev/index.ts +1109 -147
  126. package/templates/gym-fitness/l10n/ar.json +122 -6
  127. package/templates/gym-fitness/l10n/cs.json +122 -6
  128. package/templates/gym-fitness/l10n/da.json +122 -6
  129. package/templates/gym-fitness/l10n/de.json +122 -6
  130. package/templates/gym-fitness/l10n/el.json +122 -6
  131. package/templates/gym-fitness/l10n/en.json +81 -9
  132. package/templates/gym-fitness/l10n/es.json +122 -6
  133. package/templates/gym-fitness/l10n/fi.json +122 -6
  134. package/templates/gym-fitness/l10n/fr.json +122 -6
  135. package/templates/gym-fitness/l10n/he.json +96 -5
  136. package/templates/gym-fitness/l10n/hu.json +122 -6
  137. package/templates/gym-fitness/l10n/id.json +122 -6
  138. package/templates/gym-fitness/l10n/it.json +122 -6
  139. package/templates/gym-fitness/l10n/ja.json +122 -6
  140. package/templates/gym-fitness/l10n/ko.json +122 -6
  141. package/templates/gym-fitness/l10n/lt.json +122 -6
  142. package/templates/gym-fitness/l10n/nl.json +122 -6
  143. package/templates/gym-fitness/l10n/no.json +122 -6
  144. package/templates/gym-fitness/l10n/pl.json +122 -6
  145. package/templates/gym-fitness/l10n/pt.json +122 -6
  146. package/templates/gym-fitness/l10n/ru.json +122 -6
  147. package/templates/gym-fitness/l10n/sv.json +122 -6
  148. package/templates/gym-fitness/l10n/th.json +122 -6
  149. package/templates/gym-fitness/l10n/tr.json +122 -6
  150. package/templates/gym-fitness/l10n/uk.json +122 -6
  151. package/templates/gym-fitness/l10n/vi.json +122 -6
  152. package/templates/gym-fitness/l10n/zh.json +122 -6
  153. package/templates/gym-fitness/tier5-src/_shared/about-text.ts +8 -0
  154. package/templates/gym-fitness/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  155. package/templates/nonprofit-cause/dev/index.ts +1360 -153
  156. package/templates/nonprofit-cause/l10n/ar.json +123 -6
  157. package/templates/nonprofit-cause/l10n/cs.json +123 -6
  158. package/templates/nonprofit-cause/l10n/da.json +123 -6
  159. package/templates/nonprofit-cause/l10n/de.json +123 -6
  160. package/templates/nonprofit-cause/l10n/el.json +123 -6
  161. package/templates/nonprofit-cause/l10n/en.json +86 -9
  162. package/templates/nonprofit-cause/l10n/es.json +123 -6
  163. package/templates/nonprofit-cause/l10n/fi.json +123 -6
  164. package/templates/nonprofit-cause/l10n/fr.json +123 -6
  165. package/templates/nonprofit-cause/l10n/he.json +102 -5
  166. package/templates/nonprofit-cause/l10n/hu.json +123 -6
  167. package/templates/nonprofit-cause/l10n/id.json +123 -6
  168. package/templates/nonprofit-cause/l10n/it.json +123 -6
  169. package/templates/nonprofit-cause/l10n/ja.json +123 -6
  170. package/templates/nonprofit-cause/l10n/ko.json +123 -6
  171. package/templates/nonprofit-cause/l10n/lt.json +123 -6
  172. package/templates/nonprofit-cause/l10n/nl.json +123 -6
  173. package/templates/nonprofit-cause/l10n/no.json +123 -6
  174. package/templates/nonprofit-cause/l10n/pl.json +123 -6
  175. package/templates/nonprofit-cause/l10n/pt.json +123 -6
  176. package/templates/nonprofit-cause/l10n/ru.json +123 -6
  177. package/templates/nonprofit-cause/l10n/sv.json +123 -6
  178. package/templates/nonprofit-cause/l10n/th.json +123 -6
  179. package/templates/nonprofit-cause/l10n/tr.json +123 -6
  180. package/templates/nonprofit-cause/l10n/uk.json +123 -6
  181. package/templates/nonprofit-cause/l10n/vi.json +123 -6
  182. package/templates/nonprofit-cause/l10n/zh.json +123 -6
  183. package/templates/nonprofit-cause/tier5-src/_shared/about-text.ts +8 -0
  184. package/templates/nonprofit-cause/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  185. package/templates/personal-fitness-trainer/dev/index.ts +650 -75
  186. package/templates/personal-fitness-trainer/tier5-src/_shared/about-text.ts +8 -0
  187. package/templates/personal-fitness-trainer/tier5-src/_shared/group-member-count.ts +15 -0
  188. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-media.ts +33 -0
  189. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  190. package/templates/personal-fitness-trainer/tokens.json +6 -0
  191. package/templates/podcast-creator/dev/index.ts +1115 -153
  192. package/templates/podcast-creator/l10n/ar.json +117 -6
  193. package/templates/podcast-creator/l10n/cs.json +117 -6
  194. package/templates/podcast-creator/l10n/da.json +117 -6
  195. package/templates/podcast-creator/l10n/de.json +117 -6
  196. package/templates/podcast-creator/l10n/el.json +117 -6
  197. package/templates/podcast-creator/l10n/en.json +81 -9
  198. package/templates/podcast-creator/l10n/es.json +117 -6
  199. package/templates/podcast-creator/l10n/fi.json +117 -6
  200. package/templates/podcast-creator/l10n/fr.json +117 -6
  201. package/templates/podcast-creator/l10n/he.json +96 -5
  202. package/templates/podcast-creator/l10n/hu.json +117 -6
  203. package/templates/podcast-creator/l10n/id.json +117 -6
  204. package/templates/podcast-creator/l10n/it.json +117 -6
  205. package/templates/podcast-creator/l10n/ja.json +117 -6
  206. package/templates/podcast-creator/l10n/ko.json +117 -6
  207. package/templates/podcast-creator/l10n/lt.json +117 -6
  208. package/templates/podcast-creator/l10n/nl.json +117 -6
  209. package/templates/podcast-creator/l10n/no.json +117 -6
  210. package/templates/podcast-creator/l10n/pl.json +117 -6
  211. package/templates/podcast-creator/l10n/pt.json +117 -6
  212. package/templates/podcast-creator/l10n/ru.json +117 -6
  213. package/templates/podcast-creator/l10n/sv.json +117 -6
  214. package/templates/podcast-creator/l10n/th.json +117 -6
  215. package/templates/podcast-creator/l10n/tr.json +117 -6
  216. package/templates/podcast-creator/l10n/uk.json +117 -6
  217. package/templates/podcast-creator/l10n/vi.json +117 -6
  218. package/templates/podcast-creator/l10n/zh.json +117 -6
  219. package/templates/podcast-creator/tier5-src/_shared/about-text.ts +8 -0
  220. package/templates/podcast-creator/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  221. package/templates/portfolio-creative/dev/index.ts +1113 -151
  222. package/templates/portfolio-creative/l10n/ar.json +122 -12
  223. package/templates/portfolio-creative/l10n/cs.json +122 -12
  224. package/templates/portfolio-creative/l10n/da.json +122 -12
  225. package/templates/portfolio-creative/l10n/de.json +122 -12
  226. package/templates/portfolio-creative/l10n/el.json +122 -12
  227. package/templates/portfolio-creative/l10n/en.json +81 -15
  228. package/templates/portfolio-creative/l10n/es.json +122 -12
  229. package/templates/portfolio-creative/l10n/fi.json +122 -12
  230. package/templates/portfolio-creative/l10n/fr.json +122 -12
  231. package/templates/portfolio-creative/l10n/he.json +96 -10
  232. package/templates/portfolio-creative/l10n/hu.json +122 -12
  233. package/templates/portfolio-creative/l10n/id.json +122 -12
  234. package/templates/portfolio-creative/l10n/it.json +122 -12
  235. package/templates/portfolio-creative/l10n/ja.json +122 -12
  236. package/templates/portfolio-creative/l10n/ko.json +122 -12
  237. package/templates/portfolio-creative/l10n/lt.json +122 -12
  238. package/templates/portfolio-creative/l10n/nl.json +122 -12
  239. package/templates/portfolio-creative/l10n/no.json +122 -12
  240. package/templates/portfolio-creative/l10n/pl.json +122 -12
  241. package/templates/portfolio-creative/l10n/pt.json +122 -12
  242. package/templates/portfolio-creative/l10n/ru.json +122 -12
  243. package/templates/portfolio-creative/l10n/sv.json +122 -12
  244. package/templates/portfolio-creative/l10n/th.json +122 -12
  245. package/templates/portfolio-creative/l10n/tr.json +122 -12
  246. package/templates/portfolio-creative/l10n/uk.json +122 -12
  247. package/templates/portfolio-creative/l10n/vi.json +122 -12
  248. package/templates/portfolio-creative/l10n/zh.json +122 -12
  249. package/templates/portfolio-creative/tier5-src/_shared/about-text.ts +8 -0
  250. package/templates/portfolio-creative/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  251. package/templates/restaurant/dev/index.ts +1114 -152
  252. package/templates/restaurant/l10n/ar.json +117 -6
  253. package/templates/restaurant/l10n/cs.json +117 -6
  254. package/templates/restaurant/l10n/da.json +117 -6
  255. package/templates/restaurant/l10n/de.json +117 -6
  256. package/templates/restaurant/l10n/el.json +117 -6
  257. package/templates/restaurant/l10n/en.json +81 -9
  258. package/templates/restaurant/l10n/es.json +117 -6
  259. package/templates/restaurant/l10n/fi.json +117 -6
  260. package/templates/restaurant/l10n/fr.json +117 -6
  261. package/templates/restaurant/l10n/he.json +96 -5
  262. package/templates/restaurant/l10n/hu.json +117 -6
  263. package/templates/restaurant/l10n/id.json +117 -6
  264. package/templates/restaurant/l10n/it.json +117 -6
  265. package/templates/restaurant/l10n/ja.json +117 -6
  266. package/templates/restaurant/l10n/ko.json +117 -6
  267. package/templates/restaurant/l10n/lt.json +117 -6
  268. package/templates/restaurant/l10n/nl.json +117 -6
  269. package/templates/restaurant/l10n/no.json +117 -6
  270. package/templates/restaurant/l10n/pl.json +117 -6
  271. package/templates/restaurant/l10n/pt.json +117 -6
  272. package/templates/restaurant/l10n/ru.json +117 -6
  273. package/templates/restaurant/l10n/sv.json +117 -6
  274. package/templates/restaurant/l10n/th.json +117 -6
  275. package/templates/restaurant/l10n/tr.json +117 -6
  276. package/templates/restaurant/l10n/uk.json +117 -6
  277. package/templates/restaurant/l10n/vi.json +117 -6
  278. package/templates/restaurant/l10n/zh.json +117 -6
  279. package/templates/restaurant/tier5-src/_shared/about-text.ts +8 -0
  280. package/templates/restaurant/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  281. package/templates/retail-store/dev/index.ts +1115 -153
  282. package/templates/retail-store/l10n/ar.json +122 -12
  283. package/templates/retail-store/l10n/cs.json +122 -12
  284. package/templates/retail-store/l10n/da.json +122 -12
  285. package/templates/retail-store/l10n/de.json +122 -12
  286. package/templates/retail-store/l10n/el.json +122 -12
  287. package/templates/retail-store/l10n/en.json +81 -15
  288. package/templates/retail-store/l10n/es.json +122 -12
  289. package/templates/retail-store/l10n/fi.json +122 -12
  290. package/templates/retail-store/l10n/fr.json +122 -12
  291. package/templates/retail-store/l10n/he.json +96 -10
  292. package/templates/retail-store/l10n/hu.json +122 -12
  293. package/templates/retail-store/l10n/id.json +122 -12
  294. package/templates/retail-store/l10n/it.json +122 -12
  295. package/templates/retail-store/l10n/ja.json +122 -12
  296. package/templates/retail-store/l10n/ko.json +122 -12
  297. package/templates/retail-store/l10n/lt.json +122 -12
  298. package/templates/retail-store/l10n/nl.json +122 -12
  299. package/templates/retail-store/l10n/no.json +122 -12
  300. package/templates/retail-store/l10n/pl.json +122 -12
  301. package/templates/retail-store/l10n/pt.json +122 -12
  302. package/templates/retail-store/l10n/ru.json +122 -12
  303. package/templates/retail-store/l10n/sv.json +122 -12
  304. package/templates/retail-store/l10n/th.json +122 -12
  305. package/templates/retail-store/l10n/tr.json +122 -12
  306. package/templates/retail-store/l10n/uk.json +122 -12
  307. package/templates/retail-store/l10n/vi.json +122 -12
  308. package/templates/retail-store/l10n/zh.json +122 -12
  309. package/templates/retail-store/tier5-src/_shared/about-text.ts +8 -0
  310. package/templates/retail-store/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  311. package/templates/yoga-studio/dev/index.ts +1109 -147
  312. package/templates/yoga-studio/l10n/ar.json +117 -6
  313. package/templates/yoga-studio/l10n/cs.json +117 -6
  314. package/templates/yoga-studio/l10n/da.json +117 -6
  315. package/templates/yoga-studio/l10n/de.json +117 -6
  316. package/templates/yoga-studio/l10n/el.json +117 -6
  317. package/templates/yoga-studio/l10n/en.json +81 -9
  318. package/templates/yoga-studio/l10n/es.json +117 -6
  319. package/templates/yoga-studio/l10n/fi.json +117 -6
  320. package/templates/yoga-studio/l10n/fr.json +117 -6
  321. package/templates/yoga-studio/l10n/he.json +96 -5
  322. package/templates/yoga-studio/l10n/hu.json +117 -6
  323. package/templates/yoga-studio/l10n/id.json +117 -6
  324. package/templates/yoga-studio/l10n/it.json +117 -6
  325. package/templates/yoga-studio/l10n/ja.json +117 -6
  326. package/templates/yoga-studio/l10n/ko.json +117 -6
  327. package/templates/yoga-studio/l10n/lt.json +117 -6
  328. package/templates/yoga-studio/l10n/nl.json +117 -6
  329. package/templates/yoga-studio/l10n/no.json +117 -6
  330. package/templates/yoga-studio/l10n/pl.json +117 -6
  331. package/templates/yoga-studio/l10n/pt.json +117 -6
  332. package/templates/yoga-studio/l10n/ru.json +117 -6
  333. package/templates/yoga-studio/l10n/sv.json +117 -6
  334. package/templates/yoga-studio/l10n/th.json +117 -6
  335. package/templates/yoga-studio/l10n/tr.json +117 -6
  336. package/templates/yoga-studio/l10n/uk.json +117 -6
  337. package/templates/yoga-studio/l10n/vi.json +117 -6
  338. package/templates/yoga-studio/l10n/zh.json +117 -6
  339. package/templates/yoga-studio/tier5-src/_shared/about-text.ts +8 -0
  340. package/templates/yoga-studio/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  341. package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  342. package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  343. package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  344. package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  345. package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  346. package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  347. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  348. package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  349. package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  350. package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  351. package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  352. package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +0 -119
@@ -5,11 +5,17 @@
5
5
  // The Follow control reflects the live relationship (getFollowCounts + isFollowingMember, each read
6
6
  // defensively, so a 403 never blanks the screen); toggleFollow writes through the real Members v3
7
7
  // MemberFollowers API. A visitor never writes: Follow opens sign-in (the descriptor routes it).
8
+ //
9
+ // `self: "1"` (himi_view_profile) shows the SIGNED-IN member's own profile instead: the id comes from
10
+ // getMyMember, never from input; a private profile is still shown (it is the reader's own); a visitor
11
+ // gets the Sign in state and makes no member read. Self mode also reads the member's groups and gives
12
+ // the About section its own states (content / empty / failed) and a 5-line collapsed form.
8
13
  import { classifyLoadError, defineService } from "@himalaya/state";
9
14
  import { share as shareSheet } from "@himalaya/share";
10
15
  import { snackbar as showSnackbar } from "@himalaya/ui";
11
16
  import {
12
17
  getMember,
18
+ getMyMember,
13
19
  followMember,
14
20
  unfollowMember,
15
21
  getFollowCounts,
@@ -20,26 +26,41 @@ import {
20
26
  import { query as queryBadges, queryBadgeAssignments } from "@himalaya/wix-badges";
21
27
  import { queryPosts as queryBlogPosts, type WixPost as WixBlogPost } from "@himalaya/wix-blog";
22
28
  import { queryPosts as queryForumPosts, type WixPost as WixForumPost } from "@himalaya/wix-forum";
29
+ import { getGroup, listMemberships, type WixGroup, type WixGroupMembership } from "@himalaya/wix-groups";
30
+ import { aboutPlainText } from "../_shared/about-text.js";
23
31
  import { wixMediaUrl } from "@himalaya/wix-media";
24
32
  import { formatDateMedium, formatMonthYear } from "../_shared/engine-intl.js";
25
33
  import { appLocale } from "../_shared/app-locale.js";
26
34
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
27
35
  import { presence, presenceAfterError, detailInputId, isNotFoundError, type PresenceFlags } from "../_shared/detail-presence.js";
36
+ import { groupMemberCount } from "../_shared/group-member-count.js";
37
+ import { groupImage } from "../_shared/himi-media.js";
28
38
 
29
- import { readAccess, assertReadAccess, readAccessDenied, readSignInFlags, NO_READ_SIGN_IN, type ReadAccess } from "../_shared/member-read.js";
30
- import { memberAccess } from "../_shared/member-access.js";
39
+ import { readAccess, readAccessDenied, readSignInFlags, signInError, NO_READ_SIGN_IN, type ReadAccess } from "../_shared/member-read.js";
40
+ import { memberAccess, memberAccessChanged } from "../_shared/member-access.js";
31
41
 
32
42
  const POST_LIMIT = 3;
43
+ const GROUP_LIMIT = 10;
44
+ const MEMBERSHIP_PAGE_LIMIT = 50;
33
45
  // The descriptor's 64pt square preview at up to 3x density.
34
46
  const POST_THUMB_IMAGE = { width: 192, height: 192 };
47
+ /** The collapsed About holds 5 lines; a longer text gets Show more. Approximated from the text, because a
48
+ * worker cannot measure: about 45 characters per line at the phone's footnote size. */
49
+ const ABOUT_LINES = 5;
50
+ const ABOUT_CHARS_PER_LINE = 45;
35
51
 
36
52
  interface PostRow {
37
53
  id: string;
38
54
  title: string;
39
55
  meta: string;
40
56
  thumb: string;
57
+ /** No preview image: the row hides its thumbnail slot instead of an empty box. */
58
+ noThumb: boolean;
41
59
  }
42
60
  interface BadgeRow { id: string; title: string }
61
+ interface GroupRow { id: string; title: string; meta: string; image: string; initial: string; noImage: boolean; hasImage: boolean }
62
+ /** The self-mode About section: not read yet, read with text, read with no text, or the read failed. */
63
+ type AboutPhase = "pending" | "content" | "empty" | "failed";
43
64
 
44
65
  interface S extends PresenceFlags {
45
66
  signInRequired: boolean; noSignIn: boolean;
@@ -92,6 +113,34 @@ interface S extends PresenceFlags {
92
113
  /** The retryable ErrorState: hidden unless the load failed for a reason other than sign-in. */
93
114
  hideError: boolean;
94
115
  unfollowTitle: string;
116
+ // ── Self mode (himi_view_profile) ──
117
+ /** The member's profile title ("Yoga teacher"); hidden when empty. */
118
+ title: string;
119
+ hideTitle: boolean;
120
+ /** The two counts as separate numbers for the hero's Following | Followers row; the row hides when both are unknown. */
121
+ followersNumber: string;
122
+ followingNumber: string;
123
+ hideCountRow: boolean;
124
+ hideFollowersNumber: boolean;
125
+ hideFollowingNumber: boolean;
126
+ /** The rule between the two counts: only when both are known (Wix can answer one direction only). */
127
+ hideCountDivider: boolean;
128
+ aboutPhase: AboutPhase;
129
+ /** The About as plain text, for the collapsed 5-line form. */
130
+ aboutPlain: string;
131
+ aboutLong: boolean;
132
+ aboutExpanded: boolean;
133
+ /** About section gates: the whole section, the full rich text, the collapsed text, Show more / Show less, empty, failed. */
134
+ hideAboutSection: boolean;
135
+ hideAboutRich: boolean;
136
+ hideAboutCollapsed: boolean;
137
+ hideAboutMore: boolean;
138
+ hideAboutLess: boolean;
139
+ hideAboutEmpty: boolean;
140
+ hideAboutFailed: boolean;
141
+ hasGroups: boolean;
142
+ groups: GroupRow[];
143
+ hideGroups: boolean;
95
144
  }
96
145
 
97
146
  function name(m: WixMember): string {
@@ -117,6 +166,11 @@ function hasAboutContent(nodes: unknown[]): boolean {
117
166
  return Array.isArray(node.nodes) && hasAboutContent(node.nodes);
118
167
  });
119
168
  }
169
+ /** More than ABOUT_LINES lines at the phone's width: each paragraph takes at least one line. */
170
+ function aboutIsLong(plain: string): boolean {
171
+ const lines = plain.split("\n").reduce((sum, p) => sum + Math.max(1, Math.ceil(p.length / ABOUT_CHARS_PER_LINE)), 0);
172
+ return lines > ABOUT_LINES;
173
+ }
120
174
  /** "Jul 2026" from the member's createdDate; "" when the date is missing or unreadable. */
121
175
  function joinedFor(createdDate: string | undefined): string {
122
176
  if (!createdDate) return "";
@@ -145,6 +199,30 @@ function derive(s: S): S {
145
199
  noSnackbar: !s.snackbarMessage,
146
200
  followCount,
147
201
  followLabel: s.isFollowing ? "Following ✓" : "Follow",
202
+ ...selfFlags(s),
203
+ };
204
+ }
205
+ /** The self-mode flags. Each About form is shown by exactly one phase, so loading, content, empty and
206
+ * failed never paint together; Show more / Show less follow the collapsed / expanded form. */
207
+ function selfFlags(s: S): Partial<S> {
208
+ const content = s.aboutPhase === "content";
209
+ const collapsed = content && s.aboutLong && !s.aboutExpanded;
210
+ return {
211
+ hideTitle: !s.title,
212
+ followersNumber: s.followers === null ? "" : String(s.followers),
213
+ followingNumber: s.following === null ? "" : String(s.following),
214
+ hideCountRow: s.followers === null && s.following === null,
215
+ hideFollowersNumber: s.followers === null,
216
+ hideFollowingNumber: s.following === null,
217
+ hideCountDivider: s.followers === null || s.following === null,
218
+ hideAboutSection: s.aboutPhase === "pending",
219
+ hideAboutRich: !content || collapsed,
220
+ hideAboutCollapsed: !collapsed,
221
+ hideAboutMore: !collapsed,
222
+ hideAboutLess: !(content && s.aboutLong && s.aboutExpanded),
223
+ hideAboutEmpty: s.aboutPhase !== "empty",
224
+ hideAboutFailed: s.aboutPhase !== "failed",
225
+ hideGroups: !s.hasGroups,
148
226
  };
149
227
  }
150
228
  function postMeta(date: string | undefined, minutes: number | undefined): string {
@@ -153,13 +231,16 @@ function postMeta(date: string | undefined, minutes: number | undefined): string
153
231
  if (minutes) bits.push(copyTemplate("member.readTime", "{minutes} min read", { minutes }));
154
232
  return bits.join(" · ");
155
233
  }
234
+ function postRow(id: string, title: string | undefined, meta: string, thumb: string): PostRow {
235
+ return { id, title: title || "", meta, thumb, noThumb: !thumb };
236
+ }
156
237
  function blogRow(p: WixBlogPost): PostRow {
157
238
  const m = p.media;
158
- return { id: p.id, title: p.title || "", meta: postMeta(p.firstPublishedDate, p.minutesToRead), thumb: wixMediaUrl(m?.wixMedia?.image?.url, POST_THUMB_IMAGE) || wixMediaUrl(m?.embedMedia?.thumbnail?.url, POST_THUMB_IMAGE) };
239
+ return postRow(p.id, p.title, postMeta(p.firstPublishedDate, p.minutesToRead), wixMediaUrl(m?.wixMedia?.image?.url, POST_THUMB_IMAGE) || wixMediaUrl(m?.embedMedia?.thumbnail?.url, POST_THUMB_IMAGE));
159
240
  }
160
241
  function forumRow(p: WixForumPost): PostRow {
161
242
  const first = (p.images ?? [])[0] as { url?: string } | string | undefined;
162
- return { id: p.id, title: p.title || "", meta: postMeta(p.createdDate, undefined), thumb: wixMediaUrl(typeof first === "string" ? first : first?.url, POST_THUMB_IMAGE) };
243
+ return postRow(p.id, p.title, postMeta(p.createdDate, undefined), wixMediaUrl(typeof first === "string" ? first : first?.url, POST_THUMB_IMAGE));
163
244
  }
164
245
 
165
246
  const INITIAL: S = derive({
@@ -203,21 +284,67 @@ const INITIAL: S = derive({
203
284
  hideMemberActions: true,
204
285
  hideError: true,
205
286
  unfollowTitle: "",
287
+ title: "",
288
+ hideTitle: true,
289
+ followersNumber: "",
290
+ followingNumber: "",
291
+ hideCountRow: true,
292
+ hideFollowersNumber: true,
293
+ hideFollowingNumber: true,
294
+ hideCountDivider: true,
295
+ aboutPhase: "pending",
296
+ aboutPlain: "",
297
+ aboutLong: false,
298
+ aboutExpanded: false,
299
+ hideAboutSection: true,
300
+ hideAboutRich: true,
301
+ hideAboutCollapsed: true,
302
+ hideAboutMore: true,
303
+ hideAboutLess: true,
304
+ hideAboutEmpty: true,
305
+ hideAboutFailed: true,
306
+ hasGroups: false,
307
+ groups: [],
308
+ hideGroups: true,
206
309
  ...presence("loading"), ...NO_READ_SIGN_IN,
207
310
  });
208
311
  let loadVersion = 0;
209
312
  let followRevision = 0;
210
313
  let loadedAccess: ReadAccess | undefined;
211
314
  let cachedAccess: ReadAccess | undefined;
315
+ // The session bit counts too: self mode accepts a signed-in session whose email has not arrived, so email and
316
+ // scope alone ("" before and after) cannot tell that session from a sign-out.
212
317
  function sameAccess(a: ReadAccess | undefined, b: ReadAccess | undefined): boolean {
213
- return !!a && !!b && a.tenant === b.tenant && a.member.scope === b.member.scope && a.member.email === b.member.email;
318
+ return !!a && !!b && a.tenant === b.tenant && a.member.scope === b.member.scope && a.member.email === b.member.email
319
+ && a.member.signedIn === b.member.signedIn;
320
+ }
321
+ /** The shared read check with the session bit: one identity read, compared field by field by sameAccess. */
322
+ async function assertReadAccess(access: ReadAccess): Promise<void> {
323
+ if (!sameAccess(await readAccess(), access)) throw memberAccessChanged();
214
324
  }
215
325
  let siteUrlParam = "";
216
326
  let sectionsEnabled = false;
217
327
  let blogEnabled = false;
218
328
  let forumEnabled = false;
329
+ let groupsEnabled = false;
330
+ /** Badges show by default (a site's badges need no Badges screen); an app that drops the section turns the read off. */
331
+ let badgesEnabled = true;
332
+ /** Self mode: the signed-in member's own profile. `selfId` is that member's id, learned from getMyMember. */
333
+ let selfMode = false;
334
+ let selfId = "";
219
335
  const pendingFollows = new Set<string>();
220
336
 
337
+ /** The member this screen shows: the reader in self mode, else the id the host baked into the screen. */
338
+ function targetId(): string {
339
+ return selfMode ? selfId : detailInputId();
340
+ }
341
+ function groupRow(group: WixGroup, membership: WixGroupMembership): GroupRow {
342
+ const title = (group.name || copyParam("groups.groupFallbackName", "Group")).trim();
343
+ const count = group.membersCount ?? group.memberCount;
344
+ const image = groupImage(group);
345
+ return { id: String(membership.groupId), title, meta: typeof count === "number" ? groupMemberCount(count) : "", image, initial: (title[0] || "G").toUpperCase(), noImage: !image, hasImage: !!image };
346
+ }
347
+
221
348
  /** Use the shared classifier so programming errors are never called connectivity failures. */
222
349
  function errorVariantOf(e: unknown): string {
223
350
  return classifyLoadError(e) === "offline" ? "offline" : "server";
@@ -236,13 +363,19 @@ const svc = defineService<S, {
236
363
  applySections: (s: S) => S | undefined;
237
364
  setBusy: (s: S, busy: boolean) => S;
238
365
  syncBusy: (s: S) => S;
366
+ toggleAbout: (s: S) => S;
367
+ retryAbout: (s: S) => Promise<S | undefined>;
239
368
  }>("spacesMemberDetail", {
240
369
  state: INITIAL,
370
+ // Member data stays off the disk snapshot: self mode holds the signed-in member's own profile, private or not.
371
+ // Nothing is lost: `prepare` keeps a cached profile only for an access verified in this run (cachedAccess).
372
+ notPersisted: Object.keys(INITIAL) as (keyof S)[],
373
+ notHydrated: Object.keys(INITIAL) as (keyof S)[],
241
374
  actions: {
242
375
  // A revisit keeps the cached profile on screen: only the first load starts from the skeleton.
243
376
  prepare: (_s, context) => {
244
377
  const { access, cached } = context ?? {};
245
- const keep = cached?.found && cached.id === detailInputId() && sameAccess(cachedAccess, access);
378
+ const keep = cached?.found && cached.id === targetId() && sameAccess(cachedAccess, access);
246
379
  // Cached content becomes actionable again only after the same reader/site has been verified.
247
380
  loadedAccess = keep ? access : undefined;
248
381
  if (!keep) cachedAccess = undefined;
@@ -257,16 +390,20 @@ const svc = defineService<S, {
257
390
  sectionsEnabled = a.sections === "1" || a.sections === true;
258
391
  if (a.blog !== undefined) blogEnabled = a.blog === "1" || a.blog === true;
259
392
  if (a.forum !== undefined) forumEnabled = a.forum === "1" || a.forum === true;
393
+ if (a.groups !== undefined) groupsEnabled = a.groups === "1" || a.groups === true;
394
+ if (a.badges !== undefined) badgesEnabled = a.badges === "1" || a.badges === true;
395
+ selfMode = a.self === "1" || a.self === true;
260
396
  }
261
397
  const version = ++loadVersion;
262
- const id = detailInputId();
398
+ // Self mode learns the id from getMyMember below; until then it is the last reader's id (or "").
399
+ let id = targetId();
263
400
  // The bridge may be resolving a different reader even for the same profile ID.
264
401
  // Keep the cache private until identity is known; restore it before the network re-read
265
402
  // for the same reader, so pending member/relationship reads still allow cached actions.
266
403
  loadedAccess = undefined;
267
404
  await svc.resetToSkeleton();
268
405
  if (version !== loadVersion) return undefined;
269
- if (!id) return { ...INITIAL, status: "ready", noShare: true, ...presence("missing") };
406
+ if (!id && !selfMode) return { ...INITIAL, status: "ready", noShare: true, ...presence("missing") };
270
407
  let access: ReadAccess | undefined;
271
408
  let prior: S | undefined;
272
409
  try {
@@ -276,12 +413,27 @@ const svc = defineService<S, {
276
413
  const prepared = svc.getState();
277
414
  prior = prepared.found && prepared.id === id ? prepared : undefined;
278
415
  const followAtStart = followRevision;
279
- const res = await getMember(id);
280
- const m = ((res as unknown as { member?: WixMember }).member) ?? (res as unknown as WixMember);
416
+ let m: WixMember;
417
+ if (selfMode) {
418
+ // A visitor owns no profile: the Sign in state, and no member read at all. A session whose email has
419
+ // not arrived yet is still a member (as the Profile tab's session check counts it).
420
+ if (!access.member.signedIn) throw signInError();
421
+ const mine = await getMyMember({ fieldsets: ["FULL"] });
422
+ // A newer load (another member) may have started: this answer must not become the profile's id.
423
+ if (version !== loadVersion) return undefined;
424
+ m = ((mine as unknown as { member?: WixMember }).member) ?? (mine as unknown as WixMember);
425
+ if (!m?.id) throw new Error("The signed-in member could not be read.");
426
+ id = selfId = String(m.id);
427
+ if (prior && prior.id !== id) prior = undefined;
428
+ } else {
429
+ const res = await getMember(id);
430
+ m = ((res as unknown as { member?: WixMember }).member) ?? (res as unknown as WixMember);
431
+ }
281
432
  const n = name(m);
282
433
  // Anonymous public reads may omit status fields (UNKNOWN). Explicit refusals hide the profile.
434
+ // The reader's own profile is shown whatever its privacy: only its owner sees this screen.
283
435
  const known = (v: string | undefined): v is string => !!v && v !== "UNKNOWN";
284
- if ((known(m.privacyStatus) && m.privacyStatus !== "PUBLIC") || (known(m.status) && m.status !== "APPROVED")) {
436
+ if (!selfMode && ((known(m.privacyStatus) && m.privacyStatus !== "PUBLIC") || (known(m.status) && m.status !== "APPROVED"))) {
285
437
  await assertReadAccess(access);
286
438
  if (version !== loadVersion) return undefined;
287
439
  loadedAccess = undefined;
@@ -302,9 +454,11 @@ const svc = defineService<S, {
302
454
  } catch { /* unavailable counts stay hidden */ }
303
455
 
304
456
  let isFollowing = false;
305
- try {
306
- isFollowing = await isFollowingMember(id);
307
- } catch { /* default false */ }
457
+ if (!selfMode) {
458
+ try {
459
+ isFollowing = await isFollowingMember(id);
460
+ } catch { /* default false */ }
461
+ }
308
462
 
309
463
  await assertReadAccess(access);
310
464
  if (version !== loadVersion) return undefined;
@@ -323,6 +477,7 @@ const svc = defineService<S, {
323
477
  name: n,
324
478
  initial: (n[0] || "#").toUpperCase(),
325
479
  photo: m.profile?.photo?.url || "",
480
+ title: m.profile?.title?.trim() || "",
326
481
  joined, hasJoined: !!joined,
327
482
  slug, shareUrl, noShare: !shareUrl,
328
483
  isFollowing,
@@ -365,12 +520,12 @@ const svc = defineService<S, {
365
520
  toggleFollow: async (s): Promise<S | undefined> => {
366
521
  if (!s.found || !s.id) return undefined;
367
522
  const access = loadedAccess;
368
- if (!access || detailInputId() !== s.id) return undefined;
523
+ if (!access || targetId() !== s.id) return undefined;
369
524
  if (!access.member.email) return undefined;
370
525
  const pendingKey = JSON.stringify([access.tenant, access.member.scope, access.member.email, s.id]);
371
526
  if (pendingFollows.has(pendingKey)) return undefined;
372
527
  const version = loadVersion;
373
- const current = () => version === loadVersion && access === loadedAccess && detailInputId() === s.id;
528
+ const current = () => version === loadVersion && access === loadedAccess && targetId() === s.id;
374
529
  // Serialize this reader's writes to one member within this worker, including after
375
530
  // navigation back to it. Another member or reader/site can act while this request is
376
531
  // pending. Separate worker instances are isolated contexts and cannot share this guard.
@@ -386,7 +541,7 @@ const svc = defineService<S, {
386
541
  if (!current()) {
387
542
  // The write is confirmed, but a reload overlapped it and may have read the old
388
543
  // relationship. Same reader and member: re-read instead of leaving a stale label.
389
- if (detailInputId() === s.id) await svc.load();
544
+ if (targetId() === s.id) await svc.load();
390
545
  return undefined;
391
546
  }
392
547
  followRevision++;
@@ -419,20 +574,29 @@ const svc = defineService<S, {
419
574
  // toggleFollow revalidates the captured reader/site again before issuing the write.
420
575
  return svc.toggleFollow();
421
576
  },
422
- applySections: (s) => (s.found && s.id === detailInputId() ? derive({ ...s, ...sections }) : undefined),
577
+ applySections: (s) => (s.found && s.id === targetId() ? derive({ ...s, ...sections }) : undefined),
578
+ // Show more / Show less: in place, one tap. Not cached, so the screen opens collapsed again.
579
+ toggleAbout: (s) => derive({ ...s, aboutExpanded: !s.aboutExpanded }),
580
+ // Try again on the About section alone: the section keeps its failed state until the read lands.
581
+ retryAbout: async (s): Promise<S | undefined> => {
582
+ const access = loadedAccess;
583
+ if (!s.found || !access || s.id !== targetId()) return undefined;
584
+ await readAbout(s.id, sectionLander(s.id, loadVersion, access).land);
585
+ return undefined;
586
+ },
423
587
  setBusy: (s, busy) => derive({ ...s, followBusy: busy, snackbarMessage: busy ? "" : s.snackbarMessage }),
424
588
  syncBusy: (s): S => {
425
589
  const access = loadedAccess;
426
- if (!access || !s.found || s.id !== detailInputId()) return s;
590
+ if (!access || !s.found || s.id !== targetId()) return s;
427
591
  return derive({ ...s, followBusy: pendingFollows.has(JSON.stringify([access.tenant, access.member.scope, access.member.email, s.id])) });
428
592
  },
429
593
  share: async (s): Promise<S | undefined> => {
430
594
  const access = loadedAccess;
431
595
  const version = loadVersion;
432
- if (!s.found || !s.shareUrl || !access || detailInputId() !== s.id) return undefined;
596
+ if (!s.found || !s.shareUrl || !access || targetId() !== s.id) return undefined;
433
597
  try {
434
598
  await assertReadAccess(access);
435
- if (version !== loadVersion || loadedAccess !== access || detailInputId() !== s.id) return undefined;
599
+ if (version !== loadVersion || loadedAccess !== access || targetId() !== s.id) return undefined;
436
600
  await shareSheet({ subject: s.name, url: s.shareUrl });
437
601
  } catch { /* changed identity, unavailable presenter or cancellation makes no share */ }
438
602
  // A one-shot presentation never writes a captured screen snapshot back after an await.
@@ -446,6 +610,8 @@ let sections: Partial<S> = {};
446
610
  function sectionsOf(s: S): Partial<S> {
447
611
  return {
448
612
  hasAbout: s.hasAbout, aboutJson: s.aboutJson, hasBadges: s.hasBadges, badges: s.badges,
613
+ aboutPhase: s.aboutPhase, aboutPlain: s.aboutPlain, aboutLong: s.aboutLong,
614
+ hasGroups: groupsEnabled && s.hasGroups, groups: groupsEnabled ? s.groups : [],
449
615
  // A disabled vertical cannot keep contributing cached content, even on an offline revisit.
450
616
  hasBlogPosts: blogEnabled && s.hasBlogPosts, blogPosts: blogEnabled ? s.blogPosts : [],
451
617
  hasForumPosts: forumEnabled && s.hasForumPosts, forumPosts: forumEnabled ? s.forumPosts : [],
@@ -455,8 +621,8 @@ function sectionsOf(s: S): Partial<S> {
455
621
  /** Each secondary read lands in its own state write, so a slow read never delays another section and a
456
622
  * failed one only hides its own. They never change the header or the action row. An availability failure
457
623
  * keeps cached content; an authoritative refusal or missing result clears only that section. */
458
- async function publishSections(id: string, version: number, access: ReadAccess): Promise<void> {
459
- const still = () => version === loadVersion && detailInputId() === id && sameAccess(loadedAccess, access);
624
+ function sectionLander(id: string, version: number, access: ReadAccess) {
625
+ const still = () => version === loadVersion && targetId() === id && sameAccess(loadedAccess, access);
460
626
  const land = async (patch: Partial<S>) => {
461
627
  if (!still()) return;
462
628
  try { await assertReadAccess(access); }
@@ -473,18 +639,14 @@ async function publishSections(id: string, version: number, access: ReadAccess):
473
639
  sections = { ...sections, ...patch };
474
640
  await svc.applySections();
475
641
  };
642
+ return { still, land };
643
+ }
644
+
645
+ async function publishSections(id: string, version: number, access: ReadAccess): Promise<void> {
646
+ const { still, land } = sectionLander(id, version, access);
476
647
  const reads: Array<Promise<void>> = [];
477
- reads.push((async () => {
478
- try {
479
- const res = await queryMemberAbouts({ query: { filter: { memberId: id } } });
480
- const content = res.memberAbouts?.find((a) => a.memberId === id || !a.memberId)?.content;
481
- const nodes = (content as { nodes?: unknown[] } | undefined)?.nodes;
482
- await land(content && Array.isArray(nodes) && hasAboutContent(nodes) ? { hasAbout: true, aboutJson: JSON.stringify(content) } : { hasAbout: false, aboutJson: "" });
483
- } catch (e) {
484
- if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasAbout: false, aboutJson: "" });
485
- }
486
- })());
487
- reads.push((async () => {
648
+ reads.push(readAbout(id, land));
649
+ if (badgesEnabled) reads.push((async () => {
488
650
  try {
489
651
  // Badges v4 (a Visitor can read both): the badges this member holds, then the site's badges that match them.
490
652
  // The site's badge list is paged until every held badge is found, so a held badge is never lost past page one.
@@ -530,6 +692,33 @@ async function publishSections(id: string, version: number, access: ReadAccess):
530
692
  if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasBadges: false, badges: [] });
531
693
  }
532
694
  })());
695
+ // Self mode only: the groups the reader belongs to. Wix answers memberships for the caller's own id only.
696
+ if (selfMode && groupsEnabled) reads.push((async () => {
697
+ try {
698
+ // A full page (as My Groups reads it): pending requests must not crowd out the joined groups shown, and a
699
+ // group listed twice is shown once (its id keys the carousel card).
700
+ const res = await listMemberships(id, { limit: MEMBERSHIP_PAGE_LIMIT });
701
+ const seen = new Set<string>();
702
+ const memberships = ((res as { memberships?: WixGroupMembership[] }).memberships ?? [])
703
+ .filter((m) => {
704
+ if (typeof m?.groupId !== "string" || !m.groupId || (m.status ?? "").toUpperCase() !== "JOINED" || seen.has(m.groupId)) return false;
705
+ seen.add(m.groupId);
706
+ return true;
707
+ })
708
+ .slice(0, GROUP_LIMIT);
709
+ const reads = await Promise.allSettled(memberships.map((m) => getGroup(String(m.groupId))));
710
+ const rows: GroupRow[] = [];
711
+ reads.forEach((read, i) => {
712
+ if (read.status !== "fulfilled") return;
713
+ // Social Groups wraps the entity as `{ group }`; the typed signature claims a bare group.
714
+ const group = ((read.value as unknown as { group?: WixGroup }).group ?? read.value) as WixGroup;
715
+ if (group && typeof group === "object") rows.push(groupRow(group, memberships[i]));
716
+ });
717
+ await land({ hasGroups: rows.length > 0, groups: rows });
718
+ } catch (e) {
719
+ if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasGroups: false, groups: [] });
720
+ }
721
+ })());
533
722
  if (blogEnabled) reads.push((async () => {
534
723
  try {
535
724
  const res = await queryBlogPosts({ query: { filter: { memberId: id }, paging: { limit: POST_LIMIT } } });
@@ -551,6 +740,30 @@ async function publishSections(id: string, version: number, access: ReadAccess):
551
740
  await Promise.all(reads);
552
741
  }
553
742
 
743
+ /** The About read, also run alone by `retryAbout`. On the member profile a failure that is not a refusal
744
+ * keeps what the section showed. Self mode gives the section its own verdict instead: text, no text
745
+ * (the empty state invites the member to add one), or failed (Try again — never the empty state, so a
746
+ * member is not invited to write over a text that merely failed to load). */
747
+ async function readAbout(id: string, land: (patch: Partial<S>) => Promise<void>): Promise<void> {
748
+ try {
749
+ const res = await queryMemberAbouts({ query: { filter: { memberId: id } } });
750
+ const content = res.memberAbouts?.find((a) => a.memberId === id || !a.memberId)?.content;
751
+ const nodes = (content as { nodes?: unknown[] } | undefined)?.nodes;
752
+ if (content && Array.isArray(nodes) && hasAboutContent(nodes)) {
753
+ const aboutPlain = aboutPlainText(content);
754
+ await land({ hasAbout: true, aboutJson: JSON.stringify(content), aboutPhase: "content", aboutPlain, aboutLong: aboutIsLong(aboutPlain) });
755
+ } else {
756
+ await land({ hasAbout: false, aboutJson: "", aboutPhase: "empty", aboutPlain: "", aboutLong: false });
757
+ }
758
+ } catch (e) {
759
+ if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasAbout: false, aboutJson: "", aboutPhase: selfMode ? "failed" : "empty", aboutPlain: "", aboutLong: false });
760
+ else if (selfMode) await land({ aboutPhase: "failed" });
761
+ }
762
+ }
763
+
764
+ // A host older than `hydrationOptOut` ignores notPersisted/notHydrated and restores the whole snapshot: reset it
765
+ // before anything paints, so a previous member's profile never shows (as wix-spaces-view-profile does).
766
+ if (!(globalThis as { himalaya?: { hydrationOptOut?: boolean } }).himalaya?.hydrationOptOut) Object.assign(svc.getState(), INITIAL);
554
767
  svc.prepare();
555
768
  svc.load();
556
769
  export { svc };