@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
|
-
*
|
|
33
|
-
*
|
|
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
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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) =>
|
|
76
|
-
/**
|
|
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(
|
|
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.
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
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
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
$[8] =
|
|
593
|
-
|
|
594
|
-
|
|
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
|
|
604
|
-
let
|
|
605
|
-
if ($[
|
|
606
|
-
|
|
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
|
-
|
|
611
|
-
$[
|
|
612
|
-
$[
|
|
625
|
+
t4 = [];
|
|
626
|
+
$[9] = t3;
|
|
627
|
+
$[10] = t4;
|
|
613
628
|
} else {
|
|
614
|
-
|
|
615
|
-
|
|
629
|
+
t3 = $[9];
|
|
630
|
+
t4 = $[10];
|
|
616
631
|
}
|
|
617
|
-
React.useEffect(
|
|
618
|
-
let
|
|
619
|
-
if ($[
|
|
620
|
-
|
|
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 (
|
|
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
|
-
$[
|
|
635
|
-
$[
|
|
636
|
-
$[
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
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:
|
|
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
|
-
$[
|
|
651
|
-
$[
|
|
652
|
-
$[
|
|
653
|
-
$[
|
|
654
|
-
} else
|
|
655
|
-
const chooseKind =
|
|
656
|
-
let
|
|
657
|
-
if ($[
|
|
658
|
-
|
|
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
|
-
$[
|
|
664
|
-
} else
|
|
665
|
-
const fail =
|
|
666
|
-
let
|
|
667
|
-
if ($[
|
|
668
|
-
|
|
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 (
|
|
685
|
-
const failure_0 =
|
|
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({
|
|
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
|
-
$[
|
|
704
|
-
$[
|
|
705
|
-
$[
|
|
706
|
-
$[
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
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 (
|
|
726
|
-
const failure_1 =
|
|
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
|
-
$[
|
|
735
|
-
$[
|
|
736
|
-
$[
|
|
737
|
-
$[
|
|
738
|
-
} else
|
|
739
|
-
const connect =
|
|
740
|
-
let
|
|
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
|
-
|
|
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
|
-
$[
|
|
752
|
-
} else
|
|
753
|
-
let
|
|
754
|
-
if ($[
|
|
755
|
-
|
|
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
|
-
$[
|
|
760
|
-
} else
|
|
761
|
-
let
|
|
762
|
-
if ($[
|
|
763
|
-
|
|
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: [
|
|
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: [
|
|
794
|
+
children: [t11, t12]
|
|
773
795
|
})]
|
|
774
796
|
});
|
|
775
|
-
$[
|
|
776
|
-
$[
|
|
777
|
-
$[
|
|
778
|
-
} else
|
|
779
|
-
let
|
|
780
|
-
if ($[
|
|
781
|
-
|
|
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
|
-
$[
|
|
793
|
-
$[
|
|
794
|
-
} else
|
|
795
|
-
let
|
|
796
|
-
if ($[
|
|
797
|
-
|
|
798
|
-
$[
|
|
799
|
-
$[
|
|
800
|
-
} else
|
|
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]
|
|
803
|
-
t18 =
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
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: [
|
|
843
|
+
children: [t16, /* @__PURE__ */ jsx(Input, {
|
|
818
844
|
name: "endpoint",
|
|
819
845
|
value: value.endpoint,
|
|
820
846
|
disabled: busy,
|
|
821
|
-
placeholder:
|
|
822
|
-
onChange:
|
|
847
|
+
placeholder: t17,
|
|
848
|
+
onChange: t18
|
|
823
849
|
})]
|
|
824
850
|
});
|
|
825
851
|
$[43] = busy;
|
|
826
|
-
$[44] =
|
|
827
|
-
$[45] =
|
|
852
|
+
$[44] = t17;
|
|
853
|
+
$[45] = t18;
|
|
828
854
|
$[46] = value.endpoint;
|
|
829
|
-
$[47] =
|
|
830
|
-
} else
|
|
831
|
-
let
|
|
832
|
-
if ($[48] !== busy || $[49] !== findModels || $[50] !== models || $[51] !== update || $[52] !== value
|
|
833
|
-
|
|
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({
|
|
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: (
|
|
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
|
|
879
|
-
$[53] =
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
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
|
-
$[
|
|
890
|
-
$[
|
|
891
|
-
} else
|
|
892
|
-
let
|
|
893
|
-
if ($[
|
|
894
|
-
|
|
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
|
-
$[
|
|
900
|
-
$[
|
|
901
|
-
} else
|
|
902
|
-
let
|
|
903
|
-
if ($[
|
|
904
|
-
|
|
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
|
-
|
|
907
|
-
|
|
954
|
+
t19,
|
|
955
|
+
t20,
|
|
908
956
|
t21,
|
|
909
|
-
t22
|
|
910
|
-
t23,
|
|
911
|
-
t24
|
|
957
|
+
t22
|
|
912
958
|
] });
|
|
913
|
-
$[
|
|
914
|
-
$[
|
|
915
|
-
$[
|
|
916
|
-
$[
|
|
917
|
-
$[
|
|
918
|
-
$[
|
|
919
|
-
$[
|
|
920
|
-
$[
|
|
921
|
-
} else
|
|
922
|
-
const
|
|
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 ($[
|
|
925
|
-
t27 =
|
|
926
|
-
$[
|
|
927
|
-
$[
|
|
928
|
-
} else t27 = $[
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
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
|
-
$[
|
|
944
|
-
$[
|
|
945
|
-
$[
|
|
946
|
-
$[
|
|
947
|
-
$[
|
|
948
|
-
} else
|
|
949
|
-
let
|
|
950
|
-
if ($[
|
|
951
|
-
|
|
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:
|
|
955
|
-
actions:
|
|
1000
|
+
body: t23,
|
|
1001
|
+
actions: t28
|
|
956
1002
|
});
|
|
957
|
-
$[
|
|
958
|
-
$[
|
|
959
|
-
$[
|
|
960
|
-
} else
|
|
961
|
-
return
|
|
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 = [
|
|
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(
|
|
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] =
|
|
2634
|
-
$[3] =
|
|
2635
|
-
|
|
2684
|
+
$[2] = onUse;
|
|
2685
|
+
$[3] = status;
|
|
2686
|
+
$[4] = t2;
|
|
2687
|
+
} else t2 = $[4];
|
|
2636
2688
|
let t3;
|
|
2637
|
-
if ($[
|
|
2689
|
+
if ($[5] !== modelConnection) {
|
|
2638
2690
|
t3 = /* @__PURE__ */ jsx(OtherProviderChoice, { connection: modelConnection });
|
|
2639
|
-
$[
|
|
2640
|
-
$[
|
|
2641
|
-
} else t3 = $[
|
|
2691
|
+
$[5] = modelConnection;
|
|
2692
|
+
$[6] = t3;
|
|
2693
|
+
} else t3 = $[6];
|
|
2642
2694
|
let t4;
|
|
2643
|
-
if ($[
|
|
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
|
-
$[
|
|
2649
|
-
$[
|
|
2650
|
-
$[
|
|
2651
|
-
} else t4 = $[
|
|
2700
|
+
$[7] = t2;
|
|
2701
|
+
$[8] = t3;
|
|
2702
|
+
$[9] = t4;
|
|
2703
|
+
} else t4 = $[9];
|
|
2652
2704
|
let t5;
|
|
2653
|
-
if ($[
|
|
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
|
-
$[
|
|
2660
|
-
$[
|
|
2661
|
-
} else t5 = $[
|
|
2711
|
+
$[10] = status;
|
|
2712
|
+
$[11] = t5;
|
|
2713
|
+
} else t5 = $[11];
|
|
2662
2714
|
let t6;
|
|
2663
|
-
if ($[
|
|
2715
|
+
if ($[12] !== t4 || $[13] !== t5) {
|
|
2664
2716
|
t6 = /* @__PURE__ */ jsxs(Fragment, { children: [t4, t5] });
|
|
2665
|
-
$[
|
|
2666
|
-
$[
|
|
2667
|
-
$[
|
|
2668
|
-
} else t6 = $[
|
|
2717
|
+
$[12] = t4;
|
|
2718
|
+
$[13] = t5;
|
|
2719
|
+
$[14] = t6;
|
|
2720
|
+
} else t6 = $[14];
|
|
2669
2721
|
let t7;
|
|
2670
|
-
if ($[
|
|
2722
|
+
if ($[15] !== done || $[16] !== modelConnection.connected) {
|
|
2671
2723
|
t7 = done || modelConnection.connected ? /* @__PURE__ */ jsx(Next, {}) : null;
|
|
2672
|
-
$[
|
|
2673
|
-
$[
|
|
2674
|
-
$[
|
|
2675
|
-
} else t7 = $[
|
|
2724
|
+
$[15] = done;
|
|
2725
|
+
$[16] = modelConnection.connected;
|
|
2726
|
+
$[17] = t7;
|
|
2727
|
+
} else t7 = $[17];
|
|
2676
2728
|
let t8;
|
|
2677
|
-
if ($[
|
|
2729
|
+
if ($[18] !== t7) {
|
|
2678
2730
|
t8 = /* @__PURE__ */ jsx(Actions, { children: t7 });
|
|
2679
|
-
$[
|
|
2680
|
-
$[
|
|
2681
|
-
} else t8 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
2693
|
-
$[
|
|
2694
|
-
$[
|
|
2695
|
-
$[
|
|
2696
|
-
$[
|
|
2697
|
-
} else t10 = $[
|
|
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(
|
|
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
|
-
|
|
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] =
|
|
2720
|
-
|
|
2772
|
+
$[3] = onUse;
|
|
2773
|
+
$[4] = t4;
|
|
2774
|
+
} else t4 = $[4];
|
|
2721
2775
|
let t5;
|
|
2722
|
-
if ($[
|
|
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
|
-
$[
|
|
2737
|
-
$[
|
|
2738
|
-
} else t5 = $[
|
|
2790
|
+
$[5] = status;
|
|
2791
|
+
$[6] = t5;
|
|
2792
|
+
} else t5 = $[6];
|
|
2739
2793
|
let t6;
|
|
2740
|
-
if ($[
|
|
2794
|
+
if ($[7] !== done || $[8] !== status) {
|
|
2741
2795
|
t6 = !done && status !== "waiting" ? /* @__PURE__ */ jsx(ArrowUpRightIcon, { "aria-hidden": "true" }) : null;
|
|
2742
|
-
$[
|
|
2743
|
-
$[
|
|
2744
|
-
$[
|
|
2745
|
-
} else t6 = $[
|
|
2796
|
+
$[7] = done;
|
|
2797
|
+
$[8] = status;
|
|
2798
|
+
$[9] = t6;
|
|
2799
|
+
} else t6 = $[9];
|
|
2746
2800
|
let t7;
|
|
2747
|
-
if ($[
|
|
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
|
-
$[
|
|
2753
|
-
$[
|
|
2754
|
-
$[
|
|
2755
|
-
} else t7 = $[
|
|
2806
|
+
$[10] = label;
|
|
2807
|
+
$[11] = t6;
|
|
2808
|
+
$[12] = t7;
|
|
2809
|
+
} else t7 = $[12];
|
|
2756
2810
|
let t8;
|
|
2757
|
-
if ($[
|
|
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
|
-
$[
|
|
2770
|
-
$[
|
|
2771
|
-
$[
|
|
2772
|
-
$[
|
|
2773
|
-
$[
|
|
2774
|
-
$[
|
|
2775
|
-
$[
|
|
2776
|
-
$[
|
|
2777
|
-
} else t8 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
2787
|
-
} else t9 = $[
|
|
2840
|
+
$[21] = t9;
|
|
2841
|
+
} else t9 = $[21];
|
|
2788
2842
|
let t10;
|
|
2789
|
-
if ($[
|
|
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
|
-
$[
|
|
2802
|
-
$[
|
|
2803
|
-
$[
|
|
2804
|
-
} else t10 = $[
|
|
2855
|
+
$[22] = brandName;
|
|
2856
|
+
$[23] = descriptionId;
|
|
2857
|
+
$[24] = t10;
|
|
2858
|
+
} else t10 = $[24];
|
|
2805
2859
|
let t11;
|
|
2806
|
-
if ($[
|
|
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
|
-
$[
|
|
2812
|
-
$[
|
|
2813
|
-
$[
|
|
2814
|
-
} else t11 = $[
|
|
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(
|
|
3161
|
+
const $ = c(60);
|
|
3108
3162
|
const { history, skipTo } = t0;
|
|
3109
3163
|
const { brandName, go, titleId } = useFirstRun();
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
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
|
-
$[
|
|
3122
|
-
$[
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
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(
|
|
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
|
-
$[
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
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:
|
|
3250
|
+
children: t12
|
|
3146
3251
|
});
|
|
3147
|
-
$[
|
|
3148
|
-
$[
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
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
|
-
$[
|
|
3159
|
-
$[
|
|
3160
|
-
} else
|
|
3161
|
-
let
|
|
3162
|
-
if ($[
|
|
3163
|
-
|
|
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
|
-
|
|
3170
|
-
"aria-
|
|
3171
|
-
|
|
3275
|
+
disabled: waiting,
|
|
3276
|
+
"aria-busy": waiting,
|
|
3277
|
+
"aria-labelledby": t8,
|
|
3278
|
+
"aria-describedby": t9,
|
|
3279
|
+
onClick: setUp,
|
|
3172
3280
|
children: [
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3281
|
+
t10,
|
|
3282
|
+
t13,
|
|
3283
|
+
t15
|
|
3176
3284
|
]
|
|
3177
3285
|
});
|
|
3178
|
-
$[
|
|
3179
|
-
$[
|
|
3180
|
-
$[
|
|
3181
|
-
$[
|
|
3182
|
-
$[
|
|
3183
|
-
$[
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
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
|
-
$[
|
|
3194
|
-
$[
|
|
3195
|
-
$[
|
|
3196
|
-
$[
|
|
3197
|
-
} else
|
|
3198
|
-
let
|
|
3199
|
-
if ($[
|
|
3200
|
-
|
|
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
|
-
$[
|
|
3209
|
-
} else
|
|
3210
|
-
const
|
|
3211
|
-
let
|
|
3212
|
-
if ($[
|
|
3213
|
-
|
|
3214
|
-
id:
|
|
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
|
-
$[
|
|
3219
|
-
$[
|
|
3220
|
-
} else
|
|
3221
|
-
const
|
|
3222
|
-
let
|
|
3223
|
-
if ($[
|
|
3224
|
-
|
|
3225
|
-
id:
|
|
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
|
-
$[
|
|
3234
|
-
$[
|
|
3235
|
-
$[
|
|
3236
|
-
} else
|
|
3237
|
-
let
|
|
3238
|
-
if ($[
|
|
3239
|
-
|
|
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
|
-
|
|
3246
|
-
"aria-
|
|
3247
|
-
|
|
3355
|
+
disabled: waiting,
|
|
3356
|
+
"aria-labelledby": t17,
|
|
3357
|
+
"aria-describedby": t18,
|
|
3358
|
+
onClick: t19,
|
|
3248
3359
|
children: [
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3360
|
+
t20,
|
|
3361
|
+
t22,
|
|
3362
|
+
t24
|
|
3252
3363
|
]
|
|
3253
3364
|
});
|
|
3254
|
-
$[
|
|
3255
|
-
$[
|
|
3256
|
-
$[
|
|
3257
|
-
$[
|
|
3258
|
-
$[
|
|
3259
|
-
$[
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
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":
|
|
3267
|
-
|
|
3378
|
+
"aria-label": t7,
|
|
3379
|
+
"aria-busy": waiting,
|
|
3380
|
+
children: [t16, t25]
|
|
3268
3381
|
});
|
|
3269
|
-
$[
|
|
3270
|
-
$[
|
|
3271
|
-
$[
|
|
3272
|
-
$[
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
$[
|
|
3289
|
-
$[
|
|
3290
|
-
$[
|
|
3291
|
-
} else
|
|
3292
|
-
|
|
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
|
|
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 };
|