@mcp-b/react-components 0.64.0 → 0.64.1

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.
@@ -29,25 +29,44 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
29
29
  import { useIsMutating, useMutation, useQuery } from "@tanstack/react-query";
30
30
  //#region src/components/extension/first-run/flow.ts
31
31
  /**
32
- * The screens after the welcome, in order, under their label in the selector. A
33
- * screen the flow skips gives way to the next one here.
32
+ * Every screen of the first run, in order. `FirstRunStep` is derived from this
33
+ * list, so a host that persists the step can validate it at its boundary.
34
34
  */
35
- const RAIL = [
36
- ["Connect your AI", ["sign-in", "model-connection"]],
37
- ["Chrome profile", ["chrome-profile"]],
38
- ["Work", [
39
- "history",
40
- "preparation",
41
- "writing",
42
- "schedules",
43
- "try"
44
- ]],
45
- ["Ready", [
46
- "pin",
47
- "ask",
48
- "ready"
49
- ]]
35
+ const firstRunSteps = [
36
+ "welcome",
37
+ "sign-in",
38
+ "model-connection",
39
+ "chrome-profile",
40
+ "history",
41
+ "preparation",
42
+ "writing",
43
+ "schedules",
44
+ "try",
45
+ "pin",
46
+ "ask",
47
+ "ready"
50
48
  ];
49
+ /** Every history choice, for a host that persists it. */
50
+ const firstRunHistoryChoices = [
51
+ "unset",
52
+ "history",
53
+ "skip"
54
+ ];
55
+ const rank = (step) => firstRunSteps.indexOf(step);
56
+ /**
57
+ * The selector's sections, each named at its first screen. A section runs
58
+ * until the next one starts; the welcome comes before them all.
59
+ */
60
+ const SECTIONS = [
61
+ ["Connect your AI", "sign-in"],
62
+ ["Chrome profile", "chrome-profile"],
63
+ ["Work", "history"],
64
+ ["Ready", "pin"]
65
+ ];
66
+ const RAIL = SECTIONS.map(([label, first], index) => {
67
+ const following = SECTIONS[index + 1];
68
+ return [label, firstRunSteps.slice(rank(first), following && rank(following[1]))];
69
+ });
51
70
  /** Work's screens, each listed under Work in the selector once history is in use. */
52
71
  const WORK = [
53
72
  ["preparation", "Preparation"],
@@ -55,8 +74,6 @@ const WORK = [
55
74
  ["schedules", "Schedule"],
56
75
  ["try", "Try an automation"]
57
76
  ];
58
- const STEPS = ["welcome", ...RAIL.flatMap(([, steps]) => steps)];
59
- const rank = (step) => STEPS.indexOf(step);
60
77
  const section = (step) => RAIL.find(([, steps]) => steps.includes(step));
61
78
  const isWork = (step) => WORK.some(([candidate]) => candidate === step);
62
79
  /**
@@ -72,8 +89,12 @@ function applies(candidate, { step, history, pinned, trial }) {
72
89
  default: return !isWork(candidate) || history === "history";
73
90
  }
74
91
  }
75
- const flowOrder = (flow) => STEPS.filter((candidate) => applies(candidate, flow));
76
- /** The screen to show for the host's step: a skipped screen shows the next one that applies. */
92
+ const flowOrder = (flow) => firstRunSteps.filter((candidate) => applies(candidate, flow));
93
+ /**
94
+ * The screen to show for the host's step: a skipped screen shows the next one
95
+ * that applies. A Work screen restored before consent shows the history
96
+ * choice; the choice itself moves on only once the host has recorded consent.
97
+ */
77
98
  function currentStep(flow) {
78
99
  const { step, history, preparation } = flow;
79
100
  if (step === "model-connection") return step;
@@ -557,115 +578,112 @@ function validateModelAddress(value) {
557
578
  //#endregion
558
579
  //#region src/components/extension/first-run/ModelConnectionStep.tsx
559
580
  function ModelConnectionStep(t0) {
560
- const $ = c(79);
581
+ const $ = c(78);
561
582
  const { connection } = t0;
562
583
  const { go } = useFirstRun();
563
584
  const { value } = connection;
564
585
  let t1;
565
- if ($[0] !== value.endpoint) {
566
- t1 = value.endpoint.trim();
567
- $[0] = value.endpoint;
568
- $[1] = t1;
569
- } else t1 = $[1];
570
- let t2;
571
- if ($[2] !== value.model) {
572
- t2 = value.model.trim();
573
- $[2] = value.model;
574
- $[3] = t2;
575
- } else t2 = $[3];
576
- let t3;
577
- if ($[4] !== t1 || $[5] !== t2 || $[6] !== value) {
578
- t3 = {
579
- ...value,
580
- endpoint: t1,
581
- model: t2
586
+ if ($[0] !== value.apiKey || $[1] !== value.endpoint || $[2] !== value.kind || $[3] !== value.model) {
587
+ t1 = value.kind === "local" ? {
588
+ kind: "local",
589
+ endpoint: value.endpoint.trim(),
590
+ model: value.model.trim()
591
+ } : {
592
+ kind: "api",
593
+ endpoint: value.endpoint.trim(),
594
+ model: value.model.trim(),
595
+ apiKey: value.apiKey.trim()
582
596
  };
597
+ $[0] = value.apiKey;
598
+ $[1] = value.endpoint;
599
+ $[2] = value.kind;
600
+ $[3] = value.model;
583
601
  $[4] = t1;
584
- $[5] = t2;
585
- $[6] = value;
586
- $[7] = t3;
587
- } else t3 = $[7];
588
- const settings = t3;
589
- let t4;
590
- if ($[8] !== connection.connected || $[9] !== value.kind || $[10] !== value.model) {
591
- t4 = () => connection.connected && value.kind === "local" && value.model ? [value.model] : [];
592
- $[8] = connection.connected;
593
- $[9] = value.kind;
594
- $[10] = value.model;
595
- $[11] = t4;
596
- } else t4 = $[11];
597
- const [models, setModels] = React.useState(t4);
602
+ } else t1 = $[4];
603
+ const settings = t1;
604
+ let t2;
605
+ if ($[5] !== connection.connected || $[6] !== value.kind || $[7] !== value.model) {
606
+ 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];
612
+ const [models, setModels] = React.useState(t2);
598
613
  const [busy, setBusy] = React.useState(false);
599
614
  const [message, setMessage] = React.useState("");
600
615
  const [error, setError] = React.useState("");
601
616
  const request = React.useRef(0);
602
617
  const controller = React.useRef(null);
603
- let t5;
604
- let t6;
605
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
606
- t5 = () => () => {
618
+ let t3;
619
+ let t4;
620
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
621
+ t3 = () => () => {
607
622
  request.current = request.current + 1;
608
623
  controller.current?.abort();
609
624
  };
610
- t6 = [];
611
- $[12] = t5;
612
- $[13] = t6;
625
+ t4 = [];
626
+ $[9] = t3;
627
+ $[10] = t4;
613
628
  } else {
614
- t5 = $[12];
615
- t6 = $[13];
629
+ t3 = $[9];
630
+ t4 = $[10];
616
631
  }
617
- React.useEffect(t5, t6);
618
- let t7;
619
- if ($[14] !== connection || $[15] !== value) {
620
- t7 = (patch) => {
632
+ React.useEffect(t3, t4);
633
+ let t5;
634
+ if ($[11] !== connection || $[12] !== value.endpoint || $[13] !== value.kind) {
635
+ t5 = (next) => {
621
636
  request.current = request.current + 1;
622
637
  controller.current?.abort();
623
638
  setBusy(false);
624
639
  setError("");
625
- if (patch.kind !== void 0 || patch.endpoint !== void 0) {
640
+ if (next.kind !== value.kind || next.endpoint !== value.endpoint) {
626
641
  setModels([]);
627
642
  setMessage("");
628
643
  }
629
- connection.onChange({
630
- ...value,
631
- ...patch
632
- });
644
+ connection.onChange(next);
633
645
  };
634
- $[14] = connection;
635
- $[15] = value;
636
- $[16] = t7;
637
- } else t7 = $[16];
638
- const update = t7;
639
- let t8;
640
- if ($[17] !== update || $[18] !== value.endpoint || $[19] !== value.kind) {
641
- t8 = (kind) => {
646
+ $[11] = connection;
647
+ $[12] = value.endpoint;
648
+ $[13] = value.kind;
649
+ $[14] = t5;
650
+ } else t5 = $[14];
651
+ const update = t5;
652
+ let t6;
653
+ if ($[15] !== update || $[16] !== value.endpoint || $[17] !== value.kind) {
654
+ t6 = (kind) => {
642
655
  if (kind === value.kind) return;
643
656
  const local = localModelAddress(value.endpoint);
644
- update({
657
+ update(kind === "local" ? {
645
658
  kind,
646
- endpoint: kind === "local" && !local ? "http://localhost:11434/v1" : kind === "api" && local ? "" : value.endpoint,
659
+ endpoint: local ? value.endpoint : "http://localhost:11434/v1",
647
660
  model: ""
661
+ } : {
662
+ kind,
663
+ endpoint: local ? "" : value.endpoint,
664
+ model: "",
665
+ apiKey: ""
648
666
  });
649
667
  };
650
- $[17] = update;
651
- $[18] = value.endpoint;
652
- $[19] = value.kind;
653
- $[20] = t8;
654
- } else t8 = $[20];
655
- const chooseKind = t8;
656
- let t9;
657
- if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
658
- t9 = (failure) => {
668
+ $[15] = update;
669
+ $[16] = value.endpoint;
670
+ $[17] = value.kind;
671
+ $[18] = t6;
672
+ } else t6 = $[18];
673
+ const chooseKind = t6;
674
+ let t7;
675
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
676
+ t7 = (failure) => {
659
677
  setBusy(false);
660
678
  setError(failure);
661
679
  setMessage("");
662
680
  };
663
- $[21] = t9;
664
- } else t9 = $[21];
665
- const fail = t9;
666
- let t10;
667
- if ($[22] !== connection || $[23] !== settings || $[24] !== update) {
668
- t10 = async () => {
681
+ $[19] = t7;
682
+ } else t7 = $[19];
683
+ const fail = t7;
684
+ let t8;
685
+ if ($[20] !== connection || $[21] !== settings || $[22] !== update || $[23] !== value) {
686
+ t8 = async () => {
669
687
  const id = request.current = request.current + 1;
670
688
  controller.current?.abort();
671
689
  const pending = controller.current = new AbortController();
@@ -681,8 +699,8 @@ function ModelConnectionStep(t0) {
681
699
  let found;
682
700
  try {
683
701
  found = await connection.onFindModels(settings, pending.signal);
684
- } catch (t11) {
685
- const failure_0 = t11;
702
+ } catch (t9) {
703
+ const failure_0 = t9;
686
704
  if (id === request.current) {
687
705
  setModels([]);
688
706
  fail(formatErrorMessage(failure_0));
@@ -697,18 +715,22 @@ function ModelConnectionStep(t0) {
697
715
  return;
698
716
  }
699
717
  setModels(localModels);
700
- update({ model: localModels.includes(settings.model) ? settings.model : localModels[0] });
718
+ update({
719
+ ...value,
720
+ model: localModels.includes(settings.model) ? settings.model : localModels[0]
721
+ });
701
722
  setMessage("Choose a model, then connect it.");
702
723
  };
703
- $[22] = connection;
704
- $[23] = settings;
705
- $[24] = update;
706
- $[25] = t10;
707
- } else t10 = $[25];
708
- const findModels = t10;
709
- let t11;
710
- if ($[26] !== connection || $[27] !== go || $[28] !== settings) {
711
- t11 = async () => {
724
+ $[20] = connection;
725
+ $[21] = settings;
726
+ $[22] = update;
727
+ $[23] = value;
728
+ $[24] = t8;
729
+ } else t8 = $[24];
730
+ const findModels = t8;
731
+ let t9;
732
+ if ($[25] !== connection || $[26] !== go || $[27] !== settings) {
733
+ t9 = async () => {
712
734
  const id_0 = request.current = request.current + 1;
713
735
  controller.current?.abort();
714
736
  const pending_0 = controller.current = new AbortController();
@@ -722,8 +744,8 @@ function ModelConnectionStep(t0) {
722
744
  setMessage("Testing a short answer from this model…");
723
745
  try {
724
746
  await connection.onConnect(settings, pending_0.signal);
725
- } catch (t12) {
726
- const failure_1 = t12;
747
+ } catch (t10) {
748
+ const failure_1 = t10;
727
749
  if (id_0 === request.current) fail(formatErrorMessage(failure_1));
728
750
  return;
729
751
  }
@@ -731,54 +753,54 @@ function ModelConnectionStep(t0) {
731
753
  setBusy(false);
732
754
  go("chrome-profile");
733
755
  };
734
- $[26] = connection;
735
- $[27] = go;
736
- $[28] = settings;
737
- $[29] = t11;
738
- } else t11 = $[29];
739
- const connect = t11;
740
- let t12;
756
+ $[25] = connection;
757
+ $[26] = go;
758
+ $[27] = settings;
759
+ $[28] = t9;
760
+ } else t9 = $[28];
761
+ const connect = t9;
762
+ let t10;
763
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
764
+ t10 = /* @__PURE__ */ jsx("legend", { children: "AI source" });
765
+ $[29] = t10;
766
+ } else t10 = $[29];
767
+ let t11;
741
768
  if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
742
- t12 = /* @__PURE__ */ jsx("legend", { children: "AI source" });
743
- $[30] = t12;
744
- } else t12 = $[30];
745
- let t13;
746
- if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
747
- t13 = /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx(Radio.Root, {
769
+ t11 = /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx(Radio.Root, {
748
770
  value: "local",
749
771
  children: /* @__PURE__ */ jsx(Radio.Indicator, {})
750
772
  }), "Local AI"] });
751
- $[31] = t13;
752
- } else t13 = $[31];
753
- let t14;
754
- if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
755
- t14 = /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx(Radio.Root, {
773
+ $[30] = t11;
774
+ } else t11 = $[30];
775
+ let t12;
776
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
777
+ t12 = /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx(Radio.Root, {
756
778
  value: "api",
757
779
  children: /* @__PURE__ */ jsx(Radio.Indicator, {})
758
780
  }), "Another provider"] });
759
- $[32] = t14;
760
- } else t14 = $[32];
761
- let t15;
762
- if ($[33] !== chooseKind || $[34] !== value.kind) {
763
- t15 = /* @__PURE__ */ jsxs("fieldset", {
781
+ $[31] = t12;
782
+ } else t12 = $[31];
783
+ let t13;
784
+ if ($[32] !== chooseKind || $[33] !== value.kind) {
785
+ t13 = /* @__PURE__ */ jsxs("fieldset", {
764
786
  className: "first-run-model-source",
765
- children: [t12, /* @__PURE__ */ jsxs(RadioGroup.Root, {
787
+ children: [t10, /* @__PURE__ */ jsxs(RadioGroup.Root, {
766
788
  className: "first-run-model-source__options",
767
789
  "aria-label": "AI source",
768
790
  name: "providerKind",
769
791
  orientation: "horizontal",
770
792
  value: value.kind,
771
793
  onValueChange: chooseKind,
772
- children: [t13, t14]
794
+ children: [t11, t12]
773
795
  })]
774
796
  });
775
- $[33] = chooseKind;
776
- $[34] = value.kind;
777
- $[35] = t15;
778
- } else t15 = $[35];
779
- let t16;
780
- if ($[36] !== value.kind) {
781
- t16 = value.kind === "local" ? /* @__PURE__ */ jsxs("p", { children: [
797
+ $[32] = chooseKind;
798
+ $[33] = value.kind;
799
+ $[34] = t13;
800
+ } else t13 = $[34];
801
+ let t14;
802
+ if ($[35] !== value.kind) {
803
+ t14 = value.kind === "local" ? /* @__PURE__ */ jsxs("p", { children: [
782
804
  "New to local AI?",
783
805
  " ",
784
806
  /* @__PURE__ */ jsx("a", {
@@ -789,48 +811,52 @@ function ModelConnectionStep(t0) {
789
811
  }),
790
812
  ", then find your models below."
791
813
  ] }) : null;
792
- $[36] = value.kind;
793
- $[37] = t16;
794
- } else t16 = $[37];
795
- let t17;
796
- if ($[38] !== value.kind) {
797
- t17 = value.kind === "api" ? /* @__PURE__ */ jsx("p", { children: "Enter your provider’s OpenAI-compatible service address and model name." }) : null;
798
- $[38] = value.kind;
799
- $[39] = t17;
800
- } else t17 = $[39];
814
+ $[35] = value.kind;
815
+ $[36] = t14;
816
+ } else t14 = $[36];
817
+ let t15;
818
+ if ($[37] !== value.kind) {
819
+ 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];
823
+ let t16;
824
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
825
+ t16 = /* @__PURE__ */ jsx("span", { children: "Service address" });
826
+ $[39] = t16;
827
+ } else t16 = $[39];
828
+ const t17 = value.kind === "local" ? "http://localhost:11434/v1" : "https://your-provider.example/v1";
801
829
  let t18;
802
- if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
803
- t18 = /* @__PURE__ */ jsx("span", { children: "Service address" });
804
- $[40] = t18;
805
- } else t18 = $[40];
806
- const t19 = value.kind === "local" ? "http://localhost:11434/v1" : "https://your-provider.example/v1";
807
- let t20;
808
- if ($[41] !== update) {
809
- t20 = (event) => update({ endpoint: event.currentTarget.value });
810
- $[41] = update;
811
- $[42] = t20;
812
- } else t20 = $[42];
813
- let t21;
814
- if ($[43] !== busy || $[44] !== t19 || $[45] !== t20 || $[46] !== value.endpoint) {
815
- t21 = /* @__PURE__ */ jsxs("label", {
830
+ if ($[40] !== update || $[41] !== value) {
831
+ t18 = (event) => update({
832
+ ...value,
833
+ endpoint: event.currentTarget.value
834
+ });
835
+ $[40] = update;
836
+ $[41] = value;
837
+ $[42] = t18;
838
+ } else t18 = $[42];
839
+ let t19;
840
+ if ($[43] !== busy || $[44] !== t17 || $[45] !== t18 || $[46] !== value.endpoint) {
841
+ t19 = /* @__PURE__ */ jsxs("label", {
816
842
  className: "first-run-field",
817
- children: [t18, /* @__PURE__ */ jsx(Input, {
843
+ children: [t16, /* @__PURE__ */ jsx(Input, {
818
844
  name: "endpoint",
819
845
  value: value.endpoint,
820
846
  disabled: busy,
821
- placeholder: t19,
822
- onChange: t20
847
+ placeholder: t17,
848
+ onChange: t18
823
849
  })]
824
850
  });
825
851
  $[43] = busy;
826
- $[44] = t19;
827
- $[45] = t20;
852
+ $[44] = t17;
853
+ $[45] = t18;
828
854
  $[46] = value.endpoint;
829
- $[47] = t21;
830
- } else t21 = $[47];
831
- let t22;
832
- if ($[48] !== busy || $[49] !== findModels || $[50] !== models || $[51] !== update || $[52] !== value.kind || $[53] !== value.model) {
833
- t22 = value.kind === "local" ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Button, {
855
+ $[47] = t19;
856
+ } else t19 = $[47];
857
+ let t20;
858
+ if ($[48] !== busy || $[49] !== findModels || $[50] !== models || $[51] !== update || $[52] !== value) {
859
+ t20 = value.kind === "local" ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Button, {
834
860
  variant: "surface",
835
861
  color: "neutral",
836
862
  size: "sm",
@@ -845,7 +871,10 @@ function ModelConnectionStep(t0) {
845
871
  value: models.length ? value.model : null,
846
872
  disabled: busy || !models.length,
847
873
  onValueChange: (model_2) => {
848
- if (model_2) update({ model: model_2 });
874
+ if (model_2) update({
875
+ ...value,
876
+ model: model_2
877
+ });
849
878
  },
850
879
  children: [
851
880
  /* @__PURE__ */ jsx(Select.Label, { children: "Model" }),
@@ -860,7 +889,22 @@ function ModelConnectionStep(t0) {
860
889
  }) })
861
890
  ]
862
891
  })
863
- })] }) : /* @__PURE__ */ jsxs("label", {
892
+ })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("label", {
893
+ className: "first-run-field",
894
+ children: [/* @__PURE__ */ jsx("span", { children: "API key" }), /* @__PURE__ */ jsx(Input, {
895
+ name: "apiKey",
896
+ type: "password",
897
+ autoComplete: "off",
898
+ spellCheck: false,
899
+ value: value.apiKey,
900
+ disabled: busy,
901
+ placeholder: "Leave empty if your provider doesn’t use one",
902
+ onChange: (event_0) => update({
903
+ ...value,
904
+ apiKey: event_0.currentTarget.value
905
+ })
906
+ })]
907
+ }), /* @__PURE__ */ jsxs("label", {
864
908
  className: "first-run-field",
865
909
  children: [/* @__PURE__ */ jsx("span", { children: "Model name" }), /* @__PURE__ */ jsx(Input, {
866
910
  name: "model",
@@ -868,97 +912,99 @@ function ModelConnectionStep(t0) {
868
912
  disabled: busy,
869
913
  required: true,
870
914
  placeholder: "Model ID from your provider",
871
- onChange: (event_0) => update({ model: event_0.currentTarget.value })
915
+ onChange: (event_1) => update({
916
+ ...value,
917
+ model: event_1.currentTarget.value
918
+ })
872
919
  })]
873
- });
920
+ })] });
874
921
  $[48] = busy;
875
922
  $[49] = findModels;
876
923
  $[50] = models;
877
924
  $[51] = update;
878
- $[52] = value.kind;
879
- $[53] = value.model;
880
- $[54] = t22;
881
- } else t22 = $[54];
882
- let t23;
883
- if ($[55] !== message) {
884
- t23 = message ? /* @__PURE__ */ jsx("p", {
925
+ $[52] = value;
926
+ $[53] = t20;
927
+ } else t20 = $[53];
928
+ let t21;
929
+ if ($[54] !== message) {
930
+ t21 = message ? /* @__PURE__ */ jsx("p", {
885
931
  className: "first-run-provider-status",
886
932
  role: "status",
887
933
  children: message
888
934
  }) : null;
889
- $[55] = message;
890
- $[56] = t23;
891
- } else t23 = $[56];
892
- let t24;
893
- if ($[57] !== error) {
894
- t24 = error ? /* @__PURE__ */ jsx("p", {
935
+ $[54] = message;
936
+ $[55] = t21;
937
+ } else t21 = $[55];
938
+ let t22;
939
+ if ($[56] !== error) {
940
+ t22 = error ? /* @__PURE__ */ jsx("p", {
895
941
  className: "first-run-connection-error",
896
942
  role: "alert",
897
943
  children: error
898
944
  }) : null;
899
- $[57] = error;
900
- $[58] = t24;
901
- } else t24 = $[58];
902
- let t25;
903
- if ($[59] !== t15 || $[60] !== t16 || $[61] !== t17 || $[62] !== t21 || $[63] !== t22 || $[64] !== t23 || $[65] !== t24) {
904
- t25 = /* @__PURE__ */ jsxs(Fragment, { children: [
945
+ $[56] = error;
946
+ $[57] = t22;
947
+ } else t22 = $[57];
948
+ let t23;
949
+ if ($[58] !== t13 || $[59] !== t14 || $[60] !== t15 || $[61] !== t19 || $[62] !== t20 || $[63] !== t21 || $[64] !== t22) {
950
+ t23 = /* @__PURE__ */ jsxs(Fragment, { children: [
951
+ t13,
952
+ t14,
905
953
  t15,
906
- t16,
907
- t17,
954
+ t19,
955
+ t20,
908
956
  t21,
909
- t22,
910
- t23,
911
- t24
957
+ t22
912
958
  ] });
913
- $[59] = t15;
914
- $[60] = t16;
915
- $[61] = t17;
916
- $[62] = t21;
917
- $[63] = t22;
918
- $[64] = t23;
919
- $[65] = t24;
920
- $[66] = t25;
921
- } else t25 = $[66];
922
- const t26 = busy || value.kind === "local" && !models.length;
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;
969
+ let t25;
970
+ if ($[66] !== connect) {
971
+ t25 = () => void connect();
972
+ $[66] = connect;
973
+ $[67] = t25;
974
+ } else t25 = $[67];
975
+ const t26 = busy ? "Checking…" : "Connect model";
923
976
  let t27;
924
- if ($[67] !== connect) {
925
- t27 = () => void connect();
926
- $[67] = connect;
927
- $[68] = t27;
928
- } else t27 = $[68];
929
- const t28 = busy ? "Checking…" : "Connect model";
930
- let t29;
931
- if ($[69] !== busy) {
932
- t29 = busy ? null : /* @__PURE__ */ jsx(ArrowRightIcon, {});
933
- $[69] = busy;
934
- $[70] = t29;
935
- } else t29 = $[70];
936
- let t30;
937
- if ($[71] !== t26 || $[72] !== t27 || $[73] !== t28 || $[74] !== t29) {
938
- t30 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsxs(Button, {
939
- disabled: t26,
940
- onClick: t27,
941
- children: [t28, t29]
977
+ if ($[68] !== busy) {
978
+ t27 = busy ? null : /* @__PURE__ */ jsx(ArrowRightIcon, {});
979
+ $[68] = busy;
980
+ $[69] = t27;
981
+ } else t27 = $[69];
982
+ let t28;
983
+ if ($[70] !== t24 || $[71] !== t25 || $[72] !== t26 || $[73] !== t27) {
984
+ t28 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsxs(Button, {
985
+ disabled: t24,
986
+ onClick: t25,
987
+ children: [t26, t27]
942
988
  }) });
943
- $[71] = t26;
944
- $[72] = t27;
945
- $[73] = t28;
946
- $[74] = t29;
947
- $[75] = t30;
948
- } else t30 = $[75];
949
- let t31;
950
- if ($[76] !== t25 || $[77] !== t30) {
951
- t31 = /* @__PURE__ */ jsx(Step, {
989
+ $[70] = t24;
990
+ $[71] = t25;
991
+ $[72] = t26;
992
+ $[73] = t27;
993
+ $[74] = t28;
994
+ } else t28 = $[74];
995
+ let t29;
996
+ if ($[75] !== t23 || $[76] !== t28) {
997
+ t29 = /* @__PURE__ */ jsx(Step, {
952
998
  title: "Connect a model",
953
999
  lead: "Use another AI provider or a model running on this computer.",
954
- body: t25,
955
- actions: t30
1000
+ body: t23,
1001
+ actions: t28
956
1002
  });
957
- $[76] = t25;
958
- $[77] = t30;
959
- $[78] = t31;
960
- } else t31 = $[78];
961
- return t31;
1003
+ $[75] = t23;
1004
+ $[76] = t28;
1005
+ $[77] = t29;
1006
+ } else t29 = $[77];
1007
+ return t29;
962
1008
  }
963
1009
  function _temp4$2(model_3) {
964
1010
  return /* @__PURE__ */ jsxs(Select.Item, {
@@ -1102,7 +1148,7 @@ function WorkPreparation(t0) {
1102
1148
  focusable: "false",
1103
1149
  children: ORB_PARTICLES.map(_temp3$2)
1104
1150
  })
1105
- }) : 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" ? `${brandName} is preparing your writing style` : `${brandName} is preparing your work` })]
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` })]
1106
1152
  });
1107
1153
  T1 = Tabs.Root;
1108
1154
  t5 = tab;
@@ -1182,7 +1228,7 @@ function WorkPreparation(t0) {
1182
1228
  children: rows
1183
1229
  }) : work_1.status === "working" && work_1.activity?.length ? null : /* @__PURE__ */ jsx("p", {
1184
1230
  className: "first-run-work__empty",
1185
- 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.` : `Finding your ${label_0.toLowerCase()}…`
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()}.`
1186
1232
  }),
1187
1233
  work_1.status === "failed" ? /* @__PURE__ */ jsx(Button, {
1188
1234
  className: "first-run-work__retry",
@@ -1588,7 +1634,11 @@ function ScheduleReview(t0) {
1588
1634
  const { brandName, titleId } = useFirstRun();
1589
1635
  let t1;
1590
1636
  if ($[0] !== titleId) {
1591
- t1 = ["first-run-schedule", titleId];
1637
+ t1 = [
1638
+ "first-run",
1639
+ titleId,
1640
+ "schedule"
1641
+ ];
1592
1642
  $[0] = titleId;
1593
1643
  $[1] = t1;
1594
1644
  } else t1 = $[1];
@@ -2615,73 +2665,75 @@ function WelcomeStep() {
2615
2665
  return t8;
2616
2666
  }
2617
2667
  function SignInStep(t0) {
2618
- const $ = c(24);
2619
- const { status, onSignIn, modelConnection } = t0;
2668
+ const $ = c(25);
2669
+ const { status, onSignIn, onUse, modelConnection } = t0;
2620
2670
  const { brandName } = useFirstRun();
2621
2671
  const done = status === "done";
2622
2672
  useAutoAdvance(done);
2623
2673
  const t1 = `${brandName} uses it for everything, starting with the rest of setup.`;
2624
2674
  let t2;
2625
- if ($[0] !== modelConnection.connected || $[1] !== onSignIn || $[2] !== status) {
2675
+ if ($[0] !== modelConnection.connected || $[1] !== onSignIn || $[2] !== onUse || $[3] !== status) {
2626
2676
  t2 = /* @__PURE__ */ jsx(ChatGptProviderChoice, {
2627
2677
  status,
2628
2678
  onSignIn,
2679
+ onUse,
2629
2680
  modelConnected: modelConnection.connected
2630
2681
  });
2631
2682
  $[0] = modelConnection.connected;
2632
2683
  $[1] = onSignIn;
2633
- $[2] = status;
2634
- $[3] = t2;
2635
- } else t2 = $[3];
2684
+ $[2] = onUse;
2685
+ $[3] = status;
2686
+ $[4] = t2;
2687
+ } else t2 = $[4];
2636
2688
  let t3;
2637
- if ($[4] !== modelConnection) {
2689
+ if ($[5] !== modelConnection) {
2638
2690
  t3 = /* @__PURE__ */ jsx(OtherProviderChoice, { connection: modelConnection });
2639
- $[4] = modelConnection;
2640
- $[5] = t3;
2641
- } else t3 = $[5];
2691
+ $[5] = modelConnection;
2692
+ $[6] = t3;
2693
+ } else t3 = $[6];
2642
2694
  let t4;
2643
- if ($[6] !== t2 || $[7] !== t3) {
2695
+ if ($[7] !== t2 || $[8] !== t3) {
2644
2696
  t4 = /* @__PURE__ */ jsxs("div", {
2645
2697
  className: "first-run-provider-choices",
2646
2698
  children: [t2, t3]
2647
2699
  });
2648
- $[6] = t2;
2649
- $[7] = t3;
2650
- $[8] = t4;
2651
- } else t4 = $[8];
2700
+ $[7] = t2;
2701
+ $[8] = t3;
2702
+ $[9] = t4;
2703
+ } else t4 = $[9];
2652
2704
  let t5;
2653
- if ($[9] !== status) {
2705
+ if ($[10] !== status) {
2654
2706
  t5 = status === "failed" ? /* @__PURE__ */ jsx("p", {
2655
2707
  role: "alert",
2656
2708
  className: "chatgpt-sign-in__error",
2657
2709
  children: "Sign-in didn’t finish. Try again."
2658
2710
  }) : null;
2659
- $[9] = status;
2660
- $[10] = t5;
2661
- } else t5 = $[10];
2711
+ $[10] = status;
2712
+ $[11] = t5;
2713
+ } else t5 = $[11];
2662
2714
  let t6;
2663
- if ($[11] !== t4 || $[12] !== t5) {
2715
+ if ($[12] !== t4 || $[13] !== t5) {
2664
2716
  t6 = /* @__PURE__ */ jsxs(Fragment, { children: [t4, t5] });
2665
- $[11] = t4;
2666
- $[12] = t5;
2667
- $[13] = t6;
2668
- } else t6 = $[13];
2717
+ $[12] = t4;
2718
+ $[13] = t5;
2719
+ $[14] = t6;
2720
+ } else t6 = $[14];
2669
2721
  let t7;
2670
- if ($[14] !== done || $[15] !== modelConnection.connected) {
2722
+ if ($[15] !== done || $[16] !== modelConnection.connected) {
2671
2723
  t7 = done || modelConnection.connected ? /* @__PURE__ */ jsx(Next, {}) : null;
2672
- $[14] = done;
2673
- $[15] = modelConnection.connected;
2674
- $[16] = t7;
2675
- } else t7 = $[16];
2724
+ $[15] = done;
2725
+ $[16] = modelConnection.connected;
2726
+ $[17] = t7;
2727
+ } else t7 = $[17];
2676
2728
  let t8;
2677
- if ($[17] !== t7) {
2729
+ if ($[18] !== t7) {
2678
2730
  t8 = /* @__PURE__ */ jsx(Actions, { children: t7 });
2679
- $[17] = t7;
2680
- $[18] = t8;
2681
- } else t8 = $[18];
2731
+ $[18] = t7;
2732
+ $[19] = t8;
2733
+ } else t8 = $[19];
2682
2734
  const t9 = status === "waiting" ? "Waiting for ChatGPT" : done ? "Signed in with ChatGPT" : "";
2683
2735
  let t10;
2684
- if ($[19] !== t1 || $[20] !== t6 || $[21] !== t8 || $[22] !== t9) {
2736
+ if ($[20] !== t1 || $[21] !== t6 || $[22] !== t8 || $[23] !== t9) {
2685
2737
  t10 = /* @__PURE__ */ jsx(Step, {
2686
2738
  title: "Connect your AI",
2687
2739
  lead: t1,
@@ -2689,17 +2741,17 @@ function SignInStep(t0) {
2689
2741
  actions: t8,
2690
2742
  announce: t9
2691
2743
  });
2692
- $[19] = t1;
2693
- $[20] = t6;
2694
- $[21] = t8;
2695
- $[22] = t9;
2696
- $[23] = t10;
2697
- } else t10 = $[23];
2744
+ $[20] = t1;
2745
+ $[21] = t6;
2746
+ $[22] = t8;
2747
+ $[23] = t9;
2748
+ $[24] = t10;
2749
+ } else t10 = $[24];
2698
2750
  return t10;
2699
2751
  }
2700
2752
  function ChatGptProviderChoice(t0) {
2701
- const $ = c(27);
2702
- const { status, onSignIn, modelConnected } = t0;
2753
+ const $ = c(28);
2754
+ const { status, onSignIn, onUse, modelConnected } = t0;
2703
2755
  const { brandName, go } = useFirstRun();
2704
2756
  const descriptionId = React.useId();
2705
2757
  const done = status === "done";
@@ -2708,18 +2760,20 @@ function ChatGptProviderChoice(t0) {
2708
2760
  const t2 = status === "waiting";
2709
2761
  const t3 = status === "waiting" ? "Waiting for ChatGPT" : done && !modelConnected ? "Use ChatGPT, already signed in" : label;
2710
2762
  let t4;
2711
- if ($[0] !== done || $[1] !== go || $[2] !== onSignIn) {
2763
+ if ($[0] !== done || $[1] !== go || $[2] !== onSignIn || $[3] !== onUse) {
2712
2764
  t4 = () => {
2713
- onSignIn();
2714
- if (done) go("chrome-profile");
2765
+ if (!done) return onSignIn();
2766
+ onUse();
2767
+ go("chrome-profile");
2715
2768
  };
2716
2769
  $[0] = done;
2717
2770
  $[1] = go;
2718
2771
  $[2] = onSignIn;
2719
- $[3] = t4;
2720
- } else t4 = $[3];
2772
+ $[3] = onUse;
2773
+ $[4] = t4;
2774
+ } else t4 = $[4];
2721
2775
  let t5;
2722
- if ($[4] !== status) {
2776
+ if ($[5] !== status) {
2723
2777
  t5 = /* @__PURE__ */ jsx("span", {
2724
2778
  className: "first-run-provider-logo",
2725
2779
  "aria-hidden": "true",
@@ -2733,28 +2787,28 @@ function ChatGptProviderChoice(t0) {
2733
2787
  height: 80
2734
2788
  })
2735
2789
  });
2736
- $[4] = status;
2737
- $[5] = t5;
2738
- } else t5 = $[5];
2790
+ $[5] = status;
2791
+ $[6] = t5;
2792
+ } else t5 = $[6];
2739
2793
  let t6;
2740
- if ($[6] !== done || $[7] !== status) {
2794
+ if ($[7] !== done || $[8] !== status) {
2741
2795
  t6 = !done && status !== "waiting" ? /* @__PURE__ */ jsx(ArrowUpRightIcon, { "aria-hidden": "true" }) : null;
2742
- $[6] = done;
2743
- $[7] = status;
2744
- $[8] = t6;
2745
- } else t6 = $[8];
2796
+ $[7] = done;
2797
+ $[8] = status;
2798
+ $[9] = t6;
2799
+ } else t6 = $[9];
2746
2800
  let t7;
2747
- if ($[9] !== label || $[10] !== t6) {
2801
+ if ($[10] !== label || $[11] !== t6) {
2748
2802
  t7 = /* @__PURE__ */ jsxs("span", {
2749
2803
  className: "first-run-provider-label first-run-provider-label--external",
2750
2804
  children: [label, t6]
2751
2805
  });
2752
- $[9] = label;
2753
- $[10] = t6;
2754
- $[11] = t7;
2755
- } else t7 = $[11];
2806
+ $[10] = label;
2807
+ $[11] = t6;
2808
+ $[12] = t7;
2809
+ } else t7 = $[12];
2756
2810
  let t8;
2757
- if ($[12] !== descriptionId || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t7) {
2811
+ if ($[13] !== descriptionId || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t7) {
2758
2812
  t8 = /* @__PURE__ */ jsxs(Button, {
2759
2813
  className: "first-run-provider-action",
2760
2814
  variant: "ghost",
@@ -2766,27 +2820,27 @@ function ChatGptProviderChoice(t0) {
2766
2820
  onClick: t4,
2767
2821
  children: [t5, t7]
2768
2822
  });
2769
- $[12] = descriptionId;
2770
- $[13] = t1;
2771
- $[14] = t2;
2772
- $[15] = t3;
2773
- $[16] = t4;
2774
- $[17] = t5;
2775
- $[18] = t7;
2776
- $[19] = t8;
2777
- } else t8 = $[19];
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];
2778
2832
  let t9;
2779
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
2833
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
2780
2834
  t9 = /* @__PURE__ */ jsx("a", {
2781
2835
  href: "https://help.openai.com/en/articles/7730893-data-controls-faq",
2782
2836
  target: "_blank",
2783
2837
  rel: "noopener noreferrer",
2784
2838
  children: "data controls"
2785
2839
  });
2786
- $[20] = t9;
2787
- } else t9 = $[20];
2840
+ $[21] = t9;
2841
+ } else t9 = $[21];
2788
2842
  let t10;
2789
- if ($[21] !== brandName || $[22] !== descriptionId) {
2843
+ if ($[22] !== brandName || $[23] !== descriptionId) {
2790
2844
  t10 = /* @__PURE__ */ jsxs("p", {
2791
2845
  id: descriptionId,
2792
2846
  className: "first-run-provider-subtitle",
@@ -2798,20 +2852,20 @@ function ChatGptProviderChoice(t0) {
2798
2852
  "."
2799
2853
  ]
2800
2854
  });
2801
- $[21] = brandName;
2802
- $[22] = descriptionId;
2803
- $[23] = t10;
2804
- } else t10 = $[23];
2855
+ $[22] = brandName;
2856
+ $[23] = descriptionId;
2857
+ $[24] = t10;
2858
+ } else t10 = $[24];
2805
2859
  let t11;
2806
- if ($[24] !== t10 || $[25] !== t8) {
2860
+ if ($[25] !== t10 || $[26] !== t8) {
2807
2861
  t11 = /* @__PURE__ */ jsxs(Card, {
2808
2862
  className: "first-run-provider-choice first-run-provider-choice--linked",
2809
2863
  children: [t8, t10]
2810
2864
  });
2811
- $[24] = t10;
2812
- $[25] = t8;
2813
- $[26] = t11;
2814
- } else t11 = $[26];
2865
+ $[25] = t10;
2866
+ $[26] = t8;
2867
+ $[27] = t11;
2868
+ } else t11 = $[27];
2815
2869
  return t11;
2816
2870
  }
2817
2871
  function OtherProviderChoice(t0) {
@@ -3104,100 +3158,156 @@ function ProfileInitial(t0) {
3104
3158
  return t2;
3105
3159
  }
3106
3160
  function HistoryChoiceStep(t0) {
3107
- const $ = c(39);
3161
+ const $ = c(60);
3108
3162
  const { history, skipTo } = t0;
3109
3163
  const { brandName, go, titleId } = useFirstRun();
3110
- const t1 = `How should ${brandName} get started?`;
3111
- const t2 = `Choose whether ${brandName} should prepare work from this Chrome profile.`;
3112
- const t3 = `Choose how ${brandName} gets started`;
3113
- const t4 = `${titleId}-history-choice`;
3114
- const t5 = `${titleId}-history-description`;
3115
- let t6;
3116
- if ($[0] !== go || $[1] !== history) {
3117
- t6 = () => {
3118
- history.onSetUpFromHistory();
3119
- go("preparation");
3164
+ const asking = React.useRef(false);
3165
+ 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
+ }
3120
3183
  };
3121
- $[0] = go;
3122
- $[1] = history;
3123
- $[2] = t6;
3124
- } else t6 = $[2];
3125
- let t7;
3126
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
3127
- t7 = /* @__PURE__ */ jsx("span", {
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", {
3128
3227
  className: "first-run-provider-logo",
3129
3228
  "aria-hidden": "true",
3130
- children: /* @__PURE__ */ jsx("img", {
3229
+ children: waiting ? /* @__PURE__ */ jsx(SpinnerIcon, {
3230
+ className: "sigvelo-icon--spinner",
3231
+ size: 48,
3232
+ strokeWidth: 1.75
3233
+ }) : /* @__PURE__ */ jsx("img", {
3131
3234
  src: CHROME_MARK,
3132
3235
  alt: "",
3133
3236
  width: 48,
3134
3237
  height: 48
3135
3238
  })
3136
3239
  });
3137
- $[3] = t7;
3138
- } else t7 = $[3];
3139
- const t8 = `${titleId}-history-choice`;
3140
- let t9;
3141
- if ($[4] !== t8) {
3142
- t9 = /* @__PURE__ */ jsx("span", {
3143
- id: t8,
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,
3144
3249
  className: "first-run-provider-label",
3145
- children: "Set up from history"
3250
+ children: t12
3146
3251
  });
3147
- $[4] = t8;
3148
- $[5] = t9;
3149
- } else t9 = $[5];
3150
- const t10 = `${titleId}-history-description`;
3151
- let t11;
3152
- if ($[6] !== t10) {
3153
- t11 = /* @__PURE__ */ jsx("span", {
3154
- id: t10,
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,
3155
3261
  className: "first-run-provider-subtitle",
3156
3262
  children: "Use your Chrome profile’s history and sent emails to suggest projects, people, writing preferences, automations and schedules before your first task."
3157
3263
  });
3158
- $[6] = t10;
3159
- $[7] = t11;
3160
- } else t11 = $[7];
3161
- let t12;
3162
- if ($[8] !== t11 || $[9] !== t4 || $[10] !== t5 || $[11] !== t6 || $[12] !== t9) {
3163
- t12 = /* @__PURE__ */ jsxs(Button, {
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, {
3164
3270
  type: "button",
3165
3271
  className: "first-run-provider-choice",
3166
3272
  variant: "surface",
3167
3273
  color: "neutral",
3168
3274
  size: "sm",
3169
- "aria-labelledby": t4,
3170
- "aria-describedby": t5,
3171
- onClick: t6,
3275
+ disabled: waiting,
3276
+ "aria-busy": waiting,
3277
+ "aria-labelledby": t8,
3278
+ "aria-describedby": t9,
3279
+ onClick: setUp,
3172
3280
  children: [
3173
- t7,
3174
- t9,
3175
- t11
3281
+ t10,
3282
+ t13,
3283
+ t15
3176
3284
  ]
3177
3285
  });
3178
- $[8] = t11;
3179
- $[9] = t4;
3180
- $[10] = t5;
3181
- $[11] = t6;
3182
- $[12] = t9;
3183
- $[13] = t12;
3184
- } else t12 = $[13];
3185
- const t13 = `${titleId}-skip-choice`;
3186
- const t14 = `${titleId}-skip-description`;
3187
- let t15;
3188
- if ($[14] !== go || $[15] !== history || $[16] !== skipTo) {
3189
- t15 = () => {
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];
3295
+ const t17 = `${titleId}-skip-choice`;
3296
+ const t18 = `${titleId}-skip-description`;
3297
+ let t19;
3298
+ if ($[25] !== go || $[26] !== history || $[27] !== skipTo) {
3299
+ t19 = () => {
3190
3300
  history.onSkipForNow();
3191
3301
  if (skipTo) go(skipTo);
3192
3302
  };
3193
- $[14] = go;
3194
- $[15] = history;
3195
- $[16] = skipTo;
3196
- $[17] = t15;
3197
- } else t15 = $[17];
3198
- let t16;
3199
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
3200
- t16 = /* @__PURE__ */ jsx("span", {
3303
+ $[25] = go;
3304
+ $[26] = history;
3305
+ $[27] = skipTo;
3306
+ $[28] = t19;
3307
+ } else t19 = $[28];
3308
+ let t20;
3309
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
3310
+ t20 = /* @__PURE__ */ jsx("span", {
3201
3311
  className: "first-run-provider-logo",
3202
3312
  "aria-hidden": "true",
3203
3313
  children: /* @__PURE__ */ jsx(LaptopIcon, {
@@ -3205,24 +3315,24 @@ function HistoryChoiceStep(t0) {
3205
3315
  strokeWidth: 1.5
3206
3316
  })
3207
3317
  });
3208
- $[18] = t16;
3209
- } else t16 = $[18];
3210
- const t17 = `${titleId}-skip-choice`;
3211
- let t18;
3212
- if ($[19] !== t17) {
3213
- t18 = /* @__PURE__ */ jsx("span", {
3214
- id: t17,
3318
+ $[29] = t20;
3319
+ } else t20 = $[29];
3320
+ const t21 = `${titleId}-skip-choice`;
3321
+ let t22;
3322
+ if ($[30] !== t21) {
3323
+ t22 = /* @__PURE__ */ jsx("span", {
3324
+ id: t21,
3215
3325
  className: "first-run-provider-label",
3216
3326
  children: "Skip for now"
3217
3327
  });
3218
- $[19] = t17;
3219
- $[20] = t18;
3220
- } else t18 = $[20];
3221
- const t19 = `${titleId}-skip-description`;
3222
- let t20;
3223
- if ($[21] !== brandName || $[22] !== t19) {
3224
- t20 = /* @__PURE__ */ jsxs("span", {
3225
- id: t19,
3328
+ $[30] = t21;
3329
+ $[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,
3226
3336
  className: "first-run-provider-subtitle",
3227
3337
  children: [
3228
3338
  "Skip browser history for setup. ",
@@ -3230,66 +3340,92 @@ function HistoryChoiceStep(t0) {
3230
3340
  " will still learn what you need as you work."
3231
3341
  ]
3232
3342
  });
3233
- $[21] = brandName;
3234
- $[22] = t19;
3235
- $[23] = t20;
3236
- } else t20 = $[23];
3237
- let t21;
3238
- if ($[24] !== t13 || $[25] !== t14 || $[26] !== t15 || $[27] !== t18 || $[28] !== t20) {
3239
- t21 = /* @__PURE__ */ jsxs(Button, {
3343
+ $[32] = brandName;
3344
+ $[33] = t23;
3345
+ $[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, {
3240
3350
  type: "button",
3241
3351
  className: "first-run-provider-choice",
3242
3352
  variant: "surface",
3243
3353
  color: "neutral",
3244
3354
  size: "sm",
3245
- "aria-labelledby": t13,
3246
- "aria-describedby": t14,
3247
- onClick: t15,
3355
+ disabled: waiting,
3356
+ "aria-labelledby": t17,
3357
+ "aria-describedby": t18,
3358
+ onClick: t19,
3248
3359
  children: [
3249
- t16,
3250
- t18,
3251
- t20
3360
+ t20,
3361
+ t22,
3362
+ t24
3252
3363
  ]
3253
3364
  });
3254
- $[24] = t13;
3255
- $[25] = t14;
3256
- $[26] = t15;
3257
- $[27] = t18;
3258
- $[28] = t20;
3259
- $[29] = t21;
3260
- } else t21 = $[29];
3261
- let t22;
3262
- if ($[30] !== t12 || $[31] !== t21 || $[32] !== t3) {
3263
- t22 = /* @__PURE__ */ jsxs("div", {
3365
+ $[35] = t17;
3366
+ $[36] = t18;
3367
+ $[37] = t19;
3368
+ $[38] = t22;
3369
+ $[39] = t24;
3370
+ $[40] = waiting;
3371
+ $[41] = t25;
3372
+ } else t25 = $[41];
3373
+ let t26;
3374
+ if ($[42] !== t16 || $[43] !== t25 || $[44] !== t7 || $[45] !== waiting) {
3375
+ t26 = /* @__PURE__ */ jsxs("div", {
3264
3376
  className: "first-run-provider-choices",
3265
3377
  role: "group",
3266
- "aria-label": t3,
3267
- children: [t12, t21]
3378
+ "aria-label": t7,
3379
+ "aria-busy": waiting,
3380
+ children: [t16, t25]
3268
3381
  });
3269
- $[30] = t12;
3270
- $[31] = t21;
3271
- $[32] = t3;
3272
- $[33] = t22;
3273
- } else t22 = $[33];
3274
- let t23;
3275
- if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
3276
- t23 = /* @__PURE__ */ jsx(Back, {});
3277
- $[34] = t23;
3278
- } else t23 = $[34];
3279
- let t24;
3280
- if ($[35] !== t1 || $[36] !== t2 || $[37] !== t22) {
3281
- t24 = /* @__PURE__ */ jsx(Step, {
3282
- title: t1,
3283
- lead: t2,
3284
- body: t22,
3285
- actions: t23
3286
- });
3287
- $[35] = t1;
3288
- $[36] = t2;
3289
- $[37] = t22;
3290
- $[38] = t24;
3291
- } else t24 = $[38];
3292
- return t24;
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", {
3391
+ role: "alert",
3392
+ className: "chatgpt-sign-in__error",
3393
+ children: "Setting up from history didn’t finish. Try again."
3394
+ }) : 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;
3402
+ $[50] = t27;
3403
+ $[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
3420
+ });
3421
+ $[54] = t28;
3422
+ $[55] = t29;
3423
+ $[56] = t30;
3424
+ $[57] = t5;
3425
+ $[58] = t6;
3426
+ $[59] = t31;
3427
+ } else t31 = $[59];
3428
+ return t31;
3293
3429
  }
3294
3430
  /**
3295
3431
  * A drawing of Chrome's toolbar and Extensions menu that says where to click.
@@ -3624,7 +3760,7 @@ function FirstRunSetup(t0) {
3624
3760
  const titleId = React.useId();
3625
3761
  let t4;
3626
3762
  if ($[21] !== titleId) {
3627
- t4 = { mutationKey: ["first-run-schedule", titleId] };
3763
+ t4 = { mutationKey: ["first-run", titleId] };
3628
3764
  $[21] = titleId;
3629
3765
  $[22] = t4;
3630
3766
  } else t4 = $[22];
@@ -3994,4 +4130,4 @@ function _temp(item) {
3994
4130
  return item.schedule;
3995
4131
  }
3996
4132
  //#endregion
3997
- export { FirstRunSetup };
4133
+ export { FirstRunSetup, firstRunHistoryChoices, firstRunSteps };