@buoy-gg/highlight-updates 7.0.40 → 7.0.42
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/README.md +11 -67
- package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +1 -281
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -1474
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -641
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +1 -273
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -188
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +1 -293
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +1 -508
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -846
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -915
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +1 -235
- package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +1 -469
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +1 -73
- package/lib/commonjs/highlight-updates/types/copySettings.js +1 -107
- package/lib/commonjs/highlight-updates/utils/CommitProfiler.js +1 -446
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -1920
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +26 -359
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -371
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +5 -1840
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -952
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +1 -264
- package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +1 -32
- package/lib/commonjs/highlight-updates/utils/devtoolsComponentNames.js +1 -188
- package/lib/commonjs/highlight-updates/utils/namedComposite.js +1 -41
- package/lib/commonjs/highlight-updates/utils/ownStateChanged.js +1 -103
- package/lib/commonjs/highlight-updates/utils/rawEventEmitter.js +1 -50
- package/lib/commonjs/highlight-updates/utils/rawEventEmitter.web.js +1 -0
- package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +1 -58
- package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +1 -485
- package/lib/commonjs/highlight-updates/utils/screenElements.js +1 -1248
- package/lib/commonjs/highlight-updates/utils/tapMatch.js +1 -83
- package/lib/commonjs/highlight-updates/utils/testIDs.js +1 -68
- package/lib/commonjs/highlight-updates/utils/touchCapture.js +1 -277
- package/lib/commonjs/index.js +1 -429
- package/lib/commonjs/preset.js +1 -278
- package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +1 -235
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +1 -274
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -1468
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -634
- package/lib/module/highlight-updates/components/IdentifierBadge.js +1 -265
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -183
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +1 -288
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +1 -499
- package/lib/module/highlight-updates/components/RenderDetailView.js +1 -840
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -908
- package/lib/module/highlight-updates/components/RenderListItem.js +1 -230
- package/lib/module/highlight-updates/components/RendersCopySettingsView.js +1 -465
- package/lib/module/highlight-updates/components/StatsDisplay.js +1 -70
- package/lib/module/highlight-updates/types/copySettings.js +1 -102
- package/lib/module/highlight-updates/utils/CommitProfiler.js +1 -442
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -1916
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +26 -353
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -358
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +5 -1830
- package/lib/module/highlight-updates/utils/RenderTracker.js +1 -949
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +1 -255
- package/lib/module/highlight-updates/utils/copySettingsStorage.js +1 -26
- package/lib/module/highlight-updates/utils/devtoolsComponentNames.js +1 -178
- package/lib/module/highlight-updates/utils/namedComposite.js +1 -36
- package/lib/module/highlight-updates/utils/ownStateChanged.js +1 -98
- package/lib/module/highlight-updates/utils/rawEventEmitter.js +1 -46
- package/lib/module/highlight-updates/utils/rawEventEmitter.web.js +1 -0
- package/lib/module/highlight-updates/utils/renderExportFormatter.js +1 -54
- package/lib/module/highlight-updates/utils/rendersExportFormatter.js +1 -478
- package/lib/module/highlight-updates/utils/screenElements.js +1 -1242
- package/lib/module/highlight-updates/utils/tapMatch.js +1 -76
- package/lib/module/highlight-updates/utils/testIDs.js +1 -60
- package/lib/module/highlight-updates/utils/touchCapture.js +1 -270
- package/lib/module/index.js +1 -130
- package/lib/module/preset.js +1 -272
- package/lib/module/sync/highlightUpdatesSyncAdapter.js +1 -230
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts +0 -26
- package/lib/typescript/highlight-updates/utils/rawEventEmitter.web.d.ts +3 -0
- package/lib/typescript/highlight-updates/utils/screenElements.d.ts +0 -19
- package/lib/web/index.mjs +38 -0
- package/package.json +34 -14
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/CommitProfiler.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/devtoolsComponentNames.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/namedComposite.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ownStateChanged.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/rawEventEmitter.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/screenElements.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/tapMatch.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/testIDs.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/touchCapture.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";var $n=Object.defineProperty;var ol=Object.getOwnPropertyDescriptor;var il=Object.getOwnPropertyNames;var al=Object.prototype.hasOwnProperty;var kt=(e,t)=>()=>(e&&(t=e(e=0)),t);var po=(e,t)=>{for(var n in t)$n(e,n,{get:t[n],enumerable:true})},En=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of il(t))!al.call(e,o)&&o!==n&&$n(e,o,{get:()=>t[o],enumerable:!(r=ol(t,o))||r.enumerable});return e},ll=(e,t,n)=>(En(e,t,"default"),n&&En(n,t,"default"));var sl=e=>En($n({},"__esModule",{value:true}),e);var Z,U=kt(()=>{"use strict";Z=process.env.NODE_ENV!=="production";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis)});function Fn(e){return je[e]||e}function cl(e){for(let[t,n]of Object.entries(je))if(n===e)return t;return null}function ul(e){return e in je}function dl(){return Object.keys(je)}function hl(){return[...new Set(Object.values(je))]}var je,mo=kt(()=>{"use strict";U();je={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"}});function gl(){return Pt=performance.now(),Pt}function pl(e,t){Pt>0&&e>0&&(Pt=0)}var Pt,fo,Ue,en=kt(()=>{"use strict";U();Pt=0;fo=class{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(e){let t=this.enabled;this.enabled=e,e&&!t?this.resetStats():!e&&t&&this.stopSummaryInterval()}isEnabled(){return this.enabled}startBatch(e,t){let n=`batch_${++this.batchCounter}`,r=performance.now(),o=null,i=null,l=null,a=null,c=null,s=0,d=0,b=0,C=0,y;return{markFilteringComplete:(v,m)=>{o=performance.now(),s=v,d=m},markMeasurementStart:()=>{i=performance.now()},markMeasurementComplete:(v,m)=>{l=performance.now(),b=v,C=m},markTrackingComplete:()=>{a=performance.now()},markCallbackComplete:()=>{c=performance.now()},setOverlayRenderTime:v=>{y=v},getBatchId:()=>n,finish:()=>{let v=performance.now(),m={batchId:n,timestamp:Date.now(),nodesReceived:e,nodesFiltered:s,nodesToProcess:d,batchSize:t,nodesInBatch:Math.min(d,t),filteringTime:o?o-r:0,measurementTime:i&&l?l-i:0,trackingTime:l&&a?a-l:0,callbackTime:a&&c?c-a:0,totalTime:v-r,measurementSuccessCount:b,measurementFailCount:C,overlayRenderTime:y};return this.enabled&&this.recordMetrics(m),m}}}recordMetrics(e){this.rollingStats.batchCount++,this.rollingStats.totalNodes+=e.nodesReceived,this.rollingStats.totalFiltered+=e.nodesFiltered,this.rollingStats.totalProcessed+=e.nodesInBatch,this.rollingStats.totalTime+=e.totalTime,this.rollingStats.maxTime=Math.max(this.rollingStats.maxTime,e.totalTime),this.rollingStats.minTime=Math.min(this.rollingStats.minTime,e.totalTime);let t=this.rollingStats.avgMeasurementTime,n=this.rollingStats.batchCount;this.rollingStats.avgMeasurementTime=t+(e.measurementTime-t)/n,this.recentBatches.push(e),this.recentBatches.length>this.MAX_HISTORY&&this.recentBatches.shift(),this.notifyListeners(e)}logBatch(e){let{batchId:t,nodesReceived:n,nodesFiltered:r,nodesInBatch:o,batchSize:i,filteringTime:l,measurementTime:a,trackingTime:c,callbackTime:s,totalTime:d,measurementSuccessCount:b,measurementFailCount:C,overlayRenderTime:y}=e;console.log(`[HighlightPerf] ${t} | In:${n} Filt:${r} Proc:${o}/${i} | Filter:${l.toFixed(1)}ms Measure:${a.toFixed(1)}ms Track:${c.toFixed(1)}ms Callback:${s.toFixed(1)}ms | Total:${d.toFixed(1)}ms`+(y?` Render:${y.toFixed(1)}ms`:"")+` | Success:${b} Fail:${C}`),d>100&&console.warn(`[HighlightPerf] \u26A0\uFE0F SLOW BATCH: ${d.toFixed(1)}ms - Measurement phase: ${a.toFixed(1)}ms (${(a/d*100).toFixed(0)}%)`)}logSummary(){if(this.rollingStats.batchCount===0)return;let e=this.rollingStats,t=e.totalTime/e.batchCount,n=e.totalNodes/e.batchCount;console.log(`
|
|
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
|
+
Batches: ${e.batchCount}
|
|
4
|
+
Avg nodes/batch: ${n.toFixed(1)} (filtered: ${(e.totalFiltered/e.batchCount).toFixed(1)})
|
|
5
|
+
Avg total time: ${t.toFixed(1)}ms
|
|
6
|
+
Avg measurement time: ${e.avgMeasurementTime.toFixed(1)}ms
|
|
7
|
+
Min/Max time: ${e.minTime.toFixed(1)}ms / ${e.maxTime.toFixed(1)}ms
|
|
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(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notifyListeners(e){for(let t of this.listeners)try{t(e)}catch(n){console.error("[HighlightPerf] Error in metrics listener:",n)}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[],this.resetStats(),this.batchCounter=0}generateReport(){let e=this.recentBatches;if(e.length===0)return"No performance data collected yet.";let t=e.reduce((i,l)=>i+l.totalTime,0)/e.length,n=e.reduce((i,l)=>i+l.measurementTime,0)/e.length,r=e.filter(i=>i.totalTime>100),o=e.filter(i=>i.totalTime<20);return`
|
|
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
|
+
\u2551 HIGHLIGHT UPDATES PERFORMANCE REPORT \u2551
|
|
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
|
|
13
|
+
\u2551 Total batches analyzed: ${e.length.toString().padStart(5)} \u2551
|
|
14
|
+
\u2551 Average total time: ${t.toFixed(1).padStart(5)}ms \u2551
|
|
15
|
+
\u2551 Average measure time: ${n.toFixed(1).padStart(5)}ms (${(n/t*100).toFixed(0)}% of total) \u2551
|
|
16
|
+
\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
|
|
17
|
+
\u2551 Fast batches (<20ms): ${o.length.toString().padStart(5)} (${(o.length/e.length*100).toFixed(0)}%) \u2551
|
|
18
|
+
\u2551 Slow batches (>100ms): ${r.length.toString().padStart(5)} (${(r.length/e.length*100).toFixed(0)}%) \u2551
|
|
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
|
+
\u2551 Time breakdown (avg): \u2551
|
|
21
|
+
\u2551 Filtering: ${e.reduce((i,l)=>i+l.filteringTime,0/e.length).toFixed(1).padStart(6)}ms \u2551
|
|
22
|
+
\u2551 Measurement: ${n.toFixed(1).padStart(6)}ms \u2190 Primary bottleneck \u2551
|
|
23
|
+
\u2551 Tracking: ${(e.reduce((i,l)=>i+l.trackingTime,0)/e.length).toFixed(1).padStart(6)}ms \u2551
|
|
24
|
+
\u2551 Callback: ${(e.reduce((i,l)=>i+l.callbackTime,0)/e.length).toFixed(1).padStart(6)}ms \u2551
|
|
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
|
+
`}},Ue=new fo});function ml(e){if(e.testID&&e.testID.trim())return true;let t=(e.componentName??"").trim();if(!t||On.has(t)||yo.has(t))return false;let n=(e.viewType??"").trim();return!(n&&On.has(n)&&t===n||/^comp(\s|$)/i.test(t)||t.startsWith("_"))}var On,yo,fl=kt(()=>{"use strict";U();On=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]),yo=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"])});var bo={};po(bo,{RenderTracker:()=>N,default:()=>To});var _n,vo,Co,N,To,Pe=kt(()=>{"use strict";U();mo();en();fl();_n=200,vo=150,Co=class{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:vo,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(e){if(this.isPaused)return;let t=String(e.nativeTag),n=Date.now(),r=this.renders.get(t);if(r){if(r.renderCount=e.count,r.lastRenderTime=n,r.color=e.color,e.measurements&&(r.measurements=e.measurements),e.testID&&!r.testID&&(r.testID=e.testID),e.nativeID&&!r.nativeID&&(r.nativeID=e.nativeID),e.accessibilityLabel&&!r.accessibilityLabel&&(r.accessibilityLabel=e.accessibilityLabel),e.componentName&&!r.componentName&&(r.componentName=e.componentName),e.renderCause&&(r.lastRenderCause=e.renderCause),this.settings.enableRenderHistory){let o=e.renderCause||{type:"unknown",timestamp:n};this.addRenderEvent(r,o,e.capturedProps,e.capturedState)}}else{let o={id:t,nativeTag:e.nativeTag,viewType:e.viewType,displayName:Fn(e.viewType),testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,componentName:e.componentName,renderCount:e.count,firstRenderTime:n,lastRenderTime:n,measurements:e.measurements,color:e.color,lastRenderCause:e.renderCause};if(this.settings.enableRenderHistory){o.renderHistory=[];let i=e.renderCause||{type:e.count===1?"mount":"unknown",timestamp:n};this.addRenderEvent(o,i,e.capturedProps,e.capturedState)}if(this.renders.set(t,o),this.renders.size>_n){let i=Array.from(this.renders.values()).sort((l,a)=>l.lastRenderTime-a.lastRenderTime).slice(0,this.renders.size-_n);for(let l of i)this.renders.delete(l.id)}}this.isBatchMode?this.batchDirty=true:this.notifyListeners()}addRenderEvent(e,t,n,r){e.renderHistory||(e.renderHistory=[]);let o={id:`${e.nativeTag}-${t.timestamp}`,timestamp:t.timestamp,cause:t,renderNumber:e.renderCount,capturedProps:this.settings.capturePropsOnRender?n:void 0,capturedState:this.settings.captureStateOnRender?r:void 0};e.renderHistory.push(o);let i=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));e.renderHistory.length>i&&(e.renderHistory=e.renderHistory.slice(-i)),this.notifyRenderEventCallbacks(o,e)}notifyRenderEventCallbacks(e,t){this.renderEventCallbacks.forEach(n=>{try{n(e,t)}catch{}})}emitRenderEvent(e){if(this.renderEventCallbacks.size===0)return;let t=Date.now(),n=e.renderCause||{type:"unknown",timestamp:t},r={id:String(e.nativeTag),nativeTag:e.nativeTag,viewType:e.viewType,displayName:Fn(e.viewType),testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,componentName:e.componentName,renderCount:e.count,firstRenderTime:t,lastRenderTime:t,measurements:e.measurements,color:e.color,lastRenderCause:n,renderHistory:[]},o={id:`${e.nativeTag}-${t}-${e.count}`,timestamp:t,renderNumber:e.count,cause:n,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(o,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(e=>({...e}))}passesFilters(e){if(this.filters.includePatterns.length>0&&!this.matchesAnyPatternForInfo(e,this.filters.includePatterns)||this.filters.excludePatterns.length>0&&this.matchesAnyPatternForInfo(e,this.filters.excludePatterns))return false;if(this.filters.includeViewType.size>0){let t=e.viewType||"",n=e.displayName||"";if(!this.matchesPattern(t,this.filters.includeViewType)&&!this.matchesPattern(n,this.filters.includeViewType))return false}if(this.filters.includeTestID.size>0&&(!e.testID||!this.matchesPattern(e.testID,this.filters.includeTestID))||this.filters.includeNativeID.size>0&&(!e.nativeID||!this.matchesPattern(e.nativeID,this.filters.includeNativeID))||this.filters.includeComponent.size>0&&(!e.componentName||!this.matchesPattern(e.componentName,this.filters.includeComponent)))return false;if(this.filters.excludeViewType.size>0){let t=e.viewType||"",n=e.displayName||"";if(this.matchesPattern(t,this.filters.excludeViewType)||this.matchesPattern(n,this.filters.excludeViewType))return false}return!(this.filters.excludeTestID.size>0&&e.testID&&this.matchesPattern(e.testID,this.filters.excludeTestID)||this.filters.excludeNativeID.size>0&&e.nativeID&&this.matchesPattern(e.nativeID,this.filters.excludeNativeID)||this.filters.excludeComponent.size>0&&e.componentName&&this.matchesPattern(e.componentName,this.filters.excludeComponent))}matchesAnyPatternForInfo(e,t){for(let n of t){let r=n.value.toLowerCase();switch(n.type){case"any":if(e.viewType.toLowerCase().includes(r)||e.displayName?.toLowerCase().includes(r)||e.testID?.toLowerCase().includes(r)||e.nativeID?.toLowerCase().includes(r)||e.componentName?.toLowerCase().includes(r)||e.accessibilityLabel?.toLowerCase().includes(r))return true;break;case"viewType":if(e.viewType.toLowerCase().includes(r)||e.displayName?.toLowerCase().includes(r))return true;break;case"testID":if(e.testID?.toLowerCase().includes(r))return true;break;case"nativeID":if(e.nativeID?.toLowerCase().includes(r))return true;break;case"component":if(e.componentName?.toLowerCase().includes(r))return true;break;case"accessibilityLabel":if(e.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(e=""){let t=this.getRenders();if(this.settings.showHostViews||(t=t.filter(ml)),e.trim()){let n=e.toLowerCase();t=t.filter(r=>r.viewType.toLowerCase().includes(n)||r.displayName.toLowerCase().includes(n)||r.testID?.toLowerCase().includes(n)||r.nativeID?.toLowerCase().includes(n)||r.accessibilityLabel?.toLowerCase().includes(n)||r.componentName?.toLowerCase().includes(n)||String(r.nativeTag).includes(n))}return t=t.filter(n=>this.passesFilters(n)),this.filters.minRenderCount!==void 0&&(t=t.filter(n=>n.renderCount>=this.filters.minRenderCount)),this.filters.maxRenderCount!==void 0&&(t=t.filter(n=>n.renderCount<=this.filters.maxRenderCount)),t.sort((n,r)=>r.lastRenderTime-n.lastRenderTime)}matchesPattern(e,t){let n=e.toLowerCase();for(let r of t){let o=r.toLowerCase();if(n.includes(o))return true}return false}getRender(e){return this.renders.get(e)}clear(){this.renders.clear(),this.notifyListeners()}resetRenderCount(e){let t=this.renders.get(e);t&&(t.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(e,t){let n=new Map;for(let[r,o]of this.renders)o.renderHistory&&o.renderHistory.length>0&&n.set(r,o.renderHistory);this.renders=new Map(e.map(r=>{let o=n.get(r.id),i=o&&!(r.renderHistory&&r.renderHistory.length>0)?{...r,renderHistory:o}:r;return[i.id,i]})),t&&(this.isTracking!==t.isTracking||this.isPaused!==t.isPaused)&&(this.isTracking=t.isTracking,this.isPaused=t.isPaused,this.notifyStateListeners()),this.notifyListeners()}hydrateRender(e){let t=this.renders.get(e.id);this.renders.set(e.id,t?{...t,...e}:e),this.notifyListeners()}getFilters(){return this.filters}setFilters(e){this.filters={...this.filters,...e},this.notifyListeners(),this.notifyFilterListeners()}addIncludePattern(e,t){let n=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[n].add(t),this.notifyListeners()}removeIncludePattern(e,t){let n=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[n].delete(t),this.notifyListeners()}addExcludePattern(e,t){let n=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[n].add(t),this.notifyListeners()}removeExcludePattern(e,t){let n=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[n].delete(t),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 e=new Set,t=new Set,n=new Set,r=new Set,o=new Set;for(let i of this.renders.values())i.viewType&&e.add(i.viewType),i.testID&&t.add(i.testID),i.nativeID&&n.add(i.nativeID),i.componentName&&r.add(i.componentName),i.accessibilityLabel&&o.add(i.accessibilityLabel);return{viewTypes:Array.from(e).sort(),testIDs:Array.from(t).sort(),nativeIDs:Array.from(n).sort(),componentNames:Array.from(r).sort(),accessibilityLabels:Array.from(o).sort()}}getStats(){let e=0;for(let t of this.renders.values())e+=t.renderCount;return{totalComponents:this.renders.size,totalRenders:e}}subscribe(e){return this.listeners.add(e),e(this.getRenders()),()=>{this.listeners.delete(e)}}subscribeToState(e){return this.stateListeners.add(e),e(this.getState()),()=>{this.stateListeners.delete(e)}}subscribeToSettings(e){return this.settingsListeners.add(e),e(this.settings),()=>{this.settingsListeners.delete(e)}}subscribeToFilters(e){return this.filterListeners.add(e),e(this.filters),()=>{this.filterListeners.delete(e)}}onRenderEvent(e){return this.renderEventCallbacks.add(e),()=>{this.renderEventCallbacks.delete(e)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(e){let t=this.filters;return!(t.includePatterns.length>0&&!this.matchesAnyPatternForInfo(e,t.includePatterns)||t.excludePatterns.length>0&&this.matchesAnyPatternForInfo(e,t.excludePatterns)||(t.includeViewType.size>0||t.includeTestID.size>0||t.includeNativeID.size>0||t.includeComponent.size>0)&&!(t.includeViewType.size>0&&t.includeViewType.has(e.viewType)||t.includeTestID.size>0&&e.testID&&t.includeTestID.has(e.testID)||t.includeNativeID.size>0&&e.nativeID&&t.includeNativeID.has(e.nativeID)||t.includeComponent.size>0&&e.componentName&&t.includeComponent.has(e.componentName))||t.excludeViewType.has(e.viewType)||e.testID&&t.excludeTestID.has(e.testID)||e.nativeID&&t.excludeNativeID.has(e.nativeID)||e.componentName&&t.excludeComponent.has(e.componentName))}getSettings(){return{...this.settings}}setSettings(e){e.batchSize!==void 0&&(e.batchSize=Math.max(10,Math.min(500,e.batchSize))),e.maxRenderHistoryPerComponent!==void 0&&(e.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,e.maxRenderHistoryPerComponent))),e.enableRenderHistory&&!this.settings.trackRenderCauses&&(e.trackRenderCauses=true),e.trackRenderCauses===false&&this.settings.enableRenderHistory&&(e.enableRenderHistory=false),this.settings={...this.settings,...e},e.performanceLogging!==void 0&&Ue.setEnabled(e.performanceLogging),this.notifySettingsListeners()}clearAllRenderHistory(){for(let e of this.renders.values())e.renderHistory=[];this.notifyListeners()}clearRenderHistory(e){let t=this.renders.get(e);t&&(t.renderHistory=[],this.notifyListeners())}getRenderHistoryStats(){let e=0,t=0;for(let n of this.renders.values())n.renderHistory&&n.renderHistory.length>0&&(e+=n.renderHistory.length,t++);return{totalEvents:e,componentsWithHistory:t,averageEventsPerComponent:t>0?e/t:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(e){this.setSettings({batchSize:e})}notifyListeners(){let e=this.getRenders();for(let t of this.listeners)try{t(e)}catch(n){console.error("[RenderTracker] Error in listener:",n)}}notifyStateListeners(){let e=this.getState();for(let t of this.stateListeners)try{t(e)}catch(n){console.error("[RenderTracker] Error in state listener:",n)}}notifySettingsListeners(){let e=this.getSettings();for(let t of this.settingsListeners)try{t(e)}catch(n){console.error("[RenderTracker] Error in settings listener:",n)}}notifyFilterListeners(){let e=this.getFilters();for(let t of this.filterListeners)try{t(e)}catch(n){console.error("[RenderTracker] Error in filter listener:",n)}}},N=new Co,To=N});U();U();import{useState as Wn,useEffect as jn,useCallback as yl}from"react";import{HighlighterIcon as So,HighlightIcon as wo}from"@buoy-gg/floating-tools-core/web";U();import{getDOMFiber as Un,getDOMNodeHandle as bl,getDOMPublicInstance as vl,isDOMElement as Cl}from"@buoy-gg/shared-ui/web/utils";U();var ot=null,it=null,Lt=false,zt=false,tn=null;function xo(e){if(!e)return{type:"null"};let t=e,n={};if(t.canonical){n.type="Fabric";let r=t.canonical;if(r.publicInstance){let o=r.publicInstance;n.hasMeasure=typeof o.measure=="function",n.nativeTag=o.__nativeTag??o._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}function Tl(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;!e||typeof e.emit!="function"||ot||(ot=e.emit.bind(e),e.emit=function(t,...n){if(t==="traceUpdates"&&zt){let r=n[0];r.size>0&&console.log(`[PROFILER] traceUpdates: ${r.size} nodes`,Array.from(r).map((o,i)=>({index:i,...xo(o)}))),tn&&tn(r)}return ot(t,...n)})}function Sl(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.reactDevtoolsAgent;!e||typeof e.emit!="function"||it||(it=e.emit.bind(e),e.emit=function(t,...n){if(zt&&t==="drawTraceUpdates"){let r=n[0];r.length>0&&console.log(`[PROFILER] drawTraceUpdates: ${r.length} nodes`,r.map((o,i)=>({index:i,color:o.color,...xo(o.node)})))}return it(t,...n)})}function wl(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;e?.rendererInterfaces&&e.rendererInterfaces.forEach(t=>{if(typeof t.setTraceUpdatesEnabled=="function")try{t.setTraceUpdatesEnabled(false)}catch{}})}function Io(e){tn=e}function Ro(){typeof Z<"u"&&!Z||Lt||(Tl(),Sl(),Lt=true)}function Do(){if(!Lt)return;let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;ot&&e&&(e.emit=ot,ot=null),it&&e?.reactDevtoolsAgent&&(e.reactDevtoolsAgent.emit=it,it=null),wl(),tn=null,Lt=false}function xl(){return Lt}function Il(){zt=true}function Rl(){zt=false}function Dl(){return zt}var ko={};po(ko,{AccessibilityInfo:()=>zl,ActivityIndicator:()=>bs,Alert:()=>Cs,Animated:()=>Nl,AppRegistry:()=>Bl,AppState:()=>Al,Appearance:()=>Vl,BackHandler:()=>Hl,Button:()=>vs,CheckBox:()=>Jl,Clipboard:()=>Ml,DeviceEventEmitter:()=>us,Dimensions:()=>Nt,Easing:()=>$l,FlatList:()=>Po,I18nManager:()=>El,Image:()=>Yl,ImageBackground:()=>Xl,InteractionManager:()=>Ol,Keyboard:()=>Fl,KeyboardAvoidingView:()=>Ql,LayoutAnimation:()=>_l,Linking:()=>Wl,LogBox:()=>cs,Modal:()=>zo,NativeEventEmitter:()=>jl,NativeModules:()=>Ll,PanResponder:()=>Ul,Picker:()=>Zl,PixelRatio:()=>Gn,Platform:()=>Gl,Pressable:()=>Lo,ProgressBar:()=>es,RefreshControl:()=>ts,SafeAreaView:()=>ns,ScrollView:()=>Ve,SectionList:()=>rs,Share:()=>Kl,StatusBar:()=>os,StyleSheet:()=>fe,Switch:()=>at,Text:()=>g,TextInput:()=>nn,Touchable:()=>is,TouchableHighlight:()=>fs,TouchableNativeFeedback:()=>as,TouchableOpacity:()=>J,TouchableWithoutFeedback:()=>ys,UIManager:()=>Kn,Vibration:()=>ql,View:()=>h,VirtualizedList:()=>ls,YellowBox:()=>ss,findNodeHandle:()=>Vt,unstable_createElement:()=>Pl,useColorScheme:()=>ds,useLocaleContext:()=>hs,useWindowDimensions:()=>gs});U();ll(ko,kl);import*as kl from"react-native-web";import{unstable_createElement as Pl,NativeModules as Ll,AccessibilityInfo as zl,Animated as Nl,Appearance as Vl,AppRegistry as Bl,AppState as Al,BackHandler as Hl,Clipboard as Ml,Dimensions as Nt,Easing as $l,I18nManager as El,Keyboard as Fl,InteractionManager as Ol,LayoutAnimation as _l,Linking as Wl,NativeEventEmitter as jl,PanResponder as Ul,PixelRatio as Gn,Platform as Gl,Share as Kl,StyleSheet as fe,UIManager as Kn,Vibration as ql,CheckBox as Jl,FlatList as Po,Image as Yl,ImageBackground as Xl,KeyboardAvoidingView as Ql,Picker as Zl,ProgressBar as es,RefreshControl as ts,SafeAreaView as ns,SectionList as rs,StatusBar as os,Touchable as is,TouchableNativeFeedback as as,VirtualizedList as ls,YellowBox as ss,LogBox as cs,DeviceEventEmitter as us,useColorScheme as ds,useLocaleContext as hs,useWindowDimensions as gs}from"react-native-web";import*as ye from"react-native-web";import{createElement as ps,forwardRef as ms}from"react";function Ce(e){let t=ms((r,o)=>{let{accessibilityState:i,accessibilityValue:l,...a}=r;for(let c of["busy","checked","disabled","expanded","selected"])i?.[c]!==void 0&&a[`aria-${c}`]===void 0&&(a[`aria-${c}`]=i[c]);for(let[c,s]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))l?.[c]!==void 0&&a[`aria-${s}`]===void 0&&(a[`aria-${s}`]=l[c]);return ps(e,{...a,ref:o})}),n=e.State;return n&&Object.assign(t,{State:n}),t.displayName=e.displayName??e.name??"NativeWebView",t}var h=Ce(ye.View),g=Ce(ye.Text),nn=Ce(ye.TextInput),J=Ce(ye.TouchableOpacity),fs=Ce(ye.TouchableHighlight),ys=Ce(ye.TouchableWithoutFeedback),Lo=Ce(ye.Pressable),Ve=Ce(ye.ScrollView),zo=Ce(ye.Modal),at=Ce(ye.Switch),bs=Ce(ye.ActivityIndicator),vs=Ce(ye.Button),Vt=ye.findNodeHandle,Cs={alert(e,t,n,r){if(typeof document>"u")return;let o=document.createElement("dialog");o.dataset.buoyRoot="",o.setAttribute("aria-label",e),o.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",o.appendChild(i),t){let s=document.createElement("p");s.textContent=t,s.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",o.appendChild(s)}let l=document.createElement("div");l.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let a=n?.length?n:[{text:"OK"}],c=()=>{o.close?.(),o.remove()};for(let s of a){let d=document.createElement("button");d.type="button",d.textContent=s.text??"OK",d.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${s.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,d.onclick=()=>{c(),s.onPress?.()},l.appendChild(d)}o.addEventListener("cancel",s=>{s.preventDefault(),r?.cancelable!==false&&(c(),r?.onDismiss?.())}),o.appendChild(l),document.body.appendChild(o),o.showModal?o.showModal():o.setAttribute("open","")}};Pe();U();import{getDOMControlProps as Ts,getDOMNodeHandle as Ss,getDOMPublicInstance as ws,isDOMElement as xs}from"@buoy-gg/shared-ui/web/utils";U();function Is(e){return e?e.x>=-.1&&e.x<=1.1&&e.y>=-.1&&e.y<=1.1:false}function qn(e,t,n){if(!e||t<=0||n<=0)return false;let r=e.x+e.width/2,o=e.y+e.height/2,i=t*.1,l=n*.1;return r>=-i&&r<=t+i&&o>=-l&&o<=n+l}function No(e){return String(e??"").toLowerCase().replace(/\s+/g," ").replace(/(\d)[,\u00a0\u202f](?=\d{3}\b)/g,"$1").trim()}function Jn(e,t){if(t.nativeTag!=null&&e.nativeTag===t.nativeTag)return 1e3;let n=String(t.query??t.testID??"").trim().toLowerCase();if(!n)return 0;let r=[e.testID,e.label,e.text,e.name].filter(Boolean).map(l=>l.toLowerCase()),o=0;for(let l of r)l===n?o=Math.max(o,100):l.startsWith(n)?o=Math.max(o,50):l.includes(n)&&(o=Math.max(o,25));let i=No(n);if(i)for(let l of r){let a=No(l);a===i?o=Math.max(o,90):a.startsWith(i)?o=Math.max(o,45):a.includes(i)&&(o=Math.max(o,22))}return t.testID&&e.testID&&e.testID.toLowerCase()===t.testID.toLowerCase()&&(o=Math.max(o,200)),o===0?0:((e.testID??"").toLowerCase().startsWith("buoy-dial-")&&(o+=40),e.tap&&(Is(e.tap)?o+=20:o-=40),o)}var Rs=22,Vo=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function Bo(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}var Yn=0,Ao=false;function Ds(){if(Ao)return;let e=Bo();if(!e)return;let t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){return Yn++,typeof t=="function"?t.apply(e,n):void 0},Ao=true}var ks=250;function Ps(){let e=new Map;return t=>{let n=[],r=t,o=0,i=false;for(;r&&o<400;){let l=e.get(r);if(l!==void 0){i=l;break}if(Be(r)?.__buoyDevToolsRoot){i=true,e.set(r,true);break}n.push(r),r=r.return,o++}for(let l of n)e.set(l,i);return i}}function Ho(){let e=Bo();if(!e)return[];let t=[];try{if(e.renderers&&typeof e.renderers.forEach=="function"&&e.renderers.forEach((n,r)=>{try{let o=e.getFiberRoots?.(r);o&&o.forEach(i=>t.push(i))}catch{}}),t.length===0&&e.getFiberRoots){let n=e.getFiberRoots(1);n&&n.forEach(r=>t.push(r))}}catch{}return t}function Ls(e){return e.tag===Rs&&e.memoizedState!==null}function zs(e){let t=e.memoizedProps?.activityState;return t===0||t===1||e.memoizedProps?.isPageFocused===false}function Bt(e,t,n=0,r=new Set){if(!(!e||r.has(e)||n>500)){if(r.add(e),Ls(e)||zs(e)){e.sibling&&Bt(e.sibling,t,n,r);return}t(e),e.child&&Bt(e.child,t,n+1,r),e.sibling&&Bt(e.sibling,t,n,r)}}function Mo(e){let t=ws(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}function Xn(e){let t=Ss(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}function Ns(e){let t=Mo(e.stateNode);if(t)return{instance:t,nativeTag:Xn(e.stateNode),stateNode:e.stateNode};let n=[];e.child&&n.push(e.child);let r=0;for(;n.length>0&&r<4e3;){r++;let o=n.pop();if(!o)continue;let i=Mo(o.stateNode);if(i)return{instance:i,nativeTag:Xn(o.stateNode),stateNode:o.stateNode};o.child&&n.push(o.child),o.sibling&&n.push(o.sibling)}return null}function Vs(e){let t=e,n=0;for(;t&&n++<200;){let r=t.stateNode;if(r&&typeof r.scrollTo=="function"){let o=typeof r.getNativeScrollRef=="function"&&r.getNativeScrollRef()||null,i=typeof r.getInnerViewNode=="function"&&r.getInnerViewNode()||typeof r.getScrollableNode=="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:o,innerNode:i}}t=t.return}return null}async function Bs(e,t,n,r){try{if(xs(n))return n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}),await new Promise(c=>setTimeout(c,16)),true;let o=Vs(e);if(!o)return false;let i=t,l=null,a=c=>new Promise(s=>{let d=false,b=y=>{d||(d=true,s(y))},C=setTimeout(()=>b(null),600);try{c(y=>{clearTimeout(C),b(y)})}catch{clearTimeout(C),b(null)}});if(o.nativeRef&&typeof i.measureLayout=="function"&&(l=await a(c=>i.measureLayout(o.nativeRef,(s,d)=>c(d),()=>c(null)))),l==null){let c=Vt(t),s=typeof o.innerNode=="number"?o.innerNode:Vt(o.innerNode);c!=null&&s!=null&&(l=await a(d=>Kn.measureLayout(c,s,()=>d(null),(b,C)=>d(C))))}return l==null?false:(o.instance.scrollTo({y:Math.max(0,l-r),animated:false}),await new Promise(c=>setTimeout(c,120)),true)}catch{return false}}function $o(e){let t=e?.type;return t?typeof t=="string"?t:t.displayName||t.name||null:null}function As(e){let t=e?._debugOwner||e?.return,n=0;for(;t&&n<30;){n++;let r=$o(t);if(r&&!Vo.has(r)&&typeof t.type!="string")return r;t=t.return}return null}function Be(e){return Ts(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}function Eo(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 r of e){let o=Eo(r,t+1);o&&n.push(o)}return n.length>0?n.join(""):void 0}}function Hs(e){return e.replace(/\s+/g," ").trim()}function Fo(e){if(!e)return;let t=n=>{let r=Eo(n);if(r===void 0)return;let o=Hs(r);return o?o.slice(0,80):void 0};return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}function Ms(e,t){let n=[],r=(i,l)=>{if(!i||l>t||n.length>=4)return;if(i!==e){let c=Be(i);if(c&&(typeof c.onPress=="function"||typeof c.onLongPress=="function"))return}let a=Fo(Be(i));a&&!n.includes(a)&&n.push(a),i.child&&r(i.child,l+1),i!==e&&i.sibling&&r(i.sibling,l)};e.child&&r(e.child,1);let o=n.join(" ").trim();return o?o.slice(0,80):void 0}function $s(e){let t=e,n=0,r=null,o=null;for(;t&&n<25&&!(r&&o);){let i=Be(t);i&&(!r&&typeof i.onPress=="function"&&(r=i.onPress),!o&&typeof i.onLongPress=="function"&&(o=i.onLongPress)),t=t.return,n++}return r?{handler:r,kind:"onPress",longPress:o??void 0}:o?{handler:o,kind:"onLongPress"}:null}function rn(e){return new Promise(t=>{let n=false,r=o=>{n||(n=true,t(o))};setTimeout(()=>r(null),1e3);try{typeof e.measureInWindow=="function"?e.measureInWindow((o,i,l,a)=>{l>0&&a>0?r({x:o,y:i,width:l,height:a}):r(null)}):typeof e.measure=="function"?e.measure((o,i,l,a,c,s)=>{l>0&&a>0&&c!=null&&s!=null?r({x:c,y:s,width:l,height:a}):r(null)}):r(null)}catch{r(null)}})}var Es=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function Qn(){let e=Ho();if(e.length===0)return[];let t=[],n=new Map,r=new Map,o=Ps();for(let i of e)Bt(i.current,l=>{let a=Be(l);if(!a)return;let c=typeof a.onPress=="function"||typeof a.onLongPress=="function",s=typeof a.onValueChange=="function",d=typeof a.onChangeText=="function",b=a.testID||void 0,C=a.accessibilityLabel||void 0,y=a.accessibilityRole||a.role||void 0,v=Fo(a),m=y==="button"||y==="link"||y==="menuitem"||y==="tab"||y==="switch"||y==="checkbox",w=typeof l.type=="string"&&Es.has(l.type)&&a.animating!==false;if(!c&&!s&&!d&&!b&&!C&&!v&&!m&&!w)return;let u=null,x=null,R=null;if(s){let T=a.value,L=typeof T=="number"||typeof a.minimumValue=="number";x={handler:a.onValueChange,kind:L?"slider":"toggle",current:T,min:typeof a.minimumValue=="number"?a.minimumValue:void 0,max:typeof a.maximumValue=="number"?a.maximumValue:void 0}}else d?R={handler:a.onChangeText,current:typeof a.value=="string"?a.value:void 0}:u=$s(l);let H=$o(l),k=H??"Unknown";(!H||Vo.has(H)||typeof l.type=="string")&&(k=As(l)??H??"Unknown");let D=Ns(l);if(!D&&!b)return;!v&&!C&&c&&(v=Ms(l,6));let W=D?.instance??null,Q=D?.nativeTag??null,z=(W?n.get(W):void 0)??(Q!=null?r.get(Q):void 0);if(z){!z.press&&u?z.press=u:z.press&&u?.longPress&&!z.press.longPress&&(z.press.longPress=u.longPress),!z.valueControl&&x&&(z.valueControl=x),!z.textControl&&R&&(z.textControl=R),!z.testID&&b&&(z.testID=b),!z.label&&C&&(z.label=C),!z.text&&v&&(z.text=v),W&&!n.has(W)&&n.set(W,z),Q!=null&&!r.has(Q)&&r.set(Q,z);return}let _={nativeTag:Q,name:k,role:y??(w?"progressbar":void 0),testID:b,label:C,text:v,instance:W,stateNode:D?.stateNode??null,fiber:l,press:u,valueControl:x,textControl:R,rect:null,buoy:o(l)};t.push(_),W&&n.set(W,_),Q!=null&&r.set(Q,_)});return t}function Fs(e,t){return t.nativeTag!=null?e.nativeTag===t.nativeTag:t.testID&&e.testID?e.testID.toLowerCase()===t.testID.toLowerCase():false}function Oo(e){let t=Qn();return e.includeBuoy?t:t.filter(n=>!n.buoy||Fs(n,e))}async function _o(e){await Promise.all(e.map(async t=>{t.instance&&(t.rect=await rn(t.instance))}))}async function Wo(e={}){let t=Qn(),n=e.includeBuoy?t:t.filter(c=>!c.buoy),r=t.length-n.length;await _o(n);let o=Nt.get("window"),i=Math.round(o.width)||1,l=Math.round(o.height)||1,a=[];for(let c of n){let s=c.rect;if(!s&&!c.testID)continue;let d,b;if(s){let v=s.x+s.width/2,m=s.y+s.height/2;if(m<-l*.1||m>l*1.1||v<-i*.1||v>i*1.1)continue;d={x:lt(v/i),y:lt(m/l)},b={x:lt(s.x/i),y:lt(s.y/l),width:lt(s.width/i),height:lt(s.height/l)}}let C=c.valueControl?c.valueControl.kind:c.textControl?"text":void 0,y=c.valueControl?c.valueControl.current:c.textControl?.current;a.push({nativeTag:c.nativeTag,name:c.name,role:c.role,testID:c.testID,label:c.label,text:c.text,interactive:!!(c.press||c.valueControl||c.textControl),longPressable:c.press&&(c.press.kind==="onLongPress"||c.press.longPress)?true:void 0,control:C,value:y,tap:d,frame:b})}return a.sort((c,s)=>{let d=c.tap?.y??2,b=s.tap?.y??2;return Math.abs(d-b)>.02?d-b:(c.tap?.x??2)-(s.tap?.x??2)}),{screen:{width:i,height:l},count:a.length,elements:a,...r>0?{hiddenBuoy:r}:{}}}function lt(e){return Math.round(e*100)/100}function jo(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}function Uo(e,t){return Jn(jo(e),t)}function Go(e,t,n){if(!(!e||!t||!n))return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}function Ko(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:()=>{},preventDefault:()=>{},stopPropagation:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,target:null,currentTarget:null,type:"press",timeStamp:0}}async function Os(e){let t=Oo(e);if(t.length===0)return{tapped:false,reason:"No React fiber roots / elements found on screen."};let n=t.map(u=>({c:u,score:Uo(u,e)})).filter(u=>u.score>0).sort((u,x)=>x.score-u.score),r=u=>!!(u.press||u.valueControl||u.textControl);if(n.length===0)return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(r).slice(0,12).map(u=>({nativeTag:u.nativeTag,name:u.name,testID:u.testID,text:u.text}))};let o=Nt.get("window"),i=o.width||1,l=o.height||1,a=n.slice(0,15);await Promise.all(a.map(async u=>{u.c.instance&&!u.c.rect&&(u.c.rect=await rn(u.c.instance))}));for(let u of a)u.score=Jn({...jo(u.c),tap:Go(u.c.rect,i,l)},e);a.sort((u,x)=>x.score-u.score);let c=a.find(u=>r(u.c))??n.find(u=>r(u.c))??a[0],s=c.c,d=(u,x)=>u.press&&u.press.handler===x.press?.handler||u.valueControl&&u.valueControl.handler===x.valueControl?.handler||u.textControl&&u.textControl.handler===x.textControl?.handler,b=a.filter(u=>u!==c&&r(u.c)&&u.score===c.score).filter(u=>!d(u.c,s)).filter((u,x,R)=>R.findIndex(H=>d(H.c,u.c))===x).slice(0,3).map(u=>({nativeTag:u.c.nativeTag,name:u.c.name,testID:u.c.testID,text:u.c.text,tap:Go(u.c.rect,i,l)}));if(!r(s))return{tapped:false,reason:`Matched "${s.name}"${s.text?` ("${s.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:s.nativeTag,name:s.name,testID:s.testID,label:s.label,text:s.text,via:"onPress"}};s.instance&&!s.rect&&(s.rect=await rn(s.instance));let C=false;(s.rect==null||!qn(s.rect,i,l))&&e.scrollIntoView!==false&&s.instance&&(C=await Bs(s.fiber,s.instance,s.stateNode,80),C&&(s.rect=await rn(s.instance)));let y={nativeTag:s.nativeTag,name:s.name,testID:s.testID,label:s.label,text:s.text};Ds();let v=Yn,m=Date.now(),w=async u=>(await new Promise(x=>setTimeout(x,ks)),{tapped:true,scrolled:C,matched:u,effect:{commits:Yn-v,observedMs:Date.now()-m},...b.length?{alsoMatched:b}:{}});try{if(s.press){if(e.longPress){let x=s.press.kind==="onLongPress"?s.press.handler:s.press.longPress;return x?(x(Ko(s.rect)),await w({...y,via:"onLongPress"})):{tapped:false,scrolled:C,reason:`Matched "${s.name}"${s.text?` ("${s.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...y,via:"onPress"}}}return s.press.handler(Ko(s.rect)),await w({...y,via:s.press.kind})}if(s.valueControl){let x=s.valueControl,R;if(x.kind==="toggle")R=typeof e.value=="boolean"?e.value:!x.current;else{let H=x.min??0,k=x.max??1;typeof e.value=="number"?R=Math.min(k,Math.max(H,e.value)):R=x.current===k?H:k}return x.handler(R),await w({...y,via:"onValueChange",value:R})}let u=e.text??(typeof e.value=="string"?e.value:"");return s.textControl.handler(u),await w({...y,via:"onChangeText",value:u})}catch(u){return{tapped:false,scrolled:C,reason:`handler threw: ${u instanceof Error?u.message:String(u)}`,matched:{...y,via:s.press?s.press.kind:s.valueControl?"onValueChange":"onChangeText"}}}}var _s=5e3,Ws=3e4,js=50,Us=150;async function Gs(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??_s,0),Ws),n=Math.max(e.pollMs??Us,js),r=e.gone===true,o=Date.now(),i=0;for(;;){i+=1;let{hit:l,closest:a}=await Ks(e);if(r?!l:l)return{ok:true,waitedMs:Date.now()-o,polls:i,matched:l??void 0};if(Date.now()-o>=t){let c=a?.length?a:void 0,s=r?`Still on screen after ${t}ms.`:c?`Not on screen after ${t}ms \u2014 ${c.length===1?"one element":`${c.length} elements`} matched but ${c.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()-o,polls:i,reason:s,matched:l??void 0,closest:c}}await new Promise(c=>setTimeout(c,n))}}async function Ks(e){let t=Oo(e).map(a=>({c:a,score:Uo(a,e)})).filter(a=>a.score>0).sort((a,c)=>c.score-a.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await _o(t.map(a=>a.c));let n=Nt.get("window"),r=Math.round(n.width)||1,o=Math.round(n.height)||1,i=null;for(let{c:a}of t)if(qn(a.rect,r,o)){i={nativeTag:a.nativeTag,name:a.name,testID:a.testID,label:a.label,text:a.text,interactive:!!(a.press||a.valueControl||a.textControl)};break}let l=t.slice(0,3).map(({c:a})=>({name:a.name,testID:a.testID,text:a.text,onScreen:qn(a.rect,r,o)}));return{hit:i,closest:l}}function qs(e){let t=e,n=0;for(;t&&n<400;){if(Be(t)?.__buoyDevToolsRoot)return true;t=t.return,n++}return false}function Js(e,t){let n=Be(e.fiber);if(typeof n?.onPress=="function"||typeof n?.onValueChange=="function"||typeof n?.onChangeText=="function")return e;let r=null,o=e.fiber?.return,i=0;for(;o&&i<25;){if(typeof Be(o)?.onPress=="function"){r=o;break}o=o.return,i++}if(!r)return e;let l=r;for(let a=0;a<6&&l;a++){let c=t.get(l);if(c)return c;l=l.return}return e}function qo(e){let t=Qn();if(t.length===0)return null;let n=new Map;for(let a of t)n.set(a.fiber,a);let r=t.find(a=>a.nativeTag===e),o=null;if(!r){for(let a of Ho())if(Bt(a.current,c=>{o||c.stateNode&&Xn(c.stateNode)===e&&(o=c)}),o)break}let i=r??null;if(!i&&o){let a=o,c=0,s=null;for(;a&&c<25;){let d=n.get(a);if(d){if(d.press||d.valueControl||d.textControl){i=d;break}s||(s=d)}a=a.return,c++}i||(i=s)}if(!i||(i=Js(i,n),!i.press&&!i.valueControl&&!i.textControl)||qs(i.fiber))return null;let l=i.valueControl?i.valueControl.kind:i.textControl?"text":"press";return{nativeTag:i.nativeTag,name:i.name,role:i.role,testID:i.testID,label:i.label,text:i.text,control:l,value:i.valueControl?i.valueControl.current:i.textControl?i.textControl.current:void 0}}en();U();U();function Ys(e){return!!e&&typeof e=="object"&&("next"in e||"queue"in e||"memoizedState"in e)}function Jo(e,t,n){if(e===t)return false;if(n?.isClassComponent||!Ys(t))return true;let r=e,o=t;for(let i=0;o!=null&&i<64;i++){if(o.queue!=null&&(r==null||!Object.is(r.memoizedState,o.memoizedState)))return true;o=o.next,r=r!=null?r.next:null}return false}function Xs(e,t){return Jo(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===1})}var Yo={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 Qs(e){return e&&Yo[e]||Yo.default}var on=new WeakMap;function Zn(e){if(!e)return;let t=on.get(e);if(t||e.alternate&&(t=on.get(e.alternate),t))return t}function Zs(e,t){e&&(on.set(e,t),e.alternate&&on.set(e.alternate,t))}var Te=new Map,er=500,ec=10,tr=50,Xo=50,tc=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 Qo(e){return!!(!e||tc.has(e)||e.startsWith("Animated"))}function Zo(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,r=null;for(;t&&n<30;){let o=t.tag;if(o===0||o===1||o===11||o===15){let i=Ae(t);if(r||(r=t),!Qo(i))return t}t=t.return,n++}return r}function Ae(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.name)return t.name;if(t.displayName)return t.displayName}return null}function nc(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"}function rc(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}}function st(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=[],r=t,o=0;for(;r!==null&&o<tr;){let i=nc(r),l=rc(r,i);n.push({index:o,type:i,value:l,rawState:r.memoizedState}),r=r.next,o++}return n.length>0?n:null}function oc(e,t){if(!e||!t)return null;let n=[],r=Math.max(e.length,t.length);for(let o=0;o<r;o++){let i=e[o],l=t[o];if(!i&&l){n.push({index:o,type:l.type,currentValue:an(l.value,l.type),description:`Hook[${o}] added`});continue}if(i&&!l){n.push({index:o,type:i.type,previousValue:an(i.value,i.type),description:`Hook[${o}] removed`});continue}if(i&&l){if(i.rawState===l.rawState||l.type==="useEffect"||l.type==="useMemo"||l.type==="useCallback")continue;if(l.type==="useState"||l.type==="useReducer"||l.type==="useRef"){let a=an(i.value,i.type),c=an(l.value,l.type);n.push({index:o,type:l.type,previousValue:a,currentValue:c,description:`${a} \u2192 ${c}`})}}}return n.length>0?n:null}function an(e,t){return ct(e)}function ct(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)}function ic(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e,n=e.alternate,r=Zn(e);if(r&&n){let c=st(e),s=st(n),d=r.extractedHooks;if(c&&s&&d&&d.length>0){let b=d.find(C=>C.type==="useState");if(b){let C=c.find(v=>v.index===b.index),y=s.find(v=>v.index===b.index);if(C&&y){let v=C.value===b.value,m=y.value===b.value;v&&!m&&(t=n,n=e)}}}}let o=st(t),i=null,l=null,a=null;return n?(i=n.memoizedProps,l=n.memoizedState,a=st(n)):r&&(i=r.memoizedProps,l=r.memoizedState,a=r.extractedHooks),Zs(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:o}),i===null?{cause:"mount",hookChanges:null}:nr(i,t.memoizedProps)?Jo(l,t.memoizedState,{isClassComponent:t.tag===1})?{cause:"state",hookChanges:oc(a,o)}:{cause:"parent",hookChanges:null}:{cause:"props",hookChanges:null}}function nr(e,t){if(e===t)return true;if(!e||!t||typeof e!="object"||typeof t!="object")return false;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return false;for(let o of n)if(e[o]!==t[o])return false;return true}function ut(e,t=3){let n=new WeakSet;function r(o,i){if(i>t)return"[MAX_DEPTH]";if(o===null)return null;if(o===void 0)return;if(typeof o=="function")return`[Function: ${o.name||"anonymous"}]`;if(typeof o=="symbol")return`[Symbol: ${o.toString()}]`;if(typeof o!="object")return o;if(n.has(o))return"[Circular]";if(n.add(o),Array.isArray(o))return o.slice(0,10).map(c=>r(c,i+1));let l={},a=Object.keys(o).slice(0,20);for(let c of a)try{l[c]=r(o[c],i+1)}catch{l[c]="[Error accessing]"}return l}return r(e,0)}function At(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})`}function ac(e,t){if(!(!t.hookChanges||t.hookChanges.length===0))for(let n of t.hookChanges)console.log(`[${e||"Unknown"}] ${n.type}[${n.index}]: ${n.previousValue} \u2192 ${n.currentValue}`)}function lc(e,t,n,r,o){let i=Ae(n)||"Unknown",l=typeof t?.type=="string"?t.type:"Unknown",{cause:a,hookChanges:c}=r;if(console.log(`[RENDER] ${i} (${l}:${e}) | Cause: ${a.toUpperCase()}`+(o&&o.length>0?` | Props: [${o.join(", ")}]`:"")),c&&c.length>0)for(let s of c)console.log(` \u2514\u2500 ${s.type}[${s.index}]: ${s.previousValue} \u2192 ${s.currentValue}`)}function ei(e,t,n,r,o,i,l){let a=Ae(n)||"Unknown",c=typeof t?.type=="string"?t.type:"Unknown";console.log(`
|
|
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(`Render #${l} for ${c} (nativeTag: ${e})`),console.log(`Timestamp: ${new Date().toISOString()}`),console.log(`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\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(`NATIVE FIBER (${c}):`),console.log(` type: "${t?.type}"`),console.log(` tag: ${t?.tag} (${At(t?.tag)})`);let s=t?.alternate;console.log(` Previous values source: ${s?"alternate":r?"storage":"none"}`);let d=t?.memoizedProps?.children,b=s?.memoizedProps?.children,C=b!==void 0?b:r?.memoizedProps?.children,y=C!==void 0?d!==C:false;console.log(` memoizedProps.children: ${ct(d)}${y?` (was: ${ct(C)})`:C!==void 0?" (unchanged)":" (first render)"}`);let v=t?.memoizedProps?.style,m=s?.memoizedProps?.style,w=m!==void 0?m:r?.memoizedProps?.style,u=w!==void 0?v!==w:false;if(v&&(console.log(` memoizedProps.style: ${JSON.stringify(ut(v,2))}${u?" (REFERENCE CHANGED)":""}`),u&&w)){let z=ln(v,w);console.log(` \u2514\u2500 Values actually changed: ${!z}`)}console.log(` All memoizedProps keys: [${Object.keys(t?.memoizedProps||{}).join(", ")}]`);let x=t?.memoizedProps?.testID,R=t?.memoizedProps?.nativeID,H=t?.memoizedProps?.accessibilityLabel;if(x&&console.log(` testID: "${x}"`),R&&console.log(` nativeID: "${R}"`),H&&console.log(` accessibilityLabel: "${H}"`),console.log(` alternate: ${s?"YES":"NO"}`),s&&console.log(` alternate.memoizedProps.children: ${ct(b)}`),console.log(" Tree structure:"),console.log(` return (parent): ${t?.return?At(t.return.tag):"null"}`),console.log(` child: ${t?.child?At(t.child.tag):"null"}`),console.log(` sibling: ${t?.sibling?At(t.sibling.tag):"null"}`),console.log(""),console.log(`COMPONENT FIBER (${a}):`),n){if(console.log(` name: "${a}"`),console.log(` type: ${typeof n.type} (${n.type?.name||n.type?.displayName||"anonymous"})`),console.log(` tag: ${n.tag} (${At(n.tag)})`),console.log(` memoizedProps: ${JSON.stringify(ut(n.memoizedProps,2))}`),console.log(` alternate: ${n.alternate?"YES":"NO"}`),n.alternate){console.log(` ALTERNATE memoizedProps: ${JSON.stringify(ut(n.alternate.memoizedProps,2))}`);let L=!nr(n.alternate.memoizedProps,n.memoizedProps);console.log(` Props changed (vs alternate): ${L?"YES":"NO"}`),console.log(` ALTERNATE memoizedState: ${n.alternate.memoizedState===n.memoizedState?"SAME":"DIFFERENT"}`)}let z=Zn(n);if(z){console.log(` WeakMap PREVIOUS memoizedProps: ${JSON.stringify(ut(z.memoizedProps,2))}`);let L=!nr(z.memoizedProps,n.memoizedProps);console.log(` Props changed (vs WeakMap): ${L?"YES":"NO"}`)}else console.log(" WeakMap PREVIOUS state: (not found - first render or WeakMap cleared)");if(n._debugOwner){let L=Ae(n._debugOwner);console.log(` _debugOwner: "${L}"`);let le=n._debugOwner,he=1;for(;le&&he<5;){let Ne=Ae(le);console.log(` \u2514\u2500[${he}] ${Ne||"unknown"} (tag: ${le.tag})`),le=le._debugOwner,he++}}let _=0,T=t._debugOwner||t.return;for(;T&&T!==n&&_<30;)T=T.return,_++;console.log(` Depth from native fiber: ${_}`)}else console.log(" (No component fiber found - could not walk up tree)");if(console.log(""),console.log("HOOKS:"),n?.memoizedState){let z=st(n),_=n.alternate?st(n.alternate):null,T=Zn(n),L=_||T?.extractedHooks,le=_?"alternate":T?"WeakMap":"none";z&&z.length>0?(console.log(` Total hooks: ${z.length}`),console.log(` Previous values source: ${le}`),z.forEach((he,Ne)=>{let xe=L?.[Ne],Vn=xe?xe.rawState!==he.rawState:false,rt=xe?ct(xe.value):"N/A",Qt=Vn?" \u2190 CHANGED":"";console.log(` [${Ne}] ${he.type}: ${ct(he.value)}${xe?` (was: ${rt})`:" (first render)"}${Qt}`)})):(console.log(" (Could not extract hooks - memoizedState structure not recognized)"),console.log(` Raw memoizedState type: ${typeof n.memoizedState}`),console.log(` Has 'next' property: ${"next"in(n.memoizedState||{})}`),console.log(` Has 'queue' property: ${"queue"in(n.memoizedState||{})}`))}else console.log(" (No memoizedState - class component, no hooks, or not a function component)");if(console.log(""),console.log("RAW HOOKS DATA:"),n?.memoizedState&&typeof n.memoizedState=="object"){let z=n.memoizedState,_=0;for(;z&&_<10;)console.log(` Hook[${_}]:`),console.log(` memoizedState: ${ut(z.memoizedState,2)}`),console.log(` baseState: ${ut(z.baseState,2)}`),console.log(` queue: ${z.queue?"[Queue present]":"null"}`),console.log(` next: ${z.next?"[Next hook]":"null"}`),z=z.next,_++;_===0&&console.log(" (memoizedState is not a hooks linked list)")}console.log(""),console.log("DETECTION RESULTS:"),console.log(` Component Cause: ${o.cause.toUpperCase()}`),o.hookChanges&&o.hookChanges.length>0&&(console.log(" Hook Changes Detected:"),o.hookChanges.forEach(z=>{console.log(` [${z.index}] ${z.type}: ${z.previousValue} \u2192 ${z.currentValue}`),z.description&&console.log(` ${z.description}`)}));let k=typeof t?.type=="string"?t.type:void 0,D=ti(r?.memoizedProps,t?.memoizedProps,k);D&&D.length>0?console.log(` Native Props Changed: [${D.join(", ")}]`):r&&console.log(" Native Props Changed: (none detected)"),console.log(""),console.log("BATCH CONTEXT:"),console.log(` Batch size: ${i.size}`),console.log(` All tags in batch: [${Array.from(i).slice(0,20).join(", ")}${i.size>20?"...":""}]`);let W=oi(t),Q=W!==null&&i.has(W);if(console.log(` Parent nativeTag: ${W??"not found"}`),console.log(` Parent in batch: ${Q?"YES":"NO"}`),i.size>1){console.log(" Components in same batch:");let z=t?.return,_=0;for(;z&&_<10;){let T=ii(z.stateNode);if(T!==null&&i.has(T)){let L=Ae(z)||z.type;console.log(` [depth ${_}] ${L} (tag: ${T})`)}z=z.return,_++}}console.log(`
|
|
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
|
+
`)}function rr(e,t,n,r="off"){let o=Date.now();if(!t)return{type:"unknown",timestamp:o};let i=t,l=t.alternate,a=Te.get(e);if(a&&l){let D=a.memoizedProps?.children,W=t.memoizedProps?.children,Q=l.memoizedProps?.children,z=t.memoizedProps===a.memoizedProps||D!==void 0&&W===D,_=l.memoizedProps===a.memoizedProps||D!==void 0&&Q===D;z&&!_&&(i=l,l=t,r==="all"&&console.log("[RenderCause] Detected fiber swap - using alternate as current"))}let c=null,s=null;l?(c=l.memoizedProps,s=l.memoizedState):a&&(c=a.memoizedProps,s=a.memoizedState);let d=c!==null?{memoizedProps:c,memoizedState:s,timestamp:o}:void 0,b={memoizedProps:i.memoizedProps,memoizedState:i.memoizedState,timestamp:o};dc(e,b);let C=Zo(i),y=Ae(C)||void 0,v=uc(i,y)||void 0,m=ic(C),w=m.cause,u=m.hookChanges;if(!d){if(r!=="off"){if(r==="minimal")console.log(`[${y||"Unknown"}] MOUNT`);else if(r==="verbose"){let D=typeof i?.type=="string"?i.type:"Unknown";console.log(`[RENDER] ${y||"Unknown"} (${D}:${e}) | Cause: MOUNT`)}else if(r==="all"){let D=Te.has(e)?Te.size:1;ei(e,i,C,d,m,n,D)}}return{type:"mount",timestamp:o,componentCause:"mount",componentName:y}}let x=typeof i.type=="string"?i.type:void 0,R=ti(d.memoizedProps,b.memoizedProps,x);if(r!=="off"){if(r==="minimal")ac(y,m);else if(r==="verbose")lc(e,i,C,m,R);else if(r==="all"){let D=Te.has(e)?Te.size:1;ei(e,i,C,d,m,n,D)}}if(R&&R.length>0)return{type:"props",changedKeys:R.slice(0,ec),timestamp:o,componentCause:w,componentName:y,parentComponentName:v,hookChanges:u||void 0};let H=sc(d.memoizedState,b.memoizedState);if(H&&H.length>0)return{type:"hooks",hookIndices:H,timestamp:o,componentCause:w,componentName:y,parentComponentName:v,hookChanges:u||void 0};let k=oi(i);return k&&n.has(k)?{type:"parent",timestamp:o,componentCause:w,componentName:y,parentComponentName:v,hookChanges:u||void 0}:w==="state"?{type:"state",timestamp:o,componentCause:w,componentName:y,parentComponentName:v,hookChanges:u||void 0}:w==="props"?{type:"props",timestamp:o,componentCause:w,componentName:y,parentComponentName:v}:w==="parent"?{type:"parent",timestamp:o,componentCause:w,componentName:y,parentComponentName:v}:{type:"unknown",timestamp:o,componentCause:w,componentName:y,parentComponentName:v}}function ti(e,t,n){if(e===t||!e||!t||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return null;let r=Qs(n),o=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(let l of o)if(!l.startsWith("__")&&!r.skip.includes(l)){if(l==="children"){if(!r.alwaysTrack.includes("children"))continue;let a=e[l],c=t[l];a!==c&&(ni(a)&&ni(c)?i.push(`children: ${ri(a)} \u2192 ${ri(c)}`):i.push("children (content)"));continue}if(e[l]!==t[l]){let a=e[l],c=t[l];l==="style"?ln(a,c)?i.push(`${l} (ref only)`):i.push(l):typeof a=="function"&&typeof c=="function"?i.push(`${l} (fn ref)`):i.push(l)}}return i.length>0?i:null}function ln(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(!ln(e[i],t[i],n+1))return false;return true}let r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return false;for(let i of r)if(!o.includes(i)||!ln(e[i],t[i],n+1))return false;return true}function ni(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ri(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]"}function sc(e,t){if(e===t||e==null||t==null||typeof e!="object"||typeof t!="object")return null;let n=[],r=e,o=t,i=0;for(;o!==null&&i<tr;)(r===null||cc(r,o))&&n.push(i),o=o?.next??null,r=r?.next??null,i++;return n.length>0?n:null}function cc(e,t){return e===t?false:e.memoizedState!==t.memoizedState||e.baseState!==void 0&&e.baseState!==t.baseState}function oi(e){let t=e?.return,n=0;for(;t&&n<Xo;){if(t.stateNode){let r=ii(t.stateNode);if(r!=null)return r}t=t.return,n++}return null}function uc(e,t){if(!e)return null;let n=Zo(e);if(!n)return null;let r=n.return,o=0;for(;r&&o<Xo;){let i=r.tag;if(i===0||i===1||i===11||i===15){let l=Ae(r);if(l&&!Qo(l)&&l!==t)return l}r=r.return,o++}return null}function ii(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}function dc(e,t){if(Te.size>=er){let n=Array.from(Te.entries());n.sort((o,i)=>o[1].timestamp-i[1].timestamp);let r=Math.floor(er/4);for(let o=0;o<r;o++)Te.delete(n[o][0])}Te.set(e,t)}function ai(){Te.clear()}function hc(e){Te.delete(e)}function gc(){return{storedStates:Te.size,maxStates:er}}var pc=5,li=200,sn=20,cn=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>li?e.slice(0,li)+"...":e;if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="symbol")return`[Symbol: ${e.description||""}]`;if(t>=pc)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 r=e.slice(0,sn).map(o=>He(o,t+1,n));return e.length>sn&&r.push(`[...${e.length-sn} more]`),r}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 r={__type:"Map",__size:e.size},o=0;for(let[i,l]of e){if(o>=cn){r[`...${e.size-o} more`]=true;break}let a=typeof i=="string"?i:String(i);r[a]=He(l,t+1,n),o++}return r}if(e instanceof Set)return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,sn).map(r=>He(r,t+1,n))};if(typeof e=="object"){let r={},o=Object.keys(e),i=o.slice(0,cn);for(let l of i)if(!(l.startsWith("__")||l==="children"))try{r[l]=He(e[l],t+1,n)}catch{r[l]="[Error accessing property]"}return o.length>cn&&(r[`...${o.length-cn} more keys`]=true),r}return"[Unknown type]"}function mc(e){if(e?.memoizedProps)return He(e.memoizedProps)}function fc(e){if(!e?.memoizedState)return;let t=e.memoizedState;if(typeof t=="object"&&t!==null&&"next"in t){let n=[],r=t,o=0;for(;r&&o<tr;)n.push({index:o,memoizedState:He(r.memoizedState)}),r=r.next,o++;return{__type:"Hooks",hooks:n}}return He(t)}import{notifySubscriberCountChange as si}from"@buoy-gg/shared-ui/web";U();var or=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"]),Ht=["HighlightUpdates","RenderList","RenderDetail","RenderHistory","RenderCause","EventStepper","UnifiedEvent","EventsModal","EventsCopy"],ci=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"]),ir=["JsModal","ImageOverlay","PerfMonitor","PerfHud","JsTop"],ui=new Set(["VirtualizedDataExplorer","TreeDiffView","TreeDiffRow","DataViewer","DiffView","DiffSummary","FloatingDevTools","FloatingMenu","FloatingBubble","MinimizedDock","DialMenu","DialItem","ExpandableSection","ChevronIcon","GlitchText","SettingsModal","SettingsRow","OnboardingFlow","DevToolsMenu"]),ar=false;function yc(e){ar=e}function di(){return ar}var bc=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 hi(e){return e.startsWith("PerfMonitor")||e.startsWith("PerfHud")||bc.has(e)}var vc=new Set(["TaskTable","TaskRow","BusySparkline"]);function Cc(e){return e.startsWith("JsTop")||vc.has(e)}function Tc(e){if(or.has(e))return true;for(let t=0;t<Ht.length;t++)if(e.startsWith(Ht[t]))return true;if(ar)return hi(e)||Cc(e);if(ci.has(e)||ui.has(e))return true;for(let t=0;t<ir.length;t++)if(e.startsWith(ir[t]))return true;return false}function Sc(e){if(or.has(e))return true;for(let t=0;t<Ht.length;t++)if(e.startsWith(Ht[t]))return true;return false}var se=false,dt=false,Me=false,Le=false,ie=null,ze=null,un=null,Mt=null,gi=false,be=false,dn=new Set,lr=new Set,sr=new Map,cr=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],wc=false;function q(e,t){wc&&(t!==void 0?console.log(`[HighlightUpdates] ${e}`,t):console.log(`[HighlightUpdates] ${e}`))}function ur(e){let t=vl(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}function ht(e){let t=bl(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}function dr(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);let r=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Un(t),o=t?.canonical?.currentProps,i=t?.canonical?.pendingProps,l=r?.pendingProps,a=r?.memoizedProps;return n.testID=o?.testID||i?.testID||l?.testID||a?.testID||void 0,n.nativeID=o?.nativeID||i?.nativeID||l?.nativeID||a?.nativeID||void 0,n.accessibilityLabel=o?.accessibilityLabel||i?.accessibilityLabel||l?.accessibilityLabel||a?.accessibilityLabel||void 0,n.componentName=zc(r)||void 0,n}var pi=false,xc=false,hr=null;var Ic=new Set;var Rc=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]),Dc=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]),Ge=new Map,mi=500;function kc(){Ge.clear()}function fi(e){return e?!!(Rc.has(e)||e.startsWith("__highlight_")):false}function yi(e){if(!e)return false;if(Dc.has(e))return true;let t=e.charCodeAt(0);return!!(t===95&&e.startsWith("__rn_buoy__")||t===108&&e.startsWith("logbox"))}function bi(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.name)return t.name;if(t.displayName)return t.displayName}let n=e.elementType;if(n){if(n.name)return n.name;if(n.displayName)return n.displayName}return null}var Pc=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 Lc(e){return!!(!e||Pc.has(e)||e==="Unknown"||e==="Component"||e.startsWith("Animated"))}function zc(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,r=null;for(;t&&n<30;){let o=bi(t);if(o&&typeof t.type!="string"&&(r||(r=o),!Lc(o)))return o;t=t.return,n++}return r}function Nc(e){let t=e,n=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Un(t),r=ht(e)||ht(t?.canonical?.publicInstance),o=di(),i=!o&&N.getSettings().excludeDevTools;if(i&&Cl(e)&&e.closest("[data-buoy-root]"))return true;if(r!=null&&i){let c=Ge.get(r);if(c!==void 0)return c}let l=false,a=n?.pendingProps?.nativeID||n?.memoizedProps?.nativeID||t?.canonical?.currentProps?.nativeID||null;if((fi(a)||i&&yi(a))&&(l=true),!l&&n){let c=n,s=0;for(;c&&s<30;){let d=bi(c);if(d){if(or.has(d)){l=true;break}for(let C of Ht)if(d.startsWith(C)){l=true;break}if(l)break;if(o&&hi(d)){l=true;break}if(i){if(ci.has(d)||ui.has(d)){l=true;break}for(let C of ir)if(d.startsWith(C)){l=true;break}if(l)break}}let b=c.pendingProps?.nativeID||c.memoizedProps?.nativeID;if(fi(b)){l=true;break}if(i&&yi(b)){l=true;break}c=c.return,s++}}if(l&&r!=null&&i){if(Ge.size>=mi){let c=Array.from(Ge.keys());for(let s=0;s<mi/2;s++)Ge.delete(c[s])}Ge.set(r,l)}return l}function Vc(e){let t=Math.min(e-1,cr.length-1);return cr[Math.max(0,t)]}function Bc(e){if(e.size===0||!se&&!Me||N.getState().isPaused)return;Ue.isEnabled()&&gl();let t=N.getBatchSize(),n=Ue.startBatch(e.size,t),r=[],o=0,i=0,l=N.hasActiveFilters();for(let s of e)if(s&&typeof s=="object")try{if(Nc(s)){o++;continue}let d=ur(s),b=ht(s)||ht(d);if(b==null)continue;let C=dr(s);if(l&&!N.passesFilters(C)){i++;continue}let y=N.getSettings().showRenderCount,v,m;y?(v=(sr.get(b)||0)+1,sr.set(b,v),m=Vc(v)):(v=0,m=cr[0]),r.push({node:s,color:m,count:v})}catch{}if(n.markFilteringComplete(o+i,r.length),r.length===0){n.finish();return}pi&&console.log(`[HighlightUpdates] ${r.length} component(s) re-rendered`);let a=N.getRenderEventCallbackCount()>0;if(!ze&&!a){pi&&console.log("[HighlightUpdates] No highlightCallback and no event callbacks - skipping render"),gi=false;return}n.markMeasurementStart();let c=r.slice(0,t*4).map(({node:s,color:d,count:b})=>new Promise(C=>{let y=false,v=R=>{y||(y=true,clearTimeout(m),C(R))},m=setTimeout(()=>v({rect:null,stateNode:s,color:d,count:b}),500),w=ur(s),u=ht(s)||ht(w);if(u==null){v({rect:null,stateNode:s,color:d,count:b});return}let x=(R,H,k,D,W,Q)=>{if(W==null||Q==null||k==null||D==null){v({rect:null,stateNode:s,color:d,count:b});return}v({rect:{id:u,x:W,y:Q,width:k,height:D,color:d,count:b},stateNode:s,color:d,count:b})};if(!w){let R=s.node,H=globalThis.nativeFabricUIManager;if(R&&H?.measure){try{H.measure(R,x)}catch{v({rect:null,stateNode:s,color:d,count:b})}return}v({rect:null,stateNode:s,color:d,count:b});return}try{w.measure(x)}catch{v({rect:null,stateNode:s,color:d,count:b})}}));Promise.all(c).then(s=>{let d=s.filter(C=>C.rect!==null),b=d.map(C=>C.rect);n.markMeasurementComplete(d.length,s.length-d.length),b.length>0&&ze&&se&&!dt&&ze(b),setTimeout(()=>{try{for(let m of d)m.rect&&Ac(m.rect.id,m.stateNode)}catch(m){q("registerTrackedNode batch failed",m)}let C=N.getSettings(),y=C.trackRenderCauses&&C.showRenderCount,v=null;if(y){v=new Set;for(let{rect:m}of d)m&&v.add(m.id)}if(se){N.startBatch();for(let{rect:m,stateNode:w,color:u,count:x}of d)if(m){let R=dr(w),H;if(y&&v){let k=gr(w);H=rr(m.id,k,v,C.debugLogLevel)}N.trackRender({nativeTag:m.id,viewType:R.viewType,testID:R.testID,nativeID:R.nativeID,accessibilityLabel:R.accessibilityLabel,componentName:R.componentName,measurements:{x:m.x,y:m.y,width:m.width,height:m.height},color:u,count:x,renderCause:H})}N.endBatch()}else for(let{rect:m,stateNode:w,color:u,count:x}of d)if(m){let R=dr(w),H;if(y&&v){let k=gr(w);H=rr(m.id,k,v,C.debugLogLevel)}N.emitRenderEvent({nativeTag:m.id,viewType:R.viewType,testID:R.testID,nativeID:R.nativeID,accessibilityLabel:R.accessibilityLabel,componentName:R.componentName,measurements:{x:m.x,y:m.y,width:m.width,height:m.height},color:u,count:x,renderCause:H})}n.markTrackingComplete(),n.markCallbackComplete(),n.finish()},0)}).catch(s=>{console.error("[HighlightUpdates] Error in measurement pipeline:",s),n.finish()})}var vi=globalThis.WeakRef,hn=new Map;function Ac(e,t){if(!(e==null||t==null||typeof t!="object"))try{hn.set(e,vi?new vi(t):{deref:()=>t})}catch{hn.set(e,{deref:()=>t})}}function Hc(e){let t=hn.get(e)?.deref();return t||hn.delete(e),t??null}function Mc(e){return new Promise(t=>{try{e.measure((n,r,o,i,l,a)=>{l==null||a==null||o==null||i==null?t(null):t({x:l,y:a,width:o,height:i})})}catch{t(null)}})}function gr(e){let t=e;return t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Un(t)||null}function $c(e){let t=gr(e),n=0;for(;t&&n++<200;){let r=t.stateNode;if(r&&typeof r.scrollTo=="function"){let o=typeof r.getNativeScrollRef=="function"&&r.getNativeScrollRef()||null,i=typeof r.getInnerViewNode=="function"&&r.getInnerViewNode()||typeof r.getScrollableNode=="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:o,innerNode:i}}t=t.return}return null}async function Ec(e,t,n){try{let r=$c(e);if(!r)return false;let o=t,i=null,l=a=>new Promise(c=>{let s=false,d=C=>{s||(s=true,c(C))},b=setTimeout(()=>d(null),600);try{a(C=>{clearTimeout(b),d(C)})}catch{clearTimeout(b),d(null)}});if(r.nativeRef&&typeof o.measureLayout=="function"&&(i=await l(a=>o.measureLayout(r.nativeRef,(c,s)=>a(s),()=>a(null)))),i==null){let a=Vt(t),c=typeof r.innerNode=="number"?r.innerNode:Vt(r.innerNode);a!=null&&c!=null&&(i=await l(s=>Kn.measureLayout(a,c,()=>s(null),(d,b)=>s(b))))}return i==null?false:(r.instance.scrollTo({y:Math.max(0,i-n),animated:false}),await new Promise(a=>setTimeout(a,80)),true)}catch{return false}}function Fc(e,t){let n=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)],r=0;for(let o of n){if(!o)continue;let i=o.toLowerCase();if(i===t)return 3;i.startsWith(t)?r=Math.max(r,2):i.includes(t)&&(r=Math.max(r,1))}return r}async function Oc(e){let t=e.scrollIntoView!==false,n=typeof e.margin=="number"?e.margin:12,r=N.getRenders(),o=async()=>{let u=await Wo(),x=(e.query??"").trim().toLowerCase(),R;for(let D of u.elements){if(e.nativeTag!=null&&D.nativeTag===e.nativeTag){R={el:D,score:1e3};break}let W=Jn({nativeTag:D.nativeTag,testID:D.testID,label:D.label,text:D.text,name:D.name,tap:D.tap},{query:x||void 0,nativeTag:e.nativeTag});W<=0||(!R||W>R.score)&&(R={el:D,score:W})}if(!R?.el.frame)return{matched:false,reason:"no-match",candidates:[]};let H=u.screen,k=R.el.frame;return{matched:true,live:true,rect:{x:k.x*H.width,y:k.y*H.height,width:k.width*H.width,height:k.height*H.height},scale:Gn.get(),screen:{width:H.width,height:H.height},nativeTag:R.el.nativeTag??void 0,componentName:R.el.name,testID:R.el.testID}};if(r.length===0)return o();let i=(e.query??"").trim().toLowerCase(),l=i?r.map(u=>({r:u,score:Fc(u,i)})).filter(u=>u.score>0).sort((u,x)=>x.score-u.score||x.r.lastRenderTime-u.r.lastRenderTime):[],a=l.slice(0,8).map(({r:u})=>({nativeTag:u.nativeTag,componentName:u.componentName,testID:u.testID,nativeID:u.nativeID,viewType:u.viewType,renderCount:u.renderCount})),c=e.nativeTag??(l.length>0?l[0].r.nativeTag:void 0);if(c==null){let u=await o();return u.matched?u:{matched:false,reason:"no-match",candidates:a}}let s=r.find(u=>u.nativeTag===c),d=null,b=false,C=false,y=Hc(c);if(y){let u=ur(y);u&&(t&&(C=await Ec(y,u,n)),d=await Mc(u),b=!!d)}if(!d&&s?.measurements&&(d={...s.measurements}),!d)return{matched:false,reason:"no-measurement",nativeTag:c,candidates:a};let v=Gn.get(),m=Nt.get("window"),w=d.x>=-1&&d.y>=-1&&d.x+d.width<=m.width+1&&d.y+d.height<=m.height+1;return{matched:true,live:b,scrolled:C,inView:w,rect:d,scale:v,screen:{width:m.width,height:m.height},nativeTag:c,componentName:s?.componentName,testID:s?.testID,candidates:a}}function Ci(e){if(!ie?.rendererInterfaces){q("No rendererInterfaces available");return}let t=0;if(ie.rendererInterfaces.forEach((n,r)=>{if(typeof n.setTraceUpdatesEnabled=="function")try{n.setTraceUpdatesEnabled(e),t++,q(`Renderer ${r}: setTraceUpdatesEnabled(${e})`)}catch(o){q(`Renderer ${r}: error setting trace updates`,o)}else q(`Renderer ${r}: no setTraceUpdatesEnabled method`)}),q(`Set trace updates ${e?"enabled":"disabled"} on ${t} renderer(s)`),ie.reactDevtoolsAgent?.setTraceUpdatesEnabled)try{ie.reactDevtoolsAgent.setTraceUpdatesEnabled(e),q("Also set trace updates on agent")}catch(n){q("Error setting trace updates on agent",n)}}function Ti(){ie&&(Mt||(q("Subscribing to traceUpdates event"),typeof ie.sub=="function"?(Mt=ie.sub("traceUpdates",Bc),q("Subscribed using hook.sub()")):q("hook.sub not available, traceUpdates may not work"),Ci(true)))}function pr(){Ci(false),Mt&&(Mt(),Mt=null,q("Unsubscribed from traceUpdates event"))}function Si(e){ze=e,q(`Highlight callback ${e?"set":"cleared"}`)}function _c(e){un=e,q(`Badge press callback ${e?"set":"cleared"}`)}function Wc(){return un}function jc(e){un&&un(e)}var mr=null,gn=null;function Uc(e){mr=e,e&&gn!==null&&e(gn)}function Gc(e){if(ge){ge("setSpotlight",{nativeTag:e});return}gn=e,mr&&mr(e)}var ge=null;function Kc(e){ge=e}function qc(e){se!==e.enabled&&(se=e.enabled,fr()),be!==e.frozen&&(be=e.frozen,mn())}function Jc(){return gn}function fr(){lr.forEach(e=>{try{e(se)}catch(t){console.error("[HighlightUpdates] Error in state listener:",t)}})}function wi(e){return lr.add(e),e(se),()=>{lr.delete(e)}}function pn(){if(typeof Z<"u"&&!Z)return q("Only available in development builds"),false;if(ge||Le)return true;if(ie=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null,!ie)return q("React DevTools hook not found"),false;if(q("Hook found"),q(`Hook has sub: ${typeof ie.sub=="function"}`),q(`Hook has on: ${typeof ie.on=="function"}`),q(`Hook has emit: ${typeof ie.emit=="function"}`),Ro(),ie.rendererInterfaces&&ie.rendererInterfaces.size>0)return Le=true,q(`Initialized with ${ie.rendererInterfaces.size} renderer(s)`),xi(),true;let e=setInterval(()=>{ie?.rendererInterfaces&&ie.rendererInterfaces.size>0&&(clearInterval(e),Le=true,q(`Initialized with ${ie.rendererInterfaces.size} renderer(s) (delayed)`),xi())},100);return setTimeout(()=>clearInterval(e),1e4),false}function xi(){typeof window<"u"&&(window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:$t,disable:Et,toggle:Ii,isEnabled:Ri,setEnabled:Di,subscribe:wi,initialize:pn,destroy:Li,isInitialized:()=>Le,setHighlightCallback:Si})}function $t(){typeof Z<"u"&&!Z||(Le||pn(),dt&&(dt=false),!se&&(q("Enabling highlights"),Me||Ti(),N.start(),se=true,fr(),si("render")))}function Et(){typeof Z<"u"&&!Z||se&&(q("Disabling highlights"),xc=false,gi=false,hr&&(clearTimeout(hr),hr=null),Ic.clear(),Ge.clear(),ai(),be&&(be=false,mn()),Me||pr(),N.stop(),se=false,fr(),si("render"))}function Yc(){typeof Z<"u"&&!Z||Me||(Le||pn(),q("Enabling background tracking"),se||Ti(),Me=true)}function Xc(){typeof Z<"u"&&!Z||Me&&(q("Disabling background tracking"),Me=false,se||pr())}function Qc(){return Me}function Ii(){if(!(typeof Z<"u"&&!Z)){if(ge){ge("toggle");return}se?Et():$t()}}function Zc(){if(ge){ge("clearRenderCounts");return}sr.clear(),N.clear(),q("Cleared render counts")}function Ri(){return se}function Di(e){if(ge){ge("setEnabled",{enabled:e});return}e?$t():Et()}function yr(e){dt!==e&&(dt=e,e&&ze&&ze([]))}function eu(){return dt}function tu(e){if(ge){ge("setSilentTracking",{enabled:e});return}e?($t(),yr(true)):(yr(false),Et())}function nu(){return Le}function mn(){dn.forEach(e=>{try{e(be)}catch(t){console.error("[HighlightUpdates] Error in freeze listener:",t)}})}function ru(e){return dn.add(e),e(be),()=>{dn.delete(e)}}function ki(){typeof Z<"u"&&!Z||be||(be=true,q("Freeze mode enabled"),mn())}function Pi(){typeof Z<"u"&&!Z||be&&(be=false,q("Freeze mode disabled"),ze&&ze([]),mn())}function ou(){if(ge){ge("toggleFreeze");return}be?Pi():ki()}function iu(){return be}function Li(){Le&&(pr(),Do(),Io(null),be=false,dn.clear(),se=false,ie=null,ze=null,Le=false,typeof window<"u"&&delete window.__HIGHLIGHT_UPDATES_CONTROLLER__,q("Destroyed"))}var au={subscribe:wi,enable:$t,disable:Et,toggle:Ii,isEnabled:Ri,setEnabled:Di,initialize:pn,destroy:Li,isInitialized:nu,setHighlightCallback:Si,clearRenderCounts:Zc,freeze:ki,unfreeze:Pi,toggleFreeze:ou,getFrozen:iu,subscribeToFreeze:ru,setBadgePressCallback:_c,getBadgePressCallback:Wc,handleBadgePress:jc,setSpotlightCallback:Uc,setSpotlight:Gc,getSpotlight:Jc,clearDevToolsCache:kc,enableBackgroundTracking:Yc,disableBackgroundTracking:Xc,isBackgroundTrackingEnabled:Qc,setRemoteHandler:Kc,replaceRemoteState:qc,locateComponent:Oc,setHighlightsSuppressed:yr,getHighlightsSuppressed:eu,setSilentTracking:tu},M=au;U();import lu,{useState as ce,useEffect as Se,useRef as Ke,useCallback as te}from"react";import{Power as su,JsModal as cu,devToolsStorageKeys as gt,persistentStorage as fn,night as Ft,TickProvider as zi,windowDragProps as uu}from"@buoy-gg/shared-ui/web";import{useIsPro as du}from"@buoy-gg/license/web";Pe();U();import{useMemo as yn,useState as Ni,useCallback as Ot}from"react";import{CopyButton as hu,formatRelativeTime as gu,PlusIcon as pu,MinusIcon as mu,EventStepperFooter as fu,Lock as yu,night as E,useLimit as bu,monoFont as pt}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as vu}from"@buoy-gg/shared-ui/web/dataViewer";U();import{buoyColors as $e,night as ne,monoFont as qe}from"@buoy-gg/shared-ui/web";import{Fragment as Cu,jsx as G,jsxs as ae}from"react/jsx-runtime";var Ee={mount:{label:"MOUNT",color:$e.success,tip:"First render of this component."},props:{label:"PROPS",color:$e.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:$e.textSecondary,tip:"Parent component re-rendered. Consider wrapping with React.memo()."},unknown:{label:"?",color:$e.textMuted,tip:"Could not determine render cause."}},_t={mount:{label:"mount",color:$e.success,tip:"First render of this component."},props:{label:"props",color:$e.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:$e.textSecondary,tip:"Parent re-rendered but this component's props/state didn't change. Consider React.memo()."},unknown:{label:"?",color:$e.textMuted,tip:"Could not determine component render cause."}};function Vi({cause:e,compact:t=false,showKeys:n=false,showTwoLevel:r=false,testID:o}){let i=Ee[e.type],l=e.componentCause?_t[e.componentCause]:null,a=r&&l&&e.componentCause!==e.type;return ae(h,{nativeID:"__rn_buoy__cause-badge",testID:o,style:[V.container,t&&V.containerCompact],children:[a&&ae(Cu,{children:[G(h,{style:[V.badge,t&&V.badgeCompact,V.componentBadge,{backgroundColor:l.color+"15"}],children:G(g,{testID:o?`${o}-component`:void 0,style:[V.badgeText,t&&V.badgeTextCompact,V.componentBadgeText,{color:l.color}],children:l.label})}),G(g,{style:[V.arrowText,t&&V.arrowTextCompact],children:"\u2192"})]}),G(h,{style:[V.badge,t&&V.badgeCompact,{backgroundColor:i.color+"20"}],children:G(g,{testID:o?`${o}-native`:void 0,style:[V.badgeText,t&&V.badgeTextCompact,{color:i.color}],children:i.label})}),n&&e.changedKeys&&e.changedKeys.length>0&&G(g,{testID:o?`${o}-keys`:void 0,style:[V.keysText,t&&V.keysTextCompact],numberOfLines:1,children:e.changedKeys.join(", ")}),n&&e.hookIndices&&e.hookIndices.length>0&&ae(g,{testID:o?`${o}-hooks`:void 0,style:[V.keysText,t&&V.keysTextCompact],numberOfLines:1,children:["Hook ",e.hookIndices.join(", ")]})]})}function Tu({cause:e}){let t=Ee[e.type],n=e.componentCause?_t[e.componentCause]:null,r=e.componentName||"Component";return ae(h,{nativeID:"__rn_buoy__two-level-cause",style:V.twoLevelContainer,children:[n&&ae(h,{style:V.twoLevelRow,children:[G(g,{style:V.twoLevelLabel,children:"Component:"}),G(g,{style:V.twoLevelName,children:r}),G(g,{style:V.twoLevelText,children:"re-rendered due to"}),G(h,{style:[V.badge,{backgroundColor:n.color+"20"}],children:G(g,{style:[V.badgeText,{color:n.color}],children:n.label.toUpperCase()})})]}),ae(h,{style:V.twoLevelRow,children:[G(g,{style:V.twoLevelLabel,children:"Native:"}),G(h,{style:[V.badge,{backgroundColor:t.color+"20"}],children:G(g,{style:[V.badgeText,{color:t.color}],children:t.label})}),e.changedKeys&&e.changedKeys.length>0&&ae(g,{style:V.twoLevelKeys,children:["[",e.changedKeys.join(", "),"]"]})]})]})}function Bi({cause:e,nativeType:t}){let n=Ee[e.type],r=e.componentCause?_t[e.componentCause]:null,o=e.componentName||"Unknown",i=e.hookChanges&&e.hookChanges.length>0,l=e.changedKeys&&e.changedKeys.length>0,a=e.changedKeys?.filter(s=>s.includes("(ref only)")||s.includes("(fn ref)"))||[],c=e.changedKeys?.filter(s=>!s.includes("(ref only)")&&!s.includes("(fn ref)"))||[];return ae(h,{nativeID:"__rn_buoy__enhanced-cause",style:V.enhancedContainer,children:[ae(h,{style:V.enhancedHeader,children:[G(g,{style:V.enhancedComponentName,children:o}),t&&G(h,{style:V.enhancedNativeTag,children:G(g,{style:V.enhancedNativeTagText,children:t})})]}),ae(h,{style:V.enhancedFlowContainer,children:[G(g,{style:V.enhancedFlowLabel,children:"Cause:"}),r&&G(h,{style:[V.enhancedFlowBadge,{backgroundColor:r.color+"20"}],children:G(g,{style:[V.enhancedFlowBadgeText,{color:r.color}],children:r.label.toUpperCase()})}),G(g,{style:V.enhancedFlowArrow,children:"\u2192"}),G(h,{style:[V.enhancedFlowBadge,{backgroundColor:n.color+"20"}],children:G(g,{style:[V.enhancedFlowBadgeText,{color:n.color}],children:n.label})})]}),i&&ae(h,{style:V.enhancedSection,children:[G(g,{style:V.enhancedSectionTitle,children:"Component State Changed:"}),e.hookChanges.map(s=>ae(h,{style:V.enhancedChangeRow,children:[G(g,{style:V.enhancedChangeIcon,children:"\u26A1"}),ae(g,{style:V.enhancedChangeText,children:["Hook[",s.index,"] (",s.type,"): ",s.description]})]},s.index))]}),c.length>0&&ae(h,{style:V.enhancedSection,children:[G(g,{style:V.enhancedSectionTitle,children:"Native Props Changed:"}),c.map((s,d)=>ae(h,{style:V.enhancedChangeRow,children:[G(g,{style:V.enhancedChangeIcon,children:"~"}),G(g,{style:V.enhancedChangeText,children:s})]},d))]}),a.length>0&&ae(h,{style:V.enhancedSection,children:[G(g,{style:[V.enhancedSectionTitle,{color:ne.color.textTertiary}],children:"Reference Changes (optimization opportunity):"}),a.map((s,d)=>ae(h,{style:V.enhancedChangeRow,children:[G(g,{style:[V.enhancedChangeIcon,{color:ne.color.textTertiary}],children:"\u25CB"}),G(g,{style:[V.enhancedChangeText,{color:ne.color.textTertiary}],children:s})]},d))]}),!i&&!l&&e.type!=="mount"&&G(h,{style:V.enhancedSection,children:G(g,{style:V.enhancedNoChanges,children:e.type==="parent"?"Parent re-rendered (consider React.memo)":"No specific changes detected"})})]})}var V=fe.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:ne.color.border},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},componentBadgeText:{fontWeight:"500",textTransform:"lowercase"},arrowText:{fontSize:10,color:ne.color.textTertiary},arrowTextCompact:{fontSize:9},keysText:{fontSize:11,color:ne.color.textSecondary,fontFamily:qe,flex:1},keysTextCompact:{fontSize:10},twoLevelContainer:{gap:8},twoLevelRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:6},twoLevelLabel:{fontSize:11,fontWeight:"600",color:ne.color.textSecondary,minWidth:70},twoLevelName:{fontSize:11,fontWeight:"600",color:ne.color.text,fontFamily:qe},twoLevelText:{fontSize:11,color:ne.color.textSecondary},twoLevelKeys:{fontSize:10,color:ne.color.textSecondary,fontFamily:qe},enhancedContainer:{gap:12},enhancedHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},enhancedComponentName:{fontSize:14,fontWeight:"700",color:ne.color.text,fontFamily:qe},enhancedNativeTag:{backgroundColor:ne.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},enhancedNativeTagText:{fontSize:10,fontWeight:"600",color:ne.color.textTertiary,fontFamily:qe},enhancedFlowContainer:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12,backgroundColor:ne.color.bg,borderRadius:6},enhancedFlowLabel:{fontSize:11,fontWeight:"600",color:ne.color.textSecondary},enhancedFlowBadge:{paddingVertical:3,paddingHorizontal:8,borderRadius:4},enhancedFlowBadgeText:{fontSize:10,fontWeight:"700"},enhancedFlowArrow:{fontSize:14,color:ne.color.textTertiary,fontWeight:"300"},enhancedSection:{gap:6},enhancedSectionTitle:{fontSize:11,fontWeight:"600",color:ne.color.textSecondary,letterSpacing:.3},enhancedChangeRow:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingLeft:4},enhancedChangeIcon:{fontSize:12,color:ne.color.warning,fontFamily:qe,width:16},enhancedChangeText:{fontSize:12,color:ne.color.text,fontFamily:qe,flex:1},enhancedNoChanges:{fontSize:12,color:ne.color.textTertiary,fontStyle:"italic",paddingLeft:4}});U();function Su(e,t){let n=e.filter(y=>y.renderCount>=t.minRenders);if(t.filterCauses.length>0){let y=new Set(t.filterCauses);n=n.filter(v=>y.has(v.lastRenderCause?.type??"unknown"))}let r=e.flatMap(y=>[y.firstRenderTime,y.lastRenderTime]).filter(y=>Number.isFinite(y)),o=r.length>0?Math.max(...r)-Math.min(...r):0,i=Math.max(.001,o/1e3),l=(t.groupByName?wu(n):n.map(y=>[y])).map(y=>xu(y,t,i));Ru(l,t.sortBy);let a=t.topN===-1?0:Math.max(0,l.length-t.topN),c=t.topN===-1?l:l.slice(0,t.topN),s=e.reduce((y,v)=>y+v.renderCount,0),d=Iu(e),b=0,C=false;for(let y of e)y.lastRenderCause||(b+=y.renderCount),y.renderHistory&&y.renderHistory.length>0&&(C=true);return{totalUniqueComponents:n.length,totalRenders:s,windowMs:o,causeBreakdown:d,rows:c,truncated:a,dataGaps:{historyOff:!C,propsCaptureOff:!e.some(y=>y.renderHistory?.some(v=>v.capturedProps!==void 0)),stateCaptureOff:!e.some(y=>y.renderHistory?.some(v=>v.capturedState!==void 0)),rendersWithoutCause:b}}}function wu(e){let t=new Map;for(let n of e){let r=n.componentName||n.displayName||n.viewType,o=t.get(r);o?o.push(n):t.set(r,[n])}return Array.from(t.values())}function xu(e,t,n){let r=e[0],o=r.componentName||r.displayName||r.viewType,i=0,l={},a=new Map,c=new Map,s=new Map,d=0,b=0,C=0;for(let k of e){i+=k.renderCount;let D=k.lastRenderCause;if(!D)continue;let W=D.type;l[W]=(l[W]??0)+k.renderCount;let Q=(D.hookChanges?.length??0)>0,z=(D.changedKeys?.length??0)>0;if(W==="parent"&&(D.componentCause==="state"||D.componentCause==="props"||Q||z?b+=k.renderCount:C+=k.renderCount),W==="props"&&!z&&(d+=k.renderCount),D.parentComponentName&&s.set(D.parentComponentName,(s.get(D.parentComponentName)??0)+1),t.aggregateCauses&&D.hookChanges)for(let _ of D.hookChanges){let T=`${_.type}[${_.index}]`,L=a.get(T);L?L.count+=1:a.set(T,{count:1,sample:Du(_)})}if(D.changedKeys)for(let _ of D.changedKeys)_.includes("(ref only)")||c.set(_,(c.get(_)??0)+1)}let y=Array.from(a.entries()).sort((k,D)=>D[1].count-k[1].count).slice(0,3).map(([k,D])=>({hook:k,count:D.count,sample:D.sample})),v=Array.from(c.entries()).sort((k,D)=>D[1]-k[1]).slice(0,5).map(([k])=>k),m="unknown",w=-1;for(let[k,D]of Object.entries(l))(D??0)>w&&(w=D??0,m=k);let u,x=0;for(let[k,D]of s)D>x&&(x=D,u=k);let R=e.map(k=>k.renderCount).sort((k,D)=>D-k),H=i/n;return{name:o,viewType:r.viewType,instances:e.length,renders:i,causeMix:l,dominantCause:m,hookCauses:y,changedKeys:v,unknownPropsCount:d,parentWithOwnChange:b,parentNoChange:C,parentName:u,instanceCounts:R,rate:H,source:e}}function Iu(e){let t={};for(let n of e){let r=n.lastRenderCause?.type??"unknown";t[r]=(t[r]??0)+n.renderCount}return t}function Ru(e,t){switch(t){case"renderCount":e.sort((n,r)=>r.renders-n.renders);break;case"rate":e.sort((n,r)=>r.rate-n.rate);break;case"name":e.sort((n,r)=>n.name.localeCompare(r.name));break}}var Ai=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>Ai?t.slice(0,Ai-1)+"\u2026":t}function Du(e){return e.previousValue===void 0&&e.currentValue===void 0?e.description:`${Hi(e.previousValue)} \u2192 ${Hi(e.currentValue)}`}function Mi(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function br(e){return e>=100?`${e.toFixed(0)}/s`:e>=10?`${e.toFixed(1)}/s`:`${e.toFixed(2)}/s`}function $i(e){let t=Object.entries(e).sort((n,r)=>(r[1]??0)-(n[1]??0));return t.length===0?"(no causes recorded)":t.map(([n,r])=>`${n} ${r}`).join(" \xB7 ")}function Ei(e){let t=[],n=Object.entries(e.causeMix).filter(([,o])=>(o??0)>0).sort((o,i)=>(i[1]??0)-(o[1]??0)),r=n.length>=2&&(n[1]?.[1]??0)>=e.renders*.1;if(e.dominantCause==="hooks"&&e.hookCauses.length>0){let o=e.hookCauses[0];o.sample?t.push(`hooks \xD7${o.count} ${o.hook}: ${o.sample}`):t.push(`hooks \xD7${o.count} ${o.hook}`)}else if(e.dominantCause==="props"){if(e.changedKeys.length>0){let o=e.changedKeys.slice(0,3).join(", ");t.push(`props (${o})`)}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 o="parent cascade";e.parentNoChange>0&&e.parentWithOwnChange===0&&(o="parent cascade, no own change"),e.parentName&&(o+=` \u2190 ${e.parentName}`),t.push(o)}else e.dominantCause==="mount"?t.push("mount"):e.dominantCause==="state"?t.push("state"):e.dominantCause==="context"?t.push("context"):t.push("unknown");if(r){let o=n.map(([i,l])=>`${i}:${l}`).join(" + ");t.push(`(${o})`)}return t.join(" ")}function Fi(e){if(e.instances<=1)return e.name;let t=e.instanceCounts,n=t[0]??0,r=t[t.length-1]??0;if(n-r<=1)return`${e.name} \xD7${e.instances} (${n} each)`;let o=t.slice(1),i=o.reduce((a,c)=>a+c,0),l=o.length>0?i/o.length:0;return`${e.name} \xD7${e.instances} (top ${n}, others ~${Math.round(l)})`}var ku="React Native render report \u2014 review the data and identify why components are re-rendering.";function Oi(e,t){let n=[];n.push(ku),n.push(""),n.push(`Window: ${Mi(e.windowMs)} \xB7 ${e.totalUniqueComponents} components \xB7 ${e.totalRenders} renders`),n.push(`Cause mix: ${$i(e.causeBreakdown)}`),n.push(""),n.push("Top offenders (count \xB7 rate \xB7 component \xB7 cause):"),n.push("");let r=e.rows.map(Fi),o=Math.min(36,Math.max(8,...r.map(c=>c.length))),i=Math.max(3,...e.rows.map(c=>`\xD7${c.renders}`.length)),l=Math.max(5,...e.rows.map(c=>br(c.rate).length));for(let c=0;c<e.rows.length;c++){let s=e.rows[c],d=(r[c]??s.name).padEnd(o),b=`\xD7${s.renders}`.padStart(i),C=br(s.rate).padStart(l),y=Ei(s);n.push(` ${b} ${C} ${d} ${y}`)}e.truncated>0&&(n.push(""),n.push(`... ${e.truncated} more (set topN=-1 to expand)`));let a=_i(e);if(a.length>0){n.push(""),n.push("Data availability:");for(let c of a)n.push(` \xB7 ${c}`)}return n.join(`
|
|
31
|
+
`)}function _i(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}function Pu(e,t){let n=[];n.push("# React Render Report"),n.push(""),n.push(`**Window:** ${Mi(e.windowMs)} \xB7 **Components:** ${e.totalUniqueComponents} \xB7 **Renders:** ${e.totalRenders}`),n.push(`**Cause mix:** ${$i(e.causeBreakdown)}`),n.push(""),n.push("| Component | Renders | Rate | Cause |"),n.push("|---|---:|---:|---|");for(let o of e.rows){let i=Fi(o),l=Ei(o).replace(/\|/g,"\\|");n.push(`| ${i} | ${o.renders} | ${br(o.rate)} | ${l} |`)}e.truncated>0&&(n.push(""),n.push(`_... ${e.truncated} more rows_`));let r=_i(e);if(r.length>0){n.push(""),n.push("**Data availability:**");for(let o of r)n.push(`- ${o}`)}return n.join(`
|
|
32
|
+
`)}function Lu(e,t,n){let r={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(o=>({name:o.name,viewType:o.viewType,instances:o.instances,instanceCounts:o.instances>1?o.instanceCounts:void 0,renders:o.renders,ratePerSec:Number(o.rate.toFixed(3)),dominantCause:o.dominantCause,causeMix:o.causeMix,hookCauses:o.hookCauses,changedKeys:o.changedKeys,unknownPropsCount:o.unknownPropsCount||void 0,parentName:o.parentName,parentWithOwnChange:o.parentWithOwnChange||void 0,parentNoChange:o.parentNoChange||void 0,...n.includeHistory?{history:zu(o.source)}:{}}))};return n.includeHistory?JSON.stringify(r,null,2):JSON.stringify(r)}function zu(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(r=>({type:r.type,index:r.index,desc:r.description}))}}))}))}function vr(e,t){let n=Su(e,t);switch(t.format){case"summary":return Oi(n,t);case"markdown-table":return Pu(n,t);case"json":return Lu(e,n,t);default:return Oi(n,t)}}function Nu(e,t){return vr(e,t).length}function Wi(e){return{totalComponents:e.length,totalRenders:e.reduce((t,n)=>t+n.renderCount,0)}}function Vu(e){return vr([e],{format:"summary",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false})}import{jsx as F,jsxs as X}from"react/jsx-runtime";function ji({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:r,onAddFilter:o,isPro:i=false}){let[l,a]=Ni(0),c=n??l,s=r??a,d=yn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((z,_)=>z.timestamp-_.timestamp),[e.renderHistory]),b=d.length,C=d[c],y=bu("highlightUpdates.detailEvents"),v=i?1/0:y,m=yn(()=>Math.max(0,b-v),[v,b]),w=C?.cause||e.lastRenderCause,u=Ot(()=>{c>0&&s(c-1)},[c,s]),x=Ot(()=>{let z=Math.min(v-1,b-1);c<z&&s(c+1)},[c,b,s,v]),R=yn(()=>Vu(e),[e]),H=e.componentName||e.displayName,k=e.viewType,D=e.lastRenderTime-e.firstRenderTime,W=D>0?(e.renderCount/(D/1e3)).toFixed(1):e.renderCount.toString(),Q=!t&&b>1;return X(h,{style:P.container,children:[X(h,{style:P.header,children:[X(h,{style:P.headerLeft,children:[F(g,{testID:"buoy-highlight-detail-name",style:P.componentName,numberOfLines:1,children:H}),F(h,{style:P.nativeTypeBadge,children:F(g,{testID:"buoy-highlight-detail-type",style:P.nativeTypeText,children:k})})]}),F(hu,{value:R,size:14,testID:"buoy-highlight-detail-copy"})]}),X(Ve,{testID:"buoy-highlight-detail-scroll",style:P.scrollView,contentContainerStyle:[P.scrollContent,Q&&{paddingBottom:100}],showsVerticalScrollIndicator:false,children:[w&&F(Bu,{cause:w,renderNumber:C?.renderNumber}),F(Au,{render:e,rendersPerSec:W}),m>0&&X(h,{testID:"buoy-highlight-detail-locked",style:P.lockedBanner,children:[F(yu,{size:14,color:E.color.warning}),X(g,{testID:"buoy-highlight-detail-locked-text",style:P.lockedBannerText,children:[m," ",m===1?"event":"events"," hidden"]}),F(g,{style:P.lockedBannerSubtext,children:"Upgrade to Pro"})]}),o&&F(Hu,{render:e,onAddFilter:o})]}),Q&&F(fu,{currentIndex:c,totalItems:b,onPrevious:u,onNext:x,itemLabel:"Render",subtitle:C?.timestamp?gu(new Date(C.timestamp)):void 0,applySafeAreaInset:false,absolute:true})]})}function Bu({cause:e,renderNumber:t}){let n=e.componentCause||e.type,r=e.componentCause?_t[e.componentCause]:Ee[e.type],o=e.hookChanges&&e.hookChanges.length>0,i=e.changedKeys&&e.changedKeys.length>0,l=()=>e.type==="mount"?"First render":n==="parent"?"Triggered by":"Changed:";return X(h,{testID:"buoy-highlight-detail-cause",style:P.answerCard,children:[X(h,{style:P.causeBadgeRow,children:[F(g,{testID:"buoy-highlight-detail-cause-label",style:P.causeLabel,children:l()}),F(h,{style:[P.causeBadgeLarge,{backgroundColor:r.color+"20"}],children:F(g,{testID:"buoy-highlight-detail-cause-badge",style:[P.causeBadgeLargeText,{color:r.color}],children:r.label.toUpperCase()})})]}),o&&F(h,{style:P.hookChangesContainer,children:e.hookChanges.map((a,c)=>{let s=`${a.type}[${a.index}]`,d={[s]:a.previousValue},b={[s]:a.currentValue};return F(h,{style:P.hookDiffContainer,children:F(vu,{oldValue:d,newValue:b,theme:"dark",showUnchanged:false})},c)})}),!o&&i&&F(h,{style:P.propsChangesContainer,children:e.changedKeys.filter(a=>!a.includes("(ref only)")).slice(0,5).map((a,c)=>F(h,{style:P.propChangeChip,children:F(g,{testID:`buoy-highlight-detail-changed-${c}`,style:P.propChangeText,children:a})},c))})]})}function Au({render:e,rendersPerSec:t}){let n=e.testID||e.nativeID||e.accessibilityLabel,r=e.measurements;return X(h,{style:P.detailsSection,children:[n&&X(h,{testID:"buoy-highlight-detail-identifiers",style:P.detailsCard,children:[F(g,{style:P.detailsCardTitle,children:"Identifiers"}),e.testID&&F(Cr,{label:"testID",value:e.testID}),e.nativeID&&F(Cr,{label:"nativeID",value:e.nativeID}),e.accessibilityLabel&&F(Cr,{label:"a11y",value:e.accessibilityLabel})]}),X(h,{testID:"buoy-highlight-detail-stats",style:P.statsRow,children:[X(h,{testID:"buoy-highlight-detail-stat-renders",style:P.statItem,children:[F(g,{testID:"buoy-highlight-detail-stat-renders-value",style:[P.statValue,{color:e.color}],children:e.renderCount}),F(g,{style:P.statLabel,children:"renders"})]}),F(h,{style:P.statDivider}),X(h,{testID:"buoy-highlight-detail-stat-rate",style:P.statItem,children:[F(g,{testID:"buoy-highlight-detail-stat-rate-value",style:P.statValue,children:t}),F(g,{style:P.statLabel,children:"/sec"})]}),F(h,{style:P.statDivider}),X(h,{testID:"buoy-highlight-detail-stat-tag",style:P.statItem,children:[F(g,{testID:"buoy-highlight-detail-stat-tag-value",style:P.statValue,children:e.nativeTag}),F(g,{style:P.statLabel,children:"tag"})]})]}),r&&X(h,{testID:"buoy-highlight-detail-measure",style:P.measurementsRow,children:[X(h,{style:P.measurementItem,children:[F(g,{style:P.measurementLabel,children:"x"}),F(g,{testID:"buoy-highlight-detail-measure-x",style:P.measurementValue,children:Math.round(e.measurements.x)})]}),X(h,{style:P.measurementItem,children:[F(g,{style:P.measurementLabel,children:"y"}),F(g,{testID:"buoy-highlight-detail-measure-y",style:P.measurementValue,children:Math.round(e.measurements.y)})]}),X(h,{style:P.measurementItem,children:[F(g,{style:P.measurementLabel,children:"w"}),F(g,{testID:"buoy-highlight-detail-measure-w",style:P.measurementValue,children:Math.round(e.measurements.width)})]}),X(h,{style:P.measurementItem,children:[F(g,{style:P.measurementLabel,children:"h"}),F(g,{testID:"buoy-highlight-detail-measure-h",style:P.measurementValue,children:Math.round(e.measurements.height)})]})]})]})}function Cr({label:e,value:t}){let n=`buoy-highlight-detail-id-${e.toLowerCase()}`;return X(h,{testID:n,style:P.detailRow,children:[F(g,{style:P.detailLabel,children:e}),F(g,{testID:`${n}-value`,style:P.detailValue,numberOfLines:1,children:t})]})}function Hu({render:e,onAddFilter:t}){let[n,r]=Ni(null),o=yn(()=>{let s=[];return e.nativeID&&s.push({type:"nativeID",value:e.nativeID,label:"nativeID"}),e.testID&&s.push({type:"testID",value:e.testID,label:"testID"}),e.accessibilityLabel&&s.push({type:"accessibilityLabel",value:e.accessibilityLabel,label:"a11y"}),e.componentName&&s.push({type:"component",value:e.componentName,label:"component"}),s.push({type:"viewType",value:e.viewType,label:"viewType"}),s},[e]),i=n!==null?o[n]:null,l=Ot(s=>{r(d=>d===s?null:s)},[]),a=Ot(()=>{i&&(t({type:i.type,value:i.value},"include"),r(null))},[i,t]),c=Ot(()=>{i&&(t({type:i.type,value:i.value},"exclude"),r(null))},[i,t]);return X(h,{testID:"buoy-highlight-quick",style:P.quickActionsSection,children:[F(g,{style:P.quickActionsTitle,children:"Quick Filters"}),F(h,{style:P.filterOptionsList,children:o.map((s,d)=>F(Mu,{testID:`buoy-highlight-quick-${s.type.toLowerCase()}`,label:s.label,value:s.value,isSelected:n===d,onSelect:()=>l(d)},s.type))}),X(h,{style:P.filterActionButtons,children:[X(J,{testID:"buoy-highlight-quick-include",accessibilityRole:"button",accessibilityLabel:"Only show this",style:[P.filterActionButton,P.filterActionButtonInclude,!i&&P.filterActionButtonDisabled],onPress:a,disabled:!i,activeOpacity:.7,children:[F(pu,{size:14,color:i?E.color.accent:E.color.textTertiary}),F(g,{style:[P.filterActionButtonText,{color:i?E.color.accent:E.color.textTertiary}],children:"Only Show This"})]}),X(J,{testID:"buoy-highlight-quick-exclude",accessibilityRole:"button",accessibilityLabel:"Hide this",style:[P.filterActionButton,P.filterActionButtonExclude,!i&&P.filterActionButtonDisabled],onPress:c,disabled:!i,activeOpacity:.7,children:[F(mu,{size:14,color:i?E.color.danger:E.color.textTertiary}),F(g,{style:[P.filterActionButtonText,{color:i?E.color.danger:E.color.textTertiary}],children:"Hide This"})]})]})]})}function Mu({testID:e,label:t,value:n,isSelected:r,onSelect:o}){return X(J,{testID:e,accessibilityRole:"button",accessibilityLabel:`${t}, ${n}`,style:[P.filterOptionCard,r&&P.filterOptionCardSelected],onPress:o,activeOpacity:.7,children:[F(g,{style:[P.filterOptionLabel,r&&P.filterOptionLabelSelected],children:t}),F(g,{testID:e?`${e}-value`:void 0,style:[P.filterOptionValue,r&&P.filterOptionValueSelected],numberOfLines:1,children:n})]})}var P=fe.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:E.color.text,flexShrink:1},nativeTypeBadge:{backgroundColor:E.color.bg,paddingVertical:3,paddingHorizontal:8,borderRadius:4},nativeTypeText:{fontSize:11,fontWeight:"600",color:E.color.textTertiary,fontFamily:pt},answerCard:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.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:E.color.textSecondary,fontWeight:"500"},hookChangesContainer:{gap:6},hookDiffContainer:{backgroundColor:E.color.bg,borderRadius:6,overflow:"hidden"},propsChangesContainer:{flexDirection:"row",flexWrap:"wrap",gap:4},propChangeChip:{backgroundColor:E.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},propChangeText:{fontSize:11,color:E.color.text,fontFamily:pt},detailsSection:{gap:10},detailsCard:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:12,gap:6},detailsCardTitle:{fontSize:10,fontWeight:"600",color:E.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:4},detailRow:{flexDirection:"row",alignItems:"center",gap:8},detailLabel:{fontSize:11,fontWeight:"600",color:E.color.textSecondary,minWidth:55},detailValue:{fontSize:12,color:E.color.text,fontFamily:pt,flex:1},statsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,paddingVertical:10,paddingHorizontal:16},statItem:{flex:1,alignItems:"center"},statValue:{fontSize:16,fontWeight:"700",color:E.color.text,fontFamily:pt},statLabel:{fontSize:10,color:E.color.textTertiary,marginTop:2},statDivider:{width:1,height:24,backgroundColor:E.color.border,marginHorizontal:12},measurementsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,paddingVertical:8,paddingHorizontal:12},measurementItem:{flexDirection:"row",alignItems:"baseline",gap:4},measurementLabel:{fontSize:10,fontWeight:"600",color:E.color.textTertiary,textTransform:"uppercase"},measurementValue:{fontSize:12,fontWeight:"600",color:E.color.text,fontFamily:pt},quickActionsSection:{backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.border,padding:12,gap:10},quickActionsTitle:{fontSize:10,fontWeight:"600",color:E.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:2},filterOptionsList:{gap:6},filterOptionCard:{flexDirection:"row",alignItems:"center",backgroundColor:E.color.surfaceElevated,borderRadius:6,paddingVertical:10,paddingHorizontal:12,borderWidth:1,borderColor:"transparent",gap:10},filterOptionCardSelected:{borderColor:E.color.accentBorderStrong,backgroundColor:E.color.accentSoft},filterOptionLabel:{fontSize:10,fontWeight:"600",color:E.color.textTertiary,minWidth:70},filterOptionLabelSelected:{color:E.color.accent},filterOptionValue:{fontSize:12,color:E.color.text,fontFamily:pt,flex:1},filterOptionValueSelected:{color:E.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:E.color.accentSoft,borderColor:E.color.accentBorderStrong},filterActionButtonExclude:{backgroundColor:E.color.dangerSoft,borderColor:E.color.danger+"40"},filterActionButtonDisabled:{backgroundColor:E.color.surfaceElevated,borderColor:E.color.border,opacity:.5},filterActionButtonText:{fontSize:11,fontWeight:"600"},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:E.color.surface,borderRadius:8,borderWidth:1,borderColor:E.color.warning+"40",paddingVertical:12,paddingHorizontal:16,gap:8},lockedBannerText:{color:E.color.warning,fontSize:13,fontWeight:"600"},lockedBannerSubtext:{color:E.color.textTertiary,fontSize:12}});import{EventStepperFooter as $u}from"@buoy-gg/shared-ui/web";U();import{useState as Je,useCallback as Ye}from"react";import{Eye as Ui,Filter as Tr,Plus as Gi,X as bn,Box as Ki,Settings as Eu,Hash as Fu,SectionHeader as ee,night as S,monoFont as mt}from"@buoy-gg/shared-ui/web";U();import{Box as Ou,Hash as qi,Layers as _u,Eye as Wu,Search as ju,FileCode as Uu,buoyColors as Sr,night as Ji,monoFont as Yi}from"@buoy-gg/shared-ui/web";import{jsx as ft,jsxs as wr}from"react/jsx-runtime";var Xi={viewType:{label:"ViewType",shortLabel:"View",color:Ji.color.accent,icon:Ou},testID:{label:"testID",shortLabel:"test",color:Sr.success,icon:qi},nativeID:{label:"nativeID",shortLabel:"native",color:"#f59e0b",icon:qi},component:{label:"Component",shortLabel:"Comp",color:"#a855f7",icon:Uu},accessibilityLabel:{label:"a11y",shortLabel:"a11y",color:"#ec4899",icon:Wu},nativeTag:{label:"tag",shortLabel:"tag",color:Sr.textMuted,icon:_u},any:{label:"Any",shortLabel:"Any",color:Sr.warning,icon:ju}};function Wt({type:e,value:t,compact:n=false,badgeOnly:r=false,valueOnly:o=false,shortLabel:i=false,showIcon:l=false,testID:a}){let c=Xi[e],s=c.icon,d=i?c.shortLabel:c.label;return o?ft(g,{testID:a?`${a}-value`:void 0,style:[pe.valueOnly,n&&pe.valueOnlyCompact,{color:c.color}],numberOfLines:1,children:t}):r?wr(h,{testID:a,style:[pe.badgeOnly,n&&pe.badgeOnlyCompact,{backgroundColor:c.color+"20",borderColor:c.color+"40"}],children:[l&&ft(s,{size:n?10:12,color:c.color}),ft(g,{style:[pe.badgeOnlyText,n&&pe.badgeOnlyTextCompact,{color:c.color}],children:d})]}):wr(h,{testID:a,accessibilityLabel:`${c.label} ${t}`,style:[pe.container,n&&pe.containerCompact],children:[wr(h,{style:[pe.badge,n&&pe.badgeCompact,{backgroundColor:c.color+"20"}],children:[l&&ft(s,{size:n?8:10,color:c.color}),ft(g,{style:[pe.badgeText,n&&pe.badgeTextCompact,{color:c.color}],children:d})]}),ft(g,{testID:a?`${a}-value`:void 0,style:[pe.value,n&&pe.valueCompact],numberOfLines:1,children:t})]})}var pe=fe.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:Ji.color.text,fontFamily:Yi,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:Yi},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"}});U();function yt(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function Qi(e){return`buoy-highlight-row-${yt(e)}`}function Zi(e,t){return`buoy-highlight-detected-${yt(e)}-${yt(t)}`}function ea(e,t,n){return`buoy-highlight-${e}-chip-${yt(t)}-${yt(n)}`}function bt(e){return`buoy-highlight-setting-${e}`}import{Fragment as xr,jsx as f,jsxs as $}from"react/jsx-runtime";var jt=e=>Xi[e],Gu=["any","viewType","testID","nativeID","component","accessibilityLabel"];function ta({mode:e,onSelect:t,onCancel:n}){return $(h,{nativeID:"__rn_buoy__type-picker",testID:`buoy-highlight-${e}-types`,style:p.typePicker,children:[f(h,{style:p.typePickerRow,children:Gu.map(r=>{let o=jt(r),i=o.icon;return $(J,{testID:`buoy-highlight-${e}-type-${r.toLowerCase()}`,accessibilityRole:"button",accessibilityLabel:o.label,style:[p.typeOption,{backgroundColor:o.color+"15",borderColor:o.color+"40"}],onPress:()=>t(r),children:[f(i,{size:14,color:o.color}),f(g,{style:[p.typeOptionText,{color:o.color}],children:o.label})]},r)})}),f(J,{testID:`buoy-highlight-${e}-types-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:n,style:p.typePickerCancel,children:f(bn,{size:16,color:S.color.textTertiary})})]})}function na({mode:e,type:t,onSubmit:n,onCancel:r}){let[o,i]=Je(""),l=jt(t),a=()=>{o.trim()&&n(o.trim())};return $(h,{nativeID:"__rn_buoy__pattern-input",testID:`buoy-highlight-${e}-input-row`,style:p.patternInputContainer,children:[f(Wt,{type:t,value:"",badgeOnly:true,compact:true}),f(nn,{testID:`buoy-highlight-${e}-input`,value:o,onChangeText:i,onSubmitEditing:a,placeholder:"Enter pattern...",placeholderTextColor:S.color.placeholder,style:p.patternInput,autoFocus:true,returnKeyType:"done",autoCorrect:false,autoCapitalize:"none"}),o.trim()&&f(J,{testID:`buoy-highlight-${e}-submit`,accessibilityRole:"button",accessibilityLabel:"Add pattern",onPress:a,style:[p.addPatternButton,{backgroundColor:l.color+"20"}],children:f(g,{style:[p.addPatternButtonText,{color:l.color}],children:"Add"})}),f(J,{testID:`buoy-highlight-${e}-input-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:r,style:p.cancelButton,children:f(bn,{size:16,color:S.color.textTertiary})})]})}function ra({mode:e,pattern:t,onRemove:n}){let r=jt(t.type);return $(J,{testID:ea(e,t.type,t.value),accessibilityRole:"button",accessibilityLabel:`${r.label} ${t.value}, tap to remove`,style:[p.patternChip,{borderColor:r.color+"40"}],onPress:n,activeOpacity:.7,children:[f(h,{style:[p.patternChipBadge,{backgroundColor:r.color+"20"}],children:f(g,{style:[p.patternChipBadgeText,{color:r.color}],children:r.shortLabel})}),f(g,{style:p.patternChipValue,numberOfLines:1,children:t.value}),f(bn,{size:12,color:S.color.textTertiary,style:p.patternChipX})]})}var Ku={label:"All",shortLabel:"All",color:S.color.textSecondary,icon:Ki};function vt({filterType:e,count:t,isSelected:n,onPress:r}){let o=e==="all"?Ku:jt(e),i=`buoy-highlight-detected-cat-${String(e).toLowerCase()}`;return $(J,{testID:i,accessibilityRole:"button",accessibilityLabel:`${o.label}, ${t}`,style:[p.categoryBadge,{backgroundColor:o.color+"15",borderColor:n?o.color:o.color+"40",borderWidth:n?2:1}],onPress:r,children:[f(o.icon,{size:12,color:o.color}),f(g,{style:[p.categoryBadgeText,{color:o.color}],children:o.label}),f(h,{style:[p.categoryBadgeCountBubble,{backgroundColor:o.color+"25"}],children:f(g,{testID:`${i}-count`,style:[p.categoryBadgeCount,{color:o.color}],children:t})})]})}var qu=[{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:150,label:"150"},{value:250,label:"250"},{value:500,label:"500"}],Ir=[{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 oa({filters:e,onFilterChange:t,settings:n,onSettingsChange:r,availableProps:o,activeTab:i}){let[l,a]=Je(false),[c,s]=Je(false),[d,b]=Je(null),[C,y]=Je(null),[v,m]=Je("all"),[w,u]=Je(null),x=(T=>{switch(T){case"viewType":return o.viewTypes.map(L=>({value:L,type:"viewType"}));case"testID":return o.testIDs.map(L=>({value:L,type:"testID"}));case"nativeID":return o.nativeIDs.map(L=>({value:L,type:"nativeID"}));case"component":return o.componentNames.map(L=>({value:L,type:"component"}));case"accessibilityLabel":return o.accessibilityLabels.map(L=>({value:L,type:"accessibilityLabel"}));case"all":default:return[...o.viewTypes.map(L=>({value:L,type:"viewType"})),...o.testIDs.map(L=>({value:L,type:"testID"})),...o.nativeIDs.map(L=>({value:L,type:"nativeID"})),...o.componentNames.map(L=>({value:L,type:"component"})),...o.accessibilityLabels.map(L=>({value:L,type:"accessibilityLabel"}))]}})(v),R=o.viewTypes.length+o.testIDs.length+o.nativeIDs.length+o.componentNames.length+o.accessibilityLabels.length,H=Ye((T,L)=>{let le=[...e.includePatterns,{type:T,value:L}];t({includePatterns:le}),b(null)},[e.includePatterns,t]),k=Ye((T,L)=>{let le=[...e.excludePatterns,{type:T,value:L}];t({excludePatterns:le}),y(null)},[e.excludePatterns,t]),D=Ye(T=>{let L=e.includePatterns.filter((le,he)=>he!==T);t({includePatterns:L})},[e.includePatterns,t]),W=Ye(T=>{let L=e.excludePatterns.filter((le,he)=>he!==T);t({excludePatterns:L})},[e.excludePatterns,t]),Q=Ye((T,L)=>{u({type:T,value:L})},[]),z=Ye(()=>{w&&(H(w.type,w.value),u(null))},[w,H]),_=Ye(()=>{w&&(k(w.type,w.value),u(null))},[w,k]);return f(h,{style:p.container,children:f(Ve,{nativeID:"__rn_buoy__filter-view",testID:"buoy-highlight-filter-scroll",style:p.scrollView,contentContainerStyle:p.scrollContent,showsVerticalScrollIndicator:false,children:i==="filters"?$(xr,{children:[$(h,{style:p.section,children:[$(ee,{children:[f(ee.Icon,{icon:Ui,color:S.color.accent,size:12}),f(ee.Title,{children:"INCLUDE ONLY"}),e.includePatterns.length>0&&f(ee.Badge,{testID:"buoy-highlight-include-count",count:e.includePatterns.length,color:S.color.accent})]}),f(g,{style:p.sectionDescription,children:"Show only components matching these patterns. If any are set, components must match at least one."}),e.includePatterns.length>0&&f(h,{style:p.patternChips,children:e.includePatterns.map((T,L)=>f(ra,{mode:"include",pattern:T,onRemove:()=>D(L)},`${T.type}-${T.value}-${L}`))}),f(h,{style:p.addPatternRow,children:l?f(ta,{mode:"include",onSelect:T=>{a(false),b(T)},onCancel:()=>a(false)}):d?f(na,{mode:"include",type:d,onSubmit:T=>H(d,T),onCancel:()=>b(null)}):$(J,{testID:"buoy-highlight-include-add",accessibilityRole:"button",accessibilityLabel:"Add include pattern",style:[p.addButton,{borderColor:S.color.accentBorderStrong}],onPress:()=>a(true),children:[f(Gi,{size:14,color:S.color.accent}),f(g,{style:[p.addButtonText,{color:S.color.accent}],children:"Add include pattern"})]})})]}),$(h,{style:p.section,children:[$(ee,{children:[f(ee.Icon,{icon:Tr,color:S.color.accent,size:12}),f(ee.Title,{children:"EXCLUDE"}),e.excludePatterns.length>0&&f(ee.Badge,{testID:"buoy-highlight-exclude-count",count:e.excludePatterns.length,color:S.color.accent})]}),f(g,{style:p.sectionDescription,children:"Hide components matching these patterns from the list."}),e.excludePatterns.length>0&&f(h,{style:p.patternChips,children:e.excludePatterns.map((T,L)=>f(ra,{mode:"exclude",pattern:T,onRemove:()=>W(L)},`${T.type}-${T.value}-${L}`))}),f(h,{style:p.addPatternRow,children:c?f(ta,{mode:"exclude",onSelect:T=>{s(false),y(T)},onCancel:()=>s(false)}):C?f(na,{mode:"exclude",type:C,onSubmit:T=>k(C,T),onCancel:()=>y(null)}):$(J,{testID:"buoy-highlight-exclude-add",accessibilityRole:"button",accessibilityLabel:"Add exclude pattern",style:[p.addButton,{borderColor:S.color.accentBorderStrong}],onPress:()=>s(true),children:[f(Gi,{size:14,color:S.color.accent}),f(g,{style:[p.addButtonText,{color:S.color.accent}],children:"Add exclude pattern"})]})})]}),$(h,{style:p.section,children:[$(ee,{children:[f(ee.Icon,{icon:Fu,color:S.color.warning,size:12}),f(ee.Title,{children:"RENDER COUNT RANGE"}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&f(ee.Badge,{count:1,color:S.color.warning})]}),f(g,{style:p.sectionDescription,children:"Show only components with render count in a specific range."}),$(h,{nativeID:"__rn_buoy__render-count-range",testID:"buoy-highlight-range",style:p.renderCountRangeContainer,children:[$(h,{style:p.renderCountInputRow,children:[$(h,{style:p.renderCountInputGroup,children:[f(g,{style:p.renderCountLabel,children:"Min"}),f(nn,{value:e.minRenderCount!==void 0?String(e.minRenderCount):"",onChangeText:T=>{let L=parseInt(T,10);T===""||T===void 0?t({minRenderCount:void 0}):!isNaN(L)&&L>=0&&t({minRenderCount:L})},testID:"buoy-highlight-range-min",placeholder:"0",placeholderTextColor:S.color.placeholder,style:p.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]}),f(g,{style:p.renderCountSeparator,children:"to"}),$(h,{style:p.renderCountInputGroup,children:[f(g,{style:p.renderCountLabel,children:"Max"}),f(nn,{value:e.maxRenderCount!==void 0?String(e.maxRenderCount):"",onChangeText:T=>{let L=parseInt(T,10);T===""||T===void 0?t({maxRenderCount:void 0}):!isNaN(L)&&L>=0&&t({maxRenderCount:L})},testID:"buoy-highlight-range-max",placeholder:"\u221E",placeholderTextColor:S.color.placeholder,style:p.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]})]}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&$(J,{testID:"buoy-highlight-range-clear",accessibilityRole:"button",accessibilityLabel:"Clear range",style:p.clearRangeButton,onPress:()=>t({minRenderCount:void 0,maxRenderCount:void 0}),children:[f(bn,{size:12,color:S.color.warning}),f(g,{style:p.clearRangeButtonText,children:"Clear Range"})]})]})]}),$(h,{style:p.section,children:[$(ee,{children:[f(ee.Icon,{icon:Ki,color:S.color.textSecondary,size:12}),f(ee.Title,{children:"DETECTED ITEMS"})]}),f(g,{style:p.sectionDescription,children:"Tap an item to quickly add it as an exclude pattern."}),$(Ve,{horizontal:true,showsHorizontalScrollIndicator:false,style:p.categoryBadgeScroll,contentContainerStyle:p.categoryBadgeScrollContent,children:[R>0&&f(vt,{filterType:"all",count:R,isSelected:v==="all",onPress:()=>m("all")}),o.viewTypes.length>0&&f(vt,{filterType:"viewType",count:o.viewTypes.length,isSelected:v==="viewType",onPress:()=>m("viewType")}),o.testIDs.length>0&&f(vt,{filterType:"testID",count:o.testIDs.length,isSelected:v==="testID",onPress:()=>m("testID")}),o.nativeIDs.length>0&&f(vt,{filterType:"nativeID",count:o.nativeIDs.length,isSelected:v==="nativeID",onPress:()=>m("nativeID")}),o.componentNames.length>0&&f(vt,{filterType:"component",count:o.componentNames.length,isSelected:v==="component",onPress:()=>m("component")}),o.accessibilityLabels.length>0&&f(vt,{filterType:"accessibilityLabel",count:o.accessibilityLabels.length,isSelected:v==="accessibilityLabel",onPress:()=>m("accessibilityLabel")})]}),f(h,{nativeID:"__rn_buoy__detected-items",testID:"buoy-highlight-detected",style:p.detectedItemsContainer,children:x.length>0?f(Ve,{testID:"buoy-highlight-detected-scroll",style:p.detectedItemsScroll,contentContainerStyle:p.detectedItems,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:x.map(T=>{let L=jt(T.type);return f(J,{testID:Zi(T.type,T.value),accessibilityRole:"button",accessibilityLabel:`${L.label} ${T.value}`,style:[p.detectedItem,{borderColor:L.color+"40"}],onPress:()=>Q(T.type,T.value),children:v==="all"?f(Wt,{type:T.type,value:T.value,compact:true,shortLabel:true}):f(g,{style:p.detectedItemText,numberOfLines:1,children:T.value})},`${T.type}-${T.value}`)})}):f(g,{testID:"buoy-highlight-detected-empty",style:p.emptyText,children:"No items detected yet. Start tracking to see components here."})})]}),f(zo,{visible:w!==null,transparent:true,animationType:"fade",onRequestClose:()=>u(null),children:f(Lo,{accessible:false,testID:"buoy-highlight-detected-popup-backdrop",style:p.modalOverlay,onPress:()=>u(null),children:f(h,{accessible:false,testID:"buoy-highlight-detected-popup",style:p.actionPopup,children:w&&$(xr,{children:[f(h,{style:p.actionPopupHeader,children:f(Wt,{type:w.type,value:w.value,compact:true,shortLabel:true})}),$(h,{style:p.actionPopupButtons,children:[$(J,{testID:"buoy-highlight-detected-popup-include",accessibilityRole:"button",accessibilityLabel:"Include only",style:[p.actionPopupButton,p.actionPopupInclude],onPress:z,children:[f(Ui,{size:16,color:S.color.accent}),f(g,{style:[p.actionPopupButtonText,{color:S.color.accent}],children:"Include Only"})]}),$(J,{testID:"buoy-highlight-detected-popup-exclude",accessibilityRole:"button",accessibilityLabel:"Exclude",style:[p.actionPopupButton,p.actionPopupExclude],onPress:_,children:[f(Tr,{size:16,color:S.color.accent}),f(g,{style:[p.actionPopupButtonText,{color:S.color.accent}],children:"Exclude"})]})]}),f(J,{testID:"buoy-highlight-detected-popup-cancel",accessibilityRole:"button",accessibilityLabel:"Cancel",style:p.actionPopupCancel,onPress:()=>u(null),children:f(g,{style:p.actionPopupCancelText,children:"Cancel"})})]})})})}),$(h,{style:p.section,children:[$(ee,{children:[f(ee.Icon,{icon:Tr,color:S.color.textTertiary,size:12}),f(ee.Title,{children:"HOW FILTERS WORK"})]}),f(h,{style:p.howItWorks,children:$(g,{style:p.howItWorksText,children:[f(g,{style:p.howItWorksBold,children:"Any:"})," Matches against all fields",`
|
|
33
|
+
`,f(g,{style:p.howItWorksBold,children:"ViewType:"})," Native component class (RCTView, RCTText)",`
|
|
34
|
+
`,f(g,{style:p.howItWorksBold,children:"testID:"})," Component testID prop",`
|
|
35
|
+
`,f(g,{style:p.howItWorksBold,children:"Component:"})," React component name from fiber"]})})]})]}):f(xr,{children:$(h,{style:p.section,children:[$(ee,{children:[f(ee.Icon,{icon:Eu,color:S.color.textTertiary,size:12}),f(ee.Title,{children:"SETTINGS"})]}),$(h,{style:p.settingsSection,children:[$(h,{style:p.settingItem,children:[$(h,{style:p.settingHeader,children:[f(g,{style:p.settingLabel,children:"Show Render Count"}),f(at,{testID:bt("showRenderCount"),value:n.showRenderCount,onValueChange:T=>{r({showRenderCount:T}),!T&&n.trackRenderCauses&&r({trackRenderCauses:false})},trackColor:{false:S.color.surfaceElevated,true:S.color.accent+"80"},thumbColor:n.showRenderCount?S.color.accent:S.color.knob})]}),f(g,{style:p.settingDescription,children:"Display render count badge on highlights. Disabling improves performance by skipping count tracking."})]}),$(h,{style:[p.settingItem,p.settingItemSpaced],children:[$(h,{style:p.settingHeader,children:[f(g,{style:[p.settingLabel,!n.showRenderCount&&p.settingLabelDisabled],children:"Track Render Causes"}),f(at,{testID:bt("trackRenderCauses"),value:n.trackRenderCauses,onValueChange:T=>r({trackRenderCauses:T}),trackColor:{false:S.color.surfaceElevated,true:S.color.warning+"80"},thumbColor:n.trackRenderCauses?S.color.warning:S.color.knob,disabled:!n.showRenderCount})]}),$(g,{style:p.settingDescription,children:["Detect WHY components render (props, hooks, parent re-render).",!n.showRenderCount&&$(g,{style:p.settingWarning,children:[`
|
|
36
|
+
`,'Requires "Show Render Count" to be enabled.']})]})]}),$(h,{style:[p.settingItem,p.settingItemSpaced],children:[$(h,{style:p.settingHeader,children:[f(g,{style:[p.settingLabel,!n.trackRenderCauses&&p.settingLabelDisabled],children:"Enable Render History"}),f(at,{testID:bt("enableRenderHistory"),value:n.enableRenderHistory,onValueChange:T=>r({enableRenderHistory:T}),trackColor:{false:S.color.surfaceElevated,true:S.color.accent+"80"},thumbColor:n.enableRenderHistory?S.color.accent:S.color.knob,disabled:!n.trackRenderCauses})]}),$(g,{style:p.settingDescription,children:["Store render events for each component to view in the History tab.",!n.trackRenderCauses&&$(g,{style:p.settingWarning,children:[`
|
|
37
|
+
`,'Requires "Track Render Causes" to be enabled.']})]})]}),$(h,{style:[p.settingItem,p.settingItemSpaced],children:[$(h,{style:p.settingHeader,children:[f(g,{style:p.settingLabel,children:"Debug Log Level"}),f(h,{style:p.settingValue,children:f(g,{testID:"buoy-highlight-setting-debugLogLevel-value",style:[p.settingValueText,n.debugLogLevel!=="off"&&{color:S.color.warning}],children:Ir.find(T=>T.value===n.debugLogLevel)?.label||"Off"})})]}),f(g,{style:p.settingDescription,children:"Control console logging verbosity for render cause detection."}),f(h,{style:p.batchSizePresets,children:Ir.map(T=>f(J,{style:[p.batchSizePreset,n.debugLogLevel===T.value&&p.batchSizePresetActive,T.value!=="off"&&n.debugLogLevel===T.value&&{backgroundColor:S.color.warningSoft,borderColor:S.color.warning}],onPress:()=>r({debugLogLevel:T.value}),testID:`buoy-highlight-preset-log-${T.value}`,accessibilityRole:"button",accessibilityLabel:`Debug log level ${T.label}`,children:f(g,{style:[p.batchSizePresetText,n.debugLogLevel===T.value&&p.batchSizePresetTextActive,T.value!=="off"&&n.debugLogLevel===T.value&&{color:S.color.warning}],children:T.label})},T.value))}),$(g,{style:p.settingDescriptionMuted,children:[Ir.find(T=>T.value===n.debugLogLevel)?.description,n.debugLogLevel!=="off"&&" \u2022 Check Metro console for logs"]})]}),$(h,{style:[p.settingItem,p.settingItemSpaced],children:[$(h,{style:p.settingHeader,children:[f(g,{style:p.settingLabel,children:"Batch Size"}),f(h,{style:p.settingValue,children:f(g,{testID:"buoy-highlight-setting-batchSize-value",style:p.settingValueText,children:n.batchSize})})]}),f(g,{style:p.settingDescription,children:"Maximum components to highlight per render update. Higher values capture more re-renders but may impact performance on complex screens."}),f(h,{style:p.batchSizePresets,children:qu.map(T=>f(J,{style:[p.batchSizePreset,n.batchSize===T.value&&p.batchSizePresetActive],onPress:()=>r({batchSize:T.value}),testID:`buoy-highlight-preset-batch-${T.value}`,accessibilityRole:"button",accessibilityLabel:`Batch size ${T.label}`,children:f(g,{style:[p.batchSizePresetText,n.batchSize===T.value&&p.batchSizePresetTextActive],children:T.label})},T.value))})]}),$(h,{style:[p.settingItem,p.settingItemSpaced],children:[$(h,{style:p.settingHeader,children:[f(g,{style:p.settingLabel,children:"Show host views"}),f(at,{testID:bt("showHostViews"),value:!!n.showHostViews,onValueChange:T=>r({showHostViews:T}),trackColor:{false:S.color.surfaceElevated,true:S.color.accent+"80"},thumbColor:n.showHostViews?S.color.accent:S.color.knob})]}),f(g,{style:p.settingDescription,children:"Include anonymous View / RCTView / Text hosts. Off by default so the list is named composites (what actually re-rendered)."})]}),$(h,{style:[p.settingItem,p.settingItemSpaced],children:[$(h,{style:p.settingHeader,children:[f(g,{style:p.settingLabel,children:"Highlight Dev Tools"}),f(at,{testID:bt("excludeDevTools"),value:!n.excludeDevTools,onValueChange:T=>r({excludeDevTools:!T}),trackColor:{false:S.color.surfaceElevated,true:S.color.accent+"80"},thumbColor:n.excludeDevTools?S.color.knob:S.color.accent})]}),$(g,{style:p.settingDescription,children:["Show re-render highlights on Buoy dev tools (floating menu, modals, etc.). Useful for optimizing the dev tools themselves.",!n.excludeDevTools&&$(g,{style:p.settingWarning,children:[`
|
|
38
|
+
`,"The highlight overlay is always excluded to prevent infinite loops."]})]})]})]})]})})})})}var p=fe.create({container:{flex:1,backgroundColor:"transparent"},scrollView:{flex:1},scrollContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:32},section:{backgroundColor:S.color.surface,borderRadius:8,borderWidth:1,borderColor:S.color.border,marginBottom:12,overflow:"hidden"},sectionDescription:{fontSize:11,color:S.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:S.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:S.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:S.color.surfaceElevated,gap:6},typeOptionText:{fontSize:11,fontWeight:"600"},typePickerCancel:{padding:8},patternInputContainer:{flexDirection:"row",alignItems:"center",backgroundColor:S.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:S.color.border,paddingLeft:4,paddingRight:8,paddingVertical:4,gap:4},patternInput:{flex:1,fontSize:12,color:S.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:S.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:6,paddingHorizontal:10,gap:6},detectedItemText:{fontSize:11,color:S.color.text,fontFamily:mt},emptyText:{fontSize:11,color:S.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:16,paddingHorizontal:16},howItWorks:{paddingHorizontal:16,paddingVertical:12},howItWorksText:{fontSize:11,color:S.color.textTertiary,lineHeight:18,fontFamily:mt},howItWorksBold:{fontWeight:"700",color:S.color.textSecondary},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:32},actionPopup:{backgroundColor:S.color.surface,borderRadius:12,borderWidth:1,borderColor:S.color.border,width:"100%",maxWidth:300,overflow:"hidden"},actionPopupHeader:{padding:16,borderBottomWidth:1,borderBottomColor:S.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:S.color.accentSoft},actionPopupExclude:{backgroundColor:S.color.accentSoft},actionPopupButtonText:{fontSize:13,fontWeight:"600"},actionPopupCancel:{padding:12,borderTopWidth:1,borderTopColor:S.color.separator,alignItems:"center"},actionPopupCancelText:{fontSize:13,color:S.color.textTertiary,fontWeight:"500"},settingsSection:{paddingHorizontal:16,paddingTop:8,paddingBottom:16},settingItem:{gap:8},settingItemSpaced:{marginTop:16,paddingTop:16,borderTopWidth:1,borderTopColor:S.color.separator},settingHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},settingLabel:{fontSize:13,fontWeight:"600",color:S.color.text},settingValue:{backgroundColor:S.color.fillSecondary,paddingHorizontal:10,paddingVertical:4,borderRadius:6},settingValueText:{fontSize:12,fontWeight:"700",color:S.color.textTertiary,fontFamily:mt},settingDescription:{fontSize:11,color:S.color.textSecondary,lineHeight:16},settingDescriptionMuted:{fontSize:10,color:S.color.textTertiary,lineHeight:14,marginTop:4,fontStyle:"italic"},settingLabelDisabled:{color:S.color.textTertiary},settingWarning:{color:S.color.warning,fontWeight:"500"},batchSizePresets:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:4},batchSizePreset:{paddingVertical:8,paddingHorizontal:14,borderRadius:6,backgroundColor:S.color.surfaceElevated,borderWidth:1,borderColor:S.color.border},batchSizePresetActive:{backgroundColor:S.color.fillSecondary,borderColor:S.color.fillTertiary},batchSizePresetText:{fontSize:12,fontWeight:"500",color:S.color.textSecondary,fontFamily:mt},batchSizePresetTextActive:{color:S.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:S.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},renderCountInput:{backgroundColor:S.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:S.color.border,paddingVertical:10,paddingHorizontal:12,fontSize:14,fontWeight:"600",color:S.color.text,fontFamily:mt,textAlign:"center"},renderCountSeparator:{fontSize:12,color:S.color.textTertiary,marginTop:18},clearRangeButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,backgroundColor:S.color.warningSoft,borderWidth:1,borderColor:S.color.warning+"40",gap:6,alignSelf:"center"},clearRangeButtonText:{fontSize:11,fontWeight:"600",color:S.color.warning}});U();import{useState as Ju,useEffect as ia,useRef as Yu,useCallback as Rr,memo as Xu,useMemo as aa}from"react";Pe();U();import Qu,{useMemo as la}from"react";import{ChevronRight as Zu,night as Xe,useRelativeTime as ed,monoFont as sa}from"@buoy-gg/shared-ui/web";import{jsx as Ie,jsxs as Ct}from"react/jsx-runtime";function td({render:e,onPress:t}){let n=la(()=>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]),r=la(()=>e.accessibilityLabel&&n.type!=="accessibilityLabel"?{type:"accessibilityLabel",value:e.accessibilityLabel}:null,[e.accessibilityLabel,n.type]),o=ed(e.lastRenderTime),i=Qi(n.value);return Ct(J,{testID:i,accessibilityRole:"button",accessibilityLabel:`${e.displayName}, ${n.type} ${n.value}, ${e.renderCount} renders`,style:ve.container,onPress:()=>t(e),activeOpacity:.7,children:[Ie(h,{style:[ve.colorIndicator,{backgroundColor:e.color}]}),Ct(h,{style:ve.content,children:[Ct(h,{style:ve.topRow,children:[Ct(h,{style:ve.viewTypeContainer,children:[Ie(g,{testID:`${i}-name`,style:ve.viewType,numberOfLines:1,children:e.displayName}),r?Ie(Wt,{type:r.type,value:r.value,compact:true,shortLabel:true}):e.displayName!==e.viewType?Ie(g,{testID:`${i}-type`,style:ve.nativeType,numberOfLines:1,children:e.viewType}):null]}),Ie(h,{style:[ve.renderCountBadge,{backgroundColor:e.color+"30"}],children:Ct(g,{testID:`${i}-count`,style:[ve.renderCount,{color:e.color}],children:[e.renderCount,"x"]})})]}),e.lastRenderCause&&Ie(h,{style:ve.causeRow,children:Ie(Vi,{testID:`${i}-cause`,cause:e.lastRenderCause,compact:true,showKeys:true,showTwoLevel:true})}),Ct(h,{style:ve.bottomRow,children:[Ie(h,{style:ve.identifierContainer,children:Ie(Wt,{testID:`${i}-identifier`,type:n.type,value:n.value,compact:true,shortLabel:true})}),Ie(g,{testID:`${i}-time`,style:ve.timing,children:o})]})]}),Ie(Zu,{size:16,color:Xe.color.textTertiary})]})}var ca=Qu.memo(td,(e,t)=>{let n=e.render,r=t.render;return n.id===r.id&&n.renderCount===r.renderCount&&n.color===r.color&&n.lastRenderTime===r.lastRenderTime&&n.lastRenderCause?.type===r.lastRenderCause?.type&&n.lastRenderCause?.componentCause===r.lastRenderCause?.componentCause&&e.onPress===t.onPress}),ve=fe.create({container:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,marginHorizontal:12,marginBottom:6,backgroundColor:Xe.color.surface,borderRadius:8,borderWidth:1,borderColor:Xe.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:Xe.color.text},nativeType:{fontSize:10,color:Xe.color.textTertiary,fontFamily:sa,marginTop:1},accessibilityLabel:{fontSize:10,color:Xe.color.accent,fontStyle:"italic",marginTop:1},renderCountBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:10},renderCount:{fontSize:11,fontWeight:"700",fontFamily:sa},bottomRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},identifierContainer:{flex:1,flexShrink:1,overflow:"hidden"},timing:{fontSize:10,color:Xe.color.textTertiary,fontWeight:"500",flexShrink:0}});import{Lock as nd,night as Dr,useLimit as rd,ToolEmptyState as od,resolveListEmptyState as id}from"@buoy-gg/shared-ui/web";import{jsx as Ut,jsxs as ua}from"react/jsx-runtime";function ad({searchText:e,filters:t,onSelectRender:n,onStatsChange:r,onRendersChange:o,isTracking:i,isPro:l=false}){let[a,c]=Ju(()=>N.getFilteredRenders(e)),s=Yu(null);ia(()=>N.subscribe(()=>{let u=N.getFilteredRenders(e);c(u),r(N.getStats()),o?.(u)}),[e,r,o]),ia(()=>{let u=N.getFilteredRenders(e);c(u),o?.(u)},[e,t,o]);let d=rd("highlightUpdates.components"),b=l?1/0:d,C=aa(()=>a.slice(0,b),[a,b]),y=aa(()=>Math.max(0,a.length-b),[a.length,b]),v=Rr(u=>u.id,[]),m=Rr(({item:u,index:x})=>Ut(ca,{render:u,onPress:()=>n(u,x,C)}),[n,C]),w=Rr(()=>y<=0?null:ua(h,{testID:"buoy-highlight-locked",style:vn.lockedBanner,children:[Ut(nd,{size:14,color:Dr.color.warning}),ua(g,{testID:"buoy-highlight-locked-text",style:vn.lockedBannerText,children:[y," more ",y===1?"component":"components"," locked"]}),Ut(g,{style:vn.lockedBannerSubtext,children:"Upgrade to Pro"})]}),[y]);if(a.length===0){let u=e.trim(),x=N.getStats().totalComponents,R=u?N.getFilteredRenders("").length:0,H=id({subject:"components",verb:"tracked",search:e,total:u?R:x,capturing:i,blocked:u&&R===0&&x>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 Ut(od,{...H,testID:"buoy-highlight-empty"})}return Ut(Po,{testID:"buoy-highlight-list",ref:s,data:C,renderItem:m,keyExtractor:v,contentContainerStyle:vn.listContent,showsVerticalScrollIndicator:true,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,ListFooterComponent:w})}var ld=Xu(ad),vn=fe.create({listContent:{paddingTop:8},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:16,marginTop:8,gap:8},lockedBannerText:{color:Dr.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:Dr.color.textTertiary,fontSize:12}});U();import{memo as Tt}from"react";import{Trash2 as sd,Search as cd,Filter as ud,Pause as dd,Copy as hd,ModalHeader as ue,TabSelector as da,night as de,PowerToggleButton as gd}from"@buoy-gg/shared-ui/web";U();import{useState as pd,useEffect as md,memo as fd}from"react";Pe();import{Activity as yd,night as Cn,monoFont as bd}from"@buoy-gg/shared-ui/web";import{jsx as ha,jsxs as vd}from"react/jsx-runtime";function Cd(){let[e,t]=pd({totalComponents:0,totalRenders:0});return md(()=>N.subscribe(()=>{t(N.getStats())}),[]),vd(h,{nativeID:"__rn_buoy__stats-row",testID:"buoy-highlight-stats",accessibilityLabel:`${e.totalComponents} components tracked`,style:ga.headerChip,children:[ha(yd,{size:12,color:Cn.color.accent}),ha(g,{testID:"buoy-highlight-stats-value",style:[ga.headerChipValue,{color:Cn.color.accent}],children:e.totalComponents})]})}var Td=fd(Cd),ga=fe.create({headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:Cn.color.buttonSurface,paddingHorizontal:8,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:Cn.color.border},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:bd}});import{jsx as Y,jsxs as Gt}from"react/jsx-runtime";var Sd=Tt(function({isActive:e,searchText:t,onSearchChange:n,onSearchClose:r}){return e?Y(ue.Search,{value:t,onChangeText:n,onCancel:()=>{n(""),r()},onDismiss:r,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}),wd=Sd,xd=Tt(function({onSearchToggle:e,onFilterToggle:t,onToggleTracking:n,onToggleFreeze:r,onClear:o,onOpenCopySettings:i,isTracking:l,isFrozen:a,activeFilterCount:c,hasRenders:s}){return Gt(ue.Actions,{children:[Y(J,{testID:"buoy-highlight-search",accessibilityRole:"button",accessibilityLabel:"Search renders",onPress:e,style:ke.headerActionButton,children:Y(cd,{size:14,color:de.color.textSecondary})}),Y(J,{testID:"buoy-highlight-filters",accessibilityRole:"button",accessibilityLabel:c>0?`Filters, ${c} active`:"Filters",onPress:t,style:[ke.headerActionButton,c>0&&ke.activeFilterButton],children:Y(ud,{size:14,color:c>0?de.color.accent:de.color.textTertiary})}),Y(J,{testID:"buoy-highlight-copy",accessibilityRole:"button",onPress:i,style:[ke.headerActionButton,!s&&ke.headerActionButtonDisabled],disabled:!s,accessibilityLabel:"Open copy settings",children:Y(hd,{size:14,color:s?de.color.textSecondary:de.color.textTertiary})}),Y(J,{testID:"buoy-highlight-freeze",accessibilityRole:"button",accessibilityLabel:a?"Unfreeze frame":"Freeze frame",onPress:r,style:[ke.headerActionButton,a&&ke.freezeButton,!l&&ke.headerActionButtonDisabled],disabled:!l,children:Y(dd,{size:14,color:l?a?de.color.accent:de.color.textTertiary:de.color.textTertiary})}),Y(gd,{testID:"buoy-highlight-power",isEnabled:l,onToggle:n,accessibilityLabel:"Toggle render tracking"}),Y(J,{testID:"buoy-highlight-clear",accessibilityRole:"button",accessibilityLabel:"Clear tracked renders",onPress:o,style:[ke.headerActionButton,!s&&ke.headerActionButtonDisabled],disabled:!s,children:Y(sd,{size:14,color:s?de.color.textTertiary:de.color.textTertiary})})]})}),Id=xd,Rd=Tt(function({onBack:e,isSearchActive:t,searchText:n,onSearchChange:r,onSearchToggle:o,onSearchClose:i,onFilterToggle:l,onToggleTracking:a,onToggleFreeze:c,onClear:s,onOpenCopySettings:d,isTracking:b,isFrozen:C,activeFilterCount:y,hasRenders:v,searchInputRef:m}){return Gt(ue,{children:[e&&Y(ue.Navigation,{onBack:e}),Y(ue.Content,{title:"",children:t?Y(wd,{isActive:t,searchText:n,onSearchChange:r,onSearchClose:i,searchInputRef:m}):Y(Td,{})}),Y(Id,{onSearchToggle:o,onFilterToggle:l,onToggleTracking:a,onToggleFreeze:c,onClear:s,onOpenCopySettings:d,isTracking:b,isFrozen:C,activeFilterCount:y,hasRenders:v})]})}),Dd=Tt(function({onBack:e,activeTab:t,onTabChange:n,activeFilterCount:r=0}){let o=[{key:"filters",label:`Filters${r>0?` (${r})`:""}`},{key:"settings",label:"Settings"}];return Gt(ue,{children:[Y(ue.Navigation,{onBack:e}),Y(ue.Content,{title:"",noMargin:true,children:Y(da,{tabs:o,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-filter-tab"})}),Y(ue.Actions,{})]})}),kd=Tt(function({onBack:e,activeTab:t,onTabChange:n,hasHistory:r=true}){let o=[{key:"details",label:"Details"},{key:"history",label:"History",disabled:!r}];return Gt(ue,{children:[Y(ue.Navigation,{onBack:e}),Y(ue.Content,{title:"",noMargin:true,children:Y(da,{tabs:o,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-detail-tab"})}),Y(ue.Actions,{})]})}),Pd=Tt(function({onBack:e}){return Gt(ue,{children:[Y(ue.Navigation,{onBack:e}),Y(ue.Content,{title:"Copy Settings",testID:"buoy-highlight-copy-title"})]})}),ke=fe.create({headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:de.color.buttonSurface,borderWidth:1,borderColor:de.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},activeFilterButton:{backgroundColor:de.color.accentSoft,borderColor:de.color.accentBorderStrong},freezeButton:{backgroundColor:de.color.accentSoft,borderColor:de.color.accentBorderStrong}});U();import{useState as kr,useCallback as Tn,useMemo as Kt}from"react";Pe();import{Clock as Ld,GitBranch as zd,Database as pa,Lock as Nd,formatRelativeTime as ma,SectionHeader as St,EventStepperFooter as fa,buoyColors as ya,night as B,useLimit as ba,ToolEmptyState as Vd,monoFont as Fe}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as va}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Bd,jsx as A,jsxs as K}from"react/jsx-runtime";function Pr(e){let t=new Date(e),n=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0"),i=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${r}:${o}.${i}`}function Ca({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:r,isPro:o=false}){let[i,l]=kr(0),a=n??i,c=r??l,[s,d]=kr("current"),b=Kt(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((k,D)=>k.timestamp-D.timestamp),[e.renderHistory]),C=ba("highlightUpdates.historyEvents"),y=o?1/0:C,v=Kt(()=>b.slice(-y),[b,y]),m=Kt(()=>Math.max(0,b.length-y),[b.length,y]),w=v.length,u=v[a],x=a>0?v[a-1]:null,R=Tn(()=>{a>0&&c(a-1)},[a,c]),H=Tn(()=>{a<w-1&&c(a+1)},[a,w,c]);if(w===0){let k=N.getSettings().enableRenderHistory;return A(Vd,{testID:"buoy-highlight-history-empty",otto:k?"stare":"paused",title:"No Render History",message:k?"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 K(Bd,{children:[K(h,{style:[I.container,{paddingBottom:!t&&w>1?80:0}],children:[m>0&&K(h,{testID:"buoy-highlight-history-locked",style:I.lockedBanner,children:[A(Nd,{size:14,color:B.color.warning}),K(g,{testID:"buoy-highlight-history-locked-text",style:I.lockedBannerText,children:[m," older ",m===1?"render":"renders"," locked"]}),A(g,{style:I.lockedBannerSubtext,children:"Upgrade to Pro"})]}),K(h,{style:I.viewToggleContainer,children:[K(J,{testID:"buoy-highlight-history-mode-current",accessibilityRole:"button",accessibilityLabel:"Current state",style:[I.viewToggleCard,s==="current"&&I.viewToggleCardActive],onPress:()=>d("current"),activeOpacity:.8,children:[K(h,{style:I.viewToggleContent,children:[A(pa,{size:16,color:s==="current"?B.color.accent:B.color.textSecondary}),A(g,{style:[I.viewToggleLabel,s==="current"&&I.viewToggleLabelActive],children:"CURRENT STATE"})]}),K(g,{style:[I.viewToggleDescription,s==="current"&&{color:B.color.text}],children:["View render #",u?.renderNumber??0," details"]})]}),K(h,{testID:"buoy-highlight-history-mode-diff",accessibilityLabel:"Diff view, coming soon",style:[I.viewToggleCard,I.viewToggleCardDisabled],children:[K(h,{style:I.viewToggleContent,children:[A(zd,{size:16,color:B.color.textTertiary}),A(g,{style:[I.viewToggleLabel,I.viewToggleLabelDisabled],children:"DIFF VIEW"}),A(h,{style:I.todoBadge,children:A(g,{style:I.todoBadgeText,children:"TODO"})})]}),A(g,{style:[I.viewToggleDescription,{color:B.color.textTertiary}],children:"Compare renders side by side (coming soon)"})]})]}),A(Ve,{testID:"buoy-highlight-history-scroll",style:I.contentScroll,contentContainerStyle:I.contentContainer,showsVerticalScrollIndicator:false,children:s==="current"?A(Ad,{event:u,render:e}):A(Hd,{previousEvent:x,currentEvent:u,render:e})})]}),!t&&A(fa,{currentIndex:a,totalItems:w,onPrevious:R,onNext:H,itemLabel:"Render",subtitle:ma(new Date(u?.timestamp??Date.now()))})]})}function Ad({event:e,render:t}){if(!e)return A(h,{testID:"buoy-highlight-history-no-event",style:I.noEventContainer,children:A(g,{style:I.noEventText,children:"No event selected"})});let n=Ee[e.cause.type];return K(h,{style:I.currentStateContainer,children:[K(h,{style:I.eventHeader,children:[K(h,{style:I.eventHeaderLeft,children:[K(g,{testID:"buoy-highlight-history-event-title",style:I.eventTitle,children:["Render #",e.renderNumber]}),A(g,{testID:"buoy-highlight-history-event-time",style:I.eventTime,children:Pr(e.timestamp)})]}),K(h,{style:[I.eventBadge,{backgroundColor:t.color+"30"}],children:[A(h,{style:[I.eventBadgeDot,{backgroundColor:t.color}]}),A(g,{testID:"buoy-highlight-history-event-cause",style:[I.eventBadgeText,{color:t.color}],children:e.cause.type.toUpperCase()})]})]}),K(h,{style:I.section,children:[K(St,{children:[A(St.Icon,{icon:Ld,color:n.color,size:12}),A(St.Title,{children:"WHY DID THIS RENDER?"})]}),A(h,{style:I.sectionContent,children:A(Bi,{cause:e.cause,nativeType:t.viewType})})]}),e.capturedProps&&Object.keys(e.capturedProps).length>0&&K(h,{style:I.section,children:[K(St,{children:[A(St.Icon,{icon:pa,color:B.color.accent,size:12}),A(St.Title,{children:"CAPTURED PROPS"})]}),A(h,{style:I.sectionContent,children:A(Ve,{horizontal:true,showsHorizontalScrollIndicator:false,style:I.propsScrollView,children:A(g,{testID:"buoy-highlight-history-props",style:I.propsJson,children:JSON.stringify(e.capturedProps,null,2)})})})]})]})}function Hd({previousEvent:e,currentEvent:t,render:n}){let[r,o]=kr("props");if(!e||!t)return A(h,{style:I.noEventContainer,children:A(g,{style:I.noEventText,children:"Select an event with a previous event to compare"})});let i=Ee[e.cause.type],l=Ee[t.cause.type],a=e.capturedProps&&t.capturedProps,c=e.capturedState&&t.capturedState;return K(h,{style:I.diffContainer,children:[K(h,{style:I.compareBar,children:[K(h,{style:I.compareSide,children:[K(h,{style:I.compareLabelRow,children:[A(g,{style:[I.compareLabel,{color:ya.warning}],children:"PREV"}),A(h,{style:[I.compareActionBadge,{backgroundColor:`${i.color}20`}],children:A(g,{style:[I.compareActionText,{color:i.color}],children:e.cause.type.toUpperCase()})})]}),K(h,{style:I.compareMeta,children:[K(g,{style:I.compareIndex,children:["#",e.renderNumber]}),A(g,{style:I.compareTime,children:Pr(e.timestamp)})]})]}),A(h,{style:I.compareDivider,children:A(g,{style:I.compareArrow,children:"\u2192"})}),K(h,{style:I.compareSide,children:[K(h,{style:I.compareLabelRow,children:[A(g,{style:[I.compareLabel,{color:ya.success}],children:"CUR"}),A(h,{style:[I.compareActionBadge,{backgroundColor:`${l.color}20`}],children:A(g,{style:[I.compareActionText,{color:l.color}],children:t.cause.type.toUpperCase()})})]}),K(h,{style:I.compareMeta,children:[K(g,{style:I.compareIndex,children:["#",t.renderNumber]}),A(g,{style:I.compareTime,children:Pr(t.timestamp)})]})]})]}),K(h,{style:I.diffModeTabs,children:[A(J,{style:[I.diffModeTab,r==="cause"&&I.diffModeTabActive],onPress:()=>o("cause"),activeOpacity:.7,children:A(g,{style:[I.diffModeTabText,r==="cause"&&I.diffModeTabTextActive],children:"CAUSE"})}),A(J,{style:[I.diffModeTab,r==="props"&&I.diffModeTabActive,!a&&I.diffModeTabDisabled],onPress:()=>a&&o("props"),activeOpacity:a?.7:1,children:A(g,{style:[I.diffModeTabText,r==="props"&&I.diffModeTabTextActive,!a&&I.diffModeTabTextDisabled],children:"PROPS"})}),A(J,{style:[I.diffModeTab,r==="state"&&I.diffModeTabActive,!c&&I.diffModeTabDisabled],onPress:()=>c&&o("state"),activeOpacity:c?.7:1,children:A(g,{style:[I.diffModeTabText,r==="state"&&I.diffModeTabTextActive,!c&&I.diffModeTabTextDisabled],children:"STATE"})})]}),r==="cause"&&A(h,{style:I.diffSummary,children:A(Bi,{cause:t.cause,nativeType:n.viewType})}),r==="props"&&A(h,{style:I.treeDiffContainer,children:a?A(va,{oldValue:e.capturedProps,newValue:t.capturedProps,theme:"dark",showUnchanged:true}):K(h,{style:I.noDiffData,children:[A(g,{style:I.noDiffDataTitle,children:"Props Not Captured"}),A(g,{style:I.noDiffDataText,children:'Enable "Capture Props on Render" in settings to see props diff.'})]})}),r==="state"&&A(h,{style:I.treeDiffContainer,children:c?A(va,{oldValue:e.capturedState,newValue:t.capturedState,theme:"dark",showUnchanged:true}):K(h,{style:I.noDiffData,children:[A(g,{style:I.noDiffDataTitle,children:"State Not Captured"}),A(g,{style:I.noDiffDataText,children:'Enable "Capture State on Render" in settings to see state diff.'})]})})]})}function Ta({render:e,selectedEventIndex:t=0,onEventIndexChange:n=()=>{},isPro:r=false}){let o=Kt(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((C,y)=>C.timestamp-y.timestamp),[e.renderHistory]),i=ba("highlightUpdates.historyEvents"),l=r?1/0:i,a=Kt(()=>o.slice(-l),[o,l]),c=a.length,s=a[t],d=Tn(()=>{n(Math.max(0,t-1))},[t,n]),b=Tn(()=>{n(Math.min(c-1,t+1))},[t,c,n]);return c<=1?null:A(fa,{currentIndex:t,totalItems:c,onPrevious:d,onNext:b,itemLabel:"Render",subtitle:s?ma(new Date(s.timestamp)):void 0})}var I=fe.create({container:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:32,gap:12},emptyTitle:{fontSize:16,fontWeight:"600",color:B.color.text},emptyText:{fontSize:13,color:B.color.textSecondary,textAlign:"center",lineHeight:18},viewToggleContainer:{flexDirection:"row",padding:12,gap:8},viewToggleCard:{flex:1,backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:10,gap:4},viewToggleCardActive:{borderColor:B.color.accentBorderStrong,backgroundColor:B.color.accentSoft},viewToggleCardDisabled:{opacity:.5},todoBadge:{backgroundColor:B.color.fillSecondary,paddingHorizontal:6,paddingVertical:2,borderRadius:4,marginLeft:4},todoBadgeText:{fontSize:9,fontWeight:"700",color:B.color.textTertiary,letterSpacing:.3},viewToggleContent:{flexDirection:"row",alignItems:"center",gap:6},viewToggleLabel:{fontSize:10,fontWeight:"700",color:B.color.textSecondary,letterSpacing:.5},viewToggleLabelActive:{color:B.color.accent},viewToggleLabelDisabled:{color:B.color.textTertiary},viewToggleDescription:{fontSize:11,color:B.color.textTertiary,marginTop:2},contentScroll:{flex:1},contentContainer:{padding:12,paddingTop:0},noEventContainer:{padding:24,alignItems:"center"},noEventText:{fontSize:13,color:B.color.textTertiary},currentStateContainer:{gap:12},eventHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12},eventHeaderLeft:{gap:2},eventTitle:{fontSize:15,fontWeight:"700",color:B.color.text},eventTime:{fontSize:11,color:B.color.textTertiary,fontFamily:Fe},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:Fe},section:{backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,overflow:"hidden"},sectionContent:{padding:12,paddingTop:8},causeContainer:{marginBottom:12},changedList:{marginBottom:12,paddingLeft:4},changedListTitle:{fontSize:11,fontWeight:"600",color:B.color.textSecondary,marginBottom:6},changedItem:{fontSize:12,color:B.color.text,fontFamily:Fe,marginBottom:3,paddingLeft:8},propsScrollView:{maxHeight:150},propsJson:{fontSize:11,fontFamily:Fe,color:B.color.text,backgroundColor:B.color.bg,padding:10,borderRadius:6},diffContainer:{gap:12},compareBar:{flexDirection:"row",backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.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:B.color.text},compareTime:{fontSize:10,color:B.color.textTertiary,fontFamily:Fe},compareDivider:{width:30,alignItems:"center",justifyContent:"center"},compareArrow:{fontSize:16,color:B.color.textTertiary},diffSummary:{backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12},diffSummaryTitle:{fontSize:11,fontWeight:"600",color:B.color.textSecondary,marginBottom:8},diffChanges:{gap:4},diffChangeItem:{flexDirection:"row",alignItems:"center",gap:6},diffChangeIcon:{fontSize:12,fontWeight:"700",color:B.color.warning,fontFamily:Fe},diffChangeKey:{fontSize:12,color:B.color.text,fontFamily:Fe},diffNoChanges:{fontSize:12,color:B.color.textTertiary,fontStyle:"italic"},diffPlaceholder:{fontSize:12,color:B.color.textTertiary,fontStyle:"italic",textAlign:"center",padding:16},diffModeTabs:{flexDirection:"row",backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:4,gap:4},diffModeTab:{flex:1,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center"},diffModeTabActive:{backgroundColor:B.color.accentSoft},diffModeTabDisabled:{opacity:.4},diffModeTabText:{fontSize:10,fontWeight:"600",color:B.color.textSecondary,letterSpacing:.5},diffModeTabTextActive:{color:B.color.accent},diffModeTabTextDisabled:{color:B.color.textTertiary},causeDiffContainer:{gap:8,marginBottom:12},causeDiffRow:{flexDirection:"row",alignItems:"center",gap:8},causeDiffLabel:{fontSize:11,fontWeight:"600",color:B.color.textSecondary,minWidth:80},causeDiffValue:{fontSize:12,color:B.color.text,fontFamily:Fe,fontWeight:"500"},diffChangesTitle:{fontSize:11,fontWeight:"600",color:B.color.textSecondary,marginBottom:6},treeDiffContainer:{backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,overflow:"hidden",minHeight:150},noDiffData:{padding:24,alignItems:"center",gap:8},noDiffDataTitle:{fontSize:13,fontWeight:"600",color:B.color.text},noDiffDataText:{fontSize:12,color:B.color.textTertiary,textAlign:"center",lineHeight:18},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,marginHorizontal:12,marginTop:8,backgroundColor:B.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:B.color.warning+"30",gap:8},lockedBannerText:{color:B.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:B.color.textTertiary,fontSize:12}});U();import{useCallback as wt,useEffect as Md,useMemo as Sn,useState as Sa}from"react";import{DynamicFilterView as $d,macOSColors as Lr,night as zr,FileText as wa,FileCode as xa,Zap as Ia,Settings as Ed,Eye as Fd,Layers as Od,ToolbarCopyButton as _d,ExportPreview as Wd,monoFont as jd}from"@buoy-gg/shared-ui/web";U();var Nr={format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},Ra={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 Ud(e){for(let[t,n]of Object.entries(Ra))if(Object.keys(n).every(r=>{let o=e[r],i=n[r];return Array.isArray(o)&&Array.isArray(i)?o.length===i.length&&o.every((l,a)=>l===i[a]):o===i}))return t;return null}var we={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"}};U();import{definePersistedSetting as Gd,devToolsStorageKeys as Kd}from"@buoy-gg/shared-ui/web";var Da=Gd(Kd.highlightUpdates.copySettings(),Nr,{sanitize:(e,t)=>({...e,filterCauses:t?.filterCauses??Nr.filterCauses})});async function qd(e){await Da.save(e)}async function Jd(){return Da.loadOrNull()}import{Fragment as Yd,jsx as xt,jsxs as Xd}from"react/jsx-runtime";var Qd=50*1024,Zd=200*1024,eh=[{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 th(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function nh(){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"]}}]}function rh({renders:e}){let[t,n]=Sa(Nr),[r,o]=Sa(false);Md(()=>{let u=true;return Jd().then(x=>{u&&x&&n(x)}),()=>{u=false}},[]);let i=wt(u=>{n(u),qd(u)},[]),l=e.length>0,a=l?e:nh(),c=Sn(()=>Ud(t),[t]),s=Sn(()=>Nu(a,t),[a,t]),d=Sn(()=>s>=Zd?"danger":s>=Qd?"warning":"none",[s]),b=wt(()=>vr(a,t),[a,t]),C=wt(u=>{let x=Ra[u];x&&i({...x,filterCauses:[...x.filterCauses]})},[i]),y=wt((u,x)=>{let[R,H]=u.split("::");if(R==="preset"){C(H);return}if(R==="format"){i({...t,format:x});return}if(R==="sort"){i({...t,sortBy:x});return}if(R==="topN"){i({...t,topN:x});return}if(R==="minRenders"){i({...t,minRenders:x});return}if(R==="cause"){let k=x,D=t.filterCauses.includes(k);i({...t,filterCauses:D?t.filterCauses.filter(W=>W!==k):[...t.filterCauses,k]});return}if(R==="signal"){let k=H;i({...t,[k]:!t[k]});return}},[t,i,C]),v=wt(()=>{let{totalComponents:u,totalRenders:x}=Wi(a);return xt(Wd,{expanded:r,onExpandedChange:o,summary:`${u} component${u!==1?"s":""} \xB7 ${x} renders \xB7 ~${th(s)}${l?"":" (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 R=b();return xt(Ve,{testID:"buoy-highlight-copy-preview-scroll",style:Vr.previewScroll,nestedScrollEnabled:true,children:xt(g,{testID:"buoy-highlight-copy-preview-text",style:Vr.previewText,selectable:true,children:R})})}})},[r,a,s,d,l,b]),m=wt(()=>{let{totalComponents:u}=Wi(a),x=l?`${u} components`:"Mock data (no renders captured)";return Xd(Yd,{children:[xt(g,{testID:"buoy-highlight-copy-status",style:Vr.statusLabel,children:x}),xt(_d,{value:b})]})},[l,a,b]),w=Sn(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:we.llm.label,icon:Ia,color:we.llm.color,value:"llm",isActive:c==="llm",description:we.llm.description},{id:"preset::table",label:we.table.label,icon:wa,color:we.table.color,value:"table",isActive:c==="table",description:we.table.description},{id:"preset::json",label:we.json.label,icon:xa,color:we.json.color,value:"json",isActive:c==="json",description:we.json.description},{id:"preset::full",label:we.full.label,icon:Od,color:we.full.color,value:"full",isActive:c==="full",description:we.full.description},{id:"preset::custom",label:"Custom",icon:Ed,color:zr.color.textSecondary,value:"custom",isActive:c===null,description:"User-configured"}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::summary",label:"Summary",icon:Ia,color:Lr.semantic.success,value:"summary",isActive:t.format==="summary",description:"Compact, LLM-ready"},{id:"format::markdown-table",label:"Table",icon:wa,color:Lr.semantic.info,value:"markdown-table",isActive:t.format==="markdown-table",description:"Markdown table"},{id:"format::json",label:"JSON",icon:xa,color:Lr.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:eh.map(u=>({id:`cause::${u.value}`,label:u.label,value:u.value,isActive:t.filterCauses.includes(u.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:Fd,content:v,headerActions:m},onFilterChange:y}),[t,c,y,v,m]);return xt($d,{...w})}var Vr=fe.create({previewScroll:{maxHeight:360},previewText:{fontFamily:jd,fontSize:11,color:zr.color.text,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:zr.color.textTertiary,marginRight:8}});import{Fragment as oh,jsx as re,jsxs as Br}from"react/jsx-runtime";var ih=lu.memo(function(){return Br(h,{testID:"buoy-highlight-disabled-banner",style:qt.disabledBanner,children:[re(su,{size:14,color:Ft.color.warning}),re(g,{testID:"buoy-highlight-disabled-text",style:qt.disabledText,children:"Render tracking is disabled"})]})});function Ar({visible:e,onClose:t,onBack:n,onMinimize:r,enableSharedModalDimensions:o=false,initialNativeTag:i,onInitialNativeTagHandled:l,onRenderSelect:a,inline:c=false}){let s=du(),[d,b]=ce(false),[C,y]=ce(()=>M.getFrozen()),[v,m]=ce(()=>N.getStats().totalComponents>0),[w,u]=ce(null),[x,R]=ce(0),[H,k]=ce(false),[D,W]=ce(false),[Q,z]=ce([]),[_,T]=ce("filters"),[L,le]=ce("details"),[he,Ne]=ce(0),[xe,Vn]=ce(""),[rt,Qt]=ce(false),Gr=Ke(null),Dt=Ke([]),Kr=Ke(N.getFilters()),[Bn,qr]=ce(()=>{let O=N.getFilters();return O.includePatterns.length+O.excludePatterns.length}),[me,Jr]=ce(()=>N.getFilters()),[An,Yr]=ce(()=>N.getSettings()),Xr=Ke(false),Hn=Ke(false),Zt=Ke(false);Se(()=>{!e||Xr.current||(Xr.current=true)},[e]),Se(()=>{if(!e||Hn.current)return;(async()=>{try{let O=await fn.getItem(gt.highlightUpdates.filters());if(O){let j=JSON.parse(O),oe={includeTestID:new Set(j.includeTestID||[]),includeNativeID:new Set(j.includeNativeID||[]),includeViewType:new Set(j.includeViewType||[]),includeComponent:new Set(j.includeComponent||[]),excludeTestID:new Set(j.excludeTestID||[]),excludeNativeID:new Set(j.excludeNativeID||[]),excludeViewType:new Set(j.excludeViewType||[]),excludeComponent:new Set(j.excludeComponent||[]),includePatterns:j.includePatterns||[],excludePatterns:j.excludePatterns||[]};N.setFilters(oe);let De=N.getFilters();Kr.current=De,Jr(De),qr(De.includePatterns.length+De.excludePatterns.length)}Hn.current=true}catch{}})()},[e]),Se(()=>{if(!Hn.current)return;(async()=>{try{let O={includeTestID:Array.from(me.includeTestID),includeNativeID:Array.from(me.includeNativeID),includeViewType:Array.from(me.includeViewType),includeComponent:Array.from(me.includeComponent),excludeTestID:Array.from(me.excludeTestID),excludeNativeID:Array.from(me.excludeNativeID),excludeViewType:Array.from(me.excludeViewType),excludeComponent:Array.from(me.excludeComponent),includePatterns:me.includePatterns,excludePatterns:me.excludePatterns};await fn.setItem(gt.highlightUpdates.filters(),JSON.stringify(O))}catch{}})()},[me]),Se(()=>{if(!e||Zt.current)return;(async()=>{try{let O=await fn.getItem(gt.highlightUpdates.settings());if(O){let j=JSON.parse(O),{performanceLogging:oe,excludeDevTools:De,...We}=j;N.setSettings(We),Yr(N.getSettings())}Zt.current=true}catch{Zt.current=true}})()},[e]),Se(()=>{if(!Zt.current)return;(async()=>{try{let{performanceLogging:O,excludeDevTools:j,...oe}=An;await fn.setItem(gt.highlightUpdates.settings(),JSON.stringify(oe))}catch{}})()},[An]),Se(()=>{let O=N.subscribeToState(j=>{b(j.isTracking)});return()=>{O()}},[]),Se(()=>{let O=M.subscribeToFreeze(j=>{y(j)});return()=>{O()}},[]),Se(()=>{rt&&requestAnimationFrame(()=>{Gr.current?.focus()})},[rt]),Se(()=>{e||M.setSpotlight(null)},[e]),Se(()=>{if(e&&i!=null){let O=N.getRender(String(i));O&&(u(O),R(0),k(false),M.setSpotlight(O.nativeTag)),l?.()}},[e,i,l]);let Qr=te(()=>{M.isInitialized()||M.initialize(),M.toggle()},[]),Zr=te(()=>{M.toggleFreeze()},[]),eo=te(()=>{M.clearRenderCounts(),m(false)},[]),to=te(()=>{z(N.getFilteredRenders(xe)),W(true)},[xe]),no=te(()=>{W(false)},[]),ro=te(O=>{Vn(O)},[]),Ja=te((O,j,oe)=>{u(O),R(j),le("details"),Ne(0),Dt.current=oe,M.setSpotlight(O.nativeTag)},[]);Se(()=>{if(!w)return;let O=String(w.nativeTag);return N.subscribe(()=>{let j=N.getRender(O);j&&u({...j})})},[w?.nativeTag]);let oo=Ke(null);Se(()=>{!a||!w||oo.current!==w.nativeTag&&(oo.current=w.nativeTag,a(w))},[w,a]);let Ya=te(O=>{Dt.current=O},[]),io=te(()=>{u(null),R(0),M.setSpotlight(null)},[]),Xa=te(()=>{let O=Dt.current;if(x>0){let j=x-1,oe=O[j];oe&&(u(oe),R(j),M.setSpotlight(oe.nativeTag))}},[x]),Qa=te(()=>{let O=Dt.current;if(x<O.length-1){let j=x+1,oe=O[j];oe&&(u(oe),R(j),M.setSpotlight(oe.nativeTag))}},[x]),ao=te(()=>{k(false)},[]),lo=te(()=>{k(true)},[]),so=te(()=>{Qt(true)},[]),co=te(()=>{Qt(false)},[]),Mn=te(O=>{N.setFilters(O);let j=N.getFilters();Kr.current=j,Jr(j),qr(j.includePatterns.length+j.excludePatterns.length)},[]),Za=te((O,j)=>{let oe=N.getFilters(),De={};j==="include"?oe.includePatterns.some(We=>We.type===O.type&&We.value===O.value)||(De.includePatterns=[...oe.includePatterns,O]):oe.excludePatterns.some(We=>We.type===O.type&&We.value===O.value)||(De.excludePatterns=[...oe.excludePatterns,O]),Object.keys(De).length>0&&(Mn(De),u(null),R(0),M.setSpotlight(null))},[Mn]),el=te(O=>{N.setSettings(O),Yr(N.getSettings())},[]),tl=te(O=>{m(O.totalComponents>0)},[]),uo=te(()=>D?re(Pd,{onBack:no}):H?re(Dd,{onBack:ao,activeTab:_,onTabChange:T,activeFilterCount:Bn}):w?re(kd,{onBack:io,activeTab:L,onTabChange:le,hasHistory:(w.renderHistory?.length??0)>0}):re(Rd,{onBack:n,isSearchActive:rt,searchText:xe,onSearchChange:ro,onSearchToggle:so,onSearchClose:co,onFilterToggle:lo,onToggleTracking:Qr,onToggleFreeze:Zr,onClear:eo,onOpenCopySettings:to,isTracking:d,isFrozen:C,activeFilterCount:Bn,hasRenders:v,searchInputRef:Gr}),[D,H,w,n,rt,xe,d,C,Bn,v,_,L,ao,io,no,ro,so,co,lo,Qr,Zr,eo,to]),nl=o?gt.modal.root():gt.highlightUpdates.modal();if(!e)return null;let rl=Dt.current.length,ho=w?L==="details"?re($u,{currentIndex:x,totalItems:rl,onPrevious:Xa,onNext:Qa,itemLabel:"Component",subtitle:w.componentName||w.displayName||w.viewType}):re(Ta,{render:w,selectedEventIndex:he,onEventIndexChange:Ne,isPro:s}):null,go=re(h,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:qt.container,children:D?re(rh,{renders:Q}):w?L==="details"?re(ji,{render:w,disableInternalFooter:true,onAddFilter:Za,isPro:s}):re(Ca,{render:w,disableInternalFooter:true,selectedEventIndex:he,onEventIndexChange:Ne,isPro:s}):H?re(oa,{filters:me,onFilterChange:Mn,settings:An,onSettingsChange:el,availableProps:N.getAvailableProps(),activeTab:_}):Br(oh,{children:[!d&&re(ih,{}),re(ld,{searchText:xe,filters:me,onSelectRender:Ja,onStatsChange:tl,onRendersChange:Ya,isTracking:d,isPro:s})]})});return c?re(zi,{children:Br(h,{style:qt.inlineRoot,children:[re(h,{style:qt.inlineHeader,...uu,children:uo()}),go,ho]})}):re(zi,{children:re(cu,{visible:e,onClose:t,onMinimize:r,persistenceKey:nl,header:{showToggleButton:true,customContent:uo()},enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:ho,footerHeight:w&&(L==="details"||(w.renderHistory?.length??0)>1)?68:0,children:go})})}function ah(e={}){return re(Ar,{...e,inline:true,visible:true,onClose:()=>{}})}var qt=fe.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Ft.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:Ft.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:Ft.color.warning+"20"},disabledText:{color:Ft.color.warning,fontSize:11,flex:1}});import{jsx as Jt}from"react/jsx-runtime";function lh({size:e}){let[t,n]=Wn(()=>M.isEnabled());return jn(()=>M.subscribe(r=>{n(r)}),[]),Jt(wo,{size:e,color:t?"#10b981":"#6b7280"})}function ka(){return null}function Pa(e){let[t,n]=Wn(null);jn(()=>(e.visible&&M.setBadgePressCallback(o=>{n(o)}),()=>{e.visible||M.setBadgePressCallback(null)}),[e.visible]);let r=yl(()=>{n(null)},[]);return Jt(Ar,{...e,initialNativeTag:t,onInitialNativeTagHandled:r})}var sh={id:"highlight-updates",name:"TOGGLE HIGHLIGHT",description:"Toggle component render highlights",slot:"row",icon:lh,component:ka,props:{},launchMode:"toggle-only",onPress:()=>{M.isInitialized()||M.initialize(),M.toggle()}};function ch(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";e?.autoInitialize&&setTimeout(()=>{M.initialize()},1e3);let r=({size:o})=>{let[i,l]=Wn(()=>M.isEnabled());return jn(()=>M.subscribe(a=>{l(a)}),[]),Jt(wo,{size:o,color:i?t:n})};return{id:e?.id||"highlight-updates",name:e?.name||"TOGGLE HIGHLIGHT",description:e?.description||"Toggle component render highlights",slot:"row",icon:r,component:ka,props:{},launchMode:"toggle-only",onPress:()=>{M.isInitialized()||M.initialize(),M.toggle()}}}var uh={id:"highlight-updates-modal",name:"HIGHLIGHT",description:"View component render tracking modal",slot:"both",icon:({size:e})=>Jt(So,{size:e}),component:Pa,props:{enableSharedModalDimensions:false}};function dh(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";return e?.autoInitialize&&setTimeout(()=>{M.initialize()},1e3),{id:e?.id||"highlight-updates-modal",name:e?.name||"HIGHLIGHT",description:e?.description||"View component render tracking modal",slot:"both",icon:({size:r})=>Jt(So,{size:r,color:t}),component:Pa,props:{enableSharedModalDimensions:false}}}U();Pe();U();U();import{resolveDOMEventEmitter as hh}from"@buoy-gg/shared-ui/web/utils";var gh=14,ph=550,mh=4e3,fh=8e3,La=600,Hr=null,za=false,Mr=null,wn=[],Oe="idle",_e=[],$r=0,Re=null;function yh(){if(za)return Hr;za=true;let e=hh();return Hr=e.emitter,Mr=e.reason,Hr}function It(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Na(e){let t=e?.nativeEvent;return t?It(t.target)??It(t.tag):null}function Er(e){let t=e?.nativeEvent;if(!t)return null;let n={x:It(t.pageX),y:It(t.pageY)};if(n.x!==null&&n.y!==null)return{x:n.x,y:n.y};for(let r of["changedTouches","touches"]){let o=t[r];if(Array.isArray(o)&&o.length){let i=o[0],l=It(i?.pageX),a=It(i?.pageY);if(l!==null&&a!==null)return{x:l,y:a}}}return null}function Va(e){_e.push({...e,seq:++$r}),_e.length>La&&(_e=_e.slice(-La))}function bh(e){let t=Na(e);if(t===null)return;let n=Er(e),r=null;try{r=qo(t)}catch{}Re={tag:t,x:n?.x??0,y:n?.y??0,t:Date.now(),drift:0,target:r}}function vh(e){if(!Re)return;let t=Er(e);if(!t)return;let n=t.x-Re.x,r=t.y-Re.y;Re.drift=Math.max(Re.drift,Math.sqrt(n*n+r*r))}function Ch(e){let t=Re;if(Re=null,!t||!t.target)return;let n=Er(e);if(n){let o=n.x-t.x,i=n.y-t.y;t.drift=Math.max(t.drift,Math.sqrt(o*o+i*i))}if(t.drift>gh)return;let r=Date.now()-t.t;r>mh||t.target.control!=="text"&&(t.target.control==="toggle"||t.target.control==="slider"||Va({t:Date.now(),kind:r>=ph?"longPress":"press",target:t.target}))}function Th(){Re=null}function Fr(e){let t=Na(e);if(t===null)return;let n=e.nativeEvent,r,o;if(typeof n.text=="string")r="text",o=n.text;else if(typeof n.value=="boolean")r="toggle",o=n.value;else if(typeof n.value=="number")r="slider",o=n.value;else return;let i=_e[_e.length-1];if(i&&i.kind===r&&i.target.nativeTag===t&&Date.now()-i.t<fh){i.value=o,i.t=Date.now();return}let l=null;try{l=qo(t)}catch{}l&&Va({t:Date.now(),kind:r,target:l,value:o})}function Sh(){if(Oe==="capturing")return Yt();let e=yh();if(!e)return Oe="unavailable",Yt();try{wn=[e.addListener("topTouchStart",bh),e.addListener("topTouchMove",vh),e.addListener("topTouchEnd",Ch),e.addListener("topTouchCancel",Th),e.addListener("topChange",Fr),e.addListener("topValueChange",Fr),e.addListener("topSlidingComplete",Fr)],Re=null,Oe="capturing"}catch(t){wn=[],Oe="unavailable",Mr=t?.message??"addListener failed"}return Yt()}function wh(){wn.forEach(e=>{try{e.remove()}catch{}}),wn=[],Re=null,Oe==="capturing"&&(Oe="idle")}function xh(){_e=[],$r=0}function Yt(){return{status:Oe,reason:Oe==="unavailable"?Mr:null}}function Ih(e=0){return{...Yt(),records:_e.filter(t=>t.seq>e),seq:$r}}U();var Ba=0,Aa=1,Ha=11,Ma=14,$a=15,xn=1,Rh=1e4,Dh=300,kh=20,Ea=false,Xt=false,Or=false,In=false,Rn=0,Qe=0,Dn=0,Ze={},et=new Map;function Fa(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}function _r(e){let t=e.flags??e.effectTag;return typeof t=="number"?t:0}function Oa(e){return e===Ba||e===Aa||e===Ha||e===Ma||e===$a}function Wr(e){let t=e.type;try{switch(e.tag){case Ba:case Aa:return t?.displayName||t?.name||"Anonymous";case Ha:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case Ma:case $a:{let n=t?.type??e.elementType?.type;return t?.displayName||n?.displayName||n?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}function Ph(e){let t=e.actualDuration;if(typeof t!="number")return null;let n=t;for(let r=e.child;r!=null;r=r.sibling)typeof r.actualDuration=="number"&&(n-=r.actualDuration);return n>0?n:0}var Lh=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"]),_a=["Animated(","Pressability","Virtualized","CellRenderer"];function Wa(e){if(Lh.has(e))return true;for(let t=0;t<_a.length;t++)if(e.startsWith(_a[t]))return true;return false}var ja=40,Ua=5;function zh(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 r=Array.isArray(e);if(r!==Array.isArray(t))return false;if(r){if(e.length!==t.length)return false;for(let l=0;l<e.length;l++)if(!Object.is(e[l],t[l]))return false;return true}let o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return false;for(let l=0;l<o.length;l++){let a=o[l];if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return false}return true}function Nh(e,t){let n=e.alternate;if(!n)return{cause:"mount"};let r=e.memoizedProps,o=n.memoizedProps;if(r!==o&&r&&o){let i=false,l=false,a,c=Object.keys(r),s=c.length<ja?c.length:ja;for(let d=0;d<s;d++){let b=c[d],C=o[b],y=r[b];if(!Object.is(C,y)&&(i=true,t&&(a||(a=[]),a.length<Ua&&a.push(b)),!zh(C,y)&&(l=true,!t)))break}if(!l&&Object.keys(o).length!==c.length&&(i=true,l=true),i)return{cause:l?"props":"propsUnstable",changedKeys:a}}return Xs(n,e)?{cause:"hooks"}:{cause:"parent"}}function Vh(e){for(let t=e.return;t!=null;t=t.return){if(!Oa(t.tag)||(_r(t)&xn)===0)continue;let n=Wr(t);if(!Wa(n))return n}}function Bh(e,t){let n=Wr(e),r=Ph(e);r!==null&&(Or=true);let o=r??0;Qe+=1,Dn+=o;let{cause:i,changedKeys:l}=Nh(e,In);if(Ze[i]=(Ze[i]??0)+1,Wa(n))return;let a=et.get(n);if(!a){if(et.size>=Dh)return;a={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}},et.set(n,a)}if(a.renders+=1,a.totalSelfMs+=o,o>a.maxSelfMs&&(a.maxSelfMs=o),a.causes[i]=(a.causes[i]??0)+1,In){if(l){a.changedProps||(a.changedProps=new Set);for(let c=0;c<l.length&&!(a.changedProps.size>=Ua);c++)a.changedProps.add(l[c])}t&&!a.parentName&&(a.parentName=t)}}function Ah(e){let t=e?.current;if(!t)return;let n=Qe,r=0,o=t;for(;o!=null&&(r+=1,!(r>Rh));){let i=false,l=Oa(o.tag);if(o.memoizedProps?.__buoyDevToolsRoot)i=true;else if(l){let a=Wr(o);Sc(a)?i=true:Tc(a)||(_r(o)&xn)!==0&&Bh(o,In?Vh(o):void 0)}if(!i){let a=o.subtreeFlags;if(!(typeof a=="number"&&(a&xn)===0&&(_r(o)&xn)===0)&&o.child!=null){o=o.child;continue}}for(;o!=null;){if(o===t)return Ga(n);if(o.sibling!=null){o=o.sibling;break}o=o.return}}Ga(n)}function Ga(e){Qe>e&&(Rn+=1)}function Hh(){if(Ea)return true;let e=Fa();if(!e)return false;let t=e.onCommitFiberRoot;return e.onCommitFiberRoot=function(n,r,...o){if(Xt)try{Ah(r)}catch{}return typeof t=="function"?t.call(e,n,r,...o):void 0},Ea=true,true}function Mh(){if(typeof Z<"u"&&!Z)return false;let e=Fa();return!!(e&&e.renderers&&e.renderers.size>0)}function $h(){return Xt}function Eh(e){Hh()&&(et=new Map,Or=false,In=e?.detail===true,Rn=0,Qe=0,Dn=0,Ze={},Xt=true)}function Fh(){if(!Xt&&Qe===0&&et.size===0)return null;Xt=false;let e=Array.from(et.entries()).sort((n,r)=>{let o=r[1].totalSelfMs-n[1].totalSelfMs;return o!==0?o:r[1].renders-n[1].renders}).slice(0,kh).map(([n,r])=>({name:n,renders:r.renders,totalMs:kn(r.totalSelfMs),maxMs:kn(r.maxSelfMs),avgMs:r.renders>0?kn(r.totalSelfMs/r.renders):0,causes:r.causes,...r.changedProps&&r.changedProps.size>0?{changedProps:Array.from(r.changedProps)}:null,...r.parentName?{parentName:r.parentName}:null})),t={totalCommits:Rn,totalRenders:Qe,capturedDurations:Or,totalRenderMs:kn(Dn),wastedRenders:(Ze.parent??0)+(Ze.propsUnstable??0),causes:Ze,topComponents:e};return et=new Map,Rn=0,Qe=0,Dn=0,Ze={},t}function kn(e){return Math.round(e*100)/100}var tt={isSupported:Mh,isCapturing:$h,startCapture:Eh,stopCapture:Fh};function Pn(){M.isInitialized()||M.initialize()}function jr(e){if(!e)return;let{hookChanges:t,...n}=e;return n}function Oh(e){let{renderHistory:t,lastRenderCause:n,...r}=e;return{...r,lastRenderCause:jr(n),historyCount:t?.length??0}}function _h(e){try{return JSON.stringify(e),e}catch{return{...e,lastRenderCause:jr(e.lastRenderCause),renderHistory:e.renderHistory?.map(t=>({...t,capturedProps:void 0,capturedState:void 0,cause:jr(t.cause)??t.cause}))}}}function Wh(){return tt.isSupported()?(tt.startCapture({detail:true}),{ok:true}):{ok:false,reason:"render capture needs a dev build with the React DevTools hook available"}}function jh(){return{summary:tt.stopCapture()}}var Uh={version:3,getSnapshot:()=>({enabled:M.isEnabled(),frozen:M.getFrozen(),highlightsSuppressed:M.getHighlightsSuppressed(),renders:N.getRenders().map(Oh),trackerState:N.getState()}),subscribe:e=>{let t=M.subscribe(e),n=M.subscribeToFreeze(e),r=N.subscribe(e),o=N.subscribeToState(e);return()=>{t(),n(),r(),o()}},actions:{beginMeasurement:()=>Wh(),endMeasurement:()=>jh(),getRenderDetail:e=>{let{nativeTag:t}=e??{};if(t==null)return{found:false,reason:"missing nativeTag"};let n=N.getRender(String(t));return n?{found:true,nativeTag:t,render:_h(n)}:{found:false,reason:"unknown nativeTag"}},toggle:()=>{Pn(),M.toggle()},setEnabled:e=>{Pn(),M.setEnabled(e.enabled)},toggleFreeze:()=>{M.toggleFreeze()},clearRenderCounts:()=>{M.clearRenderCounts()},setSpotlight:e=>{M.setSpotlight(e.nativeTag)},locateComponent:e=>(Pn(),M.locateComponent(e??{})),setSilentTracking:e=>{Pn(),M.setSilentTracking(e.enabled??false)},describeScreen:e=>Wo(e??{}),tapElement:e=>Os(e??{}),waitFor:e=>Gs(e??{}),startTouchCapture:()=>Sh(),stopTouchCapture:()=>(wh(),Yt()),clearTouchCapture:()=>(xh(),{ok:true}),readTouchCapture:e=>Ih(e?.sinceSeq??0)}};U();import{useEffect as Ln,useState as Ur,useRef as zn,useCallback as Ka,useLayoutEffect as Gh}from"react";import{night as Nn,monoFont as Kh}from"@buoy-gg/shared-ui/web";en();Pe();import{Fragment as qh,jsx as Rt,jsxs as qa}from"react/jsx-runtime";var Jh=1e3;function Yh({onBadgePress:e}={}){let[t,n]=Ur([]),[r,o]=Ur(()=>M.getFrozen()),[i,l]=Ur(null),a=zn(null),c=zn(0),s=zn(0),d=zn(r);d.current=r,Ue.isEnabled()&&(c.current=performance.now(),s.current=t.length),Gh(()=>{if(Ue.isEnabled()&&c.current>0&&s.current>0){let m=performance.now()-c.current;pl(s.current,m)}}),Ln(()=>M.subscribeToFreeze(m=>{o(m)}),[]),Ln(()=>N.subscribeToFilters(()=>{n(m=>m.filter(w=>{let u=N.getRender(String(w.id));return u?N.shouldShowRender(u):true}))}),[]),Ln(()=>(M.setSpotlightCallback(m=>{l(m)}),()=>{M.setSpotlightCallback(null)}),[]);let b=Ka(m=>{let w=Date.now(),u=m.map(x=>({...x,timestamp:w}));n(x=>{let R=[...x];for(let H of u){let k=R.findIndex(D=>D.id===H.id);k>=0?R[k]=H:R.push(H)}return R})},[]);Ln(()=>(M.setHighlightCallback(b),a.current=setInterval(()=>{if(d.current)return;let m=Date.now();n(w=>w.filter(u=>m-u.timestamp<Jh))},50),()=>{M.setHighlightCallback(null),a.current&&clearInterval(a.current)}),[b]);let C=e||M.getBadgePressCallback(),y=Ka(m=>{e?e(m):M.handleBadgePress(m)},[e]),v=i?N.getRender(String(i)):null;return t.length===0&&!v?.measurements?null:qa(h,{style:nt.overlay,pointerEvents:"box-none",nativeID:"highlight-updates-overlay",children:[v?.measurements&&qa(qh,{children:[Rt(h,{pointerEvents:"none",nativeID:"__spotlight_highlight__",style:[nt.spotlightHighlight,{left:v.measurements.x-3,top:v.measurements.y-3,width:v.measurements.width+6,height:v.measurements.height+6}]}),Rt(h,{pointerEvents:"none",style:[nt.spotlightLabel,{left:v.measurements.x,top:v.measurements.y+v.measurements.height+4}],children:Rt(g,{style:nt.spotlightLabelText,children:v.componentName||v.displayName||v.viewType})})]}),t.map(m=>Rt(h,{pointerEvents:"box-none",nativeID:`__highlight_rect_${m.id}__`,style:[nt.highlight,{left:m.x,top:m.y,width:m.width,height:m.height,borderColor:m.color}],children:m.count>0&&Rt(h,{style:[nt.badge,{backgroundColor:m.color}],nativeID:`__highlight_badge_${m.id}__`,pointerEvents:C?"auto":"none",hitSlop:{top:8,bottom:8,left:8,right:8},onStartShouldSetResponder:()=>!!C,onResponderGrant:()=>y(m.id),children:Rt(g,{style:nt.badgeText,nativeID:`__highlight_text_${m.id}__`,children:m.count})})},`highlight-${m.id}`))]})}var nt=fe.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:Nn.color.accent,backgroundColor:"transparent"},spotlightLabel:{position:"absolute",backgroundColor:Nn.color.surface,borderWidth:1,borderColor:Nn.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},spotlightLabelText:{color:Nn.color.accent,fontSize:11,fontWeight:"600",fontFamily:Kh}});import{setRenderCaptureProvider as Xh}from"@buoy-gg/shared-ui/web";Pe();en();mo();U();function Qh(e){let t={exportedAt:new Date().toISOString(),totalComponents:e.length,totalRenders:e.reduce((n,r)=>n+r.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(r=>({type:r.type,index:r.index,description:r.description}))}:null,renderHistory:n.renderHistory?.map(r=>({renderNumber:r.renderNumber,timestamp:r.timestamp,cause:{type:r.cause.type,componentCause:r.cause.componentCause,changedKeys:r.cause.changedKeys}}))}))};return JSON.stringify(t,null,2)}try{Xh({isSupported:tt.isSupported,start:tt.startCapture,stop:tt.stopCapture,startLiveHighlights:()=>{try{let e=M.isEnabled(),t=M.getHighlightsSuppressed();return M.enable(),()=>{try{e?t&&M.setHighlightsSuppressed(true):M.disable()}catch{}}}catch{return null}}})}catch{}var Zh=e=>{let{RenderTracker:t}=(Pe(),sl(bo));return t.onRenderEvent(e)};export{Ee as CAUSE_CONFIG,_t as COMPONENT_CAUSE_CONFIG,tt as CommitProfiler,oa as HighlightFilterView,ah as HighlightToolView,M as HighlightUpdatesController,Ar as HighlightUpdatesModal,Yh as HighlightUpdatesOverlay,Ue as PerformanceLogger,Vi as RenderCauseBadge,ji as RenderDetailView,Ta as RenderHistoryFooter,Ca as RenderHistoryViewer,ca as RenderListItem,N as RenderTracker,Tu as TwoLevelCauseBadge,je as VIEW_TYPE_MAP,mc as capturePropsSnapshot,fc as captureStateSnapshot,ai as clearRenderCauseState,dh as createHighlightUpdatesModalTool,ch as createHighlightUpdatesTool,rr as detectRenderCause,Zi as detectedItemTestID,Rl as disableProfilerLogging,Il as enableProfilerLogging,Qh as generateRendersJson,hl as getAllComponentNames,dl as getAllNativeViewTypes,Fn as getComponentDisplayName,cl as getNativeViewType,gc as getRenderCauseStats,uh as highlightUpdatesModalPreset,sh as highlightUpdatesPreset,Uh as highlightUpdatesSyncAdapter,yt as identifierSlug,Ro as installProfilerInterceptor,di as isCapturingBuoyToolRenders,xl as isInterceptorInstalled,ul as isKnownViewType,Dl as isLoggingEnabled,Zh as onRenderEvent,ea as patternChipTestID,hc as removeRenderCauseState,Qi as renderRowTestID,He as safeCloneForHistory,yc as setCaptureBuoyToolRenders,Io as setComparisonCallback,bt as settingTestID,Do as uninstallProfilerInterceptor};
|