@wix/himalaya-cli 0.1749.0 → 0.1751.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 (324) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/himi-package.d.ts +478 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/host-compatibility.d.ts +56 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/icon-catalog.generated.d.ts +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +156 -8
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast-service.d.ts +105 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast.d.ts +116 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +326 -13
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +730 -81
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +155 -0
  14. package/dist/browser-plane/assets.json +5 -5
  15. package/dist/browser-plane/preview-deferred/{b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin → 21f35a12bd94f4ab97a9a75453c4adcadc438daf024a4b1950d5c356c123bd01.bin} +1 -1
  16. package/dist/browser-plane/sw.js +7 -7
  17. package/dist/cli.mjs +44618 -35753
  18. package/dist/preview-assets.generated.bin +0 -0
  19. package/guides/component-reference.json +1 -1
  20. package/guides/component-reference.md +4 -0
  21. package/guides/designing-himi-screens.md +7 -0
  22. package/guides/getting-started.md +5 -1
  23. package/guides/headless-loop.md +1 -1
  24. package/guides/himi-json-output.md +54 -1
  25. package/guides/himi-skill.md +5 -1
  26. package/guides/index.json +6 -0
  27. package/guides/one-app-to-himi-app.md +31 -8
  28. package/guides/qa-builds.md +12 -1
  29. package/guides/recipe-podcast.md +149 -0
  30. package/guides/skill.md +3 -1
  31. package/guides/store-submission.md +149 -34
  32. package/guides/tier-5-add-a-screen.md +16 -2
  33. package/guides/wix-business-context.md +43 -0
  34. package/guides/wix-platform-usage.md +7 -2
  35. package/package.json +10 -10
  36. package/template-icons/fitness-gym.png +0 -0
  37. package/template-icons/personal-fitness-trainer.png +0 -0
  38. package/templates/beauty-salon/config.ts +12 -0
  39. package/templates/beauty-salon/dev/index.ts +1 -1
  40. package/templates/beauty-salon/l10n/en.json +1 -1
  41. package/templates/beauty-salon/tier5-src/_shared/booking-session.ts +3 -1
  42. package/templates/beauty-salon/tier5-src/_shared/business-chat-transport.ts +148 -0
  43. package/templates/beauty-salon/tier5-src/_shared/header-badges.ts +113 -0
  44. package/templates/beauty-salon/tier5-src/_shared/location-pin.ts +97 -0
  45. package/templates/beauty-salon/tier5-src/_shared/member-access.ts +17 -6
  46. package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +16 -0
  47. package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +5 -8
  48. package/templates/beauty-salon/tier5-src/_shared/source-badges.ts +72 -0
  49. package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  50. package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  51. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +13 -4
  52. package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  53. package/templates/branded-lite/config.ts +12 -0
  54. package/templates/branded-lite/dev/index.ts +101 -1
  55. package/templates/branded-lite/l10n/en.json +22 -1
  56. package/templates/branded-lite/l10n/es.json +22 -0
  57. package/templates/branded-lite/l10n/fr.json +23 -0
  58. package/templates/branded-lite/l10n/he.json +19 -0
  59. package/templates/branded-lite/tier5-src/_shared/booking-session.ts +3 -1
  60. package/templates/branded-lite/tier5-src/_shared/location-pin.ts +97 -0
  61. package/templates/branded-lite/tier5-src/_shared/member-access.ts +17 -6
  62. package/templates/branded-lite/tier5-src/_shared/program-fields.ts +16 -0
  63. package/templates/branded-lite/tier5-src/_shared/programs-section.ts +5 -8
  64. package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +10 -5
  65. package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  66. package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  67. package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
  68. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +12 -1
  69. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +13 -4
  70. package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  71. package/templates/brandy/README.md +33 -0
  72. package/templates/brandy/config.ts +51 -7
  73. package/templates/brandy/dev/index.ts +23 -9
  74. package/templates/community-club/l10n/en.json +1 -1
  75. package/templates/community-club/tier5-src/_shared/member-access.ts +17 -6
  76. package/templates/community-club/tier5-src/_shared/program-fields.ts +16 -0
  77. package/templates/community-club/tier5-src/_shared/programs-section.ts +5 -8
  78. package/templates/community-club/tier5-src/himi-store-account/index.ts +13 -4
  79. package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  80. package/templates/conference/tier5-src/_shared/member-access.ts +17 -6
  81. package/templates/conference/tier5-src/himi-store-account/index.ts +13 -4
  82. package/templates/events-meetups/l10n/en.json +1 -1
  83. package/templates/events-meetups/tier5-src/_shared/member-access.ts +17 -6
  84. package/templates/events-meetups/tier5-src/_shared/program-fields.ts +16 -0
  85. package/templates/events-meetups/tier5-src/_shared/programs-section.ts +5 -8
  86. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +13 -4
  87. package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  88. package/templates/fitness-gym/README.md +53 -0
  89. package/templates/fitness-gym/config.ts +560 -0
  90. package/templates/fitness-gym/dev/index.ts +25787 -0
  91. package/templates/fitness-gym/himalaya.content.json +64 -0
  92. package/templates/fitness-gym/himalaya.template.json +15 -0
  93. package/templates/fitness-gym/icon.png +0 -0
  94. package/templates/fitness-gym/platforms.json +1 -0
  95. package/templates/fitness-gym/tier5-src/_shared/app-locale.ts +61 -0
  96. package/templates/fitness-gym/tier5-src/_shared/booking-location.ts +147 -0
  97. package/templates/fitness-gym/tier5-src/_shared/booking-session.ts +224 -0
  98. package/templates/fitness-gym/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  99. package/templates/fitness-gym/tier5-src/_shared/branded-load-state.ts +109 -0
  100. package/templates/fitness-gym/tier5-src/_shared/business-chat-copy.ts +40 -0
  101. package/templates/fitness-gym/tier5-src/_shared/business-chat-history.ts +51 -0
  102. package/templates/fitness-gym/tier5-src/_shared/business-chat-message-model.ts +177 -0
  103. package/templates/fitness-gym/tier5-src/_shared/business-chat-model.ts +56 -0
  104. package/templates/fitness-gym/tier5-src/_shared/business-chat-presenter.ts +576 -0
  105. package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +148 -0
  106. package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +228 -0
  107. package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +193 -0
  108. package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +400 -0
  109. package/templates/fitness-gym/tier5-src/_shared/detail-presence.ts +51 -0
  110. package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +523 -0
  111. package/templates/fitness-gym/tier5-src/_shared/himi-account.ts +194 -0
  112. package/templates/fitness-gym/tier5-src/_shared/himi-booking-saved.ts +88 -0
  113. package/templates/fitness-gym/tier5-src/_shared/himi-bookings.ts +318 -0
  114. package/templates/fitness-gym/tier5-src/_shared/himi-copy.ts +116 -0
  115. package/templates/fitness-gym/tier5-src/_shared/himi-media.ts +29 -0
  116. package/templates/fitness-gym/tier5-src/_shared/himi-store.ts +7 -0
  117. package/templates/fitness-gym/tier5-src/_shared/himi-text.ts +24 -0
  118. package/templates/fitness-gym/tier5-src/_shared/host-events.ts +66 -0
  119. package/templates/fitness-gym/tier5-src/_shared/hosted-checkout.ts +70 -0
  120. package/templates/fitness-gym/tier5-src/_shared/iap-attendance-form.ts +106 -0
  121. package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  122. package/templates/fitness-gym/tier5-src/_shared/iap-attendance.ts +38 -0
  123. package/templates/fitness-gym/tier5-src/_shared/iap-worker.ts +127 -0
  124. package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +68 -0
  125. package/templates/fitness-gym/tier5-src/_shared/local-preferences.ts +38 -0
  126. package/templates/fitness-gym/tier5-src/_shared/member-access.ts +63 -0
  127. package/templates/fitness-gym/tier5-src/_shared/member-account-routes.ts +52 -0
  128. package/templates/fitness-gym/tier5-src/_shared/member-bookings.ts +107 -0
  129. package/templates/fitness-gym/tier5-src/_shared/member-screen.ts +99 -0
  130. package/templates/fitness-gym/tier5-src/_shared/notification-target.ts +141 -0
  131. package/templates/fitness-gym/tier5-src/_shared/offset-page.ts +10 -0
  132. package/templates/fitness-gym/tier5-src/_shared/online-actions.ts +76 -0
  133. package/templates/fitness-gym/tier5-src/_shared/owner-load-error.ts +348 -0
  134. package/templates/fitness-gym/tier5-src/_shared/payment-setup.ts +6 -0
  135. package/templates/fitness-gym/tier5-src/_shared/pricing-plan-display.ts +64 -0
  136. package/templates/fitness-gym/tier5-src/_shared/program-description.ts +11 -0
  137. package/templates/fitness-gym/tier5-src/_shared/program-fields.ts +16 -0
  138. package/templates/fitness-gym/tier5-src/_shared/program-standing.ts +46 -0
  139. package/templates/fitness-gym/tier5-src/_shared/rich-body.ts +78 -0
  140. package/templates/fitness-gym/tier5-src/_shared/rich-content-link.ts +34 -0
  141. package/templates/fitness-gym/tier5-src/_shared/sign-in-sheet.ts +18 -0
  142. package/templates/fitness-gym/tier5-src/_shared/staff-name.ts +18 -0
  143. package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +107 -0
  144. package/templates/fitness-gym/tier5-src/_shared/wix-bi.ts +85 -0
  145. package/templates/fitness-gym/tier5-src/_shared/wix-member-links.ts +114 -0
  146. package/templates/fitness-gym/tier5-src/_shared/wix-service-price.ts +146 -0
  147. package/templates/fitness-gym/tier5-src/business-chat/index.ts +732 -0
  148. package/templates/fitness-gym/tier5-src/business-contact/index.ts +6 -0
  149. package/templates/fitness-gym/tier5-src/himi-booking-account/index.ts +267 -0
  150. package/templates/fitness-gym/tier5-src/himi-booking-bookings/index.ts +468 -0
  151. package/templates/fitness-gym/tier5-src/himi-booking-service/index.ts +1190 -0
  152. package/templates/fitness-gym/tier5-src/himi-booking-services/index.ts +791 -0
  153. package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1729 -0
  154. package/templates/fitness-gym/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
  155. package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +656 -0
  156. package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
  157. package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +495 -0
  158. package/templates/fitness-gym/tier5-src/himi-branded-lite-program/facts.ts +52 -0
  159. package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +845 -0
  160. package/templates/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +191 -0
  161. package/templates/fitness-gym/tier5-src/himi-fitcoach-home/index.ts +619 -0
  162. package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +1007 -0
  163. package/templates/fitness-gym/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
  164. package/templates/fitness-gym/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  165. package/templates/fitness-gym/tokens.json +414 -0
  166. package/templates/gym-fitness/config.ts +12 -0
  167. package/templates/gym-fitness/dev/index.ts +1 -1
  168. package/templates/gym-fitness/l10n/en.json +1 -1
  169. package/templates/gym-fitness/tier5-src/_shared/booking-session.ts +3 -1
  170. package/templates/gym-fitness/tier5-src/_shared/business-chat-transport.ts +148 -0
  171. package/templates/gym-fitness/tier5-src/_shared/header-badges.ts +113 -0
  172. package/templates/gym-fitness/tier5-src/_shared/location-pin.ts +97 -0
  173. package/templates/gym-fitness/tier5-src/_shared/member-access.ts +17 -6
  174. package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +16 -0
  175. package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +5 -8
  176. package/templates/gym-fitness/tier5-src/_shared/source-badges.ts +72 -0
  177. package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  178. package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  179. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +13 -4
  180. package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  181. package/templates/medical-services/dev/index.ts +2 -1
  182. package/templates/medical-services/tier5-src/_shared/booking-session.ts +3 -1
  183. package/templates/medical-services/tier5-src/_shared/member-access.ts +17 -6
  184. package/templates/medical-services/tier5-src/himi-booking-account/index.ts +16 -1
  185. package/templates/medical-services/tier5-src/himi-store-account/index.ts +13 -4
  186. package/templates/nonprofit-cause/l10n/en.json +1 -1
  187. package/templates/nonprofit-cause/tier5-src/_shared/member-access.ts +17 -6
  188. package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +16 -0
  189. package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +5 -8
  190. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +13 -4
  191. package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  192. package/templates/personal-fitness-trainer/README.md +51 -0
  193. package/templates/personal-fitness-trainer/config.ts +343 -0
  194. package/templates/personal-fitness-trainer/dev/index.ts +24813 -0
  195. package/templates/personal-fitness-trainer/himalaya.content.json +79 -0
  196. package/templates/personal-fitness-trainer/himalaya.template.json +14 -0
  197. package/templates/personal-fitness-trainer/icon.png +0 -0
  198. package/templates/personal-fitness-trainer/platforms.json +3 -0
  199. package/templates/personal-fitness-trainer/splash.json +3 -0
  200. package/templates/personal-fitness-trainer/tier5-src/_shared/app-locale.ts +61 -0
  201. package/templates/personal-fitness-trainer/tier5-src/_shared/booking-location.ts +147 -0
  202. package/templates/personal-fitness-trainer/tier5-src/_shared/booking-session.ts +224 -0
  203. package/templates/personal-fitness-trainer/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  204. package/templates/personal-fitness-trainer/tier5-src/_shared/branded-load-state.ts +109 -0
  205. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-copy.ts +40 -0
  206. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-history.ts +51 -0
  207. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-message-model.ts +177 -0
  208. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-model.ts +56 -0
  209. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-presenter.ts +576 -0
  210. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-transport.ts +148 -0
  211. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-contract.ts +228 -0
  212. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +193 -0
  213. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +400 -0
  214. package/templates/personal-fitness-trainer/tier5-src/_shared/detail-presence.ts +51 -0
  215. package/templates/personal-fitness-trainer/tier5-src/_shared/empty-flags.ts +33 -0
  216. package/templates/personal-fitness-trainer/tier5-src/_shared/engine-intl.ts +523 -0
  217. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-account.ts +194 -0
  218. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-booking-saved.ts +88 -0
  219. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-bookings.ts +318 -0
  220. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-copy.ts +116 -0
  221. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-layouts.ts +142 -0
  222. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-store.ts +7 -0
  223. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-text.ts +24 -0
  224. package/templates/personal-fitness-trainer/tier5-src/_shared/host-events.ts +66 -0
  225. package/templates/personal-fitness-trainer/tier5-src/_shared/hosted-checkout.ts +70 -0
  226. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-form.ts +106 -0
  227. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  228. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance.ts +38 -0
  229. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-worker.ts +127 -0
  230. package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +68 -0
  231. package/templates/personal-fitness-trainer/tier5-src/_shared/local-preferences.ts +38 -0
  232. package/templates/personal-fitness-trainer/tier5-src/_shared/member-access.ts +63 -0
  233. package/templates/personal-fitness-trainer/tier5-src/_shared/member-account-routes.ts +52 -0
  234. package/templates/personal-fitness-trainer/tier5-src/_shared/member-bookings.ts +107 -0
  235. package/templates/personal-fitness-trainer/tier5-src/_shared/member-screen.ts +99 -0
  236. package/templates/personal-fitness-trainer/tier5-src/_shared/offset-page.ts +10 -0
  237. package/templates/personal-fitness-trainer/tier5-src/_shared/online-actions.ts +76 -0
  238. package/templates/personal-fitness-trainer/tier5-src/_shared/owner-load-error.ts +348 -0
  239. package/templates/personal-fitness-trainer/tier5-src/_shared/payment-setup.ts +6 -0
  240. package/templates/personal-fitness-trainer/tier5-src/_shared/pricing-plan-display.ts +64 -0
  241. package/templates/personal-fitness-trainer/tier5-src/_shared/rich-body.ts +78 -0
  242. package/templates/personal-fitness-trainer/tier5-src/_shared/rich-content-link.ts +34 -0
  243. package/templates/personal-fitness-trainer/tier5-src/_shared/sign-in-sheet.ts +18 -0
  244. package/templates/personal-fitness-trainer/tier5-src/_shared/staff-name.ts +18 -0
  245. package/templates/personal-fitness-trainer/tier5-src/_shared/video-caption.ts +21 -0
  246. package/templates/personal-fitness-trainer/tier5-src/_shared/weekly-goal.ts +107 -0
  247. package/templates/personal-fitness-trainer/tier5-src/_shared/wix-bi.ts +85 -0
  248. package/templates/personal-fitness-trainer/tier5-src/_shared/wix-service-price.ts +146 -0
  249. package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +732 -0
  250. package/templates/personal-fitness-trainer/tier5-src/business-contact/index.ts +6 -0
  251. package/templates/personal-fitness-trainer/tier5-src/himi-booking-bookings/index.ts +468 -0
  252. package/templates/personal-fitness-trainer/tier5-src/himi-booking-service/index.ts +1190 -0
  253. package/templates/personal-fitness-trainer/tier5-src/himi-booking-services/index.ts +791 -0
  254. package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +1729 -0
  255. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  256. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/index.ts +1094 -0
  257. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
  258. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-appearance/index.ts +94 -0
  259. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
  260. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-plans/index.ts +495 -0
  261. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  262. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +226 -0
  263. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-videos/index.ts +145 -0
  264. package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-home/index.ts +70 -0
  265. package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-profile/index.ts +53 -0
  266. package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +1007 -0
  267. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-app-language/index.ts +73 -0
  268. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  269. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
  270. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  271. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-view-profile/index.ts +119 -0
  272. package/templates/personal-fitness-trainer/tokens.json +381 -0
  273. package/templates/podcast-creator/dev/index.ts +100 -0
  274. package/templates/podcast-creator/l10n/en.json +22 -1
  275. package/templates/podcast-creator/l10n/es.json +22 -0
  276. package/templates/podcast-creator/l10n/fr.json +18 -0
  277. package/templates/podcast-creator/l10n/he.json +15 -0
  278. package/templates/podcast-creator/tier5-src/_shared/member-access.ts +17 -6
  279. package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +16 -0
  280. package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +5 -8
  281. package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
  282. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +13 -4
  283. package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  284. package/templates/portfolio-creative/l10n/en.json +1 -1
  285. package/templates/portfolio-creative/tier5-src/_shared/member-access.ts +17 -6
  286. package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +16 -0
  287. package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +5 -8
  288. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +13 -4
  289. package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  290. package/templates/restaurant/l10n/en.json +1 -1
  291. package/templates/restaurant/tier5-src/_shared/member-access.ts +17 -6
  292. package/templates/restaurant/tier5-src/_shared/program-fields.ts +16 -0
  293. package/templates/restaurant/tier5-src/_shared/programs-section.ts +5 -8
  294. package/templates/restaurant/tier5-src/himi-store-account/index.ts +13 -4
  295. package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  296. package/templates/retail-store/l10n/en.json +1 -1
  297. package/templates/retail-store/tier5-src/_shared/member-access.ts +17 -6
  298. package/templates/retail-store/tier5-src/_shared/program-fields.ts +16 -0
  299. package/templates/retail-store/tier5-src/_shared/programs-section.ts +5 -8
  300. package/templates/retail-store/tier5-src/himi-store-account/index.ts +13 -4
  301. package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  302. package/templates/salon-spa/dev/index.ts +1 -1
  303. package/templates/salon-spa/tier5-src/_shared/booking-session.ts +3 -1
  304. package/templates/salon-spa/tier5-src/_shared/member-access.ts +17 -6
  305. package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +16 -1
  306. package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  307. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +13 -4
  308. package/templates/wholesale-store/tier5-src/_shared/member-access.ts +17 -6
  309. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +13 -4
  310. package/templates/yoga-studio/config.ts +12 -0
  311. package/templates/yoga-studio/dev/index.ts +1 -1
  312. package/templates/yoga-studio/l10n/en.json +1 -1
  313. package/templates/yoga-studio/tier5-src/_shared/booking-session.ts +3 -1
  314. package/templates/yoga-studio/tier5-src/_shared/business-chat-transport.ts +148 -0
  315. package/templates/yoga-studio/tier5-src/_shared/header-badges.ts +113 -0
  316. package/templates/yoga-studio/tier5-src/_shared/location-pin.ts +97 -0
  317. package/templates/yoga-studio/tier5-src/_shared/member-access.ts +17 -6
  318. package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +16 -0
  319. package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +5 -8
  320. package/templates/yoga-studio/tier5-src/_shared/source-badges.ts +72 -0
  321. package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  322. package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  323. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +13 -4
  324. package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +68 -55
@@ -126,6 +126,14 @@ interface S extends LoadFlags {
126
126
  /** A location is chosen and has no session in the loaded days: its own empty state. */
127
127
  locationEmpty: boolean;
128
128
  notLocationEmpty: boolean;
129
+ /** The optional "All · Booked" filter, for an app that asks for it (`load` param `filters: "1"`):
130
+ * "booked" lists only the member's own sessions (booked or on the waitlist). Off by default, so
131
+ * an app that does not bind it lists every session, as before. */
132
+ filter?: "all" | "booked";
133
+ hideFilter?: boolean;
134
+ /** The booked filter is on and the member has no session in the loaded days. */
135
+ bookedEmpty?: boolean;
136
+ notBookedEmpty?: boolean;
129
137
  }
130
138
 
131
139
  const flag = (on: boolean): string => (on ? "true" : "");
@@ -300,6 +308,10 @@ let quietUntil = 0;
300
308
  * it. Cleared by the list's own scroll and a calendar tap, whose plain day the renderer compares
301
309
  * with what it reported (an echo of the member's own scroll never moves the list). */
302
310
  let scrollNonce = 0;
311
+ /** The "All · Booked" filter: offered when the screen's load asks for it, and the member's choice. */
312
+ let filtersOn = false;
313
+ /** The member the "Booked" choice was made by: another member (or a sign-out) opens on "All". */
314
+ let bookedFilterFor = "";
303
315
  let busy = false;
304
316
  /** An Add to Calendar flow is running (a permission prompt, a save, the calendar page). Its own
305
317
  * flag, not `busy`: the session sheet must still close while it runs. */
@@ -428,14 +440,22 @@ function derive(s: S): S {
428
440
  // From today on (the loaded days never start before it), at the chosen location. The list is
429
441
  // one run of days: a tap on the calendar SCROLLS it to a day, and scrolling it moves the
430
442
  // selection, so it never starts at the selected day (the days above it would vanish).
431
- const shown = sessions.filter((x) => x.day >= s.today && (!locationKey || x.locationKey === locationKey));
443
+ const bookedOnly = filtersOn && !!member?.email && bookedFilterFor === member.email;
444
+ const mine = (x: Session) => { const p = places.get(x.key)?.place; return p === "booked" || p === "waitlisted"; };
445
+ const shown = sessions.filter((x) => x.day >= s.today && (!locationKey || x.locationKey === locationKey) && (!bookedOnly || mine(x)));
432
446
  const events = rowsOk === false ? [] : shown.map((x, i) => eventOf(x, places.get(x.key), shown[i + 1]?.day !== x.day));
433
447
  const sheet = sessions.find((x) => x.key === sheetKey);
434
448
  const sheetPlace = sheet ? places.get(sheet.key)?.place ?? "" : "";
435
449
  const loaded = s.status === "ready" && rowsOk !== false && !!services;
436
- const locationEmpty = loaded && !!locationKey && shown.length === 0;
450
+ const locationEmpty = loaded && !!locationKey && shown.length === 0 && !bookedOnly;
451
+ const bookedEmpty = loaded && bookedOnly && shown.length === 0;
437
452
  return {
438
453
  ...s,
454
+ filter: bookedOnly ? "booked" : "all",
455
+ // A visitor has no sessions of their own: the filter shows only to a signed-in member.
456
+ hideFilter: !filtersOn || !member?.email,
457
+ bookedEmpty,
458
+ notBookedEmpty: !bookedEmpty,
439
459
  ...locationMenu(choices, chosenLocation.id),
440
460
  locationSheetOpen: locationSheet,
441
461
  locationEmpty,
@@ -449,7 +469,7 @@ function derive(s: S): S {
449
469
  signedIn: !!member?.email,
450
470
  updateRequired: rowsOk === false,
451
471
  listHidden: s.busy === true || rowsOk === false || events.length === 0,
452
- ...emptyFlags(loaded && services!.length === 0, loaded && services!.length > 0 && events.length === 0 && !locationEmpty),
472
+ ...emptyFlags(loaded && services!.length === 0, loaded && services!.length > 0 && events.length === 0 && !locationEmpty && !bookedEmpty),
453
473
  sheetOpen: !!sheet && !!sheetPlace,
454
474
  sheetTitle: sheet?.title ?? "",
455
475
  sheetWhen: sheet ? joined(dayLabel(sheet.start, { absolute: true }), timeLabel(sheet.start), lengthLabel(sheet.start, sheet.end)) : "",
@@ -630,6 +650,7 @@ function initial(): S {
630
650
  sheetOpen: false, sheetTitle: "", sheetWhen: "", sheetMeta: "", sheetHideCalendar: true, sheetHideCancel: true, sheetHideLeave: true, sheetBusy: false, sheetServiceId: "", sheetSessionId: "", sheetStart: "",
631
651
  locationOptions: [], locationLabel: "", locationA11y: "", hasLocationMenu: false, noLocationMenu: true,
632
652
  locationActive: false, noLocationActive: true, locationSheetOpen: false, locationEmpty: false, notLocationEmpty: true,
653
+ filter: "all", hideFilter: true, bookedEmpty: false, notBookedEmpty: true,
633
654
  };
634
655
  }
635
656
 
@@ -673,10 +694,13 @@ const svc = defineService<S, {
673
694
  openLocations: (s: S) => S;
674
695
  closeLocations: (s: S) => S;
675
696
  selectLocation: (s: S, p?: unknown) => Promise<S | undefined>;
697
+ setFilter: (s: S, p?: unknown) => S;
676
698
  }>("himiBrandedAgenda", {
677
699
  // An action's result belongs to that visit: a cold start must not replay it from saved state,
678
700
  // nor reopen the location sheet.
679
- notHydrated: ["resultOpen", "resultOpenB", "resultText", "resultOk", "resultInfo", "locationSheetOpen"],
701
+ notHydrated: ["resultOpen", "resultOpenB", "resultText", "resultOk", "resultInfo", "locationSheetOpen", "filter", "hideFilter", "bookedEmpty", "notBookedEmpty"],
702
+ // The optional Booked filter is the member's choice for this run: never written to the device.
703
+ notPersisted: ["filter", "hideFilter", "bookedEmpty", "notBookedEmpty"],
680
704
  state: initial(),
681
705
  actions: {
682
706
  load: async (s, p) => {
@@ -688,6 +712,7 @@ const svc = defineService<S, {
688
712
  }
689
713
  const signInScreen = argOf(p, "signInScreenId");
690
714
  if (/^[a-z][a-z0-9_]{0,63}$/.test(signInScreen)) signInScreenId = signInScreen;
715
+ if (argOf(p, "filters") === "1") filtersOn = true;
691
716
  const fw = Number(argOf(p, "firstWeekday") || s.firstWeekday);
692
717
  const today = dayKey(new Date());
693
718
  // First appearance: open on this week. A re-appearance keeps the member's place and
@@ -932,6 +957,14 @@ const svc = defineService<S, {
932
957
  locationSheet = true;
933
958
  return derive({ ...s, ...wanted });
934
959
  },
960
+ // The "All · Booked" filter (a segmented control's id, or `{ id }`). A list of the member's own
961
+ // sessions, from the same loaded days; the calendar's dots follow it.
962
+ setFilter: (s, p) => {
963
+ const id = typeof p === "string" ? p : argOf(p, "id") || argOf(p, "value") || argOf(p, "selectedId");
964
+ if (id !== "all" && id !== "booked") return s;
965
+ bookedFilterFor = id === "booked" ? member?.email ?? "" : "";
966
+ return derive({ ...s, ...wanted });
967
+ },
935
968
  closeLocations: (s) => {
936
969
  if (!locationSheet) return s;
937
970
  locationSheet = false;
@@ -0,0 +1,152 @@
1
+ // himi-branded-lite APP-LEVEL nav worker — `NavigationConfig.navLogicBundle`.
2
+ //
3
+ // WHY IT EXISTS: `push.observerAction` names a `tier5.<service>.<action>` id, and the
4
+ // native sink resolves it against mounted screens FIRST and the app-level nav worker
5
+ // SECOND (`WorkerActionSink`, both platforms). A notification arrives while no screen
6
+ // of ours is mounted — that is the normal case for a cold-start tap and for every
7
+ // background receipt — so the only place the observer can reliably land is here. The
8
+ // config previously named `tier5.himiBrandedNotifications.onNotification` — a service
9
+ // that DOES exist, but as the notifications SCREEN's worker, alive only while that
10
+ // screen is mounted. So the observer dropped with a `nav_verb_dropped /
11
+ // no_worker_for_service` telemetry line in every case that matters.
12
+ //
13
+ // LIFETIME is the point: a screen worker dies with its screen, and this one is owned
14
+ // by the shell, so the unread count keeps accumulating while the user is somewhere
15
+ // else entirely (or nowhere — the app was backgrounded).
16
+ //
17
+ // It is built like every other worker (`himi build`) and named by the app's `navLogicBundle`.
18
+
19
+ import { defineService } from "@himalaya/state";
20
+ import { serializeForAgent } from "@himalaya/agent";
21
+ import { readNotificationEvent, setBadge } from "@himalaya/push";
22
+ import { applyBrand } from "@himalaya/theme";
23
+ import { hostSiteFromInput, hostedHiddenFlags } from "../_shared/branded-lite-hosted.js";
24
+ import { LOCATION_PIN_INITIAL, locationPin, type LocationPin, type LocationPinActionSignatures, type LocationPinState } from "../_shared/location-pin.js";
25
+ import { HEADER_BADGES_INITIAL, HEADER_BADGE_KEYS, headerBadges, type HeaderBadgeActionSignatures, type HeaderBadges, type HeaderBadgeState } from "../_shared/header-badges.js";
26
+
27
+ interface NavState extends HeaderBadgeState, LocationPinState {
28
+ error: string;
29
+ /** Notifications received but not yet opened. Drives the app-icon badge. */
30
+ unread: number;
31
+ /** True when `unread > 0` — a bindable boolean, so chrome does not have to do
32
+ * arithmetic in a descriptor path. */
33
+ hasUnread: boolean;
34
+ /** WHICH notifications are counted, newest last.
35
+ *
36
+ * A plain counter was wrong in both directions: a notification delivered while the
37
+ * app was backgrounded produces no receipt on either platform, so tapping it
38
+ * decremented a count it never contributed to, and a receipt seen twice (two
39
+ * surfaces reporting one notification) counted it twice. Identity is the fix —
40
+ * `unread` is this list's length, never an independent number. */
41
+ unreadIds: string[];
42
+ /** What arrived last, for the dev loop and for a "what did I miss" surface. The
43
+ * Ping template rather than the body: the body is localized server-side and this
44
+ * worker never sees it. */
45
+ lastTemplateId: string;
46
+ lastTopic: string;
47
+ /** The destination the route table produced, or "" when no route matched. Empty
48
+ * here is exactly the signal that a delivered notification had nowhere to go. */
49
+ lastResolvedLink: string;
50
+ /** Hosted mode (#4089 B2 Task 2c): per vertical, whether its nav rows are hidden for the site the
51
+ * host opened this app for (`himalaya.input.__himiHostSite`, set by core from the host binding). The rows bind it fail-closed, so nothing
52
+ * shows before this worker has answered. A single-site build never binds it. */
53
+ hosted: Record<string, boolean>;
54
+ }
55
+
56
+ /** How many unread notifications are tracked. A long-lived app must not accumulate
57
+ * ids forever, and a count past this is "lots" for badge purposes. */
58
+ const UNREAD_LIMIT = 50;
59
+
60
+ /** What identifies a notification. `notificationId` when the sender set one; the
61
+ * resolved destination (or the raw link) otherwise, which is the best available
62
+ * handle — two notifications that open the same thing collapse, and the alternative
63
+ * is counting every duplicate delivery of one notification. */
64
+ function identify(ev: { notificationId: string; resolvedLink: string; link: string }): string {
65
+ return ev.notificationId || ev.resolvedLink || ev.link;
66
+ }
67
+
68
+ /** The site the host opened this app for, or null (single-site build, or no host). */
69
+ const hostedSite = hostSiteFromInput((globalThis as { himalaya?: { input?: unknown } }).himalaya?.input);
70
+
71
+ // The header badge counts (bell, chat, cart): one service piece shared with the template's badges-only worker.
72
+ const badges: HeaderBadges<NavState> = headerBadges<NavState>(updateInOrder, () => svc);
73
+ // The Services top-bar location pin (`noLocationMenu`): one piece shared with the access-gates worker.
74
+ const pin: LocationPin<NavState> = locationPin<NavState>(updateInOrder, () => svc);
75
+
76
+ const svc = defineService<NavState, {
77
+ /** The observer. Dispatched on EVERY notification, receipt or tap — `tapped` is
78
+ * what tells the two apart, and the native side stringifies it. */
79
+ onNotification: (s: NavState, params?: unknown) => Promise<NavState>;
80
+ /** Zero the count (the user has caught up). */
81
+ clearUnread: (s: NavState) => Promise<NavState>;
82
+ } & HeaderBadgeActionSignatures<NavState> & LocationPinActionSignatures<NavState>>("brandedLiteNav", {
83
+ state: { error: "", unread: 0, hasUnread: false, unreadIds: [], lastTemplateId: "", lastTopic: "", lastResolvedLink: "", hosted: hostedHiddenFlags(hostedSite), ...LOCATION_PIN_INITIAL, ...HEADER_BADGES_INITIAL },
84
+ // The header badge counts describe THIS run (see _shared/header-badges.ts): never stored, never restored.
85
+ notPersisted: HEADER_BADGE_KEYS,
86
+ notHydrated: HEADER_BADGE_KEYS,
87
+ actions: {
88
+ onNotification: async (s, params) => {
89
+ return updateInOrder(s, (current) => {
90
+ const ev = readNotificationEvent(params);
91
+ // A TAP means the user dealt with THAT notification, not all of them — and only
92
+ // with one that was actually counted, which a background delivery never was.
93
+ const id = identify(ev);
94
+ const openedIndex = current.unreadIds.indexOf(id);
95
+ const ids = ev.tapped ? current.unreadIds.filter((_, index) => index !== openedIndex)
96
+ : id && current.unreadIds.includes(id) ? current.unreadIds : [...current.unreadIds, id].slice(-UNREAD_LIMIT);
97
+ return next(current, ids, ev.templateId, ev.topic, ev.resolvedLink);
98
+ }).finally(() => badges.refresh());
99
+ },
100
+ // The shell runs this on every foreground, which is the one supported moment to re-read the badges.
101
+ clearUnread: async (s) => updateInOrder(s, (current) =>
102
+ next(current, [], current.lastTemplateId, current.lastTopic, current.lastResolvedLink))
103
+ .finally(() => badges.refresh()),
104
+ ...pin.actions,
105
+ ...badges.actions,
106
+ },
107
+ });
108
+
109
+ // Badge writes await native work; overlapping actions must use the preceding result.
110
+ let stateQueue: Promise<NavState> | undefined;
111
+ function updateInOrder(s: NavState, update: (current: NavState) => Promise<NavState>): Promise<NavState> {
112
+ const previous = stateQueue ?? Promise.resolve(s);
113
+ const result = previous.then(update);
114
+ stateQueue = result.catch(() => previous);
115
+ return result;
116
+ }
117
+
118
+ /** One place that writes the count, so the badge and the state cannot disagree.
119
+ * The badge write is best-effort: a denied push permission must not take the
120
+ * observer down with it, and the count is still correct in state. */
121
+ async function next(
122
+ s: NavState,
123
+ unreadIds: string[],
124
+ lastTemplateId: string,
125
+ lastTopic: string,
126
+ lastResolvedLink: string,
127
+ ): Promise<NavState> {
128
+ const unread = unreadIds.length;
129
+ const out: NavState = {
130
+ ...s, error: "", unread, hasUnread: unread > 0, unreadIds, lastTemplateId, lastTopic, lastResolvedLink,
131
+ };
132
+ try {
133
+ await setBadge(unread);
134
+ } catch {
135
+ out.error = "Could not update the app badge.";
136
+ }
137
+ serializeForAgent({ brandedLiteNav: out });
138
+ return out;
139
+ }
140
+
141
+ export { svc };
142
+
143
+ // A site without bookings never shows the pin, so a hosted site without them reads no catalog.
144
+ pin.start(!!hostedSite && hostedHiddenFlags(hostedSite).bookings);
145
+ // Subscribing notifies at once, which is the launch read; a host with no clock needs the explicit one.
146
+ badges.start();
147
+
148
+ // Hosted mode: the site's own brand over the build's. The shell's brand slot is scoped to this
149
+ // host session, so a site switch drops it.
150
+ if (hostedSite?.primaryColor) {
151
+ void applyBrand({ primaryColor: hostedSite.primaryColor }).catch((e: unknown) => console.warn(`[branded-lite] hosted brand not applied: ${String(e)}`));
152
+ }
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
565
565
  lastNameFocus: string;
566
566
  emailFocus: string;
567
567
  message: string;
568
+ hideMessage: boolean;
569
+ messageKind: "error" | "success";
570
+ resetSent: boolean;
568
571
  isLoading: boolean;
569
572
  notLoading: boolean;
570
573
  isRegistering: boolean;
@@ -640,6 +643,9 @@ function derive(s: S): S {
640
643
  const name = s.isMember ? greetingName(s.memberName) : "";
641
644
  return {
642
645
  ...s,
646
+ hideMessage: !s.message,
647
+ messageKind: s.resetSent ? "success" : "error",
648
+ resetSent: !!s.message && !!s.resetSent,
643
649
  greeting: name
644
650
  ? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
645
651
  : copyParam("storeAccount.greetingGuest", "Hey, guest"),
@@ -815,7 +821,7 @@ const svc = defineService<S, {
815
821
  restorePublish: (s: S) => S;
816
822
  iapRestore: (s: S) => Promise<undefined>;
817
823
  }>("himiStoreAccount", {
818
- notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
824
+ notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
819
825
  state: derive({
820
826
  status: "loading",
821
827
  isMember: false,
@@ -846,6 +852,9 @@ const svc = defineService<S, {
846
852
  lastNameFocus: "",
847
853
  emailFocus: "",
848
854
  message: "",
855
+ hideMessage: true,
856
+ messageKind: "error",
857
+ resetSent: false,
849
858
  isLoading: true,
850
859
  notLoading: false,
851
860
  // The form's first paint is already on its route's mode: only sign-in's route has `mode`.
@@ -942,10 +951,10 @@ const svc = defineService<S, {
942
951
  rejectResult(raw, "reset");
943
952
  if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
944
953
  return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
945
- message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
954
+ resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
946
955
  } catch (error) {
947
956
  return derive({ ...svc.getState(), authBusy: false,
948
- message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
957
+ resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
949
958
  } finally { authInFlight = false; }
950
959
  },
951
960
  signIn: (s) => authenticate(s, "signIn"),
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
991
1000
  },
992
1001
  });
993
1002
 
994
- resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
1003
+ resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
995
1004
  // `boot` tells settle this is not a visit: the host drops this call's navigation, and the
996
1005
  // appear refresh does the visit's moves.
997
1006
  svc.load({ boot: "1" });
@@ -11,7 +11,7 @@ import { getMyData, displayName } from "@himalaya/wix-users";
11
11
  // `load` has resolved a member, so a guest never glimpses the placeholder avatar while
12
12
  // the membership check is still running; `hideLoading` is false for exactly that moment,
13
13
  // so the screen shows a loading line instead of going blank.
14
- interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean }
14
+ interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean; hideError: boolean; hideAbout: boolean }
15
15
 
16
16
  const EMPTY: S = {
17
17
  status: "loading",
@@ -24,6 +24,8 @@ const EMPTY: S = {
24
24
  noSignIn: true,
25
25
  profileHidden: true,
26
26
  hideLoading: false,
27
+ hideError: true,
28
+ hideAbout: false,
27
29
  };
28
30
 
29
31
  // The SAME member check create-post and orders use (`memberAccess`: the host's
@@ -41,66 +43,77 @@ function fromParts(name: string, handleRaw: string, about: string, photo = ""):
41
43
  const clean = name.trim();
42
44
  const handle = "@" + (handleRaw || clean || "member").replace(/\s+/g, "").replace(/^@+/, "").toLowerCase();
43
45
  const initial = (clean.split(/\s+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2) || "?").toUpperCase();
44
- return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true };
46
+ return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true, hideError: true, hideAbout: false };
45
47
  }
46
48
 
47
- const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesViewProfile", {
49
+ async function readProfile(): Promise<S> {
50
+ const email = await sessionEmail();
51
+ if (!email) {
52
+ return {
53
+ status: "ready",
54
+ // Kept for hosts without the shared member gate (the Spaces clone renders these
55
+ // fields directly); branded-lite hides the profile block behind `profileHidden`.
56
+ name: "Sign in to view your profile",
57
+ handle: "",
58
+ about: "Your public profile is available after you sign in from Account.",
59
+ initial: "?",
60
+ photo: "",
61
+ needsSignIn: true,
62
+ noSignIn: false,
63
+ profileHidden: true,
64
+ hideLoading: true,
65
+ hideError: true,
66
+ hideAbout: false,
67
+ };
68
+ }
69
+ try {
70
+ const api = wixApi();
71
+ if (api) {
72
+ const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
73
+ member?: {
74
+ loginEmail?: string;
75
+ contact?: { firstName?: string; lastName?: string };
76
+ profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
77
+ };
78
+ };
79
+ const m = res.member;
80
+ if (m) {
81
+ const nick = m.profile?.nickname?.trim() || "";
82
+ const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
83
+ const name = full || nick || m.loginEmail || email;
84
+ const slug = m.profile?.slug || nick || name;
85
+ const about = m.profile?.title || "No info to display.";
86
+ return fromParts(name, slug, about, m.profile?.photo?.url || "");
87
+ }
88
+ }
89
+ } catch { /* fall through to users my-data / email */ }
90
+ try {
91
+ const d = await getMyData();
92
+ const name = displayName(d) || email;
93
+ const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
94
+ return fromParts(
95
+ name,
96
+ dd.slug || dd.nickname || name,
97
+ dd.aboutPlain || dd.about || "No info to display.",
98
+ dd.profile?.photo?.url || dd.photo?.url || "",
99
+ );
100
+ } catch {
101
+ // Session identity is still known; missing profile data is not an empty biography.
102
+ return { ...fromParts(email, email.split("@")[0] || email, ""), about: "Profile details could not be loaded. Please try again.", hideError: false, hideAbout: true };
103
+ }
104
+ }
105
+ let generation = 0;
106
+ const svc = defineService<S, { load: (s: S) => Promise<S | undefined> }>("spacesViewProfile", {
48
107
  state: { ...EMPTY },
108
+ notHydrated: Object.keys(EMPTY) as (keyof S & string)[],
49
109
  actions: {
50
110
  load: async () => {
51
- const email = await sessionEmail();
52
- if (!email) {
53
- return {
54
- status: "ready",
55
- // Kept for hosts without the shared member gate (the Spaces clone renders these
56
- // fields directly); branded-lite hides the profile block behind `profileHidden`.
57
- name: "Sign in to view your profile",
58
- handle: "",
59
- about: "Your public profile is available after you sign in from Account.",
60
- initial: "?",
61
- photo: "",
62
- needsSignIn: true,
63
- noSignIn: false,
64
- profileHidden: true,
65
- hideLoading: true,
66
- };
67
- }
68
- try {
69
- const api = wixApi();
70
- if (api) {
71
- const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
72
- member?: {
73
- loginEmail?: string;
74
- contact?: { firstName?: string; lastName?: string };
75
- profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
76
- };
77
- };
78
- const m = res.member;
79
- if (m) {
80
- const nick = m.profile?.nickname?.trim() || "";
81
- const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
82
- const name = full || nick || m.loginEmail || email;
83
- const slug = m.profile?.slug || nick || name;
84
- const about = m.profile?.title || "No info to display.";
85
- return fromParts(name, slug, about, m.profile?.photo?.url || "");
86
- }
87
- }
88
- } catch { /* fall through to users my-data / email */ }
89
- try {
90
- const d = await getMyData();
91
- const name = displayName(d) || email;
92
- const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
93
- return fromParts(
94
- name,
95
- dd.slug || dd.nickname || name,
96
- dd.aboutPlain || dd.about || "No info to display.",
97
- dd.profile?.photo?.url || dd.photo?.url || "",
98
- );
99
- } catch {
100
- return fromParts(email, email.split("@")[0] || email, "No info to display.");
101
- }
111
+ const request = ++generation;
112
+ const next = await readProfile();
113
+ return request === generation ? next : undefined;
102
114
  },
103
115
  },
104
116
  });
105
- svc.load();
117
+ if (!(globalThis as { himalaya?: { hydrationOptOut?: boolean } }).himalaya?.hydrationOptOut) Object.assign(svc.getState(), EMPTY);
118
+ void svc.load();
106
119
  export { svc };