@wix/himalaya-cli 0.1947.0 → 0.1949.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 (188) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/files/src/index.d.ts +23 -2
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/admob-ids.d.ts +4 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/index.d.ts +1 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +3 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +13 -4
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/video/src/display.d.ts +3 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +8 -2
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/files.mjs +4 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +3 -1
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-video.mjs +4 -0
  11. package/dist/browser-plane/assets.json +5 -5
  12. package/dist/browser-plane/preview-deferred/{da958a2a47eef7082c7892c1cc755a58bbeefcb4b617b47fde87f1ce567b3e64.bin → a8cfd0e17359578587e8937e88dedd40b46d533f08b4d2fdac4c47d5bae6f385.bin} +1 -1
  13. package/dist/browser-plane/sw.js +9 -9
  14. package/dist/cli.mjs +1906 -800
  15. package/dist/preview-assets.generated.bin +0 -0
  16. package/guides/app-icon.md +7 -3
  17. package/guides/getting-started.md +6 -1
  18. package/guides/himi-skill.md +6 -1
  19. package/guides/himi-test.md +30 -1
  20. package/guides/one-app-section-mappings.md +1 -1
  21. package/guides/one-app-to-himi-app.md +23 -16
  22. package/guides/sdk-reference.json +28 -7
  23. package/guides/skill.md +1 -1
  24. package/package.json +2 -2
  25. package/templates/beauty-salon-owner/config.ts +7 -0
  26. package/templates/beauty-salon-owner/dev/index.ts +567 -0
  27. package/templates/beauty-salon-owner/himalaya.content.json +3 -0
  28. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  29. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  30. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  31. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  32. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  33. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  34. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  35. package/templates/branded-lite/l10n/ar.json +21 -0
  36. package/templates/branded-lite/l10n/cs.json +21 -0
  37. package/templates/branded-lite/l10n/da.json +21 -0
  38. package/templates/branded-lite/l10n/de.json +21 -0
  39. package/templates/branded-lite/l10n/el.json +21 -0
  40. package/templates/branded-lite/l10n/en.json +5 -0
  41. package/templates/branded-lite/l10n/es.json +21 -0
  42. package/templates/branded-lite/l10n/fi.json +21 -0
  43. package/templates/branded-lite/l10n/fr.json +21 -0
  44. package/templates/branded-lite/l10n/he.json +21 -0
  45. package/templates/branded-lite/l10n/hu.json +21 -0
  46. package/templates/branded-lite/l10n/id.json +21 -0
  47. package/templates/branded-lite/l10n/it.json +21 -0
  48. package/templates/branded-lite/l10n/ja.json +21 -0
  49. package/templates/branded-lite/l10n/ko.json +21 -0
  50. package/templates/branded-lite/l10n/lt.json +21 -0
  51. package/templates/branded-lite/l10n/nl.json +21 -0
  52. package/templates/branded-lite/l10n/no.json +21 -0
  53. package/templates/branded-lite/l10n/pl.json +21 -0
  54. package/templates/branded-lite/l10n/pt.json +21 -0
  55. package/templates/branded-lite/l10n/ru.json +21 -0
  56. package/templates/branded-lite/l10n/sv.json +21 -0
  57. package/templates/branded-lite/l10n/th.json +21 -0
  58. package/templates/branded-lite/l10n/tr.json +21 -0
  59. package/templates/branded-lite/l10n/uk.json +21 -0
  60. package/templates/branded-lite/l10n/vi.json +21 -0
  61. package/templates/branded-lite/l10n/zh.json +21 -0
  62. package/templates/branded-lite/recipes/form-section.json +958 -0
  63. package/templates/branded-lite/recipes/group-feed.json +221 -3
  64. package/templates/branded-lite/recipes/groups-newsfeed.json +160 -2
  65. package/templates/branded-lite/recipes/video-library.json +475 -0
  66. package/templates/branded-lite/tier5-src/_shared/event-agenda.ts +15 -15
  67. package/templates/branded-lite/tier5-src/_shared/event-schedule-section.ts +8 -8
  68. package/templates/branded-lite/tier5-src/_shared/form-section.ts +640 -0
  69. package/templates/branded-lite/tier5-src/_shared/group-feed-section.ts +119 -7
  70. package/templates/branded-lite/tier5-src/_shared/groups-newsfeed-section.ts +17 -9
  71. package/templates/branded-lite/tier5-src/_shared/videos-section.ts +134 -2
  72. package/templates/branded-lite/tier5-src/himi-branded-lite-form/index.ts +4 -588
  73. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +4 -2
  74. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +7 -6
  75. package/templates/community-club/tier5-src/himi-events-detail/index.ts +7 -6
  76. package/templates/community-club-owner/config.ts +7 -0
  77. package/templates/community-club-owner/dev/index.ts +567 -0
  78. package/templates/community-club-owner/himalaya.content.json +3 -0
  79. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  80. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  81. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  82. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  83. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  84. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  85. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  86. package/templates/conference/tier5-src/_shared/event-agenda.ts +15 -15
  87. package/templates/conference/tier5-src/himi-conference-agenda/index.ts +3 -5
  88. package/templates/conference/tier5-src/himi-conference-home/index.ts +5 -6
  89. package/templates/conference/tier5-src/himi-events-detail/index.ts +7 -6
  90. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +7 -6
  91. package/templates/events-meetups-owner/config.ts +7 -0
  92. package/templates/events-meetups-owner/dev/index.ts +567 -0
  93. package/templates/events-meetups-owner/himalaya.content.json +3 -0
  94. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  95. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  96. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  97. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  98. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  99. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  100. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  101. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +7 -6
  102. package/templates/gym-fitness-owner/config.ts +7 -0
  103. package/templates/gym-fitness-owner/dev/index.ts +567 -0
  104. package/templates/gym-fitness-owner/himalaya.content.json +3 -0
  105. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  106. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  107. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  108. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  109. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  110. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  111. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  112. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +7 -6
  113. package/templates/nonprofit-cause-owner/config.ts +7 -0
  114. package/templates/nonprofit-cause-owner/dev/index.ts +567 -0
  115. package/templates/nonprofit-cause-owner/himalaya.content.json +3 -0
  116. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  117. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  118. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  119. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  120. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  121. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  122. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  123. package/templates/owner-lite/config.ts +7 -0
  124. package/templates/owner-lite/dev/index.ts +567 -0
  125. package/templates/owner-lite/himalaya.content.json +3 -0
  126. package/templates/owner-lite/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  127. package/templates/owner-lite/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  128. package/templates/owner-lite/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  129. package/templates/owner-lite/tier5-src/_shared/owner-maestro-when.ts +13 -0
  130. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  131. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  132. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  133. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +4 -2
  134. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +7 -6
  135. package/templates/podcast-creator-owner/config.ts +7 -0
  136. package/templates/podcast-creator-owner/dev/index.ts +567 -0
  137. package/templates/podcast-creator-owner/himalaya.content.json +3 -0
  138. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  139. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  140. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  141. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  142. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  143. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  144. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  145. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +7 -6
  146. package/templates/portfolio-creative-owner/config.ts +7 -0
  147. package/templates/portfolio-creative-owner/dev/index.ts +567 -0
  148. package/templates/portfolio-creative-owner/himalaya.content.json +3 -0
  149. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  150. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  151. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  152. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  153. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  154. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  155. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  156. package/templates/professional-services/tier5-src/himi-events-detail/index.ts +7 -6
  157. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +7 -6
  158. package/templates/restaurant-owner/config.ts +7 -0
  159. package/templates/restaurant-owner/dev/index.ts +567 -0
  160. package/templates/restaurant-owner/himalaya.content.json +3 -0
  161. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  162. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  163. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  164. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  165. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  166. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  167. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  168. package/templates/retail-store-owner/config.ts +7 -0
  169. package/templates/retail-store-owner/dev/index.ts +567 -0
  170. package/templates/retail-store-owner/himalaya.content.json +3 -0
  171. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  172. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  173. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  174. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  175. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  176. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  177. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  178. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +7 -6
  179. package/templates/yoga-studio-owner/config.ts +7 -0
  180. package/templates/yoga-studio-owner/dev/index.ts +567 -0
  181. package/templates/yoga-studio-owner/himalaya.content.json +3 -0
  182. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  183. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  184. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  185. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  186. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  187. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  188. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
@@ -0,0 +1,228 @@
1
+ // Tier-5 bundle: __HIMI_APP_NAME__ — what Maestro is doing for the business on screen.
2
+ //
3
+ // One list in three groups, read from Symphony: the tasks the owner gave Maestro, the routines it
4
+ // runs on a schedule, and the goals it works toward. A row opens the Maestro screen on the chat
5
+ // it belongs to; a routine can be paused and resumed here. Nothing is cached: storage is shared
6
+ // by everyone who signs in on the device, and a business id is not an account.
7
+
8
+ import { defineService } from "@himalaya/state";
9
+ import { copyParam, stashCopy } from "../_shared/himi-copy.js";
10
+ import { currentBusinessId } from "../_shared/owner-selected-site.js";
11
+ import { spaceIdsOf, symphonyAccount, type MaestroWixApi } from "../_shared/owner-maestro-availability.js";
12
+ import { whenLabel } from "../_shared/owner-maestro-when.js";
13
+ import {
14
+ goalsOf, routinesOf, setRoutinePaused, tasksOf,
15
+ type GoalStanding, type MaestroGoal, type MaestroRoutine, type MaestroTask, type TaskStanding,
16
+ } from "../_shared/owner-maestro-activity.js";
17
+
18
+ interface Host { wixApi?: MaestroWixApi }
19
+ const host = (): Host => (globalThis as { himalaya?: Host }).himalaya ?? {};
20
+
21
+ /** One row. `key` names it among all three groups; `id` is the task, routine or goal itself.
22
+ * `section` is the group's heading, on its first row only. `stamp` marks the list a row was
23
+ * shown in, so opening the same chat from a later list is a new request to the Maestro screen. */
24
+ export interface ActivityRow {
25
+ key: string; id: string; section: string; title: string; status: string; subtitle: string; conversationId: string; stamp: string;
26
+ /** Marks a row that waits on the owner. */
27
+ attentionHidden: string;
28
+ /** A row with a chat opens it; one without is not a button. Exactly one of the two is "false". */
29
+ openHidden: string; plainHidden: string;
30
+ /** Routines only: the button that pauses or resumes, and whether it is offered. */
31
+ toggleLabel: string; toggleHidden: string;
32
+ }
33
+
34
+ export interface MaestroActivityState {
35
+ items: ActivityRow[]; itemsHidden: string;
36
+ /** Shown until the first read ends. */
37
+ loadingHidden: string;
38
+ /** Says there is nothing to list ("" collapses the line). */
39
+ emptyText: string;
40
+ /** Says the task list was cut, and to how many ("" collapses the line). */
41
+ cutText: string;
42
+ /** Says what could not be read, which is not the same as having none. With rows on screen it
43
+ * is about the groups that are missing. */
44
+ error: string; errorHidden: string;
45
+ /** A change Symphony did not take ("" collapses the line). */
46
+ actionError: string;
47
+ _tasks: MaestroTask[]; _routines: MaestroRoutine[]; _goals: MaestroGoal[];
48
+ }
49
+
50
+ const initial: MaestroActivityState = {
51
+ items: [], itemsHidden: "true", loadingHidden: "false",
52
+ emptyText: "", cutText: "", error: "", errorHidden: "true", actionError: "",
53
+ _tasks: [], _routines: [], _goals: [],
54
+ };
55
+
56
+ const EVERY_FIELD = Object.keys(initial) as Array<keyof MaestroActivityState>;
57
+
58
+ /** Symphony's window is thirty days of tasks. Every one that waits on the owner is listed; of the
59
+ * rest, the newest up to this many, and the screen says when it left some out. */
60
+ const MAX_OTHER_TASKS = 50;
61
+
62
+ const TASK_STATUS: Record<TaskStanding, () => string> = {
63
+ needs_you: () => copyParam("ownerMaestroActivity.needsYou", "Needs you"),
64
+ working: () => copyParam("ownerMaestroActivity.working", "Working on it"),
65
+ paused: () => copyParam("ownerMaestroActivity.taskPaused", "Paused"),
66
+ done: () => copyParam("ownerMaestroActivity.done", "Done"),
67
+ stopped: () => copyParam("ownerMaestroActivity.stopped", "Stopped"),
68
+ failed: () => copyParam("ownerMaestroActivity.failed", "Didn't finish"),
69
+ };
70
+
71
+ const GOAL_STATUS: Record<GoalStanding, () => string> = {
72
+ suggested: () => copyParam("ownerMaestroActivity.goalSuggested", "Suggested"),
73
+ starting: () => copyParam("ownerMaestroActivity.goalStarting", "Getting started"),
74
+ active: () => copyParam("ownerMaestroActivity.goalActive", "In progress"),
75
+ achieved: () => copyParam("ownerMaestroActivity.goalAchieved", "Achieved"),
76
+ };
77
+
78
+ const untitled = (): string => copyParam("ownerMaestroActivity.untitled", "Untitled");
79
+ const joined = (...parts: string[]): string => parts.filter(Boolean).join(" · ");
80
+ const NO_TOGGLE = { toggleLabel: "", toggleHidden: "true" };
81
+ /** Whether the row is a button: only one that has a chat to open. */
82
+ const opening = (conversationId: string): { openHidden: string; plainHidden: string } =>
83
+ (conversationId ? { openHidden: "false", plainHidden: "true" } : { openHidden: "true", plainHidden: "false" });
84
+
85
+ /** A routine's state in words, in Symphony's own order: what Symphony holds it on comes before
86
+ * the owner's pause, since resuming does not lift it. */
87
+ function routineStatus(r: MaestroRoutine): string {
88
+ if (r.ended) return copyParam("ownerMaestroActivity.routineEnded", "Ended");
89
+ if (r.heldBy === "credits") return copyParam("ownerMaestroActivity.routineNoCredits", "Paused: out of credits");
90
+ if (r.heldBy === "error") return copyParam("ownerMaestroActivity.routineError", "Paused: something went wrong");
91
+ if (r.heldBy === "setup") return copyParam("ownerMaestroActivity.routineSetup", "Paused: needs setting up in Symphony");
92
+ return r.paused ? copyParam("ownerMaestroActivity.routinePaused", "Paused") : copyParam("ownerMaestroActivity.routineOn", "On");
93
+ }
94
+
95
+ /** The state as the screen shows it: tasks (the ones that wait on the owner first), then
96
+ * routines, then goals, each group headed on its first row. */
97
+ function shown(s: MaestroActivityState): MaestroActivityState {
98
+ const now = Date.now();
99
+ const stamp = String(now);
100
+ const others = s._tasks.filter((t) => t.standing !== "needs_you");
101
+ const tasks = [...s._tasks.filter((t) => t.standing === "needs_you"), ...others.slice(0, MAX_OTHER_TASKS)];
102
+ const left = others.length - Math.min(others.length, MAX_OTHER_TASKS);
103
+ const groups: Array<{ heading: string; rows: Array<Omit<ActivityRow, "section" | "stamp">> }> = [
104
+ { heading: copyParam("ownerMaestroActivity.tasks", "Tasks"), rows: tasks.map((t) => ({
105
+ key: `tasks_${t.id}`, id: t.id, title: t.title || untitled(), status: TASK_STATUS[t.standing](),
106
+ subtitle: joined(t.note, whenLabel(t.updated, now)), conversationId: t.conversationId,
107
+ attentionHidden: t.standing === "needs_you" ? "false" : "true", ...opening(t.conversationId), ...NO_TOGGLE,
108
+ })) },
109
+ { heading: copyParam("ownerMaestroActivity.routines", "Routines"), rows: s._routines.map((r) => ({
110
+ key: `routines_${r.id}`, id: r.id, title: r.name || untitled(), status: routineStatus(r), subtitle: r.schedule, conversationId: r.conversationId,
111
+ attentionHidden: "true", ...opening(r.conversationId),
112
+ toggleLabel: r.paused ? copyParam("ownerMaestroActivity.resume", "Resume") : copyParam("ownerMaestroActivity.pause", "Pause"),
113
+ // Not for one that is over, nor one Symphony holds: the owner's switch would change nothing they can see.
114
+ toggleHidden: r.ended || r.heldBy ? "true" : "false",
115
+ })) },
116
+ { heading: copyParam("ownerMaestroActivity.goals", "Goals"), rows: s._goals.map((g) => ({
117
+ key: `goals_${g.id}`, id: g.id, title: g.title || untitled(), status: GOAL_STATUS[g.standing](), subtitle: whenLabel(g.updated, now),
118
+ conversationId: g.conversationId, attentionHidden: "true", ...opening(g.conversationId), ...NO_TOGGLE,
119
+ })) },
120
+ ];
121
+ const items: ActivityRow[] = groups.flatMap((g) => g.rows.map((row, index) => ({ ...row, section: index === 0 ? g.heading : "", stamp })));
122
+ return {
123
+ ...s, items, itemsHidden: items.length ? "false" : "true", loadingHidden: "true",
124
+ cutText: left === 1 ? copyParam("ownerMaestroActivity.taskCut", "1 older task is not listed.")
125
+ : left > 1 ? copyParam("ownerMaestroActivity.tasksCut", "{count} older tasks are not listed.").replace("{count}", String(left)) : "",
126
+ emptyText: items.length || s.errorHidden === "false" ? ""
127
+ : copyParam("ownerMaestroActivity.empty", "Nothing yet. What you ask Maestro to do for this business shows up here."),
128
+ };
129
+ }
130
+
131
+ const loaded: MaestroActivityState = { ...initial, loadingHidden: "true" };
132
+ const none = (): MaestroActivityState => shown(loaded);
133
+ const failed = (): MaestroActivityState =>
134
+ ({ ...loaded, error: copyParam("ownerMaestroActivity.loadFailed", "Maestro's activity couldn't be loaded. Try again in a moment."), errorHidden: "false" });
135
+
136
+ const idOf = (arg: unknown): string => {
137
+ const id = (arg as { id?: unknown } | undefined)?.id;
138
+ return typeof id === "string" ? id : "";
139
+ };
140
+
141
+ // A read started for a business the owner has since left, or overtaken by a newer read, is dropped.
142
+ let reads = 0;
143
+ /** The state as it is now, which an action that waited on Symphony may no longer hold. */
144
+ const live = (fallback: MaestroActivityState): MaestroActivityState =>
145
+ (svc as unknown as { getState?: () => MaestroActivityState }).getState?.() ?? fallback;
146
+ // One change at a time: each result is built from the state it started with.
147
+ let changing = false;
148
+ // The owner's own switches: a read that started before one was made was answered with what was
149
+ // true before it, so the switch goes over that read's answer. `upTo` is the newest read started
150
+ // when the change was made.
151
+ const switched = new Map<string, { paused: boolean; upTo: number }>();
152
+
153
+ const svc = defineService<MaestroActivityState, {
154
+ load: (s: MaestroActivityState, arg?: unknown) => Promise<MaestroActivityState>;
155
+ toggleRoutine: (s: MaestroActivityState, arg?: unknown) => Promise<MaestroActivityState>;
156
+ }>("himiOwnerLiteMaestroActivity", {
157
+ state: initial,
158
+ // Read again on every appear and never shown from an earlier run.
159
+ notPersisted: EVERY_FIELD,
160
+ notHydrated: EVERY_FIELD,
161
+ actions: {
162
+ load: async (s, arg) => {
163
+ stashCopy(arg);
164
+ const site = currentBusinessId();
165
+ const api = host().wixApi;
166
+ // Counted even when nothing can be asked: a read still out for the last business is then stale.
167
+ const read = ++reads;
168
+ if (!site || !api) return failed();
169
+ // Whatever this read finds, it is for a screen that is gone once a newer read started or the
170
+ // owner picked another business.
171
+ const stale = (): boolean => read !== reads || currentBusinessId() !== site;
172
+ // A dropped read leaves the screen as it is. When it was the first, and no newer read is on
173
+ // its way, that would be "Loading…" for good: it says it failed, with Try again.
174
+ const dropped = (): MaestroActivityState => {
175
+ const now = live(s);
176
+ return now.loadingHidden === "false" && read === reads ? failed() : now;
177
+ };
178
+ try {
179
+ // No Symphony account, or a business that is not a Space: nothing to list.
180
+ const account = await symphonyAccount(api);
181
+ const spaces = account ? await spaceIdsOf(api, account, site) : [];
182
+ if (!spaces.length) return stale() ? dropped() : none();
183
+ // Each group on its own: one that could not be read does not take the others with it.
184
+ const [tasks, routines, goals] = await Promise.allSettled([tasksOf(api, spaces), routinesOf(api, spaces), goalsOf(api, spaces)]);
185
+ if (stale()) return dropped();
186
+ const read3 = [tasks, routines, goals];
187
+ if (read3.every((r) => r.status === "rejected")) return failed();
188
+ const partial = read3.some((r) => r.status === "rejected");
189
+ return shown({
190
+ ...loaded,
191
+ _tasks: tasks.status === "fulfilled" ? tasks.value : [],
192
+ _routines: routines.status === "fulfilled" ? routines.value.map((r) => {
193
+ const mine = switched.get(r.id);
194
+ return mine && read <= mine.upTo ? { ...r, paused: mine.paused } : r;
195
+ }) : [],
196
+ _goals: goals.status === "fulfilled" ? goals.value : [],
197
+ error: partial ? copyParam("ownerMaestroActivity.partFailed", "Some of Maestro's activity couldn't be loaded.") : "",
198
+ errorHidden: partial ? "false" : "true",
199
+ });
200
+ } catch {
201
+ return stale() ? dropped() : failed();
202
+ }
203
+ },
204
+ // Pause a routine that is on, or resume one the owner paused.
205
+ toggleRoutine: async (s, arg) => {
206
+ const routine = s._routines.find((r) => r.id === idOf(arg));
207
+ const api = host().wixApi;
208
+ if (!routine || routine.ended || routine.heldBy || changing || !api) return s;
209
+ changing = true;
210
+ try {
211
+ await setRoutinePaused(api, routine.id, !routine.paused);
212
+ // A read still out was answered before this change, and one may have finished while
213
+ // Symphony was being told: the change goes onto the list as it is now, and over the
214
+ // answer of any read that started before it.
215
+ switched.set(routine.id, { paused: !routine.paused, upTo: reads });
216
+ const now = live(s);
217
+ const routines = now._routines.map((r) => (r.id === routine.id ? { ...r, paused: !routine.paused } : r));
218
+ return shown({ ...now, _routines: routines, actionError: "" });
219
+ } catch {
220
+ return shown({ ...live(s), actionError: copyParam("ownerMaestroActivity.changeFailed", "That didn't go through. Try again in a moment.") });
221
+ } finally { changing = false; }
222
+ },
223
+ },
224
+ });
225
+
226
+ // No module-scope `svc.load()`: a bridge call made while the bundle is still being evaluated
227
+ // stalls on the Android WebView, and `onAppear` loads the list anyway.
228
+ export { svc };
@@ -5,11 +5,11 @@
5
5
  // messages itself. Nothing is cached here: storage is shared by everyone who signs in on the
6
6
  // device, and a business id is not an account.
7
7
 
8
- import { formatClock, formatMonthDayTime } from "../_shared/engine-intl.js";
9
8
  import { defineService } from "@himalaya/state";
10
9
  import { copyParam, stashCopy } from "../_shared/himi-copy.js";
11
10
  import { currentBusinessId } from "../_shared/owner-selected-site.js";
12
11
  import { noteDeletedChat } from "../_shared/owner-maestro-tab.js";
12
+ import { whenLabel } from "../_shared/owner-maestro-when.js";
13
13
  import { symphonyAccount, type MaestroWixApi } from "../_shared/owner-maestro-availability.js";
14
14
  import { deleteChat, pastChats, pinChat, renameChat, type PastChat } from "../_shared/owner-maestro-chat.js";
15
15
 
@@ -77,16 +77,6 @@ function bucketOf(updated: string, now: number): string {
77
77
  return copyParam("ownerMaestroHistory.older", "Older");
78
78
  }
79
79
 
80
- /** When a chat was last active: the time for one from today, whose rows would otherwise all
81
- * read the same date; the date and the time for an older one. */
82
- function whenLabel(updated: string, now: number): string {
83
- const at = Date.parse(updated);
84
- if (Number.isNaN(at)) return "";
85
- const midnight = new Date(now);
86
- midnight.setHours(0, 0, 0, 0);
87
- return at >= midnight.getTime() ? formatClock(new Date(at)) : formatMonthDayTime(new Date(at));
88
- }
89
-
90
80
  /** Rows: pinned chats first under their own heading, then by recency, each heading named on
91
81
  * its first row only. */
92
82
  function rowsOf(chats: PastChat[], now: number, s: Pick<MaestroHistoryState, "_open" | "_confirm">): HistoryRow[] {
@@ -2,9 +2,11 @@
2
2
  // visible session in start order, its time range and length in the EVENT's time zone (an
3
3
  // attendee abroad plans by the venue's clock), its stage, and the day it falls on.
4
4
  //
5
- // Read from the visitor-readable `GET /events/v1/schedule?eventId=` — only when the event has its
6
- // agenda turned on (`agendaSettings.enabled`); otherwise Wix answers for an owner only. A failed
7
- // read is reported (`ok: false`) so the caller can show an error with Retry, never an empty agenda.
5
+ // Read from the visitor-readable `GET /events/v1/schedule?eventId=`, whatever the event's
6
+ // `agendaSettings.enabled` says: that switch is the website's agenda page, not the API's. With it
7
+ // off, Wix still answers a visitor 200 — the published sessions for a One App visitor, an empty
8
+ // list where there are none — and One App shows them. A failed read is reported (`ok: false`) so
9
+ // the caller can show an error with Retry, never an empty agenda.
8
10
  import { calendarDay, formatClock, formatWeekdayMonthDayLong } from "./engine-intl.js";
9
11
  import { copyParam, copyTemplate } from "./himi-copy.js";
10
12
 
@@ -55,14 +57,15 @@ export function durationLabel(minutes: number): string {
55
57
  }
56
58
 
57
59
  interface RawItem {
58
- id?: unknown; name?: unknown; title?: unknown; hidden?: unknown; status?: unknown;
60
+ id?: unknown; name?: unknown; title?: unknown; hidden?: unknown; status?: unknown; draft?: unknown;
59
61
  stageName?: unknown; description?: unknown;
60
62
  timeSlot?: { start?: unknown; end?: unknown; timeZoneId?: unknown };
61
63
  }
62
64
 
63
65
  /** One session row from a Wix schedule item, or null for a hidden, draft or unnamed one. */
64
66
  export function agendaSession(item: RawItem, eventZone: string): AgendaSession | null {
65
- if (item.hidden === true) return null;
67
+ // An owner's read lists each item's draft copy too (`draft: true`), and only the draft until it is published.
68
+ if (item.hidden === true || item.draft === true) return null;
66
69
  // Wix schedule items are SCHEDULED or CANCELED (a draft is a separate copy, not a status).
67
70
  if (clean(item.status).toUpperCase() === "CANCELED") return null;
68
71
  const id = clean(item.id), name = clean(item.name) || clean(item.title);
@@ -91,9 +94,9 @@ export function agendaSession(item: RawItem, eventZone: string): AgendaSession |
91
94
 
92
95
  export type AgendaRead = { ok: true; sessions: AgendaSession[] } | { ok: false; sessions: AgendaSession[] };
93
96
 
94
- /** The visible sessions of `eventId`, in start order. An agenda that is off is an empty one. */
95
- export async function readAgenda(eventId: string, agendaEnabled: boolean, eventZone: string): Promise<AgendaRead> {
96
- if (!eventId || !agendaEnabled) return { ok: true, sessions: [] };
97
+ /** The visible sessions of `eventId`, in start order. */
98
+ export async function readAgenda(eventId: string, eventZone: string): Promise<AgendaRead> {
99
+ if (!eventId) return { ok: true, sessions: [] };
97
100
  const api = wixApi();
98
101
  if (!api) return { ok: false, sessions: [] };
99
102
  try {
@@ -112,11 +115,8 @@ export async function readAgenda(eventId: string, agendaEnabled: boolean, eventZ
112
115
  }
113
116
  }
114
117
 
115
- /** The event's own time zone and whether its agenda is on, from an Events v3 record. */
116
- export function agendaSettingsOf(event: unknown): { enabled: boolean; zone: string } {
117
- const e = event as { agendaSettings?: { enabled?: unknown }; dateAndTimeSettings?: { timeZoneId?: unknown }; scheduling?: { timeZoneId?: unknown; config?: { timeZoneId?: unknown } } } | null;
118
- return {
119
- enabled: e?.agendaSettings?.enabled === true,
120
- zone: clean(e?.dateAndTimeSettings?.timeZoneId) || clean(e?.scheduling?.config?.timeZoneId) || clean(e?.scheduling?.timeZoneId),
121
- };
118
+ /** The event's own time zone, from an Events v3 record (the DETAILS fieldset carries it). */
119
+ export function eventZoneOf(event: unknown): string {
120
+ const e = event as { dateAndTimeSettings?: { timeZoneId?: unknown }; scheduling?: { timeZoneId?: unknown; config?: { timeZoneId?: unknown } } } | null;
121
+ return clean(e?.dateAndTimeSettings?.timeZoneId) || clean(e?.scheduling?.config?.timeZoneId) || clean(e?.scheduling?.timeZoneId);
122
122
  }
@@ -10,7 +10,7 @@
10
10
  import { defineService, navigate } from "@himalaya/state";
11
11
  import { type WixEvent } from "@himalaya/wix-events";
12
12
  import { readFeaturedEvent } from "../_shared/featured-event.js";
13
- import { agendaSettingsOf, readAgenda, type AgendaSession } from "../_shared/event-agenda.js";
13
+ import { eventZoneOf, readAgenda, type AgendaSession } from "../_shared/event-agenda.js";
14
14
  import { starredSessions, toggleStar } from "../_shared/agenda-stars.js";
15
15
  import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
16
16
 
@@ -123,16 +123,14 @@ const now = (): S => (svc.getState?.() as S | undefined) ?? latest;
123
123
 
124
124
  async function load(s: S): Promise<S> {
125
125
  const mine = ++loadSeq;
126
- // AGENDA: without it Wix leaves `agendaSettings` out, and the agenda would never be read.
127
- const featured = await readFeaturedEvent(["DETAILS", "AGENDA"]);
126
+ const featured = await readFeaturedEvent(["DETAILS"]);
128
127
  if (mine !== loadSeq) return now();
129
128
  if (!featured.ok) return derive({ ...now(), status: "error" });
130
129
  const e: WixEvent | null = featured.event;
131
130
  // From the state as it is NOW (a filter tapped during the read stays), and with no message of
132
131
  // an event that is gone.
133
132
  if (!e?.id) return derive({ ...now(), status: "ready", eventId: "", eventTitle: "", sessions: [], starred: [], message: "" });
134
- const settings = agendaSettingsOf(e);
135
- const agenda = await readAgenda(e.id, settings.enabled, settings.zone);
133
+ const agenda = await readAgenda(e.id, eventZoneOf(e));
136
134
  if (mine !== loadSeq) return now();
137
135
  // A failed read keeps the rows only when they are THIS event's: another event's sessions under
138
136
  // this event's id would take stars for sessions it does not have.
@@ -15,7 +15,7 @@ import { queryDataItems, type WixDataItem } from "@himalaya/wix-data";
15
15
  import { wixMediaUrl, WIX_DETAIL_IMAGE } from "@himalaya/wix-media";
16
16
  import { open as openUrl } from "@himalaya/open-url";
17
17
  import { readFeaturedEvent } from "../_shared/featured-event.js";
18
- import { agendaSettingsOf, readAgenda, type AgendaSession } from "../_shared/event-agenda.js";
18
+ import { eventZoneOf, readAgenda, type AgendaSession } from "../_shared/event-agenda.js";
19
19
  import { registrationKindOf } from "../_shared/event-registration.js";
20
20
  import { formatClock, formatDateMedium } from "../_shared/engine-intl.js";
21
21
  import { signedInEmail } from "../_shared/himi-account.js";
@@ -255,8 +255,7 @@ async function load(_dispatched: S): Promise<S> {
255
255
  const tapsAtStart = linkTaps;
256
256
  const base = (): S => { const current = now(); return { ...current, linkMessage: linkTaps > tapsAtStart ? current.linkMessage : "" }; };
257
257
  const [featured, speakers, workshops] = await Promise.all([
258
- // AGENDA: without it Wix leaves `agendaSettings` out, and the agenda would never be read.
259
- readFeaturedEvent(["DETAILS", "REGISTRATION", "AGENDA"]),
258
+ readFeaturedEvent(["DETAILS", "REGISTRATION"]),
260
259
  readCollection(speakersCollection, (row) => speakerRow(row.id, row.data)),
261
260
  readCollection(workshopsCollection, (row, index) => workshopRow(row.id, row.data, index + 1)),
262
261
  ]);
@@ -270,8 +269,8 @@ async function load(_dispatched: S): Promise<S> {
270
269
  if (mine !== loadSeq) return now();
271
270
  return derive({ ...base(), ...speakersPart, status: "ready", eventId: "", title: "", dateLine: "", venue: "", address: "", mapQuery: "", image: "", ctaLabel: "", agenda: [], agendaCountLabel: "" });
272
271
  }
273
- const settings = agendaSettingsOf(e);
274
- const agenda = await readAgenda(e.id, settings.enabled, settings.zone);
272
+ const zone = eventZoneOf(e);
273
+ const agenda = await readAgenda(e.id, zone);
275
274
  if (mine !== loadSeq) return now();
276
275
  const venue = eventLocation(e);
277
276
  const address = eventAddress(e);
@@ -281,7 +280,7 @@ async function load(_dispatched: S): Promise<S> {
281
280
  status: "ready",
282
281
  eventId: e.id,
283
282
  title: clean(e.title) || copyParam("home.eventFallback", "Event"),
284
- dateLine: heroDate(e, settings.zone),
283
+ dateLine: heroDate(e, zone),
285
284
  venue: venue === "Location to be announced" ? copyParam("home.locationTbd", "Location to be announced") : venue,
286
285
  // The full address, only when it says more than the venue's name.
287
286
  address: address && address !== venue ? address : "",
@@ -475,7 +475,7 @@ function calendarFallbackUrl(s: S, end: number): string {
475
475
 
476
476
  /** The Events v3 fieldsets the detail reads (see `WixEventFieldset`). DETAILS carries mainImage and
477
477
  * shortDescription: REGISTRATION fills eventType, which skips the query enrichment that used to supply them. */
478
- export const EVENT_DETAIL_FIELDSETS: WixEventFieldset[] = ["DETAILS", "TEXTS", "REGISTRATION", "URLS", "FORM", "AGENDA"];
478
+ export const EVENT_DETAIL_FIELDSETS: WixEventFieldset[] = ["DETAILS", "TEXTS", "REGISTRATION", "URLS", "FORM"];
479
479
 
480
480
  function detailCopy(key: string, fallback: string): string { return copyParam(key, fallback); }
481
481
 
@@ -1065,25 +1065,26 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
1065
1065
  const dates = detailDate(e);
1066
1066
  const place = detailPlace(e);
1067
1067
  const registration = registrationUi(e, Date.now());
1068
- const rawEvent = e as unknown as { shortDescription?: string; agendaSettings?: { enabled?: boolean }; dateAndTimeSettings?: { recurrenceStatus?: string; recurringEvents?: { categoryId?: string } }; registration?: { allowedGuestTypes?: string; tickets?: { lowestPrice?: EventDetailMoney; highestPrice?: EventDetailMoney } } };
1068
+ const rawEvent = e as unknown as { shortDescription?: string; dateAndTimeSettings?: { recurrenceStatus?: string; recurringEvents?: { categoryId?: string } }; registration?: { allowedGuestTypes?: string; tickets?: { lowestPrice?: EventDetailMoney; highestPrice?: EventDetailMoney } } };
1069
1069
  const lowest = detailMoney(rawEvent.registration?.tickets?.lowestPrice);
1070
1070
  const highest = detailMoney(rawEvent.registration?.tickets?.highestPrice);
1071
1071
  const price = kind === "tickets" && lowest ? (highest && highest !== lowest ? detailCopy("event.priceFrom", "From {price}").replace("{price}", lowest) : lowest) : "";
1072
1072
  const memberProbeNeeded = kind === "rsvp" || rawEvent.registration?.allowedGuestTypes === "MEMBER";
1073
1073
  const isMember = memberProbeNeeded ? await signedInMember() : false;
1074
1074
  const [scheduleResponse, policyResponse, rsvpResponse] = await Promise.all([
1075
- // `limit` is required: without it Wix answers the agenda's `total` with an EMPTY `items`.
1076
- rawEvent.agendaSettings?.enabled ? bestEffort("GET", `/events/v1/schedule?eventId=${encodeURIComponent(id)}&limit=100`) : undefined,
1075
+ // `limit` is required: without it Wix answers the agenda's `total` with an EMPTY `items`. Read whatever the
1076
+ // event's agenda switch says: it is the website's agenda page, and Wix still answers a visitor with it off.
1077
+ bestEffort("GET", `/events/v1/schedule?eventId=${encodeURIComponent(id)}&limit=100`),
1077
1078
  bestEffort("POST", "/events-policies/v2/policies/query", { query: { filter: { eventId: { $eq: id } }, paging: { limit: 100 } } }),
1078
1079
  kind === "rsvp" && isMember ? bestEffort("GET", `/events/v2/rsvps/current?eventId=${encodeURIComponent(id)}`) : undefined,
1079
1080
  ]);
1080
1081
  let optionalReadFailed = [scheduleResponse, policyResponse, rsvpResponse].some((response) => response?.ok === false);
1081
1082
  const scheduleRaw = (scheduleResponse?.ok ? scheduleResponse.value : undefined) as { agenda?: Array<Record<string, unknown>>; schedule?: Array<Record<string, unknown>>; items?: Array<Record<string, unknown>>; agendaItems?: Array<Record<string, unknown>> } | undefined;
1082
- // A hidden or canceled session is not on the agenda, and an item id is listed once (an owner's
1083
+ // A hidden, canceled or draft session is not on the agenda, and an item id is listed once (an owner's
1083
1084
  // read carries a draft and its published copy); sessions in start order.
1084
1085
  const seenItems = new Set<string>();
1085
1086
  const scheduleSource = (scheduleRaw?.agenda ?? scheduleRaw?.agendaItems ?? scheduleRaw?.schedule ?? scheduleRaw?.items ?? [])
1086
- .filter((item) => item.hidden !== true && String(item.status ?? "").toUpperCase() !== "CANCELED")
1087
+ .filter((item) => item.hidden !== true && item.draft !== true && String(item.status ?? "").toUpperCase() !== "CANCELED")
1087
1088
  .filter((item) => { const key = String(item.id ?? ""); if (!key) return true; if (seenItems.has(key)) return false; seenItems.add(key); return true; })
1088
1089
  .map((item) => ({ item, at: Date.parse(String((item.timeSlot as { start?: string } | undefined)?.start ?? item.startTime ?? item.startDate ?? "")) }))
1089
1090
  .sort((a, b) => (Number.isNaN(a.at) ? Infinity : a.at) - (Number.isNaN(b.at) ? Infinity : b.at))
@@ -475,7 +475,7 @@ function calendarFallbackUrl(s: S, end: number): string {
475
475
 
476
476
  /** The Events v3 fieldsets the detail reads (see `WixEventFieldset`). DETAILS carries mainImage and
477
477
  * shortDescription: REGISTRATION fills eventType, which skips the query enrichment that used to supply them. */
478
- export const EVENT_DETAIL_FIELDSETS: WixEventFieldset[] = ["DETAILS", "TEXTS", "REGISTRATION", "URLS", "FORM", "AGENDA"];
478
+ export const EVENT_DETAIL_FIELDSETS: WixEventFieldset[] = ["DETAILS", "TEXTS", "REGISTRATION", "URLS", "FORM"];
479
479
 
480
480
  function detailCopy(key: string, fallback: string): string { return copyParam(key, fallback); }
481
481
 
@@ -1065,25 +1065,26 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
1065
1065
  const dates = detailDate(e);
1066
1066
  const place = detailPlace(e);
1067
1067
  const registration = registrationUi(e, Date.now());
1068
- const rawEvent = e as unknown as { shortDescription?: string; agendaSettings?: { enabled?: boolean }; dateAndTimeSettings?: { recurrenceStatus?: string; recurringEvents?: { categoryId?: string } }; registration?: { allowedGuestTypes?: string; tickets?: { lowestPrice?: EventDetailMoney; highestPrice?: EventDetailMoney } } };
1068
+ const rawEvent = e as unknown as { shortDescription?: string; dateAndTimeSettings?: { recurrenceStatus?: string; recurringEvents?: { categoryId?: string } }; registration?: { allowedGuestTypes?: string; tickets?: { lowestPrice?: EventDetailMoney; highestPrice?: EventDetailMoney } } };
1069
1069
  const lowest = detailMoney(rawEvent.registration?.tickets?.lowestPrice);
1070
1070
  const highest = detailMoney(rawEvent.registration?.tickets?.highestPrice);
1071
1071
  const price = kind === "tickets" && lowest ? (highest && highest !== lowest ? detailCopy("event.priceFrom", "From {price}").replace("{price}", lowest) : lowest) : "";
1072
1072
  const memberProbeNeeded = kind === "rsvp" || rawEvent.registration?.allowedGuestTypes === "MEMBER";
1073
1073
  const isMember = memberProbeNeeded ? await signedInMember() : false;
1074
1074
  const [scheduleResponse, policyResponse, rsvpResponse] = await Promise.all([
1075
- // `limit` is required: without it Wix answers the agenda's `total` with an EMPTY `items`.
1076
- rawEvent.agendaSettings?.enabled ? bestEffort("GET", `/events/v1/schedule?eventId=${encodeURIComponent(id)}&limit=100`) : undefined,
1075
+ // `limit` is required: without it Wix answers the agenda's `total` with an EMPTY `items`. Read whatever the
1076
+ // event's agenda switch says: it is the website's agenda page, and Wix still answers a visitor with it off.
1077
+ bestEffort("GET", `/events/v1/schedule?eventId=${encodeURIComponent(id)}&limit=100`),
1077
1078
  bestEffort("POST", "/events-policies/v2/policies/query", { query: { filter: { eventId: { $eq: id } }, paging: { limit: 100 } } }),
1078
1079
  kind === "rsvp" && isMember ? bestEffort("GET", `/events/v2/rsvps/current?eventId=${encodeURIComponent(id)}`) : undefined,
1079
1080
  ]);
1080
1081
  let optionalReadFailed = [scheduleResponse, policyResponse, rsvpResponse].some((response) => response?.ok === false);
1081
1082
  const scheduleRaw = (scheduleResponse?.ok ? scheduleResponse.value : undefined) as { agenda?: Array<Record<string, unknown>>; schedule?: Array<Record<string, unknown>>; items?: Array<Record<string, unknown>>; agendaItems?: Array<Record<string, unknown>> } | undefined;
1082
- // A hidden or canceled session is not on the agenda, and an item id is listed once (an owner's
1083
+ // A hidden, canceled or draft session is not on the agenda, and an item id is listed once (an owner's
1083
1084
  // read carries a draft and its published copy); sessions in start order.
1084
1085
  const seenItems = new Set<string>();
1085
1086
  const scheduleSource = (scheduleRaw?.agenda ?? scheduleRaw?.agendaItems ?? scheduleRaw?.schedule ?? scheduleRaw?.items ?? [])
1086
- .filter((item) => item.hidden !== true && String(item.status ?? "").toUpperCase() !== "CANCELED")
1087
+ .filter((item) => item.hidden !== true && item.draft !== true && String(item.status ?? "").toUpperCase() !== "CANCELED")
1087
1088
  .filter((item) => { const key = String(item.id ?? ""); if (!key) return true; if (seenItems.has(key)) return false; seenItems.add(key); return true; })
1088
1089
  .map((item) => ({ item, at: Date.parse(String((item.timeSlot as { start?: string } | undefined)?.start ?? item.startTime ?? item.startDate ?? "")) }))
1089
1090
  .sort((a, b) => (Number.isNaN(a.at) ? Infinity : a.at) - (Number.isNaN(b.at) ? Infinity : b.at))
@@ -187,6 +187,13 @@ export default defineApp({
187
187
  "parentScreenId": "himi_owner_lite_maestro",
188
188
  "tabId": "maestro"
189
189
  },
190
+ {
191
+ "screenId": "himi_owner_lite_maestro_activity",
192
+ "isPublic": false,
193
+ "paramKeys": [],
194
+ "parentScreenId": "himi_owner_lite_maestro",
195
+ "tabId": "maestro"
196
+ },
190
197
  {
191
198
  "screenId": "himi_owner_lite_brief",
192
199
  "isPublic": false,