@wix/himalaya-cli 0.1835.0 → 0.1837.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 (367) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/local-db/src/index.d.ts +15 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +4 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +1 -0
  4. package/dist/browser-plane/assets.json +5 -5
  5. package/dist/browser-plane/preview-deferred/{9258d331cc401dff7b183ce732d49df2e480ea113b52198a4a10790167519c09.bin → 12b7dd1ca5ed350a30ed6a0085a4c31f30b46688e3795c425f145dfdd3830b31.bin} +1 -1
  6. package/dist/browser-plane/sw.js +8 -8
  7. package/dist/cli.mjs +1010 -705
  8. package/dist/preview-assets.generated.bin +0 -0
  9. package/guides/app-config.md +42 -0
  10. package/guides/component-index.md +198 -0
  11. package/guides/designing-himi-screens.md +6 -5
  12. package/guides/getting-started.md +5 -1
  13. package/guides/himi-json-output.md +14 -1
  14. package/guides/himi-skill.md +5 -1
  15. package/guides/himi-test.md +6 -1
  16. package/guides/index.json +6 -0
  17. package/guides/release-notes.md +8 -0
  18. package/guides/sdk-reference.json +1 -1
  19. package/guides/skill.md +4 -0
  20. package/guides/tier-5-add-a-screen.md +10 -5
  21. package/guides/web-ux.md +2 -1
  22. package/package.json +2 -2
  23. package/templates/beauty-salon/dev/index.ts +305 -2
  24. package/templates/beauty-salon/l10n/ar.json +77 -0
  25. package/templates/beauty-salon/l10n/cs.json +77 -0
  26. package/templates/beauty-salon/l10n/da.json +77 -0
  27. package/templates/beauty-salon/l10n/de.json +77 -0
  28. package/templates/beauty-salon/l10n/el.json +77 -0
  29. package/templates/beauty-salon/l10n/en.json +85 -1
  30. package/templates/beauty-salon/l10n/es.json +77 -0
  31. package/templates/beauty-salon/l10n/fi.json +77 -0
  32. package/templates/beauty-salon/l10n/fr.json +77 -0
  33. package/templates/beauty-salon/l10n/he.json +64 -0
  34. package/templates/beauty-salon/l10n/hu.json +77 -0
  35. package/templates/beauty-salon/l10n/id.json +77 -0
  36. package/templates/beauty-salon/l10n/it.json +77 -0
  37. package/templates/beauty-salon/l10n/ja.json +77 -0
  38. package/templates/beauty-salon/l10n/ko.json +77 -0
  39. package/templates/beauty-salon/l10n/lt.json +77 -0
  40. package/templates/beauty-salon/l10n/nl.json +77 -0
  41. package/templates/beauty-salon/l10n/no.json +77 -0
  42. package/templates/beauty-salon/l10n/pl.json +77 -0
  43. package/templates/beauty-salon/l10n/pt.json +77 -0
  44. package/templates/beauty-salon/l10n/ru.json +77 -0
  45. package/templates/beauty-salon/l10n/sv.json +77 -0
  46. package/templates/beauty-salon/l10n/th.json +77 -0
  47. package/templates/beauty-salon/l10n/tr.json +77 -0
  48. package/templates/beauty-salon/l10n/uk.json +77 -0
  49. package/templates/beauty-salon/l10n/vi.json +77 -0
  50. package/templates/beauty-salon/l10n/zh.json +77 -0
  51. package/templates/beauty-salon/tier5-src/_shared/push-permission.ts +75 -0
  52. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +103 -4
  53. package/templates/beauty-salon/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  54. package/templates/branded-lite/dev/index.ts +305 -2
  55. package/templates/branded-lite/l10n/ar.json +77 -0
  56. package/templates/branded-lite/l10n/cs.json +77 -0
  57. package/templates/branded-lite/l10n/da.json +77 -0
  58. package/templates/branded-lite/l10n/de.json +77 -0
  59. package/templates/branded-lite/l10n/el.json +77 -0
  60. package/templates/branded-lite/l10n/en.json +85 -1
  61. package/templates/branded-lite/l10n/es.json +77 -0
  62. package/templates/branded-lite/l10n/fi.json +77 -0
  63. package/templates/branded-lite/l10n/fr.json +77 -0
  64. package/templates/branded-lite/l10n/he.json +64 -0
  65. package/templates/branded-lite/l10n/hu.json +77 -0
  66. package/templates/branded-lite/l10n/id.json +77 -0
  67. package/templates/branded-lite/l10n/it.json +77 -0
  68. package/templates/branded-lite/l10n/ja.json +77 -0
  69. package/templates/branded-lite/l10n/ko.json +77 -0
  70. package/templates/branded-lite/l10n/lt.json +77 -0
  71. package/templates/branded-lite/l10n/nl.json +77 -0
  72. package/templates/branded-lite/l10n/no.json +77 -0
  73. package/templates/branded-lite/l10n/pl.json +77 -0
  74. package/templates/branded-lite/l10n/pt.json +77 -0
  75. package/templates/branded-lite/l10n/ru.json +77 -0
  76. package/templates/branded-lite/l10n/sv.json +77 -0
  77. package/templates/branded-lite/l10n/th.json +77 -0
  78. package/templates/branded-lite/l10n/tr.json +77 -0
  79. package/templates/branded-lite/l10n/uk.json +77 -0
  80. package/templates/branded-lite/l10n/vi.json +77 -0
  81. package/templates/branded-lite/l10n/zh.json +77 -0
  82. package/templates/branded-lite/tier5-src/_shared/push-permission.ts +75 -0
  83. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +103 -4
  84. package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  85. package/templates/community-club/dev/index.ts +305 -2
  86. package/templates/community-club/l10n/ar.json +77 -0
  87. package/templates/community-club/l10n/cs.json +77 -0
  88. package/templates/community-club/l10n/da.json +77 -0
  89. package/templates/community-club/l10n/de.json +77 -0
  90. package/templates/community-club/l10n/el.json +77 -0
  91. package/templates/community-club/l10n/en.json +85 -1
  92. package/templates/community-club/l10n/es.json +77 -0
  93. package/templates/community-club/l10n/fi.json +77 -0
  94. package/templates/community-club/l10n/fr.json +77 -0
  95. package/templates/community-club/l10n/he.json +64 -0
  96. package/templates/community-club/l10n/hu.json +77 -0
  97. package/templates/community-club/l10n/id.json +77 -0
  98. package/templates/community-club/l10n/it.json +77 -0
  99. package/templates/community-club/l10n/ja.json +77 -0
  100. package/templates/community-club/l10n/ko.json +77 -0
  101. package/templates/community-club/l10n/lt.json +77 -0
  102. package/templates/community-club/l10n/nl.json +77 -0
  103. package/templates/community-club/l10n/no.json +77 -0
  104. package/templates/community-club/l10n/pl.json +77 -0
  105. package/templates/community-club/l10n/pt.json +77 -0
  106. package/templates/community-club/l10n/ru.json +77 -0
  107. package/templates/community-club/l10n/sv.json +77 -0
  108. package/templates/community-club/l10n/th.json +77 -0
  109. package/templates/community-club/l10n/tr.json +77 -0
  110. package/templates/community-club/l10n/uk.json +77 -0
  111. package/templates/community-club/l10n/vi.json +77 -0
  112. package/templates/community-club/l10n/zh.json +77 -0
  113. package/templates/community-club/tier5-src/_shared/push-permission.ts +75 -0
  114. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +103 -4
  115. package/templates/community-club/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  116. package/templates/events-meetups/dev/index.ts +305 -2
  117. package/templates/events-meetups/l10n/ar.json +77 -0
  118. package/templates/events-meetups/l10n/cs.json +77 -0
  119. package/templates/events-meetups/l10n/da.json +77 -0
  120. package/templates/events-meetups/l10n/de.json +77 -0
  121. package/templates/events-meetups/l10n/el.json +77 -0
  122. package/templates/events-meetups/l10n/en.json +85 -1
  123. package/templates/events-meetups/l10n/es.json +77 -0
  124. package/templates/events-meetups/l10n/fi.json +77 -0
  125. package/templates/events-meetups/l10n/fr.json +77 -0
  126. package/templates/events-meetups/l10n/he.json +64 -0
  127. package/templates/events-meetups/l10n/hu.json +77 -0
  128. package/templates/events-meetups/l10n/id.json +77 -0
  129. package/templates/events-meetups/l10n/it.json +77 -0
  130. package/templates/events-meetups/l10n/ja.json +77 -0
  131. package/templates/events-meetups/l10n/ko.json +77 -0
  132. package/templates/events-meetups/l10n/lt.json +77 -0
  133. package/templates/events-meetups/l10n/nl.json +77 -0
  134. package/templates/events-meetups/l10n/no.json +77 -0
  135. package/templates/events-meetups/l10n/pl.json +77 -0
  136. package/templates/events-meetups/l10n/pt.json +77 -0
  137. package/templates/events-meetups/l10n/ru.json +77 -0
  138. package/templates/events-meetups/l10n/sv.json +77 -0
  139. package/templates/events-meetups/l10n/th.json +77 -0
  140. package/templates/events-meetups/l10n/tr.json +77 -0
  141. package/templates/events-meetups/l10n/uk.json +77 -0
  142. package/templates/events-meetups/l10n/vi.json +77 -0
  143. package/templates/events-meetups/l10n/zh.json +77 -0
  144. package/templates/events-meetups/tier5-src/_shared/push-permission.ts +75 -0
  145. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +103 -4
  146. package/templates/events-meetups/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  147. package/templates/gym-fitness/dev/index.ts +305 -2
  148. package/templates/gym-fitness/l10n/ar.json +77 -0
  149. package/templates/gym-fitness/l10n/cs.json +77 -0
  150. package/templates/gym-fitness/l10n/da.json +77 -0
  151. package/templates/gym-fitness/l10n/de.json +77 -0
  152. package/templates/gym-fitness/l10n/el.json +77 -0
  153. package/templates/gym-fitness/l10n/en.json +85 -1
  154. package/templates/gym-fitness/l10n/es.json +77 -0
  155. package/templates/gym-fitness/l10n/fi.json +77 -0
  156. package/templates/gym-fitness/l10n/fr.json +77 -0
  157. package/templates/gym-fitness/l10n/he.json +64 -0
  158. package/templates/gym-fitness/l10n/hu.json +77 -0
  159. package/templates/gym-fitness/l10n/id.json +77 -0
  160. package/templates/gym-fitness/l10n/it.json +77 -0
  161. package/templates/gym-fitness/l10n/ja.json +77 -0
  162. package/templates/gym-fitness/l10n/ko.json +77 -0
  163. package/templates/gym-fitness/l10n/lt.json +77 -0
  164. package/templates/gym-fitness/l10n/nl.json +77 -0
  165. package/templates/gym-fitness/l10n/no.json +77 -0
  166. package/templates/gym-fitness/l10n/pl.json +77 -0
  167. package/templates/gym-fitness/l10n/pt.json +77 -0
  168. package/templates/gym-fitness/l10n/ru.json +77 -0
  169. package/templates/gym-fitness/l10n/sv.json +77 -0
  170. package/templates/gym-fitness/l10n/th.json +77 -0
  171. package/templates/gym-fitness/l10n/tr.json +77 -0
  172. package/templates/gym-fitness/l10n/uk.json +77 -0
  173. package/templates/gym-fitness/l10n/vi.json +77 -0
  174. package/templates/gym-fitness/l10n/zh.json +77 -0
  175. package/templates/gym-fitness/tier5-src/_shared/push-permission.ts +75 -0
  176. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +103 -4
  177. package/templates/gym-fitness/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  178. package/templates/nonprofit-cause/dev/index.ts +305 -2
  179. package/templates/nonprofit-cause/l10n/ar.json +77 -0
  180. package/templates/nonprofit-cause/l10n/cs.json +77 -0
  181. package/templates/nonprofit-cause/l10n/da.json +77 -0
  182. package/templates/nonprofit-cause/l10n/de.json +77 -0
  183. package/templates/nonprofit-cause/l10n/el.json +77 -0
  184. package/templates/nonprofit-cause/l10n/en.json +85 -1
  185. package/templates/nonprofit-cause/l10n/es.json +77 -0
  186. package/templates/nonprofit-cause/l10n/fi.json +77 -0
  187. package/templates/nonprofit-cause/l10n/fr.json +77 -0
  188. package/templates/nonprofit-cause/l10n/he.json +64 -0
  189. package/templates/nonprofit-cause/l10n/hu.json +77 -0
  190. package/templates/nonprofit-cause/l10n/id.json +77 -0
  191. package/templates/nonprofit-cause/l10n/it.json +77 -0
  192. package/templates/nonprofit-cause/l10n/ja.json +77 -0
  193. package/templates/nonprofit-cause/l10n/ko.json +77 -0
  194. package/templates/nonprofit-cause/l10n/lt.json +77 -0
  195. package/templates/nonprofit-cause/l10n/nl.json +77 -0
  196. package/templates/nonprofit-cause/l10n/no.json +77 -0
  197. package/templates/nonprofit-cause/l10n/pl.json +77 -0
  198. package/templates/nonprofit-cause/l10n/pt.json +77 -0
  199. package/templates/nonprofit-cause/l10n/ru.json +77 -0
  200. package/templates/nonprofit-cause/l10n/sv.json +77 -0
  201. package/templates/nonprofit-cause/l10n/th.json +77 -0
  202. package/templates/nonprofit-cause/l10n/tr.json +77 -0
  203. package/templates/nonprofit-cause/l10n/uk.json +77 -0
  204. package/templates/nonprofit-cause/l10n/vi.json +77 -0
  205. package/templates/nonprofit-cause/l10n/zh.json +77 -0
  206. package/templates/nonprofit-cause/tier5-src/_shared/push-permission.ts +75 -0
  207. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +103 -4
  208. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  209. package/templates/personal-fitness-trainer/config.ts +1 -1
  210. package/templates/personal-fitness-trainer/dev/index.ts +129 -1
  211. package/templates/personal-fitness-trainer/tier5-src/_shared/push-permission.ts +75 -0
  212. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  213. package/templates/podcast-creator/dev/index.ts +305 -2
  214. package/templates/podcast-creator/l10n/ar.json +77 -0
  215. package/templates/podcast-creator/l10n/cs.json +77 -0
  216. package/templates/podcast-creator/l10n/da.json +77 -0
  217. package/templates/podcast-creator/l10n/de.json +77 -0
  218. package/templates/podcast-creator/l10n/el.json +77 -0
  219. package/templates/podcast-creator/l10n/en.json +85 -1
  220. package/templates/podcast-creator/l10n/es.json +77 -0
  221. package/templates/podcast-creator/l10n/fi.json +77 -0
  222. package/templates/podcast-creator/l10n/fr.json +77 -0
  223. package/templates/podcast-creator/l10n/he.json +64 -0
  224. package/templates/podcast-creator/l10n/hu.json +77 -0
  225. package/templates/podcast-creator/l10n/id.json +77 -0
  226. package/templates/podcast-creator/l10n/it.json +77 -0
  227. package/templates/podcast-creator/l10n/ja.json +77 -0
  228. package/templates/podcast-creator/l10n/ko.json +77 -0
  229. package/templates/podcast-creator/l10n/lt.json +77 -0
  230. package/templates/podcast-creator/l10n/nl.json +77 -0
  231. package/templates/podcast-creator/l10n/no.json +77 -0
  232. package/templates/podcast-creator/l10n/pl.json +77 -0
  233. package/templates/podcast-creator/l10n/pt.json +77 -0
  234. package/templates/podcast-creator/l10n/ru.json +77 -0
  235. package/templates/podcast-creator/l10n/sv.json +77 -0
  236. package/templates/podcast-creator/l10n/th.json +77 -0
  237. package/templates/podcast-creator/l10n/tr.json +77 -0
  238. package/templates/podcast-creator/l10n/uk.json +77 -0
  239. package/templates/podcast-creator/l10n/vi.json +77 -0
  240. package/templates/podcast-creator/l10n/zh.json +77 -0
  241. package/templates/podcast-creator/tier5-src/_shared/push-permission.ts +75 -0
  242. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +103 -4
  243. package/templates/podcast-creator/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  244. package/templates/portfolio-creative/dev/index.ts +305 -2
  245. package/templates/portfolio-creative/l10n/ar.json +77 -0
  246. package/templates/portfolio-creative/l10n/cs.json +77 -0
  247. package/templates/portfolio-creative/l10n/da.json +77 -0
  248. package/templates/portfolio-creative/l10n/de.json +77 -0
  249. package/templates/portfolio-creative/l10n/el.json +77 -0
  250. package/templates/portfolio-creative/l10n/en.json +85 -1
  251. package/templates/portfolio-creative/l10n/es.json +77 -0
  252. package/templates/portfolio-creative/l10n/fi.json +77 -0
  253. package/templates/portfolio-creative/l10n/fr.json +77 -0
  254. package/templates/portfolio-creative/l10n/he.json +64 -0
  255. package/templates/portfolio-creative/l10n/hu.json +77 -0
  256. package/templates/portfolio-creative/l10n/id.json +77 -0
  257. package/templates/portfolio-creative/l10n/it.json +77 -0
  258. package/templates/portfolio-creative/l10n/ja.json +77 -0
  259. package/templates/portfolio-creative/l10n/ko.json +77 -0
  260. package/templates/portfolio-creative/l10n/lt.json +77 -0
  261. package/templates/portfolio-creative/l10n/nl.json +77 -0
  262. package/templates/portfolio-creative/l10n/no.json +77 -0
  263. package/templates/portfolio-creative/l10n/pl.json +77 -0
  264. package/templates/portfolio-creative/l10n/pt.json +77 -0
  265. package/templates/portfolio-creative/l10n/ru.json +77 -0
  266. package/templates/portfolio-creative/l10n/sv.json +77 -0
  267. package/templates/portfolio-creative/l10n/th.json +77 -0
  268. package/templates/portfolio-creative/l10n/tr.json +77 -0
  269. package/templates/portfolio-creative/l10n/uk.json +77 -0
  270. package/templates/portfolio-creative/l10n/vi.json +77 -0
  271. package/templates/portfolio-creative/l10n/zh.json +77 -0
  272. package/templates/portfolio-creative/tier5-src/_shared/push-permission.ts +75 -0
  273. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +103 -4
  274. package/templates/portfolio-creative/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  275. package/templates/restaurant/dev/index.ts +305 -2
  276. package/templates/restaurant/l10n/ar.json +77 -0
  277. package/templates/restaurant/l10n/cs.json +77 -0
  278. package/templates/restaurant/l10n/da.json +77 -0
  279. package/templates/restaurant/l10n/de.json +77 -0
  280. package/templates/restaurant/l10n/el.json +77 -0
  281. package/templates/restaurant/l10n/en.json +85 -1
  282. package/templates/restaurant/l10n/es.json +77 -0
  283. package/templates/restaurant/l10n/fi.json +77 -0
  284. package/templates/restaurant/l10n/fr.json +77 -0
  285. package/templates/restaurant/l10n/he.json +64 -0
  286. package/templates/restaurant/l10n/hu.json +77 -0
  287. package/templates/restaurant/l10n/id.json +77 -0
  288. package/templates/restaurant/l10n/it.json +77 -0
  289. package/templates/restaurant/l10n/ja.json +77 -0
  290. package/templates/restaurant/l10n/ko.json +77 -0
  291. package/templates/restaurant/l10n/lt.json +77 -0
  292. package/templates/restaurant/l10n/nl.json +77 -0
  293. package/templates/restaurant/l10n/no.json +77 -0
  294. package/templates/restaurant/l10n/pl.json +77 -0
  295. package/templates/restaurant/l10n/pt.json +77 -0
  296. package/templates/restaurant/l10n/ru.json +77 -0
  297. package/templates/restaurant/l10n/sv.json +77 -0
  298. package/templates/restaurant/l10n/th.json +77 -0
  299. package/templates/restaurant/l10n/tr.json +77 -0
  300. package/templates/restaurant/l10n/uk.json +77 -0
  301. package/templates/restaurant/l10n/vi.json +77 -0
  302. package/templates/restaurant/l10n/zh.json +77 -0
  303. package/templates/restaurant/tier5-src/_shared/push-permission.ts +75 -0
  304. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +103 -4
  305. package/templates/restaurant/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  306. package/templates/retail-store/dev/index.ts +305 -2
  307. package/templates/retail-store/l10n/ar.json +77 -0
  308. package/templates/retail-store/l10n/cs.json +77 -0
  309. package/templates/retail-store/l10n/da.json +77 -0
  310. package/templates/retail-store/l10n/de.json +77 -0
  311. package/templates/retail-store/l10n/el.json +77 -0
  312. package/templates/retail-store/l10n/en.json +85 -1
  313. package/templates/retail-store/l10n/es.json +77 -0
  314. package/templates/retail-store/l10n/fi.json +77 -0
  315. package/templates/retail-store/l10n/fr.json +77 -0
  316. package/templates/retail-store/l10n/he.json +64 -0
  317. package/templates/retail-store/l10n/hu.json +77 -0
  318. package/templates/retail-store/l10n/id.json +77 -0
  319. package/templates/retail-store/l10n/it.json +77 -0
  320. package/templates/retail-store/l10n/ja.json +77 -0
  321. package/templates/retail-store/l10n/ko.json +77 -0
  322. package/templates/retail-store/l10n/lt.json +77 -0
  323. package/templates/retail-store/l10n/nl.json +77 -0
  324. package/templates/retail-store/l10n/no.json +77 -0
  325. package/templates/retail-store/l10n/pl.json +77 -0
  326. package/templates/retail-store/l10n/pt.json +77 -0
  327. package/templates/retail-store/l10n/ru.json +77 -0
  328. package/templates/retail-store/l10n/sv.json +77 -0
  329. package/templates/retail-store/l10n/th.json +77 -0
  330. package/templates/retail-store/l10n/tr.json +77 -0
  331. package/templates/retail-store/l10n/uk.json +77 -0
  332. package/templates/retail-store/l10n/vi.json +77 -0
  333. package/templates/retail-store/l10n/zh.json +77 -0
  334. package/templates/retail-store/tier5-src/_shared/push-permission.ts +75 -0
  335. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +103 -4
  336. package/templates/retail-store/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  337. package/templates/yoga-studio/dev/index.ts +305 -2
  338. package/templates/yoga-studio/l10n/ar.json +77 -0
  339. package/templates/yoga-studio/l10n/cs.json +77 -0
  340. package/templates/yoga-studio/l10n/da.json +77 -0
  341. package/templates/yoga-studio/l10n/de.json +77 -0
  342. package/templates/yoga-studio/l10n/el.json +77 -0
  343. package/templates/yoga-studio/l10n/en.json +85 -1
  344. package/templates/yoga-studio/l10n/es.json +77 -0
  345. package/templates/yoga-studio/l10n/fi.json +77 -0
  346. package/templates/yoga-studio/l10n/fr.json +77 -0
  347. package/templates/yoga-studio/l10n/he.json +64 -0
  348. package/templates/yoga-studio/l10n/hu.json +77 -0
  349. package/templates/yoga-studio/l10n/id.json +77 -0
  350. package/templates/yoga-studio/l10n/it.json +77 -0
  351. package/templates/yoga-studio/l10n/ja.json +77 -0
  352. package/templates/yoga-studio/l10n/ko.json +77 -0
  353. package/templates/yoga-studio/l10n/lt.json +77 -0
  354. package/templates/yoga-studio/l10n/nl.json +77 -0
  355. package/templates/yoga-studio/l10n/no.json +77 -0
  356. package/templates/yoga-studio/l10n/pl.json +77 -0
  357. package/templates/yoga-studio/l10n/pt.json +77 -0
  358. package/templates/yoga-studio/l10n/ru.json +77 -0
  359. package/templates/yoga-studio/l10n/sv.json +77 -0
  360. package/templates/yoga-studio/l10n/th.json +77 -0
  361. package/templates/yoga-studio/l10n/tr.json +77 -0
  362. package/templates/yoga-studio/l10n/uk.json +77 -0
  363. package/templates/yoga-studio/l10n/vi.json +77 -0
  364. package/templates/yoga-studio/l10n/zh.json +77 -0
  365. package/templates/yoga-studio/tier5-src/_shared/push-permission.ts +75 -0
  366. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +103 -4
  367. package/templates/yoga-studio/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
@@ -1730,6 +1730,78 @@
1730
1730
  "translation": "Fotoğrafı değiştir",
1731
1731
  "origin": "machine"
1732
1732
  },
1733
+ "h_134635e9a2a6": {
1734
+ "key": "notifsettings.openSettingsCta",
1735
+ "source": "Open Settings",
1736
+ "translation": "Ayarlar'ı aç",
1737
+ "origin": "machine"
1738
+ },
1739
+ "h_2bcb76170ec3": {
1740
+ "key": "notifsettings.pushOffTitle",
1741
+ "source": "Notifications are off on this phone",
1742
+ "translation": "Bu telefonda bildirimler kapalı",
1743
+ "origin": "machine"
1744
+ },
1745
+ "h_31b3496929a9": {
1746
+ "key": "notifsettings.pushAskBody",
1747
+ "source": "Allow notifications on this phone to get the updates you choose below.",
1748
+ "translation": "Aşağıda seçtiğiniz güncellemeleri almak için bu telefonda bildirimlere izin verin.",
1749
+ "origin": "machine"
1750
+ },
1751
+ "h_5ab087ec11ff": {
1752
+ "key": "notifsettings.turnOnCta",
1753
+ "source": "Turn on notifications",
1754
+ "translation": "Bildirimleri aç",
1755
+ "origin": "machine"
1756
+ },
1757
+ "h_e45714907316": {
1758
+ "key": "home.pushAskNotNow",
1759
+ "source": "Not now",
1760
+ "translation": "Şimdi değil",
1761
+ "origin": "machine"
1762
+ },
1763
+ "h_e9093cc9cde8": {
1764
+ "key": "home.pushAskBodyOrdersBookings",
1765
+ "source": "Get notified when your order status changes, and get reminders about your bookings.",
1766
+ "translation": "Siparişinizin durumu değiştiğinde bildirim, rezervasyonlarınız için hatırlatıcı alın.",
1767
+ "origin": "machine"
1768
+ },
1769
+ "h_f54254af0c08": {
1770
+ "key": "home.pushAskTitle",
1771
+ "source": "Stay in the loop",
1772
+ "translation": "Haberdar olun",
1773
+ "origin": "machine"
1774
+ },
1775
+ "h_01828fbf543c": {
1776
+ "key": "home.pushAskBodyOrders",
1777
+ "source": "Get notified when your order status changes.",
1778
+ "translation": "Siparişinizin durumu değiştiğinde bildirim alın.",
1779
+ "origin": "machine"
1780
+ },
1781
+ "h_a365748a7092": {
1782
+ "key": "home.pushAskBodyBookings",
1783
+ "source": "Get reminders and updates about your bookings.",
1784
+ "translation": "Rezervasyonlarınızla ilgili hatırlatıcılar ve güncellemeler alın.",
1785
+ "origin": "machine"
1786
+ },
1787
+ "h_fb0c45519478": {
1788
+ "key": "home.pushAskBodyGeneral",
1789
+ "source": "Get notified about replies and updates that matter to you.",
1790
+ "translation": "Sizin için önemli yanıtlar ve güncellemeler hakkında bildirim alın.",
1791
+ "origin": "machine"
1792
+ },
1793
+ "h_b115e30c1a23": {
1794
+ "key": "notifsettings.pushAskTitle",
1795
+ "source": "Notifications aren't on yet",
1796
+ "translation": "Bildirimler henüz açık değil",
1797
+ "origin": "machine"
1798
+ },
1799
+ "h_282e81f51b9e": {
1800
+ "key": "notifsettings.pushOffBody",
1801
+ "source": "Your choices below are saved, but nothing arrives until notifications are allowed on this phone.",
1802
+ "translation": "Aşağıdaki seçimleriniz kaydedildi ancak bu telefonda bildirimlere izin verilene kadar hiçbir şey gelmez.",
1803
+ "origin": "machine"
1804
+ },
1733
1805
  "h_1e9b74b4dda5": {
1734
1806
  "source": "Show all ({count})",
1735
1807
  "translation": "Tümünü göster ({count})",
@@ -3949,6 +4021,11 @@
3949
4021
  "source": "Unblock {name}?",
3950
4022
  "translation": "{name} engeli kaldırılsın mı?",
3951
4023
  "origin": "machine"
4024
+ },
4025
+ "h_27b36f21a125": {
4026
+ "source": "Change notifications for this app in your phone's settings.",
4027
+ "translation": "Bu uygulamanın bildirimlerini telefonunuzun ayarlarından değiştirin.",
4028
+ "origin": "machine"
3952
4029
  }
3953
4030
  }
3954
4031
  }
@@ -1730,6 +1730,78 @@
1730
1730
  "translation": "Змінити фото",
1731
1731
  "origin": "machine"
1732
1732
  },
1733
+ "h_134635e9a2a6": {
1734
+ "key": "notifsettings.openSettingsCta",
1735
+ "source": "Open Settings",
1736
+ "translation": "Відкрити Налаштування",
1737
+ "origin": "machine"
1738
+ },
1739
+ "h_2bcb76170ec3": {
1740
+ "key": "notifsettings.pushOffTitle",
1741
+ "source": "Notifications are off on this phone",
1742
+ "translation": "Сповіщення на цьому телефоні вимкнено",
1743
+ "origin": "machine"
1744
+ },
1745
+ "h_31b3496929a9": {
1746
+ "key": "notifsettings.pushAskBody",
1747
+ "source": "Allow notifications on this phone to get the updates you choose below.",
1748
+ "translation": "Дозвольте сповіщення на цьому телефоні, щоб отримувати вибрані нижче оновлення.",
1749
+ "origin": "machine"
1750
+ },
1751
+ "h_5ab087ec11ff": {
1752
+ "key": "notifsettings.turnOnCta",
1753
+ "source": "Turn on notifications",
1754
+ "translation": "Увімкнути сповіщення",
1755
+ "origin": "machine"
1756
+ },
1757
+ "h_e45714907316": {
1758
+ "key": "home.pushAskNotNow",
1759
+ "source": "Not now",
1760
+ "translation": "Не зараз",
1761
+ "origin": "machine"
1762
+ },
1763
+ "h_e9093cc9cde8": {
1764
+ "key": "home.pushAskBodyOrdersBookings",
1765
+ "source": "Get notified when your order status changes, and get reminders about your bookings.",
1766
+ "translation": "Отримуйте сповіщення, коли змінюється статус замовлення, і нагадування про бронювання.",
1767
+ "origin": "machine"
1768
+ },
1769
+ "h_f54254af0c08": {
1770
+ "key": "home.pushAskTitle",
1771
+ "source": "Stay in the loop",
1772
+ "translation": "Будьте в курсі",
1773
+ "origin": "machine"
1774
+ },
1775
+ "h_01828fbf543c": {
1776
+ "key": "home.pushAskBodyOrders",
1777
+ "source": "Get notified when your order status changes.",
1778
+ "translation": "Отримуйте сповіщення, коли змінюється статус замовлення.",
1779
+ "origin": "machine"
1780
+ },
1781
+ "h_a365748a7092": {
1782
+ "key": "home.pushAskBodyBookings",
1783
+ "source": "Get reminders and updates about your bookings.",
1784
+ "translation": "Отримуйте нагадування й оновлення про ваші бронювання.",
1785
+ "origin": "machine"
1786
+ },
1787
+ "h_fb0c45519478": {
1788
+ "key": "home.pushAskBodyGeneral",
1789
+ "source": "Get notified about replies and updates that matter to you.",
1790
+ "translation": "Отримуйте сповіщення про відповіді й важливі для вас оновлення.",
1791
+ "origin": "machine"
1792
+ },
1793
+ "h_b115e30c1a23": {
1794
+ "key": "notifsettings.pushAskTitle",
1795
+ "source": "Notifications aren't on yet",
1796
+ "translation": "Сповіщення ще не ввімкнено",
1797
+ "origin": "machine"
1798
+ },
1799
+ "h_282e81f51b9e": {
1800
+ "key": "notifsettings.pushOffBody",
1801
+ "source": "Your choices below are saved, but nothing arrives until notifications are allowed on this phone.",
1802
+ "translation": "Ваш вибір нижче збережено, але нічого не надходитиме, доки сповіщення не дозволено на цьому телефоні.",
1803
+ "origin": "machine"
1804
+ },
1733
1805
  "h_1e9b74b4dda5": {
1734
1806
  "source": "Show all ({count})",
1735
1807
  "translation": "Показати все ({count})",
@@ -3949,6 +4021,11 @@
3949
4021
  "source": "Unblock {name}?",
3950
4022
  "translation": "Розблокувати {name}?",
3951
4023
  "origin": "machine"
4024
+ },
4025
+ "h_27b36f21a125": {
4026
+ "source": "Change notifications for this app in your phone's settings.",
4027
+ "translation": "Змініть сповіщення цього застосунку в налаштуваннях телефона.",
4028
+ "origin": "machine"
3952
4029
  }
3953
4030
  }
3954
4031
  }
@@ -1730,6 +1730,78 @@
1730
1730
  "translation": "Đổi ảnh",
1731
1731
  "origin": "machine"
1732
1732
  },
1733
+ "h_134635e9a2a6": {
1734
+ "key": "notifsettings.openSettingsCta",
1735
+ "source": "Open Settings",
1736
+ "translation": "Mở Cài đặt",
1737
+ "origin": "machine"
1738
+ },
1739
+ "h_2bcb76170ec3": {
1740
+ "key": "notifsettings.pushOffTitle",
1741
+ "source": "Notifications are off on this phone",
1742
+ "translation": "Thông báo đang tắt trên điện thoại này",
1743
+ "origin": "machine"
1744
+ },
1745
+ "h_31b3496929a9": {
1746
+ "key": "notifsettings.pushAskBody",
1747
+ "source": "Allow notifications on this phone to get the updates you choose below.",
1748
+ "translation": "Cho phép thông báo trên điện thoại này để nhận các cập nhật bạn chọn bên dưới.",
1749
+ "origin": "machine"
1750
+ },
1751
+ "h_5ab087ec11ff": {
1752
+ "key": "notifsettings.turnOnCta",
1753
+ "source": "Turn on notifications",
1754
+ "translation": "Bật thông báo",
1755
+ "origin": "machine"
1756
+ },
1757
+ "h_e45714907316": {
1758
+ "key": "home.pushAskNotNow",
1759
+ "source": "Not now",
1760
+ "translation": "Để sau",
1761
+ "origin": "machine"
1762
+ },
1763
+ "h_e9093cc9cde8": {
1764
+ "key": "home.pushAskBodyOrdersBookings",
1765
+ "source": "Get notified when your order status changes, and get reminders about your bookings.",
1766
+ "translation": "Nhận thông báo khi trạng thái đơn hàng thay đổi và lời nhắc về lịch đặt của bạn.",
1767
+ "origin": "machine"
1768
+ },
1769
+ "h_f54254af0c08": {
1770
+ "key": "home.pushAskTitle",
1771
+ "source": "Stay in the loop",
1772
+ "translation": "Luôn cập nhật",
1773
+ "origin": "machine"
1774
+ },
1775
+ "h_01828fbf543c": {
1776
+ "key": "home.pushAskBodyOrders",
1777
+ "source": "Get notified when your order status changes.",
1778
+ "translation": "Nhận thông báo khi trạng thái đơn hàng của bạn thay đổi.",
1779
+ "origin": "machine"
1780
+ },
1781
+ "h_a365748a7092": {
1782
+ "key": "home.pushAskBodyBookings",
1783
+ "source": "Get reminders and updates about your bookings.",
1784
+ "translation": "Nhận lời nhắc và cập nhật về lịch đặt của bạn.",
1785
+ "origin": "machine"
1786
+ },
1787
+ "h_fb0c45519478": {
1788
+ "key": "home.pushAskBodyGeneral",
1789
+ "source": "Get notified about replies and updates that matter to you.",
1790
+ "translation": "Nhận thông báo về phản hồi và cập nhật quan trọng với bạn.",
1791
+ "origin": "machine"
1792
+ },
1793
+ "h_b115e30c1a23": {
1794
+ "key": "notifsettings.pushAskTitle",
1795
+ "source": "Notifications aren't on yet",
1796
+ "translation": "Thông báo chưa được bật",
1797
+ "origin": "machine"
1798
+ },
1799
+ "h_282e81f51b9e": {
1800
+ "key": "notifsettings.pushOffBody",
1801
+ "source": "Your choices below are saved, but nothing arrives until notifications are allowed on this phone.",
1802
+ "translation": "Lựa chọn của bạn bên dưới đã được lưu, nhưng sẽ không có thông báo nào cho đến khi điện thoại này cho phép thông báo.",
1803
+ "origin": "machine"
1804
+ },
1733
1805
  "h_1e9b74b4dda5": {
1734
1806
  "source": "Show all ({count})",
1735
1807
  "translation": "Xem tất cả ({count})",
@@ -3949,6 +4021,11 @@
3949
4021
  "source": "Unblock {name}?",
3950
4022
  "translation": "Bỏ chặn {name}?",
3951
4023
  "origin": "machine"
4024
+ },
4025
+ "h_27b36f21a125": {
4026
+ "source": "Change notifications for this app in your phone's settings.",
4027
+ "translation": "Thay đổi thông báo của ứng dụng này trong cài đặt điện thoại.",
4028
+ "origin": "machine"
3952
4029
  }
3953
4030
  }
3954
4031
  }
@@ -1730,6 +1730,78 @@
1730
1730
  "translation": "變更相片",
1731
1731
  "origin": "machine"
1732
1732
  },
1733
+ "h_134635e9a2a6": {
1734
+ "key": "notifsettings.openSettingsCta",
1735
+ "source": "Open Settings",
1736
+ "translation": "打开设置",
1737
+ "origin": "machine"
1738
+ },
1739
+ "h_2bcb76170ec3": {
1740
+ "key": "notifsettings.pushOffTitle",
1741
+ "source": "Notifications are off on this phone",
1742
+ "translation": "此手机已关闭通知",
1743
+ "origin": "machine"
1744
+ },
1745
+ "h_31b3496929a9": {
1746
+ "key": "notifsettings.pushAskBody",
1747
+ "source": "Allow notifications on this phone to get the updates you choose below.",
1748
+ "translation": "在此手机上允许通知,即可收到你在下方选择的更新。",
1749
+ "origin": "machine"
1750
+ },
1751
+ "h_5ab087ec11ff": {
1752
+ "key": "notifsettings.turnOnCta",
1753
+ "source": "Turn on notifications",
1754
+ "translation": "开启通知",
1755
+ "origin": "machine"
1756
+ },
1757
+ "h_e45714907316": {
1758
+ "key": "home.pushAskNotNow",
1759
+ "source": "Not now",
1760
+ "translation": "以后再说",
1761
+ "origin": "machine"
1762
+ },
1763
+ "h_e9093cc9cde8": {
1764
+ "key": "home.pushAskBodyOrdersBookings",
1765
+ "source": "Get notified when your order status changes, and get reminders about your bookings.",
1766
+ "translation": "订单状态变化时通知你,并提醒你的预约。",
1767
+ "origin": "machine"
1768
+ },
1769
+ "h_f54254af0c08": {
1770
+ "key": "home.pushAskTitle",
1771
+ "source": "Stay in the loop",
1772
+ "translation": "及时了解动态",
1773
+ "origin": "machine"
1774
+ },
1775
+ "h_01828fbf543c": {
1776
+ "key": "home.pushAskBodyOrders",
1777
+ "source": "Get notified when your order status changes.",
1778
+ "translation": "订单状态变化时通知你。",
1779
+ "origin": "machine"
1780
+ },
1781
+ "h_a365748a7092": {
1782
+ "key": "home.pushAskBodyBookings",
1783
+ "source": "Get reminders and updates about your bookings.",
1784
+ "translation": "接收预约提醒和最新动态。",
1785
+ "origin": "machine"
1786
+ },
1787
+ "h_fb0c45519478": {
1788
+ "key": "home.pushAskBodyGeneral",
1789
+ "source": "Get notified about replies and updates that matter to you.",
1790
+ "translation": "接收与你相关的回复和更新通知。",
1791
+ "origin": "machine"
1792
+ },
1793
+ "h_b115e30c1a23": {
1794
+ "key": "notifsettings.pushAskTitle",
1795
+ "source": "Notifications aren't on yet",
1796
+ "translation": "通知尚未开启",
1797
+ "origin": "machine"
1798
+ },
1799
+ "h_282e81f51b9e": {
1800
+ "key": "notifsettings.pushOffBody",
1801
+ "source": "Your choices below are saved, but nothing arrives until notifications are allowed on this phone.",
1802
+ "translation": "你在下方的选择已保存,但在此手机允许通知之前,不会收到任何通知。",
1803
+ "origin": "machine"
1804
+ },
1733
1805
  "h_1e9b74b4dda5": {
1734
1806
  "source": "Show all ({count})",
1735
1807
  "translation": "查看全部({count})",
@@ -3949,6 +4021,11 @@
3949
4021
  "source": "Unblock {name}?",
3950
4022
  "translation": "要解除封鎖 {name} 嗎?",
3951
4023
  "origin": "machine"
4024
+ },
4025
+ "h_27b36f21a125": {
4026
+ "source": "Change notifications for this app in your phone's settings.",
4027
+ "translation": "请在手机设置中更改此应用的通知。",
4028
+ "origin": "machine"
3952
4029
  }
3953
4030
  }
3954
4031
  }
@@ -0,0 +1,75 @@
1
+ // The phone's notification permission, as Branded Lite's screens use it (Notification settings and
2
+ // Home's in-context ask). Every call is caught: a host without the push capability (an older binary)
3
+ // answers "error", which shows nothing rather than an offer that leads nowhere.
4
+ //
5
+ // Only a native app has a PHONE permission. A web host reports the browser's, which says nothing
6
+ // about the member's phone, so it reads as "error" too.
7
+ //
8
+ // Android reports "denied" both before its first ask and after a refusal (it has no "undetermined"
9
+ // once API 33's runtime permission exists), so only a request can tell the two apart. Below API 33
10
+ // there is no runtime dialog at all: "denied" means switched off in Settings.
11
+
12
+ import { openSettings, requestPermission, type PushPermission } from "@himalaya/push";
13
+ import { dispatch } from "@himalaya/dispatch";
14
+ import { get as getAppInfo } from "@himalaya/app-info";
15
+
16
+ export type PushStatus = PushPermission | "error";
17
+ export type PushPlatform = "ios" | "android" | "macos" | "";
18
+
19
+ export interface PhonePush {
20
+ status: PushStatus;
21
+ platform: PushPlatform;
22
+ /** A "denied" answer may still hide a first ask the system can show (Android 13+ only). */
23
+ deniedMayPrompt: boolean;
24
+ }
25
+
26
+ const NATIVE: readonly string[] = ["ios", "android", "macos"];
27
+
28
+ /** Android's major version, or 0 when the host does not say. */
29
+ function androidMajor(osVersion: string | undefined): number {
30
+ const major = Number.parseInt(String(osVersion ?? ""), 10);
31
+ return Number.isFinite(major) ? major : 0;
32
+ }
33
+
34
+ export async function readPhonePush(): Promise<PhonePush> {
35
+ const info = await getAppInfo().catch(() => undefined);
36
+ const platform = (NATIVE.includes(info?.platform ?? "") ? info!.platform : "") as PushPlatform;
37
+ if (!platform) return { status: "error", platform, deniedMayPrompt: false };
38
+ const status = await readPushStatus();
39
+ // An unknown Android version may be below 13, where no dialog exists: promise no prompt then.
40
+ return { status, platform, deniedMayPrompt: platform === "android" && androidMajor(info?.osVersion) >= 13 };
41
+ }
42
+
43
+ /** Read raw: the SDK maps every unknown answer to "undetermined", but a native host without the
44
+ * push module answers "unavailable", where a Turn on button could never prompt. */
45
+ export async function readPushStatus(): Promise<PushStatus> {
46
+ try {
47
+ const r = (await dispatch("capability.push.getPermissionStatus")) as { status?: unknown } | null;
48
+ const status = r?.status;
49
+ return status === "granted" || status === "denied" || status === "undetermined" ? status : "error";
50
+ } catch { return "error"; }
51
+ }
52
+
53
+ /** Ask the OS. Shows the system prompt only while it still can; otherwise just reads the answer.
54
+ * Once granted it also registers this session's push token (no prompt). */
55
+ export async function askForPush(): Promise<PushStatus> {
56
+ try { return await requestPermission(); } catch { return readPushStatus(); }
57
+ }
58
+
59
+ export async function openPushSettings(): Promise<boolean> {
60
+ try { return await openSettings(); } catch { return false; }
61
+ }
62
+
63
+ /** A grant made earlier (or just now, in the OS settings) still needs this launch's token:
64
+ * `requestPermission` on a granted phone registers it without a prompt. */
65
+ export async function refreshGrantedToken(status: PushStatus): Promise<void> {
66
+ if (status === "granted") await askForPush();
67
+ }
68
+
69
+ /** The same, at most once per worker run: a launch needs one token request, not one per refresh. */
70
+ let tokenRefreshedThisRun = false;
71
+ export async function refreshGrantedTokenOnce(status: PushStatus): Promise<void> {
72
+ if (status !== "granted" || tokenRefreshedThisRun) return;
73
+ tokenRefreshedThisRun = true;
74
+ await askForPush();
75
+ }
@@ -5,6 +5,7 @@ import { isProgramEnded } from "../_shared/program-fields.js";
5
5
  import { fetchMemberBookings, type MemberBookingRow } from "../_shared/member-bookings.js";
6
6
  import { hostSiteFromInput, hostedExploreCards, hostedHiddenFlags, type HostedExploreCard } from "../_shared/branded-lite-hosted.js";
7
7
  import { memberAccess, assertMemberAccess } from "../_shared/member-access.js";
8
+ import { askForPush, readPhonePush, refreshGrantedTokenOnce, type PhonePush } from "../_shared/push-permission.js";
8
9
  import { defineService as registerHome } from "../_shared/home-service.js";
9
10
  import { navigate } from "@himalaya/state";
10
11
  import { withIapPresentation } from "../_shared/iap-presentation.js";
@@ -283,6 +284,12 @@ interface State {
283
284
  /** Inverse of onboardingHidden — hide the post-onboarding primary Shop CTA
284
285
  * while the welcome card is still up (one primary: Got it). */
285
286
  onboardingActive: boolean;
287
+ /** The in-context push ask (Turn on / Not now). Hidden unless a signed-in member's phone can
288
+ * still show the system prompt and this phone has not answered the card. */
289
+ pushAskHidden: boolean;
290
+ /** Which benefit line the ask shows (hiddenWhen flags, so TRUE hides): the one that fits the
291
+ * installed verticals, the general one in hosted mode. */
292
+ hidePushBodyOrders: boolean; hidePushBodyBookings: boolean; hidePushBodyOrdersBookings: boolean; hidePushBodyGeneral: boolean;
286
293
  heroTitle: string;
287
294
  heroSubtitle: string;
288
295
  heroPrice: string;
@@ -378,6 +385,51 @@ function onboardingSeen(): boolean {
378
385
  try { return storage()?.getItem(ONBOARDING_KEY) === "1"; } catch { return false; }
379
386
  }
380
387
 
388
+ // The push ask is answered once per phone, either way: "Not now" must not come back every launch.
389
+ const PUSH_ASKED_KEY = "himi.brandedLite.pushAsked";
390
+ let pushCheckGeneration = 0;
391
+ /** Also held in memory: a host without storage must still keep "Not now" for this run. */
392
+ let pushAskAnsweredThisRun = false;
393
+ function pushAskAnswered(): boolean {
394
+ if (pushAskAnsweredThisRun) return true;
395
+ try { return storage()?.getItem(PUSH_ASKED_KEY) === "1"; } catch { return false; }
396
+ }
397
+ function rememberPushAskAnswered(): void {
398
+ pushAskAnsweredThisRun = true;
399
+ try { storage()?.setItem(PUSH_ASKED_KEY, "1"); } catch { /* best-effort: held in memory for this run */ }
400
+ }
401
+
402
+ /** Whether the system prompt can still be shown. iOS and macOS say so ("undetermined"); Android 13+
403
+ * reports "denied" before its first ask too, so there a refusal cannot be told from never asked.
404
+ * An iOS phone that refused, and Android below 13 (no runtime dialog), have Notification
405
+ * settings' Settings path instead. */
406
+ function promptPossible(phone: PhonePush): boolean {
407
+ return phone.status === "undetermined" || (phone.status === "denied" && phone.deniedMayPrompt);
408
+ }
409
+
410
+ type PushBody = "orders" | "bookings" | "ordersBookings" | "general";
411
+ /** Ping routes member pushes for orders and bookings; anything else is replies and updates. */
412
+ function pushBodyFor(verticals: string[], hosted: boolean): PushBody {
413
+ if (hosted) return "general";
414
+ const orders = verticals.includes("store"), bookings = verticals.includes("bookings");
415
+ return orders && bookings ? "ordersBookings" : orders ? "orders" : bookings ? "bookings" : "general";
416
+ }
417
+ function pushBodyFlags(body: PushBody): Pick<State, "hidePushBodyOrders" | "hidePushBodyBookings" | "hidePushBodyOrdersBookings" | "hidePushBodyGeneral"> {
418
+ return { hidePushBodyOrders: body !== "orders", hidePushBodyBookings: body !== "bookings",
419
+ hidePushBodyOrdersBookings: body !== "ordersBookings", hidePushBodyGeneral: body !== "general" };
420
+ }
421
+
422
+ /** The moment of value is after sign-in: Ping delivers member notifications (orders, bookings,
423
+ * chat) only to a signed-in member, so a visitor has nothing to be notified about yet. */
424
+ async function shouldAskForPush(): Promise<boolean> {
425
+ const phone = await readPhonePush();
426
+ // Every launch, answered or not: a grant still needs this launch's token, and shells older than
427
+ // the native refresh registered it only from the launch prompt this app no longer shows.
428
+ await refreshGrantedTokenOnce(phone.status);
429
+ if (pushAskAnswered() || !promptPossible(phone)) return false;
430
+ return (await memberAccess()).signedIn === true;
431
+ }
432
+
381
433
  // The user's own layout choice, persisted by the appearance worker under the
382
434
  // same shared LAYOUT_KEY. Best-effort — a missing store just means we fall back
383
435
  // to owner-default / content-recommendation.
@@ -1085,6 +1137,8 @@ function baseState(): State {
1085
1137
  refreshedAt: "",
1086
1138
  effectiveLayout: resolveEffectiveLayout(undefined, 0),
1087
1139
  onboardingHidden: onboardingSeen(),
1140
+ pushAskHidden: true,
1141
+ ...pushBodyFlags("general"),
1088
1142
  // derive() recomputes this from onboardingHidden, but State requires it and this
1089
1143
  // literal is a full State by contract — every other derived flag above is passed
1090
1144
  // explicitly for the same reason. Omitting it made baseState() not a State.
@@ -1327,6 +1381,7 @@ async function refresh(state: State, arg?: unknown): Promise<State | undefined>
1327
1381
  const generation = ++personalGeneration;
1328
1382
  // Personalized work must never hold public browsing behind identity/network.
1329
1383
  svc.clearPersonal();
1384
+ void svc.checkPushAsk();
1330
1385
  void refreshPersonal(generation, arg);
1331
1386
  const publicState = await refreshPublic(state, arg);
1332
1387
  if (!publicState || generation !== personalGeneration) return undefined;
@@ -1344,7 +1399,10 @@ async function refresh(state: State, arg?: unknown): Promise<State | undefined>
1344
1399
  memberProgressLabel: current.memberProgressLabel, memberProgressFraction: current.memberProgressFraction,
1345
1400
  hideMemberProgress: current.hideMemberProgress, personalError: current.personalError, hidePersonalError: current.hidePersonalError,
1346
1401
  // The weekly goal is PERSONAL (member bookings); the public refresh resets it, so keep it.
1347
- weeklyClassCount: current.weeklyClassCount, weeklyClassGoalFraction: current.weeklyClassGoalFraction, weeklyGoalLabel: current.weeklyGoalLabel });
1402
+ weeklyClassCount: current.weeklyClassCount, weeklyClassGoalFraction: current.weeklyClassGoalFraction, weeklyGoalLabel: current.weeklyGoalLabel,
1403
+ // Decided by checkPushAsk, which may have landed while the public read was in flight.
1404
+ pushAskHidden: current.pushAskHidden, hidePushBodyOrders: current.hidePushBodyOrders, hidePushBodyBookings: current.hidePushBodyBookings,
1405
+ hidePushBodyOrdersBookings: current.hidePushBodyOrdersBookings, hidePushBodyGeneral: current.hidePushBodyGeneral });
1348
1406
  }
1349
1407
 
1350
1408
  const defineService = withIapPresentation<State>({
@@ -1366,6 +1424,9 @@ const svc = defineService<State, {
1366
1424
  // constraint allows an undefined return for exactly this; the declaration did not.
1367
1425
  refresh: (state: State, arg?: unknown) => Promise<State | undefined>;
1368
1426
  dismissOnboarding: (state: State) => State;
1427
+ checkPushAsk: (state: State, arg?: unknown) => Promise<State | undefined>;
1428
+ turnOnPush: (state: State) => Promise<State | undefined>;
1429
+ dismissPushAsk: (state: State) => State;
1369
1430
  clearPersonal: (state: State) => State;
1370
1431
  memberProgramsLoaded: (state: State, arg: { generation: number; rows: MemberProgramCard[]; attempt?: number }) => State | undefined;
1371
1432
  openShopCategory: (state: State, arg?: unknown) => State;
@@ -1375,9 +1436,10 @@ const svc = defineService<State, {
1375
1436
  state: baseState(),
1376
1437
  // The host's site is read fresh at every boot: a snapshot of the last session's site must not
1377
1438
  // decide this one's verticals or name (an owner installs or removes one; another site opens).
1378
- notHydrated: ["hosted", "hostedName", "hostedCards", "homeCategories", "noHomeCategories", "memberPrograms", "noMemberPrograms"],
1439
+ notHydrated: ["hosted", "hostedName", "hostedCards", "homeCategories", "noHomeCategories", "memberPrograms", "noMemberPrograms", "pushAskHidden"],
1379
1440
  // A member's standing never reaches the on-device snapshot either: the next boot may be another member's.
1380
- notPersisted: ["memberPrograms", "noMemberPrograms"],
1441
+ // Nor does the push ask: an early paint from the snapshot would show last run's card.
1442
+ notPersisted: ["memberPrograms", "noMemberPrograms", "pushAskHidden"],
1381
1443
  actions: {
1382
1444
  clearPersonal: state => derive({ ...state, nextBooking: [], hideNextBooking: true, memberProgressLabel: "", memberProgressFraction: 0, hideMemberProgress: true, memberPrograms: [], noMemberPrograms: true, personalError: false, hidePersonalError: true,
1383
1445
  weeklyClassCount: 0, weeklyClassGoalFraction: 0, weeklyGoalLabel: "" }),
@@ -1419,6 +1481,42 @@ const svc = defineService<State, {
1419
1481
  try { storage()?.setItem(ONBOARDING_KEY, "1"); } catch { /* best-effort */ }
1420
1482
  return derive({ ...state, onboardingHidden: true });
1421
1483
  },
1484
+ checkPushAsk: async (_state: State, arg?: unknown): Promise<State | undefined> => {
1485
+ stashCopy(arg);
1486
+ // Only the newest check publishes: an older one (e.g. a visitor's) must not undo a later
1487
+ // revisit's answer for the member who has signed in since.
1488
+ const generation = ++pushCheckGeneration;
1489
+ // Re-read the answer after the awaits: "Not now" tapped meanwhile must win.
1490
+ const hidden = !(await shouldAskForPush()) || pushAskAnswered();
1491
+ if (generation !== pushCheckGeneration) return undefined;
1492
+ const live: State = svc.getState();
1493
+ const body = pushBodyFlags(pushBodyFor(parseVerticals(undefined), !!hostedSite));
1494
+ const same = live.pushAskHidden === hidden && (Object.keys(body) as (keyof typeof body)[]).every((k) => live[k] === body[k]);
1495
+ return same ? undefined : derive({ ...live, ...body, pushAskHidden: hidden });
1496
+ },
1497
+ // The ONLY path to the system prompt. Never a Settings trip: whatever the answer, the card is done.
1498
+ turnOnPush: async (): Promise<State | undefined> => {
1499
+ // Re-check before prompting: a card restored from an older session may outlive the member.
1500
+ // The tap decides on its own fresh check and then outranks every check started before it
1501
+ // (a Home refresh must not cancel it). The permission is the phone's, not the member's, so a
1502
+ // sign-out racing the tap costs nothing but timing.
1503
+ const stillEligible = await shouldAskForPush();
1504
+ ++pushCheckGeneration;
1505
+ // A failed check hides the card for now but does not use up the offer; "Not now" tapped
1506
+ // while the check ran wins.
1507
+ if (stillEligible && !pushAskAnswered()) {
1508
+ const status = await askForPush();
1509
+ // Remembered only once the OS has an answer: a request that failed before any dialog
1510
+ // ("undetermined" or unreadable) leaves the offer for the next visit.
1511
+ if (status === "granted" || status === "denied") rememberPushAskAnswered();
1512
+ }
1513
+ const live: State = svc.getState();
1514
+ return derive({ ...live, pushAskHidden: true });
1515
+ },
1516
+ dismissPushAsk: (state) => {
1517
+ rememberPushAskAnswered();
1518
+ return derive({ ...state, pushAskHidden: true });
1519
+ },
1422
1520
  },
1423
1521
  });
1424
1522
 
@@ -1427,7 +1525,8 @@ const svc = defineService<State, {
1427
1525
  // name. In place, because on those runtimes getState() IS the stored state (as himi-player-home does).
1428
1526
  if ((globalThis as { himalaya?: { hydrationOptOut?: unknown } }).himalaya?.hydrationOptOut !== true) {
1429
1527
  const live = (svc as { getState?: () => State | undefined }).getState?.();
1430
- if (live && typeof live === "object") Object.assign(live, hostedBoot, { homeCategories: [], noHomeCategories: true });
1528
+ // pushAskHidden too: a card restored from the last session may not be this member's.
1529
+ if (live && typeof live === "object") Object.assign(live, hostedBoot, { homeCategories: [], noHomeCategories: true, pushAskHidden: true });
1431
1530
  }
1432
1531
 
1433
1532
  svc.refresh();