@burdenoff/microfe-timecampus 2026.1107.1 → 2026.1107.3
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.
- package/dist/generated/wspace-operations.d.ts +75 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +1353 -1306
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +18 -2
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +15 -11
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/channels/ChannelsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/channels/ChannelsPage.js +124 -117
- package/dist/timecampus/pages/channels/ChannelsPage.js.map +1 -1
- package/dist/timecampus/pages/channels/channelCatalog.d.ts +20 -1
- package/dist/timecampus/pages/channels/channelCatalog.d.ts.map +1 -1
- package/dist/timecampus/pages/channels/channelCatalog.js +51 -21
- package/dist/timecampus/pages/channels/channelCatalog.js.map +1 -1
- package/dist/timecampus/pages/settings/IdleDetectionCard.d.ts +12 -0
- package/dist/timecampus/pages/settings/IdleDetectionCard.d.ts.map +1 -0
- package/dist/timecampus/pages/settings/IdleDetectionCard.js +127 -0
- package/dist/timecampus/pages/settings/IdleDetectionCard.js.map +1 -0
- package/dist/timecampus/pages/settings/PrivacySettingsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js +101 -88
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js.map +1 -1
- package/dist/timecampus/pages/settings/idleDetection.d.ts +38 -0
- package/dist/timecampus/pages/settings/idleDetection.d.ts.map +1 -0
- package/dist/timecampus/pages/settings/idleDetection.js +45 -0
- package/dist/timecampus/pages/settings/idleDetection.js.map +1 -0
- package/dist/timecampus/pages/timeline/timelineProvenance.d.ts +1 -1
- package/dist/timecampus/pages/timeline/timelineProvenance.d.ts.map +1 -1
- package/dist/timecampus/pages/timeline/timelineProvenance.js +4 -0
- package/dist/timecampus/pages/timeline/timelineProvenance.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/helpers.js";
|
|
2
|
+
import { LoadingSkeleton as t } from "../../components/LoadingSkeleton.js";
|
|
3
|
+
import { MyTimeCampusIdleDetectionSettingsDocument as n, useMyTimeCampusIdleDetectionSettingsQuery as r, useUpdateMyTimeCampusIdleDetectionSettingsMutation as i } from "../../../generated/wspace-operations.js";
|
|
4
|
+
import { ToggleSwitch as a } from "../../components/ToggleSwitch.js";
|
|
5
|
+
import "../../components/index.js";
|
|
6
|
+
import { TimeCampusIdleAction as o } from "../../../generated/wspace-types.js";
|
|
7
|
+
import { IDLE_ACTION_OPTIONS as s, idleSummary as c, isIdleAction as l, parseThresholdValue as u, thresholdOptions as d } from "./idleDetection.js";
|
|
8
|
+
import { useState as f } from "react";
|
|
9
|
+
import { Coffee as p } from "lucide-react";
|
|
10
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
import { GlassCard as g } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
//#region src/timecampus/pages/settings/IdleDetectionCard.tsx
|
|
13
|
+
function _(e) {
|
|
14
|
+
return e === "MARK_AWAY" ? o.MarkAway : o.Discard;
|
|
15
|
+
}
|
|
16
|
+
function v({ skip: o, onSaved: v, onError: y }) {
|
|
17
|
+
let { data: b, loading: x, error: S } = r({ skip: o }), [C] = i({ update(e, { data: t }) {
|
|
18
|
+
let r = t?.updateMyTimeCampusIdleDetectionSettings;
|
|
19
|
+
r && e.writeQuery({
|
|
20
|
+
query: n,
|
|
21
|
+
data: { myTimeCampusIdleDetectionSettings: r }
|
|
22
|
+
});
|
|
23
|
+
} }), [w, T] = f(!1), E = b?.myTimeCampusIdleDetectionSettings, D = E ? {
|
|
24
|
+
enabled: E.enabled,
|
|
25
|
+
thresholdMinutes: E.thresholdMinutes,
|
|
26
|
+
idleAction: l(E.idleAction) ? E.idleAction : "MARK_AWAY"
|
|
27
|
+
} : null, O = async (e, t) => {
|
|
28
|
+
T(!0);
|
|
29
|
+
try {
|
|
30
|
+
let n = await C({
|
|
31
|
+
variables: { input: e },
|
|
32
|
+
refetchQueries: ["MyTimeCampusIdleDetectionSettings"]
|
|
33
|
+
});
|
|
34
|
+
if (n.error) throw Error(n.error.message);
|
|
35
|
+
v(t);
|
|
36
|
+
} catch {
|
|
37
|
+
y();
|
|
38
|
+
}
|
|
39
|
+
T(!1);
|
|
40
|
+
}, k = w || !D, A = k || !D?.enabled;
|
|
41
|
+
return /* @__PURE__ */ h(g, {
|
|
42
|
+
treatment: "glass",
|
|
43
|
+
className: "mt-6 p-4 sm:p-6",
|
|
44
|
+
"data-testid": "privacy-idle-detection",
|
|
45
|
+
children: [/* @__PURE__ */ h("div", {
|
|
46
|
+
className: "mb-4 flex items-start gap-3",
|
|
47
|
+
children: [/* @__PURE__ */ m("div", {
|
|
48
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
49
|
+
children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
|
|
50
|
+
}), /* @__PURE__ */ h("div", {
|
|
51
|
+
className: "min-w-0",
|
|
52
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
53
|
+
className: "text-sm font-semibold text-text-primary",
|
|
54
|
+
children: "Idle detection"
|
|
55
|
+
}), /* @__PURE__ */ m("p", {
|
|
56
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
57
|
+
children: "The desktop app notices when you stop using the keyboard and mouse, so time you were away is not recorded as work. It only counts the seconds since your last input, never what you typed. Away blocks follow the same privacy rules as the rest of your captured activity."
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
}), S && !D ? /* @__PURE__ */ m("div", {
|
|
61
|
+
className: "rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-3 text-xs text-status-error-text",
|
|
62
|
+
children: "Couldn't load your idle detection settings right now."
|
|
63
|
+
}) : x || !D ? /* @__PURE__ */ m(t, {
|
|
64
|
+
variant: "list",
|
|
65
|
+
count: 1
|
|
66
|
+
}) : /* @__PURE__ */ h("div", {
|
|
67
|
+
className: "flex flex-col gap-4",
|
|
68
|
+
children: [/* @__PURE__ */ m("p", {
|
|
69
|
+
className: "text-xs text-text-secondary",
|
|
70
|
+
"data-testid": "privacy-idle-summary",
|
|
71
|
+
children: c(D)
|
|
72
|
+
}), /* @__PURE__ */ h("div", {
|
|
73
|
+
className: "flex flex-wrap items-center gap-4",
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ h("label", {
|
|
76
|
+
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
77
|
+
children: ["Detect idle time", /* @__PURE__ */ m(a, {
|
|
78
|
+
checked: D.enabled,
|
|
79
|
+
disabled: k,
|
|
80
|
+
ariaLabel: "Detect idle time",
|
|
81
|
+
onChange: (e) => void O({ enabled: e }, e ? "Idle detection turned on" : "Idle detection turned off")
|
|
82
|
+
})]
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ h("label", {
|
|
85
|
+
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
86
|
+
children: ["Away after", /* @__PURE__ */ m("select", {
|
|
87
|
+
value: String(D.thresholdMinutes ?? 5),
|
|
88
|
+
disabled: A,
|
|
89
|
+
"aria-label": "Idle threshold",
|
|
90
|
+
onChange: (e) => {
|
|
91
|
+
let t = u(e.target.value);
|
|
92
|
+
t != null && O({ thresholdMinutes: t }, `You count as away after ${e.target.selectedOptions[0]?.text ?? `${t} minutes`}`);
|
|
93
|
+
},
|
|
94
|
+
className: e("rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary", A && "cursor-not-allowed opacity-50"),
|
|
95
|
+
children: d(D.thresholdMinutes).map((e) => /* @__PURE__ */ m("option", {
|
|
96
|
+
value: e.value,
|
|
97
|
+
children: e.label
|
|
98
|
+
}, e.value))
|
|
99
|
+
})]
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ h("label", {
|
|
102
|
+
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
103
|
+
children: ["Away time", /* @__PURE__ */ m("select", {
|
|
104
|
+
value: D.idleAction,
|
|
105
|
+
disabled: A,
|
|
106
|
+
"aria-label": "What happens to away time",
|
|
107
|
+
onChange: (e) => {
|
|
108
|
+
let t = e.target.value;
|
|
109
|
+
l(t) && O({ idleAction: _(t) }, t === "MARK_AWAY" ? "Away time now shows on your timeline" : "Away time is now left out");
|
|
110
|
+
},
|
|
111
|
+
className: e("rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary", A && "cursor-not-allowed opacity-50"),
|
|
112
|
+
children: s.map((e) => /* @__PURE__ */ m("option", {
|
|
113
|
+
value: e.value,
|
|
114
|
+
title: e.detail,
|
|
115
|
+
children: e.label
|
|
116
|
+
}, e.value))
|
|
117
|
+
})]
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
})]
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { v as IdleDetectionCard };
|
|
126
|
+
|
|
127
|
+
//# sourceMappingURL=IdleDetectionCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdleDetectionCard.js","names":[],"sources":["../../../../src/timecampus/pages/settings/IdleDetectionCard.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { Coffee } from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { LoadingSkeleton, ToggleSwitch } from \"../../components\";\nimport { cn } from \"../../utils/helpers\";\nimport {\n MyTimeCampusIdleDetectionSettingsDocument,\n useMyTimeCampusIdleDetectionSettingsQuery,\n useUpdateMyTimeCampusIdleDetectionSettingsMutation,\n type UpdateMyTimeCampusIdleDetectionSettingsMutationVariables,\n} from \"@/generated/wspace-operations\";\nimport { TimeCampusIdleAction } from \"@/generated/wspace-types\";\nimport {\n DEFAULT_THRESHOLD_MINUTES,\n IDLE_ACTION_OPTIONS,\n type IdleAction,\n idleSummary,\n isIdleAction,\n parseThresholdValue,\n thresholdOptions,\n} from \"./idleDetection\";\n\ntype IdleSettingsInput =\n UpdateMyTimeCampusIdleDetectionSettingsMutationVariables[\"input\"];\n\nfunction toIdleActionInput(action: IdleAction): TimeCampusIdleAction {\n return action === \"MARK_AWAY\"\n ? TimeCampusIdleAction.MarkAway\n : TimeCampusIdleAction.Discard;\n}\n\ninterface IdleDetectionCardProps {\n skip: boolean;\n onSaved(message: string): void;\n onError(): void;\n}\n\n/**\n * Idle detection for the desktop app's automatic capture (BOFF-4210): on or\n * off, how long without input counts as away, and what happens to away time.\n */\nexport function IdleDetectionCard({\n skip,\n onSaved,\n onError,\n}: IdleDetectionCardProps) {\n const { data, loading, error } = useMyTimeCampusIdleDetectionSettingsQuery({\n skip,\n });\n const [update] = useUpdateMyTimeCampusIdleDetectionSettingsMutation({\n // The settings object has no id, so cache normalisation cannot link the\n // mutation result to the settings query. Write the saved settings straight\n // into the query cache so the card shows what the server stored even if\n // the confirming refetch fails.\n update(cache, { data: result }) {\n const saved = result?.updateMyTimeCampusIdleDetectionSettings;\n if (!saved) return;\n cache.writeQuery({\n query: MyTimeCampusIdleDetectionSettingsDocument,\n data: { myTimeCampusIdleDetectionSettings: saved },\n });\n },\n });\n const [saving, setSaving] = useState(false);\n\n const stored = data?.myTimeCampusIdleDetectionSettings;\n const settings = stored\n ? {\n enabled: stored.enabled,\n thresholdMinutes: stored.thresholdMinutes,\n idleAction: (isIdleAction(stored.idleAction)\n ? stored.idleAction\n : \"MARK_AWAY\") as IdleAction,\n }\n : null;\n\n const save = async (input: IdleSettingsInput, message: string) => {\n setSaving(true);\n try {\n const res = await update({\n variables: { input },\n // Best-effort confirmation only; the cache write in the mutation's\n // update callback is what the card renders from.\n refetchQueries: [\"MyTimeCampusIdleDetectionSettings\"],\n });\n if (res.error) throw new Error(res.error.message);\n onSaved(message);\n } catch {\n onError();\n }\n setSaving(false);\n };\n\n const disabled = saving || !settings;\n const controlsDisabled = disabled || !settings?.enabled;\n\n return (\n <GlassCard\n treatment=\"glass\"\n className=\"mt-6 p-4 sm:p-6\"\n data-testid=\"privacy-idle-detection\"\n >\n <div className=\"mb-4 flex items-start gap-3\">\n <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <Coffee className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n Idle detection\n </h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n The desktop app notices when you stop using the keyboard and mouse,\n so time you were away is not recorded as work. It only counts the\n seconds since your last input, never what you typed. Away blocks\n follow the same privacy rules as the rest of your captured activity.\n </p>\n </div>\n </div>\n\n {error && !settings ? (\n <div className=\"rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-3 text-xs text-status-error-text\">\n Couldn't load your idle detection settings right now.\n </div>\n ) : loading || !settings ? (\n <LoadingSkeleton variant=\"list\" count={1} />\n ) : (\n <div className=\"flex flex-col gap-4\">\n <p\n className=\"text-xs text-text-secondary\"\n data-testid=\"privacy-idle-summary\"\n >\n {idleSummary(settings)}\n </p>\n <div className=\"flex flex-wrap items-center gap-4\">\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n Detect idle time\n <ToggleSwitch\n checked={settings.enabled}\n disabled={disabled}\n ariaLabel=\"Detect idle time\"\n onChange={(next) =>\n void save(\n { enabled: next },\n next\n ? \"Idle detection turned on\"\n : \"Idle detection turned off\",\n )\n }\n />\n </label>\n\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n Away after\n <select\n value={String(\n settings.thresholdMinutes ?? DEFAULT_THRESHOLD_MINUTES,\n )}\n disabled={controlsDisabled}\n aria-label=\"Idle threshold\"\n onChange={(e) => {\n const minutes = parseThresholdValue(e.target.value);\n if (minutes == null) return;\n void save(\n { thresholdMinutes: minutes },\n `You count as away after ${e.target.selectedOptions[0]?.text ?? `${minutes} minutes`}`,\n );\n }}\n className={cn(\n \"rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary\",\n controlsDisabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {thresholdOptions(settings.thresholdMinutes).map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n </label>\n\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n Away time\n <select\n value={settings.idleAction}\n disabled={controlsDisabled}\n aria-label=\"What happens to away time\"\n onChange={(e) => {\n const value = e.target.value;\n if (!isIdleAction(value)) return;\n void save(\n { idleAction: toIdleActionInput(value) },\n value === \"MARK_AWAY\"\n ? \"Away time now shows on your timeline\"\n : \"Away time is now left out\",\n );\n }}\n className={cn(\n \"rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary\",\n controlsDisabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {IDLE_ACTION_OPTIONS.map((option) => (\n <option\n key={option.value}\n value={option.value}\n title={option.detail}\n >\n {option.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n </div>\n )}\n </GlassCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyBA,SAAS,EAAkB,GAA0C;CACnE,OAAO,MAAW,cACd,EAAqB,WACrB,EAAqB;AAC3B;AAYA,SAAgB,EAAkB,EAChC,SACA,YACA,cACyB;CACzB,IAAM,EAAE,SAAM,YAAS,aAAU,EAA0C,EACzE,QACF,CAAC,GACK,CAAC,KAAU,EAAmD,EAKlE,OAAO,GAAO,EAAE,MAAM,KAAU;EAC9B,IAAM,IAAQ,GAAQ;EACjB,KACL,EAAM,WAAW;GACf,OAAO;GACP,MAAM,EAAE,mCAAmC,EAAM;EACnD,CAAC;CACH,EACF,CAAC,GACK,CAAC,GAAQ,KAAa,EAAS,EAAK,GAEpC,IAAS,GAA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,SAAS,EAAS;OACR;OACV,WAAU;OACV,WAAW,MACT,KAAK,EACH,EAAE,SAAS,EAAK,GAChB,IACI,6BACA,2BACN;MAEH,CAAA,CACI;;KAEP,kBAAC,SAAD;MAAO,WAAU;MAAjB,UAAA,CAAuE,cAErE,kBAAC,UAAD;OACE,OAAO,OACL,EAAS,oBAAA,CACX;OACA,UAAU;OACV,cAAW;OACX,WAAW,MAAM;QACf,IAAM,IAAU,EAAoB,EAAE,OAAO,KAAK;QAC9C,KAAW,QACf,EACE,EAAE,kBAAkB,EAAQ,GAC5B,2BAA2B,EAAE,OAAO,gBAAgB,EAAE,EAAE,QAAQ,GAAG,EAAQ,WAC7E;OACF;OACA,WAAW,EACT,8FACA,KAAoB,+BACtB;OAEC,UAAA,EAAiB,EAAS,gBAAgB,CAAC,CAAC,KAAK,MAChD,kBAAC,UAAD;QAA2B,OAAO,EAAO;QACtC,UAAA,EAAO;OACF,GAFK,EAAO,KAEZ,CACT;MACK,CAAA,CACH;;KAEP,kBAAC,SAAD;MAAO,WAAU;MAAjB,UAAA,CAAuE,aAErE,kBAAC,UAAD;OACE,OAAO,EAAS;OAChB,UAAU;OACV,cAAW;OACX,WAAW,MAAM;QACf,IAAM,IAAQ,EAAE,OAAO;QAClB,EAAa,CAAK,KACvB,EACE,EAAE,YAAY,EAAkB,CAAK,EAAE,GACvC,MAAU,cACN,yCACA,2BACN;OACF;OACA,WAAW,EACT,8FACA,KAAoB,+BACtB;OAEC,UAAA,EAAoB,KAAK,MACxB,kBAAC,UAAD;QAEE,OAAO,EAAO;QACd,OAAO,EAAO;QAEb,UAAA,EAAO;OACF,GALD,EAAO,KAKN,CACT;MACK,CAAA,CACH;;IACJ;GACF,CAAA,CAAA;EAEE,CAAA,CAAA;;AAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivacySettingsPage.d.ts","sourceRoot":"","sources":["../../../../src/timecampus/pages/settings/PrivacySettingsPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrivacySettingsPage.d.ts","sourceRoot":"","sources":["../../../../src/timecampus/pages/settings/PrivacySettingsPage.tsx"],"names":[],"mappings":"AAgEA,wBAAgB,mBAAmB,gCAwUlC"}
|
|
@@ -9,112 +9,113 @@ import { ToastContainer as f, useToast as p } from "../../components/Toast.js";
|
|
|
9
9
|
import { ToggleSwitch as m } from "../../components/ToggleSwitch.js";
|
|
10
10
|
import "../../components/index.js";
|
|
11
11
|
import { parseRetentionValue as h, retentionLabel as g, retentionOptions as _, retentionValue as v } from "./retention.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { IdleDetectionCard as y } from "./IdleDetectionCard.js";
|
|
13
|
+
import { useState as b } from "react";
|
|
14
|
+
import { ArrowUpRight as x, CameraOff as S, Cpu as C, KeyRound as w, Plug as T, Scale as E, ShieldCheck as D } from "lucide-react";
|
|
15
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
16
|
+
import { GlassCard as A } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/timecampus/pages/settings/PrivacySettingsPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var j = [{
|
|
18
19
|
label: "Screenshots",
|
|
19
20
|
detail: "TimeCampus has no screenshot capture, so there is nothing to switch on.",
|
|
20
|
-
icon: /* @__PURE__ */
|
|
21
|
+
icon: /* @__PURE__ */ O(S, { className: "h-5 w-5" })
|
|
21
22
|
}, {
|
|
22
23
|
label: "Keystrokes",
|
|
23
24
|
detail: "No keystroke logging, and no reading of what you type in other apps.",
|
|
24
|
-
icon: /* @__PURE__ */
|
|
25
|
-
}],
|
|
25
|
+
icon: /* @__PURE__ */ O(w, { className: "h-5 w-5" })
|
|
26
|
+
}], M = [
|
|
26
27
|
"sustainableHours",
|
|
27
28
|
"recoveryBand",
|
|
28
29
|
"workLifeBoundary"
|
|
29
30
|
];
|
|
30
|
-
function
|
|
31
|
-
let { workspaceId:
|
|
32
|
-
|
|
31
|
+
function N() {
|
|
32
|
+
let { workspaceId: S = "" } = e(), w = t(), { toasts: N, addToast: P, dismissToast: F } = p(), { data: I, loading: L, error: R, refetch: z } = c({ skip: !S }), { data: B, error: V } = s({ skip: !S }), [H] = o(), [U] = l(), [W, G] = b(() => /* @__PURE__ */ new Set()), K = I?.mySourceConsents ?? [], q = B?.myContextSharingPolicy, J = q ? M.filter((e) => q[e]).length : null, Y = async (e, t, n) => {
|
|
33
|
+
G((t) => new Set(t).add(e));
|
|
33
34
|
let r = !1;
|
|
34
35
|
try {
|
|
35
36
|
let e = await t();
|
|
36
37
|
if (e.error) throw Error(e.error.message);
|
|
37
|
-
r = !0,
|
|
38
|
+
r = !0, P({
|
|
38
39
|
title: n,
|
|
39
40
|
variant: "success"
|
|
40
41
|
});
|
|
41
42
|
} catch {
|
|
42
|
-
|
|
43
|
+
P({
|
|
43
44
|
title: "Couldn't save this setting",
|
|
44
45
|
description: "Nothing was changed. Please try again.",
|
|
45
46
|
variant: "error"
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
r && await
|
|
49
|
+
r && await z().catch(() => void 0), G((t) => {
|
|
49
50
|
let n = new Set(t);
|
|
50
51
|
return n.delete(e), n;
|
|
51
52
|
});
|
|
52
|
-
},
|
|
53
|
+
}, X = (e, t) => {
|
|
53
54
|
let n = r(e.source);
|
|
54
|
-
|
|
55
|
+
Y(e.source, () => t ? H({ variables: {
|
|
55
56
|
source: e.source,
|
|
56
57
|
mode: e.mode
|
|
57
|
-
} }) :
|
|
58
|
-
},
|
|
58
|
+
} }) : U({ variables: { source: e.source } }), t ? `${n} can capture again` : `${n} stopped capturing`);
|
|
59
|
+
}, Z = (e, t) => {
|
|
59
60
|
let n = r(e.source);
|
|
60
|
-
|
|
61
|
+
Y(e.source, () => H({ variables: {
|
|
61
62
|
source: e.source,
|
|
62
63
|
mode: e.mode,
|
|
63
64
|
onDeviceOnly: t
|
|
64
65
|
} }), t ? `${n} now processes on your device only` : `${n} on-device-only turned off`);
|
|
65
|
-
},
|
|
66
|
+
}, Q = (e, t) => {
|
|
66
67
|
let n = h(t), i = r(e.source);
|
|
67
|
-
|
|
68
|
+
Y(e.source, () => H({ variables: {
|
|
68
69
|
source: e.source,
|
|
69
70
|
mode: e.mode,
|
|
70
71
|
retentionDays: n
|
|
71
72
|
} }), n == null ? `${i}: kept until you delete it` : `${i}: activity older than ${g(n)} is deleted`);
|
|
72
73
|
};
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ k(u, {
|
|
74
75
|
title: "Privacy settings",
|
|
75
76
|
description: "What TimeCampus captures, where it is processed and how long it is kept",
|
|
76
|
-
purpose: "You decide which sources may capture your activity, whether a source is processed on your device only,
|
|
77
|
-
actions: /* @__PURE__ */
|
|
77
|
+
purpose: "You decide which sources may capture your activity, whether a source is processed on your device only, how long captured activity is kept before it is deleted, and how time away from the keyboard is treated. Changes apply straight away.",
|
|
78
|
+
actions: /* @__PURE__ */ O("button", {
|
|
78
79
|
type: "button",
|
|
79
|
-
onClick: () =>
|
|
80
|
+
onClick: () => w("/settings"),
|
|
80
81
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-secondary transition-colors hover:text-text-primary",
|
|
81
82
|
children: "All settings"
|
|
82
83
|
}),
|
|
83
84
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ O(A, {
|
|
85
86
|
treatment: "insight",
|
|
86
87
|
glow: !0,
|
|
87
88
|
className: "p-4 sm:p-6",
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ k("div", {
|
|
89
90
|
className: "flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ k("div", {
|
|
91
92
|
className: "flex items-start gap-3",
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ O("div", {
|
|
93
94
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
94
|
-
children: /* @__PURE__ */ D
|
|
95
|
-
}), /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ O(D, { className: "h-5 w-5" })
|
|
96
|
+
}), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
|
|
96
97
|
className: "text-lg font-semibold text-text-primary",
|
|
97
98
|
children: "No screenshots. No keystroke logging. You own your data."
|
|
98
|
-
}), /* @__PURE__ */
|
|
99
|
+
}), /* @__PURE__ */ O("p", {
|
|
99
100
|
className: "mt-1 text-sm text-text-secondary",
|
|
100
101
|
children: "TimeCampus records what you allow below and nothing else."
|
|
101
102
|
})] })]
|
|
102
|
-
}), /* @__PURE__ */
|
|
103
|
+
}), /* @__PURE__ */ O("ul", {
|
|
103
104
|
className: "grid gap-2 sm:grid-cols-2 lg:min-w-[28rem]",
|
|
104
|
-
children:
|
|
105
|
+
children: j.map((e) => /* @__PURE__ */ k("li", {
|
|
105
106
|
className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ O("span", {
|
|
107
108
|
className: "text-text-muted",
|
|
108
109
|
children: e.icon
|
|
109
|
-
}), /* @__PURE__ */
|
|
110
|
+
}), /* @__PURE__ */ k("span", {
|
|
110
111
|
className: "min-w-0",
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ k("span", {
|
|
112
113
|
className: "flex items-center gap-2 text-sm font-medium text-text-primary",
|
|
113
|
-
children: [e.label, /* @__PURE__ */
|
|
114
|
+
children: [e.label, /* @__PURE__ */ O(d, {
|
|
114
115
|
variant: "muted",
|
|
115
116
|
label: "Never captured"
|
|
116
117
|
})]
|
|
117
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ O("span", {
|
|
118
119
|
className: "mt-0.5 block text-xs text-text-secondary",
|
|
119
120
|
children: e.detail
|
|
120
121
|
})]
|
|
@@ -123,102 +124,102 @@ function M() {
|
|
|
123
124
|
})]
|
|
124
125
|
})
|
|
125
126
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ k(A, {
|
|
127
128
|
treatment: "glass",
|
|
128
129
|
className: "mt-6 p-4 sm:p-6",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ k("div", {
|
|
130
131
|
className: "mb-4 flex items-start gap-3",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ O("div", {
|
|
132
133
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
133
|
-
children: /* @__PURE__ */
|
|
134
|
-
}), /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ O(T, { className: "h-5 w-5" })
|
|
135
|
+
}), /* @__PURE__ */ k("div", {
|
|
135
136
|
className: "min-w-0",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ O("h2", {
|
|
137
138
|
className: "text-sm font-semibold text-text-primary",
|
|
138
139
|
children: "Capture sources"
|
|
139
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ O("p", {
|
|
140
141
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
141
142
|
children: "Each source feeds your record only while it has your consent. Retention deletes that source's captured activity once it is older than the window you pick."
|
|
142
143
|
})]
|
|
143
144
|
})]
|
|
144
|
-
}),
|
|
145
|
+
}), R && K.length === 0 ? /* @__PURE__ */ O("div", {
|
|
145
146
|
className: "rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-3 text-xs text-status-error-text",
|
|
146
147
|
children: "Couldn't load your capture sources right now."
|
|
147
|
-
}) : (
|
|
148
|
+
}) : (L || !S) && K.length === 0 ? /* @__PURE__ */ O(i, {
|
|
148
149
|
variant: "list",
|
|
149
150
|
count: 3
|
|
150
|
-
}) :
|
|
151
|
+
}) : K.length === 0 ? /* @__PURE__ */ O(a, {
|
|
151
152
|
illustration: "empty-data",
|
|
152
153
|
title: "No capture sources yet",
|
|
153
154
|
description: "Connect a calendar, browser or other channel and its consent, on-device processing and retention controls appear here.",
|
|
154
|
-
action: /* @__PURE__ */
|
|
155
|
+
action: /* @__PURE__ */ O("button", {
|
|
155
156
|
type: "button",
|
|
156
|
-
onClick: () =>
|
|
157
|
+
onClick: () => w("/channels"),
|
|
157
158
|
className: "rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text",
|
|
158
159
|
children: "Connect a channel"
|
|
159
160
|
})
|
|
160
|
-
}) : /* @__PURE__ */
|
|
161
|
+
}) : /* @__PURE__ */ O("ul", {
|
|
161
162
|
className: "divide-y divide-border-subtle",
|
|
162
|
-
children:
|
|
163
|
-
let t = r(e.source), i =
|
|
164
|
-
return /* @__PURE__ */
|
|
163
|
+
children: K.map((e) => {
|
|
164
|
+
let t = r(e.source), i = W.has(e.source);
|
|
165
|
+
return /* @__PURE__ */ k("li", {
|
|
165
166
|
className: "flex flex-col gap-3 py-4 first:pt-0 last:pb-0 md:flex-row md:items-center md:justify-between",
|
|
166
167
|
"data-testid": `privacy-source-${e.source}`,
|
|
167
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ k("div", {
|
|
168
169
|
className: "min-w-0",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ O("p", {
|
|
170
171
|
className: "truncate text-sm font-medium text-text-primary",
|
|
171
172
|
children: t
|
|
172
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ k("div", {
|
|
173
174
|
className: "mt-1 flex flex-wrap items-center gap-1.5",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ O(d, {
|
|
175
176
|
variant: e.granted ? "success" : "muted",
|
|
176
177
|
label: e.granted ? "Capturing" : "Stopped"
|
|
177
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ O(d, {
|
|
178
179
|
variant: "muted",
|
|
179
180
|
label: r(e.mode)
|
|
180
181
|
})]
|
|
181
182
|
})]
|
|
182
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ k("div", {
|
|
183
184
|
className: "flex flex-wrap items-center gap-4",
|
|
184
185
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ k("label", {
|
|
186
187
|
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
187
188
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ O(C, {
|
|
189
190
|
className: "h-3.5 w-3.5",
|
|
190
191
|
"aria-hidden": "true"
|
|
191
192
|
}),
|
|
192
193
|
"On-device only",
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ O(m, {
|
|
194
195
|
checked: e.onDeviceOnly,
|
|
195
196
|
disabled: i || !e.granted,
|
|
196
197
|
ariaLabel: `On-device only for ${t}`,
|
|
197
|
-
onChange: (t) =>
|
|
198
|
+
onChange: (t) => Z(e, t)
|
|
198
199
|
})
|
|
199
200
|
]
|
|
200
201
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ k("label", {
|
|
202
203
|
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
203
|
-
children: ["Keep activity", /* @__PURE__ */
|
|
204
|
+
children: ["Keep activity", /* @__PURE__ */ O("select", {
|
|
204
205
|
value: v(e.retentionDays ?? null),
|
|
205
206
|
disabled: i || !e.granted,
|
|
206
207
|
"aria-label": `Retention for ${t}`,
|
|
207
|
-
onChange: (t) =>
|
|
208
|
+
onChange: (t) => Q(e, t.target.value),
|
|
208
209
|
className: n("rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary", (i || !e.granted) && "cursor-not-allowed opacity-50"),
|
|
209
|
-
children: _(e.retentionDays ?? null).map((e) => /* @__PURE__ */
|
|
210
|
+
children: _(e.retentionDays ?? null).map((e) => /* @__PURE__ */ O("option", {
|
|
210
211
|
value: e.value,
|
|
211
212
|
children: e.label
|
|
212
213
|
}, e.value))
|
|
213
214
|
})]
|
|
214
215
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ k("label", {
|
|
216
217
|
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
217
|
-
children: ["Consent", /* @__PURE__ */
|
|
218
|
+
children: ["Consent", /* @__PURE__ */ O(m, {
|
|
218
219
|
checked: e.granted,
|
|
219
220
|
disabled: i,
|
|
220
221
|
ariaLabel: `Consent for ${t}`,
|
|
221
|
-
onChange: (t) =>
|
|
222
|
+
onChange: (t) => X(e, t)
|
|
222
223
|
})]
|
|
223
224
|
})
|
|
224
225
|
]
|
|
@@ -227,42 +228,54 @@ function M() {
|
|
|
227
228
|
})
|
|
228
229
|
})]
|
|
229
230
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ O(y, {
|
|
232
|
+
skip: !S,
|
|
233
|
+
onSaved: (e) => P({
|
|
234
|
+
title: e,
|
|
235
|
+
variant: "success"
|
|
236
|
+
}),
|
|
237
|
+
onError: () => P({
|
|
238
|
+
title: "Couldn't save this setting",
|
|
239
|
+
description: "Nothing was changed. Please try again.",
|
|
240
|
+
variant: "error"
|
|
241
|
+
})
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ O(A, {
|
|
231
244
|
treatment: "glass",
|
|
232
245
|
className: "mt-6 p-4 sm:p-6",
|
|
233
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ k("div", {
|
|
234
247
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ k("div", {
|
|
236
249
|
className: "flex items-start gap-3",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ O("div", {
|
|
238
251
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
239
|
-
children: /* @__PURE__ */
|
|
240
|
-
}), /* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ O(E, { className: "h-5 w-5" })
|
|
253
|
+
}), /* @__PURE__ */ k("div", {
|
|
241
254
|
className: "min-w-0",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ O("h2", {
|
|
243
256
|
className: "text-sm font-semibold text-text-primary",
|
|
244
257
|
children: "Personal and work boundary"
|
|
245
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ O("p", {
|
|
246
259
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
247
|
-
children:
|
|
260
|
+
children: V && !q ? "Couldn't load what you share with your workspace right now." : J == null ? "Loading what you share with your workspace…" : J === 0 ? "Your workspace sees none of your wellbeing signals. Your personal record never leaves your account." : `Your workspace sees ${J} of ${M.length} aggregate wellbeing signals, never the activity behind them.`
|
|
248
261
|
})]
|
|
249
262
|
})]
|
|
250
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ k("button", {
|
|
251
264
|
type: "button",
|
|
252
|
-
onClick: () =>
|
|
265
|
+
onClick: () => w("/personal-corporate"),
|
|
253
266
|
className: "inline-flex shrink-0 items-center gap-1 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-bg-sunken",
|
|
254
|
-
children: ["Manage boundary", /* @__PURE__ */
|
|
267
|
+
children: ["Manage boundary", /* @__PURE__ */ O(x, { className: "h-3.5 w-3.5" })]
|
|
255
268
|
})]
|
|
256
269
|
})
|
|
257
270
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
toasts:
|
|
260
|
-
onDismiss:
|
|
271
|
+
/* @__PURE__ */ O(f, {
|
|
272
|
+
toasts: N,
|
|
273
|
+
onDismiss: F
|
|
261
274
|
})
|
|
262
275
|
]
|
|
263
276
|
});
|
|
264
277
|
}
|
|
265
278
|
//#endregion
|
|
266
|
-
export {
|
|
279
|
+
export { N as PrivacySettingsPage };
|
|
267
280
|
|
|
268
281
|
//# sourceMappingURL=PrivacySettingsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivacySettingsPage.js","names":[],"sources":["../../../../src/timecampus/pages/settings/PrivacySettingsPage.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport {\n ArrowUpRight,\n CameraOff,\n Cpu,\n KeyRound,\n Plug,\n Scale,\n ShieldCheck,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport {\n EmptyState,\n LoadingSkeleton,\n PageLayout,\n StatusBadge,\n ToastContainer,\n ToggleSwitch,\n useToast,\n} from \"../../components\";\nimport { cn, humanizeToken } from \"../../utils/helpers\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport {\n useGrantSourceConsentMutation,\n useMyContextSharingPolicyQuery,\n useMySourceConsentsQuery,\n useRevokeSourceConsentMutation,\n type MySourceConsentsQuery,\n} from \"@/generated/wspace-operations\";\nimport {\n parseRetentionValue,\n retentionLabel,\n retentionOptions,\n retentionValue,\n} from \"./retention\";\n\ntype SourceConsent = MySourceConsentsQuery[\"mySourceConsents\"][number];\n\n/** Capture TimeCampus does not have at all; stated, not toggled. */\nconst NEVER_CAPTURED = [\n {\n label: \"Screenshots\",\n detail:\n \"TimeCampus has no screenshot capture, so there is nothing to switch on.\",\n icon: <CameraOff className=\"h-5 w-5\" />,\n },\n {\n label: \"Keystrokes\",\n detail:\n \"No keystroke logging, and no reading of what you type in other apps.\",\n icon: <KeyRound className=\"h-5 w-5\" />,\n },\n];\n\nconst SHARING_KEYS = [\n \"sustainableHours\",\n \"recoveryBand\",\n \"workLifeBoundary\",\n] as const;\n\nexport function PrivacySettingsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n const { toasts, addToast, dismissToast } = useToast();\n\n const {\n data: consentsData,\n loading: consentsLoading,\n error: consentsError,\n refetch: refetchConsents,\n } = useMySourceConsentsQuery({ skip: !workspaceId });\n const { data: policyData, error: policyError } =\n useMyContextSharingPolicyQuery({ skip: !workspaceId });\n\n const [grantConsent] = useGrantSourceConsentMutation();\n const [revokeConsent] = useRevokeSourceConsentMutation();\n // Sources with a save in flight. Tracked per source so a save on one\n // source never re-enables another source's controls while its own request\n // (for example a revocation) is still pending.\n const [pendingSources, setPendingSources] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n\n const consents: SourceConsent[] = consentsData?.mySourceConsents ?? [];\n const policy = policyData?.myContextSharingPolicy;\n const sharedCount = policy\n ? SHARING_KEYS.filter((key) => policy[key]).length\n : null;\n\n const run = async (\n source: string,\n action: () => Promise<{ error?: { message: string } | undefined }>,\n success: string,\n ) => {\n setPendingSources((prev) => new Set(prev).add(source));\n let saved = false;\n try {\n const res = await action();\n if (res.error) throw new Error(res.error.message);\n saved = true;\n addToast({ title: success, variant: \"success\" });\n } catch {\n addToast({\n title: \"Couldn't save this setting\",\n description: \"Nothing was changed. Please try again.\",\n variant: \"error\",\n });\n }\n // The mutation already returned the updated row; the refetch only keeps\n // the list complete, so a failed refetch is not reported as a failed save.\n if (saved) await refetchConsents().catch(() => undefined);\n setPendingSources((prev) => {\n const next = new Set(prev);\n next.delete(source);\n return next;\n });\n };\n\n // grantSourceConsent resets `mode` when it is omitted, so it is always sent.\n const handleConsent = (consent: SourceConsent, next: boolean) => {\n const label = humanizeToken(consent.source);\n void run(\n consent.source,\n () =>\n next\n ? grantConsent({\n variables: { source: consent.source, mode: consent.mode },\n })\n : revokeConsent({ variables: { source: consent.source } }),\n next ? `${label} can capture again` : `${label} stopped capturing`,\n );\n };\n\n const handleOnDevice = (consent: SourceConsent, next: boolean) => {\n const label = humanizeToken(consent.source);\n void run(\n consent.source,\n () =>\n grantConsent({\n variables: {\n source: consent.source,\n mode: consent.mode,\n onDeviceOnly: next,\n },\n }),\n next\n ? `${label} now processes on your device only`\n : `${label} on-device-only turned off`,\n );\n };\n\n const handleRetention = (consent: SourceConsent, value: string) => {\n const days = parseRetentionValue(value);\n const label = humanizeToken(consent.source);\n void run(\n consent.source,\n () =>\n grantConsent({\n variables: {\n source: consent.source,\n mode: consent.mode,\n retentionDays: days,\n },\n }),\n days == null\n ? `${label}: kept until you delete it`\n : `${label}: activity older than ${retentionLabel(days)} is deleted`,\n );\n };\n\n return (\n <PageLayout\n title=\"Privacy settings\"\n description=\"What TimeCampus captures, where it is processed and how long it is kept\"\n purpose=\"You decide which sources may capture your activity, whether a source is processed on your device only, and how long captured activity is kept before it is deleted. Changes apply straight away.\"\n actions={\n <button\n type=\"button\"\n onClick={() => navigate(\"/settings\")}\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-secondary transition-colors hover:text-text-primary\"\n >\n All settings\n </button>\n }\n >\n <GlassCard treatment=\"insight\" glow className=\"p-4 sm:p-6\">\n <div className=\"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <ShieldCheck className=\"h-5 w-5\" />\n </div>\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n No screenshots. No keystroke logging. You own your data.\n </h2>\n <p className=\"mt-1 text-sm text-text-secondary\">\n TimeCampus records what you allow below and nothing else.\n </p>\n </div>\n </div>\n <ul className=\"grid gap-2 sm:grid-cols-2 lg:min-w-[28rem]\">\n {NEVER_CAPTURED.map((item) => (\n <li\n key={item.label}\n className=\"flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3\"\n >\n <span className=\"text-text-muted\">{item.icon}</span>\n <span className=\"min-w-0\">\n <span className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n {item.label}\n <StatusBadge variant=\"muted\" label=\"Never captured\" />\n </span>\n <span className=\"mt-0.5 block text-xs text-text-secondary\">\n {item.detail}\n </span>\n </span>\n </li>\n ))}\n </ul>\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"glass\" className=\"mt-6 p-4 sm:p-6\">\n <div className=\"mb-4 flex items-start gap-3\">\n <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <Plug className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n Capture sources\n </h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n Each source feeds your record only while it has your consent.\n Retention deletes that source's captured activity once it is older\n than the window you pick.\n </p>\n </div>\n </div>\n\n {consentsError && consents.length === 0 ? (\n <div className=\"rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-3 text-xs text-status-error-text\">\n Couldn't load your capture sources right now.\n </div>\n ) : (consentsLoading || !workspaceId) && consents.length === 0 ? (\n <LoadingSkeleton variant=\"list\" count={3} />\n ) : consents.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No capture sources yet\"\n description=\"Connect a calendar, browser or other channel and its consent, on-device processing and retention controls appear here.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigate(\"/channels\")}\n className=\"rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text\"\n >\n Connect a channel\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {consents.map((consent) => {\n const name = humanizeToken(consent.source);\n const busy = pendingSources.has(consent.source);\n return (\n <li\n key={consent.id}\n className=\"flex flex-col gap-3 py-4 first:pt-0 last:pb-0 md:flex-row md:items-center md:justify-between\"\n data-testid={`privacy-source-${consent.source}`}\n >\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {name}\n </p>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n <StatusBadge\n variant={consent.granted ? \"success\" : \"muted\"}\n label={consent.granted ? \"Capturing\" : \"Stopped\"}\n />\n <StatusBadge\n variant=\"muted\"\n label={humanizeToken(consent.mode)}\n />\n </div>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-4\">\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n <Cpu className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n On-device only\n <ToggleSwitch\n checked={consent.onDeviceOnly}\n disabled={busy || !consent.granted}\n ariaLabel={`On-device only for ${name}`}\n onChange={(next) => handleOnDevice(consent, next)}\n />\n </label>\n\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n Keep activity\n <select\n value={retentionValue(consent.retentionDays ?? null)}\n disabled={busy || !consent.granted}\n aria-label={`Retention for ${name}`}\n onChange={(e) =>\n handleRetention(consent, e.target.value)\n }\n className={cn(\n \"rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary\",\n (busy || !consent.granted) &&\n \"cursor-not-allowed opacity-50\",\n )}\n >\n {retentionOptions(consent.retentionDays ?? null).map(\n (option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ),\n )}\n </select>\n </label>\n\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n Consent\n <ToggleSwitch\n checked={consent.granted}\n disabled={busy}\n ariaLabel={`Consent for ${name}`}\n onChange={(next) => handleConsent(consent, next)}\n />\n </label>\n </div>\n </li>\n );\n })}\n </ul>\n )}\n </GlassCard>\n\n <GlassCard treatment=\"glass\" className=\"mt-6 p-4 sm:p-6\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <Scale className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n Personal and work boundary\n </h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {policyError && !policy\n ? \"Couldn't load what you share with your workspace right now.\"\n : sharedCount == null\n ? \"Loading what you share with your workspace…\"\n : sharedCount === 0\n ? \"Your workspace sees none of your wellbeing signals. Your personal record never leaves your account.\"\n : `Your workspace sees ${sharedCount} of ${SHARING_KEYS.length} aggregate wellbeing signals, never the activity behind them.`}\n </p>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate(\"/personal-corporate\")}\n className=\"inline-flex shrink-0 items-center gap-1 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n Manage boundary\n <ArrowUpRight className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n </GlassCard>\n\n <ToastContainer toasts={toasts} onDismiss={dismissToast} />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,IAAM,IAAiB,CACrB;CACE,OAAO;CACP,QACE;CACF,MAAM,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA;AACxC,GACA;CACE,OAAO;CACP,QACE;CACF,MAAM,kBAAC,GAAD,EAAU,WAAU,UAAW,CAAA;AACvC,CACF,GAEM,IAAe;CACnB;CACA;CACA;AACF;AAEA,SAAgB,IAAsB;CACpC,IAAM,EAAE,iBAAc,OAAO,EAAc,GACrC,IAAW,EAAsB,GACjC,EAAE,WAAQ,aAAU,oBAAiB,EAAS,GAE9C,EACJ,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,MACP,EAAyB,EAAE,MAAM,CAAC,EAAY,CAAC,GAC7C,EAAE,MAAM,GAAY,OAAO,MAC/B,EAA+B,EAAE,MAAM,CAAC,EAAY,CAAC,GAEjD,CAAC,KAAgB,EAA8B,GAC/C,CAAC,KAAiB,EAA+B,GAIjD,CAAC,GAAgB,KAAqB,wBACpC,IAAI,IAA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WAAU;OACb,UAAA,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA;MACzB,CAAA,GACL,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,MAAD;QAAI,WAAU;QAA0C,UAAA;OAEpD,CAAA,GACJ,kBAAC,KAAD;QAAG,WAAU;QACV,UAAA,KAAe,CAAC,IACb,gEACA,KAAe,OACb,gDACA,MAAgB,IACd,wGACA,uBAAuB,EAAY,MAAM,EAAa,OAAO;OACpE,CAAA,CACA;MACF,CAAA,CAAA;KACL,CAAA,GAAA,kBAAC,UAAD;MACE,MAAK;MACL,eAAe,EAAS,qBAAqB;MAC7C,WAAU;MAHZ,UAAA,CAIC,mBAEC,kBAAC,GAAD,EAAc,WAAU,cAAe,CAAA,CACjC;KACL,CAAA,CAAA;;GACI,CAAA;GAEX,kBAAC,GAAD;IAAwB;IAAQ,WAAW;GAAe,CAAA;EAChD;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"PrivacySettingsPage.js","names":[],"sources":["../../../../src/timecampus/pages/settings/PrivacySettingsPage.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport {\n ArrowUpRight,\n CameraOff,\n Cpu,\n KeyRound,\n Plug,\n Scale,\n ShieldCheck,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport {\n EmptyState,\n LoadingSkeleton,\n PageLayout,\n StatusBadge,\n ToastContainer,\n ToggleSwitch,\n useToast,\n} from \"../../components\";\nimport { cn, humanizeToken } from \"../../utils/helpers\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport {\n useGrantSourceConsentMutation,\n useMyContextSharingPolicyQuery,\n useMySourceConsentsQuery,\n useRevokeSourceConsentMutation,\n type MySourceConsentsQuery,\n} from \"@/generated/wspace-operations\";\nimport {\n parseRetentionValue,\n retentionLabel,\n retentionOptions,\n retentionValue,\n} from \"./retention\";\nimport { IdleDetectionCard } from \"./IdleDetectionCard\";\n\ntype SourceConsent = MySourceConsentsQuery[\"mySourceConsents\"][number];\n\n/** Capture TimeCampus does not have at all; stated, not toggled. */\nconst NEVER_CAPTURED = [\n {\n label: \"Screenshots\",\n detail:\n \"TimeCampus has no screenshot capture, so there is nothing to switch on.\",\n icon: <CameraOff className=\"h-5 w-5\" />,\n },\n {\n label: \"Keystrokes\",\n detail:\n \"No keystroke logging, and no reading of what you type in other apps.\",\n icon: <KeyRound className=\"h-5 w-5\" />,\n },\n];\n\nconst SHARING_KEYS = [\n \"sustainableHours\",\n \"recoveryBand\",\n \"workLifeBoundary\",\n] as const;\n\nexport function PrivacySettingsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n const { toasts, addToast, dismissToast } = useToast();\n\n const {\n data: consentsData,\n loading: consentsLoading,\n error: consentsError,\n refetch: refetchConsents,\n } = useMySourceConsentsQuery({ skip: !workspaceId });\n const { data: policyData, error: policyError } =\n useMyContextSharingPolicyQuery({ skip: !workspaceId });\n\n const [grantConsent] = useGrantSourceConsentMutation();\n const [revokeConsent] = useRevokeSourceConsentMutation();\n // Sources with a save in flight. Tracked per source so a save on one\n // source never re-enables another source's controls while its own request\n // (for example a revocation) is still pending.\n const [pendingSources, setPendingSources] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n\n const consents: SourceConsent[] = consentsData?.mySourceConsents ?? [];\n const policy = policyData?.myContextSharingPolicy;\n const sharedCount = policy\n ? SHARING_KEYS.filter((key) => policy[key]).length\n : null;\n\n const run = async (\n source: string,\n action: () => Promise<{ error?: { message: string } | undefined }>,\n success: string,\n ) => {\n setPendingSources((prev) => new Set(prev).add(source));\n let saved = false;\n try {\n const res = await action();\n if (res.error) throw new Error(res.error.message);\n saved = true;\n addToast({ title: success, variant: \"success\" });\n } catch {\n addToast({\n title: \"Couldn't save this setting\",\n description: \"Nothing was changed. Please try again.\",\n variant: \"error\",\n });\n }\n // The mutation already returned the updated row; the refetch only keeps\n // the list complete, so a failed refetch is not reported as a failed save.\n if (saved) await refetchConsents().catch(() => undefined);\n setPendingSources((prev) => {\n const next = new Set(prev);\n next.delete(source);\n return next;\n });\n };\n\n // grantSourceConsent resets `mode` when it is omitted, so it is always sent.\n const handleConsent = (consent: SourceConsent, next: boolean) => {\n const label = humanizeToken(consent.source);\n void run(\n consent.source,\n () =>\n next\n ? grantConsent({\n variables: { source: consent.source, mode: consent.mode },\n })\n : revokeConsent({ variables: { source: consent.source } }),\n next ? `${label} can capture again` : `${label} stopped capturing`,\n );\n };\n\n const handleOnDevice = (consent: SourceConsent, next: boolean) => {\n const label = humanizeToken(consent.source);\n void run(\n consent.source,\n () =>\n grantConsent({\n variables: {\n source: consent.source,\n mode: consent.mode,\n onDeviceOnly: next,\n },\n }),\n next\n ? `${label} now processes on your device only`\n : `${label} on-device-only turned off`,\n );\n };\n\n const handleRetention = (consent: SourceConsent, value: string) => {\n const days = parseRetentionValue(value);\n const label = humanizeToken(consent.source);\n void run(\n consent.source,\n () =>\n grantConsent({\n variables: {\n source: consent.source,\n mode: consent.mode,\n retentionDays: days,\n },\n }),\n days == null\n ? `${label}: kept until you delete it`\n : `${label}: activity older than ${retentionLabel(days)} is deleted`,\n );\n };\n\n return (\n <PageLayout\n title=\"Privacy settings\"\n description=\"What TimeCampus captures, where it is processed and how long it is kept\"\n purpose=\"You decide which sources may capture your activity, whether a source is processed on your device only, how long captured activity is kept before it is deleted, and how time away from the keyboard is treated. Changes apply straight away.\"\n actions={\n <button\n type=\"button\"\n onClick={() => navigate(\"/settings\")}\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-secondary transition-colors hover:text-text-primary\"\n >\n All settings\n </button>\n }\n >\n <GlassCard treatment=\"insight\" glow className=\"p-4 sm:p-6\">\n <div className=\"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <ShieldCheck className=\"h-5 w-5\" />\n </div>\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n No screenshots. No keystroke logging. You own your data.\n </h2>\n <p className=\"mt-1 text-sm text-text-secondary\">\n TimeCampus records what you allow below and nothing else.\n </p>\n </div>\n </div>\n <ul className=\"grid gap-2 sm:grid-cols-2 lg:min-w-[28rem]\">\n {NEVER_CAPTURED.map((item) => (\n <li\n key={item.label}\n className=\"flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3\"\n >\n <span className=\"text-text-muted\">{item.icon}</span>\n <span className=\"min-w-0\">\n <span className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n {item.label}\n <StatusBadge variant=\"muted\" label=\"Never captured\" />\n </span>\n <span className=\"mt-0.5 block text-xs text-text-secondary\">\n {item.detail}\n </span>\n </span>\n </li>\n ))}\n </ul>\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"glass\" className=\"mt-6 p-4 sm:p-6\">\n <div className=\"mb-4 flex items-start gap-3\">\n <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <Plug className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n Capture sources\n </h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n Each source feeds your record only while it has your consent.\n Retention deletes that source's captured activity once it is older\n than the window you pick.\n </p>\n </div>\n </div>\n\n {consentsError && consents.length === 0 ? (\n <div className=\"rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-3 text-xs text-status-error-text\">\n Couldn't load your capture sources right now.\n </div>\n ) : (consentsLoading || !workspaceId) && consents.length === 0 ? (\n <LoadingSkeleton variant=\"list\" count={3} />\n ) : consents.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No capture sources yet\"\n description=\"Connect a calendar, browser or other channel and its consent, on-device processing and retention controls appear here.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigate(\"/channels\")}\n className=\"rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text\"\n >\n Connect a channel\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {consents.map((consent) => {\n const name = humanizeToken(consent.source);\n const busy = pendingSources.has(consent.source);\n return (\n <li\n key={consent.id}\n className=\"flex flex-col gap-3 py-4 first:pt-0 last:pb-0 md:flex-row md:items-center md:justify-between\"\n data-testid={`privacy-source-${consent.source}`}\n >\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {name}\n </p>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n <StatusBadge\n variant={consent.granted ? \"success\" : \"muted\"}\n label={consent.granted ? \"Capturing\" : \"Stopped\"}\n />\n <StatusBadge\n variant=\"muted\"\n label={humanizeToken(consent.mode)}\n />\n </div>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-4\">\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n <Cpu className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n On-device only\n <ToggleSwitch\n checked={consent.onDeviceOnly}\n disabled={busy || !consent.granted}\n ariaLabel={`On-device only for ${name}`}\n onChange={(next) => handleOnDevice(consent, next)}\n />\n </label>\n\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n Keep activity\n <select\n value={retentionValue(consent.retentionDays ?? null)}\n disabled={busy || !consent.granted}\n aria-label={`Retention for ${name}`}\n onChange={(e) =>\n handleRetention(consent, e.target.value)\n }\n className={cn(\n \"rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary\",\n (busy || !consent.granted) &&\n \"cursor-not-allowed opacity-50\",\n )}\n >\n {retentionOptions(consent.retentionDays ?? null).map(\n (option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ),\n )}\n </select>\n </label>\n\n <label className=\"flex items-center gap-2 text-xs text-text-secondary\">\n Consent\n <ToggleSwitch\n checked={consent.granted}\n disabled={busy}\n ariaLabel={`Consent for ${name}`}\n onChange={(next) => handleConsent(consent, next)}\n />\n </label>\n </div>\n </li>\n );\n })}\n </ul>\n )}\n </GlassCard>\n\n <IdleDetectionCard\n skip={!workspaceId}\n onSaved={(message) => addToast({ title: message, variant: \"success\" })}\n onError={() =>\n addToast({\n title: \"Couldn't save this setting\",\n description: \"Nothing was changed. Please try again.\",\n variant: \"error\",\n })\n }\n />\n\n <GlassCard treatment=\"glass\" className=\"mt-6 p-4 sm:p-6\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <Scale className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n Personal and work boundary\n </h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {policyError && !policy\n ? \"Couldn't load what you share with your workspace right now.\"\n : sharedCount == null\n ? \"Loading what you share with your workspace…\"\n : sharedCount === 0\n ? \"Your workspace sees none of your wellbeing signals. Your personal record never leaves your account.\"\n : `Your workspace sees ${sharedCount} of ${SHARING_KEYS.length} aggregate wellbeing signals, never the activity behind them.`}\n </p>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate(\"/personal-corporate\")}\n className=\"inline-flex shrink-0 items-center gap-1 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n Manage boundary\n <ArrowUpRight className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n </GlassCard>\n\n <ToastContainer toasts={toasts} onDismiss={dismissToast} />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,IAAM,IAAiB,CACrB;CACE,OAAO;CACP,QACE;CACF,MAAM,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA;AACxC,GACA;CAC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