@buoy-gg/highlight-updates 7.0.77 → 7.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -1
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -1
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -1
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -1
- package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +1 -1
- package/lib/commonjs/highlight-updates/utils/domScreenElements.js +1 -1
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -1
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -1
- package/lib/module/highlight-updates/components/RenderDetailView.js +1 -1
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -1
- package/lib/module/highlight-updates/components/RendersCopySettingsView.js +1 -1
- package/lib/module/highlight-updates/utils/domScreenElements.js +1 -1
- package/lib/web/index.mjs +14 -14
- package/package.json +6 -6
package/lib/web/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";var In=Object.defineProperty;var
|
|
1
|
+
"use client";var In=Object.defineProperty;var dd=Object.getOwnPropertyDescriptor;var hd=Object.getOwnPropertyNames;var gd=Object.prototype.hasOwnProperty;var l=(e,t)=>In(e,"name",{value:t,configurable:true});var Xt=(e,t)=>()=>(e&&(t=e(e=0)),t);var Na=(e,t)=>{for(var n in t)In(e,n,{get:t[n],enumerable:true})},_o=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of hd(t))!gd.call(e,r)&&r!==n&&In(e,r,{get:()=>t[r],enumerable:!(o=dd(t,r))||o.enumerable});return e},pd=(e,t,n)=>(_o(e,t,"default"),n&&_o(n,t,"default"));var fd=e=>_o(In({},"__esModule",{value:true}),e);var ee,j=Xt(()=>{"use strict";ee=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis)});function Rn(e){return Xe[e]||e}function La(e){for(let[t,n]of Object.entries(Xe))if(n===e)return t;return null}function za(e){return e in Xe}function Ba(){return Object.keys(Xe)}function Va(){return[...new Set(Object.values(Xe))]}var Xe,Aa=Xt(()=>{"use strict";j();Xe={RCTView:"View",RCTSafeAreaView:"SafeAreaView",RCTModalHostView:"Modal",RCTText:"Text",RCTRawText:"RawText",RCTVirtualText:"VirtualText",RCTTextInlineImage:"TextInlineImage",RCTImageView:"Image",RCTImage:"Image",RCTScrollView:"ScrollView",RCTScrollContentView:"ScrollContentView",AndroidHorizontalScrollView:"HorizontalScrollView",AndroidHorizontalScrollContentView:"HorizontalScrollContentView",RCTSinglelineTextInputView:"TextInput",RCTMultilineTextInputView:"TextInput (Multiline)",AndroidTextInput:"TextInput",RCTInputAccessoryView:"InputAccessoryView",RCTRefreshControl:"RefreshControl",AndroidSwipeRefreshLayout:"RefreshControl",PullToRefreshView:"RefreshControl",RCTSwitch:"Switch",AndroidSwitch:"Switch",RCTSlider:"Slider",RCTActivityIndicatorView:"ActivityIndicator",AndroidProgressBar:"ActivityIndicator",AndroidDrawerLayout:"DrawerLayout",VirtualView:"VirtualView",VirtualViewExperimental:"VirtualView",DebuggingOverlay:"DebuggingOverlay",LayoutConformance:"LayoutConformance",UnimplementedNativeView:"UnimplementedView",RKShimmeringView:"ShimmeringView",RCTTemplateView:"TemplateView",RCTAxialGradientView:"AxialGradientView",RCTMap:"Map",RCTWebView:"WebView",RCTKeyframes:"Keyframes",RCTImpressionTrackingView:"ImpressionTrackingView",RNSVGSvgView:"Svg",RNSVGGroup:"G",RNSVGPath:"Path",RNSVGText:"SvgText",RNSVGTSpan:"TSpan",RNSVGTextPath:"TextPath",RNSVGImage:"SvgImage",RNSVGCircle:"Circle",RNSVGEllipse:"Ellipse",RNSVGLine:"Line",RNSVGRect:"Rect",RNSVGClipPath:"ClipPath",RNSVGDefs:"Defs",RNSVGUse:"Use",RNSVGSymbol:"Symbol",RNSVGPattern:"Pattern",RNSVGMask:"Mask",RNSVGForeignObject:"ForeignObject",RNSVGMarker:"Marker",RNSVGLinearGradient:"LinearGradient",RNSVGRadialGradient:"RadialGradient",RNSVGFilter:"Filter",RNSVGFeBlend:"FeBlend",RNSVGFeColorMatrix:"FeColorMatrix",RNSVGFeComposite:"FeComposite",RNSVGFeFlood:"FeFlood",RNSVGFeGaussianBlur:"FeGaussianBlur",RNSVGFeMerge:"FeMerge",RNSVGFeOffset:"FeOffset",RNSVGPolygon:"Polygon",RNSVGPolyline:"Polyline",RNSVGStop:"Stop",RNGestureHandlerRootView:"GestureHandlerRootView",RNGestureHandlerButton:"GestureHandlerButton",RNCSafeAreaProvider:"SafeAreaProvider",RNCSafeAreaView:"SafeAreaView",RNSScreen:"Screen",RNSScreenContainer:"ScreenContainer",RNSScreenStack:"ScreenStack",RNSScreenStackHeaderConfig:"ScreenStackHeaderConfig",RNSScreenStackHeaderSubview:"ScreenStackHeaderSubview",RNSSearchBar:"SearchBar",RNSFullWindowOverlay:"FullWindowOverlay",RNSModalScreen:"ModalScreen",ReanimatedView:"Animated.View",ExpoView:"ExpoView",ExpoBlurView:"BlurView",ExpoLinearGradient:"LinearGradient",ExpoImage:"ExpoImage",ExpoVideoView:"VideoView",ExpoCamera:"Camera",ExpoBarCodeScannerView:"BarCodeScanner",RNCWebView:"WebView",AIRMap:"MapView",AIRMapMarker:"Marker",AIRMapPolyline:"Polyline",AIRMapPolygon:"Polygon",AIRMapCircle:"Circle",AIRMapCallout:"Callout",RCTVideo:"Video",LottieAnimationView:"LottieView",FastImageView:"FastImage"};l(Rn,"getComponentDisplayName");l(La,"getNativeViewType");l(za,"isKnownViewType");l(Ba,"getAllNativeViewTypes");l(Va,"getAllComponentNames")});function Ea(){return Qt=performance.now(),Qt}function Ha(e,t){Qt>0&&e>0&&(Qt=0)}var Qt,Wo,Fa,Qe,kn=Xt(()=>{"use strict";j();Qt=0;l(Ea,"markEventReceived");l(Ha,"markOverlayRendered");Wo=class Ep{constructor(){this.enabled=false;this.batchCounter=0;this.listeners=new Set;this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0};this.recentBatches=[];this.MAX_HISTORY=100;this.summaryInterval=null;this.SUMMARY_INTERVAL_MS=1e4}setEnabled(t){let n=this.enabled;this.enabled=t,t&&!n?this.resetStats():!t&&n&&this.stopSummaryInterval()}isEnabled(){return this.enabled}startBatch(t,n){let o=`batch_${++this.batchCounter}`,r=performance.now(),i=null,a=null,s=null,u=null,c=null,d=0,h=0,T=0,m=0,b;return{markFilteringComplete:l((f,S)=>{i=performance.now(),d=f,h=S},"markFilteringComplete"),markMeasurementStart:l(()=>{a=performance.now()},"markMeasurementStart"),markMeasurementComplete:l((f,S)=>{s=performance.now(),T=f,m=S},"markMeasurementComplete"),markTrackingComplete:l(()=>{u=performance.now()},"markTrackingComplete"),markCallbackComplete:l(()=>{c=performance.now()},"markCallbackComplete"),setOverlayRenderTime:l(f=>{b=f},"setOverlayRenderTime"),getBatchId:l(()=>o,"getBatchId"),finish:l(()=>{let f=performance.now(),S={batchId:o,timestamp:Date.now(),nodesReceived:t,nodesFiltered:d,nodesToProcess:h,batchSize:n,nodesInBatch:Math.min(h,n),filteringTime:i?i-r:0,measurementTime:a&&s?s-a:0,trackingTime:s&&u?u-s:0,callbackTime:u&&c?c-u:0,totalTime:f-r,measurementSuccessCount:T,measurementFailCount:m,overlayRenderTime:b};return this.enabled&&this.recordMetrics(S),S},"finish")}}recordMetrics(t){this.rollingStats.batchCount++,this.rollingStats.totalNodes+=t.nodesReceived,this.rollingStats.totalFiltered+=t.nodesFiltered,this.rollingStats.totalProcessed+=t.nodesInBatch,this.rollingStats.totalTime+=t.totalTime,this.rollingStats.maxTime=Math.max(this.rollingStats.maxTime,t.totalTime),this.rollingStats.minTime=Math.min(this.rollingStats.minTime,t.totalTime);let n=this.rollingStats.avgMeasurementTime,o=this.rollingStats.batchCount;this.rollingStats.avgMeasurementTime=n+(t.measurementTime-n)/o,this.recentBatches.push(t),this.recentBatches.length>this.MAX_HISTORY&&this.recentBatches.shift(),this.notifyListeners(t)}logBatch(t){let{batchId:n,nodesReceived:o,nodesFiltered:r,nodesInBatch:i,batchSize:a,filteringTime:s,measurementTime:u,trackingTime:c,callbackTime:d,totalTime:h,measurementSuccessCount:T,measurementFailCount:m,overlayRenderTime:b}=t;console.log("[Buoy]",`[HighlightPerf] ${n} | In:${o} Filt:${r} Proc:${i}/${a} | Filter:${s.toFixed(1)}ms Measure:${u.toFixed(1)}ms Track:${c.toFixed(1)}ms Callback:${d.toFixed(1)}ms | Total:${h.toFixed(1)}ms`+(b?` Render:${b.toFixed(1)}ms`:"")+` | Success:${T} Fail:${m}`),h>100&&console.warn("[Buoy]",`[HighlightPerf] \u26A0\uFE0F SLOW BATCH: ${h.toFixed(1)}ms - Measurement phase: ${u.toFixed(1)}ms (${(u/h*100).toFixed(0)}%)`)}logSummary(){if(this.rollingStats.batchCount===0)return;let t=this.rollingStats,n=t.totalTime/t.batchCount,o=t.totalNodes/t.batchCount;console.log("[Buoy]",`
|
|
2
2
|
[HighlightPerf] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 SUMMARY (last ${this.SUMMARY_INTERVAL_MS/1e3}s) \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
|
|
3
3
|
Batches: ${t.batchCount}
|
|
4
4
|
Avg nodes/batch: ${o.toFixed(1)} (filtered: ${(t.totalFiltered/t.batchCount).toFixed(1)})
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Avg measurement time: ${t.avgMeasurementTime.toFixed(1)}ms
|
|
7
7
|
Min/Max time: ${t.minTime.toFixed(1)}ms / ${t.maxTime.toFixed(1)}ms
|
|
8
8
|
\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
|
|
9
|
-
`),this.resetStats()}resetStats(){this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0}}startSummaryInterval(){this.stopSummaryInterval(),this.summaryInterval=setInterval(()=>{this.logSummary()},this.SUMMARY_INTERVAL_MS)}stopSummaryInterval(){this.summaryInterval&&(clearInterval(this.summaryInterval),this.summaryInterval=null)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(t){for(let n of this.listeners)try{n(t)}catch(o){console.error("[Buoy]","[HighlightPerf] Error in metrics listener:",o)}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[],this.resetStats(),this.batchCounter=0}generateReport(){let t=this.recentBatches;if(t.length===0)return"No performance data collected yet.";let n=t.reduce((a,
|
|
9
|
+
`),this.resetStats()}resetStats(){this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0}}startSummaryInterval(){this.stopSummaryInterval(),this.summaryInterval=setInterval(()=>{this.logSummary()},this.SUMMARY_INTERVAL_MS)}stopSummaryInterval(){this.summaryInterval&&(clearInterval(this.summaryInterval),this.summaryInterval=null)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(t){for(let n of this.listeners)try{n(t)}catch(o){console.error("[Buoy]","[HighlightPerf] Error in metrics listener:",o)}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[],this.resetStats(),this.batchCounter=0}generateReport(){let t=this.recentBatches;if(t.length===0)return"No performance data collected yet.";let n=t.reduce((a,s)=>a+s.totalTime,0)/t.length,o=t.reduce((a,s)=>a+s.measurementTime,0)/t.length,r=t.filter(a=>a.totalTime>100),i=t.filter(a=>a.totalTime<20);return`
|
|
10
10
|
\u2554\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\u2557
|
|
11
11
|
\u2551 HIGHLIGHT UPDATES PERFORMANCE REPORT \u2551
|
|
12
12
|
\u2560\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\u2563
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
\u2551 Slow batches (>100ms): ${r.length.toString().padStart(5)} (${(r.length/t.length*100).toFixed(0)}%) \u2551
|
|
19
19
|
\u2560\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\u2563
|
|
20
20
|
\u2551 Time breakdown (avg): \u2551
|
|
21
|
-
\u2551 Filtering: ${t.reduce((a,
|
|
21
|
+
\u2551 Filtering: ${t.reduce((a,s)=>a+s.filteringTime,0/t.length).toFixed(1).padStart(6)}ms \u2551
|
|
22
22
|
\u2551 Measurement: ${o.toFixed(1).padStart(6)}ms \u2190 Primary bottleneck \u2551
|
|
23
|
-
\u2551 Tracking: ${(t.reduce((a,
|
|
24
|
-
\u2551 Callback: ${(t.reduce((a,
|
|
23
|
+
\u2551 Tracking: ${(t.reduce((a,s)=>a+s.trackingTime,0)/t.length).toFixed(1).padStart(6)}ms \u2551
|
|
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
|
-
`}};s(Wo,"PerformanceLoggerSingleton");Ba=Wo,Qe=new Ba});function Va(e){if(e.isComponent===true||e.testID&&e.testID.trim())return true;let t=(e.componentName??"").trim();if(!t||jo.has(t)||Aa.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,Aa,gd=Xt(()=>{"use strict";j();jo=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]),Aa=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"]);s(Va,"isNamedComposite")});var Ea={};Ia(Ea,{RenderTracker:()=>B,default:()=>$a});var Uo,Ha,Go,Fa,B,$a,Ve=Xt(()=>{"use strict";j();Na();Dn();gd();Uo=200,Ha=150,Go=class Vp{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:Ha,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((l,u)=>l.lastRenderTime-u.lastRenderTime).slice(0,this.renders.size-Uo);for(let l of a)this.renders.delete(l.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(Va)),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)}}};s(Go,"RenderTrackerSingleton");Fa=Go,B=new Fa,$a=B});j();j();import{useState as Ko,useEffect as qo,useCallback as pd}from"react";import{HighlighterIcon as Ma,HighlightIcon as Oa}from"@buoy-gg/floating-tools-core/web";j();import{getDOMFiber as Jo,getDOMNodeHandle as _a,getDOMPublicInstance as fd,isDOMElement as Wa}from"@buoy-gg/shared-ui/web/utils";j();var It=null,Rt=null,Zt=false,en=false,kn=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}s(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)}))),kn&&kn(o)}return It(t,...n)})}s(ja,"swizzleHookEmit");function Ua(){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)})}s(Ua,"swizzleAgentEmit");function Ga(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;e?.rendererInterfaces&&e.rendererInterfaces.forEach(t=>{if(typeof t.setTraceUpdatesEnabled=="function")try{t.setTraceUpdatesEnabled(false)}catch{}})}s(Ga,"disableTracingOnAllRenderers");function Xo(e){kn=e}s(Xo,"setComparisonCallback");function Qo(){typeof ee<"u"&&!ee||Zt||(ja(),Ua(),Zt=true)}s(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),Ga(),kn=null,Zt=false}s(Zo,"uninstallProfilerInterceptor");function Ka(){return Zt}s(Ka,"isInterceptorInstalled");function qa(){en=true}s(qa,"enableProfilerLogging");function Ja(){en=false}s(Ja,"disableProfilerLogging");function Ya(){return en}s(Ya,"isLoggingEnabled");var Xa={};Ia(Xa,{AccessibilityInfo:()=>vd,ActivityIndicator:()=>hh,Alert:()=>ph,Animated:()=>ch,AppRegistry:()=>Td,AppState:()=>wd,Appearance:()=>Cd,BackHandler:()=>Sd,Button:()=>gh,CheckBox:()=>Ad,Clipboard:()=>xd,DeviceEventEmitter:()=>Yd,Dimensions:()=>Ze,Easing:()=>Id,FlatList:()=>Za,I18nManager:()=>Rd,Image:()=>Ed,ImageBackground:()=>Hd,InteractionManager:()=>kd,Keyboard:()=>Dd,KeyboardAvoidingView:()=>Fd,LayoutAnimation:()=>Pd,Linking:()=>Nd,LogBox:()=>Jd,Modal:()=>il,NativeEventEmitter:()=>Ld,NativeModules:()=>bd,PanResponder:()=>zd,Picker:()=>$d,PixelRatio:()=>er,Platform:()=>Qa,Pressable:()=>ol,ProgressBar:()=>Md,RefreshControl:()=>Od,SafeAreaView:()=>_d,ScrollView:()=>$e,SectionList:()=>Wd,Share:()=>Bd,StatusBar:()=>jd,StyleSheet:()=>Ce,Switch:()=>Pt,Text:()=>p,TextInput:()=>Nn,Touchable:()=>Ud,TouchableHighlight:()=>uh,TouchableNativeFeedback:()=>Gd,TouchableOpacity:()=>Y,TouchableWithoutFeedback:()=>dh,UIManager:()=>tn,Vibration:()=>Vd,View:()=>g,VirtualizedList:()=>Kd,YellowBox:()=>qd,findNodeHandle:()=>Nt,unstable_createElement:()=>yd,useColorScheme:()=>Xd,useLocaleContext:()=>Qd,useWindowDimensions:()=>Zd});j();dd(Xa,md);import*as md from"react-native-web";import{unstable_createElement as yd,NativeModules as bd,AccessibilityInfo as vd,Appearance as Cd,AppRegistry as Td,AppState as wd,BackHandler as Sd,Clipboard as xd,Dimensions as Ze,Easing as Id,I18nManager as Rd,Keyboard as Dd,InteractionManager as kd,LayoutAnimation as Pd,Linking as Nd,NativeEventEmitter as Ld,PanResponder as zd,PixelRatio as er,Platform as Qa,Share as Bd,UIManager as tn,Vibration as Vd,CheckBox as Ad,FlatList as Za,Image as Ed,ImageBackground as Hd,KeyboardAvoidingView as Fd,Picker as $d,ProgressBar as Md,RefreshControl as Od,SafeAreaView as _d,SectionList as Wd,StatusBar as jd,Touchable as Ud,TouchableNativeFeedback as Gd,VirtualizedList as Kd,YellowBox as qd,LogBox as Jd,DeviceEventEmitter as Yd,useColorScheme as Xd,useLocaleContext as Qd,useWindowDimensions as Zd}from"react-native-web";import*as fe from"react-native-web";import{createElement as tr,forwardRef as el,useCallback as eh,useRef as th}from"react";j();import{useEffect as nh,useState as oh}from"react";import{createPortal as rh}from"react-dom";j();var ih='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as ah}from"react/jsx-runtime";var nn=Symbol.for("@buoy-gg/portal-host"),tl=s(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:ih});let n=s(()=>{let d=document.fullscreenElement,h=d&&d.tagName!=="CANVAS"?d:document.body;t.parentElement!==h&&h.appendChild(t)},"move"),o=new Map,r=s(d=>{(!t.contains(d.target)||!tl(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=s(d=>{o.delete(d.code||d.key)},"up"),a=s(()=>o.clear(),"clear"),l=s(()=>{let d=[...o.values()];o.clear();for(let h of d)document.dispatchEvent(new KeyboardEvent("keyup",{...h,bubbles:true}))},"focus"),u=s(d=>{tl(d.target)&&d.stopPropagation()},"key"),c=s(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",l),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:s(()=>{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}s(nr,"getBuoyPortalHost");function nl({children:e}){let[t,n]=oh(null);return nh(()=>{let o=nr(),r=document[nn];return r.users++,n(o),()=>{--r.users===0&&r.dispose()}},[]),t?rh(ah("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}s(nl,"BuoyPortal");var Dt=fe,lh=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],kt=s(e=>typeof e=="number"?`${e}px`:e,"px");function Pn(e){if(Array.isArray(e)){let h=e.map(Pn);return h.some((T,f)=>T!==e[f])?h:e}if(!e||typeof e!="object"||!lh.some(h=>e[h]!=null))return e;let{shadowColor:t,shadowOffset:n,shadowOpacity:o,shadowRadius:r,textShadowColor:i,textShadowOffset:a,textShadowRadius:l,...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)`,f=`${kt(n?.width??0)} ${kt(n?.height??0)} ${kt(r??0)} ${T}`;u.boxShadow=typeof u.boxShadow=="string"?`${u.boxShadow}, ${f}`:u.boxShadow??f}let{width:c=0,height:d=0}=a??{};if(i&&(c||d||l)){let h=`${kt(c)} ${kt(d)} ${kt(l??0)} ${i}`;u.textShadow=u.textShadow?`${u.textShadow}, ${h}`:h}return u}s(Pn,"webShadows");var sh=Dt.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,sh[t]]:n}s(or,"webStyle");var Ce={...Dt.StyleSheet,create:s(e=>Dt.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Pn(n)]))),"create")};function Te(e){let t=el((o,r)=>{let{accessibilityState:i,accessibilityValue:a,pointerEvents:l,...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,l);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}s(Te,"withAccessibility");var g=Te(fe.View),p=Te(fe.Text),ch={...Dt.Animated,View:Dt.Animated.createAnimatedComponent(g),Text:Dt.Animated.createAnimatedComponent(p)},Nn=Te(fe.TextInput),Y=Te(fe.TouchableOpacity),uh=Te(fe.TouchableHighlight),dh=Te(fe.TouchableWithoutFeedback),ol=Te(fe.Pressable),$e=Te(fe.ScrollView),rl=el((e,t)=>{let n=th(null),o=eh(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(nl,null,tr(fe.Modal,{...e,ref:o}))});rl.displayName="Modal";var il=Te(rl),Pt=Te(fe.Switch),hh=Te(fe.ActivityIndicator),gh=Te(fe.Button),Nt=fe.findNodeHandle,ph={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 l=n?.length?n:[{text:"OK"}],u=s(()=>{r.close?.(),r.remove()},"close");for(let c of l){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 fh,getDOMNodeHandle as Ln,getDOMPublicInstance as al,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}s(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}s(zn,"isRectCenterOnScreen");function ir(e){return String(e??"").toLowerCase().replace(/\s+/g," ").replace(/(\d)[,\u00a0\u202f](?=\d{3}\b)/g,"$1").trim()}s(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 l=ir(a);l===i?r=Math.max(r,90):l.startsWith(i)?r=Math.max(r,45):l.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)}s(Lt,"scoreTapMatch");j();import{getDOMControlProps as mh}from"@buoy-gg/shared-ui/web/utils";var yh=new Set(["button","link","menuitem","tab","switch","checkbox","radio","option","textbox","slider"]),bh=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE","SVG","PATH","HEAD","META","LINK"]),ar=80;function ll(e){for(let t in e)if(t.startsWith("__reactContainer$")||t==="_reactRootContainer")return true;return false}s(ll,"isReactContainer");function sl(e){if(e.getAttribute("aria-hidden")==="true")return true;let t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}s(sl,"isHidden");function cl(e){let t=e;return typeof t.$$click=="function"||typeof t.onclick=="function"||e.tabIndex>=0&&e.hasAttribute("tabindex")}s(cl,"hasClick");function ul(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===3&&(t+=n.textContent??"");return t=t.replace(/\s+/g," ").trim(),t||void 0}s(ul,"ownText");function lr(e,t){if(e)return t||e.length<=ar?e:`${e.slice(0,ar)}\u2026`}s(lr,"clip");function dl(e,t){return lr((e.innerText??e.textContent??"").replace(/\s+/g," ").trim(),t)}s(dl,"allText");var et="input, textarea, select",hl=`${et}, button, a[href]`;function rn(e){let t="",n=s(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()}s(rn,"readText");function sr(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(hl)&&!o.querySelector(hl)?o:null}let r=t.parentElement;if(!r||r.querySelectorAll(et).length>1)return null;t=r}return null}s(sr,"nearbyLabel");function gl(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)?sr(e):null;return t||e.getAttribute("aria-label")||n||e.getAttribute("title")||e.getAttribute("placeholder")||(o?rn(o):"")}s(gl,"accessibleName");function pl(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&&sr(a)===o)return a}return null}s(pl,"labeledField");function cr(e={}){if(typeof document>"u"||!document.body)return[];let t=[],n=s((o,r,i)=>{if(bh.has(o.tagName.toUpperCase())||ll(o)||sl(o))return;let a=i||o.hasAttribute("data-buoy-root")||o.hasAttribute("data-buoy-portal-host"),l=o.tagName.toLowerCase(),u=o.getAttribute("role")??void 0,c=l==="button"||l==="a"&&o.hasAttribute("href")||l==="input"||l==="textarea"||l==="select"||u!==void 0&&yh.has(u)||cl(o),d=o.getAttribute("data-testid")??void 0,h=c?lr(gl(o),!!e.fullText):o.getAttribute("aria-label")??void 0,T=c?dl(o,!!e.fullText):r?void 0:ul(o);if(c||d||h||T){let f={"data-testid":d,"aria-label":h,role:u,id:o.id||void 0};c&&l!=="input"&&l!=="textarea"&&l!=="select"&&(f.onClick=()=>o.click());let b=mh(o,f);if(u==="switch"||u==="checkbox"){let m=o.getAttribute("aria-checked")==="true";b.value=m,b.onValueChange=S=>{!!S!=(o.getAttribute("aria-checked")==="true")&&o.click()},delete b.onPress}o.disabled&&delete b.onPress,t.push({element:o,props:b,text:T,buoy:a})}for(let f of Array.from(o.children))f instanceof HTMLElement&&n(f,r||c,a)},"walk");return n(document.body,false,false),t}s(cr,"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()}s(Bn,"domElementName");function fl(){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)}s(fl,"watchDOMChanges");var Vn=5,vh=22,ur=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function dr(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}s(dr,"getReactDevToolsHook");var hr=0,ml=false;function yl(){if(ml)return;let e=dr();if(!e)return;let t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){return hr++,typeof t=="function"?t.apply(e,n):void 0},ml=true}s(yl,"ensureCommitCounter");var Ch=250;function gr(){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}}s(gr,"makeChromeCheck");function Me(){let e=dr();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}s(Me,"getAllFiberRoots");function pr(e){return e.tag===vh&&e.memoizedState!==null}s(pr,"isHiddenOffscreen");var tt=false,fr=0,an=false;function mr(e,t){let n=tt;tt=e;try{return t()}finally{tt=n}}s(mr,"withHiddenScreens");function bl(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}s(bl,"isNotShowingScreen");function yr(e){let t=e.memoizedProps?.activityState;return t===0||t===1||e.memoizedProps?.isPageFocused===false?true:!tt&&bl(e)?(fr++,true):false}s(yr,"isInactiveScreen");function Ae(e,t,n=0,o=new Set){if(!(!e||o.has(e)||n>500)){if(o.add(e),pr(e)||yr(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)}}s(Ae,"traverseFiberTree");function An(e){let t=al(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}s(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}s(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}s(En,"findHostInstance");function vl(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}s(vl,"findScrollAncestor");async function Cl(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=vl(e);if(!r)return false;let i=t,a=null,l=s(u=>new Promise(c=>{let d=false,h=s(f=>{d||(d=true,c(f))},"settle"),T=setTimeout(()=>h(null),600);try{u(f=>{clearTimeout(T),h(f)})}catch{clearTimeout(T),h(null)}}),"withTimeout");if(r.nativeRef&&typeof i.measureLayout=="function"&&(a=await l(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 l(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}}s(Cl,"scrollIntoView");function Oe(e){let t=e?.type;return t?typeof t=="string"?t:t.displayName||t.name||null:null}s(Oe,"getComponentName");function Hn(e){let t=e?._debugOwner||e?.return,n=0;for(;t&&n<30;){n++;let o=Oe(t);if(o&&!ur.has(o)&&typeof t.type!="string")return o;t=t.return}return null}s(Hn,"getOwningComponentName");function le(e){return fh(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}s(le,"getProps");function br(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=br(o,t+1);r&&n.push(r)}return n.length>0?n.join(""):void 0}}s(br,"flattenText");function Tl(e){return e.replace(/\s+/g," ").trim()}s(Tl,"normalizeVisibleText");function Fn(e){if(!e)return;let t=s(n=>{let o=br(n);if(o===void 0)return;let r=Tl(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}s(Fn,"getVisibleText");function wl(e,t){let n=[],o=s((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 l=Fn(le(i));l&&!n.includes(l)&&n.push(l),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}s(wl,"collectDescendantText");function Sl(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}s(Sl,"findPressHandler");function _e(e){return new Promise(t=>{let n=false,o=s(r=>{n||(n=true,t(r))},"done");setTimeout(()=>o(null),1e3);try{typeof e.measureInWindow=="function"?e.measureInWindow((r,i,a,l)=>{a>0&&l>0?o({x:r,y:i,width:a,height:l}):o(null)}):typeof e.measure=="function"?e.measure((r,i,a,l,u,c)=>{a>0&&l>0&&u!=null&&c!=null?o({x:u,y:c,width:a,height:l}):o(null)}):o(null)}catch{o(null)}})}s(_e,"measureInstance");var Th=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function $n(){let e=Me(),t=[],n=new Map,o=new Map,r=gr();for(let i of e)Ae(i.current,a=>{let l=le(a);if(!l)return;let u=typeof l.onPress=="function"||typeof l.onLongPress=="function",c=typeof l.onValueChange=="function",d=typeof l.onChangeText=="function",h=l.testID||void 0,T=l.accessibilityLabel||void 0,f=l.accessibilityRole||l.role||void 0,b=Fn(l),m=f==="button"||f==="link"||f==="menuitem"||f==="tab"||f==="switch"||f==="checkbox",S=typeof a.type=="string"&&Th.has(a.type)&&l.animating!==false;if(!u&&!c&&!d&&!h&&!T&&!b&&!m&&!S)return;let v=null,L=null,P=null;if(c){let x=l.value,z=typeof x=="number"||typeof l.minimumValue=="number";L={handler:l.onValueChange,kind:z?"slider":"toggle",current:x,min:typeof l.minimumValue=="number"?l.minimumValue:void 0,max:typeof l.maximumValue=="number"?l.maximumValue:void 0}}else d?P={handler:l.onChangeText,current:typeof l.value=="string"?l.value:void 0}:v=Sl(a);let C=Oe(a),I=C??"Unknown";(!C||ur.has(C)||typeof a.type=="string")&&(I=Hn(a)??C??"Unknown");let D=En(a);if(!D&&!h)return;!b&&!T&&u&&(b=wl(a,6));let W=D?.instance??null,X=D?.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:f??(S?"progressbar":void 0),testID:h,label:T,text:b,instance:W,stateNode:D?.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(...vr()),t}s($n,"collectCandidates");function vr(){return cr({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:al(e),stateNode:e,fiber:null,buoy:o,press:a,valueControl:r,textControl:i,rect:null}})}s(vr,"collectDOMCandidates");function xl(e,t){return t.nativeTag!=null?e.nativeTag===t.nativeTag:t.testID&&e.testID?e.testID.toLowerCase()===t.testID.toLowerCase():false}s(xl,"explicitlyTargets");function Mn(e){let t=$n();return e.includeBuoy?t:t.filter(n=>!n.buoy||xl(n,e))}s(Mn,"appCandidates");async function Cr(e){await Promise.all(e.map(async t=>{t.instance&&(t.rect=await _e(t.instance))}))}s(Cr,"measureCandidates");var wh=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function Il(e,t){let n=[],o=gr();for(let i of Me())Ae(i.current,a=>{if(Oe(a)!=="VirtualizedList")return;let l=a.memoizedProps;if(!l||typeof l.getItemCount!="function"||!e&&o(a))return;let u;try{u=Number(l.getItemCount(l.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;let c=[],d=s((f,b)=>{for(let m=f?.child;m;m=m.sibling){let S=Oe(m);if(S!=="VirtualizedList"){if(S==="CellRenderer"){c.push(m);continue}b<40&&d(m,b+1)}}},"walk");d(a,0);let h=a,T=Hn(h);for(let f=0;f<6&&T&&wh.test(T);f++)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 l=>{let u=En(l);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}s(Il,"collectLists");async function ln(e={}){let t=tt,n=an;tt=!!e.includeHidden,an=!!e.fullText;try{return await Rl(e)}finally{tt=t,an=n}}s(ln,"describeScreen");async function Rl(e){fr=0;let t=$n(),n=fr,o=e.includeBuoy?t:t.filter(d=>!d.buoy),r=t.length-o.length;await Cr(o);let i=Ze.get("window"),a=Math.round(i.width)||1,l=Math.round(i.height)||1,u=[];for(let d of o){let h=d.rect;if(!h&&!d.testID)continue;let T,f;if(h){let S=h.x+h.width/2,v=h.y+h.height/2;if(v<-l*.1||v>l*1.1||S<-a*.1||S>a*1.1)continue;T={x:ke(S/a),y:ke(v/l)},f={x:ke(h.x/a),y:ke(h.y/l),width:ke(h.width/a),height:ke(h.height/l)}}let b=d.valueControl?d.valueControl.kind:d.textControl?"text":void 0,m=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:m,tap:T,frame:f})}u.sort((d,h)=>{let T=d.tap?.y??2,f=h.tap?.y??2;return Math.abs(T-f)>.02?T-f:(d.tap?.x??2)-(h.tap?.x??2)});let c=await Il(!!e.includeBuoy,d=>{if(!d)return false;let h=d.x+d.width/2;return d.y<=l*1.1&&d.y+d.height>=-l*.1&&h>=-a*.1&&h<=a*1.1});return{screen:{width:a,height:l},count:u.length,elements:u,...r>0?{hiddenBuoy:r}:{},...n>0?{hiddenScreens:n}:{},...c.length?{lists:c}:{}}}s(Rl,"describeScreenInner");function ke(e){return Math.round(e*100)/100}s(ke,"round2");function Tr(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}s(Tr,"fieldsOf");function On(e,t){return Lt(Tr(e),t)}s(On,"matchScore");function wr(e,t,n){if(!(!e||!t||!n))return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}s(wr,"tapPoint");function Sr(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:s(()=>{},"persist"),preventDefault:s(()=>{},"preventDefault"),stopPropagation:s(()=>{},"stopPropagation"),isDefaultPrevented:s(()=>false,"isDefaultPrevented"),isPropagationStopped:s(()=>false,"isPropagationStopped"),target:null,currentTarget:null,type:"press",timeStamp:0}}s(Sr,"makeSyntheticPressEvent");async function Dl(e){let t=mr(!!e.includeHidden,()=>Mn(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=s(C=>!!(C.press||C.valueControl||C.textControl),"isInteractive");if(n.length===0&&!e.includeHidden&&mr(true,()=>Mn(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,l=n.slice(0,15);await Promise.all(l.map(async C=>{C.c.instance&&!C.c.rect&&(C.c.rect=await _e(C.c.instance))}));for(let C of l)C.score=Lt({...Tr(C.c),tap:wr(C.c.rect,i,a)},e);if(l.sort((C,I)=>I.score-C.score),e.text!==void 0)for(let C of l){let I=!o(C.c)&&on(C.c.stateNode)?pl(C.c.stateNode):null,D=I?t.find(W=>W.stateNode===I&&W.textControl):void 0;D&&(C.c=D)}let u=l.find(C=>o(C.c))??n.find(C=>o(C.c))??l[0],c=u.c,d=s((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=l.filter(C=>C!==u&&o(C.c)&&C.score===u.score).filter(C=>!d(C.c,c)).filter((C,I,D)=>D.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:wr(C.c.rect,i,a)})),T=e.nativeTag==null&&!(e.testID&&!e.query);if(T&&h.length>0){let C=[c,...h.map(I=>l.find(D=>D.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 f=l[0];if(T&&f&&f!==u&&!o(f.c)&&f.score>=90&&u.score<f.score-40)return{tapped:false,reason:`The best match for "${e.query}" is "${f.c.text??f.c.label??f.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 Cl(c.fiber,c.instance,c.stateNode,80),b&&(c.rect=await _e(c.instance)));let m={nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text};yl();let S=hr,v=c.fiber===null&&on(c.stateNode)?fl():null,L=Date.now(),P=s(async C=>(await new Promise(I=>setTimeout(I,Ch)),{tapped:true,scrolled:b,matched:C,effect:{commits:v?v():hr-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(Sr(c.rect)),await P({...m,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:{...m,via:"onPress"}}}return c.press.handler(Sr(c.rect)),await P({...m,via:c.press.kind})}if(c.valueControl){let I=c.valueControl,D;if(I.kind==="toggle")D=typeof e.value=="boolean"?e.value:!I.current;else{let W=I.min??0,X=I.max??1;typeof e.value=="number"?D=Math.min(X,Math.max(W,e.value)):D=I.current===X?W:X}return I.handler(D),await P({...m,via:"onValueChange",value:D})}let C=e.text??(typeof e.value=="string"?e.value:"");return c.textControl.handler(C),await P({...m,via:"onChangeText",value:C})}catch(C){return v?.(),{tapped:false,scrolled:b,reason:`handler threw: ${C instanceof Error?C.message:String(C)}`,matched:{...m,via:c.press?c.press.kind:c.valueControl?"onValueChange":"onChangeText"}}}}s(Dl,"tapElement");var Sh=5e3,xh=3e4,Ih=50,Rh=150;async function kl(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??Sh,0),xh),n=Math.max(e.pollMs??Rh,Ih),o=e.gone===true,r=Date.now(),i=0;for(;;){i+=1;let{hit:a,closest:l}=await Pl(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=l?.length?l: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))}}s(kl,"waitFor");async function Pl(e){let t=Mn(e).map(l=>({c:l,score:On(l,e)})).filter(l=>l.score>0).sort((l,u)=>u.score-l.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await Cr(t.map(l=>l.c));let n=Ze.get("window"),o=Math.round(n.width)||1,r=Math.round(n.height)||1,i=null;for(let{c:l}of t)if(zn(l.rect,o,r)){i={nativeTag:l.nativeTag,name:l.name,testID:l.testID,label:l.label,text:l.text,interactive:!!(l.press||l.valueControl||l.textControl)};break}let a=t.slice(0,3).map(({c:l})=>({name:l.name,testID:l.testID,text:l.text,onScreen:zn(l.rect,o,r)}));return{hit:i,closest:a}}s(Pl,"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}s(_n,"isBuoyChrome");function Nl(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 l=0;l<6&&a;l++){let u=t.get(a);if(u)return u;a=a.return}return e}s(Nl,"preferHandlerOwner");function Wn(e){let t=$n();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 Me())if(Ae(a.current,l=>{r||l.stateNode&&nt(l.stateNode)===e&&(r=l)}),r)break}let i=o??null;if(!i&&r){let a=r,l=0,u=null;for(;a&&l<25;){let c=n.get(a);if(c){if(c.press||c.valueControl||c.textControl){i=c;break}u||(u=c)}a=a.return,l++}i||(i=u)}if(!i?.fiber&&!r){let a=i?.stateNode,l=on(a)?a:Ll(e);if(l){for(let u=l;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=Nl(i,n),!i.press&&!i.valueControl&&!i.textControl)||_n(i.fiber)?null:jn(i)}s(Wn,"resolveTouchTarget");function Ll(e){let t=globalThis.document;return t?.querySelectorAll?Array.from(t.querySelectorAll("*")).find(n=>Ln(n)===e)??null:null}s(Ll,"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}}s(jn,"touchTargetOf");function zl(e){let t=null;for(let n of Me())if(Ae(n.current,o=>{!t&&o.stateNode&&nt(o.stateNode)===e&&(t=o)}),t)break;return t}s(zl,"fiberForTag");function xr(){let e=[];for(let t of Me()){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}s(xr,"rootHostFibers");function Bl(e,t){let n=globalThis.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!="function")return null;let o=xr().filter(r=>r.stateNode?.node);return o.length?new Promise(r=>{let i=setTimeout(()=>r(null),1e3),a=o.length,l=null;o.forEach((u,c)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,d=>{d&&(!l||c>=l.i)&&(l={i:c,fiber:d}),--a===0&&(clearTimeout(i),r(l?.fiber??null))})}catch{--a===0&&(clearTimeout(i),r(l?.fiber??null))}})}):null}s(Bl,"fabricFiberAt");function Vl(e,t){let n=tn?.findSubviewIn;if(typeof n!="function")return null;let o=xr()[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],l=>{clearTimeout(a),i(typeof l=="number"?zl(l):null)})}catch{clearTimeout(a),i(null)}})}s(Vl,"paperFiberAt");function Al(){let e=[],t=new Set,n=s(r=>{let i=[],a=s((l,u)=>{for(let c=l;c&&i.length<5e3;c=c.sibling)t.has(c)||u>500||pr(c)||yr(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=s((r,i)=>{t.has(r)||i>500||(t.add(r),e.push(r),Ir(n(r)).forEach(a=>o(a,i+1)))},"walk");for(let r of Me())Ir(n(r.current)).forEach(i=>o(i,0));return e}s(Al,"visibleHostFibers");function Ir(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)}s(Ir,"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}s(Un,"flatStyle");var Dh=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function El(e){if(typeof e.type=="string"&&Dh.has(e.type)&&e.type!=="RCTScrollContentView")return true;let t=Un(le(e)?.style).overflow;return t==="hidden"||t==="scroll"}s(El,"clipsChildren");function Hl(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}s(Hl,"passesTouchesThrough");async function Fl(e,t,n){let o=await Promise.all(n.map(l=>{let u=An(l.stateNode);return u?_e(u):Promise.resolve(null)})),r=new Map;n.forEach((l,u)=>r.set(l,o[u]));let i=s(l=>!!l&&e>=l.x&&e<=l.x+l.width&&t>=l.y&&t<=l.y+l.height,"inside"),a=s(l=>{for(let u=l.return,c=0;u&&c<300;u=u.return,c++)if(u.tag===Vn&&r.has(u)&&El(u)&&!i(r.get(u)))return true;return false},"clippedAway");for(let l=n.length-1;l>=0;l--)if(!(!i(o[l])||Hl(n[l])||a(n[l])))return n[l];return null}s(Fl,"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}s($l,"domFiberAt");function Ml(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=vr(),l=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:l?.testID,label:l?.label,text:l?.text},path:c,target:u&&!i?jn(u):null}}s(Ml,"domPageHit");async function Ol(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",l=null,u=$l(t,n),c=u?null:Ml(t,n);if(c)return c;if(u)a="dom",l=u;else{let m=Bl(r,i);if(m)a="fabric",l=await m;else{let v=Vl(r,i);v&&(a="paper",l=await v)}let S=Al();(!l||!new Set(S).has(l))&&(l=await Fl(r,i,S),a="measured")}if(!l)return{found:false,method:a};let d=le(l)??{},h=nt(l.stateNode),T=[],f=l,b=0;for(;f&&b++<80&&T.length<6;){let m=Oe(f);m&&typeof f.type!="string"&&!ur.has(m)&&T[T.length-1]!==m&&T.push(m),f=f.return}return{found:true,method:a,buoy:_n(l),view:{name:Oe(l)??"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}}s(Ol,"hitTest");async function _l(){let e=[];for(let o of Me())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=s(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,l=le(o)??{};return{name:Oe(o)??"Map",testID:typeof l.testID=="string"?l.testID:void 0,frame:a&&t.width&&t.height?{x:ke(a.x/t.width),y:ke(a.y/t.height),width:ke(a.width/t.width),height:ke(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)}}s(_l,"readMaps");Dn();j();j();function Wl(e){return!!e&&typeof e=="object"&&("next"in e||"queue"in e||"memoizedState"in e)}s(Wl,"isHookList");function Rr(e,t,n){if(e===t)return false;if(n?.isClassComponent||!Wl(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}s(Rr,"hookStateChanged");function jl(e,t){return Rr(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===1})}s(jl,"ownStateChanged");var Ul={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 Gl(e){return e&&Ul[e]||Ul.default}s(Gl,"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}s(Kn,"getComponentFiberPrevState");function Kl(e,t){e&&(Gn.set(e,t),e.alternate&&Gn.set(e.alternate,t))}s(Kl,"setComponentFiberState");var Ie=new Map,Dr=500,kh=10,kr=50,ql=50,Ph=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 Pr(e){return!!(!e||Ph.has(e)||e.startsWith("Animated"))}s(Pr,"isInternalComponentName");function Nr(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),!Pr(i))return t}t=t.return,n++}return o}s(Nr,"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}s(Ee,"getComponentNameFromFiber");function Jl(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"}s(Jl,"detectHookType");function Yl(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}}s(Yl,"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<kr;){let i=Jl(o),a=Yl(o,i);n.push({index:r,type:i,value:a,rawState:o.memoizedState}),o=o.next,r++}return n.length>0?n:null}s(ot,"extractHookStates");function Xl(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 l=sn(i.value,i.type),u=sn(a.value,a.type);n.push({index:r,type:a.type,previousValue:l,currentValue:u,description:`${l} \u2192 ${u}`})}}}return n.length>0?n:null}s(Xl,"compareHookStates");function sn(e,t){return rt(e)}s(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)}s(rt,"formatDisplayValue");function Ql(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),f=c.find(b=>b.index===h.index);if(T&&f){let b=T.value===h.value,m=f.value===h.value;b&&!m&&(t=n,n=e)}}}}let r=ot(t),i=null,a=null,l=null;return n?(i=n.memoizedProps,a=n.memoizedState,l=ot(n)):o&&(i=o.memoizedProps,a=o.memoizedState,l=o.extractedHooks),Kl(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:r}),i===null?{cause:"mount",hookChanges:null}:qn(i,t.memoizedProps)?Rr(a,t.memoizedState,{isClassComponent:t.tag===1})?{cause:"state",hookChanges:Xl(l,r)}:{cause:"parent",hookChanges:null}:{cause:"props",hookChanges:null}}s(Ql,"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}s(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={},l=Object.keys(r).slice(0,20);for(let u of l)try{a[u]=o(r[u],i+1)}catch{a[u]="[Error accessing]"}return a}return s(o,"stringify"),o(e,0)}s(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})`}s(zt,"getTagName");function Zl(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}`)}s(Zl,"logMinimal");function es(e,t,n,o,r){let i=Ee(n)||"Unknown",a=typeof t?.type=="string"?t.type:"Unknown",{cause:l,hookChanges:u}=o;if(console.log("[Buoy]",`[RENDER] ${i} (${a}:${e}) | Cause: ${l.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}`)}s(es,"logVerbose");function Lr(e,t,n,o,r,i,a){let l=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.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]",`
|
|
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
|
-
`),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,
|
|
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
|
|
30
|
-
`)}s(Lr,"logComprehensiveRenderData");function Jn(e,t,n,o="off"){let r=Date.now();if(!t)return{type:"unknown",timestamp:r};let i=t,a=t.alternate,l=Ie.get(e);if(l&&a){let D=l.memoizedProps?.children,W=t.memoizedProps?.children,X=a.memoizedProps?.children,V=t.memoizedProps===l.memoizedProps||D!==void 0&&W===D,U=a.memoizedProps===l.memoizedProps||D!==void 0&&X===D;V&&!U&&(i=a,a=t,o==="all"&&console.log("[Buoy]","[RenderCause] Detected fiber swap - using alternate as current"))}let u=null,c=null;a?(u=a.memoizedProps,c=a.memoizedState):l&&(u=l.memoizedProps,c=l.memoizedState);let d=u!==null?{memoizedProps:u,memoizedState:c,timestamp:r}:void 0,h={memoizedProps:i.memoizedProps,memoizedState:i.memoizedState,timestamp:r};rs(e,h);let T=Nr(i),f=Ee(T)||void 0,b=os(i,f)||void 0,m=Ql(T),S=m.cause,v=m.hookChanges;if(!d){if(o!=="off"){if(o==="minimal")console.log("[Buoy]",`[${f||"Unknown"}] MOUNT`);else if(o==="verbose"){let D=typeof i?.type=="string"?i.type:"Unknown";console.log("[Buoy]",`[RENDER] ${f||"Unknown"} (${D}:${e}) | Cause: MOUNT`)}else if(o==="all"){let D=Ie.has(e)?Ie.size:1;Lr(e,i,T,d,m,n,D)}}return{type:"mount",timestamp:r,componentCause:"mount",componentName:f}}let L=typeof i.type=="string"?i.type:void 0,P=zr(d.memoizedProps,h.memoizedProps,L);if(o!=="off"){if(o==="minimal")Zl(f,m);else if(o==="verbose")es(e,i,T,m,P);else if(o==="all"){let D=Ie.has(e)?Ie.size:1;Lr(e,i,T,d,m,n,D)}}if(P&&P.length>0)return{type:"props",changedKeys:P.slice(0,kh),timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0};let C=ts(d.memoizedState,h.memoizedState);if(C&&C.length>0)return{type:"hooks",hookIndices:C,timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0};let I=Ar(i);return I&&n.has(I)?{type:"parent",timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0}:S==="state"?{type:"state",timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0}:S==="props"?{type:"props",timestamp:r,componentCause:S,componentName:f,parentComponentName:b}:S==="parent"?{type:"parent",timestamp:r,componentCause:S,componentName:f,parentComponentName:b}:{type:"unknown",timestamp:r,componentCause:S,componentName:f,parentComponentName:b}}s(Jn,"detectRenderCause");function zr(e,t,n){if(e===t||!e||!t||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return null;let o=Gl(n),r=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(let a of r)if(!a.startsWith("__")&&!o.skip.includes(a)){if(a==="children"){if(!o.alwaysTrack.includes("children"))continue;let l=e[a],u=t[a];l!==u&&(Br(l)&&Br(u)?i.push(`children: ${Vr(l)} \u2192 ${Vr(u)}`):i.push("children (content)"));continue}if(e[a]!==t[a]){let l=e[a],u=t[a];a==="style"?cn(l,u)?i.push(`${a} (ref only)`):i.push(a):typeof l=="function"&&typeof u=="function"?i.push(`${a} (fn ref)`):i.push(a)}}return i.length>0?i:null}s(zr,"getChangedKeys");function cn(e,t,n=0){if(n>5)return false;if(e===t)return true;if(typeof e!=typeof t)return false;if(typeof e!="object"||e===null||t===null)return e===t;if(Array.isArray(e)!==Array.isArray(t))return false;if(Array.isArray(e)){if(e.length!==t.length)return false;for(let i=0;i<e.length;i++)if(!cn(e[i],t[i],n+1))return false;return true}let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return false;for(let i of o)if(!r.includes(i)||!cn(e[i],t[i],n+1))return false;return true}s(cn,"deepEqual");function Br(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}s(Br,"isPrimitive");function Vr(e){return e===null?"null":e===void 0?"undefined":typeof e=="string"?e.length>20?`"${e.slice(0,20)}..."`:`"${e}"`:typeof e=="number"||typeof e=="boolean"?String(e):"[object]"}s(Vr,"formatValue");function ts(e,t){if(e===t||e==null||t==null||typeof e!="object"||typeof t!="object")return null;let n=[],o=e,r=t,i=0;for(;r!==null&&i<kr;)(o===null||ns(o,r))&&n.push(i),r=r?.next??null,o=o?.next??null,i++;return n.length>0?n:null}s(ts,"detectHookChanges");function ns(e,t){return e===t?false:e.memoizedState!==t.memoizedState||e.baseState!==void 0&&e.baseState!==t.baseState}s(ns,"didHookChange");function Ar(e){let t=e?.return,n=0;for(;t&&n<ql;){if(t.stateNode){let o=Er(t.stateNode);if(o!=null)return o}t=t.return,n++}return null}s(Ar,"getParentNativeTag");function os(e,t){if(!e)return null;let n=Nr(e);if(!n)return null;let o=n.return,r=0;for(;o&&r<ql;){let i=o.tag;if(i===0||i===1||i===11||i===15){let a=Ee(o);if(a&&!Pr(a)&&a!==t)return a}o=o.return,r++}return null}s(os,"getParentComponentName");function Er(e){return e?typeof e.__nativeTag=="number"?e.__nativeTag:typeof e._nativeTag=="number"?e._nativeTag:typeof e.canonical?.__nativeTag=="number"?e.canonical.__nativeTag:typeof e.canonical?.publicInstance?.__nativeTag=="number"?e.canonical.publicInstance.__nativeTag:null:null}s(Er,"getNativeTagFromStateNode");function rs(e,t){if(Ie.size>=Dr){let n=Array.from(Ie.entries());n.sort((r,i)=>r[1].timestamp-i[1].timestamp);let o=Math.floor(Dr/4);for(let r=0;r<o;r++)Ie.delete(n[r][0])}Ie.set(e,t)}s(rs,"updateStoredState");function Hr(){Ie.clear()}s(Hr,"clearRenderCauseState");function is(e){Ie.delete(e)}s(is,"removeRenderCauseState");function as(){return{storedStates:Ie.size,maxStates:Dr}}s(as,"getRenderCauseStats");var Nh=5,ls=200,Yn=20,Xn=30;function He(e,t=0,n=new WeakSet){if(e==null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e=="string")return e.length>ls?e.slice(0,ls)+"...":e;if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="symbol")return`[Symbol: ${e.description||""}]`;if(t>=Nh)return Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`[Object: ${Object.keys(e).length} keys]`:"[...]";if(typeof e=="object"){if(n.has(e))return"[Circular]";n.add(e)}if(Array.isArray(e)){let o=e.slice(0,Yn).map(r=>He(r,t+1,n));return e.length>Yn&&o.push(`[...${e.length-Yn} more]`),o}if(e instanceof Date)return e.toISOString();if(e instanceof Error)return`[Error: ${e.message}]`;if(e instanceof RegExp)return e.toString();if(e instanceof Map){let o={__type:"Map",__size:e.size},r=0;for(let[i,a]of e){if(r>=Xn){o[`...${e.size-r} more`]=true;break}let l=typeof i=="string"?i:String(i);o[l]=He(a,t+1,n),r++}return o}if(e instanceof Set)return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,Yn).map(o=>He(o,t+1,n))};if(typeof e=="object"){let o={},r=Object.keys(e),i=r.slice(0,Xn);for(let a of i)if(!(a.startsWith("__")||a==="children"))try{o[a]=He(e[a],t+1,n)}catch{o[a]="[Error accessing property]"}return r.length>Xn&&(o[`...${r.length-Xn} more keys`]=true),o}return"[Unknown type]"}s(He,"safeCloneForHistory");function ss(e){if(e?.memoizedProps)return He(e.memoizedProps)}s(ss,"capturePropsSnapshot");function cs(e){if(!e?.memoizedState)return;let t=e.memoizedState;if(typeof t=="object"&&t!==null&&"next"in t){let n=[],o=t,r=0;for(;o&&r<kr;)n.push({index:r,memoizedState:He(o.memoizedState)}),o=o.next,r++;return{__type:"Hooks",hooks:n}}return He(t)}s(cs,"captureStateSnapshot");import{notifySubscriberCountChange as us}from"@buoy-gg/shared-ui/web";j();var Fr=new Set(["HighlightUpdatesOverlay","HighlightUpdatesModal","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderHistoryFooter","RenderCauseBadge","TwoLevelCauseBadge","EnhancedCauseDisplay","IsolatedRenderList","IsolatedRenderListInner","StatsDisplay","StatsDisplayInner","CurrentStateView","EventStepperFooter","EventsModal","UnifiedEventList","UnifiedEventItem","UnifiedEventDetail","UnifiedEventFilters","UnifiedEventViewer","ReactQueryEventDetail","EventsCopySettingsView"]),un=["HighlightUpdates","RenderList","RenderDetail","RenderHistory","RenderCause","EventStepper","UnifiedEvent","EventsModal","EventsCopy"],ds=new Set(["JsModalComponent","JsModal","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","FloatingTools","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","ModalHeader","TabSelector","SectionHeader","DraggableHeader","WindowControls","TreeDiffViewer","DataViewer","SplitDiffViewer","VirtualizedDataExplorer","DiffSummary","TypeLegend","IndentGuides","IndentGuidesOverlay","CyberpunkInput","DiffView","AnswerCard","DetailsSection","DetailRow","QuickActionsSection","FilterOptionCard","SearchSection","SearchSectionInner","HeaderActions","HeaderActionsInner","MainListHeader","FilterViewHeader","DetailViewHeader","FloatingMenu","FloatingDevTools","MinimizedToolsStack","MinimizedToolsContext","GlitchToolButton","ExpandablePopover","CollapsedPeek","ExpandedWrapper","DialIcon","DialMenu","DialIconItem","OnboardingTooltip","MenuLauncherIcon","DevToolsSettingsModal","SettingsModal","ImageOverlayModal","ImageOverlayStandalone","ToolCard","ToolIcon","GripVerticalIcon","UserStatus","Divider","ChevronDown","ChevronUp","ChevronLeft","ChevronRight","ChevronDownIcon","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage","PerfMonitorOverlay","PerfMonitorModal","PerfMonitorRoot","PerfHudInline","PerfDiagnostics","MetricSparkline","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","PerfHudInlineInner","PerfMonitorOverlayInner","MiniMetric","MetricRow","MetricNumber","MetricSparklineInner","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection","TaskTable","TaskRow","BusySparkline"]),$r=["JsModal","ImageOverlay","PerfMonitor","PerfHud","JsTop"],hs=new Set(["VirtualizedDataExplorer","TreeDiffView","TreeDiffRow","DataViewer","DiffView","DiffSummary","FloatingDevTools","FloatingMenu","FloatingBubble","MinimizedDock","DialMenu","DialItem","ExpandableSection","ChevronIcon","GlitchText","SettingsModal","SettingsRow","OnboardingFlow","DevToolsMenu"]),Mr=false;function gs(e){Mr=e}s(gs,"setCaptureBuoyToolRenders");function Or(){return Mr}s(Or,"isCapturingBuoyToolRenders");var Lh=new Set(["PerfHudInline","PerfHudInlineInner","PerfDiagnostics","MetricSparkline","MetricSparklineInner","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","MiniMetric","MetricRow","MetricNumber","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection"]);function _r(e){return e.startsWith("PerfMonitor")||e.startsWith("PerfHud")||Lh.has(e)}s(_r,"isPerfMonitorComponentName");var zh=new Set(["TaskTable","TaskRow","BusySparkline"]);function ps(e){return e.startsWith("JsTop")||zh.has(e)}s(ps,"isJsTopComponentName");function fs(e){if(Fr.has(e))return true;for(let t=0;t<un.length;t++)if(e.startsWith(un[t]))return true;if(Mr)return _r(e)||ps(e);if(ds.has(e)||hs.has(e))return true;for(let t=0;t<$r.length;t++)if(e.startsWith($r[t]))return true;return false}s(fs,"isDevToolsComponentName");function ms(e){if(Fr.has(e))return true;for(let t=0;t<un.length;t++)if(e.startsWith(un[t]))return true;return false}s(ms,"isRenderLoopUnsafeName");var se=false,at=false,We=false,we=false,ae=null,Pe=null,Qn=null,dn=null,ys=false,Se=false,Zn=new Set,Wr=new Set,jr=new Map,Ur=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],Bh=false;function J(e,t){Bh&&(t!==void 0?console.log("[Buoy]",`[HighlightUpdates] ${e}`,t):console.log("[Buoy]",`[HighlightUpdates] ${e}`))}s(J,"debugLog");function eo(e){let t=fd(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"?n:null}s(eo,"getPublicInstance");function lt(e){let t=_a(e);if(t!==null)return t;if(e==null)return null;let n=e;if(n.__nativeTag!=null)return n.__nativeTag;if(n._nativeTag!=null)return n._nativeTag;if(n.nativeTag!=null)return n.nativeTag;if(n.canonical){if(n.canonical.__nativeTag!=null)return n.canonical.__nativeTag;if(n.canonical._nativeTag!=null)return n.canonical._nativeTag;if(n.canonical.nativeTag!=null)return n.canonical.nativeTag}return null}s(lt,"getNativeTag");function to(e){let t=e,n={viewType:"Unknown"};t?.canonical?.viewConfig?.uiViewClassName?n.viewType=t.canonical.viewConfig.uiViewClassName:t?.viewConfig?.uiViewClassName?n.viewType=t.viewConfig.uiViewClassName:Wa(t)&&(n.viewType=t.tagName.toLowerCase());let o=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Jo(t),r=t?.canonical?.currentProps,i=t?.canonical?.pendingProps,a=o?.pendingProps,l=o?.memoizedProps;return n.testID=r?.testID||i?.testID||a?.testID||l?.testID||a?.["data-testid"]||l?.["data-testid"]||void 0,n.nativeID=r?.nativeID||i?.nativeID||a?.nativeID||l?.nativeID||a?.id||l?.id||void 0,n.accessibilityLabel=r?.accessibilityLabel||i?.accessibilityLabel||a?.accessibilityLabel||l?.accessibilityLabel||a?.["aria-label"]||l?.["aria-label"]||void 0,n.componentName=ws(o)||void 0,n}s(to,"extractComponentInfo");var bs=false,Vh=false,Gr=null;var Ah=new Set;var Eh=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]),Hh=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]),st=new Map,vs=500;function Cs(){st.clear()}s(Cs,"clearDevToolsCache");function Kr(e){return e?!!(Eh.has(e)||e.startsWith("__highlight_")):false}s(Kr,"isHighlightOverlayNativeID");function qr(e){if(!e)return false;if(Hh.has(e))return true;let t=e.charCodeAt(0);return!!(t===95&&e.startsWith("__rn_buoy__")||t===108&&e.startsWith("logbox"))}s(qr,"isOtherDevToolsNativeID");function Jr(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}let n=e.elementType;if(n){if(n.displayName)return n.displayName;if(n.name)return n.name}return null}s(Jr,"getComponentName");var Fh=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","ScreenContainer","ScreenStack","Screen","ScreenContentWrapper","Svg","G","Path","Rect","Circle","Line","Polygon","Polyline","Ellipse","Text as SVGText","TSpan","TextPath","Use","Symbol","Defs","ClipPath","LinearGradient","RadialGradient","Stop","Mask","Pattern","Image as SVGImage","SafeAreaProvider","SafeAreaView","SafeAreaListener","GestureHandlerRootView","GestureDetector","ReanimatedView","ReanimatedText","ReanimatedImage","ReanimatedScrollView","Fragment","Suspense","Provider","Consumer","Context","ForwardRef"]);function Ts(e){return!!(!e||Fh.has(e)||e==="Unknown"||e==="Component"||e.startsWith("Animated"))}s(Ts,"isInternalComponent");function ws(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=Jr(t);if(r&&typeof t.type!="string"&&(o||(o=r),!Ts(r)))return r;t=t.return,n++}return o}s(ws,"getOwningComponentName");function Ss(e){let t=e,n=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Jo(t),o=lt(e)||lt(t?.canonical?.publicInstance),r=Or(),i=!r&&B.getSettings().excludeDevTools;if(i&&Wa(e)&&e.closest("[data-buoy-root]"))return true;if(o!=null&&i){let u=st.get(o);if(u!==void 0)return u}let a=false,l=n?.pendingProps?.nativeID||n?.memoizedProps?.nativeID||t?.canonical?.currentProps?.nativeID||null;if((Kr(l)||i&&qr(l))&&(a=true),!a&&n){let u=n,c=0;for(;u&&c<30;){let d=Jr(u);if(d){if(Fr.has(d)){a=true;break}for(let T of un)if(d.startsWith(T)){a=true;break}if(a)break;if(r&&_r(d)){a=true;break}if(i){if(ds.has(d)||hs.has(d)){a=true;break}for(let T of $r)if(d.startsWith(T)){a=true;break}if(a)break}}let h=u.pendingProps?.nativeID||u.memoizedProps?.nativeID;if(Kr(h)){a=true;break}if(i&&qr(h)){a=true;break}u=u.return,c++}}if(a&&o!=null&&i){if(st.size>=vs){let u=Array.from(st.keys());for(let c=0;c<vs/2;c++)st.delete(u[c])}st.set(o,a)}return a}s(Ss,"isOurOverlayNode");function Yr(e){let t=Math.min(e-1,Ur.length-1);return Ur[Math.max(0,t)]}s(Yr,"getColorForRenderCount");function xs(e){if(e.size===0||!se&&!We||B.getState().isPaused)return;Qe.isEnabled()&&La();let t=B.getBatchSize(),n=Qe.startBatch(e.size,t),o=[],r=0,i=0,a=B.hasActiveFilters();for(let c of e)if(c&&typeof c=="object")try{if(Ss(c)){r++;continue}let d=eo(c),h=lt(c)||lt(d);if(h==null)continue;let T=to(c);if(a&&!B.passesFilters(T)){i++;continue}let f=B.getSettings().showRenderCount,b,m;f?(b=(jr.get(h)||0)+1,jr.set(h,b),m=Yr(b)):(b=0,m=Ur[0]),o.push({node:c,color:m,count:b})}catch{}if(n.markFilteringComplete(r+i,o.length),o.length===0){n.finish();return}bs&&console.log("[Buoy]",`[HighlightUpdates] ${o.length} component(s) re-rendered`);let l=B.getRenderEventCallbackCount()>0;if(!Pe&&!l){bs&&console.log("[Buoy]","[HighlightUpdates] No highlightCallback and no event callbacks - skipping render"),ys=false;return}n.markMeasurementStart();let u=o.slice(0,t*4).map(({node:c,color:d,count:h})=>new Promise(T=>{let f=false,b=s(P=>{f||(f=true,clearTimeout(m),T(P))},"settle"),m=setTimeout(()=>b({rect:null,stateNode:c,color:d,count:h}),500),S=eo(c),v=lt(c)||lt(S);if(v==null){b({rect:null,stateNode:c,color:d,count:h});return}let L=s((P,C,I,D,W,X)=>{if(W==null||X==null||I==null||D==null){b({rect:null,stateNode:c,color:d,count:h});return}b({rect:{id:v,x:W,y:X,width:I,height:D,color:d,count:h},stateNode:c,color:d,count:h})},"onMeasured");if(!S){let P=c.node,C=globalThis.nativeFabricUIManager;if(P&&C?.measure){try{C.measure(P,L)}catch{b({rect:null,stateNode:c,color:d,count:h})}return}b({rect:null,stateNode:c,color:d,count:h});return}try{S.measure(L)}catch{b({rect:null,stateNode:c,color:d,count:h})}}));Promise.all(u).then(c=>{let d=c.filter(T=>T.rect!==null),h=d.map(T=>T.rect);n.markMeasurementComplete(d.length,c.length-d.length),h.length>0&&Pe&&se&&!at&&Pe(h),setTimeout(()=>{try{for(let m of d)m.rect&&Xr(m.rect.id,m.stateNode)}catch(m){J("registerTrackedNode batch failed",m)}let T=B.getSettings(),f=T.trackRenderCauses&&T.showRenderCount,b=null;if(f){b=new Set;for(let{rect:m}of d)m&&b.add(m.id)}if(se){B.startBatch();for(let{rect:m,stateNode:S,color:v,count:L}of d)if(m){let P=to(S),C;if(f&&b){let I=no(S);C=Jn(m.id,I,b,T.debugLogLevel)}B.trackRender({nativeTag:m.id,viewType:P.viewType,testID:P.testID,nativeID:P.nativeID,accessibilityLabel:P.accessibilityLabel,componentName:P.componentName,measurements:{x:m.x,y:m.y,width:m.width,height:m.height},color:v,count:L,renderCause:C})}B.endBatch()}else for(let{rect:m,stateNode:S,color:v,count:L}of d)if(m){let P=to(S),C;if(f&&b){let I=no(S);C=Jn(m.id,I,b,T.debugLogLevel)}B.emitRenderEvent({nativeTag:m.id,viewType:P.viewType,testID:P.testID,nativeID:P.nativeID,accessibilityLabel:P.accessibilityLabel,componentName:P.componentName,measurements:{x:m.x,y:m.y,width:m.width,height:m.height},color:v,count:L,renderCause:C})}n.markTrackingComplete(),n.markCallbackComplete(),n.finish()},0)}).catch(c=>{console.error("[Buoy]","[HighlightUpdates] Error in measurement pipeline:",c),n.finish()})}s(xs,"handleTraceUpdates");var Is=globalThis.WeakRef,Bt=new Map;function Xr(e,t){if(!(e==null||t==null||typeof t!="object"))try{Bt.set(e,Is?new Is(t):{deref:s(()=>t,"deref")})}catch{Bt.set(e,{deref:s(()=>t,"deref")})}}s(Xr,"registerTrackedNode");function Rs(e){let t=Bt.get(e)?.deref();return t||Bt.delete(e),t??null}s(Rs,"derefNode");function Ds(e){return new Promise(t=>{try{e.measure((n,o,r,i,a,l)=>{a==null||l==null||r==null||i==null?t(null):t({x:a,y:l,width:r,height:i})})}catch{t(null)}})}s(Ds,"measureNode");function no(e){let t=e;return t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Jo(t)||null}s(no,"getFiberFromNode");function ks(e){let t=no(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}s(ks,"findScrollAncestor");async function Ps(e,t,n){try{let o=ks(e);if(!o)return false;let r=t,i=null,a=s(l=>new Promise(u=>{let c=false,d=s(T=>{c||(c=true,u(T))},"settle"),h=setTimeout(()=>d(null),600);try{l(T=>{clearTimeout(h),d(T)})}catch{clearTimeout(h),d(null)}}),"withTimeout");if(o.nativeRef&&typeof r.measureLayout=="function"&&(i=await a(l=>r.measureLayout(o.nativeRef,(u,c)=>l(c),()=>l(null)))),i==null){let l=Nt(t),u=typeof o.innerNode=="number"?o.innerNode:Nt(o.innerNode);l!=null&&u!=null&&(i=await a(c=>tn.measureLayout(l,u,()=>c(null),(d,h)=>c(h))))}return i==null?false:(o.instance.scrollTo({y:Math.max(0,i-n),animated:false}),await new Promise(l=>setTimeout(l,80)),true)}catch{return false}}s(Ps,"scrollDescendantIntoView");function Ns(e,t){let n=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)],o=0;for(let r of n){if(!r)continue;let i=r.toLowerCase();if(i===t)return 3;i.startsWith(t)?o=Math.max(o,2):i.includes(t)&&(o=Math.max(o,1))}return o}s(Ns,"matchScore");async function Ls(e){let t=e.scrollIntoView!==false,n=typeof e.margin=="number"?e.margin:12,o=B.getRenders(),r=s(async()=>{let v=await ln(),L=(e.query??"").trim().toLowerCase(),P;for(let D of v.elements){if(e.nativeTag!=null&&D.nativeTag===e.nativeTag){P={el:D,score:1e3};break}let W=Lt({nativeTag:D.nativeTag,testID:D.testID,label:D.label,text:D.text,name:D.name,tap:D.tap},{query:L||void 0,nativeTag:e.nativeTag});W<=0||(!P||W>P.score)&&(P={el:D,score:W})}if(!P?.el.frame)return{matched:false,reason:"no-match",candidates:[]};let C=v.screen,I=P.el.frame;return{matched:true,live:true,rect:{x:I.x*C.width,y:I.y*C.height,width:I.width*C.width,height:I.height*C.height},scale:er.get(),screen:{width:C.width,height:C.height},nativeTag:P.el.nativeTag??void 0,componentName:P.el.name,testID:P.el.testID}},"locateFromScreen");if(o.length===0)return r();let i=(e.query??"").trim().toLowerCase(),a=i?o.map(v=>({r:v,score:Ns(v,i)})).filter(v=>v.score>0).sort((v,L)=>L.score-v.score||L.r.lastRenderTime-v.r.lastRenderTime):[],l=a.slice(0,8).map(({r:v})=>({nativeTag:v.nativeTag,componentName:v.componentName,testID:v.testID,nativeID:v.nativeID,viewType:v.viewType,renderCount:v.renderCount})),u=e.nativeTag??(a.length>0?a[0].r.nativeTag:void 0);if(u==null){let v=await r();return v.matched?v:{matched:false,reason:"no-match",candidates:l}}let c=o.find(v=>v.nativeTag===u),d=null,h=false,T=false,f=Rs(u);if(f){let v=eo(f);v&&(t&&(T=await Ps(f,v,n)),d=await Ds(v),h=!!d)}if(!d&&c?.measurements&&(d={...c.measurements}),!d)return{matched:false,reason:"no-measurement",nativeTag:u,candidates:l};let b=er.get(),m=Ze.get("window"),S=d.x>=-1&&d.y>=-1&&d.x+d.width<=m.width+1&&d.y+d.height<=m.height+1;return{matched:true,live:h,scrolled:T,inView:S,rect:d,scale:b,screen:{width:m.width,height:m.height},nativeTag:u,componentName:c?.componentName,testID:c?.testID,candidates:l}}s(Ls,"locateComponent");function Qr(e){if(!ae?.rendererInterfaces){J("No rendererInterfaces available");return}let t=0;if(ae.rendererInterfaces.forEach((n,o)=>{if(typeof n.setTraceUpdatesEnabled=="function")try{n.setTraceUpdatesEnabled(e),t++,J(`Renderer ${o}: setTraceUpdatesEnabled(${e})`)}catch(r){J(`Renderer ${o}: error setting trace updates`,r)}else J(`Renderer ${o}: no setTraceUpdatesEnabled method`)}),J(`Set trace updates ${e?"enabled":"disabled"} on ${t} renderer(s)`),ae.reactDevtoolsAgent?.setTraceUpdatesEnabled)try{ae.reactDevtoolsAgent.setTraceUpdatesEnabled(e),J("Also set trace updates on agent")}catch(n){J("Error setting trace updates on agent",n)}}s(Qr,"setTraceUpdatesOnRenderers");function Zr(){ae&&(dn||(J("Subscribing to traceUpdates event"),typeof ae.sub=="function"?(dn=ae.sub("traceUpdates",xs),J("Subscribed using hook.sub()")):J("hook.sub not available, traceUpdates may not work"),Qr(true)))}s(Zr,"subscribeToTraceUpdates");function oo(){Qr(false),dn&&(dn(),dn=null,J("Unsubscribed from traceUpdates event"))}s(oo,"unsubscribeFromTraceUpdates");function ei(e){Pe=e,J(`Highlight callback ${e?"set":"cleared"}`)}s(ei,"setHighlightCallback");function zs(e){Qn=e,J(`Badge press callback ${e?"set":"cleared"}`)}s(zs,"setBadgePressCallback");function Bs(){return Qn}s(Bs,"getBadgePressCallback");function Vs(e){Qn&&Qn(e)}s(Vs,"handleBadgePress");var ti=null,ro=null;function As(e){ti=e,e&&ro!==null&&e(ro)}s(As,"setSpotlightCallback");function Es(e){if(me){me("setSpotlight",{nativeTag:e});return}ro=e,ti&&ti(e)}s(Es,"setSpotlight");var me=null;function Hs(e){me=e}s(Hs,"setRemoteHandler");function Fs(e){se!==e.enabled&&(se=e.enabled,io()),Se!==e.frozen&&(Se=e.frozen,hn())}s(Fs,"replaceRemoteState");function $s(){return ro}s($s,"getSpotlight");function io(){Wr.forEach(e=>{try{e(se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in state listener:",t)}})}s(io,"notifyStateListeners");function ni(e){return Wr.add(e),e(se),()=>{Wr.delete(e)}}s(ni,"subscribe");function Ms(e){if(typeof ee<"u"&&!ee)return{recordRenders:s(()=>{},"recordRenders"),disconnect:s(()=>{},"disconnect")};if(je!==void 0||we)throw new Error("Connect the render source before Highlight starts.");je=e;let t=true,n=new Set;return Vt(),{recordRenders(o){if(!t||!e||!se||B.getState().isPaused)return;let r=[];B.startBatch();try{for(let{host:i,name:a,count:l}of o){if(!i.isConnected)continue;let u=_a(i);if(u===null)continue;let c=(B.getRender(String(u))?.renderCount??0)+l,d=Yr(c),{x:h,y:T,width:f,height:b}=i.getBoundingClientRect(),m={x:h,y:T,width:f,height:b};B.trackRender({nativeTag:u,viewType:a,componentName:a,isComponent:true,testID:i.getAttribute("data-testid")??void 0,measurements:m,color:d,count:c}),Xr(u,i),n.add(u),f>0&&b>0&&r.push({id:u,...m,color:d,count:B.getSettings().showRenderCount?c:0})}}finally{B.endBatch()}for(let i of n)B.getRender(String(i))||(n.delete(i),Bt.delete(i));!at&&r.length&&Pe?.(r)},disconnect(){if(t){t=false,ct(),Pe?.([]),ri();for(let o of n)Bt.delete(o);n.clear(),je=void 0,we=false}}}}s(Ms,"connectRenderSource");var je;function Os(){return je===void 0?void 0:je?"ready":"unavailable"}s(Os,"getRenderSourceStatus");function Vt(){if(typeof ee<"u"&&!ee)return J("Only available in development builds"),false;if(me||we)return true;if(je!==void 0)return we=je,ao(),we;if(ae=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null,!ae)return J("React DevTools hook not found"),false;if(J("Hook found"),J(`Hook has sub: ${typeof ae.sub=="function"}`),J(`Hook has on: ${typeof ae.on=="function"}`),J(`Hook has emit: ${typeof ae.emit=="function"}`),Qo(),ae.rendererInterfaces&&ae.rendererInterfaces.size>0)return we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s)`),ao(),true;let e=setInterval(()=>{ae?.rendererInterfaces&&ae.rendererInterfaces.size>0&&(clearInterval(e),we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s) (delayed)`),ao())},100);return setTimeout(()=>clearInterval(e),1e4),false}s(Vt,"initialize");function ao(){typeof window<"u"&&(window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:At,disable:ct,toggle:oi,isEnabled:ii,setEnabled:ai,subscribe:ni,initialize:Vt,destroy:ci,isInitialized:s(()=>we,"isInitialized"),setHighlightCallback:ei})}s(ao,"exposeGlobally");function At(){typeof ee<"u"&&!ee||je!==false&&(we||Vt(),at&&(at=false),!se&&(J("Enabling highlights"),We||Zr(),B.start(),se=true,io(),us("render")))}s(At,"enable");function ct(){typeof ee<"u"&&!ee||se&&(J("Disabling highlights"),Vh=false,ys=false,Gr&&(clearTimeout(Gr),Gr=null),Ah.clear(),st.clear(),Hr(),Se&&(Se=false,hn()),We||oo(),B.stop(),se=false,io(),us("render"))}s(ct,"disable");function _s(){typeof ee<"u"&&!ee||We||(we||Vt(),J("Enabling background tracking"),se||Zr(),We=true)}s(_s,"enableBackgroundTracking");function Ws(){typeof ee<"u"&&!ee||We&&(J("Disabling background tracking"),We=false,se||oo())}s(Ws,"disableBackgroundTracking");function js(){return We}s(js,"isBackgroundTrackingEnabled");function oi(){if(!(typeof ee<"u"&&!ee)){if(me){me("toggle");return}se?ct():At()}}s(oi,"toggle");function ri(){if(me){me("clearRenderCounts");return}jr.clear(),B.clear(),J("Cleared render counts")}s(ri,"clearRenderCounts");function ii(){return se}s(ii,"isEnabled");function ai(e){if(me){me("setEnabled",{enabled:e});return}e?At():ct()}s(ai,"setEnabled");function lo(e){at!==e&&(at=e,e&&Pe&&Pe([]))}s(lo,"setHighlightsSuppressed");function Us(){return at}s(Us,"getHighlightsSuppressed");function Gs(e){if(me){me("setSilentTracking",{enabled:e});return}e?(At(),lo(true)):(lo(false),ct())}s(Gs,"setSilentTracking");function Ks(){return we}s(Ks,"isInitialized");function hn(){Zn.forEach(e=>{try{e(Se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in freeze listener:",t)}})}s(hn,"notifyFreezeListeners");function qs(e){return Zn.add(e),e(Se),()=>{Zn.delete(e)}}s(qs,"subscribeToFreeze");function li(){typeof ee<"u"&&!ee||Se||(Se=true,J("Freeze mode enabled"),hn())}s(li,"freeze");function si(){typeof ee<"u"&&!ee||Se&&(Se=false,J("Freeze mode disabled"),Pe&&Pe([]),hn())}s(si,"unfreeze");function Js(){if(me){me("toggleFreeze");return}Se?si():li()}s(Js,"toggleFreeze");function Ys(){return Se}s(Ys,"getFrozen");function ci(){we&&(oo(),Zo(),Xo(null),Se=false,Zn.clear(),se=false,ae=null,Pe=null,we=false,typeof window<"u"&&delete window.__HIGHLIGHT_UPDATES_CONTROLLER__,J("Destroyed"))}s(ci,"destroy");var $h={connectRenderSource:Ms,getRenderSourceStatus:Os,subscribe:ni,enable:At,disable:ct,toggle:oi,isEnabled:ii,setEnabled:ai,initialize:Vt,destroy:ci,isInitialized:Ks,setHighlightCallback:ei,clearRenderCounts:ri,freeze:li,unfreeze:si,toggleFreeze:Js,getFrozen:Ys,subscribeToFreeze:qs,setBadgePressCallback:zs,getBadgePressCallback:Bs,handleBadgePress:Vs,setSpotlightCallback:As,setSpotlight:Es,getSpotlight:$s,clearDevToolsCache:Cs,enableBackgroundTracking:_s,disableBackgroundTracking:Ws,isBackgroundTrackingEnabled:js,setRemoteHandler:Hs,replaceRemoteState:Fs,locateComponent:Ls,setHighlightsSuppressed:lo,getHighlightsSuppressed:Us,setSilentTracking:Gs},H=$h;j();import Mh,{useState as de,useEffect as Re,useRef as ut,useCallback as oe}from"react";import{Power as Oh,JsModal as _h,devToolsStorageKeys as Et,persistentStorage as so,night as Ht,TickProvider as Xs,windowDragProps as Wh}from"@buoy-gg/shared-ui/web";import{useIsPro as jh}from"@buoy-gg/license/web";Ve();j();import{useMemo as co,useState as Qs,useCallback as gn}from"react";import{CopyButton as Uh,formatRelativeTime as Gh,PlusIcon as Kh,MinusIcon as qh,EventStepperFooter as Jh,Lock as Yh,night as M,useLimit as Xh,monoFont as Ft}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as Qh}from"@buoy-gg/shared-ui/web/dataViewer";j();import{buoyColors as Ue,night as re,monoFont as dt}from"@buoy-gg/shared-ui/web";import{Fragment as Zh,jsx as K,jsxs as ce}from"react/jsx-runtime";var Ge={mount:{label:"MOUNT",color:Ue.success,tip:"First render of this component."},props:{label:"PROPS",color:Ue.warning,tip:"Native props changed. Consider React.memo() or useCallback for handlers."},state:{label:"STATE",color:"#a855f7",tip:"Component state changed via setState."},hooks:{label:"HOOKS",color:"#ec4899",tip:"Hook values changed (useState, useReducer, useMemo, etc.)."},context:{label:"CONTEXT",color:"#06b6d4",tip:"React context value changed."},parent:{label:"PARENT",color:Ue.textSecondary,tip:"Parent component re-rendered. Consider wrapping with React.memo()."},unknown:{label:"?",color:Ue.textMuted,tip:"Could not determine render cause."}},pn={mount:{label:"mount",color:Ue.success,tip:"First render of this component."},props:{label:"props",color:Ue.warning,tip:"Component received different props from parent."},state:{label:"state",color:"#a855f7",tip:"Component's own state changed (useState/useReducer)."},parent:{label:"parent",color:Ue.textSecondary,tip:"Parent re-rendered but this component's props/state didn't change. Consider React.memo()."},unknown:{label:"?",color:Ue.textMuted,tip:"Could not determine component render cause."}};function ui({cause:e,compact:t=false,showKeys:n=false,showTwoLevel:o=false,testID:r}){let i=Ge[e.type],a=e.componentCause?pn[e.componentCause]:null,l=o&&a&&e.componentCause!==e.type;return ce(g,{nativeID:"__rn_buoy__cause-badge",testID:r,style:[A.container,t&&A.containerCompact],children:[l&&ce(Zh,{children:[K(g,{style:[A.badge,t&&A.badgeCompact,A.componentBadge,{backgroundColor:a.color+"15"}],children:K(p,{testID:r?`${r}-component`:void 0,style:[A.badgeText,t&&A.badgeTextCompact,A.componentBadgeText,{color:a.color}],children:a.label})}),K(p,{style:[A.arrowText,t&&A.arrowTextCompact],children:"\u2192"})]}),K(g,{style:[A.badge,t&&A.badgeCompact,{backgroundColor:i.color+"20"}],children:K(p,{testID:r?`${r}-native`:void 0,style:[A.badgeText,t&&A.badgeTextCompact,{color:i.color}],children:i.label})}),n&&e.changedKeys&&e.changedKeys.length>0&&K(p,{testID:r?`${r}-keys`:void 0,style:[A.keysText,t&&A.keysTextCompact],numberOfLines:1,children:e.changedKeys.join(", ")}),n&&e.hookIndices&&e.hookIndices.length>0&&ce(p,{testID:r?`${r}-hooks`:void 0,style:[A.keysText,t&&A.keysTextCompact],numberOfLines:1,children:["Hook ",e.hookIndices.join(", ")]})]})}s(ui,"RenderCauseBadge");function Zs({cause:e}){let t=Ge[e.type],n=e.componentCause?pn[e.componentCause]:null,o=e.componentName||"Component";return ce(g,{nativeID:"__rn_buoy__two-level-cause",style:A.twoLevelContainer,children:[n&&ce(g,{style:A.twoLevelRow,children:[K(p,{style:A.twoLevelLabel,children:"Component:"}),K(p,{style:A.twoLevelName,children:o}),K(p,{style:A.twoLevelText,children:"re-rendered due to"}),K(g,{style:[A.badge,{backgroundColor:n.color+"20"}],children:K(p,{style:[A.badgeText,{color:n.color}],children:n.label.toUpperCase()})})]}),ce(g,{style:A.twoLevelRow,children:[K(p,{style:A.twoLevelLabel,children:"Native:"}),K(g,{style:[A.badge,{backgroundColor:t.color+"20"}],children:K(p,{style:[A.badgeText,{color:t.color}],children:t.label})}),e.changedKeys&&e.changedKeys.length>0&&ce(p,{style:A.twoLevelKeys,children:["[",e.changedKeys.join(", "),"]"]})]})]})}s(Zs,"TwoLevelCauseBadge");function di({cause:e,nativeType:t}){let n=Ge[e.type],o=e.componentCause?pn[e.componentCause]:null,r=e.componentName||"Unknown",i=e.hookChanges&&e.hookChanges.length>0,a=e.changedKeys&&e.changedKeys.length>0,l=e.changedKeys?.filter(c=>c.includes("(ref only)")||c.includes("(fn ref)"))||[],u=e.changedKeys?.filter(c=>!c.includes("(ref only)")&&!c.includes("(fn ref)"))||[];return ce(g,{nativeID:"__rn_buoy__enhanced-cause",style:A.enhancedContainer,children:[ce(g,{style:A.enhancedHeader,children:[K(p,{style:A.enhancedComponentName,children:r}),t&&K(g,{style:A.enhancedNativeTag,children:K(p,{style:A.enhancedNativeTagText,children:t})})]}),ce(g,{style:A.enhancedFlowContainer,children:[K(p,{style:A.enhancedFlowLabel,children:"Cause:"}),o&&K(g,{style:[A.enhancedFlowBadge,{backgroundColor:o.color+"20"}],children:K(p,{style:[A.enhancedFlowBadgeText,{color:o.color}],children:o.label.toUpperCase()})}),K(p,{style:A.enhancedFlowArrow,children:"\u2192"}),K(g,{style:[A.enhancedFlowBadge,{backgroundColor:n.color+"20"}],children:K(p,{style:[A.enhancedFlowBadgeText,{color:n.color}],children:n.label})})]}),i&&ce(g,{style:A.enhancedSection,children:[K(p,{style:A.enhancedSectionTitle,children:"Component State Changed:"}),e.hookChanges.map(c=>ce(g,{style:A.enhancedChangeRow,children:[K(p,{style:A.enhancedChangeIcon,children:"\u26A1"}),ce(p,{style:A.enhancedChangeText,children:["Hook[",c.index,"] (",c.type,"): ",c.description]})]},c.index))]}),u.length>0&&ce(g,{style:A.enhancedSection,children:[K(p,{style:A.enhancedSectionTitle,children:"Native Props Changed:"}),u.map((c,d)=>ce(g,{style:A.enhancedChangeRow,children:[K(p,{style:A.enhancedChangeIcon,children:"~"}),K(p,{style:A.enhancedChangeText,children:c})]},d))]}),l.length>0&&ce(g,{style:A.enhancedSection,children:[K(p,{style:[A.enhancedSectionTitle,{color:re.color.textTertiary}],children:"Reference Changes (optimization opportunity):"}),l.map((c,d)=>ce(g,{style:A.enhancedChangeRow,children:[K(p,{style:[A.enhancedChangeIcon,{color:re.color.textTertiary}],children:"\u25CB"}),K(p,{style:[A.enhancedChangeText,{color:re.color.textTertiary}],children:c})]},d))]}),!i&&!a&&e.type!=="mount"&&K(g,{style:A.enhancedSection,children:K(p,{style:A.enhancedNoChanges,children:e.type==="parent"?"Parent re-rendered (consider React.memo)":"No specific changes detected"})})]})}s(di,"EnhancedCauseDisplay");var A=Ce.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{paddingVertical:3,paddingHorizontal:6,borderRadius:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5},componentBadge:{borderStyle:"dashed",borderWidth:1,borderColor:re.color.border},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},componentBadgeText:{fontWeight:"500",textTransform:"lowercase"},arrowText:{fontSize:10,color:re.color.textTertiary},arrowTextCompact:{fontSize:9},keysText:{fontSize:11,color:re.color.textSecondary,fontFamily:dt,flex:1},keysTextCompact:{fontSize:10},twoLevelContainer:{gap:8},twoLevelRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:6},twoLevelLabel:{fontSize:11,fontWeight:"600",color:re.color.textSecondary,minWidth:70},twoLevelName:{fontSize:11,fontWeight:"600",color:re.color.text,fontFamily:dt},twoLevelText:{fontSize:11,color:re.color.textSecondary},twoLevelKeys:{fontSize:10,color:re.color.textSecondary,fontFamily:dt},enhancedContainer:{gap:12},enhancedHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},enhancedComponentName:{fontSize:14,fontWeight:"700",color:re.color.text,fontFamily:dt},enhancedNativeTag:{backgroundColor:re.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},enhancedNativeTagText:{fontSize:10,fontWeight:"600",color:re.color.textTertiary,fontFamily:dt},enhancedFlowContainer:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12,backgroundColor:re.color.bg,borderRadius:6},enhancedFlowLabel:{fontSize:11,fontWeight:"600",color:re.color.textSecondary},enhancedFlowBadge:{paddingVertical:3,paddingHorizontal:8,borderRadius:4},enhancedFlowBadgeText:{fontSize:10,fontWeight:"700"},enhancedFlowArrow:{fontSize:14,color:re.color.textTertiary,fontWeight:"300"},enhancedSection:{gap:6},enhancedSectionTitle:{fontSize:11,fontWeight:"600",color:re.color.textSecondary,letterSpacing:.3},enhancedChangeRow:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingLeft:4},enhancedChangeIcon:{fontSize:12,color:re.color.warning,fontFamily:dt,width:16},enhancedChangeText:{fontSize:12,color:re.color.text,fontFamily:dt,flex:1},enhancedNoChanges:{fontSize:12,color:re.color.textTertiary,fontStyle:"italic",paddingLeft:4}});j();function ec(e,t){let n=e.filter(f=>f.renderCount>=t.minRenders);if(t.filterCauses.length>0){let f=new Set(t.filterCauses);n=n.filter(b=>f.has(b.lastRenderCause?.type??"unknown"))}let o=e.flatMap(f=>[f.firstRenderTime,f.lastRenderTime]).filter(f=>Number.isFinite(f)),r=o.length>0?Math.max(...o)-Math.min(...o):0,i=Math.max(.001,r/1e3),a=(t.groupByName?tc(n):n.map(f=>[f])).map(f=>nc(f,t,i));rc(a,t.sortBy);let l=t.topN===-1?0:Math.max(0,a.length-t.topN),u=t.topN===-1?a:a.slice(0,t.topN),c=e.reduce((f,b)=>f+b.renderCount,0),d=oc(e),h=0,T=false;for(let f of e)f.lastRenderCause||(h+=f.renderCount),f.renderHistory&&f.renderHistory.length>0&&(T=true);return{totalUniqueComponents:n.length,totalRenders:c,windowMs:r,causeBreakdown:d,rows:u,truncated:l,dataGaps:{historyOff:!T,propsCaptureOff:!e.some(f=>f.renderHistory?.some(b=>b.capturedProps!==void 0)),stateCaptureOff:!e.some(f=>f.renderHistory?.some(b=>b.capturedState!==void 0)),rendersWithoutCause:h}}}s(ec,"buildReport");function tc(e){let t=new Map;for(let n of e){let o=n.componentName||n.displayName||n.viewType,r=t.get(o);r?r.push(n):t.set(o,[n])}return Array.from(t.values())}s(tc,"groupByComponentName");function nc(e,t,n){let o=e[0],r=o.componentName||o.displayName||o.viewType,i=0,a={},l=new Map,u=new Map,c=new Map,d=0,h=0,T=0;for(let I of e){i+=I.renderCount;let D=I.lastRenderCause;if(!D)continue;let W=D.type;a[W]=(a[W]??0)+I.renderCount;let X=(D.hookChanges?.length??0)>0,V=(D.changedKeys?.length??0)>0;if(W==="parent"&&(D.componentCause==="state"||D.componentCause==="props"||X||V?h+=I.renderCount:T+=I.renderCount),W==="props"&&!V&&(d+=I.renderCount),D.parentComponentName&&c.set(D.parentComponentName,(c.get(D.parentComponentName)??0)+1),t.aggregateCauses&&D.hookChanges)for(let U of D.hookChanges){let x=`${U.type}[${U.index}]`,z=l.get(x);z?z.count+=1:l.set(x,{count:1,sample:ac(U)})}if(D.changedKeys)for(let U of D.changedKeys)U.includes("(ref only)")||u.set(U,(u.get(U)??0)+1)}let f=Array.from(l.entries()).sort((I,D)=>D[1].count-I[1].count).slice(0,3).map(([I,D])=>({hook:I,count:D.count,sample:D.sample})),b=Array.from(u.entries()).sort((I,D)=>D[1]-I[1]).slice(0,5).map(([I])=>I),m="unknown",S=-1;for(let[I,D]of Object.entries(a))(D??0)>S&&(S=D??0,m=I);let v,L=0;for(let[I,D]of c)D>L&&(L=D,v=I);let P=e.map(I=>I.renderCount).sort((I,D)=>D-I),C=i/n;return{name:r,viewType:o.viewType,instances:e.length,renders:i,causeMix:a,dominantCause:m,hookCauses:f,changedKeys:b,unknownPropsCount:d,parentWithOwnChange:h,parentNoChange:T,parentName:v,instanceCounts:P,rate:C,source:e}}s(nc,"processGroup");function oc(e){let t={};for(let n of e){let o=n.lastRenderCause?.type??"unknown";t[o]=(t[o]??0)+n.renderCount}return t}s(oc,"aggregateCauseBreakdown");function rc(e,t){switch(t){case"renderCount":e.sort((n,o)=>o.renders-n.renders);break;case"rate":e.sort((n,o)=>o.rate-n.rate);break;case"name":e.sort((n,o)=>n.name.localeCompare(o.name));break}}s(rc,"sortRows");var ic=32;function hi(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="function")return"[Fn]";if(typeof e=="object")return Array.isArray(e)?`[Array(${e.length})]`:"[Obj]";let t=String(e);return t.length>ic?t.slice(0,ic-1)+"\u2026":t}s(hi,"truncateValue");function ac(e){return e.previousValue===void 0&&e.currentValue===void 0?e.description:`${hi(e.previousValue)} \u2192 ${hi(e.currentValue)}`}s(ac,"formatHookSample");function gi(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}s(gi,"formatWindow");function uo(e){return e>=100?`${e.toFixed(0)}/s`:e>=10?`${e.toFixed(1)}/s`:`${e.toFixed(2)}/s`}s(uo,"formatRate");function pi(e){let t=Object.entries(e).sort((n,o)=>(o[1]??0)-(n[1]??0));return t.length===0?"(no causes recorded)":t.map(([n,o])=>`${n} ${o}`).join(" \xB7 ")}s(pi,"causeBreakdownLine");function fi(e){let t=[],n=Object.entries(e.causeMix).filter(([,r])=>(r??0)>0).sort((r,i)=>(i[1]??0)-(r[1]??0)),o=n.length>=2&&(n[1]?.[1]??0)>=e.renders*.1;if(e.dominantCause==="hooks"&&e.hookCauses.length>0){let r=e.hookCauses[0];r.sample?t.push(`hooks \xD7${r.count} ${r.hook}: ${r.sample}`):t.push(`hooks \xD7${r.count} ${r.hook}`)}else if(e.dominantCause==="props"){if(e.changedKeys.length>0){let r=e.changedKeys.slice(0,3).join(", ");t.push(`props (${r})`)}else t.push("props (keys not captured)");e.unknownPropsCount>0&&e.changedKeys.length>0&&t.push(`[${e.unknownPropsCount} unidentified]`)}else if(e.dominantCause==="parent"){let r="parent cascade";e.parentNoChange>0&&e.parentWithOwnChange===0&&(r="parent cascade, no own change"),e.parentName&&(r+=` \u2190 ${e.parentName}`),t.push(r)}else e.dominantCause==="mount"?t.push("mount"):e.dominantCause==="state"?t.push("state"):e.dominantCause==="context"?t.push("context"):t.push("unknown");if(o){let r=n.map(([i,a])=>`${i}:${a}`).join(" + ");t.push(`(${r})`)}return t.join(" ")}s(fi,"describeCause");function mi(e){if(e.instances<=1)return e.name;let t=e.instanceCounts,n=t[0]??0,o=t[t.length-1]??0;if(n-o<=1)return`${e.name} \xD7${e.instances} (${n} each)`;let r=t.slice(1),i=r.reduce((l,u)=>l+u,0),a=r.length>0?i/r.length:0;return`${e.name} \xD7${e.instances} (top ${n}, others ~${Math.round(a)})`}s(mi,"describeInstances");var eg="React Native render report \u2014 review the data and identify why components are re-rendering.";function yi(e,t){let n=[];n.push(eg),n.push(""),n.push(`Window: ${gi(e.windowMs)} \xB7 ${e.totalUniqueComponents} components \xB7 ${e.totalRenders} renders`),n.push(`Cause mix: ${pi(e.causeBreakdown)}`),n.push(""),n.push("Top offenders (count \xB7 rate \xB7 component \xB7 cause):"),n.push("");let o=e.rows.map(mi),r=Math.min(36,Math.max(8,...o.map(u=>u.length))),i=Math.max(3,...e.rows.map(u=>`\xD7${u.renders}`.length)),a=Math.max(5,...e.rows.map(u=>uo(u.rate).length));for(let u=0;u<e.rows.length;u++){let c=e.rows[u],d=(o[u]??c.name).padEnd(r),h=`\xD7${c.renders}`.padStart(i),T=uo(c.rate).padStart(a),f=fi(c);n.push(` ${h} ${T} ${d} ${f}`)}e.truncated>0&&(n.push(""),n.push(`... ${e.truncated} more (set topN=-1 to expand)`));let l=bi(e);if(l.length>0){n.push(""),n.push("Data availability:");for(let u of l)n.push(` \xB7 ${u}`)}return n.join(`
|
|
31
|
-
`)}
|
|
32
|
-
`)}s(lc,"generateMarkdownTable");function sc(e,t,n){let o={exportedAt:new Date().toISOString(),summary:{windowMs:t.windowMs,totalComponents:t.totalUniqueComponents,totalRenders:t.totalRenders,causeBreakdown:t.causeBreakdown,truncated:t.truncated,dataGaps:t.dataGaps},components:t.rows.map(r=>({name:r.name,viewType:r.viewType,instances:r.instances,instanceCounts:r.instances>1?r.instanceCounts:void 0,renders:r.renders,ratePerSec:Number(r.rate.toFixed(3)),dominantCause:r.dominantCause,causeMix:r.causeMix,hookCauses:r.hookCauses,changedKeys:r.changedKeys,unknownPropsCount:r.unknownPropsCount||void 0,parentName:r.parentName,parentWithOwnChange:r.parentWithOwnChange||void 0,parentNoChange:r.parentNoChange||void 0,...n.includeHistory?{history:cc(r.source)}:{}}))};return n.includeHistory?JSON.stringify(o,null,2):JSON.stringify(o)}s(sc,"generateJson");function cc(e){return e.map(t=>({name:t.componentName||t.displayName,nativeTag:t.nativeTag,renderCount:t.renderCount,history:t.renderHistory?.map(n=>({n:n.renderNumber,t:n.timestamp,cause:{type:n.cause.type,componentCause:n.cause.componentCause,changedKeys:n.cause.changedKeys,parentComponentName:n.cause.parentComponentName,hookChanges:n.cause.hookChanges?.map(o=>({type:o.type,index:o.index,desc:o.description}))}}))}))}s(cc,"extractHistory");function ho(e,t){let n=ec(e,t);switch(t.format){case"summary":return yi(n,t);case"markdown-table":return lc(n,t);case"json":return sc(e,n,t);default:return yi(n,t)}}s(ho,"generateExport");function uc(e,t){return ho(e,t).length}s(uc,"estimateExportSize");function vi(e){return{totalComponents:e.length,totalRenders:e.reduce((t,n)=>t+n.renderCount,0)}}s(vi,"getExportSummary");function dc(e){return ho([e],{format:"summary",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false})}s(dc,"generateSingleComponentExport");import{jsx as O,jsxs as Z}from"react/jsx-runtime";function Ci({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:o,onAddFilter:r,isPro:i=false}){let[a,l]=Qs(0),u=n??a,c=o??l,d=co(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((V,U)=>V.timestamp-U.timestamp),[e.renderHistory]),h=d.length,T=d[u],f=Xh("highlightUpdates.detailEvents"),b=i?1/0:f,m=co(()=>Math.max(0,h-b),[b,h]),S=T?.cause||e.lastRenderCause,v=gn(()=>{u>0&&c(u-1)},[u,c]),L=gn(()=>{let V=Math.min(b-1,h-1);u<V&&c(u+1)},[u,h,c,b]),P=co(()=>dc(e),[e]),C=e.componentName||e.displayName,I=e.viewType,D=e.lastRenderTime-e.firstRenderTime,W=D>0?(e.renderCount/(D/1e3)).toFixed(1):e.renderCount.toString(),X=!t&&h>1;return Z(g,{style:N.container,children:[Z(g,{style:N.header,children:[Z(g,{style:N.headerLeft,children:[O(p,{testID:"buoy-highlight-detail-name",style:N.componentName,numberOfLines:1,children:C}),O(g,{style:N.nativeTypeBadge,children:O(p,{testID:"buoy-highlight-detail-type",style:N.nativeTypeText,children:I})})]}),O(Uh,{value:P,size:14,testID:"buoy-highlight-detail-copy"})]}),Z($e,{testID:"buoy-highlight-detail-scroll",style:N.scrollView,contentContainerStyle:[N.scrollContent,X&&{paddingBottom:100}],showsVerticalScrollIndicator:false,children:[S&&O(hc,{cause:S,renderNumber:T?.renderNumber}),O(gc,{render:e,rendersPerSec:W}),m>0&&Z(g,{testID:"buoy-highlight-detail-locked",style:N.lockedBanner,children:[O(Yh,{size:14,color:M.color.warning}),Z(p,{testID:"buoy-highlight-detail-locked-text",style:N.lockedBannerText,children:[m," ",m===1?"event":"events"," hidden"]}),O(p,{style:N.lockedBannerSubtext,children:"Upgrade to Pro"})]}),r&&O(pc,{render:e,onAddFilter:r})]}),X&&O(Jh,{currentIndex:u,totalItems:h,onPrevious:v,onNext:L,itemLabel:"Render",subtitle:T?.timestamp?Gh(new Date(T.timestamp)):void 0,applySafeAreaInset:false,absolute:true})]})}s(Ci,"RenderDetailView");function hc({cause:e,renderNumber:t}){let n=e.componentCause||e.type,o=e.componentCause?pn[e.componentCause]:Ge[e.type],r=e.hookChanges&&e.hookChanges.length>0,i=e.changedKeys&&e.changedKeys.length>0,a=s(()=>e.type==="mount"?"First render":n==="parent"?"Triggered by":"Changed:","getLabel");return Z(g,{testID:"buoy-highlight-detail-cause",style:N.answerCard,children:[Z(g,{style:N.causeBadgeRow,children:[O(p,{testID:"buoy-highlight-detail-cause-label",style:N.causeLabel,children:a()}),O(g,{style:[N.causeBadgeLarge,{backgroundColor:o.color+"20"}],children:O(p,{testID:"buoy-highlight-detail-cause-badge",style:[N.causeBadgeLargeText,{color:o.color}],children:o.label.toUpperCase()})})]}),r&&O(g,{style:N.hookChangesContainer,children:e.hookChanges.map((l,u)=>{let c=`${l.type}[${l.index}]`,d={[c]:l.previousValue},h={[c]:l.currentValue};return O(g,{style:N.hookDiffContainer,children:O(Qh,{oldValue:d,newValue:h,theme:"dark",showUnchanged:false})},u)})}),!r&&i&&O(g,{style:N.propsChangesContainer,children:e.changedKeys.filter(l=>!l.includes("(ref only)")).slice(0,5).map((l,u)=>O(g,{style:N.propChangeChip,children:O(p,{testID:`buoy-highlight-detail-changed-${u}`,style:N.propChangeText,children:l})},u))})]})}s(hc,"AnswerCard");function gc({render:e,rendersPerSec:t}){let n=e.testID||e.nativeID||e.accessibilityLabel,o=e.measurements;return Z(g,{style:N.detailsSection,children:[n&&Z(g,{testID:"buoy-highlight-detail-identifiers",style:N.detailsCard,children:[O(p,{style:N.detailsCardTitle,children:"Identifiers"}),e.testID&&O(go,{label:"testID",value:e.testID}),e.nativeID&&O(go,{label:"nativeID",value:e.nativeID}),e.accessibilityLabel&&O(go,{label:"a11y",value:e.accessibilityLabel})]}),Z(g,{testID:"buoy-highlight-detail-stats",style:N.statsRow,children:[Z(g,{testID:"buoy-highlight-detail-stat-renders",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-renders-value",style:[N.statValue,{color:e.color}],children:e.renderCount}),O(p,{style:N.statLabel,children:"renders"})]}),O(g,{style:N.statDivider}),Z(g,{testID:"buoy-highlight-detail-stat-rate",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-rate-value",style:N.statValue,children:t}),O(p,{style:N.statLabel,children:"/sec"})]}),O(g,{style:N.statDivider}),Z(g,{testID:"buoy-highlight-detail-stat-tag",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-tag-value",style:N.statValue,children:e.nativeTag}),O(p,{style:N.statLabel,children:"tag"})]})]}),o&&Z(g,{testID:"buoy-highlight-detail-measure",style:N.measurementsRow,children:[Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"x"}),O(p,{testID:"buoy-highlight-detail-measure-x",style:N.measurementValue,children:Math.round(e.measurements.x)})]}),Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"y"}),O(p,{testID:"buoy-highlight-detail-measure-y",style:N.measurementValue,children:Math.round(e.measurements.y)})]}),Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"w"}),O(p,{testID:"buoy-highlight-detail-measure-w",style:N.measurementValue,children:Math.round(e.measurements.width)})]}),Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"h"}),O(p,{testID:"buoy-highlight-detail-measure-h",style:N.measurementValue,children:Math.round(e.measurements.height)})]})]})]})}s(gc,"DetailsSection");function go({label:e,value:t}){let n=`buoy-highlight-detail-id-${e.toLowerCase()}`;return Z(g,{testID:n,style:N.detailRow,children:[O(p,{style:N.detailLabel,children:e}),O(p,{testID:`${n}-value`,style:N.detailValue,numberOfLines:1,children:t})]})}s(go,"DetailRow");function pc({render:e,onAddFilter:t}){let[n,o]=Qs(null),r=co(()=>{let c=[];return e.nativeID&&c.push({type:"nativeID",value:e.nativeID,label:"nativeID"}),e.testID&&c.push({type:"testID",value:e.testID,label:"testID"}),e.accessibilityLabel&&c.push({type:"accessibilityLabel",value:e.accessibilityLabel,label:"a11y"}),e.componentName&&c.push({type:"component",value:e.componentName,label:"component"}),c.push({type:"viewType",value:e.viewType,label:"viewType"}),c},[e]),i=n!==null?r[n]:null,a=gn(c=>{o(d=>d===c?null:c)},[]),l=gn(()=>{i&&(t({type:i.type,value:i.value},"include"),o(null))},[i,t]),u=gn(()=>{i&&(t({type:i.type,value:i.value},"exclude"),o(null))},[i,t]);return Z(g,{testID:"buoy-highlight-quick",style:N.quickActionsSection,children:[O(p,{style:N.quickActionsTitle,children:"Quick Filters"}),O(g,{style:N.filterOptionsList,children:r.map((c,d)=>O(fc,{testID:`buoy-highlight-quick-${c.type.toLowerCase()}`,label:c.label,value:c.value,isSelected:n===d,onSelect:()=>a(d)},c.type))}),Z(g,{style:N.filterActionButtons,children:[Z(Y,{testID:"buoy-highlight-quick-include",accessibilityRole:"button",accessibilityLabel:"Only show this",style:[N.filterActionButton,N.filterActionButtonInclude,!i&&N.filterActionButtonDisabled],onPress:l,disabled:!i,activeOpacity:.7,children:[O(Kh,{size:14,color:i?M.color.accent:M.color.textTertiary}),O(p,{style:[N.filterActionButtonText,{color:i?M.color.accent:M.color.textTertiary}],children:"Only Show This"})]}),Z(Y,{testID:"buoy-highlight-quick-exclude",accessibilityRole:"button",accessibilityLabel:"Hide this",style:[N.filterActionButton,N.filterActionButtonExclude,!i&&N.filterActionButtonDisabled],onPress:u,disabled:!i,activeOpacity:.7,children:[O(qh,{size:14,color:i?M.color.danger:M.color.textTertiary}),O(p,{style:[N.filterActionButtonText,{color:i?M.color.danger:M.color.textTertiary}],children:"Hide This"})]})]})]})}s(pc,"QuickActionsSection");function fc({testID:e,label:t,value:n,isSelected:o,onSelect:r}){return Z(Y,{testID:e,accessibilityRole:"button",accessibilityLabel:`${t}, ${n}`,style:[N.filterOptionCard,o&&N.filterOptionCardSelected],onPress:r,activeOpacity:.7,children:[O(p,{style:[N.filterOptionLabel,o&&N.filterOptionLabelSelected],children:t}),O(p,{testID:e?`${e}-value`:void 0,style:[N.filterOptionValue,o&&N.filterOptionValueSelected],numberOfLines:1,children:n})]})}s(fc,"FilterOptionCard");var N=Ce.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:12,padding:16,paddingBottom:0},scrollView:{flex:1},scrollContent:{padding:16,paddingTop:12,paddingBottom:80,gap:12},headerLeft:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:10},componentName:{fontSize:18,fontWeight:"700",color:M.color.text,flexShrink:1},nativeTypeBadge:{backgroundColor:M.color.bg,paddingVertical:3,paddingHorizontal:8,borderRadius:4},nativeTypeText:{fontSize:11,fontWeight:"600",color:M.color.textTertiary,fontFamily:Ft},answerCard:{backgroundColor:M.color.surface,borderRadius:8,borderWidth:1,borderColor:M.color.border,padding:12,gap:6},causeBadgeRow:{flexDirection:"row",alignItems:"center",gap:8},causeBadgeLarge:{paddingVertical:4,paddingHorizontal:10,borderRadius:4},causeBadgeLargeText:{fontSize:11,fontWeight:"700",letterSpacing:.5},causeLabel:{fontSize:12,color:M.color.textSecondary,fontWeight:"500"},hookChangesContainer:{gap:6},hookDiffContainer:{backgroundColor:M.color.bg,borderRadius:6,overflow:"hidden"},propsChangesContainer:{flexDirection:"row",flexWrap:"wrap",gap:4},propChangeChip:{backgroundColor:M.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},propChangeText:{fontSize:11,color:M.color.text,fontFamily:Ft},detailsSection:{gap:10},detailsCard:{backgroundColor:M.color.surface,borderRadius:8,borderWidth:1,borderColor:M.color.border,padding:12,gap:6},detailsCardTitle:{fontSize:10,fontWeight:"600",color:M.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:4},detailRow:{flexDirection:"row",alignItems:"center",gap:8},detailLabel:{fontSize:11,fontWeight:"600",color:M.color.textSecondary,minWidth:55},detailValue:{fontSize:12,color:M.color.text,fontFamily:Ft,flex:1},statsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:M.color.surface,borderRadius:8,borderWidth:1,borderColor:M.color.border,paddingVertical:10,paddingHorizontal:16},statItem:{flex:1,alignItems:"center"},statValue:{fontSize:16,fontWeight:"700",color:M.color.text,fontFamily:Ft},statLabel:{fontSize:10,color:M.color.textTertiary,marginTop:2},statDivider:{width:1,height:24,backgroundColor:M.color.border,marginHorizontal:12},measurementsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:M.color.surface,borderRadius:8,borderWidth:1,borderColor:M.color.border,paddingVertical:8,paddingHorizontal:12},measurementItem:{flexDirection:"row",alignItems:"baseline",gap:4},measurementLabel:{fontSize:10,fontWeight:"600",color:M.color.textTertiary,textTransform:"uppercase"},measurementValue:{fontSize:12,fontWeight:"600",color:M.color.text,fontFamily:Ft},quickActionsSection:{backgroundColor:M.color.surface,borderRadius:8,borderWidth:1,borderColor:M.color.border,padding:12,gap:10},quickActionsTitle:{fontSize:10,fontWeight:"600",color:M.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:2},filterOptionsList:{gap:6},filterOptionCard:{flexDirection:"row",alignItems:"center",backgroundColor:M.color.surfaceElevated,borderRadius:6,paddingVertical:10,paddingHorizontal:12,borderWidth:1,borderColor:"transparent",gap:10},filterOptionCardSelected:{borderColor:M.color.accentBorderStrong,backgroundColor:M.color.accentSoft},filterOptionLabel:{fontSize:10,fontWeight:"600",color:M.color.textTertiary,minWidth:70},filterOptionLabelSelected:{color:M.color.accent},filterOptionValue:{fontSize:12,color:M.color.text,fontFamily:Ft,flex:1},filterOptionValueSelected:{color:M.color.text},filterActionButtons:{flexDirection:"row",gap:8,marginTop:12},filterActionButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:4,paddingVertical:8,paddingHorizontal:10,borderRadius:6,borderWidth:1},filterActionButtonInclude:{backgroundColor:M.color.accentSoft,borderColor:M.color.accentBorderStrong},filterActionButtonExclude:{backgroundColor:M.color.dangerSoft,borderColor:M.color.danger+"40"},filterActionButtonDisabled:{backgroundColor:M.color.surfaceElevated,borderColor:M.color.border,opacity:.5},filterActionButtonText:{fontSize:11,fontWeight:"600"},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:M.color.surface,borderRadius:8,borderWidth:1,borderColor:M.color.warning+"40",paddingVertical:12,paddingHorizontal:16,gap:8},lockedBannerText:{color:M.color.warning,fontSize:13,fontWeight:"600"},lockedBannerSubtext:{color:M.color.textTertiary,fontSize:12}});import{EventStepperFooter as tg}from"@buoy-gg/shared-ui/web";j();import{useState as ht,useCallback as gt}from"react";import{Eye as mc,Filter as Ti,Plus as yc,X as po,Box as bc,Settings as ng,Hash as og,SectionHeader as te,night as R,monoFont as $t}from"@buoy-gg/shared-ui/web";j();import{Box as rg,Hash as vc,Layers as ig,Eye as ag,Search as lg,FileCode as sg,buoyColors as wi,night as Cc,monoFont as Tc}from"@buoy-gg/shared-ui/web";import{jsx as Mt,jsxs as Si}from"react/jsx-runtime";var wc={viewType:{label:"ViewType",shortLabel:"View",color:Cc.color.accent,icon:rg},testID:{label:"testID",shortLabel:"test",color:wi.success,icon:vc},nativeID:{label:"nativeID",shortLabel:"native",color:"#f59e0b",icon:vc},component:{label:"Component",shortLabel:"Comp",color:"#a855f7",icon:sg},accessibilityLabel:{label:"a11y",shortLabel:"a11y",color:"#ec4899",icon:ag},nativeTag:{label:"tag",shortLabel:"tag",color:wi.textMuted,icon:ig},any:{label:"Any",shortLabel:"Any",color:wi.warning,icon:lg}};function Ot({type:e,value:t,compact:n=false,badgeOnly:o=false,valueOnly:r=false,shortLabel:i=false,showIcon:a=false,testID:l}){let u=wc[e],c=u.icon,d=i?u.shortLabel:u.label;return r?Mt(p,{testID:l?`${l}-value`:void 0,style:[ye.valueOnly,n&&ye.valueOnlyCompact,{color:u.color}],numberOfLines:1,children:t}):o?Si(g,{testID:l,style:[ye.badgeOnly,n&&ye.badgeOnlyCompact,{backgroundColor:u.color+"20",borderColor:u.color+"40"}],children:[a&&Mt(c,{size:n?10:12,color:u.color}),Mt(p,{style:[ye.badgeOnlyText,n&&ye.badgeOnlyTextCompact,{color:u.color}],children:d})]}):Si(g,{testID:l,accessibilityLabel:`${u.label} ${t}`,style:[ye.container,n&&ye.containerCompact],children:[Si(g,{style:[ye.badge,n&&ye.badgeCompact,{backgroundColor:u.color+"20"}],children:[a&&Mt(c,{size:n?8:10,color:u.color}),Mt(p,{style:[ye.badgeText,n&&ye.badgeTextCompact,{color:u.color}],children:d})]}),Mt(p,{testID:l?`${l}-value`:void 0,style:[ye.value,n&&ye.valueCompact],numberOfLines:1,children:t})]})}s(Ot,"IdentifierBadge");var ye=Ce.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{flexDirection:"row",alignItems:"center",paddingVertical:3,paddingHorizontal:6,borderRadius:4,gap:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5,gap:3},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},value:{fontSize:12,color:Cc.color.text,fontFamily:Tc,flex:1},valueCompact:{fontSize:11},badgeOnly:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,borderRadius:6,borderWidth:1,gap:5},badgeOnlyCompact:{paddingVertical:2,paddingHorizontal:6,borderRadius:4,gap:4},badgeOnlyText:{fontSize:11,fontWeight:"600"},badgeOnlyTextCompact:{fontSize:9,fontWeight:"700"},valueOnly:{fontSize:12,fontFamily:Tc},valueOnlyCompact:{fontSize:11},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCount:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCountText:{fontSize:10,fontWeight:"600"}});j();function pt(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}s(pt,"identifierSlug");function xi(e){return`buoy-highlight-row-${pt(e)}`}s(xi,"renderRowTestID");function Ii(e,t){return`buoy-highlight-detected-${pt(e)}-${pt(t)}`}s(Ii,"detectedItemTestID");function Ri(e,t,n){return`buoy-highlight-${e}-chip-${pt(t)}-${pt(n)}`}s(Ri,"patternChipTestID");function ft(e){return`buoy-highlight-setting-${e}`}s(ft,"settingTestID");import{Fragment as Di,jsx as w,jsxs as $}from"react/jsx-runtime";var fn=s(e=>wc[e],"getFilterConfig"),cg=["any","viewType","testID","nativeID","component","accessibilityLabel"];function ki({mode:e,onSelect:t,onCancel:n}){return $(g,{nativeID:"__rn_buoy__type-picker",testID:`buoy-highlight-${e}-types`,style:y.typePicker,children:[w(g,{style:y.typePickerRow,children:cg.map(o=>{let r=fn(o),i=r.icon;return $(Y,{testID:`buoy-highlight-${e}-type-${o.toLowerCase()}`,accessibilityRole:"button",accessibilityLabel:r.label,style:[y.typeOption,{backgroundColor:r.color+"15",borderColor:r.color+"40"}],onPress:()=>t(o),children:[w(i,{size:14,color:r.color}),w(p,{style:[y.typeOptionText,{color:r.color}],children:r.label})]},o)})}),w(Y,{testID:`buoy-highlight-${e}-types-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:n,style:y.typePickerCancel,children:w(po,{size:16,color:R.color.textTertiary})})]})}s(ki,"TypePicker");function Pi({mode:e,type:t,onSubmit:n,onCancel:o}){let[r,i]=ht(""),a=fn(t),l=s(()=>{r.trim()&&n(r.trim())},"handleSubmit");return $(g,{nativeID:"__rn_buoy__pattern-input",testID:`buoy-highlight-${e}-input-row`,style:y.patternInputContainer,children:[w(Ot,{type:t,value:"",badgeOnly:true,compact:true}),w(Nn,{testID:`buoy-highlight-${e}-input`,value:r,onChangeText:i,onSubmitEditing:l,placeholder:"Enter pattern...",placeholderTextColor:R.color.placeholder,style:y.patternInput,autoFocus:true,returnKeyType:"done",autoCorrect:false,autoCapitalize:"none"}),r.trim()&&w(Y,{testID:`buoy-highlight-${e}-submit`,accessibilityRole:"button",accessibilityLabel:"Add pattern",onPress:l,style:[y.addPatternButton,{backgroundColor:a.color+"20"}],children:w(p,{style:[y.addPatternButtonText,{color:a.color}],children:"Add"})}),w(Y,{testID:`buoy-highlight-${e}-input-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:o,style:y.cancelButton,children:w(po,{size:16,color:R.color.textTertiary})})]})}s(Pi,"PatternInput");function Ni({mode:e,pattern:t,onRemove:n}){let o=fn(t.type);return $(Y,{testID:Ri(e,t.type,t.value),accessibilityRole:"button",accessibilityLabel:`${o.label} ${t.value}, tap to remove`,style:[y.patternChip,{borderColor:o.color+"40"}],onPress:n,activeOpacity:.7,children:[w(g,{style:[y.patternChipBadge,{backgroundColor:o.color+"20"}],children:w(p,{style:[y.patternChipBadgeText,{color:o.color}],children:o.shortLabel})}),w(p,{style:y.patternChipValue,numberOfLines:1,children:t.value}),w(po,{size:12,color:R.color.textTertiary,style:y.patternChipX})]})}s(Ni,"PatternChip");var ug={label:"All",shortLabel:"All",color:R.color.textSecondary,icon:bc};function mt({filterType:e,count:t,isSelected:n,onPress:o}){let r=e==="all"?ug:fn(e),i=`buoy-highlight-detected-cat-${String(e).toLowerCase()}`;return $(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${r.label}, ${t}`,style:[y.categoryBadge,{backgroundColor:r.color+"15",borderColor:n?r.color:r.color+"40",borderWidth:n?2:1}],onPress:o,children:[w(r.icon,{size:12,color:r.color}),w(p,{style:[y.categoryBadgeText,{color:r.color}],children:r.label}),w(g,{style:[y.categoryBadgeCountBubble,{backgroundColor:r.color+"25"}],children:w(p,{testID:`${i}-count`,style:[y.categoryBadgeCount,{color:r.color}],children:t})})]})}s(mt,"DetectedCategoryBadge");var dg=[{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:150,label:"150"},{value:250,label:"250"},{value:500,label:"500"}],Li=[{value:"off",label:"Off",description:"No debug logging"},{value:"minimal",label:"Minimal",description:"Only hook value changes"},{value:"verbose",label:"Verbose",description:"Component + cause + changes"},{value:"all",label:"All",description:"Full fiber dump"}];function zi({filters:e,onFilterChange:t,settings:n,onSettingsChange:o,availableProps:r,activeTab:i}){let[a,l]=ht(false),[u,c]=ht(false),[d,h]=ht(null),[T,f]=ht(null),[b,m]=ht("all"),[S,v]=ht(null),L=s(x=>{switch(x){case"viewType":return r.viewTypes.map(z=>({value:z,type:"viewType"}));case"testID":return r.testIDs.map(z=>({value:z,type:"testID"}));case"nativeID":return r.nativeIDs.map(z=>({value:z,type:"nativeID"}));case"component":return r.componentNames.map(z=>({value:z,type:"component"}));case"accessibilityLabel":return r.accessibilityLabels.map(z=>({value:z,type:"accessibilityLabel"}));case"all":default:return[...r.viewTypes.map(z=>({value:z,type:"viewType"})),...r.testIDs.map(z=>({value:z,type:"testID"})),...r.nativeIDs.map(z=>({value:z,type:"nativeID"})),...r.componentNames.map(z=>({value:z,type:"component"})),...r.accessibilityLabels.map(z=>({value:z,type:"accessibilityLabel"}))]}},"getItemsForCategory")(b),P=r.viewTypes.length+r.testIDs.length+r.nativeIDs.length+r.componentNames.length+r.accessibilityLabels.length,C=gt((x,z)=>{let ue=[...e.includePatterns,{type:x,value:z}];t({includePatterns:ue}),h(null)},[e.includePatterns,t]),I=gt((x,z)=>{let ue=[...e.excludePatterns,{type:x,value:z}];t({excludePatterns:ue}),f(null)},[e.excludePatterns,t]),D=gt(x=>{let z=e.includePatterns.filter((ue,pe)=>pe!==x);t({includePatterns:z})},[e.includePatterns,t]),W=gt(x=>{let z=e.excludePatterns.filter((ue,pe)=>pe!==x);t({excludePatterns:z})},[e.excludePatterns,t]),X=gt((x,z)=>{v({type:x,value:z})},[]),V=gt(()=>{S&&(C(S.type,S.value),v(null))},[S,C]),U=gt(()=>{S&&(I(S.type,S.value),v(null))},[S,I]);return w(g,{style:y.container,children:w($e,{nativeID:"__rn_buoy__filter-view",testID:"buoy-highlight-filter-scroll",style:y.scrollView,contentContainerStyle:y.scrollContent,showsVerticalScrollIndicator:false,children:i==="filters"?$(Di,{children:[$(g,{style:y.section,children:[$(te,{children:[w(te.Icon,{icon:mc,color:R.color.accent,size:12}),w(te.Title,{children:"INCLUDE ONLY"}),e.includePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-include-count",count:e.includePatterns.length,color:R.color.accent})]}),w(p,{style:y.sectionDescription,children:"Show only components matching these patterns. If any are set, components must match at least one."}),e.includePatterns.length>0&&w(g,{style:y.patternChips,children:e.includePatterns.map((x,z)=>w(Ni,{mode:"include",pattern:x,onRemove:()=>D(z)},`${x.type}-${x.value}-${z}`))}),w(g,{style:y.addPatternRow,children:a?w(ki,{mode:"include",onSelect:x=>{l(false),h(x)},onCancel:()=>l(false)}):d?w(Pi,{mode:"include",type:d,onSubmit:x=>C(d,x),onCancel:()=>h(null)}):$(Y,{testID:"buoy-highlight-include-add",accessibilityRole:"button",accessibilityLabel:"Add include pattern",style:[y.addButton,{borderColor:R.color.accentBorderStrong}],onPress:()=>l(true),children:[w(yc,{size:14,color:R.color.accent}),w(p,{style:[y.addButtonText,{color:R.color.accent}],children:"Add include pattern"})]})})]}),$(g,{style:y.section,children:[$(te,{children:[w(te.Icon,{icon:Ti,color:R.color.accent,size:12}),w(te.Title,{children:"EXCLUDE"}),e.excludePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-exclude-count",count:e.excludePatterns.length,color:R.color.accent})]}),w(p,{style:y.sectionDescription,children:"Hide components matching these patterns from the list."}),e.excludePatterns.length>0&&w(g,{style:y.patternChips,children:e.excludePatterns.map((x,z)=>w(Ni,{mode:"exclude",pattern:x,onRemove:()=>W(z)},`${x.type}-${x.value}-${z}`))}),w(g,{style:y.addPatternRow,children:u?w(ki,{mode:"exclude",onSelect:x=>{c(false),f(x)},onCancel:()=>c(false)}):T?w(Pi,{mode:"exclude",type:T,onSubmit:x=>I(T,x),onCancel:()=>f(null)}):$(Y,{testID:"buoy-highlight-exclude-add",accessibilityRole:"button",accessibilityLabel:"Add exclude pattern",style:[y.addButton,{borderColor:R.color.accentBorderStrong}],onPress:()=>c(true),children:[w(yc,{size:14,color:R.color.accent}),w(p,{style:[y.addButtonText,{color:R.color.accent}],children:"Add exclude pattern"})]})})]}),$(g,{style:y.section,children:[$(te,{children:[w(te.Icon,{icon:og,color:R.color.warning,size:12}),w(te.Title,{children:"RENDER COUNT RANGE"}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&w(te.Badge,{count:1,color:R.color.warning})]}),w(p,{style:y.sectionDescription,children:"Show only components with render count in a specific range."}),$(g,{nativeID:"__rn_buoy__render-count-range",testID:"buoy-highlight-range",style:y.renderCountRangeContainer,children:[$(g,{style:y.renderCountInputRow,children:[$(g,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Min"}),w(Nn,{value:e.minRenderCount!==void 0?String(e.minRenderCount):"",onChangeText:x=>{let z=parseInt(x,10);x===""||x===void 0?t({minRenderCount:void 0}):!isNaN(z)&&z>=0&&t({minRenderCount:z})},testID:"buoy-highlight-range-min",placeholder:"0",placeholderTextColor:R.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]}),w(p,{style:y.renderCountSeparator,children:"to"}),$(g,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Max"}),w(Nn,{value:e.maxRenderCount!==void 0?String(e.maxRenderCount):"",onChangeText:x=>{let z=parseInt(x,10);x===""||x===void 0?t({maxRenderCount:void 0}):!isNaN(z)&&z>=0&&t({maxRenderCount:z})},testID:"buoy-highlight-range-max",placeholder:"\u221E",placeholderTextColor:R.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]})]}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&$(Y,{testID:"buoy-highlight-range-clear",accessibilityRole:"button",accessibilityLabel:"Clear range",style:y.clearRangeButton,onPress:()=>t({minRenderCount:void 0,maxRenderCount:void 0}),children:[w(po,{size:12,color:R.color.warning}),w(p,{style:y.clearRangeButtonText,children:"Clear Range"})]})]})]}),$(g,{style:y.section,children:[$(te,{children:[w(te.Icon,{icon:bc,color:R.color.textSecondary,size:12}),w(te.Title,{children:"DETECTED ITEMS"})]}),w(p,{style:y.sectionDescription,children:"Tap an item to quickly add it as an exclude pattern."}),$($e,{horizontal:true,showsHorizontalScrollIndicator:false,style:y.categoryBadgeScroll,contentContainerStyle:y.categoryBadgeScrollContent,children:[P>0&&w(mt,{filterType:"all",count:P,isSelected:b==="all",onPress:()=>m("all")}),r.viewTypes.length>0&&w(mt,{filterType:"viewType",count:r.viewTypes.length,isSelected:b==="viewType",onPress:()=>m("viewType")}),r.testIDs.length>0&&w(mt,{filterType:"testID",count:r.testIDs.length,isSelected:b==="testID",onPress:()=>m("testID")}),r.nativeIDs.length>0&&w(mt,{filterType:"nativeID",count:r.nativeIDs.length,isSelected:b==="nativeID",onPress:()=>m("nativeID")}),r.componentNames.length>0&&w(mt,{filterType:"component",count:r.componentNames.length,isSelected:b==="component",onPress:()=>m("component")}),r.accessibilityLabels.length>0&&w(mt,{filterType:"accessibilityLabel",count:r.accessibilityLabels.length,isSelected:b==="accessibilityLabel",onPress:()=>m("accessibilityLabel")})]}),w(g,{nativeID:"__rn_buoy__detected-items",testID:"buoy-highlight-detected",style:y.detectedItemsContainer,children:L.length>0?w($e,{testID:"buoy-highlight-detected-scroll",style:y.detectedItemsScroll,contentContainerStyle:y.detectedItems,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:L.map(x=>{let z=fn(x.type);return w(Y,{testID:Ii(x.type,x.value),accessibilityRole:"button",accessibilityLabel:`${z.label} ${x.value}`,style:[y.detectedItem,{borderColor:z.color+"40"}],onPress:()=>X(x.type,x.value),children:b==="all"?w(Ot,{type:x.type,value:x.value,compact:true,shortLabel:true}):w(p,{style:y.detectedItemText,numberOfLines:1,children:x.value})},`${x.type}-${x.value}`)})}):w(p,{testID:"buoy-highlight-detected-empty",style:y.emptyText,children:"No items detected yet. Start tracking to see components here."})})]}),w(il,{visible:S!==null,transparent:true,animationType:"fade",onRequestClose:()=>v(null),children:w(ol,{accessible:false,testID:"buoy-highlight-detected-popup-backdrop",style:y.modalOverlay,onPress:()=>v(null),children:w(g,{accessible:false,testID:"buoy-highlight-detected-popup",style:y.actionPopup,children:S&&$(Di,{children:[w(g,{style:y.actionPopupHeader,children:w(Ot,{type:S.type,value:S.value,compact:true,shortLabel:true})}),$(g,{style:y.actionPopupButtons,children:[$(Y,{testID:"buoy-highlight-detected-popup-include",accessibilityRole:"button",accessibilityLabel:"Include only",style:[y.actionPopupButton,y.actionPopupInclude],onPress:V,children:[w(mc,{size:16,color:R.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:R.color.accent}],children:"Include Only"})]}),$(Y,{testID:"buoy-highlight-detected-popup-exclude",accessibilityRole:"button",accessibilityLabel:"Exclude",style:[y.actionPopupButton,y.actionPopupExclude],onPress:U,children:[w(Ti,{size:16,color:R.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:R.color.accent}],children:"Exclude"})]})]}),w(Y,{testID:"buoy-highlight-detected-popup-cancel",accessibilityRole:"button",accessibilityLabel:"Cancel",style:y.actionPopupCancel,onPress:()=>v(null),children:w(p,{style:y.actionPopupCancelText,children:"Cancel"})})]})})})}),$(g,{style:y.section,children:[$(te,{children:[w(te.Icon,{icon:Ti,color:R.color.textTertiary,size:12}),w(te.Title,{children:"HOW FILTERS WORK"})]}),w(g,{style:y.howItWorks,children:$(p,{style:y.howItWorksText,children:[w(p,{style:y.howItWorksBold,children:"Any:"})," Matches against all fields",`
|
|
30
|
+
`)}l(Er,"logComprehensiveRenderData");function Jn(e,t,n,o="off"){let r=Date.now();if(!t)return{type:"unknown",timestamp:r};let i=t,a=t.alternate,s=Ie.get(e);if(s&&a){let k=s.memoizedProps?.children,W=t.memoizedProps?.children,X=a.memoizedProps?.children,V=t.memoizedProps===s.memoizedProps||k!==void 0&&W===k,U=a.memoizedProps===s.memoizedProps||k!==void 0&&X===k;V&&!U&&(i=a,a=t,o==="all"&&console.log("[Buoy]","[RenderCause] Detected fiber swap - using alternate as current"))}let u=null,c=null;a?(u=a.memoizedProps,c=a.memoizedState):s&&(u=s.memoizedProps,c=s.memoizedState);let d=u!==null?{memoizedProps:u,memoizedState:c,timestamp:r}:void 0,h={memoizedProps:i.memoizedProps,memoizedState:i.memoizedState,timestamp:r};ls(e,h);let T=Ar(i),m=Ee(T)||void 0,b=as(i,m)||void 0,f=ts(T),S=f.cause,v=f.hookChanges;if(!d){if(o!=="off"){if(o==="minimal")console.log("[Buoy]",`[${m||"Unknown"}] MOUNT`);else if(o==="verbose"){let k=typeof i?.type=="string"?i.type:"Unknown";console.log("[Buoy]",`[RENDER] ${m||"Unknown"} (${k}:${e}) | Cause: MOUNT`)}else if(o==="all"){let k=Ie.has(e)?Ie.size:1;Er(e,i,T,d,f,n,k)}}return{type:"mount",timestamp:r,componentCause:"mount",componentName:m}}let L=typeof i.type=="string"?i.type:void 0,P=Hr(d.memoizedProps,h.memoizedProps,L);if(o!=="off"){if(o==="minimal")ns(m,f);else if(o==="verbose")os(e,i,T,f,P);else if(o==="all"){let k=Ie.has(e)?Ie.size:1;Er(e,i,T,d,f,n,k)}}if(P&&P.length>0)return{type:"props",changedKeys:P.slice(0,Lh),timestamp:r,componentCause:S,componentName:m,parentComponentName:b,hookChanges:v||void 0};let C=rs(d.memoizedState,h.memoizedState);if(C&&C.length>0)return{type:"hooks",hookIndices:C,timestamp:r,componentCause:S,componentName:m,parentComponentName:b,hookChanges:v||void 0};let I=$r(i);return I&&n.has(I)?{type:"parent",timestamp:r,componentCause:S,componentName:m,parentComponentName:b,hookChanges:v||void 0}:S==="state"?{type:"state",timestamp:r,componentCause:S,componentName:m,parentComponentName:b,hookChanges:v||void 0}:S==="props"?{type:"props",timestamp:r,componentCause:S,componentName:m,parentComponentName:b}:S==="parent"?{type:"parent",timestamp:r,componentCause:S,componentName:m,parentComponentName:b}:{type:"unknown",timestamp:r,componentCause:S,componentName:m,parentComponentName:b}}l(Jn,"detectRenderCause");function Hr(e,t,n){if(e===t||!e||!t||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return null;let o=Jl(n),r=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(let a of r)if(!a.startsWith("__")&&!o.skip.includes(a)){if(a==="children"){if(!o.alwaysTrack.includes("children"))continue;let s=e[a],u=t[a];s!==u&&(Fr(s)&&Fr(u)?i.push(`children: ${Mr(s)} \u2192 ${Mr(u)}`):i.push("children (content)"));continue}if(e[a]!==t[a]){let s=e[a],u=t[a];a==="style"?cn(s,u)?i.push(`${a} (ref only)`):i.push(a):typeof s=="function"&&typeof u=="function"?i.push(`${a} (fn ref)`):i.push(a)}}return i.length>0?i:null}l(Hr,"getChangedKeys");function cn(e,t,n=0){if(n>5)return false;if(e===t)return true;if(typeof e!=typeof t)return false;if(typeof e!="object"||e===null||t===null)return e===t;if(Array.isArray(e)!==Array.isArray(t))return false;if(Array.isArray(e)){if(e.length!==t.length)return false;for(let i=0;i<e.length;i++)if(!cn(e[i],t[i],n+1))return false;return true}let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return false;for(let i of o)if(!r.includes(i)||!cn(e[i],t[i],n+1))return false;return true}l(cn,"deepEqual");function Fr(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}l(Fr,"isPrimitive");function Mr(e){return e===null?"null":e===void 0?"undefined":typeof e=="string"?e.length>20?`"${e.slice(0,20)}..."`:`"${e}"`:typeof e=="number"||typeof e=="boolean"?String(e):"[object]"}l(Mr,"formatValue");function rs(e,t){if(e===t||e==null||t==null||typeof e!="object"||typeof t!="object")return null;let n=[],o=e,r=t,i=0;for(;r!==null&&i<Br;)(o===null||is(o,r))&&n.push(i),r=r?.next??null,o=o?.next??null,i++;return n.length>0?n:null}l(rs,"detectHookChanges");function is(e,t){return e===t?false:e.memoizedState!==t.memoizedState||e.baseState!==void 0&&e.baseState!==t.baseState}l(is,"didHookChange");function $r(e){let t=e?.return,n=0;for(;t&&n<Xl;){if(t.stateNode){let o=Or(t.stateNode);if(o!=null)return o}t=t.return,n++}return null}l($r,"getParentNativeTag");function as(e,t){if(!e)return null;let n=Ar(e);if(!n)return null;let o=n.return,r=0;for(;o&&r<Xl;){let i=o.tag;if(i===0||i===1||i===11||i===15){let a=Ee(o);if(a&&!Vr(a)&&a!==t)return a}o=o.return,r++}return null}l(as,"getParentComponentName");function Or(e){return e?typeof e.__nativeTag=="number"?e.__nativeTag:typeof e._nativeTag=="number"?e._nativeTag:typeof e.canonical?.__nativeTag=="number"?e.canonical.__nativeTag:typeof e.canonical?.publicInstance?.__nativeTag=="number"?e.canonical.publicInstance.__nativeTag:null:null}l(Or,"getNativeTagFromStateNode");function ls(e,t){if(Ie.size>=zr){let n=Array.from(Ie.entries());n.sort((r,i)=>r[1].timestamp-i[1].timestamp);let o=Math.floor(zr/4);for(let r=0;r<o;r++)Ie.delete(n[r][0])}Ie.set(e,t)}l(ls,"updateStoredState");function _r(){Ie.clear()}l(_r,"clearRenderCauseState");function ss(e){Ie.delete(e)}l(ss,"removeRenderCauseState");function cs(){return{storedStates:Ie.size,maxStates:zr}}l(cs,"getRenderCauseStats");var Bh=5,us=200,Yn=20,Xn=30;function He(e,t=0,n=new WeakSet){if(e==null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e=="string")return e.length>us?e.slice(0,us)+"...":e;if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="symbol")return`[Symbol: ${e.description||""}]`;if(t>=Bh)return Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`[Object: ${Object.keys(e).length} keys]`:"[...]";if(typeof e=="object"){if(n.has(e))return"[Circular]";n.add(e)}if(Array.isArray(e)){let o=e.slice(0,Yn).map(r=>He(r,t+1,n));return e.length>Yn&&o.push(`[...${e.length-Yn} more]`),o}if(e instanceof Date)return e.toISOString();if(e instanceof Error)return`[Error: ${e.message}]`;if(e instanceof RegExp)return e.toString();if(e instanceof Map){let o={__type:"Map",__size:e.size},r=0;for(let[i,a]of e){if(r>=Xn){o[`...${e.size-r} more`]=true;break}let s=typeof i=="string"?i:String(i);o[s]=He(a,t+1,n),r++}return o}if(e instanceof Set)return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,Yn).map(o=>He(o,t+1,n))};if(typeof e=="object"){let o={},r=Object.keys(e),i=r.slice(0,Xn);for(let a of i)if(!(a.startsWith("__")||a==="children"))try{o[a]=He(e[a],t+1,n)}catch{o[a]="[Error accessing property]"}return r.length>Xn&&(o[`...${r.length-Xn} more keys`]=true),o}return"[Unknown type]"}l(He,"safeCloneForHistory");function ds(e){if(e?.memoizedProps)return He(e.memoizedProps)}l(ds,"capturePropsSnapshot");function hs(e){if(!e?.memoizedState)return;let t=e.memoizedState;if(typeof t=="object"&&t!==null&&"next"in t){let n=[],o=t,r=0;for(;o&&r<Br;)n.push({index:r,memoizedState:He(o.memoizedState)}),o=o.next,r++;return{__type:"Hooks",hooks:n}}return He(t)}l(hs,"captureStateSnapshot");import{notifySubscriberCountChange as gs}from"@buoy-gg/shared-ui/web";j();var Wr=new Set(["HighlightUpdatesOverlay","HighlightUpdatesModal","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderHistoryFooter","RenderCauseBadge","TwoLevelCauseBadge","EnhancedCauseDisplay","IsolatedRenderList","IsolatedRenderListInner","StatsDisplay","StatsDisplayInner","CurrentStateView","EventStepperFooter","EventsModal","UnifiedEventList","UnifiedEventItem","UnifiedEventDetail","UnifiedEventFilters","UnifiedEventViewer","ReactQueryEventDetail","EventsCopySettingsView"]),un=["HighlightUpdates","RenderList","RenderDetail","RenderHistory","RenderCause","EventStepper","UnifiedEvent","EventsModal","EventsCopy"],ps=new Set(["JsModalComponent","JsModal","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","FloatingTools","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","ModalHeader","TabSelector","SectionHeader","DraggableHeader","WindowControls","TreeDiffViewer","DataViewer","SplitDiffViewer","VirtualizedDataExplorer","DiffSummary","TypeLegend","IndentGuides","IndentGuidesOverlay","CyberpunkInput","DiffView","AnswerCard","DetailsSection","DetailRow","QuickActionsSection","FilterOptionCard","SearchSection","SearchSectionInner","HeaderActions","HeaderActionsInner","MainListHeader","FilterViewHeader","DetailViewHeader","FloatingMenu","FloatingDevTools","MinimizedToolsStack","MinimizedToolsContext","GlitchToolButton","ExpandablePopover","CollapsedPeek","ExpandedWrapper","DialIcon","DialMenu","DialIconItem","OnboardingTooltip","MenuLauncherIcon","DevToolsSettingsModal","SettingsModal","ImageOverlayModal","ImageOverlayStandalone","ToolCard","ToolIcon","GripVerticalIcon","UserStatus","Divider","ChevronDown","ChevronUp","ChevronLeft","ChevronRight","ChevronDownIcon","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage","PerfMonitorOverlay","PerfMonitorModal","PerfMonitorRoot","PerfHudInline","PerfDiagnostics","MetricSparkline","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","PerfHudInlineInner","PerfMonitorOverlayInner","MiniMetric","MetricRow","MetricNumber","MetricSparklineInner","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection","TaskTable","TaskRow","BusySparkline"]),jr=["JsModal","ImageOverlay","PerfMonitor","PerfHud","JsTop"],fs=new Set(["VirtualizedDataExplorer","TreeDiffView","TreeDiffRow","DataViewer","DiffView","DiffSummary","FloatingDevTools","FloatingMenu","FloatingBubble","MinimizedDock","DialMenu","DialItem","ExpandableSection","ChevronIcon","GlitchText","SettingsModal","SettingsRow","OnboardingFlow","DevToolsMenu"]),Ur=false;function ms(e){Ur=e}l(ms,"setCaptureBuoyToolRenders");function Gr(){return Ur}l(Gr,"isCapturingBuoyToolRenders");var Vh=new Set(["PerfHudInline","PerfHudInlineInner","PerfDiagnostics","MetricSparkline","MetricSparklineInner","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","MiniMetric","MetricRow","MetricNumber","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection"]);function Kr(e){return e.startsWith("PerfMonitor")||e.startsWith("PerfHud")||Vh.has(e)}l(Kr,"isPerfMonitorComponentName");var Ah=new Set(["TaskTable","TaskRow","BusySparkline"]);function ys(e){return e.startsWith("JsTop")||Ah.has(e)}l(ys,"isJsTopComponentName");function bs(e){if(Wr.has(e))return true;for(let t=0;t<un.length;t++)if(e.startsWith(un[t]))return true;if(Ur)return Kr(e)||ys(e);if(ps.has(e)||fs.has(e))return true;for(let t=0;t<jr.length;t++)if(e.startsWith(jr[t]))return true;return false}l(bs,"isDevToolsComponentName");function vs(e){if(Wr.has(e))return true;for(let t=0;t<un.length;t++)if(e.startsWith(un[t]))return true;return false}l(vs,"isRenderLoopUnsafeName");var se=false,at=false,We=false,we=false,ae=null,Pe=null,Qn=null,dn=null,Cs=false,Se=false,Zn=new Set,qr=new Set,Jr=new Map,Yr=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],Eh=false;function J(e,t){Eh&&(t!==void 0?console.log("[Buoy]",`[HighlightUpdates] ${e}`,t):console.log("[Buoy]",`[HighlightUpdates] ${e}`))}l(J,"debugLog");function eo(e){let t=bd(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"?n:null}l(eo,"getPublicInstance");function lt(e){let t=Ka(e);if(t!==null)return t;if(e==null)return null;let n=e;if(n.__nativeTag!=null)return n.__nativeTag;if(n._nativeTag!=null)return n._nativeTag;if(n.nativeTag!=null)return n.nativeTag;if(n.canonical){if(n.canonical.__nativeTag!=null)return n.canonical.__nativeTag;if(n.canonical._nativeTag!=null)return n.canonical._nativeTag;if(n.canonical.nativeTag!=null)return n.canonical.nativeTag}return null}l(lt,"getNativeTag");function to(e){let t=e,n={viewType:"Unknown"};t?.canonical?.viewConfig?.uiViewClassName?n.viewType=t.canonical.viewConfig.uiViewClassName:t?.viewConfig?.uiViewClassName?n.viewType=t.viewConfig.uiViewClassName:qa(t)&&(n.viewType=t.tagName.toLowerCase());let o=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Jo(t),r=t?.canonical?.currentProps,i=t?.canonical?.pendingProps,a=o?.pendingProps,s=o?.memoizedProps;return n.testID=r?.testID||i?.testID||a?.testID||s?.testID||a?.["data-testid"]||s?.["data-testid"]||void 0,n.nativeID=r?.nativeID||i?.nativeID||a?.nativeID||s?.nativeID||a?.id||s?.id||void 0,n.accessibilityLabel=r?.accessibilityLabel||i?.accessibilityLabel||a?.accessibilityLabel||s?.accessibilityLabel||a?.["aria-label"]||s?.["aria-label"]||void 0,n.componentName=Is(o)||void 0,n}l(to,"extractComponentInfo");var Ts=false,Hh=false,Xr=null;var Fh=new Set;var Mh=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]),$h=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]),st=new Map,ws=500;function Ss(){st.clear()}l(Ss,"clearDevToolsCache");function Qr(e){return e?!!(Mh.has(e)||e.startsWith("__highlight_")):false}l(Qr,"isHighlightOverlayNativeID");function Zr(e){if(!e)return false;if($h.has(e))return true;let t=e.charCodeAt(0);return!!(t===95&&e.startsWith("__rn_buoy__")||t===108&&e.startsWith("logbox"))}l(Zr,"isOtherDevToolsNativeID");function ei(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}let n=e.elementType;if(n){if(n.displayName)return n.displayName;if(n.name)return n.name}return null}l(ei,"getComponentName");var Oh=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","ScreenContainer","ScreenStack","Screen","ScreenContentWrapper","Svg","G","Path","Rect","Circle","Line","Polygon","Polyline","Ellipse","Text as SVGText","TSpan","TextPath","Use","Symbol","Defs","ClipPath","LinearGradient","RadialGradient","Stop","Mask","Pattern","Image as SVGImage","SafeAreaProvider","SafeAreaView","SafeAreaListener","GestureHandlerRootView","GestureDetector","ReanimatedView","ReanimatedText","ReanimatedImage","ReanimatedScrollView","Fragment","Suspense","Provider","Consumer","Context","ForwardRef"]);function xs(e){return!!(!e||Oh.has(e)||e==="Unknown"||e==="Component"||e.startsWith("Animated"))}l(xs,"isInternalComponent");function Is(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=ei(t);if(r&&typeof t.type!="string"&&(o||(o=r),!xs(r)))return r;t=t.return,n++}return o}l(Is,"getOwningComponentName");function Rs(e){let t=e,n=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Jo(t),o=lt(e)||lt(t?.canonical?.publicInstance),r=Gr(),i=!r&&B.getSettings().excludeDevTools;if(i&&qa(e)&&e.closest("[data-buoy-root]"))return true;if(o!=null&&i){let u=st.get(o);if(u!==void 0)return u}let a=false,s=n?.pendingProps?.nativeID||n?.memoizedProps?.nativeID||t?.canonical?.currentProps?.nativeID||null;if((Qr(s)||i&&Zr(s))&&(a=true),!a&&n){let u=n,c=0;for(;u&&c<30;){let d=ei(u);if(d){if(Wr.has(d)){a=true;break}for(let T of un)if(d.startsWith(T)){a=true;break}if(a)break;if(r&&Kr(d)){a=true;break}if(i){if(ps.has(d)||fs.has(d)){a=true;break}for(let T of jr)if(d.startsWith(T)){a=true;break}if(a)break}}let h=u.pendingProps?.nativeID||u.memoizedProps?.nativeID;if(Qr(h)){a=true;break}if(i&&Zr(h)){a=true;break}u=u.return,c++}}if(a&&o!=null&&i){if(st.size>=ws){let u=Array.from(st.keys());for(let c=0;c<ws/2;c++)st.delete(u[c])}st.set(o,a)}return a}l(Rs,"isOurOverlayNode");function ti(e){let t=Math.min(e-1,Yr.length-1);return Yr[Math.max(0,t)]}l(ti,"getColorForRenderCount");function ks(e){if(e.size===0||!se&&!We||B.getState().isPaused)return;Qe.isEnabled()&&Ea();let t=B.getBatchSize(),n=Qe.startBatch(e.size,t),o=[],r=0,i=0,a=B.hasActiveFilters();for(let c of e)if(c&&typeof c=="object")try{if(Rs(c)){r++;continue}let d=eo(c),h=lt(c)||lt(d);if(h==null)continue;let T=to(c);if(a&&!B.passesFilters(T)){i++;continue}let m=B.getSettings().showRenderCount,b,f;m?(b=(Jr.get(h)||0)+1,Jr.set(h,b),f=ti(b)):(b=0,f=Yr[0]),o.push({node:c,color:f,count:b})}catch{}if(n.markFilteringComplete(r+i,o.length),o.length===0){n.finish();return}Ts&&console.log("[Buoy]",`[HighlightUpdates] ${o.length} component(s) re-rendered`);let s=B.getRenderEventCallbackCount()>0;if(!Pe&&!s){Ts&&console.log("[Buoy]","[HighlightUpdates] No highlightCallback and no event callbacks - skipping render"),Cs=false;return}n.markMeasurementStart();let u=o.slice(0,t*4).map(({node:c,color:d,count:h})=>new Promise(T=>{let m=false,b=l(P=>{m||(m=true,clearTimeout(f),T(P))},"settle"),f=setTimeout(()=>b({rect:null,stateNode:c,color:d,count:h}),500),S=eo(c),v=lt(c)||lt(S);if(v==null){b({rect:null,stateNode:c,color:d,count:h});return}let L=l((P,C,I,k,W,X)=>{if(W==null||X==null||I==null||k==null){b({rect:null,stateNode:c,color:d,count:h});return}b({rect:{id:v,x:W,y:X,width:I,height:k,color:d,count:h},stateNode:c,color:d,count:h})},"onMeasured");if(!S){let P=c.node,C=globalThis.nativeFabricUIManager;if(P&&C?.measure){try{C.measure(P,L)}catch{b({rect:null,stateNode:c,color:d,count:h})}return}b({rect:null,stateNode:c,color:d,count:h});return}try{S.measure(L)}catch{b({rect:null,stateNode:c,color:d,count:h})}}));Promise.all(u).then(c=>{let d=c.filter(T=>T.rect!==null),h=d.map(T=>T.rect);n.markMeasurementComplete(d.length,c.length-d.length),h.length>0&&Pe&&se&&!at&&Pe(h),setTimeout(()=>{try{for(let f of d)f.rect&&ni(f.rect.id,f.stateNode)}catch(f){J("registerTrackedNode batch failed",f)}let T=B.getSettings(),m=T.trackRenderCauses&&T.showRenderCount,b=null;if(m){b=new Set;for(let{rect:f}of d)f&&b.add(f.id)}if(se){B.startBatch();for(let{rect:f,stateNode:S,color:v,count:L}of d)if(f){let P=to(S),C;if(m&&b){let I=no(S);C=Jn(f.id,I,b,T.debugLogLevel)}B.trackRender({nativeTag:f.id,viewType:P.viewType,testID:P.testID,nativeID:P.nativeID,accessibilityLabel:P.accessibilityLabel,componentName:P.componentName,measurements:{x:f.x,y:f.y,width:f.width,height:f.height},color:v,count:L,renderCause:C})}B.endBatch()}else for(let{rect:f,stateNode:S,color:v,count:L}of d)if(f){let P=to(S),C;if(m&&b){let I=no(S);C=Jn(f.id,I,b,T.debugLogLevel)}B.emitRenderEvent({nativeTag:f.id,viewType:P.viewType,testID:P.testID,nativeID:P.nativeID,accessibilityLabel:P.accessibilityLabel,componentName:P.componentName,measurements:{x:f.x,y:f.y,width:f.width,height:f.height},color:v,count:L,renderCause:C})}n.markTrackingComplete(),n.markCallbackComplete(),n.finish()},0)}).catch(c=>{console.error("[Buoy]","[HighlightUpdates] Error in measurement pipeline:",c),n.finish()})}l(ks,"handleTraceUpdates");var Ds=globalThis.WeakRef,Bt=new Map;function ni(e,t){if(!(e==null||t==null||typeof t!="object"))try{Bt.set(e,Ds?new Ds(t):{deref:l(()=>t,"deref")})}catch{Bt.set(e,{deref:l(()=>t,"deref")})}}l(ni,"registerTrackedNode");function Ps(e){let t=Bt.get(e)?.deref();return t||Bt.delete(e),t??null}l(Ps,"derefNode");function Ns(e){return new Promise(t=>{try{e.measure((n,o,r,i,a,s)=>{a==null||s==null||r==null||i==null?t(null):t({x:a,y:s,width:r,height:i})})}catch{t(null)}})}l(Ns,"measureNode");function no(e){let t=e;return t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Jo(t)||null}l(no,"getFiberFromNode");function Ls(e){let t=no(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(Ls,"findScrollAncestor");async function zs(e,t,n){try{let o=Ls(e);if(!o)return false;let r=t,i=null,a=l(s=>new Promise(u=>{let c=false,d=l(T=>{c||(c=true,u(T))},"settle"),h=setTimeout(()=>d(null),600);try{s(T=>{clearTimeout(h),d(T)})}catch{clearTimeout(h),d(null)}}),"withTimeout");if(o.nativeRef&&typeof r.measureLayout=="function"&&(i=await a(s=>r.measureLayout(o.nativeRef,(u,c)=>s(c),()=>s(null)))),i==null){let s=Nt(t),u=typeof o.innerNode=="number"?o.innerNode:Nt(o.innerNode);s!=null&&u!=null&&(i=await a(c=>tn.measureLayout(s,u,()=>c(null),(d,h)=>c(h))))}return i==null?false:(o.instance.scrollTo({y:Math.max(0,i-n),animated:false}),await new Promise(s=>setTimeout(s,80)),true)}catch{return false}}l(zs,"scrollDescendantIntoView");function Bs(e,t){let n=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)],o=0;for(let r of n){if(!r)continue;let i=r.toLowerCase();if(i===t)return 3;i.startsWith(t)?o=Math.max(o,2):i.includes(t)&&(o=Math.max(o,1))}return o}l(Bs,"matchScore");async function Vs(e){let t=e.scrollIntoView!==false,n=typeof e.margin=="number"?e.margin:12,o=B.getRenders(),r=l(async()=>{let v=await ln(),L=(e.query??"").trim().toLowerCase(),P;for(let k of v.elements){if(e.nativeTag!=null&&k.nativeTag===e.nativeTag){P={el:k,score:1e3};break}let W=Lt({nativeTag:k.nativeTag,testID:k.testID,label:k.label,text:k.text,name:k.name,tap:k.tap},{query:L||void 0,nativeTag:e.nativeTag});W<=0||(!P||W>P.score)&&(P={el:k,score:W})}if(!P?.el.frame)return{matched:false,reason:"no-match",candidates:[]};let C=v.screen,I=P.el.frame;return{matched:true,live:true,rect:{x:I.x*C.width,y:I.y*C.height,width:I.width*C.width,height:I.height*C.height},scale:er.get(),screen:{width:C.width,height:C.height},nativeTag:P.el.nativeTag??void 0,componentName:P.el.name,testID:P.el.testID}},"locateFromScreen");if(o.length===0)return r();let i=(e.query??"").trim().toLowerCase(),a=i?o.map(v=>({r:v,score:Bs(v,i)})).filter(v=>v.score>0).sort((v,L)=>L.score-v.score||L.r.lastRenderTime-v.r.lastRenderTime):[],s=a.slice(0,8).map(({r:v})=>({nativeTag:v.nativeTag,componentName:v.componentName,testID:v.testID,nativeID:v.nativeID,viewType:v.viewType,renderCount:v.renderCount})),u=e.nativeTag??(a.length>0?a[0].r.nativeTag:void 0);if(u==null){let v=await r();return v.matched?v:{matched:false,reason:"no-match",candidates:s}}let c=o.find(v=>v.nativeTag===u),d=null,h=false,T=false,m=Ps(u);if(m){let v=eo(m);v&&(t&&(T=await zs(m,v,n)),d=await Ns(v),h=!!d)}if(!d&&c?.measurements&&(d={...c.measurements}),!d)return{matched:false,reason:"no-measurement",nativeTag:u,candidates:s};let b=er.get(),f=Ze.get("window"),S=d.x>=-1&&d.y>=-1&&d.x+d.width<=f.width+1&&d.y+d.height<=f.height+1;return{matched:true,live:h,scrolled:T,inView:S,rect:d,scale:b,screen:{width:f.width,height:f.height},nativeTag:u,componentName:c?.componentName,testID:c?.testID,candidates:s}}l(Vs,"locateComponent");function oi(e){if(!ae?.rendererInterfaces){J("No rendererInterfaces available");return}let t=0;if(ae.rendererInterfaces.forEach((n,o)=>{if(typeof n.setTraceUpdatesEnabled=="function")try{n.setTraceUpdatesEnabled(e),t++,J(`Renderer ${o}: setTraceUpdatesEnabled(${e})`)}catch(r){J(`Renderer ${o}: error setting trace updates`,r)}else J(`Renderer ${o}: no setTraceUpdatesEnabled method`)}),J(`Set trace updates ${e?"enabled":"disabled"} on ${t} renderer(s)`),ae.reactDevtoolsAgent?.setTraceUpdatesEnabled)try{ae.reactDevtoolsAgent.setTraceUpdatesEnabled(e),J("Also set trace updates on agent")}catch(n){J("Error setting trace updates on agent",n)}}l(oi,"setTraceUpdatesOnRenderers");function ri(){ae&&(dn||(J("Subscribing to traceUpdates event"),typeof ae.sub=="function"?(dn=ae.sub("traceUpdates",ks),J("Subscribed using hook.sub()")):J("hook.sub not available, traceUpdates may not work"),oi(true)))}l(ri,"subscribeToTraceUpdates");function oo(){oi(false),dn&&(dn(),dn=null,J("Unsubscribed from traceUpdates event"))}l(oo,"unsubscribeFromTraceUpdates");function ii(e){Pe=e,J(`Highlight callback ${e?"set":"cleared"}`)}l(ii,"setHighlightCallback");function As(e){Qn=e,J(`Badge press callback ${e?"set":"cleared"}`)}l(As,"setBadgePressCallback");function Es(){return Qn}l(Es,"getBadgePressCallback");function Hs(e){Qn&&Qn(e)}l(Hs,"handleBadgePress");var ai=null,ro=null;function Fs(e){ai=e,e&&ro!==null&&e(ro)}l(Fs,"setSpotlightCallback");function Ms(e){if(me){me("setSpotlight",{nativeTag:e});return}ro=e,ai&&ai(e)}l(Ms,"setSpotlight");var me=null;function $s(e){me=e}l($s,"setRemoteHandler");function Os(e){se!==e.enabled&&(se=e.enabled,io()),Se!==e.frozen&&(Se=e.frozen,hn())}l(Os,"replaceRemoteState");function _s(){return ro}l(_s,"getSpotlight");function io(){qr.forEach(e=>{try{e(se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in state listener:",t)}})}l(io,"notifyStateListeners");function li(e){return qr.add(e),e(se),()=>{qr.delete(e)}}l(li,"subscribe");function Ws(e){if(typeof ee<"u"&&!ee)return{recordRenders:l(()=>{},"recordRenders"),disconnect:l(()=>{},"disconnect")};if(je!==void 0||we)throw new Error("Connect the render source before Highlight starts.");je=e;let t=true,n=new Set;return Vt(),{recordRenders(o){if(!t||!e||!se||B.getState().isPaused)return;let r=[];B.startBatch();try{for(let{host:i,name:a,count:s}of o){if(!i.isConnected)continue;let u=Ka(i);if(u===null)continue;let c=(B.getRender(String(u))?.renderCount??0)+s,d=ti(c),{x:h,y:T,width:m,height:b}=i.getBoundingClientRect(),f={x:h,y:T,width:m,height:b};B.trackRender({nativeTag:u,viewType:a,componentName:a,isComponent:true,testID:i.getAttribute("data-testid")??void 0,measurements:f,color:d,count:c}),ni(u,i),n.add(u),m>0&&b>0&&r.push({id:u,...f,color:d,count:B.getSettings().showRenderCount?c:0})}}finally{B.endBatch()}for(let i of n)B.getRender(String(i))||(n.delete(i),Bt.delete(i));!at&&r.length&&Pe?.(r)},disconnect(){if(t){t=false,ct(),Pe?.([]),ci();for(let o of n)Bt.delete(o);n.clear(),je=void 0,we=false}}}}l(Ws,"connectRenderSource");var je;function js(){return je===void 0?void 0:je?"ready":"unavailable"}l(js,"getRenderSourceStatus");function Vt(){if(typeof ee<"u"&&!ee)return J("Only available in development builds"),false;if(me||we)return true;if(je!==void 0)return we=je,ao(),we;if(ae=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null,!ae)return J("React DevTools hook not found"),false;if(J("Hook found"),J(`Hook has sub: ${typeof ae.sub=="function"}`),J(`Hook has on: ${typeof ae.on=="function"}`),J(`Hook has emit: ${typeof ae.emit=="function"}`),Qo(),ae.rendererInterfaces&&ae.rendererInterfaces.size>0)return we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s)`),ao(),true;let e=setInterval(()=>{ae?.rendererInterfaces&&ae.rendererInterfaces.size>0&&(clearInterval(e),we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s) (delayed)`),ao())},100);return setTimeout(()=>clearInterval(e),1e4),false}l(Vt,"initialize");function ao(){typeof window<"u"&&(window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:At,disable:ct,toggle:si,isEnabled:ui,setEnabled:di,subscribe:li,initialize:Vt,destroy:pi,isInitialized:l(()=>we,"isInitialized"),setHighlightCallback:ii})}l(ao,"exposeGlobally");function At(){typeof ee<"u"&&!ee||je!==false&&(we||Vt(),at&&(at=false),!se&&(J("Enabling highlights"),We||ri(),B.start(),se=true,io(),gs("render")))}l(At,"enable");function ct(){typeof ee<"u"&&!ee||se&&(J("Disabling highlights"),Hh=false,Cs=false,Xr&&(clearTimeout(Xr),Xr=null),Fh.clear(),st.clear(),_r(),Se&&(Se=false,hn()),We||oo(),B.stop(),se=false,io(),gs("render"))}l(ct,"disable");function Us(){typeof ee<"u"&&!ee||We||(we||Vt(),J("Enabling background tracking"),se||ri(),We=true)}l(Us,"enableBackgroundTracking");function Gs(){typeof ee<"u"&&!ee||We&&(J("Disabling background tracking"),We=false,se||oo())}l(Gs,"disableBackgroundTracking");function Ks(){return We}l(Ks,"isBackgroundTrackingEnabled");function si(){if(!(typeof ee<"u"&&!ee)){if(me){me("toggle");return}se?ct():At()}}l(si,"toggle");function ci(){if(me){me("clearRenderCounts");return}Jr.clear(),B.clear(),J("Cleared render counts")}l(ci,"clearRenderCounts");function ui(){return se}l(ui,"isEnabled");function di(e){if(me){me("setEnabled",{enabled:e});return}e?At():ct()}l(di,"setEnabled");function lo(e){at!==e&&(at=e,e&&Pe&&Pe([]))}l(lo,"setHighlightsSuppressed");function qs(){return at}l(qs,"getHighlightsSuppressed");function Js(e){if(me){me("setSilentTracking",{enabled:e});return}e?(At(),lo(true)):(lo(false),ct())}l(Js,"setSilentTracking");function Ys(){return we}l(Ys,"isInitialized");function hn(){Zn.forEach(e=>{try{e(Se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in freeze listener:",t)}})}l(hn,"notifyFreezeListeners");function Xs(e){return Zn.add(e),e(Se),()=>{Zn.delete(e)}}l(Xs,"subscribeToFreeze");function hi(){typeof ee<"u"&&!ee||Se||(Se=true,J("Freeze mode enabled"),hn())}l(hi,"freeze");function gi(){typeof ee<"u"&&!ee||Se&&(Se=false,J("Freeze mode disabled"),Pe&&Pe([]),hn())}l(gi,"unfreeze");function Qs(){if(me){me("toggleFreeze");return}Se?gi():hi()}l(Qs,"toggleFreeze");function Zs(){return Se}l(Zs,"getFrozen");function pi(){we&&(oo(),Zo(),Xo(null),Se=false,Zn.clear(),se=false,ae=null,Pe=null,we=false,typeof window<"u"&&delete window.__HIGHLIGHT_UPDATES_CONTROLLER__,J("Destroyed"))}l(pi,"destroy");var _h={connectRenderSource:Ws,getRenderSourceStatus:js,subscribe:li,enable:At,disable:ct,toggle:si,isEnabled:ui,setEnabled:di,initialize:Vt,destroy:pi,isInitialized:Ys,setHighlightCallback:ii,clearRenderCounts:ci,freeze:hi,unfreeze:gi,toggleFreeze:Qs,getFrozen:Zs,subscribeToFreeze:Xs,setBadgePressCallback:As,getBadgePressCallback:Es,handleBadgePress:Hs,setSpotlightCallback:Fs,setSpotlight:Ms,getSpotlight:_s,clearDevToolsCache:Ss,enableBackgroundTracking:Us,disableBackgroundTracking:Gs,isBackgroundTrackingEnabled:Ks,setRemoteHandler:$s,replaceRemoteState:Os,locateComponent:Vs,setHighlightsSuppressed:lo,getHighlightsSuppressed:qs,setSilentTracking:Js},H=_h;j();import Wh,{useState as de,useEffect as Re,useRef as ut,useCallback as oe}from"react";import{Power as jh,JsModal as Uh,devToolsStorageKeys as Et,persistentStorage as so,night as Ht,TickProvider as ec,windowDragProps as Gh}from"@buoy-gg/shared-ui/web";import{useIsPro as Kh}from"@buoy-gg/license/web";Ve();j();import{useMemo as co,useState as tc,useCallback as gn}from"react";import{CopyButton as qh,formatRelativeTime as Jh,PlusIcon as Yh,MinusIcon as Xh,EventStepperFooter as Qh,Lock as Zh,night as $,useLimit as eg,monoFont as Ft}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as tg}from"@buoy-gg/shared-ui/web/dataViewer";j();import{buoyColors as Ue,night as re,monoFont as dt}from"@buoy-gg/shared-ui/web";import{Fragment as ng,jsx as K,jsxs as ce}from"react/jsx-runtime";var Ge={mount:{label:"MOUNT",color:Ue.success,tip:"First render of this component."},props:{label:"PROPS",color:Ue.warning,tip:"Native props changed. Consider React.memo() or useCallback for handlers."},state:{label:"STATE",color:"#a855f7",tip:"Component state changed via setState."},hooks:{label:"HOOKS",color:"#ec4899",tip:"Hook values changed (useState, useReducer, useMemo, etc.)."},context:{label:"CONTEXT",color:"#06b6d4",tip:"React context value changed."},parent:{label:"PARENT",color:Ue.textSecondary,tip:"Parent component re-rendered. Consider wrapping with React.memo()."},unknown:{label:"?",color:Ue.textMuted,tip:"Could not determine render cause."}},pn={mount:{label:"mount",color:Ue.success,tip:"First render of this component."},props:{label:"props",color:Ue.warning,tip:"Component received different props from parent."},state:{label:"state",color:"#a855f7",tip:"Component's own state changed (useState/useReducer)."},parent:{label:"parent",color:Ue.textSecondary,tip:"Parent re-rendered but this component's props/state didn't change. Consider React.memo()."},unknown:{label:"?",color:Ue.textMuted,tip:"Could not determine component render cause."}};function fi({cause:e,compact:t=false,showKeys:n=false,showTwoLevel:o=false,testID:r}){let i=Ge[e.type],a=e.componentCause?pn[e.componentCause]:null,s=o&&a&&e.componentCause!==e.type;return ce(g,{nativeID:"__rn_buoy__cause-badge",testID:r,style:[A.container,t&&A.containerCompact],children:[s&&ce(ng,{children:[K(g,{style:[A.badge,t&&A.badgeCompact,A.componentBadge,{backgroundColor:a.color+"15"}],children:K(p,{testID:r?`${r}-component`:void 0,style:[A.badgeText,t&&A.badgeTextCompact,A.componentBadgeText,{color:a.color}],children:a.label})}),K(p,{style:[A.arrowText,t&&A.arrowTextCompact],children:"\u2192"})]}),K(g,{style:[A.badge,t&&A.badgeCompact,{backgroundColor:i.color+"20"}],children:K(p,{testID:r?`${r}-native`:void 0,style:[A.badgeText,t&&A.badgeTextCompact,{color:i.color}],children:i.label})}),n&&e.changedKeys&&e.changedKeys.length>0&&K(p,{testID:r?`${r}-keys`:void 0,style:[A.keysText,t&&A.keysTextCompact],numberOfLines:1,children:e.changedKeys.join(", ")}),n&&e.hookIndices&&e.hookIndices.length>0&&ce(p,{testID:r?`${r}-hooks`:void 0,style:[A.keysText,t&&A.keysTextCompact],numberOfLines:1,children:["Hook ",e.hookIndices.join(", ")]})]})}l(fi,"RenderCauseBadge");function nc({cause:e}){let t=Ge[e.type],n=e.componentCause?pn[e.componentCause]:null,o=e.componentName||"Component";return ce(g,{nativeID:"__rn_buoy__two-level-cause",style:A.twoLevelContainer,children:[n&&ce(g,{style:A.twoLevelRow,children:[K(p,{style:A.twoLevelLabel,children:"Component:"}),K(p,{style:A.twoLevelName,children:o}),K(p,{style:A.twoLevelText,children:"re-rendered due to"}),K(g,{style:[A.badge,{backgroundColor:n.color+"20"}],children:K(p,{style:[A.badgeText,{color:n.color}],children:n.label.toUpperCase()})})]}),ce(g,{style:A.twoLevelRow,children:[K(p,{style:A.twoLevelLabel,children:"Native:"}),K(g,{style:[A.badge,{backgroundColor:t.color+"20"}],children:K(p,{style:[A.badgeText,{color:t.color}],children:t.label})}),e.changedKeys&&e.changedKeys.length>0&&ce(p,{style:A.twoLevelKeys,children:["[",e.changedKeys.join(", "),"]"]})]})]})}l(nc,"TwoLevelCauseBadge");function mi({cause:e,nativeType:t}){let n=Ge[e.type],o=e.componentCause?pn[e.componentCause]:null,r=e.componentName||"Unknown",i=e.hookChanges&&e.hookChanges.length>0,a=e.changedKeys&&e.changedKeys.length>0,s=e.changedKeys?.filter(c=>c.includes("(ref only)")||c.includes("(fn ref)"))||[],u=e.changedKeys?.filter(c=>!c.includes("(ref only)")&&!c.includes("(fn ref)"))||[];return ce(g,{nativeID:"__rn_buoy__enhanced-cause",style:A.enhancedContainer,children:[ce(g,{style:A.enhancedHeader,children:[K(p,{style:A.enhancedComponentName,children:r}),t&&K(g,{style:A.enhancedNativeTag,children:K(p,{style:A.enhancedNativeTagText,children:t})})]}),ce(g,{style:A.enhancedFlowContainer,children:[K(p,{style:A.enhancedFlowLabel,children:"Cause:"}),o&&K(g,{style:[A.enhancedFlowBadge,{backgroundColor:o.color+"20"}],children:K(p,{style:[A.enhancedFlowBadgeText,{color:o.color}],children:o.label.toUpperCase()})}),K(p,{style:A.enhancedFlowArrow,children:"\u2192"}),K(g,{style:[A.enhancedFlowBadge,{backgroundColor:n.color+"20"}],children:K(p,{style:[A.enhancedFlowBadgeText,{color:n.color}],children:n.label})})]}),i&&ce(g,{style:A.enhancedSection,children:[K(p,{style:A.enhancedSectionTitle,children:"Component State Changed:"}),e.hookChanges.map(c=>ce(g,{style:A.enhancedChangeRow,children:[K(p,{style:A.enhancedChangeIcon,children:"\u26A1"}),ce(p,{style:A.enhancedChangeText,children:["Hook[",c.index,"] (",c.type,"): ",c.description]})]},c.index))]}),u.length>0&&ce(g,{style:A.enhancedSection,children:[K(p,{style:A.enhancedSectionTitle,children:"Native Props Changed:"}),u.map((c,d)=>ce(g,{style:A.enhancedChangeRow,children:[K(p,{style:A.enhancedChangeIcon,children:"~"}),K(p,{style:A.enhancedChangeText,children:c})]},d))]}),s.length>0&&ce(g,{style:A.enhancedSection,children:[K(p,{style:[A.enhancedSectionTitle,{color:re.color.textTertiary}],children:"Reference Changes (optimization opportunity):"}),s.map((c,d)=>ce(g,{style:A.enhancedChangeRow,children:[K(p,{style:[A.enhancedChangeIcon,{color:re.color.textTertiary}],children:"\u25CB"}),K(p,{style:[A.enhancedChangeText,{color:re.color.textTertiary}],children:c})]},d))]}),!i&&!a&&e.type!=="mount"&&K(g,{style:A.enhancedSection,children:K(p,{style:A.enhancedNoChanges,children:e.type==="parent"?"Parent re-rendered (consider React.memo)":"No specific changes detected"})})]})}l(mi,"EnhancedCauseDisplay");var A=Ce.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{paddingVertical:3,paddingHorizontal:6,borderRadius:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5},componentBadge:{borderStyle:"dashed",borderWidth:1,borderColor:re.color.border},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},componentBadgeText:{fontWeight:"500",textTransform:"lowercase"},arrowText:{fontSize:10,color:re.color.textTertiary},arrowTextCompact:{fontSize:9},keysText:{fontSize:11,color:re.color.textSecondary,fontFamily:dt,flex:1},keysTextCompact:{fontSize:10},twoLevelContainer:{gap:8},twoLevelRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:6},twoLevelLabel:{fontSize:11,fontWeight:"600",color:re.color.textSecondary,minWidth:70},twoLevelName:{fontSize:11,fontWeight:"600",color:re.color.text,fontFamily:dt},twoLevelText:{fontSize:11,color:re.color.textSecondary},twoLevelKeys:{fontSize:10,color:re.color.textSecondary,fontFamily:dt},enhancedContainer:{gap:12},enhancedHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},enhancedComponentName:{fontSize:14,fontWeight:"700",color:re.color.text,fontFamily:dt},enhancedNativeTag:{backgroundColor:re.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},enhancedNativeTagText:{fontSize:10,fontWeight:"600",color:re.color.textTertiary,fontFamily:dt},enhancedFlowContainer:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12,backgroundColor:re.color.bg,borderRadius:6},enhancedFlowLabel:{fontSize:11,fontWeight:"600",color:re.color.textSecondary},enhancedFlowBadge:{paddingVertical:3,paddingHorizontal:8,borderRadius:4},enhancedFlowBadgeText:{fontSize:10,fontWeight:"700"},enhancedFlowArrow:{fontSize:14,color:re.color.textTertiary,fontWeight:"300"},enhancedSection:{gap:6},enhancedSectionTitle:{fontSize:11,fontWeight:"600",color:re.color.textSecondary,letterSpacing:.3},enhancedChangeRow:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingLeft:4},enhancedChangeIcon:{fontSize:12,color:re.color.warning,fontFamily:dt,width:16},enhancedChangeText:{fontSize:12,color:re.color.text,fontFamily:dt,flex:1},enhancedNoChanges:{fontSize:12,color:re.color.textTertiary,fontStyle:"italic",paddingLeft:4}});j();function oc(e,t){let n=e.filter(m=>m.renderCount>=t.minRenders);if(t.filterCauses.length>0){let m=new Set(t.filterCauses);n=n.filter(b=>m.has(b.lastRenderCause?.type??"unknown"))}let o=e.flatMap(m=>[m.firstRenderTime,m.lastRenderTime]).filter(m=>Number.isFinite(m)),r=o.length>0?Math.max(...o)-Math.min(...o):0,i=Math.max(.001,r/1e3),a=(t.groupByName?rc(n):n.map(m=>[m])).map(m=>ic(m,t,i));lc(a,t.sortBy);let s=t.topN===-1?0:Math.max(0,a.length-t.topN),u=t.topN===-1?a:a.slice(0,t.topN),c=e.reduce((m,b)=>m+b.renderCount,0),d=ac(e),h=0,T=false;for(let m of e)m.lastRenderCause||(h+=m.renderCount),m.renderHistory&&m.renderHistory.length>0&&(T=true);return{totalUniqueComponents:n.length,totalRenders:c,windowMs:r,causeBreakdown:d,rows:u,truncated:s,dataGaps:{historyOff:!T,propsCaptureOff:!e.some(m=>m.renderHistory?.some(b=>b.capturedProps!==void 0)),stateCaptureOff:!e.some(m=>m.renderHistory?.some(b=>b.capturedState!==void 0)),rendersWithoutCause:h}}}l(oc,"buildReport");function rc(e){let t=new Map;for(let n of e){let o=n.componentName||n.displayName||n.viewType,r=t.get(o);r?r.push(n):t.set(o,[n])}return Array.from(t.values())}l(rc,"groupByComponentName");function ic(e,t,n){let o=e[0],r=o.componentName||o.displayName||o.viewType,i=0,a={},s=new Map,u=new Map,c=new Map,d=0,h=0,T=0;for(let I of e){i+=I.renderCount;let k=I.lastRenderCause;if(!k)continue;let W=k.type;a[W]=(a[W]??0)+I.renderCount;let X=(k.hookChanges?.length??0)>0,V=(k.changedKeys?.length??0)>0;if(W==="parent"&&(k.componentCause==="state"||k.componentCause==="props"||X||V?h+=I.renderCount:T+=I.renderCount),W==="props"&&!V&&(d+=I.renderCount),k.parentComponentName&&c.set(k.parentComponentName,(c.get(k.parentComponentName)??0)+1),t.aggregateCauses&&k.hookChanges)for(let U of k.hookChanges){let x=`${U.type}[${U.index}]`,z=s.get(x);z?z.count+=1:s.set(x,{count:1,sample:cc(U)})}if(k.changedKeys)for(let U of k.changedKeys)U.includes("(ref only)")||u.set(U,(u.get(U)??0)+1)}let m=Array.from(s.entries()).sort((I,k)=>k[1].count-I[1].count).slice(0,3).map(([I,k])=>({hook:I,count:k.count,sample:k.sample})),b=Array.from(u.entries()).sort((I,k)=>k[1]-I[1]).slice(0,5).map(([I])=>I),f="unknown",S=-1;for(let[I,k]of Object.entries(a))(k??0)>S&&(S=k??0,f=I);let v,L=0;for(let[I,k]of c)k>L&&(L=k,v=I);let P=e.map(I=>I.renderCount).sort((I,k)=>k-I),C=i/n;return{name:r,viewType:o.viewType,instances:e.length,renders:i,causeMix:a,dominantCause:f,hookCauses:m,changedKeys:b,unknownPropsCount:d,parentWithOwnChange:h,parentNoChange:T,parentName:v,instanceCounts:P,rate:C,source:e}}l(ic,"processGroup");function ac(e){let t={};for(let n of e){let o=n.lastRenderCause?.type??"unknown";t[o]=(t[o]??0)+n.renderCount}return t}l(ac,"aggregateCauseBreakdown");function lc(e,t){switch(t){case"renderCount":e.sort((n,o)=>o.renders-n.renders);break;case"rate":e.sort((n,o)=>o.rate-n.rate);break;case"name":e.sort((n,o)=>n.name.localeCompare(o.name));break}}l(lc,"sortRows");var sc=32;function yi(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="function")return"[Fn]";if(typeof e=="object")return Array.isArray(e)?`[Array(${e.length})]`:"[Obj]";let t=String(e);return t.length>sc?t.slice(0,sc-1)+"\u2026":t}l(yi,"truncateValue");function cc(e){return e.previousValue===void 0&&e.currentValue===void 0?e.description:`${yi(e.previousValue)} \u2192 ${yi(e.currentValue)}`}l(cc,"formatHookSample");function bi(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}l(bi,"formatWindow");function uo(e){return e>=100?`${e.toFixed(0)}/s`:e>=10?`${e.toFixed(1)}/s`:`${e.toFixed(2)}/s`}l(uo,"formatRate");function vi(e){let t=Object.entries(e).sort((n,o)=>(o[1]??0)-(n[1]??0));return t.length===0?"(no causes recorded)":t.map(([n,o])=>`${n} ${o}`).join(" \xB7 ")}l(vi,"causeBreakdownLine");function Ci(e){let t=[],n=Object.entries(e.causeMix).filter(([,r])=>(r??0)>0).sort((r,i)=>(i[1]??0)-(r[1]??0)),o=n.length>=2&&(n[1]?.[1]??0)>=e.renders*.1;if(e.dominantCause==="hooks"&&e.hookCauses.length>0){let r=e.hookCauses[0];r.sample?t.push(`hooks \xD7${r.count} ${r.hook}: ${r.sample}`):t.push(`hooks \xD7${r.count} ${r.hook}`)}else if(e.dominantCause==="props"){if(e.changedKeys.length>0){let r=e.changedKeys.slice(0,3).join(", ");t.push(`props (${r})`)}else t.push("props (keys not captured)");e.unknownPropsCount>0&&e.changedKeys.length>0&&t.push(`[${e.unknownPropsCount} unidentified]`)}else if(e.dominantCause==="parent"){let r="parent cascade";e.parentNoChange>0&&e.parentWithOwnChange===0&&(r="parent cascade, no own change"),e.parentName&&(r+=` \u2190 ${e.parentName}`),t.push(r)}else e.dominantCause==="mount"?t.push("mount"):e.dominantCause==="state"?t.push("state"):e.dominantCause==="context"?t.push("context"):t.push("unknown");if(o){let r=n.map(([i,a])=>`${i}:${a}`).join(" + ");t.push(`(${r})`)}return t.join(" ")}l(Ci,"describeCause");function Ti(e){if(e.instances<=1)return e.name;let t=e.instanceCounts,n=t[0]??0,o=t[t.length-1]??0;if(n-o<=1)return`${e.name} \xD7${e.instances} (${n} each)`;let r=t.slice(1),i=r.reduce((s,u)=>s+u,0),a=r.length>0?i/r.length:0;return`${e.name} \xD7${e.instances} (top ${n}, others ~${Math.round(a)})`}l(Ti,"describeInstances");var og="React Native render report \u2014 review the data and identify why components are re-rendering.";function wi(e,t){let n=[];n.push(og),n.push(""),n.push(`Window: ${bi(e.windowMs)} \xB7 ${e.totalUniqueComponents} components \xB7 ${e.totalRenders} renders`),n.push(`Cause mix: ${vi(e.causeBreakdown)}`),n.push(""),n.push("Top offenders (count \xB7 rate \xB7 component \xB7 cause):"),n.push("");let o=e.rows.map(Ti),r=Math.min(36,Math.max(8,...o.map(u=>u.length))),i=Math.max(3,...e.rows.map(u=>`\xD7${u.renders}`.length)),a=Math.max(5,...e.rows.map(u=>uo(u.rate).length));for(let u=0;u<e.rows.length;u++){let c=e.rows[u],d=(o[u]??c.name).padEnd(r),h=`\xD7${c.renders}`.padStart(i),T=uo(c.rate).padStart(a),m=Ci(c);n.push(` ${h} ${T} ${d} ${m}`)}e.truncated>0&&(n.push(""),n.push(`... ${e.truncated} more (set topN=-1 to expand)`));let s=Si(e);if(s.length>0){n.push(""),n.push("Data availability:");for(let u of s)n.push(` \xB7 ${u}`)}return n.join(`
|
|
31
|
+
`)}l(wi,"generateSummary");function Si(e){let t=[];return e.dataGaps.rendersWithoutCause>0&&t.push(`${e.dataGaps.rendersWithoutCause} renders had no cause info (enable trackRenderCauses for more detail)`),e.dataGaps.propsCaptureOff&&t.push("prop snapshots not captured (enable capturePropsOnRender to see prop diffs for 'props (keys not captured)' rows)"),e.dataGaps.stateCaptureOff&&t.push("state snapshots not captured (enable captureStateOnRender)"),e.dataGaps.historyOff&&t.push("render history off (enable enableRenderHistory for per-render timeline)"),t}l(Si,"buildDataFooter");function uc(e,t){let n=[];n.push("# React Render Report"),n.push(""),n.push(`**Window:** ${bi(e.windowMs)} \xB7 **Components:** ${e.totalUniqueComponents} \xB7 **Renders:** ${e.totalRenders}`),n.push(`**Cause mix:** ${vi(e.causeBreakdown)}`),n.push(""),n.push("| Component | Renders | Rate | Cause |"),n.push("|---|---:|---:|---|");for(let r of e.rows){let i=Ti(r),a=Ci(r).replace(/\|/g,"\\|");n.push(`| ${i} | ${r.renders} | ${uo(r.rate)} | ${a} |`)}e.truncated>0&&(n.push(""),n.push(`_... ${e.truncated} more rows_`));let o=Si(e);if(o.length>0){n.push(""),n.push("**Data availability:**");for(let r of o)n.push(`- ${r}`)}return n.join(`
|
|
32
|
+
`)}l(uc,"generateMarkdownTable");function dc(e,t,n){let o={exportedAt:new Date().toISOString(),summary:{windowMs:t.windowMs,totalComponents:t.totalUniqueComponents,totalRenders:t.totalRenders,causeBreakdown:t.causeBreakdown,truncated:t.truncated,dataGaps:t.dataGaps},components:t.rows.map(r=>({name:r.name,viewType:r.viewType,instances:r.instances,instanceCounts:r.instances>1?r.instanceCounts:void 0,renders:r.renders,ratePerSec:Number(r.rate.toFixed(3)),dominantCause:r.dominantCause,causeMix:r.causeMix,hookCauses:r.hookCauses,changedKeys:r.changedKeys,unknownPropsCount:r.unknownPropsCount||void 0,parentName:r.parentName,parentWithOwnChange:r.parentWithOwnChange||void 0,parentNoChange:r.parentNoChange||void 0,...n.includeHistory?{history:hc(r.source)}:{}}))};return n.includeHistory?JSON.stringify(o,null,2):JSON.stringify(o)}l(dc,"generateJson");function hc(e){return e.map(t=>({name:t.componentName||t.displayName,nativeTag:t.nativeTag,renderCount:t.renderCount,history:t.renderHistory?.map(n=>({n:n.renderNumber,t:n.timestamp,cause:{type:n.cause.type,componentCause:n.cause.componentCause,changedKeys:n.cause.changedKeys,parentComponentName:n.cause.parentComponentName,hookChanges:n.cause.hookChanges?.map(o=>({type:o.type,index:o.index,desc:o.description}))}}))}))}l(hc,"extractHistory");function ho(e,t){let n=oc(e,t);switch(t.format){case"summary":return wi(n,t);case"markdown-table":return uc(n,t);case"json":return dc(e,n,t);default:return wi(n,t)}}l(ho,"generateExport");function gc(e,t){return ho(e,t).length}l(gc,"estimateExportSize");function xi(e){return{totalComponents:e.length,totalRenders:e.reduce((t,n)=>t+n.renderCount,0)}}l(xi,"getExportSummary");function pc(e){return ho([e],{format:"summary",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false})}l(pc,"generateSingleComponentExport");import{jsx as O,jsxs as Z}from"react/jsx-runtime";function Ii({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:o,onAddFilter:r,isPro:i=false}){let[a,s]=tc(0),u=n??a,c=o??s,d=co(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((V,U)=>V.timestamp-U.timestamp),[e.renderHistory]),h=d.length,T=d[u],m=eg("highlightUpdates.detailEvents"),b=i?1/0:m,f=co(()=>Math.max(0,h-b),[b,h]),S=T?.cause||e.lastRenderCause,v=gn(()=>{u>0&&c(u-1)},[u,c]),L=gn(()=>{let V=Math.min(b-1,h-1);u<V&&c(u+1)},[u,h,c,b]),P=co(()=>pc(e),[e]),C=e.componentName||e.displayName,I=e.viewType,k=e.lastRenderTime-e.firstRenderTime,W=k>0?(e.renderCount/(k/1e3)).toFixed(1):e.renderCount.toString(),X=!t&&h>1;return Z(g,{style:N.container,children:[Z(g,{style:N.header,children:[Z(g,{style:N.headerLeft,children:[O(p,{testID:"buoy-highlight-detail-name",style:N.componentName,numberOfLines:1,children:C}),O(g,{style:N.nativeTypeBadge,children:O(p,{testID:"buoy-highlight-detail-type",style:N.nativeTypeText,children:I})})]}),O(qh,{value:P,size:14,testID:"buoy-highlight-detail-copy"})]}),Z(Me,{keyboardShouldPersistTaps:"handled",testID:"buoy-highlight-detail-scroll",style:N.scrollView,contentContainerStyle:[N.scrollContent,X&&{paddingBottom:100}],showsVerticalScrollIndicator:false,children:[S&&O(fc,{cause:S,renderNumber:T?.renderNumber}),O(mc,{render:e,rendersPerSec:W}),f>0&&Z(g,{testID:"buoy-highlight-detail-locked",style:N.lockedBanner,children:[O(Zh,{size:14,color:$.color.warning}),Z(p,{testID:"buoy-highlight-detail-locked-text",style:N.lockedBannerText,children:[f," ",f===1?"event":"events"," hidden"]}),O(p,{style:N.lockedBannerSubtext,children:"Upgrade to Pro"})]}),r&&O(yc,{render:e,onAddFilter:r})]}),X&&O(Qh,{currentIndex:u,totalItems:h,onPrevious:v,onNext:L,itemLabel:"Render",subtitle:T?.timestamp?Jh(new Date(T.timestamp)):void 0,applySafeAreaInset:false,absolute:true})]})}l(Ii,"RenderDetailView");function fc({cause:e,renderNumber:t}){let n=e.componentCause||e.type,o=e.componentCause?pn[e.componentCause]:Ge[e.type],r=e.hookChanges&&e.hookChanges.length>0,i=e.changedKeys&&e.changedKeys.length>0,a=l(()=>e.type==="mount"?"First render":n==="parent"?"Triggered by":"Changed:","getLabel");return Z(g,{testID:"buoy-highlight-detail-cause",style:N.answerCard,children:[Z(g,{style:N.causeBadgeRow,children:[O(p,{testID:"buoy-highlight-detail-cause-label",style:N.causeLabel,children:a()}),O(g,{style:[N.causeBadgeLarge,{backgroundColor:o.color+"20"}],children:O(p,{testID:"buoy-highlight-detail-cause-badge",style:[N.causeBadgeLargeText,{color:o.color}],children:o.label.toUpperCase()})})]}),r&&O(g,{style:N.hookChangesContainer,children:e.hookChanges.map((s,u)=>{let c=`${s.type}[${s.index}]`,d={[c]:s.previousValue},h={[c]:s.currentValue};return O(g,{style:N.hookDiffContainer,children:O(tg,{oldValue:d,newValue:h,theme:"dark",showUnchanged:false})},u)})}),!r&&i&&O(g,{style:N.propsChangesContainer,children:e.changedKeys.filter(s=>!s.includes("(ref only)")).slice(0,5).map((s,u)=>O(g,{style:N.propChangeChip,children:O(p,{testID:`buoy-highlight-detail-changed-${u}`,style:N.propChangeText,children:s})},u))})]})}l(fc,"AnswerCard");function mc({render:e,rendersPerSec:t}){let n=e.testID||e.nativeID||e.accessibilityLabel,o=e.measurements;return Z(g,{style:N.detailsSection,children:[n&&Z(g,{testID:"buoy-highlight-detail-identifiers",style:N.detailsCard,children:[O(p,{style:N.detailsCardTitle,children:"Identifiers"}),e.testID&&O(go,{label:"testID",value:e.testID}),e.nativeID&&O(go,{label:"nativeID",value:e.nativeID}),e.accessibilityLabel&&O(go,{label:"a11y",value:e.accessibilityLabel})]}),Z(g,{testID:"buoy-highlight-detail-stats",style:N.statsRow,children:[Z(g,{testID:"buoy-highlight-detail-stat-renders",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-renders-value",style:[N.statValue,{color:e.color}],children:e.renderCount}),O(p,{style:N.statLabel,children:"renders"})]}),O(g,{style:N.statDivider}),Z(g,{testID:"buoy-highlight-detail-stat-rate",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-rate-value",style:N.statValue,children:t}),O(p,{style:N.statLabel,children:"/sec"})]}),O(g,{style:N.statDivider}),Z(g,{testID:"buoy-highlight-detail-stat-tag",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-tag-value",style:N.statValue,children:e.nativeTag}),O(p,{style:N.statLabel,children:"tag"})]})]}),o&&Z(g,{testID:"buoy-highlight-detail-measure",style:N.measurementsRow,children:[Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"x"}),O(p,{testID:"buoy-highlight-detail-measure-x",style:N.measurementValue,children:Math.round(e.measurements.x)})]}),Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"y"}),O(p,{testID:"buoy-highlight-detail-measure-y",style:N.measurementValue,children:Math.round(e.measurements.y)})]}),Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"w"}),O(p,{testID:"buoy-highlight-detail-measure-w",style:N.measurementValue,children:Math.round(e.measurements.width)})]}),Z(g,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"h"}),O(p,{testID:"buoy-highlight-detail-measure-h",style:N.measurementValue,children:Math.round(e.measurements.height)})]})]})]})}l(mc,"DetailsSection");function go({label:e,value:t}){let n=`buoy-highlight-detail-id-${e.toLowerCase()}`;return Z(g,{testID:n,style:N.detailRow,children:[O(p,{style:N.detailLabel,children:e}),O(p,{testID:`${n}-value`,style:N.detailValue,numberOfLines:1,children:t})]})}l(go,"DetailRow");function yc({render:e,onAddFilter:t}){let[n,o]=tc(null),r=co(()=>{let c=[];return e.nativeID&&c.push({type:"nativeID",value:e.nativeID,label:"nativeID"}),e.testID&&c.push({type:"testID",value:e.testID,label:"testID"}),e.accessibilityLabel&&c.push({type:"accessibilityLabel",value:e.accessibilityLabel,label:"a11y"}),e.componentName&&c.push({type:"component",value:e.componentName,label:"component"}),c.push({type:"viewType",value:e.viewType,label:"viewType"}),c},[e]),i=n!==null?r[n]:null,a=gn(c=>{o(d=>d===c?null:c)},[]),s=gn(()=>{i&&(t({type:i.type,value:i.value},"include"),o(null))},[i,t]),u=gn(()=>{i&&(t({type:i.type,value:i.value},"exclude"),o(null))},[i,t]);return Z(g,{testID:"buoy-highlight-quick",style:N.quickActionsSection,children:[O(p,{style:N.quickActionsTitle,children:"Quick Filters"}),O(g,{style:N.filterOptionsList,children:r.map((c,d)=>O(bc,{testID:`buoy-highlight-quick-${c.type.toLowerCase()}`,label:c.label,value:c.value,isSelected:n===d,onSelect:()=>a(d)},c.type))}),Z(g,{style:N.filterActionButtons,children:[Z(Y,{testID:"buoy-highlight-quick-include",accessibilityRole:"button",accessibilityLabel:"Only show this",style:[N.filterActionButton,N.filterActionButtonInclude,!i&&N.filterActionButtonDisabled],onPress:s,disabled:!i,activeOpacity:.7,children:[O(Yh,{size:14,color:i?$.color.accent:$.color.textTertiary}),O(p,{style:[N.filterActionButtonText,{color:i?$.color.accent:$.color.textTertiary}],children:"Only Show This"})]}),Z(Y,{testID:"buoy-highlight-quick-exclude",accessibilityRole:"button",accessibilityLabel:"Hide this",style:[N.filterActionButton,N.filterActionButtonExclude,!i&&N.filterActionButtonDisabled],onPress:u,disabled:!i,activeOpacity:.7,children:[O(Xh,{size:14,color:i?$.color.danger:$.color.textTertiary}),O(p,{style:[N.filterActionButtonText,{color:i?$.color.danger:$.color.textTertiary}],children:"Hide This"})]})]})]})}l(yc,"QuickActionsSection");function bc({testID:e,label:t,value:n,isSelected:o,onSelect:r}){return Z(Y,{testID:e,accessibilityRole:"button",accessibilityLabel:`${t}, ${n}`,style:[N.filterOptionCard,o&&N.filterOptionCardSelected],onPress:r,activeOpacity:.7,children:[O(p,{style:[N.filterOptionLabel,o&&N.filterOptionLabelSelected],children:t}),O(p,{testID:e?`${e}-value`:void 0,style:[N.filterOptionValue,o&&N.filterOptionValueSelected],numberOfLines:1,children:n})]})}l(bc,"FilterOptionCard");var N=Ce.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:12,padding:16,paddingBottom:0},scrollView:{flex:1},scrollContent:{padding:16,paddingTop:12,paddingBottom:80,gap:12},headerLeft:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:10},componentName:{fontSize:18,fontWeight:"700",color:$.color.text,flexShrink:1},nativeTypeBadge:{backgroundColor:$.color.bg,paddingVertical:3,paddingHorizontal:8,borderRadius:4},nativeTypeText:{fontSize:11,fontWeight:"600",color:$.color.textTertiary,fontFamily:Ft},answerCard:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:6},causeBadgeRow:{flexDirection:"row",alignItems:"center",gap:8},causeBadgeLarge:{paddingVertical:4,paddingHorizontal:10,borderRadius:4},causeBadgeLargeText:{fontSize:11,fontWeight:"700",letterSpacing:.5},causeLabel:{fontSize:12,color:$.color.textSecondary,fontWeight:"500"},hookChangesContainer:{gap:6},hookDiffContainer:{backgroundColor:$.color.bg,borderRadius:6,overflow:"hidden"},propsChangesContainer:{flexDirection:"row",flexWrap:"wrap",gap:4},propChangeChip:{backgroundColor:$.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},propChangeText:{fontSize:11,color:$.color.text,fontFamily:Ft},detailsSection:{gap:10},detailsCard:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:6},detailsCardTitle:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:4},detailRow:{flexDirection:"row",alignItems:"center",gap:8},detailLabel:{fontSize:11,fontWeight:"600",color:$.color.textSecondary,minWidth:55},detailValue:{fontSize:12,color:$.color.text,fontFamily:Ft,flex:1},statsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,paddingVertical:10,paddingHorizontal:16},statItem:{flex:1,alignItems:"center"},statValue:{fontSize:16,fontWeight:"700",color:$.color.text,fontFamily:Ft},statLabel:{fontSize:10,color:$.color.textTertiary,marginTop:2},statDivider:{width:1,height:24,backgroundColor:$.color.border,marginHorizontal:12},measurementsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,paddingVertical:8,paddingHorizontal:12},measurementItem:{flexDirection:"row",alignItems:"baseline",gap:4},measurementLabel:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,textTransform:"uppercase"},measurementValue:{fontSize:12,fontWeight:"600",color:$.color.text,fontFamily:Ft},quickActionsSection:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:10},quickActionsTitle:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:2},filterOptionsList:{gap:6},filterOptionCard:{flexDirection:"row",alignItems:"center",backgroundColor:$.color.surfaceElevated,borderRadius:6,paddingVertical:10,paddingHorizontal:12,borderWidth:1,borderColor:"transparent",gap:10},filterOptionCardSelected:{borderColor:$.color.accentBorderStrong,backgroundColor:$.color.accentSoft},filterOptionLabel:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,minWidth:70},filterOptionLabelSelected:{color:$.color.accent},filterOptionValue:{fontSize:12,color:$.color.text,fontFamily:Ft,flex:1},filterOptionValueSelected:{color:$.color.text},filterActionButtons:{flexDirection:"row",gap:8,marginTop:12},filterActionButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:4,paddingVertical:8,paddingHorizontal:10,borderRadius:6,borderWidth:1},filterActionButtonInclude:{backgroundColor:$.color.accentSoft,borderColor:$.color.accentBorderStrong},filterActionButtonExclude:{backgroundColor:$.color.dangerSoft,borderColor:$.color.danger+"40"},filterActionButtonDisabled:{backgroundColor:$.color.surfaceElevated,borderColor:$.color.border,opacity:.5},filterActionButtonText:{fontSize:11,fontWeight:"600"},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.warning+"40",paddingVertical:12,paddingHorizontal:16,gap:8},lockedBannerText:{color:$.color.warning,fontSize:13,fontWeight:"600"},lockedBannerSubtext:{color:$.color.textTertiary,fontSize:12}});import{EventStepperFooter as rg}from"@buoy-gg/shared-ui/web";j();import{useState as ht,useCallback as gt}from"react";import{Eye as vc,Filter as Ri,Plus as Cc,X as po,Box as Tc,Settings as ig,Hash as ag,SectionHeader as te,night as R,monoFont as Mt}from"@buoy-gg/shared-ui/web";j();import{Box as lg,Hash as wc,Layers as sg,Eye as cg,Search as ug,FileCode as dg,buoyColors as ki,night as Sc,monoFont as xc}from"@buoy-gg/shared-ui/web";import{jsx as $t,jsxs as Di}from"react/jsx-runtime";var Ic={viewType:{label:"ViewType",shortLabel:"View",color:Sc.color.accent,icon:lg},testID:{label:"testID",shortLabel:"test",color:ki.success,icon:wc},nativeID:{label:"nativeID",shortLabel:"native",color:"#f59e0b",icon:wc},component:{label:"Component",shortLabel:"Comp",color:"#a855f7",icon:dg},accessibilityLabel:{label:"a11y",shortLabel:"a11y",color:"#ec4899",icon:cg},nativeTag:{label:"tag",shortLabel:"tag",color:ki.textMuted,icon:sg},any:{label:"Any",shortLabel:"Any",color:ki.warning,icon:ug}};function Ot({type:e,value:t,compact:n=false,badgeOnly:o=false,valueOnly:r=false,shortLabel:i=false,showIcon:a=false,testID:s}){let u=Ic[e],c=u.icon,d=i?u.shortLabel:u.label;return r?$t(p,{testID:s?`${s}-value`:void 0,style:[ye.valueOnly,n&&ye.valueOnlyCompact,{color:u.color}],numberOfLines:1,children:t}):o?Di(g,{testID:s,style:[ye.badgeOnly,n&&ye.badgeOnlyCompact,{backgroundColor:u.color+"20",borderColor:u.color+"40"}],children:[a&&$t(c,{size:n?10:12,color:u.color}),$t(p,{style:[ye.badgeOnlyText,n&&ye.badgeOnlyTextCompact,{color:u.color}],children:d})]}):Di(g,{testID:s,accessibilityLabel:`${u.label} ${t}`,style:[ye.container,n&&ye.containerCompact],children:[Di(g,{style:[ye.badge,n&&ye.badgeCompact,{backgroundColor:u.color+"20"}],children:[a&&$t(c,{size:n?8:10,color:u.color}),$t(p,{style:[ye.badgeText,n&&ye.badgeTextCompact,{color:u.color}],children:d})]}),$t(p,{testID:s?`${s}-value`:void 0,style:[ye.value,n&&ye.valueCompact],numberOfLines:1,children:t})]})}l(Ot,"IdentifierBadge");var ye=Ce.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{flexDirection:"row",alignItems:"center",paddingVertical:3,paddingHorizontal:6,borderRadius:4,gap:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5,gap:3},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},value:{fontSize:12,color:Sc.color.text,fontFamily:xc,flex:1},valueCompact:{fontSize:11},badgeOnly:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,borderRadius:6,borderWidth:1,gap:5},badgeOnlyCompact:{paddingVertical:2,paddingHorizontal:6,borderRadius:4,gap:4},badgeOnlyText:{fontSize:11,fontWeight:"600"},badgeOnlyTextCompact:{fontSize:9,fontWeight:"700"},valueOnly:{fontSize:12,fontFamily:xc},valueOnlyCompact:{fontSize:11},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCount:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCountText:{fontSize:10,fontWeight:"600"}});j();function pt(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}l(pt,"identifierSlug");function Pi(e){return`buoy-highlight-row-${pt(e)}`}l(Pi,"renderRowTestID");function Ni(e,t){return`buoy-highlight-detected-${pt(e)}-${pt(t)}`}l(Ni,"detectedItemTestID");function Li(e,t,n){return`buoy-highlight-${e}-chip-${pt(t)}-${pt(n)}`}l(Li,"patternChipTestID");function ft(e){return`buoy-highlight-setting-${e}`}l(ft,"settingTestID");import{Fragment as zi,jsx as w,jsxs as M}from"react/jsx-runtime";var fn=l(e=>Ic[e],"getFilterConfig"),hg=["any","viewType","testID","nativeID","component","accessibilityLabel"];function Bi({mode:e,onSelect:t,onCancel:n}){return M(g,{nativeID:"__rn_buoy__type-picker",testID:`buoy-highlight-${e}-types`,style:y.typePicker,children:[w(g,{style:y.typePickerRow,children:hg.map(o=>{let r=fn(o),i=r.icon;return M(Y,{testID:`buoy-highlight-${e}-type-${o.toLowerCase()}`,accessibilityRole:"button",accessibilityLabel:r.label,style:[y.typeOption,{backgroundColor:r.color+"15",borderColor:r.color+"40"}],onPress:()=>t(o),children:[w(i,{size:14,color:r.color}),w(p,{style:[y.typeOptionText,{color:r.color}],children:r.label})]},o)})}),w(Y,{testID:`buoy-highlight-${e}-types-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:n,style:y.typePickerCancel,children:w(po,{size:16,color:R.color.textTertiary})})]})}l(Bi,"TypePicker");function Vi({mode:e,type:t,onSubmit:n,onCancel:o}){let[r,i]=ht(""),a=fn(t),s=l(()=>{r.trim()&&n(r.trim())},"handleSubmit");return M(g,{nativeID:"__rn_buoy__pattern-input",testID:`buoy-highlight-${e}-input-row`,style:y.patternInputContainer,children:[w(Ot,{type:t,value:"",badgeOnly:true,compact:true}),w(Nn,{testID:`buoy-highlight-${e}-input`,value:r,onChangeText:i,onSubmitEditing:s,placeholder:"Enter pattern...",placeholderTextColor:R.color.placeholder,style:y.patternInput,autoFocus:true,returnKeyType:"done",autoCorrect:false,autoCapitalize:"none"}),r.trim()&&w(Y,{testID:`buoy-highlight-${e}-submit`,accessibilityRole:"button",accessibilityLabel:"Add pattern",onPress:s,style:[y.addPatternButton,{backgroundColor:a.color+"20"}],children:w(p,{style:[y.addPatternButtonText,{color:a.color}],children:"Add"})}),w(Y,{testID:`buoy-highlight-${e}-input-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:o,style:y.cancelButton,children:w(po,{size:16,color:R.color.textTertiary})})]})}l(Vi,"PatternInput");function Ai({mode:e,pattern:t,onRemove:n}){let o=fn(t.type);return M(Y,{testID:Li(e,t.type,t.value),accessibilityRole:"button",accessibilityLabel:`${o.label} ${t.value}, tap to remove`,style:[y.patternChip,{borderColor:o.color+"40"}],onPress:n,activeOpacity:.7,children:[w(g,{style:[y.patternChipBadge,{backgroundColor:o.color+"20"}],children:w(p,{style:[y.patternChipBadgeText,{color:o.color}],children:o.shortLabel})}),w(p,{style:y.patternChipValue,numberOfLines:1,children:t.value}),w(po,{size:12,color:R.color.textTertiary,style:y.patternChipX})]})}l(Ai,"PatternChip");var gg={label:"All",shortLabel:"All",color:R.color.textSecondary,icon:Tc};function mt({filterType:e,count:t,isSelected:n,onPress:o}){let r=e==="all"?gg:fn(e),i=`buoy-highlight-detected-cat-${String(e).toLowerCase()}`;return M(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${r.label}, ${t}`,style:[y.categoryBadge,{backgroundColor:r.color+"15",borderColor:n?r.color:r.color+"40",borderWidth:n?2:1}],onPress:o,children:[w(r.icon,{size:12,color:r.color}),w(p,{style:[y.categoryBadgeText,{color:r.color}],children:r.label}),w(g,{style:[y.categoryBadgeCountBubble,{backgroundColor:r.color+"25"}],children:w(p,{testID:`${i}-count`,style:[y.categoryBadgeCount,{color:r.color}],children:t})})]})}l(mt,"DetectedCategoryBadge");var pg=[{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:150,label:"150"},{value:250,label:"250"},{value:500,label:"500"}],Ei=[{value:"off",label:"Off",description:"No debug logging"},{value:"minimal",label:"Minimal",description:"Only hook value changes"},{value:"verbose",label:"Verbose",description:"Component + cause + changes"},{value:"all",label:"All",description:"Full fiber dump"}];function Hi({filters:e,onFilterChange:t,settings:n,onSettingsChange:o,availableProps:r,activeTab:i}){let[a,s]=ht(false),[u,c]=ht(false),[d,h]=ht(null),[T,m]=ht(null),[b,f]=ht("all"),[S,v]=ht(null),L=l(x=>{switch(x){case"viewType":return r.viewTypes.map(z=>({value:z,type:"viewType"}));case"testID":return r.testIDs.map(z=>({value:z,type:"testID"}));case"nativeID":return r.nativeIDs.map(z=>({value:z,type:"nativeID"}));case"component":return r.componentNames.map(z=>({value:z,type:"component"}));case"accessibilityLabel":return r.accessibilityLabels.map(z=>({value:z,type:"accessibilityLabel"}));case"all":default:return[...r.viewTypes.map(z=>({value:z,type:"viewType"})),...r.testIDs.map(z=>({value:z,type:"testID"})),...r.nativeIDs.map(z=>({value:z,type:"nativeID"})),...r.componentNames.map(z=>({value:z,type:"component"})),...r.accessibilityLabels.map(z=>({value:z,type:"accessibilityLabel"}))]}},"getItemsForCategory")(b),P=r.viewTypes.length+r.testIDs.length+r.nativeIDs.length+r.componentNames.length+r.accessibilityLabels.length,C=gt((x,z)=>{let ue=[...e.includePatterns,{type:x,value:z}];t({includePatterns:ue}),h(null)},[e.includePatterns,t]),I=gt((x,z)=>{let ue=[...e.excludePatterns,{type:x,value:z}];t({excludePatterns:ue}),m(null)},[e.excludePatterns,t]),k=gt(x=>{let z=e.includePatterns.filter((ue,pe)=>pe!==x);t({includePatterns:z})},[e.includePatterns,t]),W=gt(x=>{let z=e.excludePatterns.filter((ue,pe)=>pe!==x);t({excludePatterns:z})},[e.excludePatterns,t]),X=gt((x,z)=>{v({type:x,value:z})},[]),V=gt(()=>{S&&(C(S.type,S.value),v(null))},[S,C]),U=gt(()=>{S&&(I(S.type,S.value),v(null))},[S,I]);return w(g,{style:y.container,children:w(Me,{keyboardShouldPersistTaps:"handled",nativeID:"__rn_buoy__filter-view",testID:"buoy-highlight-filter-scroll",style:y.scrollView,contentContainerStyle:y.scrollContent,showsVerticalScrollIndicator:false,children:i==="filters"?M(zi,{children:[M(g,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:vc,color:R.color.accent,size:12}),w(te.Title,{children:"INCLUDE ONLY"}),e.includePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-include-count",count:e.includePatterns.length,color:R.color.accent})]}),w(p,{style:y.sectionDescription,children:"Show only components matching these patterns. If any are set, components must match at least one."}),e.includePatterns.length>0&&w(g,{style:y.patternChips,children:e.includePatterns.map((x,z)=>w(Ai,{mode:"include",pattern:x,onRemove:()=>k(z)},`${x.type}-${x.value}-${z}`))}),w(g,{style:y.addPatternRow,children:a?w(Bi,{mode:"include",onSelect:x=>{s(false),h(x)},onCancel:()=>s(false)}):d?w(Vi,{mode:"include",type:d,onSubmit:x=>C(d,x),onCancel:()=>h(null)}):M(Y,{testID:"buoy-highlight-include-add",accessibilityRole:"button",accessibilityLabel:"Add include pattern",style:[y.addButton,{borderColor:R.color.accentBorderStrong}],onPress:()=>s(true),children:[w(Cc,{size:14,color:R.color.accent}),w(p,{style:[y.addButtonText,{color:R.color.accent}],children:"Add include pattern"})]})})]}),M(g,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:Ri,color:R.color.accent,size:12}),w(te.Title,{children:"EXCLUDE"}),e.excludePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-exclude-count",count:e.excludePatterns.length,color:R.color.accent})]}),w(p,{style:y.sectionDescription,children:"Hide components matching these patterns from the list."}),e.excludePatterns.length>0&&w(g,{style:y.patternChips,children:e.excludePatterns.map((x,z)=>w(Ai,{mode:"exclude",pattern:x,onRemove:()=>W(z)},`${x.type}-${x.value}-${z}`))}),w(g,{style:y.addPatternRow,children:u?w(Bi,{mode:"exclude",onSelect:x=>{c(false),m(x)},onCancel:()=>c(false)}):T?w(Vi,{mode:"exclude",type:T,onSubmit:x=>I(T,x),onCancel:()=>m(null)}):M(Y,{testID:"buoy-highlight-exclude-add",accessibilityRole:"button",accessibilityLabel:"Add exclude pattern",style:[y.addButton,{borderColor:R.color.accentBorderStrong}],onPress:()=>c(true),children:[w(Cc,{size:14,color:R.color.accent}),w(p,{style:[y.addButtonText,{color:R.color.accent}],children:"Add exclude pattern"})]})})]}),M(g,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:ag,color:R.color.warning,size:12}),w(te.Title,{children:"RENDER COUNT RANGE"}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&w(te.Badge,{count:1,color:R.color.warning})]}),w(p,{style:y.sectionDescription,children:"Show only components with render count in a specific range."}),M(g,{nativeID:"__rn_buoy__render-count-range",testID:"buoy-highlight-range",style:y.renderCountRangeContainer,children:[M(g,{style:y.renderCountInputRow,children:[M(g,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Min"}),w(Nn,{value:e.minRenderCount!==void 0?String(e.minRenderCount):"",onChangeText:x=>{let z=parseInt(x,10);x===""||x===void 0?t({minRenderCount:void 0}):!isNaN(z)&&z>=0&&t({minRenderCount:z})},testID:"buoy-highlight-range-min",placeholder:"0",placeholderTextColor:R.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]}),w(p,{style:y.renderCountSeparator,children:"to"}),M(g,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Max"}),w(Nn,{value:e.maxRenderCount!==void 0?String(e.maxRenderCount):"",onChangeText:x=>{let z=parseInt(x,10);x===""||x===void 0?t({maxRenderCount:void 0}):!isNaN(z)&&z>=0&&t({maxRenderCount:z})},testID:"buoy-highlight-range-max",placeholder:"\u221E",placeholderTextColor:R.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]})]}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&M(Y,{testID:"buoy-highlight-range-clear",accessibilityRole:"button",accessibilityLabel:"Clear range",style:y.clearRangeButton,onPress:()=>t({minRenderCount:void 0,maxRenderCount:void 0}),children:[w(po,{size:12,color:R.color.warning}),w(p,{style:y.clearRangeButtonText,children:"Clear Range"})]})]})]}),M(g,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:Tc,color:R.color.textSecondary,size:12}),w(te.Title,{children:"DETECTED ITEMS"})]}),w(p,{style:y.sectionDescription,children:"Tap an item to quickly add it as an exclude pattern."}),M(Me,{keyboardShouldPersistTaps:"handled",horizontal:true,showsHorizontalScrollIndicator:false,style:y.categoryBadgeScroll,contentContainerStyle:y.categoryBadgeScrollContent,children:[P>0&&w(mt,{filterType:"all",count:P,isSelected:b==="all",onPress:()=>f("all")}),r.viewTypes.length>0&&w(mt,{filterType:"viewType",count:r.viewTypes.length,isSelected:b==="viewType",onPress:()=>f("viewType")}),r.testIDs.length>0&&w(mt,{filterType:"testID",count:r.testIDs.length,isSelected:b==="testID",onPress:()=>f("testID")}),r.nativeIDs.length>0&&w(mt,{filterType:"nativeID",count:r.nativeIDs.length,isSelected:b==="nativeID",onPress:()=>f("nativeID")}),r.componentNames.length>0&&w(mt,{filterType:"component",count:r.componentNames.length,isSelected:b==="component",onPress:()=>f("component")}),r.accessibilityLabels.length>0&&w(mt,{filterType:"accessibilityLabel",count:r.accessibilityLabels.length,isSelected:b==="accessibilityLabel",onPress:()=>f("accessibilityLabel")})]}),w(g,{nativeID:"__rn_buoy__detected-items",testID:"buoy-highlight-detected",style:y.detectedItemsContainer,children:L.length>0?w(Me,{keyboardShouldPersistTaps:"handled",testID:"buoy-highlight-detected-scroll",style:y.detectedItemsScroll,contentContainerStyle:y.detectedItems,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:L.map(x=>{let z=fn(x.type);return w(Y,{testID:Ni(x.type,x.value),accessibilityRole:"button",accessibilityLabel:`${z.label} ${x.value}`,style:[y.detectedItem,{borderColor:z.color+"40"}],onPress:()=>X(x.type,x.value),children:b==="all"?w(Ot,{type:x.type,value:x.value,compact:true,shortLabel:true}):w(p,{style:y.detectedItemText,numberOfLines:1,children:x.value})},`${x.type}-${x.value}`)})}):w(p,{testID:"buoy-highlight-detected-empty",style:y.emptyText,children:"No items detected yet. Start tracking to see components here."})})]}),w(dl,{visible:S!==null,transparent:true,animationType:"fade",onRequestClose:()=>v(null),children:w(cl,{accessible:false,testID:"buoy-highlight-detected-popup-backdrop",style:y.modalOverlay,onPress:()=>v(null),children:w(g,{accessible:false,testID:"buoy-highlight-detected-popup",style:y.actionPopup,children:S&&M(zi,{children:[w(g,{style:y.actionPopupHeader,children:w(Ot,{type:S.type,value:S.value,compact:true,shortLabel:true})}),M(g,{style:y.actionPopupButtons,children:[M(Y,{testID:"buoy-highlight-detected-popup-include",accessibilityRole:"button",accessibilityLabel:"Include only",style:[y.actionPopupButton,y.actionPopupInclude],onPress:V,children:[w(vc,{size:16,color:R.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:R.color.accent}],children:"Include Only"})]}),M(Y,{testID:"buoy-highlight-detected-popup-exclude",accessibilityRole:"button",accessibilityLabel:"Exclude",style:[y.actionPopupButton,y.actionPopupExclude],onPress:U,children:[w(Ri,{size:16,color:R.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:R.color.accent}],children:"Exclude"})]})]}),w(Y,{testID:"buoy-highlight-detected-popup-cancel",accessibilityRole:"button",accessibilityLabel:"Cancel",style:y.actionPopupCancel,onPress:()=>v(null),children:w(p,{style:y.actionPopupCancelText,children:"Cancel"})})]})})})}),M(g,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:Ri,color:R.color.textTertiary,size:12}),w(te.Title,{children:"HOW FILTERS WORK"})]}),w(g,{style:y.howItWorks,children:M(p,{style:y.howItWorksText,children:[w(p,{style:y.howItWorksBold,children:"Any:"})," Matches against all fields",`
|
|
33
33
|
`,w(p,{style:y.howItWorksBold,children:"ViewType:"})," Native component class (RCTView, RCTText)",`
|
|
34
34
|
`,w(p,{style:y.howItWorksBold,children:"testID:"})," Component testID prop",`
|
|
35
|
-
`,w(p,{style:y.howItWorksBold,children:"Component:"})," React component name from fiber"]})})]})]}):w(
|
|
36
|
-
`,'Requires "Show Render Count" to be enabled.']})]})]})
|
|
37
|
-
`,'Requires "Track Render Causes" to be enabled.']})]})]})
|
|
38
|
-
`,"The highlight overlay is always excluded to prevent infinite loops."]})]})]})]})]})})})})}s(zi,"HighlightFilterView");var y=Ce.create({container:{flex:1,backgroundColor:"transparent"},scrollView:{flex:1},scrollContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:32},section:{backgroundColor:R.color.surface,borderRadius:8,borderWidth:1,borderColor:R.color.border,marginBottom:12,overflow:"hidden"},sectionDescription:{fontSize:11,color:R.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:16},patternChips:{flexDirection:"row",flexWrap:"wrap",gap:8,paddingHorizontal:16,paddingTop:12},patternChip:{flexDirection:"row",alignItems:"center",backgroundColor:R.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:4,paddingLeft:4,paddingRight:6,maxWidth:"100%",gap:4},patternChipBadge:{paddingVertical:2,paddingHorizontal:5,borderRadius:4},patternChipBadgeText:{fontSize:9,fontWeight:"700"},patternChipValue:{fontSize:11,color:R.color.text,fontFamily:$t,flexShrink:1},patternChipX:{marginLeft:2},addPatternRow:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},addButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderStyle:"dashed",gap:6},addButtonText:{fontSize:12,fontWeight:"500"},typePicker:{flexDirection:"row",alignItems:"center",gap:8},typePickerRow:{flex:1,flexDirection:"row",flexWrap:"wrap",gap:8},typeOption:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,borderWidth:1,backgroundColor:R.color.surfaceElevated,gap:6},typeOptionText:{fontSize:11,fontWeight:"600"},typePickerCancel:{padding:8},patternInputContainer:{flexDirection:"row",alignItems:"center",backgroundColor:R.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:R.color.border,paddingLeft:4,paddingRight:8,paddingVertical:4,gap:4},patternInput:{flex:1,fontSize:12,color:R.color.text,paddingVertical:6,paddingHorizontal:4},addPatternButton:{paddingVertical:6,paddingHorizontal:10,borderRadius:4},addPatternButtonText:{fontSize:11,fontWeight:"600"},cancelButton:{padding:4},categoryBadgeScroll:{marginTop:12},categoryBadgeScrollContent:{paddingHorizontal:16,gap:8},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,borderWidth:1,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCountBubble:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCount:{fontSize:10,fontWeight:"600"},detectedItemsContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},detectedItemsScroll:{maxHeight:200},detectedItems:{flexDirection:"row",flexWrap:"wrap",gap:8},detectedItem:{flexDirection:"row",alignItems:"center",backgroundColor:R.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:6,paddingHorizontal:10,gap:6},detectedItemText:{fontSize:11,color:R.color.text,fontFamily:$t},emptyText:{fontSize:11,color:R.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:16,paddingHorizontal:16},howItWorks:{paddingHorizontal:16,paddingVertical:12},howItWorksText:{fontSize:11,color:R.color.textTertiary,lineHeight:18,fontFamily:$t},howItWorksBold:{fontWeight:"700",color:R.color.textSecondary},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:32},actionPopup:{backgroundColor:R.color.surface,borderRadius:12,borderWidth:1,borderColor:R.color.border,width:"100%",maxWidth:300,overflow:"hidden"},actionPopupHeader:{padding:16,borderBottomWidth:1,borderBottomColor:R.color.separator,alignItems:"center"},actionPopupButtons:{flexDirection:"row",padding:12,gap:8},actionPopupButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:12,borderRadius:8,gap:8},actionPopupInclude:{backgroundColor:R.color.accentSoft},actionPopupExclude:{backgroundColor:R.color.accentSoft},actionPopupButtonText:{fontSize:13,fontWeight:"600"},actionPopupCancel:{padding:12,borderTopWidth:1,borderTopColor:R.color.separator,alignItems:"center"},actionPopupCancelText:{fontSize:13,color:R.color.textTertiary,fontWeight:"500"},settingsSection:{paddingHorizontal:16,paddingTop:8,paddingBottom:16},settingItem:{gap:8},settingItemSpaced:{marginTop:16,paddingTop:16,borderTopWidth:1,borderTopColor:R.color.separator},settingHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},settingLabel:{fontSize:13,fontWeight:"600",color:R.color.text},settingValue:{backgroundColor:R.color.fillSecondary,paddingHorizontal:10,paddingVertical:4,borderRadius:6},settingValueText:{fontSize:12,fontWeight:"700",color:R.color.textTertiary,fontFamily:$t},settingDescription:{fontSize:11,color:R.color.textSecondary,lineHeight:16},settingDescriptionMuted:{fontSize:10,color:R.color.textTertiary,lineHeight:14,marginTop:4,fontStyle:"italic"},settingLabelDisabled:{color:R.color.textTertiary},settingWarning:{color:R.color.warning,fontWeight:"500"},batchSizePresets:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:4},batchSizePreset:{paddingVertical:8,paddingHorizontal:14,borderRadius:6,backgroundColor:R.color.surfaceElevated,borderWidth:1,borderColor:R.color.border},batchSizePresetActive:{backgroundColor:R.color.fillSecondary,borderColor:R.color.fillTertiary},batchSizePresetText:{fontSize:12,fontWeight:"500",color:R.color.textSecondary,fontFamily:$t},batchSizePresetTextActive:{color:R.color.textTertiary,fontWeight:"700"},renderCountRangeContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,gap:12},renderCountInputRow:{flexDirection:"row",alignItems:"center",gap:12},renderCountInputGroup:{flex:1,gap:4},renderCountLabel:{fontSize:10,fontWeight:"600",color:R.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},renderCountInput:{backgroundColor:R.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:R.color.border,paddingVertical:10,paddingHorizontal:12,fontSize:14,fontWeight:"600",color:R.color.text,fontFamily:$t,textAlign:"center"},renderCountSeparator:{fontSize:12,color:R.color.textTertiary,marginTop:18},clearRangeButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,backgroundColor:R.color.warningSoft,borderWidth:1,borderColor:R.color.warning+"40",gap:6,alignSelf:"center"},clearRangeButtonText:{fontSize:11,fontWeight:"600",color:R.color.warning}});j();import{useState as hg,useEffect as Sc,useRef as gg,useCallback as Bi,memo as pg,useMemo as xc}from"react";Ve();j();import fg,{useMemo as Ic}from"react";import{ChevronRight as mg,night as yt,useRelativeTime as yg,monoFont as Rc}from"@buoy-gg/shared-ui/web";import{jsx as Ne,jsxs as _t}from"react/jsx-runtime";function Dc({render:e,onPress:t}){let n=Ic(()=>e.testID?{type:"testID",value:e.testID}:e.nativeID?{type:"nativeID",value:e.nativeID}:e.componentName?{type:"component",value:e.componentName}:e.accessibilityLabel?{type:"accessibilityLabel",value:e.accessibilityLabel}:{type:"nativeTag",value:String(e.nativeTag)},[e.testID,e.nativeID,e.componentName,e.accessibilityLabel,e.nativeTag]),o=Ic(()=>e.accessibilityLabel&&n.type!=="accessibilityLabel"?{type:"accessibilityLabel",value:e.accessibilityLabel}:null,[e.accessibilityLabel,n.type]),r=yg(e.lastRenderTime),i=xi(n.value);return _t(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${e.displayName}, ${n.type} ${n.value}, ${e.renderCount} renders`,style:xe.container,onPress:()=>t(e),activeOpacity:.7,children:[Ne(g,{style:[xe.colorIndicator,{backgroundColor:e.color}]}),_t(g,{style:xe.content,children:[_t(g,{style:xe.topRow,children:[_t(g,{style:xe.viewTypeContainer,children:[Ne(p,{testID:`${i}-name`,style:xe.viewType,numberOfLines:1,children:e.displayName}),o?Ne(Ot,{type:o.type,value:o.value,compact:true,shortLabel:true}):e.displayName!==e.viewType?Ne(p,{testID:`${i}-type`,style:xe.nativeType,numberOfLines:1,children:e.viewType}):null]}),Ne(g,{style:[xe.renderCountBadge,{backgroundColor:e.color+"30"}],children:_t(p,{testID:`${i}-count`,style:[xe.renderCount,{color:e.color}],children:[e.renderCount,"x"]})})]}),e.lastRenderCause&&Ne(g,{style:xe.causeRow,children:Ne(ui,{testID:`${i}-cause`,cause:e.lastRenderCause,compact:true,showKeys:true,showTwoLevel:true})}),_t(g,{style:xe.bottomRow,children:[Ne(g,{style:xe.identifierContainer,children:Ne(Ot,{testID:`${i}-identifier`,type:n.type,value:n.value,compact:true,shortLabel:true})}),Ne(p,{testID:`${i}-time`,style:xe.timing,children:r})]})]}),Ne(mg,{size:16,color:yt.color.textTertiary})]})}s(Dc,"RenderListItemInner");var kc=fg.memo(Dc,(e,t)=>{let n=e.render,o=t.render;return n.id===o.id&&n.renderCount===o.renderCount&&n.color===o.color&&n.lastRenderTime===o.lastRenderTime&&n.lastRenderCause?.type===o.lastRenderCause?.type&&n.lastRenderCause?.componentCause===o.lastRenderCause?.componentCause&&e.onPress===t.onPress}),xe=Ce.create({container:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,marginHorizontal:12,marginBottom:6,backgroundColor:yt.color.surface,borderRadius:8,borderWidth:1,borderColor:yt.color.border},colorIndicator:{width:4,height:36,borderRadius:2,marginRight:10},content:{flex:1,marginRight:8},topRow:{flexDirection:"row",alignItems:"center",marginBottom:4},causeRow:{marginBottom:4},viewTypeContainer:{flex:1,marginRight:8},viewType:{fontSize:13,fontWeight:"600",color:yt.color.text},nativeType:{fontSize:10,color:yt.color.textTertiary,fontFamily:Rc,marginTop:1},accessibilityLabel:{fontSize:10,color:yt.color.accent,fontStyle:"italic",marginTop:1},renderCountBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:10},renderCount:{fontSize:11,fontWeight:"700",fontFamily:Rc},bottomRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},identifierContainer:{flex:1,flexShrink:1,overflow:"hidden"},timing:{fontSize:10,color:yt.color.textTertiary,fontWeight:"500",flexShrink:0}});import{Lock as bg,night as Vi,useLimit as vg,ToolEmptyState as Cg,resolveListEmptyState as Tg}from"@buoy-gg/shared-ui/web";import{jsx as mn,jsxs as Pc}from"react/jsx-runtime";function Nc({searchText:e,filters:t,onSelectRender:n,onStatsChange:o,onRendersChange:r,isTracking:i,isPro:a=false}){let[l,u]=hg(()=>B.getFilteredRenders(e)),c=gg(null);Sc(()=>B.subscribe(()=>{let v=B.getFilteredRenders(e);u(v),o(B.getStats()),r?.(v)}),[e,o,r]),Sc(()=>{let v=B.getFilteredRenders(e);u(v),r?.(v)},[e,t,r]);let d=vg("highlightUpdates.components"),h=a?1/0:d,T=xc(()=>l.slice(0,h),[l,h]),f=xc(()=>Math.max(0,l.length-h),[l.length,h]),b=Bi(v=>v.id,[]),m=Bi(({item:v,index:L})=>mn(kc,{render:v,onPress:()=>n(v,L,T)}),[n,T]),S=Bi(()=>f<=0?null:Pc(g,{testID:"buoy-highlight-locked",style:fo.lockedBanner,children:[mn(bg,{size:14,color:Vi.color.warning}),Pc(p,{testID:"buoy-highlight-locked-text",style:fo.lockedBannerText,children:[f," more ",f===1?"component":"components"," locked"]}),mn(p,{style:fo.lockedBannerSubtext,children:"Upgrade to Pro"})]}),[f]);if(l.length===0){let v=e.trim(),L=B.getStats().totalComponents,P=v?B.getFilteredRenders("").length:0,C=Tg({subject:"components",verb:"tracked",search:e,total:v?P:L,capturing:i,blocked:v&&P===0&&L>0?"The active filters hide everything tracked, so there is nothing to search.":void 0,waiting:{otto:"stare",title:"No renders tracked",message:"Component renders will appear here"},paused:{title:"No renders tracked",message:"Enable tracking to start capturing"}});return mn(Cg,{...C,testID:"buoy-highlight-empty"})}return mn(Za,{testID:"buoy-highlight-list",ref:c,data:T,renderItem:m,keyExtractor:b,contentContainerStyle:fo.listContent,showsVerticalScrollIndicator:true,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,ListFooterComponent:S})}s(Nc,"IsolatedRenderListInner");var wg=pg(Nc),fo=Ce.create({listContent:{paddingTop:8},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:16,marginTop:8,gap:8},lockedBannerText:{color:Vi.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:Vi.color.textTertiary,fontSize:12}});j();import{memo as Wt}from"react";import{Trash2 as Sg,Search as xg,Filter as Ig,Pause as Rg,Copy as Dg,ModalHeader as he,TabSelector as Lc,night as ge,PowerToggleButton as kg}from"@buoy-gg/shared-ui/web";j();import{useState as Pg,useEffect as Ng,memo as Lg}from"react";Ve();import{Activity as zg,night as mo,monoFont as Bg}from"@buoy-gg/shared-ui/web";import{jsx as zc,jsxs as Vg}from"react/jsx-runtime";function Bc(){let[e,t]=Pg({totalComponents:0,totalRenders:0});return Ng(()=>B.subscribe(()=>{t(B.getStats())}),[]),Vg(g,{nativeID:"__rn_buoy__stats-row",testID:"buoy-highlight-stats",accessibilityLabel:`${e.totalComponents} components tracked`,style:Vc.headerChip,children:[zc(zg,{size:12,color:mo.color.accent}),zc(p,{testID:"buoy-highlight-stats-value",style:[Vc.headerChipValue,{color:mo.color.accent}],children:e.totalComponents})]})}s(Bc,"StatsDisplayInner");var Ag=Lg(Bc),Vc=Ce.create({headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:mo.color.buttonSurface,paddingHorizontal:8,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:mo.color.border},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:Bg}});import{jsx as Q,jsxs as yn}from"react/jsx-runtime";var Eg=Wt(s(function({isActive:e,searchText:t,onSearchChange:n,onSearchClose:o}){return e?Q(he.Search,{value:t,onChangeText:n,onCancel:()=>{n(""),o()},onDismiss:o,dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search testID, nativeID, component...",accessibilityLabel:"Search renders",iconSize:14,testID:"buoy-highlight-search-field",containerTestID:"buoy-highlight-search-container",containerNativeID:"__rn_buoy__search-container",clearTestID:"buoy-highlight-search-clear"}):null},"SearchSection")),Hg=Eg,Fg=Wt(s(function({onSearchToggle:e,onFilterToggle:t,onToggleTracking:n,onToggleFreeze:o,onClear:r,onOpenCopySettings:i,isTracking:a,isFrozen:l,activeFilterCount:u,hasRenders:c}){return yn(he.Actions,{children:[Q(Y,{testID:"buoy-highlight-search",accessibilityRole:"button",accessibilityLabel:"Search renders",onPress:e,style:Be.headerActionButton,children:Q(xg,{size:14,color:ge.color.textSecondary})}),Q(Y,{testID:"buoy-highlight-filters",accessibilityRole:"button",accessibilityLabel:u>0?`Filters, ${u} active`:"Filters",onPress:t,style:[Be.headerActionButton,u>0&&Be.activeFilterButton],children:Q(Ig,{size:14,color:u>0?ge.color.accent:ge.color.textTertiary})}),Q(Y,{testID:"buoy-highlight-copy",accessibilityRole:"button",onPress:i,style:[Be.headerActionButton,!c&&Be.headerActionButtonDisabled],disabled:!c,accessibilityLabel:"Open copy settings",children:Q(Dg,{size:14,color:c?ge.color.textSecondary:ge.color.textTertiary})}),Q(Y,{testID:"buoy-highlight-freeze",accessibilityRole:"button",accessibilityLabel:l?"Unfreeze frame":"Freeze frame",onPress:o,style:[Be.headerActionButton,l&&Be.freezeButton,!a&&Be.headerActionButtonDisabled],disabled:!a,children:Q(Rg,{size:14,color:a?l?ge.color.accent:ge.color.textTertiary:ge.color.textTertiary})}),Q(kg,{testID:"buoy-highlight-power",isEnabled:a,onToggle:n,accessibilityLabel:"Toggle render tracking"}),Q(Y,{testID:"buoy-highlight-clear",accessibilityRole:"button",accessibilityLabel:"Clear tracked renders",onPress:r,style:[Be.headerActionButton,!c&&Be.headerActionButtonDisabled],disabled:!c,children:Q(Sg,{size:14,color:c?ge.color.textTertiary:ge.color.textTertiary})})]})},"HeaderActions")),$g=Fg,Mg=Wt(s(function({onBack:e,isSearchActive:t,searchText:n,onSearchChange:o,onSearchToggle:r,onSearchClose:i,onFilterToggle:a,onToggleTracking:l,onToggleFreeze:u,onClear:c,onOpenCopySettings:d,isTracking:h,isFrozen:T,activeFilterCount:f,hasRenders:b,searchInputRef:m}){return yn(he,{children:[e&&Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"",children:t?Q(Hg,{isActive:t,searchText:n,onSearchChange:o,onSearchClose:i,searchInputRef:m}):Q(Ag,{})}),Q($g,{onSearchToggle:r,onFilterToggle:a,onToggleTracking:l,onToggleFreeze:u,onClear:c,onOpenCopySettings:d,isTracking:h,isFrozen:T,activeFilterCount:f,hasRenders:b})]})},"MainListHeader")),Og=Wt(s(function({onBack:e,activeTab:t,onTabChange:n,activeFilterCount:o=0}){let r=[{key:"filters",label:`Filters${o>0?` (${o})`:""}`},{key:"settings",label:"Settings"}];return yn(he,{children:[Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"",noMargin:true,children:Q(Lc,{tabs:r,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-filter-tab"})}),Q(he.Actions,{})]})},"FilterViewHeader")),_g=Wt(s(function({onBack:e,activeTab:t,onTabChange:n,hasHistory:o=true}){let r=[{key:"details",label:"Details"},{key:"history",label:"History",disabled:!o}];return yn(he,{children:[Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"",noMargin:true,children:Q(Lc,{tabs:r,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-detail-tab"})}),Q(he.Actions,{})]})},"DetailViewHeader")),Wg=Wt(s(function({onBack:e}){return yn(he,{children:[Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"Copy Settings",testID:"buoy-highlight-copy-title"})]})},"CopySettingsViewHeader")),Be=Ce.create({headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:ge.color.buttonSurface,borderWidth:1,borderColor:ge.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},activeFilterButton:{backgroundColor:ge.color.accentSoft,borderColor:ge.color.accentBorderStrong},freezeButton:{backgroundColor:ge.color.accentSoft,borderColor:ge.color.accentBorderStrong}});j();import{useState as Ai,useCallback as yo,useMemo as bn}from"react";Ve();import{Clock as jg,GitBranch as Ug,Database as Ac,Lock as Gg,formatRelativeTime as Ec,SectionHeader as jt,EventStepperFooter as Hc,buoyColors as Fc,night as E,useLimit as $c,ToolEmptyState as Kg,monoFont as Ke}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as Mc}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as qg,jsx as F,jsxs as q}from"react/jsx-runtime";function bo(e){let t=new Date(e),n=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),r=t.getSeconds().toString().padStart(2,"0"),i=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${o}:${r}.${i}`}s(bo,"formatTimeWithMs");function Ei({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:o,isPro:r=false}){let[i,a]=Ai(0),l=n??i,u=o??a,[c,d]=Ai("current"),h=bn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((I,D)=>I.timestamp-D.timestamp),[e.renderHistory]),T=$c("highlightUpdates.historyEvents"),f=r?1/0:T,b=bn(()=>h.slice(-f),[h,f]),m=bn(()=>Math.max(0,h.length-f),[h.length,f]),S=b.length,v=b[l],L=l>0?b[l-1]:null,P=yo(()=>{l>0&&u(l-1)},[l,u]),C=yo(()=>{l<S-1&&u(l+1)},[l,S,u]);if(S===0){let I=B.getSettings().enableRenderHistory;return F(Kg,{testID:"buoy-highlight-history-empty",otto:I?"stare":"paused",title:"No Render History",message:I?"History is on and armed \u2014 this component has not re-rendered since. Interact with the app to record one.":"Enable render history tracking in settings to see render events here."})}return q(qg,{children:[q(g,{style:[k.container,{paddingBottom:!t&&S>1?80:0}],children:[m>0&&q(g,{testID:"buoy-highlight-history-locked",style:k.lockedBanner,children:[F(Gg,{size:14,color:E.color.warning}),q(p,{testID:"buoy-highlight-history-locked-text",style:k.lockedBannerText,children:[m," older ",m===1?"render":"renders"," locked"]}),F(p,{style:k.lockedBannerSubtext,children:"Upgrade to Pro"})]}),q(g,{style:k.viewToggleContainer,children:[q(Y,{testID:"buoy-highlight-history-mode-current",accessibilityRole:"button",accessibilityLabel:"Current state",style:[k.viewToggleCard,c==="current"&&k.viewToggleCardActive],onPress:()=>d("current"),activeOpacity:.8,children:[q(g,{style:k.viewToggleContent,children:[F(Ac,{size:16,color:c==="current"?E.color.accent:E.color.textSecondary}),F(p,{style:[k.viewToggleLabel,c==="current"&&k.viewToggleLabelActive],children:"CURRENT STATE"})]}),q(p,{style:[k.viewToggleDescription,c==="current"&&{color:E.color.text}],children:["View render #",v?.renderNumber??0," details"]})]}),q(g,{testID:"buoy-highlight-history-mode-diff",accessibilityLabel:"Diff view, coming soon",style:[k.viewToggleCard,k.viewToggleCardDisabled],children:[q(g,{style:k.viewToggleContent,children:[F(Ug,{size:16,color:E.color.textTertiary}),F(p,{style:[k.viewToggleLabel,k.viewToggleLabelDisabled],children:"DIFF VIEW"}),F(g,{style:k.todoBadge,children:F(p,{style:k.todoBadgeText,children:"TODO"})})]}),F(p,{style:[k.viewToggleDescription,{color:E.color.textTertiary}],children:"Compare renders side by side (coming soon)"})]})]}),F($e,{testID:"buoy-highlight-history-scroll",style:k.contentScroll,contentContainerStyle:k.contentContainer,showsVerticalScrollIndicator:false,children:c==="current"?F(Oc,{event:v,render:e}):F(_c,{previousEvent:L,currentEvent:v,render:e})})]}),!t&&F(Hc,{currentIndex:l,totalItems:S,onPrevious:P,onNext:C,itemLabel:"Render",subtitle:Ec(new Date(v?.timestamp??Date.now()))})]})}s(Ei,"RenderHistoryViewer");function Oc({event:e,render:t}){if(!e)return F(g,{testID:"buoy-highlight-history-no-event",style:k.noEventContainer,children:F(p,{style:k.noEventText,children:"No event selected"})});let n=Ge[e.cause.type];return q(g,{style:k.currentStateContainer,children:[q(g,{style:k.eventHeader,children:[q(g,{style:k.eventHeaderLeft,children:[q(p,{testID:"buoy-highlight-history-event-title",style:k.eventTitle,children:["Render #",e.renderNumber]}),F(p,{testID:"buoy-highlight-history-event-time",style:k.eventTime,children:bo(e.timestamp)})]}),q(g,{style:[k.eventBadge,{backgroundColor:t.color+"30"}],children:[F(g,{style:[k.eventBadgeDot,{backgroundColor:t.color}]}),F(p,{testID:"buoy-highlight-history-event-cause",style:[k.eventBadgeText,{color:t.color}],children:e.cause.type.toUpperCase()})]})]}),q(g,{style:k.section,children:[q(jt,{children:[F(jt.Icon,{icon:jg,color:n.color,size:12}),F(jt.Title,{children:"WHY DID THIS RENDER?"})]}),F(g,{style:k.sectionContent,children:F(di,{cause:e.cause,nativeType:t.viewType})})]}),e.capturedProps&&Object.keys(e.capturedProps).length>0&&q(g,{style:k.section,children:[q(jt,{children:[F(jt.Icon,{icon:Ac,color:E.color.accent,size:12}),F(jt.Title,{children:"CAPTURED PROPS"})]}),F(g,{style:k.sectionContent,children:F($e,{horizontal:true,showsHorizontalScrollIndicator:false,style:k.propsScrollView,children:F(p,{testID:"buoy-highlight-history-props",style:k.propsJson,children:JSON.stringify(e.capturedProps,null,2)})})})]})]})}s(Oc,"CurrentStateView");function _c({previousEvent:e,currentEvent:t,render:n}){let[o,r]=Ai("props");if(!e||!t)return F(g,{style:k.noEventContainer,children:F(p,{style:k.noEventText,children:"Select an event with a previous event to compare"})});let i=Ge[e.cause.type],a=Ge[t.cause.type],l=e.capturedProps&&t.capturedProps,u=e.capturedState&&t.capturedState;return q(g,{style:k.diffContainer,children:[q(g,{style:k.compareBar,children:[q(g,{style:k.compareSide,children:[q(g,{style:k.compareLabelRow,children:[F(p,{style:[k.compareLabel,{color:Fc.warning}],children:"PREV"}),F(g,{style:[k.compareActionBadge,{backgroundColor:`${i.color}20`}],children:F(p,{style:[k.compareActionText,{color:i.color}],children:e.cause.type.toUpperCase()})})]}),q(g,{style:k.compareMeta,children:[q(p,{style:k.compareIndex,children:["#",e.renderNumber]}),F(p,{style:k.compareTime,children:bo(e.timestamp)})]})]}),F(g,{style:k.compareDivider,children:F(p,{style:k.compareArrow,children:"\u2192"})}),q(g,{style:k.compareSide,children:[q(g,{style:k.compareLabelRow,children:[F(p,{style:[k.compareLabel,{color:Fc.success}],children:"CUR"}),F(g,{style:[k.compareActionBadge,{backgroundColor:`${a.color}20`}],children:F(p,{style:[k.compareActionText,{color:a.color}],children:t.cause.type.toUpperCase()})})]}),q(g,{style:k.compareMeta,children:[q(p,{style:k.compareIndex,children:["#",t.renderNumber]}),F(p,{style:k.compareTime,children:bo(t.timestamp)})]})]})]}),q(g,{style:k.diffModeTabs,children:[F(Y,{style:[k.diffModeTab,o==="cause"&&k.diffModeTabActive],onPress:()=>r("cause"),activeOpacity:.7,children:F(p,{style:[k.diffModeTabText,o==="cause"&&k.diffModeTabTextActive],children:"CAUSE"})}),F(Y,{style:[k.diffModeTab,o==="props"&&k.diffModeTabActive,!l&&k.diffModeTabDisabled],onPress:()=>l&&r("props"),activeOpacity:l?.7:1,children:F(p,{style:[k.diffModeTabText,o==="props"&&k.diffModeTabTextActive,!l&&k.diffModeTabTextDisabled],children:"PROPS"})}),F(Y,{style:[k.diffModeTab,o==="state"&&k.diffModeTabActive,!u&&k.diffModeTabDisabled],onPress:()=>u&&r("state"),activeOpacity:u?.7:1,children:F(p,{style:[k.diffModeTabText,o==="state"&&k.diffModeTabTextActive,!u&&k.diffModeTabTextDisabled],children:"STATE"})})]}),o==="cause"&&F(g,{style:k.diffSummary,children:F(di,{cause:t.cause,nativeType:n.viewType})}),o==="props"&&F(g,{style:k.treeDiffContainer,children:l?F(Mc,{oldValue:e.capturedProps,newValue:t.capturedProps,theme:"dark",showUnchanged:true}):q(g,{style:k.noDiffData,children:[F(p,{style:k.noDiffDataTitle,children:"Props Not Captured"}),F(p,{style:k.noDiffDataText,children:'Enable "Capture Props on Render" in settings to see props diff.'})]})}),o==="state"&&F(g,{style:k.treeDiffContainer,children:u?F(Mc,{oldValue:e.capturedState,newValue:t.capturedState,theme:"dark",showUnchanged:true}):q(g,{style:k.noDiffData,children:[F(p,{style:k.noDiffDataTitle,children:"State Not Captured"}),F(p,{style:k.noDiffDataText,children:'Enable "Capture State on Render" in settings to see state diff.'})]})})]})}s(_c,"DiffView");function Hi({render:e,selectedEventIndex:t=0,onEventIndexChange:n=s(()=>{},"onEventIndexChange"),isPro:o=false}){let r=bn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((T,f)=>T.timestamp-f.timestamp),[e.renderHistory]),i=$c("highlightUpdates.historyEvents"),a=o?1/0:i,l=bn(()=>r.slice(-a),[r,a]),u=l.length,c=l[t],d=yo(()=>{n(Math.max(0,t-1))},[t,n]),h=yo(()=>{n(Math.min(u-1,t+1))},[t,u,n]);return u<=1?null:F(Hc,{currentIndex:t,totalItems:u,onPrevious:d,onNext:h,itemLabel:"Render",subtitle:c?Ec(new Date(c.timestamp)):void 0})}s(Hi,"RenderHistoryFooter");var k=Ce.create({container:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:32,gap:12},emptyTitle:{fontSize:16,fontWeight:"600",color:E.color.text},emptyText:{fontSize:13,color:E.color.textSecondary,textAlign:"center",lineHeight:18},viewToggleContainer:{flexDirection:"row",padding:12,gap:8},viewToggleCard:{flex:1,backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:10,gap:4},viewToggleCardActive:{borderColor:E.color.accentBorderStrong,backgroundColor:E.color.accentSoft},viewToggleCardDisabled:{opacity:.5},todoBadge:{backgroundColor:E.color.fillSecondary,paddingHorizontal:6,paddingVertical:2,borderRadius:4,marginLeft:4},todoBadgeText:{fontSize:9,fontWeight:"700",color:E.color.textTertiary,letterSpacing:.3},viewToggleContent:{flexDirection:"row",alignItems:"center",gap:6},viewToggleLabel:{fontSize:10,fontWeight:"700",color:E.color.textSecondary,letterSpacing:.5},viewToggleLabelActive:{color:E.color.accent},viewToggleLabelDisabled:{color:E.color.textTertiary},viewToggleDescription:{fontSize:11,color:E.color.textTertiary,marginTop:2},contentScroll:{flex:1},contentContainer:{padding:12,paddingTop:0},noEventContainer:{padding:24,alignItems:"center"},noEventText:{fontSize:13,color:E.color.textTertiary},currentStateContainer:{gap:12},eventHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:12},eventHeaderLeft:{gap:2},eventTitle:{fontSize:15,fontWeight:"700",color:E.color.text},eventTime:{fontSize:11,color:E.color.textTertiary,fontFamily:Ke},eventBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4,borderRadius:12,gap:6},eventBadgeDot:{width:6,height:6,borderRadius:3},eventBadgeText:{fontSize:10,fontWeight:"700",fontFamily:Ke},section:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,overflow:"hidden"},sectionContent:{padding:12,paddingTop:8},causeContainer:{marginBottom:12},changedList:{marginBottom:12,paddingLeft:4},changedListTitle:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,marginBottom:6},changedItem:{fontSize:12,color:E.color.text,fontFamily:Ke,marginBottom:3,paddingLeft:8},propsScrollView:{maxHeight:150},propsJson:{fontSize:11,fontFamily:Ke,color:E.color.text,backgroundColor:E.color.bg,padding:10,borderRadius:6},diffContainer:{gap:12},compareBar:{flexDirection:"row",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:10},compareSide:{flex:1,gap:4},compareLabelRow:{flexDirection:"row",alignItems:"center",gap:8},compareLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5},compareActionBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},compareActionText:{fontSize:9,fontWeight:"600"},compareMeta:{flexDirection:"row",alignItems:"center",gap:6},compareIndex:{fontSize:12,fontWeight:"600",color:E.color.text},compareTime:{fontSize:10,color:E.color.textTertiary,fontFamily:Ke},compareDivider:{width:30,alignItems:"center",justifyContent:"center"},compareArrow:{fontSize:16,color:E.color.textTertiary},diffSummary:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:12},diffSummaryTitle:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,marginBottom:8},diffChanges:{gap:4},diffChangeItem:{flexDirection:"row",alignItems:"center",gap:6},diffChangeIcon:{fontSize:12,fontWeight:"700",color:E.color.warning,fontFamily:Ke},diffChangeKey:{fontSize:12,color:E.color.text,fontFamily:Ke},diffNoChanges:{fontSize:12,color:E.color.textTertiary,fontStyle:"italic"},diffPlaceholder:{fontSize:12,color:E.color.textTertiary,fontStyle:"italic",textAlign:"center",padding:16},diffModeTabs:{flexDirection:"row",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:4,gap:4},diffModeTab:{flex:1,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center"},diffModeTabActive:{backgroundColor:E.color.accentSoft},diffModeTabDisabled:{opacity:.4},diffModeTabText:{fontSize:10,fontWeight:"600",color:E.color.textSecondary,letterSpacing:.5},diffModeTabTextActive:{color:E.color.accent},diffModeTabTextDisabled:{color:E.color.textTertiary},causeDiffContainer:{gap:8,marginBottom:12},causeDiffRow:{flexDirection:"row",alignItems:"center",gap:8},causeDiffLabel:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,minWidth:80},causeDiffValue:{fontSize:12,color:E.color.text,fontFamily:Ke,fontWeight:"500"},diffChangesTitle:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,marginBottom:6},treeDiffContainer:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,overflow:"hidden",minHeight:150},noDiffData:{padding:24,alignItems:"center",gap:8},noDiffDataTitle:{fontSize:13,fontWeight:"600",color:E.color.text},noDiffDataText:{fontSize:12,color:E.color.textTertiary,textAlign:"center",lineHeight:18},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,marginHorizontal:12,marginTop:8,backgroundColor:E.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:E.color.warning+"30",gap:8},lockedBannerText:{color:E.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:E.color.textTertiary,fontSize:12}});j();import{useCallback as Ut,useEffect as Jg,useMemo as vo,useState as Wc}from"react";import{DynamicFilterView as Yg,macOSColors as Fi,night as $i,FileText as jc,FileCode as Uc,Zap as Gc,Settings as Xg,Eye as Qg,Layers as Zg,ToolbarCopyButton as ep,ExportPreview as tp,monoFont as np}from"@buoy-gg/shared-ui/web";j();var Mi={format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},Kc={llm:{format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},table:{format:"markdown-table",topN:50,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},json:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},full:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:false,sortBy:"renderCount",includeHistory:true}};function qc(e){for(let[t,n]of Object.entries(Kc))if(Object.keys(n).every(o=>{let r=e[o],i=n[o];return Array.isArray(r)&&Array.isArray(i)?r.length===i.length&&r.every((a,l)=>a===i[l]):r===i}))return t;return null}s(qc,"detectActivePreset");var De={llm:{label:"LLM",description:"Compact summary for AI",color:"#10B981"},table:{label:"Table",description:"Markdown table",color:"#3B82F6"},json:{label:"JSON",description:"Structured data",color:"#F59E0B"},full:{label:"Full",description:"Everything incl. history",color:"#6B7280"}};j();import{definePersistedSetting as op,devToolsStorageKeys as rp}from"@buoy-gg/shared-ui/web";var Jc=op(rp.highlightUpdates.copySettings(),Mi,{sanitize:s((e,t)=>({...e,filterCauses:t?.filterCauses??Mi.filterCauses}),"sanitize")});async function Yc(e){await Jc.save(e)}s(Yc,"saveCopySettings");async function Xc(){return Jc.loadOrNull()}s(Xc,"loadCopySettings");import{Fragment as ip,jsx as Gt,jsxs as ap}from"react/jsx-runtime";var lp=50*1024,sp=200*1024,cp=[{value:"mount",label:"Mount"},{value:"props",label:"Props"},{value:"hooks",label:"Hooks"},{value:"state",label:"State"},{value:"parent",label:"Parent"},{value:"context",label:"Context"},{value:"unknown",label:"Unknown"}];function Qc(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}s(Qc,"formatBytes");function Zc(){let e=Date.now();return[{id:"1",nativeTag:1,viewType:"RCTView",displayName:"View",componentName:"PokemonListItem",renderCount:30,firstRenderTime:e-5e3,lastRenderTime:e,color:"#10B981",lastRenderCause:{type:"parent",timestamp:e,componentCause:"parent"}},{id:"2",nativeTag:2,viewType:"RCTView",displayName:"View",componentName:"CartHeader",renderCount:12,firstRenderTime:e-4e3,lastRenderTime:e,color:"#3B82F6",lastRenderCause:{type:"hooks",timestamp:e,componentCause:"state",hookChanges:[{type:"useState",index:2,previousValue:4,currentValue:5}]}},{id:"3",nativeTag:3,viewType:"RCTView",displayName:"View",componentName:"SearchBar",renderCount:8,firstRenderTime:e-3e3,lastRenderTime:e,color:"#F59E0B",lastRenderCause:{type:"props",timestamp:e,componentCause:"props",changedKeys:["query","onChange"]}}]}s(Zc,"createMockRenders");function eu({renders:e}){let[t,n]=Wc(Mi),[o,r]=Wc(false);Jg(()=>{let v=true;return Xc().then(L=>{v&&L&&n(L)}),()=>{v=false}},[]);let i=Ut(v=>{n(v),Yc(v)},[]),a=e.length>0,l=a?e:Zc(),u=vo(()=>qc(t),[t]),c=vo(()=>uc(l,t),[l,t]),d=vo(()=>c>=sp?"danger":c>=lp?"warning":"none",[c]),h=Ut(()=>ho(l,t),[l,t]),T=Ut(v=>{let L=Kc[v];L&&i({...L,filterCauses:[...L.filterCauses]})},[i]),f=Ut((v,L)=>{let[P,C]=v.split("::");if(P==="preset"){T(C);return}if(P==="format"){i({...t,format:L});return}if(P==="sort"){i({...t,sortBy:L});return}if(P==="topN"){i({...t,topN:L});return}if(P==="minRenders"){i({...t,minRenders:L});return}if(P==="cause"){let I=L,D=t.filterCauses.includes(I);i({...t,filterCauses:D?t.filterCauses.filter(W=>W!==I):[...t.filterCauses,I]});return}if(P==="signal"){let I=C;i({...t,[I]:!t[I]});return}},[t,i,T]),b=Ut(()=>{let{totalComponents:v,totalRenders:L}=vi(l);return Gt(tp,{expanded:o,onExpandedChange:r,summary:`${v} component${v!==1?"s":""} \xB7 ${L} renders \xB7 ~${Qc(c)}${a?"":" (mock data)"}`,warningLevel:d,warningText:{warning:"Large payload \u2014 preview may be slow",danger:"Very large payload \u2014 try a smaller topN or turn off history"},testIDs:{expand:"buoy-highlight-copy-preview-show",collapse:"buoy-highlight-copy-preview-hide",summary:"buoy-highlight-copy-preview-summary",warning:"buoy-highlight-copy-size-warning"},renderBody:()=>{let P=h();return Gt($e,{testID:"buoy-highlight-copy-preview-scroll",style:Oi.previewScroll,nestedScrollEnabled:true,children:Gt(p,{testID:"buoy-highlight-copy-preview-text",style:Oi.previewText,selectable:true,children:P})})}})},[o,l,c,d,a,h]),m=Ut(()=>{let{totalComponents:v}=vi(l),L=a?`${v} components`:"Mock data (no renders captured)";return ap(ip,{children:[Gt(p,{testID:"buoy-highlight-copy-status",style:Oi.statusLabel,children:L}),Gt(ep,{value:h})]})},[a,l,h]),S=vo(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:De.llm.label,icon:Gc,color:De.llm.color,value:"llm",isActive:u==="llm",description:De.llm.description},{id:"preset::table",label:De.table.label,icon:jc,color:De.table.color,value:"table",isActive:u==="table",description:De.table.description},{id:"preset::json",label:De.json.label,icon:Uc,color:De.json.color,value:"json",isActive:u==="json",description:De.json.description},{id:"preset::full",label:De.full.label,icon:Zg,color:De.full.color,value:"full",isActive:u==="full",description:De.full.description},{id:"preset::custom",label:"Custom",icon:Xg,color:$i.color.textSecondary,value:"custom",isActive:u===null,description:"User-configured"}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::summary",label:"Summary",icon:Gc,color:Fi.semantic.success,value:"summary",isActive:t.format==="summary",description:"Compact, LLM-ready"},{id:"format::markdown-table",label:"Table",icon:jc,color:Fi.semantic.info,value:"markdown-table",isActive:t.format==="markdown-table",description:"Markdown table"},{id:"format::json",label:"JSON",icon:Uc,color:Fi.semantic.warning,value:"json",isActive:t.format==="json",description:"Structured data"}]},{id:"sort",title:"Sort By",type:"custom",data:[{id:"sort::renderCount",label:"Count",value:"renderCount",isActive:t.sortBy==="renderCount",description:"Total renders"},{id:"sort::rate",label:"Rate",value:"rate",isActive:t.sortBy==="rate",description:"Renders / sec"},{id:"sort::name",label:"Name",value:"name",isActive:t.sortBy==="name",description:"Alphabetical"}]},{id:"topN",title:"Top N",type:"custom",data:[{id:"topN::10",label:"10",value:10,isActive:t.topN===10},{id:"topN::25",label:"25",value:25,isActive:t.topN===25},{id:"topN::50",label:"50",value:50,isActive:t.topN===50},{id:"topN::100",label:"100",value:100,isActive:t.topN===100},{id:"topN::-1",label:"All",value:-1,isActive:t.topN===-1}]},{id:"minRenders",title:"Min Renders",type:"custom",data:[{id:"minRenders::1",label:"1",value:1,isActive:t.minRenders===1},{id:"minRenders::2",label:"2",value:2,isActive:t.minRenders===2},{id:"minRenders::3",label:"3",value:3,isActive:t.minRenders===3},{id:"minRenders::5",label:"5",value:5,isActive:t.minRenders===5},{id:"minRenders::10",label:"10",value:10,isActive:t.minRenders===10}]},{id:"causes",title:"Filter Causes",type:"custom",description:t.filterCauses.length===0?"All causes shown":"Only the selected causes shown",data:cp.map(v=>({id:`cause::${v.value}`,label:v.label,value:v.value,isActive:t.filterCauses.includes(v.value)}))},{id:"signal",title:"Signal Extraction",type:"custom",data:[{id:"signal::groupByName",label:"Group by name",value:"groupByName",isActive:t.groupByName,description:"Collapse list items"},{id:"signal::aggregateCauses",label:"Aggregate causes",value:"aggregateCauses",isActive:t.aggregateCauses,description:"Hook x N"},{id:"signal::includeHistory",label:"Include history",value:"includeHistory",isActive:t.includeHistory,description:"JSON only \u2014 large"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:Qg,content:b,headerActions:m},onFilterChange:f}),[t,u,f,b,m]);return Gt(Yg,{...S})}s(eu,"RendersCopySettingsView");var Oi=Ce.create({previewScroll:{maxHeight:360},previewText:{fontFamily:np,fontSize:11,color:$i.color.text,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:$i.color.textTertiary,marginRight:8}});import{Fragment as up,jsx as ne,jsxs as _i}from"react/jsx-runtime";var dp=Mh.memo(s(function(){return _i(g,{testID:"buoy-highlight-disabled-banner",style:vn.disabledBanner,children:[ne(Oh,{size:14,color:Ht.color.warning}),ne(p,{testID:"buoy-highlight-disabled-text",style:vn.disabledText,children:"Render tracking is disabled"})]})},"DisabledBanner"));function Co({visible:e,onClose:t,onBack:n,onMinimize:o,enableSharedModalDimensions:r=false,initialNativeTag:i,onInitialNativeTagHandled:a,onRenderSelect:l,inline:u=false}){let c=jh(),[d,h]=de(false),[T,f]=de(()=>H.getFrozen()),[b,m]=de(()=>B.getStats().totalComponents>0),[S,v]=de(null),[L,P]=de(0),[C,I]=de(false),[D,W]=de(false),[X,V]=de([]),[U,x]=de("filters"),[z,ue]=de("details"),[pe,Fe]=de(0),[be,Ho]=de(""),[xt,Jt]=de(false),ra=ut(null),Yt=ut([]),ia=ut(B.getFilters()),[Fo,aa]=de(()=>{let _=B.getFilters();return _.includePatterns.length+_.excludePatterns.length}),[ve,la]=de(()=>B.getFilters()),[$o,sa]=de(()=>B.getSettings()),ca=ut(false),Mo=ut(false),xn=ut(false);Re(()=>{!e||ca.current||(ca.current=true)},[e]),Re(()=>{if(!e||Mo.current)return;s(async()=>{try{let _=await so.getItem(Et.highlightUpdates.filters());if(_){let G=JSON.parse(_),ie={includeTestID:new Set(G.includeTestID||[]),includeNativeID:new Set(G.includeNativeID||[]),includeViewType:new Set(G.includeViewType||[]),includeComponent:new Set(G.includeComponent||[]),excludeTestID:new Set(G.excludeTestID||[]),excludeNativeID:new Set(G.excludeNativeID||[]),excludeViewType:new Set(G.excludeViewType||[]),excludeComponent:new Set(G.excludeComponent||[]),includePatterns:G.includePatterns||[],excludePatterns:G.excludePatterns||[]};B.setFilters(ie);let ze=B.getFilters();ia.current=ze,la(ze),aa(ze.includePatterns.length+ze.excludePatterns.length)}Mo.current=true}catch{}},"loadFilters")()},[e]),Re(()=>{if(!Mo.current)return;s(async()=>{try{let _={includeTestID:Array.from(ve.includeTestID),includeNativeID:Array.from(ve.includeNativeID),includeViewType:Array.from(ve.includeViewType),includeComponent:Array.from(ve.includeComponent),excludeTestID:Array.from(ve.excludeTestID),excludeNativeID:Array.from(ve.excludeNativeID),excludeViewType:Array.from(ve.excludeViewType),excludeComponent:Array.from(ve.excludeComponent),includePatterns:ve.includePatterns,excludePatterns:ve.excludePatterns};await so.setItem(Et.highlightUpdates.filters(),JSON.stringify(_))}catch{}},"saveFilters")()},[ve]),Re(()=>{if(!e||xn.current)return;s(async()=>{try{let _=await so.getItem(Et.highlightUpdates.settings());if(_){let G=JSON.parse(_),{performanceLogging:ie,excludeDevTools:ze,...Ye}=G;B.setSettings(Ye),sa(B.getSettings())}xn.current=true}catch{xn.current=true}},"loadSettings")()},[e]),Re(()=>{if(!xn.current)return;s(async()=>{try{let{performanceLogging:_,excludeDevTools:G,...ie}=$o;await so.setItem(Et.highlightUpdates.settings(),JSON.stringify(ie))}catch{}},"saveSettings")()},[$o]),Re(()=>{let _=B.subscribeToState(G=>{h(G.isTracking)});return()=>{_()}},[]),Re(()=>{let _=H.subscribeToFreeze(G=>{f(G)});return()=>{_()}},[]),Re(()=>{xt&&requestAnimationFrame(()=>{ra.current?.focus()})},[xt]),Re(()=>{e||H.setSpotlight(null)},[e]),Re(()=>{if(e&&i!=null){let _=B.getRender(String(i));_&&(v(_),P(0),I(false),H.setSpotlight(_.nativeTag)),a?.()}},[e,i,a]);let ua=oe(()=>{H.isInitialized()||H.initialize(),H.toggle()},[]),da=oe(()=>{H.toggleFreeze()},[]),ha=oe(()=>{H.clearRenderCounts(),m(false)},[]),ga=oe(()=>{V(B.getFilteredRenders(be)),W(true)},[be]),pa=oe(()=>{W(false)},[]),fa=oe(_=>{Ho(_)},[]),Zu=oe((_,G,ie)=>{v(_),P(G),ue("details"),Fe(0),Yt.current=ie,H.setSpotlight(_.nativeTag)},[]);Re(()=>{if(!S)return;let _=String(S.nativeTag);return B.subscribe(()=>{let G=B.getRender(_);G&&v({...G})})},[S?.nativeTag]);let ma=ut(null);Re(()=>{!l||!S||ma.current!==S.nativeTag&&(ma.current=S.nativeTag,l(S))},[S,l]);let ed=oe(_=>{Yt.current=_},[]),ya=oe(()=>{v(null),P(0),be&&Jt(true),H.setSpotlight(null)},[be]),td=oe(()=>{let _=Yt.current;if(L>0){let G=L-1,ie=_[G];ie&&(v(ie),P(G),H.setSpotlight(ie.nativeTag))}},[L]),nd=oe(()=>{let _=Yt.current;if(L<_.length-1){let G=L+1,ie=_[G];ie&&(v(ie),P(G),H.setSpotlight(ie.nativeTag))}},[L]),ba=oe(()=>{I(false)},[]),va=oe(()=>{I(true)},[]),Ca=oe(()=>{Jt(true)},[]),Ta=oe(()=>{Jt(false)},[]),Oo=oe(_=>{B.setFilters(_);let G=B.getFilters();ia.current=G,la(G),aa(G.includePatterns.length+G.excludePatterns.length)},[]),od=oe((_,G)=>{let ie=B.getFilters(),ze={};G==="include"?ie.includePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(ze.includePatterns=[...ie.includePatterns,_]):ie.excludePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(ze.excludePatterns=[...ie.excludePatterns,_]),Object.keys(ze).length>0&&(Oo(ze),v(null),P(0),H.setSpotlight(null))},[Oo]),rd=oe(_=>{B.setSettings(_),sa(B.getSettings())},[]),id=oe(_=>{m(_.totalComponents>0)},[]),wa=oe(()=>D?ne(Wg,{onBack:pa}):C?ne(Og,{onBack:ba,activeTab:U,onTabChange:x,activeFilterCount:Fo}):S?ne(_g,{onBack:ya,activeTab:z,onTabChange:ue,hasHistory:(S.renderHistory?.length??0)>0}):ne(Mg,{onBack:n,isSearchActive:xt,searchText:be,onSearchChange:fa,onSearchToggle:Ca,onSearchClose:Ta,onFilterToggle:va,onToggleTracking:ua,onToggleFreeze:da,onClear:ha,onOpenCopySettings:ga,isTracking:d,isFrozen:T,activeFilterCount:Fo,hasRenders:b,searchInputRef:ra}),[D,C,S,n,xt,be,d,T,Fo,b,U,z,ba,ya,pa,fa,Ca,Ta,va,ua,da,ha,ga]),ad=r?Et.modal.root():Et.highlightUpdates.modal();if(!e)return null;let ld=Yt.current.length,Sa=S?z==="details"?ne(tg,{currentIndex:L,totalItems:ld,onPrevious:td,onNext:nd,itemLabel:"Component",subtitle:S.componentName||S.displayName||S.viewType}):ne(Hi,{render:S,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:c}):null,xa=ne(g,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:vn.container,children:D?ne(eu,{renders:X}):S?z==="details"?ne(Ci,{render:S,disableInternalFooter:true,onAddFilter:od,isPro:c}):ne(Ei,{render:S,disableInternalFooter:true,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:c}):C?ne(zi,{filters:ve,onFilterChange:Oo,settings:$o,onSettingsChange:rd,availableProps:B.getAvailableProps(),activeTab:U}):_i(up,{children:[H.getRenderSourceStatus()==="unavailable"?ne(p,{style:{color:Ht.color.warning,padding:16},children:"Not in this app"}):!d&&ne(dp,{}),ne(wg,{searchText:be,filters:ve,onSelectRender:Zu,onStatsChange:id,onRendersChange:ed,isTracking:d,isPro:c})]})});return u?ne(Xs,{children:_i(g,{style:vn.inlineRoot,children:[ne(g,{style:vn.inlineHeader,...Wh,children:wa()}),xa,Sa]})}):ne(Xs,{children:ne(_h,{visible:e,onClose:t,onMinimize:o,persistenceKey:ad,header:{showToggleButton:true,customContent:wa()},enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Qa.OS==="web",styles:{},footer:Sa,footerHeight:S&&(z==="details"||(S.renderHistory?.length??0)>1)?68:0,children:xa})})}s(Co,"HighlightUpdatesModal");function tu(e={}){return ne(Co,{...e,inline:true,visible:true,onClose:()=>{}})}s(tu,"HighlightToolView");var vn=Ce.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Ht.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:Ht.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:Ht.color.warning+"20"},disabledText:{color:Ht.color.warning,fontSize:11,flex:1}});import{jsx as Cn}from"react/jsx-runtime";function nu({size:e}){let[t,n]=Ko(()=>H.isEnabled());return qo(()=>H.subscribe(o=>{n(o)}),[]),Cn(Oa,{size:e,color:t?"#10b981":"#6b7280"})}s(nu,"HighlightIcon");function Wi(){return null}s(Wi,"EmptyComponent");function ji(e){let[t,n]=Ko(null);qo(()=>(e.visible&&H.setBadgePressCallback(r=>{n(r)}),()=>{e.visible||H.setBadgePressCallback(null)}),[e.visible]);let o=pd(()=>{n(null)},[]);return Cn(Co,{...e,initialNativeTag:t,onInitialNativeTagHandled:o})}s(ji,"HighlightUpdatesModalWithBadgeNavigation");var hp={id:"highlight-updates",name:"TOGGLE HIGHLIGHT",description:"Toggle component render highlights",slot:"row",icon:nu,component:Wi,props:{},launchMode:"toggle-only",onPress:s(()=>{H.isInitialized()||H.initialize(),H.toggle()},"onPress")};function ou(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";e?.autoInitialize&&setTimeout(()=>{H.initialize()},1e3);let o=s(({size:r})=>{let[i,a]=Ko(()=>H.isEnabled());return qo(()=>H.subscribe(l=>{a(l)}),[]),Cn(Oa,{size:r,color:i?t:n})},"CustomHighlightIcon");return{id:e?.id||"highlight-updates",name:e?.name||"TOGGLE HIGHLIGHT",description:e?.description||"Toggle component render highlights",slot:"row",icon:o,component:Wi,props:{},launchMode:"toggle-only",onPress:s(()=>{H.isInitialized()||H.initialize(),H.toggle()},"onPress")}}s(ou,"createHighlightUpdatesTool");var gp={id:"highlight-updates-modal",name:"HIGHLIGHT",description:"View component render tracking modal",slot:"both",icon:s(({size:e})=>Cn(Ma,{size:e}),"icon"),component:ji,props:{enableSharedModalDimensions:false}};function ru(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";return e?.autoInitialize&&setTimeout(()=>{H.initialize()},1e3),{id:e?.id||"highlight-updates-modal",name:e?.name||"HIGHLIGHT",description:e?.description||"View component render tracking modal",slot:"both",icon:s(({size:o})=>Cn(Ma,{size:o,color:t}),"icon"),component:ji,props:{enableSharedModalDimensions:false}}}s(ru,"createHighlightUpdatesModalTool");j();j();import{getDOMFiber as pp,getDOMNodeHandle as Ui}from"@buoy-gg/shared-ui/web/utils";var fp=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","Pressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","TextInput","Switch","ActivityIndicator","Modal","SafeAreaView","SafeAreaProvider","KeyboardAvoidingView","VirtualizedList","Screen","ScreenContainer","ScreenStack","ScreenContentWrapper","GestureHandlerRootView","GestureDetector","Wrapper"]);function To(e){let t=e.return,n=t?.elementType??t?.type;return t&&n?.$$typeof===Symbol.for("react.memo")&&(n.type===e.type||n.type===e.elementType)?t:null}s(To,"memoParent");function wo(e){let t="",n=e.tag===14||e.tag===15,o=e.tag===11,r=new Set,i=s(l=>{!l||r.has(l)||r.size>20||(r.add(l),t||(t=l.displayName||(typeof l=="function"?l.name:"")),l.$$typeof===Symbol.for("react.memo")&&(n=true,i(l.type)),l.$$typeof===Symbol.for("react.forward_ref")&&(o=true,i(l.render)))},"visit");i(e.elementType),i(e.type);let a=To(e);return a&&i(a.elementType??a.type),{name:t||"Anonymous",memo:n,forwardRef:o}}s(wo,"typeInfo");function Gi(e){if(!e||typeof e.type=="string"||![0,1,2,11,14,15].includes(e.tag))return false;let{name:t}=wo(e),n=e._debugSource?.fileName??"";return!fp.has(t)&&!/^(Animated|RCT|Reanimated|Buoy|DevTools|FloatingDevTools|HighlightUpdates)/.test(t)&&!/[@/]buoy-gg\/|\/react-native\//.test(n)&&!e.memoizedProps?.__buoyDevToolsRoot}s(Gi,"isUserComponent");function iu(e){let t=wo(e),n=To(e),o=e._debugSource??n?._debugSource;if(typeof o?.fileName=="string"&&o.fileName)t.source={fileName:o.fileName},Number.isFinite(o.lineNumber)&&(t.source.lineNumber=o.lineNumber),Number.isFinite(o.columnNumber)&&(t.source.columnNumber=o.columnNumber);else{let r=e._debugStack??n?._debugStack;typeof r?.stack=="string"&&(t.rawStack=r.stack)}return t}s(iu,"entry");function au(e){let t=e.child?[e.child]:[],n=0;for(;t.length&&n++<300;){let o=t.shift();if(o._debugOwner===e){let r=o._debugSource;if(typeof r?.fileName=="string"&&r.fileName)return{source:{fileName:r.fileName,...Number.isFinite(r.lineNumber)?{lineNumber:r.lineNumber}:{},...Number.isFinite(r.columnNumber)?{columnNumber:r.columnNumber}:{}}};if(typeof o._debugStack?.stack=="string")return{rawStack:o._debugStack.stack}}o.child&&t.push(o.child),o.sibling&&t.push(o.sibling)}}s(au,"definitionOf");async function lu(e,t){let n=globalThis[Symbol.for("buoy.dom.componentSource")];if(!n||typeof document>"u")return{found:false,reason:"This page's framework doesn't report where its components live."};let o=cr().filter(a=>!a.buoy).map(a=>a.element),r;if(e!=null&&(r=o.find(a=>Ui(a)===e)),!r&&t){let a=t.toLowerCase();for(let l of o){let u=n(l);if(!u?.found)continue;let c=[u.component,...u.owners],d=c.findIndex(h=>h.name.toLowerCase()===a);if(d>=0)return{found:true,component:c[d],owners:c.slice(d+1),sourceKind:"definition"}}if(!r){let l=(await ln({})).elements.map(u=>({el:u,score:Lt(u,{query:t})})).filter(({score:u})=>u>0).sort((u,c)=>c.score-u.score)[0]?.el;l?.nativeTag!=null&&(r=o.find(u=>Ui(u)===l.nativeTag))}}if(!r)return{found:false,reason:"No view matched. Check describe_screen for its name or tag."};let i=n(r);return i?.found?{...i,sourceKind:"definition"}:i??{found:false,reason:"No app component was found for this view."}}s(lu,"domComponentSource");function su(e){let t=[],n=null,o=new Set,r=e;for(;r&&!o.has(r)&&o.size<400&&t.length<7;){o.add(r),Gi(r)&&(t.length||(n=r),t.push(iu(r)));let a=To(r);r=r._debugOwner||a?._debugOwner||a?.return||r.return,a&&r===a&&(r=a._debugOwner||a.return)}if(!t.length)return{found:false,reason:"No app component was found for this view."};let i=n?au(n):void 0;return{found:true,component:i?{...t[0],definedIn:i}:t[0],owners:t.slice(1)}}s(su,"sourceFromFiber");function cu(e){return e?.canonical?.internalInstanceHandle||e?._internalInstanceHandle||e?._internalFiberInstanceHandleDEV||pp(e)||null}s(cu,"fiberFromStateNode");function uu(e){return Ui(e)??e?.__nativeTag??e?._nativeTag??e?.nativeTag??e?.canonical?.__nativeTag??e?.canonical?._nativeTag??e?.canonical?.nativeTag??null}s(uu,"nativeTag");var mp=1e5;function du(e){let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__,n=[],o=s(a=>{try{t?.getFiberRoots?.(a)?.forEach(l=>n.push(l.current))}catch{}},"addRoots");t?.renderers?.forEach((a,l)=>o(l)),n.length||o(1);let r=[...n],i=new Set;for(;r.length;){if(i.size>=mp)return{fiber:null,capped:true,any:true};let a=r.pop();if(!a||i.has(a))continue;i.add(a),a.sibling&&r.push(a.sibling);let l=a.memoizedProps??{};if(!(a.tag===22&&a.memoizedState!=null||l.__buoyDevToolsRoot||l.activityState===0||l.activityState===1||l.isPageFocused===false||l["aria-hidden"]===true&&(l.activityState!==void 0||"shouldFreeze"in l)||l.isFocused===false&&(l.routeKey!==void 0||"freezeContents"in l))){if(e(a))return{fiber:a,capped:false,any:true};a.child&&r.push(a.child)}}return{fiber:null,capped:false,any:n.length>0}}s(du,"findLiveFiber");async function hu(e={}){try{let{nativeTag:t,query:n}=e??{};if(t!==void 0&&(!Number.isInteger(t)||t<0)||n!==void 0&&typeof n!="string")return{found:false,reason:"Pass a valid nativeTag or a text query."};let o=n?.trim();if(t==null&&!o)return{found:false,reason:"Pass a query or nativeTag."};let r=false,i=false,a=s(c=>{let d=du(c);return r||(r=d.capped),i||(i=d.any),d.fiber??void 0},"find"),l=s(c=>a(d=>d.stateNode&&uu(d.stateNode)===c),"byTag"),u=t!=null?l(t):void 0;if(t==null&&o&&(u=a(c=>Gi(c)&&wo(c).name.toLowerCase()===o.toLowerCase()),!u)){let c=(await ln({})).elements.map(d=>({el:d,score:Lt(d,{query:o})})).filter(({score:d})=>d>0).sort((d,h)=>h.score-d.score)[0]?.el;c?.nativeTag!=null&&(u=l(c.nativeTag))}return!u&&!i?lu(t,o):u?su(cu(u.stateNode)??u):{found:false,reason:r?"The React tree is too big to search fully, and no view matched in the part searched. Pass the nativeTag from describe_screen.":"No view matched. Check describe_screen for its name or tag."}}catch{return{found:false,reason:"Could not read the React tree. Try again in a dev build."}}}s(hu,"getComponentSource");Ve();j();j();import{resolveDOMEventEmitter as yp}from"@buoy-gg/shared-ui/web/utils";var bp=14,vp=550,Cp=4e3,Tp=8e3,gu=600,Ki=null,pu=false,qi=null,So=[],qe="idle",Je=[],Ji=0,Le=null;function fu(){if(pu)return Ki;pu=true;let e=yp();return Ki=e.emitter,qi=e.reason,Ki}s(fu,"getEmitter");function bt(e){return typeof e=="number"&&Number.isFinite(e)?e:null}s(bt,"num");function Yi(e){let t=e?.nativeEvent;return t?bt(t.target)??bt(t.tag):null}s(Yi,"tagOf");function xo(e){let t=e?.nativeEvent;if(!t)return null;let n={x:bt(t.pageX),y:bt(t.pageY)};if(n.x!==null&&n.y!==null)return{x:n.x,y:n.y};for(let o of["changedTouches","touches"]){let r=t[o];if(Array.isArray(r)&&r.length){let i=r[0],a=bt(i?.pageX),l=bt(i?.pageY);if(a!==null&&l!==null)return{x:a,y:l}}}return null}s(xo,"pointOf");function Xi(e){Je.push({...e,seq:++Ji}),Je.length>gu&&(Je=Je.slice(-gu))}s(Xi,"push");function mu(e){let t=Yi(e);if(t===null)return;let n=xo(e),o=null;try{o=Wn(t)}catch{}Le={tag:t,x:n?.x??0,y:n?.y??0,t:Date.now(),drift:0,target:o}}s(mu,"onTouchStart");function yu(e){if(!Le)return;let t=xo(e);if(!t)return;let n=t.x-Le.x,o=t.y-Le.y;Le.drift=Math.max(Le.drift,Math.sqrt(n*n+o*o))}s(yu,"onTouchMove");function bu(e){let t=Le;if(Le=null,!t||!t.target)return;let n=xo(e);if(n){let r=n.x-t.x,i=n.y-t.y;t.drift=Math.max(t.drift,Math.sqrt(r*r+i*i))}if(t.drift>bp)return;let o=Date.now()-t.t;o>Cp||t.target.control!=="text"&&(t.target.control==="toggle"||t.target.control==="slider"||Xi({t:Date.now(),kind:o>=vp?"longPress":"press",target:t.target}))}s(bu,"onTouchEnd");function vu(){Le=null}s(vu,"onTouchCancel");function Io(e){let t=Yi(e);if(t===null)return;let n=e.nativeEvent,o,r;if(typeof n.text=="string")o="text",r=n.text;else if(typeof n.value=="boolean")o="toggle",r=n.value;else if(typeof n.value=="number")o="slider",r=n.value;else return;let i=Je[Je.length-1];if(i&&i.kind===o&&i.target.nativeTag===t&&Date.now()-i.t<Tp){i.value=r,i.t=Date.now();return}let a=null;try{a=Wn(t)}catch{}a&&Xi({t:Date.now(),kind:o,target:a,value:r})}s(Io,"onChange");function Cu(){if(qe==="capturing")return Kt();let e=fu();if(!e)return qe="unavailable",Kt();try{So=[e.addListener("topTouchStart",mu),e.addListener("topTouchMove",yu),e.addListener("topTouchEnd",bu),e.addListener("topTouchCancel",vu),e.addListener("topChange",Io),e.addListener("topValueChange",Io),e.addListener("topSlidingComplete",Io)],Le=null,qe="capturing"}catch(t){So=[],qe="unavailable",qi=t?.message??"addListener failed"}return Kt()}s(Cu,"startTouchCapture");function Tu(){So.forEach(e=>{try{e.remove()}catch{}}),So=[],Le=null,qe==="capturing"&&(qe="idle")}s(Tu,"stopTouchCapture");function wu(){Je=[],Ji=0}s(wu,"clearTouchCapture");function Kt(){return{status:qe,reason:qe==="unavailable"?qi:null}}s(Kt,"getTouchCaptureStatus");function Su(e=0){return{...Kt(),records:Je.filter(t=>t.seq>e),seq:Ji}}s(Su,"readTouchCapture");j();var xu=0,Iu=1,Ru=11,Du=14,ku=15,Ro=1,wp=1e4,Sp=300,xp=20,Pu=false,Tn=false,Qi=false,Do=false,ko=0,vt=0,Po=0,Ct={},Tt=new Map;function Zi(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}s(Zi,"getHook");function No(e){let t=e.flags??e.effectTag;return typeof t=="number"?t:0}s(No,"getFlags");function ea(e){return e===xu||e===Iu||e===Ru||e===Du||e===ku}s(ea,"isCompositeTag");function Lo(e){let t=e.type;try{switch(e.tag){case xu:case Iu:return t?.displayName||t?.name||"Anonymous";case Ru:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case Du:case ku:{let n=t?.type??e.elementType?.type;return t?.displayName||n?.displayName||n?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}s(Lo,"getComponentName");function Nu(e){let t=e.actualDuration;if(typeof t!="number")return null;let n=t;for(let o=e.child;o!=null;o=o.sibling)typeof o.actualDuration=="number"&&(n-=o.actualDuration);return n>0?n:0}s(Nu,"computeSelfMs");var Ip=new Set(["View","Text","Image","ImageBackground","ScrollView","FlatList","SectionList","SafeAreaView","KeyboardAvoidingView","StatusBar","ActivityIndicator","RefreshControl","Modal","Switch","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","PressabilityDebugView","AnimatedComponent","Wrapper"]),Lu=["Animated(","Pressability","Virtualized","CellRenderer"];function ta(e){if(Ip.has(e))return true;for(let t=0;t<Lu.length;t++)if(e.startsWith(Lu[t]))return true;return false}s(ta,"isFrameworkWrapperName");var zu=40,Bu=5;function Vu(e,t){if(Object.is(e,t))return true;let n=typeof e;if(n!==typeof t)return false;if(n==="function")return true;if(e===null||t===null||n!=="object")return false;let o=Array.isArray(e);if(o!==Array.isArray(t))return false;if(o){if(e.length!==t.length)return false;for(let a=0;a<e.length;a++)if(!Object.is(e[a],t[a]))return false;return true}let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return false;for(let a=0;a<r.length;a++){let l=r[a];if(!Object.prototype.hasOwnProperty.call(t,l)||!Object.is(e[l],t[l]))return false}return true}s(Vu,"isEquivalentValue");function Au(e,t){let n=e.alternate;if(!n)return{cause:"mount"};let o=e.memoizedProps,r=n.memoizedProps;if(o!==r&&o&&r){let i=false,a=false,l,u=Object.keys(o),c=u.length<zu?u.length:zu;for(let d=0;d<c;d++){let h=u[d],T=r[h],f=o[h];if(!Object.is(T,f)&&(i=true,t&&(l||(l=[]),l.length<Bu&&l.push(h)),!Vu(T,f)&&(a=true,!t)))break}if(!a&&Object.keys(r).length!==u.length&&(i=true,a=true),i)return{cause:a?"props":"propsUnstable",changedKeys:l}}return jl(n,e)?{cause:"hooks"}:{cause:"parent"}}s(Au,"detectCause");function Eu(e){for(let t=e.return;t!=null;t=t.return){if(!ea(t.tag)||(No(t)&Ro)===0)continue;let n=Lo(t);if(!ta(n))return n}}s(Eu,"nearestRenderedAncestorName");function Hu(e,t){let n=Lo(e),o=Nu(e);o!==null&&(Qi=true);let r=o??0;vt+=1,Po+=r;let{cause:i,changedKeys:a}=Au(e,Do);if(Ct[i]=(Ct[i]??0)+1,ta(n))return;let l=Tt.get(n);if(!l){if(Tt.size>=Sp)return;l={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}},Tt.set(n,l)}if(l.renders+=1,l.totalSelfMs+=r,r>l.maxSelfMs&&(l.maxSelfMs=r),l.causes[i]=(l.causes[i]??0)+1,Do){if(a){l.changedProps||(l.changedProps=new Set);for(let u=0;u<a.length&&!(l.changedProps.size>=Bu);u++)l.changedProps.add(a[u])}t&&!l.parentName&&(l.parentName=t)}}s(Hu,"recordRender");function Fu(e){let t=e?.current;if(!t)return;let n=vt,o=0,r=t;for(;r!=null&&(o+=1,!(o>wp));){let i=false,a=ea(r.tag);if(r.memoizedProps?.__buoyDevToolsRoot||r.memoizedProps?.["data-buoy-root"]!==void 0)i=true;else if(a){let l=Lo(r);ms(l)?i=true:fs(l)||(No(r)&Ro)!==0&&Hu(r,Do?Eu(r):void 0)}if(!i){let l=r.subtreeFlags;if(!(typeof l=="number"&&(l&Ro)===0&&(No(r)&Ro)===0)&&r.child!=null){r=r.child;continue}}for(;r!=null;){if(r===t)return na(n);if(r.sibling!=null){r=r.sibling;break}r=r.return}}na(n)}s(Fu,"handleCommit");function na(e){vt>e&&(ko+=1)}s(na,"finalizeCommit");function $u(){if(Pu)return true;let e=Zi();if(!e)return false;let t=e.onCommitFiberRoot;return e.onCommitFiberRoot=function(n,o,...r){if(Tn)try{Fu(o)}catch{}return typeof t=="function"?t.call(e,n,o,...r):void 0},Pu=true,true}s($u,"ensureHookInstalled");function Mu(){if(typeof ee<"u"&&!ee)return false;let e=Zi();return!!(e&&e.renderers&&e.renderers.size>0)}s(Mu,"isSupported");function Ou(){return Tn}s(Ou,"isCapturing");function _u(e){$u()&&(Tt=new Map,Qi=false,Do=e?.detail===true,ko=0,vt=0,Po=0,Ct={},Tn=true)}s(_u,"startCapture");function Wu(){if(!Tn&&vt===0&&Tt.size===0)return null;Tn=false;let e=Array.from(Tt.entries()).sort((n,o)=>{let r=o[1].totalSelfMs-n[1].totalSelfMs;return r!==0?r:o[1].renders-n[1].renders}).slice(0,xp).map(([n,o])=>({name:n,renders:o.renders,totalMs:wn(o.totalSelfMs),maxMs:wn(o.maxSelfMs),avgMs:o.renders>0?wn(o.totalSelfMs/o.renders):0,causes:o.causes,...o.changedProps&&o.changedProps.size>0?{changedProps:Array.from(o.changedProps)}:null,...o.parentName?{parentName:o.parentName}:null})),t={totalCommits:ko,totalRenders:vt,capturedDurations:Qi,totalRenderMs:wn(Po),wastedRenders:(Ct.parent??0)+(Ct.propsUnstable??0),causes:Ct,topComponents:e};return Tt=new Map,ko=0,vt=0,Po=0,Ct={},t}s(Wu,"stopCapture");function wn(e){return Math.round(e*100)/100}s(wn,"round2");var wt={isSupported:Mu,isCapturing:Ou,startCapture:_u,stopCapture:Wu};function Sn(){H.isInitialized()||H.initialize()}s(Sn,"ensureInitialized");function zo(e){if(!e)return;let{hookChanges:t,...n}=e;return n}s(zo,"toWireCause");function ju(e){let{renderHistory:t,lastRenderCause:n,...o}=e;return{...o,lastRenderCause:zo(n),historyCount:t?.length??0}}s(ju,"toWireRender");function Uu(e){try{return JSON.stringify(e),e}catch{return{...e,lastRenderCause:zo(e.lastRenderCause),renderHistory:e.renderHistory?.map(t=>({...t,capturedProps:void 0,capturedState:void 0,cause:zo(t.cause)??t.cause}))}}}s(Uu,"jsonSafeRender");function Gu(){let e=globalThis[Symbol.for("buoy.framework.renderCapture")];return e&&typeof e.start=="function"&&e.isSupported()?e:null}s(Gu,"frameworkCapture");var Bo=null;function Ku(){if(wt.isSupported())return wt.startCapture({detail:true}),Bo="react",{ok:true};let e=Gu();return e?(e.start(),Bo=e,{ok:true}):{ok:false,reason:"render capture needs a dev build with the React DevTools hook available"}}s(Ku,"beginMeasurement");function qu(){let e=Bo;return Bo=null,e&&e!=="react"?{summary:e.stop()}:{summary:wt.stopCapture()}}s(qu,"endMeasurement");var Rp={version:3,getSnapshot:s(()=>({enabled:H.isEnabled(),frozen:H.getFrozen(),highlightsSuppressed:H.getHighlightsSuppressed(),renders:B.getRenders().map(ju),trackerState:B.getState()}),"getSnapshot"),subscribe:s(e=>{let t=H.subscribe(e),n=H.subscribeToFreeze(e),o=B.subscribe(e),r=B.subscribeToState(e);return()=>{t(),n(),o(),r()}},"subscribe"),actions:{getComponentSource:s(async e=>{try{return await hu(e)}catch(t){return{found:false,reason:`Could not read the component's source: ${t instanceof Error?t.message:String(t)}`}}},"getComponentSource"),beginMeasurement:s(()=>Ku(),"beginMeasurement"),endMeasurement:s(()=>qu(),"endMeasurement"),getRenderDetail:s(e=>{let{nativeTag:t}=e??{};if(t==null)return{found:false,reason:"missing nativeTag"};let n=B.getRender(String(t));return n?{found:true,nativeTag:t,render:Uu(n)}:{found:false,reason:"unknown nativeTag"}},"getRenderDetail"),toggle:s(()=>{Sn(),H.toggle()},"toggle"),setEnabled:s(e=>{Sn(),H.setEnabled(e.enabled)},"setEnabled"),toggleFreeze:s(()=>{H.toggleFreeze()},"toggleFreeze"),clearRenderCounts:s(()=>{H.clearRenderCounts()},"clearRenderCounts"),setSpotlight:s(e=>{H.setSpotlight(e.nativeTag)},"setSpotlight"),locateComponent:s(e=>(Sn(),H.locateComponent(e??{})),"locateComponent"),setSilentTracking:s(e=>{Sn(),H.setSilentTracking(e.enabled??false)},"setSilentTracking"),describeScreen:s(e=>ln(e??{}),"describeScreen"),tapElement:s(e=>Dl(e??{}),"tapElement"),waitFor:s(e=>kl(e??{}),"waitFor"),hitTest:s(e=>Ol(e??{x:.5,y:.5}),"hitTest"),readMaps:s(()=>_l(),"readMaps"),startTouchCapture:s(()=>Cu(),"startTouchCapture"),stopTouchCapture:s(()=>(Tu(),Kt()),"stopTouchCapture"),clearTouchCapture:s(()=>(wu(),{ok:true}),"clearTouchCapture"),readTouchCapture:s(e=>Su(e?.sinceSeq??0),"readTouchCapture")}};j();import{useEffect as Vo,useState as oa,useRef as Ao,useCallback as Ju,useLayoutEffect as Dp}from"react";import{night as Eo,monoFont as kp}from"@buoy-gg/shared-ui/web";Dn();Ve();import{Fragment as Pp,jsx as qt,jsxs as Yu}from"react/jsx-runtime";var Np=1e3;function Xu({onBadgePress:e}={}){let[t,n]=oa([]),[o,r]=oa(()=>H.getFrozen()),[i,a]=oa(null),l=Ao(null),u=Ao(0),c=Ao(0),d=Ao(o);d.current=o,Qe.isEnabled()&&(u.current=performance.now(),c.current=t.length),Dp(()=>{if(Qe.isEnabled()&&u.current>0&&c.current>0){let m=performance.now()-u.current;za(c.current,m)}}),Vo(()=>H.subscribeToFreeze(m=>{r(m)}),[]),Vo(()=>B.subscribeToFilters(()=>{n(m=>m.filter(S=>{let v=B.getRender(String(S.id));return v?B.shouldShowRender(v):true}))}),[]),Vo(()=>(H.setSpotlightCallback(m=>{a(m)}),()=>{H.setSpotlightCallback(null)}),[]);let h=Ju(m=>{let S=Date.now(),v=m.map(L=>({...L,timestamp:S}));n(L=>{let P=[...L];for(let C of v){let I=P.findIndex(D=>D.id===C.id);I>=0?P[I]=C:P.push(C)}return P})},[]);Vo(()=>(H.setHighlightCallback(h),l.current=setInterval(()=>{if(d.current)return;let m=Date.now();n(S=>S.filter(v=>m-v.timestamp<Np))},50),()=>{H.setHighlightCallback(null),l.current&&clearInterval(l.current)}),[h]);let T=e||H.getBadgePressCallback(),f=Ju(m=>{e?e(m):H.handleBadgePress(m)},[e]),b=i?B.getRender(String(i)):null;return t.length===0&&!b?.measurements?null:Yu(g,{style:St.overlay,pointerEvents:"box-none",nativeID:"highlight-updates-overlay",children:[b?.measurements&&Yu(Pp,{children:[qt(g,{pointerEvents:"none",nativeID:"__spotlight_highlight__",style:[St.spotlightHighlight,{left:b.measurements.x-3,top:b.measurements.y-3,width:b.measurements.width+6,height:b.measurements.height+6}]}),qt(g,{pointerEvents:"none",style:[St.spotlightLabel,{left:b.measurements.x,top:b.measurements.y+b.measurements.height+4}],children:qt(p,{style:St.spotlightLabelText,children:b.componentName||b.displayName||b.viewType})})]}),t.map(m=>qt(g,{pointerEvents:"box-none",nativeID:`__highlight_rect_${m.id}__`,style:[St.highlight,{left:m.x,top:m.y,width:m.width,height:m.height,borderColor:m.color}],children:m.count>0&&qt(g,{style:[St.badge,{backgroundColor:m.color}],nativeID:`__highlight_badge_${m.id}__`,pointerEvents:T?"auto":"none",hitSlop:{top:8,bottom:8,left:8,right:8},onStartShouldSetResponder:()=>!!T,onResponderGrant:()=>f(m.id),children:qt(p,{style:St.badgeText,nativeID:`__highlight_text_${m.id}__`,children:m.count})})},`highlight-${m.id}`))]})}s(Xu,"HighlightUpdatesOverlay");var St=Ce.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999999,elevation:999999,borderWidth:0},highlight:{position:"absolute",borderWidth:2,borderStyle:"solid",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,height:14,borderRadius:0,justifyContent:"center",alignItems:"center",paddingHorizontal:2},badgeText:{color:"#000",fontSize:9,fontWeight:"bold"},spotlightHighlight:{position:"absolute",borderWidth:2,borderStyle:"dashed",borderColor:Eo.color.accent,backgroundColor:"transparent"},spotlightLabel:{position:"absolute",backgroundColor:Eo.color.surface,borderWidth:1,borderColor:Eo.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},spotlightLabelText:{color:Eo.color.accent,fontSize:11,fontWeight:"600",fontFamily:kp}});import{setRenderCaptureProvider as Lp}from"@buoy-gg/shared-ui/web";Ve();Dn();Na();j();function Qu(e){let t={exportedAt:new Date().toISOString(),totalComponents:e.length,totalRenders:e.reduce((n,o)=>n+o.renderCount,0),components:e.map(n=>({componentName:n.componentName||n.displayName,viewType:n.viewType,nativeTag:n.nativeTag,testID:n.testID,nativeID:n.nativeID,accessibilityLabel:n.accessibilityLabel,renderCount:n.renderCount,firstRenderTime:n.firstRenderTime,lastRenderTime:n.lastRenderTime,lastRenderCause:n.lastRenderCause?{type:n.lastRenderCause.type,componentCause:n.lastRenderCause.componentCause,changedKeys:n.lastRenderCause.changedKeys,hookChanges:n.lastRenderCause.hookChanges?.map(o=>({type:o.type,index:o.index,description:o.description}))}:null,renderHistory:n.renderHistory?.map(o=>({renderNumber:o.renderNumber,timestamp:o.timestamp,cause:{type:o.cause.type,componentCause:o.cause.componentCause,changedKeys:o.cause.changedKeys}}))}))};return JSON.stringify(t,null,2)}s(Qu,"generateRendersJson");try{Lp({isSupported:wt.isSupported,start:wt.startCapture,stop:wt.stopCapture,startLiveHighlights:s(()=>{try{let e=H.isEnabled(),t=H.getHighlightsSuppressed();return H.enable(),()=>{try{e?t&&H.setHighlightsSuppressed(true):H.disable()}catch{}}}catch{return null}},"startLiveHighlights")})}catch{}var zp=s(e=>{let{RenderTracker:t}=(Ve(),hd(Ea));return t.onRenderEvent(e)},"onRenderEvent");export{Ge as CAUSE_CONFIG,pn as COMPONENT_CAUSE_CONFIG,wt as CommitProfiler,zi as HighlightFilterView,tu as HighlightToolView,H as HighlightUpdatesController,Co as HighlightUpdatesModal,Xu as HighlightUpdatesOverlay,Qe as PerformanceLogger,ui as RenderCauseBadge,Ci as RenderDetailView,Hi as RenderHistoryFooter,Ei as RenderHistoryViewer,kc as RenderListItem,B as RenderTracker,Zs as TwoLevelCauseBadge,Xe as VIEW_TYPE_MAP,ss as capturePropsSnapshot,cs as captureStateSnapshot,Hr as clearRenderCauseState,ru as createHighlightUpdatesModalTool,ou as createHighlightUpdatesTool,Jn as detectRenderCause,Ii as detectedItemTestID,Ja as disableProfilerLogging,qa as enableProfilerLogging,Qu as generateRendersJson,Pa as getAllComponentNames,ka as getAllNativeViewTypes,Rn as getComponentDisplayName,Ra as getNativeViewType,as as getRenderCauseStats,gp as highlightUpdatesModalPreset,hp as highlightUpdatesPreset,Rp as highlightUpdatesSyncAdapter,pt as identifierSlug,Qo as installProfilerInterceptor,Or as isCapturingBuoyToolRenders,Ka as isInterceptorInstalled,Da as isKnownViewType,Ya as isLoggingEnabled,zp as onRenderEvent,Ri as patternChipTestID,is as removeRenderCauseState,xi as renderRowTestID,He as safeCloneForHistory,gs as setCaptureBuoyToolRenders,Xo as setComparisonCallback,ft as settingTestID,Zo as uninstallProfilerInterceptor};
|
|
35
|
+
`,w(p,{style:y.howItWorksBold,children:"Component:"})," React component name from fiber"]})})]})]}):w(zi,{children:M(g,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:ig,color:R.color.textTertiary,size:12}),w(te.Title,{children:"SETTINGS"})]}),M(g,{style:y.settingsSection,children:[M(g,{style:y.settingItem,children:[M(g,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Show Render Count"}),w(Pt,{testID:ft("showRenderCount"),value:n.showRenderCount,onValueChange:x=>{o({showRenderCount:x}),!x&&n.trackRenderCauses&&o({trackRenderCauses:false})},trackColor:{false:R.color.surfaceElevated,true:R.color.accent+"80"},thumbColor:n.showRenderCount?R.color.accent:R.color.knob})]}),w(p,{style:y.settingDescription,children:"Display render count badge on highlights. Disabling improves performance by skipping count tracking."})]}),M(g,{style:[y.settingItem,y.settingItemSpaced],children:[M(g,{style:y.settingHeader,children:[w(p,{style:[y.settingLabel,!n.showRenderCount&&y.settingLabelDisabled],children:"Track Render Causes"}),w(Pt,{testID:ft("trackRenderCauses"),value:n.trackRenderCauses,onValueChange:x=>o({trackRenderCauses:x}),trackColor:{false:R.color.surfaceElevated,true:R.color.warning+"80"},thumbColor:n.trackRenderCauses?R.color.warning:R.color.knob,disabled:!n.showRenderCount})]}),M(p,{style:y.settingDescription,children:["Detect WHY components render (props, hooks, parent re-render).",!n.showRenderCount&&M(p,{style:y.settingWarning,children:[`
|
|
36
|
+
`,'Requires "Show Render Count" to be enabled.']})]})]}),M(g,{style:[y.settingItem,y.settingItemSpaced],children:[M(g,{style:y.settingHeader,children:[w(p,{style:[y.settingLabel,!n.trackRenderCauses&&y.settingLabelDisabled],children:"Enable Render History"}),w(Pt,{testID:ft("enableRenderHistory"),value:n.enableRenderHistory,onValueChange:x=>o({enableRenderHistory:x}),trackColor:{false:R.color.surfaceElevated,true:R.color.accent+"80"},thumbColor:n.enableRenderHistory?R.color.accent:R.color.knob,disabled:!n.trackRenderCauses})]}),M(p,{style:y.settingDescription,children:["Store render events for each component to view in the History tab.",!n.trackRenderCauses&&M(p,{style:y.settingWarning,children:[`
|
|
37
|
+
`,'Requires "Track Render Causes" to be enabled.']})]})]}),M(g,{style:[y.settingItem,y.settingItemSpaced],children:[M(g,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Debug Log Level"}),w(g,{style:y.settingValue,children:w(p,{testID:"buoy-highlight-setting-debugLogLevel-value",style:[y.settingValueText,n.debugLogLevel!=="off"&&{color:R.color.warning}],children:Ei.find(x=>x.value===n.debugLogLevel)?.label||"Off"})})]}),w(p,{style:y.settingDescription,children:"Control console logging verbosity for render cause detection."}),w(g,{style:y.batchSizePresets,children:Ei.map(x=>w(Y,{style:[y.batchSizePreset,n.debugLogLevel===x.value&&y.batchSizePresetActive,x.value!=="off"&&n.debugLogLevel===x.value&&{backgroundColor:R.color.warningSoft,borderColor:R.color.warning}],onPress:()=>o({debugLogLevel:x.value}),testID:`buoy-highlight-preset-log-${x.value}`,accessibilityRole:"button",accessibilityLabel:`Debug log level ${x.label}`,children:w(p,{style:[y.batchSizePresetText,n.debugLogLevel===x.value&&y.batchSizePresetTextActive,x.value!=="off"&&n.debugLogLevel===x.value&&{color:R.color.warning}],children:x.label})},x.value))}),M(p,{style:y.settingDescriptionMuted,children:[Ei.find(x=>x.value===n.debugLogLevel)?.description,n.debugLogLevel!=="off"&&" \u2022 Check Metro console for logs"]})]}),M(g,{style:[y.settingItem,y.settingItemSpaced],children:[M(g,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Batch Size"}),w(g,{style:y.settingValue,children:w(p,{testID:"buoy-highlight-setting-batchSize-value",style:y.settingValueText,children:n.batchSize})})]}),w(p,{style:y.settingDescription,children:"Maximum components to highlight per render update. Higher values capture more re-renders but may impact performance on complex screens."}),w(g,{style:y.batchSizePresets,children:pg.map(x=>w(Y,{style:[y.batchSizePreset,n.batchSize===x.value&&y.batchSizePresetActive],onPress:()=>o({batchSize:x.value}),testID:`buoy-highlight-preset-batch-${x.value}`,accessibilityRole:"button",accessibilityLabel:`Batch size ${x.label}`,children:w(p,{style:[y.batchSizePresetText,n.batchSize===x.value&&y.batchSizePresetTextActive],children:x.label})},x.value))})]}),M(g,{style:[y.settingItem,y.settingItemSpaced],children:[M(g,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Show host views"}),w(Pt,{testID:ft("showHostViews"),value:!!n.showHostViews,onValueChange:x=>o({showHostViews:x}),trackColor:{false:R.color.surfaceElevated,true:R.color.accent+"80"},thumbColor:n.showHostViews?R.color.accent:R.color.knob})]}),w(p,{style:y.settingDescription,children:"Include anonymous View / RCTView / Text hosts. Off by default so the list is named composites (what actually re-rendered)."})]}),M(g,{style:[y.settingItem,y.settingItemSpaced],children:[M(g,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Highlight Dev Tools"}),w(Pt,{testID:ft("excludeDevTools"),value:!n.excludeDevTools,onValueChange:x=>o({excludeDevTools:!x}),trackColor:{false:R.color.surfaceElevated,true:R.color.accent+"80"},thumbColor:n.excludeDevTools?R.color.knob:R.color.accent})]}),M(p,{style:y.settingDescription,children:["Show re-render highlights on Buoy dev tools (floating menu, modals, etc.). Useful for optimizing the dev tools themselves.",!n.excludeDevTools&&M(p,{style:y.settingWarning,children:[`
|
|
38
|
+
`,"The highlight overlay is always excluded to prevent infinite loops."]})]})]})]})]})})})})}l(Hi,"HighlightFilterView");var y=Ce.create({container:{flex:1,backgroundColor:"transparent"},scrollView:{flex:1},scrollContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:32},section:{backgroundColor:R.color.surface,borderRadius:8,borderWidth:1,borderColor:R.color.border,marginBottom:12,overflow:"hidden"},sectionDescription:{fontSize:11,color:R.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:16},patternChips:{flexDirection:"row",flexWrap:"wrap",gap:8,paddingHorizontal:16,paddingTop:12},patternChip:{flexDirection:"row",alignItems:"center",backgroundColor:R.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:4,paddingLeft:4,paddingRight:6,maxWidth:"100%",gap:4},patternChipBadge:{paddingVertical:2,paddingHorizontal:5,borderRadius:4},patternChipBadgeText:{fontSize:9,fontWeight:"700"},patternChipValue:{fontSize:11,color:R.color.text,fontFamily:Mt,flexShrink:1},patternChipX:{marginLeft:2},addPatternRow:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},addButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderStyle:"dashed",gap:6},addButtonText:{fontSize:12,fontWeight:"500"},typePicker:{flexDirection:"row",alignItems:"center",gap:8},typePickerRow:{flex:1,flexDirection:"row",flexWrap:"wrap",gap:8},typeOption:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,borderWidth:1,backgroundColor:R.color.surfaceElevated,gap:6},typeOptionText:{fontSize:11,fontWeight:"600"},typePickerCancel:{padding:8},patternInputContainer:{flexDirection:"row",alignItems:"center",backgroundColor:R.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:R.color.border,paddingLeft:4,paddingRight:8,paddingVertical:4,gap:4},patternInput:{flex:1,fontSize:12,color:R.color.text,paddingVertical:6,paddingHorizontal:4},addPatternButton:{paddingVertical:6,paddingHorizontal:10,borderRadius:4},addPatternButtonText:{fontSize:11,fontWeight:"600"},cancelButton:{padding:4},categoryBadgeScroll:{marginTop:12},categoryBadgeScrollContent:{paddingHorizontal:16,gap:8},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,borderWidth:1,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCountBubble:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCount:{fontSize:10,fontWeight:"600"},detectedItemsContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},detectedItemsScroll:{maxHeight:200},detectedItems:{flexDirection:"row",flexWrap:"wrap",gap:8},detectedItem:{flexDirection:"row",alignItems:"center",backgroundColor:R.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:6,paddingHorizontal:10,gap:6},detectedItemText:{fontSize:11,color:R.color.text,fontFamily:Mt},emptyText:{fontSize:11,color:R.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:16,paddingHorizontal:16},howItWorks:{paddingHorizontal:16,paddingVertical:12},howItWorksText:{fontSize:11,color:R.color.textTertiary,lineHeight:18,fontFamily:Mt},howItWorksBold:{fontWeight:"700",color:R.color.textSecondary},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:32},actionPopup:{backgroundColor:R.color.surface,borderRadius:12,borderWidth:1,borderColor:R.color.border,width:"100%",maxWidth:300,overflow:"hidden"},actionPopupHeader:{padding:16,borderBottomWidth:1,borderBottomColor:R.color.separator,alignItems:"center"},actionPopupButtons:{flexDirection:"row",padding:12,gap:8},actionPopupButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:12,borderRadius:8,gap:8},actionPopupInclude:{backgroundColor:R.color.accentSoft},actionPopupExclude:{backgroundColor:R.color.accentSoft},actionPopupButtonText:{fontSize:13,fontWeight:"600"},actionPopupCancel:{padding:12,borderTopWidth:1,borderTopColor:R.color.separator,alignItems:"center"},actionPopupCancelText:{fontSize:13,color:R.color.textTertiary,fontWeight:"500"},settingsSection:{paddingHorizontal:16,paddingTop:8,paddingBottom:16},settingItem:{gap:8},settingItemSpaced:{marginTop:16,paddingTop:16,borderTopWidth:1,borderTopColor:R.color.separator},settingHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},settingLabel:{fontSize:13,fontWeight:"600",color:R.color.text},settingValue:{backgroundColor:R.color.fillSecondary,paddingHorizontal:10,paddingVertical:4,borderRadius:6},settingValueText:{fontSize:12,fontWeight:"700",color:R.color.textTertiary,fontFamily:Mt},settingDescription:{fontSize:11,color:R.color.textSecondary,lineHeight:16},settingDescriptionMuted:{fontSize:10,color:R.color.textTertiary,lineHeight:14,marginTop:4,fontStyle:"italic"},settingLabelDisabled:{color:R.color.textTertiary},settingWarning:{color:R.color.warning,fontWeight:"500"},batchSizePresets:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:4},batchSizePreset:{paddingVertical:8,paddingHorizontal:14,borderRadius:6,backgroundColor:R.color.surfaceElevated,borderWidth:1,borderColor:R.color.border},batchSizePresetActive:{backgroundColor:R.color.fillSecondary,borderColor:R.color.fillTertiary},batchSizePresetText:{fontSize:12,fontWeight:"500",color:R.color.textSecondary,fontFamily:Mt},batchSizePresetTextActive:{color:R.color.textTertiary,fontWeight:"700"},renderCountRangeContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,gap:12},renderCountInputRow:{flexDirection:"row",alignItems:"center",gap:12},renderCountInputGroup:{flex:1,gap:4},renderCountLabel:{fontSize:10,fontWeight:"600",color:R.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},renderCountInput:{backgroundColor:R.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:R.color.border,paddingVertical:10,paddingHorizontal:12,fontSize:14,fontWeight:"600",color:R.color.text,fontFamily:Mt,textAlign:"center"},renderCountSeparator:{fontSize:12,color:R.color.textTertiary,marginTop:18},clearRangeButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,backgroundColor:R.color.warningSoft,borderWidth:1,borderColor:R.color.warning+"40",gap:6,alignSelf:"center"},clearRangeButtonText:{fontSize:11,fontWeight:"600",color:R.color.warning}});j();import{useState as fg,useEffect as Rc,useRef as mg,useCallback as Fi,memo as yg,useMemo as kc}from"react";Ve();j();import bg,{useMemo as Dc}from"react";import{ChevronRight as vg,night as yt,useRelativeTime as Cg,monoFont as Pc}from"@buoy-gg/shared-ui/web";import{jsx as Ne,jsxs as _t}from"react/jsx-runtime";function Nc({render:e,onPress:t}){let n=Dc(()=>e.testID?{type:"testID",value:e.testID}:e.nativeID?{type:"nativeID",value:e.nativeID}:e.componentName?{type:"component",value:e.componentName}:e.accessibilityLabel?{type:"accessibilityLabel",value:e.accessibilityLabel}:{type:"nativeTag",value:String(e.nativeTag)},[e.testID,e.nativeID,e.componentName,e.accessibilityLabel,e.nativeTag]),o=Dc(()=>e.accessibilityLabel&&n.type!=="accessibilityLabel"?{type:"accessibilityLabel",value:e.accessibilityLabel}:null,[e.accessibilityLabel,n.type]),r=Cg(e.lastRenderTime),i=Pi(n.value);return _t(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${e.displayName}, ${n.type} ${n.value}, ${e.renderCount} renders`,style:xe.container,onPress:()=>t(e),activeOpacity:.7,children:[Ne(g,{style:[xe.colorIndicator,{backgroundColor:e.color}]}),_t(g,{style:xe.content,children:[_t(g,{style:xe.topRow,children:[_t(g,{style:xe.viewTypeContainer,children:[Ne(p,{testID:`${i}-name`,style:xe.viewType,numberOfLines:1,children:e.displayName}),o?Ne(Ot,{type:o.type,value:o.value,compact:true,shortLabel:true}):e.displayName!==e.viewType?Ne(p,{testID:`${i}-type`,style:xe.nativeType,numberOfLines:1,children:e.viewType}):null]}),Ne(g,{style:[xe.renderCountBadge,{backgroundColor:e.color+"30"}],children:_t(p,{testID:`${i}-count`,style:[xe.renderCount,{color:e.color}],children:[e.renderCount,"x"]})})]}),e.lastRenderCause&&Ne(g,{style:xe.causeRow,children:Ne(fi,{testID:`${i}-cause`,cause:e.lastRenderCause,compact:true,showKeys:true,showTwoLevel:true})}),_t(g,{style:xe.bottomRow,children:[Ne(g,{style:xe.identifierContainer,children:Ne(Ot,{testID:`${i}-identifier`,type:n.type,value:n.value,compact:true,shortLabel:true})}),Ne(p,{testID:`${i}-time`,style:xe.timing,children:r})]})]}),Ne(vg,{size:16,color:yt.color.textTertiary})]})}l(Nc,"RenderListItemInner");var Lc=bg.memo(Nc,(e,t)=>{let n=e.render,o=t.render;return n.id===o.id&&n.renderCount===o.renderCount&&n.color===o.color&&n.lastRenderTime===o.lastRenderTime&&n.lastRenderCause?.type===o.lastRenderCause?.type&&n.lastRenderCause?.componentCause===o.lastRenderCause?.componentCause&&e.onPress===t.onPress}),xe=Ce.create({container:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,marginHorizontal:12,marginBottom:6,backgroundColor:yt.color.surface,borderRadius:8,borderWidth:1,borderColor:yt.color.border},colorIndicator:{width:4,height:36,borderRadius:2,marginRight:10},content:{flex:1,marginRight:8},topRow:{flexDirection:"row",alignItems:"center",marginBottom:4},causeRow:{marginBottom:4},viewTypeContainer:{flex:1,marginRight:8},viewType:{fontSize:13,fontWeight:"600",color:yt.color.text},nativeType:{fontSize:10,color:yt.color.textTertiary,fontFamily:Pc,marginTop:1},accessibilityLabel:{fontSize:10,color:yt.color.accent,fontStyle:"italic",marginTop:1},renderCountBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:10},renderCount:{fontSize:11,fontWeight:"700",fontFamily:Pc},bottomRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},identifierContainer:{flex:1,flexShrink:1,overflow:"hidden"},timing:{fontSize:10,color:yt.color.textTertiary,fontWeight:"500",flexShrink:0}});import{Lock as Tg,night as Mi,useLimit as wg,ToolEmptyState as Sg,resolveListEmptyState as xg}from"@buoy-gg/shared-ui/web";import{jsx as mn,jsxs as zc}from"react/jsx-runtime";function Bc({searchText:e,filters:t,onSelectRender:n,onStatsChange:o,onRendersChange:r,isTracking:i,isPro:a=false}){let[s,u]=fg(()=>B.getFilteredRenders(e)),c=mg(null);Rc(()=>B.subscribe(()=>{let v=B.getFilteredRenders(e);u(v),o(B.getStats()),r?.(v)}),[e,o,r]),Rc(()=>{let v=B.getFilteredRenders(e);u(v),r?.(v)},[e,t,r]);let d=wg("highlightUpdates.components"),h=a?1/0:d,T=kc(()=>s.slice(0,h),[s,h]),m=kc(()=>Math.max(0,s.length-h),[s.length,h]),b=Fi(v=>v.id,[]),f=Fi(({item:v,index:L})=>mn(Lc,{render:v,onPress:()=>{ol.dismiss(),n(v,L,T)}}),[n,T]),S=Fi(()=>m<=0?null:zc(g,{testID:"buoy-highlight-locked",style:fo.lockedBanner,children:[mn(Tg,{size:14,color:Mi.color.warning}),zc(p,{testID:"buoy-highlight-locked-text",style:fo.lockedBannerText,children:[m," more ",m===1?"component":"components"," locked"]}),mn(p,{style:fo.lockedBannerSubtext,children:"Upgrade to Pro"})]}),[m]);if(s.length===0){let v=e.trim(),L=B.getStats().totalComponents,P=v?B.getFilteredRenders("").length:0,C=xg({subject:"components",verb:"tracked",search:e,total:v?P:L,capturing:i,blocked:v&&P===0&&L>0?"The active filters hide everything tracked, so there is nothing to search.":void 0,waiting:{otto:"stare",title:"No renders tracked",message:"Component renders will appear here"},paused:{title:"No renders tracked",message:"Enable tracking to start capturing"}});return mn(Sg,{...C,testID:"buoy-highlight-empty"})}return mn(il,{testID:"buoy-highlight-list",ref:c,keyboardShouldPersistTaps:"handled",data:T,renderItem:f,keyExtractor:b,contentContainerStyle:fo.listContent,showsVerticalScrollIndicator:true,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,ListFooterComponent:S})}l(Bc,"IsolatedRenderListInner");var Ig=yg(Bc),fo=Ce.create({listContent:{paddingTop:8},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:16,marginTop:8,gap:8},lockedBannerText:{color:Mi.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:Mi.color.textTertiary,fontSize:12}});j();import{memo as Wt}from"react";import{Trash2 as Rg,Search as kg,Filter as Dg,Pause as Pg,Copy as Ng,ModalHeader as he,TabSelector as Vc,night as ge,PowerToggleButton as Lg}from"@buoy-gg/shared-ui/web";j();import{useState as zg,useEffect as Bg,memo as Vg}from"react";Ve();import{Activity as Ag,night as mo,monoFont as Eg}from"@buoy-gg/shared-ui/web";import{jsx as Ac,jsxs as Hg}from"react/jsx-runtime";function Ec(){let[e,t]=zg({totalComponents:0,totalRenders:0});return Bg(()=>B.subscribe(()=>{t(B.getStats())}),[]),Hg(g,{nativeID:"__rn_buoy__stats-row",testID:"buoy-highlight-stats",accessibilityLabel:`${e.totalComponents} components tracked`,style:Hc.headerChip,children:[Ac(Ag,{size:12,color:mo.color.accent}),Ac(p,{testID:"buoy-highlight-stats-value",style:[Hc.headerChipValue,{color:mo.color.accent}],children:e.totalComponents})]})}l(Ec,"StatsDisplayInner");var Fg=Vg(Ec),Hc=Ce.create({headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:mo.color.buttonSurface,paddingHorizontal:8,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:mo.color.border},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:Eg}});import{jsx as Q,jsxs as yn}from"react/jsx-runtime";var Mg=Wt(l(function({isActive:e,searchText:t,onSearchChange:n,onSearchClose:o}){return e?Q(he.Search,{value:t,onChangeText:n,onCancel:()=>{n(""),o()},onDismiss:o,dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search testID, nativeID, component...",accessibilityLabel:"Search renders",iconSize:14,testID:"buoy-highlight-search-field",containerTestID:"buoy-highlight-search-container",containerNativeID:"__rn_buoy__search-container",clearTestID:"buoy-highlight-search-clear"}):null},"SearchSection")),$g=Mg,Og=Wt(l(function({onSearchToggle:e,onFilterToggle:t,onToggleTracking:n,onToggleFreeze:o,onClear:r,onOpenCopySettings:i,isTracking:a,isFrozen:s,activeFilterCount:u,hasRenders:c}){return yn(he.Actions,{children:[Q(Y,{testID:"buoy-highlight-search",accessibilityRole:"button",accessibilityLabel:"Search renders",onPress:e,style:Be.headerActionButton,children:Q(kg,{size:14,color:ge.color.textSecondary})}),Q(Y,{testID:"buoy-highlight-filters",accessibilityRole:"button",accessibilityLabel:u>0?`Filters, ${u} active`:"Filters",onPress:t,style:[Be.headerActionButton,u>0&&Be.activeFilterButton],children:Q(Dg,{size:14,color:u>0?ge.color.accent:ge.color.textTertiary})}),Q(Y,{testID:"buoy-highlight-copy",accessibilityRole:"button",onPress:i,style:[Be.headerActionButton,!c&&Be.headerActionButtonDisabled],disabled:!c,accessibilityLabel:"Open copy settings",children:Q(Ng,{size:14,color:c?ge.color.textSecondary:ge.color.textTertiary})}),Q(Y,{testID:"buoy-highlight-freeze",accessibilityRole:"button",accessibilityLabel:s?"Unfreeze frame":"Freeze frame",onPress:o,style:[Be.headerActionButton,s&&Be.freezeButton,!a&&Be.headerActionButtonDisabled],disabled:!a,children:Q(Pg,{size:14,color:a?s?ge.color.accent:ge.color.textTertiary:ge.color.textTertiary})}),Q(Lg,{testID:"buoy-highlight-power",isEnabled:a,onToggle:n,accessibilityLabel:"Toggle render tracking"}),Q(Y,{testID:"buoy-highlight-clear",accessibilityRole:"button",accessibilityLabel:"Clear tracked renders",onPress:r,style:[Be.headerActionButton,!c&&Be.headerActionButtonDisabled],disabled:!c,children:Q(Rg,{size:14,color:c?ge.color.textTertiary:ge.color.textTertiary})})]})},"HeaderActions")),_g=Og,Wg=Wt(l(function({onBack:e,isSearchActive:t,searchText:n,onSearchChange:o,onSearchToggle:r,onSearchClose:i,onFilterToggle:a,onToggleTracking:s,onToggleFreeze:u,onClear:c,onOpenCopySettings:d,isTracking:h,isFrozen:T,activeFilterCount:m,hasRenders:b,searchInputRef:f}){return yn(he,{children:[e&&Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"",children:t?Q($g,{isActive:t,searchText:n,onSearchChange:o,onSearchClose:i,searchInputRef:f}):Q(Fg,{})}),Q(_g,{onSearchToggle:r,onFilterToggle:a,onToggleTracking:s,onToggleFreeze:u,onClear:c,onOpenCopySettings:d,isTracking:h,isFrozen:T,activeFilterCount:m,hasRenders:b})]})},"MainListHeader")),jg=Wt(l(function({onBack:e,activeTab:t,onTabChange:n,activeFilterCount:o=0}){let r=[{key:"filters",label:`Filters${o>0?` (${o})`:""}`},{key:"settings",label:"Settings"}];return yn(he,{children:[Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"",noMargin:true,children:Q(Vc,{tabs:r,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-filter-tab"})}),Q(he.Actions,{})]})},"FilterViewHeader")),Ug=Wt(l(function({onBack:e,activeTab:t,onTabChange:n,hasHistory:o=true}){let r=[{key:"details",label:"Details"},{key:"history",label:"History",disabled:!o}];return yn(he,{children:[Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"",noMargin:true,children:Q(Vc,{tabs:r,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-detail-tab"})}),Q(he.Actions,{})]})},"DetailViewHeader")),Gg=Wt(l(function({onBack:e}){return yn(he,{children:[Q(he.Navigation,{onBack:e}),Q(he.Content,{title:"Copy Settings",testID:"buoy-highlight-copy-title"})]})},"CopySettingsViewHeader")),Be=Ce.create({headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:ge.color.buttonSurface,borderWidth:1,borderColor:ge.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},activeFilterButton:{backgroundColor:ge.color.accentSoft,borderColor:ge.color.accentBorderStrong},freezeButton:{backgroundColor:ge.color.accentSoft,borderColor:ge.color.accentBorderStrong}});j();import{useState as $i,useCallback as yo,useMemo as bn}from"react";Ve();import{Clock as Kg,GitBranch as qg,Database as Fc,Lock as Jg,formatRelativeTime as Mc,SectionHeader as jt,EventStepperFooter as $c,buoyColors as Oc,night as E,useLimit as _c,ToolEmptyState as Yg,monoFont as Ke}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as Wc}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Xg,jsx as F,jsxs as q}from"react/jsx-runtime";function bo(e){let t=new Date(e),n=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),r=t.getSeconds().toString().padStart(2,"0"),i=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${o}:${r}.${i}`}l(bo,"formatTimeWithMs");function Oi({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:o,isPro:r=false}){let[i,a]=$i(0),s=n??i,u=o??a,[c,d]=$i("current"),h=bn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((I,k)=>I.timestamp-k.timestamp),[e.renderHistory]),T=_c("highlightUpdates.historyEvents"),m=r?1/0:T,b=bn(()=>h.slice(-m),[h,m]),f=bn(()=>Math.max(0,h.length-m),[h.length,m]),S=b.length,v=b[s],L=s>0?b[s-1]:null,P=yo(()=>{s>0&&u(s-1)},[s,u]),C=yo(()=>{s<S-1&&u(s+1)},[s,S,u]);if(S===0){let I=B.getSettings().enableRenderHistory;return F(Yg,{testID:"buoy-highlight-history-empty",otto:I?"stare":"paused",title:"No Render History",message:I?"History is on and armed \u2014 this component has not re-rendered since. Interact with the app to record one.":"Enable render history tracking in settings to see render events here."})}return q(Xg,{children:[q(g,{style:[D.container,{paddingBottom:!t&&S>1?80:0}],children:[f>0&&q(g,{testID:"buoy-highlight-history-locked",style:D.lockedBanner,children:[F(Jg,{size:14,color:E.color.warning}),q(p,{testID:"buoy-highlight-history-locked-text",style:D.lockedBannerText,children:[f," older ",f===1?"render":"renders"," locked"]}),F(p,{style:D.lockedBannerSubtext,children:"Upgrade to Pro"})]}),q(g,{style:D.viewToggleContainer,children:[q(Y,{testID:"buoy-highlight-history-mode-current",accessibilityRole:"button",accessibilityLabel:"Current state",style:[D.viewToggleCard,c==="current"&&D.viewToggleCardActive],onPress:()=>d("current"),activeOpacity:.8,children:[q(g,{style:D.viewToggleContent,children:[F(Fc,{size:16,color:c==="current"?E.color.accent:E.color.textSecondary}),F(p,{style:[D.viewToggleLabel,c==="current"&&D.viewToggleLabelActive],children:"CURRENT STATE"})]}),q(p,{style:[D.viewToggleDescription,c==="current"&&{color:E.color.text}],children:["View render #",v?.renderNumber??0," details"]})]}),q(g,{testID:"buoy-highlight-history-mode-diff",accessibilityLabel:"Diff view, coming soon",style:[D.viewToggleCard,D.viewToggleCardDisabled],children:[q(g,{style:D.viewToggleContent,children:[F(qg,{size:16,color:E.color.textTertiary}),F(p,{style:[D.viewToggleLabel,D.viewToggleLabelDisabled],children:"DIFF VIEW"}),F(g,{style:D.todoBadge,children:F(p,{style:D.todoBadgeText,children:"TODO"})})]}),F(p,{style:[D.viewToggleDescription,{color:E.color.textTertiary}],children:"Compare renders side by side (coming soon)"})]})]}),F(Me,{keyboardShouldPersistTaps:"handled",testID:"buoy-highlight-history-scroll",style:D.contentScroll,contentContainerStyle:D.contentContainer,showsVerticalScrollIndicator:false,children:c==="current"?F(jc,{event:v,render:e}):F(Uc,{previousEvent:L,currentEvent:v,render:e})})]}),!t&&F($c,{currentIndex:s,totalItems:S,onPrevious:P,onNext:C,itemLabel:"Render",subtitle:Mc(new Date(v?.timestamp??Date.now()))})]})}l(Oi,"RenderHistoryViewer");function jc({event:e,render:t}){if(!e)return F(g,{testID:"buoy-highlight-history-no-event",style:D.noEventContainer,children:F(p,{style:D.noEventText,children:"No event selected"})});let n=Ge[e.cause.type];return q(g,{style:D.currentStateContainer,children:[q(g,{style:D.eventHeader,children:[q(g,{style:D.eventHeaderLeft,children:[q(p,{testID:"buoy-highlight-history-event-title",style:D.eventTitle,children:["Render #",e.renderNumber]}),F(p,{testID:"buoy-highlight-history-event-time",style:D.eventTime,children:bo(e.timestamp)})]}),q(g,{style:[D.eventBadge,{backgroundColor:t.color+"30"}],children:[F(g,{style:[D.eventBadgeDot,{backgroundColor:t.color}]}),F(p,{testID:"buoy-highlight-history-event-cause",style:[D.eventBadgeText,{color:t.color}],children:e.cause.type.toUpperCase()})]})]}),q(g,{style:D.section,children:[q(jt,{children:[F(jt.Icon,{icon:Kg,color:n.color,size:12}),F(jt.Title,{children:"WHY DID THIS RENDER?"})]}),F(g,{style:D.sectionContent,children:F(mi,{cause:e.cause,nativeType:t.viewType})})]}),e.capturedProps&&Object.keys(e.capturedProps).length>0&&q(g,{style:D.section,children:[q(jt,{children:[F(jt.Icon,{icon:Fc,color:E.color.accent,size:12}),F(jt.Title,{children:"CAPTURED PROPS"})]}),F(g,{style:D.sectionContent,children:F(Me,{horizontal:true,showsHorizontalScrollIndicator:false,style:D.propsScrollView,children:F(p,{testID:"buoy-highlight-history-props",style:D.propsJson,children:JSON.stringify(e.capturedProps,null,2)})})})]})]})}l(jc,"CurrentStateView");function Uc({previousEvent:e,currentEvent:t,render:n}){let[o,r]=$i("props");if(!e||!t)return F(g,{style:D.noEventContainer,children:F(p,{style:D.noEventText,children:"Select an event with a previous event to compare"})});let i=Ge[e.cause.type],a=Ge[t.cause.type],s=e.capturedProps&&t.capturedProps,u=e.capturedState&&t.capturedState;return q(g,{style:D.diffContainer,children:[q(g,{style:D.compareBar,children:[q(g,{style:D.compareSide,children:[q(g,{style:D.compareLabelRow,children:[F(p,{style:[D.compareLabel,{color:Oc.warning}],children:"PREV"}),F(g,{style:[D.compareActionBadge,{backgroundColor:`${i.color}20`}],children:F(p,{style:[D.compareActionText,{color:i.color}],children:e.cause.type.toUpperCase()})})]}),q(g,{style:D.compareMeta,children:[q(p,{style:D.compareIndex,children:["#",e.renderNumber]}),F(p,{style:D.compareTime,children:bo(e.timestamp)})]})]}),F(g,{style:D.compareDivider,children:F(p,{style:D.compareArrow,children:"\u2192"})}),q(g,{style:D.compareSide,children:[q(g,{style:D.compareLabelRow,children:[F(p,{style:[D.compareLabel,{color:Oc.success}],children:"CUR"}),F(g,{style:[D.compareActionBadge,{backgroundColor:`${a.color}20`}],children:F(p,{style:[D.compareActionText,{color:a.color}],children:t.cause.type.toUpperCase()})})]}),q(g,{style:D.compareMeta,children:[q(p,{style:D.compareIndex,children:["#",t.renderNumber]}),F(p,{style:D.compareTime,children:bo(t.timestamp)})]})]})]}),q(g,{style:D.diffModeTabs,children:[F(Y,{style:[D.diffModeTab,o==="cause"&&D.diffModeTabActive],onPress:()=>r("cause"),activeOpacity:.7,children:F(p,{style:[D.diffModeTabText,o==="cause"&&D.diffModeTabTextActive],children:"CAUSE"})}),F(Y,{style:[D.diffModeTab,o==="props"&&D.diffModeTabActive,!s&&D.diffModeTabDisabled],onPress:()=>s&&r("props"),activeOpacity:s?.7:1,children:F(p,{style:[D.diffModeTabText,o==="props"&&D.diffModeTabTextActive,!s&&D.diffModeTabTextDisabled],children:"PROPS"})}),F(Y,{style:[D.diffModeTab,o==="state"&&D.diffModeTabActive,!u&&D.diffModeTabDisabled],onPress:()=>u&&r("state"),activeOpacity:u?.7:1,children:F(p,{style:[D.diffModeTabText,o==="state"&&D.diffModeTabTextActive,!u&&D.diffModeTabTextDisabled],children:"STATE"})})]}),o==="cause"&&F(g,{style:D.diffSummary,children:F(mi,{cause:t.cause,nativeType:n.viewType})}),o==="props"&&F(g,{style:D.treeDiffContainer,children:s?F(Wc,{oldValue:e.capturedProps,newValue:t.capturedProps,theme:"dark",showUnchanged:true}):q(g,{style:D.noDiffData,children:[F(p,{style:D.noDiffDataTitle,children:"Props Not Captured"}),F(p,{style:D.noDiffDataText,children:'Enable "Capture Props on Render" in settings to see props diff.'})]})}),o==="state"&&F(g,{style:D.treeDiffContainer,children:u?F(Wc,{oldValue:e.capturedState,newValue:t.capturedState,theme:"dark",showUnchanged:true}):q(g,{style:D.noDiffData,children:[F(p,{style:D.noDiffDataTitle,children:"State Not Captured"}),F(p,{style:D.noDiffDataText,children:'Enable "Capture State on Render" in settings to see state diff.'})]})})]})}l(Uc,"DiffView");function _i({render:e,selectedEventIndex:t=0,onEventIndexChange:n=l(()=>{},"onEventIndexChange"),isPro:o=false}){let r=bn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((T,m)=>T.timestamp-m.timestamp),[e.renderHistory]),i=_c("highlightUpdates.historyEvents"),a=o?1/0:i,s=bn(()=>r.slice(-a),[r,a]),u=s.length,c=s[t],d=yo(()=>{n(Math.max(0,t-1))},[t,n]),h=yo(()=>{n(Math.min(u-1,t+1))},[t,u,n]);return u<=1?null:F($c,{currentIndex:t,totalItems:u,onPrevious:d,onNext:h,itemLabel:"Render",subtitle:c?Mc(new Date(c.timestamp)):void 0})}l(_i,"RenderHistoryFooter");var D=Ce.create({container:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:32,gap:12},emptyTitle:{fontSize:16,fontWeight:"600",color:E.color.text},emptyText:{fontSize:13,color:E.color.textSecondary,textAlign:"center",lineHeight:18},viewToggleContainer:{flexDirection:"row",padding:12,gap:8},viewToggleCard:{flex:1,backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:10,gap:4},viewToggleCardActive:{borderColor:E.color.accentBorderStrong,backgroundColor:E.color.accentSoft},viewToggleCardDisabled:{opacity:.5},todoBadge:{backgroundColor:E.color.fillSecondary,paddingHorizontal:6,paddingVertical:2,borderRadius:4,marginLeft:4},todoBadgeText:{fontSize:9,fontWeight:"700",color:E.color.textTertiary,letterSpacing:.3},viewToggleContent:{flexDirection:"row",alignItems:"center",gap:6},viewToggleLabel:{fontSize:10,fontWeight:"700",color:E.color.textSecondary,letterSpacing:.5},viewToggleLabelActive:{color:E.color.accent},viewToggleLabelDisabled:{color:E.color.textTertiary},viewToggleDescription:{fontSize:11,color:E.color.textTertiary,marginTop:2},contentScroll:{flex:1},contentContainer:{padding:12,paddingTop:0},noEventContainer:{padding:24,alignItems:"center"},noEventText:{fontSize:13,color:E.color.textTertiary},currentStateContainer:{gap:12},eventHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:12},eventHeaderLeft:{gap:2},eventTitle:{fontSize:15,fontWeight:"700",color:E.color.text},eventTime:{fontSize:11,color:E.color.textTertiary,fontFamily:Ke},eventBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4,borderRadius:12,gap:6},eventBadgeDot:{width:6,height:6,borderRadius:3},eventBadgeText:{fontSize:10,fontWeight:"700",fontFamily:Ke},section:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,overflow:"hidden"},sectionContent:{padding:12,paddingTop:8},causeContainer:{marginBottom:12},changedList:{marginBottom:12,paddingLeft:4},changedListTitle:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,marginBottom:6},changedItem:{fontSize:12,color:E.color.text,fontFamily:Ke,marginBottom:3,paddingLeft:8},propsScrollView:{maxHeight:150},propsJson:{fontSize:11,fontFamily:Ke,color:E.color.text,backgroundColor:E.color.bg,padding:10,borderRadius:6},diffContainer:{gap:12},compareBar:{flexDirection:"row",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:10},compareSide:{flex:1,gap:4},compareLabelRow:{flexDirection:"row",alignItems:"center",gap:8},compareLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5},compareActionBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},compareActionText:{fontSize:9,fontWeight:"600"},compareMeta:{flexDirection:"row",alignItems:"center",gap:6},compareIndex:{fontSize:12,fontWeight:"600",color:E.color.text},compareTime:{fontSize:10,color:E.color.textTertiary,fontFamily:Ke},compareDivider:{width:30,alignItems:"center",justifyContent:"center"},compareArrow:{fontSize:16,color:E.color.textTertiary},diffSummary:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:12},diffSummaryTitle:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,marginBottom:8},diffChanges:{gap:4},diffChangeItem:{flexDirection:"row",alignItems:"center",gap:6},diffChangeIcon:{fontSize:12,fontWeight:"700",color:E.color.warning,fontFamily:Ke},diffChangeKey:{fontSize:12,color:E.color.text,fontFamily:Ke},diffNoChanges:{fontSize:12,color:E.color.textTertiary,fontStyle:"italic"},diffPlaceholder:{fontSize:12,color:E.color.textTertiary,fontStyle:"italic",textAlign:"center",padding:16},diffModeTabs:{flexDirection:"row",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:4,gap:4},diffModeTab:{flex:1,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center"},diffModeTabActive:{backgroundColor:E.color.accentSoft},diffModeTabDisabled:{opacity:.4},diffModeTabText:{fontSize:10,fontWeight:"600",color:E.color.textSecondary,letterSpacing:.5},diffModeTabTextActive:{color:E.color.accent},diffModeTabTextDisabled:{color:E.color.textTertiary},causeDiffContainer:{gap:8,marginBottom:12},causeDiffRow:{flexDirection:"row",alignItems:"center",gap:8},causeDiffLabel:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,minWidth:80},causeDiffValue:{fontSize:12,color:E.color.text,fontFamily:Ke,fontWeight:"500"},diffChangesTitle:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,marginBottom:6},treeDiffContainer:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,overflow:"hidden",minHeight:150},noDiffData:{padding:24,alignItems:"center",gap:8},noDiffDataTitle:{fontSize:13,fontWeight:"600",color:E.color.text},noDiffDataText:{fontSize:12,color:E.color.textTertiary,textAlign:"center",lineHeight:18},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,marginHorizontal:12,marginTop:8,backgroundColor:E.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:E.color.warning+"30",gap:8},lockedBannerText:{color:E.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:E.color.textTertiary,fontSize:12}});j();import{useCallback as Ut,useEffect as Qg,useMemo as vo,useState as Gc}from"react";import{DynamicFilterView as Zg,macOSColors as Wi,night as ji,FileText as Kc,FileCode as qc,Zap as Jc,Settings as ep,Eye as tp,Layers as np,ToolbarCopyButton as op,ExportPreview as rp,monoFont as ip}from"@buoy-gg/shared-ui/web";j();var Ui={format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},Yc={llm:{format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},table:{format:"markdown-table",topN:50,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},json:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},full:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:false,sortBy:"renderCount",includeHistory:true}};function Xc(e){for(let[t,n]of Object.entries(Yc))if(Object.keys(n).every(o=>{let r=e[o],i=n[o];return Array.isArray(r)&&Array.isArray(i)?r.length===i.length&&r.every((a,s)=>a===i[s]):r===i}))return t;return null}l(Xc,"detectActivePreset");var ke={llm:{label:"LLM",description:"Compact summary for AI",color:"#10B981"},table:{label:"Table",description:"Markdown table",color:"#3B82F6"},json:{label:"JSON",description:"Structured data",color:"#F59E0B"},full:{label:"Full",description:"Everything incl. history",color:"#6B7280"}};j();import{definePersistedSetting as ap,devToolsStorageKeys as lp}from"@buoy-gg/shared-ui/web";var Qc=ap(lp.highlightUpdates.copySettings(),Ui,{sanitize:l((e,t)=>({...e,filterCauses:t?.filterCauses??Ui.filterCauses}),"sanitize")});async function Zc(e){await Qc.save(e)}l(Zc,"saveCopySettings");async function eu(){return Qc.loadOrNull()}l(eu,"loadCopySettings");import{Fragment as sp,jsx as Gt,jsxs as cp}from"react/jsx-runtime";var up=50*1024,dp=200*1024,hp=[{value:"mount",label:"Mount"},{value:"props",label:"Props"},{value:"hooks",label:"Hooks"},{value:"state",label:"State"},{value:"parent",label:"Parent"},{value:"context",label:"Context"},{value:"unknown",label:"Unknown"}];function tu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}l(tu,"formatBytes");function nu(){let e=Date.now();return[{id:"1",nativeTag:1,viewType:"RCTView",displayName:"View",componentName:"PokemonListItem",renderCount:30,firstRenderTime:e-5e3,lastRenderTime:e,color:"#10B981",lastRenderCause:{type:"parent",timestamp:e,componentCause:"parent"}},{id:"2",nativeTag:2,viewType:"RCTView",displayName:"View",componentName:"CartHeader",renderCount:12,firstRenderTime:e-4e3,lastRenderTime:e,color:"#3B82F6",lastRenderCause:{type:"hooks",timestamp:e,componentCause:"state",hookChanges:[{type:"useState",index:2,previousValue:4,currentValue:5}]}},{id:"3",nativeTag:3,viewType:"RCTView",displayName:"View",componentName:"SearchBar",renderCount:8,firstRenderTime:e-3e3,lastRenderTime:e,color:"#F59E0B",lastRenderCause:{type:"props",timestamp:e,componentCause:"props",changedKeys:["query","onChange"]}}]}l(nu,"createMockRenders");function ou({renders:e}){let[t,n]=Gc(Ui),[o,r]=Gc(false);Qg(()=>{let v=true;return eu().then(L=>{v&&L&&n(L)}),()=>{v=false}},[]);let i=Ut(v=>{n(v),Zc(v)},[]),a=e.length>0,s=a?e:nu(),u=vo(()=>Xc(t),[t]),c=vo(()=>gc(s,t),[s,t]),d=vo(()=>c>=dp?"danger":c>=up?"warning":"none",[c]),h=Ut(()=>ho(s,t),[s,t]),T=Ut(v=>{let L=Yc[v];L&&i({...L,filterCauses:[...L.filterCauses]})},[i]),m=Ut((v,L)=>{let[P,C]=v.split("::");if(P==="preset"){T(C);return}if(P==="format"){i({...t,format:L});return}if(P==="sort"){i({...t,sortBy:L});return}if(P==="topN"){i({...t,topN:L});return}if(P==="minRenders"){i({...t,minRenders:L});return}if(P==="cause"){let I=L,k=t.filterCauses.includes(I);i({...t,filterCauses:k?t.filterCauses.filter(W=>W!==I):[...t.filterCauses,I]});return}if(P==="signal"){let I=C;i({...t,[I]:!t[I]});return}},[t,i,T]),b=Ut(()=>{let{totalComponents:v,totalRenders:L}=xi(s);return Gt(rp,{expanded:o,onExpandedChange:r,summary:`${v} component${v!==1?"s":""} \xB7 ${L} renders \xB7 ~${tu(c)}${a?"":" (mock data)"}`,warningLevel:d,warningText:{warning:"Large payload \u2014 preview may be slow",danger:"Very large payload \u2014 try a smaller topN or turn off history"},testIDs:{expand:"buoy-highlight-copy-preview-show",collapse:"buoy-highlight-copy-preview-hide",summary:"buoy-highlight-copy-preview-summary",warning:"buoy-highlight-copy-size-warning"},renderBody:()=>{let P=h();return Gt(Me,{keyboardShouldPersistTaps:"handled",testID:"buoy-highlight-copy-preview-scroll",style:Gi.previewScroll,nestedScrollEnabled:true,children:Gt(p,{testID:"buoy-highlight-copy-preview-text",style:Gi.previewText,selectable:true,children:P})})}})},[o,s,c,d,a,h]),f=Ut(()=>{let{totalComponents:v}=xi(s),L=a?`${v} components`:"Mock data (no renders captured)";return cp(sp,{children:[Gt(p,{testID:"buoy-highlight-copy-status",style:Gi.statusLabel,children:L}),Gt(op,{value:h})]})},[a,s,h]),S=vo(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:ke.llm.label,icon:Jc,color:ke.llm.color,value:"llm",isActive:u==="llm",description:ke.llm.description},{id:"preset::table",label:ke.table.label,icon:Kc,color:ke.table.color,value:"table",isActive:u==="table",description:ke.table.description},{id:"preset::json",label:ke.json.label,icon:qc,color:ke.json.color,value:"json",isActive:u==="json",description:ke.json.description},{id:"preset::full",label:ke.full.label,icon:np,color:ke.full.color,value:"full",isActive:u==="full",description:ke.full.description},{id:"preset::custom",label:"Custom",icon:ep,color:ji.color.textSecondary,value:"custom",isActive:u===null,description:"User-configured"}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::summary",label:"Summary",icon:Jc,color:Wi.semantic.success,value:"summary",isActive:t.format==="summary",description:"Compact, LLM-ready"},{id:"format::markdown-table",label:"Table",icon:Kc,color:Wi.semantic.info,value:"markdown-table",isActive:t.format==="markdown-table",description:"Markdown table"},{id:"format::json",label:"JSON",icon:qc,color:Wi.semantic.warning,value:"json",isActive:t.format==="json",description:"Structured data"}]},{id:"sort",title:"Sort By",type:"custom",data:[{id:"sort::renderCount",label:"Count",value:"renderCount",isActive:t.sortBy==="renderCount",description:"Total renders"},{id:"sort::rate",label:"Rate",value:"rate",isActive:t.sortBy==="rate",description:"Renders / sec"},{id:"sort::name",label:"Name",value:"name",isActive:t.sortBy==="name",description:"Alphabetical"}]},{id:"topN",title:"Top N",type:"custom",data:[{id:"topN::10",label:"10",value:10,isActive:t.topN===10},{id:"topN::25",label:"25",value:25,isActive:t.topN===25},{id:"topN::50",label:"50",value:50,isActive:t.topN===50},{id:"topN::100",label:"100",value:100,isActive:t.topN===100},{id:"topN::-1",label:"All",value:-1,isActive:t.topN===-1}]},{id:"minRenders",title:"Min Renders",type:"custom",data:[{id:"minRenders::1",label:"1",value:1,isActive:t.minRenders===1},{id:"minRenders::2",label:"2",value:2,isActive:t.minRenders===2},{id:"minRenders::3",label:"3",value:3,isActive:t.minRenders===3},{id:"minRenders::5",label:"5",value:5,isActive:t.minRenders===5},{id:"minRenders::10",label:"10",value:10,isActive:t.minRenders===10}]},{id:"causes",title:"Filter Causes",type:"custom",description:t.filterCauses.length===0?"All causes shown":"Only the selected causes shown",data:hp.map(v=>({id:`cause::${v.value}`,label:v.label,value:v.value,isActive:t.filterCauses.includes(v.value)}))},{id:"signal",title:"Signal Extraction",type:"custom",data:[{id:"signal::groupByName",label:"Group by name",value:"groupByName",isActive:t.groupByName,description:"Collapse list items"},{id:"signal::aggregateCauses",label:"Aggregate causes",value:"aggregateCauses",isActive:t.aggregateCauses,description:"Hook x N"},{id:"signal::includeHistory",label:"Include history",value:"includeHistory",isActive:t.includeHistory,description:"JSON only \u2014 large"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:tp,content:b,headerActions:f},onFilterChange:m}),[t,u,m,b,f]);return Gt(Zg,{...S})}l(ou,"RendersCopySettingsView");var Gi=Ce.create({previewScroll:{maxHeight:360},previewText:{fontFamily:ip,fontSize:11,color:ji.color.text,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:ji.color.textTertiary,marginRight:8}});import{Fragment as gp,jsx as ne,jsxs as Ki}from"react/jsx-runtime";var pp=Wh.memo(l(function(){return Ki(g,{testID:"buoy-highlight-disabled-banner",style:vn.disabledBanner,children:[ne(jh,{size:14,color:Ht.color.warning}),ne(p,{testID:"buoy-highlight-disabled-text",style:vn.disabledText,children:"Render tracking is disabled"})]})},"DisabledBanner"));function Co({visible:e,onClose:t,onBack:n,onMinimize:o,enableSharedModalDimensions:r=false,initialNativeTag:i,onInitialNativeTagHandled:a,onRenderSelect:s,inline:u=false}){let c=Kh(),[d,h]=de(false),[T,m]=de(()=>H.getFrozen()),[b,f]=de(()=>B.getStats().totalComponents>0),[S,v]=de(null),[L,P]=de(0),[C,I]=de(false),[k,W]=de(false),[X,V]=de([]),[U,x]=de("filters"),[z,ue]=de("details"),[pe,Fe]=de(0),[be,Ho]=de(""),[xt,Jt]=de(false),ca=ut(null),Yt=ut([]),ua=ut(B.getFilters()),[Fo,da]=de(()=>{let _=B.getFilters();return _.includePatterns.length+_.excludePatterns.length}),[ve,ha]=de(()=>B.getFilters()),[Mo,ga]=de(()=>B.getSettings()),pa=ut(false),$o=ut(false),xn=ut(false);Re(()=>{!e||pa.current||(pa.current=true)},[e]),Re(()=>{if(!e||$o.current)return;l(async()=>{try{let _=await so.getItem(Et.highlightUpdates.filters());if(_){let G=JSON.parse(_),ie={includeTestID:new Set(G.includeTestID||[]),includeNativeID:new Set(G.includeNativeID||[]),includeViewType:new Set(G.includeViewType||[]),includeComponent:new Set(G.includeComponent||[]),excludeTestID:new Set(G.excludeTestID||[]),excludeNativeID:new Set(G.excludeNativeID||[]),excludeViewType:new Set(G.excludeViewType||[]),excludeComponent:new Set(G.excludeComponent||[]),includePatterns:G.includePatterns||[],excludePatterns:G.excludePatterns||[]};B.setFilters(ie);let ze=B.getFilters();ua.current=ze,ha(ze),da(ze.includePatterns.length+ze.excludePatterns.length)}$o.current=true}catch{}},"loadFilters")()},[e]),Re(()=>{if(!$o.current)return;l(async()=>{try{let _={includeTestID:Array.from(ve.includeTestID),includeNativeID:Array.from(ve.includeNativeID),includeViewType:Array.from(ve.includeViewType),includeComponent:Array.from(ve.includeComponent),excludeTestID:Array.from(ve.excludeTestID),excludeNativeID:Array.from(ve.excludeNativeID),excludeViewType:Array.from(ve.excludeViewType),excludeComponent:Array.from(ve.excludeComponent),includePatterns:ve.includePatterns,excludePatterns:ve.excludePatterns};await so.setItem(Et.highlightUpdates.filters(),JSON.stringify(_))}catch{}},"saveFilters")()},[ve]),Re(()=>{if(!e||xn.current)return;l(async()=>{try{let _=await so.getItem(Et.highlightUpdates.settings());if(_){let G=JSON.parse(_),{performanceLogging:ie,excludeDevTools:ze,...Ye}=G;B.setSettings(Ye),ga(B.getSettings())}xn.current=true}catch{xn.current=true}},"loadSettings")()},[e]),Re(()=>{if(!xn.current)return;l(async()=>{try{let{performanceLogging:_,excludeDevTools:G,...ie}=Mo;await so.setItem(Et.highlightUpdates.settings(),JSON.stringify(ie))}catch{}},"saveSettings")()},[Mo]),Re(()=>{let _=B.subscribeToState(G=>{h(G.isTracking)});return()=>{_()}},[]),Re(()=>{let _=H.subscribeToFreeze(G=>{m(G)});return()=>{_()}},[]),Re(()=>{xt&&requestAnimationFrame(()=>{ca.current?.focus()})},[xt]),Re(()=>{e||H.setSpotlight(null)},[e]),Re(()=>{if(e&&i!=null){let _=B.getRender(String(i));_&&(v(_),P(0),I(false),H.setSpotlight(_.nativeTag)),a?.()}},[e,i,a]);let fa=oe(()=>{H.isInitialized()||H.initialize(),H.toggle()},[]),ma=oe(()=>{H.toggleFreeze()},[]),ya=oe(()=>{H.clearRenderCounts(),f(false)},[]),ba=oe(()=>{V(B.getFilteredRenders(be)),W(true)},[be]),va=oe(()=>{W(false)},[]),Ca=oe(_=>{Ho(_)},[]),nd=oe((_,G,ie)=>{v(_),P(G),ue("details"),Fe(0),Yt.current=ie,H.setSpotlight(_.nativeTag)},[]);Re(()=>{if(!S)return;let _=String(S.nativeTag);return B.subscribe(()=>{let G=B.getRender(_);G&&v({...G})})},[S?.nativeTag]);let Ta=ut(null);Re(()=>{!s||!S||Ta.current!==S.nativeTag&&(Ta.current=S.nativeTag,s(S))},[S,s]);let od=oe(_=>{Yt.current=_},[]),wa=oe(()=>{v(null),P(0),be&&Jt(true),H.setSpotlight(null)},[be]),rd=oe(()=>{let _=Yt.current;if(L>0){let G=L-1,ie=_[G];ie&&(v(ie),P(G),H.setSpotlight(ie.nativeTag))}},[L]),id=oe(()=>{let _=Yt.current;if(L<_.length-1){let G=L+1,ie=_[G];ie&&(v(ie),P(G),H.setSpotlight(ie.nativeTag))}},[L]),Sa=oe(()=>{I(false)},[]),xa=oe(()=>{I(true)},[]),Ia=oe(()=>{Jt(true)},[]),Ra=oe(()=>{Jt(false)},[]),Oo=oe(_=>{B.setFilters(_);let G=B.getFilters();ua.current=G,ha(G),da(G.includePatterns.length+G.excludePatterns.length)},[]),ad=oe((_,G)=>{let ie=B.getFilters(),ze={};G==="include"?ie.includePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(ze.includePatterns=[...ie.includePatterns,_]):ie.excludePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(ze.excludePatterns=[...ie.excludePatterns,_]),Object.keys(ze).length>0&&(Oo(ze),v(null),P(0),H.setSpotlight(null))},[Oo]),ld=oe(_=>{B.setSettings(_),ga(B.getSettings())},[]),sd=oe(_=>{f(_.totalComponents>0)},[]),ka=oe(()=>k?ne(Gg,{onBack:va}):C?ne(jg,{onBack:Sa,activeTab:U,onTabChange:x,activeFilterCount:Fo}):S?ne(Ug,{onBack:wa,activeTab:z,onTabChange:ue,hasHistory:(S.renderHistory?.length??0)>0}):ne(Wg,{onBack:n,isSearchActive:xt,searchText:be,onSearchChange:Ca,onSearchToggle:Ia,onSearchClose:Ra,onFilterToggle:xa,onToggleTracking:fa,onToggleFreeze:ma,onClear:ya,onOpenCopySettings:ba,isTracking:d,isFrozen:T,activeFilterCount:Fo,hasRenders:b,searchInputRef:ca}),[k,C,S,n,xt,be,d,T,Fo,b,U,z,Sa,wa,va,Ca,Ia,Ra,xa,fa,ma,ya,ba]),cd=r?Et.modal.root():Et.highlightUpdates.modal();if(!e)return null;let ud=Yt.current.length,Da=S?z==="details"?ne(rg,{currentIndex:L,totalItems:ud,onPrevious:rd,onNext:id,itemLabel:"Component",subtitle:S.componentName||S.displayName||S.viewType}):ne(_i,{render:S,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:c}):null,Pa=ne(g,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:vn.container,children:k?ne(ou,{renders:X}):S?z==="details"?ne(Ii,{render:S,disableInternalFooter:true,onAddFilter:ad,isPro:c}):ne(Oi,{render:S,disableInternalFooter:true,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:c}):C?ne(Hi,{filters:ve,onFilterChange:Oo,settings:Mo,onSettingsChange:ld,availableProps:B.getAvailableProps(),activeTab:U}):Ki(gp,{children:[H.getRenderSourceStatus()==="unavailable"?ne(p,{style:{color:Ht.color.warning,padding:16},children:"Not in this app"}):!d&&ne(pp,{}),ne(Ig,{searchText:be,filters:ve,onSelectRender:nd,onStatsChange:sd,onRendersChange:od,isTracking:d,isPro:c})]})});return u?ne(ec,{children:Ki(g,{style:vn.inlineRoot,children:[ne(g,{style:vn.inlineHeader,...Gh,children:ka()}),Pa,Da]})}):ne(ec,{children:ne(Uh,{visible:e,onClose:t,onMinimize:o,persistenceKey:cd,header:{showToggleButton:true,customContent:ka()},enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:rl.OS==="web",styles:{},footer:Da,footerHeight:S&&(z==="details"||(S.renderHistory?.length??0)>1)?68:0,children:Pa})})}l(Co,"HighlightUpdatesModal");function ru(e={}){return ne(Co,{...e,inline:true,visible:true,onClose:()=>{}})}l(ru,"HighlightToolView");var vn=Ce.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Ht.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:Ht.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:Ht.color.warning+"20"},disabledText:{color:Ht.color.warning,fontSize:11,flex:1}});import{jsx as Cn}from"react/jsx-runtime";function iu({size:e}){let[t,n]=Ko(()=>H.isEnabled());return qo(()=>H.subscribe(o=>{n(o)}),[]),Cn(Ga,{size:e,color:t?"#10b981":"#6b7280"})}l(iu,"HighlightIcon");function qi(){return null}l(qi,"EmptyComponent");function Ji(e){let[t,n]=Ko(null);qo(()=>(e.visible&&H.setBadgePressCallback(r=>{n(r)}),()=>{e.visible||H.setBadgePressCallback(null)}),[e.visible]);let o=yd(()=>{n(null)},[]);return Cn(Co,{...e,initialNativeTag:t,onInitialNativeTagHandled:o})}l(Ji,"HighlightUpdatesModalWithBadgeNavigation");var fp={id:"highlight-updates",name:"TOGGLE HIGHLIGHT",description:"Toggle component render highlights",slot:"row",icon:iu,component:qi,props:{},launchMode:"toggle-only",onPress:l(()=>{H.isInitialized()||H.initialize(),H.toggle()},"onPress")};function au(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";e?.autoInitialize&&setTimeout(()=>{H.initialize()},1e3);let o=l(({size:r})=>{let[i,a]=Ko(()=>H.isEnabled());return qo(()=>H.subscribe(s=>{a(s)}),[]),Cn(Ga,{size:r,color:i?t:n})},"CustomHighlightIcon");return{id:e?.id||"highlight-updates",name:e?.name||"TOGGLE HIGHLIGHT",description:e?.description||"Toggle component render highlights",slot:"row",icon:o,component:qi,props:{},launchMode:"toggle-only",onPress:l(()=>{H.isInitialized()||H.initialize(),H.toggle()},"onPress")}}l(au,"createHighlightUpdatesTool");var mp={id:"highlight-updates-modal",name:"HIGHLIGHT",description:"View component render tracking modal",slot:"both",icon:l(({size:e})=>Cn(Ua,{size:e}),"icon"),component:Ji,props:{enableSharedModalDimensions:false}};function lu(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";return e?.autoInitialize&&setTimeout(()=>{H.initialize()},1e3),{id:e?.id||"highlight-updates-modal",name:e?.name||"HIGHLIGHT",description:e?.description||"View component render tracking modal",slot:"both",icon:l(({size:o})=>Cn(Ua,{size:o,color:t}),"icon"),component:Ji,props:{enableSharedModalDimensions:false}}}l(lu,"createHighlightUpdatesModalTool");j();j();import{getDOMFiber as yp,getDOMNodeHandle as Yi}from"@buoy-gg/shared-ui/web/utils";var bp=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","Pressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","TextInput","Switch","ActivityIndicator","Modal","SafeAreaView","SafeAreaProvider","KeyboardAvoidingView","VirtualizedList","Screen","ScreenContainer","ScreenStack","ScreenContentWrapper","GestureHandlerRootView","GestureDetector","Wrapper"]);function To(e){let t=e.return,n=t?.elementType??t?.type;return t&&n?.$$typeof===Symbol.for("react.memo")&&(n.type===e.type||n.type===e.elementType)?t:null}l(To,"memoParent");function wo(e){let t="",n=e.tag===14||e.tag===15,o=e.tag===11,r=new Set,i=l(s=>{!s||r.has(s)||r.size>20||(r.add(s),t||(t=s.displayName||(typeof s=="function"?s.name:"")),s.$$typeof===Symbol.for("react.memo")&&(n=true,i(s.type)),s.$$typeof===Symbol.for("react.forward_ref")&&(o=true,i(s.render)))},"visit");i(e.elementType),i(e.type);let a=To(e);return a&&i(a.elementType??a.type),{name:t||"Anonymous",memo:n,forwardRef:o}}l(wo,"typeInfo");function Xi(e){if(!e||typeof e.type=="string"||![0,1,2,11,14,15].includes(e.tag))return false;let{name:t}=wo(e),n=e._debugSource?.fileName??"";return!bp.has(t)&&!/^(Animated|RCT|Reanimated|Buoy|DevTools|FloatingDevTools|HighlightUpdates)/.test(t)&&!/[@/]buoy-gg\/|\/react-native\//.test(n)&&!e.memoizedProps?.__buoyDevToolsRoot}l(Xi,"isUserComponent");function su(e){let t=wo(e),n=To(e),o=e._debugSource??n?._debugSource;if(typeof o?.fileName=="string"&&o.fileName)t.source={fileName:o.fileName},Number.isFinite(o.lineNumber)&&(t.source.lineNumber=o.lineNumber),Number.isFinite(o.columnNumber)&&(t.source.columnNumber=o.columnNumber);else{let r=e._debugStack??n?._debugStack;typeof r?.stack=="string"&&(t.rawStack=r.stack)}return t}l(su,"entry");function cu(e){let t=e.child?[e.child]:[],n=0;for(;t.length&&n++<300;){let o=t.shift();if(o._debugOwner===e){let r=o._debugSource;if(typeof r?.fileName=="string"&&r.fileName)return{source:{fileName:r.fileName,...Number.isFinite(r.lineNumber)?{lineNumber:r.lineNumber}:{},...Number.isFinite(r.columnNumber)?{columnNumber:r.columnNumber}:{}}};if(typeof o._debugStack?.stack=="string")return{rawStack:o._debugStack.stack}}o.child&&t.push(o.child),o.sibling&&t.push(o.sibling)}}l(cu,"definitionOf");async function uu(e,t){let n=globalThis[Symbol.for("buoy.dom.componentSource")];if(!n||typeof document>"u")return{found:false,reason:"This page's framework doesn't report where its components live."};let o=pr().filter(a=>!a.buoy).map(a=>a.element),r;if(e!=null&&(r=o.find(a=>Yi(a)===e)),!r&&t){let a=t.toLowerCase();for(let s of o){let u=n(s);if(!u?.found)continue;let c=[u.component,...u.owners],d=c.findIndex(h=>h.name.toLowerCase()===a);if(d>=0)return{found:true,component:c[d],owners:c.slice(d+1),sourceKind:"definition"}}if(!r){let s=(await ln({})).elements.map(u=>({el:u,score:Lt(u,{query:t})})).filter(({score:u})=>u>0).sort((u,c)=>c.score-u.score)[0]?.el;s?.nativeTag!=null&&(r=o.find(u=>Yi(u)===s.nativeTag))}}if(!r)return{found:false,reason:"No view matched. Check describe_screen for its name or tag."};let i=n(r);return i?.found?{...i,sourceKind:"definition"}:i??{found:false,reason:"No app component was found for this view."}}l(uu,"domComponentSource");function du(e){let t=[],n=null,o=new Set,r=e;for(;r&&!o.has(r)&&o.size<400&&t.length<7;){o.add(r),Xi(r)&&(t.length||(n=r),t.push(su(r)));let a=To(r);r=r._debugOwner||a?._debugOwner||a?.return||r.return,a&&r===a&&(r=a._debugOwner||a.return)}if(!t.length)return{found:false,reason:"No app component was found for this view."};let i=n?cu(n):void 0;return{found:true,component:i?{...t[0],definedIn:i}:t[0],owners:t.slice(1)}}l(du,"sourceFromFiber");function hu(e){return e?.canonical?.internalInstanceHandle||e?._internalInstanceHandle||e?._internalFiberInstanceHandleDEV||yp(e)||null}l(hu,"fiberFromStateNode");function gu(e){return Yi(e)??e?.__nativeTag??e?._nativeTag??e?.nativeTag??e?.canonical?.__nativeTag??e?.canonical?._nativeTag??e?.canonical?.nativeTag??null}l(gu,"nativeTag");var vp=1e5;function pu(e){let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__,n=[],o=l(a=>{try{t?.getFiberRoots?.(a)?.forEach(s=>n.push(s.current))}catch{}},"addRoots");t?.renderers?.forEach((a,s)=>o(s)),n.length||o(1);let r=[...n],i=new Set;for(;r.length;){if(i.size>=vp)return{fiber:null,capped:true,any:true};let a=r.pop();if(!a||i.has(a))continue;i.add(a),a.sibling&&r.push(a.sibling);let s=a.memoizedProps??{};if(!(a.tag===22&&a.memoizedState!=null||s.__buoyDevToolsRoot||s.activityState===0||s.activityState===1||s.isPageFocused===false||s["aria-hidden"]===true&&(s.activityState!==void 0||"shouldFreeze"in s)||s.isFocused===false&&(s.routeKey!==void 0||"freezeContents"in s))){if(e(a))return{fiber:a,capped:false,any:true};a.child&&r.push(a.child)}}return{fiber:null,capped:false,any:n.length>0}}l(pu,"findLiveFiber");async function fu(e={}){try{let{nativeTag:t,query:n}=e??{};if(t!==void 0&&(!Number.isInteger(t)||t<0)||n!==void 0&&typeof n!="string")return{found:false,reason:"Pass a valid nativeTag or a text query."};let o=n?.trim();if(t==null&&!o)return{found:false,reason:"Pass a query or nativeTag."};let r=false,i=false,a=l(c=>{let d=pu(c);return r||(r=d.capped),i||(i=d.any),d.fiber??void 0},"find"),s=l(c=>a(d=>d.stateNode&&gu(d.stateNode)===c),"byTag"),u=t!=null?s(t):void 0;if(t==null&&o&&(u=a(c=>Xi(c)&&wo(c).name.toLowerCase()===o.toLowerCase()),!u)){let c=(await ln({})).elements.map(d=>({el:d,score:Lt(d,{query:o})})).filter(({score:d})=>d>0).sort((d,h)=>h.score-d.score)[0]?.el;c?.nativeTag!=null&&(u=s(c.nativeTag))}return!u&&!i?uu(t,o):u?du(hu(u.stateNode)??u):{found:false,reason:r?"The React tree is too big to search fully, and no view matched in the part searched. Pass the nativeTag from describe_screen.":"No view matched. Check describe_screen for its name or tag."}}catch{return{found:false,reason:"Could not read the React tree. Try again in a dev build."}}}l(fu,"getComponentSource");Ve();j();j();import{resolveDOMEventEmitter as Cp}from"@buoy-gg/shared-ui/web/utils";var Tp=14,wp=550,Sp=4e3,xp=8e3,mu=600,Qi=null,yu=false,Zi=null,So=[],qe="idle",Je=[],ea=0,Le=null;function bu(){if(yu)return Qi;yu=true;let e=Cp();return Qi=e.emitter,Zi=e.reason,Qi}l(bu,"getEmitter");function bt(e){return typeof e=="number"&&Number.isFinite(e)?e:null}l(bt,"num");function ta(e){let t=e?.nativeEvent;return t?bt(t.target)??bt(t.tag):null}l(ta,"tagOf");function xo(e){let t=e?.nativeEvent;if(!t)return null;let n={x:bt(t.pageX),y:bt(t.pageY)};if(n.x!==null&&n.y!==null)return{x:n.x,y:n.y};for(let o of["changedTouches","touches"]){let r=t[o];if(Array.isArray(r)&&r.length){let i=r[0],a=bt(i?.pageX),s=bt(i?.pageY);if(a!==null&&s!==null)return{x:a,y:s}}}return null}l(xo,"pointOf");function na(e){Je.push({...e,seq:++ea}),Je.length>mu&&(Je=Je.slice(-mu))}l(na,"push");function vu(e){let t=ta(e);if(t===null)return;let n=xo(e),o=null;try{o=Wn(t)}catch{}Le={tag:t,x:n?.x??0,y:n?.y??0,t:Date.now(),drift:0,target:o}}l(vu,"onTouchStart");function Cu(e){if(!Le)return;let t=xo(e);if(!t)return;let n=t.x-Le.x,o=t.y-Le.y;Le.drift=Math.max(Le.drift,Math.sqrt(n*n+o*o))}l(Cu,"onTouchMove");function Tu(e){let t=Le;if(Le=null,!t||!t.target)return;let n=xo(e);if(n){let r=n.x-t.x,i=n.y-t.y;t.drift=Math.max(t.drift,Math.sqrt(r*r+i*i))}if(t.drift>Tp)return;let o=Date.now()-t.t;o>Sp||t.target.control!=="text"&&(t.target.control==="toggle"||t.target.control==="slider"||na({t:Date.now(),kind:o>=wp?"longPress":"press",target:t.target}))}l(Tu,"onTouchEnd");function wu(){Le=null}l(wu,"onTouchCancel");function Io(e){let t=ta(e);if(t===null)return;let n=e.nativeEvent,o,r;if(typeof n.text=="string")o="text",r=n.text;else if(typeof n.value=="boolean")o="toggle",r=n.value;else if(typeof n.value=="number")o="slider",r=n.value;else return;let i=Je[Je.length-1];if(i&&i.kind===o&&i.target.nativeTag===t&&Date.now()-i.t<xp){i.value=r,i.t=Date.now();return}let a=null;try{a=Wn(t)}catch{}a&&na({t:Date.now(),kind:o,target:a,value:r})}l(Io,"onChange");function Su(){if(qe==="capturing")return Kt();let e=bu();if(!e)return qe="unavailable",Kt();try{So=[e.addListener("topTouchStart",vu),e.addListener("topTouchMove",Cu),e.addListener("topTouchEnd",Tu),e.addListener("topTouchCancel",wu),e.addListener("topChange",Io),e.addListener("topValueChange",Io),e.addListener("topSlidingComplete",Io)],Le=null,qe="capturing"}catch(t){So=[],qe="unavailable",Zi=t?.message??"addListener failed"}return Kt()}l(Su,"startTouchCapture");function xu(){So.forEach(e=>{try{e.remove()}catch{}}),So=[],Le=null,qe==="capturing"&&(qe="idle")}l(xu,"stopTouchCapture");function Iu(){Je=[],ea=0}l(Iu,"clearTouchCapture");function Kt(){return{status:qe,reason:qe==="unavailable"?Zi:null}}l(Kt,"getTouchCaptureStatus");function Ru(e=0){return{...Kt(),records:Je.filter(t=>t.seq>e),seq:ea}}l(Ru,"readTouchCapture");j();var ku=0,Du=1,Pu=11,Nu=14,Lu=15,Ro=1,Ip=1e4,Rp=300,kp=20,zu=false,Tn=false,oa=false,ko=false,Do=0,vt=0,Po=0,Ct={},Tt=new Map;function ra(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}l(ra,"getHook");function No(e){let t=e.flags??e.effectTag;return typeof t=="number"?t:0}l(No,"getFlags");function ia(e){return e===ku||e===Du||e===Pu||e===Nu||e===Lu}l(ia,"isCompositeTag");function Lo(e){let t=e.type;try{switch(e.tag){case ku:case Du:return t?.displayName||t?.name||"Anonymous";case Pu:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case Nu:case Lu:{let n=t?.type??e.elementType?.type;return t?.displayName||n?.displayName||n?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}l(Lo,"getComponentName");function Bu(e){let t=e.actualDuration;if(typeof t!="number")return null;let n=t;for(let o=e.child;o!=null;o=o.sibling)typeof o.actualDuration=="number"&&(n-=o.actualDuration);return n>0?n:0}l(Bu,"computeSelfMs");var Dp=new Set(["View","Text","Image","ImageBackground","ScrollView","FlatList","SectionList","SafeAreaView","KeyboardAvoidingView","StatusBar","ActivityIndicator","RefreshControl","Modal","Switch","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","PressabilityDebugView","AnimatedComponent","Wrapper"]),Vu=["Animated(","Pressability","Virtualized","CellRenderer"];function aa(e){if(Dp.has(e))return true;for(let t=0;t<Vu.length;t++)if(e.startsWith(Vu[t]))return true;return false}l(aa,"isFrameworkWrapperName");var Au=40,Eu=5;function Hu(e,t){if(Object.is(e,t))return true;let n=typeof e;if(n!==typeof t)return false;if(n==="function")return true;if(e===null||t===null||n!=="object")return false;let o=Array.isArray(e);if(o!==Array.isArray(t))return false;if(o){if(e.length!==t.length)return false;for(let a=0;a<e.length;a++)if(!Object.is(e[a],t[a]))return false;return true}let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return false;for(let a=0;a<r.length;a++){let s=r[a];if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return false}return true}l(Hu,"isEquivalentValue");function Fu(e,t){let n=e.alternate;if(!n)return{cause:"mount"};let o=e.memoizedProps,r=n.memoizedProps;if(o!==r&&o&&r){let i=false,a=false,s,u=Object.keys(o),c=u.length<Au?u.length:Au;for(let d=0;d<c;d++){let h=u[d],T=r[h],m=o[h];if(!Object.is(T,m)&&(i=true,t&&(s||(s=[]),s.length<Eu&&s.push(h)),!Hu(T,m)&&(a=true,!t)))break}if(!a&&Object.keys(r).length!==u.length&&(i=true,a=true),i)return{cause:a?"props":"propsUnstable",changedKeys:s}}return Kl(n,e)?{cause:"hooks"}:{cause:"parent"}}l(Fu,"detectCause");function Mu(e){for(let t=e.return;t!=null;t=t.return){if(!ia(t.tag)||(No(t)&Ro)===0)continue;let n=Lo(t);if(!aa(n))return n}}l(Mu,"nearestRenderedAncestorName");function $u(e,t){let n=Lo(e),o=Bu(e);o!==null&&(oa=true);let r=o??0;vt+=1,Po+=r;let{cause:i,changedKeys:a}=Fu(e,ko);if(Ct[i]=(Ct[i]??0)+1,aa(n))return;let s=Tt.get(n);if(!s){if(Tt.size>=Rp)return;s={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}},Tt.set(n,s)}if(s.renders+=1,s.totalSelfMs+=r,r>s.maxSelfMs&&(s.maxSelfMs=r),s.causes[i]=(s.causes[i]??0)+1,ko){if(a){s.changedProps||(s.changedProps=new Set);for(let u=0;u<a.length&&!(s.changedProps.size>=Eu);u++)s.changedProps.add(a[u])}t&&!s.parentName&&(s.parentName=t)}}l($u,"recordRender");function Ou(e){let t=e?.current;if(!t)return;let n=vt,o=0,r=t;for(;r!=null&&(o+=1,!(o>Ip));){let i=false,a=ia(r.tag);if(r.memoizedProps?.__buoyDevToolsRoot||r.memoizedProps?.["data-buoy-root"]!==void 0)i=true;else if(a){let s=Lo(r);vs(s)?i=true:bs(s)||(No(r)&Ro)!==0&&$u(r,ko?Mu(r):void 0)}if(!i){let s=r.subtreeFlags;if(!(typeof s=="number"&&(s&Ro)===0&&(No(r)&Ro)===0)&&r.child!=null){r=r.child;continue}}for(;r!=null;){if(r===t)return la(n);if(r.sibling!=null){r=r.sibling;break}r=r.return}}la(n)}l(Ou,"handleCommit");function la(e){vt>e&&(Do+=1)}l(la,"finalizeCommit");function _u(){if(zu)return true;let e=ra();if(!e)return false;let t=e.onCommitFiberRoot;return e.onCommitFiberRoot=function(n,o,...r){if(Tn)try{Ou(o)}catch{}return typeof t=="function"?t.call(e,n,o,...r):void 0},zu=true,true}l(_u,"ensureHookInstalled");function Wu(){if(typeof ee<"u"&&!ee)return false;let e=ra();return!!(e&&e.renderers&&e.renderers.size>0)}l(Wu,"isSupported");function ju(){return Tn}l(ju,"isCapturing");function Uu(e){_u()&&(Tt=new Map,oa=false,ko=e?.detail===true,Do=0,vt=0,Po=0,Ct={},Tn=true)}l(Uu,"startCapture");function Gu(){if(!Tn&&vt===0&&Tt.size===0)return null;Tn=false;let e=Array.from(Tt.entries()).sort((n,o)=>{let r=o[1].totalSelfMs-n[1].totalSelfMs;return r!==0?r:o[1].renders-n[1].renders}).slice(0,kp).map(([n,o])=>({name:n,renders:o.renders,totalMs:wn(o.totalSelfMs),maxMs:wn(o.maxSelfMs),avgMs:o.renders>0?wn(o.totalSelfMs/o.renders):0,causes:o.causes,...o.changedProps&&o.changedProps.size>0?{changedProps:Array.from(o.changedProps)}:null,...o.parentName?{parentName:o.parentName}:null})),t={totalCommits:Do,totalRenders:vt,capturedDurations:oa,totalRenderMs:wn(Po),wastedRenders:(Ct.parent??0)+(Ct.propsUnstable??0),causes:Ct,topComponents:e};return Tt=new Map,Do=0,vt=0,Po=0,Ct={},t}l(Gu,"stopCapture");function wn(e){return Math.round(e*100)/100}l(wn,"round2");var wt={isSupported:Wu,isCapturing:ju,startCapture:Uu,stopCapture:Gu};function Sn(){H.isInitialized()||H.initialize()}l(Sn,"ensureInitialized");function zo(e){if(!e)return;let{hookChanges:t,...n}=e;return n}l(zo,"toWireCause");function Ku(e){let{renderHistory:t,lastRenderCause:n,...o}=e;return{...o,lastRenderCause:zo(n),historyCount:t?.length??0}}l(Ku,"toWireRender");function qu(e){try{return JSON.stringify(e),e}catch{return{...e,lastRenderCause:zo(e.lastRenderCause),renderHistory:e.renderHistory?.map(t=>({...t,capturedProps:void 0,capturedState:void 0,cause:zo(t.cause)??t.cause}))}}}l(qu,"jsonSafeRender");function Ju(){let e=globalThis[Symbol.for("buoy.framework.renderCapture")];return e&&typeof e.start=="function"&&e.isSupported()?e:null}l(Ju,"frameworkCapture");var Bo=null;function Yu(){if(wt.isSupported())return wt.startCapture({detail:true}),Bo="react",{ok:true};let e=Ju();return e?(e.start(),Bo=e,{ok:true}):{ok:false,reason:"render capture needs a dev build with the React DevTools hook available"}}l(Yu,"beginMeasurement");function Xu(){let e=Bo;return Bo=null,e&&e!=="react"?{summary:e.stop()}:{summary:wt.stopCapture()}}l(Xu,"endMeasurement");var Pp={version:3,getSnapshot:l(()=>({enabled:H.isEnabled(),frozen:H.getFrozen(),highlightsSuppressed:H.getHighlightsSuppressed(),renders:B.getRenders().map(Ku),trackerState:B.getState()}),"getSnapshot"),subscribe:l(e=>{let t=H.subscribe(e),n=H.subscribeToFreeze(e),o=B.subscribe(e),r=B.subscribeToState(e);return()=>{t(),n(),o(),r()}},"subscribe"),actions:{getComponentSource:l(async e=>{try{return await fu(e)}catch(t){return{found:false,reason:`Could not read the component's source: ${t instanceof Error?t.message:String(t)}`}}},"getComponentSource"),beginMeasurement:l(()=>Yu(),"beginMeasurement"),endMeasurement:l(()=>Xu(),"endMeasurement"),getRenderDetail:l(e=>{let{nativeTag:t}=e??{};if(t==null)return{found:false,reason:"missing nativeTag"};let n=B.getRender(String(t));return n?{found:true,nativeTag:t,render:qu(n)}:{found:false,reason:"unknown nativeTag"}},"getRenderDetail"),toggle:l(()=>{Sn(),H.toggle()},"toggle"),setEnabled:l(e=>{Sn(),H.setEnabled(e.enabled)},"setEnabled"),toggleFreeze:l(()=>{H.toggleFreeze()},"toggleFreeze"),clearRenderCounts:l(()=>{H.clearRenderCounts()},"clearRenderCounts"),setSpotlight:l(e=>{H.setSpotlight(e.nativeTag)},"setSpotlight"),locateComponent:l(e=>(Sn(),H.locateComponent(e??{})),"locateComponent"),setSilentTracking:l(e=>{Sn(),H.setSilentTracking(e.enabled??false)},"setSilentTracking"),describeScreen:l(e=>ln(e??{}),"describeScreen"),tapElement:l(e=>Nl(e??{}),"tapElement"),waitFor:l(e=>Ll(e??{}),"waitFor"),hitTest:l(e=>jl(e??{x:.5,y:.5}),"hitTest"),readMaps:l(()=>Ul(),"readMaps"),startTouchCapture:l(()=>Su(),"startTouchCapture"),stopTouchCapture:l(()=>(xu(),Kt()),"stopTouchCapture"),clearTouchCapture:l(()=>(Iu(),{ok:true}),"clearTouchCapture"),readTouchCapture:l(e=>Ru(e?.sinceSeq??0),"readTouchCapture")}};j();import{useEffect as Vo,useState as sa,useRef as Ao,useCallback as Qu,useLayoutEffect as Np}from"react";import{night as Eo,monoFont as Lp}from"@buoy-gg/shared-ui/web";kn();Ve();import{Fragment as zp,jsx as qt,jsxs as Zu}from"react/jsx-runtime";var Bp=1e3;function ed({onBadgePress:e}={}){let[t,n]=sa([]),[o,r]=sa(()=>H.getFrozen()),[i,a]=sa(null),s=Ao(null),u=Ao(0),c=Ao(0),d=Ao(o);d.current=o,Qe.isEnabled()&&(u.current=performance.now(),c.current=t.length),Np(()=>{if(Qe.isEnabled()&&u.current>0&&c.current>0){let f=performance.now()-u.current;Ha(c.current,f)}}),Vo(()=>H.subscribeToFreeze(f=>{r(f)}),[]),Vo(()=>B.subscribeToFilters(()=>{n(f=>f.filter(S=>{let v=B.getRender(String(S.id));return v?B.shouldShowRender(v):true}))}),[]),Vo(()=>(H.setSpotlightCallback(f=>{a(f)}),()=>{H.setSpotlightCallback(null)}),[]);let h=Qu(f=>{let S=Date.now(),v=f.map(L=>({...L,timestamp:S}));n(L=>{let P=[...L];for(let C of v){let I=P.findIndex(k=>k.id===C.id);I>=0?P[I]=C:P.push(C)}return P})},[]);Vo(()=>(H.setHighlightCallback(h),s.current=setInterval(()=>{if(d.current)return;let f=Date.now();n(S=>S.filter(v=>f-v.timestamp<Bp))},50),()=>{H.setHighlightCallback(null),s.current&&clearInterval(s.current)}),[h]);let T=e||H.getBadgePressCallback(),m=Qu(f=>{e?e(f):H.handleBadgePress(f)},[e]),b=i?B.getRender(String(i)):null;return t.length===0&&!b?.measurements?null:Zu(g,{style:St.overlay,pointerEvents:"box-none",nativeID:"highlight-updates-overlay",children:[b?.measurements&&Zu(zp,{children:[qt(g,{pointerEvents:"none",nativeID:"__spotlight_highlight__",style:[St.spotlightHighlight,{left:b.measurements.x-3,top:b.measurements.y-3,width:b.measurements.width+6,height:b.measurements.height+6}]}),qt(g,{pointerEvents:"none",style:[St.spotlightLabel,{left:b.measurements.x,top:b.measurements.y+b.measurements.height+4}],children:qt(p,{style:St.spotlightLabelText,children:b.componentName||b.displayName||b.viewType})})]}),t.map(f=>qt(g,{pointerEvents:"box-none",nativeID:`__highlight_rect_${f.id}__`,style:[St.highlight,{left:f.x,top:f.y,width:f.width,height:f.height,borderColor:f.color}],children:f.count>0&&qt(g,{style:[St.badge,{backgroundColor:f.color}],nativeID:`__highlight_badge_${f.id}__`,pointerEvents:T?"auto":"none",hitSlop:{top:8,bottom:8,left:8,right:8},onStartShouldSetResponder:()=>!!T,onResponderGrant:()=>m(f.id),children:qt(p,{style:St.badgeText,nativeID:`__highlight_text_${f.id}__`,children:f.count})})},`highlight-${f.id}`))]})}l(ed,"HighlightUpdatesOverlay");var St=Ce.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999999,elevation:999999,borderWidth:0},highlight:{position:"absolute",borderWidth:2,borderStyle:"solid",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,height:14,borderRadius:0,justifyContent:"center",alignItems:"center",paddingHorizontal:2},badgeText:{color:"#000",fontSize:9,fontWeight:"bold"},spotlightHighlight:{position:"absolute",borderWidth:2,borderStyle:"dashed",borderColor:Eo.color.accent,backgroundColor:"transparent"},spotlightLabel:{position:"absolute",backgroundColor:Eo.color.surface,borderWidth:1,borderColor:Eo.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},spotlightLabelText:{color:Eo.color.accent,fontSize:11,fontWeight:"600",fontFamily:Lp}});import{setRenderCaptureProvider as Vp}from"@buoy-gg/shared-ui/web";Ve();kn();Aa();j();function td(e){let t={exportedAt:new Date().toISOString(),totalComponents:e.length,totalRenders:e.reduce((n,o)=>n+o.renderCount,0),components:e.map(n=>({componentName:n.componentName||n.displayName,viewType:n.viewType,nativeTag:n.nativeTag,testID:n.testID,nativeID:n.nativeID,accessibilityLabel:n.accessibilityLabel,renderCount:n.renderCount,firstRenderTime:n.firstRenderTime,lastRenderTime:n.lastRenderTime,lastRenderCause:n.lastRenderCause?{type:n.lastRenderCause.type,componentCause:n.lastRenderCause.componentCause,changedKeys:n.lastRenderCause.changedKeys,hookChanges:n.lastRenderCause.hookChanges?.map(o=>({type:o.type,index:o.index,description:o.description}))}:null,renderHistory:n.renderHistory?.map(o=>({renderNumber:o.renderNumber,timestamp:o.timestamp,cause:{type:o.cause.type,componentCause:o.cause.componentCause,changedKeys:o.cause.changedKeys}}))}))};return JSON.stringify(t,null,2)}l(td,"generateRendersJson");try{Vp({isSupported:wt.isSupported,start:wt.startCapture,stop:wt.stopCapture,startLiveHighlights:l(()=>{try{let e=H.isEnabled(),t=H.getHighlightsSuppressed();return H.enable(),()=>{try{e?t&&H.setHighlightsSuppressed(true):H.disable()}catch{}}}catch{return null}},"startLiveHighlights")})}catch{}var Ap=l(e=>{let{RenderTracker:t}=(Ve(),fd(Oa));return t.onRenderEvent(e)},"onRenderEvent");export{Ge as CAUSE_CONFIG,pn as COMPONENT_CAUSE_CONFIG,wt as CommitProfiler,Hi as HighlightFilterView,ru as HighlightToolView,H as HighlightUpdatesController,Co as HighlightUpdatesModal,ed as HighlightUpdatesOverlay,Qe as PerformanceLogger,fi as RenderCauseBadge,Ii as RenderDetailView,_i as RenderHistoryFooter,Oi as RenderHistoryViewer,Lc as RenderListItem,B as RenderTracker,nc as TwoLevelCauseBadge,Xe as VIEW_TYPE_MAP,ds as capturePropsSnapshot,hs as captureStateSnapshot,_r as clearRenderCauseState,lu as createHighlightUpdatesModalTool,au as createHighlightUpdatesTool,Jn as detectRenderCause,Ni as detectedItemTestID,el as disableProfilerLogging,Za as enableProfilerLogging,td as generateRendersJson,Va as getAllComponentNames,Ba as getAllNativeViewTypes,Rn as getComponentDisplayName,La as getNativeViewType,cs as getRenderCauseStats,mp as highlightUpdatesModalPreset,fp as highlightUpdatesPreset,Pp as highlightUpdatesSyncAdapter,pt as identifierSlug,Qo as installProfilerInterceptor,Gr as isCapturingBuoyToolRenders,Qa as isInterceptorInstalled,za as isKnownViewType,tl as isLoggingEnabled,Ap as onRenderEvent,Li as patternChipTestID,ss as removeRenderCauseState,Pi as renderRowTestID,He as safeCloneForHistory,ms as setCaptureBuoyToolRenders,Xo as setComparisonCallback,ft as settingTestID,Zo as uninstallProfilerInterceptor};
|