@testerpaykit/expo 0.10.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,3 +1,6 @@
1
+ import {
2
+ ExpoStorage
3
+ } from "./chunk-M6XDJUYN.mjs";
1
4
  import {
2
5
  installNetworkCapture
3
6
  } from "./chunk-AGHDTD54.mjs";
@@ -160,39 +163,6 @@ function uuidv4() {
160
163
  // src/client.ts
161
164
  import { AppState } from "react-native";
162
165
 
163
- // src/storage.ts
164
- import AsyncStorage from "@react-native-async-storage/async-storage";
165
- var PREFIX = "@testerpaykit/";
166
- var ExpoStorage = class {
167
- /**
168
- * Read a JSON-serializable value, returning `null` if the key is
169
- * absent or the stored value can't be parsed.
170
- */
171
- async get(key) {
172
- const raw = await AsyncStorage.getItem(PREFIX + key);
173
- if (raw == null) return null;
174
- try {
175
- return JSON.parse(raw);
176
- } catch {
177
- return null;
178
- }
179
- }
180
- async set(key, value) {
181
- await AsyncStorage.setItem(PREFIX + key, JSON.stringify(value));
182
- }
183
- async remove(key) {
184
- await AsyncStorage.removeItem(PREFIX + key);
185
- }
186
- /**
187
- * List every key this SDK has written. Useful for inspection /
188
- * debug dashboards; not used internally.
189
- */
190
- async keys() {
191
- const all = await AsyncStorage.getAllKeys();
192
- return all.filter((k) => k.startsWith(PREFIX)).map((k) => k.slice(PREFIX.length));
193
- }
194
- };
195
-
196
166
  // src/device.ts
197
167
  import { Platform } from "react-native";
198
168
  async function getDeviceSnapshot() {
@@ -1003,7 +973,7 @@ function findAssignmentForTask(tasks, key) {
1003
973
  }
1004
974
 
1005
975
  // package.json
1006
- var version = "0.10.1";
976
+ var version = "0.11.0";
1007
977
 
1008
978
  // src/version.ts
1009
979
  var SDK_VERSION = `@testerpaykit/expo/${version}`;
@@ -1033,6 +1003,15 @@ var TpkExpo = class _TpkExpo {
1033
1003
  * tpk.annotations.snapshot({ taskId: 'task-1' });
1034
1004
  */
1035
1005
  this.annotations = annotations;
1006
+ /**
1007
+ * Extra state for the live link to Claude Code (`enableLiveLink` on
1008
+ * the wrapper): what this returns goes into every `device_snapshot`
1009
+ * and "Send to Claude" note as `app_state`. Set it anywhere the state
1010
+ * is reachable, e.g. `tpk.liveStateProvider = () => ({ cart, user })`.
1011
+ * Round-tripped through JSON; a throwing or non-serialisable provider
1012
+ * yields `{error}` instead of breaking the snapshot.
1013
+ */
1014
+ this.liveStateProvider = null;
1036
1015
  this.sessionEvents = [];
1037
1016
  this.uninstallDurableSync = null;
1038
1017
  this.uninstallTaskBinding = null;
@@ -1055,6 +1034,10 @@ var TpkExpo = class _TpkExpo {
1055
1034
  get ready() {
1056
1035
  return this._ready;
1057
1036
  }
1037
+ /** The project this client reports into. */
1038
+ get projectId() {
1039
+ return this.config.projectId;
1040
+ }
1058
1041
  static async init(config) {
1059
1042
  runSetupCheck();
1060
1043
  const storage = config.storage ?? new ExpoStorage();
@@ -1320,7 +1303,8 @@ var TpkExpo = class _TpkExpo {
1320
1303
  * Used by the wrapper's `aiRemoteTrigger` poll.
1321
1304
  */
1322
1305
  async claimRemoteAiSession() {
1323
- return this.api.claimRemoteAiSession(this.config.projectId);
1306
+ const { version: version2 } = await getAppSnapshot();
1307
+ return this.api.claimRemoteAiSession(this.config.projectId, version2);
1324
1308
  }
1325
1309
  /**
1326
1310
  * Onboard with a runtime invite code (instead of the baked-in
@@ -1915,7 +1899,10 @@ var DEFAULT_GLYPH_MAP = {
1915
1899
  shape_circle: "radio-button-unchecked",
1916
1900
  shape_arrow: "arrow-forward",
1917
1901
  text: "text-fields",
1918
- blur: "blur-on"
1902
+ blur: "blur-on",
1903
+ link: "link",
1904
+ link_off: "link-off",
1905
+ send: "send"
1919
1906
  };
1920
1907
  var EMOJI_FALLBACK_MAP = {
1921
1908
  bug_report: "\u{1F41E}",
@@ -1949,7 +1936,10 @@ var EMOJI_FALLBACK_MAP = {
1949
1936
  shape_circle: "\u2B55",
1950
1937
  shape_arrow: "\u27A1\uFE0F",
1951
1938
  text: "\u{1F163}",
1952
- blur: "\u{1F7E6}"
1939
+ blur: "\u{1F7E6}",
1940
+ link: "\u{1F517}",
1941
+ link_off: "\u26D3\uFE0F\u200D\u{1F4A5}",
1942
+ send: "\u{1F4E4}"
1953
1943
  };
1954
1944
  var TpkIconsContext = createContext2({});
1955
1945
  function TpkIconsProvider({
@@ -2074,6 +2064,10 @@ var TPK_STRINGS = {
2074
2064
  menuReportBug: "Bug melden",
2075
2065
  menuFeedback: "Feedback",
2076
2066
  menuAutoTest: "Auto-Test (KI)",
2067
+ menuChecklist: "Was testen?",
2068
+ menuSendToClaude: "An Claude senden",
2069
+ menuConnectClaude: "Mit Claude verbinden",
2070
+ menuDisconnectClaude: "Von Claude trennen",
2077
2071
  menuCachedCrashes: (n) => n === 1 ? "1 gespeicherten Absturz senden" : `${n} gespeicherte Abst\xFCrze senden`,
2078
2072
  menuWorkboard: "Meine \xDCbersicht",
2079
2073
  menuMyBugs: "Meine Bugs",
@@ -2170,6 +2164,10 @@ var TPK_STRINGS = {
2170
2164
  menuReportBug: "Report Bug",
2171
2165
  menuFeedback: "Feedback",
2172
2166
  menuAutoTest: "Auto Test (AI)",
2167
+ menuChecklist: "What to test",
2168
+ menuSendToClaude: "Send to Claude",
2169
+ menuConnectClaude: "Connect to Claude",
2170
+ menuDisconnectClaude: "Disconnect from Claude",
2173
2171
  menuCachedCrashes: (n) => `Send ${n} cached ${n === 1 ? "crash" : "crashes"}`,
2174
2172
  menuWorkboard: "My Workboard",
2175
2173
  menuMyBugs: "My Bugs",
@@ -2762,6 +2760,11 @@ function FloatingFeedbackButton({
2762
2760
  onShowMessages,
2763
2761
  unreadMessageCount = 0,
2764
2762
  onAutoTest,
2763
+ onShowChecklist,
2764
+ checklistCount = 0,
2765
+ onSendToClaude,
2766
+ onToggleLiveLink,
2767
+ liveLinkConnected = false,
2765
2768
  onLongPressVoiceBug,
2766
2769
  onFlushCachedCrashes,
2767
2770
  notificationCount = 0,
@@ -2897,6 +2900,33 @@ function FloatingFeedbackButton({
2897
2900
  onTap: () => handleAction(onGeneralFeedback)
2898
2901
  }
2899
2902
  ];
2903
+ if (onShowChecklist) {
2904
+ opts.push({
2905
+ key: "checklist",
2906
+ icon: "check",
2907
+ label: checklistCount > 0 ? `${S.menuChecklist} (${checklistCount})` : S.menuChecklist,
2908
+ color: "#0D9488",
2909
+ onTap: () => handleAction(onShowChecklist)
2910
+ });
2911
+ }
2912
+ if (onSendToClaude) {
2913
+ opts.push({
2914
+ key: "send-to-claude",
2915
+ icon: "send",
2916
+ label: S.menuSendToClaude,
2917
+ color: "#D97757",
2918
+ onTap: () => handleAction(onSendToClaude)
2919
+ });
2920
+ }
2921
+ if (onToggleLiveLink) {
2922
+ opts.push({
2923
+ key: "live-link",
2924
+ icon: liveLinkConnected ? "link_off" : "link",
2925
+ label: liveLinkConnected ? S.menuDisconnectClaude : S.menuConnectClaude,
2926
+ color: "#D97757",
2927
+ onTap: () => handleAction(onToggleLiveLink)
2928
+ });
2929
+ }
2900
2930
  if (onAutoTest) {
2901
2931
  opts.push({
2902
2932
  key: "auto-test",
@@ -2990,6 +3020,11 @@ function FloatingFeedbackButton({
2990
3020
  onShowMessages,
2991
3021
  unreadMessageCount,
2992
3022
  onAutoTest,
3023
+ onShowChecklist,
3024
+ checklistCount,
3025
+ onSendToClaude,
3026
+ onToggleLiveLink,
3027
+ liveLinkConnected,
2993
3028
  onFlushCachedCrashes,
2994
3029
  notificationCount,
2995
3030
  handleAction,
@@ -7398,32 +7433,411 @@ var styles9 = StyleSheet9.create({
7398
7433
  btnOutline: { borderWidth: 1, borderColor: "#CBD5E1" }
7399
7434
  });
7400
7435
 
7401
- // src/ScreenshotAnnotationEditor.tsx
7402
- import React15, { useCallback as useCallback7, useRef as useRef7, useState as useState11 } from "react";
7436
+ // src/ChecklistPanel.tsx
7437
+ import React14, { useCallback as useCallback6, useEffect as useEffect9, useMemo as useMemo6, useState as useState10 } from "react";
7403
7438
  import {
7404
7439
  ActivityIndicator as ActivityIndicator5,
7405
- Modal as Modal6,
7440
+ Dimensions as Dimensions3,
7406
7441
  Pressable as Pressable9,
7407
7442
  ScrollView as ScrollView8,
7408
- StyleSheet as StyleSheet11,
7443
+ StyleSheet as StyleSheet10,
7409
7444
  Text as Text10,
7410
7445
  TextInput as TextInput4,
7411
- View as View11
7446
+ View as View10
7447
+ } from "react-native";
7448
+
7449
+ // src/checklist.ts
7450
+ async function loadChecklist(tpk) {
7451
+ if (!tpk) return [];
7452
+ try {
7453
+ await tpk.ready;
7454
+ const tasks = await tpk.api.getChecklist(tpk.projectId);
7455
+ return Array.isArray(tasks) ? tasks.filter((t) => t && typeof t.id === "string" && Array.isArray(t.steps)) : [];
7456
+ } catch {
7457
+ return [];
7458
+ }
7459
+ }
7460
+ function newDraft(task) {
7461
+ return task.steps.map(() => ({ passed: null, note: "" }));
7462
+ }
7463
+ function toggleVerdict(draft, index, passed) {
7464
+ return draft.map(
7465
+ (s, i) => i === index ? { ...s, passed: s.passed === passed ? null : passed } : s
7466
+ );
7467
+ }
7468
+ function setNote(draft, index, note) {
7469
+ return draft.map((s, i) => i === index ? { ...s, note } : s);
7470
+ }
7471
+ function toStepResults(draft) {
7472
+ const out = [];
7473
+ draft.forEach((s, i) => {
7474
+ if (s.passed === null) return;
7475
+ const note = s.note.trim();
7476
+ out.push({ step: i + 1, passed: s.passed, ...note ? { note } : {} });
7477
+ });
7478
+ return out;
7479
+ }
7480
+ function canSend(draft) {
7481
+ return draft.some((s) => s.passed !== null);
7482
+ }
7483
+ function nextOpenStep(draft) {
7484
+ return draft.findIndex((s) => s.passed === null);
7485
+ }
7486
+ function draftProgress(draft) {
7487
+ return {
7488
+ judged: draft.filter((s) => s.passed !== null).length,
7489
+ failed: draft.filter((s) => s.passed === false).length,
7490
+ total: draft.length
7491
+ };
7492
+ }
7493
+ function openTaskCount(tasks) {
7494
+ return tasks.filter((t) => t.mine?.status !== "passed").length;
7495
+ }
7496
+ function runTone(run) {
7497
+ if (!run) return "none";
7498
+ if (run.status === "passed" || run.status === "failed" || run.status === "incomplete") return run.status;
7499
+ return "incomplete";
7500
+ }
7501
+ var STATUS_TEXT = {
7502
+ de: { passed: "Bestanden", failed: "Fehler gefunden", incomplete: "Unvollst\xE4ndig", none: "Noch offen" },
7503
+ en: { passed: "Passed", failed: "Failed", incomplete: "Incomplete", none: "Not tested yet" }
7504
+ };
7505
+ function runStatusText(run, language) {
7506
+ return STATUS_TEXT[language][runTone(run)];
7507
+ }
7508
+ var RUN_TONE_COLOR = {
7509
+ passed: "#16A34A",
7510
+ failed: "#DC2626",
7511
+ incomplete: "#EA580C",
7512
+ none: "#64748B"
7513
+ };
7514
+ function lastStepVerdict(run, index) {
7515
+ const s = run?.steps?.find((r) => r && r.step === index + 1);
7516
+ return typeof s?.passed === "boolean" ? s.passed : null;
7517
+ }
7518
+
7519
+ // src/ChecklistPanel.tsx
7520
+ var PASS = "#16A34A";
7521
+ var FAIL = "#DC2626";
7522
+ function ChecklistPanel({
7523
+ visible,
7524
+ tpk,
7525
+ tasks,
7526
+ onReload,
7527
+ onClose
7528
+ }) {
7529
+ const theme = useTpkTheme();
7530
+ const tr = useTr();
7531
+ const language = useTpkLanguage();
7532
+ const [taskId, setTaskId] = useState10(null);
7533
+ const [draft, setDraft] = useState10([]);
7534
+ const [noteOpen, setNoteOpen] = useState10(null);
7535
+ const [collapsed, setCollapsed] = useState10(false);
7536
+ const [dockTop, setDockTop] = useState10(false);
7537
+ const [typing, setTyping] = useState10(false);
7538
+ const [sending, setSending] = useState10(false);
7539
+ const [message, setMessage] = useState10(null);
7540
+ const task = useMemo6(() => tasks.find((t) => t.id === taskId) ?? null, [tasks, taskId]);
7541
+ useEffect9(() => {
7542
+ if (!visible) {
7543
+ setTaskId(null);
7544
+ setCollapsed(false);
7545
+ setMessage(null);
7546
+ }
7547
+ }, [visible]);
7548
+ const openTask = useCallback6((t) => {
7549
+ setTaskId(t.id);
7550
+ setDraft(newDraft(t));
7551
+ setNoteOpen(null);
7552
+ setMessage(null);
7553
+ }, []);
7554
+ const send = useCallback6(async () => {
7555
+ if (!tpk || !task || !canSend(draft)) return;
7556
+ setSending(true);
7557
+ setMessage(null);
7558
+ try {
7559
+ await tpk.ready;
7560
+ const status = await tpk.api.submitChecklistRun({
7561
+ projectId: tpk.projectId,
7562
+ taskId: task.id,
7563
+ stepResults: toStepResults(draft)
7564
+ });
7565
+ const text = runStatusText({ status, steps: [], at: "" }, language);
7566
+ setMessage({ text: tr({ en: `Sent \u2014 ${text}`, de: `Gesendet \u2014 ${text}` }), error: false });
7567
+ setTaskId(null);
7568
+ onReload();
7569
+ } catch (e) {
7570
+ setMessage({
7571
+ text: tr({ en: "Could not send. ", de: "Senden fehlgeschlagen. " }) + (e instanceof Error ? e.message : String(e)),
7572
+ error: true
7573
+ });
7574
+ } finally {
7575
+ setSending(false);
7576
+ }
7577
+ }, [tpk, task, draft, language, tr, onReload]);
7578
+ if (!visible) return null;
7579
+ const win = (() => {
7580
+ try {
7581
+ return Dimensions3.get("window");
7582
+ } catch {
7583
+ return { width: 390, height: 800 };
7584
+ }
7585
+ })();
7586
+ const insets = getModalInsets();
7587
+ const atTop = dockTop || typing;
7588
+ const progress = task ? draftProgress(draft) : null;
7589
+ const current = task ? nextOpenStep(draft) : -1;
7590
+ const title = task ? task.title : tr({ en: "What to test", de: "Was testen?" });
7591
+ return /* @__PURE__ */ React14.createElement(
7592
+ View10,
7593
+ {
7594
+ pointerEvents: "box-none",
7595
+ style: [
7596
+ styles10.dock,
7597
+ atTop ? { top: insets.top + 8 } : { bottom: insets.bottom + 8 }
7598
+ ],
7599
+ testID: "tpk-checklist-panel"
7600
+ },
7601
+ /* @__PURE__ */ React14.createElement(View10, { style: [styles10.panel, { backgroundColor: theme.surface, maxHeight: collapsed ? void 0 : Math.round(win.height * 0.42) }] }, /* @__PURE__ */ React14.createElement(View10, { style: styles10.header }, task && !collapsed ? /* @__PURE__ */ React14.createElement(
7602
+ Pressable9,
7603
+ {
7604
+ onPress: () => setTaskId(null),
7605
+ hitSlop: 8,
7606
+ accessibilityLabel: tr({ en: "All tasks", de: "Alle Aufgaben" }),
7607
+ testID: "tpk-checklist-back"
7608
+ },
7609
+ /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.headerBtn, { color: theme.primary }] }, "\u2039")
7610
+ ) : null, /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.title, { color: theme.onSurface }], numberOfLines: 1 }, title), progress ? /* @__PURE__ */ React14.createElement(Text10, { style: styles10.progress, testID: "tpk-checklist-progress" }, progress.judged, "/", progress.total) : null, /* @__PURE__ */ React14.createElement(
7611
+ Pressable9,
7612
+ {
7613
+ onPress: () => setDockTop((v) => !v),
7614
+ hitSlop: 8,
7615
+ accessibilityLabel: tr({ en: "Move panel", de: "Leiste verschieben" }),
7616
+ testID: "tpk-checklist-dock"
7617
+ },
7618
+ /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.headerBtn, { color: theme.onSurface }] }, atTop ? "\u2193" : "\u2191")
7619
+ ), /* @__PURE__ */ React14.createElement(
7620
+ Pressable9,
7621
+ {
7622
+ onPress: () => setCollapsed((v) => !v),
7623
+ hitSlop: 8,
7624
+ accessibilityLabel: collapsed ? tr({ en: "Expand", de: "Aufklappen" }) : tr({ en: "Collapse", de: "Einklappen" }),
7625
+ testID: "tpk-checklist-collapse"
7626
+ },
7627
+ /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.headerBtn, { color: theme.onSurface }] }, collapsed ? "\u25B4" : "\u25BE")
7628
+ ), /* @__PURE__ */ React14.createElement(
7629
+ Pressable9,
7630
+ {
7631
+ onPress: onClose,
7632
+ hitSlop: 8,
7633
+ accessibilityLabel: tr({ en: "Close", de: "Schlie\xDFen" }),
7634
+ testID: "tpk-checklist-close"
7635
+ },
7636
+ /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.headerBtn, { color: theme.onSurface }] }, "\u2715")
7637
+ )), collapsed ? task && current >= 0 ? /* @__PURE__ */ React14.createElement(Text10, { style: styles10.collapsedStep, numberOfLines: 1, testID: "tpk-checklist-current" }, current + 1, ". ", task.steps[current]) : null : /* @__PURE__ */ React14.createElement(ScrollView8, { style: styles10.body, keyboardShouldPersistTaps: "handled" }, message ? /* @__PURE__ */ React14.createElement(
7638
+ Text10,
7639
+ {
7640
+ style: [styles10.message, { color: message.error ? FAIL : PASS }],
7641
+ testID: "tpk-checklist-message"
7642
+ },
7643
+ message.text
7644
+ ) : null, !task ? tasks.length === 0 ? /* @__PURE__ */ React14.createElement(Text10, { style: styles10.muted }, tr({ en: "Nothing to test right now.", de: "Gerade gibt es nichts zu testen." })) : tasks.map((t) => {
7645
+ const tone = runTone(t.mine);
7646
+ return /* @__PURE__ */ React14.createElement(
7647
+ Pressable9,
7648
+ {
7649
+ key: t.id,
7650
+ onPress: () => openTask(t),
7651
+ style: styles10.taskRow,
7652
+ testID: `tpk-checklist-task-${t.id}`
7653
+ },
7654
+ /* @__PURE__ */ React14.createElement(View10, { style: { flex: 1 } }, /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.taskTitle, { color: theme.onSurface }], numberOfLines: 2 }, t.title), /* @__PURE__ */ React14.createElement(Text10, { style: styles10.muted }, tr({
7655
+ en: `${t.steps.length} step${t.steps.length === 1 ? "" : "s"}`,
7656
+ de: `${t.steps.length} Schritt${t.steps.length === 1 ? "" : "e"}`
7657
+ }))),
7658
+ /* @__PURE__ */ React14.createElement(
7659
+ Text10,
7660
+ {
7661
+ style: [styles10.chip, { color: RUN_TONE_COLOR[tone], borderColor: RUN_TONE_COLOR[tone] }],
7662
+ testID: `tpk-checklist-status-${t.id}`
7663
+ },
7664
+ runStatusText(t.mine, language)
7665
+ )
7666
+ );
7667
+ }) : /* @__PURE__ */ React14.createElement(React14.Fragment, null, task.description ? /* @__PURE__ */ React14.createElement(Text10, { style: styles10.description }, task.description) : null, task.steps.map((step, i) => {
7668
+ const d = draft[i] ?? { passed: null, note: "" };
7669
+ const last = lastStepVerdict(task.mine, i);
7670
+ return /* @__PURE__ */ React14.createElement(
7671
+ View10,
7672
+ {
7673
+ key: i,
7674
+ style: [styles10.stepRow, i === current && styles10.stepCurrent],
7675
+ testID: `tpk-checklist-step-${i + 1}`
7676
+ },
7677
+ /* @__PURE__ */ React14.createElement(View10, { style: styles10.stepLine }, /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.stepText, { color: theme.onSurface }] }, i + 1, ". ", step, last !== null && d.passed === null ? /* @__PURE__ */ React14.createElement(Text10, { style: { color: last ? PASS : FAIL } }, " ", last ? "\u2713" : "\u2717") : null), /* @__PURE__ */ React14.createElement(
7678
+ Pressable9,
7679
+ {
7680
+ onPress: () => setDraft((dr) => toggleVerdict(dr, i, true)),
7681
+ style: [styles10.verdict, d.passed === true && { backgroundColor: PASS, borderColor: PASS }],
7682
+ accessibilityLabel: tr({ en: `Step ${i + 1} works`, de: `Schritt ${i + 1} klappt` }),
7683
+ testID: `tpk-checklist-pass-${i + 1}`
7684
+ },
7685
+ /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.verdictText, { color: d.passed === true ? "#FFF" : PASS }] }, "\u2713")
7686
+ ), /* @__PURE__ */ React14.createElement(
7687
+ Pressable9,
7688
+ {
7689
+ onPress: () => {
7690
+ setDraft((dr) => toggleVerdict(dr, i, false));
7691
+ if (d.passed !== false) setNoteOpen(i);
7692
+ },
7693
+ style: [styles10.verdict, d.passed === false && { backgroundColor: FAIL, borderColor: FAIL }],
7694
+ accessibilityLabel: tr({ en: `Step ${i + 1} fails`, de: `Schritt ${i + 1} klappt nicht` }),
7695
+ testID: `tpk-checklist-fail-${i + 1}`
7696
+ },
7697
+ /* @__PURE__ */ React14.createElement(Text10, { style: [styles10.verdictText, { color: d.passed === false ? "#FFF" : FAIL }] }, "\u2717")
7698
+ )),
7699
+ noteOpen === i ? /* @__PURE__ */ React14.createElement(
7700
+ TextInput4,
7701
+ {
7702
+ value: d.note,
7703
+ onChangeText: (v) => setDraft((dr) => setNote(dr, i, v)),
7704
+ placeholder: tr({ en: "What happened? (optional)", de: "Was ist passiert? (optional)" }),
7705
+ placeholderTextColor: "#94A3B8",
7706
+ style: [styles10.note, { color: theme.onSurface }],
7707
+ onFocus: () => setTyping(true),
7708
+ onBlur: () => setTyping(false),
7709
+ multiline: true,
7710
+ testID: `tpk-checklist-note-${i + 1}`
7711
+ }
7712
+ ) : /* @__PURE__ */ React14.createElement(Pressable9, { onPress: () => setNoteOpen(i), hitSlop: 4, testID: `tpk-checklist-add-note-${i + 1}` }, /* @__PURE__ */ React14.createElement(Text10, { style: styles10.addNote }, d.note.trim() ? `\u201C${d.note.trim()}\u201D` : tr({ en: "+ note", de: "+ Notiz" })))
7713
+ );
7714
+ }), /* @__PURE__ */ React14.createElement(
7715
+ Pressable9,
7716
+ {
7717
+ onPress: () => void send(),
7718
+ disabled: !canSend(draft) || sending,
7719
+ style: [
7720
+ styles10.send,
7721
+ { backgroundColor: theme.primary },
7722
+ (!canSend(draft) || sending) && styles10.sendDisabled
7723
+ ],
7724
+ testID: "tpk-checklist-send"
7725
+ },
7726
+ sending ? /* @__PURE__ */ React14.createElement(ActivityIndicator5, { color: "#FFF" }) : /* @__PURE__ */ React14.createElement(Text10, { style: styles10.sendText }, tr({ en: "Send", de: "Senden" }))
7727
+ ))))
7728
+ );
7729
+ }
7730
+ var styles10 = StyleSheet10.create({
7731
+ dock: {
7732
+ position: "absolute",
7733
+ left: 8,
7734
+ right: 8
7735
+ },
7736
+ panel: {
7737
+ borderRadius: 14,
7738
+ paddingHorizontal: 12,
7739
+ paddingVertical: 8,
7740
+ opacity: 0.96,
7741
+ shadowColor: "#000",
7742
+ shadowOpacity: 0.18,
7743
+ shadowRadius: 10,
7744
+ shadowOffset: { width: 0, height: 2 },
7745
+ elevation: 8
7746
+ },
7747
+ header: {
7748
+ flexDirection: "row",
7749
+ alignItems: "center",
7750
+ gap: 12,
7751
+ minHeight: 32
7752
+ },
7753
+ headerBtn: { fontSize: 18, fontWeight: "600", paddingHorizontal: 2 },
7754
+ title: { flex: 1, fontSize: 15, fontWeight: "700" },
7755
+ progress: { fontSize: 13, color: "#64748B", fontVariant: ["tabular-nums"] },
7756
+ body: { marginTop: 4 },
7757
+ collapsedStep: { fontSize: 13, color: "#334155", marginTop: 2 },
7758
+ message: { fontSize: 13, fontWeight: "600", marginBottom: 6 },
7759
+ muted: { fontSize: 12, color: "#64748B" },
7760
+ description: { fontSize: 13, color: "#475569", marginBottom: 6 },
7761
+ taskRow: {
7762
+ flexDirection: "row",
7763
+ alignItems: "center",
7764
+ gap: 8,
7765
+ paddingVertical: 8,
7766
+ borderBottomWidth: StyleSheet10.hairlineWidth,
7767
+ borderBottomColor: "#E2E8F0"
7768
+ },
7769
+ taskTitle: { fontSize: 14, fontWeight: "600" },
7770
+ chip: {
7771
+ fontSize: 11,
7772
+ fontWeight: "700",
7773
+ borderWidth: 1,
7774
+ borderRadius: 10,
7775
+ paddingHorizontal: 8,
7776
+ paddingVertical: 2,
7777
+ overflow: "hidden"
7778
+ },
7779
+ stepRow: { paddingVertical: 6, paddingHorizontal: 4, borderRadius: 8 },
7780
+ stepCurrent: { backgroundColor: "rgba(37, 99, 235, 0.07)" },
7781
+ stepLine: { flexDirection: "row", alignItems: "center", gap: 8 },
7782
+ stepText: { flex: 1, fontSize: 14 },
7783
+ verdict: {
7784
+ width: 36,
7785
+ height: 32,
7786
+ borderRadius: 8,
7787
+ borderWidth: 1.5,
7788
+ borderColor: "#CBD5E1",
7789
+ alignItems: "center",
7790
+ justifyContent: "center"
7791
+ },
7792
+ verdictText: { fontSize: 16, fontWeight: "800" },
7793
+ addNote: { fontSize: 12, color: "#64748B", marginTop: 2 },
7794
+ note: {
7795
+ marginTop: 4,
7796
+ borderWidth: 1,
7797
+ borderColor: "#CBD5E1",
7798
+ borderRadius: 8,
7799
+ paddingHorizontal: 8,
7800
+ paddingVertical: 6,
7801
+ fontSize: 13,
7802
+ minHeight: 36
7803
+ },
7804
+ send: {
7805
+ marginTop: 8,
7806
+ marginBottom: 4,
7807
+ borderRadius: 10,
7808
+ paddingVertical: 10,
7809
+ alignItems: "center"
7810
+ },
7811
+ sendDisabled: { opacity: 0.4 },
7812
+ sendText: { color: "#FFF", fontWeight: "700", fontSize: 15 }
7813
+ });
7814
+
7815
+ // src/ScreenshotAnnotationEditor.tsx
7816
+ import React16, { useCallback as useCallback8, useRef as useRef7, useState as useState12 } from "react";
7817
+ import {
7818
+ ActivityIndicator as ActivityIndicator6,
7819
+ Modal as Modal6,
7820
+ Pressable as Pressable10,
7821
+ ScrollView as ScrollView9,
7822
+ StyleSheet as StyleSheet12,
7823
+ Text as Text11,
7824
+ TextInput as TextInput5,
7825
+ View as View12
7412
7826
  } from "react-native";
7413
7827
 
7414
7828
  // src/TpkAnnotationOverlay.tsx
7415
- import React14, {
7829
+ import React15, {
7416
7830
  forwardRef,
7417
- useCallback as useCallback6,
7831
+ useCallback as useCallback7,
7418
7832
  useImperativeHandle,
7419
- useMemo as useMemo6,
7833
+ useMemo as useMemo7,
7420
7834
  useRef as useRef6,
7421
- useState as useState10
7835
+ useState as useState11
7422
7836
  } from "react";
7423
7837
  import {
7424
- View as View10,
7838
+ View as View11,
7425
7839
  Image as Image2,
7426
- StyleSheet as StyleSheet10,
7840
+ StyleSheet as StyleSheet11,
7427
7841
  PanResponder as PanResponder2
7428
7842
  } from "react-native";
7429
7843
 
@@ -7541,7 +7955,7 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7541
7955
  onShapesChange,
7542
7956
  textValue
7543
7957
  } = props;
7544
- const [shapes, setShapesState] = useState10(
7958
+ const [shapes, setShapesState] = useState11(
7545
7959
  initialShapes ?? []
7546
7960
  );
7547
7961
  const draftRef = useRef6(null);
@@ -7551,22 +7965,22 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7551
7965
  });
7552
7966
  const surfaceRef = useRef6(null);
7553
7967
  const SvgModRef = useRef6(null);
7554
- const [svgReady, setSvgReady] = useState10(false);
7555
- React14.useEffect(() => {
7968
+ const [svgReady, setSvgReady] = useState11(false);
7969
+ React15.useEffect(() => {
7556
7970
  import("react-native-svg").then((mod) => {
7557
7971
  SvgModRef.current = mod;
7558
7972
  setSvgReady(true);
7559
7973
  }).catch(() => {
7560
7974
  });
7561
7975
  }, []);
7562
- const commitShapes = useCallback6(
7976
+ const commitShapes = useCallback7(
7563
7977
  (next) => {
7564
7978
  setShapesState(next);
7565
7979
  onShapesChange?.(next);
7566
7980
  },
7567
7981
  [onShapesChange]
7568
7982
  );
7569
- const toImageCoords = useCallback6(
7983
+ const toImageCoords = useCallback7(
7570
7984
  (e) => {
7571
7985
  const { width, height } = layoutRef.current;
7572
7986
  const scaleX = imageWidth / Math.max(1, width);
@@ -7578,7 +7992,7 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7578
7992
  },
7579
7993
  [imageWidth, imageHeight]
7580
7994
  );
7581
- const panResponder = useMemo6(
7995
+ const panResponder = useMemo7(
7582
7996
  () => PanResponder2.create({
7583
7997
  onStartShouldSetPanResponder: () => tool !== "select",
7584
7998
  onMoveShouldSetPanResponder: () => tool !== "select",
@@ -7604,7 +8018,7 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7604
8018
  }),
7605
8019
  [tool, style, textValue, toImageCoords, shapes, commitShapes]
7606
8020
  );
7607
- const onLayout = useCallback6((e) => {
8021
+ const onLayout = useCallback7((e) => {
7608
8022
  layoutRef.current = {
7609
8023
  width: e.nativeEvent.layout.width,
7610
8024
  height: e.nativeEvent.layout.height
@@ -7638,32 +8052,32 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7638
8052
  }),
7639
8053
  [shapes, commitShapes]
7640
8054
  );
7641
- return /* @__PURE__ */ React14.createElement(
7642
- View10,
8055
+ return /* @__PURE__ */ React15.createElement(
8056
+ View11,
7643
8057
  {
7644
8058
  ref: surfaceRef,
7645
- style: [styles10.surface, { aspectRatio: imageWidth / imageHeight }],
8059
+ style: [styles11.surface, { aspectRatio: imageWidth / imageHeight }],
7646
8060
  onLayout,
7647
8061
  ...panResponder.panHandlers
7648
8062
  },
7649
- /* @__PURE__ */ React14.createElement(
8063
+ /* @__PURE__ */ React15.createElement(
7650
8064
  Image2,
7651
8065
  {
7652
8066
  source: { uri: imageUri },
7653
- style: StyleSheet10.absoluteFill,
8067
+ style: StyleSheet11.absoluteFill,
7654
8068
  resizeMode: "contain"
7655
8069
  }
7656
8070
  ),
7657
- svgReady && SvgModRef.current ? /* @__PURE__ */ React14.createElement(ShapeLayer, { shapes, svgMod: SvgModRef.current, viewBox: `0 0 ${imageWidth} ${imageHeight}` }) : null
8071
+ svgReady && SvgModRef.current ? /* @__PURE__ */ React15.createElement(ShapeLayer, { shapes, svgMod: SvgModRef.current, viewBox: `0 0 ${imageWidth} ${imageHeight}` }) : null
7658
8072
  );
7659
8073
  });
7660
8074
  function ShapeLayer({ shapes, svgMod, viewBox }) {
7661
8075
  const Svg = svgMod.default ?? svgMod.Svg;
7662
8076
  const { Rect, Circle, Polygon, Path, Text: SvgText, Line: SvgLine, G } = svgMod;
7663
- return /* @__PURE__ */ React14.createElement(
8077
+ return /* @__PURE__ */ React15.createElement(
7664
8078
  Svg,
7665
8079
  {
7666
- style: StyleSheet10.absoluteFill,
8080
+ style: StyleSheet11.absoluteFill,
7667
8081
  viewBox,
7668
8082
  preserveAspectRatio: "xMidYMid meet"
7669
8083
  },
@@ -7673,7 +8087,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7673
8087
  const opacity = s.kind === "blur" ? 1 : s.style.opacity ?? 1;
7674
8088
  switch (s.kind) {
7675
8089
  case "rect":
7676
- return /* @__PURE__ */ React14.createElement(
8090
+ return /* @__PURE__ */ React15.createElement(
7677
8091
  Rect,
7678
8092
  {
7679
8093
  key: s.id,
@@ -7688,7 +8102,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7688
8102
  }
7689
8103
  );
7690
8104
  case "circle":
7691
- return /* @__PURE__ */ React14.createElement(
8105
+ return /* @__PURE__ */ React15.createElement(
7692
8106
  Circle,
7693
8107
  {
7694
8108
  key: s.id,
@@ -7703,7 +8117,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7703
8117
  );
7704
8118
  case "arrow": {
7705
8119
  const head = arrowHeadPoints(s);
7706
- return /* @__PURE__ */ React14.createElement(G, { key: s.id, opacity }, /* @__PURE__ */ React14.createElement(
8120
+ return /* @__PURE__ */ React15.createElement(G, { key: s.id, opacity }, /* @__PURE__ */ React15.createElement(
7707
8121
  SvgLine,
7708
8122
  {
7709
8123
  x1: s.from.x,
@@ -7713,7 +8127,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7713
8127
  stroke,
7714
8128
  strokeWidth
7715
8129
  }
7716
- ), /* @__PURE__ */ React14.createElement(
8130
+ ), /* @__PURE__ */ React15.createElement(
7717
8131
  Polygon,
7718
8132
  {
7719
8133
  points: head.map((p) => `${p.x},${p.y}`).join(" "),
@@ -7722,7 +8136,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7722
8136
  ));
7723
8137
  }
7724
8138
  case "path":
7725
- return /* @__PURE__ */ React14.createElement(
8139
+ return /* @__PURE__ */ React15.createElement(
7726
8140
  Path,
7727
8141
  {
7728
8142
  key: s.id,
@@ -7734,7 +8148,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7734
8148
  }
7735
8149
  );
7736
8150
  case "text":
7737
- return /* @__PURE__ */ React14.createElement(
8151
+ return /* @__PURE__ */ React15.createElement(
7738
8152
  SvgText,
7739
8153
  {
7740
8154
  key: s.id,
@@ -7747,7 +8161,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7747
8161
  s.text
7748
8162
  );
7749
8163
  case "blur":
7750
- return /* @__PURE__ */ React14.createElement(
8164
+ return /* @__PURE__ */ React15.createElement(
7751
8165
  Rect,
7752
8166
  {
7753
8167
  key: s.id,
@@ -7846,7 +8260,7 @@ function estimateBase64Bytes2(b64) {
7846
8260
  const padding = b64.endsWith("==") ? 2 : b64.endsWith("=") ? 1 : 0;
7847
8261
  return Math.floor(b64.length * 3 / 4) - padding;
7848
8262
  }
7849
- var styles10 = StyleSheet10.create({
8263
+ var styles11 = StyleSheet11.create({
7850
8264
  surface: {
7851
8265
  width: "100%",
7852
8266
  backgroundColor: "#000"
@@ -7923,14 +8337,14 @@ function ScreenshotAnnotationEditor({
7923
8337
  }) {
7924
8338
  const t = STRINGS6[useTpkLanguage()];
7925
8339
  const editorRef = useRef7(null);
7926
- const [tool, setTool] = useState11("arrow");
7927
- const [annotationStyle, setAnnotationStyle] = useState11(
8340
+ const [tool, setTool] = useState12("arrow");
8341
+ const [annotationStyle, setAnnotationStyle] = useState12(
7928
8342
  DEFAULT_STYLE
7929
8343
  );
7930
- const [textValue, setTextValue] = useState11("");
7931
- const [processing, setProcessing] = useState11(false);
7932
- const [error, setError] = useState11(null);
7933
- const handleSave = useCallback7(async () => {
8344
+ const [textValue, setTextValue] = useState12("");
8345
+ const [processing, setProcessing] = useState12(false);
8346
+ const [error, setError] = useState12(null);
8347
+ const handleSave = useCallback8(async () => {
7934
8348
  if (!editorRef.current) {
7935
8349
  setError(t.errorNotReady);
7936
8350
  return;
@@ -7950,13 +8364,13 @@ function ScreenshotAnnotationEditor({
7950
8364
  setProcessing(false);
7951
8365
  }
7952
8366
  }, [format, quality, onSave, t]);
7953
- const setColor = useCallback7((color) => {
8367
+ const setColor = useCallback8((color) => {
7954
8368
  setAnnotationStyle((cur) => ({ ...cur, color }));
7955
8369
  }, []);
7956
- const setStrokeWidth = useCallback7((strokeWidth) => {
8370
+ const setStrokeWidth = useCallback8((strokeWidth) => {
7957
8371
  setAnnotationStyle((cur) => ({ ...cur, strokeWidth }));
7958
8372
  }, []);
7959
- return /* @__PURE__ */ React15.createElement(
8373
+ return /* @__PURE__ */ React16.createElement(
7960
8374
  Modal6,
7961
8375
  {
7962
8376
  animationType: "slide",
@@ -7964,7 +8378,7 @@ function ScreenshotAnnotationEditor({
7964
8378
  transparent: false,
7965
8379
  visible
7966
8380
  },
7967
- /* @__PURE__ */ React15.createElement(View11, { style: [styles11.root, style], testID }, /* @__PURE__ */ React15.createElement(
8381
+ /* @__PURE__ */ React16.createElement(View12, { style: [styles12.root, style], testID }, /* @__PURE__ */ React16.createElement(
7968
8382
  Header2,
7969
8383
  {
7970
8384
  onCancel,
@@ -7973,7 +8387,7 @@ function ScreenshotAnnotationEditor({
7973
8387
  onClear: () => editorRef.current?.clear(),
7974
8388
  t
7975
8389
  }
7976
- ), /* @__PURE__ */ React15.createElement(
8390
+ ), /* @__PURE__ */ React16.createElement(
7977
8391
  Toolbar,
7978
8392
  {
7979
8393
  tool,
@@ -7983,17 +8397,17 @@ function ScreenshotAnnotationEditor({
7983
8397
  onStrokeWidthChange: setStrokeWidth,
7984
8398
  t
7985
8399
  }
7986
- ), tool === "text" && /* @__PURE__ */ React15.createElement(View11, { style: styles11.textInputRow }, /* @__PURE__ */ React15.createElement(
7987
- TextInput4,
8400
+ ), tool === "text" && /* @__PURE__ */ React16.createElement(View12, { style: styles12.textInputRow }, /* @__PURE__ */ React16.createElement(
8401
+ TextInput5,
7988
8402
  {
7989
8403
  autoFocus: true,
7990
8404
  placeholder: t.textPlaceholder,
7991
8405
  placeholderTextColor: "#94A3B8",
7992
- style: styles11.textInput,
8406
+ style: styles12.textInput,
7993
8407
  value: textValue,
7994
8408
  onChangeText: setTextValue
7995
8409
  }
7996
- )), /* @__PURE__ */ React15.createElement(View11, { style: styles11.canvasWrap }, /* @__PURE__ */ React15.createElement(
8410
+ )), /* @__PURE__ */ React16.createElement(View12, { style: styles12.canvasWrap }, /* @__PURE__ */ React16.createElement(
7997
8411
  TpkAnnotationOverlay,
7998
8412
  {
7999
8413
  ref: editorRef,
@@ -8004,7 +8418,7 @@ function ScreenshotAnnotationEditor({
8004
8418
  style: annotationStyle,
8005
8419
  textValue
8006
8420
  }
8007
- )), error && /* @__PURE__ */ React15.createElement(View11, { style: styles11.errorBanner }, /* @__PURE__ */ React15.createElement(Text10, { style: styles11.errorLabel }, error)), /* @__PURE__ */ React15.createElement(
8421
+ )), error && /* @__PURE__ */ React16.createElement(View12, { style: styles12.errorBanner }, /* @__PURE__ */ React16.createElement(Text11, { style: styles12.errorLabel }, error)), /* @__PURE__ */ React16.createElement(
8008
8422
  Footer2,
8009
8423
  {
8010
8424
  processing,
@@ -8022,36 +8436,36 @@ function Header2({
8022
8436
  onClear,
8023
8437
  t
8024
8438
  }) {
8025
- return /* @__PURE__ */ React15.createElement(View11, { style: [styles11.header, { paddingTop: 12 + getModalInsets().top }] }, /* @__PURE__ */ React15.createElement(
8026
- Pressable9,
8439
+ return /* @__PURE__ */ React16.createElement(View12, { style: [styles12.header, { paddingTop: 12 + getModalInsets().top }] }, /* @__PURE__ */ React16.createElement(
8440
+ Pressable10,
8027
8441
  {
8028
8442
  accessibilityRole: "button",
8029
8443
  accessibilityLabel: t.cancelA11y,
8030
8444
  disabled: processing,
8031
8445
  onPress: onCancel,
8032
- style: styles11.headerIconButton
8446
+ style: styles12.headerIconButton
8033
8447
  },
8034
- /* @__PURE__ */ React15.createElement(TpkIcon, { name: "close", size: 20, color: "#FAFAF7" })
8035
- ), /* @__PURE__ */ React15.createElement(View11, { style: styles11.headerTitleRow }, /* @__PURE__ */ React15.createElement(TpkIcon, { name: "edit_pen", size: 20, color: "#FAFAF7" }), /* @__PURE__ */ React15.createElement(Text10, { style: styles11.headerTitle }, t.title)), /* @__PURE__ */ React15.createElement(
8036
- Pressable9,
8448
+ /* @__PURE__ */ React16.createElement(TpkIcon, { name: "close", size: 20, color: "#FAFAF7" })
8449
+ ), /* @__PURE__ */ React16.createElement(View12, { style: styles12.headerTitleRow }, /* @__PURE__ */ React16.createElement(TpkIcon, { name: "edit_pen", size: 20, color: "#FAFAF7" }), /* @__PURE__ */ React16.createElement(Text11, { style: styles12.headerTitle }, t.title)), /* @__PURE__ */ React16.createElement(
8450
+ Pressable10,
8037
8451
  {
8038
8452
  accessibilityRole: "button",
8039
8453
  accessibilityLabel: t.undoA11y,
8040
8454
  disabled: processing,
8041
8455
  onPress: onUndo,
8042
- style: styles11.headerIconButton
8456
+ style: styles12.headerIconButton
8043
8457
  },
8044
- /* @__PURE__ */ React15.createElement(Text10, { style: styles11.headerIconLabel }, "\u21B6")
8045
- ), /* @__PURE__ */ React15.createElement(
8046
- Pressable9,
8458
+ /* @__PURE__ */ React16.createElement(Text11, { style: styles12.headerIconLabel }, "\u21B6")
8459
+ ), /* @__PURE__ */ React16.createElement(
8460
+ Pressable10,
8047
8461
  {
8048
8462
  accessibilityRole: "button",
8049
8463
  accessibilityLabel: t.clearA11y,
8050
8464
  disabled: processing,
8051
8465
  onPress: onClear,
8052
- style: styles11.headerIconButton
8466
+ style: styles12.headerIconButton
8053
8467
  },
8054
- /* @__PURE__ */ React15.createElement(Text10, { style: styles11.headerIconLabel }, "\u232B")
8468
+ /* @__PURE__ */ React16.createElement(Text11, { style: styles12.headerIconLabel }, "\u232B")
8055
8469
  ));
8056
8470
  }
8057
8471
  function Toolbar({
@@ -8062,17 +8476,17 @@ function Toolbar({
8062
8476
  onStrokeWidthChange,
8063
8477
  t
8064
8478
  }) {
8065
- return /* @__PURE__ */ React15.createElement(View11, { style: styles11.toolbar }, /* @__PURE__ */ React15.createElement(
8066
- ScrollView8,
8479
+ return /* @__PURE__ */ React16.createElement(View12, { style: styles12.toolbar }, /* @__PURE__ */ React16.createElement(
8480
+ ScrollView9,
8067
8481
  {
8068
8482
  horizontal: true,
8069
8483
  showsHorizontalScrollIndicator: false,
8070
- contentContainerStyle: styles11.toolbarRow
8484
+ contentContainerStyle: styles12.toolbarRow
8071
8485
  },
8072
8486
  TOOLS.map((item) => {
8073
8487
  const active = tool === item.value;
8074
- return /* @__PURE__ */ React15.createElement(
8075
- Pressable9,
8488
+ return /* @__PURE__ */ React16.createElement(
8489
+ Pressable10,
8076
8490
  {
8077
8491
  key: item.value,
8078
8492
  accessibilityRole: "radio",
@@ -8080,11 +8494,11 @@ function Toolbar({
8080
8494
  accessibilityLabel: t.tools[item.value],
8081
8495
  onPress: () => onToolChange(item.value),
8082
8496
  style: [
8083
- styles11.toolButton,
8084
- active && styles11.toolButtonActive
8497
+ styles12.toolButton,
8498
+ active && styles12.toolButtonActive
8085
8499
  ]
8086
8500
  },
8087
- /* @__PURE__ */ React15.createElement(
8501
+ /* @__PURE__ */ React16.createElement(
8088
8502
  TpkIcon,
8089
8503
  {
8090
8504
  name: item.icon,
@@ -8092,48 +8506,48 @@ function Toolbar({
8092
8506
  color: active ? "#FAFAF7" : "#94A3B8"
8093
8507
  }
8094
8508
  ),
8095
- /* @__PURE__ */ React15.createElement(
8096
- Text10,
8509
+ /* @__PURE__ */ React16.createElement(
8510
+ Text11,
8097
8511
  {
8098
8512
  style: [
8099
- styles11.toolLabel,
8100
- active && styles11.toolLabelActive
8513
+ styles12.toolLabel,
8514
+ active && styles12.toolLabelActive
8101
8515
  ]
8102
8516
  },
8103
8517
  t.tools[item.value]
8104
8518
  )
8105
8519
  );
8106
8520
  })
8107
- ), /* @__PURE__ */ React15.createElement(View11, { style: styles11.toolbarBottomRow }, /* @__PURE__ */ React15.createElement(View11, { style: styles11.swatchRow }, ANNOTATION_PALETTE.map((c) => /* @__PURE__ */ React15.createElement(
8108
- Pressable9,
8521
+ ), /* @__PURE__ */ React16.createElement(View12, { style: styles12.toolbarBottomRow }, /* @__PURE__ */ React16.createElement(View12, { style: styles12.swatchRow }, ANNOTATION_PALETTE.map((c) => /* @__PURE__ */ React16.createElement(
8522
+ Pressable10,
8109
8523
  {
8110
8524
  key: c,
8111
8525
  accessibilityRole: "button",
8112
8526
  accessibilityLabel: t.colorA11y(c),
8113
8527
  onPress: () => onColorChange(c),
8114
8528
  style: [
8115
- styles11.swatch,
8529
+ styles12.swatch,
8116
8530
  { backgroundColor: c },
8117
- annotationStyle.color === c && styles11.swatchActive
8531
+ annotationStyle.color === c && styles12.swatchActive
8118
8532
  ]
8119
8533
  }
8120
- ))), /* @__PURE__ */ React15.createElement(View11, { style: styles11.strokeRow }, STROKE_WIDTHS.map((w) => /* @__PURE__ */ React15.createElement(
8121
- Pressable9,
8534
+ ))), /* @__PURE__ */ React16.createElement(View12, { style: styles12.strokeRow }, STROKE_WIDTHS.map((w) => /* @__PURE__ */ React16.createElement(
8535
+ Pressable10,
8122
8536
  {
8123
8537
  key: w,
8124
8538
  accessibilityRole: "button",
8125
8539
  accessibilityLabel: t.strokeA11y(w),
8126
8540
  onPress: () => onStrokeWidthChange(w),
8127
8541
  style: [
8128
- styles11.strokeButton,
8129
- annotationStyle.strokeWidth === w && styles11.strokeButtonActive
8542
+ styles12.strokeButton,
8543
+ annotationStyle.strokeWidth === w && styles12.strokeButtonActive
8130
8544
  ]
8131
8545
  },
8132
- /* @__PURE__ */ React15.createElement(
8133
- View11,
8546
+ /* @__PURE__ */ React16.createElement(
8547
+ View12,
8134
8548
  {
8135
8549
  style: [
8136
- styles11.strokeIndicator,
8550
+ styles12.strokeIndicator,
8137
8551
  {
8138
8552
  height: w,
8139
8553
  backgroundColor: annotationStyle.strokeWidth === w ? "#FAFAF7" : "#94A3B8"
@@ -8149,45 +8563,45 @@ function Footer2({
8149
8563
  onSave,
8150
8564
  t
8151
8565
  }) {
8152
- return /* @__PURE__ */ React15.createElement(
8153
- View11,
8566
+ return /* @__PURE__ */ React16.createElement(
8567
+ View12,
8154
8568
  {
8155
8569
  style: [
8156
- styles11.footer,
8570
+ styles12.footer,
8157
8571
  { paddingBottom: Math.max(14, getModalInsets().bottom) }
8158
8572
  ]
8159
8573
  },
8160
- /* @__PURE__ */ React15.createElement(
8161
- Pressable9,
8574
+ /* @__PURE__ */ React16.createElement(
8575
+ Pressable10,
8162
8576
  {
8163
8577
  accessibilityRole: "button",
8164
8578
  disabled: processing,
8165
8579
  onPress: onCancel,
8166
8580
  style: ({ pressed }) => [
8167
- styles11.footerSecondary,
8581
+ styles12.footerSecondary,
8168
8582
  pressed && { opacity: 0.7 }
8169
8583
  ]
8170
8584
  },
8171
- /* @__PURE__ */ React15.createElement(Text10, { style: styles11.footerSecondaryLabel }, t.cancel)
8585
+ /* @__PURE__ */ React16.createElement(Text11, { style: styles12.footerSecondaryLabel }, t.cancel)
8172
8586
  ),
8173
- /* @__PURE__ */ React15.createElement(
8174
- Pressable9,
8587
+ /* @__PURE__ */ React16.createElement(
8588
+ Pressable10,
8175
8589
  {
8176
8590
  accessibilityRole: "button",
8177
8591
  accessibilityLabel: t.save,
8178
8592
  disabled: processing,
8179
8593
  onPress: onSave,
8180
8594
  style: ({ pressed }) => [
8181
- styles11.footerPrimary,
8182
- processing && styles11.footerPrimaryDisabled,
8595
+ styles12.footerPrimary,
8596
+ processing && styles12.footerPrimaryDisabled,
8183
8597
  pressed && { opacity: 0.85 }
8184
8598
  ]
8185
8599
  },
8186
- processing ? /* @__PURE__ */ React15.createElement(ActivityIndicator5, { color: "#FAFAF7" }) : /* @__PURE__ */ React15.createElement(Text10, { style: styles11.footerPrimaryLabel }, t.save)
8600
+ processing ? /* @__PURE__ */ React16.createElement(ActivityIndicator6, { color: "#FAFAF7" }) : /* @__PURE__ */ React16.createElement(Text11, { style: styles12.footerPrimaryLabel }, t.save)
8187
8601
  )
8188
8602
  );
8189
8603
  }
8190
- var styles11 = StyleSheet11.create({
8604
+ var styles12 = StyleSheet12.create({
8191
8605
  root: {
8192
8606
  flex: 1,
8193
8607
  backgroundColor: "#0F172A"
@@ -8200,7 +8614,7 @@ var styles11 = StyleSheet11.create({
8200
8614
  paddingTop: 12,
8201
8615
  paddingBottom: 12,
8202
8616
  backgroundColor: "#020617",
8203
- borderBottomWidth: StyleSheet11.hairlineWidth,
8617
+ borderBottomWidth: StyleSheet12.hairlineWidth,
8204
8618
  borderBottomColor: "#1F2A24"
8205
8619
  },
8206
8620
  headerIconButton: {
@@ -8232,7 +8646,7 @@ var styles11 = StyleSheet11.create({
8232
8646
  toolbar: {
8233
8647
  backgroundColor: "#020617",
8234
8648
  paddingVertical: 8,
8235
- borderBottomWidth: StyleSheet11.hairlineWidth,
8649
+ borderBottomWidth: StyleSheet12.hairlineWidth,
8236
8650
  borderBottomColor: "#1F2A24"
8237
8651
  },
8238
8652
  toolbarRow: {
@@ -8306,7 +8720,7 @@ var styles11 = StyleSheet11.create({
8306
8720
  backgroundColor: "#020617",
8307
8721
  paddingHorizontal: 12,
8308
8722
  paddingVertical: 10,
8309
- borderBottomWidth: StyleSheet11.hairlineWidth,
8723
+ borderBottomWidth: StyleSheet12.hairlineWidth,
8310
8724
  borderBottomColor: "#1F2A24"
8311
8725
  },
8312
8726
  textInput: {
@@ -8338,7 +8752,7 @@ var styles11 = StyleSheet11.create({
8338
8752
  gap: 10,
8339
8753
  padding: 14,
8340
8754
  backgroundColor: "#020617",
8341
- borderTopWidth: StyleSheet11.hairlineWidth,
8755
+ borderTopWidth: StyleSheet12.hairlineWidth,
8342
8756
  borderTopColor: "#1F2A24"
8343
8757
  },
8344
8758
  footerSecondary: {
@@ -8415,24 +8829,24 @@ async function readFileSize(uri) {
8415
8829
  }
8416
8830
 
8417
8831
  // src/VoiceBugInputSheet.tsx
8418
- import React16, {
8419
- useCallback as useCallback8,
8420
- useEffect as useEffect9,
8421
- useMemo as useMemo7,
8832
+ import React17, {
8833
+ useCallback as useCallback9,
8834
+ useEffect as useEffect10,
8835
+ useMemo as useMemo8,
8422
8836
  useRef as useRef8,
8423
- useState as useState12
8837
+ useState as useState13
8424
8838
  } from "react";
8425
8839
  import {
8426
- ActivityIndicator as ActivityIndicator6,
8840
+ ActivityIndicator as ActivityIndicator7,
8427
8841
  Animated as Animated2,
8428
8842
  Easing as Easing2,
8429
8843
  Modal as Modal7,
8430
8844
  Platform as Platform7,
8431
- Pressable as Pressable10,
8432
- ScrollView as ScrollView9,
8433
- StyleSheet as StyleSheet12,
8434
- Text as Text11,
8435
- View as View12
8845
+ Pressable as Pressable11,
8846
+ ScrollView as ScrollView10,
8847
+ StyleSheet as StyleSheet13,
8848
+ Text as Text12,
8849
+ View as View13
8436
8850
  } from "react-native";
8437
8851
 
8438
8852
  // src/voice-extract.ts
@@ -8588,23 +9002,23 @@ function VoiceBugInputSheet({
8588
9002
  testID = "tpk-voice-bug-sheet"
8589
9003
  }) {
8590
9004
  const uiLanguage = useTpkLanguage();
8591
- const S = useMemo7(
9005
+ const S = useMemo8(
8592
9006
  () => ({
8593
9007
  ...uiLanguage === "de" ? DEFAULT_STRINGS_DE : DEFAULT_STRINGS_EN,
8594
9008
  ...strings ?? {}
8595
9009
  }),
8596
9010
  [strings, uiLanguage]
8597
9011
  );
8598
- const [phase, setPhase] = useState12("idle");
8599
- const [classification, setClassification] = useState12("bug");
8600
- const [seconds, setSeconds] = useState12(0);
8601
- const [error, setError] = useState12(null);
8602
- const [result, setResult] = useState12(null);
8603
- const [quickMode, setQuickMode] = useState12(false);
8604
- const [language, setLanguage] = useState12(
9012
+ const [phase, setPhase] = useState13("idle");
9013
+ const [classification, setClassification] = useState13("bug");
9014
+ const [seconds, setSeconds] = useState13(0);
9015
+ const [error, setError] = useState13(null);
9016
+ const [result, setResult] = useState13(null);
9017
+ const [quickMode, setQuickMode] = useState13(false);
9018
+ const [language, setLanguage] = useState13(
8605
9019
  voiceLanguage ?? "auto"
8606
9020
  );
8607
- useEffect9(() => {
9021
+ useEffect10(() => {
8608
9022
  if (voiceLanguage !== void 0) {
8609
9023
  setLanguage(voiceLanguage);
8610
9024
  return;
@@ -8626,7 +9040,7 @@ function VoiceBugInputSheet({
8626
9040
  const tickerRef = useRef8(null);
8627
9041
  const meterAnim = useRef8(new Animated2.Value(0)).current;
8628
9042
  const pulseAnim = useRef8(new Animated2.Value(0)).current;
8629
- useEffect9(() => {
9043
+ useEffect10(() => {
8630
9044
  if (phase !== "recording") {
8631
9045
  pulseAnim.stopAnimation();
8632
9046
  pulseAnim.setValue(0);
@@ -8652,14 +9066,14 @@ function VoiceBugInputSheet({
8652
9066
  return () => loop.stop();
8653
9067
  }, [pulseAnim, phase]);
8654
9068
  const dimAnim = useRef8(new Animated2.Value(1)).current;
8655
- useEffect9(() => {
9069
+ useEffect10(() => {
8656
9070
  Animated2.timing(dimAnim, {
8657
9071
  toValue: phase === "recording" ? 0.1 : 1,
8658
9072
  duration: 200,
8659
9073
  useNativeDriver: true
8660
9074
  }).start();
8661
9075
  }, [dimAnim, phase]);
8662
- useEffect9(() => {
9076
+ useEffect10(() => {
8663
9077
  if (visible) {
8664
9078
  setPhase("idle");
8665
9079
  setClassification("bug");
@@ -8675,12 +9089,12 @@ function VoiceBugInputSheet({
8675
9089
  }
8676
9090
  }
8677
9091
  }, [visible]);
8678
- useEffect9(() => {
9092
+ useEffect10(() => {
8679
9093
  if (phase === "recording" && seconds >= maxSeconds) {
8680
9094
  void stop();
8681
9095
  }
8682
9096
  }, [phase, seconds, maxSeconds]);
8683
- const start = useCallback8(async () => {
9097
+ const start = useCallback9(async () => {
8684
9098
  setError(null);
8685
9099
  setSeconds(0);
8686
9100
  meterAnim.setValue(0);
@@ -8699,7 +9113,7 @@ function VoiceBugInputSheet({
8699
9113
  );
8700
9114
  }
8701
9115
  }, [meterAnim]);
8702
- const stop = useCallback8(async () => {
9116
+ const stop = useCallback9(async () => {
8703
9117
  if (phase !== "recording") return;
8704
9118
  if (tickerRef.current) {
8705
9119
  clearInterval(tickerRef.current);
@@ -8735,7 +9149,7 @@ function VoiceBugInputSheet({
8735
9149
  );
8736
9150
  }
8737
9151
  }, [phase, tpk, language, meterAnim]);
8738
- const cancel = useCallback8(async () => {
9152
+ const cancel = useCallback9(async () => {
8739
9153
  if (tickerRef.current) {
8740
9154
  clearInterval(tickerRef.current);
8741
9155
  tickerRef.current = null;
@@ -8744,7 +9158,7 @@ function VoiceBugInputSheet({
8744
9158
  recorderRef.current = null;
8745
9159
  onCancel();
8746
9160
  }, [onCancel]);
8747
- const runQuick = useCallback8(
9161
+ const runQuick = useCallback9(
8748
9162
  async (action) => {
8749
9163
  if (phase !== "idle" || !captureScreen) return;
8750
9164
  setQuickMode(true);
@@ -8770,17 +9184,17 @@ function VoiceBugInputSheet({
8770
9184
  },
8771
9185
  [phase, captureScreen, tpk, currentScreen, language, S]
8772
9186
  );
8773
- const useResult = useCallback8(() => {
9187
+ const useResult = useCallback9(() => {
8774
9188
  if (result) onExtracted(result, classification);
8775
9189
  }, [result, classification, onExtracted]);
8776
- const retryFresh = useCallback8(() => {
9190
+ const retryFresh = useCallback9(() => {
8777
9191
  setQuickMode(false);
8778
9192
  setResult(null);
8779
9193
  setSeconds(0);
8780
9194
  setError(null);
8781
9195
  setPhase("idle");
8782
9196
  }, []);
8783
- const headline = useMemo7(() => {
9197
+ const headline = useMemo8(() => {
8784
9198
  switch (phase) {
8785
9199
  case "idle":
8786
9200
  return S.idleHeadline;
@@ -8794,7 +9208,7 @@ function VoiceBugInputSheet({
8794
9208
  return S.errorHeadline;
8795
9209
  }
8796
9210
  }, [phase, S]);
8797
- const description = useMemo7(() => {
9211
+ const description = useMemo8(() => {
8798
9212
  switch (phase) {
8799
9213
  case "idle":
8800
9214
  return S.idleDescription;
@@ -8808,7 +9222,7 @@ function VoiceBugInputSheet({
8808
9222
  return error ?? S.errorDescriptionFallback;
8809
9223
  }
8810
9224
  }, [phase, error, S, quickMode]);
8811
- const classificationLabel = useCallback8(
9225
+ const classificationLabel = useCallback9(
8812
9226
  (c) => {
8813
9227
  switch (c) {
8814
9228
  case "bug":
@@ -8823,7 +9237,7 @@ function VoiceBugInputSheet({
8823
9237
  },
8824
9238
  [S]
8825
9239
  );
8826
- const languageLabel = useCallback8(
9240
+ const languageLabel = useCallback9(
8827
9241
  (l, s) => {
8828
9242
  if (l === "auto") return s.languagePickerLabel;
8829
9243
  return l.toUpperCase();
@@ -8842,9 +9256,11 @@ function VoiceBugInputSheet({
8842
9256
  const isExtracted = phase === "extracted";
8843
9257
  const isError = phase === "error";
8844
9258
  const opacity = Math.max(0, Math.min(1, sheetOpacity));
8845
- const backdropOverride = { backgroundColor: `rgba(0,0,0,${0.55 * opacity})` };
8846
- const sheetOverride = { backgroundColor: `rgba(17,24,39,${opacity})` };
8847
- return /* @__PURE__ */ React16.createElement(
9259
+ const backdropAlpha = isRecording ? 0.08 : 0.55 * opacity;
9260
+ const sheetAlpha = isRecording ? 0.15 : opacity;
9261
+ const backdropOverride = { backgroundColor: `rgba(0,0,0,${backdropAlpha})` };
9262
+ const sheetOverride = { backgroundColor: `rgba(17,24,39,${sheetAlpha})` };
9263
+ return /* @__PURE__ */ React17.createElement(
8848
9264
  Modal7,
8849
9265
  {
8850
9266
  animationType: "slide",
@@ -8852,23 +9268,23 @@ function VoiceBugInputSheet({
8852
9268
  transparent: true,
8853
9269
  visible
8854
9270
  },
8855
- /* @__PURE__ */ React16.createElement(View12, { style: [styles12.backdrop, backdropOverride, style], testID }, /* @__PURE__ */ React16.createElement(
8856
- Pressable10,
9271
+ /* @__PURE__ */ React17.createElement(View13, { style: [styles13.backdrop, backdropOverride, style], testID }, /* @__PURE__ */ React17.createElement(
9272
+ Pressable11,
8857
9273
  {
8858
9274
  accessibilityRole: "button",
8859
9275
  accessibilityLabel: S.cancel,
8860
9276
  disabled: isUploading,
8861
9277
  onPress: () => void cancel(),
8862
- style: styles12.backdropSpacer
9278
+ style: styles13.backdropSpacer
8863
9279
  }
8864
- ), /* @__PURE__ */ React16.createElement(View12, { style: [styles12.sheet, sheetOverride] }, /* @__PURE__ */ React16.createElement(View12, { style: styles12.grabber }), /* @__PURE__ */ React16.createElement(
9280
+ ), /* @__PURE__ */ React17.createElement(View13, { style: [styles13.sheet, sheetOverride] }, /* @__PURE__ */ React17.createElement(View13, { style: styles13.grabber }), /* @__PURE__ */ React17.createElement(
8865
9281
  Animated2.View,
8866
9282
  {
8867
- style: [styles12.dimmable, { opacity: dimAnim }],
9283
+ style: [styles13.dimmable, { opacity: dimAnim }],
8868
9284
  pointerEvents: isRecording ? "none" : "auto"
8869
9285
  },
8870
- /* @__PURE__ */ React16.createElement(View12, { style: styles12.languagePickerRow }, /* @__PURE__ */ React16.createElement(
8871
- Pressable10,
9286
+ /* @__PURE__ */ React17.createElement(View13, { style: styles13.languagePickerRow }, /* @__PURE__ */ React17.createElement(
9287
+ Pressable11,
8872
9288
  {
8873
9289
  accessibilityRole: "button",
8874
9290
  accessibilityLabel: `Current language: ${languageLabel(language, S)}. Tap to change.`,
@@ -8878,22 +9294,22 @@ function VoiceBugInputSheet({
8878
9294
  (cur) => cur === "auto" ? "de" : cur === "de" ? "en" : "auto"
8879
9295
  );
8880
9296
  },
8881
- style: [styles12.languageChip, !isIdle && { opacity: 0.5 }]
9297
+ style: [styles13.languageChip, !isIdle && { opacity: 0.5 }]
8882
9298
  },
8883
- /* @__PURE__ */ React16.createElement(TpkIcon, { name: "language", size: 14, color: "#475569" }),
8884
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.languageChipLabel }, languageLabel(language, S))
9299
+ /* @__PURE__ */ React17.createElement(TpkIcon, { name: "language", size: 14, color: "#475569" }),
9300
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.languageChipLabel }, languageLabel(language, S))
8885
9301
  )),
8886
- /* @__PURE__ */ React16.createElement(
8887
- ScrollView9,
9302
+ /* @__PURE__ */ React17.createElement(
9303
+ ScrollView10,
8888
9304
  {
8889
9305
  horizontal: true,
8890
9306
  showsHorizontalScrollIndicator: false,
8891
- contentContainerStyle: styles12.classificationRow
9307
+ contentContainerStyle: styles13.classificationRow
8892
9308
  },
8893
9309
  CLASSIFICATIONS.map((c) => {
8894
9310
  const active = classification === c;
8895
- return /* @__PURE__ */ React16.createElement(
8896
- Pressable10,
9311
+ return /* @__PURE__ */ React17.createElement(
9312
+ Pressable11,
8897
9313
  {
8898
9314
  key: c,
8899
9315
  accessibilityRole: "radio",
@@ -8902,7 +9318,7 @@ function VoiceBugInputSheet({
8902
9318
  disabled: !isIdle,
8903
9319
  onPress: () => setClassification(c),
8904
9320
  style: [
8905
- styles12.classificationChip,
9321
+ styles13.classificationChip,
8906
9322
  active && {
8907
9323
  backgroundColor: accentColor,
8908
9324
  borderColor: accentColor
@@ -8910,7 +9326,7 @@ function VoiceBugInputSheet({
8910
9326
  !isIdle && { opacity: 0.5 }
8911
9327
  ]
8912
9328
  },
8913
- active && /* @__PURE__ */ React16.createElement(
9329
+ active && /* @__PURE__ */ React17.createElement(
8914
9330
  TpkIcon,
8915
9331
  {
8916
9332
  name: "check",
@@ -8919,12 +9335,12 @@ function VoiceBugInputSheet({
8919
9335
  style: { marginRight: 4 }
8920
9336
  }
8921
9337
  ),
8922
- /* @__PURE__ */ React16.createElement(
8923
- Text11,
9338
+ /* @__PURE__ */ React17.createElement(
9339
+ Text12,
8924
9340
  {
8925
9341
  style: [
8926
- styles12.classificationChipLabel,
8927
- active && styles12.classificationChipLabelActive
9342
+ styles13.classificationChipLabel,
9343
+ active && styles13.classificationChipLabelActive
8928
9344
  ]
8929
9345
  },
8930
9346
  classificationLabel(c)
@@ -8932,13 +9348,13 @@ function VoiceBugInputSheet({
8932
9348
  );
8933
9349
  })
8934
9350
  ),
8935
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.headline }, headline),
8936
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.description }, description)
8937
- ), isRecording && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Text11, { style: [styles12.timer, { color: accentColor }] }, formatTime(seconds)), /* @__PURE__ */ React16.createElement(View12, { style: styles12.meterTrack }, /* @__PURE__ */ React16.createElement(
9351
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.headline }, headline),
9352
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.description }, description)
9353
+ ), isRecording && /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(Text12, { style: [styles13.timer, { color: accentColor }] }, formatTime(seconds)), /* @__PURE__ */ React17.createElement(View13, { style: styles13.meterTrack }, /* @__PURE__ */ React17.createElement(
8938
9354
  Animated2.View,
8939
9355
  {
8940
9356
  style: [
8941
- styles12.meterFill,
9357
+ styles13.meterFill,
8942
9358
  {
8943
9359
  backgroundColor: accentColor,
8944
9360
  transform: [
@@ -8952,38 +9368,38 @@ function VoiceBugInputSheet({
8952
9368
  }
8953
9369
  ]
8954
9370
  }
8955
- ))), isExtracted && result && /* @__PURE__ */ React16.createElement(
8956
- ScrollView9,
9371
+ ))), isExtracted && result && /* @__PURE__ */ React17.createElement(
9372
+ ScrollView10,
8957
9373
  {
8958
- style: styles12.extractedScroll,
8959
- contentContainerStyle: styles12.extractedScrollContent
9374
+ style: styles13.extractedScroll,
9375
+ contentContainerStyle: styles13.extractedScrollContent
8960
9376
  },
8961
- quickMode ? null : /* @__PURE__ */ React16.createElement(View12, { style: styles12.transcriptCard }, /* @__PURE__ */ React16.createElement(Text11, { style: styles12.transcriptLabel }, "Transcript"), /* @__PURE__ */ React16.createElement(Text11, { style: styles12.transcriptText }, result.transcript || "(empty)")),
8962
- /* @__PURE__ */ React16.createElement(ExtractField, { label: "Title", value: result.title }),
8963
- /* @__PURE__ */ React16.createElement(
9377
+ quickMode ? null : /* @__PURE__ */ React17.createElement(View13, { style: styles13.transcriptCard }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.transcriptLabel }, "Transcript"), /* @__PURE__ */ React17.createElement(Text12, { style: styles13.transcriptText }, result.transcript || "(empty)")),
9378
+ /* @__PURE__ */ React17.createElement(ExtractField, { label: "Title", value: result.title }),
9379
+ /* @__PURE__ */ React17.createElement(
8964
9380
  ExtractField,
8965
9381
  {
8966
9382
  label: "Description",
8967
9383
  value: result.description
8968
9384
  }
8969
9385
  ),
8970
- /* @__PURE__ */ React16.createElement(
9386
+ /* @__PURE__ */ React17.createElement(
8971
9387
  ExtractField,
8972
9388
  {
8973
9389
  label: "Expected",
8974
9390
  value: result.expectedBehavior
8975
9391
  }
8976
9392
  ),
8977
- /* @__PURE__ */ React16.createElement(
9393
+ /* @__PURE__ */ React17.createElement(
8978
9394
  ExtractField,
8979
9395
  {
8980
9396
  label: "Actual",
8981
9397
  value: result.actualBehavior
8982
9398
  }
8983
9399
  ),
8984
- /* @__PURE__ */ React16.createElement(ExtractField, { label: "Frequency", value: result.frequency })
8985
- ), isIdle && captureScreen ? /* @__PURE__ */ React16.createElement(View12, { style: styles12.quickBlock }, /* @__PURE__ */ React16.createElement(Text11, { style: styles12.quickHint }, S.quickHint), /* @__PURE__ */ React16.createElement(View12, { style: styles12.quickGrid }, QUICK_ACTIONS.map((a) => /* @__PURE__ */ React16.createElement(
8986
- Pressable10,
9400
+ /* @__PURE__ */ React17.createElement(ExtractField, { label: "Frequency", value: result.frequency })
9401
+ ), isIdle && captureScreen ? /* @__PURE__ */ React17.createElement(View13, { style: styles13.quickBlock }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.quickHint }, S.quickHint), /* @__PURE__ */ React17.createElement(View13, { style: styles13.quickGrid }, QUICK_ACTIONS.map((a) => /* @__PURE__ */ React17.createElement(
9402
+ Pressable11,
8987
9403
  {
8988
9404
  key: a.kind,
8989
9405
  accessibilityRole: "button",
@@ -8991,29 +9407,29 @@ function VoiceBugInputSheet({
8991
9407
  testID: `tpk-quick-${a.kind}`,
8992
9408
  onPress: () => void runQuick(a),
8993
9409
  style: ({ pressed }) => [
8994
- styles12.quickButton,
9410
+ styles13.quickButton,
8995
9411
  pressed && { opacity: 0.8 }
8996
9412
  ]
8997
9413
  },
8998
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.quickEmoji }, a.emoji),
8999
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.quickLabel }, S[a.label])
9000
- )))) : null, /* @__PURE__ */ React16.createElement(View12, { style: styles12.primaryRow }, isIdle && /* @__PURE__ */ React16.createElement(
9001
- Pressable10,
9414
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.quickEmoji }, a.emoji),
9415
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.quickLabel }, S[a.label])
9416
+ )))) : null, /* @__PURE__ */ React17.createElement(View13, { style: styles13.primaryRow }, isIdle && /* @__PURE__ */ React17.createElement(
9417
+ Pressable11,
9002
9418
  {
9003
9419
  accessibilityRole: "button",
9004
9420
  accessibilityLabel: "Start recording",
9005
9421
  onPress: () => void start(),
9006
9422
  style: [
9007
- styles12.micButton,
9423
+ styles13.micButton,
9008
9424
  { backgroundColor: accentColor, shadowColor: accentColor }
9009
9425
  ]
9010
9426
  },
9011
- /* @__PURE__ */ React16.createElement(TpkIcon, { name: "voice", size: 42, color: "#FFFFFF" })
9012
- ), isRecording && /* @__PURE__ */ React16.createElement(
9427
+ /* @__PURE__ */ React17.createElement(TpkIcon, { name: "voice", size: 42, color: "#FFFFFF" })
9428
+ ), isRecording && /* @__PURE__ */ React17.createElement(
9013
9429
  Animated2.View,
9014
9430
  {
9015
9431
  style: [
9016
- styles12.micButton,
9432
+ styles13.micButton,
9017
9433
  {
9018
9434
  backgroundColor: accentColor,
9019
9435
  shadowColor: accentColor,
@@ -9021,49 +9437,49 @@ function VoiceBugInputSheet({
9021
9437
  }
9022
9438
  ]
9023
9439
  },
9024
- /* @__PURE__ */ React16.createElement(
9025
- Pressable10,
9440
+ /* @__PURE__ */ React17.createElement(
9441
+ Pressable11,
9026
9442
  {
9027
9443
  accessibilityRole: "button",
9028
9444
  accessibilityLabel: "Stop recording",
9029
9445
  onPress: () => void stop(),
9030
- style: styles12.micPressable
9446
+ style: styles13.micPressable
9031
9447
  },
9032
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.micButtonStop }, "\u25A0")
9448
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.micButtonStop }, "\u25A0")
9033
9449
  )
9034
- ), isUploading && /* @__PURE__ */ React16.createElement(View12, { style: styles12.spinnerSlot }, /* @__PURE__ */ React16.createElement(ActivityIndicator6, { size: "large", color: accentColor })), (isExtracted || isError) && /* @__PURE__ */ React16.createElement(View12, { style: styles12.actionsRow }, /* @__PURE__ */ React16.createElement(
9035
- Pressable10,
9450
+ ), isUploading && /* @__PURE__ */ React17.createElement(View13, { style: styles13.spinnerSlot }, /* @__PURE__ */ React17.createElement(ActivityIndicator7, { size: "large", color: accentColor })), (isExtracted || isError) && /* @__PURE__ */ React17.createElement(View13, { style: styles13.actionsRow }, /* @__PURE__ */ React17.createElement(
9451
+ Pressable11,
9036
9452
  {
9037
9453
  accessibilityRole: "button",
9038
9454
  onPress: retryFresh,
9039
9455
  style: ({ pressed }) => [
9040
- styles12.secondaryButton,
9456
+ styles13.secondaryButton,
9041
9457
  pressed && { opacity: 0.85 }
9042
9458
  ]
9043
9459
  },
9044
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.secondaryButtonLabel }, quickMode ? S.back : isError ? S.retry : S.rerecord)
9045
- ), isExtracted && /* @__PURE__ */ React16.createElement(
9046
- Pressable10,
9460
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.secondaryButtonLabel }, quickMode ? S.back : isError ? S.retry : S.rerecord)
9461
+ ), isExtracted && /* @__PURE__ */ React17.createElement(
9462
+ Pressable11,
9047
9463
  {
9048
9464
  accessibilityRole: "button",
9049
9465
  accessibilityLabel: S.useExtracted,
9050
9466
  onPress: useResult,
9051
9467
  style: ({ pressed }) => [
9052
- styles12.primaryButton,
9468
+ styles13.primaryButton,
9053
9469
  { backgroundColor: accentColor },
9054
9470
  pressed && { opacity: 0.85 }
9055
9471
  ]
9056
9472
  },
9057
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.primaryButtonLabel }, S.useExtracted)
9058
- ))), /* @__PURE__ */ React16.createElement(
9059
- Pressable10,
9473
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.primaryButtonLabel }, S.useExtracted)
9474
+ ))), /* @__PURE__ */ React17.createElement(
9475
+ Pressable11,
9060
9476
  {
9061
9477
  accessibilityRole: "button",
9062
9478
  disabled: isUploading,
9063
9479
  onPress: () => void cancel(),
9064
- style: styles12.cancelButton
9480
+ style: styles13.cancelButton
9065
9481
  },
9066
- /* @__PURE__ */ React16.createElement(Text11, { style: [styles12.cancelLabel, { color: accentColor }] }, S.cancel)
9482
+ /* @__PURE__ */ React17.createElement(Text12, { style: [styles13.cancelLabel, { color: accentColor }] }, S.cancel)
9067
9483
  )))
9068
9484
  );
9069
9485
  }
@@ -9071,7 +9487,7 @@ function ExtractField({
9071
9487
  label,
9072
9488
  value
9073
9489
  }) {
9074
- return /* @__PURE__ */ React16.createElement(View12, { style: styles12.extractRow }, /* @__PURE__ */ React16.createElement(Text11, { style: styles12.extractLabel }, label), /* @__PURE__ */ React16.createElement(Text11, { style: styles12.extractValue }, value || "\u2014"));
9490
+ return /* @__PURE__ */ React17.createElement(View13, { style: styles13.extractRow }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.extractLabel }, label), /* @__PURE__ */ React17.createElement(Text12, { style: styles13.extractValue }, value || "\u2014"));
9075
9491
  }
9076
9492
  async function startRecording(opts = {}) {
9077
9493
  if (Platform7.OS === "web") return startWebRecording(opts);
@@ -9250,7 +9666,7 @@ function formatTime(seconds) {
9250
9666
  const s = (seconds % 60).toString().padStart(2, "0");
9251
9667
  return `${m}:${s}`;
9252
9668
  }
9253
- var styles12 = StyleSheet12.create({
9669
+ var styles13 = StyleSheet13.create({
9254
9670
  backdrop: {
9255
9671
  flex: 1,
9256
9672
  backgroundColor: "rgba(0,0,0,0.55)",
@@ -9498,7 +9914,7 @@ var styles12 = StyleSheet12.create({
9498
9914
  },
9499
9915
  extractRow: {
9500
9916
  paddingVertical: 8,
9501
- borderBottomWidth: StyleSheet12.hairlineWidth,
9917
+ borderBottomWidth: StyleSheet13.hairlineWidth,
9502
9918
  borderBottomColor: "rgba(255,255,255,0.1)"
9503
9919
  },
9504
9920
  extractLabel: {
@@ -9517,17 +9933,17 @@ var styles12 = StyleSheet12.create({
9517
9933
  });
9518
9934
 
9519
9935
  // src/SessionEndDialog.tsx
9520
- import React17, { useCallback as useCallback9, useEffect as useEffect10, useMemo as useMemo8, useState as useState13 } from "react";
9936
+ import React18, { useCallback as useCallback10, useEffect as useEffect11, useMemo as useMemo9, useState as useState14 } from "react";
9521
9937
  import {
9522
- ActivityIndicator as ActivityIndicator7,
9938
+ ActivityIndicator as ActivityIndicator8,
9523
9939
  Modal as Modal8,
9524
- Pressable as Pressable11,
9525
- ScrollView as ScrollView10,
9526
- StyleSheet as StyleSheet13,
9940
+ Pressable as Pressable12,
9941
+ ScrollView as ScrollView11,
9942
+ StyleSheet as StyleSheet14,
9527
9943
  Switch as Switch2,
9528
- Text as Text12,
9529
- TextInput as TextInput5,
9530
- View as View13
9944
+ Text as Text13,
9945
+ TextInput as TextInput6,
9946
+ View as View14
9531
9947
  } from "react-native";
9532
9948
  var ISSUE_KEYS = ["bugs", "crashes", "performance", "ui"];
9533
9949
  var ISSUE_LABELS = {
@@ -9610,24 +10026,24 @@ function SessionEndDialog({
9610
10026
  style
9611
10027
  }) {
9612
10028
  const t = STRINGS7[useTpkLanguage()];
9613
- const [ratings, setRatings] = useState13({
10029
+ const [ratings, setRatings] = useState14({
9614
10030
  overall: 3,
9615
10031
  stability: 3,
9616
10032
  usability: 3,
9617
10033
  experience: 3
9618
10034
  });
9619
- const [issues, setIssues] = useState13({
10035
+ const [issues, setIssues] = useState14({
9620
10036
  bugs: false,
9621
10037
  crashes: false,
9622
10038
  performance: false,
9623
10039
  ui: false
9624
10040
  });
9625
- const [positive, setPositive] = useState13("");
9626
- const [negative, setNegative] = useState13("");
9627
- const [suggestions, setSuggestions] = useState13("");
9628
- const [submitting, setSubmitting] = useState13(false);
9629
- const [error, setError] = useState13(null);
9630
- useEffect10(() => {
10041
+ const [positive, setPositive] = useState14("");
10042
+ const [negative, setNegative] = useState14("");
10043
+ const [suggestions, setSuggestions] = useState14("");
10044
+ const [submitting, setSubmitting] = useState14(false);
10045
+ const [error, setError] = useState14(null);
10046
+ useEffect11(() => {
9631
10047
  if (visible) {
9632
10048
  setRatings({ overall: 3, stability: 3, usability: 3, experience: 3 });
9633
10049
  setIssues({ bugs: false, crashes: false, performance: false, ui: false });
@@ -9637,13 +10053,13 @@ function SessionEndDialog({
9637
10053
  setError(null);
9638
10054
  }
9639
10055
  }, [visible]);
9640
- const hasFeedback = useMemo8(() => {
10056
+ const hasFeedback = useMemo9(() => {
9641
10057
  if (positive.trim() || negative.trim() || suggestions.trim()) return true;
9642
10058
  if (Object.values(issues).some(Boolean)) return true;
9643
10059
  if (Object.values(ratings).some((r) => r !== 3)) return true;
9644
10060
  return false;
9645
10061
  }, [positive, negative, suggestions, issues, ratings]);
9646
- const submit = useCallback9(async () => {
10062
+ const submit = useCallback10(async () => {
9647
10063
  if (!tpk) return;
9648
10064
  setSubmitting(true);
9649
10065
  setError(null);
@@ -9699,7 +10115,7 @@ function SessionEndDialog({
9699
10115
  onError,
9700
10116
  t
9701
10117
  ]);
9702
- return /* @__PURE__ */ React17.createElement(
10118
+ return /* @__PURE__ */ React18.createElement(
9703
10119
  Modal8,
9704
10120
  {
9705
10121
  animationType: "slide",
@@ -9707,33 +10123,33 @@ function SessionEndDialog({
9707
10123
  transparent: false,
9708
10124
  visible
9709
10125
  },
9710
- /* @__PURE__ */ React17.createElement(View13, { style: [styles13.root, style] }, /* @__PURE__ */ React17.createElement(
9711
- View13,
10126
+ /* @__PURE__ */ React18.createElement(View14, { style: [styles14.root, style] }, /* @__PURE__ */ React18.createElement(
10127
+ View14,
9712
10128
  {
9713
- style: [styles13.header, { paddingTop: 12 + getModalInsets().top }]
10129
+ style: [styles14.header, { paddingTop: 12 + getModalInsets().top }]
9714
10130
  },
9715
- /* @__PURE__ */ React17.createElement(
9716
- Pressable11,
10131
+ /* @__PURE__ */ React18.createElement(
10132
+ Pressable12,
9717
10133
  {
9718
10134
  accessibilityRole: "button",
9719
10135
  accessibilityLabel: t.cancel,
9720
10136
  disabled: submitting,
9721
10137
  onPress: onClose,
9722
- style: styles13.headerClose
10138
+ style: styles14.headerClose
9723
10139
  },
9724
- /* @__PURE__ */ React17.createElement(Text12, { style: styles13.headerCloseLabel }, "\xD7")
10140
+ /* @__PURE__ */ React18.createElement(Text13, { style: styles14.headerCloseLabel }, "\xD7")
9725
10141
  ),
9726
- /* @__PURE__ */ React17.createElement(Text12, { style: styles13.headerTitle }, t.title),
9727
- /* @__PURE__ */ React17.createElement(View13, { style: { width: 36 } })
9728
- ), /* @__PURE__ */ React17.createElement(
9729
- ScrollView10,
10142
+ /* @__PURE__ */ React18.createElement(Text13, { style: styles14.headerTitle }, t.title),
10143
+ /* @__PURE__ */ React18.createElement(View14, { style: { width: 36 } })
10144
+ ), /* @__PURE__ */ React18.createElement(
10145
+ ScrollView11,
9730
10146
  {
9731
- contentContainerStyle: styles13.body,
10147
+ contentContainerStyle: styles14.body,
9732
10148
  keyboardShouldPersistTaps: "handled"
9733
10149
  },
9734
- /* @__PURE__ */ React17.createElement(StatsSection, { stats, t }),
9735
- /* @__PURE__ */ React17.createElement(SectionLabel, { text: t.howWasIt }),
9736
- RATING_KEYS.map((k) => /* @__PURE__ */ React17.createElement(
10150
+ /* @__PURE__ */ React18.createElement(StatsSection, { stats, t }),
10151
+ /* @__PURE__ */ React18.createElement(SectionLabel, { text: t.howWasIt }),
10152
+ RATING_KEYS.map((k) => /* @__PURE__ */ React18.createElement(
9737
10153
  RatingRow,
9738
10154
  {
9739
10155
  key: k,
@@ -9743,8 +10159,8 @@ function SessionEndDialog({
9743
10159
  onChange: (v) => setRatings((cur) => ({ ...cur, [k]: v }))
9744
10160
  }
9745
10161
  )),
9746
- /* @__PURE__ */ React17.createElement(SectionLabel, { text: t.didYouEncounter }),
9747
- ISSUE_KEYS.map((k) => /* @__PURE__ */ React17.createElement(
10162
+ /* @__PURE__ */ React18.createElement(SectionLabel, { text: t.didYouEncounter }),
10163
+ ISSUE_KEYS.map((k) => /* @__PURE__ */ React18.createElement(
9748
10164
  IssueRow,
9749
10165
  {
9750
10166
  key: k,
@@ -9753,78 +10169,78 @@ function SessionEndDialog({
9753
10169
  onChange: (v) => setIssues((cur) => ({ ...cur, [k]: v }))
9754
10170
  }
9755
10171
  )),
9756
- /* @__PURE__ */ React17.createElement(SectionLabel, { text: t.comments }),
9757
- /* @__PURE__ */ React17.createElement(FieldLabel2, { text: t.positiveLabel }),
9758
- /* @__PURE__ */ React17.createElement(
9759
- TextInput5,
10172
+ /* @__PURE__ */ React18.createElement(SectionLabel, { text: t.comments }),
10173
+ /* @__PURE__ */ React18.createElement(FieldLabel2, { text: t.positiveLabel }),
10174
+ /* @__PURE__ */ React18.createElement(
10175
+ TextInput6,
9760
10176
  {
9761
10177
  multiline: true,
9762
10178
  onChangeText: setPositive,
9763
10179
  placeholder: t.positivePlaceholder,
9764
- style: [styles13.input, styles13.textarea],
10180
+ style: [styles14.input, styles14.textarea],
9765
10181
  textAlignVertical: "top",
9766
10182
  value: positive
9767
10183
  }
9768
10184
  ),
9769
- /* @__PURE__ */ React17.createElement(FieldLabel2, { text: t.negativeLabel }),
9770
- /* @__PURE__ */ React17.createElement(
9771
- TextInput5,
10185
+ /* @__PURE__ */ React18.createElement(FieldLabel2, { text: t.negativeLabel }),
10186
+ /* @__PURE__ */ React18.createElement(
10187
+ TextInput6,
9772
10188
  {
9773
10189
  multiline: true,
9774
10190
  onChangeText: setNegative,
9775
10191
  placeholder: t.negativePlaceholder,
9776
- style: [styles13.input, styles13.textarea],
10192
+ style: [styles14.input, styles14.textarea],
9777
10193
  textAlignVertical: "top",
9778
10194
  value: negative
9779
10195
  }
9780
10196
  ),
9781
- /* @__PURE__ */ React17.createElement(FieldLabel2, { text: t.suggestionsLabel }),
9782
- /* @__PURE__ */ React17.createElement(
9783
- TextInput5,
10197
+ /* @__PURE__ */ React18.createElement(FieldLabel2, { text: t.suggestionsLabel }),
10198
+ /* @__PURE__ */ React18.createElement(
10199
+ TextInput6,
9784
10200
  {
9785
10201
  multiline: true,
9786
10202
  onChangeText: setSuggestions,
9787
10203
  placeholder: t.suggestionsPlaceholder,
9788
- style: [styles13.input, styles13.textarea],
10204
+ style: [styles14.input, styles14.textarea],
9789
10205
  textAlignVertical: "top",
9790
10206
  value: suggestions
9791
10207
  }
9792
10208
  ),
9793
- error && /* @__PURE__ */ React17.createElement(View13, { style: styles13.errorBox }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.errorLabel }, error))
9794
- ), /* @__PURE__ */ React17.createElement(
9795
- View13,
10209
+ error && /* @__PURE__ */ React18.createElement(View14, { style: styles14.errorBox }, /* @__PURE__ */ React18.createElement(Text13, { style: styles14.errorLabel }, error))
10210
+ ), /* @__PURE__ */ React18.createElement(
10211
+ View14,
9796
10212
  {
9797
10213
  style: [
9798
- styles13.footer,
10214
+ styles14.footer,
9799
10215
  { paddingBottom: Math.max(14, getModalInsets().bottom) }
9800
10216
  ]
9801
10217
  },
9802
- /* @__PURE__ */ React17.createElement(
9803
- Pressable11,
10218
+ /* @__PURE__ */ React18.createElement(
10219
+ Pressable12,
9804
10220
  {
9805
10221
  accessibilityRole: "button",
9806
10222
  disabled: submitting,
9807
10223
  onPress: onClose,
9808
10224
  style: ({ pressed }) => [
9809
- styles13.cancelButton,
10225
+ styles14.cancelButton,
9810
10226
  pressed && { opacity: 0.7 }
9811
10227
  ]
9812
10228
  },
9813
- /* @__PURE__ */ React17.createElement(Text12, { style: styles13.cancelLabel }, t.cancel)
10229
+ /* @__PURE__ */ React18.createElement(Text13, { style: styles14.cancelLabel }, t.cancel)
9814
10230
  ),
9815
- /* @__PURE__ */ React17.createElement(
9816
- Pressable11,
10231
+ /* @__PURE__ */ React18.createElement(
10232
+ Pressable12,
9817
10233
  {
9818
10234
  accessibilityRole: "button",
9819
10235
  disabled: !tpk || submitting,
9820
10236
  onPress: () => void submit(),
9821
10237
  style: ({ pressed }) => [
9822
- styles13.endButton,
9823
- (!tpk || submitting) && styles13.endButtonDisabled,
10238
+ styles14.endButton,
10239
+ (!tpk || submitting) && styles14.endButtonDisabled,
9824
10240
  pressed && { opacity: 0.85 }
9825
10241
  ]
9826
10242
  },
9827
- submitting ? /* @__PURE__ */ React17.createElement(ActivityIndicator7, { color: "#FAFAF7" }) : /* @__PURE__ */ React17.createElement(Text12, { style: styles13.endLabel }, t.endSession)
10243
+ submitting ? /* @__PURE__ */ React18.createElement(ActivityIndicator8, { color: "#FAFAF7" }) : /* @__PURE__ */ React18.createElement(Text13, { style: styles14.endLabel }, t.endSession)
9828
10244
  )
9829
10245
  ))
9830
10246
  );
@@ -9834,19 +10250,19 @@ function StatsSection({
9834
10250
  t
9835
10251
  }) {
9836
10252
  const duration = stats?.durationSeconds ?? 0;
9837
- return /* @__PURE__ */ React17.createElement(View13, { style: styles13.statsGrid }, /* @__PURE__ */ React17.createElement(StatTile, { label: t.statDuration, value: formatDuration(duration) }), /* @__PURE__ */ React17.createElement(
10253
+ return /* @__PURE__ */ React18.createElement(View14, { style: styles14.statsGrid }, /* @__PURE__ */ React18.createElement(StatTile, { label: t.statDuration, value: formatDuration(duration) }), /* @__PURE__ */ React18.createElement(
9838
10254
  StatTile,
9839
10255
  {
9840
10256
  label: t.statScreens,
9841
10257
  value: String(stats?.screensVisited ?? 0)
9842
10258
  }
9843
- ), /* @__PURE__ */ React17.createElement(
10259
+ ), /* @__PURE__ */ React18.createElement(
9844
10260
  StatTile,
9845
10261
  {
9846
10262
  label: t.statBugs,
9847
10263
  value: String(stats?.bugsReported ?? 0)
9848
10264
  }
9849
- ), /* @__PURE__ */ React17.createElement(
10265
+ ), /* @__PURE__ */ React18.createElement(
9850
10266
  StatTile,
9851
10267
  {
9852
10268
  label: t.statTasks,
@@ -9858,13 +10274,13 @@ function StatTile({
9858
10274
  label,
9859
10275
  value
9860
10276
  }) {
9861
- return /* @__PURE__ */ React17.createElement(View13, { style: styles13.statTile }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.statValue }, value), /* @__PURE__ */ React17.createElement(Text12, { style: styles13.statLabel }, label));
10277
+ return /* @__PURE__ */ React18.createElement(View14, { style: styles14.statTile }, /* @__PURE__ */ React18.createElement(Text13, { style: styles14.statValue }, value), /* @__PURE__ */ React18.createElement(Text13, { style: styles14.statLabel }, label));
9862
10278
  }
9863
10279
  function SectionLabel({ text }) {
9864
- return /* @__PURE__ */ React17.createElement(Text12, { style: styles13.sectionLabel }, text);
10280
+ return /* @__PURE__ */ React18.createElement(Text13, { style: styles14.sectionLabel }, text);
9865
10281
  }
9866
10282
  function FieldLabel2({ text }) {
9867
- return /* @__PURE__ */ React17.createElement(Text12, { style: styles13.fieldLabel }, text);
10283
+ return /* @__PURE__ */ React18.createElement(Text13, { style: styles14.fieldLabel }, text);
9868
10284
  }
9869
10285
  function RatingRow({
9870
10286
  label,
@@ -9872,8 +10288,8 @@ function RatingRow({
9872
10288
  onChange,
9873
10289
  starsA11y
9874
10290
  }) {
9875
- return /* @__PURE__ */ React17.createElement(View13, { style: styles13.ratingRow }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.ratingLabel }, label), /* @__PURE__ */ React17.createElement(View13, { style: styles13.starRow }, [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ React17.createElement(
9876
- Pressable11,
10291
+ return /* @__PURE__ */ React18.createElement(View14, { style: styles14.ratingRow }, /* @__PURE__ */ React18.createElement(Text13, { style: styles14.ratingLabel }, label), /* @__PURE__ */ React18.createElement(View14, { style: styles14.starRow }, [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ React18.createElement(
10292
+ Pressable12,
9877
10293
  {
9878
10294
  key: i,
9879
10295
  accessibilityRole: "button",
@@ -9881,11 +10297,11 @@ function RatingRow({
9881
10297
  accessibilityState: { selected: value === i },
9882
10298
  onPress: () => onChange(i),
9883
10299
  style: ({ pressed }) => [
9884
- styles13.starButton,
10300
+ styles14.starButton,
9885
10301
  pressed && { opacity: 0.7 }
9886
10302
  ]
9887
10303
  },
9888
- /* @__PURE__ */ React17.createElement(
10304
+ /* @__PURE__ */ React18.createElement(
9889
10305
  TpkIcon,
9890
10306
  {
9891
10307
  name: i <= value ? "star_filled" : "star_outline",
@@ -9900,7 +10316,7 @@ function IssueRow({
9900
10316
  value,
9901
10317
  onChange
9902
10318
  }) {
9903
- return /* @__PURE__ */ React17.createElement(View13, { style: styles13.issueRow }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.issueLabel }, label), /* @__PURE__ */ React17.createElement(Switch2, { value, onValueChange: onChange }));
10319
+ return /* @__PURE__ */ React18.createElement(View14, { style: styles14.issueRow }, /* @__PURE__ */ React18.createElement(Text13, { style: styles14.issueLabel }, label), /* @__PURE__ */ React18.createElement(Switch2, { value, onValueChange: onChange }));
9904
10320
  }
9905
10321
  function formatDuration(seconds) {
9906
10322
  if (seconds < 60) return `${seconds}s`;
@@ -9944,7 +10360,7 @@ function composeFeedbackDescription(input) {
9944
10360
  }
9945
10361
  return lines.join("\n");
9946
10362
  }
9947
- var styles13 = StyleSheet13.create({
10363
+ var styles14 = StyleSheet14.create({
9948
10364
  root: {
9949
10365
  flex: 1,
9950
10366
  backgroundColor: "#FAFAF7"
@@ -9955,7 +10371,7 @@ var styles13 = StyleSheet13.create({
9955
10371
  paddingHorizontal: 12,
9956
10372
  paddingVertical: 12,
9957
10373
  backgroundColor: "#FFFFFF",
9958
- borderBottomWidth: StyleSheet13.hairlineWidth,
10374
+ borderBottomWidth: StyleSheet14.hairlineWidth,
9959
10375
  borderBottomColor: "#E5E7EB"
9960
10376
  },
9961
10377
  headerClose: {
@@ -10094,7 +10510,7 @@ var styles13 = StyleSheet13.create({
10094
10510
  gap: 10,
10095
10511
  padding: 14,
10096
10512
  backgroundColor: "#FFFFFF",
10097
- borderTopWidth: StyleSheet13.hairlineWidth,
10513
+ borderTopWidth: StyleSheet14.hairlineWidth,
10098
10514
  borderTopColor: "#E5E7EB"
10099
10515
  },
10100
10516
  cancelButton: {
@@ -10128,16 +10544,16 @@ var styles13 = StyleSheet13.create({
10128
10544
  });
10129
10545
 
10130
10546
  // src/MyBugsSheet.tsx
10131
- import React18, { useEffect as useEffect11, useState as useState14 } from "react";
10547
+ import React19, { useEffect as useEffect12, useState as useState15 } from "react";
10132
10548
  import {
10133
- ActivityIndicator as ActivityIndicator8,
10549
+ ActivityIndicator as ActivityIndicator9,
10134
10550
  FlatList as FlatList2,
10135
10551
  Modal as Modal9,
10136
- Pressable as Pressable12,
10137
- ScrollView as ScrollView11,
10138
- StyleSheet as StyleSheet14,
10139
- Text as Text13,
10140
- View as View14
10552
+ Pressable as Pressable13,
10553
+ ScrollView as ScrollView12,
10554
+ StyleSheet as StyleSheet15,
10555
+ Text as Text14,
10556
+ View as View15
10141
10557
  } from "react-native";
10142
10558
 
10143
10559
  // src/bug-status.ts
@@ -10208,11 +10624,11 @@ function MyBugsSheet({
10208
10624
  const theme = useTpkTheme();
10209
10625
  const language = useTpkLanguage();
10210
10626
  const t = STRINGS8[language];
10211
- const [loading, setLoading] = useState14(false);
10212
- const [error, setError] = useState14(false);
10213
- const [bugs, setBugs] = useState14([]);
10214
- const [selected, setSelected] = useState14(null);
10215
- useEffect11(() => {
10627
+ const [loading, setLoading] = useState15(false);
10628
+ const [error, setError] = useState15(false);
10629
+ const [bugs, setBugs] = useState15([]);
10630
+ const [selected, setSelected] = useState15(null);
10631
+ useEffect12(() => {
10216
10632
  if (!visible || !tpk) return;
10217
10633
  let cancelled = false;
10218
10634
  setLoading(true);
@@ -10228,7 +10644,7 @@ function MyBugsSheet({
10228
10644
  cancelled = true;
10229
10645
  };
10230
10646
  }, [visible, tpk]);
10231
- return /* @__PURE__ */ React18.createElement(
10647
+ return /* @__PURE__ */ React19.createElement(
10232
10648
  Modal9,
10233
10649
  {
10234
10650
  visible,
@@ -10236,22 +10652,22 @@ function MyBugsSheet({
10236
10652
  animationType: "slide",
10237
10653
  onRequestClose: onClose
10238
10654
  },
10239
- /* @__PURE__ */ React18.createElement(View14, { style: styles14.backdrop }, /* @__PURE__ */ React18.createElement(View14, { style: [styles14.sheet, { backgroundColor: theme.surface }] }, /* @__PURE__ */ React18.createElement(View14, { style: styles14.header }, /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.title, { color: theme.onSurface }] }, t.title), /* @__PURE__ */ React18.createElement(
10240
- Pressable12,
10655
+ /* @__PURE__ */ React19.createElement(View15, { style: styles15.backdrop }, /* @__PURE__ */ React19.createElement(View15, { style: [styles15.sheet, { backgroundColor: theme.surface }] }, /* @__PURE__ */ React19.createElement(View15, { style: styles15.header }, /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.title, { color: theme.onSurface }] }, t.title), /* @__PURE__ */ React19.createElement(
10656
+ Pressable13,
10241
10657
  {
10242
10658
  onPress: onClose,
10243
10659
  hitSlop: 8,
10244
10660
  accessibilityLabel: t.close,
10245
10661
  testID: "tpk-my-bugs-close"
10246
10662
  },
10247
- /* @__PURE__ */ React18.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10248
- )), loading ? /* @__PURE__ */ React18.createElement(View14, { style: styles14.center }, /* @__PURE__ */ React18.createElement(ActivityIndicator8, { color: theme.primary })) : error ? /* @__PURE__ */ React18.createElement(View14, { style: styles14.center }, /* @__PURE__ */ React18.createElement(Text13, { style: styles14.muted }, t.loadFailed)) : bugs.length === 0 ? /* @__PURE__ */ React18.createElement(View14, { style: styles14.center }, /* @__PURE__ */ React18.createElement(TpkIcon, { name: "check", size: 48, color: "#CBD5E1" }), /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.empty, { marginTop: 12 }] }, t.empty)) : /* @__PURE__ */ React18.createElement(
10663
+ /* @__PURE__ */ React19.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10664
+ )), loading ? /* @__PURE__ */ React19.createElement(View15, { style: styles15.center }, /* @__PURE__ */ React19.createElement(ActivityIndicator9, { color: theme.primary })) : error ? /* @__PURE__ */ React19.createElement(View15, { style: styles15.center }, /* @__PURE__ */ React19.createElement(Text14, { style: styles15.muted }, t.loadFailed)) : bugs.length === 0 ? /* @__PURE__ */ React19.createElement(View15, { style: styles15.center }, /* @__PURE__ */ React19.createElement(TpkIcon, { name: "check", size: 48, color: "#CBD5E1" }), /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.empty, { marginTop: 12 }] }, t.empty)) : /* @__PURE__ */ React19.createElement(
10249
10665
  FlatList2,
10250
10666
  {
10251
10667
  data: bugs,
10252
10668
  keyExtractor: (b) => b.id,
10253
- contentContainerStyle: styles14.listBody,
10254
- renderItem: ({ item }) => /* @__PURE__ */ React18.createElement(
10669
+ contentContainerStyle: styles15.listBody,
10670
+ renderItem: ({ item }) => /* @__PURE__ */ React19.createElement(
10255
10671
  BugRow,
10256
10672
  {
10257
10673
  bug: item,
@@ -10262,7 +10678,7 @@ function MyBugsSheet({
10262
10678
  )
10263
10679
  }
10264
10680
  ))),
10265
- /* @__PURE__ */ React18.createElement(
10681
+ /* @__PURE__ */ React19.createElement(
10266
10682
  BugDetailModal,
10267
10683
  {
10268
10684
  bug: selected,
@@ -10279,15 +10695,15 @@ function StatusBadge2({
10279
10695
  language
10280
10696
  }) {
10281
10697
  const { label, color } = bugStatusStyle(status, language);
10282
- return /* @__PURE__ */ React18.createElement(
10283
- View14,
10698
+ return /* @__PURE__ */ React19.createElement(
10699
+ View15,
10284
10700
  {
10285
10701
  style: [
10286
- styles14.badge,
10702
+ styles15.badge,
10287
10703
  { backgroundColor: `${color}1F`, borderColor: `${color}66` }
10288
10704
  ]
10289
10705
  },
10290
- /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.badgeText, { color }] }, label)
10706
+ /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.badgeText, { color }] }, label)
10291
10707
  );
10292
10708
  }
10293
10709
  function metaLine(bug, language) {
@@ -10304,15 +10720,15 @@ function BugRow({
10304
10720
  textColor,
10305
10721
  onPress
10306
10722
  }) {
10307
- return /* @__PURE__ */ React18.createElement(
10308
- Pressable12,
10723
+ return /* @__PURE__ */ React19.createElement(
10724
+ Pressable13,
10309
10725
  {
10310
- style: styles14.row,
10726
+ style: styles15.row,
10311
10727
  onPress,
10312
10728
  testID: `tpk-my-bug-${bug.id}`
10313
10729
  },
10314
- /* @__PURE__ */ React18.createElement(View14, { style: styles14.rowMain }, /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.rowTitle, { color: textColor }], numberOfLines: 2 }, bug.title), /* @__PURE__ */ React18.createElement(Text13, { style: styles14.muted }, metaLine(bug, language))),
10315
- /* @__PURE__ */ React18.createElement(StatusBadge2, { status: bug.status, language })
10730
+ /* @__PURE__ */ React19.createElement(View15, { style: styles15.rowMain }, /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.rowTitle, { color: textColor }], numberOfLines: 2 }, bug.title), /* @__PURE__ */ React19.createElement(Text14, { style: styles15.muted }, metaLine(bug, language))),
10731
+ /* @__PURE__ */ React19.createElement(StatusBadge2, { status: bug.status, language })
10316
10732
  );
10317
10733
  }
10318
10734
  function BugDetailModal({
@@ -10322,7 +10738,7 @@ function BugDetailModal({
10322
10738
  surface,
10323
10739
  textColor
10324
10740
  }) {
10325
- return /* @__PURE__ */ React18.createElement(
10741
+ return /* @__PURE__ */ React19.createElement(
10326
10742
  Modal9,
10327
10743
  {
10328
10744
  visible: bug != null,
@@ -10330,17 +10746,17 @@ function BugDetailModal({
10330
10746
  animationType: "fade",
10331
10747
  onRequestClose: onClose
10332
10748
  },
10333
- /* @__PURE__ */ React18.createElement(Pressable12, { style: styles14.detailBackdrop, onPress: onClose }, /* @__PURE__ */ React18.createElement(
10334
- Pressable12,
10749
+ /* @__PURE__ */ React19.createElement(Pressable13, { style: styles15.detailBackdrop, onPress: onClose }, /* @__PURE__ */ React19.createElement(
10750
+ Pressable13,
10335
10751
  {
10336
- style: [styles14.detailCard, { backgroundColor: surface }],
10752
+ style: [styles15.detailCard, { backgroundColor: surface }],
10337
10753
  onPress: () => void 0
10338
10754
  },
10339
- bug ? /* @__PURE__ */ React18.createElement(ScrollView11, { contentContainerStyle: styles14.detailBody }, /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.detailTitle, { color: textColor }] }, bug.title), /* @__PURE__ */ React18.createElement(View14, { style: styles14.detailBadgeRow }, /* @__PURE__ */ React18.createElement(StatusBadge2, { status: bug.status, language })), /* @__PURE__ */ React18.createElement(Text13, { style: styles14.muted }, metaLine(bug, language)), bug.description ? /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.detailLabel, { color: textColor }] }, STRINGS8[language].description), /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.detailDesc, { color: textColor }] }, bug.description)) : null) : null
10755
+ bug ? /* @__PURE__ */ React19.createElement(ScrollView12, { contentContainerStyle: styles15.detailBody }, /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.detailTitle, { color: textColor }] }, bug.title), /* @__PURE__ */ React19.createElement(View15, { style: styles15.detailBadgeRow }, /* @__PURE__ */ React19.createElement(StatusBadge2, { status: bug.status, language })), /* @__PURE__ */ React19.createElement(Text14, { style: styles15.muted }, metaLine(bug, language)), bug.description ? /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.detailLabel, { color: textColor }] }, STRINGS8[language].description), /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.detailDesc, { color: textColor }] }, bug.description)) : null) : null
10340
10756
  ))
10341
10757
  );
10342
10758
  }
10343
- var styles14 = StyleSheet14.create({
10759
+ var styles15 = StyleSheet15.create({
10344
10760
  backdrop: {
10345
10761
  flex: 1,
10346
10762
  backgroundColor: "rgba(0,0,0,0.4)",
@@ -10369,7 +10785,7 @@ var styles14 = StyleSheet14.create({
10369
10785
  flexDirection: "row",
10370
10786
  alignItems: "center",
10371
10787
  paddingVertical: 14,
10372
- borderBottomWidth: StyleSheet14.hairlineWidth,
10788
+ borderBottomWidth: StyleSheet15.hairlineWidth,
10373
10789
  borderBottomColor: "#E2E8F0"
10374
10790
  },
10375
10791
  rowMain: { flex: 1, paddingRight: 12 },
@@ -10397,14 +10813,14 @@ var styles14 = StyleSheet14.create({
10397
10813
  });
10398
10814
 
10399
10815
  // src/SessionDetailsSheet.tsx
10400
- import React19, { useEffect as useEffect12, useMemo as useMemo9, useState as useState15 } from "react";
10816
+ import React20, { useEffect as useEffect13, useMemo as useMemo10, useState as useState16 } from "react";
10401
10817
  import {
10402
10818
  Modal as Modal10,
10403
- Pressable as Pressable13,
10404
- ScrollView as ScrollView12,
10405
- StyleSheet as StyleSheet15,
10406
- Text as Text14,
10407
- View as View15
10819
+ Pressable as Pressable14,
10820
+ ScrollView as ScrollView13,
10821
+ StyleSheet as StyleSheet16,
10822
+ Text as Text15,
10823
+ View as View16
10408
10824
  } from "react-native";
10409
10825
  var STRINGS9 = {
10410
10826
  en: {
@@ -10450,7 +10866,7 @@ function SessionDetailsSheet({
10450
10866
  const language = useTpkLanguage();
10451
10867
  const t = STRINGS9[language];
10452
10868
  const money = (amount) => formatTpkMoney(amount, earningsCurrency, language);
10453
- const data = useMemo9(() => {
10869
+ const data = useMemo10(() => {
10454
10870
  if (!visible || !tpk) {
10455
10871
  return { taps: 0, screenViews: 0, activeMinutes: 0, paidMinutes: 0 };
10456
10872
  }
@@ -10462,8 +10878,8 @@ function SessionDetailsSheet({
10462
10878
  paidMinutes: tpk.getEngagedMinutes()
10463
10879
  };
10464
10880
  }, [visible, tpk]);
10465
- const [tasks, setTasks] = useState15(null);
10466
- useEffect12(() => {
10881
+ const [tasks, setTasks] = useState16(null);
10882
+ useEffect13(() => {
10467
10883
  if (!visible || !tpk) return;
10468
10884
  let cancelled = false;
10469
10885
  tpk.getTaskProgress().then((p) => {
@@ -10474,7 +10890,7 @@ function SessionDetailsSheet({
10474
10890
  };
10475
10891
  }, [visible, tpk]);
10476
10892
  const expected = earningsBaseAmount + data.paidMinutes * earningsPerMinuteRate;
10477
- return /* @__PURE__ */ React19.createElement(
10893
+ return /* @__PURE__ */ React20.createElement(
10478
10894
  Modal10,
10479
10895
  {
10480
10896
  visible,
@@ -10482,29 +10898,29 @@ function SessionDetailsSheet({
10482
10898
  animationType: "slide",
10483
10899
  onRequestClose: onClose
10484
10900
  },
10485
- /* @__PURE__ */ React19.createElement(View15, { style: styles15.backdrop }, /* @__PURE__ */ React19.createElement(View15, { style: [styles15.sheet, { backgroundColor: theme.surface }] }, /* @__PURE__ */ React19.createElement(View15, { style: styles15.header }, /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.title, { color: theme.onSurface }] }, t.title), /* @__PURE__ */ React19.createElement(
10486
- Pressable13,
10901
+ /* @__PURE__ */ React20.createElement(View16, { style: styles16.backdrop }, /* @__PURE__ */ React20.createElement(View16, { style: [styles16.sheet, { backgroundColor: theme.surface }] }, /* @__PURE__ */ React20.createElement(View16, { style: styles16.header }, /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.title, { color: theme.onSurface }] }, t.title), /* @__PURE__ */ React20.createElement(
10902
+ Pressable14,
10487
10903
  {
10488
10904
  onPress: onClose,
10489
10905
  hitSlop: 8,
10490
10906
  accessibilityLabel: t.close,
10491
10907
  testID: "tpk-session-details-close"
10492
10908
  },
10493
- /* @__PURE__ */ React19.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10494
- )), /* @__PURE__ */ React19.createElement(ScrollView12, { contentContainerStyle: styles15.body }, /* @__PURE__ */ React19.createElement(
10495
- View15,
10909
+ /* @__PURE__ */ React20.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10910
+ )), /* @__PURE__ */ React20.createElement(ScrollView13, { contentContainerStyle: styles16.body }, /* @__PURE__ */ React20.createElement(
10911
+ View16,
10496
10912
  {
10497
- style: [styles15.earnings, { borderColor: theme.primary }],
10913
+ style: [styles16.earnings, { borderColor: theme.primary }],
10498
10914
  testID: "tpk-session-details-earnings"
10499
10915
  },
10500
- /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.earningsLabel, { color: theme.onSurface }] }, t.expectedEarnings),
10501
- /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.earningsValue, { color: theme.primary }] }, money(expected)),
10502
- /* @__PURE__ */ React19.createElement(Text14, { style: styles15.earningsHint }, t.earningsHint(
10916
+ /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.earningsLabel, { color: theme.onSurface }] }, t.expectedEarnings),
10917
+ /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.earningsValue, { color: theme.primary }] }, money(expected)),
10918
+ /* @__PURE__ */ React20.createElement(Text15, { style: styles16.earningsHint }, t.earningsHint(
10503
10919
  money(earningsBaseAmount),
10504
10920
  data.paidMinutes,
10505
10921
  money(earningsPerMinuteRate)
10506
10922
  ))
10507
- ), /* @__PURE__ */ React19.createElement(
10923
+ ), /* @__PURE__ */ React20.createElement(
10508
10924
  Metric,
10509
10925
  {
10510
10926
  label: t.activeTime,
@@ -10512,7 +10928,7 @@ function SessionDetailsSheet({
10512
10928
  hint: t.activeTimeHint,
10513
10929
  color: theme.onSurface
10514
10930
  }
10515
- ), /* @__PURE__ */ React19.createElement(
10931
+ ), /* @__PURE__ */ React20.createElement(
10516
10932
  Metric,
10517
10933
  {
10518
10934
  label: t.paidTime,
@@ -10520,21 +10936,21 @@ function SessionDetailsSheet({
10520
10936
  hint: t.paidTimeHint,
10521
10937
  color: theme.onSurface
10522
10938
  }
10523
- ), /* @__PURE__ */ React19.createElement(
10939
+ ), /* @__PURE__ */ React20.createElement(
10524
10940
  Metric,
10525
10941
  {
10526
10942
  label: t.taps,
10527
10943
  value: String(data.taps),
10528
10944
  color: theme.onSurface
10529
10945
  }
10530
- ), /* @__PURE__ */ React19.createElement(
10946
+ ), /* @__PURE__ */ React20.createElement(
10531
10947
  Metric,
10532
10948
  {
10533
10949
  label: t.screens,
10534
10950
  value: String(data.screenViews),
10535
10951
  color: theme.onSurface
10536
10952
  }
10537
- ), tasks?.hasTasks ? /* @__PURE__ */ React19.createElement(
10953
+ ), tasks?.hasTasks ? /* @__PURE__ */ React20.createElement(
10538
10954
  Metric,
10539
10955
  {
10540
10956
  label: t.tasks,
@@ -10550,9 +10966,9 @@ function Metric({
10550
10966
  hint,
10551
10967
  color
10552
10968
  }) {
10553
- return /* @__PURE__ */ React19.createElement(View15, { style: styles15.metricRow }, /* @__PURE__ */ React19.createElement(View15, { style: styles15.metricLabelCol }, /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.metricLabel, { color }] }, label), hint ? /* @__PURE__ */ React19.createElement(Text14, { style: styles15.metricHint }, hint) : null), /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.metricValue, { color }] }, value));
10969
+ return /* @__PURE__ */ React20.createElement(View16, { style: styles16.metricRow }, /* @__PURE__ */ React20.createElement(View16, { style: styles16.metricLabelCol }, /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.metricLabel, { color }] }, label), hint ? /* @__PURE__ */ React20.createElement(Text15, { style: styles16.metricHint }, hint) : null), /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.metricValue, { color }] }, value));
10554
10970
  }
10555
- var styles15 = StyleSheet15.create({
10971
+ var styles16 = StyleSheet16.create({
10556
10972
  backdrop: {
10557
10973
  flex: 1,
10558
10974
  backgroundColor: "rgba(0,0,0,0.4)",
@@ -10589,7 +11005,7 @@ var styles15 = StyleSheet15.create({
10589
11005
  alignItems: "center",
10590
11006
  justifyContent: "space-between",
10591
11007
  paddingVertical: 12,
10592
- borderBottomWidth: StyleSheet15.hairlineWidth,
11008
+ borderBottomWidth: StyleSheet16.hairlineWidth,
10593
11009
  borderBottomColor: "#E2E8F0"
10594
11010
  },
10595
11011
  metricLabelCol: { flex: 1, paddingRight: 12 },
@@ -10599,15 +11015,15 @@ var styles15 = StyleSheet15.create({
10599
11015
  });
10600
11016
 
10601
11017
  // src/NotificationsSheet.tsx
10602
- import React20, { useEffect as useEffect13, useState as useState16 } from "react";
11018
+ import React21, { useEffect as useEffect14, useState as useState17 } from "react";
10603
11019
  import {
10604
- ActivityIndicator as ActivityIndicator9,
11020
+ ActivityIndicator as ActivityIndicator10,
10605
11021
  FlatList as FlatList3,
10606
11022
  Modal as Modal11,
10607
- Pressable as Pressable14,
10608
- StyleSheet as StyleSheet16,
10609
- Text as Text15,
10610
- View as View16
11023
+ Pressable as Pressable15,
11024
+ StyleSheet as StyleSheet17,
11025
+ Text as Text16,
11026
+ View as View17
10611
11027
  } from "react-native";
10612
11028
  var STRINGS10 = {
10613
11029
  en: {
@@ -10639,10 +11055,10 @@ function NotificationsSheet({
10639
11055
  }) {
10640
11056
  const theme = useTpkTheme();
10641
11057
  const t = STRINGS10[useTpkLanguage()];
10642
- const [loading, setLoading] = useState16(false);
10643
- const [error, setError] = useState16(false);
10644
- const [items, setItems] = useState16([]);
10645
- useEffect13(() => {
11058
+ const [loading, setLoading] = useState17(false);
11059
+ const [error, setError] = useState17(false);
11060
+ const [items, setItems] = useState17([]);
11061
+ useEffect14(() => {
10646
11062
  if (!visible || !tpk) return;
10647
11063
  let cancelled = false;
10648
11064
  setLoading(true);
@@ -10677,7 +11093,7 @@ function NotificationsSheet({
10677
11093
  tpk.markNotificationsRead().then((unread) => onUnreadChange?.(unread)).catch(() => void 0);
10678
11094
  };
10679
11095
  const hasUnread = items.some((x) => !x.isRead);
10680
- return /* @__PURE__ */ React20.createElement(
11096
+ return /* @__PURE__ */ React21.createElement(
10681
11097
  Modal11,
10682
11098
  {
10683
11099
  visible,
@@ -10685,52 +11101,52 @@ function NotificationsSheet({
10685
11101
  animationType: "slide",
10686
11102
  onRequestClose: onClose
10687
11103
  },
10688
- /* @__PURE__ */ React20.createElement(View16, { style: styles16.backdrop }, /* @__PURE__ */ React20.createElement(View16, { style: [styles16.sheet, { backgroundColor: theme.surface }] }, /* @__PURE__ */ React20.createElement(View16, { style: styles16.header }, /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.title, { color: theme.onSurface }] }, t.title), /* @__PURE__ */ React20.createElement(View16, { style: styles16.headerActions }, hasUnread ? /* @__PURE__ */ React20.createElement(
10689
- Pressable14,
11104
+ /* @__PURE__ */ React21.createElement(View17, { style: styles17.backdrop }, /* @__PURE__ */ React21.createElement(View17, { style: [styles17.sheet, { backgroundColor: theme.surface }] }, /* @__PURE__ */ React21.createElement(View17, { style: styles17.header }, /* @__PURE__ */ React21.createElement(Text16, { style: [styles17.title, { color: theme.onSurface }] }, t.title), /* @__PURE__ */ React21.createElement(View17, { style: styles17.headerActions }, hasUnread ? /* @__PURE__ */ React21.createElement(
11105
+ Pressable15,
10690
11106
  {
10691
11107
  onPress: markAll,
10692
11108
  hitSlop: 8,
10693
11109
  testID: "tpk-notifications-mark-all"
10694
11110
  },
10695
- /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.markAll, { color: theme.primary }] }, t.markAll)
10696
- ) : null, /* @__PURE__ */ React20.createElement(
10697
- Pressable14,
11111
+ /* @__PURE__ */ React21.createElement(Text16, { style: [styles17.markAll, { color: theme.primary }] }, t.markAll)
11112
+ ) : null, /* @__PURE__ */ React21.createElement(
11113
+ Pressable15,
10698
11114
  {
10699
11115
  onPress: onClose,
10700
11116
  hitSlop: 8,
10701
11117
  accessibilityLabel: t.close,
10702
11118
  testID: "tpk-notifications-close"
10703
11119
  },
10704
- /* @__PURE__ */ React20.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10705
- ))), loading ? /* @__PURE__ */ React20.createElement(View16, { style: styles16.center }, /* @__PURE__ */ React20.createElement(ActivityIndicator9, { color: theme.primary })) : error ? /* @__PURE__ */ React20.createElement(View16, { style: styles16.center }, /* @__PURE__ */ React20.createElement(Text15, { style: styles16.muted }, t.loadFailed)) : items.length === 0 ? /* @__PURE__ */ React20.createElement(View16, { style: styles16.center }, /* @__PURE__ */ React20.createElement(TpkIcon, { name: "feedback", size: 48, color: "#CBD5E1" }), /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.empty, { marginTop: 12 }] }, t.empty)) : /* @__PURE__ */ React20.createElement(
11120
+ /* @__PURE__ */ React21.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
11121
+ ))), loading ? /* @__PURE__ */ React21.createElement(View17, { style: styles17.center }, /* @__PURE__ */ React21.createElement(ActivityIndicator10, { color: theme.primary })) : error ? /* @__PURE__ */ React21.createElement(View17, { style: styles17.center }, /* @__PURE__ */ React21.createElement(Text16, { style: styles17.muted }, t.loadFailed)) : items.length === 0 ? /* @__PURE__ */ React21.createElement(View17, { style: styles17.center }, /* @__PURE__ */ React21.createElement(TpkIcon, { name: "feedback", size: 48, color: "#CBD5E1" }), /* @__PURE__ */ React21.createElement(Text16, { style: [styles17.empty, { marginTop: 12 }] }, t.empty)) : /* @__PURE__ */ React21.createElement(
10706
11122
  FlatList3,
10707
11123
  {
10708
11124
  data: items,
10709
11125
  keyExtractor: (n) => n.id,
10710
- contentContainerStyle: styles16.listBody,
10711
- renderItem: ({ item }) => /* @__PURE__ */ React20.createElement(
10712
- Pressable14,
11126
+ contentContainerStyle: styles17.listBody,
11127
+ renderItem: ({ item }) => /* @__PURE__ */ React21.createElement(
11128
+ Pressable15,
10713
11129
  {
10714
- style: styles16.row,
11130
+ style: styles17.row,
10715
11131
  onPress: () => markOne(item),
10716
11132
  testID: `tpk-notification-${item.id}`
10717
11133
  },
10718
- /* @__PURE__ */ React20.createElement(
10719
- View16,
11134
+ /* @__PURE__ */ React21.createElement(
11135
+ View17,
10720
11136
  {
10721
11137
  style: [
10722
- styles16.dot,
11138
+ styles17.dot,
10723
11139
  {
10724
11140
  backgroundColor: item.isRead ? "transparent" : theme.primary
10725
11141
  }
10726
11142
  ]
10727
11143
  }
10728
11144
  ),
10729
- /* @__PURE__ */ React20.createElement(View16, { style: styles16.rowMain }, /* @__PURE__ */ React20.createElement(
10730
- Text15,
11145
+ /* @__PURE__ */ React21.createElement(View17, { style: styles17.rowMain }, /* @__PURE__ */ React21.createElement(
11146
+ Text16,
10731
11147
  {
10732
11148
  style: [
10733
- styles16.rowTitle,
11149
+ styles17.rowTitle,
10734
11150
  {
10735
11151
  color: theme.onSurface,
10736
11152
  fontWeight: item.isRead ? "500" : "700"
@@ -10739,20 +11155,20 @@ function NotificationsSheet({
10739
11155
  numberOfLines: 2
10740
11156
  },
10741
11157
  item.title
10742
- ), item.body ? /* @__PURE__ */ React20.createElement(
10743
- Text15,
11158
+ ), item.body ? /* @__PURE__ */ React21.createElement(
11159
+ Text16,
10744
11160
  {
10745
- style: [styles16.rowBody, { color: theme.onSurface }],
11161
+ style: [styles17.rowBody, { color: theme.onSurface }],
10746
11162
  numberOfLines: 3
10747
11163
  },
10748
11164
  item.body
10749
- ) : null, /* @__PURE__ */ React20.createElement(Text15, { style: styles16.muted }, formatDate2(item.createdAt)))
11165
+ ) : null, /* @__PURE__ */ React21.createElement(Text16, { style: styles17.muted }, formatDate2(item.createdAt)))
10750
11166
  )
10751
11167
  }
10752
11168
  )))
10753
11169
  );
10754
11170
  }
10755
- var styles16 = StyleSheet16.create({
11171
+ var styles17 = StyleSheet17.create({
10756
11172
  backdrop: {
10757
11173
  flex: 1,
10758
11174
  backgroundColor: "rgba(0,0,0,0.4)",
@@ -10783,7 +11199,7 @@ var styles16 = StyleSheet16.create({
10783
11199
  flexDirection: "row",
10784
11200
  alignItems: "flex-start",
10785
11201
  paddingVertical: 14,
10786
- borderBottomWidth: StyleSheet16.hairlineWidth,
11202
+ borderBottomWidth: StyleSheet17.hairlineWidth,
10787
11203
  borderBottomColor: "#E2E8F0"
10788
11204
  },
10789
11205
  dot: { width: 8, height: 8, borderRadius: 4, marginTop: 6, marginRight: 10 },
@@ -10793,17 +11209,17 @@ var styles16 = StyleSheet16.create({
10793
11209
  });
10794
11210
 
10795
11211
  // src/InviteCodeScreen.tsx
10796
- import React21, { useState as useState17 } from "react";
11212
+ import React22, { useState as useState18 } from "react";
10797
11213
  import {
10798
- ActivityIndicator as ActivityIndicator10,
11214
+ ActivityIndicator as ActivityIndicator11,
10799
11215
  KeyboardAvoidingView,
10800
11216
  Modal as Modal12,
10801
11217
  Platform as Platform8,
10802
- Pressable as Pressable15,
10803
- StyleSheet as StyleSheet17,
10804
- Text as Text16,
10805
- TextInput as TextInput6,
10806
- View as View17
11218
+ Pressable as Pressable16,
11219
+ StyleSheet as StyleSheet18,
11220
+ Text as Text17,
11221
+ TextInput as TextInput7,
11222
+ View as View18
10807
11223
  } from "react-native";
10808
11224
  var STRINGS11 = {
10809
11225
  en: {
@@ -10834,9 +11250,9 @@ function InviteCodeScreen({
10834
11250
  }) {
10835
11251
  const theme = useTpkTheme();
10836
11252
  const t = STRINGS11[useTpkLanguage()];
10837
- const [code, setCode] = useState17("");
10838
- const [loading, setLoading] = useState17(false);
10839
- const [error, setError] = useState17(false);
11253
+ const [code, setCode] = useState18("");
11254
+ const [loading, setLoading] = useState18(false);
11255
+ const [error, setError] = useState18(false);
10840
11256
  const trimmed = code.trim();
10841
11257
  const canSubmit = trimmed.length > 0 && !loading && tpk != null;
10842
11258
  const submit = () => {
@@ -10852,7 +11268,7 @@ function InviteCodeScreen({
10852
11268
  setError(true);
10853
11269
  });
10854
11270
  };
10855
- return /* @__PURE__ */ React21.createElement(
11271
+ return /* @__PURE__ */ React22.createElement(
10856
11272
  Modal12,
10857
11273
  {
10858
11274
  visible,
@@ -10860,24 +11276,24 @@ function InviteCodeScreen({
10860
11276
  animationType: "fade",
10861
11277
  onRequestClose: onClose
10862
11278
  },
10863
- /* @__PURE__ */ React21.createElement(
11279
+ /* @__PURE__ */ React22.createElement(
10864
11280
  KeyboardAvoidingView,
10865
11281
  {
10866
11282
  behavior: Platform8.OS === "ios" ? "padding" : void 0,
10867
- style: styles17.backdrop
11283
+ style: styles18.backdrop
10868
11284
  },
10869
- /* @__PURE__ */ React21.createElement(View17, { style: [styles17.card, { backgroundColor: theme.surface }] }, onClose ? /* @__PURE__ */ React21.createElement(
10870
- Pressable15,
11285
+ /* @__PURE__ */ React22.createElement(View18, { style: [styles18.card, { backgroundColor: theme.surface }] }, onClose ? /* @__PURE__ */ React22.createElement(
11286
+ Pressable16,
10871
11287
  {
10872
11288
  onPress: onClose,
10873
11289
  hitSlop: 8,
10874
- style: styles17.close,
11290
+ style: styles18.close,
10875
11291
  accessibilityLabel: t.close,
10876
11292
  testID: "tpk-invite-close"
10877
11293
  },
10878
- /* @__PURE__ */ React21.createElement(TpkIcon, { name: "close", size: 22, color: theme.onSurface })
10879
- ) : null, /* @__PURE__ */ React21.createElement(TpkIcon, { name: "rocket", size: 40, color: theme.primary }), /* @__PURE__ */ React21.createElement(Text16, { style: [styles17.title, { color: theme.onSurface }] }, projectName ? t.testProject(projectName) : t.becomeTester), /* @__PURE__ */ React21.createElement(Text16, { style: styles17.subtitle }, t.subtitle), /* @__PURE__ */ React21.createElement(
10880
- TextInput6,
11294
+ /* @__PURE__ */ React22.createElement(TpkIcon, { name: "close", size: 22, color: theme.onSurface })
11295
+ ) : null, /* @__PURE__ */ React22.createElement(TpkIcon, { name: "rocket", size: 40, color: theme.primary }), /* @__PURE__ */ React22.createElement(Text17, { style: [styles18.title, { color: theme.onSurface }] }, projectName ? t.testProject(projectName) : t.becomeTester), /* @__PURE__ */ React22.createElement(Text17, { style: styles18.subtitle }, t.subtitle), /* @__PURE__ */ React22.createElement(
11296
+ TextInput7,
10881
11297
  {
10882
11298
  value: code,
10883
11299
  onChangeText: (t2) => {
@@ -10892,7 +11308,7 @@ function InviteCodeScreen({
10892
11308
  onSubmitEditing: submit,
10893
11309
  returnKeyType: "go",
10894
11310
  style: [
10895
- styles17.input,
11311
+ styles18.input,
10896
11312
  {
10897
11313
  color: theme.onSurface,
10898
11314
  borderColor: error ? theme.errorColour : "#CBD5E1"
@@ -10900,23 +11316,23 @@ function InviteCodeScreen({
10900
11316
  ],
10901
11317
  testID: "tpk-invite-input"
10902
11318
  }
10903
- ), error ? /* @__PURE__ */ React21.createElement(Text16, { style: [styles17.error, { color: theme.errorColour }] }, t.invalidCode) : null, /* @__PURE__ */ React21.createElement(
10904
- Pressable15,
11319
+ ), error ? /* @__PURE__ */ React22.createElement(Text17, { style: [styles18.error, { color: theme.errorColour }] }, t.invalidCode) : null, /* @__PURE__ */ React22.createElement(
11320
+ Pressable16,
10905
11321
  {
10906
11322
  onPress: submit,
10907
11323
  disabled: !canSubmit,
10908
11324
  style: [
10909
- styles17.button,
11325
+ styles18.button,
10910
11326
  { backgroundColor: theme.primary, opacity: canSubmit ? 1 : 0.5 }
10911
11327
  ],
10912
11328
  testID: "tpk-invite-submit"
10913
11329
  },
10914
- loading ? /* @__PURE__ */ React21.createElement(ActivityIndicator10, { color: "#FFFFFF" }) : /* @__PURE__ */ React21.createElement(Text16, { style: styles17.buttonText }, t.start)
11330
+ loading ? /* @__PURE__ */ React22.createElement(ActivityIndicator11, { color: "#FFFFFF" }) : /* @__PURE__ */ React22.createElement(Text17, { style: styles18.buttonText }, t.start)
10915
11331
  ))
10916
11332
  )
10917
11333
  );
10918
11334
  }
10919
- var styles17 = StyleSheet17.create({
11335
+ var styles18 = StyleSheet18.create({
10920
11336
  backdrop: {
10921
11337
  flex: 1,
10922
11338
  backgroundColor: "rgba(0,0,0,0.5)",
@@ -10962,27 +11378,30 @@ var styles17 = StyleSheet17.create({
10962
11378
  });
10963
11379
 
10964
11380
  // src/TesterPayKitWrapper.tsx
10965
- import React23, {
10966
- useCallback as useCallback11,
10967
- useEffect as useEffect15,
11381
+ import React26, {
11382
+ useCallback as useCallback12,
11383
+ useEffect as useEffect17,
10968
11384
  useRef as useRef10,
10969
- useState as useState19
11385
+ useState as useState21
10970
11386
  } from "react";
10971
11387
  import {
11388
+ Alert,
10972
11389
  AppState as AppState3,
10973
- Platform as Platform9,
10974
- StyleSheet as StyleSheet19,
10975
- View as View19
11390
+ Dimensions as Dimensions5,
11391
+ Platform as Platform10,
11392
+ StyleSheet as StyleSheet22,
11393
+ TextInput as TextInput9,
11394
+ View as View22
10976
11395
  } from "react-native";
10977
11396
 
10978
11397
  // src/ai-tester/AiRemoteControl.tsx
10979
- import React22, { useCallback as useCallback10, useEffect as useEffect14, useRef as useRef9, useState as useState18 } from "react";
11398
+ import React23, { useCallback as useCallback11, useEffect as useEffect15, useRef as useRef9, useState as useState19 } from "react";
10980
11399
  import {
10981
11400
  Modal as Modal13,
10982
- Pressable as Pressable16,
10983
- StyleSheet as StyleSheet18,
10984
- Text as Text17,
10985
- View as View18
11401
+ Pressable as Pressable17,
11402
+ StyleSheet as StyleSheet19,
11403
+ Text as Text18,
11404
+ View as View19
10986
11405
  } from "react-native";
10987
11406
  import {
10988
11407
  executeAction,
@@ -11044,17 +11463,17 @@ function AiRemoteControl({
11044
11463
  onSessionEnded,
11045
11464
  style
11046
11465
  }) {
11047
- const [status, setStatus] = useState18("choosing");
11048
- const [actionCount, setActionCount] = useState18(0);
11466
+ const [status, setStatus] = useState19("choosing");
11467
+ const [actionCount, setActionCount] = useState19(0);
11049
11468
  const language = useTpkLanguage();
11050
11469
  const t = STRINGS12[language];
11051
- const [errorMessage2, setErrorMessage] = useState18(null);
11052
- const [sessionId, setSessionId] = useState18(null);
11053
- const [personas, setPersonas] = useState18([]);
11054
- const [selectedPersona, setSelectedPersona] = useState18("junior_tester");
11470
+ const [errorMessage2, setErrorMessage] = useState19(null);
11471
+ const [sessionId, setSessionId] = useState19(null);
11472
+ const [personas, setPersonas] = useState19([]);
11473
+ const [selectedPersona, setSelectedPersona] = useState19("junior_tester");
11055
11474
  const wsRef = useRef9(null);
11056
11475
  const closedRef = useRef9(false);
11057
- useEffect14(() => {
11476
+ useEffect15(() => {
11058
11477
  if (!visible) {
11059
11478
  const ws = wsRef.current;
11060
11479
  if (ws && ws.readyState <= 1) {
@@ -11099,7 +11518,7 @@ function AiRemoteControl({
11099
11518
  cancelled = true;
11100
11519
  };
11101
11520
  }, [visible, apiBaseUrl, coordinatorToken, remoteSession]);
11102
- const _start = useCallback10(
11521
+ const _start = useCallback11(
11103
11522
  () => {
11104
11523
  setStatus("starting");
11105
11524
  void (async () => {
@@ -11155,7 +11574,7 @@ function AiRemoteControl({
11155
11574
  // eslint-disable-next-line react-hooks/exhaustive-deps
11156
11575
  [apiBaseUrl, coordinatorToken, projectId, configuration, selectedPersona]
11157
11576
  );
11158
- useEffect14(() => {
11577
+ useEffect15(() => {
11159
11578
  if (status !== "running") return;
11160
11579
  const handler = (ev) => {
11161
11580
  if (isSyntheticEvent(ev)) return;
@@ -11172,7 +11591,7 @@ function AiRemoteControl({
11172
11591
  document.addEventListener("pointerdown", handler, true);
11173
11592
  return () => document.removeEventListener("pointerdown", handler, true);
11174
11593
  }, [status]);
11175
- const _openSocket = useCallback10(
11594
+ const _openSocket = useCallback11(
11176
11595
  (wsUrl) => {
11177
11596
  const ws = new WebSocket(wsUrl);
11178
11597
  wsRef.current = ws;
@@ -11236,7 +11655,7 @@ function AiRemoteControl({
11236
11655
  },
11237
11656
  []
11238
11657
  );
11239
- const _finishSession = useCallback10(
11658
+ const _finishSession = useCallback11(
11240
11659
  (s) => {
11241
11660
  closedRef.current = true;
11242
11661
  setStatus("ended");
@@ -11251,7 +11670,7 @@ function AiRemoteControl({
11251
11670
  },
11252
11671
  [onSessionEnded, sessionId]
11253
11672
  );
11254
- const onStopPress = useCallback10(() => {
11673
+ const onStopPress = useCallback11(() => {
11255
11674
  const ws = wsRef.current;
11256
11675
  if (ws && ws.readyState === 1) {
11257
11676
  ws.send(JSON.stringify({ type: "goodbye", reason: "manual_stop" }));
@@ -11260,7 +11679,7 @@ function AiRemoteControl({
11260
11679
  onClose();
11261
11680
  }, [_finishSession, onClose]);
11262
11681
  if (!visible) return null;
11263
- return /* @__PURE__ */ React22.createElement(
11682
+ return /* @__PURE__ */ React23.createElement(
11264
11683
  Modal13,
11265
11684
  {
11266
11685
  animationType: "fade",
@@ -11268,13 +11687,13 @@ function AiRemoteControl({
11268
11687
  transparent: true,
11269
11688
  visible
11270
11689
  },
11271
- /* @__PURE__ */ React22.createElement(
11272
- View18,
11690
+ /* @__PURE__ */ React23.createElement(
11691
+ View19,
11273
11692
  {
11274
- style: [styles18.backdrop, style],
11693
+ style: [styles19.backdrop, style],
11275
11694
  dataSet: { "tpk-ai-overlay": "true" }
11276
11695
  },
11277
- /* @__PURE__ */ React22.createElement(View18, { style: styles18.card }, /* @__PURE__ */ React22.createElement(View18, { style: styles18.header }, /* @__PURE__ */ React22.createElement(TpkIcon, { name: "sparkle", size: 28, color: "#7C3AED" }), /* @__PURE__ */ React22.createElement(Text17, { style: styles18.title }, status === "choosing" ? t.chooseTester : t.aiTesting)), status === "choosing" ? /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Text17, { style: styles18.subtitle }, t.pickPersona), /* @__PURE__ */ React22.createElement(View18, { style: styles18.personaList }, (personas.length ? personas : [
11696
+ /* @__PURE__ */ React23.createElement(View19, { style: styles19.card }, /* @__PURE__ */ React23.createElement(View19, { style: styles19.header }, /* @__PURE__ */ React23.createElement(TpkIcon, { name: "sparkle", size: 28, color: "#7C3AED" }), /* @__PURE__ */ React23.createElement(Text18, { style: styles19.title }, status === "choosing" ? t.chooseTester : t.aiTesting)), status === "choosing" ? /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Text18, { style: styles19.subtitle }, t.pickPersona), /* @__PURE__ */ React23.createElement(View19, { style: styles19.personaList }, (personas.length ? personas : [
11278
11697
  {
11279
11698
  slug: "junior_tester",
11280
11699
  displayName: t.defaultPersonaName,
@@ -11282,58 +11701,58 @@ function AiRemoteControl({
11282
11701
  }
11283
11702
  ]).map((p) => {
11284
11703
  const sel = p.slug === selectedPersona;
11285
- return /* @__PURE__ */ React22.createElement(
11286
- Pressable16,
11704
+ return /* @__PURE__ */ React23.createElement(
11705
+ Pressable17,
11287
11706
  {
11288
11707
  key: p.slug,
11289
11708
  accessibilityRole: "button",
11290
11709
  accessibilityState: { selected: sel },
11291
11710
  onPress: () => setSelectedPersona(p.slug),
11292
11711
  style: [
11293
- styles18.personaChip,
11294
- sel && styles18.personaChipSelected
11712
+ styles19.personaChip,
11713
+ sel && styles19.personaChipSelected
11295
11714
  ]
11296
11715
  },
11297
- /* @__PURE__ */ React22.createElement(
11298
- Text17,
11716
+ /* @__PURE__ */ React23.createElement(
11717
+ Text18,
11299
11718
  {
11300
11719
  style: [
11301
- styles18.personaChipText,
11302
- sel && styles18.personaChipTextSelected
11720
+ styles19.personaChipText,
11721
+ sel && styles19.personaChipTextSelected
11303
11722
  ]
11304
11723
  },
11305
11724
  p.displayName
11306
11725
  )
11307
11726
  );
11308
- })), personas.find((p) => p.slug === selectedPersona)?.description ? /* @__PURE__ */ React22.createElement(Text17, { style: styles18.personaDesc }, personas.find((p) => p.slug === selectedPersona)?.description) : null, /* @__PURE__ */ React22.createElement(View18, { style: styles18.choosingActions }, /* @__PURE__ */ React22.createElement(
11309
- Pressable16,
11727
+ })), personas.find((p) => p.slug === selectedPersona)?.description ? /* @__PURE__ */ React23.createElement(Text18, { style: styles19.personaDesc }, personas.find((p) => p.slug === selectedPersona)?.description) : null, /* @__PURE__ */ React23.createElement(View19, { style: styles19.choosingActions }, /* @__PURE__ */ React23.createElement(
11728
+ Pressable17,
11310
11729
  {
11311
11730
  accessibilityRole: "button",
11312
11731
  onPress: onClose,
11313
- style: styles18.cancelButton
11732
+ style: styles19.cancelButton
11314
11733
  },
11315
- /* @__PURE__ */ React22.createElement(Text17, { style: styles18.cancelText }, t.cancel)
11316
- ), /* @__PURE__ */ React22.createElement(
11317
- Pressable16,
11734
+ /* @__PURE__ */ React23.createElement(Text18, { style: styles19.cancelText }, t.cancel)
11735
+ ), /* @__PURE__ */ React23.createElement(
11736
+ Pressable17,
11318
11737
  {
11319
11738
  accessibilityRole: "button",
11320
11739
  onPress: _start,
11321
- style: styles18.startButton
11740
+ style: styles19.startButton
11322
11741
  },
11323
- /* @__PURE__ */ React22.createElement(Text17, { style: styles18.stopText }, t.startTest)
11324
- ))) : /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Text17, { style: styles18.subtitle }, status === "starting" && t.starting, status === "running" && t.running(actionCount), status === "paused" && t.paused, status === "ended" && t.ended, status === "error" && (errorMessage2?.[language] ?? t.error)), status === "running" || status === "paused" ? /* @__PURE__ */ React22.createElement(Text17, { style: styles18.hint }, t.hint) : null, /* @__PURE__ */ React22.createElement(
11325
- Pressable16,
11742
+ /* @__PURE__ */ React23.createElement(Text18, { style: styles19.stopText }, t.startTest)
11743
+ ))) : /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Text18, { style: styles19.subtitle }, status === "starting" && t.starting, status === "running" && t.running(actionCount), status === "paused" && t.paused, status === "ended" && t.ended, status === "error" && (errorMessage2?.[language] ?? t.error)), status === "running" || status === "paused" ? /* @__PURE__ */ React23.createElement(Text18, { style: styles19.hint }, t.hint) : null, /* @__PURE__ */ React23.createElement(
11744
+ Pressable17,
11326
11745
  {
11327
11746
  accessibilityRole: "button",
11328
11747
  onPress: onStopPress,
11329
- style: styles18.stopButton
11748
+ style: styles19.stopButton
11330
11749
  },
11331
- /* @__PURE__ */ React22.createElement(Text17, { style: styles18.stopText }, status === "ended" ? t.close : t.stop)
11750
+ /* @__PURE__ */ React23.createElement(Text18, { style: styles19.stopText }, status === "ended" ? t.close : t.stop)
11332
11751
  )))
11333
11752
  )
11334
11753
  );
11335
11754
  }
11336
- var styles18 = StyleSheet18.create({
11755
+ var styles19 = StyleSheet19.create({
11337
11756
  backdrop: {
11338
11757
  flex: 1,
11339
11758
  backgroundColor: "rgba(124, 58, 237, 0.18)",
@@ -11440,84 +11859,1107 @@ var styles18 = StyleSheet18.create({
11440
11859
  }
11441
11860
  });
11442
11861
 
11443
- // src/TesterPayKitWrapper.tsx
11444
- var SHAKE_MIN_INTERVAL_MS = 1500;
11445
- function TesterPayKitWrapper({
11446
- children,
11447
- tpk,
11448
- enableWrapper = true,
11449
- enableShake = true,
11450
- shakeThresholdG = 2.7,
11451
- style,
11452
- onShowDebugLogs,
11453
- notificationCount,
11454
- onFlushCachedCrashes,
11455
- retestCount,
11456
- onShowRetests,
11457
- onViewDashboard,
11458
- buttonPosition,
11459
- currentScreen,
11460
- sessionStartedAt,
11461
- aiCoordinatorToken,
11462
- aiRemoteTrigger = false,
11463
- aiRemotePollSeconds = 15,
11464
- aiProjectId,
11465
- aiApiBaseUrl,
11466
- theme,
11467
- language,
11468
- testID = "tpk-wrapper"
11469
- }) {
11470
- const rootRef = useRef10(null);
11471
- const [bugOpen, setBugOpen] = useState19(false);
11472
- const [bugInitialDraft, setBugInitialDraft] = useState19(null);
11473
- const [feedbackOpen, setFeedbackOpen] = useState19(false);
11474
- const [voiceOpen, setVoiceOpen] = useState19(false);
11475
- const [sessionEndOpen, setSessionEndOpen] = useState19(false);
11476
- const [aiOpen, setAiOpen] = useState19(false);
11477
- const [myBugsOpen, setMyBugsOpen] = useState19(false);
11478
- const [sessionDetailsOpen, setSessionDetailsOpen] = useState19(false);
11479
- const [messagesOpen, setMessagesOpen] = useState19(false);
11480
- const [unreadMessages, setUnreadMessages] = useState19(0);
11481
- const [retestsOpen, setRetestsOpen] = useState19(false);
11482
- const [openRetests, setOpenRetests] = useState19(0);
11483
- const refreshRetests = useCallback11(() => {
11484
- if (!tpk || retestCount !== void 0) return;
11485
- void tpk.ready.then(() => tpk.api.getMyRetests()).then((list) => setOpenRetests(list.length)).catch(() => void 0);
11486
- }, [tpk, retestCount]);
11487
- useEffect15(() => {
11488
- refreshRetests();
11489
- }, [refreshRetests]);
11490
- const aiReady = Boolean(aiCoordinatorToken && aiProjectId && aiApiBaseUrl);
11491
- const onAutoTest = aiReady ? () => setAiOpen(true) : void 0;
11492
- const [remoteSession, setRemoteSession] = useState19(
11493
- null
11494
- );
11495
- const remoteSessionRef = useRef10(null);
11496
- useEffect15(() => {
11497
- remoteSessionRef.current = remoteSession;
11498
- }, [remoteSession]);
11499
- useEffect15(() => {
11500
- if (!aiRemoteTrigger || !tpk || aiOpen) return;
11501
- let busy = false;
11502
- const poll = async () => {
11503
- if (busy || AppState3.currentState !== "active") return;
11504
- busy = true;
11862
+ // src/live/live-link.ts
11863
+ var OPEN = 1;
11864
+ var TpkLiveLink = class {
11865
+ constructor(opts) {
11866
+ this.socket = null;
11867
+ this.retry = null;
11868
+ this.wanted = false;
11869
+ this.failures = 0;
11870
+ /** Bumped on every connect attempt and on stop, so late callbacks of
11871
+ * an abandoned socket do nothing. */
11872
+ this.generation = 0;
11873
+ this._status = "off";
11874
+ this.listeners = /* @__PURE__ */ new Set();
11875
+ this.opts = opts;
11876
+ }
11877
+ get status() {
11878
+ return this._status;
11879
+ }
11880
+ /** Subscribe to status changes. Returns the unsubscribe function. */
11881
+ onStatus(listener) {
11882
+ this.listeners.add(listener);
11883
+ return () => {
11884
+ this.listeners.delete(listener);
11885
+ };
11886
+ }
11887
+ /** Opens the link and keeps it open until `stop`. */
11888
+ start() {
11889
+ if (this.wanted) return;
11890
+ this.wanted = true;
11891
+ this.failures = 0;
11892
+ void this.connect();
11893
+ }
11894
+ stop() {
11895
+ this.wanted = false;
11896
+ this.generation++;
11897
+ if (this.retry) clearTimeout(this.retry);
11898
+ this.retry = null;
11899
+ this.close();
11900
+ this.setStatus("off");
11901
+ }
11902
+ dispose() {
11903
+ this.stop();
11904
+ this.listeners.clear();
11905
+ }
11906
+ setStatus(s) {
11907
+ if (this._status === s) return;
11908
+ this._status = s;
11909
+ for (const l of this.listeners) {
11505
11910
  try {
11506
- const claimed = await tpk.claimRemoteAiSession();
11507
- if (claimed) {
11508
- setRemoteSession(claimed);
11509
- setAiOpen(true);
11510
- }
11911
+ l(s);
11511
11912
  } catch {
11512
- } finally {
11513
- busy = false;
11514
11913
  }
11914
+ }
11915
+ }
11916
+ async connect() {
11917
+ if (!this.wanted) return;
11918
+ const gen = ++this.generation;
11919
+ this.setStatus("connecting");
11920
+ let url;
11921
+ try {
11922
+ url = await this.opts.openChannel();
11923
+ } catch (e) {
11924
+ if (gen === this.generation) this.fail(`open failed: ${errText(e)}`);
11925
+ return;
11926
+ }
11927
+ if (!this.wanted || gen !== this.generation) return;
11928
+ let ws;
11929
+ try {
11930
+ ws = this.opts.createSocket ? this.opts.createSocket(url) : new WebSocket(url);
11931
+ } catch (e) {
11932
+ this.fail(`socket failed: ${errText(e)}`);
11933
+ return;
11934
+ }
11935
+ this.socket = ws;
11936
+ let dropped = false;
11937
+ const drop = (why) => {
11938
+ if (dropped || gen !== this.generation) return;
11939
+ dropped = true;
11940
+ this.fail(why);
11515
11941
  };
11516
- void poll();
11517
- const timer = setInterval(poll, aiRemotePollSeconds * 1e3);
11518
- return () => clearInterval(timer);
11942
+ ws.onopen = () => {
11943
+ if (gen !== this.generation) return;
11944
+ void (async () => {
11945
+ let hello = {};
11946
+ try {
11947
+ hello = await this.opts.hello();
11948
+ } catch {
11949
+ }
11950
+ if (gen !== this.generation) return;
11951
+ this.send(ws, { type: "hello", ...hello });
11952
+ this.failures = 0;
11953
+ this.setStatus("connected");
11954
+ TpkTalker.info("Live link connected");
11955
+ })();
11956
+ };
11957
+ ws.onmessage = (ev) => {
11958
+ if (gen !== this.generation) return;
11959
+ void this.onFrame(ws, ev.data);
11960
+ };
11961
+ ws.onerror = () => drop("socket error");
11962
+ ws.onclose = () => drop("socket closed");
11963
+ }
11964
+ fail(why) {
11965
+ TpkTalker.warn(`Live link: ${why}`);
11966
+ this.close();
11967
+ if (!this.wanted) return;
11968
+ this.setStatus("connecting");
11969
+ this.failures++;
11970
+ const seconds = Math.min(30, 2 ** Math.min(this.failures, 5));
11971
+ if (this.retry) clearTimeout(this.retry);
11972
+ this.retry = setTimeout(() => {
11973
+ this.retry = null;
11974
+ void this.connect();
11975
+ }, seconds * 1e3);
11976
+ }
11977
+ close() {
11978
+ const ws = this.socket;
11979
+ this.socket = null;
11980
+ if (!ws) return;
11981
+ ws.onopen = ws.onmessage = ws.onerror = ws.onclose = null;
11982
+ try {
11983
+ ws.close(1e3, "bye");
11984
+ } catch {
11985
+ }
11986
+ }
11987
+ send(ws, msg) {
11988
+ try {
11989
+ if (ws.readyState === OPEN) ws.send(JSON.stringify(msg));
11990
+ } catch (e) {
11991
+ TpkTalker.warn(`Live link: send failed: ${errText(e)}`);
11992
+ }
11993
+ }
11994
+ async onFrame(ws, raw) {
11995
+ let msg;
11996
+ try {
11997
+ msg = JSON.parse(typeof raw === "string" ? raw : String(raw));
11998
+ } catch {
11999
+ return;
12000
+ }
12001
+ if (!msg || typeof msg !== "object") return;
12002
+ const requestId = msg.requestId;
12003
+ let reply;
12004
+ if (msg.type === "snapshot_request") {
12005
+ try {
12006
+ reply = { type: "snapshot", requestId, data: await this.opts.capture() };
12007
+ } catch (e) {
12008
+ reply = { type: "snapshot", requestId, error: errText(e) };
12009
+ }
12010
+ } else if (msg.type === "action") {
12011
+ try {
12012
+ if (!this.opts.act) throw new Error("This app does not accept device actions");
12013
+ reply = { type: "action_result", requestId, data: await this.opts.act(msg) };
12014
+ } catch (e) {
12015
+ reply = { type: "action_result", requestId, error: errText(e) };
12016
+ }
12017
+ } else {
12018
+ return;
12019
+ }
12020
+ this.send(ws, reply);
12021
+ }
12022
+ };
12023
+ function errText(e) {
12024
+ return e instanceof Error ? e.message : String(e);
12025
+ }
12026
+
12027
+ // src/live/screen-text.ts
12028
+ import { Dimensions as Dimensions4 } from "react-native";
12029
+ var HOST_COMPONENT = 5;
12030
+ var HOST_TEXT = 6;
12031
+ var OFFSCREEN = 22;
12032
+ var MAX_ENTRIES = 300;
12033
+ var MAX_TEXT = 300;
12034
+ var MEASURE_TIMEOUT_MS = 400;
12035
+ var ccLike = /\b(?:\d[ -]?){13,19}\b/g;
12036
+ var ibanLike = /\b[A-Z]{2}\d{2}[A-Z0-9]{10,30}\b/g;
12037
+ function propsOf(f) {
12038
+ const p = f.memoizedProps;
12039
+ return p && typeof p === "object" ? p : {};
12040
+ }
12041
+ function isButton(p) {
12042
+ return p.accessibilityRole === "button" || p.role === "button" || typeof p.onPress === "function";
12043
+ }
12044
+ function isTextInput(f) {
12045
+ if (f.tag !== HOST_COMPONENT || typeof f.type !== "string") return false;
12046
+ return /TextInput/i.test(f.type) || f.type === "input" || f.type === "textarea";
12047
+ }
12048
+ function isSecure(p) {
12049
+ if (p.secureTextEntry === true || p.type === "password") return true;
12050
+ const hint = `${p.textContentType ?? ""} ${p.autoComplete ?? ""}`.toLowerCase();
12051
+ return /password|cc-|creditcard|one-time-code/.test(hint);
12052
+ }
12053
+ function scrub(text) {
12054
+ return text.replace(ccLike, "[redacted]").replace(ibanLike, "[redacted]");
12055
+ }
12056
+ function clip(text) {
12057
+ const t = text.replace(/\s+/g, " ").trim();
12058
+ return t.length > MAX_TEXT ? `${t.slice(0, MAX_TEXT)}\u2026` : t;
12059
+ }
12060
+ function collectTexts(root) {
12061
+ const out = [];
12062
+ const walk = (f, inButton, host) => {
12063
+ let produced = false;
12064
+ for (let cur = f; cur && out.length < MAX_ENTRIES; cur = cur.sibling) {
12065
+ if (cur.type === TpkSensitive) continue;
12066
+ if (cur.tag === OFFSCREEN && cur.memoizedState != null) continue;
12067
+ const p = propsOf(cur);
12068
+ const button = inButton || isButton(p);
12069
+ if (cur.tag === HOST_TEXT) {
12070
+ const s = typeof cur.memoizedProps === "string" ? cur.memoizedProps : "";
12071
+ if (s.trim()) {
12072
+ const last = out[out.length - 1];
12073
+ if (last && last.node === host && host != null) {
12074
+ last.text += s;
12075
+ } else {
12076
+ out.push({ tag: button ? "button" : "text", text: s, node: host });
12077
+ }
12078
+ produced = true;
12079
+ }
12080
+ continue;
12081
+ }
12082
+ if (isTextInput(cur)) {
12083
+ const raw = p.value ?? p.text ?? p.defaultValue;
12084
+ const value = typeof raw === "string" ? raw : "";
12085
+ const placeholder = typeof p.placeholder === "string" ? p.placeholder : "";
12086
+ let text;
12087
+ if (isSecure(p)) {
12088
+ text = placeholder ? `[secure: ${placeholder}]` : "[secure]";
12089
+ } else {
12090
+ text = value || (placeholder ? `[placeholder: ${placeholder}]` : "");
12091
+ }
12092
+ if (text) {
12093
+ out.push({ tag: "textfield", text, node: cur.stateNode });
12094
+ produced = true;
12095
+ }
12096
+ continue;
12097
+ }
12098
+ const own = p.children;
12099
+ if (cur.tag === HOST_COMPONENT && (typeof own === "string" || typeof own === "number")) {
12100
+ const s = String(own);
12101
+ if (s.trim()) {
12102
+ out.push({ tag: button ? "button" : "text", text: s, node: cur.stateNode });
12103
+ produced = true;
12104
+ continue;
12105
+ }
12106
+ }
12107
+ const nextHost = cur.tag === HOST_COMPONENT ? cur.stateNode : host;
12108
+ const childProduced = walk(cur.child, button, nextHost);
12109
+ produced = produced || childProduced;
12110
+ if (!childProduced && cur.tag === HOST_COMPONENT) {
12111
+ const label = p.accessibilityLabel ?? p["aria-label"];
12112
+ if (typeof label === "string" && label.trim()) {
12113
+ out.push({ tag: button ? "button" : "label", text: label, node: cur.stateNode });
12114
+ produced = true;
12115
+ }
12116
+ }
12117
+ }
12118
+ return produced;
12119
+ };
12120
+ try {
12121
+ walk(root, false, null);
12122
+ } catch {
12123
+ return [];
12124
+ }
12125
+ return out;
12126
+ }
12127
+ function measure(node) {
12128
+ return new Promise((resolve) => {
12129
+ const done = (r) => resolve(r);
12130
+ const timer = setTimeout(() => done(null), MEASURE_TIMEOUT_MS);
12131
+ const finish = (r) => {
12132
+ clearTimeout(timer);
12133
+ done(r);
12134
+ };
12135
+ try {
12136
+ if (!node || typeof node !== "object") return finish(null);
12137
+ const n = node;
12138
+ if (typeof n.getBoundingClientRect === "function") {
12139
+ const r = n.getBoundingClientRect();
12140
+ return finish({ x: r.left, y: r.top, width: r.width, height: r.height });
12141
+ }
12142
+ const inst = n.canonical?.publicInstance ?? node;
12143
+ const cb = (x, y, width, height) => finish({ x, y, width, height });
12144
+ if (typeof inst.measureInWindow === "function") {
12145
+ inst.measureInWindow(cb);
12146
+ return;
12147
+ }
12148
+ const fabric = globalThis.nativeFabricUIManager;
12149
+ if (n.node && typeof fabric?.measureInWindow === "function") {
12150
+ fabric.measureInWindow(n.node, cb);
12151
+ return;
12152
+ }
12153
+ finish(null);
12154
+ } catch {
12155
+ finish(null);
12156
+ }
12157
+ });
12158
+ }
12159
+ async function readScreenTexts(root) {
12160
+ const found = collectTexts(root);
12161
+ if (found.length === 0) return [];
12162
+ let win = { width: Infinity, height: Infinity };
12163
+ try {
12164
+ const d = Dimensions4.get("window");
12165
+ if (d.width > 0 && d.height > 0) win = d;
12166
+ } catch {
12167
+ }
12168
+ const rects = await Promise.all(found.map((f) => measure(f.node)));
12169
+ const rows = [];
12170
+ found.forEach((f, i) => {
12171
+ const r = rects[i];
12172
+ if (r) {
12173
+ if (r.width <= 0 && r.height <= 0) return;
12174
+ if (r.y >= win.height || r.y + r.height <= 0) return;
12175
+ if (r.x >= win.width || r.x + r.width <= 0) return;
12176
+ }
12177
+ const text = clip(f.tag === "textfield" && f.text.startsWith("[secure") ? f.text : scrub(f.text));
12178
+ if (!text) return;
12179
+ rows.push({
12180
+ tag: f.tag,
12181
+ text,
12182
+ x: r ? Math.round(r.x) : 0,
12183
+ y: r ? Math.round(r.y) : 0,
12184
+ order: i,
12185
+ measured: r != null
12186
+ });
12187
+ });
12188
+ if (rows.every((r) => r.measured)) {
12189
+ rows.sort((a, b) => a.y - b.y || a.x - b.x || a.order - b.order);
12190
+ }
12191
+ return rows.map(({ tag, text, x, y }) => ({ tag, text, x, y }));
12192
+ }
12193
+ var HOST_ROOT = 3;
12194
+ function currentFiberOf(instance) {
12195
+ try {
12196
+ const start = instance?._reactInternals;
12197
+ if (!start) return null;
12198
+ let top = start;
12199
+ while (top && top.tag !== HOST_ROOT) top = top.return;
12200
+ const current = top?.stateNode?.current;
12201
+ if (!current) return start;
12202
+ const stack = [current];
12203
+ let budget = 5e3;
12204
+ while (stack.length && budget-- > 0) {
12205
+ const f = stack.pop();
12206
+ if (f.stateNode === instance) return f;
12207
+ if (f.sibling) stack.push(f.sibling);
12208
+ if (f.child) stack.push(f.child);
12209
+ }
12210
+ return start;
12211
+ } catch {
12212
+ return null;
12213
+ }
12214
+ }
12215
+
12216
+ // src/live/live-snapshot.ts
12217
+ function readLiveState(provider) {
12218
+ if (!provider) return void 0;
12219
+ try {
12220
+ const value = provider();
12221
+ if (value === void 0) return void 0;
12222
+ const json = JSON.stringify(value);
12223
+ return json === void 0 ? void 0 : JSON.parse(json);
12224
+ } catch (e) {
12225
+ return { error: `liveStateProvider failed: ${e instanceof Error ? e.message : String(e)}` };
12226
+ }
12227
+ }
12228
+ function recentLogs(limit = 30) {
12229
+ try {
12230
+ return TpkTalker.instance.history().slice(-limit).map((e) => `${new Date(e.timestamp).toISOString()} ${e.level} ${e.message}`);
12231
+ } catch {
12232
+ return [];
12233
+ }
12234
+ }
12235
+ async function safe(fn, fallback) {
12236
+ try {
12237
+ return await fn();
12238
+ } catch {
12239
+ return fallback;
12240
+ }
12241
+ }
12242
+ async function captureLiveSnapshot(src) {
12243
+ const crumbs = (() => {
12244
+ try {
12245
+ return src.breadcrumbs().slice(-15);
12246
+ } catch {
12247
+ return [];
12248
+ }
12249
+ })();
12250
+ const allCrumbs = (() => {
12251
+ try {
12252
+ return src.breadcrumbs();
12253
+ } catch {
12254
+ return [];
12255
+ }
12256
+ })();
12257
+ const screen = [...allCrumbs].reverse().find((b) => b.action === "navigation" && b.screen)?.screen;
12258
+ const read = src.readTexts ?? readScreenTexts;
12259
+ const texts = await safe(() => read(src.rootFiber?.() ?? null), []);
12260
+ const [app, shot] = await Promise.all([
12261
+ safe(src.app, {}),
12262
+ src.screenshot ? safe(src.screenshot, null) : Promise.resolve(null)
12263
+ ]);
12264
+ const appState = readLiveState(src.liveStateProvider);
12265
+ const out = {
12266
+ captured_at: (/* @__PURE__ */ new Date()).toISOString()
12267
+ };
12268
+ if (screen) out.screen = screen;
12269
+ out.navigation = deriveNavigationPath(allCrumbs, 10);
12270
+ out.texts = texts;
12271
+ if (appState !== void 0) out.app_state = appState;
12272
+ out.app = app;
12273
+ out.breadcrumbs = crumbs.map((b) => {
12274
+ const row = { type: b.action, at: b.t };
12275
+ if (b.screen) row.screen = b.screen;
12276
+ const message = b.target ?? (typeof b.data?.message === "string" ? b.data.message : void 0);
12277
+ if (message) row.message = message;
12278
+ return row;
12279
+ });
12280
+ out.logs = recentLogs();
12281
+ if (shot) out.screenshot = shot;
12282
+ return out;
12283
+ }
12284
+ async function liveAppInfo() {
12285
+ try {
12286
+ const A = await import("expo-application");
12287
+ return {
12288
+ name: A.applicationName ?? void 0,
12289
+ version: A.nativeApplicationVersion ?? void 0,
12290
+ build: A.nativeBuildVersion ?? void 0,
12291
+ bundleId: A.applicationId ?? void 0
12292
+ };
12293
+ } catch {
12294
+ return {};
12295
+ }
12296
+ }
12297
+
12298
+ // src/live/LiveNoteDialog.tsx
12299
+ import React24, { useEffect as useEffect16, useState as useState20 } from "react";
12300
+ import {
12301
+ ActivityIndicator as ActivityIndicator12,
12302
+ KeyboardAvoidingView as KeyboardAvoidingView2,
12303
+ Modal as Modal14,
12304
+ Platform as Platform9,
12305
+ Pressable as Pressable18,
12306
+ StyleSheet as StyleSheet20,
12307
+ Text as Text19,
12308
+ TextInput as TextInput8,
12309
+ View as View20
12310
+ } from "react-native";
12311
+ var CLAUDE_COLOR = "#D97757";
12312
+ function LiveNoteDialog({
12313
+ visible,
12314
+ sending = false,
12315
+ onCancel,
12316
+ onSend
12317
+ }) {
12318
+ const tr = useTr();
12319
+ const [text, setText] = useState20("");
12320
+ useEffect16(() => {
12321
+ if (visible) setText("");
12322
+ }, [visible]);
12323
+ if (!visible) return null;
12324
+ return /* @__PURE__ */ React24.createElement(Modal14, { transparent: true, animationType: "fade", visible: true, onRequestClose: onCancel }, /* @__PURE__ */ React24.createElement(
12325
+ KeyboardAvoidingView2,
12326
+ {
12327
+ style: styles20.backdrop,
12328
+ behavior: Platform9.OS === "ios" ? "padding" : void 0
12329
+ },
12330
+ /* @__PURE__ */ React24.createElement(View20, { style: styles20.card, testID: "tpk-live-note-dialog" }, /* @__PURE__ */ React24.createElement(Text19, { style: styles20.title }, tr({ en: "Send to Claude", de: "An Claude senden" })), /* @__PURE__ */ React24.createElement(
12331
+ TextInput8,
12332
+ {
12333
+ style: styles20.input,
12334
+ value: text,
12335
+ onChangeText: setText,
12336
+ autoFocus: true,
12337
+ multiline: true,
12338
+ autoCapitalize: "sentences",
12339
+ placeholder: tr({
12340
+ en: "What do you notice on this screen?",
12341
+ de: "Was f\xE4llt dir auf diesem Screen auf?"
12342
+ }),
12343
+ placeholderTextColor: "#94A3B8",
12344
+ testID: "tpk-live-note-input"
12345
+ }
12346
+ ), /* @__PURE__ */ React24.createElement(Text19, { style: styles20.helper }, tr({
12347
+ en: "Screenshot and screen contents are attached.",
12348
+ de: "Screenshot und Bildschirminhalt gehen mit."
12349
+ })), /* @__PURE__ */ React24.createElement(View20, { style: styles20.actions }, /* @__PURE__ */ React24.createElement(Pressable18, { onPress: onCancel, style: styles20.button, testID: "tpk-live-note-cancel" }, /* @__PURE__ */ React24.createElement(Text19, { style: styles20.cancel }, tr({ en: "Cancel", de: "Abbrechen" }))), /* @__PURE__ */ React24.createElement(
12350
+ Pressable18,
12351
+ {
12352
+ onPress: () => onSend(text),
12353
+ disabled: sending,
12354
+ style: [styles20.button, styles20.send],
12355
+ testID: "tpk-live-note-send"
12356
+ },
12357
+ sending ? /* @__PURE__ */ React24.createElement(ActivityIndicator12, { color: "#FFFFFF" }) : /* @__PURE__ */ React24.createElement(Text19, { style: styles20.sendText }, tr({ en: "Send", de: "Senden" }))
12358
+ )))
12359
+ ));
12360
+ }
12361
+ var styles20 = StyleSheet20.create({
12362
+ backdrop: {
12363
+ flex: 1,
12364
+ backgroundColor: "rgba(15,23,42,0.45)",
12365
+ justifyContent: "center",
12366
+ padding: 24
12367
+ },
12368
+ card: {
12369
+ backgroundColor: "#FFFFFF",
12370
+ borderRadius: 16,
12371
+ padding: 20,
12372
+ maxWidth: 480,
12373
+ width: "100%",
12374
+ alignSelf: "center"
12375
+ },
12376
+ title: { fontSize: 18, fontWeight: "600", color: "#0F172A", marginBottom: 12 },
12377
+ input: {
12378
+ minHeight: 64,
12379
+ maxHeight: 160,
12380
+ borderWidth: 1,
12381
+ borderColor: "#CBD5E1",
12382
+ borderRadius: 10,
12383
+ padding: 10,
12384
+ fontSize: 16,
12385
+ color: "#0F172A",
12386
+ textAlignVertical: "top"
12387
+ },
12388
+ helper: { fontSize: 12, color: "#64748B", marginTop: 6 },
12389
+ actions: { flexDirection: "row", justifyContent: "flex-end", marginTop: 16, gap: 8 },
12390
+ button: { paddingHorizontal: 16, paddingVertical: 10, borderRadius: 10, minWidth: 80, alignItems: "center" },
12391
+ cancel: { color: "#334155", fontSize: 15 },
12392
+ send: { backgroundColor: CLAUDE_COLOR },
12393
+ sendText: { color: "#FFFFFF", fontSize: 15, fontWeight: "600" }
12394
+ });
12395
+
12396
+ // src/live/live-actions.ts
12397
+ var DENY_LABEL_PATTERNS = [
12398
+ /\bdelete\s+(account|profile|user|workspace)\b/i,
12399
+ /\b(cancel|stop)\s+(subscription|plan|membership)\b/i,
12400
+ /\bprocess\s+payment\b/i,
12401
+ /\b(pay|charge|withdraw|transfer)\s+now\b/i,
12402
+ /\bsign\s*out\b/i,
12403
+ /\blog\s*out\b/i,
12404
+ /\b(löschen|kündigen|abmelden)\b/i
12405
+ ];
12406
+ function deniedBy(label) {
12407
+ for (const re of DENY_LABEL_PATTERNS) if (re.test(label)) return re;
12408
+ return null;
12409
+ }
12410
+ function parseLiveAction(raw) {
12411
+ const m = raw && typeof raw === "object" ? raw : {};
12412
+ const kind = m.kind;
12413
+ if (kind !== "tap" && kind !== "type" && kind !== "scroll" && kind !== "back") {
12414
+ throw new Error(`Unknown action kind: ${String(kind)}`);
12415
+ }
12416
+ const action = { kind };
12417
+ const t = m.target;
12418
+ if (t && typeof t === "object") {
12419
+ const tt = t;
12420
+ if (typeof tt.text === "string" && tt.text.trim()) action.target = { text: tt.text };
12421
+ else if (typeof tt.x === "number" && typeof tt.y === "number") action.target = { x: tt.x, y: tt.y };
12422
+ }
12423
+ if (typeof m.text === "string") action.text = m.text;
12424
+ if (m.submit === true) action.submit = true;
12425
+ if (m.direction === "up" || m.direction === "down" || m.direction === "left" || m.direction === "right") {
12426
+ action.direction = m.direction;
12427
+ }
12428
+ return action;
12429
+ }
12430
+ var MAX_FIBERS = 8e3;
12431
+ function walkFibers(root) {
12432
+ const out = [];
12433
+ const stack = [{ f: root, depth: 0 }];
12434
+ while (stack.length && out.length < MAX_FIBERS) {
12435
+ const { f, depth } = stack.pop();
12436
+ if (!f) continue;
12437
+ if (f.sibling) stack.push({ f: f.sibling, depth });
12438
+ if (f.type === TpkSensitive) continue;
12439
+ if (f.tag === OFFSCREEN && f.memoizedState != null) continue;
12440
+ out.push({ fiber: f, depth, order: out.length });
12441
+ if (f.child) stack.push({ f: f.child, depth: depth + 1 });
12442
+ }
12443
+ return out;
12444
+ }
12445
+ function norm(s) {
12446
+ return s.replace(/\s+/g, " ").trim().toLowerCase();
12447
+ }
12448
+ function ownText(f) {
12449
+ if (f.tag !== HOST_COMPONENT) return "";
12450
+ const p = propsOf(f);
12451
+ if (typeof p.children === "string" || typeof p.children === "number") return String(p.children);
12452
+ let s = "";
12453
+ for (let c = f.child; c; c = c.sibling) {
12454
+ if (c.tag === HOST_TEXT && typeof c.memoizedProps === "string") s += c.memoizedProps;
12455
+ }
12456
+ return s;
12457
+ }
12458
+ function a11yLabel(p) {
12459
+ const l = p.accessibilityLabel ?? p["aria-label"];
12460
+ return typeof l === "string" ? l : "";
12461
+ }
12462
+ function subtreeText(f) {
12463
+ const parts = [];
12464
+ const own = a11yLabel(propsOf(f));
12465
+ if (own) parts.push(own);
12466
+ for (const v of walkFibers(f.child)) {
12467
+ if (v.fiber.tag === HOST_TEXT && typeof v.fiber.memoizedProps === "string") parts.push(v.fiber.memoizedProps);
12468
+ else if (v.fiber.tag === HOST_COMPONENT) {
12469
+ const p = propsOf(v.fiber);
12470
+ if (typeof p.children === "string") parts.push(p.children);
12471
+ const l = a11yLabel(p);
12472
+ if (l) parts.push(l);
12473
+ }
12474
+ if (parts.length > 40) break;
12475
+ }
12476
+ return parts.join(" ");
12477
+ }
12478
+ function hostNodeOf(f) {
12479
+ if (f.tag === HOST_COMPONENT) return f.stateNode;
12480
+ for (const v of walkFibers(f.child)) {
12481
+ if (v.fiber.tag === HOST_COMPONENT) return v.fiber.stateNode;
12482
+ }
12483
+ return null;
12484
+ }
12485
+ function isDisabled(p) {
12486
+ const st = p.accessibilityState;
12487
+ return p.disabled === true || st?.disabled === true || p["aria-disabled"] === true;
12488
+ }
12489
+ function pressableAncestor(f, root) {
12490
+ const stop = root.return ?? null;
12491
+ for (let cur = f; cur && cur !== stop; cur = cur.return) {
12492
+ const p = propsOf(cur);
12493
+ if (typeof p.onPress === "function" || typeof p.onClick === "function") return cur;
12494
+ }
12495
+ return null;
12496
+ }
12497
+ function fakeEvent(target, x = 0, y = 0) {
12498
+ const noop2 = () => void 0;
12499
+ return {
12500
+ type: "press",
12501
+ nativeEvent: { pageX: x, pageY: y, locationX: 0, locationY: 0, timestamp: Date.now() },
12502
+ target,
12503
+ currentTarget: target,
12504
+ persist: noop2,
12505
+ preventDefault: noop2,
12506
+ stopPropagation: noop2,
12507
+ isDefaultPrevented: () => false,
12508
+ isPropagationStopped: () => false
12509
+ };
12510
+ }
12511
+ function invoke(fn, ...args) {
12512
+ const r = fn(...args);
12513
+ if (r && typeof r.catch === "function") {
12514
+ r.catch(() => void 0);
12515
+ }
12516
+ }
12517
+ async function visibleRect(env, node) {
12518
+ const m = env.measure ?? measure;
12519
+ let rect;
12520
+ try {
12521
+ rect = await m(node);
12522
+ } catch {
12523
+ rect = null;
12524
+ }
12525
+ if (!rect) return { rect: null, visible: true };
12526
+ const w = env.window?.width ?? Infinity;
12527
+ const h = env.window?.height ?? Infinity;
12528
+ const visible = (rect.width > 0 || rect.height > 0) && rect.y < h && rect.y + rect.height > 0 && rect.x < w && rect.x + rect.width > 0;
12529
+ return { rect, visible };
12530
+ }
12531
+ function unwrapSnapshotLabel(q) {
12532
+ const m = /^\[(?:placeholder|secure):\s*(.*)\]$/i.exec(q.trim());
12533
+ return m ? m[1] : q;
12534
+ }
12535
+ function score(label, query) {
12536
+ const l = norm(label);
12537
+ if (!l) return 0;
12538
+ if (l === query) return 3;
12539
+ if (query.length >= 2 && l.startsWith(query)) return 2;
12540
+ if (query.length >= 2 && l.includes(query)) return 1;
12541
+ return 0;
12542
+ }
12543
+ async function pickBest(env, cands) {
12544
+ if (!cands.length) return null;
12545
+ const top = Math.max(...cands.map((c) => c.score));
12546
+ const best = cands.filter((c) => c.score === top);
12547
+ const vis = await Promise.all(best.map((c) => visibleRect(env, hostNodeOf(c.fiber))));
12548
+ const shown = best.filter((_, i) => vis[i].visible);
12549
+ const pool = shown.length ? shown : best;
12550
+ return pool[pool.length - 1];
12551
+ }
12552
+ function refuseIfDenied(...labels) {
12553
+ for (const l of labels) {
12554
+ const re = l ? deniedBy(l) : null;
12555
+ if (re) throw new Error(`Refused: "${l.trim().slice(0, 60)}" matches the deny list (${re.source})`);
12556
+ }
12557
+ }
12558
+ function press(target, label, x, y) {
12559
+ const p = propsOf(target);
12560
+ if (isDisabled(p)) throw new Error(`"${label}" is disabled`);
12561
+ refuseIfDenied(label, subtreeText(target));
12562
+ const host = hostNodeOf(target);
12563
+ if (isTextInput(target)) {
12564
+ const n = host;
12565
+ if (typeof n?.focus === "function") n.focus();
12566
+ return { ok: true, matched: label, focused: true };
12567
+ }
12568
+ const fn = typeof p.onPress === "function" ? p.onPress : p.onClick;
12569
+ if (!fn) throw new Error(`"${label}" cannot be tapped (no onPress)`);
12570
+ invoke(fn, fakeEvent(host, x, y));
12571
+ return { ok: true, matched: label };
12572
+ }
12573
+ async function tapText(env, root, text) {
12574
+ const query = norm(unwrapSnapshotLabel(text));
12575
+ if (!query) throw new Error("Say what to tap");
12576
+ const cands = [];
12577
+ for (const v of walkFibers(root)) {
12578
+ const f = v.fiber;
12579
+ if (f.tag !== HOST_COMPONENT) continue;
12580
+ const p = propsOf(f);
12581
+ const labels = [ownText(f), a11yLabel(p)];
12582
+ if (isTextInput(f) && typeof p.placeholder === "string") labels.push(p.placeholder);
12583
+ const s = Math.max(...labels.map((l) => score(l, query)));
12584
+ if (s > 0) cands.push({ fiber: f, label: labels.find((l) => score(l, query) === s) ?? text, score: s, order: v.order });
12585
+ }
12586
+ const pressable = [];
12587
+ for (const c of cands) {
12588
+ const target = isTextInput(c.fiber) ? c.fiber : pressableAncestor(c.fiber, root);
12589
+ if (target) pressable.push({ ...c, fiber: target });
12590
+ }
12591
+ const hit = await pickBest(env, pressable);
12592
+ if (!hit) {
12593
+ if (cands.length) {
12594
+ refuseIfDenied(cands[cands.length - 1].label);
12595
+ throw new Error(`"${text}" is on screen but nothing tappable holds it`);
12596
+ }
12597
+ throw new Error(`Nothing on screen matches "${text}"`);
12598
+ }
12599
+ return press(hit.fiber, hit.label.trim() || text);
12600
+ }
12601
+ async function tapPoint(env, root, x, y) {
12602
+ const targets = [];
12603
+ for (const v of walkFibers(root)) {
12604
+ const p = propsOf(v.fiber);
12605
+ if (typeof p.onPress === "function" || typeof p.onClick === "function" || isTextInput(v.fiber)) {
12606
+ targets.push(v);
12607
+ if (targets.length >= 300) break;
12608
+ }
12609
+ }
12610
+ const rects = await Promise.all(targets.map((v) => visibleRect(env, hostNodeOf(v.fiber))));
12611
+ let best = null;
12612
+ targets.forEach((v, i) => {
12613
+ const r = rects[i].rect;
12614
+ if (!r || !rects[i].visible) return;
12615
+ if (x < r.x || x > r.x + r.width || y < r.y || y > r.y + r.height) return;
12616
+ const area = r.width * r.height;
12617
+ if (!best || area <= best.area) best = { v, area };
12618
+ });
12619
+ if (!best) throw new Error(`Nothing tappable at ${Math.round(x)}, ${Math.round(y)}`);
12620
+ const f = best.v.fiber;
12621
+ const label = subtreeText(f).trim().slice(0, 80) || `${Math.round(x)}, ${Math.round(y)}`;
12622
+ return press(f, label, x, y);
12623
+ }
12624
+ function inputLabel(p) {
12625
+ return typeof p.placeholder === "string" && p.placeholder || a11yLabel(p) || "";
12626
+ }
12627
+ function sameInstance(stateNode, focused) {
12628
+ if (!stateNode || !focused) return false;
12629
+ if (stateNode === focused) return true;
12630
+ const s = stateNode;
12631
+ return s.canonical?.publicInstance === focused;
12632
+ }
12633
+ function handlerUp(f, root, name) {
12634
+ const stop = root.return ?? null;
12635
+ let hops = 0;
12636
+ for (let cur = f; cur && cur !== stop && hops < 6; cur = cur.return, hops++) {
12637
+ const fn = propsOf(cur)[name];
12638
+ if (typeof fn === "function") return { fn, at: cur };
12639
+ }
12640
+ return null;
12641
+ }
12642
+ function isDomInput(node) {
12643
+ return !!node && typeof node.dispatchEvent === "function" && "value" in node;
12644
+ }
12645
+ async function typeText(env, root, action) {
12646
+ const text = action.text ?? "";
12647
+ const inputs = walkFibers(root).filter((v) => isTextInput(v.fiber) && propsOf(v.fiber).editable !== false && !isDisabled(propsOf(v.fiber))).map((v) => v.fiber);
12648
+ if (!inputs.length) throw new Error("No text field on screen");
12649
+ let field;
12650
+ let label;
12651
+ if (action.target?.text) {
12652
+ const query = norm(unwrapSnapshotLabel(action.target.text));
12653
+ const cands = [];
12654
+ inputs.forEach((f, order) => {
12655
+ const p = propsOf(f);
12656
+ const value = typeof p.value === "string" ? p.value : "";
12657
+ const s = Math.max(score(inputLabel(p), query), score(a11yLabel(p), query), value ? score(value, query) : 0);
12658
+ if (s > 0) cands.push({ fiber: f, label: inputLabel(p) || action.target.text, score: s, order });
12659
+ });
12660
+ const hit = await pickBest(env, cands);
12661
+ if (!hit) throw new Error(`No text field matches "${action.target.text}"`);
12662
+ field = hit.fiber;
12663
+ label = hit.label;
12664
+ } else {
12665
+ let focused = null;
12666
+ try {
12667
+ focused = env.focusedInput?.() ?? null;
12668
+ } catch {
12669
+ focused = null;
12670
+ }
12671
+ if (!focused && typeof document !== "undefined") focused = document.activeElement;
12672
+ field = inputs.find((f) => sameInstance(f.stateNode, focused)) ?? null;
12673
+ if (!field && inputs.length === 1) field = inputs[0];
12674
+ if (!field) throw new Error("No field is focused \u2014 say which one (into: its placeholder or label)");
12675
+ label = inputLabel(propsOf(field)) || "focused field";
12676
+ }
12677
+ const node = field.stateNode;
12678
+ if (isDomInput(node)) {
12679
+ const proto = Object.getPrototypeOf(node);
12680
+ const setter = Object.getOwnPropertyDescriptor(proto, "value")?.set;
12681
+ if (setter) setter.call(node, text);
12682
+ else node.value = text;
12683
+ const Ev = node.ownerDocument?.defaultView?.Event ?? Event;
12684
+ node.dispatchEvent(new Ev("input", { bubbles: true }));
12685
+ } else {
12686
+ const change = handlerUp(field, root, "onChangeText");
12687
+ if (change) {
12688
+ invoke(change.fn, text);
12689
+ } else {
12690
+ const onChange = handlerUp(field, root, "onChange");
12691
+ if (onChange) invoke(onChange.fn, { nativeEvent: { text }, target: node });
12692
+ }
12693
+ const composite = change?.at ?? field;
12694
+ if (propsOf(composite).value === void 0) {
12695
+ const inst = node?.canonical?.publicInstance ?? node;
12696
+ try {
12697
+ inst?.setNativeProps?.({ text });
12698
+ } catch {
12699
+ }
12700
+ }
12701
+ }
12702
+ let submitted = false;
12703
+ if (action.submit) {
12704
+ const submit = handlerUp(field, root, "onSubmitEditing");
12705
+ if (submit) {
12706
+ refuseIfDenied(label);
12707
+ invoke(submit.fn, { nativeEvent: { text }, target: node });
12708
+ submitted = true;
12709
+ } else if (isDomInput(node)) {
12710
+ const form = node.form;
12711
+ if (form && typeof form.requestSubmit === "function") {
12712
+ form.requestSubmit();
12713
+ submitted = true;
12714
+ }
12715
+ }
12716
+ }
12717
+ return { ok: true, matched: label, ...action.submit ? { submitted } : {} };
12718
+ }
12719
+ var lastOffset = /* @__PURE__ */ new WeakMap();
12720
+ function nameOf(f) {
12721
+ const t = f.type;
12722
+ if (typeof t === "string") return t;
12723
+ return t?.displayName || t?.name || "list";
12724
+ }
12725
+ async function scroll(env, root, direction) {
12726
+ const horizontal = direction === "left" || direction === "right";
12727
+ const seenHosts = /* @__PURE__ */ new Set();
12728
+ const found = [];
12729
+ for (const v of walkFibers(root)) {
12730
+ const inst = v.fiber.stateNode;
12731
+ if (!inst || typeof inst !== "object") continue;
12732
+ if (typeof inst.scrollTo !== "function" && typeof inst.scrollToOffset !== "function") continue;
12733
+ if (v.fiber.tag === HOST_COMPONENT) continue;
12734
+ if (propsOf(v.fiber).horizontal === true !== horizontal) continue;
12735
+ const host = hostNodeOf(v.fiber);
12736
+ if (host && seenHosts.has(host)) continue;
12737
+ seenHosts.add(host);
12738
+ found.push({ f: v.fiber, inst, host, order: v.order });
12739
+ }
12740
+ if (!found.length) throw new Error(`Nothing on screen scrolls ${horizontal ? "sideways" : "vertically"}`);
12741
+ const rects = await Promise.all(found.map((c2) => visibleRect(env, c2.host)));
12742
+ let pick = found.length - 1;
12743
+ let bestArea = -1;
12744
+ found.forEach((_, i) => {
12745
+ const r = rects[i];
12746
+ if (!r.visible) return;
12747
+ const area = r.rect ? r.rect.width * r.rect.height : 0;
12748
+ if (area >= bestArea) {
12749
+ bestArea = area;
12750
+ pick = i;
12751
+ }
12752
+ });
12753
+ const c = found[pick];
12754
+ const rect = rects[pick].rect;
12755
+ const frame = horizontal ? rect?.width : rect?.height;
12756
+ const win = horizontal ? env.window?.width : env.window?.height;
12757
+ const step = Math.round(0.8 * (frame && frame > 0 ? frame : win && Number.isFinite(win) ? win : 600));
12758
+ const metrics = c.inst._listRef?._scrollMetrics ?? c.inst._scrollMetrics;
12759
+ const dom = c.host;
12760
+ const domOffset = horizontal ? dom?.scrollLeft : dom?.scrollTop;
12761
+ const current = typeof metrics?.offset === "number" ? metrics.offset : typeof domOffset === "number" ? domOffset : lastOffset.get(c.inst) ?? 0;
12762
+ let next = direction === "down" || direction === "right" ? current + step : current - step;
12763
+ if (typeof metrics?.contentLength === "number" && typeof metrics.visibleLength === "number" && metrics.contentLength > 0) {
12764
+ next = Math.min(next, Math.max(0, metrics.contentLength - metrics.visibleLength));
12765
+ }
12766
+ next = Math.max(0, Math.round(next));
12767
+ if (typeof c.inst.scrollToOffset === "function") {
12768
+ c.inst.scrollToOffset({ offset: next, animated: false });
12769
+ } else {
12770
+ c.inst.scrollTo(horizontal ? { x: next, animated: false } : { y: next, animated: false });
12771
+ }
12772
+ lastOffset.set(c.inst, next);
12773
+ return { ok: true, matched: nameOf(c.f), offset: next, moved: next !== current };
12774
+ }
12775
+ function back(env, root) {
12776
+ let best = null;
12777
+ for (const v of walkFibers(root)) {
12778
+ const p = propsOf(v.fiber);
12779
+ const nav = p.navigation;
12780
+ if (!nav || typeof nav !== "object" || typeof nav.goBack !== "function") continue;
12781
+ let ok;
12782
+ try {
12783
+ ok = (nav.isFocused?.() ?? true) && (nav.canGoBack?.() ?? false);
12784
+ } catch {
12785
+ ok = false;
12786
+ }
12787
+ if (!ok) continue;
12788
+ if (!best || v.depth >= best.depth) {
12789
+ const route = p.route?.name;
12790
+ best = { nav, depth: v.depth, route };
12791
+ }
12792
+ }
12793
+ if (best) {
12794
+ best.nav.goBack();
12795
+ return { ok: true, matched: best.route ? `back from ${best.route}` : "back" };
12796
+ }
12797
+ if (env.historyBack?.()) return { ok: true, matched: "history.back" };
12798
+ throw new Error(
12799
+ "Back is not supported here: no react-navigation / expo-router screen that can go back"
12800
+ );
12801
+ }
12802
+ async function runLiveAction(raw, env) {
12803
+ const action = parseLiveAction(raw);
12804
+ const root = env.root;
12805
+ if (!root) throw new Error("The app shows nothing the SDK can reach");
12806
+ switch (action.kind) {
12807
+ case "tap": {
12808
+ const t = action.target;
12809
+ if (t?.text) return tapText(env, root, t.text);
12810
+ if (t && typeof t.x === "number" && typeof t.y === "number") return tapPoint(env, root, t.x, t.y);
12811
+ throw new Error("Say what to tap: text or x/y");
12812
+ }
12813
+ case "type":
12814
+ if (typeof action.text !== "string") throw new Error("type needs text");
12815
+ return typeText(env, root, action);
12816
+ case "scroll":
12817
+ return scroll(env, root, action.direction ?? "down");
12818
+ case "back":
12819
+ return back(env, root);
12820
+ }
12821
+ }
12822
+
12823
+ // src/live/LiveActionHint.tsx
12824
+ import React25 from "react";
12825
+ import { StyleSheet as StyleSheet21, Text as Text20, View as View21 } from "react-native";
12826
+ function liveActionHintText(kind, label, language) {
12827
+ const l = label.trim().slice(0, 60);
12828
+ const de = language === "de";
12829
+ switch (kind) {
12830
+ case "tap":
12831
+ return de ? `Claude tippt: ${l}` : `Claude taps: ${l}`;
12832
+ case "type":
12833
+ return de ? `Claude schreibt: ${l}` : `Claude types: ${l}`;
12834
+ case "scroll": {
12835
+ const dir = de ? { up: "hoch", down: "runter", left: "nach links", right: "nach rechts" }[l] ?? l : l;
12836
+ return de ? `Claude scrollt ${dir}` : `Claude scrolls ${dir}`;
12837
+ }
12838
+ case "back":
12839
+ return de ? "Claude geht zur\xFCck" : "Claude goes back";
12840
+ }
12841
+ }
12842
+ function LiveActionHint({ text, top }) {
12843
+ if (!text) return null;
12844
+ return /* @__PURE__ */ React25.createElement(View21, { pointerEvents: "none", style: [styles21.wrap, { top }], testID: "tpk-live-action-hint" }, /* @__PURE__ */ React25.createElement(View21, { style: styles21.pill }, /* @__PURE__ */ React25.createElement(Text20, { style: styles21.text, numberOfLines: 1 }, text)));
12845
+ }
12846
+ var styles21 = StyleSheet21.create({
12847
+ wrap: { position: "absolute", left: 0, right: 0, alignItems: "center" },
12848
+ pill: {
12849
+ backgroundColor: "rgba(217, 119, 87, 0.95)",
12850
+ borderRadius: 16,
12851
+ paddingHorizontal: 14,
12852
+ paddingVertical: 6,
12853
+ maxWidth: "90%"
12854
+ },
12855
+ text: { color: "#FFF", fontSize: 13, fontWeight: "700" }
12856
+ });
12857
+
12858
+ // src/TesterPayKitWrapper.tsx
12859
+ var LiveContentAnchor = class extends React26.Component {
12860
+ render() {
12861
+ return this.props.children;
12862
+ }
12863
+ };
12864
+ var LIVE_LINK_STORAGE_KEY = "live-link-on";
12865
+ async function liveStorage() {
12866
+ const { ExpoStorage: ExpoStorage2 } = await import("./storage-RD3WGNGX.mjs");
12867
+ return new ExpoStorage2();
12868
+ }
12869
+ var SHAKE_MIN_INTERVAL_MS = 1500;
12870
+ function TesterPayKitWrapper({
12871
+ children,
12872
+ tpk,
12873
+ enableWrapper = true,
12874
+ enableShake = true,
12875
+ shakeThresholdG = 2.7,
12876
+ style,
12877
+ onShowDebugLogs,
12878
+ notificationCount,
12879
+ onFlushCachedCrashes,
12880
+ retestCount,
12881
+ onShowRetests,
12882
+ onViewDashboard,
12883
+ buttonPosition,
12884
+ currentScreen,
12885
+ sessionStartedAt,
12886
+ aiCoordinatorToken,
12887
+ aiRemoteTrigger = false,
12888
+ aiRemotePollSeconds = 15,
12889
+ enableLiveLink = false,
12890
+ aiProjectId,
12891
+ aiApiBaseUrl,
12892
+ theme,
12893
+ language,
12894
+ testID = "tpk-wrapper"
12895
+ }) {
12896
+ const rootRef = useRef10(null);
12897
+ const contentRef = useRef10(null);
12898
+ const anchorRef = useRef10(null);
12899
+ const [bugOpen, setBugOpen] = useState21(false);
12900
+ const [bugInitialDraft, setBugInitialDraft] = useState21(null);
12901
+ const [feedbackOpen, setFeedbackOpen] = useState21(false);
12902
+ const [voiceOpen, setVoiceOpen] = useState21(false);
12903
+ const [sessionEndOpen, setSessionEndOpen] = useState21(false);
12904
+ const [aiOpen, setAiOpen] = useState21(false);
12905
+ const [myBugsOpen, setMyBugsOpen] = useState21(false);
12906
+ const [sessionDetailsOpen, setSessionDetailsOpen] = useState21(false);
12907
+ const [messagesOpen, setMessagesOpen] = useState21(false);
12908
+ const [unreadMessages, setUnreadMessages] = useState21(0);
12909
+ const [retestsOpen, setRetestsOpen] = useState21(false);
12910
+ const [openRetests, setOpenRetests] = useState21(0);
12911
+ const refreshRetests = useCallback12(() => {
12912
+ if (!tpk || retestCount !== void 0) return;
12913
+ void tpk.ready.then(() => tpk.api.getMyRetests()).then((list) => setOpenRetests(list.length)).catch(() => void 0);
12914
+ }, [tpk, retestCount]);
12915
+ useEffect17(() => {
12916
+ refreshRetests();
12917
+ }, [refreshRetests]);
12918
+ const [checklist, setChecklist] = useState21([]);
12919
+ const [checklistOpen, setChecklistOpen] = useState21(false);
12920
+ const refreshChecklist = useCallback12(() => {
12921
+ if (!enableWrapper || !tpk) return;
12922
+ void loadChecklist(tpk).then(setChecklist);
12923
+ }, [enableWrapper, tpk]);
12924
+ useEffect17(() => {
12925
+ if (!enableWrapper || !tpk) return;
12926
+ refreshChecklist();
12927
+ const sub = AppState3.addEventListener?.("change", (state) => {
12928
+ if (state === "active") refreshChecklist();
12929
+ });
12930
+ return () => sub?.remove();
12931
+ }, [enableWrapper, tpk, refreshChecklist]);
12932
+ const aiReady = Boolean(aiCoordinatorToken && aiProjectId && aiApiBaseUrl);
12933
+ const onAutoTest = aiReady ? () => setAiOpen(true) : void 0;
12934
+ const [remoteSession, setRemoteSession] = useState21(
12935
+ null
12936
+ );
12937
+ const remoteSessionRef = useRef10(null);
12938
+ useEffect17(() => {
12939
+ remoteSessionRef.current = remoteSession;
12940
+ }, [remoteSession]);
12941
+ useEffect17(() => {
12942
+ if (!aiRemoteTrigger || !tpk || aiOpen) return;
12943
+ let busy = false;
12944
+ const poll = async () => {
12945
+ if (busy || AppState3.currentState !== "active") return;
12946
+ busy = true;
12947
+ try {
12948
+ const claimed = await tpk.claimRemoteAiSession();
12949
+ if (claimed) {
12950
+ setRemoteSession(claimed);
12951
+ setAiOpen(true);
12952
+ }
12953
+ } catch {
12954
+ } finally {
12955
+ busy = false;
12956
+ }
12957
+ };
12958
+ void poll();
12959
+ const timer = setInterval(poll, aiRemotePollSeconds * 1e3);
12960
+ return () => clearInterval(timer);
11519
12961
  }, [aiRemoteTrigger, aiRemotePollSeconds, tpk, aiOpen]);
11520
- useEffect15(() => {
12962
+ useEffect17(() => {
11521
12963
  if (!aiOpen) return;
11522
12964
  const g = globalThis;
11523
12965
  g.__tpkCaptureScreenshot = async () => (await captureView(rootRef))?.base64 ?? null;
@@ -11525,19 +12967,187 @@ function TesterPayKitWrapper({
11525
12967
  delete g.__tpkCaptureScreenshot;
11526
12968
  };
11527
12969
  }, [aiOpen]);
12970
+ const liveEnabled = enableWrapper && enableLiveLink && tpk != null;
12971
+ const liveLinkRef = useRef10(null);
12972
+ const liveOnRef = useRef10(false);
12973
+ const [liveStatus, setLiveStatus] = useState21("off");
12974
+ const [noteOpen, setNoteOpen] = useState21(false);
12975
+ const [noteSending, setNoteSending] = useState21(false);
12976
+ const noteSnapshotRef = useRef10(null);
12977
+ const captureLive = useCallback12(async () => {
12978
+ if (!tpk) throw new Error("TPK client not ready");
12979
+ return captureLiveSnapshot({
12980
+ breadcrumbs: () => tpk.breadcrumbs.snapshot(),
12981
+ liveStateProvider: tpk.liveStateProvider,
12982
+ app: async () => {
12983
+ const { name, version: version2, build } = await liveAppInfo();
12984
+ return { name, version: version2, build };
12985
+ },
12986
+ rootFiber: () => currentFiberOf(anchorRef.current)?.child ?? null,
12987
+ screenshot: async () => (await captureView(contentRef))?.base64 ?? null
12988
+ });
12989
+ }, [tpk]);
12990
+ const [actionHint, setActionHint] = useState21(null);
12991
+ const hintTimer = useRef10(null);
12992
+ const showActionHint = useCallback12((text) => {
12993
+ setActionHint(text);
12994
+ if (hintTimer.current) clearTimeout(hintTimer.current);
12995
+ hintTimer.current = setTimeout(() => setActionHint(null), 1800);
12996
+ }, []);
12997
+ useEffect17(() => () => {
12998
+ if (hintTimer.current) clearTimeout(hintTimer.current);
12999
+ }, []);
13000
+ const runAction = useCallback12(
13001
+ async (raw) => {
13002
+ const action = parseLiveAction(raw);
13003
+ const result = await runLiveAction(action, {
13004
+ root: currentFiberOf(anchorRef.current)?.child ?? null,
13005
+ window: (() => {
13006
+ try {
13007
+ return Dimensions5.get("window");
13008
+ } catch {
13009
+ return void 0;
13010
+ }
13011
+ })(),
13012
+ focusedInput: () => TextInput9.State?.currentlyFocusedInput?.() ?? null,
13013
+ historyBack: () => {
13014
+ if (Platform10.OS !== "web") return false;
13015
+ const h = globalThis.history;
13016
+ if (!h || h.length <= 1) return false;
13017
+ h.back();
13018
+ return true;
13019
+ }
13020
+ });
13021
+ const label = action.kind === "scroll" ? action.direction ?? "down" : String(result.matched ?? "");
13022
+ showActionHint(
13023
+ liveActionHintText(action.kind, label, language ?? detectDeviceLanguage())
13024
+ );
13025
+ TpkTalker.info(`Live link: ${action.kind} ${label}`.trim());
13026
+ return result;
13027
+ },
13028
+ [showActionHint, language]
13029
+ );
13030
+ const runActionRef = useRef10(runAction);
13031
+ useEffect17(() => {
13032
+ runActionRef.current = runAction;
13033
+ }, [runAction]);
13034
+ const captureLiveRef = useRef10(captureLive);
13035
+ useEffect17(() => {
13036
+ captureLiveRef.current = captureLive;
13037
+ }, [captureLive]);
13038
+ useEffect17(() => {
13039
+ if (!liveEnabled || !tpk) return;
13040
+ const link = new TpkLiveLink({
13041
+ openChannel: async () => {
13042
+ await tpk.ready;
13043
+ return tpk.api.openLiveLink(tpk.projectId);
13044
+ },
13045
+ hello: async () => {
13046
+ const app = await liveAppInfo();
13047
+ return {
13048
+ app: app.bundleId ?? app.name ?? "unknown",
13049
+ appVersion: [app.version, app.build].filter(Boolean).join("+"),
13050
+ platform: Platform10.OS
13051
+ };
13052
+ },
13053
+ capture: () => captureLiveRef.current(),
13054
+ act: (action) => runActionRef.current(action)
13055
+ });
13056
+ liveLinkRef.current = link;
13057
+ const unsubscribe = link.onStatus(setLiveStatus);
13058
+ let cancelled = false;
13059
+ void (async () => {
13060
+ try {
13061
+ liveOnRef.current = await (await liveStorage()).get(LIVE_LINK_STORAGE_KEY) === true;
13062
+ } catch {
13063
+ liveOnRef.current = false;
13064
+ }
13065
+ if (!cancelled && liveOnRef.current && AppState3.currentState !== "background") {
13066
+ link.start();
13067
+ }
13068
+ })();
13069
+ const sub = AppState3.addEventListener?.("change", (state) => {
13070
+ if (state === "active") {
13071
+ if (liveOnRef.current) link.start();
13072
+ } else if (state === "background") {
13073
+ link.stop();
13074
+ }
13075
+ });
13076
+ return () => {
13077
+ cancelled = true;
13078
+ sub?.remove();
13079
+ unsubscribe();
13080
+ link.dispose();
13081
+ liveLinkRef.current = null;
13082
+ setLiveStatus("off");
13083
+ };
13084
+ }, [liveEnabled, tpk]);
13085
+ const onToggleLiveLink = useCallback12(() => {
13086
+ const link = liveLinkRef.current;
13087
+ if (!link) return;
13088
+ liveOnRef.current = !liveOnRef.current;
13089
+ if (liveOnRef.current) link.start();
13090
+ else link.stop();
13091
+ const on = liveOnRef.current;
13092
+ void liveStorage().then((st) => st.set(LIVE_LINK_STORAGE_KEY, on)).catch(() => void 0);
13093
+ }, []);
13094
+ const onSendToClaude = useCallback12(() => {
13095
+ void (async () => {
13096
+ try {
13097
+ noteSnapshotRef.current = await captureLiveRef.current();
13098
+ } catch (e) {
13099
+ TpkTalker.warn(`Send to Claude: capture failed: ${String(e)}`);
13100
+ noteSnapshotRef.current = {};
13101
+ }
13102
+ setNoteOpen(true);
13103
+ })();
13104
+ }, []);
13105
+ const sendNote = useCallback12(
13106
+ (text) => {
13107
+ if (!tpk) return;
13108
+ const snapshot = { ...noteSnapshotRef.current ?? {} };
13109
+ const screenshot = typeof snapshot.screenshot === "string" ? snapshot.screenshot : null;
13110
+ delete snapshot.screenshot;
13111
+ setNoteSending(true);
13112
+ void (async () => {
13113
+ try {
13114
+ await tpk.ready;
13115
+ await tpk.api.sendLiveNote({
13116
+ projectId: tpk.projectId,
13117
+ text,
13118
+ snapshot,
13119
+ screenshotBase64: screenshot
13120
+ });
13121
+ TpkTalker.info("Sent to Claude");
13122
+ setNoteOpen(false);
13123
+ noteSnapshotRef.current = null;
13124
+ } catch (e) {
13125
+ TpkTalker.warn(`Send to Claude failed: ${String(e)}`);
13126
+ const de = (language ?? detectDeviceLanguage()) === "de";
13127
+ Alert.alert(
13128
+ de ? "Senden fehlgeschlagen" : "Could not send",
13129
+ e instanceof Error ? e.message : String(e)
13130
+ );
13131
+ } finally {
13132
+ setNoteSending(false);
13133
+ }
13134
+ })();
13135
+ },
13136
+ [tpk, language]
13137
+ );
11528
13138
  const sessionAnchor = useRef10(sessionStartedAt ?? null);
11529
- useEffect15(() => {
13139
+ useEffect17(() => {
11530
13140
  if (sessionStartedAt) {
11531
13141
  sessionAnchor.current = sessionStartedAt;
11532
13142
  } else if (tpk && !sessionAnchor.current) {
11533
13143
  sessionAnchor.current = /* @__PURE__ */ new Date();
11534
13144
  }
11535
13145
  }, [tpk, sessionStartedAt]);
11536
- useEffect15(() => {
13146
+ useEffect17(() => {
11537
13147
  if (!tpk || !currentScreen) return;
11538
13148
  tpk.trackScreenView(currentScreen);
11539
13149
  }, [tpk, currentScreen]);
11540
- useEffect15(() => {
13150
+ useEffect17(() => {
11541
13151
  if (!tpk) return;
11542
13152
  let cancelled = false;
11543
13153
  tpk.getNotifications({ limit: 1 }).then((res) => {
@@ -11547,9 +13157,9 @@ function TesterPayKitWrapper({
11547
13157
  cancelled = true;
11548
13158
  };
11549
13159
  }, [tpk]);
11550
- useEffect15(() => {
13160
+ useEffect17(() => {
11551
13161
  if (!enableWrapper || !enableShake) return;
11552
- if (Platform9.OS === "web") return;
13162
+ if (Platform10.OS === "web") return;
11553
13163
  let teardown = null;
11554
13164
  let cancelled = false;
11555
13165
  let lastShakeAt = 0;
@@ -11586,14 +13196,14 @@ function TesterPayKitWrapper({
11586
13196
  voiceOpen,
11587
13197
  sessionEndOpen
11588
13198
  ]);
11589
- const onReportBug = useCallback11(() => setBugOpen(true), []);
11590
- const onGeneralFeedback = useCallback11(() => setFeedbackOpen(true), []);
11591
- const onEndSession = useCallback11(() => setSessionEndOpen(true), []);
11592
- const onLongPressVoiceBug = useCallback11(() => setVoiceOpen(true), []);
11593
- const handleAutoTap = useCallback11(() => {
13199
+ const onReportBug = useCallback12(() => setBugOpen(true), []);
13200
+ const onGeneralFeedback = useCallback12(() => setFeedbackOpen(true), []);
13201
+ const onEndSession = useCallback12(() => setSessionEndOpen(true), []);
13202
+ const onLongPressVoiceBug = useCallback12(() => setVoiceOpen(true), []);
13203
+ const handleAutoTap = useCallback12(() => {
11594
13204
  tpk?.trackTap(currentScreen ?? "unknown", "auto-tap");
11595
13205
  }, [tpk, currentScreen]);
11596
- const handleVoiceExtracted = useCallback11(
13206
+ const handleVoiceExtracted = useCallback12(
11597
13207
  (result, classification) => {
11598
13208
  setBugInitialDraft({
11599
13209
  type: classification === "idea" ? "featureRequest" : classification === "issue" ? "uiIssue" : classification,
@@ -11615,18 +13225,27 @@ function TesterPayKitWrapper({
11615
13225
  []
11616
13226
  );
11617
13227
  if (!enableWrapper) {
11618
- return /* @__PURE__ */ React23.createElement(React23.Fragment, null, children);
13228
+ return /* @__PURE__ */ React26.createElement(React26.Fragment, null, children);
11619
13229
  }
11620
- return /* @__PURE__ */ React23.createElement(TpkThemeProvider, { theme }, /* @__PURE__ */ React23.createElement(TpkLanguageProvider, { language }, /* @__PURE__ */ React23.createElement(
11621
- View19,
13230
+ return /* @__PURE__ */ React26.createElement(TpkThemeProvider, { theme }, /* @__PURE__ */ React26.createElement(TpkLanguageProvider, { language }, /* @__PURE__ */ React26.createElement(
13231
+ View22,
11622
13232
  {
11623
13233
  ref: rootRef,
11624
- style: [styles19.root, style],
13234
+ style: [styles22.root, style],
11625
13235
  testID,
11626
13236
  collapsable: false
11627
13237
  },
11628
- /* @__PURE__ */ React23.createElement(View19, { style: styles19.content, onTouchStart: handleAutoTap }, children),
11629
- /* @__PURE__ */ React23.createElement(
13238
+ /* @__PURE__ */ React26.createElement(
13239
+ View22,
13240
+ {
13241
+ ref: contentRef,
13242
+ style: styles22.content,
13243
+ onTouchStart: handleAutoTap,
13244
+ collapsable: false
13245
+ },
13246
+ /* @__PURE__ */ React26.createElement(LiveContentAnchor, { ref: anchorRef }, children)
13247
+ ),
13248
+ /* @__PURE__ */ React26.createElement(
11630
13249
  FloatingFeedbackButton,
11631
13250
  {
11632
13251
  position: buttonPosition,
@@ -11636,6 +13255,11 @@ function TesterPayKitWrapper({
11636
13255
  onEndSession,
11637
13256
  onShowDebugLogs,
11638
13257
  onAutoTest,
13258
+ onShowChecklist: checklist.length > 0 ? () => setChecklistOpen(true) : void 0,
13259
+ checklistCount: openTaskCount(checklist),
13260
+ onSendToClaude: liveEnabled ? onSendToClaude : void 0,
13261
+ onToggleLiveLink: liveEnabled ? onToggleLiveLink : void 0,
13262
+ liveLinkConnected: liveStatus !== "off",
11639
13263
  onLongPressVoiceBug,
11640
13264
  onFlushCachedCrashes,
11641
13265
  onShowRetests: onShowRetests ?? (() => setRetestsOpen(true)),
@@ -11648,7 +13272,7 @@ function TesterPayKitWrapper({
11648
13272
  sessionStartedAt: sessionAnchor.current ?? void 0
11649
13273
  }
11650
13274
  ),
11651
- (aiReady || remoteSession) && /* @__PURE__ */ React23.createElement(
13275
+ (aiReady || remoteSession) && /* @__PURE__ */ React26.createElement(
11652
13276
  AiRemoteControl,
11653
13277
  {
11654
13278
  visible: aiOpen,
@@ -11669,7 +13293,30 @@ function TesterPayKitWrapper({
11669
13293
  }
11670
13294
  }
11671
13295
  ),
11672
- /* @__PURE__ */ React23.createElement(
13296
+ /* @__PURE__ */ React26.createElement(
13297
+ ChecklistPanel,
13298
+ {
13299
+ visible: checklistOpen,
13300
+ tpk,
13301
+ tasks: checklist,
13302
+ onReload: refreshChecklist,
13303
+ onClose: () => setChecklistOpen(false)
13304
+ }
13305
+ ),
13306
+ liveEnabled && /* @__PURE__ */ React26.createElement(LiveActionHint, { text: actionHint, top: getModalInsets().top + 8 }),
13307
+ liveEnabled && /* @__PURE__ */ React26.createElement(
13308
+ LiveNoteDialog,
13309
+ {
13310
+ visible: noteOpen,
13311
+ sending: noteSending,
13312
+ onCancel: () => {
13313
+ setNoteOpen(false);
13314
+ noteSnapshotRef.current = null;
13315
+ },
13316
+ onSend: sendNote
13317
+ }
13318
+ ),
13319
+ /* @__PURE__ */ React26.createElement(
11673
13320
  BugReportSheet,
11674
13321
  {
11675
13322
  visible: bugOpen,
@@ -11691,7 +13338,7 @@ function TesterPayKitWrapper({
11691
13338
  }
11692
13339
  }
11693
13340
  ),
11694
- /* @__PURE__ */ React23.createElement(
13341
+ /* @__PURE__ */ React26.createElement(
11695
13342
  GeneralFeedbackDialog,
11696
13343
  {
11697
13344
  visible: feedbackOpen,
@@ -11700,7 +13347,7 @@ function TesterPayKitWrapper({
11700
13347
  onClose: () => setFeedbackOpen(false)
11701
13348
  }
11702
13349
  ),
11703
- /* @__PURE__ */ React23.createElement(
13350
+ /* @__PURE__ */ React26.createElement(
11704
13351
  VoiceBugInputSheet,
11705
13352
  {
11706
13353
  visible: voiceOpen,
@@ -11711,7 +13358,7 @@ function TesterPayKitWrapper({
11711
13358
  captureScreen: async () => (await captureView(rootRef))?.base64 ?? null
11712
13359
  }
11713
13360
  ),
11714
- /* @__PURE__ */ React23.createElement(
13361
+ /* @__PURE__ */ React26.createElement(
11715
13362
  SessionEndDialog,
11716
13363
  {
11717
13364
  visible: sessionEndOpen,
@@ -11731,7 +13378,7 @@ function TesterPayKitWrapper({
11731
13378
  }
11732
13379
  }
11733
13380
  ),
11734
- /* @__PURE__ */ React23.createElement(
13381
+ /* @__PURE__ */ React26.createElement(
11735
13382
  MyBugsSheet,
11736
13383
  {
11737
13384
  visible: myBugsOpen,
@@ -11739,7 +13386,7 @@ function TesterPayKitWrapper({
11739
13386
  onClose: () => setMyBugsOpen(false)
11740
13387
  }
11741
13388
  ),
11742
- /* @__PURE__ */ React23.createElement(
13389
+ /* @__PURE__ */ React26.createElement(
11743
13390
  SessionDetailsSheet,
11744
13391
  {
11745
13392
  visible: sessionDetailsOpen,
@@ -11747,7 +13394,7 @@ function TesterPayKitWrapper({
11747
13394
  onClose: () => setSessionDetailsOpen(false)
11748
13395
  }
11749
13396
  ),
11750
- /* @__PURE__ */ React23.createElement(
13397
+ /* @__PURE__ */ React26.createElement(
11751
13398
  NotificationsSheet,
11752
13399
  {
11753
13400
  visible: messagesOpen,
@@ -11756,7 +13403,7 @@ function TesterPayKitWrapper({
11756
13403
  onUnreadChange: setUnreadMessages
11757
13404
  }
11758
13405
  ),
11759
- /* @__PURE__ */ React23.createElement(
13406
+ /* @__PURE__ */ React26.createElement(
11760
13407
  RetestSheet,
11761
13408
  {
11762
13409
  visible: retestsOpen,
@@ -11767,7 +13414,7 @@ function TesterPayKitWrapper({
11767
13414
  )
11768
13415
  )));
11769
13416
  }
11770
- var styles19 = StyleSheet19.create({
13417
+ var styles22 = StyleSheet22.create({
11771
13418
  root: {
11772
13419
  flex: 1
11773
13420
  },
@@ -11781,9 +13428,9 @@ import {
11781
13428
  Children,
11782
13429
  cloneElement,
11783
13430
  isValidElement,
11784
- useCallback as useCallback12,
11785
- useEffect as useEffect16,
11786
- useMemo as useMemo10,
13431
+ useCallback as useCallback13,
13432
+ useEffect as useEffect18,
13433
+ useMemo as useMemo11,
11787
13434
  useRef as useRef11
11788
13435
  } from "react";
11789
13436
  function TpkAnnotated({
@@ -11807,7 +13454,7 @@ function TpkAnnotated({
11807
13454
  const childProps = child.props;
11808
13455
  const resolvedKey = elementKey ?? childProps.testID;
11809
13456
  const resolvedType = elementType ?? inferElementType(child);
11810
- useEffect16(() => {
13457
+ useEffect18(() => {
11811
13458
  const id = annotations.register({
11812
13459
  taskId: task,
11813
13460
  focusAreaId: focusArea,
@@ -11826,7 +13473,7 @@ function TpkAnnotated({
11826
13473
  annotationIdRef.current = null;
11827
13474
  };
11828
13475
  }, [task, focusArea, resolvedKey]);
11829
- useEffect16(() => {
13476
+ useEffect18(() => {
11830
13477
  if (!annotationIdRef.current) return;
11831
13478
  annotations.update(annotationIdRef.current, {
11832
13479
  semanticLabels: labels,
@@ -11844,13 +13491,13 @@ function TpkAnnotated({
11844
13491
  versionRange,
11845
13492
  metadata
11846
13493
  ]);
11847
- useEffect16(() => {
13494
+ useEffect18(() => {
11848
13495
  if (completionTrigger !== "on-visible") return;
11849
13496
  if (annotationIdRef.current) {
11850
13497
  annotations.recordInteraction(annotationIdRef.current);
11851
13498
  }
11852
13499
  }, [completionTrigger]);
11853
- const wrapHandler = useCallback12(
13500
+ const wrapHandler = useCallback13(
11854
13501
  (handler) => {
11855
13502
  const wrapped = ((...args) => {
11856
13503
  const id = annotationIdRef.current;
@@ -11861,7 +13508,7 @@ function TpkAnnotated({
11861
13508
  },
11862
13509
  []
11863
13510
  );
11864
- const triggeredHandlerName = useMemo10(() => {
13511
+ const triggeredHandlerName = useMemo11(() => {
11865
13512
  switch (completionTrigger) {
11866
13513
  case "on-tap":
11867
13514
  return "onPress";
@@ -11882,7 +13529,7 @@ function TpkAnnotated({
11882
13529
  function useTaskAnnotation(options) {
11883
13530
  const ref = useRef11(null);
11884
13531
  const idRef = useRef11(null);
11885
- useEffect16(() => {
13532
+ useEffect18(() => {
11886
13533
  const id = annotations.register({
11887
13534
  taskId: options.taskId,
11888
13535
  focusAreaId: options.focusAreaId,
@@ -11901,7 +13548,7 @@ function useTaskAnnotation(options) {
11901
13548
  idRef.current = null;
11902
13549
  };
11903
13550
  }, [options.taskId, options.focusAreaId, options.elementKey]);
11904
- const recordInteraction = useCallback12(() => {
13551
+ const recordInteraction = useCallback13(() => {
11905
13552
  if (idRef.current) annotations.recordInteraction(idRef.current);
11906
13553
  }, []);
11907
13554
  return { ref, id: idRef.current, recordInteraction };
@@ -12127,12 +13774,12 @@ function hasRecorder(recorder) {
12127
13774
  }
12128
13775
 
12129
13776
  // src/earnings.ts
12130
- import { useEffect as useEffect17, useState as useState20, useCallback as useCallback13 } from "react";
13777
+ import { useEffect as useEffect19, useState as useState22, useCallback as useCallback14 } from "react";
12131
13778
  function useTpkEarnings(tpk, options = {}) {
12132
- const [data, setData] = useState20(null);
12133
- const [loading, setLoading] = useState20(false);
12134
- const [error, setError] = useState20(null);
12135
- const refresh = useCallback13(async () => {
13779
+ const [data, setData] = useState22(null);
13780
+ const [loading, setLoading] = useState22(false);
13781
+ const [error, setError] = useState22(null);
13782
+ const refresh = useCallback14(async () => {
12136
13783
  if (!tpk) return;
12137
13784
  setLoading(true);
12138
13785
  setError(null);
@@ -12148,7 +13795,7 @@ function useTpkEarnings(tpk, options = {}) {
12148
13795
  setLoading(false);
12149
13796
  }
12150
13797
  }, [tpk, options.payoutLimit]);
12151
- useEffect17(() => {
13798
+ useEffect19(() => {
12152
13799
  if (tpk) refresh();
12153
13800
  }, [tpk, refresh]);
12154
13801
  return { data, loading, error, refresh };
@@ -12158,14 +13805,17 @@ export {
12158
13805
  AttachmentQueue,
12159
13806
  Breadcrumbs,
12160
13807
  BugReportSheet,
13808
+ ChecklistPanel,
12161
13809
  CrashQueue,
12162
13810
  DEFAULT_STYLE,
12163
13811
  DEFAULT_TPK_THEME,
13812
+ DENY_LABEL_PATTERNS,
12164
13813
  ExpoStorage,
12165
13814
  FloatingFeedbackButton,
12166
13815
  GeneralFeedbackDialog,
12167
13816
  INTERACTION_NAV_WEIGHT,
12168
13817
  InviteCodeScreen,
13818
+ LiveNoteDialog,
12169
13819
  MIN_INTERACTIONS_PER_ACTIVE_MINUTE,
12170
13820
  MyBugsSheet,
12171
13821
  NotificationsSheet,
@@ -12188,6 +13838,7 @@ export {
12188
13838
  TpkIcon,
12189
13839
  TpkIconsProvider,
12190
13840
  TpkLanguageProvider,
13841
+ TpkLiveLink,
12191
13842
  TpkOnboarding,
12192
13843
  TpkSensitive,
12193
13844
  TpkTalker,
@@ -12206,6 +13857,7 @@ export {
12206
13857
  bugSeverityLabel,
12207
13858
  bugStatusStyle,
12208
13859
  canSubmitBugReportDraft,
13860
+ captureLiveSnapshot,
12209
13861
  captureView,
12210
13862
  classificationToBugType,
12211
13863
  createBugReportDraft,
@@ -12229,18 +13881,24 @@ export {
12229
13881
  hasWelcomeBriefBeenSeen,
12230
13882
  installCrashHandler,
12231
13883
  installNetworkCapture,
13884
+ loadChecklist,
12232
13885
  markOnboardingComplete,
12233
13886
  markWelcomeBriefAsSeen,
12234
13887
  markWidgetTourSeen,
13888
+ parseLiveAction,
12235
13889
  parseVersionRange,
12236
13890
  pathToSvgD,
12237
13891
  quickDraftBug,
13892
+ readLiveState,
13893
+ readScreenTexts,
12238
13894
  resetOnboardingState,
12239
13895
  resetWelcomeBriefAck,
12240
13896
  resetWidgetTourSeen,
13897
+ runLiveAction,
12241
13898
  simplifyPath,
12242
13899
  submitBugReportDraft,
12243
13900
  subscribeNativeCaptureMode,
13901
+ toStepResults,
12244
13902
  uploadScreenshotAttachment,
12245
13903
  useShake,
12246
13904
  useTaskAnnotation,