@appilots/sdk 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkV3TUIIT2_js = require('./chunk-V3TUIIT2.js');
3
+ var chunkJ75B2HWG_js = require('./chunk-J75B2HWG.js');
4
4
  var react = require('react');
5
5
  var reactNative = require('react-native');
6
6
 
@@ -495,7 +495,7 @@ function walkSubtree(root, detectLists, startInModal = false) {
495
495
  }
496
496
  function walkFiber(root) {
497
497
  const snapshot = {
498
- route: chunkV3TUIIT2_js.getCurrentScreen(),
498
+ route: chunkJ75B2HWG_js.getCurrentScreen(),
499
499
  texts: [],
500
500
  inputs: [],
501
501
  buttons: [],
@@ -671,9 +671,9 @@ function fiberSliderMatches(fiber, registryId, registryLabel) {
671
671
  function reconcileSliders(snapshot) {
672
672
  const fiberSliders = snapshot.sliders;
673
673
  const out = [];
674
- for (const { id, kind } of chunkV3TUIIT2_js.componentRegistry.snapshot()) {
674
+ for (const { id, kind } of chunkJ75B2HWG_js.componentRegistry.snapshot()) {
675
675
  if (kind !== "slider") continue;
676
- const entry = chunkV3TUIIT2_js.componentRegistry.getSlider(id);
676
+ const entry = chunkJ75B2HWG_js.componentRegistry.getSlider(id);
677
677
  if (!entry) continue;
678
678
  const fiber = fiberSliders.find((s) => fiberSliderMatches(s, id, entry.label));
679
679
  const visible = !!fiber || typeof entry.screen === "string" && entry.screen === snapshot.route;
@@ -697,7 +697,7 @@ function reconcileSliders(snapshot) {
697
697
  snapshot.sliders = out;
698
698
  }
699
699
  function mergeRegisteredLists(snapshot) {
700
- const registered = chunkV3TUIIT2_js.listRegistry.snapshot();
700
+ const registered = chunkJ75B2HWG_js.listRegistry.snapshot();
701
701
  if (registered.length === 0) return;
702
702
  const byId = /* @__PURE__ */ new Map();
703
703
  for (const list of snapshot.lists) {
@@ -745,13 +745,13 @@ function mergeRegisteredLists(snapshot) {
745
745
  }
746
746
  }
747
747
  function captureSnapshot() {
748
- const root = chunkV3TUIIT2_js.getFiberRoot();
748
+ const root = chunkJ75B2HWG_js.getFiberRoot();
749
749
  if (!root) {
750
750
  console.warn(
751
751
  "[Appilots] captureSnapshot: fiber root not captured yet. Ensure <AppilotsProvider> has rendered before calling this."
752
752
  );
753
753
  return {
754
- route: chunkV3TUIIT2_js.getCurrentScreen(),
754
+ route: chunkJ75B2HWG_js.getCurrentScreen(),
755
755
  texts: [],
756
756
  inputs: [],
757
757
  buttons: [],
@@ -766,17 +766,17 @@ function captureSnapshot() {
766
766
  }
767
767
  const start = Date.now();
768
768
  const snapshot = walkFiber(root);
769
- const activePath = chunkV3TUIIT2_js.getActiveRouteNames();
769
+ const activePath = chunkJ75B2HWG_js.getActiveRouteNames();
770
770
  const deepestRoute = activePath[activePath.length - 1];
771
771
  if (deepestRoute) snapshot.route = deepestRoute;
772
772
  mergeRegisteredLists(snapshot);
773
773
  reconcileSliders(snapshot);
774
- snapshot.elements = chunkV3TUIIT2_js.deriveInteractionElements(snapshot);
775
- snapshot.choiceGroups = chunkV3TUIIT2_js.attachElementIdsToChoiceGroups(
774
+ snapshot.elements = chunkJ75B2HWG_js.deriveInteractionElements(snapshot);
775
+ snapshot.choiceGroups = chunkJ75B2HWG_js.attachElementIdsToChoiceGroups(
776
776
  snapshot.choiceGroups,
777
777
  snapshot.elements
778
778
  );
779
- chunkV3TUIIT2_js.elementRegistry.replaceAll(snapshot.elements);
779
+ chunkJ75B2HWG_js.elementRegistry.replaceAll(snapshot.elements);
780
780
  const elapsed = Date.now() - start;
781
781
  const totalListItems = snapshot.lists.reduce(
782
782
  (acc, l) => acc + l.items.length,
@@ -969,7 +969,7 @@ function wrapTouchable(fiber, label) {
969
969
  };
970
970
  }
971
971
  function findInteractiveByIdentifier(query, options = {}) {
972
- const root = chunkV3TUIIT2_js.getFiberRoot();
972
+ const root = chunkJ75B2HWG_js.getFiberRoot();
973
973
  if (!root) {
974
974
  console.warn("[Appilots] findInteractiveByIdentifier: fiber root not captured yet");
975
975
  return null;
@@ -1210,7 +1210,7 @@ function isPressableFiber(fiber) {
1210
1210
  return TOUCHABLE_NAMES.has(typeName) || hasPressHandler3(fiber);
1211
1211
  }
1212
1212
  function findListContainers(options = {}) {
1213
- const root = chunkV3TUIIT2_js.getFiberRoot();
1213
+ const root = chunkJ75B2HWG_js.getFiberRoot();
1214
1214
  if (!root) return [];
1215
1215
  const containers = [];
1216
1216
  const visited = /* @__PURE__ */ new WeakSet();
@@ -1369,7 +1369,7 @@ function describeTouchable(fiber) {
1369
1369
  }
1370
1370
  function touchableLooksDestructive(fiber) {
1371
1371
  const descriptor = describeTouchable(fiber);
1372
- if (descriptor && chunkV3TUIIT2_js.looksDestructiveActionLabel(descriptor)) return true;
1372
+ if (descriptor && chunkJ75B2HWG_js.looksDestructiveActionLabel(descriptor)) return true;
1373
1373
  const props = fiber?.memoizedProps ?? {};
1374
1374
  const haystack = [
1375
1375
  props.testID,
@@ -1377,7 +1377,7 @@ function touchableLooksDestructive(fiber) {
1377
1377
  props.accessibilityHint,
1378
1378
  props.label
1379
1379
  ].filter((value) => typeof value === "string").join(" ");
1380
- return chunkV3TUIIT2_js.looksDestructiveActionLabel(haystack);
1380
+ return chunkJ75B2HWG_js.looksDestructiveActionLabel(haystack);
1381
1381
  }
1382
1382
  function describeItemCandidate(listIndex, zeroBasedIndex, item) {
1383
1383
  const syntheticId = `list-${listIndex}-item-${zeroBasedIndex + 1}`;
@@ -1508,7 +1508,7 @@ function candidateLists(containers, locator) {
1508
1508
  return containers.map((list, listIndex) => ({ list, listIndex }));
1509
1509
  }
1510
1510
  function pressListItemAtOrdinal(listIndex, itemIndex) {
1511
- if (!chunkV3TUIIT2_js.getFiberRoot()) return { ok: false, reason: "no-fiber-root" };
1511
+ if (!chunkJ75B2HWG_js.getFiberRoot()) return { ok: false, reason: "no-fiber-root" };
1512
1512
  const containers = findListContainers({ allowSingleHeuristic: true });
1513
1513
  if (listIndex < 0 || listIndex >= containers.length) {
1514
1514
  return { ok: false, reason: "list-not-found" };
@@ -1522,7 +1522,7 @@ function pressListItemAtOrdinal(listIndex, itemIndex) {
1522
1522
  return pressResolvedListItem(list, items[zeroBased], listIndex, itemIndex);
1523
1523
  }
1524
1524
  function pressListItemByIdentity(locator) {
1525
- if (!chunkV3TUIIT2_js.getFiberRoot()) return { ok: false, reason: "no-fiber-root" };
1525
+ if (!chunkJ75B2HWG_js.getFiberRoot()) return { ok: false, reason: "no-fiber-root" };
1526
1526
  const parsed = locator.syntheticId ? parseSyntheticListItemId(locator.syntheticId) : null;
1527
1527
  const effective = parsed ? { ...locator, listIndex: parsed.listIndex, itemIndex: parsed.itemIndex } : locator;
1528
1528
  const containers = findListContainers({ allowSingleHeuristic: true });
@@ -1562,7 +1562,7 @@ function screenDiagnose(targetId, category = "component-not-found") {
1562
1562
  return {
1563
1563
  category,
1564
1564
  targetId,
1565
- screen: chunkV3TUIIT2_js.getCurrentScreen() ?? void 0
1565
+ screen: chunkJ75B2HWG_js.getCurrentScreen() ?? void 0
1566
1566
  };
1567
1567
  }
1568
1568
  function isPressLike(action) {
@@ -1579,10 +1579,10 @@ function elementLookupKey(value) {
1579
1579
  return canonicalElementId(value).toLowerCase().replace(/[\s_]+/g, "-");
1580
1580
  }
1581
1581
  function findRegisteredElement(elementId) {
1582
- const direct = chunkV3TUIIT2_js.elementRegistry.get(elementId) ?? chunkV3TUIIT2_js.elementRegistry.get(canonicalElementId(elementId));
1582
+ const direct = chunkJ75B2HWG_js.elementRegistry.get(elementId) ?? chunkJ75B2HWG_js.elementRegistry.get(canonicalElementId(elementId));
1583
1583
  if (direct) return direct;
1584
1584
  const wanted = elementLookupKey(elementId);
1585
- return chunkV3TUIIT2_js.elementRegistry.snapshot().find((element) => elementLookupKey(element.id) === wanted);
1585
+ return chunkJ75B2HWG_js.elementRegistry.snapshot().find((element) => elementLookupKey(element.id) === wanted);
1586
1586
  }
1587
1587
  function resolveInteractionElement(elementId) {
1588
1588
  return getLatestElement(elementId);
@@ -1802,7 +1802,7 @@ function dispatchElement(element, registry, action) {
1802
1802
  }
1803
1803
  function dispatchStructuredElementId(identifier, action) {
1804
1804
  if (!isElementIdentifier(identifier) || !isPressLike(action)) return null;
1805
- const parsed = chunkV3TUIIT2_js.parseStableElementId(identifier);
1805
+ const parsed = chunkJ75B2HWG_js.parseStableElementId(identifier);
1806
1806
  if (!parsed || parsed.role !== "option") return null;
1807
1807
  if (!parsed.itemKey && !parsed.listId) return null;
1808
1808
  const pressed = pressListItemByIdentity({
@@ -1842,20 +1842,20 @@ function normalize4(value) {
1842
1842
  return value.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]/g, "");
1843
1843
  }
1844
1844
  function resolveScreenForFormFields() {
1845
- const activePath = chunkV3TUIIT2_js.getActiveRouteNames();
1845
+ const activePath = chunkJ75B2HWG_js.getActiveRouteNames();
1846
1846
  for (let i = activePath.length - 1; i >= 0; i--) {
1847
1847
  const name = activePath[i];
1848
- const meta = name ? chunkV3TUIIT2_js.getScreenMetadata(name) : void 0;
1848
+ const meta = name ? chunkJ75B2HWG_js.getScreenMetadata(name) : void 0;
1849
1849
  if (name && Array.isArray(meta?.fields) && meta.fields.length > 0) return name;
1850
1850
  }
1851
- return chunkV3TUIIT2_js.getCurrentScreen();
1851
+ return chunkJ75B2HWG_js.getCurrentScreen();
1852
1852
  }
1853
1853
  function collectKnownFormFields(registry) {
1854
1854
  const registryFields = registry.snapshot().filter((entry) => entry.kind === "field" || entry.kind === "slider").map((entry) => ({ id: entry.id, label: entry.label }));
1855
1855
  if (registryFields.length >= 2) return registryFields;
1856
1856
  const screen = resolveScreenForFormFields();
1857
1857
  if (screen) {
1858
- const metaFields = chunkV3TUIIT2_js.getScreenMetadata(screen)?.fields;
1858
+ const metaFields = chunkJ75B2HWG_js.getScreenMetadata(screen)?.fields;
1859
1859
  if (Array.isArray(metaFields) && metaFields.length > 0) {
1860
1860
  return metaFields.filter((field) => !!field && typeof field.id === "string").map((field) => ({
1861
1861
  id: field.id,
@@ -1865,7 +1865,7 @@ function collectKnownFormFields(registry) {
1865
1865
  }));
1866
1866
  }
1867
1867
  }
1868
- for (const meta of chunkV3TUIIT2_js.getAllScreens()) {
1868
+ for (const meta of chunkJ75B2HWG_js.getAllScreens()) {
1869
1869
  if (Array.isArray(meta.fields) && meta.fields.length > 0) {
1870
1870
  return meta.fields.filter((field) => !!field && typeof field.id === "string").map((field) => ({
1871
1871
  id: field.id,
@@ -1963,7 +1963,7 @@ function rewriteMisplacedFormFillFields(fields, registry) {
1963
1963
  const inferred = inferFieldIdForValue(String(field.value ?? ""), knownFields, used);
1964
1964
  if (!inferred) return field;
1965
1965
  used.add(inferred);
1966
- chunkV3TUIIT2_js.appilotsDebugWarn(
1966
+ chunkJ75B2HWG_js.appilotsDebugWarn(
1967
1967
  `formFieldRewrite: ${field.fieldId} \u2192 ${inferred} (value=${JSON.stringify(field.value)})`
1968
1968
  );
1969
1969
  return { ...field, fieldId: inferred };
@@ -2001,7 +2001,7 @@ function readVisibleFormSuccess(snap) {
2001
2001
  return (snap.texts ?? []).find((text) => text?.trim() && FORM_SUCCESS_TEXT_RE.test(text));
2002
2002
  }
2003
2003
  function submitAsyncStillPending(submitTargetId) {
2004
- const probe = chunkV3TUIIT2_js.probeLoadingState(submitTargetId ?? null, chunkV3TUIIT2_js.getCurrentScreen());
2004
+ const probe = chunkJ75B2HWG_js.probeLoadingState(submitTargetId ?? null, chunkJ75B2HWG_js.getCurrentScreen());
2005
2005
  if (probe.loading) return true;
2006
2006
  if (submitTargetId && probe.pressedFound && probe.pressedDisabled) return true;
2007
2007
  return false;
@@ -2013,7 +2013,7 @@ function evaluatePostSubmitSnapshot(snap, activePath) {
2013
2013
  }
2014
2014
  const successText = readVisibleFormSuccess(snap);
2015
2015
  if (successText) return { status: "success", message: successText };
2016
- if (!chunkV3TUIIT2_js.snapshotShowsOpenCreateForm(snap, activePath)) {
2016
+ if (!chunkJ75B2HWG_js.snapshotShowsOpenCreateForm(snap, activePath)) {
2017
2017
  return { status: "success" };
2018
2018
  }
2019
2019
  return void 0;
@@ -2029,7 +2029,7 @@ async function waitForPostSubmitOutcome(options) {
2029
2029
  continue;
2030
2030
  }
2031
2031
  const snap2 = captureSnapshot();
2032
- const activePath2 = chunkV3TUIIT2_js.getActiveRouteNames();
2032
+ const activePath2 = chunkJ75B2HWG_js.getActiveRouteNames();
2033
2033
  const outcome2 = evaluatePostSubmitSnapshot(snap2, activePath2);
2034
2034
  if (outcome2) return outcome2;
2035
2035
  await sleep(pollMs);
@@ -2041,7 +2041,7 @@ async function waitForPostSubmitOutcome(options) {
2041
2041
  };
2042
2042
  }
2043
2043
  const snap = captureSnapshot();
2044
- const activePath = chunkV3TUIIT2_js.getActiveRouteNames();
2044
+ const activePath = chunkJ75B2HWG_js.getActiveRouteNames();
2045
2045
  const outcome = evaluatePostSubmitSnapshot(snap, activePath);
2046
2046
  if (outcome) return outcome;
2047
2047
  return {
@@ -2147,16 +2147,16 @@ function findSnapshotButton(targetId) {
2147
2147
  }
2148
2148
  }
2149
2149
  function buildUiDiagnose(targetId, cause) {
2150
- const activePath = chunkV3TUIIT2_js.getActiveRouteNames();
2151
- const screen = activePath[activePath.length - 1] ?? chunkV3TUIIT2_js.getCurrentScreen() ?? void 0;
2150
+ const activePath = chunkJ75B2HWG_js.getActiveRouteNames();
2151
+ const screen = activePath[activePath.length - 1] ?? chunkJ75B2HWG_js.getCurrentScreen() ?? void 0;
2152
2152
  const screenPath = activePath.length > 1 ? activePath.join("/") : screen;
2153
2153
  const diagnose = {
2154
2154
  category: cause === "not-found" ? "component-not-found" : cause === "disabled" ? "disabled" : "unknown",
2155
2155
  targetId,
2156
2156
  screen: screenPath
2157
2157
  };
2158
- if (chunkV3TUIIT2_js.isOptionalStepAutomationFailure(targetId, screenPath, activePath)) {
2159
- diagnose.visibleMessage = chunkV3TUIIT2_js.OPTIONAL_STEP_AUTOMATION_HINT;
2158
+ if (chunkJ75B2HWG_js.isOptionalStepAutomationFailure(targetId, screenPath, activePath)) {
2159
+ diagnose.visibleMessage = chunkJ75B2HWG_js.OPTIONAL_STEP_AUTOMATION_HINT;
2160
2160
  diagnose.recoverable = true;
2161
2161
  }
2162
2162
  return diagnose;
@@ -2218,9 +2218,9 @@ function resolveComponentId(componentId, registry, action) {
2218
2218
  return comp.id;
2219
2219
  }
2220
2220
  }
2221
- const currentScreen = chunkV3TUIIT2_js.getCurrentScreen();
2221
+ const currentScreen = chunkJ75B2HWG_js.getCurrentScreen();
2222
2222
  if (currentScreen) {
2223
- const screenMeta = chunkV3TUIIT2_js.getScreenMetadata(currentScreen);
2223
+ const screenMeta = chunkJ75B2HWG_js.getScreenMetadata(currentScreen);
2224
2224
  const actions = screenMeta?.actions;
2225
2225
  if (actions && Array.isArray(actions)) {
2226
2226
  const metaAction = actions.find(
@@ -2374,7 +2374,7 @@ function checkModalOcclusion(rawComponentId, action) {
2374
2374
  return null;
2375
2375
  }
2376
2376
  if (typeof rawComponentId !== "string" || rawComponentId.trim().length === 0) return null;
2377
- const fiberRoot = chunkV3TUIIT2_js.getFiberRoot();
2377
+ const fiberRoot = chunkJ75B2HWG_js.getFiberRoot();
2378
2378
  if (!fiberRoot) return null;
2379
2379
  let snap;
2380
2380
  try {
@@ -2437,7 +2437,7 @@ function checkModalOcclusion(rawComponentId, action) {
2437
2437
  }
2438
2438
  function uiInteractionHandler(payload, context) {
2439
2439
  const { permissions } = context;
2440
- const registry = context.registry ?? chunkV3TUIIT2_js.componentRegistry;
2440
+ const registry = context.registry ?? chunkJ75B2HWG_js.componentRegistry;
2441
2441
  if (!permissions.canInteractUI) {
2442
2442
  return {
2443
2443
  success: false,
@@ -2496,7 +2496,7 @@ function uiInteractionHandler(payload, context) {
2496
2496
  );
2497
2497
  return { success: true };
2498
2498
  }
2499
- const screen = chunkV3TUIIT2_js.getCurrentScreen() ?? void 0;
2499
+ const screen = chunkJ75B2HWG_js.getCurrentScreen() ?? void 0;
2500
2500
  if (result.reason === "list-not-found" || result.reason === "item-not-found") {
2501
2501
  return {
2502
2502
  success: false,
@@ -2661,7 +2661,7 @@ function submitLabelHintsSubmit(label) {
2661
2661
  return SUBMIT_LABEL_HINT_RE.test(trimmed);
2662
2662
  }
2663
2663
  function screenDeclaresSubmitAction(screenName) {
2664
- const meta = chunkV3TUIIT2_js.getScreenMetadata(screenName);
2664
+ const meta = chunkJ75B2HWG_js.getScreenMetadata(screenName);
2665
2665
  return Array.isArray(meta?.actions) && meta.actions.some(
2666
2666
  (action) => typeof action === "object" && action !== null && action.type === "submit"
2667
2667
  );
@@ -2694,7 +2694,7 @@ function resolveFormScreensForSubmit(screen, activePath, registry) {
2694
2694
  } else {
2695
2695
  push(screen);
2696
2696
  }
2697
- push(chunkV3TUIIT2_js.getCurrentScreen() ?? void 0);
2697
+ push(chunkJ75B2HWG_js.getCurrentScreen() ?? void 0);
2698
2698
  const withSubmit = [];
2699
2699
  const rest = [];
2700
2700
  for (const name of ordered) {
@@ -2712,7 +2712,7 @@ function collectSubmitTargetCandidates(screens, registry) {
2712
2712
  candidates.push(id);
2713
2713
  };
2714
2714
  for (const screenName of screens) {
2715
- const meta = chunkV3TUIIT2_js.getScreenMetadata(screenName);
2715
+ const meta = chunkJ75B2HWG_js.getScreenMetadata(screenName);
2716
2716
  const submitMeta = Array.isArray(meta?.actions) ? meta.actions.find(
2717
2717
  (action) => typeof action === "object" && action !== null && action.type === "submit"
2718
2718
  ) : void 0;
@@ -2758,8 +2758,8 @@ function readVisibleValidation(fieldId, label) {
2758
2758
  return void 0;
2759
2759
  }
2760
2760
  function resolveScreenContext() {
2761
- const activePath = chunkV3TUIIT2_js.getActiveRouteNames();
2762
- const screen = activePath[activePath.length - 1] ?? chunkV3TUIIT2_js.getCurrentScreen() ?? void 0;
2761
+ const activePath = chunkJ75B2HWG_js.getActiveRouteNames();
2762
+ const screen = activePath[activePath.length - 1] ?? chunkJ75B2HWG_js.getCurrentScreen() ?? void 0;
2763
2763
  return { screen, activePath };
2764
2764
  }
2765
2765
  function selectValueApplied(fieldId, requestedValue, currentValue, registry) {
@@ -2767,36 +2767,36 @@ function selectValueApplied(fieldId, requestedValue, currentValue, registry) {
2767
2767
  if (!requested) return false;
2768
2768
  const meta = getMetadataField(fieldId, registry);
2769
2769
  const options = Array.isArray(meta?.options) ? meta.options : [];
2770
- const requestedNorm = chunkV3TUIIT2_js.normalize3(requested);
2771
- const currentNorm = chunkV3TUIIT2_js.normalize3(currentValue);
2770
+ const requestedNorm = chunkJ75B2HWG_js.normalize3(requested);
2771
+ const currentNorm = chunkJ75B2HWG_js.normalize3(currentValue);
2772
2772
  if (currentNorm === requestedNorm) return true;
2773
2773
  for (const option of options) {
2774
2774
  const value = typeof option?.value === "string" ? option.value : "";
2775
2775
  const label = typeof option?.label === "string" ? option.label : "";
2776
- if (chunkV3TUIIT2_js.normalize3(value) === requestedNorm && chunkV3TUIIT2_js.normalize3(label) === currentNorm) return true;
2777
- if (chunkV3TUIIT2_js.normalize3(label) === requestedNorm && chunkV3TUIIT2_js.normalize3(label) === currentNorm) return true;
2778
- if (chunkV3TUIIT2_js.normalize3(value) === requestedNorm && chunkV3TUIIT2_js.normalize3(value) === currentNorm) return true;
2776
+ if (chunkJ75B2HWG_js.normalize3(value) === requestedNorm && chunkJ75B2HWG_js.normalize3(label) === currentNorm) return true;
2777
+ if (chunkJ75B2HWG_js.normalize3(label) === requestedNorm && chunkJ75B2HWG_js.normalize3(label) === currentNorm) return true;
2778
+ if (chunkJ75B2HWG_js.normalize3(value) === requestedNorm && chunkJ75B2HWG_js.normalize3(value) === currentNorm) return true;
2779
2779
  }
2780
2780
  return false;
2781
2781
  }
2782
2782
  function getMetadataField(fieldId, registry) {
2783
2783
  const screens = /* @__PURE__ */ new Set();
2784
- for (const name of chunkV3TUIIT2_js.getActiveRouteNames()) screens.add(name);
2785
- const current = chunkV3TUIIT2_js.getCurrentScreen();
2784
+ for (const name of chunkJ75B2HWG_js.getActiveRouteNames()) screens.add(name);
2785
+ const current = chunkJ75B2HWG_js.getCurrentScreen();
2786
2786
  if (current) screens.add(current);
2787
2787
  if (registry) {
2788
2788
  for (const comp of registry.snapshot()) {
2789
2789
  if (comp.kind === "field" && comp.screen) screens.add(comp.screen);
2790
2790
  }
2791
2791
  }
2792
- const needle = chunkV3TUIIT2_js.normalize3(fieldId);
2792
+ const needle = chunkJ75B2HWG_js.normalize3(fieldId);
2793
2793
  for (const screenName of screens) {
2794
- const screenMeta = chunkV3TUIIT2_js.getScreenMetadata(screenName);
2794
+ const screenMeta = chunkJ75B2HWG_js.getScreenMetadata(screenName);
2795
2795
  const fields = Array.isArray(screenMeta?.fields) ? screenMeta.fields : [];
2796
2796
  const match = fields.find((field) => {
2797
2797
  if (!field || typeof field !== "object") return false;
2798
- const id = typeof field.id === "string" ? chunkV3TUIIT2_js.normalize3(field.id) : "";
2799
- const label = typeof field.label === "string" ? chunkV3TUIIT2_js.normalize3(field.label) : "";
2798
+ const id = typeof field.id === "string" ? chunkJ75B2HWG_js.normalize3(field.id) : "";
2799
+ const label = typeof field.label === "string" ? chunkJ75B2HWG_js.normalize3(field.label) : "";
2800
2800
  return id === needle || label === needle;
2801
2801
  });
2802
2802
  if (match) return match;
@@ -2808,11 +2808,11 @@ function resolveSelectOption(fieldId, value, registry) {
2808
2808
  if (!requested) return void 0;
2809
2809
  const meta = getMetadataField(fieldId, registry);
2810
2810
  const options = Array.isArray(meta?.options) ? meta.options : [];
2811
- const requestedNorm = chunkV3TUIIT2_js.normalize3(requested);
2811
+ const requestedNorm = chunkJ75B2HWG_js.normalize3(requested);
2812
2812
  for (const option of options) {
2813
2813
  const optionValue = typeof option?.value === "string" ? option.value : "";
2814
2814
  const optionLabel = typeof option?.label === "string" ? option.label : "";
2815
- if (chunkV3TUIIT2_js.normalize3(optionValue) === requestedNorm || chunkV3TUIIT2_js.normalize3(optionLabel) === requestedNorm) {
2815
+ if (chunkJ75B2HWG_js.normalize3(optionValue) === requestedNorm || chunkJ75B2HWG_js.normalize3(optionLabel) === requestedNorm) {
2816
2816
  return { value: optionValue, label: optionLabel };
2817
2817
  }
2818
2818
  }
@@ -2862,12 +2862,12 @@ async function tryPressSelectOption(fieldId, value, registry, options = {}) {
2862
2862
  return {
2863
2863
  success: false,
2864
2864
  error: `No pressable option found for select field "${fieldId}"`,
2865
- diagnose: { category: "component-not-found", fieldId, screen: chunkV3TUIIT2_js.getCurrentScreen() ?? void 0 }
2865
+ diagnose: { category: "component-not-found", fieldId, screen: chunkJ75B2HWG_js.getCurrentScreen() ?? void 0 }
2866
2866
  };
2867
2867
  }
2868
2868
  function normalizeFieldType(type) {
2869
2869
  if (typeof type !== "string") return void 0;
2870
- const normalized = chunkV3TUIIT2_js.normalize3(type);
2870
+ const normalized = chunkJ75B2HWG_js.normalize3(type);
2871
2871
  if (normalized === "select" || normalized === "picker" || normalized === "dropdown") return "select";
2872
2872
  if (normalized === "toggle" || normalized === "switch" || normalized === "checkbox") return "toggle";
2873
2873
  if (normalized === "date") return "date";
@@ -2895,7 +2895,7 @@ function fieldCueTerms(fieldId, label) {
2895
2895
  );
2896
2896
  const terms = /* @__PURE__ */ new Set();
2897
2897
  for (const value of raw) {
2898
- const normalized = chunkV3TUIIT2_js.normalize3(value);
2898
+ const normalized = chunkJ75B2HWG_js.normalize3(value);
2899
2899
  if (normalized.length >= 3 && normalized !== "id") terms.add(normalized);
2900
2900
  }
2901
2901
  return [...terms];
@@ -2906,17 +2906,17 @@ function snapshotHasFieldCue(snap, fieldId, label) {
2906
2906
  const visible = [
2907
2907
  ...snap.texts ?? [],
2908
2908
  ...(snap.buttons ?? []).map((b) => b.label ?? b.id ?? "")
2909
- ].map((text) => chunkV3TUIIT2_js.normalize3(text)).filter(Boolean);
2909
+ ].map((text) => chunkJ75B2HWG_js.normalize3(text)).filter(Boolean);
2910
2910
  return visible.some((text) => terms.some((term) => text.includes(term) || term.includes(text)));
2911
2911
  }
2912
2912
  function scoreCandidateText(value, texts) {
2913
- const valueNorm = chunkV3TUIIT2_js.normalize3(String(value ?? ""));
2913
+ const valueNorm = chunkJ75B2HWG_js.normalize3(String(value ?? ""));
2914
2914
  if (!valueNorm) return 0;
2915
2915
  let best = 0;
2916
2916
  for (const text of texts) {
2917
- const textNorm = chunkV3TUIIT2_js.normalize3(text);
2917
+ const textNorm = chunkJ75B2HWG_js.normalize3(text);
2918
2918
  if (!textNorm) continue;
2919
- best = Math.max(best, chunkV3TUIIT2_js.matchScore(valueNorm, textNorm));
2919
+ best = Math.max(best, chunkJ75B2HWG_js.matchScore(valueNorm, textNorm));
2920
2920
  }
2921
2921
  return best;
2922
2922
  }
@@ -2930,7 +2930,7 @@ function optionTexts(option) {
2930
2930
  function buildChoiceCandidates(snap, fieldId, value, allowFirstVisibleWhenNoCue, registry) {
2931
2931
  const fieldLabel = getFieldLabel(fieldId, registry);
2932
2932
  const fieldCueVisible = snapshotHasFieldCue(snap, fieldId, fieldLabel);
2933
- const genericValue = chunkV3TUIIT2_js.isGenericSelectValue(value);
2933
+ const genericValue = chunkJ75B2HWG_js.isGenericSelectValue(value);
2934
2934
  const candidates = [];
2935
2935
  let order = 0;
2936
2936
  const choiceGroups = snap.choiceGroups ?? [];
@@ -2942,7 +2942,7 @@ function buildChoiceCandidates(snap, fieldId, value, allowFirstVisibleWhenNoCue,
2942
2942
  const groupCueScore = Math.max(
2943
2943
  globalCueScore,
2944
2944
  ...groupTexts.map((text) => {
2945
- const normalized = chunkV3TUIIT2_js.normalize3(text);
2945
+ const normalized = chunkJ75B2HWG_js.normalize3(text);
2946
2946
  return fieldCueTerms(fieldId, fieldLabel).some(
2947
2947
  (term) => normalized.includes(term) || term.includes(normalized)
2948
2948
  ) ? 80 : 0;
@@ -2979,7 +2979,7 @@ function buildChoiceCandidates(snap, fieldId, value, allowFirstVisibleWhenNoCue,
2979
2979
  const elementCueScore = Math.max(
2980
2980
  fieldCueVisible && elements.length <= 12 ? 50 : 0,
2981
2981
  ...cueTexts.map((text) => {
2982
- const normalized = chunkV3TUIIT2_js.normalize3(text);
2982
+ const normalized = chunkJ75B2HWG_js.normalize3(text);
2983
2983
  return fieldTerms.some(
2984
2984
  (term) => normalized.includes(term) || term.includes(normalized)
2985
2985
  ) ? 80 : 0;
@@ -3039,7 +3039,7 @@ async function selectVisibleChoiceAsync(fieldId, value, registry, options) {
3039
3039
  return {
3040
3040
  success: false,
3041
3041
  error: err?.message ?? "Could not capture visible choices",
3042
- diagnose: { category: "unknown", fieldId, screen: chunkV3TUIIT2_js.getCurrentScreen() ?? void 0 }
3042
+ diagnose: { category: "unknown", fieldId, screen: chunkJ75B2HWG_js.getCurrentScreen() ?? void 0 }
3043
3043
  };
3044
3044
  }
3045
3045
  const candidates = buildChoiceCandidates(
@@ -3054,7 +3054,7 @@ async function selectVisibleChoiceAsync(fieldId, value, registry, options) {
3054
3054
  return {
3055
3055
  success: false,
3056
3056
  error: `No visible option found for select field "${fieldId}"`,
3057
- diagnose: { category: "component-not-found", fieldId, screen: chunkV3TUIIT2_js.getCurrentScreen() ?? void 0 }
3057
+ diagnose: { category: "component-not-found", fieldId, screen: chunkJ75B2HWG_js.getCurrentScreen() ?? void 0 }
3058
3058
  };
3059
3059
  }
3060
3060
  const pressed = pressTargetByIdOrLabel(candidate.targetId, registry);
@@ -3067,7 +3067,7 @@ async function selectVisibleChoiceAsync(fieldId, value, registry, options) {
3067
3067
  }
3068
3068
  function isContinuationButton(label) {
3069
3069
  if (!label) return false;
3070
- return /^(next|continue|proximo|prox|continuar|avancar|avançar)$/i.test(chunkV3TUIIT2_js.normalize3(label));
3070
+ return /^(next|continue|proximo|prox|continuar|avancar|avançar)$/i.test(chunkJ75B2HWG_js.normalize3(label));
3071
3071
  }
3072
3072
  function pressContinuationButton(registry) {
3073
3073
  const snap = captureSnapshot();
@@ -3080,7 +3080,7 @@ function pressContinuationButton(registry) {
3080
3080
  return {
3081
3081
  success: false,
3082
3082
  error: "No enabled continuation button is visible",
3083
- diagnose: { category: "component-not-found", screen: chunkV3TUIIT2_js.getCurrentScreen() ?? void 0 }
3083
+ diagnose: { category: "component-not-found", screen: chunkJ75B2HWG_js.getCurrentScreen() ?? void 0 }
3084
3084
  };
3085
3085
  }
3086
3086
  return pressTargetByIdOrLabel(id, registry);
@@ -3100,18 +3100,18 @@ function findField(fieldId, registry) {
3100
3100
  return registry.getField(comp.id);
3101
3101
  }
3102
3102
  }
3103
- const currentScreenForTieBreak = chunkV3TUIIT2_js.getCurrentScreen();
3104
- const needle = chunkV3TUIIT2_js.normalize3(fieldId);
3103
+ const currentScreenForTieBreak = chunkJ75B2HWG_js.getCurrentScreen();
3104
+ const needle = chunkJ75B2HWG_js.normalize3(fieldId);
3105
3105
  let bestComp;
3106
3106
  let bestScore = 0;
3107
3107
  let bestOnCurrentScreen = false;
3108
3108
  for (const comp of snapshot) {
3109
3109
  if (comp.kind !== "field") continue;
3110
- const candidates = [chunkV3TUIIT2_js.normalize3(comp.id)];
3111
- if (comp.label) candidates.push(chunkV3TUIIT2_js.normalize3(comp.label));
3110
+ const candidates = [chunkJ75B2HWG_js.normalize3(comp.id)];
3111
+ if (comp.label) candidates.push(chunkJ75B2HWG_js.normalize3(comp.label));
3112
3112
  let candidateScore = 0;
3113
3113
  for (const cand of candidates) {
3114
- const s = chunkV3TUIIT2_js.matchScore(needle, cand);
3114
+ const s = chunkJ75B2HWG_js.matchScore(needle, cand);
3115
3115
  if (s > candidateScore) candidateScore = s;
3116
3116
  }
3117
3117
  if (candidateScore === 0) continue;
@@ -3129,9 +3129,9 @@ function findField(fieldId, registry) {
3129
3129
  );
3130
3130
  return registry.getField(bestComp.id);
3131
3131
  }
3132
- const currentScreen = chunkV3TUIIT2_js.getCurrentScreen();
3132
+ const currentScreen = chunkJ75B2HWG_js.getCurrentScreen();
3133
3133
  if (currentScreen) {
3134
- const screenMeta = chunkV3TUIIT2_js.getScreenMetadata(currentScreen);
3134
+ const screenMeta = chunkJ75B2HWG_js.getScreenMetadata(currentScreen);
3135
3135
  const fields = screenMeta?.fields;
3136
3136
  if (fields && Array.isArray(fields)) {
3137
3137
  const metaField = fields.find(
@@ -3139,12 +3139,12 @@ function findField(fieldId, registry) {
3139
3139
  );
3140
3140
  if (metaField && typeof metaField === "object" && metaField.label) {
3141
3141
  const metaLabel = metaField.label;
3142
- const metaNeedle = chunkV3TUIIT2_js.normalize3(metaLabel);
3142
+ const metaNeedle = chunkJ75B2HWG_js.normalize3(metaLabel);
3143
3143
  let mBest;
3144
3144
  let mBestScore = 0;
3145
3145
  for (const comp of snapshot) {
3146
3146
  if (comp.kind !== "field" || !comp.label) continue;
3147
- const score = chunkV3TUIIT2_js.matchScore(metaNeedle, chunkV3TUIIT2_js.normalize3(comp.label));
3147
+ const score = chunkJ75B2HWG_js.matchScore(metaNeedle, chunkJ75B2HWG_js.normalize3(comp.label));
3148
3148
  if (score > mBestScore) {
3149
3149
  mBestScore = score;
3150
3150
  mBest = comp;
@@ -3165,7 +3165,7 @@ function findField(fieldId, registry) {
3165
3165
  );
3166
3166
  return registry.getField(bestComp.id);
3167
3167
  }
3168
- chunkV3TUIIT2_js.appilotsDebugWarn(
3168
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3169
3169
  `findField: NOT FOUND \u2014 fieldId="${fieldId}" not in registry. Available fields: ${snapshot.filter((c) => c.kind === "field").map((c) => `"${c.id}" (label: ${c.label})`).join(", ") || "none"}`
3170
3170
  );
3171
3171
  return void 0;
@@ -3185,7 +3185,7 @@ function findToggle(fieldId, registry) {
3185
3185
  return registry.getToggle(comp.id);
3186
3186
  }
3187
3187
  }
3188
- chunkV3TUIIT2_js.appilotsDebugWarn(
3188
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3189
3189
  `findToggle: NOT FOUND \u2014 fieldId="${fieldId}" not in registry. Available toggles: ${snapshot.filter((c) => c.kind === "toggle").map((c) => `"${c.id}"`).join(", ") || "none"}`
3190
3190
  );
3191
3191
  return void 0;
@@ -3205,7 +3205,7 @@ function findSlider(fieldId, registry) {
3205
3205
  var sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
3206
3206
  async function formFillHandler(payload, context) {
3207
3207
  const { permissions } = context;
3208
- const registry = context.registry ?? chunkV3TUIIT2_js.componentRegistry;
3208
+ const registry = context.registry ?? chunkJ75B2HWG_js.componentRegistry;
3209
3209
  const { screen, activePath } = resolveScreenContext();
3210
3210
  const screenPath = activePath.length > 1 ? activePath.join("/") : screen;
3211
3211
  if (!permissions.canFillForms) {
@@ -3224,7 +3224,7 @@ async function formFillHandler(payload, context) {
3224
3224
  }
3225
3225
  const registrySnapshot = registry.snapshot();
3226
3226
  if (registrySnapshot.length === 0) {
3227
- chunkV3TUIIT2_js.appilotsDebugWarn(
3227
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3228
3228
  "formFillHandler: registry is EMPTY \u2014 auto-tracking may not be active. Ensure enableAppilotsAutoTracking() runs before components mount."
3229
3229
  );
3230
3230
  } else {
@@ -3269,7 +3269,9 @@ async function formFillHandler(payload, context) {
3269
3269
  const fieldEntry = findField(fieldId, registry);
3270
3270
  if (fieldEntry) {
3271
3271
  try {
3272
- console.log(`[Appilots] formFillHandler: found field "${fieldId}" via registry, calling setValue("${value}")`);
3272
+ chunkJ75B2HWG_js.appilotsDebugLog(
3273
+ `formFillHandler: found field "${fieldId}" via registry, calling setValue(<${String(value).length} chars>)`
3274
+ );
3273
3275
  const beforeValue = effectiveFieldType === "date" ? fieldEntry.getValue?.() ?? "" : void 0;
3274
3276
  fieldEntry.focus?.();
3275
3277
  fieldEntry.setValue(String(value));
@@ -3298,8 +3300,8 @@ async function formFillHandler(payload, context) {
3298
3300
  after = fieldEntry.getValue?.() ?? "";
3299
3301
  }
3300
3302
  if (!selectValueApplied(fieldId, value, after, registry)) {
3301
- chunkV3TUIIT2_js.appilotsDebugWarn(
3302
- `formFillHandler: select field "${fieldId}" setValue("${value}") did not stick (current="${after}"), trying visible choice fallback`
3303
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3304
+ `formFillHandler: select field "${fieldId}" setValue did not stick (wrote <${String(value).length} chars>, current is <${String(after ?? "").length} chars>), trying visible choice fallback`
3303
3305
  );
3304
3306
  const selectResult = await selectVisibleChoice(fieldId, value, registry, {
3305
3307
  allowFirstVisibleWhenNoCue: !selectedChoiceThisBatch
@@ -3471,14 +3473,14 @@ async function formFillHandler(payload, context) {
3471
3473
  if (payload.submitAfterFill === true) {
3472
3474
  if (!allSuccess) {
3473
3475
  const failedIds = fieldResults.filter((result) => !result.success).map((result) => result.fieldId);
3474
- chunkV3TUIIT2_js.appilotsDebugWarn(
3476
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3475
3477
  "formFillHandler: submitAfterFill=true requested but some fields failed; NOT submitting" + (failedIds.length > 0 ? ` (failed: ${failedIds.join(", ")})` : "")
3476
3478
  );
3477
3479
  } else {
3478
3480
  await sleep2(120);
3479
3481
  const submitResult = pressSubmitButton({ screen, screenPath, activePath }, registry);
3480
3482
  if (!submitResult.success) {
3481
- chunkV3TUIIT2_js.appilotsDebugWarn(`formFillHandler: submitAfterFill failed \u2014 ${submitResult.error}`);
3483
+ chunkJ75B2HWG_js.appilotsDebugWarn(`formFillHandler: submitAfterFill failed \u2014 ${submitResult.error}`);
3482
3484
  return {
3483
3485
  success: false,
3484
3486
  error: submitResult.error,
@@ -3490,7 +3492,7 @@ async function formFillHandler(payload, context) {
3490
3492
  submitTargetId: submitResult.pressedTargetId
3491
3493
  });
3492
3494
  if (postSubmit.status === "pending") {
3493
- chunkV3TUIIT2_js.appilotsDebugWarn(`formFillHandler: submit still pending \u2014 ${postSubmit.message}`);
3495
+ chunkJ75B2HWG_js.appilotsDebugWarn(`formFillHandler: submit still pending \u2014 ${postSubmit.message}`);
3494
3496
  return {
3495
3497
  success: false,
3496
3498
  error: postSubmit.message,
@@ -3499,7 +3501,7 @@ async function formFillHandler(payload, context) {
3499
3501
  };
3500
3502
  }
3501
3503
  if (postSubmit.status === "failure") {
3502
- chunkV3TUIIT2_js.appilotsDebugWarn(
3504
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3503
3505
  `formFillHandler: submit rejected by visible validation \u2014 ${postSubmit.message}`
3504
3506
  );
3505
3507
  return {
@@ -3526,10 +3528,10 @@ async function formFillHandler(payload, context) {
3526
3528
  };
3527
3529
  }
3528
3530
  function pressSubmitButton(context, registry) {
3529
- const activePath = context.activePath ?? chunkV3TUIIT2_js.getActiveRouteNames();
3531
+ const activePath = context.activePath ?? chunkJ75B2HWG_js.getActiveRouteNames();
3530
3532
  const hintScreen = context.screen ?? context.screenPath;
3531
3533
  const formScreens = resolveFormScreensForSubmit(hintScreen, activePath, registry);
3532
- const resolvedScreen = formScreens.find((name) => screenDeclaresSubmit(name)) ?? formScreens[0] ?? hintScreen ?? chunkV3TUIIT2_js.getCurrentScreen() ?? void 0;
3534
+ const resolvedScreen = formScreens.find((name) => screenDeclaresSubmit(name)) ?? formScreens[0] ?? hintScreen ?? chunkJ75B2HWG_js.getCurrentScreen() ?? void 0;
3533
3535
  const candidates = collectSubmitTargetCandidates(formScreens, registry);
3534
3536
  for (const candidate of candidates) {
3535
3537
  const target = registry.getTarget(candidate);
@@ -3550,7 +3552,7 @@ function pressSubmitButton(context, registry) {
3550
3552
  }
3551
3553
  }
3552
3554
  for (const screenName of formScreens) {
3553
- const screenMeta = chunkV3TUIIT2_js.getScreenMetadata(screenName);
3555
+ const screenMeta = chunkJ75B2HWG_js.getScreenMetadata(screenName);
3554
3556
  const submitMeta = Array.isArray(screenMeta?.actions) ? screenMeta.actions.find(
3555
3557
  (action) => typeof action === "object" && action !== null && action.type === "submit"
3556
3558
  ) : void 0;
@@ -3656,12 +3658,12 @@ function buildDiagnose(category, targetId, candidates) {
3656
3658
  return {
3657
3659
  category,
3658
3660
  targetId,
3659
- screen: chunkV3TUIIT2_js.getCurrentScreen() ?? void 0,
3661
+ screen: chunkJ75B2HWG_js.getCurrentScreen() ?? void 0,
3660
3662
  ...candidates && candidates.length > 0 ? { candidates: candidates.slice(0, 8) } : {}
3661
3663
  };
3662
3664
  }
3663
3665
  function resolveListEntry(listId) {
3664
- const entries = chunkV3TUIIT2_js.listRegistry.snapshot();
3666
+ const entries = chunkJ75B2HWG_js.listRegistry.snapshot();
3665
3667
  if (entries.length === 0) return {};
3666
3668
  if (listId) {
3667
3669
  const wanted = normalizeId2(listId);
@@ -3772,23 +3774,23 @@ function targetIdFromPayload(payload) {
3772
3774
  }
3773
3775
  async function waitForPostInteractionSettle(payload) {
3774
3776
  const targetId = targetIdFromPayload(payload);
3775
- const fromScreen = chunkV3TUIIT2_js.getCurrentScreen();
3776
- const baseline = chunkV3TUIIT2_js.probeLoadingState(targetId || null, fromScreen);
3777
+ const fromScreen = chunkJ75B2HWG_js.getCurrentScreen();
3778
+ const baseline = chunkJ75B2HWG_js.probeLoadingState(targetId || null, fromScreen);
3777
3779
  await sleepMs(100);
3778
- const afterPress = chunkV3TUIIT2_js.probeLoadingState(targetId || null, chunkV3TUIIT2_js.getCurrentScreen());
3780
+ const afterPress = chunkJ75B2HWG_js.probeLoadingState(targetId || null, chunkJ75B2HWG_js.getCurrentScreen());
3779
3781
  const modalOrLoading = afterPress.modalOpen || afterPress.loading || afterPress.pressedDisabled;
3780
3782
  const fingerprintChanged = afterPress.fingerprint !== baseline.fingerprint;
3781
- const capMs = chunkV3TUIIT2_js.isListItemPressTarget(targetId) ? 5e3 : 1e4;
3783
+ const capMs = chunkJ75B2HWG_js.isListItemPressTarget(targetId) ? 5e3 : 1e4;
3782
3784
  if (modalOrLoading || fingerprintChanged) {
3783
- await chunkV3TUIIT2_js.waitForLoadingSettle({
3785
+ await chunkJ75B2HWG_js.waitForLoadingSettle({
3784
3786
  pressedComponentId: targetId || null,
3785
3787
  fromScreen,
3786
3788
  maxMs: capMs
3787
3789
  });
3788
3790
  return;
3789
3791
  }
3790
- if (chunkV3TUIIT2_js.isListItemPressTarget(targetId)) {
3791
- await chunkV3TUIIT2_js.waitForLoadingSettle({
3792
+ if (chunkJ75B2HWG_js.isListItemPressTarget(targetId)) {
3793
+ await chunkJ75B2HWG_js.waitForLoadingSettle({
3792
3794
  fromScreen,
3793
3795
  maxMs: 3e3
3794
3796
  });
@@ -3808,7 +3810,7 @@ function validateActionPayload(action) {
3808
3810
  error: message,
3809
3811
  diagnose: {
3810
3812
  category: "validation",
3811
- screen: chunkV3TUIIT2_js.getCurrentScreen() ?? void 0,
3813
+ screen: chunkJ75B2HWG_js.getCurrentScreen() ?? void 0,
3812
3814
  ...ids ?? {}
3813
3815
  }
3814
3816
  });
@@ -3875,7 +3877,7 @@ async function executeAction(action, context) {
3875
3877
  let result;
3876
3878
  const validationFailure = validateActionPayload(action);
3877
3879
  if (validationFailure) {
3878
- chunkV3TUIIT2_js.appilotsDebugWarn(
3880
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3879
3881
  `executeAction: payload validation failed for type="${action.type}" id="${action.id}": ${validationFailure.error}`
3880
3882
  );
3881
3883
  context.emit({
@@ -3902,13 +3904,13 @@ async function executeAction(action, context) {
3902
3904
  case "form_fill":
3903
3905
  result = await formFillHandler(action.payload, {
3904
3906
  permissions,
3905
- registry: context.registry ?? chunkV3TUIIT2_js.getDefaultRegistry()
3907
+ registry: context.registry ?? chunkJ75B2HWG_js.getDefaultRegistry()
3906
3908
  });
3907
3909
  break;
3908
3910
  case "ui_interaction":
3909
3911
  result = uiInteractionHandler(action.payload, {
3910
3912
  permissions,
3911
- registry: context.registry ?? chunkV3TUIIT2_js.getDefaultRegistry()
3913
+ registry: context.registry ?? chunkJ75B2HWG_js.getDefaultRegistry()
3912
3914
  });
3913
3915
  if (result.success) {
3914
3916
  await waitForPostInteractionSettle(action.payload);
@@ -3938,7 +3940,7 @@ async function executeAction(action, context) {
3938
3940
  };
3939
3941
  }
3940
3942
  } catch (err) {
3941
- chunkV3TUIIT2_js.appilotsDebugWarn(
3943
+ chunkJ75B2HWG_js.appilotsDebugWarn(
3942
3944
  `executeAction: exception during action type="${action.type}" id="${action.id}": ${err?.message}`
3943
3945
  );
3944
3946
  result = {
@@ -3964,35 +3966,35 @@ async function executeAction(action, context) {
3964
3966
  }
3965
3967
  var POST_ACTION_LOADING_MAX_MS = 6e3;
3966
3968
  function resolveScreenMetadata() {
3967
- const activePath = chunkV3TUIIT2_js.getActiveRouteNames();
3969
+ const activePath = chunkJ75B2HWG_js.getActiveRouteNames();
3968
3970
  for (let i = activePath.length - 1; i >= 0; i--) {
3969
3971
  const name = activePath[i];
3970
- const meta = name ? chunkV3TUIIT2_js.getScreenMetadata(name) : void 0;
3972
+ const meta = name ? chunkJ75B2HWG_js.getScreenMetadata(name) : void 0;
3971
3973
  if (meta && (Array.isArray(meta.fields) && meta.fields.length > 0 || Array.isArray(meta.actions) && meta.actions.length > 0)) {
3972
3974
  return meta;
3973
3975
  }
3974
3976
  }
3975
- const screen = chunkV3TUIIT2_js.getCurrentScreen();
3976
- return screen ? chunkV3TUIIT2_js.getScreenMetadata(screen) : void 0;
3977
+ const screen = chunkJ75B2HWG_js.getCurrentScreen();
3978
+ return screen ? chunkJ75B2HWG_js.getScreenMetadata(screen) : void 0;
3977
3979
  }
3978
3980
  function buildAgentContext(extras = {}) {
3979
3981
  const context = {};
3980
3982
  context.platform = "react-native";
3981
- const screen = chunkV3TUIIT2_js.getCurrentScreen();
3983
+ const screen = chunkJ75B2HWG_js.getCurrentScreen();
3982
3984
  if (screen) context.currentScreen = screen;
3983
- const navigationState = chunkV3TUIIT2_js.getNavigationStateSnapshot();
3985
+ const navigationState = chunkJ75B2HWG_js.getNavigationStateSnapshot();
3984
3986
  if (navigationState) context.navigationState = navigationState;
3985
3987
  const screenMeta = resolveScreenMetadata();
3986
3988
  if (screenMeta) context.screenMetadata = screenMeta;
3987
3989
  try {
3988
3990
  context.snapshot = captureSnapshot();
3989
3991
  } catch (err) {
3990
- chunkV3TUIIT2_js.appilotsDebugWarn("buildAgentContext: captureSnapshot failed", err);
3992
+ chunkJ75B2HWG_js.appilotsDebugWarn("buildAgentContext: captureSnapshot failed", err);
3991
3993
  }
3992
- const registry = chunkV3TUIIT2_js.componentRegistry.snapshot();
3994
+ const registry = chunkJ75B2HWG_js.componentRegistry.snapshot();
3993
3995
  const filtered = screen ? registry.filter((c) => !c.screen || c.screen === screen) : registry;
3994
3996
  if (filtered.length > 0) context.registeredComponents = filtered;
3995
- const registeredLists = chunkV3TUIIT2_js.listRegistry.snapshot();
3997
+ const registeredLists = chunkJ75B2HWG_js.listRegistry.snapshot();
3996
3998
  if (registeredLists.length > 0) {
3997
3999
  context.registeredLists = registeredLists.map(
3998
4000
  ({ scrollToIndex, scrollToOffset, getScrollMetrics, dataPreview, ...rest }) => rest
@@ -4009,12 +4011,12 @@ function resolveActionHints(screen, pressedComponentId, actionPayload) {
4009
4011
  }
4010
4012
  }
4011
4013
  if (!screen || !pressedComponentId) return void 0;
4012
- const meta = chunkV3TUIIT2_js.getScreenMetadata(screen);
4014
+ const meta = chunkJ75B2HWG_js.getScreenMetadata(screen);
4013
4015
  const actions = meta?.actions;
4014
4016
  if (!actions || actions.length === 0) return void 0;
4015
4017
  for (const a of actions) {
4016
4018
  if (typeof a === "string") continue;
4017
- if (chunkV3TUIIT2_js.idLooselyMatches(a.id, pressedComponentId)) {
4019
+ if (chunkJ75B2HWG_js.idLooselyMatches(a.id, pressedComponentId)) {
4018
4020
  const inferred = a.appilotsInferred;
4019
4021
  if (inferred && typeof inferred === "object") return inferred;
4020
4022
  return void 0;
@@ -4029,7 +4031,7 @@ async function settleTurn(input) {
4029
4031
  const successById = new Map(input.results.map((r) => [r.actionId, r.success]));
4030
4032
  const typeById = new Map(input.results.map((r) => [r.actionId, r.type]));
4031
4033
  if (input.hadNavigate) {
4032
- const settle = await chunkV3TUIIT2_js.waitForScreenSettle({
4034
+ const settle = await chunkJ75B2HWG_js.waitForScreenSettle({
4033
4035
  expectingChange: true,
4034
4036
  fromScreen: input.preNavigateScreen ?? null,
4035
4037
  fromSignature: input.preNavigateSignature ?? null,
@@ -4039,19 +4041,19 @@ async function settleTurn(input) {
4039
4041
  console.log(
4040
4042
  `[Appilots] settleTurn: post-navigate settle done \u2014 screen="${settle.screen}" transitioned=${settle.transitioned} timedOut=${settle.timedOut} waitedMs=${settle.waitedMs}`
4041
4043
  );
4042
- const navigationMoved = settle.transitioned || chunkV3TUIIT2_js.screenDepartedBaseline(
4044
+ const navigationMoved = settle.transitioned || chunkJ75B2HWG_js.screenDepartedBaseline(
4043
4045
  input.preNavigateScreen ?? null,
4044
4046
  input.preNavigateSignature ?? null
4045
- ) || !!navigateTargetScreen && !!settle.screen && chunkV3TUIIT2_js.routesBelongToSameFeature(settle.screen, navigateTargetScreen);
4047
+ ) || !!navigateTargetScreen && !!settle.screen && chunkJ75B2HWG_js.routesBelongToSameFeature(settle.screen, navigateTargetScreen);
4046
4048
  if (!navigationMoved) {
4047
- chunkV3TUIIT2_js.appilotsDebugWarn(
4049
+ chunkJ75B2HWG_js.appilotsDebugWarn(
4048
4050
  `tool-without-effect: navigate emitted but screen did not change (stayed at "${input.preNavigateScreen ?? "unknown"}", waitedMs=${settle.waitedMs}). Likely causes: target screenName missing from MCP doc, nested-nav path absent, or React Navigation rejected the route.`
4049
4051
  );
4050
4052
  for (const [actionId, type] of typeById) {
4051
4053
  if (type === "navigate") toolWithoutEffectIds.add(actionId);
4052
4054
  }
4053
4055
  }
4054
- const loadSettle = await chunkV3TUIIT2_js.waitForLoadingSettle({
4056
+ const loadSettle = await chunkJ75B2HWG_js.waitForLoadingSettle({
4055
4057
  fromScreen: settle.screen ?? null,
4056
4058
  maxMs: 3e3
4057
4059
  });
@@ -4063,11 +4065,11 @@ async function settleTurn(input) {
4063
4065
  const pressedAction = turnActions.find(
4064
4066
  (a) => a.type === "ui_interaction" && a.payload?.componentId === pressedId
4065
4067
  );
4066
- const hints = resolveActionHints(chunkV3TUIIT2_js.getCurrentScreen(), pressedId, pressedAction?.payload);
4068
+ const hints = resolveActionHints(chunkJ75B2HWG_js.getCurrentScreen(), pressedId, pressedAction?.payload);
4067
4069
  const settleCapMs = hints?.isAsyncTrigger === true ? 1e4 : POST_ACTION_LOADING_MAX_MS;
4068
- const loadSettle = await chunkV3TUIIT2_js.waitForLoadingSettle({
4070
+ const loadSettle = await chunkJ75B2HWG_js.waitForLoadingSettle({
4069
4071
  pressedComponentId: pressedId,
4070
- fromScreen: chunkV3TUIIT2_js.getCurrentScreen(),
4072
+ fromScreen: chunkJ75B2HWG_js.getCurrentScreen(),
4071
4073
  maxMs: settleCapMs
4072
4074
  });
4073
4075
  console.log(
@@ -4075,23 +4077,23 @@ async function settleTurn(input) {
4075
4077
  );
4076
4078
  if (loadSettle.loadingPending) loadingPending = true;
4077
4079
  const listPressActions = turnActions.filter((action) => {
4078
- const target = chunkV3TUIIT2_js.actionPressTargetId(action);
4079
- return target ? chunkV3TUIIT2_js.isListItemPressTarget(target) : false;
4080
+ const target = chunkJ75B2HWG_js.actionPressTargetId(action);
4081
+ return target ? chunkJ75B2HWG_js.isListItemPressTarget(target) : false;
4080
4082
  });
4081
4083
  if (listPressActions.length > 0) {
4082
- const baselineFingerprint = chunkV3TUIIT2_js.probeLoadingState(pressedId, chunkV3TUIIT2_js.getCurrentScreen()).fingerprint;
4083
- const postPressSettle = await chunkV3TUIIT2_js.waitForScreenSettle({
4084
+ const baselineFingerprint = chunkJ75B2HWG_js.probeLoadingState(pressedId, chunkJ75B2HWG_js.getCurrentScreen()).fingerprint;
4085
+ const postPressSettle = await chunkJ75B2HWG_js.waitForScreenSettle({
4084
4086
  expectingChange: true,
4085
4087
  fromScreen: input.preNavigateScreen ?? null,
4086
4088
  fromSignature: input.preNavigateSignature ?? null,
4087
4089
  maxMs: 2500
4088
4090
  });
4089
- await chunkV3TUIIT2_js.waitForLoadingSettle({
4091
+ await chunkJ75B2HWG_js.waitForLoadingSettle({
4090
4092
  pressedComponentId: pressedId,
4091
- fromScreen: chunkV3TUIIT2_js.getCurrentScreen(),
4093
+ fromScreen: chunkJ75B2HWG_js.getCurrentScreen(),
4092
4094
  maxMs: 4e3
4093
4095
  });
4094
- const afterFingerprint = chunkV3TUIIT2_js.probeLoadingState(pressedId, chunkV3TUIIT2_js.getCurrentScreen()).fingerprint;
4096
+ const afterFingerprint = chunkJ75B2HWG_js.probeLoadingState(pressedId, chunkJ75B2HWG_js.getCurrentScreen()).fingerprint;
4095
4097
  console.log(
4096
4098
  `[Appilots] settleTurn: post-list-press settle \u2014 screen="${postPressSettle.screen}" transitioned=${postPressSettle.transitioned} timedOut=${postPressSettle.timedOut} waitedMs=${postPressSettle.waitedMs}`
4097
4099
  );
@@ -4108,8 +4110,8 @@ async function settleTurn(input) {
4108
4110
  }
4109
4111
  var reactNativeChatAdapter = {
4110
4112
  buildContext: buildAgentContext,
4111
- getCurrentScreen: chunkV3TUIIT2_js.getCurrentScreen,
4112
- getCurrentScreenSignature: chunkV3TUIIT2_js.getCurrentScreenSignature,
4113
+ getCurrentScreen: chunkJ75B2HWG_js.getCurrentScreen,
4114
+ getCurrentScreenSignature: chunkJ75B2HWG_js.getCurrentScreenSignature,
4113
4115
  settleTurn
4114
4116
  };
4115
4117
  async function runWithConfirmedDestructiveContext(enabled, fn) {
@@ -4145,7 +4147,7 @@ function createReactNativeActionRunner(getOptions) {
4145
4147
  return {
4146
4148
  async execute(action, { confirmedDestructive }) {
4147
4149
  const { permissions, emit, navigationRef } = getOptions();
4148
- const navRef = navigationRef?.current ? navigationRef : { current: chunkV3TUIIT2_js.getNavigationRef() };
4150
+ const navRef = navigationRef?.current ? navigationRef : { current: chunkJ75B2HWG_js.getNavigationRef() };
4149
4151
  return runWithConfirmedDestructiveContext(
4150
4152
  confirmedDestructive,
4151
4153
  () => executeAction(action, {
@@ -4155,21 +4157,21 @@ function createReactNativeActionRunner(getOptions) {
4155
4157
  })
4156
4158
  );
4157
4159
  },
4158
- getCurrentScreen: chunkV3TUIIT2_js.getCurrentScreen,
4159
- getCurrentScreenSignature: chunkV3TUIIT2_js.getCurrentScreenSignature,
4160
+ getCurrentScreen: chunkJ75B2HWG_js.getCurrentScreen,
4161
+ getCurrentScreenSignature: chunkJ75B2HWG_js.getCurrentScreenSignature,
4160
4162
  getScreenActionsMetadata(screen) {
4161
- return chunkV3TUIIT2_js.getScreenMetadata(screen)?.actions;
4163
+ return chunkJ75B2HWG_js.getScreenMetadata(screen)?.actions;
4162
4164
  },
4163
- waitForScreenSettle: chunkV3TUIIT2_js.waitForScreenSettle
4165
+ waitForScreenSettle: chunkJ75B2HWG_js.waitForScreenSettle
4164
4166
  };
4165
4167
  }
4166
4168
 
4167
4169
  // src/hooks/useAppilotsChat.ts
4168
4170
  function useAppilotsChat(options = {}) {
4169
- const { client, emit, subscribe } = chunkV3TUIIT2_js.useAppilotsContext();
4171
+ const { client, emit, subscribe } = chunkJ75B2HWG_js.useAppilotsContext();
4170
4172
  const machine = react.useMemo(
4171
- () => new chunkV3TUIIT2_js.ChatSessionMachine(
4172
- { client, adapter: reactNativeChatAdapter, emit, warn: chunkV3TUIIT2_js.appilotsDebugWarn },
4173
+ () => new chunkJ75B2HWG_js.ChatSessionMachine(
4174
+ { client, adapter: reactNativeChatAdapter, emit, warn: chunkJ75B2HWG_js.appilotsDebugWarn },
4173
4175
  options
4174
4176
  ),
4175
4177
  // A new machine per client/provider instance — options are pushed in
@@ -4212,7 +4214,7 @@ var DEFAULT_PERMISSIONS2 = {
4212
4214
  canSubmitForms: true
4213
4215
  };
4214
4216
  function useAppilotsActions(options = {}) {
4215
- const { client, subscribe, config, emit } = chunkV3TUIIT2_js.useAppilotsContext();
4217
+ const { client, subscribe, config, emit } = chunkJ75B2HWG_js.useAppilotsContext();
4216
4218
  const { navigationRef, autoExecute = false } = options;
4217
4219
  const runnerOptionsRef = react.useRef({
4218
4220
  permissions: config.permissions ?? DEFAULT_PERMISSIONS2,
@@ -4225,12 +4227,12 @@ function useAppilotsActions(options = {}) {
4225
4227
  navigationRef
4226
4228
  };
4227
4229
  const machine = react.useMemo(
4228
- () => new chunkV3TUIIT2_js.ActionQueueMachine(
4230
+ () => new chunkJ75B2HWG_js.ActionQueueMachine(
4229
4231
  {
4230
4232
  client,
4231
4233
  adapter: createReactNativeActionRunner(() => runnerOptionsRef.current),
4232
4234
  emit,
4233
- warn: chunkV3TUIIT2_js.appilotsDebugWarn
4235
+ warn: chunkJ75B2HWG_js.appilotsDebugWarn
4234
4236
  },
4235
4237
  { autoExecute }
4236
4238
  ),
@@ -4287,7 +4289,7 @@ function shouldShowSuggestedPrompts(args) {
4287
4289
 
4288
4290
  // src/hooks/useSuggestedPrompts.ts
4289
4291
  function useSuggestedPrompts(options) {
4290
- const { client } = chunkV3TUIIT2_js.useAppilotsContext();
4292
+ const { client } = chunkJ75B2HWG_js.useAppilotsContext();
4291
4293
  const { enabled, limit = 4 } = options;
4292
4294
  const [prompts, setPrompts] = react.useState([]);
4293
4295
  const [isLoading, setIsLoading] = react.useState(false);
@@ -4297,8 +4299,8 @@ function useSuggestedPrompts(options) {
4297
4299
  if (!enabled) return;
4298
4300
  const requestId = ++requestIdRef.current;
4299
4301
  let cancelled = false;
4300
- const screen = chunkV3TUIIT2_js.getCurrentScreen() ?? void 0;
4301
- const localDev = screen ? (chunkV3TUIIT2_js.getScreenMetadata(screen)?.suggestedPrompts ?? []).map((text) => ({
4302
+ const screen = chunkJ75B2HWG_js.getCurrentScreen() ?? void 0;
4303
+ const localDev = screen ? (chunkJ75B2HWG_js.getScreenMetadata(screen)?.suggestedPrompts ?? []).map((text) => ({
4302
4304
  text,
4303
4305
  source: "dev-defined"
4304
4306
  })) : [];
@@ -4323,9 +4325,9 @@ function useSuggestedPrompts(options) {
4323
4325
  }, [client, enabled, limit, refreshTick]);
4324
4326
  react.useEffect(() => {
4325
4327
  if (!enabled) return;
4326
- let lastScreen = chunkV3TUIIT2_js.getCurrentScreen();
4328
+ let lastScreen = chunkJ75B2HWG_js.getCurrentScreen();
4327
4329
  const interval = setInterval(() => {
4328
- const current = chunkV3TUIIT2_js.getCurrentScreen();
4330
+ const current = chunkJ75B2HWG_js.getCurrentScreen();
4329
4331
  if (current !== lastScreen) {
4330
4332
  lastScreen = current;
4331
4333
  setRefreshTick((t) => t + 1);
@@ -4340,14 +4342,14 @@ function useSuggestedPrompts(options) {
4340
4342
  };
4341
4343
  }
4342
4344
  function useAppilotsNavigation() {
4343
- const { emit } = chunkV3TUIIT2_js.useAppilotsContext();
4345
+ const { emit } = chunkJ75B2HWG_js.useAppilotsContext();
4344
4346
  const [currentScreen, setCurrentScreenState] = react.useState(null);
4345
4347
  const [navigationHistory, setNavigationHistory] = react.useState([]);
4346
4348
  const navigationRef = react.useRef(null);
4347
4349
  const setCurrentScreen2 = react.useCallback(
4348
4350
  (screenName) => {
4349
4351
  setCurrentScreenState(screenName);
4350
- chunkV3TUIIT2_js.setCurrentScreen(screenName);
4352
+ chunkJ75B2HWG_js.setCurrentScreen(screenName);
4351
4353
  setNavigationHistory((prev) => [...prev, screenName]);
4352
4354
  emit({
4353
4355
  type: "navigation:change",
@@ -4378,7 +4380,7 @@ function useAppilotsNavigation() {
4378
4380
 
4379
4381
  // src/hooks/useAppilots.ts
4380
4382
  function useAppilots() {
4381
- const { config, client } = chunkV3TUIIT2_js.useAppilotsContext();
4383
+ const { config, client } = chunkJ75B2HWG_js.useAppilotsContext();
4382
4384
  const chat = useAppilotsChat();
4383
4385
  const navigation = useAppilotsNavigation();
4384
4386
  const actions = useAppilotsActions();
@@ -4407,7 +4409,7 @@ function useAppilots() {
4407
4409
  }
4408
4410
  function useAppilotsField(id, options) {
4409
4411
  const { value, onChangeText, ref, fieldType, label, screen } = options;
4410
- const registry = chunkV3TUIIT2_js.useResolvedRegistry();
4412
+ const registry = chunkJ75B2HWG_js.useResolvedRegistry();
4411
4413
  const valueRef = react.useRef(value);
4412
4414
  const onChangeRef = react.useRef(onChangeText);
4413
4415
  valueRef.current = value;
@@ -4435,7 +4437,7 @@ function useAppilotsField(id, options) {
4435
4437
  }
4436
4438
  function useAppilotsTarget(id, options) {
4437
4439
  const { onPress, onLongPress, onScrollTo, label, screen } = options;
4438
- const registry = chunkV3TUIIT2_js.useResolvedRegistry();
4440
+ const registry = chunkJ75B2HWG_js.useResolvedRegistry();
4439
4441
  const onPressRef = react.useRef(onPress);
4440
4442
  const onLongPressRef = react.useRef(onLongPress);
4441
4443
  const onScrollToRef = react.useRef(onScrollTo);
@@ -4462,7 +4464,7 @@ function useAppilotsTarget(id, options) {
4462
4464
  }
4463
4465
  function useAppilotsToggle(id, options) {
4464
4466
  const { value, onValueChange, label, screen } = options;
4465
- const registry = chunkV3TUIIT2_js.useResolvedRegistry();
4467
+ const registry = chunkJ75B2HWG_js.useResolvedRegistry();
4466
4468
  const valueRef = react.useRef(value);
4467
4469
  const onChangeRef = react.useRef(onValueChange);
4468
4470
  valueRef.current = value;
@@ -4485,7 +4487,7 @@ function useAppilotsToggle(id, options) {
4485
4487
  }
4486
4488
  function useAppilotsSlider(id, options) {
4487
4489
  const { value, onValueChange, min, max, step, label, screen } = options;
4488
- const registry = chunkV3TUIIT2_js.useResolvedRegistry();
4490
+ const registry = chunkJ75B2HWG_js.useResolvedRegistry();
4489
4491
  const valueRef = react.useRef(value);
4490
4492
  const onChangeRef = react.useRef(onValueChange);
4491
4493
  valueRef.current = value;