@adminide-stack/clock-tik-browser 12.0.30 → 12.0.31

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 (64) hide show
  1. package/lib/pages/Home/HomePage.d.ts.map +1 -1
  2. package/lib/pages/Home/HomePage.js +1158 -248
  3. package/lib/pages/Home/HomePage.js.map +1 -1
  4. package/lib/pages/Home/__tests__/device.test.d.ts +2 -0
  5. package/lib/pages/Home/__tests__/device.test.d.ts.map +1 -0
  6. package/lib/pages/Home/__tests__/qr.test.d.ts +2 -0
  7. package/lib/pages/Home/__tests__/qr.test.d.ts.map +1 -0
  8. package/lib/pages/Home/__tests__/textLink.test.d.ts +2 -0
  9. package/lib/pages/Home/__tests__/textLink.test.d.ts.map +1 -0
  10. package/lib/pages/Home/assets.js +0 -2
  11. package/lib/pages/Home/assets.js.map +1 -1
  12. package/lib/pages/Home/chat/ChoresChat.d.ts +3 -1
  13. package/lib/pages/Home/chat/ChoresChat.d.ts.map +1 -1
  14. package/lib/pages/Home/chat/ChoresChat.js +99 -12
  15. package/lib/pages/Home/chat/ChoresChat.js.map +1 -1
  16. package/lib/pages/Home/chat/chatTheme.d.ts +2 -1
  17. package/lib/pages/Home/chat/chatTheme.d.ts.map +1 -1
  18. package/lib/pages/Home/chat/chatTheme.js +202 -15
  19. package/lib/pages/Home/chat/chatTheme.js.map +1 -1
  20. package/lib/pages/Home/chat/thread.d.ts +5 -0
  21. package/lib/pages/Home/chat/thread.d.ts.map +1 -1
  22. package/lib/pages/Home/chat/thread.js +24 -1
  23. package/lib/pages/Home/chat/thread.js.map +1 -1
  24. package/lib/pages/Home/content.d.ts +29 -0
  25. package/lib/pages/Home/content.d.ts.map +1 -1
  26. package/lib/pages/Home/content.js +72 -2
  27. package/lib/pages/Home/content.js.map +1 -1
  28. package/lib/pages/Home/homeStyles.d.ts +2 -0
  29. package/lib/pages/Home/homeStyles.d.ts.map +1 -1
  30. package/lib/pages/Home/homeStyles.js +2181 -512
  31. package/lib/pages/Home/homeStyles.js.map +1 -1
  32. package/lib/pages/Home/imessage/ImessageDialog.d.ts +14 -0
  33. package/lib/pages/Home/imessage/ImessageDialog.d.ts.map +1 -0
  34. package/lib/pages/Home/imessage/ImessageDialog.js +277 -0
  35. package/lib/pages/Home/imessage/ImessageDialog.js.map +1 -0
  36. package/lib/pages/Home/imessage/ImessageIcon.d.ts +5 -0
  37. package/lib/pages/Home/imessage/ImessageIcon.d.ts.map +1 -0
  38. package/lib/pages/Home/imessage/ImessageIcon.js +42 -0
  39. package/lib/pages/Home/imessage/ImessageIcon.js.map +1 -0
  40. package/lib/pages/Home/imessage/QrCode.d.ts +6 -0
  41. package/lib/pages/Home/imessage/QrCode.d.ts.map +1 -0
  42. package/lib/pages/Home/imessage/QrCode.js +86 -0
  43. package/lib/pages/Home/imessage/QrCode.js.map +1 -0
  44. package/lib/pages/Home/imessage/device.d.ts +31 -0
  45. package/lib/pages/Home/imessage/device.d.ts.map +1 -0
  46. package/lib/pages/Home/imessage/device.js +31 -0
  47. package/lib/pages/Home/imessage/device.js.map +1 -0
  48. package/lib/pages/Home/imessage/qr.d.ts +42 -0
  49. package/lib/pages/Home/imessage/qr.d.ts.map +1 -0
  50. package/lib/pages/Home/imessage/qr.js +469 -0
  51. package/lib/pages/Home/imessage/qr.js.map +1 -0
  52. package/lib/pages/Home/imessage/textLink.d.ts +70 -0
  53. package/lib/pages/Home/imessage/textLink.d.ts.map +1 -0
  54. package/lib/pages/Home/imessage/textLink.js +224 -0
  55. package/lib/pages/Home/imessage/textLink.js.map +1 -0
  56. package/lib/pages/Home/index.d.ts +15 -0
  57. package/lib/pages/Home/index.d.ts.map +1 -1
  58. package/lib/pages/Home/index.js +23 -28
  59. package/lib/pages/Home/index.js.map +1 -1
  60. package/lib/pages/Home/platform.d.ts +5 -0
  61. package/lib/pages/Home/platform.d.ts.map +1 -1
  62. package/lib/pages/Home/platform.js +8 -1
  63. package/lib/pages/Home/platform.js.map +1 -1
  64. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect,Suspense,lazy}from'react';import {createPortal}from'react-dom';import {Briefcase,PhoneCall,Plane,Wrench,Users,ShoppingCart,RefreshCcw,Receipt,ArrowRight,Workflow,BookOpen,Timer,ArrowUp,PackageOpen,Landmark,Smile,UtensilsCrossed,CalendarClock,Play}from'lucide-react';import {canLogin,beginLogin,captureLoginCallback,reconcileStoredToken,clearCdecliToken,hasCdecliToken,tokenExpiringSoon}from'@yantra/surface-kit/auth';import {businessHref}from'./business.js';import {ensurePlatformAnchor,appChatLink}from'./platform.js';import {HOME_ASSETS}from'./assets.js';import {HomeStyles}from'./homeStyles.js';import {savePendingChore,takePendingChore}from'./chat/thread.js';import {MINUTES,HERO_CHORES,VIDEO_NOTE,HOUSEWORK_MIN,AREAS,STEPS,BUSINESS_PRODUCTS,FOOTNOTE,BUSINESS_LINKS}from'./content.js';import {Mark,AnimatedMark}from'./Logo.js';import {emitAnalyticsEvent}from'../../utils/analytics.js';const AREA_ICONS = {
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useRef,useState,useCallback,useEffect,Suspense,lazy}from'react';import {createPortal}from'react-dom';import {Briefcase,ShieldCheck,PhoneCall,Plane,Wrench,Users,ShoppingCart,RefreshCcw,Receipt,ArrowRight,Plus,ArrowUp,PackageOpen,Landmark,Smile,UtensilsCrossed,CalendarClock,Check,Play,Workflow,BookOpen,Timer,X,UserPlus,KeyRound,Sparkles,Square}from'lucide-react';import {canLogin,beginLogin,captureLoginCallback,reconcileStoredToken,clearCdecliToken,getCdecliToken,hasCdecliToken,tokenExpiringSoon}from'@yantra/surface-kit/auth';import {businessHref}from'./business.js';import {ensurePlatformAnchor,appChatLink,appTextingLink}from'./platform.js';import {HOME_ASSETS}from'./assets.js';import {HomeStyles}from'./homeStyles.js';import {savePendingImessage,savePendingChore,takePendingChore,takePendingImessage,accountKeyFromToken}from'./chat/thread.js';import {MINUTES,TYPED_CHORES,HERO_CHORES,STRIP_CHORES,VIDEO_NOTE,TEXT_STEPS,AREAS,HOUSEWORK_MIN,STEPS,BUSINESS_PRODUCTS,FAQS,FOOTNOTE,CALL_STEPS,TEXT_THREAD,BUSINESS_LINKS}from'./content.js';import {ImessageIcon}from'./imessage/ImessageIcon.js';import {clearTextLinkCodes}from'./imessage/textLink.js';import {Mark,AnimatedMark}from'./Logo.js';import {emitAnalyticsEvent}from'../../utils/analytics.js';const AREA_ICONS = {
2
2
  bills: Receipt,
3
3
  subscriptions: RefreshCcw,
4
4
  groceries: ShoppingCart,
@@ -35,11 +35,48 @@ const REELS = [{
35
35
  result: 'Cancelled by phone, $600 a year back',
36
36
  label: 'Lucy calls the gym, declines three offers and cancels'
37
37
  }];
38
+ const STATS = [{
39
+ to: 38,
40
+ unit: 'min',
41
+ label: 'back, every day'
42
+ }, {
43
+ to: 4.4,
44
+ decimals: 1,
45
+ unit: 'hrs',
46
+ label: 'every week'
47
+ }, {
48
+ to: 229,
49
+ unit: 'hrs',
50
+ label: 'every year'
51
+ }];
52
+ /**
53
+ * Specks that drift up through the hero's glow. Fixed rather than random, so the server and the
54
+ * browser draw the same markup; a negative delay starts each one part-way through its rise. The
55
+ * first six, all a phone shows, still spread across the width.
56
+ */
57
+ const MOTES = [['7%', '58%', 3, '#ff8a3d', 15, -3, 14], ['49%', '38%', 2, '#ffb36b', 17, -14, -16], ['89%', '58%', 3, '#ff5a00', 23, -15, 12], ['23%', '74%', 4, '#ffc45c', 21, -1, 18], ['65%', '50%', 2, '#ff8fa3', 20, -10, -12], ['40%', '66%', 3, '#ffb36b', 22, -6, 12], ['15%', '32%', 2, '#ff5a00', 18, -9, -10], ['57%', '72%', 3, '#ff8fa3', 19, -4, 10], ['81%', '36%', 2, '#ffc45c', 16, -8, -6], ['31%', '46%', 2, '#ff8a3d', 16, -12, -8], ['73%', '64%', 4, '#ffb36b', 18, -2, 16], ['94%', '80%', 2, '#ff8fa3', 20, -5, -14]];
38
58
  /** The longest chore the composer takes. */
39
59
  const PROMPT_MAX = 2000;
60
+ const PLACEHOLDER = 'What should Lucy take off your plate?';
61
+ const NO_PHRASES = [];
62
+ /** The composer's typewriter: a chore typed out, held, taken back, and the next one. */
63
+ const TYPE_START_MS = 700;
64
+ const TYPE_MS = 34;
65
+ const TYPE_JITTER_MS = 36;
66
+ const TYPE_HOLD_MS = 1800;
67
+ const TYPE_DELETE_MS = 16;
68
+ const TYPE_GAP_MS = 420;
69
+ /** How long a revealed element rises (with its stagger) before its own transitions take over. */
70
+ const RISE_MS = 1400;
71
+ const COUNT_MS = 1400;
72
+ const CALL_STEP_MS = 1500;
73
+ const CALL_HOLD_MS = 3400;
40
74
  /** The page's chat, fetched the first time it is needed (or when the composer is focused). */
41
75
  const loadChat = () => import('./chat/ChoresChat.js');
42
76
  const ChoresChat = lazy(loadChat);
77
+ /** The iMessage dialog and its QR encoder, fetched when someone reaches for it. */
78
+ const loadImessage = () => import('./imessage/ImessageDialog.js');
79
+ const ImessageDialog = lazy(loadImessage);
43
80
  /** Signed in, with a token that is not about to lapse. */
44
81
  function hasLiveToken() {
45
82
  return hasCdecliToken() && !tokenExpiringSoon(30);
@@ -58,6 +95,137 @@ function usePrefersReducedMotion() {
58
95
  }, []);
59
96
  return reduced;
60
97
  }
98
+ /** Motion is on: after hydration (the server draws the still page), unless reduced motion was asked for. */
99
+ function useMotion() {
100
+ const [on, setOn] = useState(false);
101
+ useEffect(() => {
102
+ const query = window.matchMedia?.('(prefers-reduced-motion: reduce)');
103
+ setOn(!query?.matches);
104
+ if (!query) return;
105
+ const onChange = e => setOn(!e.matches);
106
+ query.addEventListener('change', onChange);
107
+ return () => query.removeEventListener('change', onChange);
108
+ }, []);
109
+ return on;
110
+ }
111
+ function useInView(ref) {
112
+ const [inView, setInView] = useState(false);
113
+ useEffect(() => {
114
+ const el = ref.current;
115
+ if (!el) return undefined;
116
+ if (typeof IntersectionObserver === 'undefined') {
117
+ setInView(true);
118
+ return undefined;
119
+ }
120
+ const io = new IntersectionObserver(([entry]) => setInView(Boolean(entry?.isIntersecting)));
121
+ io.observe(el);
122
+ return () => io.disconnect();
123
+ }, [ref]);
124
+ return inView;
125
+ }
126
+ /**
127
+ * `.cbh-reveal` elements still below the fold wait ([data-wait]) and rise into view ([data-in]).
128
+ * What is already on screen is left as the server drew it, so nothing on screen ever flashes.
129
+ */
130
+ function useReveal(rootRef, motion) {
131
+ useEffect(() => {
132
+ const root = rootRef.current;
133
+ if (!root || !motion || typeof IntersectionObserver === 'undefined') return undefined;
134
+ const timers = [];
135
+ const io = new IntersectionObserver(entries => {
136
+ for (const entry of entries) {
137
+ if (!entry.isIntersecting) continue;
138
+ const el = entry.target;
139
+ io.unobserve(el);
140
+ el.setAttribute('data-in', '');
141
+ // Once it has risen, the element's own transitions (a card's hover) take over.
142
+ timers.push(window.setTimeout(() => el.removeAttribute('data-wait'), RISE_MS));
143
+ }
144
+ }, {
145
+ rootMargin: '0px 0px -8% 0px',
146
+ threshold: 0.06
147
+ });
148
+ for (const el of Array.from(root.querySelectorAll('.cbh-reveal'))) {
149
+ if (el.hasAttribute('data-in') || el.getBoundingClientRect().top < window.innerHeight * 0.92) continue;
150
+ el.setAttribute('data-wait', '');
151
+ io.observe(el);
152
+ }
153
+ return () => {
154
+ io.disconnect();
155
+ timers.forEach(t => window.clearTimeout(t));
156
+ // Whatever stopped the effect, nothing is left hidden behind it.
157
+ root.querySelectorAll('.cbh-reveal[data-wait]').forEach(el => {
158
+ el.setAttribute('data-in', '');
159
+ el.removeAttribute('data-wait');
160
+ });
161
+ };
162
+ }, [rootRef, motion]);
163
+ }
164
+ /** A chore typed out in the empty composer, held, taken back, then the next. Null when idle. */
165
+ function useTypewriter(phrases, active) {
166
+ const [text, setText] = useState(null);
167
+ const phraseRef = useRef(0);
168
+ useEffect(() => {
169
+ if (!active || !phrases.length) {
170
+ setText(null);
171
+ return undefined;
172
+ }
173
+ let shown = 0;
174
+ let deleting = false;
175
+ let timer = 0;
176
+ const step = () => {
177
+ const full = phrases[phraseRef.current % phrases.length];
178
+ if (!deleting) {
179
+ shown += 1;
180
+ setText(full.slice(0, shown));
181
+ if (shown >= full.length) {
182
+ deleting = true;
183
+ timer = window.setTimeout(step, TYPE_HOLD_MS);
184
+ } else {
185
+ timer = window.setTimeout(step, TYPE_MS + Math.random() * TYPE_JITTER_MS);
186
+ }
187
+ return;
188
+ }
189
+ shown = Math.max(0, shown - 2);
190
+ setText(full.slice(0, shown));
191
+ if (shown > 0) {
192
+ timer = window.setTimeout(step, TYPE_DELETE_MS);
193
+ return;
194
+ }
195
+ deleting = false;
196
+ phraseRef.current += 1;
197
+ timer = window.setTimeout(step, TYPE_GAP_MS);
198
+ };
199
+ setText('');
200
+ timer = window.setTimeout(step, TYPE_START_MS);
201
+ return () => window.clearTimeout(timer);
202
+ }, [phrases, active]);
203
+ return text;
204
+ }
205
+ /**
206
+ * How many of `length` steps are done, looping while `active`: one every `stepMs`, a pause of
207
+ * `holdMs` on the finished state, then again. All done on the server and under reduced motion.
208
+ */
209
+ function useSequence(length, motion, active, stepMs, holdMs) {
210
+ const [done, setDone] = useState(length);
211
+ useEffect(() => {
212
+ setDone(motion ? 0 : length);
213
+ }, [motion, length]);
214
+ useEffect(() => {
215
+ if (!motion || !active) return undefined;
216
+ let n = 0;
217
+ let timer = 0;
218
+ const next = () => {
219
+ n = n >= length ? 0 : n + 1;
220
+ setDone(n);
221
+ timer = window.setTimeout(next, n >= length ? holdMs : stepMs);
222
+ };
223
+ setDone(0);
224
+ timer = window.setTimeout(next, stepMs);
225
+ return () => window.clearTimeout(timer);
226
+ }, [motion, active, length, stepMs, holdMs]);
227
+ return done;
228
+ }
61
229
  /** A silent animation that loops; a still poster when the visitor prefers reduced motion. */
62
230
  function Loop({
63
231
  src,
@@ -121,7 +289,7 @@ function Reel({
121
289
  className: "cbh-reel-play",
122
290
  "aria-hidden": true,
123
291
  children: jsx(Play, {
124
- size: 26,
292
+ size: 24,
125
293
  fill: "currentColor"
126
294
  })
127
295
  })]
@@ -138,7 +306,8 @@ function Reel({
138
306
  /** One chore: a button that hands it over. Hero chores wear their icon in front. */
139
307
  function ChoreChip({
140
308
  chore,
141
- onChore
309
+ onChore,
310
+ tabIndex
142
311
  }) {
143
312
  const Icon = chore.icon ? CHORE_ICONS[chore.icon] : null;
144
313
  return jsxs("button", {
@@ -147,30 +316,68 @@ function ChoreChip({
147
316
  "data-track": "chore_chip",
148
317
  "data-track-item": chore.label,
149
318
  onClick: () => onChore(chore),
319
+ tabIndex: tabIndex,
150
320
  children: [Icon ? jsx(Icon, {
151
321
  size: 16,
152
322
  "aria-hidden": true
153
323
  }) : null, chore.label, Icon ? null : jsx(ArrowRight, {
154
- size: 16,
324
+ size: 14,
325
+ className: "cbh-chip-go",
155
326
  "aria-hidden": true
156
327
  })]
157
328
  });
158
329
  }
330
+ /** A row of chores that drifts by; it pauses under the pointer and for the keyboard. */
331
+ function Marquee({
332
+ chores,
333
+ onChore,
334
+ reverse
335
+ }) {
336
+ return jsx("div", {
337
+ className: "cbh-marquee",
338
+ "data-reverse": reverse || undefined,
339
+ children: jsxs("div", {
340
+ className: "cbh-marquee-track",
341
+ children: [jsx("div", {
342
+ className: "cbh-marquee-group",
343
+ children: chores.map(c => jsx(ChoreChip, {
344
+ chore: c,
345
+ onChore: onChore
346
+ }, c.label))
347
+ }), jsx("div", {
348
+ className: "cbh-marquee-group cbh-marquee-dup",
349
+ "aria-hidden": true,
350
+ children: chores.map(c => jsx(ChoreChip, {
351
+ chore: c,
352
+ onChore: onChore,
353
+ tabIndex: -1
354
+ }, c.label))
355
+ })]
356
+ })
357
+ });
358
+ }
159
359
  /**
160
360
  * The chore composer, shaped like the Yantra app's home box: a few lines to say it the way you
161
- * would text it, Enter to hand it over (Shift+Enter for a new line).
361
+ * would text it, Enter to hand it over (Shift+Enter for a new line). Empty and on screen, it types
362
+ * out chores people hand over, so it is plain what to write.
162
363
  */
163
364
  function Composer({
164
365
  id,
165
366
  large,
367
+ typed,
166
368
  onSubmit,
167
369
  onWarm,
168
370
  inputRef
169
371
  }) {
170
372
  const [text, setText] = useState('');
373
+ const [focused, setFocused] = useState(false);
171
374
  const fieldRef = useRef(null);
375
+ const formRef = useRef(null);
376
+ const motion = useMotion();
377
+ const inView = useInView(formRef);
378
+ const ghost = useTypewriter(typed ?? NO_PHRASES, Boolean(typed) && motion && inView && !focused && !text);
172
379
  const ready = text.trim().length > 0;
173
- // Grow with the chore, up to the cap in home.css, then scroll.
380
+ // Grow with the chore, up to the cap in the stylesheet, then scroll.
174
381
  useEffect(() => {
175
382
  const el = fieldRef.current;
176
383
  if (!el) return;
@@ -190,52 +397,536 @@ function Composer({
190
397
  fieldRef.current = el;
191
398
  if (typeof inputRef === 'function') inputRef(el);else if (inputRef) inputRef.current = el;
192
399
  };
193
- return jsxs("form", {
194
- className: `cbh-composer${large ? ' cbh-composer-large' : ''}`,
195
- onSubmit: submit,
196
- onClick: () => fieldRef.current?.focus(),
197
- children: [jsx("label", {
198
- htmlFor: id,
400
+ return jsx("div", {
401
+ className: `cbh-cwrap${large ? ' cbh-cwrap-large' : ''}`,
402
+ children: jsxs("form", {
403
+ ref: formRef,
404
+ className: "cbh-composer",
405
+ onSubmit: submit,
406
+ onClick: () => fieldRef.current?.focus(),
407
+ children: [jsx("label", {
408
+ htmlFor: id,
409
+ className: "cbh-visually-hidden",
410
+ children: "A chore to hand over"
411
+ }), jsxs("div", {
412
+ className: "cbh-field",
413
+ children: [ghost !== null ? jsxs("span", {
414
+ className: "cbh-ghost",
415
+ "aria-hidden": true,
416
+ children: [ghost, jsx("i", {
417
+ className: "cbh-caret"
418
+ })]
419
+ }) : null, jsx("textarea", {
420
+ id: id,
421
+ ref: setRefs,
422
+ rows: 2,
423
+ value: text,
424
+ maxLength: PROMPT_MAX,
425
+ onChange: e => setText(e.target.value),
426
+ onKeyDown: onKeyDown,
427
+ onFocus: () => {
428
+ setFocused(true);
429
+ onWarm?.();
430
+ },
431
+ onBlur: () => setFocused(false),
432
+ placeholder: ghost !== null ? '' : PLACEHOLDER,
433
+ autoComplete: "off"
434
+ })]
435
+ }), jsxs("div", {
436
+ className: "cbh-composer-row",
437
+ children: [jsxs("span", {
438
+ className: "cbh-composer-hint",
439
+ children: [jsx(PhoneCall, {
440
+ size: 15,
441
+ "aria-hidden": true
442
+ }), "Lucy calls, books and keeps track"]
443
+ }), jsx("button", {
444
+ type: "submit",
445
+ className: "cbh-send",
446
+ "data-track": "chore_send",
447
+ "data-ready": ready || undefined,
448
+ disabled: !ready,
449
+ "aria-label": "Hand it over",
450
+ children: jsx(ArrowUp, {
451
+ size: 20,
452
+ strokeWidth: 2.4,
453
+ "aria-hidden": true
454
+ })
455
+ })]
456
+ })]
457
+ })
458
+ });
459
+ }
460
+ /**
461
+ * The hero's moving backdrop: a slow aurora in the mark's warm tones, a faint dot grid, a few
462
+ * drifting specks and, under a mouse, a soft light that follows the pointer while the aurora leans
463
+ * the other way. Decorative only: hidden from assistive tech, never takes a click.
464
+ */
465
+ function Ambient() {
466
+ const rootRef = useRef(null);
467
+ const driftRef = useRef(null);
468
+ const lightRef = useRef(null);
469
+ useEffect(() => {
470
+ const root = rootRef.current;
471
+ const host = root?.parentElement;
472
+ if (!root || !host) return undefined;
473
+ // A mouse only: on touch the light would jump to every tap and stay there.
474
+ if (!window.matchMedia?.('(hover: hover) and (pointer: fine)').matches) return undefined;
475
+ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined;
476
+ let frame = 0;
477
+ let clientX = 0;
478
+ let clientY = 0;
479
+ // One write per frame however fast the pointer reports; the CSS transitions smooth the rest.
480
+ const paint = () => {
481
+ frame = 0;
482
+ const box = root.getBoundingClientRect();
483
+ const x = clientX - box.left;
484
+ const y = clientY - box.top;
485
+ lightRef.current?.style.setProperty('transform', `translate3d(${x}px, ${y}px, 0)`);
486
+ const dx = (x / Math.max(box.width, 1) - 0.5) * -28;
487
+ const dy = (y / Math.max(box.height, 1) - 0.5) * -18;
488
+ driftRef.current?.style.setProperty('transform', `translate3d(${dx.toFixed(1)}px, ${dy.toFixed(1)}px, 0)`);
489
+ };
490
+ const onMove = event => {
491
+ if (event.pointerType !== 'mouse') return;
492
+ clientX = event.clientX;
493
+ clientY = event.clientY;
494
+ if (!root.hasAttribute('data-pointer')) root.setAttribute('data-pointer', '');
495
+ if (!frame) frame = window.requestAnimationFrame(paint);
496
+ };
497
+ const onLeave = () => root.removeAttribute('data-pointer');
498
+ host.addEventListener('pointermove', onMove, {
499
+ passive: true
500
+ });
501
+ host.addEventListener('pointerleave', onLeave);
502
+ return () => {
503
+ host.removeEventListener('pointermove', onMove);
504
+ host.removeEventListener('pointerleave', onLeave);
505
+ if (frame) window.cancelAnimationFrame(frame);
506
+ };
507
+ }, []);
508
+ return jsxs("div", {
509
+ ref: rootRef,
510
+ className: "cbh-amb",
511
+ "aria-hidden": true,
512
+ children: [jsxs("div", {
513
+ ref: driftRef,
514
+ className: "cbh-amb-drift",
515
+ children: [jsx("span", {
516
+ className: "cbh-amb-blob cbh-amb-b1"
517
+ }), jsx("span", {
518
+ className: "cbh-amb-blob cbh-amb-b2"
519
+ }), jsx("span", {
520
+ className: "cbh-amb-blob cbh-amb-b3"
521
+ }), jsx("span", {
522
+ className: "cbh-amb-blob cbh-amb-b4"
523
+ })]
524
+ }), jsx("div", {
525
+ className: "cbh-amb-grid"
526
+ }), jsx("div", {
527
+ children: MOTES.map(([left, top, size, color, seconds, delay, wander]) => jsx("span", {
528
+ className: "cbh-amb-mote",
529
+ style: {
530
+ left,
531
+ top,
532
+ '--mz': `${size}px`,
533
+ '--mc': color,
534
+ '--md': `${seconds}s`,
535
+ '--mdl': `${delay}s`,
536
+ '--mdx': `${wander}px`
537
+ }
538
+ }, `${left}-${top}`))
539
+ }), jsx("div", {
540
+ ref: lightRef,
541
+ className: "cbh-amb-light"
542
+ })]
543
+ });
544
+ }
545
+ /**
546
+ * A number that counts up as it comes into view. The server draws the real number; it only starts
547
+ * from zero when it was still below the fold, and screen readers hear the real number throughout.
548
+ */
549
+ function CountUp({
550
+ to,
551
+ decimals = 0
552
+ }) {
553
+ const ref = useRef(null);
554
+ const [value, setValue] = useState(to);
555
+ useEffect(() => {
556
+ const el = ref.current;
557
+ if (!el || typeof IntersectionObserver === 'undefined') return undefined;
558
+ if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return undefined;
559
+ if (el.getBoundingClientRect().top < window.innerHeight) return undefined;
560
+ setValue(0);
561
+ let frame = 0;
562
+ const io = new IntersectionObserver(([entry]) => {
563
+ if (!entry?.isIntersecting) return;
564
+ io.disconnect();
565
+ const start = performance.now();
566
+ const tick = now => {
567
+ const p = Math.min(1, (now - start) / COUNT_MS);
568
+ setValue(to * (1 - (1 - p) ** 3));
569
+ if (p < 1) frame = window.requestAnimationFrame(tick);
570
+ };
571
+ frame = window.requestAnimationFrame(tick);
572
+ }, {
573
+ threshold: 0.6
574
+ });
575
+ io.observe(el);
576
+ return () => {
577
+ io.disconnect();
578
+ if (frame) window.cancelAnimationFrame(frame);
579
+ };
580
+ }, [to]);
581
+ return jsxs(Fragment, {
582
+ children: [jsx("span", {
583
+ ref: ref,
584
+ "aria-hidden": true,
585
+ children: value.toFixed(decimals)
586
+ }), jsx("span", {
199
587
  className: "cbh-visually-hidden",
200
- children: "A chore to hand over"
201
- }), jsx("textarea", {
202
- id: id,
203
- ref: setRefs,
204
- rows: 2,
205
- value: text,
206
- maxLength: PROMPT_MAX,
207
- onChange: e => setText(e.target.value),
208
- onKeyDown: onKeyDown,
209
- onFocus: onWarm,
210
- placeholder: "What should Lucy take off your plate?",
211
- autoComplete: "off"
588
+ children: to.toFixed(decimals)
589
+ })]
590
+ });
591
+ }
592
+ /** Lucy on the phone, step by step - the reels' own internet-bill call, as it happens. */
593
+ function CallCard() {
594
+ const ref = useRef(null);
595
+ const motion = useMotion();
596
+ const inView = useInView(ref);
597
+ const done = useSequence(CALL_STEPS.length, motion, inView, CALL_STEP_MS, CALL_HOLD_MS);
598
+ const finished = done >= CALL_STEPS.length;
599
+ return jsxs("div", {
600
+ ref: ref,
601
+ className: "cbh-call",
602
+ role: "img",
603
+ "aria-label": "Illustration: Lucy calls an internet provider, gets through the phone menu, waits on hold, and comes back with a lower rate.",
604
+ children: [jsxs("p", {
605
+ className: "cbh-call-head",
606
+ "aria-hidden": true,
607
+ children: [jsx("span", {
608
+ className: "cbh-live"
609
+ }), finished ? 'Call finished' : 'Live call', jsx("em", {
610
+ children: "Lucy"
611
+ })]
612
+ }), jsx("ol", {
613
+ className: "cbh-call-steps",
614
+ "aria-hidden": true,
615
+ children: CALL_STEPS.map((s, i) => jsxs("li", {
616
+ className: "cbh-call-step",
617
+ "data-state": i < done ? 'done' : i === done ? 'now' : 'next',
618
+ children: [jsx("span", {
619
+ className: "cbh-call-dot",
620
+ children: i < done ? jsx(Check, {
621
+ size: 12,
622
+ strokeWidth: 3.2
623
+ }) : null
624
+ }), jsxs("span", {
625
+ children: [jsx("b", {
626
+ children: s.label
627
+ }), jsx("small", {
628
+ children: s.detail
629
+ })]
630
+ })]
631
+ }, s.label))
632
+ })]
633
+ });
634
+ }
635
+ /** An iMessage thread with Lucy that plays while it is on screen: drawn, not a transcript. */
636
+ function PhoneThread() {
637
+ const ref = useRef(null);
638
+ const motion = useMotion();
639
+ const inView = useInView(ref);
640
+ const [shown, setShown] = useState(TEXT_THREAD.length);
641
+ const [typing, setTyping] = useState(false);
642
+ const [round, setRound] = useState(0);
643
+ useEffect(() => {
644
+ setShown(motion ? 0 : TEXT_THREAD.length);
645
+ setTyping(false);
646
+ }, [motion]);
647
+ useEffect(() => {
648
+ if (!motion || !inView) return undefined;
649
+ const timers = [];
650
+ const at = (ms, run) => {
651
+ timers.push(window.setTimeout(run, ms));
652
+ };
653
+ let t = 0;
654
+ setShown(0);
655
+ setTyping(false);
656
+ TEXT_THREAD.forEach((line, i) => {
657
+ if (line.from === 'lucy') {
658
+ t += 600;
659
+ at(t, () => setTyping(true));
660
+ t += 1500;
661
+ at(t, () => {
662
+ setTyping(false);
663
+ setShown(i + 1);
664
+ });
665
+ } else {
666
+ t += i === 0 ? 400 : 1400;
667
+ at(t, () => setShown(i + 1));
668
+ }
669
+ });
670
+ at(t + 5000, () => setRound(r => r + 1));
671
+ return () => timers.forEach(id => window.clearTimeout(id));
672
+ }, [motion, inView, round]);
673
+ return jsx("div", {
674
+ ref: ref,
675
+ className: "cbh-phone",
676
+ role: "img",
677
+ "aria-label": `An illustrative iMessage thread with Lucy. ${TEXT_THREAD.map(m => m.text).join(' ')}`,
678
+ children: jsxs("div", {
679
+ className: "cbh-phone-screen",
680
+ "aria-hidden": true,
681
+ children: [jsx("span", {
682
+ className: "cbh-phone-island"
683
+ }), jsxs("div", {
684
+ className: "cbh-phone-head",
685
+ children: [jsx("span", {
686
+ className: "cbh-phone-avatar",
687
+ children: jsx(Mark, {
688
+ size: 26
689
+ })
690
+ }), jsx("span", {
691
+ className: "cbh-phone-name",
692
+ children: "Lucy"
693
+ })]
694
+ }), jsxs("div", {
695
+ className: "cbh-thread",
696
+ children: [jsx("span", {
697
+ className: "cbh-thread-day",
698
+ children: "iMessage \u00B7 Today"
699
+ }), TEXT_THREAD.slice(0, shown).map(m => jsx("p", {
700
+ className: "cbh-bubble",
701
+ "data-from": m.from,
702
+ children: m.text
703
+ }, m.text)), typing ? jsxs("span", {
704
+ className: "cbh-typing",
705
+ children: [jsx("i", {}), jsx("i", {}), jsx("i", {})]
706
+ }) : null]
707
+ }), jsxs("div", {
708
+ className: "cbh-phone-input",
709
+ children: ["iMessage", jsx("span", {
710
+ children: jsx(ArrowUp, {
711
+ size: 16,
712
+ strokeWidth: 2.6
713
+ })
714
+ })]
715
+ })]
716
+ })
717
+ });
718
+ }
719
+ /** A timer that has been running a while: it counts on while the card is on screen. */
720
+ const TIMER_START_S = 2 * 3600 + 14 * 60 + 36;
721
+ /** This week's hours, Monday to Friday; Thursday is today, still running. */
722
+ const WEEK_HOURS = [['Mon', 7.5], ['Tue', 8.2], ['Wed', 6.4], ['Thu', 4.6], ['Fri', 0]];
723
+ const WEEK_TODAY = 3;
724
+ function TimePreview() {
725
+ const ref = useRef(null);
726
+ const motion = useMotion();
727
+ const inView = useInView(ref);
728
+ const [seconds, setSeconds] = useState(TIMER_START_S);
729
+ useEffect(() => {
730
+ if (!motion || !inView) return undefined;
731
+ const timer = window.setInterval(() => setSeconds(s => s + 1), 1000);
732
+ return () => window.clearInterval(timer);
733
+ }, [motion, inView]);
734
+ const pad = n => String(n).padStart(2, '0');
735
+ const clock = `${pad(Math.floor(seconds / 3600))}:${pad(Math.floor(seconds / 60) % 60)}:${pad(seconds % 60)}`;
736
+ return jsxs("div", {
737
+ ref: ref,
738
+ className: "cbh-biz-ui",
739
+ "aria-hidden": true,
740
+ children: [jsxs("div", {
741
+ className: "cbh-biz-timer",
742
+ children: [jsx("span", {
743
+ className: "cbh-biz-rec"
744
+ }), jsx("span", {
745
+ className: "cbh-biz-timer-name",
746
+ children: "Website redesign"
747
+ }), jsx("b", {
748
+ children: clock
749
+ }), jsx("span", {
750
+ className: "cbh-biz-stop",
751
+ children: jsx(Square, {
752
+ size: 8,
753
+ fill: "currentColor",
754
+ strokeWidth: 0
755
+ })
756
+ })]
757
+ }), jsx("div", {
758
+ className: "cbh-biz-week",
759
+ children: WEEK_HOURS.map(([day, hours], i) => jsxs("span", {
760
+ "data-today": i === WEEK_TODAY || undefined,
761
+ children: [jsx("b", {
762
+ children: jsx("i", {
763
+ style: {
764
+ '--h': hours / 9,
765
+ '--cbh-i': i
766
+ }
767
+ })
768
+ }), day]
769
+ }, day))
770
+ })]
771
+ });
772
+ }
773
+ function PeoplePreview() {
774
+ return jsxs("div", {
775
+ className: "cbh-biz-ui",
776
+ "aria-hidden": true,
777
+ children: [jsxs("div", {
778
+ className: "cbh-biz-person",
779
+ children: [jsx("span", {
780
+ className: "cbh-biz-avatar",
781
+ children: "PS"
782
+ }), jsxs("span", {
783
+ children: [jsx("b", {
784
+ children: "Priya S. \u00B7 Time off"
785
+ }), jsx("small", {
786
+ children: "Apr 14 \u2013 16 \u00B7 3 days"
787
+ })]
788
+ })]
212
789
  }), jsxs("div", {
213
- className: "cbh-composer-row",
790
+ className: "cbh-biz-actions",
791
+ children: [jsx("span", {
792
+ className: "cbh-biz-btn",
793
+ children: "Decline"
794
+ }), jsxs("span", {
795
+ className: "cbh-biz-btn cbh-biz-btn-ink",
796
+ children: [jsx(Check, {
797
+ size: 12,
798
+ strokeWidth: 3
799
+ }), "Approve"]
800
+ })]
801
+ }), jsxs("p", {
802
+ className: "cbh-biz-hint",
803
+ children: [jsx(Sparkles, {
804
+ size: 12
805
+ }), "You usually approve these"]
806
+ })]
807
+ });
808
+ }
809
+ const LEDGER = [['Harbor Studio', 'INV-1042', '$2,480', 'Paid', 'ok'], ['Fernwood Co.', 'INV-1043', '$960', 'Due Friday', 'due'], ['Payroll', 'October', '$18,240', 'Scheduled', 'info']];
810
+ function BooksPreview() {
811
+ return jsx("div", {
812
+ className: "cbh-biz-ui cbh-biz-ledger",
813
+ "aria-hidden": true,
814
+ children: LEDGER.map(([who, ref, amount, status, tone]) => jsxs("div", {
815
+ className: "cbh-biz-line",
214
816
  children: [jsxs("span", {
215
- className: "cbh-composer-hint",
216
- children: [jsx(PhoneCall, {
217
- size: 15,
218
- "aria-hidden": true
219
- }), "Lucy calls, books and keeps track"]
220
- }), jsx("button", {
221
- type: "submit",
222
- className: "cbh-send",
223
- "data-track": "chore_send",
224
- disabled: !ready,
225
- "aria-label": "Hand it over",
226
- children: jsx(ArrowUp, {
227
- size: 20,
228
- strokeWidth: 2.4,
229
- "aria-hidden": true
817
+ children: [jsx("b", {
818
+ children: who
819
+ }), jsx("small", {
820
+ children: ref
821
+ })]
822
+ }), jsxs("span", {
823
+ children: [jsx("b", {
824
+ children: amount
825
+ }), jsx("em", {
826
+ className: "cbh-biz-pill",
827
+ "data-tone": tone,
828
+ children: status
829
+ })]
830
+ })]
831
+ }, ref))
832
+ });
833
+ }
834
+ const FLOW = [['New hire', UserPlus], ['Create accounts', KeyRound], ['Sign-off', ShieldCheck, 'Needs you']];
835
+ function WorkflowPreview() {
836
+ return jsx("div", {
837
+ className: "cbh-biz-ui cbh-biz-flow",
838
+ "aria-hidden": true,
839
+ children: FLOW.map(([label, Icon, flag], i) => jsxs("div", {
840
+ className: "cbh-biz-node",
841
+ style: {
842
+ '--cbh-i': i
843
+ },
844
+ children: [jsx("span", {
845
+ className: "cbh-biz-node-icon",
846
+ children: jsx(Icon, {
847
+ size: 13
230
848
  })
849
+ }), jsx("span", {
850
+ children: label
851
+ }), flag ? jsx("em", {
852
+ children: flag
853
+ }) : null]
854
+ }, label))
855
+ });
856
+ }
857
+ const BUSINESS_PREVIEWS = {
858
+ time: TimePreview,
859
+ hr: PeoplePreview,
860
+ books: BooksPreview,
861
+ workflows: WorkflowPreview
862
+ };
863
+ /**
864
+ * A product of Clockbook for business, the way runable.com shows its stories: a warm card, a tag,
865
+ * one line in the serif, and a small working picture of the product in a white panel. The
866
+ * picture is illustration only; the words carry the card for assistive tech.
867
+ */
868
+ function BusinessCard({
869
+ product,
870
+ index
871
+ }) {
872
+ const Icon = BUSINESS_ICONS[product.key];
873
+ const Preview = BUSINESS_PREVIEWS[product.key];
874
+ return jsxs("a", {
875
+ className: "cbh-biz-card cbh-reveal",
876
+ href: businessHref(product.path),
877
+ "data-track": "business_product",
878
+ "data-track-item": product.key,
879
+ style: {
880
+ '--cbh-i': index
881
+ },
882
+ children: [jsxs("span", {
883
+ className: "cbh-biz-tag",
884
+ children: [jsx(Icon, {
885
+ size: 14,
886
+ "aria-hidden": true
887
+ }), product.title]
888
+ }), jsx("h3", {
889
+ className: "cbh-biz-title",
890
+ children: product.headline
891
+ }), jsx("p", {
892
+ className: "cbh-biz-blurb",
893
+ children: product.blurb
894
+ }), jsx(Preview, {}), jsxs("span", {
895
+ className: "cbh-business-more",
896
+ children: ["Learn more ", jsx(ArrowRight, {
897
+ size: 16,
898
+ "aria-hidden": true
231
899
  })]
232
900
  })]
233
901
  });
234
902
  }
235
- /** Sign in before the chore runs. The chore waits in this tab and goes out when they are back. */
903
+ /** "Text Lucy on iMessage", where the composer is: the other way to hand a chore over. */
904
+ function ImessagePill({
905
+ onText,
906
+ onWarm
907
+ }) {
908
+ return jsxs("button", {
909
+ type: "button",
910
+ className: "cbh-imsg-pill",
911
+ "data-track": "text_on_imessage",
912
+ onClick: onText,
913
+ onPointerEnter: onWarm,
914
+ onFocus: onWarm,
915
+ "aria-haspopup": "dialog",
916
+ children: [jsx(ImessageIcon, {
917
+ size: 24
918
+ }), "Text Lucy on iMessage", jsx(ArrowRight, {
919
+ size: 15,
920
+ className: "cbh-arrow",
921
+ "aria-hidden": true
922
+ })]
923
+ });
924
+ }
925
+ /** Sign in before the chore runs (or the text goes). It waits in this tab and goes out when they are back. */
236
926
  function SignInDialog({
237
927
  chore,
238
928
  expired,
929
+ purpose = 'chore',
239
930
  onContinue,
240
931
  onCancel
241
932
  }) {
@@ -248,7 +939,9 @@ function SignInDialog({
248
939
  document.addEventListener('keydown', onKey);
249
940
  return () => document.removeEventListener('keydown', onKey);
250
941
  }, [onCancel]);
251
- const title = expired ? 'Sign in again to carry on' : chore ? 'Sign in to hand it over' : 'Sign in to Clockbook';
942
+ const texting = purpose === 'imessage';
943
+ const title = expired ? 'Sign in again to carry on' : texting ? 'Sign in to text Lucy' : chore ? 'Sign in to hand it over' : 'Sign in to Clockbook';
944
+ const body = expired ? texting ? 'Your sign-in ran out. Sign in again, and Messages opens with your text to Lucy.' : 'Your sign-in ran out. Sign in and Lucy picks this up again.' : texting ? 'Sign in or create an account, and Messages opens with a text to Lucy ready to send.' : chore ? 'Sign in or create an account, and Lucy starts on this as soon as you are back.' : 'Sign in or create an account to hand your chores to Lucy.';
252
945
  return jsx("div", {
253
946
  className: "cbh-dialog-backdrop",
254
947
  onClick: e => e.target === e.currentTarget && onCancel(),
@@ -257,11 +950,23 @@ function SignInDialog({
257
950
  role: "dialog",
258
951
  "aria-modal": "true",
259
952
  "aria-labelledby": "cbh-dialog-title",
260
- children: [jsx("span", {
953
+ children: [jsx("button", {
954
+ type: "button",
955
+ className: "cbh-dialog-x",
956
+ "data-track": "sign_in_cancel",
957
+ onClick: onCancel,
958
+ "aria-label": "Close",
959
+ children: jsx(X, {
960
+ size: 18,
961
+ "aria-hidden": true
962
+ })
963
+ }), jsx("span", {
261
964
  className: "cbh-dialog-mark",
262
965
  "aria-hidden": true,
263
- children: jsx(Mark, {
264
- size: 44
966
+ children: texting ? jsx(ImessageIcon, {
967
+ size: 48
968
+ }) : jsx(Mark, {
969
+ size: 46
265
970
  })
266
971
  }), jsx("h2", {
267
972
  id: "cbh-dialog-title",
@@ -272,7 +977,7 @@ function SignInDialog({
272
977
  children: ["\u201C", chore, "\u201D"]
273
978
  }) : null, jsx("p", {
274
979
  className: "cbh-dialog-body",
275
- children: expired ? 'Your sign-in ran out. Sign in and Lucy picks this up again.' : chore ? 'Sign in or create an account, and Lucy starts on this as soon as you are back.' : 'Sign in or create an account to hand your chores to Lucy.'
980
+ children: body
276
981
  }), jsxs("button", {
277
982
  ref: continueRef,
278
983
  type: "button",
@@ -303,13 +1008,21 @@ const CHAT_CLOSED = {
303
1008
  };
304
1009
  function HomePage() {
305
1010
  const totalMin = MINUTES.reduce((sum, m) => sum + m.min, 0);
1011
+ const rootRef = useRef(null);
1012
+ const motion = useMotion();
1013
+ useReveal(rootRef, motion);
306
1014
  const [signedIn, setSignedIn] = useState(false);
1015
+ const [scrolled, setScrolled] = useState(false);
307
1016
  const [chat, setChat] = useState(CHAT_CLOSED);
308
1017
  const [signIn, setSignIn] = useState(null);
1018
+ const [texting, setTexting] = useState(null);
309
1019
  const heroFieldRef = useRef(null);
310
1020
  const warmChat = useCallback(() => {
311
1021
  void loadChat();
312
1022
  }, []);
1023
+ const warmImessage = useCallback(() => {
1024
+ void loadImessage();
1025
+ }, []);
313
1026
  const openChat = useCallback(chore => {
314
1027
  const text = chore.trim();
315
1028
  setChat(c => ({
@@ -361,16 +1074,29 @@ function HomePage() {
361
1074
  method: 'typed',
362
1075
  placement
363
1076
  });
1077
+ /** Every "Text Lucy on iMessage" lands here: the dialog, sign-in first, or the app's own onboarding. */
1078
+ const textLucy = useCallback(message => {
1079
+ ensurePlatformAnchor();
1080
+ void loadImessage();
1081
+ if (hasLiveToken()) setTexting({
1082
+ message
1083
+ });else if (canLogin()) setSignIn({
1084
+ chore: '',
1085
+ purpose: 'imessage'
1086
+ });else window.location.assign(appTextingLink());
1087
+ }, []);
1088
+ const textFromChat = useCallback(() => textLucy(), [textLucy]);
364
1089
  const continueSignIn = useCallback(() => {
365
1090
  ensurePlatformAnchor();
366
1091
  emitAnalyticsEvent('sign_in_start', {
367
1092
  with_chore: !!signIn?.chore,
368
- expired: !!signIn?.expired
1093
+ expired: !!signIn?.expired,
1094
+ for_imessage: signIn?.purpose === 'imessage'
369
1095
  });
370
- savePendingChore(signIn?.chore ?? '');
1096
+ if (signIn?.purpose === 'imessage') savePendingImessage();else savePendingChore(signIn?.chore ?? '');
371
1097
  beginLogin('clockbook-home');
372
1098
  }, [signIn]);
373
- // Back from sign-in: keep the token it brought, and send the chore that waited for it.
1099
+ // Back from sign-in: keep the token it brought, and send what waited for it.
374
1100
  useEffect(() => {
375
1101
  ensurePlatformAnchor();
376
1102
  if (captureLoginCallback()) emitAnalyticsEvent('login', {
@@ -379,7 +1105,9 @@ function HomePage() {
379
1105
  const live = hasLiveToken();
380
1106
  setSignedIn(live);
381
1107
  const pending = takePendingChore();
1108
+ const pendingText = takePendingImessage();
382
1109
  if (live && pending) openChat(pending);else if (live && window.location.hash === CHAT_HASH) openChat('');else if (window.location.hash === CHAT_HASH) window.history.replaceState(null, '', window.location.pathname + window.location.search);
1110
+ if (live && pendingText) setTexting({});
383
1111
  // Where the page shares the app's session cookie (a cdebase.dev host next to the dev app),
384
1112
  // a token left by another account is dropped here. On clockbook.com there is no session to
385
1113
  // compare with, and the token stays until it is refused or the visitor signs out.
@@ -387,6 +1115,7 @@ function HomePage() {
387
1115
  void reconcileStoredToken().then(verdict => {
388
1116
  if (!live2 || verdict !== 'dropped') return;
389
1117
  setSignedIn(false);
1118
+ setTexting(null);
390
1119
  endChat();
391
1120
  });
392
1121
  return () => {
@@ -406,6 +1135,15 @@ function HomePage() {
406
1135
  window.addEventListener('popstate', onPop);
407
1136
  return () => window.removeEventListener('popstate', onPop);
408
1137
  }, []);
1138
+ // The nav turns to frosted glass once the page moves under it.
1139
+ useEffect(() => {
1140
+ const onScroll = () => setScrolled(window.scrollY > 8);
1141
+ onScroll();
1142
+ window.addEventListener('scroll', onScroll, {
1143
+ passive: true
1144
+ });
1145
+ return () => window.removeEventListener('scroll', onScroll);
1146
+ }, []);
409
1147
  // The landing does not scroll behind the open chat.
410
1148
  useEffect(() => {
411
1149
  if (!chat.open) return;
@@ -417,7 +1155,9 @@ function HomePage() {
417
1155
  };
418
1156
  }, [chat.open]);
419
1157
  const onSignedOut = useCallback(() => {
1158
+ clearTextLinkCodes();
420
1159
  setSignedIn(false);
1160
+ setTexting(null);
421
1161
  endChat();
422
1162
  }, [endChat]);
423
1163
  const onSessionExpired = useCallback(chore => {
@@ -429,6 +1169,24 @@ function HomePage() {
429
1169
  expired: true
430
1170
  });
431
1171
  }, [endChat]);
1172
+ const closeTexting = useCallback(() => setTexting(null), []);
1173
+ const textingChatHere = useCallback(() => {
1174
+ setTexting(null);
1175
+ openChat('');
1176
+ }, [openChat]);
1177
+ // The platform refused the sign-in while the dialog asked for the link: sign in again, then back to it.
1178
+ const textingSignedOut = useCallback(() => {
1179
+ clearCdecliToken();
1180
+ clearTextLinkCodes();
1181
+ setTexting(null);
1182
+ setSignedIn(false);
1183
+ endChat();
1184
+ setSignIn({
1185
+ chore: '',
1186
+ expired: true,
1187
+ purpose: 'imessage'
1188
+ });
1189
+ }, [endChat]);
432
1190
  const tryIt = () => {
433
1191
  if (signedIn) {
434
1192
  openChat('');
@@ -444,9 +1202,11 @@ function HomePage() {
444
1202
  };
445
1203
  return jsxs("div", {
446
1204
  className: "cbh",
1205
+ ref: rootRef,
447
1206
  children: [jsx(HomeStyles, {}), jsx("header", {
448
1207
  className: "cbh-nav",
449
1208
  "data-track-section": "nav",
1209
+ "data-scrolled": scrolled || undefined,
450
1210
  children: jsxs("div", {
451
1211
  className: "cbh-wrap cbh-nav-row",
452
1212
  children: [jsxs("a", {
@@ -465,6 +1225,9 @@ function HomePage() {
465
1225
  children: [jsx("a", {
466
1226
  href: "#calls",
467
1227
  children: "Lucy calls"
1228
+ }), jsx("a", {
1229
+ href: "#imessage",
1230
+ children: "iMessage"
468
1231
  }), jsx("a", {
469
1232
  href: "#areas",
470
1233
  children: "What it handles"
@@ -499,77 +1262,125 @@ function HomePage() {
499
1262
  })]
500
1263
  })
501
1264
  }), jsxs("main", {
502
- children: [jsx("section", {
1265
+ children: [jsxs("section", {
503
1266
  className: "cbh-hero",
504
1267
  id: "top",
505
1268
  "data-track-section": "hero",
506
- children: jsxs("div", {
507
- className: "cbh-wrap cbh-hero-grid",
508
- children: [jsxs("div", {
509
- className: "cbh-hero-copy",
510
- children: [jsx("p", {
511
- className: "cbh-eyebrow",
512
- children: "For busy households"
513
- }), jsxs("h1", {
514
- children: ["Get your evenings ", jsx("em", {
515
- children: "back."
516
- })]
517
- }), jsxs("p", {
518
- className: "cbh-lead",
519
- children: ["Clockbook takes the life admin off your plate: the calls, the bills, the cancellations, the groceries and the appointments. About 38 minutes back, every day.", jsx("sup", {
520
- children: "1"
521
- })]
522
- }), jsx(Composer, {
1269
+ children: [jsx(Ambient, {}), jsxs("div", {
1270
+ className: "cbh-wrap cbh-hero-inner",
1271
+ children: [jsx("div", {
1272
+ className: "cbh-halo-mark cbh-rise",
1273
+ "aria-hidden": true,
1274
+ children: jsx("span", {
1275
+ className: "cbh-halo-tile",
1276
+ children: jsx(AnimatedMark, {})
1277
+ })
1278
+ }), jsx("p", {
1279
+ className: "cbh-eyebrow cbh-rise cbh-d1",
1280
+ children: "For busy households"
1281
+ }), jsxs("h1", {
1282
+ className: "cbh-rise cbh-d2",
1283
+ children: ["Get your evenings ", jsx("em", {
1284
+ children: "back."
1285
+ })]
1286
+ }), jsxs("p", {
1287
+ className: "cbh-lead cbh-rise cbh-d3",
1288
+ children: ["Clockbook takes the life admin off your plate: the calls, the bills, the cancellations, the groceries and the appointments. About 38 minutes back, every day.", jsx("sup", {
1289
+ children: "1"
1290
+ })]
1291
+ }), jsx("div", {
1292
+ className: "cbh-rise cbh-d4",
1293
+ children: jsx(Composer, {
523
1294
  id: "cbh-chore-hero",
1295
+ typed: TYPED_CHORES,
524
1296
  onSubmit: handOverTyped('hero'),
525
1297
  onWarm: warmChat,
526
1298
  inputRef: heroFieldRef
527
- }), jsxs("div", {
528
- className: "cbh-try",
529
- children: [jsx("span", {
530
- className: "cbh-try-label",
531
- children: "Or try one"
532
- }), jsx("div", {
533
- className: "cbh-chips",
534
- children: HERO_CHORES.map(c => jsx(ChoreChip, {
535
- chore: c,
536
- onChore: handOverChip('hero')
537
- }, c.label))
538
- })]
539
- })]
540
- }), jsx("div", {
541
- className: "cbh-hero-media",
542
- children: jsx(Loop, {
543
- src: HOME_ASSETS.loopTimeBack,
544
- poster: HOME_ASSETS.loopTimeBackPoster,
545
- label: "The Clockbook clock rewinds: 38 minutes a day, 4.4 hours a week, 229 hours a year"
546
1299
  })
547
- })]
548
- })
549
- }), jsx("section", {
550
- className: "cbh-band",
551
- "aria-label": "Time back",
552
- children: jsxs("div", {
553
- className: "cbh-wrap cbh-stats",
554
- children: [jsxs("div", {
555
- children: [jsx("b", {
556
- children: "38 min"
557
- }), jsx("span", {
558
- children: "back, every day"
559
- })]
560
1300
  }), jsxs("div", {
561
- children: [jsx("b", {
562
- children: "4.4 hrs"
563
- }), jsx("span", {
564
- children: "every week"
565
- })]
1301
+ className: "cbh-try cbh-rise cbh-d5",
1302
+ role: "group",
1303
+ "aria-label": "Try a chore",
1304
+ children: [jsx("span", {
1305
+ className: "cbh-try-label",
1306
+ children: "Try"
1307
+ }), HERO_CHORES.slice(0, 5).map(c => jsx(ChoreChip, {
1308
+ chore: c,
1309
+ onChore: handOverChip('hero')
1310
+ }, c.label))]
566
1311
  }), jsxs("div", {
567
- children: [jsx("b", {
568
- children: "229 hrs"
569
- }), jsx("span", {
570
- children: "every year"
1312
+ className: "cbh-channels cbh-rise cbh-d6",
1313
+ children: [jsx(ImessagePill, {
1314
+ onText: () => textLucy(),
1315
+ onWarm: warmImessage
1316
+ }), jsxs("span", {
1317
+ className: "cbh-trust",
1318
+ children: [jsx(ShieldCheck, {
1319
+ size: 16,
1320
+ "aria-hidden": true
1321
+ }), "Nothing is paid or changed without your yes"]
571
1322
  })]
572
1323
  })]
1324
+ })]
1325
+ }), jsxs("section", {
1326
+ className: "cbh-strip",
1327
+ "aria-label": "More chores to hand over",
1328
+ "data-track-section": "strip",
1329
+ children: [jsx(Marquee, {
1330
+ chores: STRIP_CHORES.slice(0, 11),
1331
+ onChore: handOverChip('strip')
1332
+ }), jsx(Marquee, {
1333
+ chores: STRIP_CHORES.slice(11),
1334
+ onChore: handOverChip('strip'),
1335
+ reverse: true
1336
+ })]
1337
+ }), jsx("section", {
1338
+ className: "cbh-section cbh-time-section",
1339
+ "aria-labelledby": "cbh-time-title",
1340
+ children: jsx("div", {
1341
+ className: "cbh-wrap",
1342
+ children: jsxs("div", {
1343
+ className: "cbh-time-card cbh-reveal",
1344
+ children: [jsx("div", {
1345
+ className: "cbh-time-media",
1346
+ children: jsx(Loop, {
1347
+ src: HOME_ASSETS.loopTimeBack,
1348
+ poster: HOME_ASSETS.loopTimeBackPoster,
1349
+ label: "The Clockbook clock rewinds: 38 minutes a day, 4.4 hours a week, 229 hours a year"
1350
+ })
1351
+ }), jsxs("div", {
1352
+ className: "cbh-time-copy",
1353
+ children: [jsx("p", {
1354
+ className: "cbh-eyebrow",
1355
+ children: "Time back"
1356
+ }), jsxs("h2", {
1357
+ id: "cbh-time-title",
1358
+ children: ["After work, sleep and chores, the evening is ", jsx("em", {
1359
+ children: "short."
1360
+ })]
1361
+ }), jsx("ul", {
1362
+ className: "cbh-stats",
1363
+ children: STATS.map(s => jsxs("li", {
1364
+ className: "cbh-stat",
1365
+ children: [jsxs("b", {
1366
+ children: [jsx(CountUp, {
1367
+ to: s.to,
1368
+ decimals: s.decimals
1369
+ }), jsxs("small", {
1370
+ children: [" ", s.unit]
1371
+ })]
1372
+ }), jsx("span", {
1373
+ children: s.label
1374
+ })]
1375
+ }, s.label))
1376
+ }), jsxs("p", {
1377
+ className: "cbh-time-note",
1378
+ children: ["A working adult spends about 2.8 hours a day on life admin. Clockbook gives you 38 minutes of it back, every day: about 229 hours a year, or 28 workdays.", jsx("sup", {
1379
+ children: "1"
1380
+ })]
1381
+ })]
1382
+ })]
1383
+ })
573
1384
  })
574
1385
  }), jsx("section", {
575
1386
  className: "cbh-section",
@@ -577,52 +1388,159 @@ function HomePage() {
577
1388
  children: jsxs("div", {
578
1389
  className: "cbh-wrap cbh-split",
579
1390
  children: [jsxs("div", {
1391
+ className: "cbh-reveal",
580
1392
  children: [jsxs("p", {
581
1393
  className: "cbh-eyebrow",
582
1394
  children: [jsx(PhoneCall, {
583
- size: 16,
1395
+ size: 15,
584
1396
  "aria-hidden": true
585
1397
  }), " Lucy makes the call"]
586
- }), jsx("h2", {
587
- children: "Never sit on hold again."
1398
+ }), jsxs("h2", {
1399
+ children: ["Never sit on ", jsx("em", {
1400
+ children: "hold"
1401
+ }), " again."]
588
1402
  }), jsx("p", {
589
1403
  className: "cbh-body",
590
1404
  children: "Text Lucy what you need. She calls, works the phone menu, waits through the hold music and talks to a real person. When they need to hear from you, she rings you in."
591
- }), jsxs("ul", {
592
- className: "cbh-ticks",
593
- children: [jsx("li", {
594
- children: "Works the phone menu"
595
- }), jsx("li", {
596
- children: "Waits on hold for you"
597
- }), jsx("li", {
598
- children: "Says no to the retention offers"
599
- }), jsx("li", {
600
- children: "Rings you in to confirm"
601
- })]
602
- }), jsx("p", {
1405
+ }), jsx(CallCard, {}), jsx("p", {
603
1406
  className: "cbh-note",
604
1407
  children: VIDEO_NOTE
605
1408
  })]
606
1409
  }), jsx("div", {
607
- className: "cbh-reels",
608
- children: REELS.map(r => jsx(Reel, {
609
- ...r
610
- }, r.title))
1410
+ className: "cbh-reels-wrap cbh-reveal",
1411
+ style: {
1412
+ '--cbh-i': 1
1413
+ },
1414
+ children: jsx("div", {
1415
+ className: "cbh-reels",
1416
+ children: REELS.map(r => jsx(Reel, {
1417
+ ...r
1418
+ }, r.title))
1419
+ })
1420
+ })]
1421
+ })
1422
+ }), jsx("section", {
1423
+ className: "cbh-section cbh-soft",
1424
+ id: "imessage",
1425
+ children: jsxs("div", {
1426
+ className: "cbh-wrap cbh-split cbh-split-flip",
1427
+ children: [jsxs("div", {
1428
+ className: "cbh-reveal",
1429
+ children: [jsxs("p", {
1430
+ className: "cbh-eyebrow",
1431
+ children: [jsx(ImessageIcon, {
1432
+ size: 18
1433
+ }), " Now on iMessage"]
1434
+ }), jsxs("h2", {
1435
+ children: ["Text Lucy like you\u2019d text a ", jsx("em", {
1436
+ children: "friend."
1437
+ })]
1438
+ }), jsx("p", {
1439
+ className: "cbh-body",
1440
+ children: "Lucy is in Messages too. Send her a chore from your iPhone, iPad or Mac, and she texts back as it gets done. Same Lucy, same account, nothing to install."
1441
+ }), jsx("ol", {
1442
+ className: "cbh-text-steps",
1443
+ children: TEXT_STEPS.map((s, i) => jsxs("li", {
1444
+ children: [jsx("span", {
1445
+ className: "cbh-text-n",
1446
+ "aria-hidden": true,
1447
+ children: i + 1
1448
+ }), jsxs("div", {
1449
+ children: [jsx("b", {
1450
+ children: s.title
1451
+ }), jsx("span", {
1452
+ children: s.body
1453
+ })]
1454
+ })]
1455
+ }, s.title))
1456
+ }), jsxs("div", {
1457
+ className: "cbh-ctas",
1458
+ children: [jsxs("button", {
1459
+ type: "button",
1460
+ className: "cbh-btn",
1461
+ "data-track": "text_on_imessage",
1462
+ onClick: () => textLucy(),
1463
+ onPointerEnter: warmImessage,
1464
+ onFocus: warmImessage,
1465
+ "aria-haspopup": "dialog",
1466
+ children: [jsx(ImessageIcon, {
1467
+ size: 22
1468
+ }), "Text Lucy on iMessage"]
1469
+ }), jsx("span", {
1470
+ className: "cbh-fine",
1471
+ children: "Message and data rates may apply."
1472
+ })]
1473
+ })]
1474
+ }), jsx("div", {
1475
+ className: "cbh-phone-wrap cbh-reveal",
1476
+ style: {
1477
+ '--cbh-i': 1
1478
+ },
1479
+ children: jsx(PhoneThread, {})
1480
+ })]
1481
+ })
1482
+ }), jsx("section", {
1483
+ className: "cbh-section",
1484
+ id: "areas",
1485
+ children: jsxs("div", {
1486
+ className: "cbh-wrap",
1487
+ children: [jsxs("div", {
1488
+ className: "cbh-head cbh-reveal",
1489
+ children: [jsx("p", {
1490
+ className: "cbh-eyebrow",
1491
+ children: "What it handles"
1492
+ }), jsxs("h2", {
1493
+ children: ["Hand over every corner of ", jsx("em", {
1494
+ children: "home life."
1495
+ })]
1496
+ })]
1497
+ }), jsx("div", {
1498
+ className: "cbh-areas",
1499
+ children: AREAS.map((a, i) => {
1500
+ const Icon = AREA_ICONS[a.key];
1501
+ return jsxs("article", {
1502
+ className: "cbh-area cbh-reveal",
1503
+ style: {
1504
+ '--cbh-i': i % 3
1505
+ },
1506
+ children: [jsx("span", {
1507
+ className: "cbh-area-icon",
1508
+ "aria-hidden": true,
1509
+ children: jsx(Icon, {
1510
+ size: 22
1511
+ })
1512
+ }), jsx("h3", {
1513
+ children: a.title
1514
+ }), jsx("p", {
1515
+ children: a.blurb
1516
+ }), jsx("div", {
1517
+ className: "cbh-chips cbh-chips-small",
1518
+ children: a.chores.map(c => jsx(ChoreChip, {
1519
+ chore: c,
1520
+ onChore: handOverChip('areas')
1521
+ }, c.label))
1522
+ })]
1523
+ }, a.key);
1524
+ })
611
1525
  })]
612
1526
  })
613
1527
  }), jsx("section", {
614
1528
  className: "cbh-section cbh-soft",
615
1529
  id: "minutes",
616
1530
  children: jsxs("div", {
617
- className: "cbh-wrap cbh-split cbh-split-media-first",
1531
+ className: "cbh-wrap cbh-split",
618
1532
  children: [jsx("div", {
619
- className: "cbh-media-card",
1533
+ className: "cbh-media-card cbh-reveal",
620
1534
  children: jsx(Loop, {
621
1535
  src: HOME_ASSETS.loopWhere,
622
1536
  poster: HOME_ASSETS.loopWherePoster,
623
1537
  label: "The clock face fills slice by slice: shopping, meals, bills, calls and family logistics"
624
1538
  })
625
1539
  }), jsxs("div", {
1540
+ className: "cbh-reveal",
1541
+ style: {
1542
+ '--cbh-i': 1
1543
+ },
626
1544
  children: [jsx("p", {
627
1545
  className: "cbh-eyebrow",
628
1546
  children: "Where it comes from"
@@ -630,10 +1548,12 @@ function HomePage() {
630
1548
  children: [jsxs("span", {
631
1549
  className: "cbh-nowrap",
632
1550
  children: [totalMin, " minutes,"]
633
- }), " chore by chore."]
1551
+ }), " chore by ", jsx("em", {
1552
+ children: "chore."
1553
+ })]
634
1554
  }), jsxs("ul", {
635
1555
  className: "cbh-minutes",
636
- children: [MINUTES.map(m => jsxs("li", {
1556
+ children: [MINUTES.map((m, i) => jsxs("li", {
637
1557
  children: [jsx("span", {
638
1558
  className: "cbh-sw",
639
1559
  style: {
@@ -648,7 +1568,8 @@ function HomePage() {
648
1568
  "aria-hidden": true,
649
1569
  children: jsx("i", {
650
1570
  style: {
651
- width: `${m.min / 17 * 100}%`
1571
+ width: `${m.min / 17 * 100}%`,
1572
+ '--cbh-i': i
652
1573
  }
653
1574
  })
654
1575
  }), jsxs("b", {
@@ -679,107 +1600,55 @@ function HomePage() {
679
1600
  })
680
1601
  }), jsx("section", {
681
1602
  className: "cbh-section",
682
- id: "areas",
683
- children: jsxs("div", {
684
- className: "cbh-wrap",
685
- children: [jsx("p", {
686
- className: "cbh-eyebrow",
687
- children: "What it handles"
688
- }), jsx("h2", {
689
- children: "Hand over every corner of home life."
690
- }), jsx("div", {
691
- className: "cbh-areas",
692
- children: AREAS.map(a => {
693
- const Icon = AREA_ICONS[a.key];
694
- return jsxs("article", {
695
- className: "cbh-area",
696
- children: [jsx("span", {
697
- className: "cbh-area-icon",
698
- "aria-hidden": true,
699
- children: jsx(Icon, {
700
- size: 22
701
- })
702
- }), jsx("h3", {
703
- children: a.title
704
- }), jsx("p", {
705
- children: a.blurb
706
- }), jsx("div", {
707
- className: "cbh-chips cbh-chips-small",
708
- children: a.chores.map(c => jsx(ChoreChip, {
709
- chore: c,
710
- onChore: handOverChip('areas')
711
- }, c.label))
712
- })]
713
- }, a.key);
714
- })
715
- })]
716
- })
717
- }), jsx("section", {
718
- className: "cbh-section cbh-soft",
719
1603
  id: "how",
720
1604
  children: jsxs("div", {
721
1605
  className: "cbh-wrap",
722
- children: [jsx("p", {
723
- className: "cbh-eyebrow",
724
- children: "How it works"
725
- }), jsx("h2", {
726
- children: "Text it. It gets done."
1606
+ children: [jsxs("div", {
1607
+ className: "cbh-head cbh-head-center cbh-reveal",
1608
+ children: [jsx("p", {
1609
+ className: "cbh-eyebrow",
1610
+ children: "How it works"
1611
+ }), jsxs("h2", {
1612
+ children: ["Text it. It gets ", jsx("em", {
1613
+ children: "done."
1614
+ })]
1615
+ })]
727
1616
  }), jsx("ol", {
728
- className: "cbh-steps",
1617
+ className: "cbh-steps cbh-reveal",
729
1618
  children: STEPS.map((s, i) => jsxs("li", {
1619
+ className: "cbh-step",
730
1620
  children: [jsx("span", {
731
1621
  className: "cbh-step-n",
1622
+ "aria-hidden": true,
732
1623
  children: i + 1
733
- }), jsx("h3", {
734
- children: s.title
735
- }), jsx("p", {
736
- children: s.body
1624
+ }), jsxs("div", {
1625
+ children: [jsx("h3", {
1626
+ children: s.title
1627
+ }), jsx("p", {
1628
+ children: s.body
1629
+ })]
737
1630
  })]
738
1631
  }, s.title))
739
1632
  })]
740
1633
  })
741
1634
  }), jsx("section", {
742
1635
  className: "cbh-section",
743
- id: "day",
744
- children: jsxs("div", {
745
- className: "cbh-wrap cbh-split",
746
- children: [jsxs("div", {
747
- children: [jsx("p", {
748
- className: "cbh-eyebrow",
749
- children: "A working day"
750
- }), jsx("h2", {
751
- children: "After work, sleep and chores, the evening is short."
752
- }), jsxs("p", {
753
- className: "cbh-body",
754
- children: ["A working adult spends about 2.8 hours a day on life admin. Clockbook gives you 38 minutes of it back, every day. That is about 229 hours a year, or 28 workdays.", jsx("sup", {
755
- children: "1"
756
- })]
757
- })]
758
- }), jsx("div", {
759
- className: "cbh-media-card",
760
- children: jsx(Loop, {
761
- src: HOME_ASSETS.loopDay,
762
- poster: HOME_ASSETS.loopDayPoster,
763
- label: "A working day as bars: the Clockbook clock takes 38 minutes off life admin"
764
- })
765
- })]
766
- })
767
- }), jsx("section", {
768
- className: "cbh-section cbh-business",
769
1636
  id: "business",
770
1637
  children: jsxs("div", {
771
1638
  className: "cbh-wrap",
772
1639
  children: [jsxs("div", {
773
- className: "cbh-business-head",
1640
+ className: "cbh-business-head cbh-reveal",
774
1641
  children: [jsxs("div", {
775
1642
  children: [jsxs("p", {
776
1643
  className: "cbh-eyebrow",
777
1644
  children: [jsx(Briefcase, {
778
- size: 16,
1645
+ size: 15,
779
1646
  "aria-hidden": true
780
1647
  }), " Clockbook for business"]
781
- }), jsx("h2", {
782
- children: "The same Clockbook runs the back office."
1648
+ }), jsxs("h2", {
1649
+ children: ["The same Clockbook runs the ", jsx("em", {
1650
+ children: "back office."
1651
+ })]
783
1652
  }), jsx("p", {
784
1653
  className: "cbh-body",
785
1654
  children: "Clockbook started as the time tracker teams run their day on. For a business it is the whole back office: time, people, money and the workflows between them, with the paperwork handled and you always in control."
@@ -808,53 +1677,81 @@ function HomePage() {
808
1677
  })]
809
1678
  })]
810
1679
  }), jsx("div", {
811
- className: "cbh-business-grid",
812
- children: BUSINESS_PRODUCTS.map(p => {
813
- const Icon = BUSINESS_ICONS[p.key];
814
- return jsxs("a", {
815
- className: "cbh-business-card",
816
- href: businessHref(p.path),
817
- "data-track": "business_product",
818
- "data-track-item": p.key,
819
- children: [jsx("span", {
820
- className: "cbh-area-icon",
1680
+ className: "cbh-biz-grid",
1681
+ children: BUSINESS_PRODUCTS.map((p, i) => jsx(BusinessCard, {
1682
+ product: p,
1683
+ index: i
1684
+ }, p.key))
1685
+ })]
1686
+ })
1687
+ }), jsx("section", {
1688
+ className: "cbh-section cbh-soft",
1689
+ id: "faq",
1690
+ children: jsxs("div", {
1691
+ className: "cbh-wrap",
1692
+ children: [jsxs("div", {
1693
+ className: "cbh-head cbh-head-center cbh-reveal",
1694
+ children: [jsx("p", {
1695
+ className: "cbh-eyebrow",
1696
+ children: "Questions"
1697
+ }), jsxs("h2", {
1698
+ children: ["Good to ", jsx("em", {
1699
+ children: "know."
1700
+ })]
1701
+ })]
1702
+ }), jsx("div", {
1703
+ className: "cbh-faq cbh-reveal",
1704
+ children: FAQS.map(f => jsxs("details", {
1705
+ children: [jsxs("summary", {
1706
+ children: [f.q, jsx("span", {
1707
+ className: "cbh-faq-icon",
821
1708
  "aria-hidden": true,
822
- children: jsx(Icon, {
823
- size: 22
1709
+ children: jsx(Plus, {
1710
+ size: 16
824
1711
  })
825
- }), jsx("h3", {
826
- children: p.title
827
- }), jsx("p", {
828
- children: p.blurb
829
- }), jsxs("span", {
830
- className: "cbh-business-more",
831
- children: ["Learn more ", jsx(ArrowRight, {
832
- size: 16,
833
- "aria-hidden": true
834
- })]
835
1712
  })]
836
- }, p.key);
837
- })
1713
+ }), jsx("p", {
1714
+ children: f.a
1715
+ })]
1716
+ }, f.q))
838
1717
  })]
839
1718
  })
840
1719
  }), jsx("section", {
841
1720
  className: "cbh-final",
842
1721
  "data-track-section": "final",
843
- children: jsxs("div", {
1722
+ children: jsx("div", {
844
1723
  className: "cbh-wrap",
845
- children: [jsx(AnimatedMark, {
846
- className: "cbh-final-mark"
847
- }), jsx("h2", {
848
- children: "What's the first chore you'd hand over?"
849
- }), jsx(Composer, {
850
- id: "cbh-chore-final",
851
- large: true,
852
- onSubmit: handOverTyped('final'),
853
- onWarm: warmChat
854
- }), jsx("p", {
855
- className: "cbh-note",
856
- children: "Lucy asks before she pays for anything or changes an account."
857
- })]
1724
+ children: jsx("div", {
1725
+ className: "cbh-final-card cbh-reveal",
1726
+ children: jsxs("div", {
1727
+ className: "cbh-final-inner",
1728
+ children: [jsx(AnimatedMark, {
1729
+ className: "cbh-final-mark"
1730
+ }), jsxs("h2", {
1731
+ children: ["What\u2019s the first chore you\u2019d ", jsx("em", {
1732
+ children: "hand over?"
1733
+ })]
1734
+ }), jsx(Composer, {
1735
+ id: "cbh-chore-final",
1736
+ large: true,
1737
+ typed: TYPED_CHORES,
1738
+ onSubmit: handOverTyped('final'),
1739
+ onWarm: warmChat
1740
+ }), jsxs("div", {
1741
+ className: "cbh-channels",
1742
+ children: [jsx(ImessagePill, {
1743
+ onText: () => textLucy(),
1744
+ onWarm: warmImessage
1745
+ }), jsxs("span", {
1746
+ className: "cbh-trust",
1747
+ children: [jsx(ShieldCheck, {
1748
+ size: 16,
1749
+ "aria-hidden": true
1750
+ }), "Lucy asks before she pays for anything or changes an account"]
1751
+ })]
1752
+ })]
1753
+ })
1754
+ })
858
1755
  })
859
1756
  })]
860
1757
  }), jsx("footer", {
@@ -899,8 +1796,20 @@ function HomePage() {
899
1796
  }), signIn ? jsx(SignInDialog, {
900
1797
  chore: signIn.chore,
901
1798
  expired: signIn.expired,
1799
+ purpose: signIn.purpose,
902
1800
  onContinue: continueSignIn,
903
1801
  onCancel: () => setSignIn(null)
1802
+ }) : null, texting ? jsx(Suspense, {
1803
+ fallback: jsx("div", {
1804
+ className: "cbh-dialog-backdrop"
1805
+ }),
1806
+ children: jsx(ImessageDialog, {
1807
+ account: accountKeyFromToken(getCdecliToken()),
1808
+ message: texting.message,
1809
+ onClose: closeTexting,
1810
+ onChatHere: textingChatHere,
1811
+ onSignedOut: textingSignedOut
1812
+ })
904
1813
  }) : null, chat.mounted ? createPortal(jsx(Suspense, {
905
1814
  fallback: chat.open ? jsx("div", {
906
1815
  className: "cbh-chat-loading",
@@ -912,7 +1821,8 @@ function HomePage() {
912
1821
  hidden: !chat.open,
913
1822
  onClose: closeChat,
914
1823
  onSignedOut: onSignedOut,
915
- onSessionExpired: onSessionExpired
1824
+ onSessionExpired: onSessionExpired,
1825
+ onImessage: textFromChat
916
1826
  })
917
1827
  }), document.body) : null]
918
1828
  });