create-pmos 0.399.0 → 0.400.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 (421) hide show
  1. package/package.json +18 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +2 -2
  7. package/workspace/briefing-premium-board-test.js +2 -2
  8. package/workspace/briefing-premium-doc-edit-test.js +2 -8
  9. package/workspace/briefing-premium-test.js +3 -2
  10. package/workspace/briefing-premium-work-test.js +9 -4
  11. package/workspace/c3-capture-test.js +0 -17
  12. package/workspace/changelog.json +17 -0
  13. package/workspace/guide/briefing-premium.md +2 -2
  14. package/workspace/guide/home.md +20 -2
  15. package/workspace/guide/layout.md +2 -2
  16. package/workspace/guide/notes.md +2 -2
  17. package/workspace/guide/phone-companion.md +1 -1
  18. package/workspace/lib/route-modules.js +1 -9
  19. package/workspace/lib/routes-phone-day.js +18 -9
  20. package/workspace/lib/routes-slash.js +95 -0
  21. package/workspace/package-lock.json +2 -2
  22. package/workspace/package.json +1 -2
  23. package/workspace/premium-chat-goal-view-test.js +1 -1
  24. package/workspace/premium-chat-term-test.js +0 -10
  25. package/workspace/premium-menu-rows-test.js +1 -1
  26. package/workspace/premium-phone-card-test.js +2 -2
  27. package/workspace/premium-vw-doc-test.js +1 -8
  28. package/workspace/premium-work-depth-test.js +2 -3
  29. package/workspace/public/capture.html +23 -0
  30. package/workspace/public/pm/c3-base.js +47 -0
  31. package/workspace/public/pm/c3-capture.js +1 -1
  32. package/workspace/public/pm/c3-ini-ui.js +1 -1
  33. package/workspace/public/pm/c3-sheet.js +1 -1
  34. package/workspace/public/pm/c3-toast.js +1 -1
  35. package/workspace/public/pm/console3.css +3 -0
  36. package/workspace/public/pm/cozy-home.css +20 -5
  37. package/workspace/public/pm/cozy-today.css +5 -2
  38. package/workspace/public/pm/cozy-viewer.js +4 -2
  39. package/workspace/public/pm/cozy.css +9 -0
  40. package/workspace/public/pm/goal-chat.js +5 -1
  41. package/workspace/public/pm/home-app.js +47 -26
  42. package/workspace/public/pm/home-chat.js +10 -4
  43. package/workspace/public/pm/home-data.js +3 -1
  44. package/workspace/public/pm/home-dictate.js +7 -4
  45. package/workspace/public/pm/home-ini.js +12 -2
  46. package/workspace/public/pm/home-list.js +20 -7
  47. package/workspace/public/pm/home-more.js +2 -2
  48. package/workspace/public/pm/home-phone-card.js +9 -4
  49. package/workspace/public/pm/home-review.js +2 -3
  50. package/workspace/public/pm/home-today.js +10 -6
  51. package/workspace/public/pm/home-work.js +15 -8
  52. package/workspace/public/pm/note-dock.js +1 -2
  53. package/workspace/public/pm/notes-links.js +1 -2
  54. package/workspace/public/pm/notes-task.js +3 -4
  55. package/workspace/public/pm/premium-board.js +1 -1
  56. package/workspace/public/pm/premium-initiative-head.js +3 -3
  57. package/workspace/public/pm/premium-vw-doc.css +20 -2
  58. package/workspace/public/pm/premium-vw-doc.js +22 -7
  59. package/workspace/public/pm/view-notes.js +2 -2
  60. package/workspace/replaced-tests.json +435 -0
  61. package/workspace/run-tests.js +323 -28
  62. package/workspace/server.js +15 -10
  63. package/workspace/test-files.json +3 -140
  64. package/workspace/test-lists/base.json +1 -2
  65. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  66. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  67. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  68. package/workspace/test-lists/c3-work-agent.json +1 -2
  69. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  70. package/workspace/test-lists/console3-reports.json +1 -2
  71. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  72. package/workspace/test-lists/extension-capture.json +5 -0
  73. package/workspace/test-lists/jira-wbs.json +1 -2
  74. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  75. package/workspace/test-lists/meeting-material.json +1 -2
  76. package/workspace/test-lists/meeting-notes.json +2 -36
  77. package/workspace/test-lists/meeting-replay.json +1 -2
  78. package/workspace/test-lists/mm-capture.json +2 -12
  79. package/workspace/test-lists/my-work.json +2 -10
  80. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  81. package/workspace/test-lists/people-directory.json +1 -2
  82. package/workspace/test-lists/run2-a.json +1 -2
  83. package/workspace/test-lists/run2-d.json +2 -19
  84. package/workspace/test-lists/run3-b.json +1 -2
  85. package/workspace/test-lists/run3-c.json +2 -12
  86. package/workspace/test-lists/run4-b.json +1 -2
  87. package/workspace/test-lists/run4-d.json +1 -5
  88. package/workspace/test-lists/run5-c.json +1 -11
  89. package/workspace/test-lists/run6.json +1 -5
  90. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  91. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  92. package/workspace/test-timings.json +242 -123
  93. package/workspace/c3-briefing-test.js +0 -136
  94. package/workspace/c3-core-docs-test.js +0 -170
  95. package/workspace/c3-driver-fixture.js +0 -64
  96. package/workspace/c3-driver-test.js +0 -169
  97. package/workspace/c3-foundation-test.js +0 -163
  98. package/workspace/c3-ib-items-test.js +0 -114
  99. package/workspace/c3-ib-more-test.js +0 -146
  100. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  101. package/workspace/c3-ini-harness.js +0 -66
  102. package/workspace/c3-ini-life-test.js +0 -167
  103. package/workspace/c3-initiatives-test.js +0 -186
  104. package/workspace/c3-light-load-test.js +0 -112
  105. package/workspace/c3-one-home-test.js +0 -149
  106. package/workspace/c3-phone-test.js +0 -289
  107. package/workspace/c3-quiet-test.js +0 -157
  108. package/workspace/c3-report-design-real-test.js +0 -264
  109. package/workspace/c3-report-design-test.js +0 -442
  110. package/workspace/c3-report-setup-test.js +0 -192
  111. package/workspace/c3-report-structure-real-test.js +0 -248
  112. package/workspace/c3-report-structure-test.js +0 -397
  113. package/workspace/c3-reports-test.js +0 -288
  114. package/workspace/c3-scan-test.js +0 -517
  115. package/workspace/c3-sessions-panel-test.js +0 -365
  116. package/workspace/c3-settings-test.js +0 -204
  117. package/workspace/c3-updates-test.js +0 -131
  118. package/workspace/c3-work-test.js +0 -260
  119. package/workspace/cut-stub.js +0 -40
  120. package/workspace/first-paint-audit.js +0 -160
  121. package/workspace/lib/c3-full-console.js +0 -15
  122. package/workspace/lib/engine/derived/trust.js +0 -3
  123. package/workspace/lib/engine/plan-forecast.js +0 -342
  124. package/workspace/lib/engine/report-families.js +0 -175
  125. package/workspace/lib/engine/truth-table.js +0 -57
  126. package/workspace/lib/routes-c3-init.js +0 -54
  127. package/workspace/lib/routes-c3-life.js +0 -120
  128. package/workspace/lib/routes-c3-timeline.js +0 -192
  129. package/workspace/lib/routes-forecast.js +0 -86
  130. package/workspace/lib/routes-releases.js +0 -130
  131. package/workspace/lib/routes-report-facts.js +0 -85
  132. package/workspace/lib/routes-report-families.js +0 -33
  133. package/workspace/lib/routes-signals.js +0 -51
  134. package/workspace/lib/routes-timeline.js +0 -197
  135. package/workspace/public/c3.html +0 -35
  136. package/workspace/public/index.html +0 -156
  137. package/workspace/public/pm/app.js +0 -831
  138. package/workspace/public/pm/bd-board.js +0 -159
  139. package/workspace/public/pm/bd-drag.js +0 -59
  140. package/workspace/public/pm/bd-model.js +0 -152
  141. package/workspace/public/pm/bd-timeline.js +0 -233
  142. package/workspace/public/pm/bd-tree.js +0 -244
  143. package/workspace/public/pm/board-copy.js +0 -59
  144. package/workspace/public/pm/board-read.js +0 -38
  145. package/workspace/public/pm/branches-sheet.js +0 -56
  146. package/workspace/public/pm/breakdown-api.js +0 -58
  147. package/workspace/public/pm/breakdown-copy.js +0 -138
  148. package/workspace/public/pm/briefing-deck.js +0 -441
  149. package/workspace/public/pm/briefing-model.js +0 -251
  150. package/workspace/public/pm/c3-ambient.js +0 -100
  151. package/workspace/public/pm/c3-audience-link.js +0 -21
  152. package/workspace/public/pm/c3-audience.js +0 -46
  153. package/workspace/public/pm/c3-boot.js +0 -13
  154. package/workspace/public/pm/c3-breakdown.js +0 -240
  155. package/workspace/public/pm/c3-brief-data.js +0 -11
  156. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  157. package/workspace/public/pm/c3-brief-needs.js +0 -288
  158. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  159. package/workspace/public/pm/c3-brief-summary.js +0 -139
  160. package/workspace/public/pm/c3-brief-today.js +0 -79
  161. package/workspace/public/pm/c3-brief.js +0 -279
  162. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  163. package/workspace/public/pm/c3-calendar.js +0 -965
  164. package/workspace/public/pm/c3-calpop.js +0 -111
  165. package/workspace/public/pm/c3-case.js +0 -196
  166. package/workspace/public/pm/c3-core-docs.css +0 -18
  167. package/workspace/public/pm/c3-core-docs.js +0 -236
  168. package/workspace/public/pm/c3-daypart.js +0 -176
  169. package/workspace/public/pm/c3-demo-boards.js +0 -764
  170. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  171. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  172. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  173. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  174. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  175. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  176. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  177. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  178. package/workspace/public/pm/c3-demo-data.js +0 -552
  179. package/workspace/public/pm/c3-demo-focus.js +0 -181
  180. package/workspace/public/pm/c3-demo-init.js +0 -430
  181. package/workspace/public/pm/c3-demo-life.js +0 -77
  182. package/workspace/public/pm/c3-demo-material.js +0 -58
  183. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  184. package/workspace/public/pm/c3-demo-phone.js +0 -48
  185. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  186. package/workspace/public/pm/c3-demo-rd.js +0 -432
  187. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  188. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  189. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  190. package/workspace/public/pm/c3-demo-rs.js +0 -287
  191. package/workspace/public/pm/c3-demo-term.js +0 -153
  192. package/workspace/public/pm/c3-demo-time.js +0 -49
  193. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  194. package/workspace/public/pm/c3-demo.js +0 -131
  195. package/workspace/public/pm/c3-design-studio.js +0 -369
  196. package/workspace/public/pm/c3-doc-formats.js +0 -153
  197. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  198. package/workspace/public/pm/c3-dock.js +0 -206
  199. package/workspace/public/pm/c3-docs.js +0 -291
  200. package/workspace/public/pm/c3-driver-work.js +0 -110
  201. package/workspace/public/pm/c3-driver.css +0 -18
  202. package/workspace/public/pm/c3-driver.js +0 -298
  203. package/workspace/public/pm/c3-focus.css +0 -304
  204. package/workspace/public/pm/c3-focus.js +0 -983
  205. package/workspace/public/pm/c3-ib-docs.js +0 -92
  206. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  207. package/workspace/public/pm/c3-ib-items.js +0 -210
  208. package/workspace/public/pm/c3-ib-releases.js +0 -48
  209. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  210. package/workspace/public/pm/c3-ib-triage.js +0 -177
  211. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  212. package/workspace/public/pm/c3-ini-life.css +0 -34
  213. package/workspace/public/pm/c3-ini-life.js +0 -379
  214. package/workspace/public/pm/c3-ini-records.js +0 -197
  215. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  216. package/workspace/public/pm/c3-ini-work.js +0 -139
  217. package/workspace/public/pm/c3-init-extras.js +0 -170
  218. package/workspace/public/pm/c3-initiatives.js +0 -852
  219. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  220. package/workspace/public/pm/c3-look.js +0 -27
  221. package/workspace/public/pm/c3-material.css +0 -22
  222. package/workspace/public/pm/c3-material.js +0 -321
  223. package/workspace/public/pm/c3-md.js +0 -3
  224. package/workspace/public/pm/c3-misc-panels.js +0 -89
  225. package/workspace/public/pm/c3-new-session.js +0 -110
  226. package/workspace/public/pm/c3-notes.js +0 -751
  227. package/workspace/public/pm/c3-phone-boot.js +0 -47
  228. package/workspace/public/pm/c3-phone-detail.js +0 -97
  229. package/workspace/public/pm/c3-phone-model.js +0 -3
  230. package/workspace/public/pm/c3-phone.css +0 -66
  231. package/workspace/public/pm/c3-phone.js +0 -444
  232. package/workspace/public/pm/c3-plan-panels.js +0 -163
  233. package/workspace/public/pm/c3-plan.js +0 -193
  234. package/workspace/public/pm/c3-quiet.css +0 -113
  235. package/workspace/public/pm/c3-quiet.js +0 -177
  236. package/workspace/public/pm/c3-replay.css +0 -133
  237. package/workspace/public/pm/c3-replay.js +0 -429
  238. package/workspace/public/pm/c3-report-deck.css +0 -163
  239. package/workspace/public/pm/c3-report-deck.js +0 -598
  240. package/workspace/public/pm/c3-report-frame.css +0 -20
  241. package/workspace/public/pm/c3-report-print.css +0 -20
  242. package/workspace/public/pm/c3-report-setup.css +0 -67
  243. package/workspace/public/pm/c3-report-setup.js +0 -298
  244. package/workspace/public/pm/c3-report-store.js +0 -244
  245. package/workspace/public/pm/c3-report-structure.css +0 -44
  246. package/workspace/public/pm/c3-report-structure.js +0 -473
  247. package/workspace/public/pm/c3-reports.css +0 -68
  248. package/workspace/public/pm/c3-reports.js +0 -377
  249. package/workspace/public/pm/c3-roadmap.js +0 -249
  250. package/workspace/public/pm/c3-scan-api.js +0 -167
  251. package/workspace/public/pm/c3-scan-next.js +0 -248
  252. package/workspace/public/pm/c3-scan-setup.js +0 -313
  253. package/workspace/public/pm/c3-scan-words.js +0 -41
  254. package/workspace/public/pm/c3-scan.css +0 -74
  255. package/workspace/public/pm/c3-scan.js +0 -93
  256. package/workspace/public/pm/c3-session-chat.js +0 -103
  257. package/workspace/public/pm/c3-session-conv.js +0 -165
  258. package/workspace/public/pm/c3-session-term.js +0 -216
  259. package/workspace/public/pm/c3-settings.css +0 -85
  260. package/workspace/public/pm/c3-settings.js +0 -1045
  261. package/workspace/public/pm/c3-shell.js +0 -628
  262. package/workspace/public/pm/c3-signals.js +0 -196
  263. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  264. package/workspace/public/pm/c3-swipe.js +0 -230
  265. package/workspace/public/pm/c3-terminal-data.js +0 -48
  266. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  267. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  268. package/workspace/public/pm/c3-terminal-results.js +0 -141
  269. package/workspace/public/pm/c3-terminal.js +0 -52
  270. package/workspace/public/pm/c3-tickets.js +0 -163
  271. package/workspace/public/pm/c3-timeline.js +0 -201
  272. package/workspace/public/pm/calendar-views.js +0 -1049
  273. package/workspace/public/pm/console3-lift.md +0 -220
  274. package/workspace/public/pm/cozy-home.js +0 -172
  275. package/workspace/public/pm/cozy-initiative.css +0 -138
  276. package/workspace/public/pm/cycle-review.js +0 -125
  277. package/workspace/public/pm/data.js +0 -1577
  278. package/workspace/public/pm/dest-board.js +0 -444
  279. package/workspace/public/pm/dest-docs.js +0 -530
  280. package/workspace/public/pm/dest-initiatives.js +0 -162
  281. package/workspace/public/pm/dest-mywork.js +0 -307
  282. package/workspace/public/pm/dest-notes.js +0 -537
  283. package/workspace/public/pm/dest-people.js +0 -449
  284. package/workspace/public/pm/dest-reports.js +0 -383
  285. package/workspace/public/pm/dest-settings.js +0 -601
  286. package/workspace/public/pm/dest-today.js +0 -267
  287. package/workspace/public/pm/display-word.js +0 -56
  288. package/workspace/public/pm/doc-editor.js +0 -473
  289. package/workspace/public/pm/doc-graph.js +0 -272
  290. package/workspace/public/pm/doc-health-panel.js +0 -110
  291. package/workspace/public/pm/doc-rail.js +0 -167
  292. package/workspace/public/pm/doc-remote.js +0 -180
  293. package/workspace/public/pm/dock-sessions.js +0 -472
  294. package/workspace/public/pm/dock.js +0 -216
  295. package/workspace/public/pm/fixture.js +0 -821
  296. package/workspace/public/pm/flag-picker.js +0 -104
  297. package/workspace/public/pm/frame-copy.js +0 -278
  298. package/workspace/public/pm/freshness-line.js +0 -149
  299. package/workspace/public/pm/handoff-box.js +0 -82
  300. package/workspace/public/pm/initiative-list.js +0 -235
  301. package/workspace/public/pm/initiative-sheet.js +0 -331
  302. package/workspace/public/pm/initiatives-api.js +0 -95
  303. package/workspace/public/pm/initiatives-copy.js +0 -287
  304. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  305. package/workspace/public/pm/initiatives-timeline.js +0 -410
  306. package/workspace/public/pm/initiatives-ui.js +0 -291
  307. package/workspace/public/pm/item-sheet.js +0 -268
  308. package/workspace/public/pm/keep-card.js +0 -204
  309. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  310. package/workspace/public/pm/lifecycle-lens.js +0 -276
  311. package/workspace/public/pm/lifecycle.js +0 -111
  312. package/workspace/public/pm/mobile.css +0 -366
  313. package/workspace/public/pm/mobile.js +0 -581
  314. package/workspace/public/pm/modes-live.js +0 -453
  315. package/workspace/public/pm/modes.js +0 -147
  316. package/workspace/public/pm/my-work-card.js +0 -51
  317. package/workspace/public/pm/my-work-data.js +0 -36
  318. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  319. package/workspace/public/pm/next-step-ui.js +0 -190
  320. package/workspace/public/pm/outbox-panel.js +0 -125
  321. package/workspace/public/pm/palette-copy.js +0 -55
  322. package/workspace/public/pm/palette.js +0 -343
  323. package/workspace/public/pm/panel-breakdown.js +0 -702
  324. package/workspace/public/pm/panel-cockpit.js +0 -425
  325. package/workspace/public/pm/panel-detail.js +0 -1513
  326. package/workspace/public/pm/panel-initiatives.js +0 -929
  327. package/workspace/public/pm/panel-newsess.js +0 -709
  328. package/workspace/public/pm/panel-repos.js +0 -741
  329. package/workspace/public/pm/panel-tabs.js +0 -1506
  330. package/workspace/public/pm/panel-trees.js +0 -204
  331. package/workspace/public/pm/people-link.js +0 -106
  332. package/workspace/public/pm/phone-deck.js +0 -167
  333. package/workspace/public/pm/pm-work-view.js +0 -1533
  334. package/workspace/public/pm/portfolio-report.js +0 -61
  335. package/workspace/public/pm/premium-acts.js +0 -280
  336. package/workspace/public/pm/premium-brief.js +0 -111
  337. package/workspace/public/pm/premium-chat.js +0 -22
  338. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  339. package/workspace/public/pm/premium-initiative.js +0 -324
  340. package/workspace/public/pm/premium-insights.css +0 -228
  341. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  342. package/workspace/public/pm/premium-report-brief.js +0 -132
  343. package/workspace/public/pm/premium-vw-rec.js +0 -67
  344. package/workspace/public/pm/premium-wide.css +0 -30
  345. package/workspace/public/pm/print.css +0 -44
  346. package/workspace/public/pm/provider-cards.js +0 -136
  347. package/workspace/public/pm/registry.js +0 -203
  348. package/workspace/public/pm/release-card.js +0 -110
  349. package/workspace/public/pm/releases-view.js +0 -248
  350. package/workspace/public/pm/report-families-view.js +0 -505
  351. package/workspace/public/pm/report-slides.js +0 -438
  352. package/workspace/public/pm/report-tab.js +0 -33
  353. package/workspace/public/pm/report-view.js +0 -337
  354. package/workspace/public/pm/reports-copy.js +0 -134
  355. package/workspace/public/pm/roadmap.js +0 -294
  356. package/workspace/public/pm/run-card.js +0 -260
  357. package/workspace/public/pm/sessions-panel.js +0 -219
  358. package/workspace/public/pm/sheet-jira.js +0 -353
  359. package/workspace/public/pm/shell-bell.js +0 -163
  360. package/workspace/public/pm/shell-model.js +0 -83
  361. package/workspace/public/pm/shell-phone.js +0 -124
  362. package/workspace/public/pm/shell-readaloud.js +0 -53
  363. package/workspace/public/pm/shell-recording.js +0 -274
  364. package/workspace/public/pm/shell-ticker.js +0 -90
  365. package/workspace/public/pm/sig-watch.js +0 -41
  366. package/workspace/public/pm/slide-confirm.js +0 -163
  367. package/workspace/public/pm/slides-copy.js +0 -52
  368. package/workspace/public/pm/status-banner.js +0 -95
  369. package/workspace/public/pm/tab-doc.js +0 -859
  370. package/workspace/public/pm/tab-gone.js +0 -21
  371. package/workspace/public/pm/tab-term.js +0 -1210
  372. package/workspace/public/pm/tab-web.js +0 -90
  373. package/workspace/public/pm/timeline-copy.js +0 -48
  374. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  375. package/workspace/public/pm/today-agenda.js +0 -331
  376. package/workspace/public/pm/today-cards.js +0 -244
  377. package/workspace/public/pm/today-copy.js +0 -506
  378. package/workspace/public/pm/today-day.js +0 -1371
  379. package/workspace/public/pm/today-goals.js +0 -297
  380. package/workspace/public/pm/today-jobs.js +0 -84
  381. package/workspace/public/pm/today-mentions.js +0 -50
  382. package/workspace/public/pm/topbar.js +0 -202
  383. package/workspace/public/pm/triage-card.js +0 -60
  384. package/workspace/public/pm/undo-hold.js +0 -103
  385. package/workspace/public/pm/view-addrepo.js +0 -208
  386. package/workspace/public/pm/view-files.js +0 -197
  387. package/workspace/public/pm/view-livenotes.js +0 -399
  388. package/workspace/public/pm/view-today.js +0 -13
  389. package/workspace/public/pm/view-validate.js +0 -171
  390. package/workspace/public/pm/welcome.js +0 -391
  391. package/workspace/public/pm/work-place.js +0 -68
  392. package/workspace/public/pm/xlsx-read.js +0 -117
  393. package/workspace/public/welcome.html +0 -22
  394. package/workspace/test-lists/browser-suites-green.json +0 -5
  395. package/workspace/test-lists/c3-core-docs.json +0 -9
  396. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  397. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  398. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  399. package/workspace/test-lists/c3-ib-items.json +0 -9
  400. package/workspace/test-lists/c3-ib-more.json +0 -9
  401. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  402. package/workspace/test-lists/c3-ini-life.json +0 -9
  403. package/workspace/test-lists/c3-meeting-board.json +0 -5
  404. package/workspace/test-lists/c3-meeting-card.json +0 -5
  405. package/workspace/test-lists/c3-notes-place.json +0 -5
  406. package/workspace/test-lists/c3-notes-series.json +0 -5
  407. package/workspace/test-lists/calendar-time-page.json +0 -5
  408. package/workspace/test-lists/calpop.json +0 -4
  409. package/workspace/test-lists/console3-briefing.json +0 -9
  410. package/workspace/test-lists/console3-foundation.json +0 -9
  411. package/workspace/test-lists/console3-work-page.json +0 -9
  412. package/workspace/test-lists/premium-brief-parity.json +0 -9
  413. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  414. package/workspace/test-lists/report-structure-ui.json +0 -11
  415. package/workspace/test-lists/report-workspace-ui.json +0 -5
  416. package/workspace/test-lists/run3-a.json +0 -5
  417. package/workspace/test-lists/run3-d.json +0 -6
  418. package/workspace/test-lists/run4-c.json +0 -13
  419. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  420. package/workspace/test-lists/today-mentions-cards.json +0 -5
  421. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,598 +0,0 @@
1
- /* pm/c3-report-deck.js — a DESIGNED report cycle in the document sheet's Read tab: the deck or the interactive document, Present, speaker notes,
2
- * notes on the slide, Print / PDF and the "Differs from the design" notice (initiative report-design-studio; planning/prd/report-design-studio-prd.md
3
- * sections 3 and 4; mockup 42-reportdeck.js, hashes #deck, #deck-pin, #deck-speaker, #deck-present, #deck-audience, #deck-cycles).
4
- *
5
- * createDeck({ ws, path, setup, name, cycle, output, copy, onStudio, onBrief }) -> { node(api), tools(api), present(kind), state }
6
- * c3-report-setup.js makes one per open document and gives node/tools to openDocSheet's report option. node(api) is null until the cycle
7
- * is read, and stays null for a cycle with no design: the sheet then draws its ordinary format view.
8
- * RD the routes of the API contract (report-design-contract.md), through pmGet/pmPost
9
- * splitRender(html) a sanitized render as { style, slides, secs, body, format } (DOMParser; nothing of it runs)
10
- * frameDoc(style, inner) the srcdoc of one sandboxed frame: the slide tokens, the frame affordances, the render's own <style>
11
- * slideCard(R, slide, o) a 1280 x 720 slide in <iframe sandbox="allow-same-origin" srcdoc> (no allow-scripts), scaled to its width
12
- * wireFrame(doc, h) the data attributes of a render, wired from this page: data-src, data-value, data-more, data-initiative, data-from
13
- * printDeckHtml(R, o) the print page: the render's slides one per page, nothing else (no speaker note, no pin)
14
- * diffOutlines(a, b) what changed between two outlines, in words (pure; Node-testable)
15
- * The render is HTML the server sanitized. It shows only in frames with no script permission; every interaction is wired from here. Nothing is
16
- * sent: Present, Print and Download stay on this device. Writes (cycle decisions, notes, pins) go through pmPost, which the server takes only
17
- * from a press on the page. */
18
- import { el } from './dom.js';
19
- import { icon, pbtn, btn, chip, sect, put, lk } from './c3-ini-ui.js';
20
- import { pmGet, pmPost } from './http.js';
21
- import { toast } from './c3-toast.js';
22
- import { ensureC3Css } from './pm-work-view.js';
23
- import { openAudienceWindow } from './c3-audience-link.js';
24
-
25
- export const W = 1280;
26
- export const H = 720;
27
- const q = (o) => Object.entries(o).filter(([, v]) => v != null && v !== '').map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
28
- const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
29
- const pad2 = (n) => String(n).padStart(2, '0');
30
- const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
31
- /** 'Wed 7 Oct' for '2026-10-07', 'Sep 2026' for '2026-09', anything else as it is. */
32
- export function slotWord(slot) {
33
- const s = String(slot || '');
34
- let m = /^(\d{4})-(\d{2})-(\d{2})/.exec(s);
35
- if (m) { const d = new Date(Date.UTC(+m[1], +m[2] - 1, +m[3])); return WD[d.getUTCDay()] + ' ' + (+m[3]) + ' ' + MON[+m[2] - 1]; }
36
- m = /^(\d{4})-(\d{2})$/.exec(s); if (m) return MON[+m[2] - 1] + ' ' + m[1];
37
- return s;
38
- }
39
-
40
- /** Link c3-report-deck.css once (the deck, the studio and the brief share it). */
41
- export function ensureDeckCss() {
42
- if (typeof document === 'undefined' || document.querySelector('link[data-c3-report-deck]')) return;
43
- const l = document.createElement('link');
44
- l.rel = 'stylesheet'; l.href = new URL('./c3-report-deck.css', import.meta.url).href; l.setAttribute('data-c3-report-deck', '');
45
- document.head.appendChild(l);
46
- }
47
-
48
- /* ── the routes (report-design-contract.md) ── */
49
- async function textOf(url) {
50
- const r = await fetch(url);
51
- if (!r.ok) { let m = ''; try { m = (await r.json()).error; } catch { /* not JSON */ } throw new Error(m || 'the workspace did not answer'); }
52
- return r.text();
53
- }
54
- const post = (p, body) => Promise.resolve(pmPost('/api/' + p, body)).catch((e) => ({ ok: false, error: String((e && e.message) || e) }));
55
- export const RD = {
56
- design: (ws, id) => Promise.resolve(pmGet('/api/report-design?' + q({ ws, id }))).catch(() => null),
57
- version: (ws, id, n) => textOf('/api/report-design/version?' + q({ ws, id, n })),
58
- describe: (b) => post('report-design/describe', b),
59
- sample: (b) => post('report-design/sample', b),
60
- turn: (b) => post('report-design/turn', b),
61
- accept: (b) => post('report-design/accept', b),
62
- revert: (b) => post('report-design/revert', b),
63
- cycle: (ws, path) => Promise.resolve(pmGet('/api/report-design/cycle?' + q({ ws, path }))).catch(() => null),
64
- cycleHtml: (ws, path) => textOf('/api/report-design/cycle-html?' + q({ ws, path })),
65
- decide: (b) => post('report-design/cycle-decision', b),
66
- notes: (ws, path) => Promise.resolve(pmGet('/api/report-notes?' + q({ ws, path }))).catch(() => null),
67
- speaker: (b) => post('report-notes/speaker', b),
68
- pin: (b) => post('report-notes/pin', b),
69
- };
70
- export const failed = (r, what) => toast({ text: what + ': ' + ((r && (r.error || r.reason)) || 'the workspace did not answer') + '.', tone: 'error', timeout: 6000 });
71
-
72
- /* ── a render: parsed, never run ── */
73
- /** The render as parts. A second line of defence after the server's sanitizer: scripts, frames and on* attributes are dropped here too. */
74
- export function splitRender(html) {
75
- const d = new DOMParser().parseFromString(String(html || ''), 'text/html');
76
- d.querySelectorAll('script,iframe,object,embed,link,meta,base').forEach((n) => n.remove());
77
- d.querySelectorAll('*').forEach((n) => { for (const a of [...n.attributes]) if (/^on/i.test(a.name) || /^\s*javascript:/i.test(a.value)) n.removeAttribute(a.name); });
78
- const style = [...d.querySelectorAll('style')].map((s) => s.textContent).join('\n');
79
- d.querySelectorAll('style').forEach((s) => s.remove());
80
- const slides = [...d.querySelectorAll('section.pmos-slide')].map((s, i) => ({ id: s.getAttribute('data-slide-id') || 'slide-' + (i + 1), kind: s.getAttribute('data-kind') || '', title: s.getAttribute('data-title') || 'Slide ' + (i + 1), section: s.getAttribute('data-section') || '', html: s.outerHTML, n: i + 1 }));
81
- const secs = [...d.querySelectorAll('section.pmos-sec')].map((s, i) => ({ id: s.getAttribute('data-sec-id') || 'sec-' + (i + 1), kind: s.getAttribute('data-kind') || '', title: s.getAttribute('data-title') || 'Section ' + (i + 1), section: s.getAttribute('data-section') || s.getAttribute('data-title') || '', n: i + 1 }));
82
- return { style, slides, secs, body: d.body.innerHTML, format: slides.length ? 'deck' : 'doc' };
83
- }
84
- const TOKENS = () => new URL('./tokens.css', import.meta.url).href;
85
- const FRAME_CSS = () => new URL('./c3-report-frame.css', import.meta.url).href;
86
- /** The srcdoc of one frame. The render's own <style> comes last, so its rules win over the frame affordances. */
87
- export function frameDoc(style, inner, cls) {
88
- return '<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="stylesheet" href="' + esc(TOKENS()) + '"><link rel="stylesheet" href="' + esc(FRAME_CSS()) + '">'
89
- + '<style>' + String(style || '').replace(/<\/style/gi, '<\\/style') + '</style></head><body class="pmos-frame' + (cls ? ' ' + cls : '') + '">' + String(inner || '') + '</body></html>';
90
- }
91
- /** A frame: sandboxed, no scripts. onLoad(doc) runs each time it loads (moving it in the page loads it again). */
92
- export function frame(style, inner, { title, cls, onLoad, focusable } = {}) {
93
- const f = el('iframe', { class: 'rd-if', sandbox: 'allow-same-origin', srcdoc: frameDoc(style, inner, cls), title: title || 'Slide', 'data-rd-frame': '', ...(focusable ? {} : { tabindex: '-1' }) });
94
- if (onLoad) f.addEventListener('load', () => { try { if (f.contentDocument) onLoad(f.contentDocument, f); } catch { /* the frame went away */ } });
95
- return f;
96
- }
97
- const RO = typeof ResizeObserver === 'function' ? new ResizeObserver((es) => { for (const e of es) { const w = e.contentRect.width; if (w) e.target.style.setProperty('--rp-scale', String(Math.round((w / W) * 10000) / 10000)); } }) : null;
98
- /** Scale a card's 1280 x 720 frame to the card's width (as slideCards does in report-slides.js). */
99
- export function fitCard(card) {
100
- if (RO) RO.observe(card);
101
- requestAnimationFrame(() => { const w = card.getBoundingClientRect().width; if (w) card.style.setProperty('--rp-scale', String(Math.round((w / W) * 10000) / 10000)); });
102
- return card;
103
- }
104
- /** One slide as a card. o = { cls, attrs, wire(doc), over: [nodes on top], focusable }. */
105
- export function slideCard(R, slide, o = {}) {
106
- const f = frame(R.style, slide.html, { title: 'Slide ' + slide.n + ': ' + slide.title, cls: 'pmos-one', onLoad: o.wire, focusable: o.focusable });
107
- return fitCard(el('div', { class: 'rd-card' + (o.cls ? ' ' + o.cls : ''), 'data-rd-card': slide.id, ...(o.attrs || {}) }, f, ...(o.over || [])));
108
- }
109
-
110
- /* ── the data attributes, wired from the page ── */
111
- const toggleMore = (m) => { if (m.tagName === 'DETAILS') m.open = !m.open; else if (m.hasAttribute('data-open')) m.removeAttribute('data-open'); else m.setAttribute('data-open', ''); };
112
- /** data-from: a "was <value>" note after each changed value while `on`. */
113
- export function showChanges(doc, on) {
114
- doc.querySelectorAll('[data-from]').forEach((n) => {
115
- n.classList.toggle('pmos-chg', !!on);
116
- const nx = n.nextElementSibling; const has = nx && nx.classList.contains('pmos-was');
117
- if (on && !has) { const w = doc.createElement('small'); w.className = 'pmos-was'; w.textContent = 'was ' + n.getAttribute('data-from'); n.after(w); }
118
- if (!on && has) nx.remove();
119
- });
120
- }
121
- /**
122
- * h = { place(e, doc) -> true when the click placed a marker, src(ref, node), initiative(id), value(text, node) / leave(), key(e), chg }.
123
- * Every interactive part gets a role and the keyboard; links never navigate.
124
- */
125
- export function wireFrame(doc, h) {
126
- const win = doc.defaultView; if (!win) return;
127
- doc.querySelectorAll('[data-src],[data-initiative],[data-more]').forEach((n) => { if (n.tagName !== 'DETAILS' && n.tagName !== 'SUMMARY') { if (!n.hasAttribute('tabindex')) n.setAttribute('tabindex', '0'); if (!n.hasAttribute('role')) n.setAttribute('role', 'button'); } });
128
- doc.querySelectorAll('[data-value]').forEach((n) => { if (!n.hasAttribute('tabindex')) n.setAttribute('tabindex', '0'); });
129
- const act = (e) => {
130
- const t = e.target && e.target.nodeType === 1 ? e.target : e.target && e.target.parentElement; if (!t) return;
131
- if (h.place && h.place(e, doc)) { e.preventDefault(); return; }
132
- if (t.closest('a')) e.preventDefault();
133
- const s = t.closest('[data-src]'); if (s) { e.preventDefault(); if (h.src) h.src(s.getAttribute('data-src'), s); return; }
134
- const i = t.closest('[data-initiative]'); if (i) { e.preventDefault(); if (h.initiative) h.initiative(i.getAttribute('data-initiative'), i); return; }
135
- const m = t.closest('[data-more]'); if (m && !t.closest('summary')) { e.preventDefault(); toggleMore(m); if (h.more) h.more(m); }
136
- else if (m && m.tagName === 'DETAILS' && h.more) setTimeout(() => h.more(m), 0);
137
- };
138
- doc.defaultView.addEventListener('click', act);
139
- win.addEventListener('keydown', (e) => {
140
- const t = e.target && e.target.closest ? e.target : null;
141
- if (t && (e.key === 'Enter' || e.key === ' ') && t.closest('[data-src],[data-initiative],[data-more]') && t.tagName !== 'SUMMARY') { act({ target: t, preventDefault: () => e.preventDefault(), clientX: 0, clientY: 0 }); e.preventDefault(); return; }
142
- if (h.key) h.key(e);
143
- });
144
- const hov = (e) => { const v = e.target && e.target.closest && e.target.closest('[data-value]'); if (v) { if (h.value) h.value(v.getAttribute('data-value'), v); } else if (h.leave) h.leave(); };
145
- win.addEventListener('mouseover', hov); win.addEventListener('focusin', hov);
146
- doc.documentElement.addEventListener('mouseleave', () => { if (h.leave) h.leave(); });
147
- if (h.touch) { win.addEventListener('touchstart', h.touch.start, { passive: true }); win.addEventListener('touchend', h.touch.end, { passive: true }); }
148
- showChanges(doc, !!h.chg);
149
- }
150
-
151
- /* ── pure ── */
152
- /** What changed from outline a to outline b: [text]. Outlines are [{ id, kind, title }]. */
153
- export function diffOutlines(a, b) {
154
- const A = a || []; const B = b || []; const out = [];
155
- const ia = new Map(A.map((s, i) => [s.id, i]));
156
- for (const [i, s] of B.entries()) {
157
- if (!ia.has(s.id)) { out.push('Added: ' + s.title + ' (slide ' + (i + 1) + ')'); continue; }
158
- const p = A[ia.get(s.id)];
159
- if (p.kind !== s.kind) out.push(s.title + ': ' + (p.kind || 'plain') + ' became ' + (s.kind || 'plain'));
160
- if (p.title !== s.title) out.push('Renamed: ' + p.title + ' is now ' + s.title);
161
- }
162
- for (const s of A) if (!B.some((x) => x.id === s.id)) out.push('Removed: ' + s.title);
163
- const common = B.filter((s) => ia.has(s.id)).map((s) => s.id); const was = A.filter((s) => common.includes(s.id)).map((s) => s.id);
164
- common.forEach((id, k) => { if (was[k] !== id) { const s = B.find((x) => x.id === id); const from = A.findIndex((x) => x.id === id) + 1; const to = B.findIndex((x) => x.id === id) + 1; if (from !== to && !out.some((t) => t.startsWith('Moved: ' + s.title))) out.push('Moved: ' + s.title + ' to slide ' + to + ', was slide ' + from); } });
165
- return out;
166
- }
167
- /** The print page: every slide of the render on its own 1280 x 720 page, in order. Nothing else: no speaker note, no pin, no page chrome. */
168
- export function printDeckHtml(R, o = {}) {
169
- const title = esc(o.title || 'Report');
170
- if (R.format !== 'deck') return frameDoc(R.style, R.body, 'pmos-print pmos-print-doc').replace('<head>', '<head><title>' + title + '</title>');
171
- return frameDoc(R.style, R.slides.map((s) => s.html).join(''), 'pmos-print pmos-print-deck').replace('<head>', '<head><title>' + title + '</title>');
172
- }
173
- /** Open the print page in a window and print it. False when the browser blocked the window. */
174
- export function printDeck(R, o) {
175
- const w = typeof window !== 'undefined' && window.open ? window.open('', '_blank') : null;
176
- if (!w) return false;
177
- w.document.open(); w.document.write(printDeckHtml(R, o)); w.document.close();
178
- w.focus(); setTimeout(() => { try { w.print(); } catch { /* the PM prints from the window */ } }, 300);
179
- return true;
180
- }
181
-
182
- /* open an initiative: the Initiatives page, on the initiative (c3-initiatives.js reads pmos:ini-go) */
183
- export function openInitiative(id) {
184
- try { window.dispatchEvent(new CustomEvent('pmos:go-tab', { detail: { tab: 'init' } })); window.dispatchEvent(new CustomEvent('pmos:ini-go', { detail: { id } })); } catch { /* no events */ }
185
- }
186
- const SRC_WORD = { jira: 'Jira', initiative: 'PMOS initiative', ini: 'PMOS initiative', commit: 'Commit', doc: 'Document', metric: 'Metric', release: 'Release', dashboard: 'Dashboard', confluence: 'Confluence', section: 'Section of the document' };
187
- export function srcParts(ref) { const s = String(ref || ''); const k = s.indexOf(':'); const kind = k > 0 ? s.slice(0, k) : 'source'; return { kind, id: k > 0 ? s.slice(k + 1) : s, word: SRC_WORD[kind.toLowerCase()] || kind.charAt(0).toUpperCase() + kind.slice(1) }; }
188
-
189
- /* ── the deck in the Read tab ── */
190
- const CAPS = [['eye', 'Hover a value for its detail'], ['org', 'Click a number or status for its source'], ['plus', 'Expand the details'], ['init', 'Live link to each initiative'], ['notes', 'Notes on the slide'], ['mic', 'Presenter view with your notes']];
191
- const KIND_WORD = (k) => (k ? String(k).replace(/[-_]/g, ' ').replace(/^./, (c) => c.toUpperCase()) : 'Slide');
192
- const hintOf = (k) => (/headline|metric|kpi/.test(k) ? 'Hover a value for its detail. Click a number to see its source.' : /list|table/.test(k) ? 'Click a status to see where it comes from, or an initiative to open it.'
193
- : /init/.test(k) ? 'Click the status for its source, or the live link for the initiative today. A long column folds into "more".' : /roadmap/.test(k) ? 'Hover a bar for its stage and dates.'
194
- : /release|ship/.test(k) ? 'Click a release type to see its commit or ticket.' : /risk|need/.test(k) ? 'Hover a risk for its impact.' : 'The words come from the document. Change them in the Edit tab; the deck redraws.');
195
-
196
- export function createDeck(o) {
197
- ensureDeckCss();
198
- const { ws, path } = o;
199
- const S = { loaded: false, cyc: null, R: null, prev: null, prevR: null, notes: { speaker: {}, suggestions: {}, pins: [] }, cur: 0, mode: 'deck', pins: true, open: null, src: null, placing: false, draft: null, chg: false, err: '', timer: null, api: null, spkT: {} };
200
- const root = el('div', { class: 'rd-dk', 'data-rd-deck': path });
201
- const redraw = () => { if (S.api && S.api.redraw) S.api.redraw(); };
202
-
203
- /* A read that changed nothing draws nothing: while the cycle is redrawn the deck is read every 2 seconds, and a redraw loads every frame
204
- * again, so the slides flickered. */
205
- async function load() {
206
- const c = await RD.cycle(ws, path);
207
- if (!c || c.ok === false) { S.loaded = true; S.cyc = null; S.err = (c && c.error) || ''; S.seen = null; redraw(); return; }
208
- S.cyc = c; const seen = [c];
209
- if (c.designed) {
210
- try { const h = await RD.cycleHtml(ws, path); seen.push(h); S.R = splitRender(h); } catch (e) { S.err = (e && e.message) || 'the render could not be read'; S.R = null; }
211
- const n = await RD.notes(ws, path); seen.push(n); if (n && n.ok !== false) S.notes = { speaker: n.speaker || {}, suggestions: n.suggestions || {}, pins: n.pins || [] };
212
- if (c.previous && c.previous.path) {
213
- const pc = await RD.cycle(ws, c.previous.path); seen.push(pc);
214
- if (pc && pc.ok !== false && pc.designed) { S.prev = { ...pc, ...c.previous }; try { const h = await RD.cycleHtml(ws, c.previous.path); seen.push(h); S.prevR = splitRender(h); } catch { S.prevR = null; } }
215
- }
216
- }
217
- S.loaded = true; S.cur = Math.min(S.cur, Math.max(0, count() - 1));
218
- if (c.rendering) poll();
219
- const sig = JSON.stringify(seen) + S.err;
220
- if (sig === S.seen) return;
221
- S.seen = sig; redraw();
222
- }
223
- function poll() { clearTimeout(S.timer); S.timer = setTimeout(async () => { if (!root.isConnected && !OV) return; await load(); }, 2000); }
224
- const count = () => (S.R ? (S.R.format === 'deck' ? S.R.slides.length : S.R.secs.length) : 0);
225
- const slides = () => (S.R ? S.R.slides : []);
226
- const isDeck = () => !!S.R && S.R.format === 'deck';
227
- const prevWord = () => (S.cyc && S.cyc.previous ? slotWord(S.cyc.previous.slot) : 'the last cycle');
228
- const live = () => S.notes.pins.filter((p) => p.state !== 'dismissed');
229
- const pinsOf = (id) => live().filter((p) => p.slide === id);
230
- const numOf = (p) => live().indexOf(p) + 1;
231
- const curSlide = () => slides()[S.cur] || null;
232
-
233
- /* ── interactions inside a frame ── */
234
- const hands = (card, slide, extra) => ({
235
- chg: S.chg,
236
- src: (ref, n) => { S.src = { ref, label: (n.textContent || '').trim().slice(0, 60), detail: n.getAttribute('data-value') || '' }; S.open = null; paint(); const c = root.querySelector('[data-rd-src]'); if (c) c.scrollIntoView({ block: 'nearest' }); },
237
- initiative: (id) => { S.src = { ref: 'initiative:' + id, label: id, detail: '', ini: id }; S.open = null; paint(); },
238
- value: (text, n) => tipAt(card, n, text),
239
- leave: () => tipOff(card),
240
- place: (e, doc) => {
241
- if (!S.placing || !slide) return false;
242
- const box = slide.box ? slide.box(e, doc) : { x: e.clientX / W * 100, y: e.clientY / H * 100, id: slide.id };
243
- if (!box) return false;
244
- S.draft = { slide: box.id, x: Math.round(box.x), y: Math.round(box.y) }; S.placing = false; paint();
245
- const i = root.querySelector('[data-rd-pindraft]'); if (i) i.focus();
246
- return true;
247
- },
248
- ...(extra || {}),
249
- });
250
- function tipAt(card, n, text) {
251
- const t = card && card.querySelector('.rd-tip'); if (!t) return;
252
- const k = Number(getComputedStyle(card).getPropertyValue('--rp-scale')) || 1; const r = n.getBoundingClientRect();
253
- t.textContent = text; t.hidden = false;
254
- t.style.setProperty('--rp-x', Math.round((r.left + r.width / 2) * k) + 'px'); t.style.setProperty('--rp-y', Math.round(r.top * k) + 'px');
255
- }
256
- const tipOff = (card) => { const t = card && card.querySelector('.rd-tip'); if (t) t.hidden = true; };
257
-
258
- /* ── parts ── */
259
- function bar() {
260
- const c = S.cyc; const v = c.design_version;
261
- return el('div', { class: 'rd-dk-bar' },
262
- el('div', { class: 'chips2 rd-wrap' }, lk({ 'data-rd-act': 'brief', title: 'The design of this report', onclick: () => o.onBrief && o.onBrief() }, icon('spark', 'sm'), 'Design D' + v),
263
- chip(icon('doc', 'sm'), count() + (isDeck() ? (count() === 1 ? ' slide' : ' slides') : (count() === 1 ? ' section' : ' sections'))),
264
- matchChip(),
265
- isDeck() && S.prevR ? el('div', { class: 'seg', role: 'group', 'aria-label': 'Deck view' },
266
- btn({ 'data-rd-act': 'mode', 'data-v': 'deck', 'aria-pressed': String(S.mode === 'deck'), onclick: () => { S.mode = 'deck'; paint(); } }, 'Deck'),
267
- btn({ 'data-rd-act': 'mode', 'data-v': 'cmp', 'aria-pressed': String(S.mode === 'cmp'), onclick: () => { S.mode = 'cmp'; paint(); } }, 'Side by side with ' + prevWord())) : null),
268
- el('div', { class: 'chips2 rd-wrap' },
269
- isDeck() ? pbtn('primary', 'Present', 'play', { 'data-rd-act': 'present', onclick: () => present('pres') }) : null,
270
- isDeck() ? pbtn('outline', 'Audience view', 'eye', { 'data-rd-act': 'audience', onclick: () => audienceView() }) : null,
271
- pbtn('outline', 'Refine the design', 'spark', { 'data-rd-act': 'studio', onclick: () => o.onStudio && o.onStudio() }),
272
- pbtn('ghost', 'Print / PDF', 'pdf', { 'data-rd-act': 'print', onclick: () => doPrint() }),
273
- isDeck() ? pbtn('ghost', 'Download .pptx', 'drop', { 'data-rd-act': 'pptx', onclick: () => S.api && S.api.download && S.api.download('pptx') }) : null));
274
- }
275
- function matchChip() {
276
- const c = S.cyc;
277
- if (c.rendering) return el('span', { class: 'chip2', 'data-rd-match': 'rendering' }, icon('clock', 'sm'), 'Drawing to match the design');
278
- if (c.matches) return el('span', { class: 'chip2 ds-good', 'data-rd-match': 'yes' }, icon('check', 'sm'), 'Matches the design');
279
- const open = openDiffs();
280
- return open.length ? el('span', { class: 'chip2 ds-warn', 'data-rd-match': 'no' }, icon('alert', 'sm'), open.length + (open.length === 1 ? ' difference' : ' differences') + ' from the design')
281
- : el('span', { class: 'chip2 ds-good', 'data-rd-match': 'kept' }, icon('check', 'sm'), 'Kept for this cycle');
282
- }
283
- const openDiffs = () => (S.cyc.differences || []).filter((d) => !(S.cyc.decisions || []).some((x) => x.diff === d.id));
284
- function caps() {
285
- return el('div', { class: 'rd-dk-caps', 'aria-label': 'What this ' + (isDeck() ? 'deck' : 'document') + ' can do', 'data-rd-caps': '' }, el('span', { class: 'dim mono' }, isDeck() ? 'MORE THAN SLIDES' : 'MORE THAN A PAGE'),
286
- CAPS.filter(([ic]) => isDeck() || ic !== 'mic').map(([ic, t]) => chip(icon(ic, 'sm'), isDeck() ? t : t.replace('the slide', 'the document'))),
287
- S.cyc.previous ? lk({ 'data-rd-act': 'chg', 'aria-pressed': String(S.chg), class: S.chg ? 'rd-on' : '', onclick: () => { S.chg = !S.chg; paint(); } }, icon('undo', 'sm'), (S.chg ? 'Hide' : 'Show') + ' what changed since ' + prevWord()) : null);
288
- }
289
- function rbar() {
290
- const tg = (id, label, on, set) => el('label', { class: 'ds-tg' }, el('input', { type: 'checkbox', checked: on, 'data-rd-ck': id, onChange: (e) => set(e.target.checked) }), label);
291
- return el('div', { class: 'ds-rbar' }, el('span', { class: 'ds-acts' }, tg('pins', 'Show notes on the ' + (isDeck() ? 'slide' : 'document'), S.pins, (v) => { S.pins = v; paint(); }), tg('src', 'Markdown source', false, (v) => { if (v && S.api && S.api.setSrc) S.api.setSrc(true); })),
292
- el('span', { class: 'dim mono rd-small' }, 'Present, print and download stay on this device. Nothing is sent.'));
293
- }
294
- function copyNotice() {
295
- if (o.output !== 'google-slides') return null;
296
- return el('div', { class: 'fold', 'data-rd-copynote': '' }, icon('info', 'sm'), ' The deck now lives in PMOS. The Google Slides copy of this report is optional. ', lk({ onclick: () => S.api && S.api.toggleCopies && S.api.toggleCopies() }, 'Copies in other tools'));
297
- }
298
- function diffBox() {
299
- const c = S.cyc; if (c.rendering) return el('div', { class: 'fold a', role: 'status', 'data-rd-rendering': '' }, icon('clock', 'sm'), ' PMOS is drawing this cycle again to match the design. You can leave this page.');
300
- const D = c.differences || []; if (!D.length) return null;
301
- const open = openDiffs();
302
- const kept = D.filter((d) => (c.decisions || []).some((x) => x.diff === d.id && x.choice === 'keep'));
303
- if (!open.length) return kept.length ? el('div', { class: 'fold', 'data-rd-kept': '' }, icon('check', 'sm'), ' Kept for this cycle: ' + kept.map((d) => d.what).join(' ') + ' The design stays as it is.') : null;
304
- const frozen = o.state && o.state() === 'issued';
305
- return el('section', { class: 'ds-stale rd-dk-diff', 'aria-label': 'Differs from the design', 'data-rd-diff': '' }, el('div', { class: 't' }, icon('alert', 'sm'), 'Differs from the design'),
306
- open.map((d) => el('div', { class: 'rd-stack', 'data-rd-diffrow': d.id }, el('p', null, d.what),
307
- frozen ? el('p', { class: 'dim' }, 'This cycle is issued, so it stays as it was drawn.') : el('div', { class: 'ds-acts' },
308
- btn({ class: 'ds-btn', 'data-rd-decide': 'keep', onclick: () => decide(d, 'keep') }, 'Keep for this cycle'),
309
- btn({ class: 'ds-btn ag', 'data-rd-decide': 'adopt', onclick: () => decide(d, 'adopt') }, icon('spark', 'sm'), 'Make it part of the design'),
310
- btn({ class: 'ds-btn', 'data-rd-decide': 'match', onclick: () => decide(d, 'match') }, 'Match the design'),
311
- d.slide && slides().some((s) => s.id === d.slide) ? lk({ 'data-rd-act': 'showslide', onclick: () => { S.mode = 'deck'; go(slides().findIndex((s) => s.id === d.slide)); } }, 'Show the slide') : null))));
312
- }
313
- async function decide(d, choice) {
314
- const r = await RD.decide({ ws, path, diff: d.id, choice });
315
- if (!r || !r.ok) { failed(r, 'It was not recorded'); return; }
316
- toast(choice === 'keep' ? 'Kept for this cycle. The design stays as it is. It is in the Edit log.' : choice === 'adopt' ? 'Added to the design as a new version. Every next cycle follows it.' : 'PMOS draws this cycle again to match the design. It is in the Edit log.');
317
- await load();
318
- }
319
- function thumbs(cur, horiz, onPick) {
320
- return el('nav', { class: 'rd-dk-strip' + (horiz ? ' h' : ''), 'aria-label': 'Slides', 'data-rd-strip': '' }, slides().map((s, i) => {
321
- const np = pinsOf(s.id).length;
322
- return btn({ class: 'rd-dk-th', 'aria-current': String(cur === i), 'aria-label': 'Slide ' + s.n + ': ' + s.title, 'data-rd-go': String(i), onclick: () => onPick(i) },
323
- el('div', { inert: '' }, slideCard(S.R, s, { cls: 'rd-thumb' })), el('span', { class: 'rd-dk-thn' }, String(s.n)),
324
- np && !onPick.studio ? el('span', { class: 'rd-dk-thp', title: np + ' notes on the slide' }, icon('notes', 'sm'), String(np)) : null);
325
- }));
326
- }
327
- function go(i) { if (i < 0 || i >= count()) return; S.cur = i; S.src = null; S.open = null; S.draft = null; S.placing = false; paint(); }
328
- function pinLayer(id) {
329
- if (!S.pins) return [];
330
- const L = pinsOf(id).map((p) => { const b = btn({ class: 'rd-pindot ' + (p.by === 'pmos' ? 'a' : 'h') + (p.state === 'open' && p.by === 'pmos' ? ' prop' : '') + (S.open === p.id ? ' on' : ''), 'data-rd-pin': p.id, 'aria-label': 'Note ' + numOf(p) + ': ' + p.text, onclick: () => { S.open = S.open === p.id ? null : p.id; S.src = null; paint(); } }, String(numOf(p)));
331
- b.style.setProperty('--rp-x', p.x + '%'); b.style.setProperty('--rp-y', p.y + '%'); return b; });
332
- if (S.draft && S.draft.slide === id) { const d = el('span', { class: 'rd-pindot h on', 'aria-hidden': 'true' }, String(live().length + 1)); d.style.setProperty('--rp-x', S.draft.x + '%'); d.style.setProperty('--rp-y', S.draft.y + '%'); L.push(d); }
333
- return L;
334
- }
335
- function cap(s) {
336
- const frozen = o.state && o.state() === 'issued';
337
- return [el('div', { class: 'rd-dk-cap' }, el('span', { class: 'chips2 rd-wrap' }, el('b', { 'data-rd-cap': '' }, 'Slide ' + s.n + ' of ' + count()), chip(icon('img', 'sm'), KIND_WORD(s.kind)), chip(icon('doc', 'sm'), s.title)),
338
- el('span', { class: 'chips2' }, s.section && !frozen ? pbtn('ghost', 'Edit the words', 'edit', { 'data-rd-act': 'editwords', onclick: () => S.api && S.api.editAt && S.api.editAt(s.section) }) : null,
339
- btn({ class: 'ib sm', 'aria-label': 'Previous slide', 'data-rd-act': 'prev', disabled: S.cur === 0, onclick: () => go(S.cur - 1) }, icon('prev', 'sm')),
340
- btn({ class: 'ib sm', 'aria-label': 'Next slide', 'data-rd-act': 'next', disabled: S.cur >= count() - 1, onclick: () => go(S.cur + 1) }, icon('next', 'sm')))),
341
- el('div', { class: 'dim rd-small' }, hintOf(s.kind))];
342
- }
343
- function speaker(s) {
344
- const n = S.notes.speaker[s.id]; const sug = !n && S.notes.suggestions[s.id] ? S.notes.suggestions[s.id] : null;
345
- const from = sug ? slotWord(sug.from_slot) : '';
346
- const ta = el('textarea', { class: 'rd-spk', 'data-rd-spk': s.id, 'aria-label': 'Speaker notes for slide ' + s.n, placeholder: sug ? 'Keep the note from ' + from + ', or write a new one.' : 'What you want to say on this slide. Only you see it, in the presenter view.',
347
- onInput: (e) => { clearTimeout(S.spkT[s.id]); const v = e.target.value; S.spkT[s.id] = setTimeout(() => saveSpk(s.id, v), 700); }, onBlur: (e) => { clearTimeout(S.spkT[s.id]); if ((S.notes.speaker[s.id] || { text: '' }).text !== e.target.value) saveSpk(s.id, e.target.value); } });
348
- ta.value = n ? n.text : '';
349
- return sect({ ic: 'mic', title: 'Speaker notes', right: el('span', { class: 'tag' }, 'Private'), attrs: { 'data-rd-spksec': s.id } },
350
- sug ? el('div', { class: 'rd-carry', 'data-rd-carry': s.id }, el('span', { class: 'dim mono rd-small' }, 'FROM ' + from.toUpperCase() + ', SAME SLIDE'), el('p', null, sug.text),
351
- el('span', { class: 'ds-acts' }, btn({ class: 'ds-btn', 'data-rd-act': 'keep', onclick: () => keepSpk(s.id) }, icon('check', 'sm'), 'Keep'), btn({ class: 'ds-btn', 'data-rd-act': 'clear', onclick: () => clearSpk(s.id) }, icon('x', 'sm'), 'Clear'))) : null,
352
- ta, el('div', { class: 'dim rd-small' }, icon('lock', 'sm'), ' Only you see speaker notes. They are not on the slide, the PDF or the .pptx.'));
353
- }
354
- async function saveSpk(id, text) {
355
- const r = await RD.speaker({ ws, path, slide: id, text });
356
- if (!r || !r.ok) { failed(r, 'The speaker note was not saved'); return; }
357
- S.notes.speaker[id] = { text, at: new Date().toISOString() };
358
- const sv = root.querySelector('[data-rd-spksaved]'); if (sv) sv.textContent = 'Saved';
359
- }
360
- async function keepSpk(id) {
361
- const r = await RD.speaker({ ws, path, slide: id, keep: true }); if (!r || !r.ok) { failed(r, 'The note was not kept'); return; }
362
- S.notes.speaker[id] = { text: S.notes.suggestions[id].text, at: new Date().toISOString() }; paint(); toast('Kept the speaker note. Change it if you like.');
363
- }
364
- async function clearSpk(id) {
365
- const r = await RD.speaker({ ws, path, slide: id, text: '' }); if (!r || !r.ok) { failed(r, 'The note was not cleared'); return; }
366
- S.notes.speaker[id] = { text: '', at: new Date().toISOString() }; paint();
367
- }
368
- function srcCard() {
369
- if (!S.src) return null;
370
- const p = srcParts(S.src.ref); const ini = S.src.ini || (/^(ini|initiative)$/i.test(p.kind) ? p.id : null);
371
- return el('section', { class: 'ds-sync', 'aria-label': 'Source', 'data-rd-src': S.src.ref }, el('div', { class: 'hd' }, el('b', null, icon(ini ? 'init' : 'org', 'sm'), ' Where "' + (S.src.label || p.id) + '" comes from'),
372
- btn({ class: 'ib sm', 'aria-label': 'Close', onclick: () => { S.src = null; paint(); } }, icon('x', 'sm'))),
373
- el('ul', null, el('li', null, el('div', { class: 'l1' }, icon(ini ? 'init' : 'org', 'sm'), el('b', null, p.word + ': ' + p.id)),
374
- el('p', null, S.src.detail || (ini ? 'The slide shows the figures of this cycle. The initiative in PMOS shows them as they are today.' : 'The render names this source. PMOS read it when it drafted this cycle.')),
375
- ini ? el('div', { class: 'ds-acts' }, btn({ class: 'ds-btn', 'data-rd-act': 'openini', onclick: () => openInitiative(ini) }, icon('out', 'sm'), 'Open the initiative')) : null)));
376
- }
377
- function notesSect(s) {
378
- const id = s.id; const ps = pinsOf(id); const frozen = o.state && o.state() === 'issued';
379
- const row = (p) => el('li', { class: 'rd-note' + (S.open === p.id ? ' on' : ''), 'data-rd-pinrow': p.id },
380
- btn({ class: 'rd-pindot ' + (p.by === 'pmos' ? 'a' : 'h') + (p.state === 'open' && p.by === 'pmos' ? ' prop' : ''), 'aria-label': 'Note ' + numOf(p), onclick: () => { S.open = S.open === p.id ? null : p.id; paint(); } }, String(numOf(p))),
381
- el('div', { class: 'ds-le' }, el('div', { class: 'l1' }, el('b', null, p.by === 'pmos' ? 'PMOS' : 'You'), el('span', { class: 'when' }, dayAt(p.at))),
382
- p.by === 'pmos' && p.state === 'open' ? el('div', { class: 'who' }, el('span', { class: 'ds-ag' }, 'Proposed by PMOS')) : null,
383
- S.open === p.id ? [S.editPin === p.id ? el('div', { class: 'ds-whyadd' }, el('input', { type: 'text', 'data-rd-pinedit': p.id, value: p.text, 'aria-label': 'Edit the note' }),
384
- btn({ class: 'ds-btn pri', onclick: () => { const i = root.querySelector('[data-rd-pinedit]'); pinOp('edit', p, i && i.value.trim()); } }, 'Save'), btn({ class: 'ds-btn', onclick: () => { S.editPin = null; paint(); } }, 'Cancel'))
385
- : el('p', { class: 'why' }, p.text),
386
- el('div', { class: 'ds-acts' }, p.by === 'pmos' && p.state === 'open' ? [btn({ class: 'ds-btn pri', 'data-rd-pinact': 'keep', onclick: () => pinOp('keep', p) }, icon('check', 'sm'), 'Keep the note'), btn({ class: 'ds-btn', 'data-rd-pinact': 'dismiss', onclick: () => pinOp('dismiss', p) }, icon('x', 'sm'), 'Dismiss')]
387
- : [btn({ class: 'ds-btn', 'data-rd-pinact': 'edit', onclick: () => { S.editPin = p.id; paint(); } }, icon('edit', 'sm'), 'Change the note'), btn({ class: 'ds-btn', 'data-rd-pinact': 'remove', onclick: () => pinOp('remove', p) }, icon('trash', 'sm'), 'Remove')],
388
- (p.section || s.section) && !frozen ? btn({ class: 'ds-btn ag', 'data-rd-pinact': 'editthis', onclick: () => S.api && S.api.editAt && S.api.editAt(p.section || s.section) }, icon('edit', 'sm'), 'Edit this') : null)] : el('p', { class: 'why rd-clip' }, p.text)));
389
- const draft = S.draft && S.draft.slide === id ? el('div', { class: 'ds-whyadd' }, el('input', { type: 'text', 'data-rd-pindraft': '', placeholder: 'Your note. Readers of the report see it.', 'aria-label': 'Note on the slide', onKeyDown: (e) => { if (e.key === 'Enter') savePin(); } }),
390
- btn({ class: 'ds-btn pri', 'data-rd-act': 'pinsave', onclick: () => savePin() }, 'Pin it'), btn({ class: 'ds-btn', 'data-rd-act': 'pincancel', onclick: () => { S.draft = null; paint(); } }, 'Cancel')) : null;
391
- const add = S.placing ? el('div', { class: 'fold a', role: 'status', 'data-rd-placing': '' }, icon('notes', 'sm'), ' Click the spot on the ' + (isDeck() ? 'slide' : 'document') + ' where the note goes. ', lk({ onclick: () => { S.placing = false; paint(); } }, 'Cancel'))
392
- : el('div', { class: 'ds-acts' }, btn({ class: 'ds-btn', 'data-rd-act': 'place', onclick: () => { S.placing = true; S.draft = null; S.pins = true; paint(); } }, icon('plus', 'sm'), 'Add a note on the ' + (isDeck() ? 'slide' : 'document')));
393
- return sect({ ic: 'notes', title: 'Notes on the ' + (isDeck() ? 'slide' : 'document'), count: ps.length, right: el('span', { class: 'tag acc' }, 'Readers see them'), attrs: { 'data-rd-notes': id } },
394
- ps.length ? el('ul', { class: 'ds-log rd-notes' }, ps.map(row)) : el('div', { class: 'fold' }, icon('info', 'sm'), 'No notes here.'), draft || add,
395
- el('div', { class: 'dim rd-small' }, 'Readers see these notes. They do not change the words: to change the words, use Edit this. Each note is in the Edit log.'));
396
- }
397
- async function savePin() {
398
- const i = root.querySelector('[data-rd-pindraft]'); const text = i && i.value.trim(); if (!text) { if (i) i.focus(); return; }
399
- const d = S.draft; const r = await RD.pin({ ws, path, op: 'add', slide: d.slide, x: d.x, y: d.y, text });
400
- if (!r || !r.ok) { failed(r, 'The note was not pinned'); return; }
401
- S.draft = null; await reloadNotes(); const p = (r.pin && r.pin.id) || (live().slice(-1)[0] || {}).id; S.open = p || null; paint();
402
- toast('Pinned. Readers see it. It is in the Edit log.');
403
- }
404
- async function pinOp(op, p, text) {
405
- if (op === 'edit' && !text) return;
406
- const r = await RD.pin({ ws, path, op, id: p.id, slide: p.slide, x: p.x, y: p.y, text: op === 'edit' ? text : p.text });
407
- if (!r || !r.ok) { failed(r, 'The note was not changed'); return; }
408
- S.editPin = null; if (op === 'remove' || op === 'dismiss') S.open = null;
409
- await reloadNotes(); paint();
410
- toast(op === 'keep' ? 'Kept. Readers see the note.' : op === 'dismiss' ? 'Dismissed. It stays in the Edit log.' : op === 'remove' ? 'Removed. It stays in the Edit log.' : 'Changed. It is in the Edit log.');
411
- }
412
- async function reloadNotes() { const n = await RD.notes(ws, path); if (n && n.ok !== false) S.notes = { speaker: n.speaker || {}, suggestions: n.suggestions || {}, pins: n.pins || [] }; if (S.api && S.api.logChanged) S.api.logChanged(); }
413
-
414
- /* ── the views ── */
415
- function deckMain() {
416
- const s = curSlide(); if (!s) return el('div', { class: 'fold w' }, icon('alert', 'sm'), 'The render has no slide.');
417
- const big = slideCard(S.R, s, { cls: 'rd-big' + (S.placing ? ' placing' : ''), attrs: { 'data-rd-big': s.id }, focusable: true, over: [...pinLayer(s.id), el('span', { class: 'rd-tip', hidden: true, role: 'tooltip' })],
418
- wire: (doc) => wireFrame(doc, hands(big, s, { key: stageKey })) });
419
- return el('div', { class: 'rd-dk-main' }, thumbs(S.cur, false, go), el('div', { class: 'rd-dk-stage' }, ...cap(s), big,
420
- el('div', { class: 'rd-dk-under' }, speaker(s), el('div', { class: 'rd-dk-ncol' }, srcCard(), notesSect(s)))));
421
- }
422
- function stageKey(e) { if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); go(S.cur + 1); } else if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); go(S.cur - 1); } }
423
- function cmpMain() {
424
- const s = curSlide(); if (!s) return null;
425
- const ps = S.prevR ? S.prevR.slides.find((x) => x.id === s.id) : null;
426
- const was = []; const tmp = new DOMParser().parseFromString(s.html, 'text/html');
427
- tmp.querySelectorAll('[data-from]').forEach((n) => was.push((n.textContent || '').trim() + ', was ' + n.getAttribute('data-from')));
428
- const diff = ps ? (was.length ? was : ['The same words and numbers as ' + prevWord() + '.']) : ['This slide is new this cycle. ' + (openDiffs().length ? 'It is what differs from the design.' : '')];
429
- /* each column says how its cycle stands against the design (#deck-cycles) */
430
- const prevChip = () => { const pc = S.prev || {}; const n = (pc.differences || []).filter((d) => !(pc.decisions || []).some((x) => x.diff === d.id)).length;
431
- return pc.matches || !n ? el('span', { class: 'chip2 ds-good' }, icon('check', 'sm'), pc.matches ? 'Matches the design' : 'Kept for that cycle') : el('span', { class: 'chip2 ds-warn' }, icon('alert', 'sm'), n + (n === 1 ? ' difference' : ' differences') + ' from the design'); };
432
- const col = (label, state, R, sl, chip) => el('div', { class: 'rd-cmpc' }, el('div', { class: 'chips2 rd-cmph' }, el('b', null, label), el('span', { class: 'tag ' + (state === 'issued' ? 'ok' : 'acc') }, state === 'issued' ? 'Issued' : 'Draft'), chip),
433
- sl ? slideCard(R, sl, { wire: (doc) => showChanges(doc, R === S.R && S.chg) }) : el('div', { class: 'fold rd-none' }, icon('info', 'sm'), ' ' + label + ' has no slide "' + s.title + '".'));
434
- return [el('div', { class: 'rd-dk-cap' }, el('span', { class: 'chips2 rd-wrap' }, el('b', null, 'Slide ' + s.n + ' of ' + count() + ': ' + s.title), el('span', { class: 'tag ok' }, 'Same design, D' + S.cyc.design_version)),
435
- el('span', { class: 'chips2' }, btn({ class: 'ib sm', 'aria-label': 'Previous slide', disabled: S.cur === 0, onclick: () => go(S.cur - 1) }, icon('prev', 'sm')), btn({ class: 'ib sm', 'aria-label': 'Next slide', disabled: S.cur >= count() - 1, onclick: () => go(S.cur + 1) }, icon('next', 'sm')))),
436
- el('div', { class: 'rd-cmpg', 'data-rd-cmp': '' }, col(prevWord(), S.prev && S.prev.state ? S.prev.state : 'issued', S.prevR, ps, prevChip()), col(slotWord(o.slot) || 'This cycle', o.state ? o.state() : 'draft', S.R, s, matchChip())),
437
- sect({ ic: 'cols', title: 'What differs on this slide', count: diff.length }, el('ul', { class: 'chgl' }, diff.map((t) => el('li', null, icon('edit', 'sm'), el('span', null, t), el('span')))),
438
- el('div', { class: 'dim rd-small' }, 'Both cycles were drafted to match the saved design. Only the numbers and the words change, unless PMOS tells you something differs.')),
439
- thumbs(S.cur, true, go)];
440
- }
441
- function docMain() {
442
- const R = S.R; const card = el('div', { class: 'rd-docf' + (S.placing ? ' placing' : ''), 'data-rd-big': 'doc' });
443
- const layer = el('div', { class: 'rd-doclayer' }); const tip = el('span', { class: 'rd-tip', hidden: true, role: 'tooltip' });
444
- const box = (e, doc) => { const sec = e.target.closest && e.target.closest('section.pmos-sec'); if (!sec) return null; const r = sec.getBoundingClientRect(); return { id: sec.getAttribute('data-sec-id'), x: (e.clientX - r.left) / r.width * 100, y: (e.clientY - r.top) / r.height * 100 }; };
445
- const f = frame(R.style, R.body, { title: 'The document', cls: 'pmos-doc', focusable: true, onLoad: (doc, fr) => {
446
- const fit = () => { fr.style.setProperty('--rp-h', Math.max(200, doc.documentElement.scrollHeight) + 'px'); placeDocPins(doc, layer); };
447
- fit(); setTimeout(fit, 120);
448
- wireFrame(doc, { ...hands(card, { id: 'doc', box }), value: (t, n) => { tip.textContent = t; tip.hidden = false; const r = n.getBoundingClientRect(); tip.style.setProperty('--rp-x', Math.round(r.left + r.width / 2) + 'px'); tip.style.setProperty('--rp-y', Math.round(r.top) + 'px'); }, leave: () => { tip.hidden = true; }, more: () => fit() });
449
- } });
450
- card.append(f, layer, tip);
451
- const all = live(); const secOf = (id) => R.secs.find((x) => x.id === id) || { id, title: id, section: '' };
452
- const sec = S.open ? secOf((all.find((p) => p.id === S.open) || {}).slide) : (S.draft ? secOf(S.draft.slide) : { id: '__all', title: 'the document', section: '' });
453
- return el('div', { class: 'rd-dk-stage' }, card, el('div', { class: 'rd-dk-under' }, el('div', { class: 'rd-dk-ncol' }, srcCard()), el('div', { class: 'rd-dk-ncol' }, notesSect({ ...sec, id: sec.id }))));
454
- }
455
- function placeDocPins(doc, layer) {
456
- const L = [];
457
- if (S.pins) {
458
- for (const p of live()) {
459
- const sec = doc.querySelector('section.pmos-sec[data-sec-id="' + String(p.slide).replace(/"/g, '') + '"]'); if (!sec) continue;
460
- const r = sec.getBoundingClientRect(); const b = btn({ class: 'rd-pindot ' + (p.by === 'pmos' ? 'a' : 'h') + (p.state === 'open' && p.by === 'pmos' ? ' prop' : '') + (S.open === p.id ? ' on' : ''), 'data-rd-pin': p.id, 'aria-label': 'Note ' + numOf(p) + ': ' + p.text, onclick: () => { S.open = S.open === p.id ? null : p.id; paint(); } }, String(numOf(p)));
461
- b.style.setProperty('--rp-x', Math.round(r.left + r.width * p.x / 100) + 'px'); b.style.setProperty('--rp-y', Math.round(r.top + r.height * p.y / 100) + 'px'); L.push(b);
462
- }
463
- if (S.draft) { const sec = doc.querySelector('section.pmos-sec[data-sec-id="' + String(S.draft.slide).replace(/"/g, '') + '"]'); if (sec) { const r = sec.getBoundingClientRect(); const d = el('span', { class: 'rd-pindot h on', 'aria-hidden': 'true' }, String(live().length + 1)); d.style.setProperty('--rp-x', Math.round(r.left + r.width * S.draft.x / 100) + 'px'); d.style.setProperty('--rp-y', Math.round(r.top + r.height * S.draft.y / 100) + 'px'); L.push(d); } }
464
- }
465
- put(layer, ...L);
466
- }
467
- /* pins in a document are keyed by section: a pin's section box is the box its x and y are read in */
468
- function paint() {
469
- if (!S.loaded || !S.cyc || !S.cyc.designed) { put(root); return; }
470
- if (!S.R) { put(root, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), ' The render of this cycle could not be read: ' + (S.err || 'no answer') + '.')); return; }
471
- const y = scroller() ? scroller().scrollTop : 0;
472
- put(root, bar(), caps(), rbar(), copyNotice(), diffBox(), isDeck() ? (S.mode === 'cmp' && S.prevR ? cmpMain() : deckMain()) : docMain());
473
- const sc = scroller(); if (sc) sc.scrollTop = y;
474
- root.querySelectorAll('.rd-dk-th[aria-current="true"]').forEach((th) => { const st = th.parentNode; if (st.scrollHeight > st.clientHeight + 4) st.scrollTop = Math.max(0, th.offsetTop - st.offsetTop - 8); if (st.scrollWidth > st.clientWidth + 4) st.scrollLeft = Math.max(0, th.offsetLeft - st.offsetLeft - 8); });
475
- }
476
- const scroller = () => root.closest('.sb');
477
- const dayAt = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(String(iso || '')); return m ? slotWord(m[1] + '-' + m[2] + '-' + m[3]) + ', ' + m[4] + ':' + m[5] : String(iso || ''); };
478
-
479
- function doPrint() {
480
- if (!S.R) return;
481
- const ok = printDeck(S.R, { title: (o.name || 'Report') + (o.cycle ? ' ' + o.cycle : '') });
482
- toast(ok ? 'The print view is open: one ' + (isDeck() ? 'slide' : 'document') + ' per page, without your speaker notes or the notes on the slide. Choose Save as PDF. Nothing is uploaded.' : 'The browser blocked the print window. Allow pop-ups for this page, then press Print again.');
483
- }
484
-
485
- /* ── Present: the presenter view and the audience view, on the .rp-deck stage ── */
486
- let OV = null;
487
- /* The audience window (initiative meeting-material-replay-gaps): a page of its own that shows the slides only and follows this view's slide. */
488
- let AUD = null;
489
- function closeAud() {
490
- if (!AUD) return;
491
- try { if (AUD.ch) { AUD.ch.postMessage({ t: 'close' }); AUD.ch.close(); } } catch { /* gone */ }
492
- try { if (AUD.win && !AUD.win.closed) AUD.win.close(); } catch { /* gone */ }
493
- AUD = null;
494
- }
495
- /** Open the audience window. → true, or false when the browser blocked it (the caller falls back to the full-screen view in this window). */
496
- function openAudience() {
497
- if (!isDeck()) return false;
498
- if (AUD && AUD.win && !AUD.win.closed) { try { AUD.win.focus(); } catch { /* blocked */ } return true; }
499
- const w = openAudienceWindow({ ws, path, name: (o.name || 'Report') + (o.cycle ? ' · ' + o.cycle : ''), start: OV ? OV.i : S.cur });
500
- if (!w) return false;
501
- AUD = w;
502
- if (AUD.ch) AUD.ch.onmessage = (e) => {
503
- const m = e && e.data; if (!m || typeof m !== 'object') return;
504
- if (m.t === 'hello') AUD.ch.postMessage({ t: 'slide', i: OV ? OV.i : S.cur });
505
- else if (m.t === 'slide' && Number.isInteger(m.i)) { if (OV) ovGo(m.i, { quiet: true }); else { S.cur = Math.max(0, Math.min(count() - 1, m.i)); } }
506
- };
507
- return true;
508
- }
509
- /** The Audience view press: the window, else (blocked) the full-screen view in this window with a notice that says why. */
510
- function audienceView() {
511
- if (openAudience()) return;
512
- toast({ text: 'The audience window was blocked. Allow pop-ups for this page, or use the full-screen view here.', actionLabel: 'Full-screen view here', timeout: 10000, onAction: () => present('aud') });
513
- }
514
- function closeOV() {
515
- if (!OV) return; clearInterval(OV.timer); window.removeEventListener('keydown', OV.key, true); window.removeEventListener('resize', OV.fit);
516
- OV.host.remove(); const i = OV.i; OV = null; S.cur = i; closeAud(); if (o.standalone) { try { window.close(); } catch { /* not ours to close */ } return; } paint(); const b = root.querySelector('[data-rd-act="present"]'); if (b) b.focus();
517
- }
518
- function present(kind, start) {
519
- if (!isDeck()) return;
520
- if (OV) { OV.kind = kind; paintOV(); return; }
521
- ensureC3Css();
522
- const el0 = el('div', { class: 'rp-deck rd-ov ' + (kind === 'pres' ? 'rd-pres' : 'rd-aud'), open: '', role: 'dialog', 'aria-modal': 'true', 'aria-roledescription': 'carousel', tabindex: '-1', 'data-rd-ov': '' });
523
- const host = el('div', { class: 'c3 c3e c3pop rd-ovhost', 'data-shell': 'present' }, el0);
524
- OV = { kind, i: Math.max(0, Math.min(count() - 1, start == null ? S.cur : start)), el: el0, host, t0: Date.now(), timer: null, x0: null, y0: null };
525
- OV.key = (e) => ovKey(e);
526
- OV.fit = () => fitOV();
527
- document.body.appendChild(host);
528
- window.addEventListener('keydown', OV.key, true); window.addEventListener('resize', OV.fit);
529
- el0.addEventListener('touchstart', touchStart, { passive: true }); el0.addEventListener('touchend', touchEnd, { passive: true });
530
- OV.timer = setInterval(() => { const t = OV && OV.el.querySelector('[data-rd-timer]'); if (t) t.textContent = clock(); }, 1000);
531
- paintOV(); el0.focus();
532
- }
533
- const touchStart = (e) => { const t = e.changedTouches[0]; if (OV) { OV.x0 = t.clientX; OV.y0 = t.clientY; } };
534
- const touchEnd = (e) => { if (!OV || OV.x0 == null) return; const t = e.changedTouches[0]; const dx = t.clientX - OV.x0; const dy = t.clientY - OV.y0; OV.x0 = null; if (Math.abs(dx) > 40 && Math.abs(dx) > 1.5 * Math.abs(dy)) ovGo(OV.i + (dx < 0 ? 1 : -1)); };
535
- function ovKey(e) {
536
- if (!OV) return; const k = e.key;
537
- if (k === 'Escape') { e.preventDefault(); e.stopImmediatePropagation(); closeOV(); return; }
538
- const onBtn = e.target && e.target.closest && e.target.closest('button');
539
- if (k === 'ArrowRight' || k === 'PageDown' || (k === ' ' && !onBtn)) { e.preventDefault(); e.stopImmediatePropagation(); ovGo(OV.i + 1); }
540
- else if (k === 'ArrowLeft' || k === 'PageUp') { e.preventDefault(); e.stopImmediatePropagation(); ovGo(OV.i - 1); }
541
- else if (k === 'Home') { e.preventDefault(); e.stopImmediatePropagation(); ovGo(0); }
542
- else if (k === 'End') { e.preventDefault(); e.stopImmediatePropagation(); ovGo(count() - 1); }
543
- }
544
- function ovGo(j, opt) {
545
- if (!OV) return; const n = Math.max(0, Math.min(count() - 1, j)); if (n === OV.i) return; OV.i = n; paintOV();
546
- if (!(opt && opt.quiet)) {
547
- if (AUD && AUD.ch) { try { AUD.ch.postMessage({ t: 'slide', i: n }); } catch { /* closed */ } }
548
- if (typeof o.onSlide === 'function') o.onSlide(n);
549
- }
550
- }
551
- const clock = () => { const s = Math.floor((Date.now() - OV.t0) / 1000); return pad2(Math.floor(s / 60)) + ':' + pad2(s % 60); };
552
- function fitOV() {
553
- if (!OV) return;
554
- if (OV.kind === 'aud') { const st = OV.el.querySelector('.rp-deck__stage'); if (!st) return; const r = st.getBoundingClientRect(); OV.el.style.setProperty('--rp-scale', String(Math.max(0.05, Math.min(r.width / W, r.height / H)).toFixed(4))); }
555
- }
556
- function ovBar(label) {
557
- const N = count();
558
- return el('div', { class: 'rp-deck__bar', role: 'toolbar', 'aria-label': label }, el('p', { class: 'rp-deck__label' }, label),
559
- btn({ class: 'ib', 'aria-label': 'Previous slide', 'data-rd-ovact': 'prev', disabled: OV.i === 0, onclick: () => ovGo(OV.i - 1) }, icon('prev')),
560
- el('p', { class: 'rp-deck__count', 'data-rd-count': '' }, (OV.i + 1) + ' / ' + N),
561
- btn({ class: 'ib', 'aria-label': 'Next slide', 'data-rd-ovact': 'next', disabled: OV.i === N - 1, onclick: () => ovGo(OV.i + 1) }, icon('next')),
562
- OV.kind === 'pres' ? pbtn('ghost', 'Audience view', 'eye', { 'data-rd-ovact': 'aud', onclick: () => audienceView() }) : pbtn('ghost', 'Presenter view', 'mic', { 'data-rd-ovact': 'pres', onclick: () => { OV.kind = 'pres'; paintOV(); } }),
563
- btn({ class: 'ib', 'aria-label': 'Close the slides (Escape)', 'data-rd-ovact': 'close', onclick: () => closeOV() }, icon('x')));
564
- }
565
- function paintOV() {
566
- const s = slides()[OV.i]; const name = (o.name || 'Report') + (o.cycle ? ' · ' + o.cycle : '');
567
- const fwd = (doc) => wireFrame(doc, { key: ovKey, touch: { start: touchStart, end: touchEnd }, src: (ref, n) => { const p = srcParts(ref); toast((n.textContent || '').trim() + ': ' + p.word + ' ' + p.id); }, initiative: (id) => toast('Initiative ' + id + '. Open it from the deck after the session.') });
568
- OV.el.className = 'rp-deck rd-ov ' + (OV.kind === 'pres' ? 'rd-pres' : 'rd-aud');
569
- OV.el.setAttribute('aria-label', OV.kind === 'pres' ? 'Presenter view' : 'Slides, full screen');
570
- if (OV.kind === 'aud') {
571
- const fr = frame(S.R.style, s.html, { title: 'Slide ' + s.n + ': ' + s.title, cls: 'pmos-one', onLoad: fwd });
572
- put(OV.el, el('div', { class: 'rp-deck__stage' }, el('div', { class: 'rp-deck__frame rd-ovframe', 'aria-live': 'polite', 'data-rd-ovslide': s.id }, fr)), ovBar(name + '. Arrows, Space or a swipe move; Escape closes.'));
573
- } else {
574
- const nx = slides()[OV.i + 1]; const n = S.notes.speaker[s.id]; const sug = !n && S.notes.suggestions[s.id];
575
- put(OV.el, el('div', { class: 'rd-pg' },
576
- el('div', { class: 'rd-pmain' }, el('div', { class: 'rd-pp rd-plab' }, el('span', { class: 'chips2' }, el('span', { class: 'tag acc' }, 'Now'), el('b', null, 'Slide ' + s.n + ' of ' + count() + ': ' + s.title)), el('span', { class: 'dim mono rd-small' }, 'The audience sees only this slide')),
577
- slideCard(S.R, s, { attrs: { 'data-rd-ovslide': s.id }, wire: fwd }),
578
- el('div', { class: 'rd-pp', 'data-rd-ovnote': '' }, el('div', { class: 'rd-ph' }, icon('mic', 'sm'), 'Speaker notes ', el('span', { class: 'tag' }, 'Private')),
579
- n && n.text ? el('p', { class: 'rd-pnote' }, n.text) : sug ? el('p', { class: 'rd-pnote dim' }, 'From ' + slotWord(sug.from_slot) + ', not kept yet: ' + sug.text) : el('p', { class: 'dim rd-m0' }, 'No speaker note for this slide.'))),
580
- el('div', { class: 'rd-pside' }, el('div', { class: 'rd-pp rd-ptime' }, el('div', null, el('div', { class: 'rd-ph' }, icon('clock', 'sm'), 'Time'), el('b', { class: 'rd-timer', 'data-rd-timer': '' }, clock())), el('div', null, el('div', { class: 'rd-ph' }, 'Slide'), el('b', { class: 'rd-timer', 'data-rd-pn': '' }, s.n + ' / ' + count()))),
581
- el('div', { class: 'rd-pp' }, el('div', { class: 'rd-ph' }, icon('next', 'sm'), 'Next'), nx ? [slideCard(S.R, nx, { attrs: { 'data-rd-ovnext': nx.id } }), el('div', { class: 'dim rd-small' }, nx.n + '. ' + nx.title)] : el('p', { class: 'dim rd-m0' }, 'This is the last slide.')),
582
- el('div', { class: 'rd-pp' }, el('div', { class: 'rd-ph' }, icon('menu', 'sm'), 'Jump to'), el('ol', { class: 'rd-jump' }, slides().map((x, j) => el('li', null, btn({ 'data-rd-jump': String(j), 'aria-current': String(j === OV.i), onclick: () => ovGo(j) }, el('span', { class: 'mono' }, pad2(x.n)), x.title, S.notes.speaker[x.id] && S.notes.speaker[x.id].text ? icon('mic', 'sm') : null))))))),
583
- ovBar('Presenter view · ' + name + '. Only you see this screen. Nothing is sent.'));
584
- }
585
- requestAnimationFrame(fitOV);
586
- if (!OV.el.contains(document.activeElement)) OV.el.focus();
587
- }
588
-
589
- load();
590
- return {
591
- state: S,
592
- node(api) { S.api = api; if (!S.loaded || !S.cyc || !S.cyc.designed) return null; paint(); return root; },
593
- tools() { return S.loaded && S.cyc && S.cyc.designed && isDeck() ? [btn({ class: 'ib sm', 'aria-label': 'Present', title: 'Present', 'data-rd-act': 'present-top', onclick: () => present('pres') }, icon('play', 'sm'))] : []; },
594
- present, reload: load, close: closeOV, audience: audienceView, openAudience,
595
- /** Move to slide j (the audience window follows the presenter this way). opt.quiet: do not tell the other window. */
596
- goTo(j, opt) { if (OV) ovGo(j, opt); else S.cur = Math.max(0, Math.min(count() - 1, j)); },
597
- };
598
- }