@buoy-gg/debug-borders 7.0.77 → 7.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DebugBordersStandaloneOverlay=DebugBordersStandaloneOverlay;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _utils=require("@buoy-gg/shared-ui/utils");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var c=new WeakMap,s=new WeakMap;return(_interopRequireWildcard=function(t,f){if(!f&&t&&t.__esModule)return t;var a,u,o={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return o;if(a=f?s:c){if(a.has(t))return a.get(t);a.set(t,o)}for(const i in t)"default"!==i&&{}.hasOwnProperty.call(t,i)&&((u=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,i))&&(u.get||u.set)?a(o,i,u):o[i]=t[i]);return o})(e,r)}const infoModalKey=_sharedUi.devToolsStorageKeys.debugBorders.infoModal();const DebugBordersManager=require("../utils/DebugBordersManager");const{getAllHostComponentInstances}=require("../utils/fiberTreeTraversal");const{measureInstances}=require("../utils/componentMeasurement");const{getColorForDepth}=require("../utils/colorGeneration");const{getShortLabel}=require("../utils/componentInfo");const{resolveOverlappingLabels}=require("../utils/labelPositioning");let useDevToolsVisibility;function resolveUseDevToolsVisibility(){if(useDevToolsVisibility!==void 0){return useDevToolsVisibility}try{const e=(0,_utils.loadToolModule)("@buoy-gg/core");useDevToolsVisibility=e.useDevToolsVisibility??null}catch(e){useDevToolsVisibility=null}return useDevToolsVisibility??null}function InfoRow({label:e,value:r,color:c}){if(r===null||r===void 0)return null;let s;if(typeof r==="object"){try{s=JSON.stringify(r,null,2)}catch{s=String(r)}}else{s=String(r)}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:modalStyles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.label,children:e}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[modalStyles.value,c?{color:c}:null],children:s})]})}function SimpleHeader({title:e}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:headerStyles.container,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:headerStyles.title,numberOfLines:1,children:e})})}function ComponentInfoContent({info:e,rect:r}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:modalStyles.content,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Identifiers"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"testID",value:e.testID,color:"#10b981"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"accessibilityLabel",value:e.accessibilityLabel,color:"#ec4899"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"nativeID",value:e.nativeID,color:"#f59e0b"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"key",value:e.fiberKey}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Component"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Component Name",value:e.componentName,color:"#a855f7"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Parent Component",value:e.parentComponentName}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Display Name",value:e.displayName}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Native View Type",value:e.viewType}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Fiber Tag",value:e.fiberTag}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Position & Size"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"X",value:Math.round(r.x)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Y",value:Math.round(r.y)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Width",value:Math.round(r.width)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Height",value:Math.round(r.height)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Depth",value:r.depth}),(e.accessibilityRole||e.accessibilityHint||e.accessibilityState)&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Accessibility"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Role",value:e.accessibilityRole}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Hint",value:e.accessibilityHint}),e.accessibilityState&&_dataViewer.DataViewer?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(InfoRow,{label:"State",value:e.accessibilityState})]}),e.styleInfo&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Styles"}),_dataViewer.DataViewer?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:modalStyles.codeBlock,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.codeText,children:JSON.stringify(e.styleInfo,null,2)})})]})]})}function DebugBordersStandaloneOverlay(){const[e,r]=(0,_react.useState)("off");const[c,s]=(0,_react.useState)([]);const[t,f]=(0,_react.useState)(null);const[a,u]=(0,_react.useState)(false);const o=_react.default.useRef(false);const i=resolveUseDevToolsVisibility()?.()?.isDevToolsActive??false;const m=(0,_react.useCallback)(l=>{f(l);u(true)},[]);const g=(0,_react.useCallback)(()=>{u(false);f(null)},[]);const h=e!=="off"&&!i;const y=e==="labels"&&!i;(0,_react.useEffect)(()=>{const l=DebugBordersManager.subscribe(d=>{r(d)});return l},[]);(0,_react.useEffect)(()=>{if(!h){s([]);return}let l=true;let d;const n=async()=>{if(!l||o.current){return}o.current=true;try{const b=getAllHostComponentInstances();if(b.length===0){o.current=false;return}const x=await measureInstances(b);if(l){const v=y?resolveOverlappingLabels(x):x;s(v)}}catch(b){console.error("[Buoy]","[DebugBorders] Error updating measurements:",b)}finally{o.current=false}};const p=setTimeout(()=>{n()},500);d=setInterval(n,2e3);return()=>{l=false;clearTimeout(p);clearInterval(d);o.current=false}},[h,y,c.length]);if(!h){return null}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[c.map((l,d)=>{const n=l.componentInfo;const p=n&&(n.testID||n.accessibilityLabel);if(y&&!p){return null}const b=y&&n?n.primaryColor:getColorForDepth(l.depth);return(0,_jsxRuntime.jsxs)(_react.default.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[styles.border,{left:l.x,top:l.y,width:l.width,height:l.height,borderColor:b}]}),y&&p&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>m(l),style:[styles.labelContainer,{left:l.x,top:l.y-10-(l.labelOffsetY||0),backgroundColor:n.primaryColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,numberOfLines:1,children:n.primaryLabel})})]},`border-${d}`)}),_sharedUi.JsModal&&t?.componentInfo&&(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:a,onClose:g,initialMode:"bottomSheet",header:{customContent:(0,_jsxRuntime.jsx)(SimpleHeader,{title:t.componentInfo.primaryLabel})},persistenceKey:infoModalKey,enablePersistence:false,children:(0,_jsxRuntime.jsx)(ComponentInfoContent,{info:t.componentInfo,rect:t})})]})}const styles=_reactNative.StyleSheet.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:_sharedUi.monoFont,color:"#ffffff"}});const headerStyles=_reactNative.StyleSheet.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:_sharedUi.monoFont}});const modalStyles=_reactNative.StyleSheet.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:_sharedUi.monoFont},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:_sharedUi.monoFont},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:_sharedUi.monoFont}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DebugBordersStandaloneOverlay=DebugBordersStandaloneOverlay;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _utils=require("@buoy-gg/shared-ui/utils");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,o){if("function"==typeof WeakMap)var s=new WeakMap,i=new WeakMap;return(_interopRequireWildcard=function(t,f){if(!f&&t&&t.__esModule)return t;var c,u,r={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return r;if(c=f?i:s){if(c.has(t))return c.get(t);c.set(t,r)}for(const a in t)"default"!==a&&{}.hasOwnProperty.call(t,a)&&((u=(c=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,a))&&(u.get||u.set)?c(r,a,u):r[a]=t[a]);return r})(e,o)}const infoModalKey=_sharedUi.devToolsStorageKeys.debugBorders.infoModal();const DebugBordersManager=require("../utils/DebugBordersManager");const{getAllHostComponentInstances}=require("../utils/fiberTreeTraversal");const{measureInstances}=require("../utils/componentMeasurement");const{getColorForDepth}=require("../utils/colorGeneration");const{getShortLabel}=require("../utils/componentInfo");const{rectanglesForMode}=require("../utils/labelPositioning");let useDevToolsVisibility;function resolveUseDevToolsVisibility(){if(useDevToolsVisibility!==void 0){return useDevToolsVisibility}try{const e=(0,_utils.loadToolModule)("@buoy-gg/core");useDevToolsVisibility=e.useDevToolsVisibility??null}catch(e){useDevToolsVisibility=null}return useDevToolsVisibility??null}function InfoRow({label:e,value:o,color:s}){if(o===null||o===void 0)return null;let i;if(typeof o==="object"){try{i=JSON.stringify(o,null,2)}catch{i=String(o)}}else{i=String(o)}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:modalStyles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.label,children:e}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[modalStyles.value,s?{color:s}:null],children:i})]})}function SimpleHeader({title:e}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:headerStyles.container,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:headerStyles.title,numberOfLines:1,children:e})})}function ComponentInfoContent({info:e,rect:o}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:modalStyles.content,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Identifiers"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"testID",value:e.testID,color:"#10b981"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"accessibilityLabel",value:e.accessibilityLabel,color:"#ec4899"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"nativeID",value:e.nativeID,color:"#f59e0b"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"key",value:e.fiberKey}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Component"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Component Name",value:e.componentName,color:"#a855f7"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Parent Component",value:e.parentComponentName}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Display Name",value:e.displayName}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Native View Type",value:e.viewType}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Fiber Tag",value:e.fiberTag}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Position & Size"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"X",value:Math.round(o.x)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Y",value:Math.round(o.y)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Width",value:Math.round(o.width)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Height",value:Math.round(o.height)}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Depth",value:o.depth}),(e.accessibilityRole||e.accessibilityHint||e.accessibilityState)&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Accessibility"}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Role",value:e.accessibilityRole}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Hint",value:e.accessibilityHint}),e.accessibilityState&&_dataViewer.DataViewer?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(InfoRow,{label:"State",value:e.accessibilityState})]}),e.styleInfo&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.sectionTitle,children:"Styles"}),_dataViewer.DataViewer?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:modalStyles.codeBlock,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:modalStyles.codeText,children:JSON.stringify(e.styleInfo,null,2)})})]})]})}function DebugBordersStandaloneOverlay(){const[e,o]=(0,_react.useState)("off");const[s,i]=(0,_react.useState)([]);const[t,f]=(0,_react.useState)(null);const[c,u]=(0,_react.useState)(false);const r=_react.default.useRef(false);const a=resolveUseDevToolsVisibility()?.()?.isDevToolsActive??false;const x=(0,_react.useCallback)(l=>{f(l);u(true)},[]);const m=(0,_react.useCallback)(()=>{u(false);f(null)},[]);const h=e!=="off"&&!a;const y=e==="labels"&&!a;(0,_react.useEffect)(()=>{const l=DebugBordersManager.subscribe(d=>{o(d)});return l},[]);(0,_react.useEffect)(()=>{if(!h){i([]);return}let l=true;let d;const n=async()=>{if(!l||r.current){return}r.current=true;try{const b=getAllHostComponentInstances();if(b.length===0){r.current=false;return}const v=await measureInstances(b);if(l){i(v)}}catch(b){console.error("[Buoy]","[DebugBorders] Error updating measurements:",b)}finally{r.current=false}};const p=setTimeout(()=>{n()},s.length?500:0);d=setInterval(n,2e3);return()=>{l=false;clearTimeout(p);clearInterval(d);r.current=false}},[h,s.length]);const g=(0,_react.useMemo)(()=>rectanglesForMode(s,y),[s,y]);if(!h){return null}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[g.map((l,d)=>{const n=l.componentInfo;const p=n&&(n.testID||n.accessibilityLabel);if(y&&!p){return null}const b=y&&n?n.primaryColor:getColorForDepth(l.depth);return(0,_jsxRuntime.jsxs)(_react.default.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[styles.border,{left:l.x,top:l.y,width:l.width,height:l.height,borderColor:b}]}),y&&p&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>x(l),style:[styles.labelContainer,{left:l.x,top:l.y-10-(l.labelOffsetY||0),backgroundColor:n.primaryColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,numberOfLines:1,children:n.primaryLabel})})]},`border-${d}`)}),_sharedUi.JsModal&&t?.componentInfo&&(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:c,onClose:m,initialMode:"bottomSheet",header:{customContent:(0,_jsxRuntime.jsx)(SimpleHeader,{title:t.componentInfo.primaryLabel})},persistenceKey:infoModalKey,enablePersistence:false,children:(0,_jsxRuntime.jsx)(ComponentInfoContent,{info:t.componentInfo,rect:t})})]})}const styles=_reactNative.StyleSheet.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:_sharedUi.monoFont,color:"#ffffff"}});const headerStyles=_reactNative.StyleSheet.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:_sharedUi.monoFont}});const modalStyles=_reactNative.StyleSheet.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:_sharedUi.monoFont},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:_sharedUi.monoFont},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:_sharedUi.monoFont}});
@@ -1 +1 @@
1
- "use strict";const CONFIG={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function rectsOverlap(t,s){const o=CONFIG.PADDING;const l=t.x-o;const f=t.x+t.width+o;const i=t.y-o;const e=t.y+t.height+o;const n=s.x-o;const h=s.x+s.width+o;const c=s.y-o;const a=s.y+s.height+o;return!(f<n||l>h||e<c||i>a)}function estimateLabelWidth(t){if(!t)return 0;return t.length*5+8}function resolveOverlappingLabels(t){if(!t||t.length===0){return t}const s=t.filter(i=>{const e=i.componentInfo;return e&&(e.testID||e.accessibilityLabel)});const o=t.map((i,e)=>{const n=i.componentInfo;const h=n&&(n.testID||n.accessibilityLabel);const c=h?n.primaryLabel:"";const a=estimateLabelWidth(c);return{index:e,hasValidLabel:h,x:i.x,y:i.y-CONFIG.LABEL_HEIGHT,width:a,height:CONFIG.LABEL_HEIGHT,offsetY:0}});const l=o.map((i,e)=>e).filter(i=>o[i].hasValidLabel).sort((i,e)=>{const n=t[i];const h=t[e];if(Math.abs(n.y-h.y)>10){return n.y-h.y}return n.x-h.x});const f=[];for(const i of l){const e=o[i];if(e.width===0){continue}let n=0;let h=true;let c=0;const a=Math.ceil(CONFIG.MAX_VERTICAL_OFFSET/CONFIG.LABEL_HEIGHT);while(h&&c<a){const r={x:e.x,y:e.y-n,width:e.width,height:e.height};h=f.some(L=>rectsOverlap(r,L));if(h){n+=CONFIG.LABEL_HEIGHT;c++}}e.offsetY=n;f.push({x:e.x,y:e.y-n,width:e.width,height:e.height})}return t.map((i,e)=>({...i,labelOffsetY:o[e].offsetY}))}function mightHaveOverlaps(t){if(!t||t.length<2){return false}for(let s=0;s<Math.min(t.length,20);s++){for(let o=s+1;o<Math.min(t.length,20);o++){const l=t[s];const f=t[o];if(Math.abs(l.y-f.y)<CONFIG.LABEL_HEIGHT*2&&!(l.x+100<f.x||f.x+100<l.x)){return true}}}return false}module.exports={resolveOverlappingLabels,rectsOverlap,estimateLabelWidth,mightHaveOverlaps,CONFIG};
1
+ "use strict";const CONFIG={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function rectsOverlap(t,s){const o=CONFIG.PADDING;const c=t.x-o;const f=t.x+t.width+o;const n=t.y-o;const e=t.y+t.height+o;const i=s.x-o;const h=s.x+s.width+o;const l=s.y-o;const r=s.y+s.height+o;return!(f<i||c>h||e<l||n>r)}function estimateLabelWidth(t){if(!t)return 0;return t.length*5+8}function resolveOverlappingLabels(t){if(!t||t.length===0){return t}const s=t.filter(n=>{const e=n.componentInfo;return e&&(e.testID||e.accessibilityLabel)});const o=t.map((n,e)=>{const i=n.componentInfo;const h=i&&(i.testID||i.accessibilityLabel);const l=h?i.primaryLabel:"";const r=estimateLabelWidth(l);return{index:e,hasValidLabel:h,x:n.x,y:n.y-CONFIG.LABEL_HEIGHT,width:r,height:CONFIG.LABEL_HEIGHT,offsetY:0}});const c=o.map((n,e)=>e).filter(n=>o[n].hasValidLabel).sort((n,e)=>{const i=t[n];const h=t[e];if(Math.abs(i.y-h.y)>10){return i.y-h.y}return i.x-h.x});const f=[];for(const n of c){const e=o[n];if(e.width===0){continue}let i=0;let h=true;let l=0;const r=Math.ceil(CONFIG.MAX_VERTICAL_OFFSET/CONFIG.LABEL_HEIGHT);while(h&&l<r){const a={x:e.x,y:e.y-i,width:e.width,height:e.height};h=f.some(L=>rectsOverlap(a,L));if(h){i+=CONFIG.LABEL_HEIGHT;l++}}e.offsetY=i;f.push({x:e.x,y:e.y-i,width:e.width,height:e.height})}return t.map((n,e)=>({...n,labelOffsetY:o[e].offsetY}))}function rectanglesForMode(t,s){return s?resolveOverlappingLabels(t):t}function mightHaveOverlaps(t){if(!t||t.length<2){return false}for(let s=0;s<Math.min(t.length,20);s++){for(let o=s+1;o<Math.min(t.length,20);o++){const c=t[s];const f=t[o];if(Math.abs(c.y-f.y)<CONFIG.LABEL_HEIGHT*2&&!(c.x+100<f.x||f.x+100<c.x)){return true}}}return false}module.exports={resolveOverlappingLabels,rectanglesForMode,rectsOverlap,estimateLabelWidth,mightHaveOverlaps,CONFIG};
@@ -0,0 +1 @@
1
+ "use strict";var _vitest=require("vitest");const{rectanglesForMode,resolveOverlappingLabels}=require("./labelPositioning");const{PAIR_A,PAIR_B}=require("../../../../../example-dev-build/utils/bordersBench");function box(e){return{x:e.left,y:e.top,width:e.width,height:e.height,depth:1,componentInfo:{testID:e.testID,accessibilityLabel:null,primaryLabel:e.testID}}}(0,_vitest.describe)("label stacking",()=>{(0,_vitest.it)("stacks the bench pair's second tag 20 pt higher",()=>{const[e,t]=resolveOverlappingLabels([box(PAIR_A),box(PAIR_B)]);(0,_vitest.expect)(e.labelOffsetY).toBe(0);(0,_vitest.expect)(t.labelOffsetY).toBe(20)});(0,_vitest.it)("places tags for boxes measured in borders mode as soon as labels mode shows",()=>{const e=rectanglesForMode([box(PAIR_A),box(PAIR_B)],false);(0,_vitest.expect)(e.map(s=>s.labelOffsetY)).toEqual([void 0,void 0]);const t=rectanglesForMode(e,true);(0,_vitest.expect)(t.map(s=>s.labelOffsetY)).toEqual([0,20])})});
@@ -1 +1 @@
1
- "use strict";import V,{useEffect as L,useState as T,useCallback as R}from"react";import{View as d,Text as a,StyleSheet as x,TouchableOpacity as q}from"react-native";import{monoFont as p}from"@buoy-gg/shared-ui";import{JsModal as B,devToolsStorageKeys as P}from"@buoy-gg/shared-ui";import{DataViewer as S}from"@buoy-gg/shared-ui/dataViewer";import{loadToolModule as W}from"@buoy-gg/shared-ui/utils";import{jsx as e,jsxs as b,Fragment as z}from"react/jsx-runtime";const j=P.debugBorders.infoModal();const A=require("../utils/DebugBordersManager");const{getAllHostComponentInstances:K}=require("../utils/fiberTreeTraversal");const{measureInstances:J}=require("../utils/componentMeasurement");const{getColorForDepth:_}=require("../utils/colorGeneration");const{getShortLabel:ne}=require("../utils/componentInfo");const{resolveOverlappingLabels:Y}=require("../utils/labelPositioning");let h;function G(){if(h!==void 0){return h}try{const t=W("@buoy-gg/core");h=t.useDevToolsVisibility??null}catch(t){h=null}return h??null}function o({label:t,value:n,color:f}){if(n===null||n===void 0)return null;let s;if(typeof n==="object"){try{s=JSON.stringify(n,null,2)}catch{s=String(n)}}else{s=String(n)}return b(d,{style:r.row,children:[e(a,{style:r.label,children:t}),e(a,{style:[r.value,f?{color:f}:null],children:s})]})}function U({title:t}){return e(d,{style:O.container,children:e(a,{style:O.title,numberOfLines:1,children:t})})}function X({info:t,rect:n}){return b(d,{style:r.content,children:[e(a,{style:r.sectionTitle,children:"Identifiers"}),e(o,{label:"testID",value:t.testID,color:"#10b981"}),e(o,{label:"accessibilityLabel",value:t.accessibilityLabel,color:"#ec4899"}),e(o,{label:"nativeID",value:t.nativeID,color:"#f59e0b"}),e(o,{label:"key",value:t.fiberKey}),e(a,{style:r.sectionTitle,children:"Component"}),e(o,{label:"Component Name",value:t.componentName,color:"#a855f7"}),e(o,{label:"Parent Component",value:t.parentComponentName}),e(o,{label:"Display Name",value:t.displayName}),e(o,{label:"Native View Type",value:t.viewType}),e(o,{label:"Fiber Tag",value:t.fiberTag}),e(a,{style:r.sectionTitle,children:"Position & Size"}),e(o,{label:"X",value:Math.round(n.x)}),e(o,{label:"Y",value:Math.round(n.y)}),e(o,{label:"Width",value:Math.round(n.width)}),e(o,{label:"Height",value:Math.round(n.height)}),e(o,{label:"Depth",value:n.depth}),(t.accessibilityRole||t.accessibilityHint||t.accessibilityState)&&b(z,{children:[e(a,{style:r.sectionTitle,children:"Accessibility"}),e(o,{label:"Role",value:t.accessibilityRole}),e(o,{label:"Hint",value:t.accessibilityHint}),t.accessibilityState&&S?e(S,{title:"",data:t.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):e(o,{label:"State",value:t.accessibilityState})]}),t.styleInfo&&b(z,{children:[e(a,{style:r.sectionTitle,children:"Styles"}),S?e(S,{title:"",data:t.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):e(d,{style:r.codeBlock,children:e(a,{style:r.codeText,children:JSON.stringify(t.styleInfo,null,2)})})]})]})}export function DebugBordersStandaloneOverlay(){const[t,n]=T("off");const[f,s]=T([]);const[g,D]=T(null);const[H,M]=T(false);const y=V.useRef(false);const w=G()?.()?.isDevToolsActive??false;const N=R(l=>{D(l);M(true)},[]);const E=R(()=>{M(false);D(null)},[]);const C=t!=="off"&&!w;const m=t==="labels"&&!w;L(()=>{const l=A.subscribe(c=>{n(c)});return l},[]);L(()=>{if(!C){s([]);return}let l=true;let c;const i=async()=>{if(!l||y.current){return}y.current=true;try{const u=K();if(u.length===0){y.current=false;return}const F=await J(u);if(l){const k=m?Y(F):F;s(k)}}catch(u){console.error("[Buoy]","[DebugBorders] Error updating measurements:",u)}finally{y.current=false}};const v=setTimeout(()=>{i()},500);c=setInterval(i,2e3);return()=>{l=false;clearTimeout(v);clearInterval(c);y.current=false}},[C,m,f.length]);if(!C){return null}return b(d,{style:I.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[f.map((l,c)=>{const i=l.componentInfo;const v=i&&(i.testID||i.accessibilityLabel);if(m&&!v){return null}const u=m&&i?i.primaryColor:_(l.depth);return b(V.Fragment,{children:[e(d,{pointerEvents:"none",style:[I.border,{left:l.x,top:l.y,width:l.width,height:l.height,borderColor:u}]}),m&&v&&e(q,{activeOpacity:.7,onPress:()=>N(l),style:[I.labelContainer,{left:l.x,top:l.y-10-(l.labelOffsetY||0),backgroundColor:i.primaryColor}],children:e(a,{style:I.labelText,numberOfLines:1,children:i.primaryLabel})})]},`border-${c}`)}),B&&g?.componentInfo&&e(B,{visible:H,onClose:E,initialMode:"bottomSheet",header:{customContent:e(U,{title:g.componentInfo.primaryLabel})},persistenceKey:j,enablePersistence:false,children:e(X,{info:g.componentInfo,rect:g})})]})}const I=x.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:p,color:"#ffffff"}});const O=x.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:p}});const r=x.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:p},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:p},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:p}});
1
+ "use strict";import F,{useEffect as R,useState as T,useCallback as V,useMemo as q}from"react";import{View as b,Text as a,StyleSheet as M,TouchableOpacity as P}from"react-native";import{monoFont as p}from"@buoy-gg/shared-ui";import{JsModal as B,devToolsStorageKeys as W}from"@buoy-gg/shared-ui";import{DataViewer as S}from"@buoy-gg/shared-ui/dataViewer";import{loadToolModule as j}from"@buoy-gg/shared-ui/utils";import{jsx as e,jsxs as f,Fragment as L}from"react/jsx-runtime";const A=W.debugBorders.infoModal();const K=require("../utils/DebugBordersManager");const{getAllHostComponentInstances:J}=require("../utils/fiberTreeTraversal");const{measureInstances:_}=require("../utils/componentMeasurement");const{getColorForDepth:Y}=require("../utils/colorGeneration");const{getShortLabel:re}=require("../utils/componentInfo");const{rectanglesForMode:G}=require("../utils/labelPositioning");let h;function U(){if(h!==void 0){return h}try{const t=j("@buoy-gg/core");h=t.useDevToolsVisibility??null}catch(t){h=null}return h??null}function o({label:t,value:n,color:s}){if(n===null||n===void 0)return null;let c;if(typeof n==="object"){try{c=JSON.stringify(n,null,2)}catch{c=String(n)}}else{c=String(n)}return f(b,{style:r.row,children:[e(a,{style:r.label,children:t}),e(a,{style:[r.value,s?{color:s}:null],children:c})]})}function X({title:t}){return e(b,{style:z.container,children:e(a,{style:z.title,numberOfLines:1,children:t})})}function $({info:t,rect:n}){return f(b,{style:r.content,children:[e(a,{style:r.sectionTitle,children:"Identifiers"}),e(o,{label:"testID",value:t.testID,color:"#10b981"}),e(o,{label:"accessibilityLabel",value:t.accessibilityLabel,color:"#ec4899"}),e(o,{label:"nativeID",value:t.nativeID,color:"#f59e0b"}),e(o,{label:"key",value:t.fiberKey}),e(a,{style:r.sectionTitle,children:"Component"}),e(o,{label:"Component Name",value:t.componentName,color:"#a855f7"}),e(o,{label:"Parent Component",value:t.parentComponentName}),e(o,{label:"Display Name",value:t.displayName}),e(o,{label:"Native View Type",value:t.viewType}),e(o,{label:"Fiber Tag",value:t.fiberTag}),e(a,{style:r.sectionTitle,children:"Position & Size"}),e(o,{label:"X",value:Math.round(n.x)}),e(o,{label:"Y",value:Math.round(n.y)}),e(o,{label:"Width",value:Math.round(n.width)}),e(o,{label:"Height",value:Math.round(n.height)}),e(o,{label:"Depth",value:n.depth}),(t.accessibilityRole||t.accessibilityHint||t.accessibilityState)&&f(L,{children:[e(a,{style:r.sectionTitle,children:"Accessibility"}),e(o,{label:"Role",value:t.accessibilityRole}),e(o,{label:"Hint",value:t.accessibilityHint}),t.accessibilityState&&S?e(S,{title:"",data:t.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):e(o,{label:"State",value:t.accessibilityState})]}),t.styleInfo&&f(L,{children:[e(a,{style:r.sectionTitle,children:"Styles"}),S?e(S,{title:"",data:t.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):e(b,{style:r.codeBlock,children:e(a,{style:r.codeText,children:JSON.stringify(t.styleInfo,null,2)})})]})]})}export function DebugBordersStandaloneOverlay(){const[t,n]=T("off");const[s,c]=T([]);const[g,x]=T(null);const[O,D]=T(false);const y=F.useRef(false);const w=U()?.()?.isDevToolsActive??false;const H=V(l=>{x(l);D(true)},[]);const N=V(()=>{D(false);x(null)},[]);const C=t!=="off"&&!w;const m=t==="labels"&&!w;R(()=>{const l=K.subscribe(u=>{n(u)});return l},[]);R(()=>{if(!C){c([]);return}let l=true;let u;const i=async()=>{if(!l||y.current){return}y.current=true;try{const d=J();if(d.length===0){y.current=false;return}const k=await _(d);if(l){c(k)}}catch(d){console.error("[Buoy]","[DebugBorders] Error updating measurements:",d)}finally{y.current=false}};const v=setTimeout(()=>{i()},s.length?500:0);u=setInterval(i,2e3);return()=>{l=false;clearTimeout(v);clearInterval(u);y.current=false}},[C,s.length]);const E=q(()=>G(s,m),[s,m]);if(!C){return null}return f(b,{style:I.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[E.map((l,u)=>{const i=l.componentInfo;const v=i&&(i.testID||i.accessibilityLabel);if(m&&!v){return null}const d=m&&i?i.primaryColor:Y(l.depth);return f(F.Fragment,{children:[e(b,{pointerEvents:"none",style:[I.border,{left:l.x,top:l.y,width:l.width,height:l.height,borderColor:d}]}),m&&v&&e(P,{activeOpacity:.7,onPress:()=>H(l),style:[I.labelContainer,{left:l.x,top:l.y-10-(l.labelOffsetY||0),backgroundColor:i.primaryColor}],children:e(a,{style:I.labelText,numberOfLines:1,children:i.primaryLabel})})]},`border-${u}`)}),B&&g?.componentInfo&&e(B,{visible:O,onClose:N,initialMode:"bottomSheet",header:{customContent:e(X,{title:g.componentInfo.primaryLabel})},persistenceKey:A,enablePersistence:false,children:e($,{info:g.componentInfo,rect:g})})]})}const I=M.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:p,color:"#ffffff"}});const z=M.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:p}});const r=M.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:p},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:p},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:p}});
@@ -1 +1 @@
1
- "use strict";const CONFIG={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function rectsOverlap(t,s){const o=CONFIG.PADDING;const l=t.x-o;const f=t.x+t.width+o;const i=t.y-o;const e=t.y+t.height+o;const n=s.x-o;const h=s.x+s.width+o;const c=s.y-o;const a=s.y+s.height+o;return!(f<n||l>h||e<c||i>a)}function estimateLabelWidth(t){if(!t)return 0;return t.length*5+8}function resolveOverlappingLabels(t){if(!t||t.length===0){return t}const s=t.filter(i=>{const e=i.componentInfo;return e&&(e.testID||e.accessibilityLabel)});const o=t.map((i,e)=>{const n=i.componentInfo;const h=n&&(n.testID||n.accessibilityLabel);const c=h?n.primaryLabel:"";const a=estimateLabelWidth(c);return{index:e,hasValidLabel:h,x:i.x,y:i.y-CONFIG.LABEL_HEIGHT,width:a,height:CONFIG.LABEL_HEIGHT,offsetY:0}});const l=o.map((i,e)=>e).filter(i=>o[i].hasValidLabel).sort((i,e)=>{const n=t[i];const h=t[e];if(Math.abs(n.y-h.y)>10){return n.y-h.y}return n.x-h.x});const f=[];for(const i of l){const e=o[i];if(e.width===0){continue}let n=0;let h=true;let c=0;const a=Math.ceil(CONFIG.MAX_VERTICAL_OFFSET/CONFIG.LABEL_HEIGHT);while(h&&c<a){const r={x:e.x,y:e.y-n,width:e.width,height:e.height};h=f.some(L=>rectsOverlap(r,L));if(h){n+=CONFIG.LABEL_HEIGHT;c++}}e.offsetY=n;f.push({x:e.x,y:e.y-n,width:e.width,height:e.height})}return t.map((i,e)=>({...i,labelOffsetY:o[e].offsetY}))}function mightHaveOverlaps(t){if(!t||t.length<2){return false}for(let s=0;s<Math.min(t.length,20);s++){for(let o=s+1;o<Math.min(t.length,20);o++){const l=t[s];const f=t[o];if(Math.abs(l.y-f.y)<CONFIG.LABEL_HEIGHT*2&&!(l.x+100<f.x||f.x+100<l.x)){return true}}}return false}module.exports={resolveOverlappingLabels,rectsOverlap,estimateLabelWidth,mightHaveOverlaps,CONFIG};
1
+ "use strict";const CONFIG={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function rectsOverlap(t,s){const o=CONFIG.PADDING;const c=t.x-o;const f=t.x+t.width+o;const n=t.y-o;const e=t.y+t.height+o;const i=s.x-o;const h=s.x+s.width+o;const l=s.y-o;const r=s.y+s.height+o;return!(f<i||c>h||e<l||n>r)}function estimateLabelWidth(t){if(!t)return 0;return t.length*5+8}function resolveOverlappingLabels(t){if(!t||t.length===0){return t}const s=t.filter(n=>{const e=n.componentInfo;return e&&(e.testID||e.accessibilityLabel)});const o=t.map((n,e)=>{const i=n.componentInfo;const h=i&&(i.testID||i.accessibilityLabel);const l=h?i.primaryLabel:"";const r=estimateLabelWidth(l);return{index:e,hasValidLabel:h,x:n.x,y:n.y-CONFIG.LABEL_HEIGHT,width:r,height:CONFIG.LABEL_HEIGHT,offsetY:0}});const c=o.map((n,e)=>e).filter(n=>o[n].hasValidLabel).sort((n,e)=>{const i=t[n];const h=t[e];if(Math.abs(i.y-h.y)>10){return i.y-h.y}return i.x-h.x});const f=[];for(const n of c){const e=o[n];if(e.width===0){continue}let i=0;let h=true;let l=0;const r=Math.ceil(CONFIG.MAX_VERTICAL_OFFSET/CONFIG.LABEL_HEIGHT);while(h&&l<r){const a={x:e.x,y:e.y-i,width:e.width,height:e.height};h=f.some(L=>rectsOverlap(a,L));if(h){i+=CONFIG.LABEL_HEIGHT;l++}}e.offsetY=i;f.push({x:e.x,y:e.y-i,width:e.width,height:e.height})}return t.map((n,e)=>({...n,labelOffsetY:o[e].offsetY}))}function rectanglesForMode(t,s){return s?resolveOverlappingLabels(t):t}function mightHaveOverlaps(t){if(!t||t.length<2){return false}for(let s=0;s<Math.min(t.length,20);s++){for(let o=s+1;o<Math.min(t.length,20);o++){const c=t[s];const f=t[o];if(Math.abs(c.y-f.y)<CONFIG.LABEL_HEIGHT*2&&!(c.x+100<f.x||f.x+100<c.x)){return true}}}return false}module.exports={resolveOverlappingLabels,rectanglesForMode,rectsOverlap,estimateLabelWidth,mightHaveOverlaps,CONFIG};
@@ -0,0 +1 @@
1
+ "use strict";import{describe as b,expect as t,it as l}from"vitest";const{rectanglesForMode:i,resolveOverlappingLabels:d}=require("./labelPositioning");const{PAIR_A:n,PAIR_B:r}=require("../../../../../example-dev-build/utils/bordersBench");function s(e){return{x:e.left,y:e.top,width:e.width,height:e.height,depth:1,componentInfo:{testID:e.testID,accessibilityLabel:null,primaryLabel:e.testID}}}b("label stacking",()=>{l("stacks the bench pair's second tag 20 pt higher",()=>{const[e,o]=d([s(n),s(r)]);t(e.labelOffsetY).toBe(0);t(o.labelOffsetY).toBe(20)});l("places tags for boxes measured in borders mode as soon as labels mode shows",()=>{const e=i([s(n),s(r)],false);t(e.map(a=>a.labelOffsetY)).toEqual([void 0,void 0]);const o=i(e,true);t(o.map(a=>a.labelOffsetY)).toEqual([0,20])})});
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=labelPositioning.test.d.ts.map
package/lib/web/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";var ie=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var qe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,n)=>(typeof require<"u"?require:o)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var le=(e,o)=>()=>(e&&(o=e(e=0)),o);var z=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),fe=(e,o)=>{for(var n in o)ie(e,n,{get:o[n],enumerable:true})},se=(e,o,n,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Ke(o))!Ue.call(e,s)&&s!==n&&ie(e,s,{get:()=>o[s],enumerable:!(d=$e(o,s))||d.enumerable});return e},Ye=(e,o,n)=>(se(e,o,"default"),n&&se(n,o,"default"));var Je=e=>se(ie({},"__esModule",{value:true}),e);var Xe,V=le(()=>{"use strict";Xe=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis)});import{loadToolModule as Qe}from"@buoy-gg/shared-ui/web/utils";var U=z((e,o)=>{"use strict";V();var n="off",d=new Set,s=["off","borders","labels"],m=["off","borders"],h=null,f=false;function i(){if(!f){f=true;try{let u=Qe("@buoy-gg/license");u&&typeof u.isPro=="function"&&(h=u.isPro)}catch{h=null}}}function r(){if(i(),h)try{return h()}catch{return false}return false}function t(){return r()?s:m}var c=s;function y(u){return d.add(u),u(n),()=>{d.delete(u)}}function l(){d.forEach(u=>{try{u(n)}catch(g){console.error("[DebugBorders] Error in listener:",g)}})}function p(u){return n===u?true:u==="labels"&&!r()?(console.warn("[DebugBorders] Labels mode requires React Buoy Pro. Upgrade at https://buoy.gg/pro"),false):(n=u,l(),true)}function S(){return n}function w(){let u=t(),g=u.indexOf(n);if(g===-1){p("off");return}let H=(g+1)%u.length;p(u[H])}function C(){p("borders")}function x(){p("off")}function T(){w()}function M(){return n!=="off"}function N(){return n==="labels"&&r()}function G(){return r()}function a(){return t()}function b(u){u?C():x()}o.exports={subscribe:y,enable:C,disable:x,toggle:T,cycle:w,isEnabled:M,showLabels:N,setEnabled:b,getMode:S,setMode:p,isProEnabled:G,getAvailableModes:a,MODE_CYCLE:c}});function Ze(e,o){let n=[],d=e.ownerDocument.createTreeWalker(e,1,{acceptNode(m){let h=m;return h.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, .ion-page-hidden")||e.ownerDocument.defaultView?.getComputedStyle(h).display==="none"?2:1}}),s=d.nextNode();for(;s;){if(!o.has(s)){let m=e.ownerDocument.defaultView?.getComputedStyle(s),h=s.getBoundingClientRect();if(m?.visibility!=="hidden"&&m?.visibility!=="collapse"&&h.width>0&&h.height>0){let f=0;for(let i=s.parentElement;i&&i!==e;i=i.parentElement)f++;n.push({instance:s,fiber:null,depth:f})}}s=d.nextNode()}return n}var et=le(()=>{"use strict";V()});import{getDOMNodeHandle as tt,isDOMElement as pe}from"@buoy-gg/shared-ui/web/utils";var Z=z((e,o)=>{"use strict";V();et();function n(){if(typeof globalThis>"u")return null;let a=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return a||null}function d(){let a=n();if(!a)return[];if(!a.getFiberRoots)return[];let b=new Set,u=a.renderers?.keys?Array.from(a.renderers.keys()):[1];for(let g of u)try{a.getFiberRoots(g)?.forEach(H=>b.add(H))}catch{}return[...b]}var s={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16,IncompleteClassComponent:17,DehydratedFragment:18,SuspenseListComponent:19,ScopeComponent:21,OffscreenComponent:22,LegacyHiddenComponent:23,CacheComponent:24,TracingMarkerComponent:25},m=new Set(["FloatingTools","FloatingDevTools","FloatingMenu","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","MinimizedToolsStack","GlitchToolButton","DefaultConfigProvider","JsModalComponent","JsModal","ModalHeader","DraggableHeader","DragIndicator","CornerHandle","WindowControls","HighlightUpdatesModal","HighlightUpdatesOverlay","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderCauseBadge","DebugBordersStandaloneOverlay","DebugBordersModal","ImageOverlayModal","ImageOverlayStandalone","StorageBrowser","StorageModal","GameUIStorageBrowser","StorageEventListener","StorageEventFilterView","NetworkMonitor","NetworkModal","NetworkRequestList","NetworkRequestDetail","RouteEventsModal","RouteEventsList","EnvSwitcher","EnvSwitcherModal","TabSelector","SectionHeader","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","ExpandablePopover","Divider","UserStatus","GripVerticalIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage"]),h=["JsModal","HighlightUpdates","RenderList","RenderDetail","DebugBorders","ImageOverlay","Storage","Network","RouteEvents","EnvSwitcher","Floating","Minimized","Expandable","DevTools","GameUI"],f=new Set(["debug-borders-overlay","floating-devtools-root","dial-devtools-root","jsmodal-root","highlight-updates-overlay","image-overlay-standalone","__rn_buoy__highlight-modal","logbox_inspector","logbox"]),i=new Map,r=500;function t(a){let b=tt(a);return b!==null?b:a?typeof a._nativeTag=="number"?a._nativeTag:typeof a.canonical?._nativeTag=="number"?a.canonical._nativeTag:typeof a.__nativeTag=="number"?a.__nativeTag:null:null}function c(a){if(!a)return false;if(f.has(a))return true;let b=a.charCodeAt(0);return!!(b===95&&(a.startsWith("__highlight_")||a.startsWith("__rn_buoy__"))||b===108&&a.startsWith("logbox"))}function y(a){if(!a)return null;let b=a.type;if(b){if(typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;if(b.displayName)return b.displayName;if(b.name)return b.name}let u=a.elementType;if(u){if(typeof u=="function")return u.displayName||u.name||null;if(u.displayName)return u.displayName;if(u.name)return u.name}return null}function l(a,b){if(pe(b)&&b.closest("[data-buoy-root]"))return true;let u=t(b);if(u!=null){let F=i.get(u);if(F!==void 0)return F}let g=false,H=a.pendingProps?.nativeID||a.memoizedProps?.nativeID;if(c(H))g=true;else{let F=a,k=0;for(;F&&k<30;){let ae=y(F);if(ae){if(m.has(ae)){g=true;break}for(let je of h)if(ae.startsWith(je)){g=true;break}if(g)break}let We=F.pendingProps?.nativeID||F.memoizedProps?.nativeID;if(c(We)){g=true;break}F=F.return,k++}}if(g&&u!=null){if(i.size>=r){let F=Array.from(i.keys());for(let k=0;k<r/2;k++)i.delete(F[k])}i.set(u,g)}return g}function p(){i.clear()}function S(a){return a.tag!==s.OffscreenComponent?false:a.memoizedState!==null}function w(a){let b=a.memoizedProps;return b?b.activityState===0:false}function C(a){return pe(a)?a.tagName.toLowerCase():a?a.canonical?.viewConfig?.uiViewClassName?a.canonical.viewConfig.uiViewClassName:a.viewConfig?.uiViewClassName?a.viewConfig.uiViewClassName:null:null}function x(a){let b=C(a);return b?b.startsWith("RNSVG"):false}function T(a,b,u=0,g=new Set){if(a&&!g.has(a)&&(g.add(a),!(u>500))){if(S(a)){a.sibling&&T(a.sibling,b,u,g);return}if(w(a)){a.sibling&&T(a.sibling,b,u,g);return}b(a,u),a.child&&T(a.child,b,u+1,g),a.sibling&&T(a.sibling,b,u,g)}}function M(){let a=d(),b=[];if(a.forEach((u,g)=>{T(u.current,(H,F)=>{if(H.tag===s.HostComponent){let k=H.stateNode;if(l(H,k)||x(k))return;k&&b.push({instance:k,fiber:H,depth:F})}})}),typeof document<"u"&&document.body){let u=new Set(b.map(({instance:g})=>g));b.push(...Ze(document.body,u))}return b}function N(){let a=n();return!(!a||!a.getFiberRoots)}function G(){let a=n();return a?{available:true,hasAgent:!!a.reactDevtoolsAgent,hasFiberRoots:typeof a.getFiberRoots=="function",rendererCount:a.renderers?.size??0,rootCount:d().length,hookKeys:Object.keys(a)}:{available:false,reason:"Hook not found on global object"}}o.exports={getReactDevToolsHook:n,getFiberRoots:d,traverseFiberTree:T,getAllHostComponentInstances:M,isReactDevToolsAvailable:N,getReactDevToolsDiagnostics:G,isHiddenOffscreen:S,isInactiveScreen:w,isSVGComponent:x,getNativeViewClassName:C,isDevToolsComponent:l,isDevToolsNativeID:c,getComponentName:y,clearDevToolsCache:p,FiberTags:s,DEV_TOOLS_COMPONENT_NAMES:m,DEV_TOOLS_NATIVE_IDS:f}});var me={};fe(me,{VIEW_TYPE_MAP:()=>_,default:()=>we,getAllComponentNames:()=>ve,getAllNativeViewTypes:()=>he,getComponentDisplayName:()=>be,getNativeViewType:()=>ye,isKnownViewType:()=>ge});function be(e){return _[e]||e}function ye(e){for(let[o,n]of Object.entries(_))if(n===e)return o;return null}function ge(e){return e in _}function he(){return Object.keys(_)}function ve(){return[...new Set(Object.values(_))]}var _,we,ot=le(()=>{"use strict";V();_={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"};we={VIEW_TYPE_MAP:_,getComponentDisplayName:be,getNativeViewType:ye,isKnownViewType:ge,getAllNativeViewTypes:he,getAllComponentNames:ve}});var Se=z((e,o)=>{"use strict";V();var{getComponentDisplayName:n}=(ot(),Je(me)),{getNativeViewClassName:d,getComponentName:s}=Z(),m={testID:{label:"test",color:"#10b981"},nativeID:{label:"native",color:"#f59e0b"},component:{label:"comp",color:"#a855f7"},accessibilityLabel:{label:"a11y",color:"#ec4899"},viewType:{label:"view",color:"#6b7280"}};function h(r,t){let c=r?.memoizedProps||r?.pendingProps||{testID:t?.getAttribute?.("data-testid"),nativeID:t?.id,accessibilityLabel:t?.getAttribute?.("aria-label"),accessibilityRole:t?.getAttribute?.("role")},y=d(t)||"Unknown",l=n(y),p=s(r),S=c.testID||c["data-testid"]||null,w=c.nativeID||null,C=c.accessibilityLabel||c.accessible?.label||c["aria-label"]||null,x=c.accessibilityRole||c.role||null,T=c.accessibilityHint||null,M=c.accessibilityState||null,N=null;if(c.style)try{N=Array.isArray(c.style)?Object.assign({},...c.style.filter(Boolean)):c.style}catch{N=null}let G=r?.tag,a=r?.key,b=null,u=r?.return;for(;u&&!(u.type&&typeof u.type=="function"&&(b=u.type.displayName||u.type.name||null,b));)u=u.return;let g={viewType:y,displayName:l,componentName:p,parentComponentName:b,testID:S,nativeID:w,accessibilityLabel:C,accessibilityRole:x,accessibilityHint:T,accessibilityState:M,fiberTag:G,fiberKey:a,styleInfo:N,primaryLabel:null,primaryType:null,primaryColor:null};return S?(g.primaryLabel=S,g.primaryType="testID",g.primaryColor=m.testID.color):C?(g.primaryLabel=C,g.primaryType="accessibilityLabel",g.primaryColor=m.accessibilityLabel.color):p?(g.primaryLabel=p,g.primaryType="component",g.primaryColor=m.component.color):w?(g.primaryLabel=w,g.primaryType="nativeID",g.primaryColor=m.nativeID.color):(g.primaryLabel=l,g.primaryType="viewType",g.primaryColor=m.viewType.color),g}function f(r,t=20){return r?r.length<=t?r:r.substring(0,t-1)+"\u2026":""}function i(r){let t=m[r];return t?t.label+":":""}o.exports={extractComponentInfo:h,getShortLabel:f,getLabelPrefix:i,IDENTIFIER_CONFIG:m}});var Ce=z((e,o)=>{"use strict";V();var n=null;try{n=qe("./DebugInfo").addLog}catch{}function d(i){return new Promise(r=>{try{let t=i;if(i.canonical&&(i.canonical.publicInstance?t=i.canonical.publicInstance:t=i.canonical),typeof t.getBoundingClientRect=="function"){let l=t.getBoundingClientRect();if(l&&typeof l.x=="number"&&typeof l.y=="number"&&typeof l.width=="number"&&typeof l.height=="number"&&l.width>=0&&l.height>=0){r({x:l.x,y:l.y,width:l.width,height:l.height});return}}let c=typeof globalThis<"u"?globalThis.nativeFabricUIManager:void 0,y=typeof t.measure=="function"?l=>t.measure(l):i.node&&typeof c?.measure=="function"?l=>c.measure(i.node,l):null;if(y){let l=setTimeout(()=>{r(null)},100);y((p,S,w,C,x,T)=>{clearTimeout(l),x!=null&&T!=null&&w!=null&&C!=null&&w>=0&&C>=0?r({x,y:T,width:w,height:C}):r(null)});return}r(null)}catch{r(null)}})}var{extractComponentInfo:s}=Se();async function m(i){return(await Promise.all(i.map(async({instance:r,fiber:t,depth:c})=>{let y=await d(r);if(y){let l=s(t,r);return{...y,depth:c,componentInfo:l}}return null}))).filter(r=>r!=null)}function h(i){return{hasFabricBoundingRect:typeof i.getBoundingClientRect=="function",hasPaperMeasure:typeof i.measure=="function",hasNode:i.node!=null}}function f(i){let r={fabric:0,paper:0,none:0};return i.forEach(({instance:t})=>{let c=h(t);c.hasFabricBoundingRect?r.fabric++:c.hasPaperMeasure?r.paper++:r.none++}),r}o.exports={measureInstance:d,measureInstances:m,getMeasurementCapabilities:h,getMeasurementStats:f}});var xe=z((e,o)=>{"use strict";V();function n(t,c,y){let l=t/360,p=c/100,S=y/100,w,C,x;if(p===0)w=C=x=S;else{let M=(a,b,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?a+(b-a)*6*u:u<.5?b:u<.6666666666666666?a+(b-a)*(.6666666666666666-u)*6:a),N=S<.5?S*(1+p):S+p-S*p,G=2*S-N;w=M(G,N,l+1/3),C=M(G,N,l),x=M(G,N,l-1/3)}let T=M=>{let N=Math.round(M*255).toString(16);return N.length===1?"0"+N:N};return`#${T(w)}${T(C)}${T(x)}`}function d(t){let c=(0+t*137.508)%360;return n(c,70,50)}function s(){let t=Math.random()*360;return n(t,70,50)}function m(t){let c=[];for(let y=0;y<t;y++)c.push(d(y));return c}var h=["#FF5733","#33FF57","#3357FF","#FF33F5","#F5FF33","#33FFF5","#FF8333","#8333FF","#33FF83","#FF3383"];function f(t){return h[t%h.length]}function i(t,c=1){let y=parseInt(t.slice(1,3),16),l=parseInt(t.slice(3,5),16),p=parseInt(t.slice(5,7),16);return`rgba(${y}, ${l}, ${p}, ${c})`}function r(t){let c=parseInt(t.slice(1,3),16),y=parseInt(t.slice(3,5),16),l=parseInt(t.slice(5,7),16);return 255<<24|c<<16|y<<8|l}o.exports={getColorForDepth:d,getRandomColor:s,generateColorPalette:m,getColorFromPalette:f,hslToHex:n,hexToRgba:i,hexToProcessColor:r,PREDEFINED_PALETTE:h}});var nt=z((e,o)=>{"use strict";V();var n={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function d(f,i){let r=n.PADDING,t=f.x-r,c=f.x+f.width+r,y=f.y-r,l=f.y+f.height+r,p=i.x-r,S=i.x+i.width+r,w=i.y-r,C=i.y+i.height+r;return!(c<p||t>S||l<w||y>C)}function s(f){return f?f.length*5+8:0}function m(f){if(!f||f.length===0)return f;let i=f.filter(y=>{let l=y.componentInfo;return l&&(l.testID||l.accessibilityLabel)}),r=f.map((y,l)=>{let p=y.componentInfo,S=p&&(p.testID||p.accessibilityLabel),w=S?p.primaryLabel:"",C=s(w);return{index:l,hasValidLabel:S,x:y.x,y:y.y-n.LABEL_HEIGHT,width:C,height:n.LABEL_HEIGHT,offsetY:0}}),t=r.map((y,l)=>l).filter(y=>r[y].hasValidLabel).sort((y,l)=>{let p=f[y],S=f[l];return Math.abs(p.y-S.y)>10?p.y-S.y:p.x-S.x}),c=[];for(let y of t){let l=r[y];if(l.width===0)continue;let p=0,S=true,w=0,C=Math.ceil(n.MAX_VERTICAL_OFFSET/n.LABEL_HEIGHT);for(;S&&w<C;){let x={x:l.x,y:l.y-p,width:l.width,height:l.height};S=c.some(T=>d(x,T)),S&&(p+=n.LABEL_HEIGHT,w++)}l.offsetY=p,c.push({x:l.x,y:l.y-p,width:l.width,height:l.height})}return f.map((y,l)=>({...y,labelOffsetY:r[l].offsetY}))}function h(f){if(!f||f.length<2)return false;for(let i=0;i<Math.min(f.length,20);i++)for(let r=i+1;r<Math.min(f.length,20);r++){let t=f[i],c=f[r];if(Math.abs(t.y-c.y)<n.LABEL_HEIGHT*2&&!(t.x+100<c.x||c.x+100<t.x))return true}return false}o.exports={resolveOverlappingLabels:m,rectsOverlap:d,estimateLabelWidth:s,mightHaveOverlaps:h,CONFIG:n}});V();V();import{useState as Te,useEffect as Ie}from"react";import{Layers as Re}from"@buoy-gg/shared-ui/web";V();import Ve,{useEffect as Ee,useState as ee,useCallback as Le}from"react";var Ne={};fe(Ne,{AccessibilityInfo:()=>lt,ActivityIndicator:()=>fo,Alert:()=>bo,Animated:()=>no,AppRegistry:()=>ct,AppState:()=>ut,Appearance:()=>st,BackHandler:()=>dt,Button:()=>po,CheckBox:()=>Vt,Clipboard:()=>ft,DeviceEventEmitter:()=>Wt,Dimensions:()=>pt,Easing:()=>mt,FlatList:()=>Et,I18nManager:()=>bt,Image:()=>Lt,ImageBackground:()=>Nt,InteractionManager:()=>gt,Keyboard:()=>yt,KeyboardAvoidingView:()=>Bt,LayoutAnimation:()=>ht,Linking:()=>vt,LogBox:()=>zt,Modal:()=>co,NativeEventEmitter:()=>wt,NativeModules:()=>it,PanResponder:()=>St,Picker:()=>Dt,PixelRatio:()=>Ct,Platform:()=>xt,Pressable:()=>lo,ProgressBar:()=>At,RefreshControl:()=>Mt,SafeAreaView:()=>Ft,ScrollView:()=>so,SectionList:()=>Pt,Share:()=>Tt,StatusBar:()=>kt,StyleSheet:()=>Y,Switch:()=>uo,Text:()=>I,TextInput:()=>ro,Touchable:()=>Ot,TouchableHighlight:()=>ao,TouchableNativeFeedback:()=>Ht,TouchableOpacity:()=>te,TouchableWithoutFeedback:()=>io,UIManager:()=>It,Vibration:()=>Rt,View:()=>D,VirtualizedList:()=>Gt,YellowBox:()=>_t,findNodeHandle:()=>mo,unstable_createElement:()=>at,useColorScheme:()=>jt,useLocaleContext:()=>$t,useWindowDimensions:()=>Kt});V();Ye(Ne,rt);import*as rt from"react-native-web";import{unstable_createElement as at,NativeModules as it,AccessibilityInfo as lt,Appearance as st,AppRegistry as ct,AppState as ut,BackHandler as dt,Clipboard as ft,Dimensions as pt,Easing as mt,I18nManager as bt,Keyboard as yt,InteractionManager as gt,LayoutAnimation as ht,Linking as vt,NativeEventEmitter as wt,PanResponder as St,PixelRatio as Ct,Platform as xt,Share as Tt,UIManager as It,Vibration as Rt,CheckBox as Vt,FlatList as Et,Image as Lt,ImageBackground as Nt,KeyboardAvoidingView as Bt,Picker as Dt,ProgressBar as At,RefreshControl as Mt,SafeAreaView as Ft,SectionList as Pt,StatusBar as kt,Touchable as Ot,TouchableNativeFeedback as Ht,VirtualizedList as Gt,YellowBox as _t,LogBox as zt,DeviceEventEmitter as Wt,useColorScheme as jt,useLocaleContext as $t,useWindowDimensions as Kt}from"react-native-web";import*as B from"react-native-web";import{createElement as ce,forwardRef as Be,useCallback as Ut,useRef as qt}from"react";V();import{useEffect as Yt,useState as Jt}from"react";import{createPortal as Xt}from"react-dom";V();var Qt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Zt}from"react/jsx-runtime";var q=Symbol.for("@buoy-gg/portal-host"),De=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let o=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return o===""||o==="true"||o==="plaintext-only"};function Ae(){let e=document;if(e[q])return e[q].host;let o=document.createElement("div");o.dataset.buoyPortalHost="",Object.assign(o.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Qt});let n=()=>{let t=document.fullscreenElement,c=t&&t.tagName!=="CANVAS"?t:document.body;o.parentElement!==c&&c.appendChild(o)},d=new Map,s=t=>{(!o.contains(t.target)||!De(t.target))&&d.set(t.code||t.key,{key:t.key,code:t.code,location:t.location,keyCode:t.keyCode,which:t.which,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})},m=t=>{d.delete(t.code||t.key)},h=()=>d.clear(),f=()=>{let t=[...d.values()];d.clear();for(let c of t)document.dispatchEvent(new KeyboardEvent("keyup",{...c,bubbles:true}))},i=t=>{De(t.target)&&t.stopPropagation()},r=t=>t.stopPropagation();return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",s,true),document.addEventListener("keyup",m,true),window.addEventListener("blur",h),o.addEventListener("focusin",f),o.addEventListener("keydown",i),o.addEventListener("keyup",i),o.addEventListener("keypress",i),o.addEventListener("wheel",r,{passive:true}),e[q]={host:o,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",s,true),document.removeEventListener("keyup",m,true),window.removeEventListener("blur",h),o.remove(),delete e[q]}},o}function eo({children:e}){let[o,n]=Jt(null);return Yt(()=>{let d=Ae(),s=document[q];return s.users++,n(d),()=>{--s.users===0&&s.dispose()}},[]),o?Xt(Zt("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),o):null}var W=B,to=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],j=e=>typeof e=="number"?`${e}px`:e;function ue(e){if(Array.isArray(e)){let c=e.map(ue);return c.some((y,l)=>y!==e[l])?c:e}if(!e||typeof e!="object"||!to.some(c=>e[c]!=null))return e;let{shadowColor:o,shadowOffset:n,shadowOpacity:d,shadowRadius:s,textShadowColor:m,textShadowOffset:h,textShadowRadius:f,...i}=e;if(o!=null||n!=null||d!=null||s!=null){let c=o??"black",y=d==null?c:`color-mix(in srgb, ${c} ${Math.min(d,1)*100}%, transparent)`,l=`${j(n?.width??0)} ${j(n?.height??0)} ${j(s??0)} ${y}`;i.boxShadow=typeof i.boxShadow=="string"?`${i.boxShadow}, ${l}`:i.boxShadow??l}let{width:r=0,height:t=0}=h??{};if(m&&(r||t||f)){let c=`${j(r)} ${j(t)} ${j(f??0)} ${m}`;i.textShadow=i.textShadow?`${i.textShadow}, ${c}`:c}return i}var oo=W.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Me(e,o){if(typeof e=="function")return d=>Me(e(d),o);let n=ue(e);return o?[n,oo[o]]:n}var Y={...W.StyleSheet,create:e=>W.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([o,n])=>[o,ue(n)])))};function P(e){let o=Be((d,s)=>{let{accessibilityState:m,accessibilityValue:h,pointerEvents:f,...i}=d;for(let t of["busy","checked","disabled","expanded","selected"])m?.[t]!==void 0&&i[`aria-${t}`]===void 0&&(i[`aria-${t}`]=m[t]);for(let[t,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))h?.[t]!==void 0&&i[`aria-${c}`]===void 0&&(i[`aria-${c}`]=h[t]);let r=Me(i.style,f);return r!==i.style&&(i.style=r),ce(e,{...i,ref:s})}),n=e.State;return n&&Object.assign(o,{State:n}),o.displayName=e.displayName??e.name??"NativeWebView",o}var D=P(B.View),I=P(B.Text),no={...W.Animated,View:W.Animated.createAnimatedComponent(D),Text:W.Animated.createAnimatedComponent(I)},ro=P(B.TextInput),te=P(B.TouchableOpacity),ao=P(B.TouchableHighlight),io=P(B.TouchableWithoutFeedback),lo=P(B.Pressable),so=P(B.ScrollView),Fe=Be((e,o)=>{let n=qt(null),d=Ut(s=>{if(s){let m=s;for(;m.parentElement&&m.parentElement!==document.body;)m=m.parentElement;m.parentElement===document.body&&(n.current=m,Object.assign(m.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Ae().appendChild(m))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof o=="function"?o(s):o&&(o.current=s)},[o]);return ce(eo,null,ce(B.Modal,{...e,ref:d}))});Fe.displayName="Modal";var co=P(Fe),uo=P(B.Switch),fo=P(B.ActivityIndicator),po=P(B.Button),mo=B.findNodeHandle,bo={alert(e,o,n,d){if(typeof document>"u")return;let s=document.createElement("dialog");s.dataset.buoyRoot="",s.setAttribute("aria-label",e),s.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 m=document.createElement("h2");if(m.textContent=e,m.style.cssText="font-size:18px;margin:0 0 12px",s.appendChild(m),o){let r=document.createElement("p");r.textContent=o,r.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",s.appendChild(r)}let h=document.createElement("div");h.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let f=n?.length?n:[{text:"OK"}],i=()=>{s.close?.(),s.remove()};for(let r of f){let t=document.createElement("button");t.type="button",t.textContent=r.text??"OK",t.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${r.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,t.onclick=()=>{i(),r.onPress?.()},h.appendChild(t)}s.addEventListener("cancel",r=>{r.preventDefault(),d?.cancelable!==false&&(i(),d?.onDismiss?.())}),s.appendChild(h),document.body.appendChild(s),s.showModal?s.showModal():s.setAttribute("open","")}};import{monoFont as J}from"@buoy-gg/shared-ui/web";import{JsModal as Pe,devToolsStorageKeys as yo}from"@buoy-gg/shared-ui/web";import{DataViewer as oe}from"@buoy-gg/shared-ui/web/dataViewer";import{loadToolModule as go}from"@buoy-gg/shared-ui/web/utils";import{Fragment as ke,jsx as v,jsxs as $}from"react/jsx-runtime";var ho=yo.debugBorders.infoModal(),vo=U(),{getAllHostComponentInstances:wo}=Z(),{measureInstances:So}=Ce(),{getColorForDepth:Co}=xe(),{getShortLabel:rn}=Se(),{resolveOverlappingLabels:xo}=nt(),X;function To(){if(X!==void 0)return X;try{X=go("@buoy-gg/core").useDevToolsVisibility??null}catch{X=null}return X??null}function L({label:e,value:o,color:n}){if(o==null)return null;let d;if(typeof o=="object")try{d=JSON.stringify(o,null,2)}catch{d=String(o)}else d=String(o);return $(D,{style:O.row,children:[v(I,{style:O.label,children:e}),v(I,{style:[O.value,n?{color:n}:null],children:d})]})}function Io({title:e}){return v(D,{style:Oe.container,children:v(I,{style:Oe.title,numberOfLines:1,children:e})})}function Ro({info:e,rect:o}){return $(D,{style:O.content,children:[v(I,{style:O.sectionTitle,children:"Identifiers"}),v(L,{label:"testID",value:e.testID,color:"#10b981"}),v(L,{label:"accessibilityLabel",value:e.accessibilityLabel,color:"#ec4899"}),v(L,{label:"nativeID",value:e.nativeID,color:"#f59e0b"}),v(L,{label:"key",value:e.fiberKey}),v(I,{style:O.sectionTitle,children:"Component"}),v(L,{label:"Component Name",value:e.componentName,color:"#a855f7"}),v(L,{label:"Parent Component",value:e.parentComponentName}),v(L,{label:"Display Name",value:e.displayName}),v(L,{label:"Native View Type",value:e.viewType}),v(L,{label:"Fiber Tag",value:e.fiberTag}),v(I,{style:O.sectionTitle,children:"Position & Size"}),v(L,{label:"X",value:Math.round(o.x)}),v(L,{label:"Y",value:Math.round(o.y)}),v(L,{label:"Width",value:Math.round(o.width)}),v(L,{label:"Height",value:Math.round(o.height)}),v(L,{label:"Depth",value:o.depth}),(e.accessibilityRole||e.accessibilityHint||e.accessibilityState)&&$(ke,{children:[v(I,{style:O.sectionTitle,children:"Accessibility"}),v(L,{label:"Role",value:e.accessibilityRole}),v(L,{label:"Hint",value:e.accessibilityHint}),e.accessibilityState&&oe?v(oe,{title:"",data:e.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(L,{label:"State",value:e.accessibilityState})]}),e.styleInfo&&$(ke,{children:[v(I,{style:O.sectionTitle,children:"Styles"}),oe?v(oe,{title:"",data:e.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(D,{style:O.codeBlock,children:v(I,{style:O.codeText,children:JSON.stringify(e.styleInfo,null,2)})})]})]})}function Vo(){let[e,o]=ee("off"),[n,d]=ee([]),[s,m]=ee(null),[h,f]=ee(false),i=Ve.useRef(false),r=To()?.()?.isDevToolsActive??false,t=Le(p=>{m(p),f(true)},[]),c=Le(()=>{f(false),m(null)},[]),y=e!=="off"&&!r,l=e==="labels"&&!r;return Ee(()=>vo.subscribe(p=>{o(p)}),[]),Ee(()=>{if(!y){d([]);return}let p=true,S,w=async()=>{if(!(!p||i.current)){i.current=true;try{let x=wo();if(x.length===0){i.current=false;return}let T=await So(x);if(p){let M=l?xo(T):T;d(M)}}catch(x){console.error("[Buoy]","[DebugBorders] Error updating measurements:",x)}finally{i.current=false}}},C=setTimeout(()=>{w()},500);return S=setInterval(w,2e3),()=>{p=false,clearTimeout(C),clearInterval(S),i.current=false}},[y,l,n.length]),y?$(D,{style:ne.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[n.map((p,S)=>{let w=p.componentInfo,C=w&&(w.testID||w.accessibilityLabel);if(l&&!C)return null;let x=l&&w?w.primaryColor:Co(p.depth);return $(Ve.Fragment,{children:[v(D,{pointerEvents:"none",style:[ne.border,{left:p.x,top:p.y,width:p.width,height:p.height,borderColor:x}]}),l&&C&&v(te,{activeOpacity:.7,onPress:()=>t(p),style:[ne.labelContainer,{left:p.x,top:p.y-10-(p.labelOffsetY||0),backgroundColor:w.primaryColor}],children:v(I,{style:ne.labelText,numberOfLines:1,children:w.primaryLabel})})]},`border-${S}`)}),Pe&&s?.componentInfo&&v(Pe,{visible:h,onClose:c,initialMode:"bottomSheet",header:{customContent:v(Io,{title:s.componentInfo.primaryLabel})},persistenceKey:ho,enablePersistence:false,children:v(Ro,{info:s.componentInfo,rect:s})})]}):null}var ne=Y.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:J,color:"#ffffff"}}),Oe=Y.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:J}}),O=Y.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:J},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:J},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:J}});import{jsx as He}from"react/jsx-runtime";var K=U(),Eo={off:"#6b7280",borders:"#10b981",labels:"#06b6d4"};function Lo({size:e}){let[o,n]=Te(()=>K.getMode());return Ie(()=>K.subscribe(d=>{n(d)}),[]),He(Re,{size:e,color:Eo[o]})}function Ge(){return null}var No={id:"debug-borders",name:"BORDERS",description:"Visual layout debugger - tap to cycle modes",slot:"row",icon:Lo,component:Ge,props:{},launchMode:"toggle-only",onPress:()=>{K.cycle()}};function Bo(e){let o={off:e?.offColor||"#6b7280",borders:e?.bordersColor||"#10b981",labels:e?.labelsColor||"#06b6d4"},n=({size:d})=>{let[s,m]=Te(()=>K.getMode());return Ie(()=>K.subscribe(h=>{m(h)}),[]),He(Re,{size:d,color:o[s]})};return{id:e?.id||"debug-borders",name:e?.name||"BORDERS",description:e?.description||"Visual layout debugger - tap to cycle modes",slot:"row",icon:n,component:Ge,props:{},launchMode:"toggle-only",onPress:()=>{K.cycle()}}}V();V();var Do=["off","borders","labels"];function Ao(e){if(!Do.includes(e))throw new Error(`Unknown mode "${String(e)}". Use off, borders or labels.`);return e}var re=U(),Mo={version:1,getSnapshot:()=>({mode:re.getMode()}),subscribe:e=>re.subscribe(e),actions:{cycleMode:()=>{re.cycle()},setMode:e=>{re.setMode(Ao(e?.mode))}}};V();V();import{useEffect as _e,useState as ze}from"react";import{night as R,Layers as Fo,StatusBadge as Po,StatusIndicator as ko}from"@buoy-gg/shared-ui/web";import{jsx as A,jsxs as Q}from"react/jsx-runtime";var de=U();function Oo({visible:e,onClose:o}){let[n,d]=ze(false),[s,m]=ze(0);_e(()=>{let f=de.subscribe(d);return d(de.isEnabled()),f},[]),_e(()=>{if(!n){m(0);return}let f=()=>{try{let{getAllHostComponentInstances:r}=Z(),t=r();m(t.length)}catch(r){console.error("[Buoy]","[DebugBorders] Error getting component count:",r)}};setTimeout(f,600);let i=setInterval(f,2e3);return()=>clearInterval(i)},[n]);let h=()=>{de.toggle()};return e?A(D,{style:E.container,children:Q(D,{style:E.content,children:[A(I,{style:E.title,children:"Debug Borders"}),A(I,{style:E.description,children:"Visualize component layout structure with colored borders"}),Q(D,{style:E.statusRow,children:[A(I,{style:E.statusLabel,children:"Status:"}),A(Po,{status:n?"active":"inactive"})]}),n&&s>0&&Q(D,{style:E.statsRow,children:[A(I,{style:E.statsLabel,children:"Components Tracked:"}),A(I,{style:E.statsValue,children:s})]}),A(D,{style:E.toggleContainer,children:Q(te,{style:[E.button,n&&E.buttonActive],onPress:h,accessibilityRole:"button",accessibilityLabel:`Debug borders ${n?"enabled":"disabled"}`,accessibilityHint:"Tap to toggle debug borders",children:[A(Fo,{size:40,color:n?R.color.accent:R.color.textSecondary}),A(I,{style:[E.buttonText,n&&E.buttonTextActive],children:n?"Disable Borders":"Enable Borders"})]})}),Q(D,{style:E.infoBox,children:[A(ko,{status:n?"success":"info",size:"small"}),A(I,{style:E.infoText,children:n?"Borders update every 2 seconds. Tap button to disable.":"Tap button to show colored borders around all components."})]}),A(te,{style:E.closeButton,onPress:o,children:A(I,{style:E.closeButtonText,children:"Close"})})]})}):null}var E=Y.create({container:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},content:{backgroundColor:R.color.surface,borderWidth:1,borderColor:R.color.border,borderRadius:16,padding:32,width:"85%",maxWidth:420,alignItems:"center"},title:{fontSize:24,fontWeight:"700",color:R.color.text,marginBottom:8},description:{fontSize:14,color:R.color.textSecondary,textAlign:"center",marginBottom:24},statusRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statusLabel:{fontSize:14,color:R.color.textSecondary,fontWeight:"600"},statsRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statsLabel:{fontSize:14,color:R.color.textSecondary,fontWeight:"600"},statsValue:{fontSize:16,color:R.color.text,fontWeight:"700"},toggleContainer:{alignItems:"center",justifyContent:"center",marginBottom:24},button:{alignItems:"center",justifyContent:"center",padding:24,borderRadius:16,backgroundColor:R.color.surfaceElevated,borderWidth:2,borderColor:R.color.border,minWidth:200},buttonActive:{borderColor:R.color.accentBorderStrong,backgroundColor:R.color.accentSoft},buttonText:{marginTop:12,fontSize:16,fontWeight:"600",color:R.color.textSecondary},buttonTextActive:{color:R.color.accent},infoBox:{flexDirection:"row",alignItems:"flex-start",backgroundColor:R.color.surfaceElevated,padding:12,borderRadius:8,marginBottom:24,gap:8},infoText:{flex:1,fontSize:12,color:R.color.textSecondary,lineHeight:16},closeButton:{paddingVertical:12,paddingHorizontal:32,backgroundColor:R.color.accent,borderRadius:8},closeButtonText:{color:R.color.onAccent,fontSize:16,fontWeight:"600"}});var Ho=U(),Go=Z(),_o=Ce(),zo=xe();export{Ho as DebugBordersManager,Oo as DebugBordersModal,Vo as DebugBordersStandaloneOverlay,zo as colorGeneration,_o as componentMeasurement,Bo as createDebugBordersTool,Mo as debugBordersSyncAdapter,No as debugBordersToolPreset,Go as fiberTreeTraversal};
1
+ "use client";var ie=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var qe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,n)=>(typeof require<"u"?require:o)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var le=(e,o)=>()=>(e&&(o=e(e=0)),o);var z=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),fe=(e,o)=>{for(var n in o)ie(e,n,{get:o[n],enumerable:true})},se=(e,o,n,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of Ke(o))!Ue.call(e,l)&&l!==n&&ie(e,l,{get:()=>o[l],enumerable:!(d=$e(o,l))||d.enumerable});return e},Ye=(e,o,n)=>(se(e,o,"default"),n&&se(n,o,"default"));var Je=e=>se(ie({},"__esModule",{value:true}),e);var Xe,V=le(()=>{"use strict";Xe=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis)});import{loadToolModule as Qe}from"@buoy-gg/shared-ui/web/utils";var U=z((e,o)=>{"use strict";V();var n="off",d=new Set,l=["off","borders","labels"],f=["off","borders"],y=null,C=false;function r(){if(!C){C=true;try{let c=Qe("@buoy-gg/license");c&&typeof c.isPro=="function"&&(y=c.isPro)}catch{y=null}}}function i(){if(r(),y)try{return y()}catch{return false}return false}function t(){return i()?l:f}var s=l;function h(c){return d.add(c),c(n),()=>{d.delete(c)}}function u(){d.forEach(c=>{try{c(n)}catch(m){console.error("[DebugBorders] Error in listener:",m)}})}function g(c){return n===c?true:c==="labels"&&!i()?(console.warn("[DebugBorders] Labels mode requires React Buoy Pro. Upgrade at https://buoy.gg/pro"),false):(n=c,u(),true)}function p(){return n}function w(){let c=t(),m=c.indexOf(n);if(m===-1){g("off");return}let H=(m+1)%c.length;g(c[H])}function S(){g("borders")}function T(){g("off")}function x(){w()}function D(){return n!=="off"}function N(){return n==="labels"&&i()}function G(){return i()}function a(){return t()}function b(c){c?S():T()}o.exports={subscribe:h,enable:S,disable:T,toggle:x,cycle:w,isEnabled:D,showLabels:N,setEnabled:b,getMode:p,setMode:g,isProEnabled:G,getAvailableModes:a,MODE_CYCLE:s}});function Ze(e,o){let n=[],d=e.ownerDocument.createTreeWalker(e,1,{acceptNode(f){let y=f;return y.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, .ion-page-hidden")||e.ownerDocument.defaultView?.getComputedStyle(y).display==="none"?2:1}}),l=d.nextNode();for(;l;){if(!o.has(l)){let f=e.ownerDocument.defaultView?.getComputedStyle(l),y=l.getBoundingClientRect();if(f?.visibility!=="hidden"&&f?.visibility!=="collapse"&&y.width>0&&y.height>0){let C=0;for(let r=l.parentElement;r&&r!==e;r=r.parentElement)C++;n.push({instance:l,fiber:null,depth:C})}}l=d.nextNode()}return n}var et=le(()=>{"use strict";V()});import{getDOMNodeHandle as tt,isDOMElement as pe}from"@buoy-gg/shared-ui/web/utils";var Z=z((e,o)=>{"use strict";V();et();function n(){if(typeof globalThis>"u")return null;let a=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return a||null}function d(){let a=n();if(!a)return[];if(!a.getFiberRoots)return[];let b=new Set,c=a.renderers?.keys?Array.from(a.renderers.keys()):[1];for(let m of c)try{a.getFiberRoots(m)?.forEach(H=>b.add(H))}catch{}return[...b]}var l={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16,IncompleteClassComponent:17,DehydratedFragment:18,SuspenseListComponent:19,ScopeComponent:21,OffscreenComponent:22,LegacyHiddenComponent:23,CacheComponent:24,TracingMarkerComponent:25},f=new Set(["FloatingTools","FloatingDevTools","FloatingMenu","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","MinimizedToolsStack","GlitchToolButton","DefaultConfigProvider","JsModalComponent","JsModal","ModalHeader","DraggableHeader","DragIndicator","CornerHandle","WindowControls","HighlightUpdatesModal","HighlightUpdatesOverlay","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderCauseBadge","DebugBordersStandaloneOverlay","DebugBordersModal","ImageOverlayModal","ImageOverlayStandalone","StorageBrowser","StorageModal","GameUIStorageBrowser","StorageEventListener","StorageEventFilterView","NetworkMonitor","NetworkModal","NetworkRequestList","NetworkRequestDetail","RouteEventsModal","RouteEventsList","EnvSwitcher","EnvSwitcherModal","TabSelector","SectionHeader","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","ExpandablePopover","Divider","UserStatus","GripVerticalIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage"]),y=["JsModal","HighlightUpdates","RenderList","RenderDetail","DebugBorders","ImageOverlay","Storage","Network","RouteEvents","EnvSwitcher","Floating","Minimized","Expandable","DevTools","GameUI"],C=new Set(["debug-borders-overlay","floating-devtools-root","dial-devtools-root","jsmodal-root","highlight-updates-overlay","image-overlay-standalone","__rn_buoy__highlight-modal","logbox_inspector","logbox"]),r=new Map,i=500;function t(a){let b=tt(a);return b!==null?b:a?typeof a._nativeTag=="number"?a._nativeTag:typeof a.canonical?._nativeTag=="number"?a.canonical._nativeTag:typeof a.__nativeTag=="number"?a.__nativeTag:null:null}function s(a){if(!a)return false;if(C.has(a))return true;let b=a.charCodeAt(0);return!!(b===95&&(a.startsWith("__highlight_")||a.startsWith("__rn_buoy__"))||b===108&&a.startsWith("logbox"))}function h(a){if(!a)return null;let b=a.type;if(b){if(typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;if(b.displayName)return b.displayName;if(b.name)return b.name}let c=a.elementType;if(c){if(typeof c=="function")return c.displayName||c.name||null;if(c.displayName)return c.displayName;if(c.name)return c.name}return null}function u(a,b){if(pe(b)&&b.closest("[data-buoy-root]"))return true;let c=t(b);if(c!=null){let F=r.get(c);if(F!==void 0)return F}let m=false,H=a.pendingProps?.nativeID||a.memoizedProps?.nativeID;if(s(H))m=true;else{let F=a,k=0;for(;F&&k<30;){let ae=h(F);if(ae){if(f.has(ae)){m=true;break}for(let je of y)if(ae.startsWith(je)){m=true;break}if(m)break}let We=F.pendingProps?.nativeID||F.memoizedProps?.nativeID;if(s(We)){m=true;break}F=F.return,k++}}if(m&&c!=null){if(r.size>=i){let F=Array.from(r.keys());for(let k=0;k<i/2;k++)r.delete(F[k])}r.set(c,m)}return m}function g(){r.clear()}function p(a){return a.tag!==l.OffscreenComponent?false:a.memoizedState!==null}function w(a){let b=a.memoizedProps;return b?b.activityState===0:false}function S(a){return pe(a)?a.tagName.toLowerCase():a?a.canonical?.viewConfig?.uiViewClassName?a.canonical.viewConfig.uiViewClassName:a.viewConfig?.uiViewClassName?a.viewConfig.uiViewClassName:null:null}function T(a){let b=S(a);return b?b.startsWith("RNSVG"):false}function x(a,b,c=0,m=new Set){if(a&&!m.has(a)&&(m.add(a),!(c>500))){if(p(a)){a.sibling&&x(a.sibling,b,c,m);return}if(w(a)){a.sibling&&x(a.sibling,b,c,m);return}b(a,c),a.child&&x(a.child,b,c+1,m),a.sibling&&x(a.sibling,b,c,m)}}function D(){let a=d(),b=[];if(a.forEach((c,m)=>{x(c.current,(H,F)=>{if(H.tag===l.HostComponent){let k=H.stateNode;if(u(H,k)||T(k))return;k&&b.push({instance:k,fiber:H,depth:F})}})}),typeof document<"u"&&document.body){let c=new Set(b.map(({instance:m})=>m));b.push(...Ze(document.body,c))}return b}function N(){let a=n();return!(!a||!a.getFiberRoots)}function G(){let a=n();return a?{available:true,hasAgent:!!a.reactDevtoolsAgent,hasFiberRoots:typeof a.getFiberRoots=="function",rendererCount:a.renderers?.size??0,rootCount:d().length,hookKeys:Object.keys(a)}:{available:false,reason:"Hook not found on global object"}}o.exports={getReactDevToolsHook:n,getFiberRoots:d,traverseFiberTree:x,getAllHostComponentInstances:D,isReactDevToolsAvailable:N,getReactDevToolsDiagnostics:G,isHiddenOffscreen:p,isInactiveScreen:w,isSVGComponent:T,getNativeViewClassName:S,isDevToolsComponent:u,isDevToolsNativeID:s,getComponentName:h,clearDevToolsCache:g,FiberTags:l,DEV_TOOLS_COMPONENT_NAMES:f,DEV_TOOLS_NATIVE_IDS:C}});var be={};fe(be,{VIEW_TYPE_MAP:()=>_,default:()=>we,getAllComponentNames:()=>ve,getAllNativeViewTypes:()=>he,getComponentDisplayName:()=>ge,getNativeViewType:()=>me,isKnownViewType:()=>ye});function ge(e){return _[e]||e}function me(e){for(let[o,n]of Object.entries(_))if(n===e)return o;return null}function ye(e){return e in _}function he(){return Object.keys(_)}function ve(){return[...new Set(Object.values(_))]}var _,we,ot=le(()=>{"use strict";V();_={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"};we={VIEW_TYPE_MAP:_,getComponentDisplayName:ge,getNativeViewType:me,isKnownViewType:ye,getAllNativeViewTypes:he,getAllComponentNames:ve}});var Se=z((e,o)=>{"use strict";V();var{getComponentDisplayName:n}=(ot(),Je(be)),{getNativeViewClassName:d,getComponentName:l}=Z(),f={testID:{label:"test",color:"#10b981"},nativeID:{label:"native",color:"#f59e0b"},component:{label:"comp",color:"#a855f7"},accessibilityLabel:{label:"a11y",color:"#ec4899"},viewType:{label:"view",color:"#6b7280"}};function y(i,t){let s=i?.memoizedProps||i?.pendingProps||{testID:t?.getAttribute?.("data-testid"),nativeID:t?.id,accessibilityLabel:t?.getAttribute?.("aria-label"),accessibilityRole:t?.getAttribute?.("role")},h=d(t)||"Unknown",u=n(h),g=l(i),p=s.testID||s["data-testid"]||null,w=s.nativeID||null,S=s.accessibilityLabel||s.accessible?.label||s["aria-label"]||null,T=s.accessibilityRole||s.role||null,x=s.accessibilityHint||null,D=s.accessibilityState||null,N=null;if(s.style)try{N=Array.isArray(s.style)?Object.assign({},...s.style.filter(Boolean)):s.style}catch{N=null}let G=i?.tag,a=i?.key,b=null,c=i?.return;for(;c&&!(c.type&&typeof c.type=="function"&&(b=c.type.displayName||c.type.name||null,b));)c=c.return;let m={viewType:h,displayName:u,componentName:g,parentComponentName:b,testID:p,nativeID:w,accessibilityLabel:S,accessibilityRole:T,accessibilityHint:x,accessibilityState:D,fiberTag:G,fiberKey:a,styleInfo:N,primaryLabel:null,primaryType:null,primaryColor:null};return p?(m.primaryLabel=p,m.primaryType="testID",m.primaryColor=f.testID.color):S?(m.primaryLabel=S,m.primaryType="accessibilityLabel",m.primaryColor=f.accessibilityLabel.color):g?(m.primaryLabel=g,m.primaryType="component",m.primaryColor=f.component.color):w?(m.primaryLabel=w,m.primaryType="nativeID",m.primaryColor=f.nativeID.color):(m.primaryLabel=u,m.primaryType="viewType",m.primaryColor=f.viewType.color),m}function C(i,t=20){return i?i.length<=t?i:i.substring(0,t-1)+"\u2026":""}function r(i){let t=f[i];return t?t.label+":":""}o.exports={extractComponentInfo:y,getShortLabel:C,getLabelPrefix:r,IDENTIFIER_CONFIG:f}});var Ce=z((e,o)=>{"use strict";V();var n=null;try{n=qe("./DebugInfo").addLog}catch{}function d(r){return new Promise(i=>{try{let t=r;if(r.canonical&&(r.canonical.publicInstance?t=r.canonical.publicInstance:t=r.canonical),typeof t.getBoundingClientRect=="function"){let u=t.getBoundingClientRect();if(u&&typeof u.x=="number"&&typeof u.y=="number"&&typeof u.width=="number"&&typeof u.height=="number"&&u.width>=0&&u.height>=0){i({x:u.x,y:u.y,width:u.width,height:u.height});return}}let s=typeof globalThis<"u"?globalThis.nativeFabricUIManager:void 0,h=typeof t.measure=="function"?u=>t.measure(u):r.node&&typeof s?.measure=="function"?u=>s.measure(r.node,u):null;if(h){let u=setTimeout(()=>{i(null)},100);h((g,p,w,S,T,x)=>{clearTimeout(u),T!=null&&x!=null&&w!=null&&S!=null&&w>=0&&S>=0?i({x:T,y:x,width:w,height:S}):i(null)});return}i(null)}catch{i(null)}})}var{extractComponentInfo:l}=Se();async function f(r){return(await Promise.all(r.map(async({instance:i,fiber:t,depth:s})=>{let h=await d(i);if(h){let u=l(t,i);return{...h,depth:s,componentInfo:u}}return null}))).filter(i=>i!=null)}function y(r){return{hasFabricBoundingRect:typeof r.getBoundingClientRect=="function",hasPaperMeasure:typeof r.measure=="function",hasNode:r.node!=null}}function C(r){let i={fabric:0,paper:0,none:0};return r.forEach(({instance:t})=>{let s=y(t);s.hasFabricBoundingRect?i.fabric++:s.hasPaperMeasure?i.paper++:i.none++}),i}o.exports={measureInstance:d,measureInstances:f,getMeasurementCapabilities:y,getMeasurementStats:C}});var xe=z((e,o)=>{"use strict";V();function n(t,s,h){let u=t/360,g=s/100,p=h/100,w,S,T;if(g===0)w=S=T=p;else{let D=(a,b,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<.16666666666666666?a+(b-a)*6*c:c<.5?b:c<.6666666666666666?a+(b-a)*(.6666666666666666-c)*6:a),N=p<.5?p*(1+g):p+g-p*g,G=2*p-N;w=D(G,N,u+1/3),S=D(G,N,u),T=D(G,N,u-1/3)}let x=D=>{let N=Math.round(D*255).toString(16);return N.length===1?"0"+N:N};return`#${x(w)}${x(S)}${x(T)}`}function d(t){let s=(0+t*137.508)%360;return n(s,70,50)}function l(){let t=Math.random()*360;return n(t,70,50)}function f(t){let s=[];for(let h=0;h<t;h++)s.push(d(h));return s}var y=["#FF5733","#33FF57","#3357FF","#FF33F5","#F5FF33","#33FFF5","#FF8333","#8333FF","#33FF83","#FF3383"];function C(t){return y[t%y.length]}function r(t,s=1){let h=parseInt(t.slice(1,3),16),u=parseInt(t.slice(3,5),16),g=parseInt(t.slice(5,7),16);return`rgba(${h}, ${u}, ${g}, ${s})`}function i(t){let s=parseInt(t.slice(1,3),16),h=parseInt(t.slice(3,5),16),u=parseInt(t.slice(5,7),16);return 255<<24|s<<16|h<<8|u}o.exports={getColorForDepth:d,getRandomColor:l,generateColorPalette:f,getColorFromPalette:C,hslToHex:n,hexToRgba:r,hexToProcessColor:i,PREDEFINED_PALETTE:y}});var nt=z((e,o)=>{"use strict";V();var n={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function d(r,i){let t=n.PADDING,s=r.x-t,h=r.x+r.width+t,u=r.y-t,g=r.y+r.height+t,p=i.x-t,w=i.x+i.width+t,S=i.y-t,T=i.y+i.height+t;return!(h<p||s>w||g<S||u>T)}function l(r){return r?r.length*5+8:0}function f(r){if(!r||r.length===0)return r;let i=r.filter(u=>{let g=u.componentInfo;return g&&(g.testID||g.accessibilityLabel)}),t=r.map((u,g)=>{let p=u.componentInfo,w=p&&(p.testID||p.accessibilityLabel),S=w?p.primaryLabel:"",T=l(S);return{index:g,hasValidLabel:w,x:u.x,y:u.y-n.LABEL_HEIGHT,width:T,height:n.LABEL_HEIGHT,offsetY:0}}),s=t.map((u,g)=>g).filter(u=>t[u].hasValidLabel).sort((u,g)=>{let p=r[u],w=r[g];return Math.abs(p.y-w.y)>10?p.y-w.y:p.x-w.x}),h=[];for(let u of s){let g=t[u];if(g.width===0)continue;let p=0,w=true,S=0,T=Math.ceil(n.MAX_VERTICAL_OFFSET/n.LABEL_HEIGHT);for(;w&&S<T;){let x={x:g.x,y:g.y-p,width:g.width,height:g.height};w=h.some(D=>d(x,D)),w&&(p+=n.LABEL_HEIGHT,S++)}g.offsetY=p,h.push({x:g.x,y:g.y-p,width:g.width,height:g.height})}return r.map((u,g)=>({...u,labelOffsetY:t[g].offsetY}))}function y(r,i){return i?f(r):r}function C(r){if(!r||r.length<2)return false;for(let i=0;i<Math.min(r.length,20);i++)for(let t=i+1;t<Math.min(r.length,20);t++){let s=r[i],h=r[t];if(Math.abs(s.y-h.y)<n.LABEL_HEIGHT*2&&!(s.x+100<h.x||h.x+100<s.x))return true}return false}o.exports={resolveOverlappingLabels:f,rectanglesForMode:y,rectsOverlap:d,estimateLabelWidth:l,mightHaveOverlaps:C,CONFIG:n}});V();V();import{useState as Te,useEffect as Re}from"react";import{Layers as Ie}from"@buoy-gg/shared-ui/web";V();import Ve,{useEffect as Ee,useState as ee,useCallback as Le,useMemo as rt}from"react";var Ne={};fe(Ne,{AccessibilityInfo:()=>st,ActivityIndicator:()=>po,Alert:()=>mo,Animated:()=>ro,AppRegistry:()=>ut,AppState:()=>dt,Appearance:()=>ct,BackHandler:()=>ft,Button:()=>bo,CheckBox:()=>Et,Clipboard:()=>pt,DeviceEventEmitter:()=>jt,Dimensions:()=>bt,Easing:()=>gt,FlatList:()=>Lt,I18nManager:()=>mt,Image:()=>Nt,ImageBackground:()=>Dt,InteractionManager:()=>ht,Keyboard:()=>yt,KeyboardAvoidingView:()=>Mt,LayoutAnimation:()=>vt,Linking:()=>wt,LogBox:()=>Wt,Modal:()=>uo,NativeEventEmitter:()=>St,NativeModules:()=>lt,PanResponder:()=>Ct,Picker:()=>Bt,PixelRatio:()=>xt,Platform:()=>Tt,Pressable:()=>so,ProgressBar:()=>At,RefreshControl:()=>Ft,SafeAreaView:()=>Pt,ScrollView:()=>co,SectionList:()=>kt,Share:()=>Rt,StatusBar:()=>Ot,StyleSheet:()=>Y,Switch:()=>fo,Text:()=>R,TextInput:()=>ao,Touchable:()=>Ht,TouchableHighlight:()=>io,TouchableNativeFeedback:()=>Gt,TouchableOpacity:()=>te,TouchableWithoutFeedback:()=>lo,UIManager:()=>It,Vibration:()=>Vt,View:()=>B,VirtualizedList:()=>_t,YellowBox:()=>zt,findNodeHandle:()=>go,unstable_createElement:()=>it,useColorScheme:()=>$t,useLocaleContext:()=>Kt,useWindowDimensions:()=>Ut});V();Ye(Ne,at);import*as at from"react-native-web";import{unstable_createElement as it,NativeModules as lt,AccessibilityInfo as st,Appearance as ct,AppRegistry as ut,AppState as dt,BackHandler as ft,Clipboard as pt,Dimensions as bt,Easing as gt,I18nManager as mt,Keyboard as yt,InteractionManager as ht,LayoutAnimation as vt,Linking as wt,NativeEventEmitter as St,PanResponder as Ct,PixelRatio as xt,Platform as Tt,Share as Rt,UIManager as It,Vibration as Vt,CheckBox as Et,FlatList as Lt,Image as Nt,ImageBackground as Dt,KeyboardAvoidingView as Mt,Picker as Bt,ProgressBar as At,RefreshControl as Ft,SafeAreaView as Pt,SectionList as kt,StatusBar as Ot,Touchable as Ht,TouchableNativeFeedback as Gt,VirtualizedList as _t,YellowBox as zt,LogBox as Wt,DeviceEventEmitter as jt,useColorScheme as $t,useLocaleContext as Kt,useWindowDimensions as Ut}from"react-native-web";import*as M from"react-native-web";import{createElement as ce,forwardRef as De,useCallback as qt,useRef as Yt}from"react";V();import{useEffect as Jt,useState as Xt}from"react";import{createPortal as Qt}from"react-dom";V();var Zt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as eo}from"react/jsx-runtime";var q=Symbol.for("@buoy-gg/portal-host"),Me=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let o=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return o===""||o==="true"||o==="plaintext-only"};function Be(){let e=document;if(e[q])return e[q].host;let o=document.createElement("div");o.dataset.buoyPortalHost="",Object.assign(o.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Zt});let n=()=>{let t=document.fullscreenElement,s=t&&t.tagName!=="CANVAS"?t:document.body;o.parentElement!==s&&s.appendChild(o)},d=new Map,l=t=>{(!o.contains(t.target)||!Me(t.target))&&d.set(t.code||t.key,{key:t.key,code:t.code,location:t.location,keyCode:t.keyCode,which:t.which,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})},f=t=>{d.delete(t.code||t.key)},y=()=>d.clear(),C=()=>{let t=[...d.values()];d.clear();for(let s of t)document.dispatchEvent(new KeyboardEvent("keyup",{...s,bubbles:true}))},r=t=>{Me(t.target)&&t.stopPropagation()},i=t=>t.stopPropagation();return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",l,true),document.addEventListener("keyup",f,true),window.addEventListener("blur",y),o.addEventListener("focusin",C),o.addEventListener("keydown",r),o.addEventListener("keyup",r),o.addEventListener("keypress",r),o.addEventListener("wheel",i,{passive:true}),e[q]={host:o,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",l,true),document.removeEventListener("keyup",f,true),window.removeEventListener("blur",y),o.remove(),delete e[q]}},o}function to({children:e}){let[o,n]=Xt(null);return Jt(()=>{let d=Be(),l=document[q];return l.users++,n(d),()=>{--l.users===0&&l.dispose()}},[]),o?Qt(eo("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),o):null}var W=M,oo=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],j=e=>typeof e=="number"?`${e}px`:e;function ue(e){if(Array.isArray(e)){let s=e.map(ue);return s.some((h,u)=>h!==e[u])?s:e}if(!e||typeof e!="object"||!oo.some(s=>e[s]!=null))return e;let{shadowColor:o,shadowOffset:n,shadowOpacity:d,shadowRadius:l,textShadowColor:f,textShadowOffset:y,textShadowRadius:C,...r}=e;if(o!=null||n!=null||d!=null||l!=null){let s=o??"black",h=d==null?s:`color-mix(in srgb, ${s} ${Math.min(d,1)*100}%, transparent)`,u=`${j(n?.width??0)} ${j(n?.height??0)} ${j(l??0)} ${h}`;r.boxShadow=typeof r.boxShadow=="string"?`${r.boxShadow}, ${u}`:r.boxShadow??u}let{width:i=0,height:t=0}=y??{};if(f&&(i||t||C)){let s=`${j(i)} ${j(t)} ${j(C??0)} ${f}`;r.textShadow=r.textShadow?`${r.textShadow}, ${s}`:s}return r}var no=W.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Ae(e,o){if(typeof e=="function")return d=>Ae(e(d),o);let n=ue(e);return o?[n,no[o]]:n}var Y={...W.StyleSheet,create:e=>W.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([o,n])=>[o,ue(n)])))};function P(e){let o=De((d,l)=>{let{accessibilityState:f,accessibilityValue:y,pointerEvents:C,...r}=d;for(let t of["busy","checked","disabled","expanded","selected"])f?.[t]!==void 0&&r[`aria-${t}`]===void 0&&(r[`aria-${t}`]=f[t]);for(let[t,s]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))y?.[t]!==void 0&&r[`aria-${s}`]===void 0&&(r[`aria-${s}`]=y[t]);let i=Ae(r.style,C);return i!==r.style&&(r.style=i),ce(e,{...r,ref:l})}),n=e.State;return n&&Object.assign(o,{State:n}),o.displayName=e.displayName??e.name??"NativeWebView",o}var B=P(M.View),R=P(M.Text),ro={...W.Animated,View:W.Animated.createAnimatedComponent(B),Text:W.Animated.createAnimatedComponent(R)},ao=P(M.TextInput),te=P(M.TouchableOpacity),io=P(M.TouchableHighlight),lo=P(M.TouchableWithoutFeedback),so=P(M.Pressable),co=P(M.ScrollView),Fe=De((e,o)=>{let n=Yt(null),d=qt(l=>{if(l){let f=l;for(;f.parentElement&&f.parentElement!==document.body;)f=f.parentElement;f.parentElement===document.body&&(n.current=f,Object.assign(f.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Be().appendChild(f))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof o=="function"?o(l):o&&(o.current=l)},[o]);return ce(to,null,ce(M.Modal,{...e,ref:d}))});Fe.displayName="Modal";var uo=P(Fe),fo=P(M.Switch),po=P(M.ActivityIndicator),bo=P(M.Button),go=M.findNodeHandle,mo={alert(e,o,n,d){if(typeof document>"u")return;let l=document.createElement("dialog");l.dataset.buoyRoot="",l.setAttribute("aria-label",e),l.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 f=document.createElement("h2");if(f.textContent=e,f.style.cssText="font-size:18px;margin:0 0 12px",l.appendChild(f),o){let i=document.createElement("p");i.textContent=o,i.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",l.appendChild(i)}let y=document.createElement("div");y.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let C=n?.length?n:[{text:"OK"}],r=()=>{l.close?.(),l.remove()};for(let i of C){let t=document.createElement("button");t.type="button",t.textContent=i.text??"OK",t.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${i.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,t.onclick=()=>{r(),i.onPress?.()},y.appendChild(t)}l.addEventListener("cancel",i=>{i.preventDefault(),d?.cancelable!==false&&(r(),d?.onDismiss?.())}),l.appendChild(y),document.body.appendChild(l),l.showModal?l.showModal():l.setAttribute("open","")}};import{monoFont as J}from"@buoy-gg/shared-ui/web";import{JsModal as Pe,devToolsStorageKeys as yo}from"@buoy-gg/shared-ui/web";import{DataViewer as oe}from"@buoy-gg/shared-ui/web/dataViewer";import{loadToolModule as ho}from"@buoy-gg/shared-ui/web/utils";import{Fragment as ke,jsx as v,jsxs as $}from"react/jsx-runtime";var vo=yo.debugBorders.infoModal(),wo=U(),{getAllHostComponentInstances:So}=Z(),{measureInstances:Co}=Ce(),{getColorForDepth:xo}=xe(),{getShortLabel:an}=Se(),{rectanglesForMode:To}=nt(),X;function Ro(){if(X!==void 0)return X;try{X=ho("@buoy-gg/core").useDevToolsVisibility??null}catch{X=null}return X??null}function L({label:e,value:o,color:n}){if(o==null)return null;let d;if(typeof o=="object")try{d=JSON.stringify(o,null,2)}catch{d=String(o)}else d=String(o);return $(B,{style:O.row,children:[v(R,{style:O.label,children:e}),v(R,{style:[O.value,n?{color:n}:null],children:d})]})}function Io({title:e}){return v(B,{style:Oe.container,children:v(R,{style:Oe.title,numberOfLines:1,children:e})})}function Vo({info:e,rect:o}){return $(B,{style:O.content,children:[v(R,{style:O.sectionTitle,children:"Identifiers"}),v(L,{label:"testID",value:e.testID,color:"#10b981"}),v(L,{label:"accessibilityLabel",value:e.accessibilityLabel,color:"#ec4899"}),v(L,{label:"nativeID",value:e.nativeID,color:"#f59e0b"}),v(L,{label:"key",value:e.fiberKey}),v(R,{style:O.sectionTitle,children:"Component"}),v(L,{label:"Component Name",value:e.componentName,color:"#a855f7"}),v(L,{label:"Parent Component",value:e.parentComponentName}),v(L,{label:"Display Name",value:e.displayName}),v(L,{label:"Native View Type",value:e.viewType}),v(L,{label:"Fiber Tag",value:e.fiberTag}),v(R,{style:O.sectionTitle,children:"Position & Size"}),v(L,{label:"X",value:Math.round(o.x)}),v(L,{label:"Y",value:Math.round(o.y)}),v(L,{label:"Width",value:Math.round(o.width)}),v(L,{label:"Height",value:Math.round(o.height)}),v(L,{label:"Depth",value:o.depth}),(e.accessibilityRole||e.accessibilityHint||e.accessibilityState)&&$(ke,{children:[v(R,{style:O.sectionTitle,children:"Accessibility"}),v(L,{label:"Role",value:e.accessibilityRole}),v(L,{label:"Hint",value:e.accessibilityHint}),e.accessibilityState&&oe?v(oe,{title:"",data:e.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(L,{label:"State",value:e.accessibilityState})]}),e.styleInfo&&$(ke,{children:[v(R,{style:O.sectionTitle,children:"Styles"}),oe?v(oe,{title:"",data:e.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(B,{style:O.codeBlock,children:v(R,{style:O.codeText,children:JSON.stringify(e.styleInfo,null,2)})})]})]})}function Eo(){let[e,o]=ee("off"),[n,d]=ee([]),[l,f]=ee(null),[y,C]=ee(false),r=Ve.useRef(false),i=Ro()?.()?.isDevToolsActive??false,t=Le(p=>{f(p),C(true)},[]),s=Le(()=>{C(false),f(null)},[]),h=e!=="off"&&!i,u=e==="labels"&&!i;Ee(()=>wo.subscribe(p=>{o(p)}),[]),Ee(()=>{if(!h){d([]);return}let p=true,w,S=async()=>{if(!(!p||r.current)){r.current=true;try{let x=So();if(x.length===0){r.current=false;return}let D=await Co(x);p&&d(D)}catch(x){console.error("[Buoy]","[DebugBorders] Error updating measurements:",x)}finally{r.current=false}}},T=setTimeout(()=>{S()},n.length?500:0);return w=setInterval(S,2e3),()=>{p=false,clearTimeout(T),clearInterval(w),r.current=false}},[h,n.length]);let g=rt(()=>To(n,u),[n,u]);return h?$(B,{style:ne.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[g.map((p,w)=>{let S=p.componentInfo,T=S&&(S.testID||S.accessibilityLabel);if(u&&!T)return null;let x=u&&S?S.primaryColor:xo(p.depth);return $(Ve.Fragment,{children:[v(B,{pointerEvents:"none",style:[ne.border,{left:p.x,top:p.y,width:p.width,height:p.height,borderColor:x}]}),u&&T&&v(te,{activeOpacity:.7,onPress:()=>t(p),style:[ne.labelContainer,{left:p.x,top:p.y-10-(p.labelOffsetY||0),backgroundColor:S.primaryColor}],children:v(R,{style:ne.labelText,numberOfLines:1,children:S.primaryLabel})})]},`border-${w}`)}),Pe&&l?.componentInfo&&v(Pe,{visible:y,onClose:s,initialMode:"bottomSheet",header:{customContent:v(Io,{title:l.componentInfo.primaryLabel})},persistenceKey:vo,enablePersistence:false,children:v(Vo,{info:l.componentInfo,rect:l})})]}):null}var ne=Y.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:J,color:"#ffffff"}}),Oe=Y.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:J}}),O=Y.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:J},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:J},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:J}});import{jsx as He}from"react/jsx-runtime";var K=U(),Lo={off:"#6b7280",borders:"#10b981",labels:"#06b6d4"};function No({size:e}){let[o,n]=Te(()=>K.getMode());return Re(()=>K.subscribe(d=>{n(d)}),[]),He(Ie,{size:e,color:Lo[o]})}function Ge(){return null}var Do={id:"debug-borders",name:"BORDERS",description:"Visual layout debugger - tap to cycle modes",slot:"row",icon:No,component:Ge,props:{},launchMode:"toggle-only",onPress:()=>{K.cycle()}};function Mo(e){let o={off:e?.offColor||"#6b7280",borders:e?.bordersColor||"#10b981",labels:e?.labelsColor||"#06b6d4"},n=({size:d})=>{let[l,f]=Te(()=>K.getMode());return Re(()=>K.subscribe(y=>{f(y)}),[]),He(Ie,{size:d,color:o[l]})};return{id:e?.id||"debug-borders",name:e?.name||"BORDERS",description:e?.description||"Visual layout debugger - tap to cycle modes",slot:"row",icon:n,component:Ge,props:{},launchMode:"toggle-only",onPress:()=>{K.cycle()}}}V();V();var Bo=["off","borders","labels"];function Ao(e){if(!Bo.includes(e))throw new Error(`Unknown mode "${String(e)}". Use off, borders or labels.`);return e}var re=U(),Fo={version:1,getSnapshot:()=>({mode:re.getMode()}),subscribe:e=>re.subscribe(e),actions:{cycleMode:()=>{re.cycle()},setMode:e=>{re.setMode(Ao(e?.mode))}}};V();V();import{useEffect as _e,useState as ze}from"react";import{night as I,Layers as Po,StatusBadge as ko,StatusIndicator as Oo}from"@buoy-gg/shared-ui/web";import{jsx as A,jsxs as Q}from"react/jsx-runtime";var de=U();function Ho({visible:e,onClose:o}){let[n,d]=ze(false),[l,f]=ze(0);_e(()=>{let C=de.subscribe(d);return d(de.isEnabled()),C},[]),_e(()=>{if(!n){f(0);return}let C=()=>{try{let{getAllHostComponentInstances:i}=Z(),t=i();f(t.length)}catch(i){console.error("[Buoy]","[DebugBorders] Error getting component count:",i)}};setTimeout(C,600);let r=setInterval(C,2e3);return()=>clearInterval(r)},[n]);let y=()=>{de.toggle()};return e?A(B,{style:E.container,children:Q(B,{style:E.content,children:[A(R,{style:E.title,children:"Debug Borders"}),A(R,{style:E.description,children:"Visualize component layout structure with colored borders"}),Q(B,{style:E.statusRow,children:[A(R,{style:E.statusLabel,children:"Status:"}),A(ko,{status:n?"active":"inactive"})]}),n&&l>0&&Q(B,{style:E.statsRow,children:[A(R,{style:E.statsLabel,children:"Components Tracked:"}),A(R,{style:E.statsValue,children:l})]}),A(B,{style:E.toggleContainer,children:Q(te,{style:[E.button,n&&E.buttonActive],onPress:y,accessibilityRole:"button",accessibilityLabel:`Debug borders ${n?"enabled":"disabled"}`,accessibilityHint:"Tap to toggle debug borders",children:[A(Po,{size:40,color:n?I.color.accent:I.color.textSecondary}),A(R,{style:[E.buttonText,n&&E.buttonTextActive],children:n?"Disable Borders":"Enable Borders"})]})}),Q(B,{style:E.infoBox,children:[A(Oo,{status:n?"success":"info",size:"small"}),A(R,{style:E.infoText,children:n?"Borders update every 2 seconds. Tap button to disable.":"Tap button to show colored borders around all components."})]}),A(te,{style:E.closeButton,onPress:o,children:A(R,{style:E.closeButtonText,children:"Close"})})]})}):null}var E=Y.create({container:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},content:{backgroundColor:I.color.surface,borderWidth:1,borderColor:I.color.border,borderRadius:16,padding:32,width:"85%",maxWidth:420,alignItems:"center"},title:{fontSize:24,fontWeight:"700",color:I.color.text,marginBottom:8},description:{fontSize:14,color:I.color.textSecondary,textAlign:"center",marginBottom:24},statusRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statusLabel:{fontSize:14,color:I.color.textSecondary,fontWeight:"600"},statsRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statsLabel:{fontSize:14,color:I.color.textSecondary,fontWeight:"600"},statsValue:{fontSize:16,color:I.color.text,fontWeight:"700"},toggleContainer:{alignItems:"center",justifyContent:"center",marginBottom:24},button:{alignItems:"center",justifyContent:"center",padding:24,borderRadius:16,backgroundColor:I.color.surfaceElevated,borderWidth:2,borderColor:I.color.border,minWidth:200},buttonActive:{borderColor:I.color.accentBorderStrong,backgroundColor:I.color.accentSoft},buttonText:{marginTop:12,fontSize:16,fontWeight:"600",color:I.color.textSecondary},buttonTextActive:{color:I.color.accent},infoBox:{flexDirection:"row",alignItems:"flex-start",backgroundColor:I.color.surfaceElevated,padding:12,borderRadius:8,marginBottom:24,gap:8},infoText:{flex:1,fontSize:12,color:I.color.textSecondary,lineHeight:16},closeButton:{paddingVertical:12,paddingHorizontal:32,backgroundColor:I.color.accent,borderRadius:8},closeButtonText:{color:I.color.onAccent,fontSize:16,fontWeight:"600"}});var Go=U(),_o=Z(),zo=Ce(),Wo=xe();export{Go as DebugBordersManager,Ho as DebugBordersModal,Eo as DebugBordersStandaloneOverlay,Wo as colorGeneration,zo as componentMeasurement,Mo as createDebugBordersTool,Fo as debugBordersSyncAdapter,Do as debugBordersToolPreset,_o as fiberTreeTraversal};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/debug-borders",
3
- "version": "7.0.77",
3
+ "version": "7.0.79",
4
4
  "description": "Layout debugging borders for React Native — depth-colored, touch-through, tap any label to inspect testIDs & styles. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -34,18 +34,18 @@
34
34
  ],
35
35
  "sideEffects": false,
36
36
  "dependencies": {
37
- "@buoy-gg/shared-ui": "^7.0.77",
38
- "@buoy-gg/core": "^7.0.77"
37
+ "@buoy-gg/core": "^7.0.79",
38
+ "@buoy-gg/shared-ui": "^7.0.79"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": "*",
42
- "@buoy-gg/license": "7.0.77"
42
+ "@buoy-gg/license": "7.0.79"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/react": "^19.1.0",
46
46
  "@types/react-native": "^0.73.0",
47
47
  "typescript": "~5.8.3",
48
- "@buoy-gg/license": "^7.0.77"
48
+ "@buoy-gg/license": "^7.0.79"
49
49
  },
50
50
  "react-native-builder-bob": {
51
51
  "source": "src",