@testerpaykit/expo 0.10.0 → 0.11.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.0";
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",
@@ -2421,7 +2419,7 @@ function WidgetTour({
2421
2419
  style: styles.skipButton,
2422
2420
  hitSlop: 8
2423
2421
  },
2424
- /* @__PURE__ */ React5.createElement(Text2, { style: styles.skipLabel }, t.skip)
2422
+ /* @__PURE__ */ React5.createElement(Text2, { maxFontSizeMultiplier: MAX_FONT_SCALE, style: styles.skipLabel }, t.skip)
2425
2423
  )),
2426
2424
  /* @__PURE__ */ React5.createElement(
2427
2425
  ScrollView,
@@ -2469,7 +2467,7 @@ function WidgetTour({
2469
2467
  onPress: () => goTo(index - 1),
2470
2468
  style: [styles.backButton, isFirst && styles.backButtonHidden]
2471
2469
  },
2472
- /* @__PURE__ */ React5.createElement(Text2, { style: styles.backLabel }, t.back)
2470
+ /* @__PURE__ */ React5.createElement(Text2, { maxFontSizeMultiplier: MAX_FONT_SCALE, style: styles.backLabel }, t.back)
2473
2471
  ), /* @__PURE__ */ React5.createElement(
2474
2472
  Pressable,
2475
2473
  {
@@ -2481,7 +2479,7 @@ function WidgetTour({
2481
2479
  pressed && styles.primaryButtonPressed
2482
2480
  ]
2483
2481
  },
2484
- /* @__PURE__ */ React5.createElement(Text2, { style: styles.primaryLabel }, isLast ? t.done : t.next)
2482
+ /* @__PURE__ */ React5.createElement(Text2, { maxFontSizeMultiplier: MAX_FONT_SCALE, style: styles.primaryLabel }, isLast ? t.done : t.next)
2485
2483
  ))
2486
2484
  ))
2487
2485
  );
@@ -2498,13 +2496,21 @@ function Card({
2498
2496
  accessibilityLabel: `${card.title}. ${card.body}`,
2499
2497
  style: [styles.card, card.hero && styles.cardHero]
2500
2498
  },
2501
- /* @__PURE__ */ React5.createElement(View, { style: [styles.emojiWrap, card.hero && styles.emojiWrapHero] }, /* @__PURE__ */ React5.createElement(Text2, { style: styles.emoji }, card.emoji)),
2502
- card.hero && /* @__PURE__ */ React5.createElement(View, { style: styles.heroBadge }, /* @__PURE__ */ React5.createElement(Text2, { style: styles.heroBadgeLabel }, newBadge)),
2503
- /* @__PURE__ */ React5.createElement(Text2, { style: [styles.cardTitle, card.hero && styles.cardTitleHero] }, card.title),
2504
- /* @__PURE__ */ React5.createElement(Text2, { style: styles.cardBody }, card.body)
2499
+ /* @__PURE__ */ React5.createElement(View, { style: [styles.emojiWrap, card.hero && styles.emojiWrapHero] }, /* @__PURE__ */ React5.createElement(Text2, { allowFontScaling: false, style: styles.emoji }, card.emoji)),
2500
+ card.hero && /* @__PURE__ */ React5.createElement(View, { style: styles.heroBadge }, /* @__PURE__ */ React5.createElement(Text2, { maxFontSizeMultiplier: MAX_FONT_SCALE, style: styles.heroBadgeLabel }, newBadge)),
2501
+ /* @__PURE__ */ React5.createElement(
2502
+ Text2,
2503
+ {
2504
+ maxFontSizeMultiplier: MAX_FONT_SCALE,
2505
+ style: [styles.cardTitle, card.hero && styles.cardTitleHero]
2506
+ },
2507
+ card.title
2508
+ ),
2509
+ /* @__PURE__ */ React5.createElement(Text2, { maxFontSizeMultiplier: MAX_FONT_SCALE, style: styles.cardBody }, card.body)
2505
2510
  ));
2506
2511
  }
2507
2512
  var SHEET_PADDING = 20;
2513
+ var MAX_FONT_SCALE = 1.5;
2508
2514
  var styles = StyleSheet.create({
2509
2515
  backdrop: {
2510
2516
  flex: 1,
@@ -2515,6 +2521,8 @@ var styles = StyleSheet.create({
2515
2521
  sheet: {
2516
2522
  width: "100%",
2517
2523
  maxWidth: 420,
2524
+ // Very large text sizes must not push "Überspringen" off the top.
2525
+ maxHeight: "90%",
2518
2526
  backgroundColor: "#FFFFFF",
2519
2527
  borderTopLeftRadius: 24,
2520
2528
  borderTopRightRadius: 24,
@@ -2552,7 +2560,10 @@ var styles = StyleSheet.create({
2552
2560
  alignItems: "stretch"
2553
2561
  },
2554
2562
  card: {
2555
- flex: 1,
2563
+ // flexGrow, not flex: 1 — flex: 1 sets flexBasis 0, and inside the
2564
+ // horizontal ScrollView (no fixed height) every card then collapses
2565
+ // to its padding, so the tour showed only a sliver of the emoji.
2566
+ flexGrow: 1,
2556
2567
  alignItems: "center",
2557
2568
  paddingVertical: 28,
2558
2569
  paddingHorizontal: 20,
@@ -2749,6 +2760,11 @@ function FloatingFeedbackButton({
2749
2760
  onShowMessages,
2750
2761
  unreadMessageCount = 0,
2751
2762
  onAutoTest,
2763
+ onShowChecklist,
2764
+ checklistCount = 0,
2765
+ onSendToClaude,
2766
+ onToggleLiveLink,
2767
+ liveLinkConnected = false,
2752
2768
  onLongPressVoiceBug,
2753
2769
  onFlushCachedCrashes,
2754
2770
  notificationCount = 0,
@@ -2884,6 +2900,33 @@ function FloatingFeedbackButton({
2884
2900
  onTap: () => handleAction(onGeneralFeedback)
2885
2901
  }
2886
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
+ }
2887
2930
  if (onAutoTest) {
2888
2931
  opts.push({
2889
2932
  key: "auto-test",
@@ -2977,6 +3020,11 @@ function FloatingFeedbackButton({
2977
3020
  onShowMessages,
2978
3021
  unreadMessageCount,
2979
3022
  onAutoTest,
3023
+ onShowChecklist,
3024
+ checklistCount,
3025
+ onSendToClaude,
3026
+ onToggleLiveLink,
3027
+ liveLinkConnected,
2980
3028
  onFlushCachedCrashes,
2981
3029
  notificationCount,
2982
3030
  handleAction,
@@ -7385,32 +7433,411 @@ var styles9 = StyleSheet9.create({
7385
7433
  btnOutline: { borderWidth: 1, borderColor: "#CBD5E1" }
7386
7434
  });
7387
7435
 
7388
- // src/ScreenshotAnnotationEditor.tsx
7389
- 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";
7390
7438
  import {
7391
7439
  ActivityIndicator as ActivityIndicator5,
7392
- Modal as Modal6,
7440
+ Dimensions as Dimensions3,
7393
7441
  Pressable as Pressable9,
7394
7442
  ScrollView as ScrollView8,
7395
- StyleSheet as StyleSheet11,
7443
+ StyleSheet as StyleSheet10,
7396
7444
  Text as Text10,
7397
7445
  TextInput as TextInput4,
7398
- 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
7399
7826
  } from "react-native";
7400
7827
 
7401
7828
  // src/TpkAnnotationOverlay.tsx
7402
- import React14, {
7829
+ import React15, {
7403
7830
  forwardRef,
7404
- useCallback as useCallback6,
7831
+ useCallback as useCallback7,
7405
7832
  useImperativeHandle,
7406
- useMemo as useMemo6,
7833
+ useMemo as useMemo7,
7407
7834
  useRef as useRef6,
7408
- useState as useState10
7835
+ useState as useState11
7409
7836
  } from "react";
7410
7837
  import {
7411
- View as View10,
7838
+ View as View11,
7412
7839
  Image as Image2,
7413
- StyleSheet as StyleSheet10,
7840
+ StyleSheet as StyleSheet11,
7414
7841
  PanResponder as PanResponder2
7415
7842
  } from "react-native";
7416
7843
 
@@ -7528,7 +7955,7 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7528
7955
  onShapesChange,
7529
7956
  textValue
7530
7957
  } = props;
7531
- const [shapes, setShapesState] = useState10(
7958
+ const [shapes, setShapesState] = useState11(
7532
7959
  initialShapes ?? []
7533
7960
  );
7534
7961
  const draftRef = useRef6(null);
@@ -7538,22 +7965,22 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7538
7965
  });
7539
7966
  const surfaceRef = useRef6(null);
7540
7967
  const SvgModRef = useRef6(null);
7541
- const [svgReady, setSvgReady] = useState10(false);
7542
- React14.useEffect(() => {
7968
+ const [svgReady, setSvgReady] = useState11(false);
7969
+ React15.useEffect(() => {
7543
7970
  import("react-native-svg").then((mod) => {
7544
7971
  SvgModRef.current = mod;
7545
7972
  setSvgReady(true);
7546
7973
  }).catch(() => {
7547
7974
  });
7548
7975
  }, []);
7549
- const commitShapes = useCallback6(
7976
+ const commitShapes = useCallback7(
7550
7977
  (next) => {
7551
7978
  setShapesState(next);
7552
7979
  onShapesChange?.(next);
7553
7980
  },
7554
7981
  [onShapesChange]
7555
7982
  );
7556
- const toImageCoords = useCallback6(
7983
+ const toImageCoords = useCallback7(
7557
7984
  (e) => {
7558
7985
  const { width, height } = layoutRef.current;
7559
7986
  const scaleX = imageWidth / Math.max(1, width);
@@ -7565,7 +7992,7 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7565
7992
  },
7566
7993
  [imageWidth, imageHeight]
7567
7994
  );
7568
- const panResponder = useMemo6(
7995
+ const panResponder = useMemo7(
7569
7996
  () => PanResponder2.create({
7570
7997
  onStartShouldSetPanResponder: () => tool !== "select",
7571
7998
  onMoveShouldSetPanResponder: () => tool !== "select",
@@ -7591,7 +8018,7 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7591
8018
  }),
7592
8019
  [tool, style, textValue, toImageCoords, shapes, commitShapes]
7593
8020
  );
7594
- const onLayout = useCallback6((e) => {
8021
+ const onLayout = useCallback7((e) => {
7595
8022
  layoutRef.current = {
7596
8023
  width: e.nativeEvent.layout.width,
7597
8024
  height: e.nativeEvent.layout.height
@@ -7625,32 +8052,32 @@ var TpkAnnotationOverlay = forwardRef(function TpkAnnotationOverlay2(props, ref)
7625
8052
  }),
7626
8053
  [shapes, commitShapes]
7627
8054
  );
7628
- return /* @__PURE__ */ React14.createElement(
7629
- View10,
8055
+ return /* @__PURE__ */ React15.createElement(
8056
+ View11,
7630
8057
  {
7631
8058
  ref: surfaceRef,
7632
- style: [styles10.surface, { aspectRatio: imageWidth / imageHeight }],
8059
+ style: [styles11.surface, { aspectRatio: imageWidth / imageHeight }],
7633
8060
  onLayout,
7634
8061
  ...panResponder.panHandlers
7635
8062
  },
7636
- /* @__PURE__ */ React14.createElement(
8063
+ /* @__PURE__ */ React15.createElement(
7637
8064
  Image2,
7638
8065
  {
7639
8066
  source: { uri: imageUri },
7640
- style: StyleSheet10.absoluteFill,
8067
+ style: StyleSheet11.absoluteFill,
7641
8068
  resizeMode: "contain"
7642
8069
  }
7643
8070
  ),
7644
- 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
7645
8072
  );
7646
8073
  });
7647
8074
  function ShapeLayer({ shapes, svgMod, viewBox }) {
7648
8075
  const Svg = svgMod.default ?? svgMod.Svg;
7649
8076
  const { Rect, Circle, Polygon, Path, Text: SvgText, Line: SvgLine, G } = svgMod;
7650
- return /* @__PURE__ */ React14.createElement(
8077
+ return /* @__PURE__ */ React15.createElement(
7651
8078
  Svg,
7652
8079
  {
7653
- style: StyleSheet10.absoluteFill,
8080
+ style: StyleSheet11.absoluteFill,
7654
8081
  viewBox,
7655
8082
  preserveAspectRatio: "xMidYMid meet"
7656
8083
  },
@@ -7660,7 +8087,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7660
8087
  const opacity = s.kind === "blur" ? 1 : s.style.opacity ?? 1;
7661
8088
  switch (s.kind) {
7662
8089
  case "rect":
7663
- return /* @__PURE__ */ React14.createElement(
8090
+ return /* @__PURE__ */ React15.createElement(
7664
8091
  Rect,
7665
8092
  {
7666
8093
  key: s.id,
@@ -7675,7 +8102,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7675
8102
  }
7676
8103
  );
7677
8104
  case "circle":
7678
- return /* @__PURE__ */ React14.createElement(
8105
+ return /* @__PURE__ */ React15.createElement(
7679
8106
  Circle,
7680
8107
  {
7681
8108
  key: s.id,
@@ -7690,7 +8117,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7690
8117
  );
7691
8118
  case "arrow": {
7692
8119
  const head = arrowHeadPoints(s);
7693
- 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(
7694
8121
  SvgLine,
7695
8122
  {
7696
8123
  x1: s.from.x,
@@ -7700,7 +8127,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7700
8127
  stroke,
7701
8128
  strokeWidth
7702
8129
  }
7703
- ), /* @__PURE__ */ React14.createElement(
8130
+ ), /* @__PURE__ */ React15.createElement(
7704
8131
  Polygon,
7705
8132
  {
7706
8133
  points: head.map((p) => `${p.x},${p.y}`).join(" "),
@@ -7709,7 +8136,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7709
8136
  ));
7710
8137
  }
7711
8138
  case "path":
7712
- return /* @__PURE__ */ React14.createElement(
8139
+ return /* @__PURE__ */ React15.createElement(
7713
8140
  Path,
7714
8141
  {
7715
8142
  key: s.id,
@@ -7721,7 +8148,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7721
8148
  }
7722
8149
  );
7723
8150
  case "text":
7724
- return /* @__PURE__ */ React14.createElement(
8151
+ return /* @__PURE__ */ React15.createElement(
7725
8152
  SvgText,
7726
8153
  {
7727
8154
  key: s.id,
@@ -7734,7 +8161,7 @@ function ShapeLayer({ shapes, svgMod, viewBox }) {
7734
8161
  s.text
7735
8162
  );
7736
8163
  case "blur":
7737
- return /* @__PURE__ */ React14.createElement(
8164
+ return /* @__PURE__ */ React15.createElement(
7738
8165
  Rect,
7739
8166
  {
7740
8167
  key: s.id,
@@ -7833,7 +8260,7 @@ function estimateBase64Bytes2(b64) {
7833
8260
  const padding = b64.endsWith("==") ? 2 : b64.endsWith("=") ? 1 : 0;
7834
8261
  return Math.floor(b64.length * 3 / 4) - padding;
7835
8262
  }
7836
- var styles10 = StyleSheet10.create({
8263
+ var styles11 = StyleSheet11.create({
7837
8264
  surface: {
7838
8265
  width: "100%",
7839
8266
  backgroundColor: "#000"
@@ -7910,14 +8337,14 @@ function ScreenshotAnnotationEditor({
7910
8337
  }) {
7911
8338
  const t = STRINGS6[useTpkLanguage()];
7912
8339
  const editorRef = useRef7(null);
7913
- const [tool, setTool] = useState11("arrow");
7914
- const [annotationStyle, setAnnotationStyle] = useState11(
8340
+ const [tool, setTool] = useState12("arrow");
8341
+ const [annotationStyle, setAnnotationStyle] = useState12(
7915
8342
  DEFAULT_STYLE
7916
8343
  );
7917
- const [textValue, setTextValue] = useState11("");
7918
- const [processing, setProcessing] = useState11(false);
7919
- const [error, setError] = useState11(null);
7920
- 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 () => {
7921
8348
  if (!editorRef.current) {
7922
8349
  setError(t.errorNotReady);
7923
8350
  return;
@@ -7937,13 +8364,13 @@ function ScreenshotAnnotationEditor({
7937
8364
  setProcessing(false);
7938
8365
  }
7939
8366
  }, [format, quality, onSave, t]);
7940
- const setColor = useCallback7((color) => {
8367
+ const setColor = useCallback8((color) => {
7941
8368
  setAnnotationStyle((cur) => ({ ...cur, color }));
7942
8369
  }, []);
7943
- const setStrokeWidth = useCallback7((strokeWidth) => {
8370
+ const setStrokeWidth = useCallback8((strokeWidth) => {
7944
8371
  setAnnotationStyle((cur) => ({ ...cur, strokeWidth }));
7945
8372
  }, []);
7946
- return /* @__PURE__ */ React15.createElement(
8373
+ return /* @__PURE__ */ React16.createElement(
7947
8374
  Modal6,
7948
8375
  {
7949
8376
  animationType: "slide",
@@ -7951,7 +8378,7 @@ function ScreenshotAnnotationEditor({
7951
8378
  transparent: false,
7952
8379
  visible
7953
8380
  },
7954
- /* @__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(
7955
8382
  Header2,
7956
8383
  {
7957
8384
  onCancel,
@@ -7960,7 +8387,7 @@ function ScreenshotAnnotationEditor({
7960
8387
  onClear: () => editorRef.current?.clear(),
7961
8388
  t
7962
8389
  }
7963
- ), /* @__PURE__ */ React15.createElement(
8390
+ ), /* @__PURE__ */ React16.createElement(
7964
8391
  Toolbar,
7965
8392
  {
7966
8393
  tool,
@@ -7970,17 +8397,17 @@ function ScreenshotAnnotationEditor({
7970
8397
  onStrokeWidthChange: setStrokeWidth,
7971
8398
  t
7972
8399
  }
7973
- ), tool === "text" && /* @__PURE__ */ React15.createElement(View11, { style: styles11.textInputRow }, /* @__PURE__ */ React15.createElement(
7974
- TextInput4,
8400
+ ), tool === "text" && /* @__PURE__ */ React16.createElement(View12, { style: styles12.textInputRow }, /* @__PURE__ */ React16.createElement(
8401
+ TextInput5,
7975
8402
  {
7976
8403
  autoFocus: true,
7977
8404
  placeholder: t.textPlaceholder,
7978
8405
  placeholderTextColor: "#94A3B8",
7979
- style: styles11.textInput,
8406
+ style: styles12.textInput,
7980
8407
  value: textValue,
7981
8408
  onChangeText: setTextValue
7982
8409
  }
7983
- )), /* @__PURE__ */ React15.createElement(View11, { style: styles11.canvasWrap }, /* @__PURE__ */ React15.createElement(
8410
+ )), /* @__PURE__ */ React16.createElement(View12, { style: styles12.canvasWrap }, /* @__PURE__ */ React16.createElement(
7984
8411
  TpkAnnotationOverlay,
7985
8412
  {
7986
8413
  ref: editorRef,
@@ -7991,7 +8418,7 @@ function ScreenshotAnnotationEditor({
7991
8418
  style: annotationStyle,
7992
8419
  textValue
7993
8420
  }
7994
- )), 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(
7995
8422
  Footer2,
7996
8423
  {
7997
8424
  processing,
@@ -8009,36 +8436,36 @@ function Header2({
8009
8436
  onClear,
8010
8437
  t
8011
8438
  }) {
8012
- return /* @__PURE__ */ React15.createElement(View11, { style: [styles11.header, { paddingTop: 12 + getModalInsets().top }] }, /* @__PURE__ */ React15.createElement(
8013
- Pressable9,
8439
+ return /* @__PURE__ */ React16.createElement(View12, { style: [styles12.header, { paddingTop: 12 + getModalInsets().top }] }, /* @__PURE__ */ React16.createElement(
8440
+ Pressable10,
8014
8441
  {
8015
8442
  accessibilityRole: "button",
8016
8443
  accessibilityLabel: t.cancelA11y,
8017
8444
  disabled: processing,
8018
8445
  onPress: onCancel,
8019
- style: styles11.headerIconButton
8446
+ style: styles12.headerIconButton
8020
8447
  },
8021
- /* @__PURE__ */ React15.createElement(TpkIcon, { name: "close", size: 20, color: "#FAFAF7" })
8022
- ), /* @__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(
8023
- 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,
8024
8451
  {
8025
8452
  accessibilityRole: "button",
8026
8453
  accessibilityLabel: t.undoA11y,
8027
8454
  disabled: processing,
8028
8455
  onPress: onUndo,
8029
- style: styles11.headerIconButton
8456
+ style: styles12.headerIconButton
8030
8457
  },
8031
- /* @__PURE__ */ React15.createElement(Text10, { style: styles11.headerIconLabel }, "\u21B6")
8032
- ), /* @__PURE__ */ React15.createElement(
8033
- Pressable9,
8458
+ /* @__PURE__ */ React16.createElement(Text11, { style: styles12.headerIconLabel }, "\u21B6")
8459
+ ), /* @__PURE__ */ React16.createElement(
8460
+ Pressable10,
8034
8461
  {
8035
8462
  accessibilityRole: "button",
8036
8463
  accessibilityLabel: t.clearA11y,
8037
8464
  disabled: processing,
8038
8465
  onPress: onClear,
8039
- style: styles11.headerIconButton
8466
+ style: styles12.headerIconButton
8040
8467
  },
8041
- /* @__PURE__ */ React15.createElement(Text10, { style: styles11.headerIconLabel }, "\u232B")
8468
+ /* @__PURE__ */ React16.createElement(Text11, { style: styles12.headerIconLabel }, "\u232B")
8042
8469
  ));
8043
8470
  }
8044
8471
  function Toolbar({
@@ -8049,17 +8476,17 @@ function Toolbar({
8049
8476
  onStrokeWidthChange,
8050
8477
  t
8051
8478
  }) {
8052
- return /* @__PURE__ */ React15.createElement(View11, { style: styles11.toolbar }, /* @__PURE__ */ React15.createElement(
8053
- ScrollView8,
8479
+ return /* @__PURE__ */ React16.createElement(View12, { style: styles12.toolbar }, /* @__PURE__ */ React16.createElement(
8480
+ ScrollView9,
8054
8481
  {
8055
8482
  horizontal: true,
8056
8483
  showsHorizontalScrollIndicator: false,
8057
- contentContainerStyle: styles11.toolbarRow
8484
+ contentContainerStyle: styles12.toolbarRow
8058
8485
  },
8059
8486
  TOOLS.map((item) => {
8060
8487
  const active = tool === item.value;
8061
- return /* @__PURE__ */ React15.createElement(
8062
- Pressable9,
8488
+ return /* @__PURE__ */ React16.createElement(
8489
+ Pressable10,
8063
8490
  {
8064
8491
  key: item.value,
8065
8492
  accessibilityRole: "radio",
@@ -8067,11 +8494,11 @@ function Toolbar({
8067
8494
  accessibilityLabel: t.tools[item.value],
8068
8495
  onPress: () => onToolChange(item.value),
8069
8496
  style: [
8070
- styles11.toolButton,
8071
- active && styles11.toolButtonActive
8497
+ styles12.toolButton,
8498
+ active && styles12.toolButtonActive
8072
8499
  ]
8073
8500
  },
8074
- /* @__PURE__ */ React15.createElement(
8501
+ /* @__PURE__ */ React16.createElement(
8075
8502
  TpkIcon,
8076
8503
  {
8077
8504
  name: item.icon,
@@ -8079,48 +8506,48 @@ function Toolbar({
8079
8506
  color: active ? "#FAFAF7" : "#94A3B8"
8080
8507
  }
8081
8508
  ),
8082
- /* @__PURE__ */ React15.createElement(
8083
- Text10,
8509
+ /* @__PURE__ */ React16.createElement(
8510
+ Text11,
8084
8511
  {
8085
8512
  style: [
8086
- styles11.toolLabel,
8087
- active && styles11.toolLabelActive
8513
+ styles12.toolLabel,
8514
+ active && styles12.toolLabelActive
8088
8515
  ]
8089
8516
  },
8090
8517
  t.tools[item.value]
8091
8518
  )
8092
8519
  );
8093
8520
  })
8094
- ), /* @__PURE__ */ React15.createElement(View11, { style: styles11.toolbarBottomRow }, /* @__PURE__ */ React15.createElement(View11, { style: styles11.swatchRow }, ANNOTATION_PALETTE.map((c) => /* @__PURE__ */ React15.createElement(
8095
- 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,
8096
8523
  {
8097
8524
  key: c,
8098
8525
  accessibilityRole: "button",
8099
8526
  accessibilityLabel: t.colorA11y(c),
8100
8527
  onPress: () => onColorChange(c),
8101
8528
  style: [
8102
- styles11.swatch,
8529
+ styles12.swatch,
8103
8530
  { backgroundColor: c },
8104
- annotationStyle.color === c && styles11.swatchActive
8531
+ annotationStyle.color === c && styles12.swatchActive
8105
8532
  ]
8106
8533
  }
8107
- ))), /* @__PURE__ */ React15.createElement(View11, { style: styles11.strokeRow }, STROKE_WIDTHS.map((w) => /* @__PURE__ */ React15.createElement(
8108
- Pressable9,
8534
+ ))), /* @__PURE__ */ React16.createElement(View12, { style: styles12.strokeRow }, STROKE_WIDTHS.map((w) => /* @__PURE__ */ React16.createElement(
8535
+ Pressable10,
8109
8536
  {
8110
8537
  key: w,
8111
8538
  accessibilityRole: "button",
8112
8539
  accessibilityLabel: t.strokeA11y(w),
8113
8540
  onPress: () => onStrokeWidthChange(w),
8114
8541
  style: [
8115
- styles11.strokeButton,
8116
- annotationStyle.strokeWidth === w && styles11.strokeButtonActive
8542
+ styles12.strokeButton,
8543
+ annotationStyle.strokeWidth === w && styles12.strokeButtonActive
8117
8544
  ]
8118
8545
  },
8119
- /* @__PURE__ */ React15.createElement(
8120
- View11,
8546
+ /* @__PURE__ */ React16.createElement(
8547
+ View12,
8121
8548
  {
8122
8549
  style: [
8123
- styles11.strokeIndicator,
8550
+ styles12.strokeIndicator,
8124
8551
  {
8125
8552
  height: w,
8126
8553
  backgroundColor: annotationStyle.strokeWidth === w ? "#FAFAF7" : "#94A3B8"
@@ -8136,45 +8563,45 @@ function Footer2({
8136
8563
  onSave,
8137
8564
  t
8138
8565
  }) {
8139
- return /* @__PURE__ */ React15.createElement(
8140
- View11,
8566
+ return /* @__PURE__ */ React16.createElement(
8567
+ View12,
8141
8568
  {
8142
8569
  style: [
8143
- styles11.footer,
8570
+ styles12.footer,
8144
8571
  { paddingBottom: Math.max(14, getModalInsets().bottom) }
8145
8572
  ]
8146
8573
  },
8147
- /* @__PURE__ */ React15.createElement(
8148
- Pressable9,
8574
+ /* @__PURE__ */ React16.createElement(
8575
+ Pressable10,
8149
8576
  {
8150
8577
  accessibilityRole: "button",
8151
8578
  disabled: processing,
8152
8579
  onPress: onCancel,
8153
8580
  style: ({ pressed }) => [
8154
- styles11.footerSecondary,
8581
+ styles12.footerSecondary,
8155
8582
  pressed && { opacity: 0.7 }
8156
8583
  ]
8157
8584
  },
8158
- /* @__PURE__ */ React15.createElement(Text10, { style: styles11.footerSecondaryLabel }, t.cancel)
8585
+ /* @__PURE__ */ React16.createElement(Text11, { style: styles12.footerSecondaryLabel }, t.cancel)
8159
8586
  ),
8160
- /* @__PURE__ */ React15.createElement(
8161
- Pressable9,
8587
+ /* @__PURE__ */ React16.createElement(
8588
+ Pressable10,
8162
8589
  {
8163
8590
  accessibilityRole: "button",
8164
8591
  accessibilityLabel: t.save,
8165
8592
  disabled: processing,
8166
8593
  onPress: onSave,
8167
8594
  style: ({ pressed }) => [
8168
- styles11.footerPrimary,
8169
- processing && styles11.footerPrimaryDisabled,
8595
+ styles12.footerPrimary,
8596
+ processing && styles12.footerPrimaryDisabled,
8170
8597
  pressed && { opacity: 0.85 }
8171
8598
  ]
8172
8599
  },
8173
- 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)
8174
8601
  )
8175
8602
  );
8176
8603
  }
8177
- var styles11 = StyleSheet11.create({
8604
+ var styles12 = StyleSheet12.create({
8178
8605
  root: {
8179
8606
  flex: 1,
8180
8607
  backgroundColor: "#0F172A"
@@ -8187,7 +8614,7 @@ var styles11 = StyleSheet11.create({
8187
8614
  paddingTop: 12,
8188
8615
  paddingBottom: 12,
8189
8616
  backgroundColor: "#020617",
8190
- borderBottomWidth: StyleSheet11.hairlineWidth,
8617
+ borderBottomWidth: StyleSheet12.hairlineWidth,
8191
8618
  borderBottomColor: "#1F2A24"
8192
8619
  },
8193
8620
  headerIconButton: {
@@ -8219,7 +8646,7 @@ var styles11 = StyleSheet11.create({
8219
8646
  toolbar: {
8220
8647
  backgroundColor: "#020617",
8221
8648
  paddingVertical: 8,
8222
- borderBottomWidth: StyleSheet11.hairlineWidth,
8649
+ borderBottomWidth: StyleSheet12.hairlineWidth,
8223
8650
  borderBottomColor: "#1F2A24"
8224
8651
  },
8225
8652
  toolbarRow: {
@@ -8293,7 +8720,7 @@ var styles11 = StyleSheet11.create({
8293
8720
  backgroundColor: "#020617",
8294
8721
  paddingHorizontal: 12,
8295
8722
  paddingVertical: 10,
8296
- borderBottomWidth: StyleSheet11.hairlineWidth,
8723
+ borderBottomWidth: StyleSheet12.hairlineWidth,
8297
8724
  borderBottomColor: "#1F2A24"
8298
8725
  },
8299
8726
  textInput: {
@@ -8325,7 +8752,7 @@ var styles11 = StyleSheet11.create({
8325
8752
  gap: 10,
8326
8753
  padding: 14,
8327
8754
  backgroundColor: "#020617",
8328
- borderTopWidth: StyleSheet11.hairlineWidth,
8755
+ borderTopWidth: StyleSheet12.hairlineWidth,
8329
8756
  borderTopColor: "#1F2A24"
8330
8757
  },
8331
8758
  footerSecondary: {
@@ -8402,24 +8829,24 @@ async function readFileSize(uri) {
8402
8829
  }
8403
8830
 
8404
8831
  // src/VoiceBugInputSheet.tsx
8405
- import React16, {
8406
- useCallback as useCallback8,
8407
- useEffect as useEffect9,
8408
- useMemo as useMemo7,
8832
+ import React17, {
8833
+ useCallback as useCallback9,
8834
+ useEffect as useEffect10,
8835
+ useMemo as useMemo8,
8409
8836
  useRef as useRef8,
8410
- useState as useState12
8837
+ useState as useState13
8411
8838
  } from "react";
8412
8839
  import {
8413
- ActivityIndicator as ActivityIndicator6,
8840
+ ActivityIndicator as ActivityIndicator7,
8414
8841
  Animated as Animated2,
8415
8842
  Easing as Easing2,
8416
8843
  Modal as Modal7,
8417
8844
  Platform as Platform7,
8418
- Pressable as Pressable10,
8419
- ScrollView as ScrollView9,
8420
- StyleSheet as StyleSheet12,
8421
- Text as Text11,
8422
- View as View12
8845
+ Pressable as Pressable11,
8846
+ ScrollView as ScrollView10,
8847
+ StyleSheet as StyleSheet13,
8848
+ Text as Text12,
8849
+ View as View13
8423
8850
  } from "react-native";
8424
8851
 
8425
8852
  // src/voice-extract.ts
@@ -8575,23 +9002,23 @@ function VoiceBugInputSheet({
8575
9002
  testID = "tpk-voice-bug-sheet"
8576
9003
  }) {
8577
9004
  const uiLanguage = useTpkLanguage();
8578
- const S = useMemo7(
9005
+ const S = useMemo8(
8579
9006
  () => ({
8580
9007
  ...uiLanguage === "de" ? DEFAULT_STRINGS_DE : DEFAULT_STRINGS_EN,
8581
9008
  ...strings ?? {}
8582
9009
  }),
8583
9010
  [strings, uiLanguage]
8584
9011
  );
8585
- const [phase, setPhase] = useState12("idle");
8586
- const [classification, setClassification] = useState12("bug");
8587
- const [seconds, setSeconds] = useState12(0);
8588
- const [error, setError] = useState12(null);
8589
- const [result, setResult] = useState12(null);
8590
- const [quickMode, setQuickMode] = useState12(false);
8591
- 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(
8592
9019
  voiceLanguage ?? "auto"
8593
9020
  );
8594
- useEffect9(() => {
9021
+ useEffect10(() => {
8595
9022
  if (voiceLanguage !== void 0) {
8596
9023
  setLanguage(voiceLanguage);
8597
9024
  return;
@@ -8613,7 +9040,7 @@ function VoiceBugInputSheet({
8613
9040
  const tickerRef = useRef8(null);
8614
9041
  const meterAnim = useRef8(new Animated2.Value(0)).current;
8615
9042
  const pulseAnim = useRef8(new Animated2.Value(0)).current;
8616
- useEffect9(() => {
9043
+ useEffect10(() => {
8617
9044
  if (phase !== "recording") {
8618
9045
  pulseAnim.stopAnimation();
8619
9046
  pulseAnim.setValue(0);
@@ -8639,14 +9066,14 @@ function VoiceBugInputSheet({
8639
9066
  return () => loop.stop();
8640
9067
  }, [pulseAnim, phase]);
8641
9068
  const dimAnim = useRef8(new Animated2.Value(1)).current;
8642
- useEffect9(() => {
9069
+ useEffect10(() => {
8643
9070
  Animated2.timing(dimAnim, {
8644
9071
  toValue: phase === "recording" ? 0.1 : 1,
8645
9072
  duration: 200,
8646
9073
  useNativeDriver: true
8647
9074
  }).start();
8648
9075
  }, [dimAnim, phase]);
8649
- useEffect9(() => {
9076
+ useEffect10(() => {
8650
9077
  if (visible) {
8651
9078
  setPhase("idle");
8652
9079
  setClassification("bug");
@@ -8662,12 +9089,12 @@ function VoiceBugInputSheet({
8662
9089
  }
8663
9090
  }
8664
9091
  }, [visible]);
8665
- useEffect9(() => {
9092
+ useEffect10(() => {
8666
9093
  if (phase === "recording" && seconds >= maxSeconds) {
8667
9094
  void stop();
8668
9095
  }
8669
9096
  }, [phase, seconds, maxSeconds]);
8670
- const start = useCallback8(async () => {
9097
+ const start = useCallback9(async () => {
8671
9098
  setError(null);
8672
9099
  setSeconds(0);
8673
9100
  meterAnim.setValue(0);
@@ -8686,7 +9113,7 @@ function VoiceBugInputSheet({
8686
9113
  );
8687
9114
  }
8688
9115
  }, [meterAnim]);
8689
- const stop = useCallback8(async () => {
9116
+ const stop = useCallback9(async () => {
8690
9117
  if (phase !== "recording") return;
8691
9118
  if (tickerRef.current) {
8692
9119
  clearInterval(tickerRef.current);
@@ -8722,7 +9149,7 @@ function VoiceBugInputSheet({
8722
9149
  );
8723
9150
  }
8724
9151
  }, [phase, tpk, language, meterAnim]);
8725
- const cancel = useCallback8(async () => {
9152
+ const cancel = useCallback9(async () => {
8726
9153
  if (tickerRef.current) {
8727
9154
  clearInterval(tickerRef.current);
8728
9155
  tickerRef.current = null;
@@ -8731,7 +9158,7 @@ function VoiceBugInputSheet({
8731
9158
  recorderRef.current = null;
8732
9159
  onCancel();
8733
9160
  }, [onCancel]);
8734
- const runQuick = useCallback8(
9161
+ const runQuick = useCallback9(
8735
9162
  async (action) => {
8736
9163
  if (phase !== "idle" || !captureScreen) return;
8737
9164
  setQuickMode(true);
@@ -8757,17 +9184,17 @@ function VoiceBugInputSheet({
8757
9184
  },
8758
9185
  [phase, captureScreen, tpk, currentScreen, language, S]
8759
9186
  );
8760
- const useResult = useCallback8(() => {
9187
+ const useResult = useCallback9(() => {
8761
9188
  if (result) onExtracted(result, classification);
8762
9189
  }, [result, classification, onExtracted]);
8763
- const retryFresh = useCallback8(() => {
9190
+ const retryFresh = useCallback9(() => {
8764
9191
  setQuickMode(false);
8765
9192
  setResult(null);
8766
9193
  setSeconds(0);
8767
9194
  setError(null);
8768
9195
  setPhase("idle");
8769
9196
  }, []);
8770
- const headline = useMemo7(() => {
9197
+ const headline = useMemo8(() => {
8771
9198
  switch (phase) {
8772
9199
  case "idle":
8773
9200
  return S.idleHeadline;
@@ -8781,7 +9208,7 @@ function VoiceBugInputSheet({
8781
9208
  return S.errorHeadline;
8782
9209
  }
8783
9210
  }, [phase, S]);
8784
- const description = useMemo7(() => {
9211
+ const description = useMemo8(() => {
8785
9212
  switch (phase) {
8786
9213
  case "idle":
8787
9214
  return S.idleDescription;
@@ -8795,7 +9222,7 @@ function VoiceBugInputSheet({
8795
9222
  return error ?? S.errorDescriptionFallback;
8796
9223
  }
8797
9224
  }, [phase, error, S, quickMode]);
8798
- const classificationLabel = useCallback8(
9225
+ const classificationLabel = useCallback9(
8799
9226
  (c) => {
8800
9227
  switch (c) {
8801
9228
  case "bug":
@@ -8810,7 +9237,7 @@ function VoiceBugInputSheet({
8810
9237
  },
8811
9238
  [S]
8812
9239
  );
8813
- const languageLabel = useCallback8(
9240
+ const languageLabel = useCallback9(
8814
9241
  (l, s) => {
8815
9242
  if (l === "auto") return s.languagePickerLabel;
8816
9243
  return l.toUpperCase();
@@ -8829,9 +9256,11 @@ function VoiceBugInputSheet({
8829
9256
  const isExtracted = phase === "extracted";
8830
9257
  const isError = phase === "error";
8831
9258
  const opacity = Math.max(0, Math.min(1, sheetOpacity));
8832
- const backdropOverride = { backgroundColor: `rgba(0,0,0,${0.55 * opacity})` };
8833
- const sheetOverride = { backgroundColor: `rgba(17,24,39,${opacity})` };
8834
- 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(
8835
9264
  Modal7,
8836
9265
  {
8837
9266
  animationType: "slide",
@@ -8839,23 +9268,23 @@ function VoiceBugInputSheet({
8839
9268
  transparent: true,
8840
9269
  visible
8841
9270
  },
8842
- /* @__PURE__ */ React16.createElement(View12, { style: [styles12.backdrop, backdropOverride, style], testID }, /* @__PURE__ */ React16.createElement(
8843
- Pressable10,
9271
+ /* @__PURE__ */ React17.createElement(View13, { style: [styles13.backdrop, backdropOverride, style], testID }, /* @__PURE__ */ React17.createElement(
9272
+ Pressable11,
8844
9273
  {
8845
9274
  accessibilityRole: "button",
8846
9275
  accessibilityLabel: S.cancel,
8847
9276
  disabled: isUploading,
8848
9277
  onPress: () => void cancel(),
8849
- style: styles12.backdropSpacer
9278
+ style: styles13.backdropSpacer
8850
9279
  }
8851
- ), /* @__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(
8852
9281
  Animated2.View,
8853
9282
  {
8854
- style: [styles12.dimmable, { opacity: dimAnim }],
9283
+ style: [styles13.dimmable, { opacity: dimAnim }],
8855
9284
  pointerEvents: isRecording ? "none" : "auto"
8856
9285
  },
8857
- /* @__PURE__ */ React16.createElement(View12, { style: styles12.languagePickerRow }, /* @__PURE__ */ React16.createElement(
8858
- Pressable10,
9286
+ /* @__PURE__ */ React17.createElement(View13, { style: styles13.languagePickerRow }, /* @__PURE__ */ React17.createElement(
9287
+ Pressable11,
8859
9288
  {
8860
9289
  accessibilityRole: "button",
8861
9290
  accessibilityLabel: `Current language: ${languageLabel(language, S)}. Tap to change.`,
@@ -8865,22 +9294,22 @@ function VoiceBugInputSheet({
8865
9294
  (cur) => cur === "auto" ? "de" : cur === "de" ? "en" : "auto"
8866
9295
  );
8867
9296
  },
8868
- style: [styles12.languageChip, !isIdle && { opacity: 0.5 }]
9297
+ style: [styles13.languageChip, !isIdle && { opacity: 0.5 }]
8869
9298
  },
8870
- /* @__PURE__ */ React16.createElement(TpkIcon, { name: "language", size: 14, color: "#475569" }),
8871
- /* @__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))
8872
9301
  )),
8873
- /* @__PURE__ */ React16.createElement(
8874
- ScrollView9,
9302
+ /* @__PURE__ */ React17.createElement(
9303
+ ScrollView10,
8875
9304
  {
8876
9305
  horizontal: true,
8877
9306
  showsHorizontalScrollIndicator: false,
8878
- contentContainerStyle: styles12.classificationRow
9307
+ contentContainerStyle: styles13.classificationRow
8879
9308
  },
8880
9309
  CLASSIFICATIONS.map((c) => {
8881
9310
  const active = classification === c;
8882
- return /* @__PURE__ */ React16.createElement(
8883
- Pressable10,
9311
+ return /* @__PURE__ */ React17.createElement(
9312
+ Pressable11,
8884
9313
  {
8885
9314
  key: c,
8886
9315
  accessibilityRole: "radio",
@@ -8889,7 +9318,7 @@ function VoiceBugInputSheet({
8889
9318
  disabled: !isIdle,
8890
9319
  onPress: () => setClassification(c),
8891
9320
  style: [
8892
- styles12.classificationChip,
9321
+ styles13.classificationChip,
8893
9322
  active && {
8894
9323
  backgroundColor: accentColor,
8895
9324
  borderColor: accentColor
@@ -8897,7 +9326,7 @@ function VoiceBugInputSheet({
8897
9326
  !isIdle && { opacity: 0.5 }
8898
9327
  ]
8899
9328
  },
8900
- active && /* @__PURE__ */ React16.createElement(
9329
+ active && /* @__PURE__ */ React17.createElement(
8901
9330
  TpkIcon,
8902
9331
  {
8903
9332
  name: "check",
@@ -8906,12 +9335,12 @@ function VoiceBugInputSheet({
8906
9335
  style: { marginRight: 4 }
8907
9336
  }
8908
9337
  ),
8909
- /* @__PURE__ */ React16.createElement(
8910
- Text11,
9338
+ /* @__PURE__ */ React17.createElement(
9339
+ Text12,
8911
9340
  {
8912
9341
  style: [
8913
- styles12.classificationChipLabel,
8914
- active && styles12.classificationChipLabelActive
9342
+ styles13.classificationChipLabel,
9343
+ active && styles13.classificationChipLabelActive
8915
9344
  ]
8916
9345
  },
8917
9346
  classificationLabel(c)
@@ -8919,13 +9348,13 @@ function VoiceBugInputSheet({
8919
9348
  );
8920
9349
  })
8921
9350
  ),
8922
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.headline }, headline),
8923
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.description }, description)
8924
- ), 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(
8925
9354
  Animated2.View,
8926
9355
  {
8927
9356
  style: [
8928
- styles12.meterFill,
9357
+ styles13.meterFill,
8929
9358
  {
8930
9359
  backgroundColor: accentColor,
8931
9360
  transform: [
@@ -8939,38 +9368,38 @@ function VoiceBugInputSheet({
8939
9368
  }
8940
9369
  ]
8941
9370
  }
8942
- ))), isExtracted && result && /* @__PURE__ */ React16.createElement(
8943
- ScrollView9,
9371
+ ))), isExtracted && result && /* @__PURE__ */ React17.createElement(
9372
+ ScrollView10,
8944
9373
  {
8945
- style: styles12.extractedScroll,
8946
- contentContainerStyle: styles12.extractedScrollContent
9374
+ style: styles13.extractedScroll,
9375
+ contentContainerStyle: styles13.extractedScrollContent
8947
9376
  },
8948
- 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)")),
8949
- /* @__PURE__ */ React16.createElement(ExtractField, { label: "Title", value: result.title }),
8950
- /* @__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(
8951
9380
  ExtractField,
8952
9381
  {
8953
9382
  label: "Description",
8954
9383
  value: result.description
8955
9384
  }
8956
9385
  ),
8957
- /* @__PURE__ */ React16.createElement(
9386
+ /* @__PURE__ */ React17.createElement(
8958
9387
  ExtractField,
8959
9388
  {
8960
9389
  label: "Expected",
8961
9390
  value: result.expectedBehavior
8962
9391
  }
8963
9392
  ),
8964
- /* @__PURE__ */ React16.createElement(
9393
+ /* @__PURE__ */ React17.createElement(
8965
9394
  ExtractField,
8966
9395
  {
8967
9396
  label: "Actual",
8968
9397
  value: result.actualBehavior
8969
9398
  }
8970
9399
  ),
8971
- /* @__PURE__ */ React16.createElement(ExtractField, { label: "Frequency", value: result.frequency })
8972
- ), 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(
8973
- 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,
8974
9403
  {
8975
9404
  key: a.kind,
8976
9405
  accessibilityRole: "button",
@@ -8978,29 +9407,29 @@ function VoiceBugInputSheet({
8978
9407
  testID: `tpk-quick-${a.kind}`,
8979
9408
  onPress: () => void runQuick(a),
8980
9409
  style: ({ pressed }) => [
8981
- styles12.quickButton,
9410
+ styles13.quickButton,
8982
9411
  pressed && { opacity: 0.8 }
8983
9412
  ]
8984
9413
  },
8985
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.quickEmoji }, a.emoji),
8986
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.quickLabel }, S[a.label])
8987
- )))) : null, /* @__PURE__ */ React16.createElement(View12, { style: styles12.primaryRow }, isIdle && /* @__PURE__ */ React16.createElement(
8988
- 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,
8989
9418
  {
8990
9419
  accessibilityRole: "button",
8991
9420
  accessibilityLabel: "Start recording",
8992
9421
  onPress: () => void start(),
8993
9422
  style: [
8994
- styles12.micButton,
9423
+ styles13.micButton,
8995
9424
  { backgroundColor: accentColor, shadowColor: accentColor }
8996
9425
  ]
8997
9426
  },
8998
- /* @__PURE__ */ React16.createElement(TpkIcon, { name: "voice", size: 42, color: "#FFFFFF" })
8999
- ), isRecording && /* @__PURE__ */ React16.createElement(
9427
+ /* @__PURE__ */ React17.createElement(TpkIcon, { name: "voice", size: 42, color: "#FFFFFF" })
9428
+ ), isRecording && /* @__PURE__ */ React17.createElement(
9000
9429
  Animated2.View,
9001
9430
  {
9002
9431
  style: [
9003
- styles12.micButton,
9432
+ styles13.micButton,
9004
9433
  {
9005
9434
  backgroundColor: accentColor,
9006
9435
  shadowColor: accentColor,
@@ -9008,49 +9437,49 @@ function VoiceBugInputSheet({
9008
9437
  }
9009
9438
  ]
9010
9439
  },
9011
- /* @__PURE__ */ React16.createElement(
9012
- Pressable10,
9440
+ /* @__PURE__ */ React17.createElement(
9441
+ Pressable11,
9013
9442
  {
9014
9443
  accessibilityRole: "button",
9015
9444
  accessibilityLabel: "Stop recording",
9016
9445
  onPress: () => void stop(),
9017
- style: styles12.micPressable
9446
+ style: styles13.micPressable
9018
9447
  },
9019
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.micButtonStop }, "\u25A0")
9448
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.micButtonStop }, "\u25A0")
9020
9449
  )
9021
- ), 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(
9022
- 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,
9023
9452
  {
9024
9453
  accessibilityRole: "button",
9025
9454
  onPress: retryFresh,
9026
9455
  style: ({ pressed }) => [
9027
- styles12.secondaryButton,
9456
+ styles13.secondaryButton,
9028
9457
  pressed && { opacity: 0.85 }
9029
9458
  ]
9030
9459
  },
9031
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.secondaryButtonLabel }, quickMode ? S.back : isError ? S.retry : S.rerecord)
9032
- ), isExtracted && /* @__PURE__ */ React16.createElement(
9033
- Pressable10,
9460
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.secondaryButtonLabel }, quickMode ? S.back : isError ? S.retry : S.rerecord)
9461
+ ), isExtracted && /* @__PURE__ */ React17.createElement(
9462
+ Pressable11,
9034
9463
  {
9035
9464
  accessibilityRole: "button",
9036
9465
  accessibilityLabel: S.useExtracted,
9037
9466
  onPress: useResult,
9038
9467
  style: ({ pressed }) => [
9039
- styles12.primaryButton,
9468
+ styles13.primaryButton,
9040
9469
  { backgroundColor: accentColor },
9041
9470
  pressed && { opacity: 0.85 }
9042
9471
  ]
9043
9472
  },
9044
- /* @__PURE__ */ React16.createElement(Text11, { style: styles12.primaryButtonLabel }, S.useExtracted)
9045
- ))), /* @__PURE__ */ React16.createElement(
9046
- Pressable10,
9473
+ /* @__PURE__ */ React17.createElement(Text12, { style: styles13.primaryButtonLabel }, S.useExtracted)
9474
+ ))), /* @__PURE__ */ React17.createElement(
9475
+ Pressable11,
9047
9476
  {
9048
9477
  accessibilityRole: "button",
9049
9478
  disabled: isUploading,
9050
9479
  onPress: () => void cancel(),
9051
- style: styles12.cancelButton
9480
+ style: styles13.cancelButton
9052
9481
  },
9053
- /* @__PURE__ */ React16.createElement(Text11, { style: [styles12.cancelLabel, { color: accentColor }] }, S.cancel)
9482
+ /* @__PURE__ */ React17.createElement(Text12, { style: [styles13.cancelLabel, { color: accentColor }] }, S.cancel)
9054
9483
  )))
9055
9484
  );
9056
9485
  }
@@ -9058,7 +9487,7 @@ function ExtractField({
9058
9487
  label,
9059
9488
  value
9060
9489
  }) {
9061
- 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"));
9062
9491
  }
9063
9492
  async function startRecording(opts = {}) {
9064
9493
  if (Platform7.OS === "web") return startWebRecording(opts);
@@ -9237,7 +9666,7 @@ function formatTime(seconds) {
9237
9666
  const s = (seconds % 60).toString().padStart(2, "0");
9238
9667
  return `${m}:${s}`;
9239
9668
  }
9240
- var styles12 = StyleSheet12.create({
9669
+ var styles13 = StyleSheet13.create({
9241
9670
  backdrop: {
9242
9671
  flex: 1,
9243
9672
  backgroundColor: "rgba(0,0,0,0.55)",
@@ -9485,7 +9914,7 @@ var styles12 = StyleSheet12.create({
9485
9914
  },
9486
9915
  extractRow: {
9487
9916
  paddingVertical: 8,
9488
- borderBottomWidth: StyleSheet12.hairlineWidth,
9917
+ borderBottomWidth: StyleSheet13.hairlineWidth,
9489
9918
  borderBottomColor: "rgba(255,255,255,0.1)"
9490
9919
  },
9491
9920
  extractLabel: {
@@ -9504,17 +9933,17 @@ var styles12 = StyleSheet12.create({
9504
9933
  });
9505
9934
 
9506
9935
  // src/SessionEndDialog.tsx
9507
- 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";
9508
9937
  import {
9509
- ActivityIndicator as ActivityIndicator7,
9938
+ ActivityIndicator as ActivityIndicator8,
9510
9939
  Modal as Modal8,
9511
- Pressable as Pressable11,
9512
- ScrollView as ScrollView10,
9513
- StyleSheet as StyleSheet13,
9940
+ Pressable as Pressable12,
9941
+ ScrollView as ScrollView11,
9942
+ StyleSheet as StyleSheet14,
9514
9943
  Switch as Switch2,
9515
- Text as Text12,
9516
- TextInput as TextInput5,
9517
- View as View13
9944
+ Text as Text13,
9945
+ TextInput as TextInput6,
9946
+ View as View14
9518
9947
  } from "react-native";
9519
9948
  var ISSUE_KEYS = ["bugs", "crashes", "performance", "ui"];
9520
9949
  var ISSUE_LABELS = {
@@ -9597,24 +10026,24 @@ function SessionEndDialog({
9597
10026
  style
9598
10027
  }) {
9599
10028
  const t = STRINGS7[useTpkLanguage()];
9600
- const [ratings, setRatings] = useState13({
10029
+ const [ratings, setRatings] = useState14({
9601
10030
  overall: 3,
9602
10031
  stability: 3,
9603
10032
  usability: 3,
9604
10033
  experience: 3
9605
10034
  });
9606
- const [issues, setIssues] = useState13({
10035
+ const [issues, setIssues] = useState14({
9607
10036
  bugs: false,
9608
10037
  crashes: false,
9609
10038
  performance: false,
9610
10039
  ui: false
9611
10040
  });
9612
- const [positive, setPositive] = useState13("");
9613
- const [negative, setNegative] = useState13("");
9614
- const [suggestions, setSuggestions] = useState13("");
9615
- const [submitting, setSubmitting] = useState13(false);
9616
- const [error, setError] = useState13(null);
9617
- 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(() => {
9618
10047
  if (visible) {
9619
10048
  setRatings({ overall: 3, stability: 3, usability: 3, experience: 3 });
9620
10049
  setIssues({ bugs: false, crashes: false, performance: false, ui: false });
@@ -9624,13 +10053,13 @@ function SessionEndDialog({
9624
10053
  setError(null);
9625
10054
  }
9626
10055
  }, [visible]);
9627
- const hasFeedback = useMemo8(() => {
10056
+ const hasFeedback = useMemo9(() => {
9628
10057
  if (positive.trim() || negative.trim() || suggestions.trim()) return true;
9629
10058
  if (Object.values(issues).some(Boolean)) return true;
9630
10059
  if (Object.values(ratings).some((r) => r !== 3)) return true;
9631
10060
  return false;
9632
10061
  }, [positive, negative, suggestions, issues, ratings]);
9633
- const submit = useCallback9(async () => {
10062
+ const submit = useCallback10(async () => {
9634
10063
  if (!tpk) return;
9635
10064
  setSubmitting(true);
9636
10065
  setError(null);
@@ -9686,7 +10115,7 @@ function SessionEndDialog({
9686
10115
  onError,
9687
10116
  t
9688
10117
  ]);
9689
- return /* @__PURE__ */ React17.createElement(
10118
+ return /* @__PURE__ */ React18.createElement(
9690
10119
  Modal8,
9691
10120
  {
9692
10121
  animationType: "slide",
@@ -9694,33 +10123,33 @@ function SessionEndDialog({
9694
10123
  transparent: false,
9695
10124
  visible
9696
10125
  },
9697
- /* @__PURE__ */ React17.createElement(View13, { style: [styles13.root, style] }, /* @__PURE__ */ React17.createElement(
9698
- View13,
10126
+ /* @__PURE__ */ React18.createElement(View14, { style: [styles14.root, style] }, /* @__PURE__ */ React18.createElement(
10127
+ View14,
9699
10128
  {
9700
- style: [styles13.header, { paddingTop: 12 + getModalInsets().top }]
10129
+ style: [styles14.header, { paddingTop: 12 + getModalInsets().top }]
9701
10130
  },
9702
- /* @__PURE__ */ React17.createElement(
9703
- Pressable11,
10131
+ /* @__PURE__ */ React18.createElement(
10132
+ Pressable12,
9704
10133
  {
9705
10134
  accessibilityRole: "button",
9706
10135
  accessibilityLabel: t.cancel,
9707
10136
  disabled: submitting,
9708
10137
  onPress: onClose,
9709
- style: styles13.headerClose
10138
+ style: styles14.headerClose
9710
10139
  },
9711
- /* @__PURE__ */ React17.createElement(Text12, { style: styles13.headerCloseLabel }, "\xD7")
10140
+ /* @__PURE__ */ React18.createElement(Text13, { style: styles14.headerCloseLabel }, "\xD7")
9712
10141
  ),
9713
- /* @__PURE__ */ React17.createElement(Text12, { style: styles13.headerTitle }, t.title),
9714
- /* @__PURE__ */ React17.createElement(View13, { style: { width: 36 } })
9715
- ), /* @__PURE__ */ React17.createElement(
9716
- 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,
9717
10146
  {
9718
- contentContainerStyle: styles13.body,
10147
+ contentContainerStyle: styles14.body,
9719
10148
  keyboardShouldPersistTaps: "handled"
9720
10149
  },
9721
- /* @__PURE__ */ React17.createElement(StatsSection, { stats, t }),
9722
- /* @__PURE__ */ React17.createElement(SectionLabel, { text: t.howWasIt }),
9723
- 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(
9724
10153
  RatingRow,
9725
10154
  {
9726
10155
  key: k,
@@ -9730,8 +10159,8 @@ function SessionEndDialog({
9730
10159
  onChange: (v) => setRatings((cur) => ({ ...cur, [k]: v }))
9731
10160
  }
9732
10161
  )),
9733
- /* @__PURE__ */ React17.createElement(SectionLabel, { text: t.didYouEncounter }),
9734
- ISSUE_KEYS.map((k) => /* @__PURE__ */ React17.createElement(
10162
+ /* @__PURE__ */ React18.createElement(SectionLabel, { text: t.didYouEncounter }),
10163
+ ISSUE_KEYS.map((k) => /* @__PURE__ */ React18.createElement(
9735
10164
  IssueRow,
9736
10165
  {
9737
10166
  key: k,
@@ -9740,78 +10169,78 @@ function SessionEndDialog({
9740
10169
  onChange: (v) => setIssues((cur) => ({ ...cur, [k]: v }))
9741
10170
  }
9742
10171
  )),
9743
- /* @__PURE__ */ React17.createElement(SectionLabel, { text: t.comments }),
9744
- /* @__PURE__ */ React17.createElement(FieldLabel2, { text: t.positiveLabel }),
9745
- /* @__PURE__ */ React17.createElement(
9746
- TextInput5,
10172
+ /* @__PURE__ */ React18.createElement(SectionLabel, { text: t.comments }),
10173
+ /* @__PURE__ */ React18.createElement(FieldLabel2, { text: t.positiveLabel }),
10174
+ /* @__PURE__ */ React18.createElement(
10175
+ TextInput6,
9747
10176
  {
9748
10177
  multiline: true,
9749
10178
  onChangeText: setPositive,
9750
10179
  placeholder: t.positivePlaceholder,
9751
- style: [styles13.input, styles13.textarea],
10180
+ style: [styles14.input, styles14.textarea],
9752
10181
  textAlignVertical: "top",
9753
10182
  value: positive
9754
10183
  }
9755
10184
  ),
9756
- /* @__PURE__ */ React17.createElement(FieldLabel2, { text: t.negativeLabel }),
9757
- /* @__PURE__ */ React17.createElement(
9758
- TextInput5,
10185
+ /* @__PURE__ */ React18.createElement(FieldLabel2, { text: t.negativeLabel }),
10186
+ /* @__PURE__ */ React18.createElement(
10187
+ TextInput6,
9759
10188
  {
9760
10189
  multiline: true,
9761
10190
  onChangeText: setNegative,
9762
10191
  placeholder: t.negativePlaceholder,
9763
- style: [styles13.input, styles13.textarea],
10192
+ style: [styles14.input, styles14.textarea],
9764
10193
  textAlignVertical: "top",
9765
10194
  value: negative
9766
10195
  }
9767
10196
  ),
9768
- /* @__PURE__ */ React17.createElement(FieldLabel2, { text: t.suggestionsLabel }),
9769
- /* @__PURE__ */ React17.createElement(
9770
- TextInput5,
10197
+ /* @__PURE__ */ React18.createElement(FieldLabel2, { text: t.suggestionsLabel }),
10198
+ /* @__PURE__ */ React18.createElement(
10199
+ TextInput6,
9771
10200
  {
9772
10201
  multiline: true,
9773
10202
  onChangeText: setSuggestions,
9774
10203
  placeholder: t.suggestionsPlaceholder,
9775
- style: [styles13.input, styles13.textarea],
10204
+ style: [styles14.input, styles14.textarea],
9776
10205
  textAlignVertical: "top",
9777
10206
  value: suggestions
9778
10207
  }
9779
10208
  ),
9780
- error && /* @__PURE__ */ React17.createElement(View13, { style: styles13.errorBox }, /* @__PURE__ */ React17.createElement(Text12, { style: styles13.errorLabel }, error))
9781
- ), /* @__PURE__ */ React17.createElement(
9782
- View13,
10209
+ error && /* @__PURE__ */ React18.createElement(View14, { style: styles14.errorBox }, /* @__PURE__ */ React18.createElement(Text13, { style: styles14.errorLabel }, error))
10210
+ ), /* @__PURE__ */ React18.createElement(
10211
+ View14,
9783
10212
  {
9784
10213
  style: [
9785
- styles13.footer,
10214
+ styles14.footer,
9786
10215
  { paddingBottom: Math.max(14, getModalInsets().bottom) }
9787
10216
  ]
9788
10217
  },
9789
- /* @__PURE__ */ React17.createElement(
9790
- Pressable11,
10218
+ /* @__PURE__ */ React18.createElement(
10219
+ Pressable12,
9791
10220
  {
9792
10221
  accessibilityRole: "button",
9793
10222
  disabled: submitting,
9794
10223
  onPress: onClose,
9795
10224
  style: ({ pressed }) => [
9796
- styles13.cancelButton,
10225
+ styles14.cancelButton,
9797
10226
  pressed && { opacity: 0.7 }
9798
10227
  ]
9799
10228
  },
9800
- /* @__PURE__ */ React17.createElement(Text12, { style: styles13.cancelLabel }, t.cancel)
10229
+ /* @__PURE__ */ React18.createElement(Text13, { style: styles14.cancelLabel }, t.cancel)
9801
10230
  ),
9802
- /* @__PURE__ */ React17.createElement(
9803
- Pressable11,
10231
+ /* @__PURE__ */ React18.createElement(
10232
+ Pressable12,
9804
10233
  {
9805
10234
  accessibilityRole: "button",
9806
10235
  disabled: !tpk || submitting,
9807
10236
  onPress: () => void submit(),
9808
10237
  style: ({ pressed }) => [
9809
- styles13.endButton,
9810
- (!tpk || submitting) && styles13.endButtonDisabled,
10238
+ styles14.endButton,
10239
+ (!tpk || submitting) && styles14.endButtonDisabled,
9811
10240
  pressed && { opacity: 0.85 }
9812
10241
  ]
9813
10242
  },
9814
- 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)
9815
10244
  )
9816
10245
  ))
9817
10246
  );
@@ -9821,19 +10250,19 @@ function StatsSection({
9821
10250
  t
9822
10251
  }) {
9823
10252
  const duration = stats?.durationSeconds ?? 0;
9824
- 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(
9825
10254
  StatTile,
9826
10255
  {
9827
10256
  label: t.statScreens,
9828
10257
  value: String(stats?.screensVisited ?? 0)
9829
10258
  }
9830
- ), /* @__PURE__ */ React17.createElement(
10259
+ ), /* @__PURE__ */ React18.createElement(
9831
10260
  StatTile,
9832
10261
  {
9833
10262
  label: t.statBugs,
9834
10263
  value: String(stats?.bugsReported ?? 0)
9835
10264
  }
9836
- ), /* @__PURE__ */ React17.createElement(
10265
+ ), /* @__PURE__ */ React18.createElement(
9837
10266
  StatTile,
9838
10267
  {
9839
10268
  label: t.statTasks,
@@ -9845,13 +10274,13 @@ function StatTile({
9845
10274
  label,
9846
10275
  value
9847
10276
  }) {
9848
- 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));
9849
10278
  }
9850
10279
  function SectionLabel({ text }) {
9851
- return /* @__PURE__ */ React17.createElement(Text12, { style: styles13.sectionLabel }, text);
10280
+ return /* @__PURE__ */ React18.createElement(Text13, { style: styles14.sectionLabel }, text);
9852
10281
  }
9853
10282
  function FieldLabel2({ text }) {
9854
- return /* @__PURE__ */ React17.createElement(Text12, { style: styles13.fieldLabel }, text);
10283
+ return /* @__PURE__ */ React18.createElement(Text13, { style: styles14.fieldLabel }, text);
9855
10284
  }
9856
10285
  function RatingRow({
9857
10286
  label,
@@ -9859,8 +10288,8 @@ function RatingRow({
9859
10288
  onChange,
9860
10289
  starsA11y
9861
10290
  }) {
9862
- 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(
9863
- 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,
9864
10293
  {
9865
10294
  key: i,
9866
10295
  accessibilityRole: "button",
@@ -9868,11 +10297,11 @@ function RatingRow({
9868
10297
  accessibilityState: { selected: value === i },
9869
10298
  onPress: () => onChange(i),
9870
10299
  style: ({ pressed }) => [
9871
- styles13.starButton,
10300
+ styles14.starButton,
9872
10301
  pressed && { opacity: 0.7 }
9873
10302
  ]
9874
10303
  },
9875
- /* @__PURE__ */ React17.createElement(
10304
+ /* @__PURE__ */ React18.createElement(
9876
10305
  TpkIcon,
9877
10306
  {
9878
10307
  name: i <= value ? "star_filled" : "star_outline",
@@ -9887,7 +10316,7 @@ function IssueRow({
9887
10316
  value,
9888
10317
  onChange
9889
10318
  }) {
9890
- 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 }));
9891
10320
  }
9892
10321
  function formatDuration(seconds) {
9893
10322
  if (seconds < 60) return `${seconds}s`;
@@ -9931,7 +10360,7 @@ function composeFeedbackDescription(input) {
9931
10360
  }
9932
10361
  return lines.join("\n");
9933
10362
  }
9934
- var styles13 = StyleSheet13.create({
10363
+ var styles14 = StyleSheet14.create({
9935
10364
  root: {
9936
10365
  flex: 1,
9937
10366
  backgroundColor: "#FAFAF7"
@@ -9942,7 +10371,7 @@ var styles13 = StyleSheet13.create({
9942
10371
  paddingHorizontal: 12,
9943
10372
  paddingVertical: 12,
9944
10373
  backgroundColor: "#FFFFFF",
9945
- borderBottomWidth: StyleSheet13.hairlineWidth,
10374
+ borderBottomWidth: StyleSheet14.hairlineWidth,
9946
10375
  borderBottomColor: "#E5E7EB"
9947
10376
  },
9948
10377
  headerClose: {
@@ -10081,7 +10510,7 @@ var styles13 = StyleSheet13.create({
10081
10510
  gap: 10,
10082
10511
  padding: 14,
10083
10512
  backgroundColor: "#FFFFFF",
10084
- borderTopWidth: StyleSheet13.hairlineWidth,
10513
+ borderTopWidth: StyleSheet14.hairlineWidth,
10085
10514
  borderTopColor: "#E5E7EB"
10086
10515
  },
10087
10516
  cancelButton: {
@@ -10115,16 +10544,16 @@ var styles13 = StyleSheet13.create({
10115
10544
  });
10116
10545
 
10117
10546
  // src/MyBugsSheet.tsx
10118
- import React18, { useEffect as useEffect11, useState as useState14 } from "react";
10547
+ import React19, { useEffect as useEffect12, useState as useState15 } from "react";
10119
10548
  import {
10120
- ActivityIndicator as ActivityIndicator8,
10549
+ ActivityIndicator as ActivityIndicator9,
10121
10550
  FlatList as FlatList2,
10122
10551
  Modal as Modal9,
10123
- Pressable as Pressable12,
10124
- ScrollView as ScrollView11,
10125
- StyleSheet as StyleSheet14,
10126
- Text as Text13,
10127
- View as View14
10552
+ Pressable as Pressable13,
10553
+ ScrollView as ScrollView12,
10554
+ StyleSheet as StyleSheet15,
10555
+ Text as Text14,
10556
+ View as View15
10128
10557
  } from "react-native";
10129
10558
 
10130
10559
  // src/bug-status.ts
@@ -10195,11 +10624,11 @@ function MyBugsSheet({
10195
10624
  const theme = useTpkTheme();
10196
10625
  const language = useTpkLanguage();
10197
10626
  const t = STRINGS8[language];
10198
- const [loading, setLoading] = useState14(false);
10199
- const [error, setError] = useState14(false);
10200
- const [bugs, setBugs] = useState14([]);
10201
- const [selected, setSelected] = useState14(null);
10202
- 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(() => {
10203
10632
  if (!visible || !tpk) return;
10204
10633
  let cancelled = false;
10205
10634
  setLoading(true);
@@ -10215,7 +10644,7 @@ function MyBugsSheet({
10215
10644
  cancelled = true;
10216
10645
  };
10217
10646
  }, [visible, tpk]);
10218
- return /* @__PURE__ */ React18.createElement(
10647
+ return /* @__PURE__ */ React19.createElement(
10219
10648
  Modal9,
10220
10649
  {
10221
10650
  visible,
@@ -10223,22 +10652,22 @@ function MyBugsSheet({
10223
10652
  animationType: "slide",
10224
10653
  onRequestClose: onClose
10225
10654
  },
10226
- /* @__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(
10227
- 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,
10228
10657
  {
10229
10658
  onPress: onClose,
10230
10659
  hitSlop: 8,
10231
10660
  accessibilityLabel: t.close,
10232
10661
  testID: "tpk-my-bugs-close"
10233
10662
  },
10234
- /* @__PURE__ */ React18.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10235
- )), 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(
10236
10665
  FlatList2,
10237
10666
  {
10238
10667
  data: bugs,
10239
10668
  keyExtractor: (b) => b.id,
10240
- contentContainerStyle: styles14.listBody,
10241
- renderItem: ({ item }) => /* @__PURE__ */ React18.createElement(
10669
+ contentContainerStyle: styles15.listBody,
10670
+ renderItem: ({ item }) => /* @__PURE__ */ React19.createElement(
10242
10671
  BugRow,
10243
10672
  {
10244
10673
  bug: item,
@@ -10249,7 +10678,7 @@ function MyBugsSheet({
10249
10678
  )
10250
10679
  }
10251
10680
  ))),
10252
- /* @__PURE__ */ React18.createElement(
10681
+ /* @__PURE__ */ React19.createElement(
10253
10682
  BugDetailModal,
10254
10683
  {
10255
10684
  bug: selected,
@@ -10266,15 +10695,15 @@ function StatusBadge2({
10266
10695
  language
10267
10696
  }) {
10268
10697
  const { label, color } = bugStatusStyle(status, language);
10269
- return /* @__PURE__ */ React18.createElement(
10270
- View14,
10698
+ return /* @__PURE__ */ React19.createElement(
10699
+ View15,
10271
10700
  {
10272
10701
  style: [
10273
- styles14.badge,
10702
+ styles15.badge,
10274
10703
  { backgroundColor: `${color}1F`, borderColor: `${color}66` }
10275
10704
  ]
10276
10705
  },
10277
- /* @__PURE__ */ React18.createElement(Text13, { style: [styles14.badgeText, { color }] }, label)
10706
+ /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.badgeText, { color }] }, label)
10278
10707
  );
10279
10708
  }
10280
10709
  function metaLine(bug, language) {
@@ -10291,15 +10720,15 @@ function BugRow({
10291
10720
  textColor,
10292
10721
  onPress
10293
10722
  }) {
10294
- return /* @__PURE__ */ React18.createElement(
10295
- Pressable12,
10723
+ return /* @__PURE__ */ React19.createElement(
10724
+ Pressable13,
10296
10725
  {
10297
- style: styles14.row,
10726
+ style: styles15.row,
10298
10727
  onPress,
10299
10728
  testID: `tpk-my-bug-${bug.id}`
10300
10729
  },
10301
- /* @__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))),
10302
- /* @__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 })
10303
10732
  );
10304
10733
  }
10305
10734
  function BugDetailModal({
@@ -10309,7 +10738,7 @@ function BugDetailModal({
10309
10738
  surface,
10310
10739
  textColor
10311
10740
  }) {
10312
- return /* @__PURE__ */ React18.createElement(
10741
+ return /* @__PURE__ */ React19.createElement(
10313
10742
  Modal9,
10314
10743
  {
10315
10744
  visible: bug != null,
@@ -10317,17 +10746,17 @@ function BugDetailModal({
10317
10746
  animationType: "fade",
10318
10747
  onRequestClose: onClose
10319
10748
  },
10320
- /* @__PURE__ */ React18.createElement(Pressable12, { style: styles14.detailBackdrop, onPress: onClose }, /* @__PURE__ */ React18.createElement(
10321
- Pressable12,
10749
+ /* @__PURE__ */ React19.createElement(Pressable13, { style: styles15.detailBackdrop, onPress: onClose }, /* @__PURE__ */ React19.createElement(
10750
+ Pressable13,
10322
10751
  {
10323
- style: [styles14.detailCard, { backgroundColor: surface }],
10752
+ style: [styles15.detailCard, { backgroundColor: surface }],
10324
10753
  onPress: () => void 0
10325
10754
  },
10326
- 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
10327
10756
  ))
10328
10757
  );
10329
10758
  }
10330
- var styles14 = StyleSheet14.create({
10759
+ var styles15 = StyleSheet15.create({
10331
10760
  backdrop: {
10332
10761
  flex: 1,
10333
10762
  backgroundColor: "rgba(0,0,0,0.4)",
@@ -10356,7 +10785,7 @@ var styles14 = StyleSheet14.create({
10356
10785
  flexDirection: "row",
10357
10786
  alignItems: "center",
10358
10787
  paddingVertical: 14,
10359
- borderBottomWidth: StyleSheet14.hairlineWidth,
10788
+ borderBottomWidth: StyleSheet15.hairlineWidth,
10360
10789
  borderBottomColor: "#E2E8F0"
10361
10790
  },
10362
10791
  rowMain: { flex: 1, paddingRight: 12 },
@@ -10384,14 +10813,14 @@ var styles14 = StyleSheet14.create({
10384
10813
  });
10385
10814
 
10386
10815
  // src/SessionDetailsSheet.tsx
10387
- 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";
10388
10817
  import {
10389
10818
  Modal as Modal10,
10390
- Pressable as Pressable13,
10391
- ScrollView as ScrollView12,
10392
- StyleSheet as StyleSheet15,
10393
- Text as Text14,
10394
- View as View15
10819
+ Pressable as Pressable14,
10820
+ ScrollView as ScrollView13,
10821
+ StyleSheet as StyleSheet16,
10822
+ Text as Text15,
10823
+ View as View16
10395
10824
  } from "react-native";
10396
10825
  var STRINGS9 = {
10397
10826
  en: {
@@ -10437,7 +10866,7 @@ function SessionDetailsSheet({
10437
10866
  const language = useTpkLanguage();
10438
10867
  const t = STRINGS9[language];
10439
10868
  const money = (amount) => formatTpkMoney(amount, earningsCurrency, language);
10440
- const data = useMemo9(() => {
10869
+ const data = useMemo10(() => {
10441
10870
  if (!visible || !tpk) {
10442
10871
  return { taps: 0, screenViews: 0, activeMinutes: 0, paidMinutes: 0 };
10443
10872
  }
@@ -10449,8 +10878,8 @@ function SessionDetailsSheet({
10449
10878
  paidMinutes: tpk.getEngagedMinutes()
10450
10879
  };
10451
10880
  }, [visible, tpk]);
10452
- const [tasks, setTasks] = useState15(null);
10453
- useEffect12(() => {
10881
+ const [tasks, setTasks] = useState16(null);
10882
+ useEffect13(() => {
10454
10883
  if (!visible || !tpk) return;
10455
10884
  let cancelled = false;
10456
10885
  tpk.getTaskProgress().then((p) => {
@@ -10461,7 +10890,7 @@ function SessionDetailsSheet({
10461
10890
  };
10462
10891
  }, [visible, tpk]);
10463
10892
  const expected = earningsBaseAmount + data.paidMinutes * earningsPerMinuteRate;
10464
- return /* @__PURE__ */ React19.createElement(
10893
+ return /* @__PURE__ */ React20.createElement(
10465
10894
  Modal10,
10466
10895
  {
10467
10896
  visible,
@@ -10469,29 +10898,29 @@ function SessionDetailsSheet({
10469
10898
  animationType: "slide",
10470
10899
  onRequestClose: onClose
10471
10900
  },
10472
- /* @__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(
10473
- 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,
10474
10903
  {
10475
10904
  onPress: onClose,
10476
10905
  hitSlop: 8,
10477
10906
  accessibilityLabel: t.close,
10478
10907
  testID: "tpk-session-details-close"
10479
10908
  },
10480
- /* @__PURE__ */ React19.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10481
- )), /* @__PURE__ */ React19.createElement(ScrollView12, { contentContainerStyle: styles15.body }, /* @__PURE__ */ React19.createElement(
10482
- 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,
10483
10912
  {
10484
- style: [styles15.earnings, { borderColor: theme.primary }],
10913
+ style: [styles16.earnings, { borderColor: theme.primary }],
10485
10914
  testID: "tpk-session-details-earnings"
10486
10915
  },
10487
- /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.earningsLabel, { color: theme.onSurface }] }, t.expectedEarnings),
10488
- /* @__PURE__ */ React19.createElement(Text14, { style: [styles15.earningsValue, { color: theme.primary }] }, money(expected)),
10489
- /* @__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(
10490
10919
  money(earningsBaseAmount),
10491
10920
  data.paidMinutes,
10492
10921
  money(earningsPerMinuteRate)
10493
10922
  ))
10494
- ), /* @__PURE__ */ React19.createElement(
10923
+ ), /* @__PURE__ */ React20.createElement(
10495
10924
  Metric,
10496
10925
  {
10497
10926
  label: t.activeTime,
@@ -10499,7 +10928,7 @@ function SessionDetailsSheet({
10499
10928
  hint: t.activeTimeHint,
10500
10929
  color: theme.onSurface
10501
10930
  }
10502
- ), /* @__PURE__ */ React19.createElement(
10931
+ ), /* @__PURE__ */ React20.createElement(
10503
10932
  Metric,
10504
10933
  {
10505
10934
  label: t.paidTime,
@@ -10507,21 +10936,21 @@ function SessionDetailsSheet({
10507
10936
  hint: t.paidTimeHint,
10508
10937
  color: theme.onSurface
10509
10938
  }
10510
- ), /* @__PURE__ */ React19.createElement(
10939
+ ), /* @__PURE__ */ React20.createElement(
10511
10940
  Metric,
10512
10941
  {
10513
10942
  label: t.taps,
10514
10943
  value: String(data.taps),
10515
10944
  color: theme.onSurface
10516
10945
  }
10517
- ), /* @__PURE__ */ React19.createElement(
10946
+ ), /* @__PURE__ */ React20.createElement(
10518
10947
  Metric,
10519
10948
  {
10520
10949
  label: t.screens,
10521
10950
  value: String(data.screenViews),
10522
10951
  color: theme.onSurface
10523
10952
  }
10524
- ), tasks?.hasTasks ? /* @__PURE__ */ React19.createElement(
10953
+ ), tasks?.hasTasks ? /* @__PURE__ */ React20.createElement(
10525
10954
  Metric,
10526
10955
  {
10527
10956
  label: t.tasks,
@@ -10537,9 +10966,9 @@ function Metric({
10537
10966
  hint,
10538
10967
  color
10539
10968
  }) {
10540
- 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));
10541
10970
  }
10542
- var styles15 = StyleSheet15.create({
10971
+ var styles16 = StyleSheet16.create({
10543
10972
  backdrop: {
10544
10973
  flex: 1,
10545
10974
  backgroundColor: "rgba(0,0,0,0.4)",
@@ -10576,7 +11005,7 @@ var styles15 = StyleSheet15.create({
10576
11005
  alignItems: "center",
10577
11006
  justifyContent: "space-between",
10578
11007
  paddingVertical: 12,
10579
- borderBottomWidth: StyleSheet15.hairlineWidth,
11008
+ borderBottomWidth: StyleSheet16.hairlineWidth,
10580
11009
  borderBottomColor: "#E2E8F0"
10581
11010
  },
10582
11011
  metricLabelCol: { flex: 1, paddingRight: 12 },
@@ -10586,15 +11015,15 @@ var styles15 = StyleSheet15.create({
10586
11015
  });
10587
11016
 
10588
11017
  // src/NotificationsSheet.tsx
10589
- import React20, { useEffect as useEffect13, useState as useState16 } from "react";
11018
+ import React21, { useEffect as useEffect14, useState as useState17 } from "react";
10590
11019
  import {
10591
- ActivityIndicator as ActivityIndicator9,
11020
+ ActivityIndicator as ActivityIndicator10,
10592
11021
  FlatList as FlatList3,
10593
11022
  Modal as Modal11,
10594
- Pressable as Pressable14,
10595
- StyleSheet as StyleSheet16,
10596
- Text as Text15,
10597
- View as View16
11023
+ Pressable as Pressable15,
11024
+ StyleSheet as StyleSheet17,
11025
+ Text as Text16,
11026
+ View as View17
10598
11027
  } from "react-native";
10599
11028
  var STRINGS10 = {
10600
11029
  en: {
@@ -10626,10 +11055,10 @@ function NotificationsSheet({
10626
11055
  }) {
10627
11056
  const theme = useTpkTheme();
10628
11057
  const t = STRINGS10[useTpkLanguage()];
10629
- const [loading, setLoading] = useState16(false);
10630
- const [error, setError] = useState16(false);
10631
- const [items, setItems] = useState16([]);
10632
- useEffect13(() => {
11058
+ const [loading, setLoading] = useState17(false);
11059
+ const [error, setError] = useState17(false);
11060
+ const [items, setItems] = useState17([]);
11061
+ useEffect14(() => {
10633
11062
  if (!visible || !tpk) return;
10634
11063
  let cancelled = false;
10635
11064
  setLoading(true);
@@ -10664,7 +11093,7 @@ function NotificationsSheet({
10664
11093
  tpk.markNotificationsRead().then((unread) => onUnreadChange?.(unread)).catch(() => void 0);
10665
11094
  };
10666
11095
  const hasUnread = items.some((x) => !x.isRead);
10667
- return /* @__PURE__ */ React20.createElement(
11096
+ return /* @__PURE__ */ React21.createElement(
10668
11097
  Modal11,
10669
11098
  {
10670
11099
  visible,
@@ -10672,52 +11101,52 @@ function NotificationsSheet({
10672
11101
  animationType: "slide",
10673
11102
  onRequestClose: onClose
10674
11103
  },
10675
- /* @__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(
10676
- 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,
10677
11106
  {
10678
11107
  onPress: markAll,
10679
11108
  hitSlop: 8,
10680
11109
  testID: "tpk-notifications-mark-all"
10681
11110
  },
10682
- /* @__PURE__ */ React20.createElement(Text15, { style: [styles16.markAll, { color: theme.primary }] }, t.markAll)
10683
- ) : null, /* @__PURE__ */ React20.createElement(
10684
- Pressable14,
11111
+ /* @__PURE__ */ React21.createElement(Text16, { style: [styles17.markAll, { color: theme.primary }] }, t.markAll)
11112
+ ) : null, /* @__PURE__ */ React21.createElement(
11113
+ Pressable15,
10685
11114
  {
10686
11115
  onPress: onClose,
10687
11116
  hitSlop: 8,
10688
11117
  accessibilityLabel: t.close,
10689
11118
  testID: "tpk-notifications-close"
10690
11119
  },
10691
- /* @__PURE__ */ React20.createElement(TpkIcon, { name: "close", size: 24, color: theme.onSurface })
10692
- ))), 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(
10693
11122
  FlatList3,
10694
11123
  {
10695
11124
  data: items,
10696
11125
  keyExtractor: (n) => n.id,
10697
- contentContainerStyle: styles16.listBody,
10698
- renderItem: ({ item }) => /* @__PURE__ */ React20.createElement(
10699
- Pressable14,
11126
+ contentContainerStyle: styles17.listBody,
11127
+ renderItem: ({ item }) => /* @__PURE__ */ React21.createElement(
11128
+ Pressable15,
10700
11129
  {
10701
- style: styles16.row,
11130
+ style: styles17.row,
10702
11131
  onPress: () => markOne(item),
10703
11132
  testID: `tpk-notification-${item.id}`
10704
11133
  },
10705
- /* @__PURE__ */ React20.createElement(
10706
- View16,
11134
+ /* @__PURE__ */ React21.createElement(
11135
+ View17,
10707
11136
  {
10708
11137
  style: [
10709
- styles16.dot,
11138
+ styles17.dot,
10710
11139
  {
10711
11140
  backgroundColor: item.isRead ? "transparent" : theme.primary
10712
11141
  }
10713
11142
  ]
10714
11143
  }
10715
11144
  ),
10716
- /* @__PURE__ */ React20.createElement(View16, { style: styles16.rowMain }, /* @__PURE__ */ React20.createElement(
10717
- Text15,
11145
+ /* @__PURE__ */ React21.createElement(View17, { style: styles17.rowMain }, /* @__PURE__ */ React21.createElement(
11146
+ Text16,
10718
11147
  {
10719
11148
  style: [
10720
- styles16.rowTitle,
11149
+ styles17.rowTitle,
10721
11150
  {
10722
11151
  color: theme.onSurface,
10723
11152
  fontWeight: item.isRead ? "500" : "700"
@@ -10726,20 +11155,20 @@ function NotificationsSheet({
10726
11155
  numberOfLines: 2
10727
11156
  },
10728
11157
  item.title
10729
- ), item.body ? /* @__PURE__ */ React20.createElement(
10730
- Text15,
11158
+ ), item.body ? /* @__PURE__ */ React21.createElement(
11159
+ Text16,
10731
11160
  {
10732
- style: [styles16.rowBody, { color: theme.onSurface }],
11161
+ style: [styles17.rowBody, { color: theme.onSurface }],
10733
11162
  numberOfLines: 3
10734
11163
  },
10735
11164
  item.body
10736
- ) : null, /* @__PURE__ */ React20.createElement(Text15, { style: styles16.muted }, formatDate2(item.createdAt)))
11165
+ ) : null, /* @__PURE__ */ React21.createElement(Text16, { style: styles17.muted }, formatDate2(item.createdAt)))
10737
11166
  )
10738
11167
  }
10739
11168
  )))
10740
11169
  );
10741
11170
  }
10742
- var styles16 = StyleSheet16.create({
11171
+ var styles17 = StyleSheet17.create({
10743
11172
  backdrop: {
10744
11173
  flex: 1,
10745
11174
  backgroundColor: "rgba(0,0,0,0.4)",
@@ -10770,7 +11199,7 @@ var styles16 = StyleSheet16.create({
10770
11199
  flexDirection: "row",
10771
11200
  alignItems: "flex-start",
10772
11201
  paddingVertical: 14,
10773
- borderBottomWidth: StyleSheet16.hairlineWidth,
11202
+ borderBottomWidth: StyleSheet17.hairlineWidth,
10774
11203
  borderBottomColor: "#E2E8F0"
10775
11204
  },
10776
11205
  dot: { width: 8, height: 8, borderRadius: 4, marginTop: 6, marginRight: 10 },
@@ -10780,17 +11209,17 @@ var styles16 = StyleSheet16.create({
10780
11209
  });
10781
11210
 
10782
11211
  // src/InviteCodeScreen.tsx
10783
- import React21, { useState as useState17 } from "react";
11212
+ import React22, { useState as useState18 } from "react";
10784
11213
  import {
10785
- ActivityIndicator as ActivityIndicator10,
11214
+ ActivityIndicator as ActivityIndicator11,
10786
11215
  KeyboardAvoidingView,
10787
11216
  Modal as Modal12,
10788
11217
  Platform as Platform8,
10789
- Pressable as Pressable15,
10790
- StyleSheet as StyleSheet17,
10791
- Text as Text16,
10792
- TextInput as TextInput6,
10793
- View as View17
11218
+ Pressable as Pressable16,
11219
+ StyleSheet as StyleSheet18,
11220
+ Text as Text17,
11221
+ TextInput as TextInput7,
11222
+ View as View18
10794
11223
  } from "react-native";
10795
11224
  var STRINGS11 = {
10796
11225
  en: {
@@ -10821,9 +11250,9 @@ function InviteCodeScreen({
10821
11250
  }) {
10822
11251
  const theme = useTpkTheme();
10823
11252
  const t = STRINGS11[useTpkLanguage()];
10824
- const [code, setCode] = useState17("");
10825
- const [loading, setLoading] = useState17(false);
10826
- const [error, setError] = useState17(false);
11253
+ const [code, setCode] = useState18("");
11254
+ const [loading, setLoading] = useState18(false);
11255
+ const [error, setError] = useState18(false);
10827
11256
  const trimmed = code.trim();
10828
11257
  const canSubmit = trimmed.length > 0 && !loading && tpk != null;
10829
11258
  const submit = () => {
@@ -10839,7 +11268,7 @@ function InviteCodeScreen({
10839
11268
  setError(true);
10840
11269
  });
10841
11270
  };
10842
- return /* @__PURE__ */ React21.createElement(
11271
+ return /* @__PURE__ */ React22.createElement(
10843
11272
  Modal12,
10844
11273
  {
10845
11274
  visible,
@@ -10847,24 +11276,24 @@ function InviteCodeScreen({
10847
11276
  animationType: "fade",
10848
11277
  onRequestClose: onClose
10849
11278
  },
10850
- /* @__PURE__ */ React21.createElement(
11279
+ /* @__PURE__ */ React22.createElement(
10851
11280
  KeyboardAvoidingView,
10852
11281
  {
10853
11282
  behavior: Platform8.OS === "ios" ? "padding" : void 0,
10854
- style: styles17.backdrop
11283
+ style: styles18.backdrop
10855
11284
  },
10856
- /* @__PURE__ */ React21.createElement(View17, { style: [styles17.card, { backgroundColor: theme.surface }] }, onClose ? /* @__PURE__ */ React21.createElement(
10857
- Pressable15,
11285
+ /* @__PURE__ */ React22.createElement(View18, { style: [styles18.card, { backgroundColor: theme.surface }] }, onClose ? /* @__PURE__ */ React22.createElement(
11286
+ Pressable16,
10858
11287
  {
10859
11288
  onPress: onClose,
10860
11289
  hitSlop: 8,
10861
- style: styles17.close,
11290
+ style: styles18.close,
10862
11291
  accessibilityLabel: t.close,
10863
11292
  testID: "tpk-invite-close"
10864
11293
  },
10865
- /* @__PURE__ */ React21.createElement(TpkIcon, { name: "close", size: 22, color: theme.onSurface })
10866
- ) : 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(
10867
- 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,
10868
11297
  {
10869
11298
  value: code,
10870
11299
  onChangeText: (t2) => {
@@ -10879,7 +11308,7 @@ function InviteCodeScreen({
10879
11308
  onSubmitEditing: submit,
10880
11309
  returnKeyType: "go",
10881
11310
  style: [
10882
- styles17.input,
11311
+ styles18.input,
10883
11312
  {
10884
11313
  color: theme.onSurface,
10885
11314
  borderColor: error ? theme.errorColour : "#CBD5E1"
@@ -10887,23 +11316,23 @@ function InviteCodeScreen({
10887
11316
  ],
10888
11317
  testID: "tpk-invite-input"
10889
11318
  }
10890
- ), error ? /* @__PURE__ */ React21.createElement(Text16, { style: [styles17.error, { color: theme.errorColour }] }, t.invalidCode) : null, /* @__PURE__ */ React21.createElement(
10891
- Pressable15,
11319
+ ), error ? /* @__PURE__ */ React22.createElement(Text17, { style: [styles18.error, { color: theme.errorColour }] }, t.invalidCode) : null, /* @__PURE__ */ React22.createElement(
11320
+ Pressable16,
10892
11321
  {
10893
11322
  onPress: submit,
10894
11323
  disabled: !canSubmit,
10895
11324
  style: [
10896
- styles17.button,
11325
+ styles18.button,
10897
11326
  { backgroundColor: theme.primary, opacity: canSubmit ? 1 : 0.5 }
10898
11327
  ],
10899
11328
  testID: "tpk-invite-submit"
10900
11329
  },
10901
- 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)
10902
11331
  ))
10903
11332
  )
10904
11333
  );
10905
11334
  }
10906
- var styles17 = StyleSheet17.create({
11335
+ var styles18 = StyleSheet18.create({
10907
11336
  backdrop: {
10908
11337
  flex: 1,
10909
11338
  backgroundColor: "rgba(0,0,0,0.5)",
@@ -10949,27 +11378,30 @@ var styles17 = StyleSheet17.create({
10949
11378
  });
10950
11379
 
10951
11380
  // src/TesterPayKitWrapper.tsx
10952
- import React23, {
10953
- useCallback as useCallback11,
10954
- useEffect as useEffect15,
11381
+ import React26, {
11382
+ useCallback as useCallback12,
11383
+ useEffect as useEffect17,
10955
11384
  useRef as useRef10,
10956
- useState as useState19
11385
+ useState as useState21
10957
11386
  } from "react";
10958
11387
  import {
11388
+ Alert,
10959
11389
  AppState as AppState3,
10960
- Platform as Platform9,
10961
- StyleSheet as StyleSheet19,
10962
- View as View19
11390
+ Dimensions as Dimensions5,
11391
+ Platform as Platform10,
11392
+ StyleSheet as StyleSheet22,
11393
+ TextInput as TextInput9,
11394
+ View as View22
10963
11395
  } from "react-native";
10964
11396
 
10965
11397
  // src/ai-tester/AiRemoteControl.tsx
10966
- 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";
10967
11399
  import {
10968
11400
  Modal as Modal13,
10969
- Pressable as Pressable16,
10970
- StyleSheet as StyleSheet18,
10971
- Text as Text17,
10972
- View as View18
11401
+ Pressable as Pressable17,
11402
+ StyleSheet as StyleSheet19,
11403
+ Text as Text18,
11404
+ View as View19
10973
11405
  } from "react-native";
10974
11406
  import {
10975
11407
  executeAction,
@@ -11031,17 +11463,17 @@ function AiRemoteControl({
11031
11463
  onSessionEnded,
11032
11464
  style
11033
11465
  }) {
11034
- const [status, setStatus] = useState18("choosing");
11035
- const [actionCount, setActionCount] = useState18(0);
11466
+ const [status, setStatus] = useState19("choosing");
11467
+ const [actionCount, setActionCount] = useState19(0);
11036
11468
  const language = useTpkLanguage();
11037
11469
  const t = STRINGS12[language];
11038
- const [errorMessage2, setErrorMessage] = useState18(null);
11039
- const [sessionId, setSessionId] = useState18(null);
11040
- const [personas, setPersonas] = useState18([]);
11041
- 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");
11042
11474
  const wsRef = useRef9(null);
11043
11475
  const closedRef = useRef9(false);
11044
- useEffect14(() => {
11476
+ useEffect15(() => {
11045
11477
  if (!visible) {
11046
11478
  const ws = wsRef.current;
11047
11479
  if (ws && ws.readyState <= 1) {
@@ -11086,7 +11518,7 @@ function AiRemoteControl({
11086
11518
  cancelled = true;
11087
11519
  };
11088
11520
  }, [visible, apiBaseUrl, coordinatorToken, remoteSession]);
11089
- const _start = useCallback10(
11521
+ const _start = useCallback11(
11090
11522
  () => {
11091
11523
  setStatus("starting");
11092
11524
  void (async () => {
@@ -11142,7 +11574,7 @@ function AiRemoteControl({
11142
11574
  // eslint-disable-next-line react-hooks/exhaustive-deps
11143
11575
  [apiBaseUrl, coordinatorToken, projectId, configuration, selectedPersona]
11144
11576
  );
11145
- useEffect14(() => {
11577
+ useEffect15(() => {
11146
11578
  if (status !== "running") return;
11147
11579
  const handler = (ev) => {
11148
11580
  if (isSyntheticEvent(ev)) return;
@@ -11159,7 +11591,7 @@ function AiRemoteControl({
11159
11591
  document.addEventListener("pointerdown", handler, true);
11160
11592
  return () => document.removeEventListener("pointerdown", handler, true);
11161
11593
  }, [status]);
11162
- const _openSocket = useCallback10(
11594
+ const _openSocket = useCallback11(
11163
11595
  (wsUrl) => {
11164
11596
  const ws = new WebSocket(wsUrl);
11165
11597
  wsRef.current = ws;
@@ -11223,7 +11655,7 @@ function AiRemoteControl({
11223
11655
  },
11224
11656
  []
11225
11657
  );
11226
- const _finishSession = useCallback10(
11658
+ const _finishSession = useCallback11(
11227
11659
  (s) => {
11228
11660
  closedRef.current = true;
11229
11661
  setStatus("ended");
@@ -11238,7 +11670,7 @@ function AiRemoteControl({
11238
11670
  },
11239
11671
  [onSessionEnded, sessionId]
11240
11672
  );
11241
- const onStopPress = useCallback10(() => {
11673
+ const onStopPress = useCallback11(() => {
11242
11674
  const ws = wsRef.current;
11243
11675
  if (ws && ws.readyState === 1) {
11244
11676
  ws.send(JSON.stringify({ type: "goodbye", reason: "manual_stop" }));
@@ -11247,7 +11679,7 @@ function AiRemoteControl({
11247
11679
  onClose();
11248
11680
  }, [_finishSession, onClose]);
11249
11681
  if (!visible) return null;
11250
- return /* @__PURE__ */ React22.createElement(
11682
+ return /* @__PURE__ */ React23.createElement(
11251
11683
  Modal13,
11252
11684
  {
11253
11685
  animationType: "fade",
@@ -11255,13 +11687,13 @@ function AiRemoteControl({
11255
11687
  transparent: true,
11256
11688
  visible
11257
11689
  },
11258
- /* @__PURE__ */ React22.createElement(
11259
- View18,
11690
+ /* @__PURE__ */ React23.createElement(
11691
+ View19,
11260
11692
  {
11261
- style: [styles18.backdrop, style],
11693
+ style: [styles19.backdrop, style],
11262
11694
  dataSet: { "tpk-ai-overlay": "true" }
11263
11695
  },
11264
- /* @__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 : [
11265
11697
  {
11266
11698
  slug: "junior_tester",
11267
11699
  displayName: t.defaultPersonaName,
@@ -11269,58 +11701,58 @@ function AiRemoteControl({
11269
11701
  }
11270
11702
  ]).map((p) => {
11271
11703
  const sel = p.slug === selectedPersona;
11272
- return /* @__PURE__ */ React22.createElement(
11273
- Pressable16,
11704
+ return /* @__PURE__ */ React23.createElement(
11705
+ Pressable17,
11274
11706
  {
11275
11707
  key: p.slug,
11276
11708
  accessibilityRole: "button",
11277
11709
  accessibilityState: { selected: sel },
11278
11710
  onPress: () => setSelectedPersona(p.slug),
11279
11711
  style: [
11280
- styles18.personaChip,
11281
- sel && styles18.personaChipSelected
11712
+ styles19.personaChip,
11713
+ sel && styles19.personaChipSelected
11282
11714
  ]
11283
11715
  },
11284
- /* @__PURE__ */ React22.createElement(
11285
- Text17,
11716
+ /* @__PURE__ */ React23.createElement(
11717
+ Text18,
11286
11718
  {
11287
11719
  style: [
11288
- styles18.personaChipText,
11289
- sel && styles18.personaChipTextSelected
11720
+ styles19.personaChipText,
11721
+ sel && styles19.personaChipTextSelected
11290
11722
  ]
11291
11723
  },
11292
11724
  p.displayName
11293
11725
  )
11294
11726
  );
11295
- })), 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(
11296
- 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,
11297
11729
  {
11298
11730
  accessibilityRole: "button",
11299
11731
  onPress: onClose,
11300
- style: styles18.cancelButton
11732
+ style: styles19.cancelButton
11301
11733
  },
11302
- /* @__PURE__ */ React22.createElement(Text17, { style: styles18.cancelText }, t.cancel)
11303
- ), /* @__PURE__ */ React22.createElement(
11304
- Pressable16,
11734
+ /* @__PURE__ */ React23.createElement(Text18, { style: styles19.cancelText }, t.cancel)
11735
+ ), /* @__PURE__ */ React23.createElement(
11736
+ Pressable17,
11305
11737
  {
11306
11738
  accessibilityRole: "button",
11307
11739
  onPress: _start,
11308
- style: styles18.startButton
11740
+ style: styles19.startButton
11309
11741
  },
11310
- /* @__PURE__ */ React22.createElement(Text17, { style: styles18.stopText }, t.startTest)
11311
- ))) : /* @__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(
11312
- 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,
11313
11745
  {
11314
11746
  accessibilityRole: "button",
11315
11747
  onPress: onStopPress,
11316
- style: styles18.stopButton
11748
+ style: styles19.stopButton
11317
11749
  },
11318
- /* @__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)
11319
11751
  )))
11320
11752
  )
11321
11753
  );
11322
11754
  }
11323
- var styles18 = StyleSheet18.create({
11755
+ var styles19 = StyleSheet19.create({
11324
11756
  backdrop: {
11325
11757
  flex: 1,
11326
11758
  backgroundColor: "rgba(124, 58, 237, 0.18)",
@@ -11427,104 +11859,1295 @@ var styles18 = StyleSheet18.create({
11427
11859
  }
11428
11860
  });
11429
11861
 
11430
- // src/TesterPayKitWrapper.tsx
11431
- var SHAKE_MIN_INTERVAL_MS = 1500;
11432
- function TesterPayKitWrapper({
11433
- children,
11434
- tpk,
11435
- enableWrapper = true,
11436
- enableShake = true,
11437
- shakeThresholdG = 2.7,
11438
- style,
11439
- onShowDebugLogs,
11440
- notificationCount,
11441
- onFlushCachedCrashes,
11442
- retestCount,
11443
- onShowRetests,
11444
- onViewDashboard,
11445
- buttonPosition,
11446
- currentScreen,
11447
- sessionStartedAt,
11448
- aiCoordinatorToken,
11449
- aiRemoteTrigger = false,
11450
- aiRemotePollSeconds = 15,
11451
- aiProjectId,
11452
- aiApiBaseUrl,
11453
- theme,
11454
- language,
11455
- testID = "tpk-wrapper"
11456
- }) {
11457
- const rootRef = useRef10(null);
11458
- const [bugOpen, setBugOpen] = useState19(false);
11459
- const [bugInitialDraft, setBugInitialDraft] = useState19(null);
11460
- const [feedbackOpen, setFeedbackOpen] = useState19(false);
11461
- const [voiceOpen, setVoiceOpen] = useState19(false);
11462
- const [sessionEndOpen, setSessionEndOpen] = useState19(false);
11463
- const [aiOpen, setAiOpen] = useState19(false);
11464
- const [myBugsOpen, setMyBugsOpen] = useState19(false);
11465
- const [sessionDetailsOpen, setSessionDetailsOpen] = useState19(false);
11466
- const [messagesOpen, setMessagesOpen] = useState19(false);
11467
- const [unreadMessages, setUnreadMessages] = useState19(0);
11468
- const [retestsOpen, setRetestsOpen] = useState19(false);
11469
- const [openRetests, setOpenRetests] = useState19(0);
11470
- const refreshRetests = useCallback11(() => {
11471
- if (!tpk || retestCount !== void 0) return;
11472
- void tpk.ready.then(() => tpk.api.getMyRetests()).then((list) => setOpenRetests(list.length)).catch(() => void 0);
11473
- }, [tpk, retestCount]);
11474
- useEffect15(() => {
11475
- refreshRetests();
11476
- }, [refreshRetests]);
11477
- const aiReady = Boolean(aiCoordinatorToken && aiProjectId && aiApiBaseUrl);
11478
- const onAutoTest = aiReady ? () => setAiOpen(true) : void 0;
11479
- const [remoteSession, setRemoteSession] = useState19(
11480
- null
11481
- );
11482
- const remoteSessionRef = useRef10(null);
11483
- useEffect15(() => {
11484
- remoteSessionRef.current = remoteSession;
11485
- }, [remoteSession]);
11486
- useEffect15(() => {
11487
- if (!aiRemoteTrigger || !tpk || aiOpen) return;
11488
- let busy = false;
11489
- const poll = async () => {
11490
- if (busy || AppState3.currentState !== "active") return;
11491
- 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) {
11492
11910
  try {
11493
- const claimed = await tpk.claimRemoteAiSession();
11494
- if (claimed) {
11495
- setRemoteSession(claimed);
11496
- setAiOpen(true);
11497
- }
11911
+ l(s);
11498
11912
  } catch {
11499
- } finally {
11500
- busy = false;
11501
11913
  }
11502
- };
11503
- void poll();
11504
- const timer = setInterval(poll, aiRemotePollSeconds * 1e3);
11505
- return () => clearInterval(timer);
11506
- }, [aiRemoteTrigger, aiRemotePollSeconds, tpk, aiOpen]);
11507
- useEffect15(() => {
11508
- if (!aiOpen) return;
11509
- const g = globalThis;
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);
11941
+ };
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);
12961
+ }, [aiRemoteTrigger, aiRemotePollSeconds, tpk, aiOpen]);
12962
+ useEffect17(() => {
12963
+ if (!aiOpen) return;
12964
+ const g = globalThis;
11510
12965
  g.__tpkCaptureScreenshot = async () => (await captureView(rootRef))?.base64 ?? null;
11511
12966
  return () => {
11512
12967
  delete g.__tpkCaptureScreenshot;
11513
12968
  };
11514
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
+ );
11515
13138
  const sessionAnchor = useRef10(sessionStartedAt ?? null);
11516
- useEffect15(() => {
13139
+ useEffect17(() => {
11517
13140
  if (sessionStartedAt) {
11518
13141
  sessionAnchor.current = sessionStartedAt;
11519
13142
  } else if (tpk && !sessionAnchor.current) {
11520
13143
  sessionAnchor.current = /* @__PURE__ */ new Date();
11521
13144
  }
11522
13145
  }, [tpk, sessionStartedAt]);
11523
- useEffect15(() => {
13146
+ useEffect17(() => {
11524
13147
  if (!tpk || !currentScreen) return;
11525
13148
  tpk.trackScreenView(currentScreen);
11526
13149
  }, [tpk, currentScreen]);
11527
- useEffect15(() => {
13150
+ useEffect17(() => {
11528
13151
  if (!tpk) return;
11529
13152
  let cancelled = false;
11530
13153
  tpk.getNotifications({ limit: 1 }).then((res) => {
@@ -11534,9 +13157,9 @@ function TesterPayKitWrapper({
11534
13157
  cancelled = true;
11535
13158
  };
11536
13159
  }, [tpk]);
11537
- useEffect15(() => {
13160
+ useEffect17(() => {
11538
13161
  if (!enableWrapper || !enableShake) return;
11539
- if (Platform9.OS === "web") return;
13162
+ if (Platform10.OS === "web") return;
11540
13163
  let teardown = null;
11541
13164
  let cancelled = false;
11542
13165
  let lastShakeAt = 0;
@@ -11573,14 +13196,14 @@ function TesterPayKitWrapper({
11573
13196
  voiceOpen,
11574
13197
  sessionEndOpen
11575
13198
  ]);
11576
- const onReportBug = useCallback11(() => setBugOpen(true), []);
11577
- const onGeneralFeedback = useCallback11(() => setFeedbackOpen(true), []);
11578
- const onEndSession = useCallback11(() => setSessionEndOpen(true), []);
11579
- const onLongPressVoiceBug = useCallback11(() => setVoiceOpen(true), []);
11580
- 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(() => {
11581
13204
  tpk?.trackTap(currentScreen ?? "unknown", "auto-tap");
11582
13205
  }, [tpk, currentScreen]);
11583
- const handleVoiceExtracted = useCallback11(
13206
+ const handleVoiceExtracted = useCallback12(
11584
13207
  (result, classification) => {
11585
13208
  setBugInitialDraft({
11586
13209
  type: classification === "idea" ? "featureRequest" : classification === "issue" ? "uiIssue" : classification,
@@ -11602,18 +13225,27 @@ function TesterPayKitWrapper({
11602
13225
  []
11603
13226
  );
11604
13227
  if (!enableWrapper) {
11605
- return /* @__PURE__ */ React23.createElement(React23.Fragment, null, children);
13228
+ return /* @__PURE__ */ React26.createElement(React26.Fragment, null, children);
11606
13229
  }
11607
- return /* @__PURE__ */ React23.createElement(TpkThemeProvider, { theme }, /* @__PURE__ */ React23.createElement(TpkLanguageProvider, { language }, /* @__PURE__ */ React23.createElement(
11608
- View19,
13230
+ return /* @__PURE__ */ React26.createElement(TpkThemeProvider, { theme }, /* @__PURE__ */ React26.createElement(TpkLanguageProvider, { language }, /* @__PURE__ */ React26.createElement(
13231
+ View22,
11609
13232
  {
11610
13233
  ref: rootRef,
11611
- style: [styles19.root, style],
13234
+ style: [styles22.root, style],
11612
13235
  testID,
11613
13236
  collapsable: false
11614
13237
  },
11615
- /* @__PURE__ */ React23.createElement(View19, { style: styles19.content, onTouchStart: handleAutoTap }, children),
11616
- /* @__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(
11617
13249
  FloatingFeedbackButton,
11618
13250
  {
11619
13251
  position: buttonPosition,
@@ -11623,6 +13255,11 @@ function TesterPayKitWrapper({
11623
13255
  onEndSession,
11624
13256
  onShowDebugLogs,
11625
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",
11626
13263
  onLongPressVoiceBug,
11627
13264
  onFlushCachedCrashes,
11628
13265
  onShowRetests: onShowRetests ?? (() => setRetestsOpen(true)),
@@ -11635,7 +13272,7 @@ function TesterPayKitWrapper({
11635
13272
  sessionStartedAt: sessionAnchor.current ?? void 0
11636
13273
  }
11637
13274
  ),
11638
- (aiReady || remoteSession) && /* @__PURE__ */ React23.createElement(
13275
+ (aiReady || remoteSession) && /* @__PURE__ */ React26.createElement(
11639
13276
  AiRemoteControl,
11640
13277
  {
11641
13278
  visible: aiOpen,
@@ -11656,7 +13293,30 @@ function TesterPayKitWrapper({
11656
13293
  }
11657
13294
  }
11658
13295
  ),
11659
- /* @__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(
11660
13320
  BugReportSheet,
11661
13321
  {
11662
13322
  visible: bugOpen,
@@ -11678,7 +13338,7 @@ function TesterPayKitWrapper({
11678
13338
  }
11679
13339
  }
11680
13340
  ),
11681
- /* @__PURE__ */ React23.createElement(
13341
+ /* @__PURE__ */ React26.createElement(
11682
13342
  GeneralFeedbackDialog,
11683
13343
  {
11684
13344
  visible: feedbackOpen,
@@ -11687,7 +13347,7 @@ function TesterPayKitWrapper({
11687
13347
  onClose: () => setFeedbackOpen(false)
11688
13348
  }
11689
13349
  ),
11690
- /* @__PURE__ */ React23.createElement(
13350
+ /* @__PURE__ */ React26.createElement(
11691
13351
  VoiceBugInputSheet,
11692
13352
  {
11693
13353
  visible: voiceOpen,
@@ -11698,7 +13358,7 @@ function TesterPayKitWrapper({
11698
13358
  captureScreen: async () => (await captureView(rootRef))?.base64 ?? null
11699
13359
  }
11700
13360
  ),
11701
- /* @__PURE__ */ React23.createElement(
13361
+ /* @__PURE__ */ React26.createElement(
11702
13362
  SessionEndDialog,
11703
13363
  {
11704
13364
  visible: sessionEndOpen,
@@ -11718,7 +13378,7 @@ function TesterPayKitWrapper({
11718
13378
  }
11719
13379
  }
11720
13380
  ),
11721
- /* @__PURE__ */ React23.createElement(
13381
+ /* @__PURE__ */ React26.createElement(
11722
13382
  MyBugsSheet,
11723
13383
  {
11724
13384
  visible: myBugsOpen,
@@ -11726,7 +13386,7 @@ function TesterPayKitWrapper({
11726
13386
  onClose: () => setMyBugsOpen(false)
11727
13387
  }
11728
13388
  ),
11729
- /* @__PURE__ */ React23.createElement(
13389
+ /* @__PURE__ */ React26.createElement(
11730
13390
  SessionDetailsSheet,
11731
13391
  {
11732
13392
  visible: sessionDetailsOpen,
@@ -11734,7 +13394,7 @@ function TesterPayKitWrapper({
11734
13394
  onClose: () => setSessionDetailsOpen(false)
11735
13395
  }
11736
13396
  ),
11737
- /* @__PURE__ */ React23.createElement(
13397
+ /* @__PURE__ */ React26.createElement(
11738
13398
  NotificationsSheet,
11739
13399
  {
11740
13400
  visible: messagesOpen,
@@ -11743,7 +13403,7 @@ function TesterPayKitWrapper({
11743
13403
  onUnreadChange: setUnreadMessages
11744
13404
  }
11745
13405
  ),
11746
- /* @__PURE__ */ React23.createElement(
13406
+ /* @__PURE__ */ React26.createElement(
11747
13407
  RetestSheet,
11748
13408
  {
11749
13409
  visible: retestsOpen,
@@ -11754,7 +13414,7 @@ function TesterPayKitWrapper({
11754
13414
  )
11755
13415
  )));
11756
13416
  }
11757
- var styles19 = StyleSheet19.create({
13417
+ var styles22 = StyleSheet22.create({
11758
13418
  root: {
11759
13419
  flex: 1
11760
13420
  },
@@ -11768,9 +13428,9 @@ import {
11768
13428
  Children,
11769
13429
  cloneElement,
11770
13430
  isValidElement,
11771
- useCallback as useCallback12,
11772
- useEffect as useEffect16,
11773
- useMemo as useMemo10,
13431
+ useCallback as useCallback13,
13432
+ useEffect as useEffect18,
13433
+ useMemo as useMemo11,
11774
13434
  useRef as useRef11
11775
13435
  } from "react";
11776
13436
  function TpkAnnotated({
@@ -11794,7 +13454,7 @@ function TpkAnnotated({
11794
13454
  const childProps = child.props;
11795
13455
  const resolvedKey = elementKey ?? childProps.testID;
11796
13456
  const resolvedType = elementType ?? inferElementType(child);
11797
- useEffect16(() => {
13457
+ useEffect18(() => {
11798
13458
  const id = annotations.register({
11799
13459
  taskId: task,
11800
13460
  focusAreaId: focusArea,
@@ -11813,7 +13473,7 @@ function TpkAnnotated({
11813
13473
  annotationIdRef.current = null;
11814
13474
  };
11815
13475
  }, [task, focusArea, resolvedKey]);
11816
- useEffect16(() => {
13476
+ useEffect18(() => {
11817
13477
  if (!annotationIdRef.current) return;
11818
13478
  annotations.update(annotationIdRef.current, {
11819
13479
  semanticLabels: labels,
@@ -11831,13 +13491,13 @@ function TpkAnnotated({
11831
13491
  versionRange,
11832
13492
  metadata
11833
13493
  ]);
11834
- useEffect16(() => {
13494
+ useEffect18(() => {
11835
13495
  if (completionTrigger !== "on-visible") return;
11836
13496
  if (annotationIdRef.current) {
11837
13497
  annotations.recordInteraction(annotationIdRef.current);
11838
13498
  }
11839
13499
  }, [completionTrigger]);
11840
- const wrapHandler = useCallback12(
13500
+ const wrapHandler = useCallback13(
11841
13501
  (handler) => {
11842
13502
  const wrapped = ((...args) => {
11843
13503
  const id = annotationIdRef.current;
@@ -11848,7 +13508,7 @@ function TpkAnnotated({
11848
13508
  },
11849
13509
  []
11850
13510
  );
11851
- const triggeredHandlerName = useMemo10(() => {
13511
+ const triggeredHandlerName = useMemo11(() => {
11852
13512
  switch (completionTrigger) {
11853
13513
  case "on-tap":
11854
13514
  return "onPress";
@@ -11869,7 +13529,7 @@ function TpkAnnotated({
11869
13529
  function useTaskAnnotation(options) {
11870
13530
  const ref = useRef11(null);
11871
13531
  const idRef = useRef11(null);
11872
- useEffect16(() => {
13532
+ useEffect18(() => {
11873
13533
  const id = annotations.register({
11874
13534
  taskId: options.taskId,
11875
13535
  focusAreaId: options.focusAreaId,
@@ -11888,7 +13548,7 @@ function useTaskAnnotation(options) {
11888
13548
  idRef.current = null;
11889
13549
  };
11890
13550
  }, [options.taskId, options.focusAreaId, options.elementKey]);
11891
- const recordInteraction = useCallback12(() => {
13551
+ const recordInteraction = useCallback13(() => {
11892
13552
  if (idRef.current) annotations.recordInteraction(idRef.current);
11893
13553
  }, []);
11894
13554
  return { ref, id: idRef.current, recordInteraction };
@@ -12114,12 +13774,12 @@ function hasRecorder(recorder) {
12114
13774
  }
12115
13775
 
12116
13776
  // src/earnings.ts
12117
- 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";
12118
13778
  function useTpkEarnings(tpk, options = {}) {
12119
- const [data, setData] = useState20(null);
12120
- const [loading, setLoading] = useState20(false);
12121
- const [error, setError] = useState20(null);
12122
- 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 () => {
12123
13783
  if (!tpk) return;
12124
13784
  setLoading(true);
12125
13785
  setError(null);
@@ -12135,7 +13795,7 @@ function useTpkEarnings(tpk, options = {}) {
12135
13795
  setLoading(false);
12136
13796
  }
12137
13797
  }, [tpk, options.payoutLimit]);
12138
- useEffect17(() => {
13798
+ useEffect19(() => {
12139
13799
  if (tpk) refresh();
12140
13800
  }, [tpk, refresh]);
12141
13801
  return { data, loading, error, refresh };
@@ -12145,14 +13805,17 @@ export {
12145
13805
  AttachmentQueue,
12146
13806
  Breadcrumbs,
12147
13807
  BugReportSheet,
13808
+ ChecklistPanel,
12148
13809
  CrashQueue,
12149
13810
  DEFAULT_STYLE,
12150
13811
  DEFAULT_TPK_THEME,
13812
+ DENY_LABEL_PATTERNS,
12151
13813
  ExpoStorage,
12152
13814
  FloatingFeedbackButton,
12153
13815
  GeneralFeedbackDialog,
12154
13816
  INTERACTION_NAV_WEIGHT,
12155
13817
  InviteCodeScreen,
13818
+ LiveNoteDialog,
12156
13819
  MIN_INTERACTIONS_PER_ACTIVE_MINUTE,
12157
13820
  MyBugsSheet,
12158
13821
  NotificationsSheet,
@@ -12175,6 +13838,7 @@ export {
12175
13838
  TpkIcon,
12176
13839
  TpkIconsProvider,
12177
13840
  TpkLanguageProvider,
13841
+ TpkLiveLink,
12178
13842
  TpkOnboarding,
12179
13843
  TpkSensitive,
12180
13844
  TpkTalker,
@@ -12193,6 +13857,7 @@ export {
12193
13857
  bugSeverityLabel,
12194
13858
  bugStatusStyle,
12195
13859
  canSubmitBugReportDraft,
13860
+ captureLiveSnapshot,
12196
13861
  captureView,
12197
13862
  classificationToBugType,
12198
13863
  createBugReportDraft,
@@ -12216,18 +13881,24 @@ export {
12216
13881
  hasWelcomeBriefBeenSeen,
12217
13882
  installCrashHandler,
12218
13883
  installNetworkCapture,
13884
+ loadChecklist,
12219
13885
  markOnboardingComplete,
12220
13886
  markWelcomeBriefAsSeen,
12221
13887
  markWidgetTourSeen,
13888
+ parseLiveAction,
12222
13889
  parseVersionRange,
12223
13890
  pathToSvgD,
12224
13891
  quickDraftBug,
13892
+ readLiveState,
13893
+ readScreenTexts,
12225
13894
  resetOnboardingState,
12226
13895
  resetWelcomeBriefAck,
12227
13896
  resetWidgetTourSeen,
13897
+ runLiveAction,
12228
13898
  simplifyPath,
12229
13899
  submitBugReportDraft,
12230
13900
  subscribeNativeCaptureMode,
13901
+ toStepResults,
12231
13902
  uploadScreenshotAttachment,
12232
13903
  useShake,
12233
13904
  useTaskAnnotation,