@buoy-gg/highlight-updates 7.0.79 → 7.0.81

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.describeScreen=describeScreen;exports.hitTest=hitTest;exports.readMaps=readMaps;exports.resolveTouchTarget=resolveTouchTarget;exports.tapElement=tapElement;exports.waitFor=waitFor;var _utils=require("@buoy-gg/shared-ui/utils");var _reactNative=require("react-native");var _tapMatch=require("./tapMatch");var _domScreenElements=require("./domScreenElements");const HostComponent=5;const OffscreenComponent=22;const INTERNAL_NAMES=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function getReactDevToolsHook(){if(typeof global==="undefined")return null;return global.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}let commitCount=0;let commitCounterInstalled=false;function ensureCommitCounter(){if(commitCounterInstalled)return;const e=getReactDevToolsHook();if(!e)return;const t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){commitCount++;return typeof t==="function"?t.apply(e,n):void 0};commitCounterInstalled=true}const TAP_SETTLE_MS=250;function makeChromeCheck(){const e=new Map;return t=>{const n=[];let r=t;let i=0;let l=false;while(r&&i<400){const a=e.get(r);if(a!==void 0){l=a;break}if(getProps(r)?.__buoyDevToolsRoot){l=true;e.set(r,true);break}n.push(r);r=r.return;i++}for(const a of n)e.set(a,l);return l}}function getAllFiberRoots(){const e=getReactDevToolsHook();if(!e)return[];const t=[];try{if(e.renderers&&typeof e.renderers.forEach==="function"){e.renderers.forEach((n,r)=>{try{const i=e.getFiberRoots?.(r);if(i)i.forEach(l=>t.push(l))}catch{}})}if(t.length===0&&e.getFiberRoots){const n=e.getFiberRoots(1);if(n)n.forEach(r=>t.push(r))}}catch{}return t}function isHiddenOffscreen(e){return e.tag===OffscreenComponent&&e.memoizedState!==null}let includeHiddenScreens=false;let prunedHiddenScreens=0;let fullVisibleText=false;function withHiddenScreens(e,t){const n=includeHiddenScreens;includeHiddenScreens=e;try{return t()}finally{includeHiddenScreens=n}}function isNotShowingScreen(e){const t=e.memoizedProps;if(!t)return false;if(t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t))return true;if(t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t))return true;return false}function isInactiveScreen(e){const t=e.memoizedProps?.activityState;if(t===0||t===1)return true;if(e.memoizedProps?.isPageFocused===false)return true;if(!includeHiddenScreens&&isNotShowingScreen(e)){prunedHiddenScreens++;return true}return false}function traverseFiberTree(e,t,n=0,r=new Set){if(!e||r.has(e)||n>500)return;r.add(e);if(isHiddenOffscreen(e)||isInactiveScreen(e)){if(e.sibling)traverseFiberTree(e.sibling,t,n,r);return}t(e);if(e.child)traverseFiberTree(e.child,t,n+1,r);if(e.sibling)traverseFiberTree(e.sibling,t,n,r)}function getPublicInstance(e){const t=(0,_utils.getDOMPublicInstance)(e);if(t)return t;if(!e)return null;const n=e;if(n.canonical?.publicInstance)return n.canonical.publicInstance;if(n.canonical&&typeof n.canonical.measure==="function"){return n.canonical}if(typeof n.measure==="function"||typeof n.measureInWindow==="function"){return n}return null}function getNativeTag(e){const t=(0,_utils.getDOMNodeHandle)(e);if(t!==null)return t;if(e==null)return null;const n=e;if(typeof n.__nativeTag==="number")return n.__nativeTag;if(typeof n._nativeTag==="number")return n._nativeTag;if(typeof n.nativeTag==="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag==="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag==="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag==="number")return n.canonical.nativeTag}return null}function findHostInstance(e){const t=getPublicInstance(e.stateNode);if(t){return{instance:t,nativeTag:getNativeTag(e.stateNode),stateNode:e.stateNode}}const n=[];if(e.child)n.push(e.child);let r=0;while(n.length>0&&r<4e3){r++;const i=n.pop();if(!i)continue;const l=getPublicInstance(i.stateNode);if(l)return{instance:l,nativeTag:getNativeTag(i.stateNode),stateNode:i.stateNode};if(i.child)n.push(i.child);if(i.sibling)n.push(i.sibling)}return null}function findScrollAncestor(e){let t=e;let n=0;while(t&&n++<200){const r=t.stateNode;if(r&&typeof r.scrollTo==="function"){const i=typeof r.getNativeScrollRef==="function"&&r.getNativeScrollRef()||null;const l=typeof r.getInnerViewNode==="function"&&r.getInnerViewNode()||typeof r.getScrollableNode==="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:i,innerNode:l}}t=t.return}return null}async function scrollIntoView(e,t,n,r){try{if((0,_utils.isDOMElement)(n)){n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"});await new Promise(u=>setTimeout(u,16));return true}const i=findScrollAncestor(e);if(!i)return false;const l=t;let a=null;const o=u=>new Promise(s=>{let c=false;const d=m=>{if(c)return;c=true;s(m)};const g=setTimeout(()=>d(null),600);try{u(m=>{clearTimeout(g);d(m)})}catch{clearTimeout(g);d(null)}});if(i.nativeRef&&typeof l.measureLayout==="function"){a=await o(u=>l.measureLayout(i.nativeRef,(s,c)=>u(c),()=>u(null)))}if(a==null){const u=(0,_reactNative.findNodeHandle)(t);const s=typeof i.innerNode==="number"?i.innerNode:(0,_reactNative.findNodeHandle)(i.innerNode);if(u!=null&&s!=null){a=await o(c=>_reactNative.UIManager.measureLayout(u,s,()=>c(null),(d,g)=>c(g)))}}if(a==null)return false;i.instance.scrollTo({y:Math.max(0,a-r),animated:false});await new Promise(u=>setTimeout(u,120));return true}catch{return false}}function getComponentName(e){const t=e?.type;if(!t)return null;if(typeof t==="string")return t;return t.displayName||t.name||null}function getOwningComponentName(e){let t=e?._debugOwner||e?.return;let n=0;while(t&&n<30){n++;const r=getComponentName(t);if(r&&!INTERNAL_NAMES.has(r)&&typeof t.type!=="string"){return r}t=t.return}return null}function getProps(e){return(0,_utils.getDOMControlProps)(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}function flattenText(e,t=0){if(typeof e==="string")return e;if(typeof e==="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){const n=[];for(const r of e){const i=flattenText(r,t+1);if(i)n.push(i)}return n.length>0?n.join(""):void 0}return void 0}function normalizeVisibleText(e){return e.replace(/\s+/g," ").trim()}function getVisibleText(e){if(!e)return void 0;const t=n=>{const r=flattenText(n);if(r===void 0)return void 0;const i=normalizeVisibleText(r);return i?fullVisibleText?i:i.slice(0,80):void 0};return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}function collectDescendantText(e,t){const n=[];const r=(l,a)=>{if(!l||a>t||n.length>=4)return;if(l!==e){const u=getProps(l);if(u&&(typeof u.onPress==="function"||typeof u.onLongPress==="function"))return}const o=getVisibleText(getProps(l));if(o&&!n.includes(o))n.push(o);if(l.child)r(l.child,a+1);if(l!==e&&l.sibling)r(l.sibling,a)};if(e.child)r(e.child,1);const i=n.join(" ").trim();return i?i.slice(0,80):void 0}function findPressHandler(e){let t=e;let n=0;let r=null;let i=null;while(t&&n<25&&!(r&&i)){const l=getProps(t);if(l){if(!r&&typeof l.onPress==="function")r=l.onPress;if(!i&&typeof l.onLongPress==="function")i=l.onLongPress}t=t.return;n++}if(r)return{handler:r,kind:"onPress",longPress:i??void 0};return i?{handler:i,kind:"onLongPress"}:null}function measureInstance(e){return new Promise(t=>{let n=false;const r=i=>{if(n)return;n=true;t(i)};setTimeout(()=>r(null),1e3);try{if(typeof e.measureInWindow==="function"){e.measureInWindow((i,l,a,o)=>{if(a>0&&o>0)r({x:i,y:l,width:a,height:o});else r(null)})}else if(typeof e.measure==="function"){e.measure((i,l,a,o,u,s)=>{if(a>0&&o>0&&u!=null&&s!=null){r({x:u,y:s,width:a,height:o})}else{r(null)}})}else{r(null)}}catch{r(null)}})}const SPINNER_HOSTS=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function collectCandidates(){const e=getAllFiberRoots();const t=[];const n=new Map;const r=new Map;const i=makeChromeCheck();for(const l of e){traverseFiberTree(l.current,a=>{const o=getProps(a);if(!o)return;const u=typeof o.onPress==="function"||typeof o.onLongPress==="function";const s=typeof o.onValueChange==="function";const c=typeof o.onChangeText==="function";const d=o.testID||void 0;const g=o.accessibilityLabel||void 0;const m=o.accessibilityRole||o.role||void 0;let b=getVisibleText(o);const w=m==="button"||m==="link"||m==="menuitem"||m==="tab"||m==="switch"||m==="checkbox";const v=typeof a.type==="string"&&SPINNER_HOSTS.has(a.type)&&o.animating!==false;if(!u&&!s&&!c&&!d&&!g&&!b&&!w&&!v){return}let x=null;let P=null;let N=null;if(s){const D=o.value;const S=typeof D==="number"||typeof o.minimumValue==="number";P={handler:o.onValueChange,kind:S?"slider":"toggle",current:D,min:typeof o.minimumValue==="number"?o.minimumValue:void 0,max:typeof o.maximumValue==="number"?o.maximumValue:void 0}}else if(c){N={handler:o.onChangeText,current:typeof o.value==="string"?o.value:void 0}}else{x=findPressHandler(a)}const C=getComponentName(a);let f=C??"Unknown";if(!C||INTERNAL_NAMES.has(C)||typeof a.type==="string"){f=getOwningComponentName(a)??C??"Unknown"}const h=findHostInstance(a);if(!h&&!d)return;if(!b&&!g&&u){b=collectDescendantText(a,6)}const y=h?.instance??null;const T=h?.nativeTag??null;const p=(y?n.get(y):void 0)??(T!=null?r.get(T):void 0);if(p){if(!p.press&&x)p.press=x;else if(p.press&&x?.longPress&&!p.press.longPress){p.press.longPress=x.longPress}if(!p.valueControl&&P)p.valueControl=P;if(!p.textControl&&N)p.textControl=N;if(!p.testID&&d)p.testID=d;if(!p.label&&g)p.label=g;if(!p.text&&b)p.text=b;if(y&&!n.has(y))n.set(y,p);if(T!=null&&!r.has(T))r.set(T,p);return}const I={nativeTag:T,name:f,role:m??(v?"progressbar":void 0),testID:d,label:g,text:b,instance:y,stateNode:h?.stateNode??null,fiber:a,press:x,valueControl:P,textControl:N,rect:null,buoy:i(a)};t.push(I);if(y)n.set(y,I);if(T!=null)r.set(T,I)})}t.push(...collectDOMCandidates());return t}function collectDOMCandidates(){return(0,_domScreenElements.collectDOMElements)({fullText:fullVisibleText}).map(({element:e,props:t,text:n,buoy:r})=>{const i=typeof t.onValueChange==="function"?{handler:t.onValueChange,kind:typeof t.value==="number"?"slider":"toggle",current:t.value,min:t.minimumValue,max:t.maximumValue}:null;const l=!i&&typeof t.onChangeText==="function"?{handler:t.onChangeText,current:t.value}:null;const a=!i&&!l&&typeof t.onPress==="function"?{handler:t.onPress,kind:"onPress"}:null;return{nativeTag:(0,_utils.getDOMNodeHandle)(e),name:(0,_domScreenElements.domElementName)(e),role:t.accessibilityRole,testID:t.testID,label:t.accessibilityLabel,text:n,instance:(0,_utils.getDOMPublicInstance)(e),stateNode:e,fiber:null,buoy:r,press:a,valueControl:i,textControl:l,rect:null}})}function explicitlyTargets(e,t){if(t.nativeTag!=null)return e.nativeTag===t.nativeTag;if(t.testID&&e.testID)return e.testID.toLowerCase()===t.testID.toLowerCase();return false}function appCandidates(e){const t=collectCandidates();if(e.includeBuoy)return t;return t.filter(n=>!n.buoy||explicitlyTargets(n,e))}async function measureCandidates(e){await Promise.all(e.map(async t=>{if(t.instance)t.rect=await measureInstance(t.instance)}))}const LIST_WRAPPERS=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function collectLists(e,t){const n=[];const r=makeChromeCheck();for(const l of getAllFiberRoots()){traverseFiberTree(l.current,a=>{if(getComponentName(a)!=="VirtualizedList")return;const o=a.memoizedProps;if(!o||typeof o.getItemCount!=="function")return;if(!e&&r(a))return;let u;try{u=Number(o.getItemCount(o.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;const s=[];const c=(m,b)=>{for(let w=m?.child;w;w=w.sibling){const v=getComponentName(w);if(v==="VirtualizedList")continue;if(v==="CellRenderer"){s.push(w);continue}if(b<40)c(w,b+1)}};c(a,0);let d=a;let g=getOwningComponentName(d);for(let m=0;m<6&&g&&LIST_WRAPPERS.test(g);m++){d=d._debugOwner||d.return;g=getOwningComponentName(d)}n.push({owner:g,items:u,cells:s})})}const i=[];for(const l of n){const a=await Promise.all(l.cells.map(async u=>{const s=findHostInstance(u);return s?measureInstance(s.instance):null}));const o=a.filter(t).length;if(o>0&&l.items>o)i.push({owner:l.owner,items:l.items,listed:o})}return i}async function describeScreen(e={}){const t=includeHiddenScreens;const n=fullVisibleText;includeHiddenScreens=!!e.includeHidden;fullVisibleText=!!e.fullText;try{return await describeScreenInner(e)}finally{includeHiddenScreens=t;fullVisibleText=n}}async function describeScreenInner(e){prunedHiddenScreens=0;const t=collectCandidates();const n=prunedHiddenScreens;const r=e.includeBuoy?t:t.filter(c=>!c.buoy);const i=t.length-r.length;await measureCandidates(r);const l=_reactNative.Dimensions.get("window");const a=Math.round(l.width)||1;const o=Math.round(l.height)||1;const u=[];for(const c of r){const d=c.rect;if(!d&&!c.testID)continue;let g;let m;if(d){const v=d.x+d.width/2;const x=d.y+d.height/2;if(x<-o*.1||x>o*1.1||v<-a*.1||v>a*1.1){continue}g={x:round2(v/a),y:round2(x/o)};m={x:round2(d.x/a),y:round2(d.y/o),width:round2(d.width/a),height:round2(d.height/o)}}const b=c.valueControl?c.valueControl.kind:c.textControl?"text":void 0;const w=c.valueControl?c.valueControl.current:c.textControl?.current;u.push({nativeTag:c.nativeTag,name:c.name,role:c.role,testID:c.testID,label:c.label,text:c.text,interactive:!!(c.press||c.valueControl||c.textControl),longPressable:c.press&&(c.press.kind==="onLongPress"||c.press.longPress)?true:void 0,control:b,value:w,tap:g,frame:m})}u.sort((c,d)=>{const g=c.tap?.y??2;const m=d.tap?.y??2;if(Math.abs(g-m)>.02)return g-m;return(c.tap?.x??2)-(d.tap?.x??2)});const s=await collectLists(!!e.includeBuoy,c=>{if(!c)return false;const d=c.x+c.width/2;return c.y<=o*1.1&&c.y+c.height>=-o*.1&&d>=-a*.1&&d<=a*1.1});return{screen:{width:a,height:o},count:u.length,elements:u,...i>0?{hiddenBuoy:i}:{},...n>0?{hiddenScreens:n}:{},...s.length?{lists:s}:{}}}function round2(e){return Math.round(e*100)/100}function fieldsOf(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}function matchScore(e,t){return(0,_tapMatch.scoreTapMatch)(fieldsOf(e),t)}function tapPoint(e,t,n){if(!e||!t||!n)return void 0;return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}function makeSyntheticPressEvent(e){const t=e?e.x+e.width/2:0;const n=e?e.y+e.height/2:0;const r={locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]};return{nativeEvent:r,persist:()=>{},preventDefault:()=>{},stopPropagation:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,target:null,currentTarget:null,type:"press",timeStamp:0}}async function tapElement(e){const t=withHiddenScreens(!!e.includeHidden,()=>appCandidates(e));if(t.length===0){return{tapped:false,reason:"Nothing on screen to tap: no React elements and no page elements were found."}}const n=t.map(f=>({c:f,score:matchScore(f,e)})).filter(f=>f.score>0).sort((f,h)=>h.score-f.score);const r=f=>!!(f.press||f.valueControl||f.textControl);if(n.length===0&&!e.includeHidden){const f=withHiddenScreens(true,()=>appCandidates(e)).map(h=>({c:h,score:matchScore(h,e)})).filter(h=>h.score>0);if(f.length>0){return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."}}}if(n.length===0){return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(r).slice(0,12).map(f=>({nativeTag:f.nativeTag,name:f.name,testID:f.testID,text:f.text}))}}const i=_reactNative.Dimensions.get("window");const l=i.width||1;const a=i.height||1;const o=n.slice(0,15);await Promise.all(o.map(async f=>{if(f.c.instance&&!f.c.rect)f.c.rect=await measureInstance(f.c.instance)}));for(const f of o){f.score=(0,_tapMatch.scoreTapMatch)({...fieldsOf(f.c),tap:tapPoint(f.c.rect,l,a)},e)}o.sort((f,h)=>h.score-f.score);if(e.text!==void 0){for(const f of o){const h=!r(f.c)&&(0,_utils.isDOMElement)(f.c.stateNode)?(0,_domScreenElements.labeledField)(f.c.stateNode):null;const y=h?t.find(T=>T.stateNode===h&&T.textControl):void 0;if(y)f.c=y}}const u=o.find(f=>r(f.c))??n.find(f=>r(f.c))??o[0];const s=u.c;const c=(f,h)=>f.press&&f.press.handler===h.press?.handler||f.valueControl&&f.valueControl.handler===h.valueControl?.handler||f.textControl&&f.textControl.handler===h.textControl?.handler;const d=o.filter(f=>f!==u&&r(f.c)&&f.score===u.score).filter(f=>!c(f.c,s)).filter((f,h,y)=>y.findIndex(T=>c(T.c,f.c))===h).slice(0,3).map(f=>({nativeTag:f.c.nativeTag,name:f.c.name,testID:f.c.testID,text:f.c.text,tap:tapPoint(f.c.rect,l,a)}));const g=e.nativeTag==null&&!(e.testID&&!e.query);if(g&&d.length>0){const f=[s,...d.map(h=>o.find(y=>y.c.nativeTag===h.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${f.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:f.map(h=>({nativeTag:h.nativeTag,name:h.name,testID:h.testID,text:h.text}))}}const m=o[0];if(g&&m&&m!==u&&!r(m.c)&&m.score>=90&&u.score<m.score-40){return{tapped:false,reason:`The best match for "${e.query}" is "${m.c.text??m.c.label??m.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${s.text??s.label??s.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:s.nativeTag,name:s.name,testID:s.testID,text:s.text}]}}if(!r(s)){return{tapped:false,reason:(0,_utils.isDOMElement)(s.stateNode)?`Matched "${s.name}"${s.text?` ("${s.text}")`:""}, but it is not a button or a field. This element can't be driven in JS.`:`Matched "${s.name}"${s.text?` ("${s.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:s.nativeTag,name:s.name,testID:s.testID,label:s.label,text:s.text,via:"onPress"}}}if(s.instance&&!s.rect)s.rect=await measureInstance(s.instance);let b=false;const w=s.rect==null||!(0,_tapMatch.isRectCenterOnScreen)(s.rect,l,a);if(w&&e.scrollIntoView!==false&&s.instance){b=await scrollIntoView(s.fiber,s.instance,s.stateNode,80);if(b)s.rect=await measureInstance(s.instance)}const v={nativeTag:s.nativeTag,name:s.name,testID:s.testID,label:s.label,text:s.text};ensureCommitCounter();const x=commitCount;const P=s.fiber===null&&(0,_utils.isDOMElement)(s.stateNode)?(0,_domScreenElements.watchDOMChanges)():null;const N=Date.now();const C=async f=>{await new Promise(h=>setTimeout(h,TAP_SETTLE_MS));return{tapped:true,scrolled:b,matched:f,effect:{commits:P?P():commitCount-x,observedMs:Date.now()-N},...d.length?{alsoMatched:d}:{}}};try{if(s.press){if(e.longPress){const h=s.press.kind==="onLongPress"?s.press.handler:s.press.longPress;if(!h){return{tapped:false,scrolled:b,reason:`Matched "${s.name}"${s.text?` ("${s.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...v,via:"onPress"}}}h(makeSyntheticPressEvent(s.rect));return await C({...v,via:"onLongPress"})}s.press.handler(makeSyntheticPressEvent(s.rect));return await C({...v,via:s.press.kind})}if(s.valueControl){const h=s.valueControl;let y;if(h.kind==="toggle"){y=typeof e.value==="boolean"?e.value:!h.current}else{const T=h.min??0;const p=h.max??1;if(typeof e.value==="number"){y=Math.min(p,Math.max(T,e.value))}else{y=h.current===p?T:p}}h.handler(y);return await C({...v,via:"onValueChange",value:y})}const f=e.text??(typeof e.value==="string"?e.value:"");s.textControl.handler(f);return await C({...v,via:"onChangeText",value:f})}catch(f){P?.();return{tapped:false,scrolled:b,reason:`handler threw: ${f instanceof Error?f.message:String(f)}`,matched:{...v,via:s.press?s.press.kind:s.valueControl?"onValueChange":"onChangeText"}}}}const WAIT_DEFAULT_MS=5e3;const WAIT_MAX_MS=3e4;const WAIT_MIN_POLL_MS=50;const WAIT_DEFAULT_POLL_MS=150;async function waitFor(e){const t=e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim();if(!t){return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."}}const n=Math.min(Math.max(e.timeoutMs??WAIT_DEFAULT_MS,0),WAIT_MAX_MS);const r=Math.max(e.pollMs??WAIT_DEFAULT_POLL_MS,WAIT_MIN_POLL_MS);const i=e.gone===true;const l=Date.now();let a=0;for(;;){a+=1;const{hit:o,closest:u}=await findOnScreen(e);if(i?!o:!!o){return{ok:true,waitedMs:Date.now()-l,polls:a,matched:o??void 0}}if(Date.now()-l>=n){const s=u?.length?u:void 0;const c=i?`Still on screen after ${n}ms.`:s?`Not on screen after ${n}ms \u2014 ${s.length===1?"one element":`${s.length} elements`} matched but ${s.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${n}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-l,polls:a,reason:c,matched:o??void 0,closest:s}}await new Promise(s=>setTimeout(s,r))}}async function findOnScreen(e){const t=appCandidates(e).map(o=>({c:o,score:matchScore(o,e)})).filter(o=>o.score>0).sort((o,u)=>u.score-o.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await measureCandidates(t.map(o=>o.c));const n=_reactNative.Dimensions.get("window");const r=Math.round(n.width)||1;const i=Math.round(n.height)||1;let l=null;for(const{c:o}of t){if(!(0,_tapMatch.isRectCenterOnScreen)(o.rect,r,i))continue;l={nativeTag:o.nativeTag,name:o.name,testID:o.testID,label:o.label,text:o.text,interactive:!!(o.press||o.valueControl||o.textControl)};break}const a=t.slice(0,3).map(({c:o})=>({name:o.name,testID:o.testID,text:o.text,onScreen:(0,_tapMatch.isRectCenterOnScreen)(o.rect,r,i)}));return{hit:l,closest:a}}function isBuoyChrome(e){let t=e;let n=0;while(t&&n<400){if(getProps(t)?.__buoyDevToolsRoot)return true;t=t.return;n++}return false}function preferHandlerOwner(e,t){const n=getProps(e.fiber);if(typeof n?.onPress==="function"||typeof n?.onValueChange==="function"||typeof n?.onChangeText==="function"){return e}let r=null;let i=e.fiber?.return;let l=0;while(i&&l<25){if(typeof getProps(i)?.onPress==="function"){r=i;break}i=i.return;l++}if(!r)return e;let a=r;for(let o=0;o<6&&a;o++){const u=t.get(a);if(u)return u;a=a.return}return e}function resolveTouchTarget(e){const t=collectCandidates();if(t.length===0)return null;const n=new Map;for(const a of t)n.set(a.fiber,a);const r=t.find(a=>a.nativeTag===e);let i=null;if(!r){for(const a of getAllFiberRoots()){traverseFiberTree(a.current,o=>{if(i)return;if(o.stateNode&&getNativeTag(o.stateNode)===e){i=o}});if(i)break}}let l=r??null;if(!l&&i){let a=i;let o=0;let u=null;while(a&&o<25){const s=n.get(a);if(s){if(s.press||s.valueControl||s.textControl){l=s;break}if(!u)u=s}a=a.return;o++}if(!l)l=u}if(!l?.fiber&&!i){const a=l?.stateNode;const o=(0,_utils.isDOMElement)(a)?a:domElementForTag(e);if(o){for(let u=o;u;u=u.parentElement){const s=t.find(c=>c.stateNode===u&&(c.press||c.valueControl||c.textControl));if(s)return s.buoy?null:touchTargetOf(s)}return null}}if(!l)return null;l=preferHandlerOwner(l,n);if(!l.press&&!l.valueControl&&!l.textControl)return null;if(isBuoyChrome(l.fiber))return null;return touchTargetOf(l)}function domElementForTag(e){const t=global.document;if(!t?.querySelectorAll)return null;return Array.from(t.querySelectorAll("*")).find(n=>(0,_utils.getDOMNodeHandle)(n)===e)??null}function touchTargetOf(e){return{nativeTag:e.nativeTag,name:e.name,role:e.role,testID:e.testID,label:e.label,text:e.text,control:e.valueControl?e.valueControl.kind:e.textControl?"text":"press",value:e.valueControl?e.valueControl.current:e.textControl?.current}}function fiberForTag(e){let t=null;for(const n of getAllFiberRoots()){traverseFiberTree(n.current,r=>{if(!t&&r.stateNode&&getNativeTag(r.stateNode)===e)t=r});if(t)break}return t}function rootHostFibers(){const e=[];for(const t of getAllFiberRoots()){let n=t.current?.child;let r=0;while(n&&r++<200){if(n.tag===HostComponent&&n.stateNode){e.push(n);break}n=n.child}}return e}function fabricFiberAt(e,t){const n=global.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!=="function")return null;const r=rootHostFibers().filter(i=>i.stateNode?.node);if(!r.length)return null;return new Promise(i=>{const l=setTimeout(()=>i(null),1e3);let a=r.length;let o=null;r.forEach((u,s)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,c=>{if(c&&(!o||s>=o.i))o={i:s,fiber:c};if(--a===0){clearTimeout(l);i(o?.fiber??null)}})}catch{if(--a===0){clearTimeout(l);i(o?.fiber??null)}}})})}function paperFiberAt(e,t){const n=_reactNative.UIManager?.findSubviewIn;if(typeof n!=="function")return null;const r=rootHostFibers()[0];const i=r?getNativeTag(r.stateNode)??(0,_reactNative.findNodeHandle)(r.stateNode):null;if(i==null)return null;return new Promise(l=>{const a=setTimeout(()=>l(null),1e3);try{n.call(_reactNative.UIManager,i,[e,t],o=>{clearTimeout(a);l(typeof o==="number"?fiberForTag(o):null)})}catch{clearTimeout(a);l(null)}})}function visibleHostFibers(){const e=[];const t=new Set;const n=i=>{const l=[];const a=(o,u)=>{for(let s=o;s&&l.length<5e3;s=s.sibling){if(t.has(s)||u>500)continue;if(isHiddenOffscreen(s)||isInactiveScreen(s))continue;if(s.tag===HostComponent&&s.stateNode)l.push(s);else if(s.child)a(s.child,u+1)}};if(i.child)a(i.child,0);return l};const r=(i,l)=>{if(t.has(i)||l>500)return;t.add(i);e.push(i);sortByZ(n(i)).forEach(a=>r(a,l+1))};for(const i of getAllFiberRoots())sortByZ(n(i.current)).forEach(l=>r(l,0));return e}function sortByZ(e){const t=e.map(n=>{const r=Number(flatStyle(getProps(n)?.style).zIndex);return Number.isFinite(r)?r:0});return e.map((n,r)=>({h:n,i:r})).sort((n,r)=>t[n.i]-t[r.i]||n.i-r.i).map(({h:n})=>n)}function flatStyle(e,t=0){if(!e||typeof e!=="object"||t>10)return{};if(Array.isArray(e))return Object.assign({},...e.map(n=>flatStyle(n,t+1)));return e}const SCROLL_HOSTS=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function clipsChildren(e){if(typeof e.type==="string"&&SCROLL_HOSTS.has(e.type)&&e.type!=="RCTScrollContentView")return true;const t=flatStyle(getProps(e)?.style).overflow;return t==="hidden"||t==="scroll"}function passesTouchesThrough(e){let t=getProps(e)?.pointerEvents??getProps(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return;let r=0;while(n&&r++<200){const i=getProps(n)?.pointerEvents??getProps(n)?.style?.pointerEvents;if(i==="none")return"all";if(i==="box-only"&&n.tag===HostComponent)return"all";n=n.return}return t==="box-none"?"self":null}async function measuredFiberAt(e,t,n){const r=await Promise.all(n.map(o=>{const u=getPublicInstance(o.stateNode);return u?measureInstance(u):Promise.resolve(null)}));const i=new Map;n.forEach((o,u)=>i.set(o,r[u]));const l=o=>!!o&&e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height;const a=o=>{for(let u=o.return,s=0;u&&s<300;u=u.return,s++){if(u.tag===HostComponent&&i.has(u)&&clipsChildren(u)&&!l(i.get(u)))return true}return false};for(let o=n.length-1;o>=0;o--){if(!l(r[o])||passesTouchesThrough(n[o])||a(n[o]))continue;return n[o]}return null}function domFiberAt(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;let i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);while(i){const l=Object.keys(i).find(a=>a.startsWith("__reactFiber$"));if(l)return i[l];i=i.parentElement}return null}function domPageHit(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;const i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);if(!i)return null;for(let c=i;c;c=c.parentElement){if(Object.keys(c).some(d=>d.startsWith("__reactFiber$")||d.startsWith("__reactContainer$")))return null}const l=!!i.closest("[data-buoy-root], [data-buoy-portal-host]");const a=collectDOMCandidates();const o=a.find(c=>c.stateNode===i);let u;for(let c=i;c&&!u;c=c.parentElement){u=a.find(d=>d.stateNode===c&&(d.press||d.valueControl||d.textControl))}const s=[];for(let c=i;c&&s.length<6;c=c.parentElement){const d=(0,_domScreenElements.domElementName)(c);if(d!==c.tagName.toLowerCase()&&s[s.length-1]!==d)s.push(d)}return{found:true,method:"dom",buoy:l,view:{name:(0,_domScreenElements.domElementName)(i),nativeTag:(0,_utils.getDOMNodeHandle)(i),testID:o?.testID,label:o?.label,text:o?.text},path:s,target:u&&!l?touchTargetOf(u):null}}async function hitTest(e){const t=Math.min(1,Math.max(0,Number(e?.x)));const n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};const r=_reactNative.Dimensions.get("window");const i=t*r.width;const l=n*r.height;let a="none";let o=null;const u=domFiberAt(t,n);const s=u?null:domPageHit(t,n);if(s)return s;if(u){a="dom";o=u}else{const w=fabricFiberAt(i,l);if(w){a="fabric";o=await w}else{const x=paperFiberAt(i,l);if(x){a="paper";o=await x}}const v=visibleHostFibers();if(!o||!new Set(v).has(o)){o=await measuredFiberAt(i,l,v);a="measured"}}if(!o)return{found:false,method:a};const c=getProps(o)??{};const d=getNativeTag(o.stateNode);const g=[];let m=o;let b=0;while(m&&b++<80&&g.length<6){const w=getComponentName(m);if(w&&typeof m.type!=="string"&&!INTERNAL_NAMES.has(w)&&g[g.length-1]!==w)g.push(w);m=m.return}return{found:true,method:a,buoy:isBuoyChrome(o),view:{name:getComponentName(o)??"Unknown",nativeTag:d,testID:c.testID||void 0,label:c.accessibilityLabel||c["aria-label"]||void 0,text:getVisibleText(c)},path:g,target:d!=null?resolveTouchTarget(d):null}}async function readMaps(){const e=[];for(const i of getAllFiberRoots()){traverseFiberTree(i.current,l=>{const a=l.stateNode;if(l.tag===1&&a&&typeof a.getCamera==="function"&&!isBuoyChrome(l))e.push(l)})}const t=_reactNative.Dimensions.get("window");const n=i=>Promise.race([i,new Promise(l=>setTimeout(()=>l(null),1e3))]);const r=await Promise.all(e.slice(0,5).map(async i=>{try{const l=await n(Promise.resolve(i.stateNode.getCamera()));if(!l)return null;const a=findHostInstance(i);const o=a?await measureInstance(a.instance):null;const u=getProps(i)??{};return{name:getComponentName(i)??"Map",testID:typeof u.testID==="string"?u.testID:void 0,frame:o&&t.width&&t.height?{x:round2(o.x/t.width),y:round2(o.y/t.height),width:round2(o.width/t.width),height:round2(o.height/t.height)}:void 0,camera:{heading:typeof l.heading==="number"?l.heading:void 0,pitch:typeof l.pitch==="number"?l.pitch:void 0,altitude:typeof l.altitude==="number"?l.altitude:void 0,zoom:typeof l.zoom==="number"?l.zoom:void 0,center:l.center}}}catch{return null}}));return{maps:r.filter(i=>!!i)}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.describeScreen=describeScreen;exports.hitTest=hitTest;exports.readMaps=readMaps;exports.resolveTouchTarget=resolveTouchTarget;exports.tapElement=tapElement;exports.waitFor=waitFor;var _utils=require("@buoy-gg/shared-ui/utils");var _reactNative=require("react-native");var _tapMatch=require("./tapMatch");var _domScreenElements=require("./domScreenElements");const HostComponent=5;const OffscreenComponent=22;const INTERNAL_NAMES=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function getReactDevToolsHook(){if(typeof global==="undefined")return null;return global.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}let commitCount=0;let commitCounterInstalled=false;function ensureCommitCounter(){if(commitCounterInstalled)return;const e=getReactDevToolsHook();if(!e)return;const t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){commitCount++;return typeof t==="function"?t.apply(e,n):void 0};commitCounterInstalled=true}const TAP_SETTLE_MS=250;function makeChromeCheck(){const e=new Map;return t=>{const n=[];let r=t;let i=0;let s=false;while(r&&i<400){const a=e.get(r);if(a!==void 0){s=a;break}if(getProps(r)?.__buoyDevToolsRoot){s=true;e.set(r,true);break}n.push(r);r=r.return;i++}for(const a of n)e.set(a,s);return s}}function getAllFiberRoots(){const e=getReactDevToolsHook();if(!e)return[];const t=[];try{if(e.renderers&&typeof e.renderers.forEach==="function"){e.renderers.forEach((n,r)=>{try{const i=e.getFiberRoots?.(r);if(i)i.forEach(s=>t.push(s))}catch{}})}if(t.length===0&&e.getFiberRoots){const n=e.getFiberRoots(1);if(n)n.forEach(r=>t.push(r))}}catch{}return t}function isHiddenOffscreen(e){return e.tag===OffscreenComponent&&e.memoizedState!==null}let includeHiddenScreens=false;let prunedHiddenScreens=0;let fullVisibleText=false;function withHiddenScreens(e,t){const n=includeHiddenScreens;includeHiddenScreens=e;try{return t()}finally{includeHiddenScreens=n}}function isNotShowingScreen(e){const t=e.memoizedProps;if(!t)return false;if(t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t))return true;if(t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t))return true;return false}function isInactiveScreen(e){const t=e.memoizedProps?.activityState;if(t===0||t===1)return true;if(e.memoizedProps?.isPageFocused===false)return true;if(!includeHiddenScreens&&isNotShowingScreen(e)){prunedHiddenScreens++;return true}return false}function traverseFiberTree(e,t,n=0,r=new Set){if(!e||r.has(e)||n>500)return;r.add(e);if(isHiddenOffscreen(e)||isInactiveScreen(e)){if(e.sibling)traverseFiberTree(e.sibling,t,n,r);return}t(e);if(e.child)traverseFiberTree(e.child,t,n+1,r);if(e.sibling)traverseFiberTree(e.sibling,t,n,r)}function getPublicInstance(e){const t=(0,_utils.getDOMPublicInstance)(e);if(t)return t;if(!e)return null;const n=e;if(n.canonical?.publicInstance)return n.canonical.publicInstance;if(n.canonical&&typeof n.canonical.measure==="function"){return n.canonical}if(typeof n.measure==="function"||typeof n.measureInWindow==="function"){return n}return null}function getNativeTag(e){const t=(0,_utils.getDOMNodeHandle)(e);if(t!==null)return t;if(e==null)return null;const n=e;if(typeof n.__nativeTag==="number")return n.__nativeTag;if(typeof n._nativeTag==="number")return n._nativeTag;if(typeof n.nativeTag==="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag==="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag==="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag==="number")return n.canonical.nativeTag}return null}function findHostInstance(e){const t=getPublicInstance(e.stateNode);if(t){return{instance:t,nativeTag:getNativeTag(e.stateNode),stateNode:e.stateNode}}const n=[];if(e.child)n.push(e.child);let r=0;while(n.length>0&&r<4e3){r++;const i=n.pop();if(!i)continue;const s=getPublicInstance(i.stateNode);if(s)return{instance:s,nativeTag:getNativeTag(i.stateNode),stateNode:i.stateNode};if(i.child)n.push(i.child);if(i.sibling)n.push(i.sibling)}return null}function findScrollAncestor(e){let t=e;let n=0;while(t&&n++<200){const r=t.stateNode;if(r&&typeof r.scrollTo==="function"){const i=typeof r.getNativeScrollRef==="function"&&r.getNativeScrollRef()||null;const s=typeof r.getInnerViewNode==="function"&&r.getInnerViewNode()||typeof r.getScrollableNode==="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:i,innerNode:s}}t=t.return}return null}async function scrollIntoView(e,t,n,r){try{if((0,_utils.isDOMElement)(n)){n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"});await new Promise(u=>setTimeout(u,16));return true}const i=findScrollAncestor(e);if(!i)return false;const s=t;let a=null;const o=u=>new Promise(l=>{let c=false;const d=m=>{if(c)return;c=true;l(m)};const g=setTimeout(()=>d(null),600);try{u(m=>{clearTimeout(g);d(m)})}catch{clearTimeout(g);d(null)}});if(i.nativeRef&&typeof s.measureLayout==="function"){a=await o(u=>s.measureLayout(i.nativeRef,(l,c)=>u(c),()=>u(null)))}if(a==null){const u=(0,_reactNative.findNodeHandle)(t);const l=typeof i.innerNode==="number"?i.innerNode:(0,_reactNative.findNodeHandle)(i.innerNode);if(u!=null&&l!=null){a=await o(c=>_reactNative.UIManager.measureLayout(u,l,()=>c(null),(d,g)=>c(g)))}}if(a==null)return false;i.instance.scrollTo({y:Math.max(0,a-r),animated:false});await new Promise(u=>setTimeout(u,120));return true}catch{return false}}function getComponentName(e){const t=e?.type;if(!t)return null;if(typeof t==="string")return t;return t.displayName||t.name||null}function getOwningComponentName(e){let t=e?._debugOwner||e?.return;let n=0;while(t&&n<30){n++;const r=getComponentName(t);if(r&&!INTERNAL_NAMES.has(r)&&typeof t.type!=="string"){return r}t=t.return}return null}function getProps(e){return(0,_utils.getDOMControlProps)(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}function flattenText(e,t=0){if(typeof e==="string")return e;if(typeof e==="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){const n=[];for(const r of e){const i=flattenText(r,t+1);if(i)n.push(i)}return n.length>0?n.join(""):void 0}return void 0}function normalizeVisibleText(e){return e.replace(/\s+/g," ").trim()}function getVisibleText(e){if(!e)return void 0;const t=n=>{const r=flattenText(n);if(r===void 0)return void 0;const i=normalizeVisibleText(r);return i?fullVisibleText?i:i.slice(0,80):void 0};return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}function collectDescendantText(e,t){const n=[];const r=(s,a)=>{if(!s||a>t||n.length>=4)return;if(s!==e){const u=getProps(s);if(u&&(typeof u.onPress==="function"||typeof u.onLongPress==="function"))return}const o=getVisibleText(getProps(s));if(o&&!n.includes(o))n.push(o);if(s.child)r(s.child,a+1);if(s!==e&&s.sibling)r(s.sibling,a)};if(e.child)r(e.child,1);const i=n.join(" ").trim();return i?i.slice(0,80):void 0}function findPressHandler(e){let t=e;let n=0;let r=null;let i=null;while(t&&n<25&&!(r&&i)){const s=getProps(t);if(s){if(!r&&typeof s.onPress==="function")r=s.onPress;if(!i&&typeof s.onLongPress==="function")i=s.onLongPress}t=t.return;n++}if(r)return{handler:r,kind:"onPress",longPress:i??void 0};return i?{handler:i,kind:"onLongPress"}:null}function measureInstance(e){return new Promise(t=>{let n=false;const r=i=>{if(n)return;n=true;t(i)};setTimeout(()=>r(null),1e3);try{if(typeof e.measureInWindow==="function"){e.measureInWindow((i,s,a,o)=>{if(a>0&&o>0)r({x:i,y:s,width:a,height:o});else r(null)})}else if(typeof e.measure==="function"){e.measure((i,s,a,o,u,l)=>{if(a>0&&o>0&&u!=null&&l!=null){r({x:u,y:l,width:a,height:o})}else{r(null)}})}else{r(null)}}catch{r(null)}})}const SPINNER_HOSTS=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function collectCandidates(){const e=getAllFiberRoots();const t=[];const n=new Map;const r=new Map;const i=makeChromeCheck();for(const s of e){traverseFiberTree(s.current,a=>{const o=getProps(a);if(!o)return;const u=typeof o.onPress==="function"||typeof o.onLongPress==="function";const l=typeof o.onValueChange==="function";const c=typeof o.onChangeText==="function";const d=o.testID||void 0;const g=o.accessibilityLabel||void 0;const m=o.accessibilityRole||o.role||void 0;let w=getVisibleText(o);const y=m==="button"||m==="link"||m==="menuitem"||m==="tab"||m==="switch"||m==="checkbox";const b=typeof a.type==="string"&&SPINNER_HOSTS.has(a.type)&&o.animating!==false;if(!u&&!l&&!c&&!d&&!g&&!w&&!y&&!b){return}let x=null;let N=null;let I=null;if(l){const D=o.value;const S=typeof D==="number"||typeof o.minimumValue==="number";N={handler:o.onValueChange,kind:S?"slider":"toggle",current:D,min:typeof o.minimumValue==="number"?o.minimumValue:void 0,max:typeof o.maximumValue==="number"?o.maximumValue:void 0}}else if(c){I={handler:o.onChangeText,current:typeof o.value==="string"?o.value:void 0}}else{x=findPressHandler(a)}const C=getComponentName(a);let f=C??"Unknown";if(!C||INTERNAL_NAMES.has(C)||typeof a.type==="string"){f=getOwningComponentName(a)??C??"Unknown"}const h=findHostInstance(a);if(!h&&!d)return;if(!w&&!g&&u){w=collectDescendantText(a,6)}const p=h?.instance??null;const T=h?.nativeTag??null;const v=(p?n.get(p):void 0)??(T!=null?r.get(T):void 0);if(v){if(x)v.press=x;if(!v.valueControl&&N)v.valueControl=N;if(!v.textControl&&I)v.textControl=I;if(!v.testID&&d)v.testID=d;if(!v.label&&g)v.label=g;if(!v.text&&w)v.text=w;if(p&&!n.has(p))n.set(p,v);if(T!=null&&!r.has(T))r.set(T,v);return}const P={nativeTag:T,name:f,role:m??(b?"progressbar":void 0),testID:d,label:g,text:w,instance:p,stateNode:h?.stateNode??null,fiber:a,press:x,valueControl:N,textControl:I,rect:null,buoy:i(a)};t.push(P);if(p)n.set(p,P);if(T!=null)r.set(T,P)})}t.push(...collectDOMCandidates());return t}function collectDOMCandidates(){return(0,_domScreenElements.collectDOMElements)({fullText:fullVisibleText}).map(({element:e,props:t,text:n,buoy:r})=>{const i=typeof t.onValueChange==="function"?{handler:t.onValueChange,kind:typeof t.value==="number"?"slider":"toggle",current:t.value,min:t.minimumValue,max:t.maximumValue}:null;const s=!i&&typeof t.onChangeText==="function"?{handler:t.onChangeText,current:t.value}:null;const a=!i&&!s&&typeof t.onPress==="function"?{handler:t.onPress,kind:"onPress"}:null;return{nativeTag:(0,_utils.getDOMNodeHandle)(e),name:(0,_domScreenElements.domElementName)(e),role:t.accessibilityRole,testID:t.testID,label:t.accessibilityLabel,text:n,instance:(0,_utils.getDOMPublicInstance)(e),stateNode:e,fiber:null,buoy:r,press:a,valueControl:i,textControl:s,rect:null}})}function explicitlyTargets(e,t){if(t.nativeTag!=null)return e.nativeTag===t.nativeTag;if(t.testID&&e.testID)return e.testID.toLowerCase()===t.testID.toLowerCase();return false}function appCandidates(e){const t=collectCandidates();if(e.includeBuoy)return t;return t.filter(n=>!n.buoy||explicitlyTargets(n,e))}async function measureCandidates(e){await Promise.all(e.map(async t=>{if(t.instance)t.rect=await measureInstance(t.instance)}))}const LIST_WRAPPERS=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function collectLists(e,t){const n=[];const r=makeChromeCheck();for(const s of getAllFiberRoots()){traverseFiberTree(s.current,a=>{if(getComponentName(a)!=="VirtualizedList")return;const o=a.memoizedProps;if(!o||typeof o.getItemCount!=="function")return;if(!e&&r(a))return;let u;try{u=Number(o.getItemCount(o.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;const l=[];const c=(m,w)=>{for(let y=m?.child;y;y=y.sibling){const b=getComponentName(y);if(b==="VirtualizedList")continue;if(b==="CellRenderer"){l.push(y);continue}if(w<40)c(y,w+1)}};c(a,0);let d=a;let g=getOwningComponentName(d);for(let m=0;m<6&&g&&LIST_WRAPPERS.test(g);m++){d=d._debugOwner||d.return;g=getOwningComponentName(d)}n.push({owner:g,items:u,cells:l})})}const i=[];for(const s of n){const a=await Promise.all(s.cells.map(async u=>{const l=findHostInstance(u);return l?measureInstance(l.instance):null}));const o=a.filter(t).length;if(o>0&&s.items>o)i.push({owner:s.owner,items:s.items,listed:o})}return i}async function describeScreen(e={}){const t=includeHiddenScreens;const n=fullVisibleText;includeHiddenScreens=!!e.includeHidden;fullVisibleText=!!e.fullText;try{return await describeScreenInner(e)}finally{includeHiddenScreens=t;fullVisibleText=n}}async function describeScreenInner(e){prunedHiddenScreens=0;const t=collectCandidates();const n=prunedHiddenScreens;const r=e.includeBuoy?t:t.filter(c=>!c.buoy);const i=t.length-r.length;await measureCandidates(r);const s=_reactNative.Dimensions.get("window");const a=Math.round(s.width)||1;const o=Math.round(s.height)||1;const u=[];for(const c of r){const d=c.rect;if(!d&&!c.testID)continue;let g;let m;if(d){const b=d.x+d.width/2;const x=d.y+d.height/2;if(x<-o*.1||x>o*1.1||b<-a*.1||b>a*1.1){continue}g={x:round2(b/a),y:round2(x/o)};m={x:round2(d.x/a),y:round2(d.y/o),width:round2(d.width/a),height:round2(d.height/o)}}const w=c.valueControl?c.valueControl.kind:c.textControl?"text":void 0;const y=c.valueControl?c.valueControl.current:c.textControl?.current;u.push({nativeTag:c.nativeTag,name:c.name,role:c.role,testID:c.testID,label:c.label,text:c.text,interactive:!!(c.press||c.valueControl||c.textControl),longPressable:c.press&&(c.press.kind==="onLongPress"||c.press.longPress)?true:void 0,control:w,value:y,tap:g,frame:m,...c.buoy?{buoy:true}:{}})}u.sort((c,d)=>{const g=c.tap?.y??2;const m=d.tap?.y??2;if(Math.abs(g-m)>.02)return g-m;return(c.tap?.x??2)-(d.tap?.x??2)});const l=await collectLists(!!e.includeBuoy,c=>{if(!c)return false;const d=c.x+c.width/2;return c.y<=o*1.1&&c.y+c.height>=-o*.1&&d>=-a*.1&&d<=a*1.1});return{screen:{width:a,height:o},count:u.length,elements:u,...i>0?{hiddenBuoy:i}:{},...n>0?{hiddenScreens:n}:{},...l.length?{lists:l}:{}}}function round2(e){return Math.round(e*100)/100}function fieldsOf(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}function matchScore(e,t){return(0,_tapMatch.scoreTapMatch)(fieldsOf(e),t)}function tapPoint(e,t,n){if(!e||!t||!n)return void 0;return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}function makeSyntheticPressEvent(e){const t=e?e.x+e.width/2:0;const n=e?e.y+e.height/2:0;const r={locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]};return{nativeEvent:r,persist:()=>{},preventDefault:()=>{},stopPropagation:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,target:null,currentTarget:null,type:"press",timeStamp:0}}async function tapElement(e){const t=withHiddenScreens(!!e.includeHidden,()=>appCandidates(e));if(t.length===0){return{tapped:false,reason:"Nothing on screen to tap: no React elements and no page elements were found."}}const n=t.map(f=>({c:f,score:matchScore(f,e)})).filter(f=>f.score>0).sort((f,h)=>h.score-f.score);const r=f=>!!(f.press||f.valueControl||f.textControl);if(n.length===0&&!e.includeHidden){const f=withHiddenScreens(true,()=>appCandidates(e)).map(h=>({c:h,score:matchScore(h,e)})).filter(h=>h.score>0);if(f.length>0){return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."}}}if(n.length===0){return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(r).slice(0,12).map(f=>({nativeTag:f.nativeTag,name:f.name,testID:f.testID,text:f.text}))}}const i=_reactNative.Dimensions.get("window");const s=i.width||1;const a=i.height||1;const o=n.slice(0,15);await Promise.all(o.map(async f=>{if(f.c.instance&&!f.c.rect)f.c.rect=await measureInstance(f.c.instance)}));for(const f of o){f.score=(0,_tapMatch.scoreTapMatch)({...fieldsOf(f.c),tap:tapPoint(f.c.rect,s,a)},e)}o.sort((f,h)=>h.score-f.score);if(e.text!==void 0){for(const f of o){const h=!r(f.c)&&(0,_utils.isDOMElement)(f.c.stateNode)?(0,_domScreenElements.labeledField)(f.c.stateNode):null;const p=h?t.find(T=>T.stateNode===h&&T.textControl):void 0;if(p)f.c=p}}const u=o.find(f=>r(f.c))??n.find(f=>r(f.c))??o[0];const l=u.c;const c=(f,h)=>f.press&&f.press.handler===h.press?.handler||f.valueControl&&f.valueControl.handler===h.valueControl?.handler||f.textControl&&f.textControl.handler===h.textControl?.handler;const d=o.filter(f=>f!==u&&r(f.c)&&f.score===u.score).filter(f=>!c(f.c,l)).filter((f,h,p)=>p.findIndex(T=>c(T.c,f.c))===h).slice(0,3).map(f=>({nativeTag:f.c.nativeTag,name:f.c.name,testID:f.c.testID,text:f.c.text,tap:tapPoint(f.c.rect,s,a)}));const g=e.nativeTag==null&&!(e.testID&&!e.query);if(g&&d.length>0){const f=[l,...d.map(h=>o.find(p=>p.c.nativeTag===h.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${f.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:f.map(h=>({nativeTag:h.nativeTag,name:h.name,testID:h.testID,text:h.text}))}}const m=o[0];if(g&&m&&m!==u&&!r(m.c)&&m.score>=90&&u.score<m.score-40){return{tapped:false,reason:`The best match for "${e.query}" is "${m.c.text??m.c.label??m.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${l.text??l.label??l.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:l.nativeTag,name:l.name,testID:l.testID,text:l.text}]}}if(!r(l)){return{tapped:false,reason:(0,_utils.isDOMElement)(l.stateNode)?`Matched "${l.name}"${l.text?` ("${l.text}")`:""}, but it is not a button or a field. This element can't be driven in JS.`:`Matched "${l.name}"${l.text?` ("${l.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:l.nativeTag,name:l.name,testID:l.testID,label:l.label,text:l.text,via:"onPress"}}}if(l.instance&&!l.rect)l.rect=await measureInstance(l.instance);let w=false;const y=l.rect==null||!(0,_tapMatch.isRectCenterOnScreen)(l.rect,s,a);if(y&&e.scrollIntoView!==false&&l.instance){w=await scrollIntoView(l.fiber,l.instance,l.stateNode,80);if(w)l.rect=await measureInstance(l.instance)}const b={nativeTag:l.nativeTag,name:l.name,testID:l.testID,label:l.label,text:l.text};ensureCommitCounter();const x=commitCount;const N=l.fiber===null&&(0,_utils.isDOMElement)(l.stateNode)?(0,_domScreenElements.watchDOMChanges)():null;const I=Date.now();const C=async f=>{await new Promise(h=>setTimeout(h,TAP_SETTLE_MS));return{tapped:true,scrolled:w,matched:f,effect:{commits:N?N():commitCount-x,observedMs:Date.now()-I},...d.length?{alsoMatched:d}:{}}};try{if(l.press){if(e.longPress){const h=l.press.kind==="onLongPress"?l.press.handler:l.press.longPress;if(!h){return{tapped:false,scrolled:w,reason:`Matched "${l.name}"${l.text?` ("${l.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...b,via:"onPress"}}}h(makeSyntheticPressEvent(l.rect));return await C({...b,via:"onLongPress"})}l.press.handler(makeSyntheticPressEvent(l.rect));return await C({...b,via:l.press.kind})}if(l.valueControl){const h=l.valueControl;let p;if(h.kind==="toggle"){p=typeof e.value==="boolean"?e.value:!h.current}else{const T=h.min??0;const v=h.max??1;if(typeof e.value==="number"){p=Math.min(v,Math.max(T,e.value))}else{p=h.current===v?T:v}}h.handler(p);return await C({...b,via:"onValueChange",value:p})}const f=e.text??(typeof e.value==="string"?e.value:"");l.textControl.handler(f);return await C({...b,via:"onChangeText",value:f})}catch(f){N?.();return{tapped:false,scrolled:w,reason:`handler threw: ${f instanceof Error?f.message:String(f)}`,matched:{...b,via:l.press?l.press.kind:l.valueControl?"onValueChange":"onChangeText"}}}}const WAIT_DEFAULT_MS=5e3;const WAIT_MAX_MS=3e4;const WAIT_MIN_POLL_MS=50;const WAIT_DEFAULT_POLL_MS=150;async function waitFor(e){const t=e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim();if(!t){return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."}}const n=Math.min(Math.max(e.timeoutMs??WAIT_DEFAULT_MS,0),WAIT_MAX_MS);const r=Math.max(e.pollMs??WAIT_DEFAULT_POLL_MS,WAIT_MIN_POLL_MS);const i=e.gone===true;const s=Date.now();let a=0;for(;;){a+=1;const{hit:o,closest:u}=await findOnScreen(e);if(i?!o:!!o){return{ok:true,waitedMs:Date.now()-s,polls:a,matched:o??void 0}}if(Date.now()-s>=n){const l=u?.length?u:void 0;const c=i?`Still on screen after ${n}ms.`:l?`Not on screen after ${n}ms \u2014 ${l.length===1?"one element":`${l.length} elements`} matched but ${l.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${n}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-s,polls:a,reason:c,matched:o??void 0,closest:l}}await new Promise(l=>setTimeout(l,r))}}async function findOnScreen(e){const t=appCandidates(e).map(o=>({c:o,score:matchScore(o,e)})).filter(o=>o.score>0).sort((o,u)=>u.score-o.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await measureCandidates(t.map(o=>o.c));const n=_reactNative.Dimensions.get("window");const r=Math.round(n.width)||1;const i=Math.round(n.height)||1;let s=null;for(const{c:o}of t){if(!(0,_tapMatch.isRectCenterOnScreen)(o.rect,r,i))continue;s={nativeTag:o.nativeTag,name:o.name,testID:o.testID,label:o.label,text:o.text,interactive:!!(o.press||o.valueControl||o.textControl)};break}const a=t.slice(0,3).map(({c:o})=>({name:o.name,testID:o.testID,text:o.text,onScreen:(0,_tapMatch.isRectCenterOnScreen)(o.rect,r,i)}));return{hit:s,closest:a}}function isBuoyChrome(e){let t=e;let n=0;while(t&&n<400){if(getProps(t)?.__buoyDevToolsRoot)return true;t=t.return;n++}return false}function preferHandlerOwner(e,t){const n=getProps(e.fiber);if(typeof n?.onPress==="function"||typeof n?.onValueChange==="function"||typeof n?.onChangeText==="function"){return e}let r=null;let i=e.fiber?.return;let s=0;while(i&&s<25){if(typeof getProps(i)?.onPress==="function"){r=i;break}i=i.return;s++}if(!r)return e;let a=r;for(let o=0;o<6&&a;o++){const u=t.get(a);if(u)return u;a=a.return}return e}function resolveTouchTarget(e){const t=collectCandidates();if(t.length===0)return null;const n=new Map;for(const a of t)n.set(a.fiber,a);const r=t.find(a=>a.nativeTag===e);let i=null;if(!r){for(const a of getAllFiberRoots()){traverseFiberTree(a.current,o=>{if(i)return;if(o.stateNode&&getNativeTag(o.stateNode)===e){i=o}});if(i)break}}let s=r??null;if(!s&&i){let a=i;let o=0;let u=null;while(a&&o<25){const l=n.get(a);if(l){if(l.press||l.valueControl||l.textControl){s=l;break}if(!u)u=l}a=a.return;o++}if(!s)s=u}if(!s?.fiber&&!i){const a=s?.stateNode;const o=(0,_utils.isDOMElement)(a)?a:domElementForTag(e);if(o){for(let u=o;u;u=u.parentElement){const l=t.find(c=>c.stateNode===u&&(c.press||c.valueControl||c.textControl));if(l)return l.buoy?null:touchTargetOf(l)}return null}}if(!s)return null;s=preferHandlerOwner(s,n);if(!s.press&&!s.valueControl&&!s.textControl)return null;if(isBuoyChrome(s.fiber))return null;return touchTargetOf(s)}function domElementForTag(e){const t=global.document;if(!t?.querySelectorAll)return null;return Array.from(t.querySelectorAll("*")).find(n=>(0,_utils.getDOMNodeHandle)(n)===e)??null}function touchTargetOf(e){return{nativeTag:e.nativeTag,name:e.name,role:e.role,testID:e.testID,label:e.label,text:e.text,control:e.valueControl?e.valueControl.kind:e.textControl?"text":"press",value:e.valueControl?e.valueControl.current:e.textControl?.current}}function fiberForTag(e){let t=null;for(const n of getAllFiberRoots()){traverseFiberTree(n.current,r=>{if(!t&&r.stateNode&&getNativeTag(r.stateNode)===e)t=r});if(t)break}return t}function rootHostFibers(){const e=[];for(const t of getAllFiberRoots()){let n=t.current?.child;let r=0;while(n&&r++<200){if(n.tag===HostComponent&&n.stateNode){e.push(n);break}n=n.child}}return e}function fabricFiberAt(e,t){const n=global.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!=="function")return null;const r=rootHostFibers().filter(i=>i.stateNode?.node);if(!r.length)return null;return new Promise(i=>{const s=setTimeout(()=>i(null),1e3);let a=r.length;let o=null;r.forEach((u,l)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,c=>{if(c&&(!o||l>=o.i))o={i:l,fiber:c};if(--a===0){clearTimeout(s);i(o?.fiber??null)}})}catch{if(--a===0){clearTimeout(s);i(o?.fiber??null)}}})})}function paperFiberAt(e,t){const n=_reactNative.UIManager?.findSubviewIn;if(typeof n!=="function")return null;const r=rootHostFibers()[0];const i=r?getNativeTag(r.stateNode)??(0,_reactNative.findNodeHandle)(r.stateNode):null;if(i==null)return null;return new Promise(s=>{const a=setTimeout(()=>s(null),1e3);try{n.call(_reactNative.UIManager,i,[e,t],o=>{clearTimeout(a);s(typeof o==="number"?fiberForTag(o):null)})}catch{clearTimeout(a);s(null)}})}function visibleHostFibers(){const e=[];const t=new Set;const n=i=>{const s=[];const a=(o,u)=>{for(let l=o;l&&s.length<5e3;l=l.sibling){if(t.has(l)||u>500)continue;if(isHiddenOffscreen(l)||isInactiveScreen(l))continue;if(l.tag===HostComponent&&l.stateNode)s.push(l);else if(l.child)a(l.child,u+1)}};if(i.child)a(i.child,0);return s};const r=(i,s)=>{if(t.has(i)||s>500)return;t.add(i);e.push(i);sortByZ(n(i)).forEach(a=>r(a,s+1))};for(const i of getAllFiberRoots())sortByZ(n(i.current)).forEach(s=>r(s,0));return e}function sortByZ(e){const t=e.map(n=>{const r=Number(flatStyle(getProps(n)?.style).zIndex);return Number.isFinite(r)?r:0});return e.map((n,r)=>({h:n,i:r})).sort((n,r)=>t[n.i]-t[r.i]||n.i-r.i).map(({h:n})=>n)}function flatStyle(e,t=0){if(!e||typeof e!=="object"||t>10)return{};if(Array.isArray(e))return Object.assign({},...e.map(n=>flatStyle(n,t+1)));return e}const SCROLL_HOSTS=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function clipsChildren(e){if(typeof e.type==="string"&&SCROLL_HOSTS.has(e.type)&&e.type!=="RCTScrollContentView")return true;const t=flatStyle(getProps(e)?.style).overflow;return t==="hidden"||t==="scroll"}function passesTouchesThrough(e){let t=getProps(e)?.pointerEvents??getProps(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return;let r=0;while(n&&r++<200){const i=getProps(n)?.pointerEvents??getProps(n)?.style?.pointerEvents;if(i==="none")return"all";if(i==="box-only"&&n.tag===HostComponent)return"all";n=n.return}return t==="box-none"?"self":null}async function measuredFiberAt(e,t,n){const r=await Promise.all(n.map(o=>{const u=getPublicInstance(o.stateNode);return u?measureInstance(u):Promise.resolve(null)}));const i=new Map;n.forEach((o,u)=>i.set(o,r[u]));const s=o=>!!o&&e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height;const a=o=>{for(let u=o.return,l=0;u&&l<300;u=u.return,l++){if(u.tag===HostComponent&&i.has(u)&&clipsChildren(u)&&!s(i.get(u)))return true}return false};for(let o=n.length-1;o>=0;o--){if(!s(r[o])||passesTouchesThrough(n[o])||a(n[o]))continue;return n[o]}return null}function domFiberAt(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;let i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);while(i){const s=Object.keys(i).find(a=>a.startsWith("__reactFiber$"));if(s)return i[s];i=i.parentElement}return null}function domPageHit(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;const i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);if(!i)return null;for(let c=i;c;c=c.parentElement){if(Object.keys(c).some(d=>d.startsWith("__reactFiber$")||d.startsWith("__reactContainer$")))return null}const s=!!i.closest("[data-buoy-root], [data-buoy-portal-host]");const a=collectDOMCandidates();const o=a.find(c=>c.stateNode===i);let u;for(let c=i;c&&!u;c=c.parentElement){u=a.find(d=>d.stateNode===c&&(d.press||d.valueControl||d.textControl))}const l=[];for(let c=i;c&&l.length<6;c=c.parentElement){const d=(0,_domScreenElements.domElementName)(c);if(d!==c.tagName.toLowerCase()&&l[l.length-1]!==d)l.push(d)}return{found:true,method:"dom",buoy:s,view:{name:(0,_domScreenElements.domElementName)(i),nativeTag:(0,_utils.getDOMNodeHandle)(i),testID:o?.testID,label:o?.label,text:o?.text},path:l,target:u&&!s?touchTargetOf(u):null}}async function hitTest(e){const t=Math.min(1,Math.max(0,Number(e?.x)));const n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};const r=_reactNative.Dimensions.get("window");const i=t*r.width;const s=n*r.height;let a="none";let o=null;const u=domFiberAt(t,n);const l=u?null:domPageHit(t,n);if(l)return l;if(u){a="dom";o=u}else{const y=fabricFiberAt(i,s);if(y){a="fabric";o=await y}else{const x=paperFiberAt(i,s);if(x){a="paper";o=await x}}const b=visibleHostFibers();if(!o||!new Set(b).has(o)){o=await measuredFiberAt(i,s,b);a="measured"}}if(!o)return{found:false,method:a};const c=getProps(o)??{};const d=getNativeTag(o.stateNode);const g=[];let m=o;let w=0;while(m&&w++<80&&g.length<6){const y=getComponentName(m);if(y&&typeof m.type!=="string"&&!INTERNAL_NAMES.has(y)&&g[g.length-1]!==y)g.push(y);m=m.return}return{found:true,method:a,buoy:isBuoyChrome(o),view:{name:getComponentName(o)??"Unknown",nativeTag:d,testID:c.testID||void 0,label:c.accessibilityLabel||c["aria-label"]||void 0,text:getVisibleText(c)},path:g,target:d!=null?resolveTouchTarget(d):null}}async function readMaps(){const e=[];for(const i of getAllFiberRoots()){traverseFiberTree(i.current,s=>{const a=s.stateNode;if(s.tag===1&&a&&typeof a.getCamera==="function"&&!isBuoyChrome(s))e.push(s)})}const t=_reactNative.Dimensions.get("window");const n=i=>Promise.race([i,new Promise(s=>setTimeout(()=>s(null),1e3))]);const r=await Promise.all(e.slice(0,5).map(async i=>{try{const s=await n(Promise.resolve(i.stateNode.getCamera()));if(!s)return null;const a=findHostInstance(i);const o=a?await measureInstance(a.instance):null;const u=getProps(i)??{};return{name:getComponentName(i)??"Map",testID:typeof u.testID==="string"?u.testID:void 0,frame:o&&t.width&&t.height?{x:round2(o.x/t.width),y:round2(o.y/t.height),width:round2(o.width/t.width),height:round2(o.height/t.height)}:void 0,camera:{heading:typeof s.heading==="number"?s.heading:void 0,pitch:typeof s.pitch==="number"?s.pitch:void 0,altitude:typeof s.altitude==="number"?s.altitude:void 0,zoom:typeof s.zoom==="number"?s.zoom:void 0,center:s.center}}}catch{return null}}));return{maps:r.filter(i=>!!i)}}
@@ -1 +1 @@
1
- "use strict";import{getDOMControlProps as Te,getDOMNodeHandle as R,getDOMPublicInstance as re,isDOMElement as F}from"@buoy-gg/shared-ui/utils";import{Dimensions as L,UIManager as $,findNodeHandle as z}from"react-native";import{isRectCenterOnScreen as W,scoreTapMatch as ie}from"./tapMatch";import{collectDOMElements as xe,domElementName as B,labeledField as Ce,watchDOMChanges as Pe}from"./domScreenElements";const O=5;const Ie=22;const q=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function le(){if(typeof global==="undefined")return null;return global.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}let U=0;let se=false;function Ne(){if(se)return;const e=le();if(!e)return;const t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){U++;return typeof t==="function"?t.apply(e,n):void 0};se=true}const Se=250;function ae(){const e=new Map;return t=>{const n=[];let r=t;let i=0;let s=false;while(r&&i<400){const a=e.get(r);if(a!==void 0){s=a;break}if(x(r)?.__buoyDevToolsRoot){s=true;e.set(r,true);break}n.push(r);r=r.return;i++}for(const a of n)e.set(a,s);return s}}function D(){const e=le();if(!e)return[];const t=[];try{if(e.renderers&&typeof e.renderers.forEach==="function"){e.renderers.forEach((n,r)=>{try{const i=e.getFiberRoots?.(r);if(i)i.forEach(s=>t.push(s))}catch{}})}if(t.length===0&&e.getFiberRoots){const n=e.getFiberRoots(1);if(n)n.forEach(r=>t.push(r))}}catch{}return t}function ue(e){return e.tag===Ie&&e.memoizedState!==null}let _=false;let j=0;let E=false;function ce(e,t){const n=_;_=e;try{return t()}finally{_=n}}function De(e){const t=e.memoizedProps;if(!t)return false;if(t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t))return true;if(t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t))return true;return false}function fe(e){const t=e.memoizedProps?.activityState;if(t===0||t===1)return true;if(e.memoizedProps?.isPageFocused===false)return true;if(!_&&De(e)){j++;return true}return false}function S(e,t,n=0,r=new Set){if(!e||r.has(e)||n>500)return;r.add(e);if(ue(e)||fe(e)){if(e.sibling)S(e.sibling,t,n,r);return}t(e);if(e.child)S(e.child,t,n+1,r);if(e.sibling)S(e.sibling,t,n,r)}function G(e){const t=re(e);if(t)return t;if(!e)return null;const n=e;if(n.canonical?.publicInstance)return n.canonical.publicInstance;if(n.canonical&&typeof n.canonical.measure==="function"){return n.canonical}if(typeof n.measure==="function"||typeof n.measureInWindow==="function"){return n}return null}function A(e){const t=R(e);if(t!==null)return t;if(e==null)return null;const n=e;if(typeof n.__nativeTag==="number")return n.__nativeTag;if(typeof n._nativeTag==="number")return n._nativeTag;if(typeof n.nativeTag==="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag==="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag==="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag==="number")return n.canonical.nativeTag}return null}function J(e){const t=G(e.stateNode);if(t){return{instance:t,nativeTag:A(e.stateNode),stateNode:e.stateNode}}const n=[];if(e.child)n.push(e.child);let r=0;while(n.length>0&&r<4e3){r++;const i=n.pop();if(!i)continue;const s=G(i.stateNode);if(s)return{instance:s,nativeTag:A(i.stateNode),stateNode:i.stateNode};if(i.child)n.push(i.child);if(i.sibling)n.push(i.sibling)}return null}function _e(e){let t=e;let n=0;while(t&&n++<200){const r=t.stateNode;if(r&&typeof r.scrollTo==="function"){const i=typeof r.getNativeScrollRef==="function"&&r.getNativeScrollRef()||null;const s=typeof r.getInnerViewNode==="function"&&r.getInnerViewNode()||typeof r.getScrollableNode==="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:i,innerNode:s}}t=t.return}return null}async function Me(e,t,n,r){try{if(F(n)){n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"});await new Promise(u=>setTimeout(u,16));return true}const i=_e(e);if(!i)return false;const s=t;let a=null;const o=u=>new Promise(l=>{let c=false;const d=m=>{if(c)return;c=true;l(m)};const g=setTimeout(()=>d(null),600);try{u(m=>{clearTimeout(g);d(m)})}catch{clearTimeout(g);d(null)}});if(i.nativeRef&&typeof s.measureLayout==="function"){a=await o(u=>s.measureLayout(i.nativeRef,(l,c)=>u(c),()=>u(null)))}if(a==null){const u=z(t);const l=typeof i.innerNode==="number"?i.innerNode:z(i.innerNode);if(u!=null&&l!=null){a=await o(c=>$.measureLayout(u,l,()=>c(null),(d,g)=>c(g)))}}if(a==null)return false;i.instance.scrollTo({y:Math.max(0,a-r),animated:false});await new Promise(u=>setTimeout(u,120));return true}catch{return false}}function M(e){const t=e?.type;if(!t)return null;if(typeof t==="string")return t;return t.displayName||t.name||null}function K(e){let t=e?._debugOwner||e?.return;let n=0;while(t&&n<30){n++;const r=M(t);if(r&&!q.has(r)&&typeof t.type!=="string"){return r}t=t.return}return null}function x(e){return Te(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}function de(e,t=0){if(typeof e==="string")return e;if(typeof e==="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){const n=[];for(const r of e){const i=de(r,t+1);if(i)n.push(i)}return n.length>0?n.join(""):void 0}return void 0}function ke(e){return e.replace(/\s+/g," ").trim()}function X(e){if(!e)return void 0;const t=n=>{const r=de(n);if(r===void 0)return void 0;const i=ke(r);return i?E?i:i.slice(0,80):void 0};return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}function Ve(e,t){const n=[];const r=(s,a)=>{if(!s||a>t||n.length>=4)return;if(s!==e){const u=x(s);if(u&&(typeof u.onPress==="function"||typeof u.onLongPress==="function"))return}const o=X(x(s));if(o&&!n.includes(o))n.push(o);if(s.child)r(s.child,a+1);if(s!==e&&s.sibling)r(s.sibling,a)};if(e.child)r(e.child,1);const i=n.join(" ").trim();return i?i.slice(0,80):void 0}function Ae(e){let t=e;let n=0;let r=null;let i=null;while(t&&n<25&&!(r&&i)){const s=x(t);if(s){if(!r&&typeof s.onPress==="function")r=s.onPress;if(!i&&typeof s.onLongPress==="function")i=s.onLongPress}t=t.return;n++}if(r)return{handler:r,kind:"onPress",longPress:i??void 0};return i?{handler:i,kind:"onLongPress"}:null}function k(e){return new Promise(t=>{let n=false;const r=i=>{if(n)return;n=true;t(i)};setTimeout(()=>r(null),1e3);try{if(typeof e.measureInWindow==="function"){e.measureInWindow((i,s,a,o)=>{if(a>0&&o>0)r({x:i,y:s,width:a,height:o});else r(null)})}else if(typeof e.measure==="function"){e.measure((i,s,a,o,u,l)=>{if(a>0&&o>0&&u!=null&&l!=null){r({x:u,y:l,width:a,height:o})}else{r(null)}})}else{r(null)}}catch{r(null)}})}const Fe=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function Y(){const e=D();const t=[];const n=new Map;const r=new Map;const i=ae();for(const s of e){S(s.current,a=>{const o=x(a);if(!o)return;const u=typeof o.onPress==="function"||typeof o.onLongPress==="function";const l=typeof o.onValueChange==="function";const c=typeof o.onChangeText==="function";const d=o.testID||void 0;const g=o.accessibilityLabel||void 0;const m=o.accessibilityRole||o.role||void 0;let b=X(o);const w=m==="button"||m==="link"||m==="menuitem"||m==="tab"||m==="switch"||m==="checkbox";const v=typeof a.type==="string"&&Fe.has(a.type)&&o.animating!==false;if(!u&&!l&&!c&&!d&&!g&&!b&&!w&&!v){return}let C=null;let N=null;let V=null;if(l){const oe=o.value;const ve=typeof oe==="number"||typeof o.minimumValue==="number";N={handler:o.onValueChange,kind:ve?"slider":"toggle",current:oe,min:typeof o.minimumValue==="number"?o.minimumValue:void 0,max:typeof o.maximumValue==="number"?o.maximumValue:void 0}}else if(c){V={handler:o.onChangeText,current:typeof o.value==="string"?o.value:void 0}}else{C=Ae(a)}const I=M(a);let f=I??"Unknown";if(!I||q.has(I)||typeof a.type==="string"){f=K(a)??I??"Unknown"}const h=J(a);if(!h&&!d)return;if(!b&&!g&&u){b=Ve(a,6)}const y=h?.instance??null;const T=h?.nativeTag??null;const p=(y?n.get(y):void 0)??(T!=null?r.get(T):void 0);if(p){if(!p.press&&C)p.press=C;else if(p.press&&C?.longPress&&!p.press.longPress){p.press.longPress=C.longPress}if(!p.valueControl&&N)p.valueControl=N;if(!p.textControl&&V)p.textControl=V;if(!p.testID&&d)p.testID=d;if(!p.label&&g)p.label=g;if(!p.text&&b)p.text=b;if(y&&!n.has(y))n.set(y,p);if(T!=null&&!r.has(T))r.set(T,p);return}const H={nativeTag:T,name:f,role:m??(v?"progressbar":void 0),testID:d,label:g,text:b,instance:y,stateNode:h?.stateNode??null,fiber:a,press:C,valueControl:N,textControl:V,rect:null,buoy:i(a)};t.push(H);if(y)n.set(y,H);if(T!=null)r.set(T,H)})}t.push(...he());return t}function he(){return xe({fullText:E}).map(({element:e,props:t,text:n,buoy:r})=>{const i=typeof t.onValueChange==="function"?{handler:t.onValueChange,kind:typeof t.value==="number"?"slider":"toggle",current:t.value,min:t.minimumValue,max:t.maximumValue}:null;const s=!i&&typeof t.onChangeText==="function"?{handler:t.onChangeText,current:t.value}:null;const a=!i&&!s&&typeof t.onPress==="function"?{handler:t.onPress,kind:"onPress"}:null;return{nativeTag:R(e),name:B(e),role:t.accessibilityRole,testID:t.testID,label:t.accessibilityLabel,text:n,instance:re(e),stateNode:e,fiber:null,buoy:r,press:a,valueControl:i,textControl:s,rect:null}})}function Le(e,t){if(t.nativeTag!=null)return e.nativeTag===t.nativeTag;if(t.testID&&e.testID)return e.testID.toLowerCase()===t.testID.toLowerCase();return false}function Z(e){const t=Y();if(e.includeBuoy)return t;return t.filter(n=>!n.buoy||Le(n,e))}async function me(e){await Promise.all(e.map(async t=>{if(t.instance)t.rect=await k(t.instance)}))}const Ee=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function Re(e,t){const n=[];const r=ae();for(const s of D()){S(s.current,a=>{if(M(a)!=="VirtualizedList")return;const o=a.memoizedProps;if(!o||typeof o.getItemCount!=="function")return;if(!e&&r(a))return;let u;try{u=Number(o.getItemCount(o.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;const l=[];const c=(m,b)=>{for(let w=m?.child;w;w=w.sibling){const v=M(w);if(v==="VirtualizedList")continue;if(v==="CellRenderer"){l.push(w);continue}if(b<40)c(w,b+1)}};c(a,0);let d=a;let g=K(d);for(let m=0;m<6&&g&&Ee.test(g);m++){d=d._debugOwner||d.return;g=K(d)}n.push({owner:g,items:u,cells:l})})}const i=[];for(const s of n){const a=await Promise.all(s.cells.map(async u=>{const l=J(u);return l?k(l.instance):null}));const o=a.filter(t).length;if(o>0&&s.items>o)i.push({owner:s.owner,items:s.items,listed:o})}return i}export async function describeScreen(e={}){const t=_;const n=E;_=!!e.includeHidden;E=!!e.fullText;try{return await Oe(e)}finally{_=t;E=n}}async function Oe(e){j=0;const t=Y();const n=j;const r=e.includeBuoy?t:t.filter(c=>!c.buoy);const i=t.length-r.length;await me(r);const s=L.get("window");const a=Math.round(s.width)||1;const o=Math.round(s.height)||1;const u=[];for(const c of r){const d=c.rect;if(!d&&!c.testID)continue;let g;let m;if(d){const v=d.x+d.width/2;const C=d.y+d.height/2;if(C<-o*.1||C>o*1.1||v<-a*.1||v>a*1.1){continue}g={x:P(v/a),y:P(C/o)};m={x:P(d.x/a),y:P(d.y/o),width:P(d.width/a),height:P(d.height/o)}}const b=c.valueControl?c.valueControl.kind:c.textControl?"text":void 0;const w=c.valueControl?c.valueControl.current:c.textControl?.current;u.push({nativeTag:c.nativeTag,name:c.name,role:c.role,testID:c.testID,label:c.label,text:c.text,interactive:!!(c.press||c.valueControl||c.textControl),longPressable:c.press&&(c.press.kind==="onLongPress"||c.press.longPress)?true:void 0,control:b,value:w,tap:g,frame:m})}u.sort((c,d)=>{const g=c.tap?.y??2;const m=d.tap?.y??2;if(Math.abs(g-m)>.02)return g-m;return(c.tap?.x??2)-(d.tap?.x??2)});const l=await Re(!!e.includeBuoy,c=>{if(!c)return false;const d=c.x+c.width/2;return c.y<=o*1.1&&c.y+c.height>=-o*.1&&d>=-a*.1&&d<=a*1.1});return{screen:{width:a,height:o},count:u.length,elements:u,...i>0?{hiddenBuoy:i}:{},...n>0?{hiddenScreens:n}:{},...l.length?{lists:l}:{}}}function P(e){return Math.round(e*100)/100}function ge(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}function Q(e,t){return ie(ge(e),t)}function pe(e,t,n){if(!e||!t||!n)return void 0;return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}function ye(e){const t=e?e.x+e.width/2:0;const n=e?e.y+e.height/2:0;const r={locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]};return{nativeEvent:r,persist:()=>{},preventDefault:()=>{},stopPropagation:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,target:null,currentTarget:null,type:"press",timeStamp:0}}export async function tapElement(e){const t=ce(!!e.includeHidden,()=>Z(e));if(t.length===0){return{tapped:false,reason:"Nothing on screen to tap: no React elements and no page elements were found."}}const n=t.map(f=>({c:f,score:Q(f,e)})).filter(f=>f.score>0).sort((f,h)=>h.score-f.score);const r=f=>!!(f.press||f.valueControl||f.textControl);if(n.length===0&&!e.includeHidden){const f=ce(true,()=>Z(e)).map(h=>({c:h,score:Q(h,e)})).filter(h=>h.score>0);if(f.length>0){return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."}}}if(n.length===0){return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(r).slice(0,12).map(f=>({nativeTag:f.nativeTag,name:f.name,testID:f.testID,text:f.text}))}}const i=L.get("window");const s=i.width||1;const a=i.height||1;const o=n.slice(0,15);await Promise.all(o.map(async f=>{if(f.c.instance&&!f.c.rect)f.c.rect=await k(f.c.instance)}));for(const f of o){f.score=ie({...ge(f.c),tap:pe(f.c.rect,s,a)},e)}o.sort((f,h)=>h.score-f.score);if(e.text!==void 0){for(const f of o){const h=!r(f.c)&&F(f.c.stateNode)?Ce(f.c.stateNode):null;const y=h?t.find(T=>T.stateNode===h&&T.textControl):void 0;if(y)f.c=y}}const u=o.find(f=>r(f.c))??n.find(f=>r(f.c))??o[0];const l=u.c;const c=(f,h)=>f.press&&f.press.handler===h.press?.handler||f.valueControl&&f.valueControl.handler===h.valueControl?.handler||f.textControl&&f.textControl.handler===h.textControl?.handler;const d=o.filter(f=>f!==u&&r(f.c)&&f.score===u.score).filter(f=>!c(f.c,l)).filter((f,h,y)=>y.findIndex(T=>c(T.c,f.c))===h).slice(0,3).map(f=>({nativeTag:f.c.nativeTag,name:f.c.name,testID:f.c.testID,text:f.c.text,tap:pe(f.c.rect,s,a)}));const g=e.nativeTag==null&&!(e.testID&&!e.query);if(g&&d.length>0){const f=[l,...d.map(h=>o.find(y=>y.c.nativeTag===h.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${f.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:f.map(h=>({nativeTag:h.nativeTag,name:h.name,testID:h.testID,text:h.text}))}}const m=o[0];if(g&&m&&m!==u&&!r(m.c)&&m.score>=90&&u.score<m.score-40){return{tapped:false,reason:`The best match for "${e.query}" is "${m.c.text??m.c.label??m.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${l.text??l.label??l.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:l.nativeTag,name:l.name,testID:l.testID,text:l.text}]}}if(!r(l)){return{tapped:false,reason:F(l.stateNode)?`Matched "${l.name}"${l.text?` ("${l.text}")`:""}, but it is not a button or a field. This element can't be driven in JS.`:`Matched "${l.name}"${l.text?` ("${l.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:l.nativeTag,name:l.name,testID:l.testID,label:l.label,text:l.text,via:"onPress"}}}if(l.instance&&!l.rect)l.rect=await k(l.instance);let b=false;const w=l.rect==null||!W(l.rect,s,a);if(w&&e.scrollIntoView!==false&&l.instance){b=await Me(l.fiber,l.instance,l.stateNode,80);if(b)l.rect=await k(l.instance)}const v={nativeTag:l.nativeTag,name:l.name,testID:l.testID,label:l.label,text:l.text};Ne();const C=U;const N=l.fiber===null&&F(l.stateNode)?Pe():null;const V=Date.now();const I=async f=>{await new Promise(h=>setTimeout(h,Se));return{tapped:true,scrolled:b,matched:f,effect:{commits:N?N():U-C,observedMs:Date.now()-V},...d.length?{alsoMatched:d}:{}}};try{if(l.press){if(e.longPress){const h=l.press.kind==="onLongPress"?l.press.handler:l.press.longPress;if(!h){return{tapped:false,scrolled:b,reason:`Matched "${l.name}"${l.text?` ("${l.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...v,via:"onPress"}}}h(ye(l.rect));return await I({...v,via:"onLongPress"})}l.press.handler(ye(l.rect));return await I({...v,via:l.press.kind})}if(l.valueControl){const h=l.valueControl;let y;if(h.kind==="toggle"){y=typeof e.value==="boolean"?e.value:!h.current}else{const T=h.min??0;const p=h.max??1;if(typeof e.value==="number"){y=Math.min(p,Math.max(T,e.value))}else{y=h.current===p?T:p}}h.handler(y);return await I({...v,via:"onValueChange",value:y})}const f=e.text??(typeof e.value==="string"?e.value:"");l.textControl.handler(f);return await I({...v,via:"onChangeText",value:f})}catch(f){N?.();return{tapped:false,scrolled:b,reason:`handler threw: ${f instanceof Error?f.message:String(f)}`,matched:{...v,via:l.press?l.press.kind:l.valueControl?"onValueChange":"onChangeText"}}}}const He=5e3;const $e=3e4;const ze=50;const We=150;export async function waitFor(e){const t=e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim();if(!t){return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."}}const n=Math.min(Math.max(e.timeoutMs??He,0),$e);const r=Math.max(e.pollMs??We,ze);const i=e.gone===true;const s=Date.now();let a=0;for(;;){a+=1;const{hit:o,closest:u}=await Be(e);if(i?!o:!!o){return{ok:true,waitedMs:Date.now()-s,polls:a,matched:o??void 0}}if(Date.now()-s>=n){const l=u?.length?u:void 0;const c=i?`Still on screen after ${n}ms.`:l?`Not on screen after ${n}ms \u2014 ${l.length===1?"one element":`${l.length} elements`} matched but ${l.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${n}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-s,polls:a,reason:c,matched:o??void 0,closest:l}}await new Promise(l=>setTimeout(l,r))}}async function Be(e){const t=Z(e).map(o=>({c:o,score:Q(o,e)})).filter(o=>o.score>0).sort((o,u)=>u.score-o.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await me(t.map(o=>o.c));const n=L.get("window");const r=Math.round(n.width)||1;const i=Math.round(n.height)||1;let s=null;for(const{c:o}of t){if(!W(o.rect,r,i))continue;s={nativeTag:o.nativeTag,name:o.name,testID:o.testID,label:o.label,text:o.text,interactive:!!(o.press||o.valueControl||o.textControl)};break}const a=t.slice(0,3).map(({c:o})=>({name:o.name,testID:o.testID,text:o.text,onScreen:W(o.rect,r,i)}));return{hit:s,closest:a}}function ee(e){let t=e;let n=0;while(t&&n<400){if(x(t)?.__buoyDevToolsRoot)return true;t=t.return;n++}return false}function qe(e,t){const n=x(e.fiber);if(typeof n?.onPress==="function"||typeof n?.onValueChange==="function"||typeof n?.onChangeText==="function"){return e}let r=null;let i=e.fiber?.return;let s=0;while(i&&s<25){if(typeof x(i)?.onPress==="function"){r=i;break}i=i.return;s++}if(!r)return e;let a=r;for(let o=0;o<6&&a;o++){const u=t.get(a);if(u)return u;a=a.return}return e}export function resolveTouchTarget(e){const t=Y();if(t.length===0)return null;const n=new Map;for(const a of t)n.set(a.fiber,a);const r=t.find(a=>a.nativeTag===e);let i=null;if(!r){for(const a of D()){S(a.current,o=>{if(i)return;if(o.stateNode&&A(o.stateNode)===e){i=o}});if(i)break}}let s=r??null;if(!s&&i){let a=i;let o=0;let u=null;while(a&&o<25){const l=n.get(a);if(l){if(l.press||l.valueControl||l.textControl){s=l;break}if(!u)u=l}a=a.return;o++}if(!s)s=u}if(!s?.fiber&&!i){const a=s?.stateNode;const o=F(a)?a:Ue(e);if(o){for(let u=o;u;u=u.parentElement){const l=t.find(c=>c.stateNode===u&&(c.press||c.valueControl||c.textControl));if(l)return l.buoy?null:te(l)}return null}}if(!s)return null;s=qe(s,n);if(!s.press&&!s.valueControl&&!s.textControl)return null;if(ee(s.fiber))return null;return te(s)}function Ue(e){const t=global.document;if(!t?.querySelectorAll)return null;return Array.from(t.querySelectorAll("*")).find(n=>R(n)===e)??null}function te(e){return{nativeTag:e.nativeTag,name:e.name,role:e.role,testID:e.testID,label:e.label,text:e.text,control:e.valueControl?e.valueControl.kind:e.textControl?"text":"press",value:e.valueControl?e.valueControl.current:e.textControl?.current}}function je(e){let t=null;for(const n of D()){S(n.current,r=>{if(!t&&r.stateNode&&A(r.stateNode)===e)t=r});if(t)break}return t}function we(){const e=[];for(const t of D()){let n=t.current?.child;let r=0;while(n&&r++<200){if(n.tag===O&&n.stateNode){e.push(n);break}n=n.child}}return e}function Ge(e,t){const n=global.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!=="function")return null;const r=we().filter(i=>i.stateNode?.node);if(!r.length)return null;return new Promise(i=>{const s=setTimeout(()=>i(null),1e3);let a=r.length;let o=null;r.forEach((u,l)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,c=>{if(c&&(!o||l>=o.i))o={i:l,fiber:c};if(--a===0){clearTimeout(s);i(o?.fiber??null)}})}catch{if(--a===0){clearTimeout(s);i(o?.fiber??null)}}})})}function Je(e,t){const n=$?.findSubviewIn;if(typeof n!=="function")return null;const r=we()[0];const i=r?A(r.stateNode)??z(r.stateNode):null;if(i==null)return null;return new Promise(s=>{const a=setTimeout(()=>s(null),1e3);try{n.call($,i,[e,t],o=>{clearTimeout(a);s(typeof o==="number"?je(o):null)})}catch{clearTimeout(a);s(null)}})}function Ke(){const e=[];const t=new Set;const n=i=>{const s=[];const a=(o,u)=>{for(let l=o;l&&s.length<5e3;l=l.sibling){if(t.has(l)||u>500)continue;if(ue(l)||fe(l))continue;if(l.tag===O&&l.stateNode)s.push(l);else if(l.child)a(l.child,u+1)}};if(i.child)a(i.child,0);return s};const r=(i,s)=>{if(t.has(i)||s>500)return;t.add(i);e.push(i);be(n(i)).forEach(a=>r(a,s+1))};for(const i of D())be(n(i.current)).forEach(s=>r(s,0));return e}function be(e){const t=e.map(n=>{const r=Number(ne(x(n)?.style).zIndex);return Number.isFinite(r)?r:0});return e.map((n,r)=>({h:n,i:r})).sort((n,r)=>t[n.i]-t[r.i]||n.i-r.i).map(({h:n})=>n)}function ne(e,t=0){if(!e||typeof e!=="object"||t>10)return{};if(Array.isArray(e))return Object.assign({},...e.map(n=>ne(n,t+1)));return e}const Xe=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function Ye(e){if(typeof e.type==="string"&&Xe.has(e.type)&&e.type!=="RCTScrollContentView")return true;const t=ne(x(e)?.style).overflow;return t==="hidden"||t==="scroll"}function Ze(e){let t=x(e)?.pointerEvents??x(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return;let r=0;while(n&&r++<200){const i=x(n)?.pointerEvents??x(n)?.style?.pointerEvents;if(i==="none")return"all";if(i==="box-only"&&n.tag===O)return"all";n=n.return}return t==="box-none"?"self":null}async function Qe(e,t,n){const r=await Promise.all(n.map(o=>{const u=G(o.stateNode);return u?k(u):Promise.resolve(null)}));const i=new Map;n.forEach((o,u)=>i.set(o,r[u]));const s=o=>!!o&&e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height;const a=o=>{for(let u=o.return,l=0;u&&l<300;u=u.return,l++){if(u.tag===O&&i.has(u)&&Ye(u)&&!s(i.get(u)))return true}return false};for(let o=n.length-1;o>=0;o--){if(!s(r[o])||Ze(n[o])||a(n[o]))continue;return n[o]}return null}function et(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;let i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);while(i){const s=Object.keys(i).find(a=>a.startsWith("__reactFiber$"));if(s)return i[s];i=i.parentElement}return null}function tt(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;const i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);if(!i)return null;for(let c=i;c;c=c.parentElement){if(Object.keys(c).some(d=>d.startsWith("__reactFiber$")||d.startsWith("__reactContainer$")))return null}const s=!!i.closest("[data-buoy-root], [data-buoy-portal-host]");const a=he();const o=a.find(c=>c.stateNode===i);let u;for(let c=i;c&&!u;c=c.parentElement){u=a.find(d=>d.stateNode===c&&(d.press||d.valueControl||d.textControl))}const l=[];for(let c=i;c&&l.length<6;c=c.parentElement){const d=B(c);if(d!==c.tagName.toLowerCase()&&l[l.length-1]!==d)l.push(d)}return{found:true,method:"dom",buoy:s,view:{name:B(i),nativeTag:R(i),testID:o?.testID,label:o?.label,text:o?.text},path:l,target:u&&!s?te(u):null}}export async function hitTest(e){const t=Math.min(1,Math.max(0,Number(e?.x)));const n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};const r=L.get("window");const i=t*r.width;const s=n*r.height;let a="none";let o=null;const u=et(t,n);const l=u?null:tt(t,n);if(l)return l;if(u){a="dom";o=u}else{const w=Ge(i,s);if(w){a="fabric";o=await w}else{const C=Je(i,s);if(C){a="paper";o=await C}}const v=Ke();if(!o||!new Set(v).has(o)){o=await Qe(i,s,v);a="measured"}}if(!o)return{found:false,method:a};const c=x(o)??{};const d=A(o.stateNode);const g=[];let m=o;let b=0;while(m&&b++<80&&g.length<6){const w=M(m);if(w&&typeof m.type!=="string"&&!q.has(w)&&g[g.length-1]!==w)g.push(w);m=m.return}return{found:true,method:a,buoy:ee(o),view:{name:M(o)??"Unknown",nativeTag:d,testID:c.testID||void 0,label:c.accessibilityLabel||c["aria-label"]||void 0,text:X(c)},path:g,target:d!=null?resolveTouchTarget(d):null}}export async function readMaps(){const e=[];for(const i of D()){S(i.current,s=>{const a=s.stateNode;if(s.tag===1&&a&&typeof a.getCamera==="function"&&!ee(s))e.push(s)})}const t=L.get("window");const n=i=>Promise.race([i,new Promise(s=>setTimeout(()=>s(null),1e3))]);const r=await Promise.all(e.slice(0,5).map(async i=>{try{const s=await n(Promise.resolve(i.stateNode.getCamera()));if(!s)return null;const a=J(i);const o=a?await k(a.instance):null;const u=x(i)??{};return{name:M(i)??"Map",testID:typeof u.testID==="string"?u.testID:void 0,frame:o&&t.width&&t.height?{x:P(o.x/t.width),y:P(o.y/t.height),width:P(o.width/t.width),height:P(o.height/t.height)}:void 0,camera:{heading:typeof s.heading==="number"?s.heading:void 0,pitch:typeof s.pitch==="number"?s.pitch:void 0,altitude:typeof s.altitude==="number"?s.altitude:void 0,zoom:typeof s.zoom==="number"?s.zoom:void 0,center:s.center}}}catch{return null}}));return{maps:r.filter(i=>!!i)}}
1
+ "use strict";import{getDOMControlProps as Te,getDOMNodeHandle as R,getDOMPublicInstance as re,isDOMElement as F}from"@buoy-gg/shared-ui/utils";import{Dimensions as L,UIManager as $,findNodeHandle as z}from"react-native";import{isRectCenterOnScreen as W,scoreTapMatch as ie}from"./tapMatch";import{collectDOMElements as xe,domElementName as B,labeledField as Ce,watchDOMChanges as Pe}from"./domScreenElements";const O=5;const Ie=22;const q=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function le(){if(typeof global==="undefined")return null;return global.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}let U=0;let se=false;function Ne(){if(se)return;const e=le();if(!e)return;const t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){U++;return typeof t==="function"?t.apply(e,n):void 0};se=true}const Se=250;function ae(){const e=new Map;return t=>{const n=[];let r=t;let i=0;let s=false;while(r&&i<400){const a=e.get(r);if(a!==void 0){s=a;break}if(x(r)?.__buoyDevToolsRoot){s=true;e.set(r,true);break}n.push(r);r=r.return;i++}for(const a of n)e.set(a,s);return s}}function D(){const e=le();if(!e)return[];const t=[];try{if(e.renderers&&typeof e.renderers.forEach==="function"){e.renderers.forEach((n,r)=>{try{const i=e.getFiberRoots?.(r);if(i)i.forEach(s=>t.push(s))}catch{}})}if(t.length===0&&e.getFiberRoots){const n=e.getFiberRoots(1);if(n)n.forEach(r=>t.push(r))}}catch{}return t}function ue(e){return e.tag===Ie&&e.memoizedState!==null}let _=false;let j=0;let E=false;function ce(e,t){const n=_;_=e;try{return t()}finally{_=n}}function De(e){const t=e.memoizedProps;if(!t)return false;if(t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t))return true;if(t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t))return true;return false}function fe(e){const t=e.memoizedProps?.activityState;if(t===0||t===1)return true;if(e.memoizedProps?.isPageFocused===false)return true;if(!_&&De(e)){j++;return true}return false}function S(e,t,n=0,r=new Set){if(!e||r.has(e)||n>500)return;r.add(e);if(ue(e)||fe(e)){if(e.sibling)S(e.sibling,t,n,r);return}t(e);if(e.child)S(e.child,t,n+1,r);if(e.sibling)S(e.sibling,t,n,r)}function G(e){const t=re(e);if(t)return t;if(!e)return null;const n=e;if(n.canonical?.publicInstance)return n.canonical.publicInstance;if(n.canonical&&typeof n.canonical.measure==="function"){return n.canonical}if(typeof n.measure==="function"||typeof n.measureInWindow==="function"){return n}return null}function A(e){const t=R(e);if(t!==null)return t;if(e==null)return null;const n=e;if(typeof n.__nativeTag==="number")return n.__nativeTag;if(typeof n._nativeTag==="number")return n._nativeTag;if(typeof n.nativeTag==="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag==="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag==="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag==="number")return n.canonical.nativeTag}return null}function J(e){const t=G(e.stateNode);if(t){return{instance:t,nativeTag:A(e.stateNode),stateNode:e.stateNode}}const n=[];if(e.child)n.push(e.child);let r=0;while(n.length>0&&r<4e3){r++;const i=n.pop();if(!i)continue;const s=G(i.stateNode);if(s)return{instance:s,nativeTag:A(i.stateNode),stateNode:i.stateNode};if(i.child)n.push(i.child);if(i.sibling)n.push(i.sibling)}return null}function _e(e){let t=e;let n=0;while(t&&n++<200){const r=t.stateNode;if(r&&typeof r.scrollTo==="function"){const i=typeof r.getNativeScrollRef==="function"&&r.getNativeScrollRef()||null;const s=typeof r.getInnerViewNode==="function"&&r.getInnerViewNode()||typeof r.getScrollableNode==="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:i,innerNode:s}}t=t.return}return null}async function Me(e,t,n,r){try{if(F(n)){n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"});await new Promise(u=>setTimeout(u,16));return true}const i=_e(e);if(!i)return false;const s=t;let a=null;const o=u=>new Promise(l=>{let c=false;const d=m=>{if(c)return;c=true;l(m)};const g=setTimeout(()=>d(null),600);try{u(m=>{clearTimeout(g);d(m)})}catch{clearTimeout(g);d(null)}});if(i.nativeRef&&typeof s.measureLayout==="function"){a=await o(u=>s.measureLayout(i.nativeRef,(l,c)=>u(c),()=>u(null)))}if(a==null){const u=z(t);const l=typeof i.innerNode==="number"?i.innerNode:z(i.innerNode);if(u!=null&&l!=null){a=await o(c=>$.measureLayout(u,l,()=>c(null),(d,g)=>c(g)))}}if(a==null)return false;i.instance.scrollTo({y:Math.max(0,a-r),animated:false});await new Promise(u=>setTimeout(u,120));return true}catch{return false}}function M(e){const t=e?.type;if(!t)return null;if(typeof t==="string")return t;return t.displayName||t.name||null}function K(e){let t=e?._debugOwner||e?.return;let n=0;while(t&&n<30){n++;const r=M(t);if(r&&!q.has(r)&&typeof t.type!=="string"){return r}t=t.return}return null}function x(e){return Te(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}function de(e,t=0){if(typeof e==="string")return e;if(typeof e==="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){const n=[];for(const r of e){const i=de(r,t+1);if(i)n.push(i)}return n.length>0?n.join(""):void 0}return void 0}function ke(e){return e.replace(/\s+/g," ").trim()}function X(e){if(!e)return void 0;const t=n=>{const r=de(n);if(r===void 0)return void 0;const i=ke(r);return i?E?i:i.slice(0,80):void 0};return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}function Ve(e,t){const n=[];const r=(s,a)=>{if(!s||a>t||n.length>=4)return;if(s!==e){const u=x(s);if(u&&(typeof u.onPress==="function"||typeof u.onLongPress==="function"))return}const o=X(x(s));if(o&&!n.includes(o))n.push(o);if(s.child)r(s.child,a+1);if(s!==e&&s.sibling)r(s.sibling,a)};if(e.child)r(e.child,1);const i=n.join(" ").trim();return i?i.slice(0,80):void 0}function Ae(e){let t=e;let n=0;let r=null;let i=null;while(t&&n<25&&!(r&&i)){const s=x(t);if(s){if(!r&&typeof s.onPress==="function")r=s.onPress;if(!i&&typeof s.onLongPress==="function")i=s.onLongPress}t=t.return;n++}if(r)return{handler:r,kind:"onPress",longPress:i??void 0};return i?{handler:i,kind:"onLongPress"}:null}function k(e){return new Promise(t=>{let n=false;const r=i=>{if(n)return;n=true;t(i)};setTimeout(()=>r(null),1e3);try{if(typeof e.measureInWindow==="function"){e.measureInWindow((i,s,a,o)=>{if(a>0&&o>0)r({x:i,y:s,width:a,height:o});else r(null)})}else if(typeof e.measure==="function"){e.measure((i,s,a,o,u,l)=>{if(a>0&&o>0&&u!=null&&l!=null){r({x:u,y:l,width:a,height:o})}else{r(null)}})}else{r(null)}}catch{r(null)}})}const Fe=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function Y(){const e=D();const t=[];const n=new Map;const r=new Map;const i=ae();for(const s of e){S(s.current,a=>{const o=x(a);if(!o)return;const u=typeof o.onPress==="function"||typeof o.onLongPress==="function";const l=typeof o.onValueChange==="function";const c=typeof o.onChangeText==="function";const d=o.testID||void 0;const g=o.accessibilityLabel||void 0;const m=o.accessibilityRole||o.role||void 0;let w=X(o);const y=m==="button"||m==="link"||m==="menuitem"||m==="tab"||m==="switch"||m==="checkbox";const b=typeof a.type==="string"&&Fe.has(a.type)&&o.animating!==false;if(!u&&!l&&!c&&!d&&!g&&!w&&!y&&!b){return}let C=null;let N=null;let V=null;if(l){const oe=o.value;const ve=typeof oe==="number"||typeof o.minimumValue==="number";N={handler:o.onValueChange,kind:ve?"slider":"toggle",current:oe,min:typeof o.minimumValue==="number"?o.minimumValue:void 0,max:typeof o.maximumValue==="number"?o.maximumValue:void 0}}else if(c){V={handler:o.onChangeText,current:typeof o.value==="string"?o.value:void 0}}else{C=Ae(a)}const I=M(a);let f=I??"Unknown";if(!I||q.has(I)||typeof a.type==="string"){f=K(a)??I??"Unknown"}const h=J(a);if(!h&&!d)return;if(!w&&!g&&u){w=Ve(a,6)}const p=h?.instance??null;const T=h?.nativeTag??null;const v=(p?n.get(p):void 0)??(T!=null?r.get(T):void 0);if(v){if(C)v.press=C;if(!v.valueControl&&N)v.valueControl=N;if(!v.textControl&&V)v.textControl=V;if(!v.testID&&d)v.testID=d;if(!v.label&&g)v.label=g;if(!v.text&&w)v.text=w;if(p&&!n.has(p))n.set(p,v);if(T!=null&&!r.has(T))r.set(T,v);return}const H={nativeTag:T,name:f,role:m??(b?"progressbar":void 0),testID:d,label:g,text:w,instance:p,stateNode:h?.stateNode??null,fiber:a,press:C,valueControl:N,textControl:V,rect:null,buoy:i(a)};t.push(H);if(p)n.set(p,H);if(T!=null)r.set(T,H)})}t.push(...he());return t}function he(){return xe({fullText:E}).map(({element:e,props:t,text:n,buoy:r})=>{const i=typeof t.onValueChange==="function"?{handler:t.onValueChange,kind:typeof t.value==="number"?"slider":"toggle",current:t.value,min:t.minimumValue,max:t.maximumValue}:null;const s=!i&&typeof t.onChangeText==="function"?{handler:t.onChangeText,current:t.value}:null;const a=!i&&!s&&typeof t.onPress==="function"?{handler:t.onPress,kind:"onPress"}:null;return{nativeTag:R(e),name:B(e),role:t.accessibilityRole,testID:t.testID,label:t.accessibilityLabel,text:n,instance:re(e),stateNode:e,fiber:null,buoy:r,press:a,valueControl:i,textControl:s,rect:null}})}function Le(e,t){if(t.nativeTag!=null)return e.nativeTag===t.nativeTag;if(t.testID&&e.testID)return e.testID.toLowerCase()===t.testID.toLowerCase();return false}function Z(e){const t=Y();if(e.includeBuoy)return t;return t.filter(n=>!n.buoy||Le(n,e))}async function me(e){await Promise.all(e.map(async t=>{if(t.instance)t.rect=await k(t.instance)}))}const Ee=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function Re(e,t){const n=[];const r=ae();for(const s of D()){S(s.current,a=>{if(M(a)!=="VirtualizedList")return;const o=a.memoizedProps;if(!o||typeof o.getItemCount!=="function")return;if(!e&&r(a))return;let u;try{u=Number(o.getItemCount(o.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;const l=[];const c=(m,w)=>{for(let y=m?.child;y;y=y.sibling){const b=M(y);if(b==="VirtualizedList")continue;if(b==="CellRenderer"){l.push(y);continue}if(w<40)c(y,w+1)}};c(a,0);let d=a;let g=K(d);for(let m=0;m<6&&g&&Ee.test(g);m++){d=d._debugOwner||d.return;g=K(d)}n.push({owner:g,items:u,cells:l})})}const i=[];for(const s of n){const a=await Promise.all(s.cells.map(async u=>{const l=J(u);return l?k(l.instance):null}));const o=a.filter(t).length;if(o>0&&s.items>o)i.push({owner:s.owner,items:s.items,listed:o})}return i}export async function describeScreen(e={}){const t=_;const n=E;_=!!e.includeHidden;E=!!e.fullText;try{return await Oe(e)}finally{_=t;E=n}}async function Oe(e){j=0;const t=Y();const n=j;const r=e.includeBuoy?t:t.filter(c=>!c.buoy);const i=t.length-r.length;await me(r);const s=L.get("window");const a=Math.round(s.width)||1;const o=Math.round(s.height)||1;const u=[];for(const c of r){const d=c.rect;if(!d&&!c.testID)continue;let g;let m;if(d){const b=d.x+d.width/2;const C=d.y+d.height/2;if(C<-o*.1||C>o*1.1||b<-a*.1||b>a*1.1){continue}g={x:P(b/a),y:P(C/o)};m={x:P(d.x/a),y:P(d.y/o),width:P(d.width/a),height:P(d.height/o)}}const w=c.valueControl?c.valueControl.kind:c.textControl?"text":void 0;const y=c.valueControl?c.valueControl.current:c.textControl?.current;u.push({nativeTag:c.nativeTag,name:c.name,role:c.role,testID:c.testID,label:c.label,text:c.text,interactive:!!(c.press||c.valueControl||c.textControl),longPressable:c.press&&(c.press.kind==="onLongPress"||c.press.longPress)?true:void 0,control:w,value:y,tap:g,frame:m,...c.buoy?{buoy:true}:{}})}u.sort((c,d)=>{const g=c.tap?.y??2;const m=d.tap?.y??2;if(Math.abs(g-m)>.02)return g-m;return(c.tap?.x??2)-(d.tap?.x??2)});const l=await Re(!!e.includeBuoy,c=>{if(!c)return false;const d=c.x+c.width/2;return c.y<=o*1.1&&c.y+c.height>=-o*.1&&d>=-a*.1&&d<=a*1.1});return{screen:{width:a,height:o},count:u.length,elements:u,...i>0?{hiddenBuoy:i}:{},...n>0?{hiddenScreens:n}:{},...l.length?{lists:l}:{}}}function P(e){return Math.round(e*100)/100}function ge(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}function Q(e,t){return ie(ge(e),t)}function pe(e,t,n){if(!e||!t||!n)return void 0;return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}function ye(e){const t=e?e.x+e.width/2:0;const n=e?e.y+e.height/2:0;const r={locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]};return{nativeEvent:r,persist:()=>{},preventDefault:()=>{},stopPropagation:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,target:null,currentTarget:null,type:"press",timeStamp:0}}export async function tapElement(e){const t=ce(!!e.includeHidden,()=>Z(e));if(t.length===0){return{tapped:false,reason:"Nothing on screen to tap: no React elements and no page elements were found."}}const n=t.map(f=>({c:f,score:Q(f,e)})).filter(f=>f.score>0).sort((f,h)=>h.score-f.score);const r=f=>!!(f.press||f.valueControl||f.textControl);if(n.length===0&&!e.includeHidden){const f=ce(true,()=>Z(e)).map(h=>({c:h,score:Q(h,e)})).filter(h=>h.score>0);if(f.length>0){return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."}}}if(n.length===0){return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(r).slice(0,12).map(f=>({nativeTag:f.nativeTag,name:f.name,testID:f.testID,text:f.text}))}}const i=L.get("window");const s=i.width||1;const a=i.height||1;const o=n.slice(0,15);await Promise.all(o.map(async f=>{if(f.c.instance&&!f.c.rect)f.c.rect=await k(f.c.instance)}));for(const f of o){f.score=ie({...ge(f.c),tap:pe(f.c.rect,s,a)},e)}o.sort((f,h)=>h.score-f.score);if(e.text!==void 0){for(const f of o){const h=!r(f.c)&&F(f.c.stateNode)?Ce(f.c.stateNode):null;const p=h?t.find(T=>T.stateNode===h&&T.textControl):void 0;if(p)f.c=p}}const u=o.find(f=>r(f.c))??n.find(f=>r(f.c))??o[0];const l=u.c;const c=(f,h)=>f.press&&f.press.handler===h.press?.handler||f.valueControl&&f.valueControl.handler===h.valueControl?.handler||f.textControl&&f.textControl.handler===h.textControl?.handler;const d=o.filter(f=>f!==u&&r(f.c)&&f.score===u.score).filter(f=>!c(f.c,l)).filter((f,h,p)=>p.findIndex(T=>c(T.c,f.c))===h).slice(0,3).map(f=>({nativeTag:f.c.nativeTag,name:f.c.name,testID:f.c.testID,text:f.c.text,tap:pe(f.c.rect,s,a)}));const g=e.nativeTag==null&&!(e.testID&&!e.query);if(g&&d.length>0){const f=[l,...d.map(h=>o.find(p=>p.c.nativeTag===h.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${f.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:f.map(h=>({nativeTag:h.nativeTag,name:h.name,testID:h.testID,text:h.text}))}}const m=o[0];if(g&&m&&m!==u&&!r(m.c)&&m.score>=90&&u.score<m.score-40){return{tapped:false,reason:`The best match for "${e.query}" is "${m.c.text??m.c.label??m.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${l.text??l.label??l.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:l.nativeTag,name:l.name,testID:l.testID,text:l.text}]}}if(!r(l)){return{tapped:false,reason:F(l.stateNode)?`Matched "${l.name}"${l.text?` ("${l.text}")`:""}, but it is not a button or a field. This element can't be driven in JS.`:`Matched "${l.name}"${l.text?` ("${l.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:l.nativeTag,name:l.name,testID:l.testID,label:l.label,text:l.text,via:"onPress"}}}if(l.instance&&!l.rect)l.rect=await k(l.instance);let w=false;const y=l.rect==null||!W(l.rect,s,a);if(y&&e.scrollIntoView!==false&&l.instance){w=await Me(l.fiber,l.instance,l.stateNode,80);if(w)l.rect=await k(l.instance)}const b={nativeTag:l.nativeTag,name:l.name,testID:l.testID,label:l.label,text:l.text};Ne();const C=U;const N=l.fiber===null&&F(l.stateNode)?Pe():null;const V=Date.now();const I=async f=>{await new Promise(h=>setTimeout(h,Se));return{tapped:true,scrolled:w,matched:f,effect:{commits:N?N():U-C,observedMs:Date.now()-V},...d.length?{alsoMatched:d}:{}}};try{if(l.press){if(e.longPress){const h=l.press.kind==="onLongPress"?l.press.handler:l.press.longPress;if(!h){return{tapped:false,scrolled:w,reason:`Matched "${l.name}"${l.text?` ("${l.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...b,via:"onPress"}}}h(ye(l.rect));return await I({...b,via:"onLongPress"})}l.press.handler(ye(l.rect));return await I({...b,via:l.press.kind})}if(l.valueControl){const h=l.valueControl;let p;if(h.kind==="toggle"){p=typeof e.value==="boolean"?e.value:!h.current}else{const T=h.min??0;const v=h.max??1;if(typeof e.value==="number"){p=Math.min(v,Math.max(T,e.value))}else{p=h.current===v?T:v}}h.handler(p);return await I({...b,via:"onValueChange",value:p})}const f=e.text??(typeof e.value==="string"?e.value:"");l.textControl.handler(f);return await I({...b,via:"onChangeText",value:f})}catch(f){N?.();return{tapped:false,scrolled:w,reason:`handler threw: ${f instanceof Error?f.message:String(f)}`,matched:{...b,via:l.press?l.press.kind:l.valueControl?"onValueChange":"onChangeText"}}}}const He=5e3;const $e=3e4;const ze=50;const We=150;export async function waitFor(e){const t=e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim();if(!t){return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."}}const n=Math.min(Math.max(e.timeoutMs??He,0),$e);const r=Math.max(e.pollMs??We,ze);const i=e.gone===true;const s=Date.now();let a=0;for(;;){a+=1;const{hit:o,closest:u}=await Be(e);if(i?!o:!!o){return{ok:true,waitedMs:Date.now()-s,polls:a,matched:o??void 0}}if(Date.now()-s>=n){const l=u?.length?u:void 0;const c=i?`Still on screen after ${n}ms.`:l?`Not on screen after ${n}ms \u2014 ${l.length===1?"one element":`${l.length} elements`} matched but ${l.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${n}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-s,polls:a,reason:c,matched:o??void 0,closest:l}}await new Promise(l=>setTimeout(l,r))}}async function Be(e){const t=Z(e).map(o=>({c:o,score:Q(o,e)})).filter(o=>o.score>0).sort((o,u)=>u.score-o.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await me(t.map(o=>o.c));const n=L.get("window");const r=Math.round(n.width)||1;const i=Math.round(n.height)||1;let s=null;for(const{c:o}of t){if(!W(o.rect,r,i))continue;s={nativeTag:o.nativeTag,name:o.name,testID:o.testID,label:o.label,text:o.text,interactive:!!(o.press||o.valueControl||o.textControl)};break}const a=t.slice(0,3).map(({c:o})=>({name:o.name,testID:o.testID,text:o.text,onScreen:W(o.rect,r,i)}));return{hit:s,closest:a}}function ee(e){let t=e;let n=0;while(t&&n<400){if(x(t)?.__buoyDevToolsRoot)return true;t=t.return;n++}return false}function qe(e,t){const n=x(e.fiber);if(typeof n?.onPress==="function"||typeof n?.onValueChange==="function"||typeof n?.onChangeText==="function"){return e}let r=null;let i=e.fiber?.return;let s=0;while(i&&s<25){if(typeof x(i)?.onPress==="function"){r=i;break}i=i.return;s++}if(!r)return e;let a=r;for(let o=0;o<6&&a;o++){const u=t.get(a);if(u)return u;a=a.return}return e}export function resolveTouchTarget(e){const t=Y();if(t.length===0)return null;const n=new Map;for(const a of t)n.set(a.fiber,a);const r=t.find(a=>a.nativeTag===e);let i=null;if(!r){for(const a of D()){S(a.current,o=>{if(i)return;if(o.stateNode&&A(o.stateNode)===e){i=o}});if(i)break}}let s=r??null;if(!s&&i){let a=i;let o=0;let u=null;while(a&&o<25){const l=n.get(a);if(l){if(l.press||l.valueControl||l.textControl){s=l;break}if(!u)u=l}a=a.return;o++}if(!s)s=u}if(!s?.fiber&&!i){const a=s?.stateNode;const o=F(a)?a:Ue(e);if(o){for(let u=o;u;u=u.parentElement){const l=t.find(c=>c.stateNode===u&&(c.press||c.valueControl||c.textControl));if(l)return l.buoy?null:te(l)}return null}}if(!s)return null;s=qe(s,n);if(!s.press&&!s.valueControl&&!s.textControl)return null;if(ee(s.fiber))return null;return te(s)}function Ue(e){const t=global.document;if(!t?.querySelectorAll)return null;return Array.from(t.querySelectorAll("*")).find(n=>R(n)===e)??null}function te(e){return{nativeTag:e.nativeTag,name:e.name,role:e.role,testID:e.testID,label:e.label,text:e.text,control:e.valueControl?e.valueControl.kind:e.textControl?"text":"press",value:e.valueControl?e.valueControl.current:e.textControl?.current}}function je(e){let t=null;for(const n of D()){S(n.current,r=>{if(!t&&r.stateNode&&A(r.stateNode)===e)t=r});if(t)break}return t}function we(){const e=[];for(const t of D()){let n=t.current?.child;let r=0;while(n&&r++<200){if(n.tag===O&&n.stateNode){e.push(n);break}n=n.child}}return e}function Ge(e,t){const n=global.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!=="function")return null;const r=we().filter(i=>i.stateNode?.node);if(!r.length)return null;return new Promise(i=>{const s=setTimeout(()=>i(null),1e3);let a=r.length;let o=null;r.forEach((u,l)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,c=>{if(c&&(!o||l>=o.i))o={i:l,fiber:c};if(--a===0){clearTimeout(s);i(o?.fiber??null)}})}catch{if(--a===0){clearTimeout(s);i(o?.fiber??null)}}})})}function Je(e,t){const n=$?.findSubviewIn;if(typeof n!=="function")return null;const r=we()[0];const i=r?A(r.stateNode)??z(r.stateNode):null;if(i==null)return null;return new Promise(s=>{const a=setTimeout(()=>s(null),1e3);try{n.call($,i,[e,t],o=>{clearTimeout(a);s(typeof o==="number"?je(o):null)})}catch{clearTimeout(a);s(null)}})}function Ke(){const e=[];const t=new Set;const n=i=>{const s=[];const a=(o,u)=>{for(let l=o;l&&s.length<5e3;l=l.sibling){if(t.has(l)||u>500)continue;if(ue(l)||fe(l))continue;if(l.tag===O&&l.stateNode)s.push(l);else if(l.child)a(l.child,u+1)}};if(i.child)a(i.child,0);return s};const r=(i,s)=>{if(t.has(i)||s>500)return;t.add(i);e.push(i);be(n(i)).forEach(a=>r(a,s+1))};for(const i of D())be(n(i.current)).forEach(s=>r(s,0));return e}function be(e){const t=e.map(n=>{const r=Number(ne(x(n)?.style).zIndex);return Number.isFinite(r)?r:0});return e.map((n,r)=>({h:n,i:r})).sort((n,r)=>t[n.i]-t[r.i]||n.i-r.i).map(({h:n})=>n)}function ne(e,t=0){if(!e||typeof e!=="object"||t>10)return{};if(Array.isArray(e))return Object.assign({},...e.map(n=>ne(n,t+1)));return e}const Xe=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function Ye(e){if(typeof e.type==="string"&&Xe.has(e.type)&&e.type!=="RCTScrollContentView")return true;const t=ne(x(e)?.style).overflow;return t==="hidden"||t==="scroll"}function Ze(e){let t=x(e)?.pointerEvents??x(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return;let r=0;while(n&&r++<200){const i=x(n)?.pointerEvents??x(n)?.style?.pointerEvents;if(i==="none")return"all";if(i==="box-only"&&n.tag===O)return"all";n=n.return}return t==="box-none"?"self":null}async function Qe(e,t,n){const r=await Promise.all(n.map(o=>{const u=G(o.stateNode);return u?k(u):Promise.resolve(null)}));const i=new Map;n.forEach((o,u)=>i.set(o,r[u]));const s=o=>!!o&&e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height;const a=o=>{for(let u=o.return,l=0;u&&l<300;u=u.return,l++){if(u.tag===O&&i.has(u)&&Ye(u)&&!s(i.get(u)))return true}return false};for(let o=n.length-1;o>=0;o--){if(!s(r[o])||Ze(n[o])||a(n[o]))continue;return n[o]}return null}function et(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;let i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);while(i){const s=Object.keys(i).find(a=>a.startsWith("__reactFiber$"));if(s)return i[s];i=i.parentElement}return null}function tt(e,t){const n=global.document;const r=global.window;if(!n?.elementFromPoint||!r)return null;const i=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);if(!i)return null;for(let c=i;c;c=c.parentElement){if(Object.keys(c).some(d=>d.startsWith("__reactFiber$")||d.startsWith("__reactContainer$")))return null}const s=!!i.closest("[data-buoy-root], [data-buoy-portal-host]");const a=he();const o=a.find(c=>c.stateNode===i);let u;for(let c=i;c&&!u;c=c.parentElement){u=a.find(d=>d.stateNode===c&&(d.press||d.valueControl||d.textControl))}const l=[];for(let c=i;c&&l.length<6;c=c.parentElement){const d=B(c);if(d!==c.tagName.toLowerCase()&&l[l.length-1]!==d)l.push(d)}return{found:true,method:"dom",buoy:s,view:{name:B(i),nativeTag:R(i),testID:o?.testID,label:o?.label,text:o?.text},path:l,target:u&&!s?te(u):null}}export async function hitTest(e){const t=Math.min(1,Math.max(0,Number(e?.x)));const n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};const r=L.get("window");const i=t*r.width;const s=n*r.height;let a="none";let o=null;const u=et(t,n);const l=u?null:tt(t,n);if(l)return l;if(u){a="dom";o=u}else{const y=Ge(i,s);if(y){a="fabric";o=await y}else{const C=Je(i,s);if(C){a="paper";o=await C}}const b=Ke();if(!o||!new Set(b).has(o)){o=await Qe(i,s,b);a="measured"}}if(!o)return{found:false,method:a};const c=x(o)??{};const d=A(o.stateNode);const g=[];let m=o;let w=0;while(m&&w++<80&&g.length<6){const y=M(m);if(y&&typeof m.type!=="string"&&!q.has(y)&&g[g.length-1]!==y)g.push(y);m=m.return}return{found:true,method:a,buoy:ee(o),view:{name:M(o)??"Unknown",nativeTag:d,testID:c.testID||void 0,label:c.accessibilityLabel||c["aria-label"]||void 0,text:X(c)},path:g,target:d!=null?resolveTouchTarget(d):null}}export async function readMaps(){const e=[];for(const i of D()){S(i.current,s=>{const a=s.stateNode;if(s.tag===1&&a&&typeof a.getCamera==="function"&&!ee(s))e.push(s)})}const t=L.get("window");const n=i=>Promise.race([i,new Promise(s=>setTimeout(()=>s(null),1e3))]);const r=await Promise.all(e.slice(0,5).map(async i=>{try{const s=await n(Promise.resolve(i.stateNode.getCamera()));if(!s)return null;const a=J(i);const o=a?await k(a.instance):null;const u=x(i)??{};return{name:M(i)??"Map",testID:typeof u.testID==="string"?u.testID:void 0,frame:o&&t.width&&t.height?{x:P(o.x/t.width),y:P(o.y/t.height),width:P(o.width/t.width),height:P(o.height/t.height)}:void 0,camera:{heading:typeof s.heading==="number"?s.heading:void 0,pitch:typeof s.pitch==="number"?s.pitch:void 0,altitude:typeof s.altitude==="number"?s.altitude:void 0,zoom:typeof s.zoom==="number"?s.zoom:void 0,center:s.center}}}catch{return null}}));return{maps:r.filter(i=>!!i)}}
@@ -29,6 +29,8 @@ export interface ScreenElement {
29
29
  width: number;
30
30
  height: number;
31
31
  };
32
+ /** Part of Buoy's own overlay. Only set when includeBuoy listed it. */
33
+ buoy?: true;
32
34
  }
33
35
  export interface DescribeScreenParams {
34
36
  /**
package/lib/web/index.mjs CHANGED
@@ -23,7 +23,7 @@
23
23
  \u2551 Tracking: ${(t.reduce((a,s)=>a+s.trackingTime,0)/t.length).toFixed(1).padStart(6)}ms \u2551
24
24
  \u2551 Callback: ${(t.reduce((a,s)=>a+s.callbackTime,0)/t.length).toFixed(1).padStart(6)}ms \u2551
25
25
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
26
- `}};l(Wo,"PerformanceLoggerSingleton");Fa=Wo,Qe=new Fa});function Ma(e){if(e.isComponent===true||e.testID&&e.testID.trim())return true;let t=(e.componentName??"").trim();if(!t||jo.has(t)||$a.has(t))return false;let n=(e.viewType??"").trim();return!(n&&jo.has(n)&&t===n||/^comp(\s|$)/i.test(t)||t.startsWith("_"))}var jo,$a,md=Xt(()=>{"use strict";j();jo=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]),$a=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"]);l(Ma,"isNamedComposite")});var Oa={};Na(Oa,{RenderTracker:()=>B,default:()=>ja});var Uo,_a,Go,Wa,B,ja,Ve=Xt(()=>{"use strict";j();Aa();kn();md();Uo=200,_a=150,Go=class Hp{constructor(){this.renders=new Map;this.listeners=new Set;this.stateListeners=new Set;this.settingsListeners=new Set;this.filterListeners=new Set;this.renderEventCallbacks=new Set;this.isTracking=false;this.isPaused=false;this.settings={batchSize:_a,showRenderCount:true,performanceLogging:false,trackRenderCauses:false,enableRenderHistory:false,maxRenderHistoryPerComponent:20,capturePropsOnRender:false,captureStateOnRender:false,debugLogLevel:"off",excludeDevTools:true,showHostViews:false};this.isBatchMode=false;this.batchDirty=false;this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]}}trackRender(t){if(this.isPaused)return;let n=String(t.nativeTag),o=Date.now(),r=this.renders.get(n);if(r){if(r.renderCount=t.count,r.lastRenderTime=o,r.color=t.color,t.measurements&&(r.measurements=t.measurements),t.testID&&!r.testID&&(r.testID=t.testID),t.nativeID&&!r.nativeID&&(r.nativeID=t.nativeID),t.accessibilityLabel&&!r.accessibilityLabel&&(r.accessibilityLabel=t.accessibilityLabel),t.componentName&&!r.componentName&&(r.componentName=t.componentName),t.renderCause&&(r.lastRenderCause=t.renderCause),this.settings.enableRenderHistory){let i=t.renderCause||{type:"unknown",timestamp:o};this.addRenderEvent(r,i,t.capturedProps,t.capturedState)}}else{let i={id:n,nativeTag:t.nativeTag,viewType:t.viewType,displayName:Rn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,...t.isComponent===void 0?{}:{isComponent:t.isComponent},renderCount:t.count,firstRenderTime:o,lastRenderTime:o,measurements:t.measurements,color:t.color,lastRenderCause:t.renderCause};if(this.settings.enableRenderHistory){i.renderHistory=[];let a=t.renderCause||{type:t.count===1?"mount":"unknown",timestamp:o};this.addRenderEvent(i,a,t.capturedProps,t.capturedState)}if(this.renders.set(n,i),this.renders.size>Uo){let a=Array.from(this.renders.values()).sort((s,u)=>s.lastRenderTime-u.lastRenderTime).slice(0,this.renders.size-Uo);for(let s of a)this.renders.delete(s.id)}}this.isBatchMode?this.batchDirty=true:this.notifyListeners()}addRenderEvent(t,n,o,r){t.renderHistory||(t.renderHistory=[]);let i={id:`${t.nativeTag}-${n.timestamp}`,timestamp:n.timestamp,cause:n,renderNumber:t.renderCount,capturedProps:this.settings.capturePropsOnRender?o:void 0,capturedState:this.settings.captureStateOnRender?r:void 0};t.renderHistory.push(i);let a=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));t.renderHistory.length>a&&(t.renderHistory=t.renderHistory.slice(-a)),this.notifyRenderEventCallbacks(i,t)}notifyRenderEventCallbacks(t,n){this.renderEventCallbacks.forEach(o=>{try{o(t,n)}catch{}})}emitRenderEvent(t){if(this.renderEventCallbacks.size===0)return;let n=Date.now(),o=t.renderCause||{type:"unknown",timestamp:n},r={id:String(t.nativeTag),nativeTag:t.nativeTag,viewType:t.viewType,displayName:Rn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,renderCount:t.count,firstRenderTime:n,lastRenderTime:n,measurements:t.measurements,color:t.color,lastRenderCause:o,renderHistory:[]},i={id:`${t.nativeTag}-${n}-${t.count}`,timestamp:n,renderNumber:t.count,cause:o,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(i,r)}startBatch(){this.isBatchMode=true,this.batchDirty=false}endBatch(){this.isBatchMode=false,this.batchDirty&&(this.batchDirty=false,this.notifyListeners())}getRenders(){return Array.from(this.renders.values()).map(t=>({...t}))}passesFilters(t){if(this.filters.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,this.filters.includePatterns)||this.filters.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,this.filters.excludePatterns))return false;if(this.filters.includeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(!this.matchesPattern(n,this.filters.includeViewType)&&!this.matchesPattern(o,this.filters.includeViewType))return false}if(this.filters.includeTestID.size>0&&(!t.testID||!this.matchesPattern(t.testID,this.filters.includeTestID))||this.filters.includeNativeID.size>0&&(!t.nativeID||!this.matchesPattern(t.nativeID,this.filters.includeNativeID))||this.filters.includeComponent.size>0&&(!t.componentName||!this.matchesPattern(t.componentName,this.filters.includeComponent)))return false;if(this.filters.excludeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(this.matchesPattern(n,this.filters.excludeViewType)||this.matchesPattern(o,this.filters.excludeViewType))return false}return!(this.filters.excludeTestID.size>0&&t.testID&&this.matchesPattern(t.testID,this.filters.excludeTestID)||this.filters.excludeNativeID.size>0&&t.nativeID&&this.matchesPattern(t.nativeID,this.filters.excludeNativeID)||this.filters.excludeComponent.size>0&&t.componentName&&this.matchesPattern(t.componentName,this.filters.excludeComponent))}matchesAnyPatternForInfo(t,n){for(let o of n){let r=o.value.toLowerCase();switch(o.type){case"any":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r)||t.testID?.toLowerCase().includes(r)||t.nativeID?.toLowerCase().includes(r)||t.componentName?.toLowerCase().includes(r)||t.accessibilityLabel?.toLowerCase().includes(r))return true;break;case"viewType":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r))return true;break;case"testID":if(t.testID?.toLowerCase().includes(r))return true;break;case"nativeID":if(t.nativeID?.toLowerCase().includes(r))return true;break;case"component":if(t.componentName?.toLowerCase().includes(r))return true;break;case"accessibilityLabel":if(t.accessibilityLabel?.toLowerCase().includes(r))return true;break}}return false}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||this.filters.minRenderCount!==void 0||this.filters.maxRenderCount!==void 0}getFilteredRenders(t=""){let n=this.getRenders();if(this.settings.showHostViews||(n=n.filter(Ma)),t.trim()){let o=t.toLowerCase();n=n.filter(r=>r.viewType.toLowerCase().includes(o)||r.displayName.toLowerCase().includes(o)||r.testID?.toLowerCase().includes(o)||r.nativeID?.toLowerCase().includes(o)||r.accessibilityLabel?.toLowerCase().includes(o)||r.componentName?.toLowerCase().includes(o)||String(r.nativeTag).includes(o))}return n=n.filter(o=>this.passesFilters(o)),this.filters.minRenderCount!==void 0&&(n=n.filter(o=>o.renderCount>=this.filters.minRenderCount)),this.filters.maxRenderCount!==void 0&&(n=n.filter(o=>o.renderCount<=this.filters.maxRenderCount)),n.sort((o,r)=>r.lastRenderTime-o.lastRenderTime)}matchesPattern(t,n){let o=t.toLowerCase();for(let r of n){let i=r.toLowerCase();if(o.includes(i))return true}return false}getRender(t){return this.renders.get(t)}clear(){this.renders.clear(),this.notifyListeners()}resetRenderCount(t){let n=this.renders.get(t);n&&(n.renderCount=0,this.notifyListeners())}start(){this.isTracking=true,this.isPaused=false,this.notifyStateListeners()}stop(){this.isTracking=false,this.isPaused=false,this.notifyStateListeners()}pause(){this.isPaused=true,this.notifyStateListeners()}resume(){this.isPaused=false,this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused,this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}replaceRenders(t,n){let o=new Map;for(let[r,i]of this.renders)i.renderHistory&&i.renderHistory.length>0&&o.set(r,i.renderHistory);this.renders=new Map(t.map(r=>{let i=o.get(r.id),a=i&&!(r.renderHistory&&r.renderHistory.length>0)?{...r,renderHistory:i}:r;return[a.id,a]})),n&&(this.isTracking!==n.isTracking||this.isPaused!==n.isPaused)&&(this.isTracking=n.isTracking,this.isPaused=n.isPaused,this.notifyStateListeners()),this.notifyListeners()}hydrateRender(t){let n=this.renders.get(t.id);this.renders.set(t.id,n?{...n,...t}:t),this.notifyListeners()}getFilters(){return this.filters}setFilters(t){this.filters={...this.filters,...t},this.notifyListeners(),this.notifyFilterListeners()}addIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}addExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0},this.notifyListeners()}getAvailableProps(){let t=new Set,n=new Set,o=new Set,r=new Set,i=new Set;for(let a of this.renders.values())a.viewType&&t.add(a.viewType),a.testID&&n.add(a.testID),a.nativeID&&o.add(a.nativeID),a.componentName&&r.add(a.componentName),a.accessibilityLabel&&i.add(a.accessibilityLabel);return{viewTypes:Array.from(t).sort(),testIDs:Array.from(n).sort(),nativeIDs:Array.from(o).sort(),componentNames:Array.from(r).sort(),accessibilityLabels:Array.from(i).sort()}}getStats(){let t=0;for(let n of this.renders.values())t+=n.renderCount;return{totalComponents:this.renders.size,totalRenders:t}}subscribe(t){return this.listeners.add(t),t(this.getRenders()),()=>{this.listeners.delete(t)}}subscribeToState(t){return this.stateListeners.add(t),t(this.getState()),()=>{this.stateListeners.delete(t)}}subscribeToSettings(t){return this.settingsListeners.add(t),t(this.settings),()=>{this.settingsListeners.delete(t)}}subscribeToFilters(t){return this.filterListeners.add(t),t(this.filters),()=>{this.filterListeners.delete(t)}}onRenderEvent(t){return this.renderEventCallbacks.add(t),()=>{this.renderEventCallbacks.delete(t)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(t){let n=this.filters;return!(n.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,n.includePatterns)||n.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,n.excludePatterns)||(n.includeViewType.size>0||n.includeTestID.size>0||n.includeNativeID.size>0||n.includeComponent.size>0)&&!(n.includeViewType.size>0&&n.includeViewType.has(t.viewType)||n.includeTestID.size>0&&t.testID&&n.includeTestID.has(t.testID)||n.includeNativeID.size>0&&t.nativeID&&n.includeNativeID.has(t.nativeID)||n.includeComponent.size>0&&t.componentName&&n.includeComponent.has(t.componentName))||n.excludeViewType.has(t.viewType)||t.testID&&n.excludeTestID.has(t.testID)||t.nativeID&&n.excludeNativeID.has(t.nativeID)||t.componentName&&n.excludeComponent.has(t.componentName))}getSettings(){return{...this.settings}}setSettings(t){t.batchSize!==void 0&&(t.batchSize=Math.max(10,Math.min(500,t.batchSize))),t.maxRenderHistoryPerComponent!==void 0&&(t.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,t.maxRenderHistoryPerComponent))),t.enableRenderHistory&&!this.settings.trackRenderCauses&&(t.trackRenderCauses=true),t.trackRenderCauses===false&&this.settings.enableRenderHistory&&(t.enableRenderHistory=false),this.settings={...this.settings,...t},t.performanceLogging!==void 0&&Qe.setEnabled(t.performanceLogging),this.notifySettingsListeners()}clearAllRenderHistory(){for(let t of this.renders.values())t.renderHistory=[];this.notifyListeners()}clearRenderHistory(t){let n=this.renders.get(t);n&&(n.renderHistory=[],this.notifyListeners())}getRenderHistoryStats(){let t=0,n=0;for(let o of this.renders.values())o.renderHistory&&o.renderHistory.length>0&&(t+=o.renderHistory.length,n++);return{totalEvents:t,componentsWithHistory:n,averageEventsPerComponent:n>0?t/n:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(t){this.setSettings({batchSize:t})}notifyListeners(){let t=this.getRenders();for(let n of this.listeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in listener:",o)}}notifyStateListeners(){let t=this.getState();for(let n of this.stateListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in state listener:",o)}}notifySettingsListeners(){let t=this.getSettings();for(let n of this.settingsListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in settings listener:",o)}}notifyFilterListeners(){let t=this.getFilters();for(let n of this.filterListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in filter listener:",o)}}};l(Go,"RenderTrackerSingleton");Wa=Go,B=new Wa,ja=B});j();j();import{useState as Ko,useEffect as qo,useCallback as yd}from"react";import{HighlighterIcon as Ua,HighlightIcon as Ga}from"@buoy-gg/floating-tools-core/web";j();import{getDOMFiber as Jo,getDOMNodeHandle as Ka,getDOMPublicInstance as bd,isDOMElement as qa}from"@buoy-gg/shared-ui/web/utils";j();var It=null,Rt=null,Zt=false,en=false,Dn=null;function Yo(e){if(!e)return{type:"null"};let t=e,n={};if(t.canonical){n.type="Fabric";let o=t.canonical;if(o.publicInstance){let r=o.publicInstance;n.hasMeasure=typeof r.measure=="function",n.nativeTag=r.__nativeTag??r._nativeTag??"unknown"}}else typeof t.measure=="function"?(n.type="Legacy",n.hasMeasure=true,n.nativeTag=t.__nativeTag??t._nativeTag??t.nativeTag??"unknown"):(n.type="Unknown",n.keys=Object.keys(t).slice(0,10));return n}l(Yo,"describeNode");function Ja(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;!e||typeof e.emit!="function"||It||(It=e.emit.bind(e),e.emit=function(t,...n){if(t==="traceUpdates"&&en){let o=n[0];o.size>0&&console.log("[Buoy]",`[PROFILER] traceUpdates: ${o.size} nodes`,Array.from(o).map((r,i)=>({index:i,...Yo(r)}))),Dn&&Dn(o)}return It(t,...n)})}l(Ja,"swizzleHookEmit");function Ya(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.reactDevtoolsAgent;!e||typeof e.emit!="function"||Rt||(Rt=e.emit.bind(e),e.emit=function(t,...n){if(en&&t==="drawTraceUpdates"){let o=n[0];o.length>0&&console.log("[Buoy]",`[PROFILER] drawTraceUpdates: ${o.length} nodes`,o.map((r,i)=>({index:i,color:r.color,...Yo(r.node)})))}return Rt(t,...n)})}l(Ya,"swizzleAgentEmit");function Xa(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;e?.rendererInterfaces&&e.rendererInterfaces.forEach(t=>{if(typeof t.setTraceUpdatesEnabled=="function")try{t.setTraceUpdatesEnabled(false)}catch{}})}l(Xa,"disableTracingOnAllRenderers");function Xo(e){Dn=e}l(Xo,"setComparisonCallback");function Qo(){typeof ee<"u"&&!ee||Zt||(Ja(),Ya(),Zt=true)}l(Qo,"installProfilerInterceptor");function Zo(){if(!Zt)return;let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;It&&e&&(e.emit=It,It=null),Rt&&e?.reactDevtoolsAgent&&(e.reactDevtoolsAgent.emit=Rt,Rt=null),Xa(),Dn=null,Zt=false}l(Zo,"uninstallProfilerInterceptor");function Qa(){return Zt}l(Qa,"isInterceptorInstalled");function Za(){en=true}l(Za,"enableProfilerLogging");function el(){en=false}l(el,"disableProfilerLogging");function tl(){return en}l(tl,"isLoggingEnabled");var nl={};Na(nl,{AccessibilityInfo:()=>wd,ActivityIndicator:()=>ph,Alert:()=>mh,Animated:()=>dh,AppRegistry:()=>xd,AppState:()=>Id,Appearance:()=>Sd,BackHandler:()=>Rd,Button:()=>fh,CheckBox:()=>Hd,Clipboard:()=>kd,DeviceEventEmitter:()=>Qd,Dimensions:()=>Ze,Easing:()=>Dd,FlatList:()=>il,I18nManager:()=>Pd,Image:()=>Fd,ImageBackground:()=>Md,InteractionManager:()=>Nd,Keyboard:()=>ol,KeyboardAvoidingView:()=>$d,LayoutAnimation:()=>Ld,Linking:()=>zd,LogBox:()=>Xd,Modal:()=>dl,NativeEventEmitter:()=>Bd,NativeModules:()=>Td,PanResponder:()=>Vd,Picker:()=>Od,PixelRatio:()=>er,Platform:()=>rl,Pressable:()=>cl,ProgressBar:()=>_d,RefreshControl:()=>Wd,SafeAreaView:()=>jd,ScrollView:()=>Me,SectionList:()=>Ud,Share:()=>Ad,StatusBar:()=>Gd,StyleSheet:()=>Ce,Switch:()=>Pt,Text:()=>p,TextInput:()=>Nn,Touchable:()=>Kd,TouchableHighlight:()=>hh,TouchableNativeFeedback:()=>qd,TouchableOpacity:()=>Y,TouchableWithoutFeedback:()=>gh,UIManager:()=>tn,Vibration:()=>Ed,View:()=>g,VirtualizedList:()=>Jd,YellowBox:()=>Yd,findNodeHandle:()=>Nt,unstable_createElement:()=>Cd,useColorScheme:()=>Zd,useLocaleContext:()=>eh,useWindowDimensions:()=>th});j();pd(nl,vd);import*as vd from"react-native-web";import{unstable_createElement as Cd,NativeModules as Td,AccessibilityInfo as wd,Appearance as Sd,AppRegistry as xd,AppState as Id,BackHandler as Rd,Clipboard as kd,Dimensions as Ze,Easing as Dd,I18nManager as Pd,Keyboard as ol,InteractionManager as Nd,LayoutAnimation as Ld,Linking as zd,NativeEventEmitter as Bd,PanResponder as Vd,PixelRatio as er,Platform as rl,Share as Ad,UIManager as tn,Vibration as Ed,CheckBox as Hd,FlatList as il,Image as Fd,ImageBackground as Md,KeyboardAvoidingView as $d,Picker as Od,ProgressBar as _d,RefreshControl as Wd,SafeAreaView as jd,SectionList as Ud,StatusBar as Gd,Touchable as Kd,TouchableNativeFeedback as qd,VirtualizedList as Jd,YellowBox as Yd,LogBox as Xd,DeviceEventEmitter as Qd,useColorScheme as Zd,useLocaleContext as eh,useWindowDimensions as th}from"react-native-web";import*as fe from"react-native-web";import{createElement as tr,forwardRef as al,useCallback as nh,useRef as oh}from"react";j();import{useEffect as rh,useState as ih}from"react";import{createPortal as ah}from"react-dom";j();var lh='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as sh}from"react/jsx-runtime";var nn=Symbol.for("@buoy-gg/portal-host"),ll=l(e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"},"isTextField");function nr(){let e=document;if(e[nn])return e[nn].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:lh});let n=l(()=>{let d=document.fullscreenElement,h=d&&d.tagName!=="CANVAS"?d:document.body;t.parentElement!==h&&h.appendChild(t)},"move"),o=new Map,r=l(d=>{(!t.contains(d.target)||!ll(d.target))&&o.set(d.code||d.key,{key:d.key,code:d.code,location:d.location,keyCode:d.keyCode,which:d.which,altKey:d.altKey,ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey})},"down"),i=l(d=>{o.delete(d.code||d.key)},"up"),a=l(()=>o.clear(),"clear"),s=l(()=>{let d=[...o.values()];o.clear();for(let h of d)document.dispatchEvent(new KeyboardEvent("keyup",{...h,bubbles:true}))},"focus"),u=l(d=>{ll(d.target)&&d.stopPropagation()},"key"),c=l(d=>d.stopPropagation(),"wheel");return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",r,true),document.addEventListener("keyup",i,true),window.addEventListener("blur",a),t.addEventListener("focusin",s),t.addEventListener("keydown",u),t.addEventListener("keyup",u),t.addEventListener("keypress",u),t.addEventListener("wheel",c,{passive:true}),e[nn]={host:t,users:0,dispose:l(()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",r,true),document.removeEventListener("keyup",i,true),window.removeEventListener("blur",a),t.remove(),delete e[nn]},"dispose")},t}l(nr,"getBuoyPortalHost");function sl({children:e}){let[t,n]=ih(null);return rh(()=>{let o=nr(),r=document[nn];return r.users++,n(o),()=>{--r.users===0&&r.dispose()}},[]),t?ah(sh("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}l(sl,"BuoyPortal");var kt=fe,ch=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Dt=l(e=>typeof e=="number"?`${e}px`:e,"px");function Pn(e){if(Array.isArray(e)){let h=e.map(Pn);return h.some((T,m)=>T!==e[m])?h:e}if(!e||typeof e!="object"||!ch.some(h=>e[h]!=null))return e;let{shadowColor:t,shadowOffset:n,shadowOpacity:o,shadowRadius:r,textShadowColor:i,textShadowOffset:a,textShadowRadius:s,...u}=e;if(t!=null||n!=null||o!=null||r!=null){let h=t??"black",T=o==null?h:`color-mix(in srgb, ${h} ${Math.min(o,1)*100}%, transparent)`,m=`${Dt(n?.width??0)} ${Dt(n?.height??0)} ${Dt(r??0)} ${T}`;u.boxShadow=typeof u.boxShadow=="string"?`${u.boxShadow}, ${m}`:u.boxShadow??m}let{width:c=0,height:d=0}=a??{};if(i&&(c||d||s)){let h=`${Dt(c)} ${Dt(d)} ${Dt(s??0)} ${i}`;u.textShadow=u.textShadow?`${u.textShadow}, ${h}`:h}return u}l(Pn,"webShadows");var uh=kt.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function or(e,t){if(typeof e=="function")return o=>or(e(o),t);let n=Pn(e);return t?[n,uh[t]]:n}l(or,"webStyle");var Ce={...kt.StyleSheet,create:l(e=>kt.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Pn(n)]))),"create")};function Te(e){let t=al((o,r)=>{let{accessibilityState:i,accessibilityValue:a,pointerEvents:s,...u}=o;for(let d of["busy","checked","disabled","expanded","selected"])i?.[d]!==void 0&&u[`aria-${d}`]===void 0&&(u[`aria-${d}`]=i[d]);for(let[d,h]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))a?.[d]!==void 0&&u[`aria-${h}`]===void 0&&(u[`aria-${h}`]=a[d]);let c=or(u.style,s);return c!==u.style&&(u.style=c),tr(e,{...u,ref:r})}),n=e.State;return n&&Object.assign(t,{State:n}),t.displayName=e.displayName??e.name??"NativeWebView",t}l(Te,"withAccessibility");var g=Te(fe.View),p=Te(fe.Text),dh={...kt.Animated,View:kt.Animated.createAnimatedComponent(g),Text:kt.Animated.createAnimatedComponent(p)},Nn=Te(fe.TextInput),Y=Te(fe.TouchableOpacity),hh=Te(fe.TouchableHighlight),gh=Te(fe.TouchableWithoutFeedback),cl=Te(fe.Pressable),Me=Te(fe.ScrollView),ul=al((e,t)=>{let n=oh(null),o=nh(r=>{if(r){let i=r;for(;i.parentElement&&i.parentElement!==document.body;)i=i.parentElement;i.parentElement===document.body&&(n.current=i,Object.assign(i.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),nr().appendChild(i))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof t=="function"?t(r):t&&(t.current=r)},[t]);return tr(sl,null,tr(fe.Modal,{...e,ref:o}))});ul.displayName="Modal";var dl=Te(ul),Pt=Te(fe.Switch),ph=Te(fe.ActivityIndicator),fh=Te(fe.Button),Nt=fe.findNodeHandle,mh={alert(e,t,n,o){if(typeof document>"u")return;let r=document.createElement("dialog");r.dataset.buoyRoot="",r.setAttribute("aria-label",e),r.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",r.appendChild(i),t){let c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",r.appendChild(c)}let a=document.createElement("div");a.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let s=n?.length?n:[{text:"OK"}],u=l(()=>{r.close?.(),r.remove()},"close");for(let c of s){let d=document.createElement("button");d.type="button",d.textContent=c.text??"OK",d.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,d.onclick=()=>{u(),c.onPress?.()},a.appendChild(d)}r.addEventListener("cancel",c=>{c.preventDefault(),o?.cancelable!==false&&(u(),o?.onDismiss?.())}),r.appendChild(a),document.body.appendChild(r),r.showModal?r.showModal():r.setAttribute("open","")}};Ve();j();import{getDOMControlProps as yh,getDOMNodeHandle as Ln,getDOMPublicInstance as hl,isDOMElement as on}from"@buoy-gg/shared-ui/web/utils";j();function rr(e){return e?e.x>=-.1&&e.x<=1.1&&e.y>=-.1&&e.y<=1.1:false}l(rr,"isOnScreenTap");function zn(e,t,n){if(!e||t<=0||n<=0)return false;let o=e.x+e.width/2,r=e.y+e.height/2,i=t*.1,a=n*.1;return o>=-i&&o<=t+i&&r>=-a&&r<=n+a}l(zn,"isRectCenterOnScreen");function ir(e){return String(e??"").toLowerCase().replace(/\s+/g," ").replace(/(\d)[,\u00a0\u202f](?=\d{3}\b)/g,"$1").trim()}l(ir,"looseText");function Lt(e,t){if(t.nativeTag!=null&&e.nativeTag===t.nativeTag)return 1e3;if(t.testID&&!t.query){if(!e.testID||e.testID.toLowerCase()!==t.testID.trim().toLowerCase())return 0;let a=200;return e.tap&&(a+=rr(e.tap)?20:-40),a}let n=String(t.query??t.testID??"").trim().toLowerCase();if(!n)return 0;let o=[e.testID,e.label,e.text,e.name].filter(Boolean).map(a=>a.toLowerCase()),r=0;for(let a of o)a===n?r=Math.max(r,100):a.startsWith(n)?r=Math.max(r,50):a.includes(n)&&(r=Math.max(r,25));let i=ir(n);if(i)for(let a of o){let s=ir(a);s===i?r=Math.max(r,90):s.startsWith(i)?r=Math.max(r,45):s.includes(i)&&(r=Math.max(r,22))}return t.testID&&e.testID&&e.testID.toLowerCase()===t.testID.toLowerCase()&&(r=Math.max(r,200)),r===0?0:((e.testID??"").toLowerCase().startsWith("buoy-dial-")&&(r+=40),e.tap&&(rr(e.tap)?r+=20:r-=40),r)}l(Lt,"scoreTapMatch");j();import{getDOMControlProps as bh}from"@buoy-gg/shared-ui/web/utils";var vh=new Set(["button","link","menuitem","tab","switch","checkbox","radio","option","textbox","slider"]),Ch=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE","SVG","PATH","HEAD","META","LINK"]),ar=80;function gl(e){for(let t in e)if(t.startsWith("__reactContainer$")||t==="_reactRootContainer")return true;return false}l(gl,"isReactContainer");function lr(e){if(e.getAttribute("aria-hidden")==="true")return true;let t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}l(lr,"isHidden");function sr(e){let t=e;return typeof t.$$click=="function"||typeof t.onclick=="function"||e.tabIndex>=0&&e.hasAttribute("tabindex")}l(sr,"hasClick");var Th=new Set(["B","STRONG","EM","I","U","S","SPAN","SMALL","MARK","CODE","SUB","SUP","ABBR","CITE","Q","TIME","BR"]);function cr(e){return Array.from(e.childNodes).some(t=>t.nodeType===3&&(t.textContent??"").trim()!=="")}l(cr,"hasOwnText");function ur(e){return Th.has(e.tagName.toUpperCase())&&!e.hasAttribute("data-testid")&&!e.hasAttribute("aria-label")&&!e.hasAttribute("role")&&!sr(e)&&!e.querySelector(`${hr}, [role], [data-testid], [aria-label]`)}l(ur,"isPlainInline");function pl(e){let t="",n=cr(e),o=l(r=>{if(r.nodeType===3)t+=r.textContent??"";else if(n&&r.nodeType===1){let i=r;i.tagName==="BR"?t+=" ":ur(i)&&!lr(i)&&i.childNodes.forEach(o)}},"add");return e.childNodes.forEach(o),t=t.replace(/\s+/g," ").trim(),t||void 0}l(pl,"ownText");function dr(e,t){if(e)return t||e.length<=ar?e:`${e.slice(0,ar)}\u2026`}l(dr,"clip");function fl(e,t){return dr((e.innerText??e.textContent??"").replace(/\s+/g," ").trim(),t)}l(fl,"allText");var et="input, textarea, select",hr=`${et}, button, a[href]`;function rn(e){let t="",n=l(o=>{o.nodeType===3?t+=o.textContent??"":o.nodeType===1&&!o.matches(et)&&o.childNodes.forEach(n)},"visit");return n(e),t.replace(/\s+/g," ").trim()}l(rn,"readText");function gr(e){let t=e;for(let n=0;n<3;n++){let o=t.previousElementSibling;if(o){let i=rn(o);return i&&i.length<=ar&&!o.matches(hr)&&!o.querySelector(hr)?o:null}let r=t.parentElement;if(!r||r.querySelectorAll(et).length>1)return null;t=r}return null}l(gr,"nearbyLabel");function ml(e){let t=(e.getAttribute("aria-labelledby")??"").split(/\s+/).map(r=>r&&document.getElementById(r)?rn(document.getElementById(r)):"").filter(Boolean).join(" "),n=Array.from(e.labels??[]).map(rn).filter(Boolean).join(" "),o=e.matches(et)?gr(e):null;return t||e.getAttribute("aria-label")||n||e.getAttribute("title")||e.getAttribute("placeholder")||(o?rn(o):"")}l(ml,"accessibleName");function yl(e){let t=e.closest("label")?.control;if(t instanceof HTMLElement)return t;let n=e.closest("[id]")?.id;if(n){for(let o of Array.from(document.querySelectorAll("[aria-labelledby]")))if(o.matches(`${et}, [role=textbox]`)&&o.getAttribute("aria-labelledby").split(/\s+/).includes(n))return o}for(let o=e,r=0;o&&r<3;o=o.parentElement,r++){let i=o.nextElementSibling,a=i?.matches(et)?i:i?.querySelector(et);if(a instanceof HTMLElement&&gr(a)===o)return a}return null}l(yl,"labeledField");function pr(e={}){if(typeof document>"u"||!document.body)return[];let t=[],n=l((o,r,i)=>{if(Ch.has(o.tagName.toUpperCase())||gl(o)||lr(o))return;let a=i||o.hasAttribute("data-buoy-root")||o.hasAttribute("data-buoy-portal-host"),s=o.tagName.toLowerCase(),u=o.getAttribute("role")??void 0,c=s==="button"||s==="a"&&o.hasAttribute("href")||s==="input"||s==="textarea"||s==="select"||u!==void 0&&vh.has(u)||sr(o),d=o.getAttribute("data-testid")??void 0,h=c?dr(ml(o),!!e.fullText):o.getAttribute("aria-label")??void 0,T=c?fl(o,!!e.fullText):r?void 0:pl(o);if(c||d||h||T){let b={"data-testid":d,"aria-label":h,role:u,id:o.id||void 0};c&&s!=="input"&&s!=="textarea"&&s!=="select"&&(b.onClick=()=>o.click());let f=bh(o,b);if(u==="switch"||u==="checkbox"){let S=o.getAttribute("aria-checked")==="true";f.value=S,f.onValueChange=v=>{!!v!=(o.getAttribute("aria-checked")==="true")&&o.click()},delete f.onPress}o.disabled&&delete f.onPress,t.push({element:o,props:f,text:T,buoy:a})}let m=!c&&!r&&cr(o);for(let b of Array.from(o.children))m&&ur(b)||b instanceof HTMLElement&&n(b,r||c,a)},"walk");return n(document.body,false,false),t}l(pr,"collectDOMElements");function Bn(e){let t=globalThis[Symbol.for("buoy.dom.componentName")];try{let n=t?.(e);if(n)return n}catch{}return e.tagName.toLowerCase()}l(Bn,"domElementName");function bl(){if(typeof MutationObserver>"u"||typeof document>"u")return()=>0;let e=0,t=new MutationObserver(()=>{e+=1});return t.observe(document.body,{subtree:true,childList:true,characterData:true,attributes:true}),()=>(t.disconnect(),e)}l(bl,"watchDOMChanges");var Vn=5,wh=22,fr=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function mr(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}l(mr,"getReactDevToolsHook");var yr=0,vl=false;function Cl(){if(vl)return;let e=mr();if(!e)return;let t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){return yr++,typeof t=="function"?t.apply(e,n):void 0},vl=true}l(Cl,"ensureCommitCounter");var Sh=250;function br(){let e=new Map;return t=>{let n=[],o=t,r=0,i=false;for(;o&&r<400;){let a=e.get(o);if(a!==void 0){i=a;break}if(le(o)?.__buoyDevToolsRoot){i=true,e.set(o,true);break}n.push(o),o=o.return,r++}for(let a of n)e.set(a,i);return i}}l(br,"makeChromeCheck");function $e(){let e=mr();if(!e)return[];let t=[];try{if(e.renderers&&typeof e.renderers.forEach=="function"&&e.renderers.forEach((n,o)=>{try{let r=e.getFiberRoots?.(o);r&&r.forEach(i=>t.push(i))}catch{}}),t.length===0&&e.getFiberRoots){let n=e.getFiberRoots(1);n&&n.forEach(o=>t.push(o))}}catch{}return t}l($e,"getAllFiberRoots");function vr(e){return e.tag===wh&&e.memoizedState!==null}l(vr,"isHiddenOffscreen");var tt=false,Cr=0,an=false;function Tr(e,t){let n=tt;tt=e;try{return t()}finally{tt=n}}l(Tr,"withHiddenScreens");function Tl(e){let t=e.memoizedProps;return t?t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t)||t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t):false}l(Tl,"isNotShowingScreen");function wr(e){let t=e.memoizedProps?.activityState;return t===0||t===1||e.memoizedProps?.isPageFocused===false?true:!tt&&Tl(e)?(Cr++,true):false}l(wr,"isInactiveScreen");function Ae(e,t,n=0,o=new Set){if(!(!e||o.has(e)||n>500)){if(o.add(e),vr(e)||wr(e)){e.sibling&&Ae(e.sibling,t,n,o);return}t(e),e.child&&Ae(e.child,t,n+1,o),e.sibling&&Ae(e.sibling,t,n,o)}}l(Ae,"traverseFiberTree");function An(e){let t=hl(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"||typeof n.measureInWindow=="function"?n:null}l(An,"getPublicInstance");function nt(e){let t=Ln(e);if(t!==null)return t;if(e==null)return null;let n=e;if(typeof n.__nativeTag=="number")return n.__nativeTag;if(typeof n._nativeTag=="number")return n._nativeTag;if(typeof n.nativeTag=="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag=="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag=="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag=="number")return n.canonical.nativeTag}return null}l(nt,"getNativeTag");function En(e){let t=An(e.stateNode);if(t)return{instance:t,nativeTag:nt(e.stateNode),stateNode:e.stateNode};let n=[];e.child&&n.push(e.child);let o=0;for(;n.length>0&&o<4e3;){o++;let r=n.pop();if(!r)continue;let i=An(r.stateNode);if(i)return{instance:i,nativeTag:nt(r.stateNode),stateNode:r.stateNode};r.child&&n.push(r.child),r.sibling&&n.push(r.sibling)}return null}l(En,"findHostInstance");function wl(e){let t=e,n=0;for(;t&&n++<200;){let o=t.stateNode;if(o&&typeof o.scrollTo=="function"){let r=typeof o.getNativeScrollRef=="function"&&o.getNativeScrollRef()||null,i=typeof o.getInnerViewNode=="function"&&o.getInnerViewNode()||typeof o.getScrollableNode=="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:i}}t=t.return}return null}l(wl,"findScrollAncestor");async function Sl(e,t,n,o){try{if(on(n))return n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}),await new Promise(u=>setTimeout(u,16)),true;let r=wl(e);if(!r)return false;let i=t,a=null,s=l(u=>new Promise(c=>{let d=false,h=l(m=>{d||(d=true,c(m))},"settle"),T=setTimeout(()=>h(null),600);try{u(m=>{clearTimeout(T),h(m)})}catch{clearTimeout(T),h(null)}}),"withTimeout");if(r.nativeRef&&typeof i.measureLayout=="function"&&(a=await s(u=>i.measureLayout(r.nativeRef,(c,d)=>u(d),()=>u(null)))),a==null){let u=Nt(t),c=typeof r.innerNode=="number"?r.innerNode:Nt(r.innerNode);u!=null&&c!=null&&(a=await s(d=>tn.measureLayout(u,c,()=>d(null),(h,T)=>d(T))))}return a==null?false:(r.instance.scrollTo({y:Math.max(0,a-o),animated:false}),await new Promise(u=>setTimeout(u,120)),true)}catch{return false}}l(Sl,"scrollIntoView");function Oe(e){let t=e?.type;return t?typeof t=="string"?t:t.displayName||t.name||null:null}l(Oe,"getComponentName");function Hn(e){let t=e?._debugOwner||e?.return,n=0;for(;t&&n<30;){n++;let o=Oe(t);if(o&&!fr.has(o)&&typeof t.type!="string")return o;t=t.return}return null}l(Hn,"getOwningComponentName");function le(e){return yh(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}l(le,"getProps");function Sr(e,t=0){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){let n=[];for(let o of e){let r=Sr(o,t+1);r&&n.push(r)}return n.length>0?n.join(""):void 0}}l(Sr,"flattenText");function xl(e){return e.replace(/\s+/g," ").trim()}l(xl,"normalizeVisibleText");function Fn(e){if(!e)return;let t=l(n=>{let o=Sr(n);if(o===void 0)return;let r=xl(o);return r?an?r:r.slice(0,80):void 0},"pick");return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}l(Fn,"getVisibleText");function Il(e,t){let n=[],o=l((i,a)=>{if(!i||a>t||n.length>=4)return;if(i!==e){let u=le(i);if(u&&(typeof u.onPress=="function"||typeof u.onLongPress=="function"))return}let s=Fn(le(i));s&&!n.includes(s)&&n.push(s),i.child&&o(i.child,a+1),i!==e&&i.sibling&&o(i.sibling,a)},"visit");e.child&&o(e.child,1);let r=n.join(" ").trim();return r?r.slice(0,80):void 0}l(Il,"collectDescendantText");function Rl(e){let t=e,n=0,o=null,r=null;for(;t&&n<25&&!(o&&r);){let i=le(t);i&&(!o&&typeof i.onPress=="function"&&(o=i.onPress),!r&&typeof i.onLongPress=="function"&&(r=i.onLongPress)),t=t.return,n++}return o?{handler:o,kind:"onPress",longPress:r??void 0}:r?{handler:r,kind:"onLongPress"}:null}l(Rl,"findPressHandler");function _e(e){return new Promise(t=>{let n=false,o=l(r=>{n||(n=true,t(r))},"done");setTimeout(()=>o(null),1e3);try{typeof e.measureInWindow=="function"?e.measureInWindow((r,i,a,s)=>{a>0&&s>0?o({x:r,y:i,width:a,height:s}):o(null)}):typeof e.measure=="function"?e.measure((r,i,a,s,u,c)=>{a>0&&s>0&&u!=null&&c!=null?o({x:u,y:c,width:a,height:s}):o(null)}):o(null)}catch{o(null)}})}l(_e,"measureInstance");var xh=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function Mn(){let e=$e(),t=[],n=new Map,o=new Map,r=br();for(let i of e)Ae(i.current,a=>{let s=le(a);if(!s)return;let u=typeof s.onPress=="function"||typeof s.onLongPress=="function",c=typeof s.onValueChange=="function",d=typeof s.onChangeText=="function",h=s.testID||void 0,T=s.accessibilityLabel||void 0,m=s.accessibilityRole||s.role||void 0,b=Fn(s),f=m==="button"||m==="link"||m==="menuitem"||m==="tab"||m==="switch"||m==="checkbox",S=typeof a.type=="string"&&xh.has(a.type)&&s.animating!==false;if(!u&&!c&&!d&&!h&&!T&&!b&&!f&&!S)return;let v=null,L=null,P=null;if(c){let x=s.value,z=typeof x=="number"||typeof s.minimumValue=="number";L={handler:s.onValueChange,kind:z?"slider":"toggle",current:x,min:typeof s.minimumValue=="number"?s.minimumValue:void 0,max:typeof s.maximumValue=="number"?s.maximumValue:void 0}}else d?P={handler:s.onChangeText,current:typeof s.value=="string"?s.value:void 0}:v=Rl(a);let C=Oe(a),I=C??"Unknown";(!C||fr.has(C)||typeof a.type=="string")&&(I=Hn(a)??C??"Unknown");let k=En(a);if(!k&&!h)return;!b&&!T&&u&&(b=Il(a,6));let W=k?.instance??null,X=k?.nativeTag??null,V=(W?n.get(W):void 0)??(X!=null?o.get(X):void 0);if(V){!V.press&&v?V.press=v:V.press&&v?.longPress&&!V.press.longPress&&(V.press.longPress=v.longPress),!V.valueControl&&L&&(V.valueControl=L),!V.textControl&&P&&(V.textControl=P),!V.testID&&h&&(V.testID=h),!V.label&&T&&(V.label=T),!V.text&&b&&(V.text=b),W&&!n.has(W)&&n.set(W,V),X!=null&&!o.has(X)&&o.set(X,V);return}let U={nativeTag:X,name:I,role:m??(S?"progressbar":void 0),testID:h,label:T,text:b,instance:W,stateNode:k?.stateNode??null,fiber:a,press:v,valueControl:L,textControl:P,rect:null,buoy:r(a)};t.push(U),W&&n.set(W,U),X!=null&&o.set(X,U)});return t.push(...xr()),t}l(Mn,"collectCandidates");function xr(){return pr({fullText:an}).map(({element:e,props:t,text:n,buoy:o})=>{let r=typeof t.onValueChange=="function"?{handler:t.onValueChange,kind:typeof t.value=="number"?"slider":"toggle",current:t.value,min:t.minimumValue,max:t.maximumValue}:null,i=!r&&typeof t.onChangeText=="function"?{handler:t.onChangeText,current:t.value}:null,a=!r&&!i&&typeof t.onPress=="function"?{handler:t.onPress,kind:"onPress"}:null;return{nativeTag:Ln(e),name:Bn(e),role:t.accessibilityRole,testID:t.testID,label:t.accessibilityLabel,text:n,instance:hl(e),stateNode:e,fiber:null,buoy:o,press:a,valueControl:r,textControl:i,rect:null}})}l(xr,"collectDOMCandidates");function kl(e,t){return t.nativeTag!=null?e.nativeTag===t.nativeTag:t.testID&&e.testID?e.testID.toLowerCase()===t.testID.toLowerCase():false}l(kl,"explicitlyTargets");function $n(e){let t=Mn();return e.includeBuoy?t:t.filter(n=>!n.buoy||kl(n,e))}l($n,"appCandidates");async function Ir(e){await Promise.all(e.map(async t=>{t.instance&&(t.rect=await _e(t.instance))}))}l(Ir,"measureCandidates");var Ih=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function Dl(e,t){let n=[],o=br();for(let i of $e())Ae(i.current,a=>{if(Oe(a)!=="VirtualizedList")return;let s=a.memoizedProps;if(!s||typeof s.getItemCount!="function"||!e&&o(a))return;let u;try{u=Number(s.getItemCount(s.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;let c=[],d=l((m,b)=>{for(let f=m?.child;f;f=f.sibling){let S=Oe(f);if(S!=="VirtualizedList"){if(S==="CellRenderer"){c.push(f);continue}b<40&&d(f,b+1)}}},"walk");d(a,0);let h=a,T=Hn(h);for(let m=0;m<6&&T&&Ih.test(T);m++)h=h._debugOwner||h.return,T=Hn(h);n.push({owner:T,items:u,cells:c})});let r=[];for(let i of n){let a=(await Promise.all(i.cells.map(async s=>{let u=En(s);return u?_e(u.instance):null}))).filter(t).length;a>0&&i.items>a&&r.push({owner:i.owner,items:i.items,listed:a})}return r}l(Dl,"collectLists");async function ln(e={}){let t=tt,n=an;tt=!!e.includeHidden,an=!!e.fullText;try{return await Pl(e)}finally{tt=t,an=n}}l(ln,"describeScreen");async function Pl(e){Cr=0;let t=Mn(),n=Cr,o=e.includeBuoy?t:t.filter(d=>!d.buoy),r=t.length-o.length;await Ir(o);let i=Ze.get("window"),a=Math.round(i.width)||1,s=Math.round(i.height)||1,u=[];for(let d of o){let h=d.rect;if(!h&&!d.testID)continue;let T,m;if(h){let S=h.x+h.width/2,v=h.y+h.height/2;if(v<-s*.1||v>s*1.1||S<-a*.1||S>a*1.1)continue;T={x:De(S/a),y:De(v/s)},m={x:De(h.x/a),y:De(h.y/s),width:De(h.width/a),height:De(h.height/s)}}let b=d.valueControl?d.valueControl.kind:d.textControl?"text":void 0,f=d.valueControl?d.valueControl.current:d.textControl?.current;u.push({nativeTag:d.nativeTag,name:d.name,role:d.role,testID:d.testID,label:d.label,text:d.text,interactive:!!(d.press||d.valueControl||d.textControl),longPressable:d.press&&(d.press.kind==="onLongPress"||d.press.longPress)?true:void 0,control:b,value:f,tap:T,frame:m})}u.sort((d,h)=>{let T=d.tap?.y??2,m=h.tap?.y??2;return Math.abs(T-m)>.02?T-m:(d.tap?.x??2)-(h.tap?.x??2)});let c=await Dl(!!e.includeBuoy,d=>{if(!d)return false;let h=d.x+d.width/2;return d.y<=s*1.1&&d.y+d.height>=-s*.1&&h>=-a*.1&&h<=a*1.1});return{screen:{width:a,height:s},count:u.length,elements:u,...r>0?{hiddenBuoy:r}:{},...n>0?{hiddenScreens:n}:{},...c.length?{lists:c}:{}}}l(Pl,"describeScreenInner");function De(e){return Math.round(e*100)/100}l(De,"round2");function Rr(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}l(Rr,"fieldsOf");function On(e,t){return Lt(Rr(e),t)}l(On,"matchScore");function kr(e,t,n){if(!(!e||!t||!n))return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}l(kr,"tapPoint");function Dr(e){let t=e?e.x+e.width/2:0,n=e?e.y+e.height/2:0;return{nativeEvent:{locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]},persist:l(()=>{},"persist"),preventDefault:l(()=>{},"preventDefault"),stopPropagation:l(()=>{},"stopPropagation"),isDefaultPrevented:l(()=>false,"isDefaultPrevented"),isPropagationStopped:l(()=>false,"isPropagationStopped"),target:null,currentTarget:null,type:"press",timeStamp:0}}l(Dr,"makeSyntheticPressEvent");async function Nl(e){let t=Tr(!!e.includeHidden,()=>$n(e));if(t.length===0)return{tapped:false,reason:"Nothing on screen to tap: no React elements and no page elements were found."};let n=t.map(C=>({c:C,score:On(C,e)})).filter(C=>C.score>0).sort((C,I)=>I.score-C.score),o=l(C=>!!(C.press||C.valueControl||C.textControl),"isInteractive");if(n.length===0&&!e.includeHidden&&Tr(true,()=>$n(e)).map(C=>({c:C,score:On(C,e)})).filter(C=>C.score>0).length>0)return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."};if(n.length===0)return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(o).slice(0,12).map(C=>({nativeTag:C.nativeTag,name:C.name,testID:C.testID,text:C.text}))};let r=Ze.get("window"),i=r.width||1,a=r.height||1,s=n.slice(0,15);await Promise.all(s.map(async C=>{C.c.instance&&!C.c.rect&&(C.c.rect=await _e(C.c.instance))}));for(let C of s)C.score=Lt({...Rr(C.c),tap:kr(C.c.rect,i,a)},e);if(s.sort((C,I)=>I.score-C.score),e.text!==void 0)for(let C of s){let I=!o(C.c)&&on(C.c.stateNode)?yl(C.c.stateNode):null,k=I?t.find(W=>W.stateNode===I&&W.textControl):void 0;k&&(C.c=k)}let u=s.find(C=>o(C.c))??n.find(C=>o(C.c))??s[0],c=u.c,d=l((C,I)=>C.press&&C.press.handler===I.press?.handler||C.valueControl&&C.valueControl.handler===I.valueControl?.handler||C.textControl&&C.textControl.handler===I.textControl?.handler,"sameControl"),h=s.filter(C=>C!==u&&o(C.c)&&C.score===u.score).filter(C=>!d(C.c,c)).filter((C,I,k)=>k.findIndex(W=>d(W.c,C.c))===I).slice(0,3).map(C=>({nativeTag:C.c.nativeTag,name:C.c.name,testID:C.c.testID,text:C.c.text,tap:kr(C.c.rect,i,a)})),T=e.nativeTag==null&&!(e.testID&&!e.query);if(T&&h.length>0){let C=[c,...h.map(I=>s.find(k=>k.c.nativeTag===I.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${C.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:C.map(I=>({nativeTag:I.nativeTag,name:I.name,testID:I.testID,text:I.text}))}}let m=s[0];if(T&&m&&m!==u&&!o(m.c)&&m.score>=90&&u.score<m.score-40)return{tapped:false,reason:`The best match for "${e.query}" is "${m.c.text??m.c.label??m.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${c.text??c.label??c.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:c.nativeTag,name:c.name,testID:c.testID,text:c.text}]};if(!o(c))return{tapped:false,reason:on(c.stateNode)?`Matched "${c.name}"${c.text?` ("${c.text}")`:""}, but it is not a button or a field. This element can't be driven in JS.`:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text,via:"onPress"}};c.instance&&!c.rect&&(c.rect=await _e(c.instance));let b=false;(c.rect==null||!zn(c.rect,i,a))&&e.scrollIntoView!==false&&c.instance&&(b=await Sl(c.fiber,c.instance,c.stateNode,80),b&&(c.rect=await _e(c.instance)));let f={nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text};Cl();let S=yr,v=c.fiber===null&&on(c.stateNode)?bl():null,L=Date.now(),P=l(async C=>(await new Promise(I=>setTimeout(I,Sh)),{tapped:true,scrolled:b,matched:C,effect:{commits:v?v():yr-S,observedMs:Date.now()-L},...h.length?{alsoMatched:h}:{}}),"fired");try{if(c.press){if(e.longPress){let I=c.press.kind==="onLongPress"?c.press.handler:c.press.longPress;return I?(I(Dr(c.rect)),await P({...f,via:"onLongPress"})):{tapped:false,scrolled:b,reason:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...f,via:"onPress"}}}return c.press.handler(Dr(c.rect)),await P({...f,via:c.press.kind})}if(c.valueControl){let I=c.valueControl,k;if(I.kind==="toggle")k=typeof e.value=="boolean"?e.value:!I.current;else{let W=I.min??0,X=I.max??1;typeof e.value=="number"?k=Math.min(X,Math.max(W,e.value)):k=I.current===X?W:X}return I.handler(k),await P({...f,via:"onValueChange",value:k})}let C=e.text??(typeof e.value=="string"?e.value:"");return c.textControl.handler(C),await P({...f,via:"onChangeText",value:C})}catch(C){return v?.(),{tapped:false,scrolled:b,reason:`handler threw: ${C instanceof Error?C.message:String(C)}`,matched:{...f,via:c.press?c.press.kind:c.valueControl?"onValueChange":"onChangeText"}}}}l(Nl,"tapElement");var Rh=5e3,kh=3e4,Dh=50,Ph=150;async function Ll(e){if(!(e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim()))return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."};let t=Math.min(Math.max(e.timeoutMs??Rh,0),kh),n=Math.max(e.pollMs??Ph,Dh),o=e.gone===true,r=Date.now(),i=0;for(;;){i+=1;let{hit:a,closest:s}=await zl(e);if(o?!a:a)return{ok:true,waitedMs:Date.now()-r,polls:i,matched:a??void 0};if(Date.now()-r>=t){let u=s?.length?s:void 0,c=o?`Still on screen after ${t}ms.`:u?`Not on screen after ${t}ms \u2014 ${u.length===1?"one element":`${u.length} elements`} matched but ${u.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${t}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-r,polls:i,reason:c,matched:a??void 0,closest:u}}await new Promise(u=>setTimeout(u,n))}}l(Ll,"waitFor");async function zl(e){let t=$n(e).map(s=>({c:s,score:On(s,e)})).filter(s=>s.score>0).sort((s,u)=>u.score-s.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await Ir(t.map(s=>s.c));let n=Ze.get("window"),o=Math.round(n.width)||1,r=Math.round(n.height)||1,i=null;for(let{c:s}of t)if(zn(s.rect,o,r)){i={nativeTag:s.nativeTag,name:s.name,testID:s.testID,label:s.label,text:s.text,interactive:!!(s.press||s.valueControl||s.textControl)};break}let a=t.slice(0,3).map(({c:s})=>({name:s.name,testID:s.testID,text:s.text,onScreen:zn(s.rect,o,r)}));return{hit:i,closest:a}}l(zl,"findOnScreen");function _n(e){let t=e,n=0;for(;t&&n<400;){if(le(t)?.__buoyDevToolsRoot)return true;t=t.return,n++}return false}l(_n,"isBuoyChrome");function Bl(e,t){let n=le(e.fiber);if(typeof n?.onPress=="function"||typeof n?.onValueChange=="function"||typeof n?.onChangeText=="function")return e;let o=null,r=e.fiber?.return,i=0;for(;r&&i<25;){if(typeof le(r)?.onPress=="function"){o=r;break}r=r.return,i++}if(!o)return e;let a=o;for(let s=0;s<6&&a;s++){let u=t.get(a);if(u)return u;a=a.return}return e}l(Bl,"preferHandlerOwner");function Wn(e){let t=Mn();if(t.length===0)return null;let n=new Map;for(let a of t)n.set(a.fiber,a);let o=t.find(a=>a.nativeTag===e),r=null;if(!o){for(let a of $e())if(Ae(a.current,s=>{r||s.stateNode&&nt(s.stateNode)===e&&(r=s)}),r)break}let i=o??null;if(!i&&r){let a=r,s=0,u=null;for(;a&&s<25;){let c=n.get(a);if(c){if(c.press||c.valueControl||c.textControl){i=c;break}u||(u=c)}a=a.return,s++}i||(i=u)}if(!i?.fiber&&!r){let a=i?.stateNode,s=on(a)?a:Vl(e);if(s){for(let u=s;u;u=u.parentElement){let c=t.find(d=>d.stateNode===u&&(d.press||d.valueControl||d.textControl));if(c)return c.buoy?null:jn(c)}return null}}return!i||(i=Bl(i,n),!i.press&&!i.valueControl&&!i.textControl)||_n(i.fiber)?null:jn(i)}l(Wn,"resolveTouchTarget");function Vl(e){let t=globalThis.document;return t?.querySelectorAll?Array.from(t.querySelectorAll("*")).find(n=>Ln(n)===e)??null:null}l(Vl,"domElementForTag");function jn(e){return{nativeTag:e.nativeTag,name:e.name,role:e.role,testID:e.testID,label:e.label,text:e.text,control:e.valueControl?e.valueControl.kind:e.textControl?"text":"press",value:e.valueControl?e.valueControl.current:e.textControl?.current}}l(jn,"touchTargetOf");function Al(e){let t=null;for(let n of $e())if(Ae(n.current,o=>{!t&&o.stateNode&&nt(o.stateNode)===e&&(t=o)}),t)break;return t}l(Al,"fiberForTag");function Pr(){let e=[];for(let t of $e()){let n=t.current?.child,o=0;for(;n&&o++<200;){if(n.tag===Vn&&n.stateNode){e.push(n);break}n=n.child}}return e}l(Pr,"rootHostFibers");function El(e,t){let n=globalThis.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!="function")return null;let o=Pr().filter(r=>r.stateNode?.node);return o.length?new Promise(r=>{let i=setTimeout(()=>r(null),1e3),a=o.length,s=null;o.forEach((u,c)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,d=>{d&&(!s||c>=s.i)&&(s={i:c,fiber:d}),--a===0&&(clearTimeout(i),r(s?.fiber??null))})}catch{--a===0&&(clearTimeout(i),r(s?.fiber??null))}})}):null}l(El,"fabricFiberAt");function Hl(e,t){let n=tn?.findSubviewIn;if(typeof n!="function")return null;let o=Pr()[0],r=o?nt(o.stateNode)??Nt(o.stateNode):null;return r==null?null:new Promise(i=>{let a=setTimeout(()=>i(null),1e3);try{n.call(tn,r,[e,t],s=>{clearTimeout(a),i(typeof s=="number"?Al(s):null)})}catch{clearTimeout(a),i(null)}})}l(Hl,"paperFiberAt");function Fl(){let e=[],t=new Set,n=l(r=>{let i=[],a=l((s,u)=>{for(let c=s;c&&i.length<5e3;c=c.sibling)t.has(c)||u>500||vr(c)||wr(c)||(c.tag===Vn&&c.stateNode?i.push(c):c.child&&a(c.child,u+1))},"dig");return r.child&&a(r.child,0),i},"hostChildren"),o=l((r,i)=>{t.has(r)||i>500||(t.add(r),e.push(r),Nr(n(r)).forEach(a=>o(a,i+1)))},"walk");for(let r of $e())Nr(n(r.current)).forEach(i=>o(i,0));return e}l(Fl,"visibleHostFibers");function Nr(e){let t=e.map(n=>{let o=Number(Un(le(n)?.style).zIndex);return Number.isFinite(o)?o:0});return e.map((n,o)=>({h:n,i:o})).sort((n,o)=>t[n.i]-t[o.i]||n.i-o.i).map(({h:n})=>n)}l(Nr,"sortByZ");function Un(e,t=0){return!e||typeof e!="object"||t>10?{}:Array.isArray(e)?Object.assign({},...e.map(n=>Un(n,t+1))):e}l(Un,"flatStyle");var Nh=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function Ml(e){if(typeof e.type=="string"&&Nh.has(e.type)&&e.type!=="RCTScrollContentView")return true;let t=Un(le(e)?.style).overflow;return t==="hidden"||t==="scroll"}l(Ml,"clipsChildren");function $l(e){let t=le(e)?.pointerEvents??le(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return,o=0;for(;n&&o++<200;){let r=le(n)?.pointerEvents??le(n)?.style?.pointerEvents;if(r==="none"||r==="box-only"&&n.tag===Vn)return"all";n=n.return}return t==="box-none"?"self":null}l($l,"passesTouchesThrough");async function Ol(e,t,n){let o=await Promise.all(n.map(s=>{let u=An(s.stateNode);return u?_e(u):Promise.resolve(null)})),r=new Map;n.forEach((s,u)=>r.set(s,o[u]));let i=l(s=>!!s&&e>=s.x&&e<=s.x+s.width&&t>=s.y&&t<=s.y+s.height,"inside"),a=l(s=>{for(let u=s.return,c=0;u&&c<300;u=u.return,c++)if(u.tag===Vn&&r.has(u)&&Ml(u)&&!i(r.get(u)))return true;return false},"clippedAway");for(let s=n.length-1;s>=0;s--)if(!(!i(o[s])||$l(n[s])||a(n[s])))return n[s];return null}l(Ol,"measuredFiberAt");function _l(e,t){let n=globalThis.document,o=globalThis.window;if(!n?.elementFromPoint||!o)return null;let r=n.elementFromPoint(e*o.innerWidth,t*o.innerHeight);for(;r;){let i=Object.keys(r).find(a=>a.startsWith("__reactFiber$"));if(i)return r[i];r=r.parentElement}return null}l(_l,"domFiberAt");function Wl(e,t){let n=globalThis.document,o=globalThis.window;if(!n?.elementFromPoint||!o)return null;let r=n.elementFromPoint(e*o.innerWidth,t*o.innerHeight);if(!r)return null;for(let d=r;d;d=d.parentElement)if(Object.keys(d).some(h=>h.startsWith("__reactFiber$")||h.startsWith("__reactContainer$")))return null;let i=!!r.closest("[data-buoy-root], [data-buoy-portal-host]"),a=xr(),s=a.find(d=>d.stateNode===r),u;for(let d=r;d&&!u;d=d.parentElement)u=a.find(h=>h.stateNode===d&&(h.press||h.valueControl||h.textControl));let c=[];for(let d=r;d&&c.length<6;d=d.parentElement){let h=Bn(d);h!==d.tagName.toLowerCase()&&c[c.length-1]!==h&&c.push(h)}return{found:true,method:"dom",buoy:i,view:{name:Bn(r),nativeTag:Ln(r),testID:s?.testID,label:s?.label,text:s?.text},path:c,target:u&&!i?jn(u):null}}l(Wl,"domPageHit");async function jl(e){let t=Math.min(1,Math.max(0,Number(e?.x))),n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};let o=Ze.get("window"),r=t*o.width,i=n*o.height,a="none",s=null,u=_l(t,n),c=u?null:Wl(t,n);if(c)return c;if(u)a="dom",s=u;else{let f=El(r,i);if(f)a="fabric",s=await f;else{let v=Hl(r,i);v&&(a="paper",s=await v)}let S=Fl();(!s||!new Set(S).has(s))&&(s=await Ol(r,i,S),a="measured")}if(!s)return{found:false,method:a};let d=le(s)??{},h=nt(s.stateNode),T=[],m=s,b=0;for(;m&&b++<80&&T.length<6;){let f=Oe(m);f&&typeof m.type!="string"&&!fr.has(f)&&T[T.length-1]!==f&&T.push(f),m=m.return}return{found:true,method:a,buoy:_n(s),view:{name:Oe(s)??"Unknown",nativeTag:h,testID:d.testID||void 0,label:d.accessibilityLabel||d["aria-label"]||void 0,text:Fn(d)},path:T,target:h!=null?Wn(h):null}}l(jl,"hitTest");async function Ul(){let e=[];for(let o of $e())Ae(o.current,r=>{let i=r.stateNode;r.tag===1&&i&&typeof i.getCamera=="function"&&!_n(r)&&e.push(r)});let t=Ze.get("window"),n=l(o=>Promise.race([o,new Promise(r=>setTimeout(()=>r(null),1e3))]),"timeout");return{maps:(await Promise.all(e.slice(0,5).map(async o=>{try{let r=await n(Promise.resolve(o.stateNode.getCamera()));if(!r)return null;let i=En(o),a=i?await _e(i.instance):null,s=le(o)??{};return{name:Oe(o)??"Map",testID:typeof s.testID=="string"?s.testID:void 0,frame:a&&t.width&&t.height?{x:De(a.x/t.width),y:De(a.y/t.height),width:De(a.width/t.width),height:De(a.height/t.height)}:void 0,camera:{heading:typeof r.heading=="number"?r.heading:void 0,pitch:typeof r.pitch=="number"?r.pitch:void 0,altitude:typeof r.altitude=="number"?r.altitude:void 0,zoom:typeof r.zoom=="number"?r.zoom:void 0,center:r.center}}}catch{return null}}))).filter(o=>!!o)}}l(Ul,"readMaps");kn();j();j();function Gl(e){return!!e&&typeof e=="object"&&("next"in e||"queue"in e||"memoizedState"in e)}l(Gl,"isHookList");function Lr(e,t,n){if(e===t)return false;if(n?.isClassComponent||!Gl(t))return true;let o=e,r=t;for(let i=0;r!=null&&i<64;i++){if(r.queue!=null&&(o==null||!Object.is(o.memoizedState,r.memoizedState)))return true;r=r.next,o=o!=null?o.next:null}return false}l(Lr,"hookStateChanged");function Kl(e,t){return Lr(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===1})}l(Kl,"ownStateChanged");var ql={RCTText:{alwaysTrack:["children"],skip:[],description:"Text component - children is the displayed content"},RCTVirtualText:{alwaysTrack:["children"],skip:[],description:"Virtual Text (nested) - children is the displayed content"},RCTView:{alwaysTrack:[],skip:["children"],description:"View container - children are React elements"},RCTImageView:{alwaysTrack:["source"],skip:["children"],description:"Image - source contains the image URL/require"},RCTTextInput:{alwaysTrack:["value","defaultValue"],skip:["children"],description:"TextInput - value is the input content"},RCTSwitch:{alwaysTrack:["value"],skip:["children"],description:"Switch - value is the toggle state"},default:{alwaysTrack:[],skip:["children"],description:"Unknown component type"}};function Jl(e){return e&&ql[e]||ql.default}l(Jl,"getComponentPropConfig");var Gn=new WeakMap;function Kn(e){if(!e)return;let t=Gn.get(e);if(t||e.alternate&&(t=Gn.get(e.alternate),t))return t}l(Kn,"getComponentFiberPrevState");function Yl(e,t){e&&(Gn.set(e,t),e.alternate&&Gn.set(e.alternate,t))}l(Yl,"setComponentFiberState");var Ie=new Map,zr=500,Lh=10,Br=50,Xl=50,zh=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","Fragment","Suspense","Provider","Consumer","Context","ForwardRef","Unknown","Component"]);function Vr(e){return!!(!e||zh.has(e)||e.startsWith("Animated"))}l(Vr,"isInternalComponentName");function Ar(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=t.tag;if(r===0||r===1||r===11||r===15){let i=Ee(t);if(o||(o=t),!Vr(i))return t}t=t.return,n++}return o}l(Ar,"getOwningComponentFiber");function Ee(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.displayName)return t.displayName;if(t.name)return t.name}return null}l(Ee,"getComponentNameFromFiber");function Ql(e){if(!e||typeof e!="object")return"unknown";if(e.queue!==null&&e.queue!==void 0)return"useState";let t=e.memoizedState;if(t!==null&&typeof t=="object"&&!Array.isArray(t)&&"current"in t&&Object.keys(t).length===1)return"useRef";if(Array.isArray(t)&&t.length===2){let[,n]=t;if(Array.isArray(n)||n===null)return typeof t[0]=="function"?"useCallback":"useMemo"}return t!==null&&typeof t=="object"&&!Array.isArray(t)&&("tag"in t||"create"in t||"destroy"in t)?"useEffect":"unknown"}l(Ql,"detectHookType");function Zl(e,t){let n=e?.memoizedState;switch(t){case"useState":case"useReducer":return n;case"useRef":return n?.current;case"useMemo":case"useCallback":return Array.isArray(n)?n[0]:n;case"useEffect":return"[effect]";default:return n}}l(Zl,"extractHookValue");function ot(e){if(!e?.memoizedState)return null;let t=e.memoizedState;if(typeof t!="object"||t===null||!("next"in t)&&!("queue"in t)&&!("memoizedState"in t))return null;let n=[],o=t,r=0;for(;o!==null&&r<Br;){let i=Ql(o),a=Zl(o,i);n.push({index:r,type:i,value:a,rawState:o.memoizedState}),o=o.next,r++}return n.length>0?n:null}l(ot,"extractHookStates");function es(e,t){if(!e||!t)return null;let n=[],o=Math.max(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],a=t[r];if(!i&&a){n.push({index:r,type:a.type,currentValue:sn(a.value,a.type),description:`Hook[${r}] added`});continue}if(i&&!a){n.push({index:r,type:i.type,previousValue:sn(i.value,i.type),description:`Hook[${r}] removed`});continue}if(i&&a){if(i.rawState===a.rawState||a.type==="useEffect"||a.type==="useMemo"||a.type==="useCallback")continue;if(a.type==="useState"||a.type==="useReducer"||a.type==="useRef"){let s=sn(i.value,i.type),u=sn(a.value,a.type);n.push({index:r,type:a.type,previousValue:s,currentValue:u,description:`${s} \u2192 ${u}`})}}}return n.length>0?n:null}l(es,"compareHookStates");function sn(e,t){return rt(e)}l(sn,"formatHookValue");function rt(e){if(e===null)return null;if(e!==void 0)return typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?e.length>30?e.slice(0,30)+"...":e:typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`{Object: ${Object.keys(e).length} keys}`:String(e)}l(rt,"formatDisplayValue");function ts(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e,n=e.alternate,o=Kn(e);if(o&&n){let u=ot(e),c=ot(n),d=o.extractedHooks;if(u&&c&&d&&d.length>0){let h=d.find(T=>T.type==="useState");if(h){let T=u.find(b=>b.index===h.index),m=c.find(b=>b.index===h.index);if(T&&m){let b=T.value===h.value,f=m.value===h.value;b&&!f&&(t=n,n=e)}}}}let r=ot(t),i=null,a=null,s=null;return n?(i=n.memoizedProps,a=n.memoizedState,s=ot(n)):o&&(i=o.memoizedProps,a=o.memoizedState,s=o.extractedHooks),Yl(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:r}),i===null?{cause:"mount",hookChanges:null}:qn(i,t.memoizedProps)?Lr(a,t.memoizedState,{isClassComponent:t.tag===1})?{cause:"state",hookChanges:es(s,r)}:{cause:"parent",hookChanges:null}:{cause:"props",hookChanges:null}}l(ts,"detectComponentCause");function qn(e,t){if(e===t)return true;if(!e||!t||typeof e!="object"||typeof t!="object")return false;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return false;for(let r of n)if(e[r]!==t[r])return false;return true}l(qn,"shallowEqual");function it(e,t=3){let n=new WeakSet;function o(r,i){if(i>t)return"[MAX_DEPTH]";if(r===null)return null;if(r===void 0)return;if(typeof r=="function")return`[Function: ${r.name||"anonymous"}]`;if(typeof r=="symbol")return`[Symbol: ${r.toString()}]`;if(typeof r!="object")return r;if(n.has(r))return"[Circular]";if(n.add(r),Array.isArray(r))return r.slice(0,10).map(u=>o(u,i+1));let a={},s=Object.keys(r).slice(0,20);for(let u of s)try{a[u]=o(r[u],i+1)}catch{a[u]="[Error accessing]"}return a}return l(o,"stringify"),o(e,0)}l(it,"safeStringify");function zt(e){return e===void 0?"undefined":{0:"FunctionComponent",1:"ClassComponent",2:"IndeterminateComponent",3:"HostRoot",4:"HostPortal",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",12:"Profiler",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"}[e]||`Unknown(${e})`}l(zt,"getTagName");function ns(e,t){if(!(!t.hookChanges||t.hookChanges.length===0))for(let n of t.hookChanges)console.log("[Buoy]",`[${e||"Unknown"}] ${n.type}[${n.index}]: ${n.previousValue} \u2192 ${n.currentValue}`)}l(ns,"logMinimal");function os(e,t,n,o,r){let i=Ee(n)||"Unknown",a=typeof t?.type=="string"?t.type:"Unknown",{cause:s,hookChanges:u}=o;if(console.log("[Buoy]",`[RENDER] ${i} (${a}:${e}) | Cause: ${s.toUpperCase()}`+(r&&r.length>0?` | Props: [${r.join(", ")}]`:"")),u&&u.length>0)for(let c of u)console.log("[Buoy]",` \u2514\u2500 ${c.type}[${c.index}]: ${c.previousValue} \u2192 ${c.currentValue}`)}l(os,"logVerbose");function Er(e,t,n,o,r,i,a){let s=Ee(n)||"Unknown",u=typeof t?.type=="string"?t.type:"Unknown";console.log("[Buoy]",`
26
+ `}};l(Wo,"PerformanceLoggerSingleton");Fa=Wo,Qe=new Fa});function Ma(e){if(e.isComponent===true||e.testID&&e.testID.trim())return true;let t=(e.componentName??"").trim();if(!t||jo.has(t)||$a.has(t))return false;let n=(e.viewType??"").trim();return!(n&&jo.has(n)&&t===n||/^comp(\s|$)/i.test(t)||t.startsWith("_"))}var jo,$a,md=Xt(()=>{"use strict";j();jo=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]),$a=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"]);l(Ma,"isNamedComposite")});var Oa={};Na(Oa,{RenderTracker:()=>B,default:()=>ja});var Uo,_a,Go,Wa,B,ja,Ve=Xt(()=>{"use strict";j();Aa();kn();md();Uo=200,_a=150,Go=class Hp{constructor(){this.renders=new Map;this.listeners=new Set;this.stateListeners=new Set;this.settingsListeners=new Set;this.filterListeners=new Set;this.renderEventCallbacks=new Set;this.isTracking=false;this.isPaused=false;this.settings={batchSize:_a,showRenderCount:true,performanceLogging:false,trackRenderCauses:false,enableRenderHistory:false,maxRenderHistoryPerComponent:20,capturePropsOnRender:false,captureStateOnRender:false,debugLogLevel:"off",excludeDevTools:true,showHostViews:false};this.isBatchMode=false;this.batchDirty=false;this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]}}trackRender(t){if(this.isPaused)return;let n=String(t.nativeTag),o=Date.now(),r=this.renders.get(n);if(r){if(r.renderCount=t.count,r.lastRenderTime=o,r.color=t.color,t.measurements&&(r.measurements=t.measurements),t.testID&&!r.testID&&(r.testID=t.testID),t.nativeID&&!r.nativeID&&(r.nativeID=t.nativeID),t.accessibilityLabel&&!r.accessibilityLabel&&(r.accessibilityLabel=t.accessibilityLabel),t.componentName&&!r.componentName&&(r.componentName=t.componentName),t.renderCause&&(r.lastRenderCause=t.renderCause),this.settings.enableRenderHistory){let i=t.renderCause||{type:"unknown",timestamp:o};this.addRenderEvent(r,i,t.capturedProps,t.capturedState)}}else{let i={id:n,nativeTag:t.nativeTag,viewType:t.viewType,displayName:Rn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,...t.isComponent===void 0?{}:{isComponent:t.isComponent},renderCount:t.count,firstRenderTime:o,lastRenderTime:o,measurements:t.measurements,color:t.color,lastRenderCause:t.renderCause};if(this.settings.enableRenderHistory){i.renderHistory=[];let a=t.renderCause||{type:t.count===1?"mount":"unknown",timestamp:o};this.addRenderEvent(i,a,t.capturedProps,t.capturedState)}if(this.renders.set(n,i),this.renders.size>Uo){let a=Array.from(this.renders.values()).sort((s,u)=>s.lastRenderTime-u.lastRenderTime).slice(0,this.renders.size-Uo);for(let s of a)this.renders.delete(s.id)}}this.isBatchMode?this.batchDirty=true:this.notifyListeners()}addRenderEvent(t,n,o,r){t.renderHistory||(t.renderHistory=[]);let i={id:`${t.nativeTag}-${n.timestamp}`,timestamp:n.timestamp,cause:n,renderNumber:t.renderCount,capturedProps:this.settings.capturePropsOnRender?o:void 0,capturedState:this.settings.captureStateOnRender?r:void 0};t.renderHistory.push(i);let a=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));t.renderHistory.length>a&&(t.renderHistory=t.renderHistory.slice(-a)),this.notifyRenderEventCallbacks(i,t)}notifyRenderEventCallbacks(t,n){this.renderEventCallbacks.forEach(o=>{try{o(t,n)}catch{}})}emitRenderEvent(t){if(this.renderEventCallbacks.size===0)return;let n=Date.now(),o=t.renderCause||{type:"unknown",timestamp:n},r={id:String(t.nativeTag),nativeTag:t.nativeTag,viewType:t.viewType,displayName:Rn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,renderCount:t.count,firstRenderTime:n,lastRenderTime:n,measurements:t.measurements,color:t.color,lastRenderCause:o,renderHistory:[]},i={id:`${t.nativeTag}-${n}-${t.count}`,timestamp:n,renderNumber:t.count,cause:o,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(i,r)}startBatch(){this.isBatchMode=true,this.batchDirty=false}endBatch(){this.isBatchMode=false,this.batchDirty&&(this.batchDirty=false,this.notifyListeners())}getRenders(){return Array.from(this.renders.values()).map(t=>({...t}))}passesFilters(t){if(this.filters.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,this.filters.includePatterns)||this.filters.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,this.filters.excludePatterns))return false;if(this.filters.includeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(!this.matchesPattern(n,this.filters.includeViewType)&&!this.matchesPattern(o,this.filters.includeViewType))return false}if(this.filters.includeTestID.size>0&&(!t.testID||!this.matchesPattern(t.testID,this.filters.includeTestID))||this.filters.includeNativeID.size>0&&(!t.nativeID||!this.matchesPattern(t.nativeID,this.filters.includeNativeID))||this.filters.includeComponent.size>0&&(!t.componentName||!this.matchesPattern(t.componentName,this.filters.includeComponent)))return false;if(this.filters.excludeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(this.matchesPattern(n,this.filters.excludeViewType)||this.matchesPattern(o,this.filters.excludeViewType))return false}return!(this.filters.excludeTestID.size>0&&t.testID&&this.matchesPattern(t.testID,this.filters.excludeTestID)||this.filters.excludeNativeID.size>0&&t.nativeID&&this.matchesPattern(t.nativeID,this.filters.excludeNativeID)||this.filters.excludeComponent.size>0&&t.componentName&&this.matchesPattern(t.componentName,this.filters.excludeComponent))}matchesAnyPatternForInfo(t,n){for(let o of n){let r=o.value.toLowerCase();switch(o.type){case"any":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r)||t.testID?.toLowerCase().includes(r)||t.nativeID?.toLowerCase().includes(r)||t.componentName?.toLowerCase().includes(r)||t.accessibilityLabel?.toLowerCase().includes(r))return true;break;case"viewType":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r))return true;break;case"testID":if(t.testID?.toLowerCase().includes(r))return true;break;case"nativeID":if(t.nativeID?.toLowerCase().includes(r))return true;break;case"component":if(t.componentName?.toLowerCase().includes(r))return true;break;case"accessibilityLabel":if(t.accessibilityLabel?.toLowerCase().includes(r))return true;break}}return false}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||this.filters.minRenderCount!==void 0||this.filters.maxRenderCount!==void 0}getFilteredRenders(t=""){let n=this.getRenders();if(this.settings.showHostViews||(n=n.filter(Ma)),t.trim()){let o=t.toLowerCase();n=n.filter(r=>r.viewType.toLowerCase().includes(o)||r.displayName.toLowerCase().includes(o)||r.testID?.toLowerCase().includes(o)||r.nativeID?.toLowerCase().includes(o)||r.accessibilityLabel?.toLowerCase().includes(o)||r.componentName?.toLowerCase().includes(o)||String(r.nativeTag).includes(o))}return n=n.filter(o=>this.passesFilters(o)),this.filters.minRenderCount!==void 0&&(n=n.filter(o=>o.renderCount>=this.filters.minRenderCount)),this.filters.maxRenderCount!==void 0&&(n=n.filter(o=>o.renderCount<=this.filters.maxRenderCount)),n.sort((o,r)=>r.lastRenderTime-o.lastRenderTime)}matchesPattern(t,n){let o=t.toLowerCase();for(let r of n){let i=r.toLowerCase();if(o.includes(i))return true}return false}getRender(t){return this.renders.get(t)}clear(){this.renders.clear(),this.notifyListeners()}resetRenderCount(t){let n=this.renders.get(t);n&&(n.renderCount=0,this.notifyListeners())}start(){this.isTracking=true,this.isPaused=false,this.notifyStateListeners()}stop(){this.isTracking=false,this.isPaused=false,this.notifyStateListeners()}pause(){this.isPaused=true,this.notifyStateListeners()}resume(){this.isPaused=false,this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused,this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}replaceRenders(t,n){let o=new Map;for(let[r,i]of this.renders)i.renderHistory&&i.renderHistory.length>0&&o.set(r,i.renderHistory);this.renders=new Map(t.map(r=>{let i=o.get(r.id),a=i&&!(r.renderHistory&&r.renderHistory.length>0)?{...r,renderHistory:i}:r;return[a.id,a]})),n&&(this.isTracking!==n.isTracking||this.isPaused!==n.isPaused)&&(this.isTracking=n.isTracking,this.isPaused=n.isPaused,this.notifyStateListeners()),this.notifyListeners()}hydrateRender(t){let n=this.renders.get(t.id);this.renders.set(t.id,n?{...n,...t}:t),this.notifyListeners()}getFilters(){return this.filters}setFilters(t){this.filters={...this.filters,...t},this.notifyListeners(),this.notifyFilterListeners()}addIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}addExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0},this.notifyListeners()}getAvailableProps(){let t=new Set,n=new Set,o=new Set,r=new Set,i=new Set;for(let a of this.renders.values())a.viewType&&t.add(a.viewType),a.testID&&n.add(a.testID),a.nativeID&&o.add(a.nativeID),a.componentName&&r.add(a.componentName),a.accessibilityLabel&&i.add(a.accessibilityLabel);return{viewTypes:Array.from(t).sort(),testIDs:Array.from(n).sort(),nativeIDs:Array.from(o).sort(),componentNames:Array.from(r).sort(),accessibilityLabels:Array.from(i).sort()}}getStats(){let t=0;for(let n of this.renders.values())t+=n.renderCount;return{totalComponents:this.renders.size,totalRenders:t}}subscribe(t){return this.listeners.add(t),t(this.getRenders()),()=>{this.listeners.delete(t)}}subscribeToState(t){return this.stateListeners.add(t),t(this.getState()),()=>{this.stateListeners.delete(t)}}subscribeToSettings(t){return this.settingsListeners.add(t),t(this.settings),()=>{this.settingsListeners.delete(t)}}subscribeToFilters(t){return this.filterListeners.add(t),t(this.filters),()=>{this.filterListeners.delete(t)}}onRenderEvent(t){return this.renderEventCallbacks.add(t),()=>{this.renderEventCallbacks.delete(t)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(t){let n=this.filters;return!(n.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,n.includePatterns)||n.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,n.excludePatterns)||(n.includeViewType.size>0||n.includeTestID.size>0||n.includeNativeID.size>0||n.includeComponent.size>0)&&!(n.includeViewType.size>0&&n.includeViewType.has(t.viewType)||n.includeTestID.size>0&&t.testID&&n.includeTestID.has(t.testID)||n.includeNativeID.size>0&&t.nativeID&&n.includeNativeID.has(t.nativeID)||n.includeComponent.size>0&&t.componentName&&n.includeComponent.has(t.componentName))||n.excludeViewType.has(t.viewType)||t.testID&&n.excludeTestID.has(t.testID)||t.nativeID&&n.excludeNativeID.has(t.nativeID)||t.componentName&&n.excludeComponent.has(t.componentName))}getSettings(){return{...this.settings}}setSettings(t){t.batchSize!==void 0&&(t.batchSize=Math.max(10,Math.min(500,t.batchSize))),t.maxRenderHistoryPerComponent!==void 0&&(t.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,t.maxRenderHistoryPerComponent))),t.enableRenderHistory&&!this.settings.trackRenderCauses&&(t.trackRenderCauses=true),t.trackRenderCauses===false&&this.settings.enableRenderHistory&&(t.enableRenderHistory=false),this.settings={...this.settings,...t},t.performanceLogging!==void 0&&Qe.setEnabled(t.performanceLogging),this.notifySettingsListeners()}clearAllRenderHistory(){for(let t of this.renders.values())t.renderHistory=[];this.notifyListeners()}clearRenderHistory(t){let n=this.renders.get(t);n&&(n.renderHistory=[],this.notifyListeners())}getRenderHistoryStats(){let t=0,n=0;for(let o of this.renders.values())o.renderHistory&&o.renderHistory.length>0&&(t+=o.renderHistory.length,n++);return{totalEvents:t,componentsWithHistory:n,averageEventsPerComponent:n>0?t/n:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(t){this.setSettings({batchSize:t})}notifyListeners(){let t=this.getRenders();for(let n of this.listeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in listener:",o)}}notifyStateListeners(){let t=this.getState();for(let n of this.stateListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in state listener:",o)}}notifySettingsListeners(){let t=this.getSettings();for(let n of this.settingsListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in settings listener:",o)}}notifyFilterListeners(){let t=this.getFilters();for(let n of this.filterListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in filter listener:",o)}}};l(Go,"RenderTrackerSingleton");Wa=Go,B=new Wa,ja=B});j();j();import{useState as Ko,useEffect as qo,useCallback as yd}from"react";import{HighlighterIcon as Ua,HighlightIcon as Ga}from"@buoy-gg/floating-tools-core/web";j();import{getDOMFiber as Jo,getDOMNodeHandle as Ka,getDOMPublicInstance as bd,isDOMElement as qa}from"@buoy-gg/shared-ui/web/utils";j();var It=null,Rt=null,Zt=false,en=false,Dn=null;function Yo(e){if(!e)return{type:"null"};let t=e,n={};if(t.canonical){n.type="Fabric";let o=t.canonical;if(o.publicInstance){let r=o.publicInstance;n.hasMeasure=typeof r.measure=="function",n.nativeTag=r.__nativeTag??r._nativeTag??"unknown"}}else typeof t.measure=="function"?(n.type="Legacy",n.hasMeasure=true,n.nativeTag=t.__nativeTag??t._nativeTag??t.nativeTag??"unknown"):(n.type="Unknown",n.keys=Object.keys(t).slice(0,10));return n}l(Yo,"describeNode");function Ja(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;!e||typeof e.emit!="function"||It||(It=e.emit.bind(e),e.emit=function(t,...n){if(t==="traceUpdates"&&en){let o=n[0];o.size>0&&console.log("[Buoy]",`[PROFILER] traceUpdates: ${o.size} nodes`,Array.from(o).map((r,i)=>({index:i,...Yo(r)}))),Dn&&Dn(o)}return It(t,...n)})}l(Ja,"swizzleHookEmit");function Ya(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.reactDevtoolsAgent;!e||typeof e.emit!="function"||Rt||(Rt=e.emit.bind(e),e.emit=function(t,...n){if(en&&t==="drawTraceUpdates"){let o=n[0];o.length>0&&console.log("[Buoy]",`[PROFILER] drawTraceUpdates: ${o.length} nodes`,o.map((r,i)=>({index:i,color:r.color,...Yo(r.node)})))}return Rt(t,...n)})}l(Ya,"swizzleAgentEmit");function Xa(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;e?.rendererInterfaces&&e.rendererInterfaces.forEach(t=>{if(typeof t.setTraceUpdatesEnabled=="function")try{t.setTraceUpdatesEnabled(false)}catch{}})}l(Xa,"disableTracingOnAllRenderers");function Xo(e){Dn=e}l(Xo,"setComparisonCallback");function Qo(){typeof ee<"u"&&!ee||Zt||(Ja(),Ya(),Zt=true)}l(Qo,"installProfilerInterceptor");function Zo(){if(!Zt)return;let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;It&&e&&(e.emit=It,It=null),Rt&&e?.reactDevtoolsAgent&&(e.reactDevtoolsAgent.emit=Rt,Rt=null),Xa(),Dn=null,Zt=false}l(Zo,"uninstallProfilerInterceptor");function Qa(){return Zt}l(Qa,"isInterceptorInstalled");function Za(){en=true}l(Za,"enableProfilerLogging");function el(){en=false}l(el,"disableProfilerLogging");function tl(){return en}l(tl,"isLoggingEnabled");var nl={};Na(nl,{AccessibilityInfo:()=>wd,ActivityIndicator:()=>ph,Alert:()=>mh,Animated:()=>dh,AppRegistry:()=>xd,AppState:()=>Id,Appearance:()=>Sd,BackHandler:()=>Rd,Button:()=>fh,CheckBox:()=>Hd,Clipboard:()=>kd,DeviceEventEmitter:()=>Qd,Dimensions:()=>Ze,Easing:()=>Dd,FlatList:()=>il,I18nManager:()=>Pd,Image:()=>Fd,ImageBackground:()=>Md,InteractionManager:()=>Nd,Keyboard:()=>ol,KeyboardAvoidingView:()=>$d,LayoutAnimation:()=>Ld,Linking:()=>zd,LogBox:()=>Xd,Modal:()=>dl,NativeEventEmitter:()=>Bd,NativeModules:()=>Td,PanResponder:()=>Vd,Picker:()=>Od,PixelRatio:()=>er,Platform:()=>rl,Pressable:()=>cl,ProgressBar:()=>_d,RefreshControl:()=>Wd,SafeAreaView:()=>jd,ScrollView:()=>Me,SectionList:()=>Ud,Share:()=>Ad,StatusBar:()=>Gd,StyleSheet:()=>Ce,Switch:()=>Pt,Text:()=>p,TextInput:()=>Nn,Touchable:()=>Kd,TouchableHighlight:()=>hh,TouchableNativeFeedback:()=>qd,TouchableOpacity:()=>Y,TouchableWithoutFeedback:()=>gh,UIManager:()=>tn,Vibration:()=>Ed,View:()=>g,VirtualizedList:()=>Jd,YellowBox:()=>Yd,findNodeHandle:()=>Nt,unstable_createElement:()=>Cd,useColorScheme:()=>Zd,useLocaleContext:()=>eh,useWindowDimensions:()=>th});j();pd(nl,vd);import*as vd from"react-native-web";import{unstable_createElement as Cd,NativeModules as Td,AccessibilityInfo as wd,Appearance as Sd,AppRegistry as xd,AppState as Id,BackHandler as Rd,Clipboard as kd,Dimensions as Ze,Easing as Dd,I18nManager as Pd,Keyboard as ol,InteractionManager as Nd,LayoutAnimation as Ld,Linking as zd,NativeEventEmitter as Bd,PanResponder as Vd,PixelRatio as er,Platform as rl,Share as Ad,UIManager as tn,Vibration as Ed,CheckBox as Hd,FlatList as il,Image as Fd,ImageBackground as Md,KeyboardAvoidingView as $d,Picker as Od,ProgressBar as _d,RefreshControl as Wd,SafeAreaView as jd,SectionList as Ud,StatusBar as Gd,Touchable as Kd,TouchableNativeFeedback as qd,VirtualizedList as Jd,YellowBox as Yd,LogBox as Xd,DeviceEventEmitter as Qd,useColorScheme as Zd,useLocaleContext as eh,useWindowDimensions as th}from"react-native-web";import*as fe from"react-native-web";import{createElement as tr,forwardRef as al,useCallback as nh,useRef as oh}from"react";j();import{useEffect as rh,useState as ih}from"react";import{createPortal as ah}from"react-dom";j();var lh='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as sh}from"react/jsx-runtime";var nn=Symbol.for("@buoy-gg/portal-host"),ll=l(e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"},"isTextField");function nr(){let e=document;if(e[nn])return e[nn].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:lh});let n=l(()=>{let d=document.fullscreenElement,h=d&&d.tagName!=="CANVAS"?d:document.body;t.parentElement!==h&&h.appendChild(t)},"move"),o=new Map,r=l(d=>{(!t.contains(d.target)||!ll(d.target))&&o.set(d.code||d.key,{key:d.key,code:d.code,location:d.location,keyCode:d.keyCode,which:d.which,altKey:d.altKey,ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey})},"down"),i=l(d=>{o.delete(d.code||d.key)},"up"),a=l(()=>o.clear(),"clear"),s=l(()=>{let d=[...o.values()];o.clear();for(let h of d)document.dispatchEvent(new KeyboardEvent("keyup",{...h,bubbles:true}))},"focus"),u=l(d=>{ll(d.target)&&d.stopPropagation()},"key"),c=l(d=>d.stopPropagation(),"wheel");return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",r,true),document.addEventListener("keyup",i,true),window.addEventListener("blur",a),t.addEventListener("focusin",s),t.addEventListener("keydown",u),t.addEventListener("keyup",u),t.addEventListener("keypress",u),t.addEventListener("wheel",c,{passive:true}),e[nn]={host:t,users:0,dispose:l(()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",r,true),document.removeEventListener("keyup",i,true),window.removeEventListener("blur",a),t.remove(),delete e[nn]},"dispose")},t}l(nr,"getBuoyPortalHost");function sl({children:e}){let[t,n]=ih(null);return rh(()=>{let o=nr(),r=document[nn];return r.users++,n(o),()=>{--r.users===0&&r.dispose()}},[]),t?ah(sh("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}l(sl,"BuoyPortal");var kt=fe,ch=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Dt=l(e=>typeof e=="number"?`${e}px`:e,"px");function Pn(e){if(Array.isArray(e)){let h=e.map(Pn);return h.some((T,m)=>T!==e[m])?h:e}if(!e||typeof e!="object"||!ch.some(h=>e[h]!=null))return e;let{shadowColor:t,shadowOffset:n,shadowOpacity:o,shadowRadius:r,textShadowColor:i,textShadowOffset:a,textShadowRadius:s,...u}=e;if(t!=null||n!=null||o!=null||r!=null){let h=t??"black",T=o==null?h:`color-mix(in srgb, ${h} ${Math.min(o,1)*100}%, transparent)`,m=`${Dt(n?.width??0)} ${Dt(n?.height??0)} ${Dt(r??0)} ${T}`;u.boxShadow=typeof u.boxShadow=="string"?`${u.boxShadow}, ${m}`:u.boxShadow??m}let{width:c=0,height:d=0}=a??{};if(i&&(c||d||s)){let h=`${Dt(c)} ${Dt(d)} ${Dt(s??0)} ${i}`;u.textShadow=u.textShadow?`${u.textShadow}, ${h}`:h}return u}l(Pn,"webShadows");var uh=kt.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function or(e,t){if(typeof e=="function")return o=>or(e(o),t);let n=Pn(e);return t?[n,uh[t]]:n}l(or,"webStyle");var Ce={...kt.StyleSheet,create:l(e=>kt.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Pn(n)]))),"create")};function Te(e){let t=al((o,r)=>{let{accessibilityState:i,accessibilityValue:a,pointerEvents:s,...u}=o;for(let d of["busy","checked","disabled","expanded","selected"])i?.[d]!==void 0&&u[`aria-${d}`]===void 0&&(u[`aria-${d}`]=i[d]);for(let[d,h]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))a?.[d]!==void 0&&u[`aria-${h}`]===void 0&&(u[`aria-${h}`]=a[d]);let c=or(u.style,s);return c!==u.style&&(u.style=c),tr(e,{...u,ref:r})}),n=e.State;return n&&Object.assign(t,{State:n}),t.displayName=e.displayName??e.name??"NativeWebView",t}l(Te,"withAccessibility");var g=Te(fe.View),p=Te(fe.Text),dh={...kt.Animated,View:kt.Animated.createAnimatedComponent(g),Text:kt.Animated.createAnimatedComponent(p)},Nn=Te(fe.TextInput),Y=Te(fe.TouchableOpacity),hh=Te(fe.TouchableHighlight),gh=Te(fe.TouchableWithoutFeedback),cl=Te(fe.Pressable),Me=Te(fe.ScrollView),ul=al((e,t)=>{let n=oh(null),o=nh(r=>{if(r){let i=r;for(;i.parentElement&&i.parentElement!==document.body;)i=i.parentElement;i.parentElement===document.body&&(n.current=i,Object.assign(i.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),nr().appendChild(i))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof t=="function"?t(r):t&&(t.current=r)},[t]);return tr(sl,null,tr(fe.Modal,{...e,ref:o}))});ul.displayName="Modal";var dl=Te(ul),Pt=Te(fe.Switch),ph=Te(fe.ActivityIndicator),fh=Te(fe.Button),Nt=fe.findNodeHandle,mh={alert(e,t,n,o){if(typeof document>"u")return;let r=document.createElement("dialog");r.dataset.buoyRoot="",r.setAttribute("aria-label",e),r.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",r.appendChild(i),t){let c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",r.appendChild(c)}let a=document.createElement("div");a.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let s=n?.length?n:[{text:"OK"}],u=l(()=>{r.close?.(),r.remove()},"close");for(let c of s){let d=document.createElement("button");d.type="button",d.textContent=c.text??"OK",d.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,d.onclick=()=>{u(),c.onPress?.()},a.appendChild(d)}r.addEventListener("cancel",c=>{c.preventDefault(),o?.cancelable!==false&&(u(),o?.onDismiss?.())}),r.appendChild(a),document.body.appendChild(r),r.showModal?r.showModal():r.setAttribute("open","")}};Ve();j();import{getDOMControlProps as yh,getDOMNodeHandle as Ln,getDOMPublicInstance as hl,isDOMElement as on}from"@buoy-gg/shared-ui/web/utils";j();function rr(e){return e?e.x>=-.1&&e.x<=1.1&&e.y>=-.1&&e.y<=1.1:false}l(rr,"isOnScreenTap");function zn(e,t,n){if(!e||t<=0||n<=0)return false;let o=e.x+e.width/2,r=e.y+e.height/2,i=t*.1,a=n*.1;return o>=-i&&o<=t+i&&r>=-a&&r<=n+a}l(zn,"isRectCenterOnScreen");function ir(e){return String(e??"").toLowerCase().replace(/\s+/g," ").replace(/(\d)[,\u00a0\u202f](?=\d{3}\b)/g,"$1").trim()}l(ir,"looseText");function Lt(e,t){if(t.nativeTag!=null&&e.nativeTag===t.nativeTag)return 1e3;if(t.testID&&!t.query){if(!e.testID||e.testID.toLowerCase()!==t.testID.trim().toLowerCase())return 0;let a=200;return e.tap&&(a+=rr(e.tap)?20:-40),a}let n=String(t.query??t.testID??"").trim().toLowerCase();if(!n)return 0;let o=[e.testID,e.label,e.text,e.name].filter(Boolean).map(a=>a.toLowerCase()),r=0;for(let a of o)a===n?r=Math.max(r,100):a.startsWith(n)?r=Math.max(r,50):a.includes(n)&&(r=Math.max(r,25));let i=ir(n);if(i)for(let a of o){let s=ir(a);s===i?r=Math.max(r,90):s.startsWith(i)?r=Math.max(r,45):s.includes(i)&&(r=Math.max(r,22))}return t.testID&&e.testID&&e.testID.toLowerCase()===t.testID.toLowerCase()&&(r=Math.max(r,200)),r===0?0:((e.testID??"").toLowerCase().startsWith("buoy-dial-")&&(r+=40),e.tap&&(rr(e.tap)?r+=20:r-=40),r)}l(Lt,"scoreTapMatch");j();import{getDOMControlProps as bh}from"@buoy-gg/shared-ui/web/utils";var vh=new Set(["button","link","menuitem","tab","switch","checkbox","radio","option","textbox","slider"]),Ch=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE","SVG","PATH","HEAD","META","LINK"]),ar=80;function gl(e){for(let t in e)if(t.startsWith("__reactContainer$")||t==="_reactRootContainer")return true;return false}l(gl,"isReactContainer");function lr(e){if(e.getAttribute("aria-hidden")==="true")return true;let t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}l(lr,"isHidden");function sr(e){let t=e;return typeof t.$$click=="function"||typeof t.onclick=="function"||e.tabIndex>=0&&e.hasAttribute("tabindex")}l(sr,"hasClick");var Th=new Set(["B","STRONG","EM","I","U","S","SPAN","SMALL","MARK","CODE","SUB","SUP","ABBR","CITE","Q","TIME","BR"]);function cr(e){return Array.from(e.childNodes).some(t=>t.nodeType===3&&(t.textContent??"").trim()!=="")}l(cr,"hasOwnText");function ur(e){return Th.has(e.tagName.toUpperCase())&&!e.hasAttribute("data-testid")&&!e.hasAttribute("aria-label")&&!e.hasAttribute("role")&&!sr(e)&&!e.querySelector(`${hr}, [role], [data-testid], [aria-label]`)}l(ur,"isPlainInline");function pl(e){let t="",n=cr(e),o=l(r=>{if(r.nodeType===3)t+=r.textContent??"";else if(n&&r.nodeType===1){let i=r;i.tagName==="BR"?t+=" ":ur(i)&&!lr(i)&&i.childNodes.forEach(o)}},"add");return e.childNodes.forEach(o),t=t.replace(/\s+/g," ").trim(),t||void 0}l(pl,"ownText");function dr(e,t){if(e)return t||e.length<=ar?e:`${e.slice(0,ar)}\u2026`}l(dr,"clip");function fl(e,t){return dr((e.innerText??e.textContent??"").replace(/\s+/g," ").trim(),t)}l(fl,"allText");var et="input, textarea, select",hr=`${et}, button, a[href]`;function rn(e){let t="",n=l(o=>{o.nodeType===3?t+=o.textContent??"":o.nodeType===1&&!o.matches(et)&&o.childNodes.forEach(n)},"visit");return n(e),t.replace(/\s+/g," ").trim()}l(rn,"readText");function gr(e){let t=e;for(let n=0;n<3;n++){let o=t.previousElementSibling;if(o){let i=rn(o);return i&&i.length<=ar&&!o.matches(hr)&&!o.querySelector(hr)?o:null}let r=t.parentElement;if(!r||r.querySelectorAll(et).length>1)return null;t=r}return null}l(gr,"nearbyLabel");function ml(e){let t=(e.getAttribute("aria-labelledby")??"").split(/\s+/).map(r=>r&&document.getElementById(r)?rn(document.getElementById(r)):"").filter(Boolean).join(" "),n=Array.from(e.labels??[]).map(rn).filter(Boolean).join(" "),o=e.matches(et)?gr(e):null;return t||e.getAttribute("aria-label")||n||e.getAttribute("title")||e.getAttribute("placeholder")||(o?rn(o):"")}l(ml,"accessibleName");function yl(e){let t=e.closest("label")?.control;if(t instanceof HTMLElement)return t;let n=e.closest("[id]")?.id;if(n){for(let o of Array.from(document.querySelectorAll("[aria-labelledby]")))if(o.matches(`${et}, [role=textbox]`)&&o.getAttribute("aria-labelledby").split(/\s+/).includes(n))return o}for(let o=e,r=0;o&&r<3;o=o.parentElement,r++){let i=o.nextElementSibling,a=i?.matches(et)?i:i?.querySelector(et);if(a instanceof HTMLElement&&gr(a)===o)return a}return null}l(yl,"labeledField");function pr(e={}){if(typeof document>"u"||!document.body)return[];let t=[],n=l((o,r,i)=>{if(Ch.has(o.tagName.toUpperCase())||gl(o)||lr(o))return;let a=i||o.hasAttribute("data-buoy-root")||o.hasAttribute("data-buoy-portal-host"),s=o.tagName.toLowerCase(),u=o.getAttribute("role")??void 0,c=s==="button"||s==="a"&&o.hasAttribute("href")||s==="input"||s==="textarea"||s==="select"||u!==void 0&&vh.has(u)||sr(o),d=o.getAttribute("data-testid")??void 0,h=c?dr(ml(o),!!e.fullText):o.getAttribute("aria-label")??void 0,T=c?fl(o,!!e.fullText):r?void 0:pl(o);if(c||d||h||T){let b={"data-testid":d,"aria-label":h,role:u,id:o.id||void 0};c&&s!=="input"&&s!=="textarea"&&s!=="select"&&(b.onClick=()=>o.click());let f=bh(o,b);if(u==="switch"||u==="checkbox"){let S=o.getAttribute("aria-checked")==="true";f.value=S,f.onValueChange=v=>{!!v!=(o.getAttribute("aria-checked")==="true")&&o.click()},delete f.onPress}o.disabled&&delete f.onPress,t.push({element:o,props:f,text:T,buoy:a})}let m=!c&&!r&&cr(o);for(let b of Array.from(o.children))m&&ur(b)||b instanceof HTMLElement&&n(b,r||c,a)},"walk");return n(document.body,false,false),t}l(pr,"collectDOMElements");function Bn(e){let t=globalThis[Symbol.for("buoy.dom.componentName")];try{let n=t?.(e);if(n)return n}catch{}return e.tagName.toLowerCase()}l(Bn,"domElementName");function bl(){if(typeof MutationObserver>"u"||typeof document>"u")return()=>0;let e=0,t=new MutationObserver(()=>{e+=1});return t.observe(document.body,{subtree:true,childList:true,characterData:true,attributes:true}),()=>(t.disconnect(),e)}l(bl,"watchDOMChanges");var Vn=5,wh=22,fr=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function mr(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}l(mr,"getReactDevToolsHook");var yr=0,vl=false;function Cl(){if(vl)return;let e=mr();if(!e)return;let t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){return yr++,typeof t=="function"?t.apply(e,n):void 0},vl=true}l(Cl,"ensureCommitCounter");var Sh=250;function br(){let e=new Map;return t=>{let n=[],o=t,r=0,i=false;for(;o&&r<400;){let a=e.get(o);if(a!==void 0){i=a;break}if(le(o)?.__buoyDevToolsRoot){i=true,e.set(o,true);break}n.push(o),o=o.return,r++}for(let a of n)e.set(a,i);return i}}l(br,"makeChromeCheck");function $e(){let e=mr();if(!e)return[];let t=[];try{if(e.renderers&&typeof e.renderers.forEach=="function"&&e.renderers.forEach((n,o)=>{try{let r=e.getFiberRoots?.(o);r&&r.forEach(i=>t.push(i))}catch{}}),t.length===0&&e.getFiberRoots){let n=e.getFiberRoots(1);n&&n.forEach(o=>t.push(o))}}catch{}return t}l($e,"getAllFiberRoots");function vr(e){return e.tag===wh&&e.memoizedState!==null}l(vr,"isHiddenOffscreen");var tt=false,Cr=0,an=false;function Tr(e,t){let n=tt;tt=e;try{return t()}finally{tt=n}}l(Tr,"withHiddenScreens");function Tl(e){let t=e.memoizedProps;return t?t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t)||t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t):false}l(Tl,"isNotShowingScreen");function wr(e){let t=e.memoizedProps?.activityState;return t===0||t===1||e.memoizedProps?.isPageFocused===false?true:!tt&&Tl(e)?(Cr++,true):false}l(wr,"isInactiveScreen");function Ae(e,t,n=0,o=new Set){if(!(!e||o.has(e)||n>500)){if(o.add(e),vr(e)||wr(e)){e.sibling&&Ae(e.sibling,t,n,o);return}t(e),e.child&&Ae(e.child,t,n+1,o),e.sibling&&Ae(e.sibling,t,n,o)}}l(Ae,"traverseFiberTree");function An(e){let t=hl(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"||typeof n.measureInWindow=="function"?n:null}l(An,"getPublicInstance");function nt(e){let t=Ln(e);if(t!==null)return t;if(e==null)return null;let n=e;if(typeof n.__nativeTag=="number")return n.__nativeTag;if(typeof n._nativeTag=="number")return n._nativeTag;if(typeof n.nativeTag=="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag=="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag=="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag=="number")return n.canonical.nativeTag}return null}l(nt,"getNativeTag");function En(e){let t=An(e.stateNode);if(t)return{instance:t,nativeTag:nt(e.stateNode),stateNode:e.stateNode};let n=[];e.child&&n.push(e.child);let o=0;for(;n.length>0&&o<4e3;){o++;let r=n.pop();if(!r)continue;let i=An(r.stateNode);if(i)return{instance:i,nativeTag:nt(r.stateNode),stateNode:r.stateNode};r.child&&n.push(r.child),r.sibling&&n.push(r.sibling)}return null}l(En,"findHostInstance");function wl(e){let t=e,n=0;for(;t&&n++<200;){let o=t.stateNode;if(o&&typeof o.scrollTo=="function"){let r=typeof o.getNativeScrollRef=="function"&&o.getNativeScrollRef()||null,i=typeof o.getInnerViewNode=="function"&&o.getInnerViewNode()||typeof o.getScrollableNode=="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:i}}t=t.return}return null}l(wl,"findScrollAncestor");async function Sl(e,t,n,o){try{if(on(n))return n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}),await new Promise(u=>setTimeout(u,16)),true;let r=wl(e);if(!r)return false;let i=t,a=null,s=l(u=>new Promise(c=>{let d=false,h=l(m=>{d||(d=true,c(m))},"settle"),T=setTimeout(()=>h(null),600);try{u(m=>{clearTimeout(T),h(m)})}catch{clearTimeout(T),h(null)}}),"withTimeout");if(r.nativeRef&&typeof i.measureLayout=="function"&&(a=await s(u=>i.measureLayout(r.nativeRef,(c,d)=>u(d),()=>u(null)))),a==null){let u=Nt(t),c=typeof r.innerNode=="number"?r.innerNode:Nt(r.innerNode);u!=null&&c!=null&&(a=await s(d=>tn.measureLayout(u,c,()=>d(null),(h,T)=>d(T))))}return a==null?false:(r.instance.scrollTo({y:Math.max(0,a-o),animated:false}),await new Promise(u=>setTimeout(u,120)),true)}catch{return false}}l(Sl,"scrollIntoView");function Oe(e){let t=e?.type;return t?typeof t=="string"?t:t.displayName||t.name||null:null}l(Oe,"getComponentName");function Hn(e){let t=e?._debugOwner||e?.return,n=0;for(;t&&n<30;){n++;let o=Oe(t);if(o&&!fr.has(o)&&typeof t.type!="string")return o;t=t.return}return null}l(Hn,"getOwningComponentName");function le(e){return yh(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}l(le,"getProps");function Sr(e,t=0){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){let n=[];for(let o of e){let r=Sr(o,t+1);r&&n.push(r)}return n.length>0?n.join(""):void 0}}l(Sr,"flattenText");function xl(e){return e.replace(/\s+/g," ").trim()}l(xl,"normalizeVisibleText");function Fn(e){if(!e)return;let t=l(n=>{let o=Sr(n);if(o===void 0)return;let r=xl(o);return r?an?r:r.slice(0,80):void 0},"pick");return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}l(Fn,"getVisibleText");function Il(e,t){let n=[],o=l((i,a)=>{if(!i||a>t||n.length>=4)return;if(i!==e){let u=le(i);if(u&&(typeof u.onPress=="function"||typeof u.onLongPress=="function"))return}let s=Fn(le(i));s&&!n.includes(s)&&n.push(s),i.child&&o(i.child,a+1),i!==e&&i.sibling&&o(i.sibling,a)},"visit");e.child&&o(e.child,1);let r=n.join(" ").trim();return r?r.slice(0,80):void 0}l(Il,"collectDescendantText");function Rl(e){let t=e,n=0,o=null,r=null;for(;t&&n<25&&!(o&&r);){let i=le(t);i&&(!o&&typeof i.onPress=="function"&&(o=i.onPress),!r&&typeof i.onLongPress=="function"&&(r=i.onLongPress)),t=t.return,n++}return o?{handler:o,kind:"onPress",longPress:r??void 0}:r?{handler:r,kind:"onLongPress"}:null}l(Rl,"findPressHandler");function _e(e){return new Promise(t=>{let n=false,o=l(r=>{n||(n=true,t(r))},"done");setTimeout(()=>o(null),1e3);try{typeof e.measureInWindow=="function"?e.measureInWindow((r,i,a,s)=>{a>0&&s>0?o({x:r,y:i,width:a,height:s}):o(null)}):typeof e.measure=="function"?e.measure((r,i,a,s,u,c)=>{a>0&&s>0&&u!=null&&c!=null?o({x:u,y:c,width:a,height:s}):o(null)}):o(null)}catch{o(null)}})}l(_e,"measureInstance");var xh=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function Mn(){let e=$e(),t=[],n=new Map,o=new Map,r=br();for(let i of e)Ae(i.current,a=>{let s=le(a);if(!s)return;let u=typeof s.onPress=="function"||typeof s.onLongPress=="function",c=typeof s.onValueChange=="function",d=typeof s.onChangeText=="function",h=s.testID||void 0,T=s.accessibilityLabel||void 0,m=s.accessibilityRole||s.role||void 0,b=Fn(s),f=m==="button"||m==="link"||m==="menuitem"||m==="tab"||m==="switch"||m==="checkbox",S=typeof a.type=="string"&&xh.has(a.type)&&s.animating!==false;if(!u&&!c&&!d&&!h&&!T&&!b&&!f&&!S)return;let v=null,L=null,P=null;if(c){let x=s.value,z=typeof x=="number"||typeof s.minimumValue=="number";L={handler:s.onValueChange,kind:z?"slider":"toggle",current:x,min:typeof s.minimumValue=="number"?s.minimumValue:void 0,max:typeof s.maximumValue=="number"?s.maximumValue:void 0}}else d?P={handler:s.onChangeText,current:typeof s.value=="string"?s.value:void 0}:v=Rl(a);let C=Oe(a),I=C??"Unknown";(!C||fr.has(C)||typeof a.type=="string")&&(I=Hn(a)??C??"Unknown");let k=En(a);if(!k&&!h)return;!b&&!T&&u&&(b=Il(a,6));let W=k?.instance??null,X=k?.nativeTag??null,V=(W?n.get(W):void 0)??(X!=null?o.get(X):void 0);if(V){v&&(V.press=v),!V.valueControl&&L&&(V.valueControl=L),!V.textControl&&P&&(V.textControl=P),!V.testID&&h&&(V.testID=h),!V.label&&T&&(V.label=T),!V.text&&b&&(V.text=b),W&&!n.has(W)&&n.set(W,V),X!=null&&!o.has(X)&&o.set(X,V);return}let U={nativeTag:X,name:I,role:m??(S?"progressbar":void 0),testID:h,label:T,text:b,instance:W,stateNode:k?.stateNode??null,fiber:a,press:v,valueControl:L,textControl:P,rect:null,buoy:r(a)};t.push(U),W&&n.set(W,U),X!=null&&o.set(X,U)});return t.push(...xr()),t}l(Mn,"collectCandidates");function xr(){return pr({fullText:an}).map(({element:e,props:t,text:n,buoy:o})=>{let r=typeof t.onValueChange=="function"?{handler:t.onValueChange,kind:typeof t.value=="number"?"slider":"toggle",current:t.value,min:t.minimumValue,max:t.maximumValue}:null,i=!r&&typeof t.onChangeText=="function"?{handler:t.onChangeText,current:t.value}:null,a=!r&&!i&&typeof t.onPress=="function"?{handler:t.onPress,kind:"onPress"}:null;return{nativeTag:Ln(e),name:Bn(e),role:t.accessibilityRole,testID:t.testID,label:t.accessibilityLabel,text:n,instance:hl(e),stateNode:e,fiber:null,buoy:o,press:a,valueControl:r,textControl:i,rect:null}})}l(xr,"collectDOMCandidates");function kl(e,t){return t.nativeTag!=null?e.nativeTag===t.nativeTag:t.testID&&e.testID?e.testID.toLowerCase()===t.testID.toLowerCase():false}l(kl,"explicitlyTargets");function $n(e){let t=Mn();return e.includeBuoy?t:t.filter(n=>!n.buoy||kl(n,e))}l($n,"appCandidates");async function Ir(e){await Promise.all(e.map(async t=>{t.instance&&(t.rect=await _e(t.instance))}))}l(Ir,"measureCandidates");var Ih=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function Dl(e,t){let n=[],o=br();for(let i of $e())Ae(i.current,a=>{if(Oe(a)!=="VirtualizedList")return;let s=a.memoizedProps;if(!s||typeof s.getItemCount!="function"||!e&&o(a))return;let u;try{u=Number(s.getItemCount(s.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;let c=[],d=l((m,b)=>{for(let f=m?.child;f;f=f.sibling){let S=Oe(f);if(S!=="VirtualizedList"){if(S==="CellRenderer"){c.push(f);continue}b<40&&d(f,b+1)}}},"walk");d(a,0);let h=a,T=Hn(h);for(let m=0;m<6&&T&&Ih.test(T);m++)h=h._debugOwner||h.return,T=Hn(h);n.push({owner:T,items:u,cells:c})});let r=[];for(let i of n){let a=(await Promise.all(i.cells.map(async s=>{let u=En(s);return u?_e(u.instance):null}))).filter(t).length;a>0&&i.items>a&&r.push({owner:i.owner,items:i.items,listed:a})}return r}l(Dl,"collectLists");async function ln(e={}){let t=tt,n=an;tt=!!e.includeHidden,an=!!e.fullText;try{return await Pl(e)}finally{tt=t,an=n}}l(ln,"describeScreen");async function Pl(e){Cr=0;let t=Mn(),n=Cr,o=e.includeBuoy?t:t.filter(d=>!d.buoy),r=t.length-o.length;await Ir(o);let i=Ze.get("window"),a=Math.round(i.width)||1,s=Math.round(i.height)||1,u=[];for(let d of o){let h=d.rect;if(!h&&!d.testID)continue;let T,m;if(h){let S=h.x+h.width/2,v=h.y+h.height/2;if(v<-s*.1||v>s*1.1||S<-a*.1||S>a*1.1)continue;T={x:De(S/a),y:De(v/s)},m={x:De(h.x/a),y:De(h.y/s),width:De(h.width/a),height:De(h.height/s)}}let b=d.valueControl?d.valueControl.kind:d.textControl?"text":void 0,f=d.valueControl?d.valueControl.current:d.textControl?.current;u.push({nativeTag:d.nativeTag,name:d.name,role:d.role,testID:d.testID,label:d.label,text:d.text,interactive:!!(d.press||d.valueControl||d.textControl),longPressable:d.press&&(d.press.kind==="onLongPress"||d.press.longPress)?true:void 0,control:b,value:f,tap:T,frame:m,...d.buoy?{buoy:true}:{}})}u.sort((d,h)=>{let T=d.tap?.y??2,m=h.tap?.y??2;return Math.abs(T-m)>.02?T-m:(d.tap?.x??2)-(h.tap?.x??2)});let c=await Dl(!!e.includeBuoy,d=>{if(!d)return false;let h=d.x+d.width/2;return d.y<=s*1.1&&d.y+d.height>=-s*.1&&h>=-a*.1&&h<=a*1.1});return{screen:{width:a,height:s},count:u.length,elements:u,...r>0?{hiddenBuoy:r}:{},...n>0?{hiddenScreens:n}:{},...c.length?{lists:c}:{}}}l(Pl,"describeScreenInner");function De(e){return Math.round(e*100)/100}l(De,"round2");function Rr(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}l(Rr,"fieldsOf");function On(e,t){return Lt(Rr(e),t)}l(On,"matchScore");function kr(e,t,n){if(!(!e||!t||!n))return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}l(kr,"tapPoint");function Dr(e){let t=e?e.x+e.width/2:0,n=e?e.y+e.height/2:0;return{nativeEvent:{locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]},persist:l(()=>{},"persist"),preventDefault:l(()=>{},"preventDefault"),stopPropagation:l(()=>{},"stopPropagation"),isDefaultPrevented:l(()=>false,"isDefaultPrevented"),isPropagationStopped:l(()=>false,"isPropagationStopped"),target:null,currentTarget:null,type:"press",timeStamp:0}}l(Dr,"makeSyntheticPressEvent");async function Nl(e){let t=Tr(!!e.includeHidden,()=>$n(e));if(t.length===0)return{tapped:false,reason:"Nothing on screen to tap: no React elements and no page elements were found."};let n=t.map(C=>({c:C,score:On(C,e)})).filter(C=>C.score>0).sort((C,I)=>I.score-C.score),o=l(C=>!!(C.press||C.valueControl||C.textControl),"isInteractive");if(n.length===0&&!e.includeHidden&&Tr(true,()=>$n(e)).map(C=>({c:C,score:On(C,e)})).filter(C=>C.score>0).length>0)return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."};if(n.length===0)return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(o).slice(0,12).map(C=>({nativeTag:C.nativeTag,name:C.name,testID:C.testID,text:C.text}))};let r=Ze.get("window"),i=r.width||1,a=r.height||1,s=n.slice(0,15);await Promise.all(s.map(async C=>{C.c.instance&&!C.c.rect&&(C.c.rect=await _e(C.c.instance))}));for(let C of s)C.score=Lt({...Rr(C.c),tap:kr(C.c.rect,i,a)},e);if(s.sort((C,I)=>I.score-C.score),e.text!==void 0)for(let C of s){let I=!o(C.c)&&on(C.c.stateNode)?yl(C.c.stateNode):null,k=I?t.find(W=>W.stateNode===I&&W.textControl):void 0;k&&(C.c=k)}let u=s.find(C=>o(C.c))??n.find(C=>o(C.c))??s[0],c=u.c,d=l((C,I)=>C.press&&C.press.handler===I.press?.handler||C.valueControl&&C.valueControl.handler===I.valueControl?.handler||C.textControl&&C.textControl.handler===I.textControl?.handler,"sameControl"),h=s.filter(C=>C!==u&&o(C.c)&&C.score===u.score).filter(C=>!d(C.c,c)).filter((C,I,k)=>k.findIndex(W=>d(W.c,C.c))===I).slice(0,3).map(C=>({nativeTag:C.c.nativeTag,name:C.c.name,testID:C.c.testID,text:C.c.text,tap:kr(C.c.rect,i,a)})),T=e.nativeTag==null&&!(e.testID&&!e.query);if(T&&h.length>0){let C=[c,...h.map(I=>s.find(k=>k.c.nativeTag===I.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${C.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:C.map(I=>({nativeTag:I.nativeTag,name:I.name,testID:I.testID,text:I.text}))}}let m=s[0];if(T&&m&&m!==u&&!o(m.c)&&m.score>=90&&u.score<m.score-40)return{tapped:false,reason:`The best match for "${e.query}" is "${m.c.text??m.c.label??m.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${c.text??c.label??c.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:c.nativeTag,name:c.name,testID:c.testID,text:c.text}]};if(!o(c))return{tapped:false,reason:on(c.stateNode)?`Matched "${c.name}"${c.text?` ("${c.text}")`:""}, but it is not a button or a field. This element can't be driven in JS.`:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text,via:"onPress"}};c.instance&&!c.rect&&(c.rect=await _e(c.instance));let b=false;(c.rect==null||!zn(c.rect,i,a))&&e.scrollIntoView!==false&&c.instance&&(b=await Sl(c.fiber,c.instance,c.stateNode,80),b&&(c.rect=await _e(c.instance)));let f={nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text};Cl();let S=yr,v=c.fiber===null&&on(c.stateNode)?bl():null,L=Date.now(),P=l(async C=>(await new Promise(I=>setTimeout(I,Sh)),{tapped:true,scrolled:b,matched:C,effect:{commits:v?v():yr-S,observedMs:Date.now()-L},...h.length?{alsoMatched:h}:{}}),"fired");try{if(c.press){if(e.longPress){let I=c.press.kind==="onLongPress"?c.press.handler:c.press.longPress;return I?(I(Dr(c.rect)),await P({...f,via:"onLongPress"})):{tapped:false,scrolled:b,reason:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...f,via:"onPress"}}}return c.press.handler(Dr(c.rect)),await P({...f,via:c.press.kind})}if(c.valueControl){let I=c.valueControl,k;if(I.kind==="toggle")k=typeof e.value=="boolean"?e.value:!I.current;else{let W=I.min??0,X=I.max??1;typeof e.value=="number"?k=Math.min(X,Math.max(W,e.value)):k=I.current===X?W:X}return I.handler(k),await P({...f,via:"onValueChange",value:k})}let C=e.text??(typeof e.value=="string"?e.value:"");return c.textControl.handler(C),await P({...f,via:"onChangeText",value:C})}catch(C){return v?.(),{tapped:false,scrolled:b,reason:`handler threw: ${C instanceof Error?C.message:String(C)}`,matched:{...f,via:c.press?c.press.kind:c.valueControl?"onValueChange":"onChangeText"}}}}l(Nl,"tapElement");var Rh=5e3,kh=3e4,Dh=50,Ph=150;async function Ll(e){if(!(e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim()))return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."};let t=Math.min(Math.max(e.timeoutMs??Rh,0),kh),n=Math.max(e.pollMs??Ph,Dh),o=e.gone===true,r=Date.now(),i=0;for(;;){i+=1;let{hit:a,closest:s}=await zl(e);if(o?!a:a)return{ok:true,waitedMs:Date.now()-r,polls:i,matched:a??void 0};if(Date.now()-r>=t){let u=s?.length?s:void 0,c=o?`Still on screen after ${t}ms.`:u?`Not on screen after ${t}ms \u2014 ${u.length===1?"one element":`${u.length} elements`} matched but ${u.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${t}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-r,polls:i,reason:c,matched:a??void 0,closest:u}}await new Promise(u=>setTimeout(u,n))}}l(Ll,"waitFor");async function zl(e){let t=$n(e).map(s=>({c:s,score:On(s,e)})).filter(s=>s.score>0).sort((s,u)=>u.score-s.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await Ir(t.map(s=>s.c));let n=Ze.get("window"),o=Math.round(n.width)||1,r=Math.round(n.height)||1,i=null;for(let{c:s}of t)if(zn(s.rect,o,r)){i={nativeTag:s.nativeTag,name:s.name,testID:s.testID,label:s.label,text:s.text,interactive:!!(s.press||s.valueControl||s.textControl)};break}let a=t.slice(0,3).map(({c:s})=>({name:s.name,testID:s.testID,text:s.text,onScreen:zn(s.rect,o,r)}));return{hit:i,closest:a}}l(zl,"findOnScreen");function _n(e){let t=e,n=0;for(;t&&n<400;){if(le(t)?.__buoyDevToolsRoot)return true;t=t.return,n++}return false}l(_n,"isBuoyChrome");function Bl(e,t){let n=le(e.fiber);if(typeof n?.onPress=="function"||typeof n?.onValueChange=="function"||typeof n?.onChangeText=="function")return e;let o=null,r=e.fiber?.return,i=0;for(;r&&i<25;){if(typeof le(r)?.onPress=="function"){o=r;break}r=r.return,i++}if(!o)return e;let a=o;for(let s=0;s<6&&a;s++){let u=t.get(a);if(u)return u;a=a.return}return e}l(Bl,"preferHandlerOwner");function Wn(e){let t=Mn();if(t.length===0)return null;let n=new Map;for(let a of t)n.set(a.fiber,a);let o=t.find(a=>a.nativeTag===e),r=null;if(!o){for(let a of $e())if(Ae(a.current,s=>{r||s.stateNode&&nt(s.stateNode)===e&&(r=s)}),r)break}let i=o??null;if(!i&&r){let a=r,s=0,u=null;for(;a&&s<25;){let c=n.get(a);if(c){if(c.press||c.valueControl||c.textControl){i=c;break}u||(u=c)}a=a.return,s++}i||(i=u)}if(!i?.fiber&&!r){let a=i?.stateNode,s=on(a)?a:Vl(e);if(s){for(let u=s;u;u=u.parentElement){let c=t.find(d=>d.stateNode===u&&(d.press||d.valueControl||d.textControl));if(c)return c.buoy?null:jn(c)}return null}}return!i||(i=Bl(i,n),!i.press&&!i.valueControl&&!i.textControl)||_n(i.fiber)?null:jn(i)}l(Wn,"resolveTouchTarget");function Vl(e){let t=globalThis.document;return t?.querySelectorAll?Array.from(t.querySelectorAll("*")).find(n=>Ln(n)===e)??null:null}l(Vl,"domElementForTag");function jn(e){return{nativeTag:e.nativeTag,name:e.name,role:e.role,testID:e.testID,label:e.label,text:e.text,control:e.valueControl?e.valueControl.kind:e.textControl?"text":"press",value:e.valueControl?e.valueControl.current:e.textControl?.current}}l(jn,"touchTargetOf");function Al(e){let t=null;for(let n of $e())if(Ae(n.current,o=>{!t&&o.stateNode&&nt(o.stateNode)===e&&(t=o)}),t)break;return t}l(Al,"fiberForTag");function Pr(){let e=[];for(let t of $e()){let n=t.current?.child,o=0;for(;n&&o++<200;){if(n.tag===Vn&&n.stateNode){e.push(n);break}n=n.child}}return e}l(Pr,"rootHostFibers");function El(e,t){let n=globalThis.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!="function")return null;let o=Pr().filter(r=>r.stateNode?.node);return o.length?new Promise(r=>{let i=setTimeout(()=>r(null),1e3),a=o.length,s=null;o.forEach((u,c)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,d=>{d&&(!s||c>=s.i)&&(s={i:c,fiber:d}),--a===0&&(clearTimeout(i),r(s?.fiber??null))})}catch{--a===0&&(clearTimeout(i),r(s?.fiber??null))}})}):null}l(El,"fabricFiberAt");function Hl(e,t){let n=tn?.findSubviewIn;if(typeof n!="function")return null;let o=Pr()[0],r=o?nt(o.stateNode)??Nt(o.stateNode):null;return r==null?null:new Promise(i=>{let a=setTimeout(()=>i(null),1e3);try{n.call(tn,r,[e,t],s=>{clearTimeout(a),i(typeof s=="number"?Al(s):null)})}catch{clearTimeout(a),i(null)}})}l(Hl,"paperFiberAt");function Fl(){let e=[],t=new Set,n=l(r=>{let i=[],a=l((s,u)=>{for(let c=s;c&&i.length<5e3;c=c.sibling)t.has(c)||u>500||vr(c)||wr(c)||(c.tag===Vn&&c.stateNode?i.push(c):c.child&&a(c.child,u+1))},"dig");return r.child&&a(r.child,0),i},"hostChildren"),o=l((r,i)=>{t.has(r)||i>500||(t.add(r),e.push(r),Nr(n(r)).forEach(a=>o(a,i+1)))},"walk");for(let r of $e())Nr(n(r.current)).forEach(i=>o(i,0));return e}l(Fl,"visibleHostFibers");function Nr(e){let t=e.map(n=>{let o=Number(Un(le(n)?.style).zIndex);return Number.isFinite(o)?o:0});return e.map((n,o)=>({h:n,i:o})).sort((n,o)=>t[n.i]-t[o.i]||n.i-o.i).map(({h:n})=>n)}l(Nr,"sortByZ");function Un(e,t=0){return!e||typeof e!="object"||t>10?{}:Array.isArray(e)?Object.assign({},...e.map(n=>Un(n,t+1))):e}l(Un,"flatStyle");var Nh=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function Ml(e){if(typeof e.type=="string"&&Nh.has(e.type)&&e.type!=="RCTScrollContentView")return true;let t=Un(le(e)?.style).overflow;return t==="hidden"||t==="scroll"}l(Ml,"clipsChildren");function $l(e){let t=le(e)?.pointerEvents??le(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return,o=0;for(;n&&o++<200;){let r=le(n)?.pointerEvents??le(n)?.style?.pointerEvents;if(r==="none"||r==="box-only"&&n.tag===Vn)return"all";n=n.return}return t==="box-none"?"self":null}l($l,"passesTouchesThrough");async function Ol(e,t,n){let o=await Promise.all(n.map(s=>{let u=An(s.stateNode);return u?_e(u):Promise.resolve(null)})),r=new Map;n.forEach((s,u)=>r.set(s,o[u]));let i=l(s=>!!s&&e>=s.x&&e<=s.x+s.width&&t>=s.y&&t<=s.y+s.height,"inside"),a=l(s=>{for(let u=s.return,c=0;u&&c<300;u=u.return,c++)if(u.tag===Vn&&r.has(u)&&Ml(u)&&!i(r.get(u)))return true;return false},"clippedAway");for(let s=n.length-1;s>=0;s--)if(!(!i(o[s])||$l(n[s])||a(n[s])))return n[s];return null}l(Ol,"measuredFiberAt");function _l(e,t){let n=globalThis.document,o=globalThis.window;if(!n?.elementFromPoint||!o)return null;let r=n.elementFromPoint(e*o.innerWidth,t*o.innerHeight);for(;r;){let i=Object.keys(r).find(a=>a.startsWith("__reactFiber$"));if(i)return r[i];r=r.parentElement}return null}l(_l,"domFiberAt");function Wl(e,t){let n=globalThis.document,o=globalThis.window;if(!n?.elementFromPoint||!o)return null;let r=n.elementFromPoint(e*o.innerWidth,t*o.innerHeight);if(!r)return null;for(let d=r;d;d=d.parentElement)if(Object.keys(d).some(h=>h.startsWith("__reactFiber$")||h.startsWith("__reactContainer$")))return null;let i=!!r.closest("[data-buoy-root], [data-buoy-portal-host]"),a=xr(),s=a.find(d=>d.stateNode===r),u;for(let d=r;d&&!u;d=d.parentElement)u=a.find(h=>h.stateNode===d&&(h.press||h.valueControl||h.textControl));let c=[];for(let d=r;d&&c.length<6;d=d.parentElement){let h=Bn(d);h!==d.tagName.toLowerCase()&&c[c.length-1]!==h&&c.push(h)}return{found:true,method:"dom",buoy:i,view:{name:Bn(r),nativeTag:Ln(r),testID:s?.testID,label:s?.label,text:s?.text},path:c,target:u&&!i?jn(u):null}}l(Wl,"domPageHit");async function jl(e){let t=Math.min(1,Math.max(0,Number(e?.x))),n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};let o=Ze.get("window"),r=t*o.width,i=n*o.height,a="none",s=null,u=_l(t,n),c=u?null:Wl(t,n);if(c)return c;if(u)a="dom",s=u;else{let f=El(r,i);if(f)a="fabric",s=await f;else{let v=Hl(r,i);v&&(a="paper",s=await v)}let S=Fl();(!s||!new Set(S).has(s))&&(s=await Ol(r,i,S),a="measured")}if(!s)return{found:false,method:a};let d=le(s)??{},h=nt(s.stateNode),T=[],m=s,b=0;for(;m&&b++<80&&T.length<6;){let f=Oe(m);f&&typeof m.type!="string"&&!fr.has(f)&&T[T.length-1]!==f&&T.push(f),m=m.return}return{found:true,method:a,buoy:_n(s),view:{name:Oe(s)??"Unknown",nativeTag:h,testID:d.testID||void 0,label:d.accessibilityLabel||d["aria-label"]||void 0,text:Fn(d)},path:T,target:h!=null?Wn(h):null}}l(jl,"hitTest");async function Ul(){let e=[];for(let o of $e())Ae(o.current,r=>{let i=r.stateNode;r.tag===1&&i&&typeof i.getCamera=="function"&&!_n(r)&&e.push(r)});let t=Ze.get("window"),n=l(o=>Promise.race([o,new Promise(r=>setTimeout(()=>r(null),1e3))]),"timeout");return{maps:(await Promise.all(e.slice(0,5).map(async o=>{try{let r=await n(Promise.resolve(o.stateNode.getCamera()));if(!r)return null;let i=En(o),a=i?await _e(i.instance):null,s=le(o)??{};return{name:Oe(o)??"Map",testID:typeof s.testID=="string"?s.testID:void 0,frame:a&&t.width&&t.height?{x:De(a.x/t.width),y:De(a.y/t.height),width:De(a.width/t.width),height:De(a.height/t.height)}:void 0,camera:{heading:typeof r.heading=="number"?r.heading:void 0,pitch:typeof r.pitch=="number"?r.pitch:void 0,altitude:typeof r.altitude=="number"?r.altitude:void 0,zoom:typeof r.zoom=="number"?r.zoom:void 0,center:r.center}}}catch{return null}}))).filter(o=>!!o)}}l(Ul,"readMaps");kn();j();j();function Gl(e){return!!e&&typeof e=="object"&&("next"in e||"queue"in e||"memoizedState"in e)}l(Gl,"isHookList");function Lr(e,t,n){if(e===t)return false;if(n?.isClassComponent||!Gl(t))return true;let o=e,r=t;for(let i=0;r!=null&&i<64;i++){if(r.queue!=null&&(o==null||!Object.is(o.memoizedState,r.memoizedState)))return true;r=r.next,o=o!=null?o.next:null}return false}l(Lr,"hookStateChanged");function Kl(e,t){return Lr(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===1})}l(Kl,"ownStateChanged");var ql={RCTText:{alwaysTrack:["children"],skip:[],description:"Text component - children is the displayed content"},RCTVirtualText:{alwaysTrack:["children"],skip:[],description:"Virtual Text (nested) - children is the displayed content"},RCTView:{alwaysTrack:[],skip:["children"],description:"View container - children are React elements"},RCTImageView:{alwaysTrack:["source"],skip:["children"],description:"Image - source contains the image URL/require"},RCTTextInput:{alwaysTrack:["value","defaultValue"],skip:["children"],description:"TextInput - value is the input content"},RCTSwitch:{alwaysTrack:["value"],skip:["children"],description:"Switch - value is the toggle state"},default:{alwaysTrack:[],skip:["children"],description:"Unknown component type"}};function Jl(e){return e&&ql[e]||ql.default}l(Jl,"getComponentPropConfig");var Gn=new WeakMap;function Kn(e){if(!e)return;let t=Gn.get(e);if(t||e.alternate&&(t=Gn.get(e.alternate),t))return t}l(Kn,"getComponentFiberPrevState");function Yl(e,t){e&&(Gn.set(e,t),e.alternate&&Gn.set(e.alternate,t))}l(Yl,"setComponentFiberState");var Ie=new Map,zr=500,Lh=10,Br=50,Xl=50,zh=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","Fragment","Suspense","Provider","Consumer","Context","ForwardRef","Unknown","Component"]);function Vr(e){return!!(!e||zh.has(e)||e.startsWith("Animated"))}l(Vr,"isInternalComponentName");function Ar(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=t.tag;if(r===0||r===1||r===11||r===15){let i=Ee(t);if(o||(o=t),!Vr(i))return t}t=t.return,n++}return o}l(Ar,"getOwningComponentFiber");function Ee(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.displayName)return t.displayName;if(t.name)return t.name}return null}l(Ee,"getComponentNameFromFiber");function Ql(e){if(!e||typeof e!="object")return"unknown";if(e.queue!==null&&e.queue!==void 0)return"useState";let t=e.memoizedState;if(t!==null&&typeof t=="object"&&!Array.isArray(t)&&"current"in t&&Object.keys(t).length===1)return"useRef";if(Array.isArray(t)&&t.length===2){let[,n]=t;if(Array.isArray(n)||n===null)return typeof t[0]=="function"?"useCallback":"useMemo"}return t!==null&&typeof t=="object"&&!Array.isArray(t)&&("tag"in t||"create"in t||"destroy"in t)?"useEffect":"unknown"}l(Ql,"detectHookType");function Zl(e,t){let n=e?.memoizedState;switch(t){case"useState":case"useReducer":return n;case"useRef":return n?.current;case"useMemo":case"useCallback":return Array.isArray(n)?n[0]:n;case"useEffect":return"[effect]";default:return n}}l(Zl,"extractHookValue");function ot(e){if(!e?.memoizedState)return null;let t=e.memoizedState;if(typeof t!="object"||t===null||!("next"in t)&&!("queue"in t)&&!("memoizedState"in t))return null;let n=[],o=t,r=0;for(;o!==null&&r<Br;){let i=Ql(o),a=Zl(o,i);n.push({index:r,type:i,value:a,rawState:o.memoizedState}),o=o.next,r++}return n.length>0?n:null}l(ot,"extractHookStates");function es(e,t){if(!e||!t)return null;let n=[],o=Math.max(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],a=t[r];if(!i&&a){n.push({index:r,type:a.type,currentValue:sn(a.value,a.type),description:`Hook[${r}] added`});continue}if(i&&!a){n.push({index:r,type:i.type,previousValue:sn(i.value,i.type),description:`Hook[${r}] removed`});continue}if(i&&a){if(i.rawState===a.rawState||a.type==="useEffect"||a.type==="useMemo"||a.type==="useCallback")continue;if(a.type==="useState"||a.type==="useReducer"||a.type==="useRef"){let s=sn(i.value,i.type),u=sn(a.value,a.type);n.push({index:r,type:a.type,previousValue:s,currentValue:u,description:`${s} \u2192 ${u}`})}}}return n.length>0?n:null}l(es,"compareHookStates");function sn(e,t){return rt(e)}l(sn,"formatHookValue");function rt(e){if(e===null)return null;if(e!==void 0)return typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?e.length>30?e.slice(0,30)+"...":e:typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`{Object: ${Object.keys(e).length} keys}`:String(e)}l(rt,"formatDisplayValue");function ts(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e,n=e.alternate,o=Kn(e);if(o&&n){let u=ot(e),c=ot(n),d=o.extractedHooks;if(u&&c&&d&&d.length>0){let h=d.find(T=>T.type==="useState");if(h){let T=u.find(b=>b.index===h.index),m=c.find(b=>b.index===h.index);if(T&&m){let b=T.value===h.value,f=m.value===h.value;b&&!f&&(t=n,n=e)}}}}let r=ot(t),i=null,a=null,s=null;return n?(i=n.memoizedProps,a=n.memoizedState,s=ot(n)):o&&(i=o.memoizedProps,a=o.memoizedState,s=o.extractedHooks),Yl(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:r}),i===null?{cause:"mount",hookChanges:null}:qn(i,t.memoizedProps)?Lr(a,t.memoizedState,{isClassComponent:t.tag===1})?{cause:"state",hookChanges:es(s,r)}:{cause:"parent",hookChanges:null}:{cause:"props",hookChanges:null}}l(ts,"detectComponentCause");function qn(e,t){if(e===t)return true;if(!e||!t||typeof e!="object"||typeof t!="object")return false;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return false;for(let r of n)if(e[r]!==t[r])return false;return true}l(qn,"shallowEqual");function it(e,t=3){let n=new WeakSet;function o(r,i){if(i>t)return"[MAX_DEPTH]";if(r===null)return null;if(r===void 0)return;if(typeof r=="function")return`[Function: ${r.name||"anonymous"}]`;if(typeof r=="symbol")return`[Symbol: ${r.toString()}]`;if(typeof r!="object")return r;if(n.has(r))return"[Circular]";if(n.add(r),Array.isArray(r))return r.slice(0,10).map(u=>o(u,i+1));let a={},s=Object.keys(r).slice(0,20);for(let u of s)try{a[u]=o(r[u],i+1)}catch{a[u]="[Error accessing]"}return a}return l(o,"stringify"),o(e,0)}l(it,"safeStringify");function zt(e){return e===void 0?"undefined":{0:"FunctionComponent",1:"ClassComponent",2:"IndeterminateComponent",3:"HostRoot",4:"HostPortal",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",12:"Profiler",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"}[e]||`Unknown(${e})`}l(zt,"getTagName");function ns(e,t){if(!(!t.hookChanges||t.hookChanges.length===0))for(let n of t.hookChanges)console.log("[Buoy]",`[${e||"Unknown"}] ${n.type}[${n.index}]: ${n.previousValue} \u2192 ${n.currentValue}`)}l(ns,"logMinimal");function os(e,t,n,o,r){let i=Ee(n)||"Unknown",a=typeof t?.type=="string"?t.type:"Unknown",{cause:s,hookChanges:u}=o;if(console.log("[Buoy]",`[RENDER] ${i} (${a}:${e}) | Cause: ${s.toUpperCase()}`+(r&&r.length>0?` | Props: [${r.join(", ")}]`:"")),u&&u.length>0)for(let c of u)console.log("[Buoy]",` \u2514\u2500 ${c.type}[${c.index}]: ${c.previousValue} \u2192 ${c.currentValue}`)}l(os,"logVerbose");function Er(e,t,n,o,r,i,a){let s=Ee(n)||"Unknown",u=typeof t?.type=="string"?t.type:"Unknown";console.log("[Buoy]",`
27
27
  [RN-BUOY RENDER DEBUG] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`),console.log("[Buoy]",`Render #${a} for ${u} (nativeTag: ${e})`),console.log("[Buoy]",`Timestamp: ${new Date().toISOString()}`),console.log("[Buoy]",`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
28
28
  `),console.log("[Buoy]",`NATIVE FIBER (${u}):`),console.log("[Buoy]",` type: "${t?.type}"`),console.log("[Buoy]",` tag: ${t?.tag} (${zt(t?.tag)})`);let c=t?.alternate;console.log("[Buoy]",` Previous values source: ${c?"alternate":o?"storage":"none"}`);let d=t?.memoizedProps?.children,h=c?.memoizedProps?.children,T=h!==void 0?h:o?.memoizedProps?.children,m=T!==void 0?d!==T:false;console.log("[Buoy]",` memoizedProps.children: ${rt(d)}${m?` (was: ${rt(T)})`:T!==void 0?" (unchanged)":" (first render)"}`);let b=t?.memoizedProps?.style,f=c?.memoizedProps?.style,S=f!==void 0?f:o?.memoizedProps?.style,v=S!==void 0?b!==S:false;if(b&&(console.log("[Buoy]",` memoizedProps.style: ${JSON.stringify(it(b,2))}${v?" (REFERENCE CHANGED)":""}`),v&&S)){let V=cn(b,S);console.log("[Buoy]",` \u2514\u2500 Values actually changed: ${!V}`)}console.log("[Buoy]",` All memoizedProps keys: [${Object.keys(t?.memoizedProps||{}).join(", ")}]`);let L=t?.memoizedProps?.testID,P=t?.memoizedProps?.nativeID,C=t?.memoizedProps?.accessibilityLabel;if(L&&console.log("[Buoy]",` testID: "${L}"`),P&&console.log("[Buoy]",` nativeID: "${P}"`),C&&console.log("[Buoy]",` accessibilityLabel: "${C}"`),console.log("[Buoy]",` alternate: ${c?"YES":"NO"}`),c&&console.log("[Buoy]",` alternate.memoizedProps.children: ${rt(h)}`),console.log("[Buoy]"," Tree structure:"),console.log("[Buoy]",` return (parent): ${t?.return?zt(t.return.tag):"null"}`),console.log("[Buoy]",` child: ${t?.child?zt(t.child.tag):"null"}`),console.log("[Buoy]",` sibling: ${t?.sibling?zt(t.sibling.tag):"null"}`),console.log("[Buoy]",""),console.log("[Buoy]",`COMPONENT FIBER (${s}):`),n){if(console.log("[Buoy]",` name: "${s}"`),console.log("[Buoy]",` type: ${typeof n.type} (${n.type?.name||n.type?.displayName||"anonymous"})`),console.log("[Buoy]",` tag: ${n.tag} (${zt(n.tag)})`),console.log("[Buoy]",` memoizedProps: ${JSON.stringify(it(n.memoizedProps,2))}`),console.log("[Buoy]",` alternate: ${n.alternate?"YES":"NO"}`),n.alternate){console.log("[Buoy]",` ALTERNATE memoizedProps: ${JSON.stringify(it(n.alternate.memoizedProps,2))}`);let z=!qn(n.alternate.memoizedProps,n.memoizedProps);console.log("[Buoy]",` Props changed (vs alternate): ${z?"YES":"NO"}`),console.log("[Buoy]",` ALTERNATE memoizedState: ${n.alternate.memoizedState===n.memoizedState?"SAME":"DIFFERENT"}`)}let V=Kn(n);if(V){console.log("[Buoy]",` WeakMap PREVIOUS memoizedProps: ${JSON.stringify(it(V.memoizedProps,2))}`);let z=!qn(V.memoizedProps,n.memoizedProps);console.log("[Buoy]",` Props changed (vs WeakMap): ${z?"YES":"NO"}`)}else console.log("[Buoy]"," WeakMap PREVIOUS state: (not found - first render or WeakMap cleared)");if(n._debugOwner){let z=Ee(n._debugOwner);console.log("[Buoy]",` _debugOwner: "${z}"`);let ue=n._debugOwner,pe=1;for(;ue&&pe<5;){let Fe=Ee(ue);console.log("[Buoy]",` \u2514\u2500[${pe}] ${Fe||"unknown"} (tag: ${ue.tag})`),ue=ue._debugOwner,pe++}}let U=0,x=t._debugOwner||t.return;for(;x&&x!==n&&U<30;)x=x.return,U++;console.log("[Buoy]",` Depth from native fiber: ${U}`)}else console.log("[Buoy]"," (No component fiber found - could not walk up tree)");if(console.log("[Buoy]",""),console.log("[Buoy]","HOOKS:"),n?.memoizedState){let V=ot(n),U=n.alternate?ot(n.alternate):null,x=Kn(n),z=U||x?.extractedHooks,ue=U?"alternate":x?"WeakMap":"none";V&&V.length>0?(console.log("[Buoy]",` Total hooks: ${V.length}`),console.log("[Buoy]",` Previous values source: ${ue}`),V.forEach((pe,Fe)=>{let be=z?.[Fe],Ho=be?be.rawState!==pe.rawState:false,xt=be?rt(be.value):"N/A",Jt=Ho?" \u2190 CHANGED":"";console.log("[Buoy]",` [${Fe}] ${pe.type}: ${rt(pe.value)}${be?` (was: ${xt})`:" (first render)"}${Jt}`)})):(console.log("[Buoy]"," (Could not extract hooks - memoizedState structure not recognized)"),console.log("[Buoy]",` Raw memoizedState type: ${typeof n.memoizedState}`),console.log("[Buoy]",` Has 'next' property: ${"next"in(n.memoizedState||{})}`),console.log("[Buoy]",` Has 'queue' property: ${"queue"in(n.memoizedState||{})}`))}else console.log("[Buoy]"," (No memoizedState - class component, no hooks, or not a function component)");if(console.log("[Buoy]",""),console.log("[Buoy]","RAW HOOKS DATA:"),n?.memoizedState&&typeof n.memoizedState=="object"){let V=n.memoizedState,U=0;for(;V&&U<10;)console.log("[Buoy]",` Hook[${U}]:`),console.log("[Buoy]",` memoizedState: ${it(V.memoizedState,2)}`),console.log("[Buoy]",` baseState: ${it(V.baseState,2)}`),console.log("[Buoy]",` queue: ${V.queue?"[Queue present]":"null"}`),console.log("[Buoy]",` next: ${V.next?"[Next hook]":"null"}`),V=V.next,U++;U===0&&console.log("[Buoy]"," (memoizedState is not a hooks linked list)")}console.log("[Buoy]",""),console.log("[Buoy]","DETECTION RESULTS:"),console.log("[Buoy]",` Component Cause: ${r.cause.toUpperCase()}`),r.hookChanges&&r.hookChanges.length>0&&(console.log("[Buoy]"," Hook Changes Detected:"),r.hookChanges.forEach(V=>{console.log("[Buoy]",` [${V.index}] ${V.type}: ${V.previousValue} \u2192 ${V.currentValue}`),V.description&&console.log("[Buoy]",` ${V.description}`)}));let I=typeof t?.type=="string"?t.type:void 0,k=Hr(o?.memoizedProps,t?.memoizedProps,I);k&&k.length>0?console.log("[Buoy]",` Native Props Changed: [${k.join(", ")}]`):o&&console.log("[Buoy]"," Native Props Changed: (none detected)"),console.log("[Buoy]",""),console.log("[Buoy]","BATCH CONTEXT:"),console.log("[Buoy]",` Batch size: ${i.size}`),console.log("[Buoy]",` All tags in batch: [${Array.from(i).slice(0,20).join(", ")}${i.size>20?"...":""}]`);let W=$r(t),X=W!==null&&i.has(W);if(console.log("[Buoy]",` Parent nativeTag: ${W??"not found"}`),console.log("[Buoy]",` Parent in batch: ${X?"YES":"NO"}`),i.size>1){console.log("[Buoy]"," Components in same batch:");let V=t?.return,U=0;for(;V&&U<10;){let x=Or(V.stateNode);if(x!==null&&i.has(x)){let z=Ee(V)||V.type;console.log("[Buoy]",` [depth ${U}] ${z} (tag: ${x})`)}V=V.return,U++}}console.log("[Buoy]",`
29
29
  \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/highlight-updates",
3
- "version": "7.0.79",
3
+ "version": "7.0.81",
4
4
  "description": "Highlight observed React Native renders and inspect available render diagnostics.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -34,11 +34,11 @@
34
34
  ],
35
35
  "sideEffects": false,
36
36
  "dependencies": {
37
- "@buoy-gg/shared-ui": "^7.0.79",
38
- "@buoy-gg/floating-tools-core": "^7.0.79"
37
+ "@buoy-gg/shared-ui": "^7.0.81",
38
+ "@buoy-gg/floating-tools-core": "^7.0.81"
39
39
  },
40
40
  "peerDependencies": {
41
- "@buoy-gg/license": "7.0.79",
41
+ "@buoy-gg/license": "7.0.81",
42
42
  "react": "*"
43
43
  },
44
44
  "peerDependenciesMeta": {
@@ -59,8 +59,8 @@
59
59
  "@types/react": "^19.1.0",
60
60
  "@types/react-native": "^0.73.0",
61
61
  "typescript": "~5.8.3",
62
- "@buoy-gg/core": "^7.0.79",
63
- "@buoy-gg/license": "^7.0.79"
62
+ "@buoy-gg/core": "^7.0.81",
63
+ "@buoy-gg/license": "^7.0.81"
64
64
  },
65
65
  "react-native-builder-bob": {
66
66
  "source": "src",