@mcp-b/react-components 0.64.1 → 0.65.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.
@@ -1,6 +1,6 @@
1
1
  import { CHROME_MARK, GMAIL_MARK, SIGVELO_LOGO } from "../../utils/brand-marks.js";
2
2
  import { t as cx } from "../../class-names-BiMDVpUo.js";
3
- import { N as KeyboardIcon, P as LaptopIcon, Q as PuzzleIcon, T as EllipsisVerticalIcon, Y as PinIcon, Z as PlusIcon, ft as UserIcon, i as ArrowRightIcon, it as SpinnerIcon, m as ChevronDownIcon, mt as WarningIcon, p as CheckIcon, r as ArrowLeftIcon, s as ArrowUpRightIcon, u as BoxIcon } from "../../icons-nLTnB9kd.js";
3
+ import { N as KeyboardIcon, P as LaptopIcon, Q as PuzzleIcon, T as EllipsisVerticalIcon, U as MinusIcon, Y as PinIcon, Z as PlusIcon, ft as UserIcon, i as ArrowRightIcon, it as SpinnerIcon, m as ChevronDownIcon, mt as WarningIcon, p as CheckIcon, r as ArrowLeftIcon, s as ArrowUpRightIcon, u as BoxIcon, v as ClockIcon } from "../../icons-nLTnB9kd.js";
4
4
  import { Select } from "../foundations/Select.js";
5
5
  import { a as formatErrorMessage, r as firstLine, t as capitalize } from "../../format-DL7f2rqp.js";
6
6
  import { Button } from "../foundations/Button.js";
@@ -61,7 +61,9 @@ const SECTIONS = [
61
61
  ["Connect your AI", "sign-in"],
62
62
  ["Chrome profile", "chrome-profile"],
63
63
  ["Work", "history"],
64
- ["Ready", "pin"]
64
+ ["Pin", "pin"],
65
+ ["Ask", "ask"],
66
+ ["Ready", "ready"]
65
67
  ];
66
68
  const RAIL = SECTIONS.map(([label, first], index) => {
67
69
  const following = SECTIONS[index + 1];
@@ -76,15 +78,21 @@ const WORK = [
76
78
  ];
77
79
  const section = (step) => RAIL.find(([, steps]) => steps.includes(step));
78
80
  const isWork = (step) => WORK.some(([candidate]) => candidate === step);
81
+ /** Preparation has settled: nothing runs, so what finished can be used and what failed waits for a retry. */
82
+ const settled = (preparation) => preparation === "done" || preparation === "failed";
79
83
  /**
80
84
  * Whether a screen is a stop on this person's way. Connecting a model is a
81
- * branch of sign-in, Work's screens wait for history consent, and Pin stays
82
- * only while there is something to pin or the person is on it.
85
+ * branch of sign-in, Work's screens wait for history consent and for the
86
+ * work they show, and Pin stays only while there is something to pin or the
87
+ * person is on it.
83
88
  */
84
- function applies(candidate, { step, history, pinned, trial }) {
89
+ function applies(candidate, flow) {
90
+ const { step, history, pinned } = flow;
85
91
  switch (candidate) {
86
92
  case "model-connection": return false;
87
- case "try": return history === "history" && trial;
93
+ case "writing": return history === "history" && flow.writing;
94
+ case "schedules": return history === "history" && flow.automations;
95
+ case "try": return history === "history" && flow.trial;
88
96
  case "pin": return !pinned || step === "pin";
89
97
  default: return !isWork(candidate) || history === "history";
90
98
  }
@@ -99,7 +107,7 @@ function currentStep(flow) {
99
107
  const { step, history, preparation } = flow;
100
108
  if (step === "model-connection") return step;
101
109
  if (isWork(step) && history === "unset") return "history";
102
- if (isWork(step) && step !== "preparation" && history === "history" && preparation !== "done") return "preparation";
110
+ if (isWork(step) && step !== "preparation" && history === "history" && !settled(preparation)) return "preparation";
103
111
  const order = flowOrder(flow);
104
112
  return order.includes(step) ? step : order.find((candidate) => rank(candidate) > rank(step)) ?? "ready";
105
113
  }
@@ -112,6 +120,19 @@ function nextStep(flow) {
112
120
  });
113
121
  return order[order.indexOf(current) + 1];
114
122
  }
123
+ /**
124
+ * Where skipping history leads: the screen after the history choice once it
125
+ * reads skipped. From the choice itself or from a Work screen restored before
126
+ * consent, which shows the choice; Ready is last, so a skip always has
127
+ * somewhere to go.
128
+ */
129
+ function afterHistorySkip(flow) {
130
+ return nextStep({
131
+ ...flow,
132
+ step: "history",
133
+ history: "skip"
134
+ }) ?? "ready";
135
+ }
115
136
  function previousStep(flow) {
116
137
  const current = currentStep(flow);
117
138
  if (current === "model-connection") return "sign-in";
@@ -121,22 +142,52 @@ function previousStep(flow) {
121
142
  });
122
143
  return order[order.indexOf(current) - 1];
123
144
  }
124
- /** Whether the selector can move to `target`: Work's later screens wait for all preparation. */
125
- function canVisit(target, navigation) {
126
- if (navigation.saving) return false;
127
- if (!flowOrder({
145
+ /**
146
+ * The screens the selector lists: the flow's, and Pin once reached, so a
147
+ * profile pinned on the way keeps its check in view.
148
+ */
149
+ const selectorOrder = (navigation) => {
150
+ const order = flowOrder({
128
151
  ...navigation,
129
152
  step: currentStep(navigation)
130
- }).includes(target)) return false;
131
- if (isWork(target)) return target === "preparation" || navigation.preparation === "done";
153
+ });
154
+ return firstRunSteps.filter((candidate) => order.includes(candidate) || candidate === "pin" && rank(candidate) <= navigation.furthest);
155
+ };
156
+ /**
157
+ * Whether the selector can move to `target`: Work's later screens open once
158
+ * preparation settles and their own work is done.
159
+ */
160
+ function canVisit(target, navigation) {
161
+ if (navigation.saving) return false;
162
+ if (!selectorOrder(navigation).includes(target)) return false;
163
+ if (isWork(target)) return target === "preparation" || settled(navigation.preparation);
132
164
  return rank(target) <= navigation.furthest;
133
165
  }
166
+ /**
167
+ * A screen's outcome, from the answer it produced rather than from having
168
+ * passed it: a model in use, a history choice, finished work, a review, a
169
+ * completed run, a pin, or Not now. Screens with nothing to answer complete
170
+ * when the person leaves them with Continue; passing them in the selector
171
+ * answers nothing.
172
+ */
173
+ function outcome(step, navigation) {
174
+ const skipped = navigation.left[step] === "skipped" ? "Skipped" : void 0;
175
+ switch (step) {
176
+ case "sign-in": return navigation.connected ? "Completed" : void 0;
177
+ case "history": return navigation.history === "history" ? "Completed" : navigation.history === "skip" ? "Skipped" : void 0;
178
+ case "preparation": return navigation.preparation === "done" ? "Completed" : void 0;
179
+ case "writing":
180
+ case "schedules": return navigation.reviewed[step] ? "Reviewed" : void 0;
181
+ case "try": return navigation.tried ? "Completed" : skipped;
182
+ case "pin": return navigation.pinned ? "Completed" : skipped;
183
+ case "chrome-profile":
184
+ case "ask": return navigation.left[step] === "continued" ? "Completed" : skipped;
185
+ default: return;
186
+ }
187
+ }
134
188
  /** The selector's entries: each section at its first screen, and Work's screens under it. */
135
189
  function navigationItems(navigation) {
136
- const order = flowOrder({
137
- ...navigation,
138
- step: currentStep(navigation)
139
- });
190
+ const order = selectorOrder(navigation);
140
191
  return RAIL.flatMap(([label, steps]) => {
141
192
  const value = order.find((candidate) => steps.includes(candidate));
142
193
  if (!value) return [];
@@ -144,14 +195,13 @@ function navigationItems(navigation) {
144
195
  label,
145
196
  value,
146
197
  disabled: !canVisit(value, navigation),
147
- completed: label === "Work" ? navigation.history !== "unset" : steps.every((step) => rank(step) < navigation.furthest),
148
- completionText: "Completed"
198
+ outcome: outcome(value, navigation)
149
199
  }, ...value === "history" && navigation.history === "history" ? WORK.map(([step, label]) => ({
150
200
  label,
151
201
  value: step,
152
202
  disabled: !canVisit(step, navigation),
153
- completed: step === "preparation" ? navigation.preparation === "done" : step === "writing" || step === "schedules" ? navigation.reviewed[step] : false,
154
- completionText: step === "preparation" ? "Completed" : "Reviewed"
203
+ outcome: outcome(step, navigation),
204
+ nested: true
155
205
  })) : []];
156
206
  });
157
207
  }
@@ -166,18 +216,78 @@ function navigationValue(flow) {
166
216
  const steps = section(current)?.[1] ?? [];
167
217
  return order.find((candidate) => steps.includes(candidate));
168
218
  }
169
- /** Parallel work in one status: working while any runs, then failed if any failed. */
170
- function preparationState(works) {
171
- const done = works.filter((work) => work.status === "done").length;
172
- return {
173
- status: works.some((work) => work.status === "working") ? "working" : works.some((work) => work.status === "failed") ? "failed" : done === works.length ? "done" : "idle",
174
- done,
175
- total: works.length
176
- };
219
+ /**
220
+ * Parallel work in one status: working while any runs, then failed if any
221
+ * failed, done once all are, and idle otherwise. Setup combines its own
222
+ * preparation this way; a host combines the jobs behind one work with it.
223
+ */
224
+ function combineFirstRunWorkStatus(statuses) {
225
+ if (statuses.includes("working")) return "working";
226
+ if (statuses.includes("failed")) return "failed";
227
+ return statuses.every((status) => status === "done") ? "done" : "idle";
228
+ }
229
+ /**
230
+ * All preparation in one status. Once nothing runs and some work is done, a
231
+ * work the host never started counts as unfinished, as a failed one does, so
232
+ * the person goes on with what finished instead of waiting on nothing.
233
+ */
234
+ function preparationStatus(works) {
235
+ const statuses = works.map((work) => work.status);
236
+ const status = combineFirstRunWorkStatus(statuses);
237
+ return status === "idle" && statuses.includes("done") ? "failed" : status;
177
238
  }
178
239
  //#endregion
179
240
  //#region src/components/extension/first-run/frame.tsx
180
241
  const ADVANCE_MS = 1600;
242
+ /**
243
+ * Owns one work's retry: pending reads as working, so Try again cannot be
244
+ * pressed twice, and a rejection's sentence stays until the host runs the
245
+ * work again.
246
+ */
247
+ function useRetry(work) {
248
+ const $ = c(13);
249
+ let t0;
250
+ if ($[0] !== work) {
251
+ t0 = { mutationFn: () => work.onRetry() };
252
+ $[0] = work;
253
+ $[1] = t0;
254
+ } else t0 = $[1];
255
+ const retry = useMutation(t0);
256
+ const [hostStatus, setHostStatus] = React.useState(work.status);
257
+ if (hostStatus !== work.status) {
258
+ setHostStatus(work.status);
259
+ if (hostStatus === "failed") retry.reset();
260
+ }
261
+ const t1 = retry.isPending ? "working" : work.status;
262
+ let t2;
263
+ if ($[2] !== retry) {
264
+ t2 = () => retry.mutate();
265
+ $[2] = retry;
266
+ $[3] = t2;
267
+ } else t2 = $[3];
268
+ let t3;
269
+ if ($[4] !== retry.error || $[5] !== retry.isError || $[6] !== work.failure || $[7] !== work.status) {
270
+ t3 = work.status !== "failed" ? void 0 : retry.isError && formatErrorMessage(retry.error) || work.failure;
271
+ $[4] = retry.error;
272
+ $[5] = retry.isError;
273
+ $[6] = work.failure;
274
+ $[7] = work.status;
275
+ $[8] = t3;
276
+ } else t3 = $[8];
277
+ let t4;
278
+ if ($[9] !== t1 || $[10] !== t2 || $[11] !== t3) {
279
+ t4 = {
280
+ status: t1,
281
+ onRetry: t2,
282
+ failure: t3
283
+ };
284
+ $[9] = t1;
285
+ $[10] = t2;
286
+ $[11] = t3;
287
+ $[12] = t4;
288
+ } else t4 = $[12];
289
+ return t4;
290
+ }
181
291
  const FirstRunContext = React.createContext(null);
182
292
  function useFirstRun() {
183
293
  const context = React.use(FirstRunContext);
@@ -222,125 +332,140 @@ function PoweredBy() {
222
332
  * `layout` names a screen whose body sets its own scroll layout.
223
333
  */
224
334
  function Step(t0) {
225
- const $ = c(29);
335
+ const $ = c(30);
226
336
  const { hero, title, lead, body, narrow, layout, actions, center, announce: t1 } = t0;
227
337
  const announce = t1 === void 0 ? "" : t1;
228
338
  const { arrival, titleId } = useFirstRun();
229
339
  const heading = React.useRef(null);
230
340
  const shown = React.useRef(false);
231
- const [initial] = React.useState(announce);
341
+ const focused = React.useRef(null);
232
342
  let t2;
233
- if ($[0] !== arrival) {
234
- t2 = () => {
343
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
344
+ t2 = (event) => {
345
+ focused.current = event.target;
346
+ };
347
+ $[0] = t2;
348
+ } else t2 = $[0];
349
+ const track = t2;
350
+ const [initial] = React.useState(announce);
351
+ let t3;
352
+ if ($[1] !== arrival) {
353
+ t3 = () => {
235
354
  const update = shown.current;
236
355
  shown.current = true;
237
- if (update ? document.activeElement === document.body : !arrival) heading.current?.focus({ preventScroll: true });
356
+ const lost = document.activeElement === document.body && focused.current !== null && (!focused.current.isConnected || focused.current.matches(":disabled"));
357
+ if (update ? lost : !arrival) {
358
+ focused.current = null;
359
+ heading.current?.focus({ preventScroll: true });
360
+ }
238
361
  };
239
- $[0] = arrival;
240
- $[1] = t2;
241
- } else t2 = $[1];
242
- React.useLayoutEffect(t2);
243
- let t3;
244
- if ($[2] !== title || $[3] !== titleId) {
245
- t3 = /* @__PURE__ */ jsx("h1", {
362
+ $[1] = arrival;
363
+ $[2] = t3;
364
+ } else t3 = $[2];
365
+ React.useLayoutEffect(t3);
366
+ let t4;
367
+ if ($[3] !== title || $[4] !== titleId) {
368
+ t4 = /* @__PURE__ */ jsx("h1", {
246
369
  ref: heading,
247
370
  id: titleId,
248
371
  tabIndex: -1,
249
372
  children: title
250
373
  });
251
- $[2] = title;
252
- $[3] = titleId;
253
- $[4] = t3;
254
- } else t3 = $[4];
255
- let t4;
256
- if ($[5] !== lead) {
257
- t4 = lead ? /* @__PURE__ */ jsx("p", { children: lead }) : null;
258
- $[5] = lead;
259
- $[6] = t4;
260
- } else t4 = $[6];
374
+ $[3] = title;
375
+ $[4] = titleId;
376
+ $[5] = t4;
377
+ } else t4 = $[5];
261
378
  let t5;
262
- if ($[7] !== hero || $[8] !== t3 || $[9] !== t4) {
263
- t5 = /* @__PURE__ */ jsxs("div", {
379
+ if ($[6] !== lead) {
380
+ t5 = lead ? /* @__PURE__ */ jsx("p", { children: lead }) : null;
381
+ $[6] = lead;
382
+ $[7] = t5;
383
+ } else t5 = $[7];
384
+ let t6;
385
+ if ($[8] !== hero || $[9] !== t4 || $[10] !== t5) {
386
+ t6 = /* @__PURE__ */ jsxs("div", {
264
387
  className: "first-run-intro",
265
388
  children: [
266
389
  hero,
267
- t3,
268
- t4
390
+ t4,
391
+ t5
269
392
  ]
270
393
  });
271
- $[7] = hero;
272
- $[8] = t3;
394
+ $[8] = hero;
273
395
  $[9] = t4;
274
396
  $[10] = t5;
275
- } else t5 = $[10];
276
- let t6;
277
- if ($[11] !== body || $[12] !== narrow) {
278
- t6 = body ? /* @__PURE__ */ jsx("div", {
397
+ $[11] = t6;
398
+ } else t6 = $[11];
399
+ let t7;
400
+ if ($[12] !== body || $[13] !== narrow) {
401
+ t7 = body ? /* @__PURE__ */ jsx("div", {
279
402
  className: "first-run-body",
280
403
  "data-narrow": narrow ? "" : void 0,
281
404
  children: body
282
405
  }) : null;
283
- $[11] = body;
284
- $[12] = narrow;
285
- $[13] = t6;
286
- } else t6 = $[13];
287
- let t7;
288
- if ($[14] !== t5 || $[15] !== t6) {
289
- t7 = /* @__PURE__ */ jsx(React.ViewTransition, {
406
+ $[12] = body;
407
+ $[13] = narrow;
408
+ $[14] = t7;
409
+ } else t7 = $[14];
410
+ let t8;
411
+ if ($[15] !== t6 || $[16] !== t7) {
412
+ t8 = /* @__PURE__ */ jsx(React.ViewTransition, {
290
413
  name: "first-run-step",
291
- children: /* @__PURE__ */ jsxs("div", { children: [t5, t6] })
414
+ children: /* @__PURE__ */ jsxs("div", { children: [t6, t7] })
292
415
  });
293
- $[14] = t5;
294
416
  $[15] = t6;
295
417
  $[16] = t7;
296
- } else t7 = $[16];
297
- const t8 = announce === initial ? "" : announce;
298
- let t9;
299
- if ($[17] !== t8) {
300
- t9 = /* @__PURE__ */ jsx("p", {
418
+ $[17] = t8;
419
+ } else t8 = $[17];
420
+ const t9 = announce === initial ? "" : announce;
421
+ let t10;
422
+ if ($[18] !== t9) {
423
+ t10 = /* @__PURE__ */ jsx("p", {
301
424
  role: "status",
302
425
  className: "sigvelo-visually-hidden",
303
- children: t8
426
+ children: t9
304
427
  });
305
- $[17] = t8;
306
428
  $[18] = t9;
307
- } else t9 = $[18];
308
- let t10;
309
- if ($[19] !== layout || $[20] !== t7 || $[21] !== t9) {
310
- t10 = /* @__PURE__ */ jsxs("div", {
429
+ $[19] = t10;
430
+ } else t10 = $[19];
431
+ let t11;
432
+ if ($[20] !== layout || $[21] !== t10 || $[22] !== t8) {
433
+ t11 = /* @__PURE__ */ jsxs("div", {
311
434
  className: "first-run-screen__scroll",
312
435
  "data-recipe": "scroll-fade-y",
313
436
  "data-layout": layout,
314
- children: [t7, t9]
437
+ onFocus: track,
438
+ children: [t8, t10]
315
439
  });
316
- $[19] = layout;
317
- $[20] = t7;
318
- $[21] = t9;
319
- $[22] = t10;
320
- } else t10 = $[22];
321
- const t11 = center ? "" : void 0;
322
- let t12;
323
- if ($[23] !== actions || $[24] !== t11) {
324
- t12 = /* @__PURE__ */ jsx(React.ViewTransition, {
440
+ $[20] = layout;
441
+ $[21] = t10;
442
+ $[22] = t8;
443
+ $[23] = t11;
444
+ } else t11 = $[23];
445
+ const t12 = center ? "" : void 0;
446
+ let t13;
447
+ if ($[24] !== actions || $[25] !== t12) {
448
+ t13 = /* @__PURE__ */ jsx(React.ViewTransition, {
325
449
  name: "first-run-actions",
326
450
  children: /* @__PURE__ */ jsx("div", {
327
451
  className: "first-run-actions",
328
- "data-center": t11,
452
+ "data-center": t12,
453
+ onFocus: track,
329
454
  children: actions
330
455
  })
331
456
  });
332
- $[23] = actions;
333
- $[24] = t11;
457
+ $[24] = actions;
334
458
  $[25] = t12;
335
- } else t12 = $[25];
336
- let t13;
337
- if ($[26] !== t10 || $[27] !== t12) {
338
- t13 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t12] });
339
- $[26] = t10;
340
- $[27] = t12;
459
+ $[26] = t13;
460
+ } else t13 = $[26];
461
+ let t14;
462
+ if ($[27] !== t11 || $[28] !== t13) {
463
+ t14 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t13] });
464
+ $[27] = t11;
341
465
  $[28] = t13;
342
- } else t13 = $[28];
343
- return t13;
466
+ $[29] = t14;
467
+ } else t14 = $[29];
468
+ return t14;
344
469
  }
345
470
  /** A screen's usual actions: Back at the start, its own controls at the end. */
346
471
  function Actions(t0) {
@@ -424,17 +549,17 @@ function Next(t0) {
424
549
  }
425
550
  function NotNow() {
426
551
  const $ = c(2);
427
- const { next } = useFirstRun();
552
+ const { skip } = useFirstRun();
428
553
  let t0;
429
- if ($[0] !== next) {
554
+ if ($[0] !== skip) {
430
555
  t0 = /* @__PURE__ */ jsx(Button, {
431
556
  variant: "surface",
432
557
  color: "neutral",
433
558
  size: "md",
434
- onClick: next,
559
+ onClick: skip,
435
560
  children: "Not now"
436
561
  });
437
- $[0] = next;
562
+ $[0] = skip;
438
563
  $[1] = t0;
439
564
  } else t0 = $[1];
440
565
  return t0;
@@ -577,13 +702,30 @@ function validateModelAddress(value) {
577
702
  }
578
703
  //#endregion
579
704
  //#region src/components/extension/first-run/ModelConnectionStep.tsx
705
+ /** A failure that came without a sentence still names the next step. */
706
+ const UNREACHABLE = "Couldn’t reach this model. Check the address and try again.";
580
707
  function ModelConnectionStep(t0) {
581
- const $ = c(78);
708
+ const $ = c(2);
709
+ const { connection } = t0;
710
+ let t1;
711
+ if ($[0] !== connection) {
712
+ t1 = connection.kind === "managed" ? /* @__PURE__ */ jsx(Step, {
713
+ title: connection.model,
714
+ lead: "Your organization manages this model.",
715
+ actions: /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(Next, {}) })
716
+ }) : /* @__PURE__ */ jsx(EditableModelConnection, { connection });
717
+ $[0] = connection;
718
+ $[1] = t1;
719
+ } else t1 = $[1];
720
+ return t1;
721
+ }
722
+ function EditableModelConnection(t0) {
723
+ const $ = c(86);
582
724
  const { connection } = t0;
583
725
  const { go } = useFirstRun();
584
726
  const { value } = connection;
585
727
  let t1;
586
- if ($[0] !== value.apiKey || $[1] !== value.endpoint || $[2] !== value.kind || $[3] !== value.model) {
728
+ if ($[0] !== value.apiKey || $[1] !== value.endpoint || $[2] !== value.keySaved || $[3] !== value.kind || $[4] !== value.model) {
587
729
  t1 = value.kind === "local" ? {
588
730
  kind: "local",
589
731
  endpoint: value.endpoint.trim(),
@@ -592,23 +734,25 @@ function ModelConnectionStep(t0) {
592
734
  kind: "api",
593
735
  endpoint: value.endpoint.trim(),
594
736
  model: value.model.trim(),
595
- apiKey: value.apiKey.trim()
737
+ apiKey: value.apiKey.trim(),
738
+ keySaved: value.keySaved
596
739
  };
597
740
  $[0] = value.apiKey;
598
741
  $[1] = value.endpoint;
599
- $[2] = value.kind;
600
- $[3] = value.model;
601
- $[4] = t1;
602
- } else t1 = $[4];
742
+ $[2] = value.keySaved;
743
+ $[3] = value.kind;
744
+ $[4] = value.model;
745
+ $[5] = t1;
746
+ } else t1 = $[5];
603
747
  const settings = t1;
604
748
  let t2;
605
- if ($[5] !== connection.connected || $[6] !== value.kind || $[7] !== value.model) {
749
+ if ($[6] !== connection.connected || $[7] !== value.kind || $[8] !== value.model) {
606
750
  t2 = () => connection.connected && value.kind === "local" && value.model ? [value.model] : [];
607
- $[5] = connection.connected;
608
- $[6] = value.kind;
609
- $[7] = value.model;
610
- $[8] = t2;
611
- } else t2 = $[8];
751
+ $[6] = connection.connected;
752
+ $[7] = value.kind;
753
+ $[8] = value.model;
754
+ $[9] = t2;
755
+ } else t2 = $[9];
612
756
  const [models, setModels] = React.useState(t2);
613
757
  const [busy, setBusy] = React.useState(false);
614
758
  const [message, setMessage] = React.useState("");
@@ -617,21 +761,21 @@ function ModelConnectionStep(t0) {
617
761
  const controller = React.useRef(null);
618
762
  let t3;
619
763
  let t4;
620
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
764
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
621
765
  t3 = () => () => {
622
766
  request.current = request.current + 1;
623
767
  controller.current?.abort();
624
768
  };
625
769
  t4 = [];
626
- $[9] = t3;
627
- $[10] = t4;
770
+ $[10] = t3;
771
+ $[11] = t4;
628
772
  } else {
629
- t3 = $[9];
630
- t4 = $[10];
773
+ t3 = $[10];
774
+ t4 = $[11];
631
775
  }
632
776
  React.useEffect(t3, t4);
633
777
  let t5;
634
- if ($[11] !== connection || $[12] !== value.endpoint || $[13] !== value.kind) {
778
+ if ($[12] !== connection || $[13] !== value.endpoint || $[14] !== value.kind) {
635
779
  t5 = (next) => {
636
780
  request.current = request.current + 1;
637
781
  controller.current?.abort();
@@ -643,14 +787,14 @@ function ModelConnectionStep(t0) {
643
787
  }
644
788
  connection.onChange(next);
645
789
  };
646
- $[11] = connection;
647
- $[12] = value.endpoint;
648
- $[13] = value.kind;
649
- $[14] = t5;
650
- } else t5 = $[14];
790
+ $[12] = connection;
791
+ $[13] = value.endpoint;
792
+ $[14] = value.kind;
793
+ $[15] = t5;
794
+ } else t5 = $[15];
651
795
  const update = t5;
652
796
  let t6;
653
- if ($[15] !== update || $[16] !== value.endpoint || $[17] !== value.kind) {
797
+ if ($[16] !== update || $[17] !== value.endpoint || $[18] !== value.kind) {
654
798
  t6 = (kind) => {
655
799
  if (kind === value.kind) return;
656
800
  const local = localModelAddress(value.endpoint);
@@ -662,27 +806,28 @@ function ModelConnectionStep(t0) {
662
806
  kind,
663
807
  endpoint: local ? "" : value.endpoint,
664
808
  model: "",
665
- apiKey: ""
809
+ apiKey: "",
810
+ keySaved: false
666
811
  });
667
812
  };
668
- $[15] = update;
669
- $[16] = value.endpoint;
670
- $[17] = value.kind;
671
- $[18] = t6;
672
- } else t6 = $[18];
813
+ $[16] = update;
814
+ $[17] = value.endpoint;
815
+ $[18] = value.kind;
816
+ $[19] = t6;
817
+ } else t6 = $[19];
673
818
  const chooseKind = t6;
674
819
  let t7;
675
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
820
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
676
821
  t7 = (failure) => {
677
822
  setBusy(false);
678
823
  setError(failure);
679
824
  setMessage("");
680
825
  };
681
- $[19] = t7;
682
- } else t7 = $[19];
826
+ $[20] = t7;
827
+ } else t7 = $[20];
683
828
  const fail = t7;
684
829
  let t8;
685
- if ($[20] !== connection || $[21] !== settings || $[22] !== update || $[23] !== value) {
830
+ if ($[21] !== connection || $[22] !== settings || $[23] !== update || $[24] !== value) {
686
831
  t8 = async () => {
687
832
  const id = request.current = request.current + 1;
688
833
  controller.current?.abort();
@@ -703,7 +848,7 @@ function ModelConnectionStep(t0) {
703
848
  const failure_0 = t9;
704
849
  if (id === request.current) {
705
850
  setModels([]);
706
- fail(formatErrorMessage(failure_0));
851
+ fail(formatErrorMessage(failure_0) || UNREACHABLE);
707
852
  }
708
853
  return;
709
854
  }
@@ -721,15 +866,15 @@ function ModelConnectionStep(t0) {
721
866
  });
722
867
  setMessage("Choose a model, then connect it.");
723
868
  };
724
- $[20] = connection;
725
- $[21] = settings;
726
- $[22] = update;
727
- $[23] = value;
728
- $[24] = t8;
729
- } else t8 = $[24];
869
+ $[21] = connection;
870
+ $[22] = settings;
871
+ $[23] = update;
872
+ $[24] = value;
873
+ $[25] = t8;
874
+ } else t8 = $[25];
730
875
  const findModels = t8;
731
876
  let t9;
732
- if ($[25] !== connection || $[26] !== go || $[27] !== settings) {
877
+ if ($[26] !== connection || $[27] !== go || $[28] !== settings) {
733
878
  t9 = async () => {
734
879
  const id_0 = request.current = request.current + 1;
735
880
  controller.current?.abort();
@@ -746,42 +891,42 @@ function ModelConnectionStep(t0) {
746
891
  await connection.onConnect(settings, pending_0.signal);
747
892
  } catch (t10) {
748
893
  const failure_1 = t10;
749
- if (id_0 === request.current) fail(formatErrorMessage(failure_1));
894
+ if (id_0 === request.current) fail(formatErrorMessage(failure_1) || UNREACHABLE);
750
895
  return;
751
896
  }
752
897
  if (id_0 !== request.current) return;
753
898
  setBusy(false);
754
899
  go("chrome-profile");
755
900
  };
756
- $[25] = connection;
757
- $[26] = go;
758
- $[27] = settings;
759
- $[28] = t9;
760
- } else t9 = $[28];
901
+ $[26] = connection;
902
+ $[27] = go;
903
+ $[28] = settings;
904
+ $[29] = t9;
905
+ } else t9 = $[29];
761
906
  const connect = t9;
762
907
  let t10;
763
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
908
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
764
909
  t10 = /* @__PURE__ */ jsx("legend", { children: "AI source" });
765
- $[29] = t10;
766
- } else t10 = $[29];
910
+ $[30] = t10;
911
+ } else t10 = $[30];
767
912
  let t11;
768
- if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
913
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
769
914
  t11 = /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx(Radio.Root, {
770
915
  value: "local",
771
916
  children: /* @__PURE__ */ jsx(Radio.Indicator, {})
772
917
  }), "Local AI"] });
773
- $[30] = t11;
774
- } else t11 = $[30];
918
+ $[31] = t11;
919
+ } else t11 = $[31];
775
920
  let t12;
776
- if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
921
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
777
922
  t12 = /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx(Radio.Root, {
778
923
  value: "api",
779
924
  children: /* @__PURE__ */ jsx(Radio.Indicator, {})
780
925
  }), "Another provider"] });
781
- $[31] = t12;
782
- } else t12 = $[31];
926
+ $[32] = t12;
927
+ } else t12 = $[32];
783
928
  let t13;
784
- if ($[32] !== chooseKind || $[33] !== value.kind) {
929
+ if ($[33] !== chooseKind || $[34] !== value.kind) {
785
930
  t13 = /* @__PURE__ */ jsxs("fieldset", {
786
931
  className: "first-run-model-source",
787
932
  children: [t10, /* @__PURE__ */ jsxs(RadioGroup.Root, {
@@ -794,12 +939,12 @@ function ModelConnectionStep(t0) {
794
939
  children: [t11, t12]
795
940
  })]
796
941
  });
797
- $[32] = chooseKind;
798
- $[33] = value.kind;
799
- $[34] = t13;
800
- } else t13 = $[34];
942
+ $[33] = chooseKind;
943
+ $[34] = value.kind;
944
+ $[35] = t13;
945
+ } else t13 = $[35];
801
946
  let t14;
802
- if ($[35] !== value.kind) {
947
+ if ($[36] !== value.kind) {
803
948
  t14 = value.kind === "local" ? /* @__PURE__ */ jsxs("p", { children: [
804
949
  "New to local AI?",
805
950
  " ",
@@ -811,33 +956,33 @@ function ModelConnectionStep(t0) {
811
956
  }),
812
957
  ", then find your models below."
813
958
  ] }) : null;
814
- $[35] = value.kind;
815
- $[36] = t14;
816
- } else t14 = $[36];
959
+ $[36] = value.kind;
960
+ $[37] = t14;
961
+ } else t14 = $[37];
817
962
  let t15;
818
- if ($[37] !== value.kind) {
963
+ if ($[38] !== value.kind) {
819
964
  t15 = value.kind === "api" ? /* @__PURE__ */ jsx("p", { children: "Enter your provider’s OpenAI-compatible service address, API key and model name." }) : null;
820
- $[37] = value.kind;
821
- $[38] = t15;
822
- } else t15 = $[38];
965
+ $[38] = value.kind;
966
+ $[39] = t15;
967
+ } else t15 = $[39];
823
968
  let t16;
824
- if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
969
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
825
970
  t16 = /* @__PURE__ */ jsx("span", { children: "Service address" });
826
- $[39] = t16;
827
- } else t16 = $[39];
971
+ $[40] = t16;
972
+ } else t16 = $[40];
828
973
  const t17 = value.kind === "local" ? "http://localhost:11434/v1" : "https://your-provider.example/v1";
829
974
  let t18;
830
- if ($[40] !== update || $[41] !== value) {
975
+ if ($[41] !== update || $[42] !== value) {
831
976
  t18 = (event) => update({
832
977
  ...value,
833
978
  endpoint: event.currentTarget.value
834
979
  });
835
- $[40] = update;
836
- $[41] = value;
837
- $[42] = t18;
838
- } else t18 = $[42];
980
+ $[41] = update;
981
+ $[42] = value;
982
+ $[43] = t18;
983
+ } else t18 = $[43];
839
984
  let t19;
840
- if ($[43] !== busy || $[44] !== t17 || $[45] !== t18 || $[46] !== value.endpoint) {
985
+ if ($[44] !== busy || $[45] !== t17 || $[46] !== t18 || $[47] !== value.endpoint) {
841
986
  t19 = /* @__PURE__ */ jsxs("label", {
842
987
  className: "first-run-field",
843
988
  children: [t16, /* @__PURE__ */ jsx(Input, {
@@ -848,19 +993,20 @@ function ModelConnectionStep(t0) {
848
993
  onChange: t18
849
994
  })]
850
995
  });
851
- $[43] = busy;
852
- $[44] = t17;
853
- $[45] = t18;
854
- $[46] = value.endpoint;
855
- $[47] = t19;
856
- } else t19 = $[47];
996
+ $[44] = busy;
997
+ $[45] = t17;
998
+ $[46] = t18;
999
+ $[47] = value.endpoint;
1000
+ $[48] = t19;
1001
+ } else t19 = $[48];
857
1002
  let t20;
858
- if ($[48] !== busy || $[49] !== findModels || $[50] !== models || $[51] !== update || $[52] !== value) {
1003
+ if ($[49] !== busy || $[50] !== findModels || $[51] !== models || $[52] !== update || $[53] !== value) {
859
1004
  t20 = value.kind === "local" ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Button, {
860
1005
  variant: "surface",
861
1006
  color: "neutral",
862
1007
  size: "sm",
863
1008
  disabled: busy,
1009
+ focusableWhenDisabled: busy,
864
1010
  onClick: () => void findModels(),
865
1011
  children: "Find models"
866
1012
  }), /* @__PURE__ */ jsx("div", {
@@ -885,6 +1031,7 @@ function ModelConnectionStep(t0) {
885
1031
  /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
886
1032
  sideOffset: 4,
887
1033
  alignItemWithTrigger: false,
1034
+ align: "start",
888
1035
  children: /* @__PURE__ */ jsx(Select.Popup, { children: /* @__PURE__ */ jsx(Select.List, { children: models.map(_temp4$2) }) })
889
1036
  }) })
890
1037
  ]
@@ -898,7 +1045,7 @@ function ModelConnectionStep(t0) {
898
1045
  spellCheck: false,
899
1046
  value: value.apiKey,
900
1047
  disabled: busy,
901
- placeholder: "Leave empty if your provider doesn’t use one",
1048
+ placeholder: value.keySaved ? "A key is saved. Enter a new one to replace it." : "Leave empty if your provider doesn’t use one",
902
1049
  onChange: (event_0) => update({
903
1050
  ...value,
904
1051
  apiKey: event_0.currentTarget.value
@@ -918,35 +1065,35 @@ function ModelConnectionStep(t0) {
918
1065
  })
919
1066
  })]
920
1067
  })] });
921
- $[48] = busy;
922
- $[49] = findModels;
923
- $[50] = models;
924
- $[51] = update;
925
- $[52] = value;
926
- $[53] = t20;
927
- } else t20 = $[53];
1068
+ $[49] = busy;
1069
+ $[50] = findModels;
1070
+ $[51] = models;
1071
+ $[52] = update;
1072
+ $[53] = value;
1073
+ $[54] = t20;
1074
+ } else t20 = $[54];
928
1075
  let t21;
929
- if ($[54] !== message) {
1076
+ if ($[55] !== message) {
930
1077
  t21 = message ? /* @__PURE__ */ jsx("p", {
931
1078
  className: "first-run-provider-status",
932
1079
  role: "status",
933
1080
  children: message
934
1081
  }) : null;
935
- $[54] = message;
936
- $[55] = t21;
937
- } else t21 = $[55];
1082
+ $[55] = message;
1083
+ $[56] = t21;
1084
+ } else t21 = $[56];
938
1085
  let t22;
939
- if ($[56] !== error) {
1086
+ if ($[57] !== error) {
940
1087
  t22 = error ? /* @__PURE__ */ jsx("p", {
941
1088
  className: "first-run-connection-error",
942
1089
  role: "alert",
943
1090
  children: error
944
1091
  }) : null;
945
- $[56] = error;
946
- $[57] = t22;
947
- } else t22 = $[57];
1092
+ $[57] = error;
1093
+ $[58] = t22;
1094
+ } else t22 = $[58];
948
1095
  let t23;
949
- if ($[58] !== t13 || $[59] !== t14 || $[60] !== t15 || $[61] !== t19 || $[62] !== t20 || $[63] !== t21 || $[64] !== t22) {
1096
+ if ($[59] !== t13 || $[60] !== t14 || $[61] !== t15 || $[62] !== t19 || $[63] !== t20 || $[64] !== t21 || $[65] !== t22) {
950
1097
  t23 = /* @__PURE__ */ jsxs(Fragment, { children: [
951
1098
  t13,
952
1099
  t14,
@@ -956,54 +1103,66 @@ function ModelConnectionStep(t0) {
956
1103
  t21,
957
1104
  t22
958
1105
  ] });
959
- $[58] = t13;
960
- $[59] = t14;
961
- $[60] = t15;
962
- $[61] = t19;
963
- $[62] = t20;
964
- $[63] = t21;
965
- $[64] = t22;
966
- $[65] = t23;
967
- } else t23 = $[65];
968
- const t24 = busy || value.kind === "local" && !models.length;
1106
+ $[59] = t13;
1107
+ $[60] = t14;
1108
+ $[61] = t15;
1109
+ $[62] = t19;
1110
+ $[63] = t20;
1111
+ $[64] = t21;
1112
+ $[65] = t22;
1113
+ $[66] = t23;
1114
+ } else t23 = $[66];
1115
+ let t24;
1116
+ if ($[67] !== busy || $[68] !== models || $[69] !== value.endpoint || $[70] !== value.kind || $[71] !== value.model) {
1117
+ t24 = busy || !value.endpoint.trim() || !value.model.trim() || value.kind === "local" && !models.length;
1118
+ $[67] = busy;
1119
+ $[68] = models;
1120
+ $[69] = value.endpoint;
1121
+ $[70] = value.kind;
1122
+ $[71] = value.model;
1123
+ $[72] = t24;
1124
+ } else t24 = $[72];
969
1125
  let t25;
970
- if ($[66] !== connect) {
1126
+ if ($[73] !== connect) {
971
1127
  t25 = () => void connect();
972
- $[66] = connect;
973
- $[67] = t25;
974
- } else t25 = $[67];
1128
+ $[73] = connect;
1129
+ $[74] = t25;
1130
+ } else t25 = $[74];
975
1131
  const t26 = busy ? "Checking…" : "Connect model";
976
1132
  let t27;
977
- if ($[68] !== busy) {
1133
+ if ($[75] !== busy) {
978
1134
  t27 = busy ? null : /* @__PURE__ */ jsx(ArrowRightIcon, {});
979
- $[68] = busy;
980
- $[69] = t27;
981
- } else t27 = $[69];
1135
+ $[75] = busy;
1136
+ $[76] = t27;
1137
+ } else t27 = $[76];
982
1138
  let t28;
983
- if ($[70] !== t24 || $[71] !== t25 || $[72] !== t26 || $[73] !== t27) {
1139
+ if ($[77] !== busy || $[78] !== t24 || $[79] !== t25 || $[80] !== t26 || $[81] !== t27) {
984
1140
  t28 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsxs(Button, {
1141
+ size: "md",
985
1142
  disabled: t24,
1143
+ focusableWhenDisabled: busy,
986
1144
  onClick: t25,
987
1145
  children: [t26, t27]
988
1146
  }) });
989
- $[70] = t24;
990
- $[71] = t25;
991
- $[72] = t26;
992
- $[73] = t27;
993
- $[74] = t28;
994
- } else t28 = $[74];
1147
+ $[77] = busy;
1148
+ $[78] = t24;
1149
+ $[79] = t25;
1150
+ $[80] = t26;
1151
+ $[81] = t27;
1152
+ $[82] = t28;
1153
+ } else t28 = $[82];
995
1154
  let t29;
996
- if ($[75] !== t23 || $[76] !== t28) {
1155
+ if ($[83] !== t23 || $[84] !== t28) {
997
1156
  t29 = /* @__PURE__ */ jsx(Step, {
998
1157
  title: "Connect a model",
999
1158
  lead: "Use another AI provider or a model running on this computer.",
1000
1159
  body: t23,
1001
1160
  actions: t28
1002
1161
  });
1003
- $[75] = t23;
1004
- $[76] = t28;
1005
- $[77] = t29;
1006
- } else t29 = $[77];
1162
+ $[83] = t23;
1163
+ $[84] = t28;
1164
+ $[85] = t29;
1165
+ } else t29 = $[85];
1007
1166
  return t29;
1008
1167
  }
1009
1168
  function _temp4$2(model_3) {
@@ -1042,7 +1201,7 @@ const ORB_PARTICLES = Array.from({ length: 80 }, (_, id) => {
1042
1201
  });
1043
1202
  /** Parallel preparation shares one tabbed page; writing, approvals, and a trial are separate. */
1044
1203
  function WorkPreparation(t0) {
1045
- const $ = c(65);
1204
+ const $ = c(77);
1046
1205
  const { tab, onTabChange, preparation, projects, people, automations, skills, writing } = t0;
1047
1206
  const { brandName } = useFirstRun();
1048
1207
  const groupId = React.useId();
@@ -1067,6 +1226,7 @@ function WorkPreparation(t0) {
1067
1226
  let completed;
1068
1227
  let stages;
1069
1228
  let t10;
1229
+ let t11;
1070
1230
  let t3;
1071
1231
  let t4;
1072
1232
  let t5;
@@ -1074,27 +1234,27 @@ function WorkPreparation(t0) {
1074
1234
  let t7;
1075
1235
  let t8;
1076
1236
  let t9;
1077
- if ($[2] !== automationEntries || $[3] !== automations || $[4] !== brandName || $[5] !== groupId || $[6] !== onTabChange || $[7] !== people || $[8] !== personEntries || $[9] !== personRow || $[10] !== preparation || $[11] !== projectEntries || $[12] !== projects || $[13] !== skills || $[14] !== t2 || $[15] !== tab || $[16] !== writing.status) {
1078
- let t11;
1079
- if ($[30] !== projects.source.queryOptions) {
1080
- t11 = (project) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceProjectFile, {
1237
+ if ($[2] !== automationEntries || $[3] !== automations || $[4] !== brandName || $[5] !== groupId || $[6] !== onTabChange || $[7] !== people || $[8] !== personEntries || $[9] !== personRow || $[10] !== preparation || $[11] !== projectEntries || $[12] !== projects || $[13] !== skills || $[14] !== t2 || $[15] !== tab || $[16] !== writing) {
1238
+ let t12;
1239
+ if ($[31] !== projects.source.queryOptions) {
1240
+ t12 = (project) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceProjectFile, {
1081
1241
  flat: true,
1082
1242
  path: project.path,
1083
1243
  source: { queryOptions: projects.source.queryOptions }
1084
1244
  }) }, project.path);
1085
- $[30] = projects.source.queryOptions;
1086
- $[31] = t11;
1087
- } else t11 = $[31];
1088
- let t12;
1089
- if ($[32] !== automations.source.queryOptions) {
1090
- t12 = (automation) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceAutomationFile, {
1245
+ $[31] = projects.source.queryOptions;
1246
+ $[32] = t12;
1247
+ } else t12 = $[32];
1248
+ let t13;
1249
+ if ($[33] !== automations.source.queryOptions) {
1250
+ t13 = (automation) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceAutomationFile, {
1091
1251
  flat: true,
1092
1252
  path: automation.path,
1093
1253
  source: { queryOptions: automations.source.queryOptions }
1094
1254
  }) }, automation.path);
1095
- $[32] = automations.source.queryOptions;
1096
- $[33] = t12;
1097
- } else t12 = $[33];
1255
+ $[33] = automations.source.queryOptions;
1256
+ $[34] = t13;
1257
+ } else t13 = $[34];
1098
1258
  stages = [
1099
1259
  {
1100
1260
  id: "projects",
@@ -1102,7 +1262,7 @@ function WorkPreparation(t0) {
1102
1262
  work: projects,
1103
1263
  count: projectEntries.length,
1104
1264
  description: t2,
1105
- rows: projectEntries.map(t11)
1265
+ rows: projectEntries.map(t12)
1106
1266
  },
1107
1267
  {
1108
1268
  id: "people",
@@ -1118,7 +1278,7 @@ function WorkPreparation(t0) {
1118
1278
  work: automations,
1119
1279
  count: automationEntries.length,
1120
1280
  description: "Each takes over work you do by hand. None runs until you say so.",
1121
- rows: automationEntries.map(t12)
1281
+ rows: automationEntries.map(t13)
1122
1282
  },
1123
1283
  {
1124
1284
  id: "skills",
@@ -1129,15 +1289,20 @@ function WorkPreparation(t0) {
1129
1289
  rows: skills.source.list.map(_temp$4)
1130
1290
  }
1131
1291
  ];
1132
- const categories = preparationState(stages.map(_temp2$3)).status;
1292
+ const categories = combineFirstRunWorkStatus(stages.map(_temp2$3));
1133
1293
  const working = preparation === "working";
1134
1294
  completed = preparation === "done";
1295
+ const unfinished = [...stages.map(_temp3$2), {
1296
+ label: "Writing style",
1297
+ work: writing
1298
+ }].filter(_temp4$1);
1299
+ const [only] = unfinished;
1300
+ const title = completed ? "Your work is ready" : working ? categories === "done" ? `${brandName} is preparing your writing style` : `${brandName} is preparing your work` : preparation === "idle" || !only ? `${brandName} hasn’t started preparing your work` : unfinished.length > 1 ? unfinished.some(_temp5$1) ? "Some of your work didn’t finish" : "Some of your work hasn’t started" : only.work === writing ? only.work.status === "failed" ? `${brandName} couldn’t analyze your writing style` : `${brandName} hasn’t started on your writing style` : only.work.status === "failed" ? `${brandName} couldn’t find your ${only.label.toLowerCase()}` : `${brandName} hasn’t started finding your ${only.label.toLowerCase()}`;
1135
1301
  T2 = Step;
1136
- t9 = "work";
1137
- t10 = completed ? "Your work is ready" : /* @__PURE__ */ jsxs(Card, {
1138
- render: /* @__PURE__ */ jsx("span", {}),
1139
- className: "first-run-work__heading",
1140
- children: [working ? /* @__PURE__ */ jsx("span", {
1302
+ t10 = "work";
1303
+ let t14;
1304
+ if ($[35] !== working) {
1305
+ t14 = working ? /* @__PURE__ */ jsx("span", {
1141
1306
  className: "first-run-orb",
1142
1307
  "aria-hidden": "true",
1143
1308
  children: /* @__PURE__ */ jsx("svg", {
@@ -1146,38 +1311,55 @@ function WorkPreparation(t0) {
1146
1311
  width: "40",
1147
1312
  height: "40",
1148
1313
  focusable: "false",
1149
- children: ORB_PARTICLES.map(_temp3$2)
1314
+ children: ORB_PARTICLES.map(_temp6$1)
1150
1315
  })
1151
- }) : null, /* @__PURE__ */ jsx("span", { children: writing.status === "failed" ? `${brandName} couldn’t analyze your writing style` : categories === "failed" && !working ? "Your work needs a little attention" : categories === "done" ? working ? `${brandName} is preparing your writing style` : `${brandName} hasn’t started on your writing style` : working ? `${brandName} is preparing your work` : `${brandName} hasn’t started preparing your work` })]
1152
- });
1316
+ }) : null;
1317
+ $[35] = working;
1318
+ $[36] = t14;
1319
+ } else t14 = $[36];
1320
+ let t15;
1321
+ if ($[37] !== title) {
1322
+ t15 = /* @__PURE__ */ jsx("span", { children: title });
1323
+ $[37] = title;
1324
+ $[38] = t15;
1325
+ } else t15 = $[38];
1326
+ if ($[39] !== t14 || $[40] !== t15) {
1327
+ t11 = /* @__PURE__ */ jsxs("span", {
1328
+ className: "first-run-work__heading",
1329
+ children: [t14, t15]
1330
+ });
1331
+ $[39] = t14;
1332
+ $[40] = t15;
1333
+ $[41] = t11;
1334
+ } else t11 = $[41];
1153
1335
  T1 = Tabs.Root;
1154
1336
  t5 = tab;
1155
- if ($[34] !== onTabChange) {
1337
+ if ($[42] !== onTabChange) {
1156
1338
  t6 = (value) => onTabChange(String(value));
1157
- $[34] = onTabChange;
1158
- $[35] = t6;
1159
- } else t6 = $[35];
1339
+ $[42] = onTabChange;
1340
+ $[43] = t6;
1341
+ } else t6 = $[43];
1160
1342
  t7 = "first-run-work";
1161
- let t14;
1162
- if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
1163
- t14 = /* @__PURE__ */ jsx(Tabs.Indicator, {});
1164
- $[36] = t14;
1165
- } else t14 = $[36];
1343
+ let t17;
1344
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
1345
+ t17 = /* @__PURE__ */ jsx(Tabs.Indicator, {});
1346
+ $[44] = t17;
1347
+ } else t17 = $[44];
1166
1348
  t8 = /* @__PURE__ */ jsxs(Tabs.List, {
1167
1349
  variant: "line",
1168
1350
  className: "first-run-work__tabs",
1169
1351
  "aria-label": "Work preparation",
1170
- children: [stages.map((t13) => {
1171
- const { id: id_0, label, work: work_0, count } = t13;
1352
+ children: [stages.map((t16) => {
1353
+ const { id: id_0, label: label_0, work: work_3, count } = t16;
1172
1354
  return /* @__PURE__ */ jsxs(Tabs.Tab, {
1173
1355
  value: id_0,
1174
1356
  className: "first-run-work__tab",
1175
- "aria-label": label,
1357
+ "aria-label": label_0,
1176
1358
  "aria-describedby": `${groupId}-${id_0}-status`,
1177
1359
  children: [
1178
1360
  /* @__PURE__ */ jsxs("span", {
1179
1361
  className: "first-run-work__tab-label",
1180
- children: [label, /* @__PURE__ */ jsx("span", {
1362
+ children: [label_0, /* @__PURE__ */ jsx("span", {
1181
1363
  className: "first-run-work__tab-count",
1182
1364
  children: count
1183
1365
  })]
@@ -1186,30 +1368,54 @@ function WorkPreparation(t0) {
1186
1368
  className: "first-run-work__tab-state",
1187
1369
  "aria-hidden": "true",
1188
1370
  children: /* @__PURE__ */ jsx(WorkStatusMark, {
1189
- status: work_0.status,
1371
+ status: work_3.status,
1190
1372
  idle: "—"
1191
1373
  })
1192
1374
  }),
1193
1375
  /* @__PURE__ */ jsx("span", {
1194
1376
  id: `${groupId}-${id_0}-status`,
1195
1377
  className: "sigvelo-visually-hidden",
1196
- children: WORK_STATUS_TEXT[work_0.status]
1378
+ children: WORK_STATUS_TEXT[work_3.status]
1197
1379
  })
1198
1380
  ]
1199
1381
  }, id_0);
1200
- }), t14]
1382
+ }), t17]
1201
1383
  });
1384
+ if ($[45] !== brandName || $[46] !== groupId || $[47] !== writing.failure || $[48] !== writing.onRetry || $[49] !== writing.status) {
1385
+ t9 = writing.status === "failed" ? /* @__PURE__ */ jsxs("div", {
1386
+ className: "first-run-work__unfinished",
1387
+ children: [/* @__PURE__ */ jsx("p", {
1388
+ id: `${groupId}-writing-failure`,
1389
+ role: "alert",
1390
+ children: writing.failure ?? `${brandName} couldn’t analyze your writing style.`
1391
+ }), /* @__PURE__ */ jsx(Button, {
1392
+ variant: "surface",
1393
+ color: "neutral",
1394
+ size: "sm",
1395
+ "aria-describedby": `${groupId}-writing-failure`,
1396
+ onClick: writing.onRetry,
1397
+ children: "Analyze writing again"
1398
+ })]
1399
+ }) : null;
1400
+ $[45] = brandName;
1401
+ $[46] = groupId;
1402
+ $[47] = writing.failure;
1403
+ $[48] = writing.onRetry;
1404
+ $[49] = writing.status;
1405
+ $[50] = t9;
1406
+ } else t9 = $[50];
1202
1407
  T0 = Tabs.Panels;
1203
1408
  t3 = "first-run-work__panels";
1204
- t4 = stages.map((t15) => {
1205
- const { id: id_1, label: label_0, work: work_1, description, rows } = t15;
1409
+ t4 = stages.map((t18) => {
1410
+ const { id: id_1, label: label_1, work: work_4, description, rows } = t18;
1206
1411
  return /* @__PURE__ */ jsxs(Tabs.Panel, {
1207
1412
  value: id_1,
1208
1413
  className: "first-run-work__panel",
1414
+ "data-recipe": "scroll-fade-y",
1209
1415
  children: [
1210
1416
  /* @__PURE__ */ jsx("h2", {
1211
1417
  className: "sigvelo-visually-hidden",
1212
- children: label_0
1418
+ children: label_1
1213
1419
  }),
1214
1420
  /* @__PURE__ */ jsx("p", {
1215
1421
  className: "first-run-work__description",
@@ -1218,26 +1424,31 @@ function WorkPreparation(t0) {
1218
1424
  /* @__PURE__ */ jsxs("div", {
1219
1425
  className: "first-run-work__result",
1220
1426
  children: [
1221
- work_1.status !== "done" && work_1.activity?.length ? /* @__PURE__ */ jsx("ul", {
1427
+ work_4.status !== "done" && work_4.activity?.length ? /* @__PURE__ */ jsx("ul", {
1222
1428
  className: "first-run-work__sources",
1223
- "aria-label": `${label_0} activity`,
1224
- children: work_1.activity.map(_temp4$1)
1429
+ "aria-label": `${label_1} activity`,
1430
+ children: work_4.activity.map(_temp7$1)
1225
1431
  }) : null,
1226
1432
  rows.length ? /* @__PURE__ */ jsx("ul", {
1227
1433
  className: "workspace-concept-list",
1228
1434
  children: rows
1229
- }) : work_1.status === "working" && work_1.activity?.length ? null : /* @__PURE__ */ jsx("p", {
1435
+ }) : null,
1436
+ work_4.status === "failed" ? /* @__PURE__ */ jsxs("div", {
1437
+ className: "first-run-work__unfinished",
1438
+ children: [/* @__PURE__ */ jsx("p", {
1439
+ id: `${groupId}-${id_1}-failure`,
1440
+ role: "alert",
1441
+ children: work_4.failure ?? `${brandName} didn’t finish finding your ${label_1.toLowerCase()}.`
1442
+ }), /* @__PURE__ */ jsx(TryAgain, {
1443
+ size: "sm",
1444
+ onClick: work_4.onRetry,
1445
+ "aria-label": `Try again: ${label_1}`,
1446
+ "aria-describedby": `${groupId}-${id_1}-failure`
1447
+ })]
1448
+ }) : rows.length || work_4.status === "working" && work_4.activity?.length ? null : /* @__PURE__ */ jsx("p", {
1230
1449
  className: "first-run-work__empty",
1231
- children: work_1.status === "done" ? `No ${label_0.toLowerCase()} found. You can add them later.` : work_1.status === "failed" ? `${brandName} couldn’t finish this section. Your other work can continue.` : work_1.status === "working" ? `Finding your ${label_0.toLowerCase()}…` : `Waiting to find your ${label_0.toLowerCase()}.`
1232
- }),
1233
- work_1.status === "failed" ? /* @__PURE__ */ jsx(Button, {
1234
- className: "first-run-work__retry",
1235
- variant: "surface",
1236
- color: "neutral",
1237
- onClick: work_1.onRetry,
1238
- "aria-label": `Retry ${label_0}`,
1239
- children: "Try again"
1240
- }) : null
1450
+ children: work_4.status === "done" ? `No ${label_1.toLowerCase()} found. You can add them later.` : work_4.status === "working" ? `Finding your ${label_1.toLowerCase()}…` : `Waiting to find your ${label_1.toLowerCase()}.`
1451
+ })
1241
1452
  ]
1242
1453
  })
1243
1454
  ]
@@ -1257,20 +1468,21 @@ function WorkPreparation(t0) {
1257
1468
  $[13] = skills;
1258
1469
  $[14] = t2;
1259
1470
  $[15] = tab;
1260
- $[16] = writing.status;
1471
+ $[16] = writing;
1261
1472
  $[17] = T0;
1262
1473
  $[18] = T1;
1263
1474
  $[19] = T2;
1264
1475
  $[20] = completed;
1265
1476
  $[21] = stages;
1266
1477
  $[22] = t10;
1267
- $[23] = t3;
1268
- $[24] = t4;
1269
- $[25] = t5;
1270
- $[26] = t6;
1271
- $[27] = t7;
1272
- $[28] = t8;
1273
- $[29] = t9;
1478
+ $[23] = t11;
1479
+ $[24] = t3;
1480
+ $[25] = t4;
1481
+ $[26] = t5;
1482
+ $[27] = t6;
1483
+ $[28] = t7;
1484
+ $[29] = t8;
1485
+ $[30] = t9;
1274
1486
  } else {
1275
1487
  T0 = $[17];
1276
1488
  T1 = $[18];
@@ -1278,96 +1490,95 @@ function WorkPreparation(t0) {
1278
1490
  completed = $[20];
1279
1491
  stages = $[21];
1280
1492
  t10 = $[22];
1281
- t3 = $[23];
1282
- t4 = $[24];
1283
- t5 = $[25];
1284
- t6 = $[26];
1285
- t7 = $[27];
1286
- t8 = $[28];
1287
- t9 = $[29];
1493
+ t11 = $[23];
1494
+ t3 = $[24];
1495
+ t4 = $[25];
1496
+ t5 = $[26];
1497
+ t6 = $[27];
1498
+ t7 = $[28];
1499
+ t8 = $[29];
1500
+ t9 = $[30];
1288
1501
  }
1289
- let t11;
1290
- if ($[37] !== T0 || $[38] !== t3 || $[39] !== t4) {
1291
- t11 = /* @__PURE__ */ jsx(T0, {
1502
+ let t12;
1503
+ if ($[51] !== T0 || $[52] !== t3 || $[53] !== t4) {
1504
+ t12 = /* @__PURE__ */ jsx(T0, {
1292
1505
  className: t3,
1293
1506
  children: t4
1294
1507
  });
1295
- $[37] = T0;
1296
- $[38] = t3;
1297
- $[39] = t4;
1298
- $[40] = t11;
1299
- } else t11 = $[40];
1300
- let t12;
1301
- if ($[41] !== T1 || $[42] !== t11 || $[43] !== t5 || $[44] !== t6 || $[45] !== t7 || $[46] !== t8) {
1302
- t12 = /* @__PURE__ */ jsxs(T1, {
1508
+ $[51] = T0;
1509
+ $[52] = t3;
1510
+ $[53] = t4;
1511
+ $[54] = t12;
1512
+ } else t12 = $[54];
1513
+ let t13;
1514
+ if ($[55] !== T1 || $[56] !== t12 || $[57] !== t5 || $[58] !== t6 || $[59] !== t7 || $[60] !== t8 || $[61] !== t9) {
1515
+ t13 = /* @__PURE__ */ jsxs(T1, {
1303
1516
  value: t5,
1304
1517
  onValueChange: t6,
1305
1518
  className: t7,
1306
- children: [t8, t11]
1519
+ children: [
1520
+ t8,
1521
+ t9,
1522
+ t12
1523
+ ]
1307
1524
  });
1308
- $[41] = T1;
1309
- $[42] = t11;
1310
- $[43] = t5;
1311
- $[44] = t6;
1312
- $[45] = t7;
1313
- $[46] = t8;
1314
- $[47] = t12;
1315
- } else t12 = $[47];
1316
- let t13;
1317
- if ($[48] !== writing.onRetry || $[49] !== writing.status) {
1318
- t13 = writing.status === "failed" ? /* @__PURE__ */ jsx(TryAgain, {
1319
- onClick: writing.onRetry,
1320
- "aria-label": "Retry writing style analysis"
1321
- }) : null;
1322
- $[48] = writing.onRetry;
1323
- $[49] = writing.status;
1324
- $[50] = t13;
1325
- } else t13 = $[50];
1326
- const t14 = !completed;
1525
+ $[55] = T1;
1526
+ $[56] = t12;
1527
+ $[57] = t5;
1528
+ $[58] = t6;
1529
+ $[59] = t7;
1530
+ $[60] = t8;
1531
+ $[61] = t9;
1532
+ $[62] = t13;
1533
+ } else t13 = $[62];
1534
+ const t14 = !completed && preparation !== "failed";
1327
1535
  let t15;
1328
- if ($[51] !== t14) {
1329
- t15 = /* @__PURE__ */ jsx(Next, { disabled: t14 });
1330
- $[51] = t14;
1331
- $[52] = t15;
1332
- } else t15 = $[52];
1536
+ if ($[63] !== t14) {
1537
+ t15 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(Next, { disabled: t14 }) });
1538
+ $[63] = t14;
1539
+ $[64] = t15;
1540
+ } else t15 = $[64];
1333
1541
  let t16;
1334
- if ($[53] !== t13 || $[54] !== t15) {
1335
- t16 = /* @__PURE__ */ jsxs(Actions, { children: [t13, t15] });
1336
- $[53] = t13;
1337
- $[54] = t15;
1338
- $[55] = t16;
1339
- } else t16 = $[55];
1542
+ if ($[65] !== writing) {
1543
+ t16 = {
1544
+ label: "Writing style",
1545
+ work: writing
1546
+ };
1547
+ $[65] = writing;
1548
+ $[66] = t16;
1549
+ } else t16 = $[66];
1340
1550
  let t17;
1341
- if ($[56] !== stages) {
1342
- t17 = stages.map(_temp5$1);
1343
- $[56] = stages;
1344
- $[57] = t17;
1345
- } else t17 = $[57];
1551
+ if ($[67] !== stages || $[68] !== t16) {
1552
+ t17 = [...stages, t16].map(_temp8);
1553
+ $[67] = stages;
1554
+ $[68] = t16;
1555
+ $[69] = t17;
1556
+ } else t17 = $[69];
1346
1557
  const t18 = t17.join(". ");
1347
1558
  let t19;
1348
- if ($[58] !== T2 || $[59] !== t10 || $[60] !== t12 || $[61] !== t16 || $[62] !== t18 || $[63] !== t9) {
1559
+ if ($[70] !== T2 || $[71] !== t10 || $[72] !== t11 || $[73] !== t13 || $[74] !== t15 || $[75] !== t18) {
1349
1560
  t19 = /* @__PURE__ */ jsx(T2, {
1350
- layout: t9,
1351
- title: t10,
1352
- body: t12,
1353
- actions: t16,
1561
+ layout: t10,
1562
+ title: t11,
1563
+ body: t13,
1564
+ actions: t15,
1354
1565
  announce: t18
1355
1566
  });
1356
- $[58] = T2;
1357
- $[59] = t10;
1358
- $[60] = t12;
1359
- $[61] = t16;
1360
- $[62] = t18;
1361
- $[63] = t9;
1362
- $[64] = t19;
1363
- } else t19 = $[64];
1567
+ $[70] = T2;
1568
+ $[71] = t10;
1569
+ $[72] = t11;
1570
+ $[73] = t13;
1571
+ $[74] = t15;
1572
+ $[75] = t18;
1573
+ $[76] = t19;
1574
+ } else t19 = $[76];
1364
1575
  return t19;
1365
1576
  }
1366
- function _temp5$1(t0) {
1367
- const { label: label_1, work: work_2 } = t0;
1368
- return `${label_1}: ${WORK_STATUS_TEXT[work_2.status]}`;
1577
+ function _temp8(t0) {
1578
+ const { label: label_2, work: work_5 } = t0;
1579
+ return `${label_2}: ${WORK_STATUS_TEXT[work_5.status]}`;
1369
1580
  }
1370
- function _temp4$1(activity) {
1581
+ function _temp7$1(activity) {
1371
1582
  return /* @__PURE__ */ jsxs("li", {
1372
1583
  className: "first-run-work__source",
1373
1584
  children: [
@@ -1385,13 +1596,13 @@ function _temp4$1(activity) {
1385
1596
  className: "first-run-work__source-status",
1386
1597
  children: /* @__PURE__ */ jsx(WorkStatusMark, {
1387
1598
  status: activity.status,
1388
- text: ACTIVITY_STATUS_TEXT
1599
+ text: WORK_STATUS_TEXT
1389
1600
  })
1390
1601
  })
1391
1602
  ]
1392
1603
  }, activity.id);
1393
1604
  }
1394
- function _temp3$2(t0) {
1605
+ function _temp6$1(t0) {
1395
1606
  const { id, x, y, radius, opacity } = t0;
1396
1607
  return /* @__PURE__ */ jsx("circle", {
1397
1608
  className: "first-run-orb__particle",
@@ -1401,9 +1612,24 @@ function _temp3$2(t0) {
1401
1612
  opacity
1402
1613
  }, id);
1403
1614
  }
1615
+ function _temp5$1(t0) {
1616
+ const { work: work_2 } = t0;
1617
+ return work_2.status === "failed";
1618
+ }
1619
+ function _temp4$1(t0) {
1620
+ const { work: work_1 } = t0;
1621
+ return work_1.status === "failed" || work_1.status === "idle";
1622
+ }
1623
+ function _temp3$2(t0) {
1624
+ const { label, work: work_0 } = t0;
1625
+ return {
1626
+ label,
1627
+ work: work_0
1628
+ };
1629
+ }
1404
1630
  function _temp2$3(t0) {
1405
1631
  const { work } = t0;
1406
- return work;
1632
+ return work.status;
1407
1633
  }
1408
1634
  function _temp$4(skill) {
1409
1635
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceEntityCard, {
@@ -1413,159 +1639,172 @@ function _temp$4(skill) {
1413
1639
  meta: firstLine(skill.description)
1414
1640
  }) }, skill.name);
1415
1641
  }
1416
- /** How a preparation tab names its status. */
1642
+ /** How a preparation tab or source row names its status. */
1417
1643
  const WORK_STATUS_TEXT = {
1418
1644
  idle: "Waiting",
1419
1645
  working: "Preparing",
1420
1646
  done: "Ready",
1421
- failed: "Needs attention"
1422
- };
1423
- /** How a source row names its status, in words while it waits or works. */
1424
- const ACTIVITY_STATUS_TEXT = {
1425
- idle: "Waiting",
1426
- working: "Checking…",
1427
- done: "Completed",
1428
- failed: "Needs attention"
1647
+ failed: "Didn’t finish"
1429
1648
  };
1430
1649
  //#endregion
1431
1650
  //#region src/components/extension/first-run/WorkTrial.tsx
1651
+ /**
1652
+ * The offered automation's run. Setup owns it, so a run outlives its screen
1653
+ * and the selector can mark Try an automation once one completes.
1654
+ */
1655
+ function useTrialRun(automation, source) {
1656
+ const $ = c(9);
1657
+ let t0;
1658
+ if ($[0] !== source) {
1659
+ t0 = { mutationFn: (path) => source.onRun({
1660
+ path,
1661
+ args: {}
1662
+ }) };
1663
+ $[0] = source;
1664
+ $[1] = t0;
1665
+ } else t0 = $[1];
1666
+ const request = useMutation(t0);
1667
+ const trace = automation && source.trace?.path === automation.path ? source.trace : void 0;
1668
+ let t1;
1669
+ if ($[2] !== request.status || $[3] !== trace) {
1670
+ t1 = tryStatus(request.status, trace);
1671
+ $[2] = request.status;
1672
+ $[3] = trace;
1673
+ $[4] = t1;
1674
+ } else t1 = $[4];
1675
+ let t2;
1676
+ if ($[5] !== request || $[6] !== t1 || $[7] !== trace) {
1677
+ t2 = {
1678
+ request,
1679
+ trace,
1680
+ status: t1
1681
+ };
1682
+ $[5] = request;
1683
+ $[6] = t1;
1684
+ $[7] = trace;
1685
+ $[8] = t2;
1686
+ } else t2 = $[8];
1687
+ return t2;
1688
+ }
1432
1689
  /** A trial is separate from schedule decisions and always starts with an explicit Run action. */
1433
1690
  function WorkTrial(t0) {
1434
- const $ = c(47);
1435
- const { automation, source } = t0;
1691
+ const $ = c(41);
1692
+ const { automation, source, run: t1 } = t0;
1693
+ const { request: run, trace, status } = t1;
1436
1694
  const { brandName } = useFirstRun();
1437
- const trace = source.trace?.path === automation.path ? source.trace : void 0;
1438
- let t1;
1439
- if ($[0] !== automation.path || $[1] !== source.onRun) {
1440
- t1 = { mutationFn: () => source.onRun({
1441
- path: automation.path,
1442
- args: {}
1443
- }) };
1444
- $[0] = automation.path;
1445
- $[1] = source.onRun;
1446
- $[2] = t1;
1447
- } else t1 = $[2];
1448
- const run = useMutation(t1);
1449
1695
  let t2;
1450
- if ($[3] !== source.onStop) {
1696
+ if ($[0] !== source) {
1451
1697
  t2 = { mutationFn: (executionId) => source.onStop(executionId) };
1452
- $[3] = source.onStop;
1453
- $[4] = t2;
1454
- } else t2 = $[4];
1698
+ $[0] = source;
1699
+ $[1] = t2;
1700
+ } else t2 = $[1];
1455
1701
  const stop = useMutation(t2);
1456
1702
  let t3;
1457
- if ($[5] !== run.status || $[6] !== trace) {
1458
- t3 = tryStatus(run.status, trace);
1459
- $[5] = run.status;
1460
- $[6] = trace;
1461
- $[7] = t3;
1462
- } else t3 = $[7];
1463
- const status = t3;
1703
+ if ($[2] !== trace) {
1704
+ t3 = trace ? boardNotice(trace.graph, trace) : void 0;
1705
+ $[2] = trace;
1706
+ $[3] = t3;
1707
+ } else t3 = $[3];
1708
+ const notice = t3;
1464
1709
  let t4;
1465
- if ($[8] !== trace) {
1466
- t4 = trace ? boardNotice(trace.graph, trace) : void 0;
1467
- $[8] = trace;
1468
- $[9] = t4;
1469
- } else t4 = $[9];
1470
- const notice = t4;
1471
- let t5;
1472
- if ($[10] !== automation.graph || $[11] !== trace?.graph) {
1473
- t5 = (trace?.graph ?? automation.graph)?.nodes ?? [];
1474
- $[10] = automation.graph;
1475
- $[11] = trace?.graph;
1476
- $[12] = t5;
1477
- } else t5 = $[12];
1478
- const nodes = t5;
1710
+ if ($[4] !== automation || $[5] !== trace?.graph) {
1711
+ t4 = (trace?.graph ?? automation.graph)?.nodes ?? [];
1712
+ $[4] = automation;
1713
+ $[5] = trace?.graph;
1714
+ $[6] = t4;
1715
+ } else t4 = $[6];
1716
+ const nodes = t4;
1479
1717
  const busy = status === "running";
1480
- const t6 = status === "idle" ? "Try an automation now" : status === "done" ? "Done" : automation.name;
1718
+ const t5 = status === "idle" ? "Try an automation" : automation.name;
1719
+ let t6;
1720
+ if ($[7] !== automation || $[8] !== brandName || $[9] !== busy || $[10] !== notice?.text || $[11] !== run || $[12] !== status || $[13] !== stop || $[14] !== trace?.result) {
1721
+ t6 = status === "idle" ? [automation.description, `${brandName} can run “${automation.name}” now, in tabs of its own.`].filter(Boolean).join(" ") : busy ? stop.error ? executionErrorSummary(formatErrorMessage(stop.error)) : `${brandName} is working in tabs of its own.` : status === "done" ? firstLine(executionResultSummary(run.data?.result ?? trace?.result)) : notice?.text ?? executionErrorSummary(formatErrorMessage(run.error));
1722
+ $[7] = automation;
1723
+ $[8] = brandName;
1724
+ $[9] = busy;
1725
+ $[10] = notice?.text;
1726
+ $[11] = run;
1727
+ $[12] = status;
1728
+ $[13] = stop;
1729
+ $[14] = trace?.result;
1730
+ $[15] = t6;
1731
+ } else t6 = $[15];
1481
1732
  let t7;
1482
- if ($[13] !== automation.name || $[14] !== brandName || $[15] !== busy || $[16] !== notice?.text || $[17] !== run.data?.result || $[18] !== run.error || $[19] !== status || $[20] !== stop || $[21] !== trace?.result) {
1483
- t7 = status === "idle" ? `${brandName} can run “${automation.name}” for you now, in tabs of its own.` : busy ? stop.error ? executionErrorSummary(formatErrorMessage(stop.error)) : `${brandName} is working in tabs of its own.` : status === "done" ? firstLine(executionResultSummary(run.data?.result ?? trace?.result)) : notice?.text ?? executionErrorSummary(formatErrorMessage(run.error));
1484
- $[13] = automation.name;
1485
- $[14] = brandName;
1486
- $[15] = busy;
1487
- $[16] = notice?.text;
1488
- $[17] = run.data?.result;
1489
- $[18] = run.error;
1490
- $[19] = status;
1491
- $[20] = stop;
1492
- $[21] = trace?.result;
1493
- $[22] = t7;
1494
- } else t7 = $[22];
1495
- let t8;
1496
- if ($[23] !== nodes || $[24] !== status || $[25] !== trace) {
1497
- t8 = status !== "idle" && nodes.length ? /* @__PURE__ */ jsx(RunProgress, {
1733
+ if ($[16] !== nodes || $[17] !== status || $[18] !== trace) {
1734
+ t7 = status !== "idle" && nodes.length ? /* @__PURE__ */ jsx(RunProgress, {
1498
1735
  nodes,
1499
1736
  trace
1500
1737
  }) : void 0;
1501
- $[23] = nodes;
1502
- $[24] = status;
1503
- $[25] = trace;
1504
- $[26] = t8;
1505
- } else t8 = $[26];
1738
+ $[16] = nodes;
1739
+ $[17] = status;
1740
+ $[18] = trace;
1741
+ $[19] = t7;
1742
+ } else t7 = $[19];
1743
+ let t8;
1744
+ if ($[20] !== busy) {
1745
+ t8 = /* @__PURE__ */ jsx(Back, { disabled: busy });
1746
+ $[20] = busy;
1747
+ $[21] = t8;
1748
+ } else t8 = $[21];
1506
1749
  let t9;
1507
- if ($[27] !== busy) {
1508
- t9 = /* @__PURE__ */ jsx(Back, { disabled: busy });
1509
- $[27] = busy;
1510
- $[28] = t9;
1511
- } else t9 = $[28];
1512
- let t10;
1513
- if ($[29] !== busy || $[30] !== run || $[31] !== source.onStop || $[32] !== status || $[33] !== stop || $[34] !== trace) {
1514
- t10 = busy ? source.onStop && trace ? /* @__PURE__ */ jsx(Button, {
1750
+ if ($[22] !== automation || $[23] !== busy || $[24] !== run || $[25] !== source || $[26] !== status || $[27] !== stop || $[28] !== trace) {
1751
+ t9 = busy ? source.onStop && trace ? /* @__PURE__ */ jsx(Button, {
1515
1752
  variant: "surface",
1516
1753
  color: "neutral",
1517
1754
  size: "md",
1518
1755
  disabled: stop.isPending,
1756
+ focusableWhenDisabled: stop.isPending,
1519
1757
  onClick: () => stop.mutate(trace.executionId),
1520
1758
  children: "Stop run"
1521
1759
  }) : null : status === "idle" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(NotNow, {}), /* @__PURE__ */ jsx(Button, {
1522
1760
  size: "md",
1523
- onClick: () => run.mutate(),
1524
- children: "Run it"
1525
- })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [status === "failed" ? /* @__PURE__ */ jsx(TryAgain, { onClick: () => run.mutate() }) : null, /* @__PURE__ */ jsx(Next, {})] });
1526
- $[29] = busy;
1527
- $[30] = run;
1528
- $[31] = source.onStop;
1529
- $[32] = status;
1530
- $[33] = stop;
1531
- $[34] = trace;
1532
- $[35] = t10;
1533
- } else t10 = $[35];
1534
- let t11;
1535
- if ($[36] !== t10) {
1536
- t11 = /* @__PURE__ */ jsx("div", {
1761
+ onClick: () => run.mutate(automation.path),
1762
+ children: "Run"
1763
+ })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [status === "failed" ? /* @__PURE__ */ jsx(TryAgain, { onClick: () => run.mutate(automation.path) }) : null, /* @__PURE__ */ jsx(Next, {})] });
1764
+ $[22] = automation;
1765
+ $[23] = busy;
1766
+ $[24] = run;
1767
+ $[25] = source;
1768
+ $[26] = status;
1769
+ $[27] = stop;
1770
+ $[28] = trace;
1771
+ $[29] = t9;
1772
+ } else t9 = $[29];
1773
+ let t10;
1774
+ if ($[30] !== t9) {
1775
+ t10 = /* @__PURE__ */ jsx("div", {
1537
1776
  className: "first-run-actions__end",
1538
- children: t10
1777
+ children: t9
1539
1778
  });
1540
- $[36] = t10;
1541
- $[37] = t11;
1542
- } else t11 = $[37];
1543
- let t12;
1544
- if ($[38] !== t11 || $[39] !== t9) {
1545
- t12 = /* @__PURE__ */ jsxs(Fragment, { children: [t9, t11] });
1546
- $[38] = t11;
1547
- $[39] = t9;
1548
- $[40] = t12;
1549
- } else t12 = $[40];
1550
- const t13 = busy ? `Running ${automation.name}` : status === "done" ? "Run completed" : "";
1551
- let t14;
1552
- if ($[41] !== t12 || $[42] !== t13 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8) {
1553
- t14 = /* @__PURE__ */ jsx(Step, {
1779
+ $[30] = t9;
1780
+ $[31] = t10;
1781
+ } else t10 = $[31];
1782
+ let t11;
1783
+ if ($[32] !== t10 || $[33] !== t8) {
1784
+ t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t8, t10] });
1785
+ $[32] = t10;
1786
+ $[33] = t8;
1787
+ $[34] = t11;
1788
+ } else t11 = $[34];
1789
+ const t12 = busy ? `Running ${automation.name}` : status === "done" ? `Ran ${automation.name}` : "";
1790
+ let t13;
1791
+ if ($[35] !== t11 || $[36] !== t12 || $[37] !== t5 || $[38] !== t6 || $[39] !== t7) {
1792
+ t13 = /* @__PURE__ */ jsx(Step, {
1554
1793
  narrow: true,
1555
- title: t6,
1556
- lead: t7,
1557
- body: t8,
1558
- actions: t12,
1559
- announce: t13
1794
+ title: t5,
1795
+ lead: t6,
1796
+ body: t7,
1797
+ actions: t11,
1798
+ announce: t12
1560
1799
  });
1561
- $[41] = t12;
1562
- $[42] = t13;
1563
- $[43] = t6;
1564
- $[44] = t7;
1565
- $[45] = t8;
1566
- $[46] = t14;
1567
- } else t14 = $[46];
1568
- return t14;
1800
+ $[35] = t11;
1801
+ $[36] = t12;
1802
+ $[37] = t5;
1803
+ $[38] = t6;
1804
+ $[39] = t7;
1805
+ $[40] = t13;
1806
+ } else t13 = $[40];
1807
+ return t13;
1569
1808
  }
1570
1809
  /** Where the tried run stands: its trace once the host streams one, else the request. */
1571
1810
  function tryStatus(request, trace) {
@@ -1650,7 +1889,7 @@ function ScheduleReview(t0) {
1650
1889
  $[3] = t2;
1651
1890
  } else t2 = $[3];
1652
1891
  const saving = useIsMutating(t2) > 0;
1653
- const t3 = automations.length ? "Choose scheduled tasks" : "No schedules suggested";
1892
+ const t3 = automations.length ? "Choose schedules" : "No schedules suggested";
1654
1893
  const t4 = automations.length ? "Only schedules you turn on will run automatically." : `You can ask ${brandName} to schedule work anytime.`;
1655
1894
  let t5;
1656
1895
  if ($[4] !== automations || $[5] !== mutationKey || $[6] !== schedules) {
@@ -1713,7 +1952,7 @@ function ScheduleReview(t0) {
1713
1952
  }
1714
1953
  /** Each switch is an explicit, immediately saved approval with its own pending/error state. */
1715
1954
  function ScheduleChoice(t0) {
1716
- const $ = c(50);
1955
+ const $ = c(44);
1717
1956
  const { automation, schedules, mutationKey } = t0;
1718
1957
  const id = React.useId();
1719
1958
  let t1;
@@ -1724,145 +1963,131 @@ function ScheduleChoice(t0) {
1724
1963
  } else t1 = $[1];
1725
1964
  const schedule = schedules.list.find(t1);
1726
1965
  const enabled = schedule?.enabled ?? false;
1727
- let t2;
1728
- if ($[2] !== automation || $[3] !== schedules) {
1729
- t2 = (value) => schedules.onChange(automation, value);
1730
- $[2] = automation;
1731
- $[3] = schedules;
1732
- $[4] = t2;
1733
- } else t2 = $[4];
1734
- let t3;
1735
- if ($[5] !== mutationKey || $[6] !== t2) {
1736
- t3 = {
1737
- mutationKey,
1738
- mutationFn: t2
1739
- };
1740
- $[5] = mutationKey;
1741
- $[6] = t2;
1742
- $[7] = t3;
1743
- } else t3 = $[7];
1744
- const change = useMutation(t3);
1966
+ const change = useMutation({
1967
+ mutationKey,
1968
+ mutationFn: (value) => schedules.onChange(automation, value, schedule)
1969
+ });
1745
1970
  const next = enabled && schedule ? getThinkScheduleNextRun(schedule) : void 0;
1746
- const t4 = change.isPending;
1747
- let t5;
1748
- if ($[8] !== automation.name) {
1749
- t5 = /* @__PURE__ */ jsx("strong", { children: automation.name });
1750
- $[8] = automation.name;
1751
- $[9] = t5;
1752
- } else t5 = $[9];
1753
- let t6;
1754
- if ($[10] !== id || $[11] !== t5) {
1755
- t6 = /* @__PURE__ */ jsx("label", {
1971
+ const t2 = change.isPending;
1972
+ let t3;
1973
+ if ($[2] !== automation.name) {
1974
+ t3 = /* @__PURE__ */ jsx("strong", { children: automation.name });
1975
+ $[2] = automation.name;
1976
+ $[3] = t3;
1977
+ } else t3 = $[3];
1978
+ let t4;
1979
+ if ($[4] !== id || $[5] !== t3) {
1980
+ t4 = /* @__PURE__ */ jsx("label", {
1756
1981
  htmlFor: id,
1757
- children: t5
1982
+ children: t3
1758
1983
  });
1759
- $[10] = id;
1760
- $[11] = t5;
1761
- $[12] = t6;
1762
- } else t6 = $[12];
1763
- const t7 = `${id}-timing`;
1764
- const t8 = automation.schedule ?? "";
1984
+ $[4] = id;
1985
+ $[5] = t3;
1986
+ $[6] = t4;
1987
+ } else t4 = $[6];
1988
+ const t5 = `${id}-timing`;
1989
+ const t6 = automation.schedule ?? "";
1990
+ let t7;
1991
+ if ($[7] !== t6) {
1992
+ t7 = formatThinkScheduleRepeat(t6);
1993
+ $[7] = t6;
1994
+ $[8] = t7;
1995
+ } else t7 = $[8];
1996
+ let t8;
1997
+ if ($[9] !== t5 || $[10] !== t7) {
1998
+ t8 = /* @__PURE__ */ jsx("span", {
1999
+ id: t5,
2000
+ children: t7
2001
+ });
2002
+ $[9] = t5;
2003
+ $[10] = t7;
2004
+ $[11] = t8;
2005
+ } else t8 = $[11];
1765
2006
  let t9;
1766
- if ($[13] !== t8) {
1767
- t9 = formatThinkScheduleRepeat(t8);
1768
- $[13] = t8;
1769
- $[14] = t9;
1770
- } else t9 = $[14];
2007
+ if ($[12] !== next) {
2008
+ t9 = next ? /* @__PURE__ */ jsxs("small", { children: ["Next ", next] }) : null;
2009
+ $[12] = next;
2010
+ $[13] = t9;
2011
+ } else t9 = $[13];
1771
2012
  let t10;
1772
- if ($[15] !== t7 || $[16] !== t9) {
1773
- t10 = /* @__PURE__ */ jsx("span", {
1774
- id: t7,
1775
- children: t9
2013
+ if ($[14] !== t4 || $[15] !== t8 || $[16] !== t9) {
2014
+ t10 = /* @__PURE__ */ jsxs("div", {
2015
+ className: "first-run-schedule__copy",
2016
+ children: [
2017
+ t4,
2018
+ t8,
2019
+ t9
2020
+ ]
1776
2021
  });
1777
- $[15] = t7;
2022
+ $[14] = t4;
2023
+ $[15] = t8;
1778
2024
  $[16] = t9;
1779
2025
  $[17] = t10;
1780
2026
  } else t10 = $[17];
1781
2027
  let t11;
1782
- if ($[18] !== next) {
1783
- t11 = next ? /* @__PURE__ */ jsxs("small", { children: ["Next ", next] }) : null;
1784
- $[18] = next;
1785
- $[19] = t11;
1786
- } else t11 = $[19];
1787
- let t12;
1788
- if ($[20] !== t10 || $[21] !== t11 || $[22] !== t6) {
1789
- t12 = /* @__PURE__ */ jsxs("div", {
1790
- className: "first-run-schedule__copy",
1791
- children: [
1792
- t6,
1793
- t10,
1794
- t11
1795
- ]
1796
- });
1797
- $[20] = t10;
1798
- $[21] = t11;
1799
- $[22] = t6;
1800
- $[23] = t12;
1801
- } else t12 = $[23];
1802
- let t13;
1803
- if ($[24] !== change.isPending) {
1804
- t13 = change.isPending ? /* @__PURE__ */ jsx("span", {
2028
+ if ($[18] !== change.isPending) {
2029
+ t11 = change.isPending ? /* @__PURE__ */ jsx("span", {
1805
2030
  role: "status",
1806
2031
  children: "Saving…"
1807
2032
  }) : null;
1808
- $[24] = change.isPending;
1809
- $[25] = t13;
1810
- } else t13 = $[25];
1811
- const t14 = `${id}-timing`;
1812
- const t15 = change.isPending ? change.variables : enabled;
2033
+ $[18] = change.isPending;
2034
+ $[19] = t11;
2035
+ } else t11 = $[19];
2036
+ const t12 = `${id}-timing`;
2037
+ const t13 = change.isPending ? change.variables : enabled;
2038
+ let t14;
2039
+ if ($[20] !== change) {
2040
+ t14 = (value_0) => change.mutate(value_0);
2041
+ $[20] = change;
2042
+ $[21] = t14;
2043
+ } else t14 = $[21];
2044
+ let t15;
2045
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
2046
+ t15 = /* @__PURE__ */ jsx(Switch.Thumb, {});
2047
+ $[22] = t15;
2048
+ } else t15 = $[22];
1813
2049
  let t16;
1814
- if ($[26] !== change) {
1815
- t16 = (value_0) => change.mutate(value_0);
1816
- $[26] = change;
1817
- $[27] = t16;
1818
- } else t16 = $[27];
1819
- let t17;
1820
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
1821
- t17 = /* @__PURE__ */ jsx(Switch.Thumb, {});
1822
- $[28] = t17;
1823
- } else t17 = $[28];
1824
- let t18;
1825
- if ($[29] !== automation.name || $[30] !== change.isPending || $[31] !== id || $[32] !== t14 || $[33] !== t15 || $[34] !== t16) {
1826
- t18 = /* @__PURE__ */ jsx(Switch.Root, {
2050
+ if ($[23] !== automation.name || $[24] !== change.isPending || $[25] !== id || $[26] !== t12 || $[27] !== t13 || $[28] !== t14) {
2051
+ t16 = /* @__PURE__ */ jsx(Switch.Root, {
1827
2052
  id,
1828
2053
  "aria-label": automation.name,
1829
- "aria-describedby": t14,
1830
- checked: t15,
2054
+ "aria-describedby": t12,
2055
+ checked: t13,
1831
2056
  disabled: change.isPending,
1832
- onCheckedChange: t16,
1833
- children: t17
2057
+ onCheckedChange: t14,
2058
+ children: t15
1834
2059
  });
1835
- $[29] = automation.name;
1836
- $[30] = change.isPending;
1837
- $[31] = id;
1838
- $[32] = t14;
1839
- $[33] = t15;
1840
- $[34] = t16;
1841
- $[35] = t18;
1842
- } else t18 = $[35];
1843
- let t19;
1844
- if ($[36] !== t13 || $[37] !== t18) {
1845
- t19 = /* @__PURE__ */ jsxs("div", {
2060
+ $[23] = automation.name;
2061
+ $[24] = change.isPending;
2062
+ $[25] = id;
2063
+ $[26] = t12;
2064
+ $[27] = t13;
2065
+ $[28] = t14;
2066
+ $[29] = t16;
2067
+ } else t16 = $[29];
2068
+ let t17;
2069
+ if ($[30] !== t11 || $[31] !== t16) {
2070
+ t17 = /* @__PURE__ */ jsxs("div", {
1846
2071
  className: "first-run-schedule__control",
1847
- children: [t13, t18]
2072
+ children: [t11, t16]
1848
2073
  });
1849
- $[36] = t13;
1850
- $[37] = t18;
1851
- $[38] = t19;
1852
- } else t19 = $[38];
1853
- let t20;
1854
- if ($[39] !== t12 || $[40] !== t19) {
1855
- t20 = /* @__PURE__ */ jsxs("div", {
2074
+ $[30] = t11;
2075
+ $[31] = t16;
2076
+ $[32] = t17;
2077
+ } else t17 = $[32];
2078
+ let t18;
2079
+ if ($[33] !== t10 || $[34] !== t17) {
2080
+ t18 = /* @__PURE__ */ jsxs("div", {
1856
2081
  className: "first-run-schedule",
1857
- children: [t12, t19]
2082
+ children: [t10, t17]
1858
2083
  });
1859
- $[39] = t12;
1860
- $[40] = t19;
1861
- $[41] = t20;
1862
- } else t20 = $[41];
1863
- let t21;
1864
- if ($[42] !== automation.name || $[43] !== change || $[44] !== enabled) {
1865
- t21 = change.isError ? /* @__PURE__ */ jsxs("div", {
2084
+ $[33] = t10;
2085
+ $[34] = t17;
2086
+ $[35] = t18;
2087
+ } else t18 = $[35];
2088
+ let t19;
2089
+ if ($[36] !== automation.name || $[37] !== change || $[38] !== enabled) {
2090
+ t19 = change.isError ? /* @__PURE__ */ jsxs("div", {
1866
2091
  className: "first-run-schedule__error",
1867
2092
  children: [/* @__PURE__ */ jsxs("p", {
1868
2093
  role: "alert",
@@ -1876,29 +2101,29 @@ function ScheduleChoice(t0) {
1876
2101
  variant: "ghost",
1877
2102
  color: "neutral",
1878
2103
  size: "sm",
1879
- "aria-label": `Retry ${automation.name}`,
2104
+ "aria-label": `Try again: ${automation.name}`,
1880
2105
  onClick: () => change.mutate(change.variables ?? !enabled),
1881
- children: "Retry"
2106
+ children: "Try again"
1882
2107
  })]
1883
2108
  }) : null;
1884
- $[42] = automation.name;
1885
- $[43] = change;
1886
- $[44] = enabled;
1887
- $[45] = t21;
1888
- } else t21 = $[45];
1889
- let t22;
1890
- if ($[46] !== change.isPending || $[47] !== t20 || $[48] !== t21) {
1891
- t22 = /* @__PURE__ */ jsxs("li", {
2109
+ $[36] = automation.name;
2110
+ $[37] = change;
2111
+ $[38] = enabled;
2112
+ $[39] = t19;
2113
+ } else t19 = $[39];
2114
+ let t20;
2115
+ if ($[40] !== change.isPending || $[41] !== t18 || $[42] !== t19) {
2116
+ t20 = /* @__PURE__ */ jsxs("li", {
1892
2117
  className: "first-run-schedule-choice",
1893
- "aria-busy": t4,
1894
- children: [t20, t21]
2118
+ "aria-busy": t2,
2119
+ children: [t18, t19]
1895
2120
  });
1896
- $[46] = change.isPending;
1897
- $[47] = t20;
1898
- $[48] = t21;
1899
- $[49] = t22;
1900
- } else t22 = $[49];
1901
- return t22;
2121
+ $[40] = change.isPending;
2122
+ $[41] = t18;
2123
+ $[42] = t19;
2124
+ $[43] = t20;
2125
+ } else t20 = $[43];
2126
+ return t20;
1902
2127
  }
1903
2128
  //#endregion
1904
2129
  //#region src/components/extension/first-run/WritingStep.tsx
@@ -1910,10 +2135,10 @@ const STYLES = [
1910
2135
  ];
1911
2136
  /** Preview the selected writing style and signing identity together. */
1912
2137
  function WritingStep(t0) {
1913
- const $ = c(86);
2138
+ const $ = c(79);
1914
2139
  const { writing, answer, onStyleChange, onSignChange, onReviewed, profileEmail } = t0;
1915
2140
  const { brandName } = useFirstRun();
1916
- const profileLabel = profileEmail ?? "Current Chrome profile";
2141
+ const profileLabel = profileEmail ?? "Me (Chrome profile)";
1917
2142
  let T0;
1918
2143
  let t1;
1919
2144
  let t2;
@@ -1923,188 +2148,183 @@ function WritingStep(t0) {
1923
2148
  let t6;
1924
2149
  let t7;
1925
2150
  let t8;
1926
- if ($[0] !== answer || $[1] !== brandName || $[2] !== onSignChange || $[3] !== onStyleChange || $[4] !== profileLabel || $[5] !== writing.samples || $[6] !== writing.status || $[7] !== writing.suggested) {
2151
+ if ($[0] !== answer || $[1] !== brandName || $[2] !== onSignChange || $[3] !== onStyleChange || $[4] !== profileLabel || $[5] !== writing.samples || $[6] !== writing.suggested) {
1927
2152
  let t9;
1928
- if ($[17] !== answer.sign || $[18] !== answer.style) {
2153
+ if ($[16] !== answer.sign || $[17] !== answer.style) {
1929
2154
  t9 = (candidate) => candidate.style === answer.style && candidate.sign === answer.sign;
1930
- $[17] = answer.sign;
1931
- $[18] = answer.style;
1932
- $[19] = t9;
1933
- } else t9 = $[19];
2155
+ $[16] = answer.sign;
2156
+ $[17] = answer.style;
2157
+ $[18] = t9;
2158
+ } else t9 = $[18];
1934
2159
  const sample = writing.samples.find(t9);
1935
- const working = writing.status === "working";
1936
2160
  T0 = Step;
1937
2161
  t6 = "writing";
1938
2162
  t7 = "Writing style";
1939
- t8 = working ? `${brandName} is studying your sent emails to suggest a writing style.` : writing.status === "done" && writing.suggested ? `${brandName} recommends a tone based on your sent emails.` : "Choose a tone and signature for this Chrome profile.";
2163
+ t8 = writing.suggested ? `${brandName} recommends a tone based on your sent emails.` : "Choose a tone and signature for this Chrome profile.";
1940
2164
  t4 = "first-run-writing";
1941
2165
  let t10;
1942
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
2166
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
1943
2167
  t10 = /* @__PURE__ */ jsx("legend", { children: "Tone" });
1944
- $[20] = t10;
1945
- } else t10 = $[20];
1946
- const t11 = writing.status === "done" ? writing.suggested : void 0;
1947
- let t12;
1948
- if ($[21] !== answer || $[22] !== onStyleChange || $[23] !== t11) {
1949
- t12 = /* @__PURE__ */ jsxs("fieldset", {
2168
+ $[19] = t10;
2169
+ } else t10 = $[19];
2170
+ let t11;
2171
+ if ($[20] !== answer || $[21] !== onStyleChange || $[22] !== writing.suggested) {
2172
+ t11 = /* @__PURE__ */ jsxs("fieldset", {
1950
2173
  className: "first-run-writing__preference",
1951
2174
  children: [t10, /* @__PURE__ */ jsx(WritingChoices, {
1952
2175
  answer,
1953
2176
  onStyleChange,
1954
- suggested: t11
2177
+ suggested: writing.suggested
1955
2178
  })]
1956
2179
  });
1957
- $[21] = answer;
1958
- $[22] = onStyleChange;
2180
+ $[20] = answer;
2181
+ $[21] = onStyleChange;
2182
+ $[22] = writing.suggested;
1959
2183
  $[23] = t11;
2184
+ } else t11 = $[23];
2185
+ let t12;
2186
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
2187
+ t12 = /* @__PURE__ */ jsx("legend", { children: "Signature" });
1960
2188
  $[24] = t12;
1961
2189
  } else t12 = $[24];
1962
2190
  let t13;
1963
- if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
1964
- t13 = /* @__PURE__ */ jsx("legend", { children: "Signature" });
1965
- $[25] = t13;
1966
- } else t13 = $[25];
1967
- let t14;
1968
- if ($[26] !== profileLabel) {
1969
- t14 = {
2191
+ if ($[25] !== profileLabel) {
2192
+ t13 = {
1970
2193
  value: "profile",
1971
2194
  label: profileLabel
1972
2195
  };
1973
- $[26] = profileLabel;
1974
- $[27] = t14;
1975
- } else t14 = $[27];
1976
- let t15;
1977
- if ($[28] !== brandName) {
1978
- t15 = {
2196
+ $[25] = profileLabel;
2197
+ $[26] = t13;
2198
+ } else t13 = $[26];
2199
+ let t14;
2200
+ if ($[27] !== brandName) {
2201
+ t14 = {
1979
2202
  value: "assistant",
1980
2203
  label: brandName
1981
2204
  };
1982
- $[28] = brandName;
1983
- $[29] = t15;
1984
- } else t15 = $[29];
1985
- let t16;
1986
- if ($[30] !== t14 || $[31] !== t15) {
1987
- t16 = [t14, t15];
2205
+ $[27] = brandName;
2206
+ $[28] = t14;
2207
+ } else t14 = $[28];
2208
+ let t15;
2209
+ if ($[29] !== t13 || $[30] !== t14) {
2210
+ t15 = [t13, t14];
2211
+ $[29] = t13;
1988
2212
  $[30] = t14;
1989
2213
  $[31] = t15;
1990
- $[32] = t16;
1991
- } else t16 = $[32];
1992
- let t17;
1993
- if ($[33] !== onSignChange) {
1994
- t17 = (value) => {
2214
+ } else t15 = $[31];
2215
+ let t16;
2216
+ if ($[32] !== onSignChange) {
2217
+ t16 = (value) => {
1995
2218
  if (value === "profile" || value === "assistant") onSignChange(value);
1996
2219
  };
1997
- $[33] = onSignChange;
2220
+ $[32] = onSignChange;
2221
+ $[33] = t16;
2222
+ } else t16 = $[33];
2223
+ let t17;
2224
+ if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
2225
+ t17 = /* @__PURE__ */ jsx(Select.Value, {});
1998
2226
  $[34] = t17;
1999
2227
  } else t17 = $[34];
2000
2228
  let t18;
2001
2229
  if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
2002
- t18 = /* @__PURE__ */ jsx(Select.Value, {});
2230
+ t18 = /* @__PURE__ */ jsxs(Select.Trigger, {
2231
+ className: "first-run-writing__signature-select",
2232
+ "aria-label": "Sign as",
2233
+ children: [t17, /* @__PURE__ */ jsx(Select.Icon, { children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })]
2234
+ });
2003
2235
  $[35] = t18;
2004
2236
  } else t18 = $[35];
2005
2237
  let t19;
2006
2238
  if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
2007
- t19 = /* @__PURE__ */ jsxs(Select.Trigger, {
2008
- className: "first-run-writing__signature-select",
2009
- "aria-label": "Sign as",
2010
- children: [t18, /* @__PURE__ */ jsx(Select.Icon, { children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })]
2011
- });
2239
+ t19 = /* @__PURE__ */ jsx(Select.ItemIndicator, {});
2012
2240
  $[36] = t19;
2013
2241
  } else t19 = $[36];
2014
2242
  let t20;
2015
- if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
2016
- t20 = /* @__PURE__ */ jsx(Select.ItemIndicator, {});
2017
- $[37] = t20;
2018
- } else t20 = $[37];
2243
+ if ($[37] !== profileLabel) {
2244
+ t20 = /* @__PURE__ */ jsx(Select.ItemText, { children: profileLabel });
2245
+ $[37] = profileLabel;
2246
+ $[38] = t20;
2247
+ } else t20 = $[38];
2019
2248
  let t21;
2020
- if ($[38] !== profileLabel) {
2021
- t21 = /* @__PURE__ */ jsx(Select.ItemText, { children: profileLabel });
2022
- $[38] = profileLabel;
2023
- $[39] = t21;
2024
- } else t21 = $[39];
2025
- let t22;
2026
- if ($[40] !== profileLabel || $[41] !== t21) {
2027
- t22 = /* @__PURE__ */ jsxs(Select.Item, {
2249
+ if ($[39] !== profileLabel || $[40] !== t20) {
2250
+ t21 = /* @__PURE__ */ jsxs(Select.Item, {
2028
2251
  value: "profile",
2029
2252
  "aria-label": profileLabel,
2030
- children: [t20, t21]
2253
+ children: [t19, t20]
2031
2254
  });
2032
- $[40] = profileLabel;
2255
+ $[39] = profileLabel;
2256
+ $[40] = t20;
2033
2257
  $[41] = t21;
2258
+ } else t21 = $[41];
2259
+ let t22;
2260
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
2261
+ t22 = /* @__PURE__ */ jsx(Select.ItemIndicator, {});
2034
2262
  $[42] = t22;
2035
2263
  } else t22 = $[42];
2036
2264
  let t23;
2037
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
2038
- t23 = /* @__PURE__ */ jsx(Select.ItemIndicator, {});
2039
- $[43] = t23;
2040
- } else t23 = $[43];
2265
+ if ($[43] !== brandName) {
2266
+ t23 = /* @__PURE__ */ jsx(Select.ItemText, { children: brandName });
2267
+ $[43] = brandName;
2268
+ $[44] = t23;
2269
+ } else t23 = $[44];
2041
2270
  let t24;
2042
- if ($[44] !== brandName) {
2043
- t24 = /* @__PURE__ */ jsx(Select.ItemText, { children: brandName });
2044
- $[44] = brandName;
2045
- $[45] = t24;
2046
- } else t24 = $[45];
2047
- let t25;
2048
- if ($[46] !== brandName || $[47] !== t24) {
2049
- t25 = /* @__PURE__ */ jsxs(Select.Item, {
2271
+ if ($[45] !== brandName || $[46] !== t23) {
2272
+ t24 = /* @__PURE__ */ jsxs(Select.Item, {
2050
2273
  value: "assistant",
2051
2274
  "aria-label": brandName,
2052
- children: [t23, t24]
2275
+ children: [t22, t23]
2053
2276
  });
2054
- $[46] = brandName;
2277
+ $[45] = brandName;
2278
+ $[46] = t23;
2055
2279
  $[47] = t24;
2056
- $[48] = t25;
2057
- } else t25 = $[48];
2058
- let t26;
2059
- if ($[49] !== t22 || $[50] !== t25) {
2060
- t26 = /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
2280
+ } else t24 = $[47];
2281
+ let t25;
2282
+ if ($[48] !== t21 || $[49] !== t24) {
2283
+ t25 = /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
2061
2284
  sideOffset: 4,
2062
2285
  alignItemWithTrigger: false,
2063
2286
  align: "start",
2064
- children: /* @__PURE__ */ jsx(Select.Popup, { children: /* @__PURE__ */ jsxs(Select.List, { children: [t22, t25] }) })
2287
+ children: /* @__PURE__ */ jsx(Select.Popup, { children: /* @__PURE__ */ jsxs(Select.List, { children: [t21, t24] }) })
2065
2288
  }) });
2066
- $[49] = t22;
2289
+ $[48] = t21;
2290
+ $[49] = t24;
2067
2291
  $[50] = t25;
2068
- $[51] = t26;
2069
- } else t26 = $[51];
2070
- let t27;
2071
- if ($[52] !== answer.sign || $[53] !== t16 || $[54] !== t17 || $[55] !== t26) {
2072
- t27 = /* @__PURE__ */ jsxs("fieldset", {
2292
+ } else t25 = $[50];
2293
+ let t26;
2294
+ if ($[51] !== answer.sign || $[52] !== t15 || $[53] !== t16 || $[54] !== t25) {
2295
+ t26 = /* @__PURE__ */ jsxs("fieldset", {
2073
2296
  className: "first-run-writing__preference first-run-writing__signature",
2074
- children: [t13, /* @__PURE__ */ jsxs(Select.Root, {
2075
- items: t16,
2297
+ children: [t12, /* @__PURE__ */ jsxs(Select.Root, {
2298
+ items: t15,
2076
2299
  value: answer.sign,
2077
- onValueChange: t17,
2078
- children: [t19, t26]
2300
+ onValueChange: t16,
2301
+ children: [t18, t25]
2079
2302
  })]
2080
2303
  });
2081
- $[52] = answer.sign;
2304
+ $[51] = answer.sign;
2305
+ $[52] = t15;
2082
2306
  $[53] = t16;
2083
- $[54] = t17;
2307
+ $[54] = t25;
2084
2308
  $[55] = t26;
2085
- $[56] = t27;
2086
- } else t27 = $[56];
2087
- if ($[57] !== t12 || $[58] !== t27) {
2309
+ } else t26 = $[55];
2310
+ if ($[56] !== t11 || $[57] !== t26) {
2088
2311
  t5 = /* @__PURE__ */ jsxs("div", {
2089
2312
  className: "first-run-writing__preferences",
2090
- children: [t12, t27]
2313
+ children: [t11, t26]
2091
2314
  });
2092
- $[57] = t12;
2093
- $[58] = t27;
2094
- $[59] = t5;
2095
- } else t5 = $[59];
2315
+ $[56] = t11;
2316
+ $[57] = t26;
2317
+ $[58] = t5;
2318
+ } else t5 = $[58];
2096
2319
  t1 = "first-run-figure first-run-writing__preview";
2097
- if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
2320
+ if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
2098
2321
  t2 = /* @__PURE__ */ jsx("h2", {
2099
2322
  className: "sigvelo-visually-hidden",
2100
2323
  children: "Email preview"
2101
2324
  });
2102
- $[60] = t2;
2103
- } else t2 = $[60];
2104
- t3 = working ? /* @__PURE__ */ jsx("p", {
2105
- className: "first-run-live",
2106
- children: "Writing your email"
2107
- }) : sample ? /* @__PURE__ */ jsx(WorkspaceEntityCard, {
2325
+ $[59] = t2;
2326
+ } else t2 = $[59];
2327
+ t3 = sample ? /* @__PURE__ */ jsx(WorkspaceEntityCard, {
2108
2328
  className: "first-run-writing__email",
2109
2329
  name: "Example email",
2110
2330
  icon: /* @__PURE__ */ jsx(AppIcon.Root, {
@@ -2135,119 +2355,102 @@ function WritingStep(t0) {
2135
2355
  $[3] = onStyleChange;
2136
2356
  $[4] = profileLabel;
2137
2357
  $[5] = writing.samples;
2138
- $[6] = writing.status;
2139
- $[7] = writing.suggested;
2140
- $[8] = T0;
2141
- $[9] = t1;
2142
- $[10] = t2;
2143
- $[11] = t3;
2144
- $[12] = t4;
2145
- $[13] = t5;
2146
- $[14] = t6;
2147
- $[15] = t7;
2148
- $[16] = t8;
2358
+ $[6] = writing.suggested;
2359
+ $[7] = T0;
2360
+ $[8] = t1;
2361
+ $[9] = t2;
2362
+ $[10] = t3;
2363
+ $[11] = t4;
2364
+ $[12] = t5;
2365
+ $[13] = t6;
2366
+ $[14] = t7;
2367
+ $[15] = t8;
2149
2368
  } else {
2150
- T0 = $[8];
2151
- t1 = $[9];
2152
- t2 = $[10];
2153
- t3 = $[11];
2154
- t4 = $[12];
2155
- t5 = $[13];
2156
- t6 = $[14];
2157
- t7 = $[15];
2158
- t8 = $[16];
2369
+ T0 = $[7];
2370
+ t1 = $[8];
2371
+ t2 = $[9];
2372
+ t3 = $[10];
2373
+ t4 = $[11];
2374
+ t5 = $[12];
2375
+ t6 = $[13];
2376
+ t7 = $[14];
2377
+ t8 = $[15];
2159
2378
  }
2160
2379
  let t9;
2161
- if ($[61] !== t1 || $[62] !== t2 || $[63] !== t3) {
2380
+ if ($[60] !== t1 || $[61] !== t2 || $[62] !== t3) {
2162
2381
  t9 = /* @__PURE__ */ jsxs("figure", {
2163
2382
  className: t1,
2164
2383
  children: [t2, t3]
2165
2384
  });
2166
- $[61] = t1;
2167
- $[62] = t2;
2168
- $[63] = t3;
2169
- $[64] = t9;
2170
- } else t9 = $[64];
2385
+ $[60] = t1;
2386
+ $[61] = t2;
2387
+ $[62] = t3;
2388
+ $[63] = t9;
2389
+ } else t9 = $[63];
2171
2390
  let t10;
2172
- if ($[65] !== t4 || $[66] !== t5 || $[67] !== t9) {
2391
+ if ($[64] !== t4 || $[65] !== t5 || $[66] !== t9) {
2173
2392
  t10 = /* @__PURE__ */ jsxs("section", {
2174
2393
  className: t4,
2175
2394
  children: [t5, t9]
2176
2395
  });
2177
- $[65] = t4;
2178
- $[66] = t5;
2179
- $[67] = t9;
2180
- $[68] = t10;
2181
- } else t10 = $[68];
2396
+ $[64] = t4;
2397
+ $[65] = t5;
2398
+ $[66] = t9;
2399
+ $[67] = t10;
2400
+ } else t10 = $[67];
2182
2401
  let t11;
2183
- if ($[69] !== writing.onRetry || $[70] !== writing.status) {
2184
- t11 = writing.status === "failed" ? /* @__PURE__ */ jsx(TryAgain, { onClick: writing.onRetry }) : null;
2185
- $[69] = writing.onRetry;
2186
- $[70] = writing.status;
2402
+ if ($[68] !== answer || $[69] !== onReviewed || $[70] !== writing) {
2403
+ t11 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(Next, { onSave: () => {
2404
+ writing.onSave(answer);
2405
+ onReviewed();
2406
+ } }) });
2407
+ $[68] = answer;
2408
+ $[69] = onReviewed;
2409
+ $[70] = writing;
2187
2410
  $[71] = t11;
2188
2411
  } else t11 = $[71];
2189
2412
  let t12;
2190
- if ($[72] !== answer || $[73] !== onReviewed || $[74] !== writing) {
2191
- t12 = /* @__PURE__ */ jsx(Next, { onSave: () => {
2192
- writing.onSave(answer);
2193
- onReviewed();
2194
- } });
2195
- $[72] = answer;
2196
- $[73] = onReviewed;
2197
- $[74] = writing;
2198
- $[75] = t12;
2199
- } else t12 = $[75];
2200
- let t13;
2201
- if ($[76] !== t11 || $[77] !== t12) {
2202
- t13 = /* @__PURE__ */ jsxs(Actions, { children: [t11, t12] });
2203
- $[76] = t11;
2204
- $[77] = t12;
2205
- $[78] = t13;
2206
- } else t13 = $[78];
2207
- let t14;
2208
- if ($[79] !== T0 || $[80] !== t10 || $[81] !== t13 || $[82] !== t6 || $[83] !== t7 || $[84] !== t8) {
2209
- t14 = /* @__PURE__ */ jsx(T0, {
2413
+ if ($[72] !== T0 || $[73] !== t10 || $[74] !== t11 || $[75] !== t6 || $[76] !== t7 || $[77] !== t8) {
2414
+ t12 = /* @__PURE__ */ jsx(T0, {
2210
2415
  layout: t6,
2211
2416
  title: t7,
2212
2417
  lead: t8,
2213
2418
  body: t10,
2214
- actions: t13
2419
+ actions: t11
2215
2420
  });
2216
- $[79] = T0;
2217
- $[80] = t10;
2218
- $[81] = t13;
2219
- $[82] = t6;
2220
- $[83] = t7;
2221
- $[84] = t8;
2222
- $[85] = t14;
2223
- } else t14 = $[85];
2224
- return t14;
2421
+ $[72] = T0;
2422
+ $[73] = t10;
2423
+ $[74] = t11;
2424
+ $[75] = t6;
2425
+ $[76] = t7;
2426
+ $[77] = t8;
2427
+ $[78] = t12;
2428
+ } else t12 = $[78];
2429
+ return t12;
2225
2430
  }
2226
2431
  function _temp$3(field) {
2227
2432
  return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: field.label }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: field.value })] }, field.name);
2228
2433
  }
2229
2434
  /** The writing styles available to choose from. */
2230
2435
  function WritingChoices(t0) {
2231
- const $ = c(7);
2436
+ const $ = c(6);
2232
2437
  const { answer, onStyleChange, suggested } = t0;
2233
- const { brandName } = useFirstRun();
2234
2438
  const t1 = answer.style;
2235
2439
  let t2;
2236
- if ($[0] !== brandName || $[1] !== suggested) {
2440
+ if ($[0] !== suggested) {
2237
2441
  t2 = STYLES.map((t3) => {
2238
2442
  const [style, label] = t3;
2239
2443
  return /* @__PURE__ */ jsx(Choice, {
2240
2444
  value: style,
2241
- note: style === suggested ? `${brandName} recommends` : void 0,
2445
+ note: style === suggested ? "Matches your sent email" : void 0,
2242
2446
  children: label
2243
2447
  }, style);
2244
2448
  });
2245
- $[0] = brandName;
2246
- $[1] = suggested;
2247
- $[2] = t2;
2248
- } else t2 = $[2];
2449
+ $[0] = suggested;
2450
+ $[1] = t2;
2451
+ } else t2 = $[1];
2249
2452
  let t3;
2250
- if ($[3] !== answer.style || $[4] !== onStyleChange || $[5] !== t2) {
2453
+ if ($[2] !== answer.style || $[3] !== onStyleChange || $[4] !== t2) {
2251
2454
  t3 = /* @__PURE__ */ jsx(RadioGroup.Root, {
2252
2455
  className: "first-run-choices",
2253
2456
  orientation: "vertical",
@@ -2256,11 +2459,11 @@ function WritingChoices(t0) {
2256
2459
  onValueChange: onStyleChange,
2257
2460
  children: t2
2258
2461
  });
2259
- $[3] = answer.style;
2260
- $[4] = onStyleChange;
2261
- $[5] = t2;
2262
- $[6] = t3;
2263
- } else t3 = $[6];
2462
+ $[2] = answer.style;
2463
+ $[3] = onStyleChange;
2464
+ $[4] = t2;
2465
+ $[5] = t3;
2466
+ } else t3 = $[5];
2264
2467
  return t3;
2265
2468
  }
2266
2469
  function Choice(t0) {
@@ -2607,7 +2810,7 @@ function WelcomeStep() {
2607
2810
  } else t2 = $[5];
2608
2811
  let t3;
2609
2812
  if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
2610
- t3 = /* @__PURE__ */ jsx("p", { children: "Let’s set up your new employee." });
2813
+ t3 = /* @__PURE__ */ jsx("p", { children: "Set up your new employee." });
2611
2814
  $[6] = t3;
2612
2815
  } else t3 = $[6];
2613
2816
  let t4;
@@ -2665,75 +2868,73 @@ function WelcomeStep() {
2665
2868
  return t8;
2666
2869
  }
2667
2870
  function SignInStep(t0) {
2668
- const $ = c(25);
2669
- const { status, onSignIn, onUse, modelConnection } = t0;
2871
+ const $ = c(24);
2872
+ const { status, onSignIn, modelConnection } = t0;
2670
2873
  const { brandName } = useFirstRun();
2671
2874
  const done = status === "done";
2875
+ const modelInUse = modelConnection.kind === "managed" || modelConnection.connected;
2672
2876
  useAutoAdvance(done);
2673
2877
  const t1 = `${brandName} uses it for everything, starting with the rest of setup.`;
2674
2878
  let t2;
2675
- if ($[0] !== modelConnection.connected || $[1] !== onSignIn || $[2] !== onUse || $[3] !== status) {
2676
- t2 = /* @__PURE__ */ jsx(ChatGptProviderChoice, {
2879
+ if ($[0] !== modelConnection.kind || $[1] !== onSignIn || $[2] !== status) {
2880
+ t2 = modelConnection.kind === "managed" ? null : /* @__PURE__ */ jsx(ChatGptProviderChoice, {
2677
2881
  status,
2678
- onSignIn,
2679
- onUse,
2680
- modelConnected: modelConnection.connected
2882
+ onSignIn
2681
2883
  });
2682
- $[0] = modelConnection.connected;
2884
+ $[0] = modelConnection.kind;
2683
2885
  $[1] = onSignIn;
2684
- $[2] = onUse;
2685
- $[3] = status;
2686
- $[4] = t2;
2687
- } else t2 = $[4];
2886
+ $[2] = status;
2887
+ $[3] = t2;
2888
+ } else t2 = $[3];
2688
2889
  let t3;
2689
- if ($[5] !== modelConnection) {
2890
+ if ($[4] !== modelConnection) {
2690
2891
  t3 = /* @__PURE__ */ jsx(OtherProviderChoice, { connection: modelConnection });
2691
- $[5] = modelConnection;
2692
- $[6] = t3;
2693
- } else t3 = $[6];
2892
+ $[4] = modelConnection;
2893
+ $[5] = t3;
2894
+ } else t3 = $[5];
2694
2895
  let t4;
2695
- if ($[7] !== t2 || $[8] !== t3) {
2896
+ if ($[6] !== t2 || $[7] !== t3) {
2696
2897
  t4 = /* @__PURE__ */ jsxs("div", {
2697
2898
  className: "first-run-provider-choices",
2698
2899
  children: [t2, t3]
2699
2900
  });
2700
- $[7] = t2;
2701
- $[8] = t3;
2702
- $[9] = t4;
2703
- } else t4 = $[9];
2901
+ $[6] = t2;
2902
+ $[7] = t3;
2903
+ $[8] = t4;
2904
+ } else t4 = $[8];
2704
2905
  let t5;
2705
- if ($[10] !== status) {
2906
+ if ($[9] !== status) {
2706
2907
  t5 = status === "failed" ? /* @__PURE__ */ jsx("p", {
2707
2908
  role: "alert",
2708
2909
  className: "chatgpt-sign-in__error",
2709
- children: "Sign-in didn’t finish. Try again."
2910
+ children: "Couldn’t sign in to ChatGPT. Try again."
2710
2911
  }) : null;
2711
- $[10] = status;
2712
- $[11] = t5;
2713
- } else t5 = $[11];
2912
+ $[9] = status;
2913
+ $[10] = t5;
2914
+ } else t5 = $[10];
2714
2915
  let t6;
2715
- if ($[12] !== t4 || $[13] !== t5) {
2916
+ if ($[11] !== t4 || $[12] !== t5) {
2716
2917
  t6 = /* @__PURE__ */ jsxs(Fragment, { children: [t4, t5] });
2717
- $[12] = t4;
2718
- $[13] = t5;
2719
- $[14] = t6;
2720
- } else t6 = $[14];
2918
+ $[11] = t4;
2919
+ $[12] = t5;
2920
+ $[13] = t6;
2921
+ } else t6 = $[13];
2721
2922
  let t7;
2722
- if ($[15] !== done || $[16] !== modelConnection.connected) {
2723
- t7 = done || modelConnection.connected ? /* @__PURE__ */ jsx(Next, {}) : null;
2724
- $[15] = done;
2725
- $[16] = modelConnection.connected;
2726
- $[17] = t7;
2727
- } else t7 = $[17];
2923
+ if ($[14] !== done || $[15] !== modelInUse) {
2924
+ t7 = done || modelInUse ? /* @__PURE__ */ jsx(Next, {}) : null;
2925
+ $[14] = done;
2926
+ $[15] = modelInUse;
2927
+ $[16] = t7;
2928
+ } else t7 = $[16];
2728
2929
  let t8;
2729
- if ($[18] !== t7) {
2930
+ if ($[17] !== t7) {
2730
2931
  t8 = /* @__PURE__ */ jsx(Actions, { children: t7 });
2731
- $[18] = t7;
2732
- $[19] = t8;
2733
- } else t8 = $[19];
2932
+ $[17] = t7;
2933
+ $[18] = t8;
2934
+ } else t8 = $[18];
2734
2935
  const t9 = status === "waiting" ? "Waiting for ChatGPT" : done ? "Signed in with ChatGPT" : "";
2735
2936
  let t10;
2736
- if ($[20] !== t1 || $[21] !== t6 || $[22] !== t8 || $[23] !== t9) {
2937
+ if ($[19] !== t1 || $[20] !== t6 || $[21] !== t8 || $[22] !== t9) {
2737
2938
  t10 = /* @__PURE__ */ jsx(Step, {
2738
2939
  title: "Connect your AI",
2739
2940
  lead: t1,
@@ -2741,43 +2942,29 @@ function SignInStep(t0) {
2741
2942
  actions: t8,
2742
2943
  announce: t9
2743
2944
  });
2744
- $[20] = t1;
2745
- $[21] = t6;
2746
- $[22] = t8;
2747
- $[23] = t9;
2748
- $[24] = t10;
2749
- } else t10 = $[24];
2945
+ $[19] = t1;
2946
+ $[20] = t6;
2947
+ $[21] = t8;
2948
+ $[22] = t9;
2949
+ $[23] = t10;
2950
+ } else t10 = $[23];
2750
2951
  return t10;
2751
2952
  }
2752
2953
  function ChatGptProviderChoice(t0) {
2753
- const $ = c(28);
2754
- const { status, onSignIn, onUse, modelConnected } = t0;
2755
- const { brandName, go } = useFirstRun();
2954
+ const $ = c(23);
2955
+ const { status, onSignIn } = t0;
2956
+ const { brandName, next } = useFirstRun();
2756
2957
  const descriptionId = React.useId();
2757
2958
  const done = status === "done";
2758
- const label = status === "waiting" ? "Waiting for ChatGPT…" : done ? modelConnected ? "Use ChatGPT" : "Already signed in" : "Sign in with ChatGPT";
2759
- const t1 = status === "waiting";
2760
- const t2 = status === "waiting";
2761
- const t3 = status === "waiting" ? "Waiting for ChatGPT" : done && !modelConnected ? "Use ChatGPT, already signed in" : label;
2762
- let t4;
2763
- if ($[0] !== done || $[1] !== go || $[2] !== onSignIn || $[3] !== onUse) {
2764
- t4 = () => {
2765
- if (!done) return onSignIn();
2766
- onUse();
2767
- go("chrome-profile");
2768
- };
2769
- $[0] = done;
2770
- $[1] = go;
2771
- $[2] = onSignIn;
2772
- $[3] = onUse;
2773
- $[4] = t4;
2774
- } else t4 = $[4];
2775
- let t5;
2776
- if ($[5] !== status) {
2777
- t5 = /* @__PURE__ */ jsx("span", {
2959
+ const waiting = status === "waiting";
2960
+ const t1 = waiting ? "Waiting for ChatGPT" : void 0;
2961
+ const t2 = done ? next : onSignIn;
2962
+ let t3;
2963
+ if ($[0] !== waiting) {
2964
+ t3 = /* @__PURE__ */ jsx("span", {
2778
2965
  className: "first-run-provider-logo",
2779
2966
  "aria-hidden": "true",
2780
- children: status === "waiting" ? /* @__PURE__ */ jsx(SpinnerIcon, {
2967
+ children: waiting ? /* @__PURE__ */ jsx(SpinnerIcon, {
2781
2968
  className: "sigvelo-icon--spinner",
2782
2969
  size: 80,
2783
2970
  strokeWidth: 1.75
@@ -2787,64 +2974,67 @@ function ChatGptProviderChoice(t0) {
2787
2974
  height: 80
2788
2975
  })
2789
2976
  });
2790
- $[5] = status;
2791
- $[6] = t5;
2792
- } else t5 = $[6];
2977
+ $[0] = waiting;
2978
+ $[1] = t3;
2979
+ } else t3 = $[1];
2980
+ const t4 = waiting ? "Waiting for ChatGPT…" : done ? "Continue with ChatGPT" : "Sign in with ChatGPT";
2981
+ let t5;
2982
+ if ($[2] !== done || $[3] !== waiting) {
2983
+ t5 = !done && !waiting ? /* @__PURE__ */ jsx(ArrowUpRightIcon, { "aria-hidden": "true" }) : null;
2984
+ $[2] = done;
2985
+ $[3] = waiting;
2986
+ $[4] = t5;
2987
+ } else t5 = $[4];
2793
2988
  let t6;
2794
- if ($[7] !== done || $[8] !== status) {
2795
- t6 = !done && status !== "waiting" ? /* @__PURE__ */ jsx(ArrowUpRightIcon, { "aria-hidden": "true" }) : null;
2796
- $[7] = done;
2797
- $[8] = status;
2798
- $[9] = t6;
2799
- } else t6 = $[9];
2800
- let t7;
2801
- if ($[10] !== label || $[11] !== t6) {
2802
- t7 = /* @__PURE__ */ jsxs("span", {
2989
+ if ($[5] !== t4 || $[6] !== t5) {
2990
+ t6 = /* @__PURE__ */ jsxs("span", {
2803
2991
  className: "first-run-provider-label first-run-provider-label--external",
2804
- children: [label, t6]
2992
+ children: [t4, t5]
2805
2993
  });
2806
- $[10] = label;
2807
- $[11] = t6;
2808
- $[12] = t7;
2809
- } else t7 = $[12];
2810
- let t8;
2811
- if ($[13] !== descriptionId || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t7) {
2812
- t8 = /* @__PURE__ */ jsxs(Button, {
2994
+ $[5] = t4;
2995
+ $[6] = t5;
2996
+ $[7] = t6;
2997
+ } else t6 = $[7];
2998
+ let t7;
2999
+ if ($[8] !== descriptionId || $[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t6 || $[13] !== waiting) {
3000
+ t7 = /* @__PURE__ */ jsxs(Button, {
2813
3001
  className: "first-run-provider-action",
2814
3002
  variant: "ghost",
2815
3003
  color: "neutral",
2816
- disabled: t1,
2817
- "aria-busy": t2,
3004
+ disabled: waiting,
3005
+ focusableWhenDisabled: waiting,
3006
+ "aria-busy": waiting,
2818
3007
  "aria-describedby": descriptionId,
2819
- "aria-label": t3,
2820
- onClick: t4,
2821
- children: [t5, t7]
3008
+ "aria-label": t1,
3009
+ onClick: t2,
3010
+ children: [t3, t6]
2822
3011
  });
2823
- $[13] = descriptionId;
2824
- $[14] = t1;
2825
- $[15] = t2;
2826
- $[16] = t3;
2827
- $[17] = t4;
2828
- $[18] = t5;
2829
- $[19] = t7;
2830
- $[20] = t8;
2831
- } else t8 = $[20];
3012
+ $[8] = descriptionId;
3013
+ $[9] = t1;
3014
+ $[10] = t2;
3015
+ $[11] = t3;
3016
+ $[12] = t6;
3017
+ $[13] = waiting;
3018
+ $[14] = t7;
3019
+ } else t7 = $[14];
3020
+ const t8 = done ? "Signed in. " : null;
2832
3021
  let t9;
2833
- if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
3022
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
2834
3023
  t9 = /* @__PURE__ */ jsx("a", {
2835
3024
  href: "https://help.openai.com/en/articles/7730893-data-controls-faq",
2836
3025
  target: "_blank",
2837
3026
  rel: "noopener noreferrer",
2838
3027
  children: "data controls"
2839
3028
  });
2840
- $[21] = t9;
2841
- } else t9 = $[21];
3029
+ $[15] = t9;
3030
+ } else t9 = $[15];
2842
3031
  let t10;
2843
- if ($[22] !== brandName || $[23] !== descriptionId) {
3032
+ if ($[16] !== brandName || $[17] !== descriptionId || $[18] !== t8) {
2844
3033
  t10 = /* @__PURE__ */ jsxs("p", {
2845
3034
  id: descriptionId,
2846
3035
  className: "first-run-provider-subtitle",
2847
3036
  children: [
3037
+ t8,
2848
3038
  brandName,
2849
3039
  " never sees your password. Control how OpenAI uses your conversations for model training in ChatGPT’s",
2850
3040
  " ",
@@ -2852,37 +3042,41 @@ function ChatGptProviderChoice(t0) {
2852
3042
  "."
2853
3043
  ]
2854
3044
  });
2855
- $[22] = brandName;
2856
- $[23] = descriptionId;
2857
- $[24] = t10;
2858
- } else t10 = $[24];
3045
+ $[16] = brandName;
3046
+ $[17] = descriptionId;
3047
+ $[18] = t8;
3048
+ $[19] = t10;
3049
+ } else t10 = $[19];
2859
3050
  let t11;
2860
- if ($[25] !== t10 || $[26] !== t8) {
3051
+ if ($[20] !== t10 || $[21] !== t7) {
2861
3052
  t11 = /* @__PURE__ */ jsxs(Card, {
2862
3053
  className: "first-run-provider-choice first-run-provider-choice--linked",
2863
- children: [t8, t10]
3054
+ children: [t7, t10]
2864
3055
  });
2865
- $[25] = t10;
2866
- $[26] = t8;
2867
- $[27] = t11;
2868
- } else t11 = $[27];
3056
+ $[20] = t10;
3057
+ $[21] = t7;
3058
+ $[22] = t11;
3059
+ } else t11 = $[22];
2869
3060
  return t11;
2870
3061
  }
2871
3062
  function OtherProviderChoice(t0) {
2872
- const $ = c(18);
2873
- const { connection: modelConnection } = t0;
3063
+ const $ = c(23);
3064
+ const { connection } = t0;
2874
3065
  const { go } = useFirstRun();
2875
3066
  const descriptionId = React.useId();
2876
- const t1 = modelConnection.connected ? `Configure ${modelConnection.value.model}` : "Use a different provider";
2877
- let t2;
3067
+ const managed = connection.kind === "managed";
3068
+ const model = managed ? connection.model : connection.connected ? connection.value.model : "";
3069
+ const t1 = managed ? void 0 : model ? `Configure ${model}` : "Use a different provider";
3070
+ const t2 = model ? true : void 0;
3071
+ let t3;
2878
3072
  if ($[0] !== go) {
2879
- t2 = () => go("model-connection");
3073
+ t3 = () => go("model-connection");
2880
3074
  $[0] = go;
2881
- $[1] = t2;
2882
- } else t2 = $[1];
2883
- let t3;
3075
+ $[1] = t3;
3076
+ } else t3 = $[1];
3077
+ let t4;
2884
3078
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2885
- t3 = /* @__PURE__ */ jsx("span", {
3079
+ t4 = /* @__PURE__ */ jsx("span", {
2886
3080
  className: "first-run-provider-logo",
2887
3081
  "aria-hidden": "true",
2888
3082
  children: /* @__PURE__ */ jsx(LaptopIcon, {
@@ -2890,38 +3084,47 @@ function OtherProviderChoice(t0) {
2890
3084
  strokeWidth: 1.5
2891
3085
  })
2892
3086
  });
2893
- $[2] = t3;
2894
- } else t3 = $[2];
2895
- const t4 = modelConnection.connected ? modelConnection.value.model : "Use a different provider";
2896
- let t5;
2897
- if ($[3] !== t4) {
2898
- t5 = /* @__PURE__ */ jsx("span", {
2899
- className: "first-run-provider-label",
2900
- children: t4
2901
- });
2902
- $[3] = t4;
2903
- $[4] = t5;
2904
- } else t5 = $[4];
3087
+ $[2] = t4;
3088
+ } else t4 = $[2];
3089
+ const t5 = model || "Use a different provider";
2905
3090
  let t6;
2906
- if ($[5] !== descriptionId || $[6] !== t1 || $[7] !== t2 || $[8] !== t5) {
2907
- t6 = /* @__PURE__ */ jsxs(Button, {
3091
+ if ($[3] !== model) {
3092
+ t6 = model ? /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }) : null;
3093
+ $[3] = model;
3094
+ $[4] = t6;
3095
+ } else t6 = $[4];
3096
+ let t7;
3097
+ if ($[5] !== t5 || $[6] !== t6) {
3098
+ t7 = /* @__PURE__ */ jsxs("span", {
3099
+ className: "first-run-provider-label first-run-provider-label--external",
3100
+ children: [t5, t6]
3101
+ });
3102
+ $[5] = t5;
3103
+ $[6] = t6;
3104
+ $[7] = t7;
3105
+ } else t7 = $[7];
3106
+ let t8;
3107
+ if ($[8] !== descriptionId || $[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t7) {
3108
+ t8 = /* @__PURE__ */ jsxs(Button, {
2908
3109
  className: "first-run-provider-action",
2909
3110
  variant: "ghost",
2910
3111
  color: "neutral",
2911
3112
  "aria-describedby": descriptionId,
2912
3113
  "aria-label": t1,
2913
- onClick: t2,
2914
- children: [t3, t5]
3114
+ "aria-current": t2,
3115
+ onClick: t3,
3116
+ children: [t4, t7]
2915
3117
  });
2916
- $[5] = descriptionId;
2917
- $[6] = t1;
2918
- $[7] = t2;
2919
- $[8] = t5;
2920
- $[9] = t6;
2921
- } else t6 = $[9];
2922
- let t7;
2923
- if ($[10] !== modelConnection.connected) {
2924
- t7 = modelConnection.connected ? "Your model is connected." : /* @__PURE__ */ jsxs(Fragment, { children: [
3118
+ $[8] = descriptionId;
3119
+ $[9] = t1;
3120
+ $[10] = t2;
3121
+ $[11] = t3;
3122
+ $[12] = t7;
3123
+ $[13] = t8;
3124
+ } else t8 = $[13];
3125
+ let t9;
3126
+ if ($[14] !== managed || $[15] !== model) {
3127
+ t9 = managed ? "Your organization manages this model." : model ? "Your model is connected." : /* @__PURE__ */ jsxs(Fragment, { children: [
2925
3128
  "Choose another AI provider, or keep processing on this computer with",
2926
3129
  " ",
2927
3130
  /* @__PURE__ */ jsx("a", {
@@ -2932,35 +3135,36 @@ function OtherProviderChoice(t0) {
2932
3135
  }),
2933
3136
  "."
2934
3137
  ] });
2935
- $[10] = modelConnection.connected;
2936
- $[11] = t7;
2937
- } else t7 = $[11];
2938
- let t8;
2939
- if ($[12] !== descriptionId || $[13] !== t7) {
2940
- t8 = /* @__PURE__ */ jsx("p", {
3138
+ $[14] = managed;
3139
+ $[15] = model;
3140
+ $[16] = t9;
3141
+ } else t9 = $[16];
3142
+ let t10;
3143
+ if ($[17] !== descriptionId || $[18] !== t9) {
3144
+ t10 = /* @__PURE__ */ jsx("p", {
2941
3145
  id: descriptionId,
2942
3146
  className: "first-run-provider-subtitle",
2943
- children: t7
3147
+ children: t9
2944
3148
  });
2945
- $[12] = descriptionId;
2946
- $[13] = t7;
2947
- $[14] = t8;
2948
- } else t8 = $[14];
2949
- let t9;
2950
- if ($[15] !== t6 || $[16] !== t8) {
2951
- t9 = /* @__PURE__ */ jsxs(Card, {
3149
+ $[17] = descriptionId;
3150
+ $[18] = t9;
3151
+ $[19] = t10;
3152
+ } else t10 = $[19];
3153
+ let t11;
3154
+ if ($[20] !== t10 || $[21] !== t8) {
3155
+ t11 = /* @__PURE__ */ jsxs(Card, {
2952
3156
  className: "first-run-provider-choice first-run-provider-choice--linked",
2953
- children: [t6, t8]
3157
+ children: [t8, t10]
2954
3158
  });
2955
- $[15] = t6;
2956
- $[16] = t8;
2957
- $[17] = t9;
2958
- } else t9 = $[17];
2959
- return t9;
3159
+ $[20] = t10;
3160
+ $[21] = t8;
3161
+ $[22] = t11;
3162
+ } else t11 = $[22];
3163
+ return t11;
2960
3164
  }
2961
3165
  function ChromeProfileStep(t0) {
2962
- const $ = c(32);
2963
- const { email, signedIn } = t0;
3166
+ const $ = c(31);
3167
+ const { email } = t0;
2964
3168
  const { brandName } = useFirstRun();
2965
3169
  let t1;
2966
3170
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -2982,34 +3186,32 @@ function ChromeProfileStep(t0) {
2982
3186
  $[1] = brandName;
2983
3187
  $[2] = t2;
2984
3188
  } else t2 = $[2];
2985
- const t3 = `${brandName} doesn’t retain your data. Everything stays on this device except task information sent to your AI provider or connected apps.`;
2986
- let t4;
3189
+ let t3;
2987
3190
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
2988
- t4 = /* @__PURE__ */ jsx("section", {});
2989
- $[3] = t4;
2990
- } else t4 = $[3];
2991
- const t5 = signedIn ? email : void 0;
2992
- let t6;
2993
- if ($[4] !== t5) {
2994
- t6 = /* @__PURE__ */ jsx(Avatar.Root, {
3191
+ t3 = /* @__PURE__ */ jsx("section", {});
3192
+ $[3] = t3;
3193
+ } else t3 = $[3];
3194
+ let t4;
3195
+ if ($[4] !== email) {
3196
+ t4 = /* @__PURE__ */ jsx(Avatar.Root, {
2995
3197
  size: "lg",
2996
3198
  shape: "circle",
2997
3199
  "aria-hidden": "true",
2998
- children: /* @__PURE__ */ jsx(ProfileInitial, { email: t5 })
3200
+ children: /* @__PURE__ */ jsx(ProfileInitial, { email })
2999
3201
  });
3000
- $[4] = t5;
3001
- $[5] = t6;
3002
- } else t6 = $[5];
3003
- const t7 = signedIn ? email || "Your Chrome profile" : "Not signed in";
3004
- let t8;
3005
- if ($[6] !== t7) {
3006
- t8 = /* @__PURE__ */ jsx("strong", { children: t7 });
3007
- $[6] = t7;
3008
- $[7] = t8;
3009
- } else t8 = $[7];
3010
- let t9;
3011
- if ($[8] !== brandName || $[9] !== signedIn) {
3012
- t9 = signedIn ? `${brandName} will use this signed-in Chrome profile.` : /* @__PURE__ */ jsxs(Fragment, { children: [
3202
+ $[4] = email;
3203
+ $[5] = t4;
3204
+ } else t4 = $[5];
3205
+ const t5 = email ?? "Not signed in";
3206
+ let t6;
3207
+ if ($[6] !== t5) {
3208
+ t6 = /* @__PURE__ */ jsx("strong", { children: t5 });
3209
+ $[6] = t5;
3210
+ $[7] = t6;
3211
+ } else t6 = $[7];
3212
+ let t7;
3213
+ if ($[8] !== brandName || $[9] !== email) {
3214
+ t7 = email ? `${brandName} will use this signed-in Chrome profile.` : /* @__PURE__ */ jsxs(Fragment, { children: [
3013
3215
  /* @__PURE__ */ jsx("a", {
3014
3216
  href: "https://support.google.com/chrome/answer/185277",
3015
3217
  target: "_blank",
@@ -3028,116 +3230,115 @@ function ChromeProfileStep(t0) {
3028
3230
  "with a Gmail address or an existing email address from Microsoft or another provider. You can also continue without signing in."
3029
3231
  ] });
3030
3232
  $[8] = brandName;
3031
- $[9] = signedIn;
3032
- $[10] = t9;
3033
- } else t9 = $[10];
3034
- let t10;
3035
- if ($[11] !== t9) {
3036
- t10 = /* @__PURE__ */ jsx("span", { children: t9 });
3037
- $[11] = t9;
3038
- $[12] = t10;
3039
- } else t10 = $[12];
3040
- let t11;
3041
- if ($[13] !== t10 || $[14] !== t8) {
3042
- t11 = /* @__PURE__ */ jsxs("div", {
3233
+ $[9] = email;
3234
+ $[10] = t7;
3235
+ } else t7 = $[10];
3236
+ let t8;
3237
+ if ($[11] !== t7) {
3238
+ t8 = /* @__PURE__ */ jsx("span", { children: t7 });
3239
+ $[11] = t7;
3240
+ $[12] = t8;
3241
+ } else t8 = $[12];
3242
+ let t9;
3243
+ if ($[13] !== t6 || $[14] !== t8) {
3244
+ t9 = /* @__PURE__ */ jsxs("div", {
3043
3245
  className: "first-run-profile-card__identity",
3044
- children: [t8, t10]
3246
+ children: [t6, t8]
3045
3247
  });
3046
- $[13] = t10;
3248
+ $[13] = t6;
3047
3249
  $[14] = t8;
3048
- $[15] = t11;
3049
- } else t11 = $[15];
3050
- let t12;
3051
- if ($[16] !== t11 || $[17] !== t6) {
3052
- t12 = /* @__PURE__ */ jsxs(Card, {
3053
- render: t4,
3250
+ $[15] = t9;
3251
+ } else t9 = $[15];
3252
+ let t10;
3253
+ if ($[16] !== t4 || $[17] !== t9) {
3254
+ t10 = /* @__PURE__ */ jsxs(Card, {
3255
+ render: t3,
3054
3256
  className: "first-run-profile-card",
3055
3257
  size: "sm",
3056
3258
  "aria-label": "Chrome profile",
3057
- children: [t6, t11]
3259
+ children: [t4, t9]
3058
3260
  });
3059
- $[16] = t11;
3060
- $[17] = t6;
3061
- $[18] = t12;
3062
- } else t12 = $[18];
3063
- let t13;
3261
+ $[16] = t4;
3262
+ $[17] = t9;
3263
+ $[18] = t10;
3264
+ } else t10 = $[18];
3265
+ let t11;
3064
3266
  if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
3065
- t13 = /* @__PURE__ */ jsx(ShieldCheck, {
3267
+ t11 = /* @__PURE__ */ jsx(ShieldCheck, {
3066
3268
  size: 16,
3067
3269
  strokeWidth: 1.75
3068
3270
  });
3069
- $[19] = t13;
3070
- } else t13 = $[19];
3071
- let t14;
3271
+ $[19] = t11;
3272
+ } else t11 = $[19];
3273
+ let t12;
3072
3274
  if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
3073
- t14 = /* @__PURE__ */ jsx("a", {
3275
+ t12 = /* @__PURE__ */ jsx("a", {
3074
3276
  href: "https://support.google.com/chrome/a/answer/7532419",
3075
3277
  target: "_blank",
3076
3278
  rel: "noopener noreferrer",
3077
3279
  children: "managed Chrome settings"
3078
3280
  });
3079
- $[20] = t14;
3080
- } else t14 = $[20];
3081
- let t15;
3281
+ $[20] = t12;
3282
+ } else t12 = $[20];
3283
+ let t13;
3082
3284
  if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
3083
- t15 = /* @__PURE__ */ jsx("a", {
3285
+ t13 = /* @__PURE__ */ jsx("a", {
3084
3286
  href: "https://support.google.com/a/answer/7281227",
3085
3287
  target: "_blank",
3086
3288
  rel: "noopener noreferrer",
3087
3289
  children: "Google Workspace app controls"
3088
3290
  });
3089
- $[21] = t15;
3090
- } else t15 = $[21];
3091
- let t16;
3291
+ $[21] = t13;
3292
+ } else t13 = $[21];
3293
+ let t14;
3092
3294
  if ($[22] !== brandName) {
3093
- t16 = /* @__PURE__ */ jsx("div", {
3295
+ t14 = /* @__PURE__ */ jsx("div", {
3094
3296
  className: "first-run-notes",
3095
3297
  children: /* @__PURE__ */ jsxs(Note, {
3096
- icon: t13,
3298
+ icon: t11,
3097
3299
  children: [
3098
3300
  "An administrator can use",
3099
3301
  " ",
3100
- t14,
3302
+ t12,
3101
3303
  " ",
3102
3304
  "to limit the sites ",
3103
3305
  brandName,
3104
3306
  " can visit, and",
3105
3307
  " ",
3106
- t15,
3308
+ t13,
3107
3309
  " ",
3108
3310
  "to manage Google app connections."
3109
3311
  ]
3110
3312
  })
3111
3313
  });
3112
3314
  $[22] = brandName;
3113
- $[23] = t16;
3114
- } else t16 = $[23];
3115
- let t17;
3116
- if ($[24] !== t12 || $[25] !== t16) {
3117
- t17 = /* @__PURE__ */ jsxs(Fragment, { children: [t12, t16] });
3118
- $[24] = t12;
3119
- $[25] = t16;
3120
- $[26] = t17;
3121
- } else t17 = $[26];
3122
- let t18;
3315
+ $[23] = t14;
3316
+ } else t14 = $[23];
3317
+ let t15;
3318
+ if ($[24] !== t10 || $[25] !== t14) {
3319
+ t15 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t14] });
3320
+ $[24] = t10;
3321
+ $[25] = t14;
3322
+ $[26] = t15;
3323
+ } else t15 = $[26];
3324
+ let t16;
3123
3325
  if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
3124
- t18 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(Next, {}) });
3125
- $[27] = t18;
3126
- } else t18 = $[27];
3127
- let t19;
3128
- if ($[28] !== t17 || $[29] !== t2 || $[30] !== t3) {
3129
- t19 = /* @__PURE__ */ jsx(Step, {
3326
+ t16 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(Next, {}) });
3327
+ $[27] = t16;
3328
+ } else t16 = $[27];
3329
+ let t17;
3330
+ if ($[28] !== t15 || $[29] !== t2) {
3331
+ t17 = /* @__PURE__ */ jsx(Step, {
3130
3332
  title: t2,
3131
- lead: t3,
3132
- body: t17,
3133
- actions: t18
3333
+ lead: "Your data stays on this device. Only what a task needs goes to your AI provider and the apps it uses.",
3334
+ body: t15,
3335
+ actions: t16
3134
3336
  });
3135
- $[28] = t17;
3337
+ $[28] = t15;
3136
3338
  $[29] = t2;
3137
- $[30] = t3;
3138
- $[31] = t19;
3139
- } else t19 = $[31];
3140
- return t19;
3339
+ $[30] = t17;
3340
+ } else t17 = $[30];
3341
+ return t17;
3141
3342
  }
3142
3343
  /** A Chrome profile's avatar: its email's first letter, or a person when signed out. */
3143
3344
  function ProfileInitial(t0) {
@@ -3157,73 +3358,30 @@ function ProfileInitial(t0) {
3157
3358
  } else t2 = $[3];
3158
3359
  return t2;
3159
3360
  }
3361
+ /**
3362
+ * The history choice. Setup owns the consent ask, so a person who leaves and
3363
+ * comes back while it is pending finds it still waiting.
3364
+ */
3160
3365
  function HistoryChoiceStep(t0) {
3161
- const $ = c(60);
3162
- const { history, skipTo } = t0;
3366
+ const $ = c(58);
3367
+ const { history, waiting, failure, onSetUp, skipTo } = t0;
3163
3368
  const { brandName, go, titleId } = useFirstRun();
3164
- const asking = React.useRef(false);
3165
3369
  let t1;
3166
- if ($[0] !== titleId) {
3167
- t1 = [
3168
- "first-run",
3169
- titleId,
3170
- "history"
3171
- ];
3172
- $[0] = titleId;
3173
- $[1] = t1;
3174
- } else t1 = $[1];
3175
- let t2;
3176
- if ($[2] !== history) {
3177
- t2 = async () => {
3178
- try {
3179
- return await history.onSetUpFromHistory() === true;
3180
- } catch {
3181
- return false;
3182
- }
3183
- };
3184
- $[2] = history;
3185
- $[3] = t2;
3186
- } else t2 = $[3];
3187
- let t3;
3188
- if ($[4] !== t1 || $[5] !== t2) {
3189
- t3 = {
3190
- mutationKey: t1,
3191
- mutationFn: t2
3192
- };
3193
- $[4] = t1;
3194
- $[5] = t2;
3195
- $[6] = t3;
3196
- } else t3 = $[6];
3197
- const consent = useMutation(t3);
3198
- const waiting = consent.isPending;
3199
- const failed = consent.data === false;
3200
- let t4;
3201
- if ($[7] !== consent || $[8] !== go) {
3202
- t4 = () => {
3203
- if (asking.current) return;
3204
- asking.current = true;
3205
- consent.mutate(void 0, {
3206
- onSuccess: (recorded) => {
3207
- if (recorded) go("preparation");
3208
- },
3209
- onSettled: () => {
3210
- asking.current = false;
3211
- }
3212
- });
3213
- };
3214
- $[7] = consent;
3215
- $[8] = go;
3216
- $[9] = t4;
3217
- } else t4 = $[9];
3218
- const setUp = t4;
3219
- const t5 = `How should ${brandName} get started?`;
3220
- const t6 = `Choose whether ${brandName} should prepare work from this Chrome profile.`;
3221
- const t7 = `Choose how ${brandName} gets started`;
3222
- const t8 = `${titleId}-history-choice`;
3223
- const t9 = `${titleId}-history-description`;
3224
- let t10;
3225
- if ($[10] !== waiting) {
3226
- t10 = /* @__PURE__ */ jsx("span", {
3370
+ if ($[0] !== history.choice || $[1] !== waiting) {
3371
+ t1 = (choice) => !waiting && history.choice === choice ? /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }) : null;
3372
+ $[0] = history.choice;
3373
+ $[1] = waiting;
3374
+ $[2] = t1;
3375
+ } else t1 = $[2];
3376
+ const current = t1;
3377
+ const t2 = `How should ${brandName} get started?`;
3378
+ const t3 = `Choose how ${brandName} gets started`;
3379
+ const t4 = history.choice === "history" ? true : void 0;
3380
+ const t5 = `${titleId}-history-choice`;
3381
+ const t6 = `${titleId}-history-description`;
3382
+ let t7;
3383
+ if ($[3] !== waiting) {
3384
+ t7 = /* @__PURE__ */ jsx("span", {
3227
3385
  className: "first-run-provider-logo",
3228
3386
  "aria-hidden": "true",
3229
3387
  children: waiting ? /* @__PURE__ */ jsx(SpinnerIcon, {
@@ -3237,195 +3395,211 @@ function HistoryChoiceStep(t0) {
3237
3395
  height: 48
3238
3396
  })
3239
3397
  });
3240
- $[10] = waiting;
3241
- $[11] = t10;
3242
- } else t10 = $[11];
3243
- const t11 = `${titleId}-history-choice`;
3244
- const t12 = waiting ? "Waiting for permission…" : "Set up from history";
3245
- let t13;
3246
- if ($[12] !== t11 || $[13] !== t12) {
3247
- t13 = /* @__PURE__ */ jsx("span", {
3248
- id: t11,
3249
- className: "first-run-provider-label",
3250
- children: t12
3398
+ $[3] = waiting;
3399
+ $[4] = t7;
3400
+ } else t7 = $[4];
3401
+ const t8 = `${titleId}-history-choice`;
3402
+ const t9 = waiting ? "Waiting for permission…" : "Set up from history";
3403
+ let t10;
3404
+ if ($[5] !== current) {
3405
+ t10 = current("history");
3406
+ $[5] = current;
3407
+ $[6] = t10;
3408
+ } else t10 = $[6];
3409
+ let t11;
3410
+ if ($[7] !== t10 || $[8] !== t8 || $[9] !== t9) {
3411
+ t11 = /* @__PURE__ */ jsxs("span", {
3412
+ id: t8,
3413
+ className: "first-run-provider-label first-run-provider-label--external",
3414
+ children: [t9, t10]
3251
3415
  });
3252
- $[12] = t11;
3253
- $[13] = t12;
3254
- $[14] = t13;
3255
- } else t13 = $[14];
3256
- const t14 = `${titleId}-history-description`;
3257
- let t15;
3258
- if ($[15] !== t14) {
3259
- t15 = /* @__PURE__ */ jsx("span", {
3260
- id: t14,
3416
+ $[7] = t10;
3417
+ $[8] = t8;
3418
+ $[9] = t9;
3419
+ $[10] = t11;
3420
+ } else t11 = $[10];
3421
+ const t12 = `${titleId}-history-description`;
3422
+ const t13 = waiting ? "Approve access in the Google window." : "Reads this profile’s history and sent email to set up your projects, people, writing style and automations.";
3423
+ let t14;
3424
+ if ($[11] !== t12 || $[12] !== t13) {
3425
+ t14 = /* @__PURE__ */ jsx("span", {
3426
+ id: t12,
3261
3427
  className: "first-run-provider-subtitle",
3262
- children: "Use your Chrome profile’s history and sent emails to suggest projects, people, writing preferences, automations and schedules before your first task."
3428
+ children: t13
3263
3429
  });
3264
- $[15] = t14;
3265
- $[16] = t15;
3266
- } else t15 = $[16];
3267
- let t16;
3268
- if ($[17] !== setUp || $[18] !== t10 || $[19] !== t13 || $[20] !== t15 || $[21] !== t8 || $[22] !== t9 || $[23] !== waiting) {
3269
- t16 = /* @__PURE__ */ jsxs(Button, {
3430
+ $[11] = t12;
3431
+ $[12] = t13;
3432
+ $[13] = t14;
3433
+ } else t14 = $[13];
3434
+ let t15;
3435
+ if ($[14] !== onSetUp || $[15] !== t11 || $[16] !== t14 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6 || $[20] !== t7 || $[21] !== waiting) {
3436
+ t15 = /* @__PURE__ */ jsxs(Button, {
3270
3437
  type: "button",
3271
3438
  className: "first-run-provider-choice",
3272
3439
  variant: "surface",
3273
3440
  color: "neutral",
3274
3441
  size: "sm",
3275
3442
  disabled: waiting,
3443
+ focusableWhenDisabled: waiting,
3276
3444
  "aria-busy": waiting,
3277
- "aria-labelledby": t8,
3278
- "aria-describedby": t9,
3279
- onClick: setUp,
3445
+ "aria-current": t4,
3446
+ "aria-labelledby": t5,
3447
+ "aria-describedby": t6,
3448
+ onClick: onSetUp,
3280
3449
  children: [
3281
- t10,
3282
- t13,
3283
- t15
3450
+ t7,
3451
+ t11,
3452
+ t14
3284
3453
  ]
3285
3454
  });
3286
- $[17] = setUp;
3287
- $[18] = t10;
3288
- $[19] = t13;
3289
- $[20] = t15;
3290
- $[21] = t8;
3291
- $[22] = t9;
3292
- $[23] = waiting;
3293
- $[24] = t16;
3294
- } else t16 = $[24];
3455
+ $[14] = onSetUp;
3456
+ $[15] = t11;
3457
+ $[16] = t14;
3458
+ $[17] = t4;
3459
+ $[18] = t5;
3460
+ $[19] = t6;
3461
+ $[20] = t7;
3462
+ $[21] = waiting;
3463
+ $[22] = t15;
3464
+ } else t15 = $[22];
3465
+ const t16 = history.choice === "skip" ? true : void 0;
3295
3466
  const t17 = `${titleId}-skip-choice`;
3296
3467
  const t18 = `${titleId}-skip-description`;
3297
3468
  let t19;
3298
- if ($[25] !== go || $[26] !== history || $[27] !== skipTo) {
3469
+ if ($[23] !== go || $[24] !== history || $[25] !== skipTo) {
3299
3470
  t19 = () => {
3300
- history.onSkipForNow();
3301
- if (skipTo) go(skipTo);
3471
+ history.onSkipForNow(skipTo);
3472
+ go(skipTo);
3302
3473
  };
3303
- $[25] = go;
3304
- $[26] = history;
3305
- $[27] = skipTo;
3306
- $[28] = t19;
3307
- } else t19 = $[28];
3474
+ $[23] = go;
3475
+ $[24] = history;
3476
+ $[25] = skipTo;
3477
+ $[26] = t19;
3478
+ } else t19 = $[26];
3308
3479
  let t20;
3309
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
3480
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
3310
3481
  t20 = /* @__PURE__ */ jsx("span", {
3311
3482
  className: "first-run-provider-logo",
3312
3483
  "aria-hidden": "true",
3313
- children: /* @__PURE__ */ jsx(LaptopIcon, {
3484
+ children: /* @__PURE__ */ jsx(ClockIcon, {
3314
3485
  size: 48,
3315
3486
  strokeWidth: 1.5
3316
3487
  })
3317
3488
  });
3318
- $[29] = t20;
3319
- } else t20 = $[29];
3489
+ $[27] = t20;
3490
+ } else t20 = $[27];
3320
3491
  const t21 = `${titleId}-skip-choice`;
3321
3492
  let t22;
3322
- if ($[30] !== t21) {
3323
- t22 = /* @__PURE__ */ jsx("span", {
3493
+ if ($[28] !== current) {
3494
+ t22 = current("skip");
3495
+ $[28] = current;
3496
+ $[29] = t22;
3497
+ } else t22 = $[29];
3498
+ let t23;
3499
+ if ($[30] !== t21 || $[31] !== t22) {
3500
+ t23 = /* @__PURE__ */ jsxs("span", {
3324
3501
  id: t21,
3325
- className: "first-run-provider-label",
3326
- children: "Skip for now"
3502
+ className: "first-run-provider-label first-run-provider-label--external",
3503
+ children: ["Skip for now", t22]
3327
3504
  });
3328
3505
  $[30] = t21;
3329
3506
  $[31] = t22;
3330
- } else t22 = $[31];
3331
- const t23 = `${titleId}-skip-description`;
3332
- let t24;
3333
- if ($[32] !== brandName || $[33] !== t23) {
3334
- t24 = /* @__PURE__ */ jsxs("span", {
3335
- id: t23,
3507
+ $[32] = t23;
3508
+ } else t23 = $[32];
3509
+ const t24 = `${titleId}-skip-description`;
3510
+ let t25;
3511
+ if ($[33] !== brandName || $[34] !== t24) {
3512
+ t25 = /* @__PURE__ */ jsxs("span", {
3513
+ id: t24,
3336
3514
  className: "first-run-provider-subtitle",
3337
3515
  children: [
3338
- "Skip browser history for setup. ",
3516
+ "Start without history. ",
3339
3517
  brandName,
3340
- " will still learn what you need as you work."
3518
+ " learns from your tasks."
3341
3519
  ]
3342
3520
  });
3343
- $[32] = brandName;
3344
- $[33] = t23;
3521
+ $[33] = brandName;
3345
3522
  $[34] = t24;
3346
- } else t24 = $[34];
3347
- let t25;
3348
- if ($[35] !== t17 || $[36] !== t18 || $[37] !== t19 || $[38] !== t22 || $[39] !== t24 || $[40] !== waiting) {
3349
- t25 = /* @__PURE__ */ jsxs(Button, {
3523
+ $[35] = t25;
3524
+ } else t25 = $[35];
3525
+ let t26;
3526
+ if ($[36] !== t16 || $[37] !== t17 || $[38] !== t18 || $[39] !== t19 || $[40] !== t23 || $[41] !== t25 || $[42] !== waiting) {
3527
+ t26 = /* @__PURE__ */ jsxs(Button, {
3350
3528
  type: "button",
3351
3529
  className: "first-run-provider-choice",
3352
3530
  variant: "surface",
3353
3531
  color: "neutral",
3354
3532
  size: "sm",
3355
3533
  disabled: waiting,
3534
+ "aria-current": t16,
3356
3535
  "aria-labelledby": t17,
3357
3536
  "aria-describedby": t18,
3358
3537
  onClick: t19,
3359
3538
  children: [
3360
3539
  t20,
3361
- t22,
3362
- t24
3540
+ t23,
3541
+ t25
3363
3542
  ]
3364
3543
  });
3365
- $[35] = t17;
3366
- $[36] = t18;
3367
- $[37] = t19;
3368
- $[38] = t22;
3369
- $[39] = t24;
3370
- $[40] = waiting;
3544
+ $[36] = t16;
3545
+ $[37] = t17;
3546
+ $[38] = t18;
3547
+ $[39] = t19;
3548
+ $[40] = t23;
3371
3549
  $[41] = t25;
3372
- } else t25 = $[41];
3373
- let t26;
3374
- if ($[42] !== t16 || $[43] !== t25 || $[44] !== t7 || $[45] !== waiting) {
3375
- t26 = /* @__PURE__ */ jsxs("div", {
3550
+ $[42] = waiting;
3551
+ $[43] = t26;
3552
+ } else t26 = $[43];
3553
+ let t27;
3554
+ if ($[44] !== t15 || $[45] !== t26 || $[46] !== t3) {
3555
+ t27 = /* @__PURE__ */ jsxs("div", {
3376
3556
  className: "first-run-provider-choices",
3377
3557
  role: "group",
3378
- "aria-label": t7,
3379
- "aria-busy": waiting,
3380
- children: [t16, t25]
3558
+ "aria-label": t3,
3559
+ children: [t15, t26]
3381
3560
  });
3382
- $[42] = t16;
3383
- $[43] = t25;
3384
- $[44] = t7;
3385
- $[45] = waiting;
3386
- $[46] = t26;
3387
- } else t26 = $[46];
3388
- let t27;
3389
- if ($[47] !== failed) {
3390
- t27 = failed ? /* @__PURE__ */ jsx("p", {
3561
+ $[44] = t15;
3562
+ $[45] = t26;
3563
+ $[46] = t3;
3564
+ $[47] = t27;
3565
+ } else t27 = $[47];
3566
+ let t28;
3567
+ if ($[48] !== failure) {
3568
+ t28 = failure ? /* @__PURE__ */ jsx("p", {
3391
3569
  role: "alert",
3392
3570
  className: "chatgpt-sign-in__error",
3393
- children: "Setting up from history didn’t finish. Try again."
3571
+ children: failure
3394
3572
  }) : null;
3395
- $[47] = failed;
3396
- $[48] = t27;
3397
- } else t27 = $[48];
3398
- let t28;
3399
- if ($[49] !== t26 || $[50] !== t27) {
3400
- t28 = /* @__PURE__ */ jsxs(Fragment, { children: [t26, t27] });
3401
- $[49] = t26;
3573
+ $[48] = failure;
3574
+ $[49] = t28;
3575
+ } else t28 = $[49];
3576
+ let t29;
3577
+ if ($[50] !== t27 || $[51] !== t28) {
3578
+ t29 = /* @__PURE__ */ jsxs(Fragment, { children: [t27, t28] });
3402
3579
  $[50] = t27;
3403
3580
  $[51] = t28;
3404
- } else t28 = $[51];
3405
- let t29;
3406
- if ($[52] !== waiting) {
3407
- t29 = /* @__PURE__ */ jsx(Back, { disabled: waiting });
3408
- $[52] = waiting;
3409
- $[53] = t29;
3410
- } else t29 = $[53];
3411
- const t30 = waiting ? "Waiting for permission" : "";
3412
- let t31;
3413
- if ($[54] !== t28 || $[55] !== t29 || $[56] !== t30 || $[57] !== t5 || $[58] !== t6) {
3414
- t31 = /* @__PURE__ */ jsx(Step, {
3415
- title: t5,
3416
- lead: t6,
3417
- body: t28,
3418
- actions: t29,
3419
- announce: t30
3581
+ $[52] = t29;
3582
+ } else t29 = $[52];
3583
+ let t30;
3584
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
3585
+ t30 = /* @__PURE__ */ jsx(Back, {});
3586
+ $[53] = t30;
3587
+ } else t30 = $[53];
3588
+ const t31 = waiting ? "Waiting for permission in the Google window" : "";
3589
+ let t32;
3590
+ if ($[54] !== t2 || $[55] !== t29 || $[56] !== t31) {
3591
+ t32 = /* @__PURE__ */ jsx(Step, {
3592
+ title: t2,
3593
+ body: t29,
3594
+ actions: t30,
3595
+ announce: t31
3420
3596
  });
3421
- $[54] = t28;
3597
+ $[54] = t2;
3422
3598
  $[55] = t29;
3423
- $[56] = t30;
3424
- $[57] = t5;
3425
- $[58] = t6;
3426
- $[59] = t31;
3427
- } else t31 = $[59];
3428
- return t31;
3599
+ $[56] = t31;
3600
+ $[57] = t32;
3601
+ } else t32 = $[57];
3602
+ return t32;
3429
3603
  }
3430
3604
  /**
3431
3605
  * A drawing of Chrome's toolbar and Extensions menu that says where to click.
@@ -3589,7 +3763,7 @@ function ReadyStep(t0) {
3589
3763
  $[11] = t2;
3590
3764
  } else t2 = $[11];
3591
3765
  t3 = `${brandName} is ready`;
3592
- t4 = `${on.length ? "Here’s what it does next. " : "Nothing is scheduled. "}Ask it for anything in the side panel.`;
3766
+ t4 = `${on.length ? "" : "Nothing is scheduled. "}Ask it for anything in the side panel.`;
3593
3767
  t5 = on.length || shortcut ? /* @__PURE__ */ jsxs(Fragment, { children: [on.length ? /* @__PURE__ */ jsxs("figure", {
3594
3768
  className: "first-run-figure",
3595
3769
  children: [/* @__PURE__ */ jsx("figcaption", { children: "Schedules" }), on.map(_temp2$1)]
@@ -3662,7 +3836,7 @@ function _temp2$1(schedule_0) {
3662
3836
  children: [
3663
3837
  /* @__PURE__ */ jsx("strong", { children: schedule_0.name }),
3664
3838
  /* @__PURE__ */ jsx("span", { children: formatThinkScheduleRepeat(schedule_0.task.schedule, "timezone" in schedule_0.task ? schedule_0.task.timezone : void 0) }),
3665
- /* @__PURE__ */ jsx("small", { children: next ? `Next ${next}` : "On" })
3839
+ /* @__PURE__ */ jsx("small", { children: next ? `Next ${next}` : "No upcoming run" })
3666
3840
  ]
3667
3841
  })
3668
3842
  }, schedule_0.id);
@@ -3679,6 +3853,147 @@ const sigveloLogo = /* @__PURE__ */ jsx("img", {
3679
3853
  height: 96
3680
3854
  });
3681
3855
  /**
3856
+ * The page setup draws around every step after the welcome: the wallpaper,
3857
+ * the brand bar, one glass card, and the footer. `FirstRunSetup` renders its
3858
+ * steps in it. It is exported for host screens outside the step flow, such
3859
+ * as setup stopping because its saved progress did not read, so they share
3860
+ * the frame instead of copying its classes.
3861
+ */
3862
+ function FirstRunFrame(t0) {
3863
+ const $ = c(34);
3864
+ let children;
3865
+ let className;
3866
+ let navigation;
3867
+ let props;
3868
+ let t1;
3869
+ let t2;
3870
+ let titleId;
3871
+ if ($[0] !== t0) {
3872
+ ({brandName: t1, brandLogo: t2, navigation, titleId, children, className, ...props} = t0);
3873
+ $[0] = t0;
3874
+ $[1] = children;
3875
+ $[2] = className;
3876
+ $[3] = navigation;
3877
+ $[4] = props;
3878
+ $[5] = t1;
3879
+ $[6] = t2;
3880
+ $[7] = titleId;
3881
+ } else {
3882
+ children = $[1];
3883
+ className = $[2];
3884
+ navigation = $[3];
3885
+ props = $[4];
3886
+ t1 = $[5];
3887
+ t2 = $[6];
3888
+ titleId = $[7];
3889
+ }
3890
+ const brandName = t1 === void 0 ? "Rook" : t1;
3891
+ const brandLogo = t2 === void 0 ? sigveloLogo : t2;
3892
+ const t3 = `Set up ${brandName}`;
3893
+ let t4;
3894
+ if ($[8] !== className) {
3895
+ t4 = cx("first-run", className);
3896
+ $[8] = className;
3897
+ $[9] = t4;
3898
+ } else t4 = $[9];
3899
+ let t5;
3900
+ if ($[10] !== brandLogo) {
3901
+ t5 = /* @__PURE__ */ jsx(React.ViewTransition, {
3902
+ name: "first-run-mark",
3903
+ children: /* @__PURE__ */ jsx("span", {
3904
+ className: "first-run-brand__mark",
3905
+ children: brandLogo
3906
+ })
3907
+ });
3908
+ $[10] = brandLogo;
3909
+ $[11] = t5;
3910
+ } else t5 = $[11];
3911
+ let t6;
3912
+ if ($[12] !== brandName) {
3913
+ t6 = /* @__PURE__ */ jsx(React.ViewTransition, {
3914
+ name: "first-run-brand-name",
3915
+ children: /* @__PURE__ */ jsx("span", { children: brandName })
3916
+ });
3917
+ $[12] = brandName;
3918
+ $[13] = t6;
3919
+ } else t6 = $[13];
3920
+ let t7;
3921
+ if ($[14] !== t5 || $[15] !== t6) {
3922
+ t7 = /* @__PURE__ */ jsx("header", {
3923
+ className: "first-run-top",
3924
+ children: /* @__PURE__ */ jsxs("span", {
3925
+ className: "first-run-brand",
3926
+ children: [t5, t6]
3927
+ })
3928
+ });
3929
+ $[14] = t5;
3930
+ $[15] = t6;
3931
+ $[16] = t7;
3932
+ } else t7 = $[16];
3933
+ let t8;
3934
+ if ($[17] !== navigation) {
3935
+ t8 = navigation ?? /* @__PURE__ */ jsx("span", { "aria-hidden": "true" });
3936
+ $[17] = navigation;
3937
+ $[18] = t8;
3938
+ } else t8 = $[18];
3939
+ let t9;
3940
+ if ($[19] !== children || $[20] !== titleId) {
3941
+ t9 = /* @__PURE__ */ jsx("section", {
3942
+ className: "first-run-screen",
3943
+ "aria-labelledby": titleId,
3944
+ children
3945
+ });
3946
+ $[19] = children;
3947
+ $[20] = titleId;
3948
+ $[21] = t9;
3949
+ } else t9 = $[21];
3950
+ let t10;
3951
+ if ($[22] !== t8 || $[23] !== t9) {
3952
+ t10 = /* @__PURE__ */ jsxs(Card, {
3953
+ className: "first-run-frame",
3954
+ children: [t8, t9]
3955
+ });
3956
+ $[22] = t8;
3957
+ $[23] = t9;
3958
+ $[24] = t10;
3959
+ } else t10 = $[24];
3960
+ let t11;
3961
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
3962
+ t11 = /* @__PURE__ */ jsx(PoweredBy, {});
3963
+ $[25] = t11;
3964
+ } else t11 = $[25];
3965
+ let t12;
3966
+ if ($[26] !== t10 || $[27] !== t7) {
3967
+ t12 = /* @__PURE__ */ jsxs("div", {
3968
+ className: "first-run__page",
3969
+ children: [
3970
+ t7,
3971
+ t10,
3972
+ t11
3973
+ ]
3974
+ });
3975
+ $[26] = t10;
3976
+ $[27] = t7;
3977
+ $[28] = t12;
3978
+ } else t12 = $[28];
3979
+ let t13;
3980
+ if ($[29] !== props || $[30] !== t12 || $[31] !== t3 || $[32] !== t4) {
3981
+ t13 = /* @__PURE__ */ jsx("main", {
3982
+ "aria-label": t3,
3983
+ ...props,
3984
+ className: t4,
3985
+ "data-recipe": "fill-host computer-wallpaper",
3986
+ children: t12
3987
+ });
3988
+ $[29] = props;
3989
+ $[30] = t12;
3990
+ $[31] = t3;
3991
+ $[32] = t4;
3992
+ $[33] = t13;
3993
+ } else t13 = $[33];
3994
+ return t13;
3995
+ }
3996
+ /**
3682
3997
  * Full-screen first run of the agent, one screen at a time: connect a
3683
3998
  * model, confirm the Chrome profile, choose whether to use history, and set up projects, people, writing, and
3684
3999
  * automations from the person's own work, try
@@ -3688,89 +4003,111 @@ const sigveloLogo = /* @__PURE__ */ jsx("img", {
3688
4003
  * moving between screens animates through React view transitions.
3689
4004
  */
3690
4005
  function FirstRunSetup(t0) {
3691
- const $ = c(68);
3692
- let automations;
4006
+ const $ = c(58);
4007
+ let automationWork;
3693
4008
  let className;
3694
4009
  let email;
3695
4010
  let history;
3696
4011
  let modelConnection;
3697
4012
  let onOpen;
3698
4013
  let onStepChange;
3699
- let people;
4014
+ let peopleWork;
3700
4015
  let pinned;
3701
- let projects;
4016
+ let projectWork;
3702
4017
  let props;
3703
4018
  let schedules;
3704
4019
  let shortcut;
3705
4020
  let signIn;
3706
- let skills;
4021
+ let skillWork;
3707
4022
  let step;
3708
4023
  let t1;
3709
4024
  let t2;
3710
- let t3;
3711
- let writing;
4025
+ let writingWork;
3712
4026
  if ($[0] !== t0) {
3713
- ({step, onStepChange, brandName: t1, brandLogo: t2, email, chromeSignedIn: t3, shortcut, signIn, modelConnection, history, projects, people, writing, automations, schedules, skills, pinned, onOpen, className, ...props} = t0);
4027
+ ({step, onStepChange, brandName: t1, brandLogo: t2, email, shortcut, signIn, modelConnection, history, projects: projectWork, people: peopleWork, writing: writingWork, automations: automationWork, schedules, skills: skillWork, pinned, onOpen, className, ...props} = t0);
3714
4028
  $[0] = t0;
3715
- $[1] = automations;
4029
+ $[1] = automationWork;
3716
4030
  $[2] = className;
3717
4031
  $[3] = email;
3718
4032
  $[4] = history;
3719
4033
  $[5] = modelConnection;
3720
4034
  $[6] = onOpen;
3721
4035
  $[7] = onStepChange;
3722
- $[8] = people;
4036
+ $[8] = peopleWork;
3723
4037
  $[9] = pinned;
3724
- $[10] = projects;
4038
+ $[10] = projectWork;
3725
4039
  $[11] = props;
3726
4040
  $[12] = schedules;
3727
4041
  $[13] = shortcut;
3728
4042
  $[14] = signIn;
3729
- $[15] = skills;
4043
+ $[15] = skillWork;
3730
4044
  $[16] = step;
3731
4045
  $[17] = t1;
3732
4046
  $[18] = t2;
3733
- $[19] = t3;
3734
- $[20] = writing;
4047
+ $[19] = writingWork;
3735
4048
  } else {
3736
- automations = $[1];
4049
+ automationWork = $[1];
3737
4050
  className = $[2];
3738
4051
  email = $[3];
3739
4052
  history = $[4];
3740
4053
  modelConnection = $[5];
3741
4054
  onOpen = $[6];
3742
4055
  onStepChange = $[7];
3743
- people = $[8];
4056
+ peopleWork = $[8];
3744
4057
  pinned = $[9];
3745
- projects = $[10];
4058
+ projectWork = $[10];
3746
4059
  props = $[11];
3747
4060
  schedules = $[12];
3748
4061
  shortcut = $[13];
3749
4062
  signIn = $[14];
3750
- skills = $[15];
4063
+ skillWork = $[15];
3751
4064
  step = $[16];
3752
4065
  t1 = $[17];
3753
4066
  t2 = $[18];
3754
- t3 = $[19];
3755
- writing = $[20];
4067
+ writingWork = $[19];
3756
4068
  }
3757
4069
  const brandName = t1 === void 0 ? "Rook" : t1;
3758
4070
  const brandLogo = t2 === void 0 ? sigveloLogo : t2;
3759
- const chromeSignedIn = t3 === void 0 ? Boolean(email) : t3;
3760
4071
  const titleId = React.useId();
3761
- let t4;
3762
- if ($[21] !== titleId) {
3763
- t4 = { mutationKey: ["first-run", titleId] };
3764
- $[21] = titleId;
3765
- $[22] = t4;
3766
- } else t4 = $[22];
3767
- const saving = useIsMutating(t4) > 0;
4072
+ let t3;
4073
+ if ($[20] !== titleId) {
4074
+ t3 = { mutationKey: ["first-run", titleId] };
4075
+ $[20] = titleId;
4076
+ $[21] = t3;
4077
+ } else t3 = $[21];
4078
+ const saving = useIsMutating(t3) > 0;
3768
4079
  const [arrival, setArrival] = React.useState(true);
3769
4080
  const [style, setStyle] = React.useState();
3770
- const [sign, setSign] = React.useState("assistant");
4081
+ const [sign, setSign] = React.useState();
3771
4082
  const [workTab, setWorkTab] = React.useState("projects");
3772
4083
  const [schedulesReviewed, setSchedulesReviewed] = React.useState(false);
3773
4084
  const [writingReviewed, setWritingReviewed] = React.useState(false);
4085
+ let t4;
4086
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
4087
+ t4 = {};
4088
+ $[22] = t4;
4089
+ } else t4 = $[22];
4090
+ const [left, setLeft] = React.useState(t4);
4091
+ const projects = {
4092
+ ...projectWork,
4093
+ ...useRetry(projectWork)
4094
+ };
4095
+ const people = {
4096
+ ...peopleWork,
4097
+ ...useRetry(peopleWork)
4098
+ };
4099
+ const writing = {
4100
+ ...writingWork,
4101
+ ...useRetry(writingWork)
4102
+ };
4103
+ const automations = {
4104
+ ...automationWork,
4105
+ ...useRetry(automationWork)
4106
+ };
4107
+ const skills = {
4108
+ ...skillWork,
4109
+ ...useRetry(skillWork)
4110
+ };
3774
4111
  const reading = history.choice === "history";
3775
4112
  const automationEntries = useQuery({
3776
4113
  ...automations.source.queryOptions,
@@ -3786,27 +4123,60 @@ function FirstRunSetup(t0) {
3786
4123
  } else t5 = $[25];
3787
4124
  const scheduled = t5;
3788
4125
  let t6;
3789
- if ($[26] !== automationEntries || $[27] !== automations.source.onRun || $[28] !== automationsReady) {
3790
- t6 = automationsReady && automations.source.onRun ? automationEntries.find(_temp3) : void 0;
4126
+ if ($[26] !== automationEntries || $[27] !== automationsReady) {
4127
+ t6 = automationsReady ? automationEntries.find(_temp3) : void 0;
3791
4128
  $[26] = automationEntries;
3792
- $[27] = automations.source.onRun;
3793
- $[28] = automationsReady;
3794
- $[29] = t6;
3795
- } else t6 = $[29];
4129
+ $[27] = automationsReady;
4130
+ $[28] = t6;
4131
+ } else t6 = $[28];
3796
4132
  const trial = t6;
3797
- const preparation = preparationState([
4133
+ const preparation = preparationStatus([
3798
4134
  projects,
3799
4135
  people,
3800
4136
  automations,
3801
4137
  skills,
3802
4138
  writing
3803
4139
  ]);
4140
+ const run = useTrialRun(trial, automations.source);
4141
+ const [tried, setTried] = React.useState(false);
4142
+ if (run.status === "done" && !tried) setTried(true);
4143
+ let t7;
4144
+ if ($[29] !== titleId) {
4145
+ t7 = [
4146
+ "first-run",
4147
+ titleId,
4148
+ "history"
4149
+ ];
4150
+ $[29] = titleId;
4151
+ $[30] = t7;
4152
+ } else t7 = $[30];
4153
+ let t8;
4154
+ if ($[31] !== history) {
4155
+ t8 = () => history.onSetUpFromHistory();
4156
+ $[31] = history;
4157
+ $[32] = t8;
4158
+ } else t8 = $[32];
4159
+ let t9;
4160
+ if ($[33] !== t7 || $[34] !== t8) {
4161
+ t9 = {
4162
+ mutationKey: t7,
4163
+ mutationFn: t8
4164
+ };
4165
+ $[33] = t7;
4166
+ $[34] = t8;
4167
+ $[35] = t9;
4168
+ } else t9 = $[35];
4169
+ const consent = useMutation(t9);
4170
+ const asking = React.useRef(false);
4171
+ const consented = React.useRef(void 0);
3804
4172
  const flow = {
3805
4173
  step,
3806
4174
  history: history.choice,
3807
4175
  pinned,
3808
4176
  trial: Boolean(trial),
3809
- preparation: preparation.status
4177
+ writing: reading && writing.status === "done",
4178
+ automations: automationsReady,
4179
+ preparation
3810
4180
  };
3811
4181
  const current = currentStep(flow);
3812
4182
  const currentRank = rank(current);
@@ -3816,23 +4186,25 @@ function FirstRunSetup(t0) {
3816
4186
  ...flow,
3817
4187
  furthest: furthestRank,
3818
4188
  saving,
4189
+ connected: signIn.status === "done" || modelConnection.kind === "managed" || modelConnection.connected,
4190
+ left,
4191
+ tried,
3819
4192
  reviewed: {
3820
- writing: writingReviewed,
4193
+ writing: writingReviewed || writing.answer !== void 0,
3821
4194
  schedules: schedulesReviewed
3822
4195
  }
3823
4196
  };
3824
- const t7 = style ?? writing.suggested ?? "direct";
3825
- let t8;
3826
- if ($[30] !== sign || $[31] !== t7) {
3827
- t8 = {
3828
- style: t7,
3829
- sign
3830
- };
3831
- $[30] = sign;
3832
- $[31] = t7;
3833
- $[32] = t8;
3834
- } else t8 = $[32];
3835
- const answer = t8;
4197
+ const answer = {
4198
+ style: style ?? writing.answer?.style ?? writing.suggested ?? "direct",
4199
+ sign: sign ?? writing.answer?.sign ?? "assistant"
4200
+ };
4201
+ let t10;
4202
+ if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
4203
+ t10 = [];
4204
+ $[36] = t10;
4205
+ } else t10 = $[36];
4206
+ React.useEffect(_temp5, t10);
4207
+ const chosen = React.useRef(false);
3836
4208
  const go = (to) => {
3837
4209
  if (!to || to === current) return;
3838
4210
  const back = rank(to) < rank(current);
@@ -3848,278 +4220,259 @@ function FirstRunSetup(t0) {
3848
4220
  titleId,
3849
4221
  arrival,
3850
4222
  go,
3851
- next: () => go(nextStep(flow)),
4223
+ next: () => {
4224
+ setLeft((previous) => ({
4225
+ ...previous,
4226
+ [current]: "continued"
4227
+ }));
4228
+ go(nextStep(flow));
4229
+ },
4230
+ skip: () => {
4231
+ setLeft((previous_0) => ({
4232
+ ...previous_0,
4233
+ [current]: "skipped"
4234
+ }));
4235
+ go(nextStep(flow));
4236
+ },
3852
4237
  back: () => go(previousStep(flow))
3853
4238
  };
3854
- let t9;
3855
- if ($[33] !== modelConnection || $[34] !== signIn) {
3856
- t9 = () => /* @__PURE__ */ jsx(SignInStep, {
3857
- ...signIn,
3858
- modelConnection
4239
+ React.useLayoutEffect(() => {
4240
+ consented.current = (choice) => {
4241
+ if (current === "history") go(choice === "history" ? "preparation" : afterHistorySkip(flow));
4242
+ };
4243
+ });
4244
+ const setUpFromHistory = () => {
4245
+ if (asking.current) return;
4246
+ asking.current = true;
4247
+ consent.mutate(void 0, {
4248
+ onSuccess: (choice_0) => consented.current?.(choice_0),
4249
+ onSettled: () => {
4250
+ asking.current = false;
4251
+ }
3859
4252
  });
3860
- $[33] = modelConnection;
3861
- $[34] = signIn;
3862
- $[35] = t9;
3863
- } else t9 = $[35];
3864
- let t10;
3865
- if ($[36] !== modelConnection) {
3866
- t10 = () => /* @__PURE__ */ jsx(ModelConnectionStep, { connection: modelConnection });
3867
- $[36] = modelConnection;
3868
- $[37] = t10;
3869
- } else t10 = $[37];
4253
+ };
3870
4254
  let t11;
3871
- if ($[38] !== chromeSignedIn || $[39] !== email) {
3872
- t11 = () => /* @__PURE__ */ jsx(ChromeProfileStep, {
3873
- email,
3874
- signedIn: chromeSignedIn
4255
+ if ($[37] !== modelConnection || $[38] !== signIn) {
4256
+ t11 = () => /* @__PURE__ */ jsx(SignInStep, {
4257
+ ...signIn,
4258
+ modelConnection
3875
4259
  });
3876
- $[38] = chromeSignedIn;
3877
- $[39] = email;
3878
- $[40] = t11;
3879
- } else t11 = $[40];
4260
+ $[37] = modelConnection;
4261
+ $[38] = signIn;
4262
+ $[39] = t11;
4263
+ } else t11 = $[39];
3880
4264
  let t12;
3881
- if ($[41] !== answer || $[42] !== chromeSignedIn || $[43] !== email || $[44] !== writing) {
3882
- t12 = () => /* @__PURE__ */ jsx(WritingStep, {
3883
- writing,
3884
- answer,
3885
- onStyleChange: setStyle,
3886
- onSignChange: setSign,
3887
- onReviewed: () => setWritingReviewed(true),
3888
- profileEmail: chromeSignedIn ? email : void 0
3889
- });
3890
- $[41] = answer;
3891
- $[42] = chromeSignedIn;
3892
- $[43] = email;
3893
- $[44] = writing;
3894
- $[45] = t12;
3895
- } else t12 = $[45];
4265
+ if ($[40] !== modelConnection) {
4266
+ t12 = () => /* @__PURE__ */ jsx(ModelConnectionStep, { connection: modelConnection });
4267
+ $[40] = modelConnection;
4268
+ $[41] = t12;
4269
+ } else t12 = $[41];
3896
4270
  let t13;
3897
- if ($[46] !== scheduled || $[47] !== schedules) {
3898
- t13 = () => /* @__PURE__ */ jsx(ScheduleReview, {
4271
+ if ($[42] !== email) {
4272
+ t13 = () => /* @__PURE__ */ jsx(ChromeProfileStep, { email });
4273
+ $[42] = email;
4274
+ $[43] = t13;
4275
+ } else t13 = $[43];
4276
+ let t14;
4277
+ if ($[44] !== scheduled || $[45] !== schedules) {
4278
+ t14 = () => /* @__PURE__ */ jsx(ScheduleReview, {
3899
4279
  automations: scheduled,
3900
4280
  schedules,
3901
4281
  onReviewed: () => setSchedulesReviewed(true)
3902
4282
  });
3903
- $[46] = scheduled;
3904
- $[47] = schedules;
3905
- $[48] = t13;
3906
- } else t13 = $[48];
3907
- let t14;
3908
- if ($[49] !== automations.source || $[50] !== trial) {
3909
- t14 = () => trial ? /* @__PURE__ */ jsx(WorkTrial, {
3910
- automation: trial,
3911
- source: automations.source
3912
- }) : null;
3913
- $[49] = automations.source;
3914
- $[50] = trial;
3915
- $[51] = t14;
3916
- } else t14 = $[51];
4283
+ $[44] = scheduled;
4284
+ $[45] = schedules;
4285
+ $[46] = t14;
4286
+ } else t14 = $[46];
3917
4287
  let t15;
3918
- if ($[52] !== email || $[53] !== pinned) {
4288
+ if ($[47] !== email || $[48] !== pinned) {
3919
4289
  t15 = () => /* @__PURE__ */ jsx(PinStep, {
3920
4290
  pinned,
3921
4291
  email
3922
4292
  });
3923
- $[52] = email;
3924
- $[53] = pinned;
3925
- $[54] = t15;
3926
- } else t15 = $[54];
4293
+ $[47] = email;
4294
+ $[48] = pinned;
4295
+ $[49] = t15;
4296
+ } else t15 = $[49];
3927
4297
  let t16;
3928
- if ($[55] !== onOpen || $[56] !== schedules || $[57] !== shortcut) {
4298
+ if ($[50] !== onOpen || $[51] !== schedules || $[52] !== shortcut) {
3929
4299
  t16 = () => /* @__PURE__ */ jsx(ReadyStep, {
3930
4300
  schedules: schedules.list,
3931
4301
  shortcut,
3932
4302
  onOpen
3933
4303
  });
3934
- $[55] = onOpen;
3935
- $[56] = schedules;
3936
- $[57] = shortcut;
3937
- $[58] = t16;
3938
- } else t16 = $[58];
4304
+ $[50] = onOpen;
4305
+ $[51] = schedules;
4306
+ $[52] = shortcut;
4307
+ $[53] = t16;
4308
+ } else t16 = $[53];
3939
4309
  const screen = {
3940
- welcome: _temp4,
3941
- "sign-in": t9,
3942
- "model-connection": t10,
3943
- "chrome-profile": t11,
4310
+ welcome: _temp6,
4311
+ "sign-in": t11,
4312
+ "model-connection": t12,
4313
+ "chrome-profile": t13,
3944
4314
  history: () => /* @__PURE__ */ jsx(HistoryChoiceStep, {
3945
4315
  history,
3946
- skipTo: nextStep({
3947
- ...flow,
3948
- history: "skip"
3949
- })
4316
+ waiting: consent.isPending,
4317
+ failure: consent.isError ? formatErrorMessage(consent.error) || "Couldn’t set up from history. Try again." : "",
4318
+ onSetUp: setUpFromHistory,
4319
+ skipTo: afterHistorySkip(flow)
3950
4320
  }),
3951
4321
  preparation: () => /* @__PURE__ */ jsx(WorkPreparation, {
3952
4322
  tab: workTab,
3953
4323
  onTabChange: setWorkTab,
3954
- preparation: preparation.status,
4324
+ preparation,
3955
4325
  projects,
3956
4326
  people,
3957
4327
  automations,
3958
4328
  skills,
3959
4329
  writing
3960
4330
  }),
3961
- writing: t12,
3962
- schedules: t13,
3963
- try: t14,
4331
+ writing: () => /* @__PURE__ */ jsx(WritingStep, {
4332
+ writing,
4333
+ answer,
4334
+ onStyleChange: setStyle,
4335
+ onSignChange: setSign,
4336
+ onReviewed: () => setWritingReviewed(true),
4337
+ profileEmail: email
4338
+ }),
4339
+ schedules: t14,
4340
+ try: () => trial ? /* @__PURE__ */ jsx(WorkTrial, {
4341
+ automation: trial,
4342
+ source: automations.source,
4343
+ run
4344
+ }) : null,
3964
4345
  pin: t15,
3965
- ask: _temp5,
4346
+ ask: _temp7,
3966
4347
  ready: t16
3967
4348
  }[current]();
3968
4349
  const items = navigationItems(navigation);
3969
- const preparing = reading && preparation.status === "working";
3970
- let t17;
3971
- if ($[59] !== className) {
3972
- t17 = cx("first-run", className);
3973
- $[59] = className;
3974
- $[60] = t17;
3975
- } else t17 = $[60];
3976
- const t18 = `Set up ${brandName}`;
3977
- const t19 = arrival ? "" : void 0;
3978
- const t20 = "fill-host computer-wallpaper";
3979
- const t21 = current === "welcome" ? screen : /* @__PURE__ */ jsxs("div", {
3980
- className: "first-run__page",
3981
- children: [
3982
- /* @__PURE__ */ jsx("header", {
3983
- className: "first-run-top",
3984
- children: /* @__PURE__ */ jsxs("span", {
3985
- className: "first-run-brand",
3986
- children: [/* @__PURE__ */ jsx(React.ViewTransition, {
3987
- name: "first-run-mark",
3988
- children: /* @__PURE__ */ jsx("span", {
3989
- className: "first-run-brand__mark",
3990
- children: brandLogo
3991
- })
3992
- }), /* @__PURE__ */ jsx(React.ViewTransition, {
3993
- name: "first-run-brand-name",
3994
- children: /* @__PURE__ */ jsx("span", { children: brandName })
3995
- })]
3996
- })
3997
- }),
3998
- /* @__PURE__ */ jsxs(Card, {
3999
- className: "first-run-frame",
4000
- children: [/* @__PURE__ */ jsxs("nav", {
4001
- className: "first-run-navigation",
4002
- "aria-label": "Setup steps",
4003
- children: [/* @__PURE__ */ jsxs(Select.Root, {
4004
- items,
4005
- value: navigationValue(flow),
4006
- onValueChange: (value, details) => {
4007
- if (details.reason === "none") {
4008
- details.cancel();
4009
- return;
4010
- }
4011
- if (value && canVisit(value, navigation)) go(value);
4012
- },
4013
- children: [/* @__PURE__ */ jsxs(Select.Trigger, {
4014
- className: "first-run-navigation__picker",
4015
- size: "md",
4016
- "aria-label": "Setup step",
4017
- disabled: saving,
4018
- children: [
4019
- /* @__PURE__ */ jsx(Select.Value, {}),
4020
- preparing && section(current)?.[0] === "Work" ? /* @__PURE__ */ jsxs("span", {
4021
- className: "first-run-work__activity",
4022
- "aria-hidden": "true",
4023
- children: [/* @__PURE__ */ jsx(SpinnerIcon, { className: "first-run-work__activity-spin" }), /* @__PURE__ */ jsxs("span", {
4024
- className: "first-run-work__activity-count",
4350
+ const preparing = reading && preparation === "working";
4351
+ const t17 = arrival ? "" : void 0;
4352
+ let t18;
4353
+ if ($[54] !== current || $[55] !== props || $[56] !== t17) {
4354
+ t18 = {
4355
+ ...props,
4356
+ "data-screen": current,
4357
+ "data-arrival": t17
4358
+ };
4359
+ $[54] = current;
4360
+ $[55] = props;
4361
+ $[56] = t17;
4362
+ $[57] = t18;
4363
+ } else t18 = $[57];
4364
+ const page = t18;
4365
+ return /* @__PURE__ */ jsx(FirstRunContext, {
4366
+ value: context,
4367
+ children: current === "welcome" ? /* @__PURE__ */ jsx("main", {
4368
+ ...page,
4369
+ className: cx("first-run", className),
4370
+ "aria-label": `Set up ${brandName}`,
4371
+ "data-recipe": "fill-host computer-wallpaper",
4372
+ children: screen
4373
+ }) : /* @__PURE__ */ jsx(FirstRunFrame, {
4374
+ ...page,
4375
+ className,
4376
+ brandName,
4377
+ brandLogo,
4378
+ titleId,
4379
+ navigation: /* @__PURE__ */ jsxs("nav", {
4380
+ className: "first-run-navigation",
4381
+ "aria-label": "Setup steps",
4382
+ children: [/* @__PURE__ */ jsxs(Select.Root, {
4383
+ items,
4384
+ value: navigationValue(flow),
4385
+ onValueChange: (value, details) => {
4386
+ if (details.reason === "none") {
4387
+ details.cancel();
4388
+ return;
4389
+ }
4390
+ if (!value || !canVisit(value, navigation)) return;
4391
+ chosen.current = value !== current;
4392
+ go(value);
4393
+ },
4394
+ children: [/* @__PURE__ */ jsxs(Select.Trigger, {
4395
+ className: "first-run-navigation__picker",
4396
+ size: "md",
4397
+ "aria-label": "Setup step",
4398
+ disabled: saving,
4399
+ children: [/* @__PURE__ */ jsx(Select.Value, {}), /* @__PURE__ */ jsx(Select.Icon, { children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })]
4400
+ }), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
4401
+ sideOffset: 4,
4402
+ alignItemWithTrigger: false,
4403
+ align: "start",
4404
+ children: /* @__PURE__ */ jsx(Select.Popup, {
4405
+ className: "first-run-navigation__menu",
4406
+ finalFocus: () => {
4407
+ const moved = chosen.current;
4408
+ chosen.current = false;
4409
+ return !moved;
4410
+ },
4411
+ children: /* @__PURE__ */ jsx(Select.List, {
4412
+ "aria-label": "Setup steps",
4413
+ children: items.map((t19, position) => {
4414
+ const { label, value: value_0, disabled, outcome, nested } = t19;
4415
+ return /* @__PURE__ */ jsxs(Select.Item, {
4416
+ value: value_0,
4417
+ className: "first-run-navigation__step",
4418
+ "data-nested": nested ? "" : void 0,
4419
+ "aria-label": label,
4420
+ "aria-describedby": outcome ? `${titleId}-${value_0}-status` : void 0,
4421
+ disabled,
4025
4422
  children: [
4026
- preparation.done,
4027
- "/",
4028
- preparation.total
4423
+ /* @__PURE__ */ jsx("span", {
4424
+ className: "first-run-navigation__mark",
4425
+ "aria-hidden": "true",
4426
+ children: outcome === "Skipped" ? /* @__PURE__ */ jsx(MinusIcon, {}) : outcome ? /* @__PURE__ */ jsx(CheckIcon, {}) : position + 1
4427
+ }),
4428
+ /* @__PURE__ */ jsx(Select.ItemText, { children: label }),
4429
+ outcome ? /* @__PURE__ */ jsx("span", {
4430
+ id: `${titleId}-${value_0}-status`,
4431
+ className: "sigvelo-visually-hidden",
4432
+ children: outcome
4433
+ }) : null
4029
4434
  ]
4030
- })]
4031
- }) : null,
4032
- /* @__PURE__ */ jsx(Select.Icon, { children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
4033
- ]
4034
- }), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
4035
- sideOffset: 4,
4036
- alignItemWithTrigger: false,
4037
- align: "start",
4038
- children: /* @__PURE__ */ jsx(Select.Popup, {
4039
- className: "first-run-navigation__menu",
4040
- children: /* @__PURE__ */ jsx(Select.List, {
4041
- "aria-label": "Setup steps",
4042
- children: items.map((t22, position) => {
4043
- const { label, value: value_0, disabled, completed, completionText } = t22;
4044
- return /* @__PURE__ */ jsxs(Select.Item, {
4045
- value: value_0,
4046
- className: "first-run-navigation__step",
4047
- "aria-label": label,
4048
- "aria-describedby": completed ? `${titleId}-${value_0}-status` : void 0,
4049
- disabled,
4050
- children: [
4051
- /* @__PURE__ */ jsx("span", {
4052
- className: "first-run-navigation__mark",
4053
- "aria-hidden": "true",
4054
- children: completed ? /* @__PURE__ */ jsx(CheckIcon, {}) : position + 1
4055
- }),
4056
- /* @__PURE__ */ jsx(Select.ItemText, { children: label }),
4057
- completed ? /* @__PURE__ */ jsx("span", {
4058
- id: `${titleId}-${value_0}-status`,
4059
- className: "sigvelo-visually-hidden",
4060
- children: completionText
4061
- }) : null
4062
- ]
4063
- }, value_0);
4064
- })
4435
+ }, value_0);
4065
4436
  })
4066
4437
  })
4067
- }) })]
4068
- }), current === "preparation" && preparing ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Button, {
4069
- className: "first-run-navigation__open",
4070
- variant: "ghost",
4071
- color: "neutral",
4072
- onClick: onOpen,
4073
- "aria-describedby": `${titleId}-open-background`,
4074
- children: [
4075
- "Open ",
4076
- brandName,
4077
- /* @__PURE__ */ jsx(ArrowRightIcon, {})
4078
- ]
4079
- }), /* @__PURE__ */ jsxs("span", {
4080
- id: `${titleId}-open-background`,
4081
- className: "sigvelo-visually-hidden",
4082
- children: [brandName, " will keep preparing your work in the background."]
4083
- })] }) : null]
4084
- }), /* @__PURE__ */ jsx("section", {
4085
- className: "first-run-screen",
4086
- "aria-labelledby": titleId,
4087
- children: /* @__PURE__ */ jsx(React.Fragment, { children: screen }, current)
4088
- })]
4438
+ })
4439
+ }) })]
4440
+ }), current === "preparation" && reading && preparation !== "done" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Button, {
4441
+ className: "first-run-navigation__open",
4442
+ variant: "ghost",
4443
+ color: "neutral",
4444
+ onClick: onOpen,
4445
+ "aria-describedby": preparing ? `${titleId}-open-background` : void 0,
4446
+ children: [
4447
+ "Open ",
4448
+ brandName,
4449
+ /* @__PURE__ */ jsx(ArrowRightIcon, {})
4450
+ ]
4451
+ }), preparing ? /* @__PURE__ */ jsxs("span", {
4452
+ id: `${titleId}-open-background`,
4453
+ className: "sigvelo-visually-hidden",
4454
+ children: [brandName, " will keep preparing your work in the background."]
4455
+ }) : null] }) : null]
4089
4456
  }),
4090
- /* @__PURE__ */ jsx(PoweredBy, {})
4091
- ]
4092
- });
4093
- let t23;
4094
- if ($[61] !== current || $[62] !== props || $[63] !== t17 || $[64] !== t18 || $[65] !== t19 || $[66] !== t21) {
4095
- t23 = /* @__PURE__ */ jsx("main", {
4096
- ...props,
4097
- className: t17,
4098
- "aria-label": t18,
4099
- "data-screen": current,
4100
- "data-arrival": t19,
4101
- "data-recipe": t20,
4102
- children: t21
4103
- });
4104
- $[61] = current;
4105
- $[62] = props;
4106
- $[63] = t17;
4107
- $[64] = t18;
4108
- $[65] = t19;
4109
- $[66] = t21;
4110
- $[67] = t23;
4111
- } else t23 = $[67];
4112
- return /* @__PURE__ */ jsx(FirstRunContext, {
4113
- value: context,
4114
- children: t23
4457
+ children: /* @__PURE__ */ jsx(React.Fragment, { children: screen }, current)
4458
+ })
4115
4459
  });
4116
4460
  }
4117
- function _temp5() {
4461
+ function _temp7() {
4118
4462
  return /* @__PURE__ */ jsx(AskStep, {});
4119
4463
  }
4120
- function _temp4() {
4464
+ function _temp6() {
4121
4465
  return /* @__PURE__ */ jsx(WelcomeStep, {});
4122
4466
  }
4467
+ function _temp5() {
4468
+ const finish = _temp4;
4469
+ document.addEventListener("keydown", finish, true);
4470
+ return () => document.removeEventListener("keydown", finish, true);
4471
+ }
4472
+ function _temp4() {
4473
+ const transition = document.activeViewTransition;
4474
+ if (transition?.types.has("first-run-forward") || transition?.types.has("first-run-back")) transition.skipTransition();
4475
+ }
4123
4476
  function _temp3(item_0) {
4124
4477
  return !item_0.parameters.some(_temp2);
4125
4478
  }
@@ -4130,4 +4483,4 @@ function _temp(item) {
4130
4483
  return item.schedule;
4131
4484
  }
4132
4485
  //#endregion
4133
- export { FirstRunSetup, firstRunHistoryChoices, firstRunSteps };
4486
+ export { FirstRunFrame, FirstRunSetup, combineFirstRunWorkStatus, firstRunHistoryChoices, firstRunSteps };