@buoy-gg/network 7.0.76 → 7.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/network/components/NetworkCopySettingsView.js +1 -1
- package/lib/commonjs/network/components/NetworkEventDetailView.js +1 -1
- package/lib/commonjs/network/components/NetworkListScreen.js +1 -1
- package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -1
- package/lib/module/network/components/NetworkCopySettingsView.js +3 -3
- package/lib/module/network/components/NetworkEventDetailView.js +2 -2
- package/lib/module/network/components/NetworkListScreen.js +1 -1
- package/lib/module/network/components/NetworkSavedScreen.js +1 -1
- package/lib/web/index.mjs +4 -4
- package/package.json +2 -2
|
@@ -24,4 +24,4 @@ ${JSON.stringify(w||{},null,2)}
|
|
|
24
24
|
## Response Body
|
|
25
25
|
\`\`\`json
|
|
26
26
|
${JSON.stringify(w||{},null,2)}
|
|
27
|
-
\`\`\``)}return p.join("\n")});const i=e.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.markdownText,selectable:S,children:i||"No data included"})})}const O=d.map((e,i)=>{const r=[];r.push(`Request ${i+1}:`);if(u){r.push(`${e.method} ${e.url}`)}if(n){r.push(`Status: ${e.status}`);r.push(`Duration: ${e.duration}ms`)}if(y){r.push(`Timestamp: ${e.timestamp}`)}if(h){const m="requestBody"in e?e.requestBody:e.requestData;r.push("\nRequest:");r.push(JSON.stringify(m||{},null,2))}if(q){const m="responseBody"in e?e.responseBody:e.responseData;r.push("\nResponse:");r.push(JSON.stringify(m||{},null,2))}return r.join("\n")});const o=O.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.plaintextText,selectable:S,children:o||"No data included"})})},[s,c,a,f,S]);const L=(0,_react.useCallback)(()=>{const d=c?a:[f];const t=d.length;return(0,_jsxRuntime.jsx)(_sharedUi.ExportPreview,{expanded:E,onExpandedChange:_,summary:`${t} request${t!==1?"s":""} \u2022 ~${formatBytes(b)}`,warningLevel:F,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},renderBody:P})},[s,c,a,f,E,b,F,P]);const I=(0,_react.useCallback)(()=>{const d=c&&j?`Live data \u2022 Updated ${(0,_sharedUi.formatRelativeTime)(j,B)}`:"Mock data (no events captured)";return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statusLabel,children:d}),(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:A()})]})},[c,j,B,A]);const z=(0,_react.useCallback)(()=>{return L()},[L]);const J=(0,_react.useMemo)(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::urls",label:"URLs",icon:_sharedUi.Link,color:_sharedUi.macOSColors.semantic.info,value:"urls",isActive:R==="urls"},{id:"preset::llm",label:"LLM",icon:_sharedUi.Zap,color:_sharedUi.macOSColors.semantic.success,value:"llm",isActive:R==="llm"},{id:"preset::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:R==="json"},{id:"preset::full",label:"Full",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"full",isActive:R==="full"},{id:"preset::custom",label:"Custom",icon:_sharedUi.Settings,color:_sharedUi.macOSColors.text.secondary,value:"custom",isActive:R===null}]},{id:"include",title:"Include",type:"custom",data:[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:s.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:s.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:s.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:s.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:s.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:s.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:s.includeErrors}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"markdown",isActive:s.format==="markdown"},{id:"format::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:s.format==="json"},{id:"format::plaintext",label:"Text",icon:_sharedUi.Hash,color:_sharedUi.macOSColors.text.secondary,value:"plaintext",isActive:s.format==="plaintext"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_sharedUi.Eye,content:z,headerActions:I},onFilterChange:N}),[s,N,z,I,R]);if(!S){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.gatedContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.ProFeatureBanner,{featureName:"Network Export",description:"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.gatedPreview,children:(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})})]})}return(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})}const styles=_reactNative.StyleSheet.create({previewScroll:{maxHeight:300},markdownText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},plaintextText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.macOSColors.text.muted,marginRight:8},gatedContainer:{flex:1,padding:12},gatedPreview:{flex:1}});
|
|
27
|
+
\`\`\``)}return p.join("\n")});const i=e.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.markdownText,selectable:S,children:i||"No data included"})})}const O=d.map((e,i)=>{const r=[];r.push(`Request ${i+1}:`);if(u){r.push(`${e.method} ${e.url}`)}if(n){r.push(`Status: ${e.status}`);r.push(`Duration: ${e.duration}ms`)}if(y){r.push(`Timestamp: ${e.timestamp}`)}if(h){const m="requestBody"in e?e.requestBody:e.requestData;r.push("\nRequest:");r.push(JSON.stringify(m||{},null,2))}if(q){const m="responseBody"in e?e.responseBody:e.responseData;r.push("\nResponse:");r.push(JSON.stringify(m||{},null,2))}return r.join("\n")});const o=O.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.plaintextText,selectable:S,children:o||"No data included"})})},[s,c,a,f,S]);const L=(0,_react.useCallback)(()=>{const d=c?a:[f];const t=d.length;return(0,_jsxRuntime.jsx)(_sharedUi.ExportPreview,{expanded:E,onExpandedChange:_,summary:`${t} request${t!==1?"s":""} \u2022 ~${formatBytes(b)}`,warningLevel:F,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},renderBody:P})},[s,c,a,f,E,b,F,P]);const I=(0,_react.useCallback)(()=>{const d=c&&j?`Live data \u2022 Updated ${(0,_sharedUi.formatRelativeTime)(j,B)}`:"Mock data (no events captured)";return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statusLabel,children:d}),(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:A()})]})},[c,j,B,A]);const z=(0,_react.useCallback)(()=>{return L()},[L]);const J=(0,_react.useMemo)(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::urls",label:"URLs",icon:_sharedUi.Link,color:_sharedUi.macOSColors.semantic.info,value:"urls",isActive:R==="urls"},{id:"preset::llm",label:"LLM",icon:_sharedUi.Zap,color:_sharedUi.macOSColors.semantic.success,value:"llm",isActive:R==="llm"},{id:"preset::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:R==="json"},{id:"preset::full",label:"Full",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"full",isActive:R==="full"},{id:"preset::custom",label:"Custom",icon:_sharedUi.Settings,color:_sharedUi.macOSColors.text.secondary,value:"custom",isActive:R===null}]},{id:"include",title:"Include",type:"custom",data:[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:s.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:s.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:s.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:s.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:s.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:s.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:s.includeErrors}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"markdown",isActive:s.format==="markdown"},{id:"format::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:s.format==="json"},{id:"format::plaintext",label:"Text",icon:_sharedUi.Hash,color:_sharedUi.macOSColors.text.secondary,value:"plaintext",isActive:s.format==="plaintext"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_sharedUi.Eye,content:z,headerActions:I},onFilterChange:N}),[s,N,z,I,R]);if(!S){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.gatedContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.ProFeatureBanner,{featureName:"Network Export",description:"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.gatedPreview,children:(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})})]})}return(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})}const styles=_reactNative.StyleSheet.create({previewScroll:{maxHeight:300},markdownText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},plaintextText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.macOSColors.text.muted,marginRight:8},gatedContainer:{flex:1,padding:12},gatedPreview:{flex:1}});
|
|
@@ -32,4 +32,4 @@ ${JSON.stringify(t.responseHeaders,null,2)}
|
|
|
32
32
|
\`\`\`json
|
|
33
33
|
${JSON.stringify(t.responseData,null,2)}
|
|
34
34
|
\`\`\`
|
|
35
|
-
`};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{testID:"buoy-network-detail-scroll",style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.requestDetailsSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.httpMethodBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpMethod,children:e.method})}),e.status?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.httpStatusBadge,{backgroundColor:`${n?.color}20`}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.httpStatusText,{color:n?.color}],children:[n?.text," ",n?.meaning]})}):w?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pendingBadgeText,children:"Pending"})]}):null,e.condition&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:{color:"#FFCC66"},children:["Conditions: ",e.condition.profile," (+",e.condition.delayMs," ms)"]}),e.duration?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpDuration,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpDurationText,children:(0,_formatting.formatDuration)(e.duration)})]}):null,e.override?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overrideBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,s?(0,_jsxRuntime.jsx)(_sharedUi.InlineCopyButton,{value:D,buttonStyle:styles.copyFullButton}):(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.copyFullButton,onPress:()=>c(true),activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:_sharedUi.night.color.textSecondary})})]}),(0,_jsxRuntime.jsx)(UrlBreakdown,{url:e.url,requestData:g,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient,isPro:s,onUpgradePress:()=>c(true)}),e.error?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBox,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:e.error})]}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingLabel,children:"Started:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingValue,children:(0,_sharedUi.formatRelativeTime)(e.timestamp)}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeRow,children:[e.requestSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:10,color:_sharedUi.night.color.info}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Sent:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.requestSize)})]}):null,e.responseSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:10,color:NEUTRAL_ICON}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Received:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.responseSize)})]}):null]}):null]}),e.timings?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseDivider}),(0,_jsxRuntime.jsx)(TimingPhases,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:14,color:_sharedUi.night.color.info}),defaultOpen:false,count:Object.keys(m).length,children:Object.keys(m).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:m,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No request headers"})}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:14,color:NEUTRAL_ICON}),defaultOpen:false,count:Object.keys(C).length,children:Object.keys(C).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:C,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No response headers yet"})}),g!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):j?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading request body (${(0,_formatting.formatBytes)(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,f!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:f,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):d?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading response body (${(0,_formatting.formatBytes)(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Filter Options",icon:(0,_jsxRuntime.jsx)(_sharedUi.Filter,{size:14,color:_sharedUi.night.color.warning}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterOptionsContainer,children:(()=>{let t="";let h="";try{const V=new URL(e.url);t=V.hostname;h=V.pathname}catch{h=e.url}const T=l.has(t);const S=l.has(h);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,T&&styles.filterOptionActive],onPress:()=>t&&a(t),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Globe,{size:16,color:T?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore Domain"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,children:t||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,T&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,T&&styles.filterToggleTextActive],children:T?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,S&&styles.filterOptionActive],onPress:()=>h&&a(h),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Link,{size:16,color:S?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore URL Pattern"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,numberOfLines:1,children:h||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,S&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,S&&styles.filterToggleTextActive],children:S?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterInfoBox,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),(0,_jsxRuntime.jsx)(_sharedUi.UpgradeModal,{visible:r,onClose:()=>c(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})});const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:_sharedUi.night.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:_sharedUi.night.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:_sharedUi.night.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:_sharedUi.night.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.warningSoft},overrideBadgeText:{color:_sharedUi.night.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:_sharedUi.night.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:_sharedUi.night.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:_sharedUi.night.color.textSecondary,fontSize:11,fontFamily:_sharedUi.monoFont},urlQueryString:{color:_sharedUi.night.color.info,fontSize:11,fontFamily:_sharedUi.monoFont},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11},timingValue:{color:_sharedUi.night.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:_sharedUi.night.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:_sharedUi.night.color.textTertiary,fontSize:10},sizeValue:{color:_sharedUi.night.color.info,fontSize:10,fontFamily:_sharedUi.monoFont,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:_sharedUi.night.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:_sharedUi.night.color.textSecondary},phaseHint:{fontSize:10,color:_sharedUi.night.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:_sharedUi.monoFont,color:_sharedUi.night.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:_sharedUi.night.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:_sharedUi.night.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:_sharedUi.night.color.textTertiary,fontSize:11.5,fontFamily:_sharedUi.monoFont},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:_sharedUi.night.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:_sharedUi.night.color.danger,fontSize:11,flex:1},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:_sharedUi.night.color.border},filterOptionActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:_sharedUi.night.color.text,fontSize:13,fontFamily:_sharedUi.monoFont},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:_sharedUi.night.color.bg,borderWidth:1,borderColor:_sharedUi.night.color.border},filterToggleActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:_sharedUi.night.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:_sharedUi.night.color.warning},filterInfoBox:{backgroundColor:_sharedUi.night.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:_sharedUi.night.color.info+"33"},filterInfoText:{color:_sharedUi.night.color.textSecondary,fontSize:11,lineHeight:16}});
|
|
35
|
+
`};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-detail-scroll",style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.requestDetailsSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.httpMethodBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpMethod,children:e.method})}),e.status?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.httpStatusBadge,{backgroundColor:`${n?.color}20`}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.httpStatusText,{color:n?.color}],children:[n?.text," ",n?.meaning]})}):w?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pendingBadgeText,children:"Pending"})]}):null,e.condition&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:{color:"#FFCC66"},children:["Conditions: ",e.condition.profile," (+",e.condition.delayMs," ms)"]}),e.duration?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpDuration,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpDurationText,children:(0,_formatting.formatDuration)(e.duration)})]}):null,e.override?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overrideBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,s?(0,_jsxRuntime.jsx)(_sharedUi.InlineCopyButton,{value:D,buttonStyle:styles.copyFullButton}):(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.copyFullButton,onPress:()=>c(true),activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:_sharedUi.night.color.textSecondary})})]}),(0,_jsxRuntime.jsx)(UrlBreakdown,{url:e.url,requestData:g,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient,isPro:s,onUpgradePress:()=>c(true)}),e.error?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBox,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:e.error})]}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingLabel,children:"Started:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingValue,children:(0,_sharedUi.formatRelativeTime)(e.timestamp)}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeRow,children:[e.requestSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:10,color:_sharedUi.night.color.info}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Sent:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.requestSize)})]}):null,e.responseSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:10,color:NEUTRAL_ICON}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Received:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.responseSize)})]}):null]}):null]}),e.timings?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseDivider}),(0,_jsxRuntime.jsx)(TimingPhases,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:14,color:_sharedUi.night.color.info}),defaultOpen:false,count:Object.keys(m).length,children:Object.keys(m).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:m,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No request headers"})}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:14,color:NEUTRAL_ICON}),defaultOpen:false,count:Object.keys(C).length,children:Object.keys(C).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:C,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No response headers yet"})}),g!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):j?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading request body (${(0,_formatting.formatBytes)(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,f!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:f,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):d?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading response body (${(0,_formatting.formatBytes)(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Filter Options",icon:(0,_jsxRuntime.jsx)(_sharedUi.Filter,{size:14,color:_sharedUi.night.color.warning}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterOptionsContainer,children:(()=>{let t="";let h="";try{const V=new URL(e.url);t=V.hostname;h=V.pathname}catch{h=e.url}const T=l.has(t);const S=l.has(h);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,T&&styles.filterOptionActive],onPress:()=>t&&a(t),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Globe,{size:16,color:T?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore Domain"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,children:t||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,T&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,T&&styles.filterToggleTextActive],children:T?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,S&&styles.filterOptionActive],onPress:()=>h&&a(h),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Link,{size:16,color:S?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore URL Pattern"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,numberOfLines:1,children:h||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,S&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,S&&styles.filterToggleTextActive],children:S?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterInfoBox,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),(0,_jsxRuntime.jsx)(_sharedUi.UpgradeModal,{visible:r,onClose:()=>c(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})});const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:_sharedUi.night.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:_sharedUi.night.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:_sharedUi.night.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:_sharedUi.night.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.warningSoft},overrideBadgeText:{color:_sharedUi.night.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:_sharedUi.night.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:_sharedUi.night.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:_sharedUi.night.color.textSecondary,fontSize:11,fontFamily:_sharedUi.monoFont},urlQueryString:{color:_sharedUi.night.color.info,fontSize:11,fontFamily:_sharedUi.monoFont},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11},timingValue:{color:_sharedUi.night.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:_sharedUi.night.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:_sharedUi.night.color.textTertiary,fontSize:10},sizeValue:{color:_sharedUi.night.color.info,fontSize:10,fontFamily:_sharedUi.monoFont,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:_sharedUi.night.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:_sharedUi.night.color.textSecondary},phaseHint:{fontSize:10,color:_sharedUi.night.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:_sharedUi.monoFont,color:_sharedUi.night.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:_sharedUi.night.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:_sharedUi.night.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:_sharedUi.night.color.textTertiary,fontSize:11.5,fontFamily:_sharedUi.monoFont},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:_sharedUi.night.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:_sharedUi.night.color.danger,fontSize:11,flex:1},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:_sharedUi.night.color.border},filterOptionActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:_sharedUi.night.color.text,fontSize:13,fontFamily:_sharedUi.monoFont},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:_sharedUi.night.color.bg,borderWidth:1,borderColor:_sharedUi.night.color.border},filterToggleActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:_sharedUi.night.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:_sharedUi.night.color.warning},filterInfoBox:{backgroundColor:_sharedUi.night.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:_sharedUi.night.color.info+"33"},filterInfoText:{color:_sharedUi.night.color.textSecondary,fontSize:11,lineHeight:16}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkListScreen=NetworkListScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _useNetworkEventList=require("../hooks/useNetworkEventList");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _useOverrideRules=require("../hooks/useOverrideRules");var _overriddenRows=require("../overrides/overriddenRows");var _withPinnedFirst=require("../utils/withPinnedFirst");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=r=>r.id;function PinnedSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,onClearPinned:t}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:11,active:true,color:_sharedUi.macOSColors.semantic.info}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.pinnedTitle,children:["PINNED \xB7 ",r.length]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore unpin all",style:styles.pinnedClear,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pinnedClearText,children:"Unpin all"})})]}),r.map(n=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:n,onPress:i,onLongPress:s,pinned:true,saved:a.has(n.id)},n.id))]})}function OverriddenSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,paused:t,onTogglePaused:n}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.overriddenSection,t&&styles.overriddenSectionOff],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overriddenHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:11,color:t?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-network-overridden-strip",style:[styles.overriddenTitle,t&&styles.overriddenTitleOff],children:t?`PAUSED \xB7 ${r.length}`:`OVERRIDDEN \xB7 ${r.length}`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:n,"sentry-label":"ignore pause overrides",style:styles.overriddenManage,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.overriddenManageText,t&&styles.overriddenTitleOff],children:t?"Resume":"Pause"})})]}),r.map(o=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:o,onPress:i,onLongPress:s,overridden:true,saved:a.has(o.id)},o.id))]})}function NetworkListScreen({visible:r,paused:i,filter:s,ignoredPatterns:a,isPro:t,searchText:n,onEventPress:o,onUpgradePress:k}){const{visibleEvents:b,hasLockedEvents:v,lockedEventCount:l,totalEvents:C}=(0,_useNetworkEventList.useNetworkEventList)({filter:s,ignoredPatterns:a,paused:i,visible:r,isPro:t});const{pinnedEvents:y,pinnedLiveIds:E,savedLiveIds:d,togglePin:p,clearPinned:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkListScreen=NetworkListScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _useNetworkEventList=require("../hooks/useNetworkEventList");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _useOverrideRules=require("../hooks/useOverrideRules");var _overriddenRows=require("../overrides/overriddenRows");var _withPinnedFirst=require("../utils/withPinnedFirst");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=r=>r.id;function PinnedSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,onClearPinned:t}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:11,active:true,color:_sharedUi.macOSColors.semantic.info}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.pinnedTitle,children:["PINNED \xB7 ",r.length]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore unpin all",style:styles.pinnedClear,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pinnedClearText,children:"Unpin all"})})]}),r.map(n=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:n,onPress:i,onLongPress:s,pinned:true,saved:a.has(n.id)},n.id))]})}function OverriddenSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,paused:t,onTogglePaused:n}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.overriddenSection,t&&styles.overriddenSectionOff],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overriddenHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:11,color:t?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-network-overridden-strip",style:[styles.overriddenTitle,t&&styles.overriddenTitleOff],children:t?`PAUSED \xB7 ${r.length}`:`OVERRIDDEN \xB7 ${r.length}`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:n,"sentry-label":"ignore pause overrides",style:styles.overriddenManage,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.overriddenManageText,t&&styles.overriddenTitleOff],children:t?"Resume":"Pause"})})]}),r.map(o=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:o,onPress:i,onLongPress:s,overridden:true,saved:a.has(o.id)},o.id))]})}function NetworkListScreen({visible:r,paused:i,filter:s,ignoredPatterns:a,isPro:t,searchText:n,onEventPress:o,onUpgradePress:k}){const{visibleEvents:b,hasLockedEvents:v,lockedEventCount:l,totalEvents:C}=(0,_useNetworkEventList.useNetworkEventList)({filter:s,ignoredPatterns:a,paused:i,visible:r,isPro:t});const{pinnedEvents:y,pinnedLiveIds:E,savedLiveIds:d,togglePin:p,clearPinned:T}=(0,_useNetworkSaved.useNetworkSaved)();const{rules:O,enabled:h,setEnabled:P,isRuleSpent:j}=(0,_useOverrideRules.useOverrideRules)();const c=(0,_react.useCallback)(e=>{p(e)},[p]);if(!r)return null;const{pinned:x,rest:u}=(0,_withPinnedFirst.splitPinned)(b,y,E);const N=O.filter(e=>e.enabled&&!j(e));const g=(0,_overriddenRows.overriddenEvents)([...x,...u],N);const m=new Set(g.map(e=>e.id));const w=x.filter(e=>!m.has(e.id));const S=m.size?u.filter(e=>!m.has(e.id)):u;const f=!i;const I=({item:e})=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:e,onPress:o,onLongPress:c,saved:d.has(e.id)});const L=()=>{if(w.length>0||g.length>0)return null;return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-network-empty",...(0,_sharedUi.resolveListEmptyState)({subject:"requests",search:n,total:C,capturing:f,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})})};const q=()=>{if(!v)return null;const e=n.length>0;const B=e?`${l} matching ${l===1?"request":"requests"} in locked history`:`${l} requests locked`;const R=e?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history";return(0,_jsxRuntime.jsx)(_NetworkUpgradeBanner.NetworkUpgradeBanner,{title:B,subtitle:R,onPress:k})};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.root,children:[!f?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Network interception is disabled"})]}):null,(0,_jsxRuntime.jsx)(OverriddenSection,{events:g,onEventPress:o,onLongPress:c,savedLiveIds:d,paused:!h,onTogglePaused:()=>P(!h)}),(0,_jsxRuntime.jsx)(PinnedSection,{events:w,onEventPress:o,onLongPress:c,savedLiveIds:d,onClearPinned:T}),S.length>0||v?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-list",data:S,renderItem:I,keyExtractor,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,..._sharedUi.EVENT_LIST_PRESET,extraData:d,"sentry-label":"ignore network events list",ListFooterComponent:q}):L()]})}const styles=_reactNative.StyleSheet.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.semantic.warning+"44",backgroundColor:_sharedUi.macOSColors.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:_sharedUi.macOSColors.border.default,backgroundColor:_sharedUi.macOSColors.background.card},overriddenTitleOff:{color:_sharedUi.macOSColors.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:_sharedUi.macOSColors.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:_sharedUi.macOSColors.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:_sharedUi.macOSColors.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:_sharedUi.monoFont},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:_sharedUi.macOSColors.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:_sharedUi.macOSColors.semantic.warning+"20"},disabledText:{color:_sharedUi.macOSColors.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkSavedScreen=NetworkSavedScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _generateNetworkCopyText=require("../utils/generateNetworkCopyText");var _selectSavedEvents=require("../utils/selectSavedEvents");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _networkSavedStore=require("../utils/networkSavedStore");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=l=>l.id;function NetworkSavedScreen({visible:l,isPro:u,copySettings:v,search:n,onSearchChange:i,onEventPress:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkSavedScreen=NetworkSavedScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _generateNetworkCopyText=require("../utils/generateNetworkCopyText");var _selectSavedEvents=require("../utils/selectSavedEvents");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _networkSavedStore=require("../utils/networkSavedStore");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=l=>l.id;function NetworkSavedScreen({visible:l,isPro:u,copySettings:v,search:n,onSearchChange:i,onEventPress:p,onUpgradePress:g}){const{savedRecords:e,pinnedLiveIds:c,toggleSave:S,clearSaved:h}=(0,_useNetworkSaved.useNetworkSaved)();const t=(0,_sharedUi.useLimit)("network.saved");const[m,x]=(0,_react.useState)("");const d=n!=null&&i!=null;const r=d?n:m;const b=d?i:x;if(!l)return null;const{events:o,lockedCount:a}=(0,_selectSavedEvents.selectSavedEvents)(e,t,r);const C=s=>{S(s)};const y=({item:s})=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:s,onPress:p,onLongPress:C,saved:true,pinned:c.has(s.id)});const k=()=>{if(a===0)return null;return(0,_jsxRuntime.jsx)(_NetworkUpgradeBanner.NetworkUpgradeBanner,{title:`${a} saved ${a===1?"request":"requests"} locked`,subtitle:`Your plan keeps ${t}. Upgrade to Pro to unlock the rest.`,onPress:g})};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.root,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.toolbar,children:[(0,_jsxRuntime.jsx)(_sharedUi.Bookmark,{size:11,color:_sharedUi.macOSColors.semantic.debug}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.toolbarTitle,children:["SAVED \xB7 ",e.length,t>=_networkSavedStore.MAX_SAVED?"":`/${t}`]}),u?(0,_jsxRuntime.jsx)(_sharedUi.CopyButton,{value:()=>(0,_generateNetworkCopyText.generateNetworkCopyText)(o,v),size:13,buttonStyle:styles.toolbarButton,colors:{idle:_sharedUi.macOSColors.text.secondary,success:_sharedUi.macOSColors.semantic.success,error:_sharedUi.macOSColors.semantic.error},disabled:o.length===0}):null,(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:h,"sentry-label":"ignore clear saved",style:styles.toolbarClear,disabled:e.length===0,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.toolbarClearText,e.length===0&&styles.toolbarClearTextDisabled],children:"Clear all"})})]}),e.length>0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.searchRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:13,color:_sharedUi.macOSColors.text.secondary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.searchInput,placeholder:"Search saved requests\u2026",placeholderTextColor:_sharedUi.macOSColors.text.muted,value:r,onChangeText:b,"sentry-label":"ignore saved search",accessibilityLabel:"Search saved requests",autoCapitalize:"none",autoCorrect:false,returnKeyType:"search"})]}):null,e.length===0||r.trim().length>0&&o.length===0&&a===0?(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-network-saved-empty",...(0,_sharedUi.resolveListEmptyState)({subject:"saved requests",verb:"kept",search:e.length===0?"":r,total:e.length,waiting:{otto:"empty",title:"No saved requests",message:"Open a request and tap the bookmark to keep it here \u2014 saved requests survive Clear and app restarts."}})}):(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",data:o,renderItem:y,keyExtractor,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:true,scrollEnabled:true,..._sharedUi.EVENT_LIST_PRESET,extraData:c,"sentry-label":"ignore saved requests list",ListFooterComponent:k})]})}const styles=_reactNative.StyleSheet.create({root:{flex:1,minHeight:0},toolbar:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},toolbarTitle:{flex:1,color:_sharedUi.macOSColors.semantic.debug,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:_sharedUi.monoFont},toolbarButton:{width:26,height:26,borderRadius:6,alignItems:"center",justifyContent:"center"},toolbarClear:{paddingHorizontal:6,paddingVertical:2},toolbarClearText:{color:_sharedUi.macOSColors.text.muted,fontSize:10},toolbarClearTextDisabled:{color:_sharedUi.macOSColors.text.disabled},searchRow:{flexDirection:"row",alignItems:"center",gap:6,marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5,backgroundColor:_sharedUi.macOSColors.background.input,borderRadius:10,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default},searchInput:{flex:1,color:_sharedUi.macOSColors.text.primary,fontSize:13,paddingVertical:2},listContent:{paddingTop:4}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";import{DynamicFilterView as X,macOSColors as y,FileText as Y,FileCode as Q,Link as se,Zap as
|
|
1
|
+
"use strict";import{DynamicFilterView as X,macOSColors as y,FileText as Y,FileCode as Q,Link as se,Zap as oe,Settings as te,Hash as ie,Eye as ue,ToolbarCopyButton as ne,formatRelativeTime as le,useFeatureGate as de,ProFeatureBanner as ae,ExportPreview as ce,monoFont as g}from"@buoy-gg/shared-ui";import{DataViewer as pe}from"@buoy-gg/shared-ui/dataViewer";import{useCallback as q,useMemo as b,useState as me}from"react";import{Text as F,StyleSheet as fe,ScrollView as v,View as D}from"react-native";import{useTickEveryMinute as ye}from"../hooks/useTickEveryMinute";import{jsx as m,Fragment as he,jsxs as ee}from"react/jsx-runtime";export const DEFAULT_COPY_SETTINGS={includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"};const k={urls:{includeMethod:true,includeStatus:false,includeDuration:false,includeTimestamp:false,includeClient:false,includeSizes:false,includeErrors:false,includeRequestHeaders:false,includeResponseHeaders:false,includeRequestBody:false,includeResponseBody:false,bodySizeThreshold:10,format:"plaintext",filterMode:"all"},llm:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"},json:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"json",filterMode:"all"},full:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"markdown",filterMode:"all"}};function qe(r){for(const[l,a]of Object.entries(k)){const T=Object.keys(a).every(j=>a[j]===r[j]);if(T)return l}return null}const Re=100*1024;const Be=500*1024;function Se(r){if(r<1024)return`${r} B`;if(r<1024*1024)return`${(r/1024).toFixed(1)} KB`;return`${(r/(1024*1024)).toFixed(1)} MB`}export function NetworkCopySettingsView({settings:r,onSettingsChange:l,events:a=[]}){const{isPro:T}=de();const j=ye();const[P,re]=me(false);const c=a.length>0;const O=b(()=>{if(!c)return null;const d=a.map(t=>typeof t.timestamp==="number"?t.timestamp:new Date(t.timestamp).getTime());return Math.max(...d)},[a,c]);const x=b(()=>qe(r),[r]);const L=q(()=>{l(k.urls)},[l]);const z=q(()=>{l(k.llm)},[l]);const I=q(()=>{l(k.json)},[l]);const J=q(()=>{l(k.full)},[l]);const C=q((d,t)=>{const[u,n]=d.split("::");if(u==="preset"){switch(n){case"urls":L();break;case"llm":z();break;case"json":I();break;case"full":J();break}return}if(u==="requestInfo"){l({...r,[n]:!r[n]});return}if(u==="headers"){l({...r,[n]:!r[n]});return}if(u==="body"){if(n==="bodySizeThreshold"){l({...r,bodySizeThreshold:t})}else{l({...r,[n]:!r[n]})}return}if(u==="format"){l({...r,format:t});return}if(u==="filter"){l({...r,filterMode:t})}},[r,l,L,z,I,J]);const h=b(()=>({method:"POST",url:"https://api.example.com/v1/users",status:201,duration:342,timestamp:new Date().toISOString(),requestHeaders:{"Content-Type":"application/json","Authorization":"Bearer ***"},responseHeaders:{"Content-Type":"application/json","X-Request-ID":"abc123"},requestBody:{name:"John Doe",email:"john@example.com"},responseBody:{id:"user_123",name:"John Doe",email:"john@example.com",createdAt:"2025-01-10T12:00:00Z"}}),[]);const be=b(()=>{if(c){return a}return[h]},[c,a,h]);const H=b(()=>{const d=c?a:[h];let t=0;for(const u of d){if(r.includeMethod){t+=(u.url?.length||0)+10}if(r.includeStatus){t+=30}if(r.includeTimestamp){t+=30}if(r.includeRequestHeaders){try{t+=JSON.stringify(u.requestHeaders||{}).length}catch{t+=100}}if(r.includeRequestBody){const n="requestBody"in u?u.requestBody:u.requestData;try{t+=JSON.stringify(n||{}).length}catch{t+=100}}if(r.includeResponseBody){const n="responseBody"in u?u.responseBody:u.responseData;try{t+=JSON.stringify(n||{}).length}catch{t+=100}}}return t},[c,a,h,r]);const _=b(()=>{if(H>=Be)return"danger";if(H>=Re)return"warning";return"none"},[H]);const V=q(()=>{const d=c?a:[h];const{format:t,includeMethod:u,includeStatus:n,includeTimestamp:R,includeRequestHeaders:$,includeRequestBody:B,includeResponseBody:S}=r;const M=o=>{const e={};if(u){e.method=o.method;e.url=o.url}if(n){e.status=o.status;e.duration=o.duration}if(R){e.timestamp=o.timestamp}if($){e.requestHeaders=o.requestHeaders}if(B){e.requestBody="requestBody"in o?o.requestBody:o.requestData}if(S){e.responseBody="responseBody"in o?o.responseBody:o.responseData}return e};if(t==="json"){const o=d.map(M);return JSON.stringify(o,null,2)}if(t==="markdown"){const o=d.map((e,i)=>{const s=[];s.push(`# Request ${i+1}`);if(u){s.push(`
|
|
2
2
|
**${e.method}** ${e.url}`)}const f=[];if(n){f.push(`**Status:** ${e.status}`);f.push(`**Duration:** ${e.duration}ms`)}if(R){f.push(`**Timestamp:** ${e.timestamp}`)}if(f.length>0){s.push("\n"+f.join("\n"))}if($){const p=e.requestHeaders||{};s.push(`
|
|
3
3
|
## Request Headers
|
|
4
4
|
\`\`\`json
|
|
@@ -11,7 +11,7 @@ ${JSON.stringify(p||{},null,2)}
|
|
|
11
11
|
## Response Body
|
|
12
12
|
\`\`\`json
|
|
13
13
|
${JSON.stringify(p||{},null,2)}
|
|
14
|
-
\`\`\``)}return s.join("\n")});return
|
|
14
|
+
\`\`\``)}return s.join("\n")});return o.join("\n\n---\n\n")||"No data included"}const A=d.map((o,e)=>{const i=[];i.push(`Request ${e+1}:`);if(u){i.push(`${o.method} ${o.url}`)}if(n){i.push(`Status: ${o.status}`);i.push(`Duration: ${o.duration}ms`)}if(R){i.push(`Timestamp: ${o.timestamp}`)}if(B){const s="requestBody"in o?o.requestBody:o.requestData;i.push("\nRequest:");i.push(JSON.stringify(s||{},null,2))}if(S){const s="responseBody"in o?o.responseBody:o.responseData;i.push("\nResponse:");i.push(JSON.stringify(s||{},null,2))}return i.join("\n")});return A.join("\n\n---\n\n")||"No data included"},[c,a,h,r]);const U=q(()=>{const d=c?a:[h];const{format:t,includeMethod:u,includeStatus:n,includeTimestamp:R,includeRequestHeaders:$,includeRequestBody:B,includeResponseBody:S}=r;const M=e=>{const i={};if(u){i.method=e.method;i.url=e.url}if(n){i.status=e.status;i.duration=e.duration}if(R){i.timestamp=e.timestamp}if($){i.requestHeaders=e.requestHeaders}if(B){i.requestBody="requestBody"in e?e.requestBody:e.requestData}if(S){i.responseBody="responseBody"in e?e.responseBody:e.responseData}return i};if(t==="json"){const e=d.map(M);return m(pe,{data:e,title:"",showTypeFilter:false})}if(t==="markdown"){const e=d.map((s,f)=>{const p=[];p.push(`# Request ${f+1}`);if(u){p.push(`
|
|
15
15
|
**${s.method}** ${s.url}`)}const E=[];if(n){E.push(`**Status:** ${s.status}`);E.push(`**Duration:** ${s.duration}ms`)}if(R){E.push(`**Timestamp:** ${s.timestamp}`)}if(E.length>0){p.push("\n"+E.join("\n"))}if($){const N=s.requestHeaders||{};p.push(`
|
|
16
16
|
## Request Headers
|
|
17
17
|
\`\`\`json
|
|
@@ -24,4 +24,4 @@ ${JSON.stringify(N||{},null,2)}
|
|
|
24
24
|
## Response Body
|
|
25
25
|
\`\`\`json
|
|
26
26
|
${JSON.stringify(N||{},null,2)}
|
|
27
|
-
\`\`\``)}return p.join("\n")});const i=e.join("\n\n---\n\n");return m(v,{style:w.previewScroll,nestedScrollEnabled:true,children:m(F,{style:w.markdownText,selectable:T,children:i||"No data included"})})}const A=d.map((e,i)=>{const s=[];s.push(`Request ${i+1}:`);if(u){s.push(`${e.method} ${e.url}`)}if(n){s.push(`Status: ${e.status}`);s.push(`Duration: ${e.duration}ms`)}if(R){s.push(`Timestamp: ${e.timestamp}`)}if(B){const f="requestBody"in e?e.requestBody:e.requestData;s.push("\nRequest:");s.push(JSON.stringify(f||{},null,2))}if(S){const f="responseBody"in e?e.responseBody:e.responseData;s.push("\nResponse:");s.push(JSON.stringify(f||{},null,2))}return s.join("\n")});const
|
|
27
|
+
\`\`\``)}return p.join("\n")});const i=e.join("\n\n---\n\n");return m(v,{keyboardShouldPersistTaps:"handled",style:w.previewScroll,nestedScrollEnabled:true,children:m(F,{style:w.markdownText,selectable:T,children:i||"No data included"})})}const A=d.map((e,i)=>{const s=[];s.push(`Request ${i+1}:`);if(u){s.push(`${e.method} ${e.url}`)}if(n){s.push(`Status: ${e.status}`);s.push(`Duration: ${e.duration}ms`)}if(R){s.push(`Timestamp: ${e.timestamp}`)}if(B){const f="requestBody"in e?e.requestBody:e.requestData;s.push("\nRequest:");s.push(JSON.stringify(f||{},null,2))}if(S){const f="responseBody"in e?e.responseBody:e.responseData;s.push("\nResponse:");s.push(JSON.stringify(f||{},null,2))}return s.join("\n")});const o=A.join("\n\n---\n\n");return m(v,{keyboardShouldPersistTaps:"handled",style:w.previewScroll,nestedScrollEnabled:true,children:m(F,{style:w.plaintextText,selectable:T,children:o||"No data included"})})},[r,c,a,h,T]);const G=q(()=>{const d=c?a:[h];const t=d.length;return m(ce,{expanded:P,onExpandedChange:re,summary:`${t} request${t!==1?"s":""} \u2022 ~${Se(H)}`,warningLevel:_,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},renderBody:U})},[r,c,a,h,P,H,_,U]);const W=q(()=>{const d=c&&O?`Live data \u2022 Updated ${le(O,j)}`:"Mock data (no events captured)";return ee(he,{children:[m(F,{style:w.statusLabel,children:d}),m(ne,{value:V()})]})},[c,O,j,V]);const Z=q(()=>{return G()},[G]);const K=b(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::urls",label:"URLs",icon:se,color:y.semantic.info,value:"urls",isActive:x==="urls"},{id:"preset::llm",label:"LLM",icon:oe,color:y.semantic.success,value:"llm",isActive:x==="llm"},{id:"preset::json",label:"JSON",icon:Q,color:y.semantic.warning,value:"json",isActive:x==="json"},{id:"preset::full",label:"Full",icon:Y,color:y.semantic.info,value:"full",isActive:x==="full"},{id:"preset::custom",label:"Custom",icon:te,color:y.text.secondary,value:"custom",isActive:x===null}]},{id:"include",title:"Include",type:"custom",data:[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:r.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:r.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:r.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:r.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:r.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:r.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:r.includeErrors}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:Y,color:y.semantic.info,value:"markdown",isActive:r.format==="markdown"},{id:"format::json",label:"JSON",icon:Q,color:y.semantic.warning,value:"json",isActive:r.format==="json"},{id:"format::plaintext",label:"Text",icon:ie,color:y.text.secondary,value:"plaintext",isActive:r.format==="plaintext"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:ue,content:Z,headerActions:W},onFilterChange:C}),[r,C,Z,W,x]);if(!T){return ee(D,{style:w.gatedContainer,children:[m(ae,{featureName:"Network Export",description:"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]}),m(D,{style:w.gatedPreview,children:m(X,{...K})})]})}return m(X,{...K})}const w=fe.create({previewScroll:{maxHeight:300},markdownText:{fontFamily:g,fontSize:11,color:y.text.primary,lineHeight:18},plaintextText:{fontFamily:g,fontSize:11,color:y.text.primary,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:y.text.muted,marginRight:8},gatedContainer:{flex:1,padding:12},gatedPreview:{flex:1}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";import{useState as H,useEffect as U,useMemo as ee,memo as
|
|
1
|
+
"use strict";import{useState as H,useEffect as U,useMemo as ee,memo as oe}from"react";import{View as l,Text as i,StyleSheet as te,ScrollView as re,TouchableOpacity as O}from"react-native";import{Clock as M,Upload as G,Download as J,AlertCircle as le,ChevronDown as _,ChevronUp as Q,Lock as ie,Unlock as ne,FileJson as E,Filter as ae,Globe as se,Link as ce,Copy as Y,FlaskConical as de,InlineCopyButton as K,macOSColors as N,night as t,useFeatureGate as ue,UpgradeModal as pe,monoFont as R}from"@buoy-gg/shared-ui";import{formatBytes as q,formatDuration as X,formatHttpStatus as ge}from"../utils/formatting";import{formatRelativeTime as he}from"@buoy-gg/shared-ui";import{DataViewer as F}from"@buoy-gg/shared-ui/dataViewer";import{formatGraphQLDisplay as fe}from"../utils/formatGraphQLVariables";import{useNetworkBodyResolver as ye}from"../sync/networkBodyResolver";import{jsx as e,jsxs as n,Fragment as W}from"react/jsx-runtime";const A=t.color.accent;const me=new Set;const be=()=>{};const Se=({timings:d,total:r})=>{const u=Math.max(1,r);const h=[{label:"Waiting (TTFB)",hint:"incl. queue, DNS, TLS",value:d.ttfb,color:N.semantic.warning},{label:"Content download",hint:void 0,value:d.download,color:N.semantic.success}];return e(l,{style:o.phaseList,children:h.map(s=>n(l,{style:o.phaseRow,children:[n(l,{style:o.phaseLabelGroup,children:[e(i,{style:o.phaseLabel,children:s.label}),s.hint?e(i,{style:o.phaseHint,children:s.hint}):null]}),e(l,{style:o.phaseTrack,children:e(l,{style:[o.phaseBar,{backgroundColor:s.color,width:`${Math.min(100,Math.max(1,s.value/u*100))}%`}]})}),e(i,{style:o.phaseValue,children:X(s.value)})]},s.label))})};const Z=()=>e(l,{style:o.bodyDeferred});const T=({title:d,icon:r,children:u,defaultOpen:h=false,count:s})=>{const[p,B]=H(h);return n(l,{style:o.collapsibleSection,children:[n(O,{style:o.collapsibleHeader,onPress:()=>B(!p),testID:`buoy-network-section-${d.toLowerCase().replace(/\s+/g,"-")}`,accessibilityRole:"button",accessibilityLabel:d,children:[n(l,{style:o.collapsibleTitle,children:[r,e(i,{style:o.collapsibleTitleText,children:d}),s!==void 0?e(i,{style:o.collapsibleCount,children:s}):null]}),p?e(Q,{size:16,color:t.color.textSecondary}):e(_,{size:16,color:t.color.textSecondary})]}),p?e(l,{style:o.collapsibleContent,children:u}):null]})};const xe=({url:d,requestData:r,operationName:u,graphqlVariables:h,requestClient:s,isPro:p=false,onUpgradePress:B})=>{const g=L=>{try{const y=new URL(L);const x=String(y.protocol||"");const C=String(y.host||"");const V=x==="https:";let m=String(y.pathname||"");if(s==="graphql"&&u){const z=fe(u,h);m=`${m} (${z})`}else if(u){m=`${m} (${u})`}const w={};const b=y.searchParams;if(b&&typeof b.forEach==="function"){b.forEach((z,D)=>{w[D]=z})}return{protocol:x.replace(":",""),host:C,pathname:m,params:Object.keys(w).length>0?w:null,isSecure:V}}catch{return{protocol:"",host:d,pathname:"",params:null,isSecure:false}}};const c=ee(()=>g(d),[d,s,u,h]);const[f,k]=H(false);return n(l,{style:o.urlBreakdown,children:[n(l,{style:o.urlRow,children:[c.isSecure?e(ie,{size:12,color:N.semantic.success}):e(ne,{size:12,color:N.semantic.warning}),e(i,{style:o.urlDomain,children:c.host}),n(i,{style:o.urlProtocol,children:["(",c.protocol.toUpperCase(),")"]}),p?e(K,{value:d,buttonStyle:o.copyButton}):e(O,{style:o.copyButton,onPress:B,activeOpacity:.7,children:e(Y,{size:14,color:t.color.textSecondary})})]}),e(l,{style:o.urlPathRow,children:n(i,{style:o.urlPath,numberOfLines:2,children:[c.pathname,c.params?n(i,{style:o.urlQueryString,children:["?",new URLSearchParams(c.params).toString()]}):null]})}),c.params?n(l,{style:o.queryParamsCollapsible,children:[n(O,{style:o.queryParamsToggle,onPress:()=>k(!f),activeOpacity:.7,children:[e(i,{style:o.queryParamsToggleText,children:"Query Parameters"}),e(i,{style:o.collapsibleCount,children:Object.keys(c.params).length}),f?e(Q,{size:14,color:t.color.textSecondary}):e(_,{size:14,color:t.color.textSecondary})]}),f?e(F,{title:"",data:c.params,showTypeFilter:true,rawMode:true,initialExpanded:true}):null]}):null]})};export const NetworkEventDetailView=oe(function d({event:r,ignoredPatterns:u=me,onTogglePattern:h=be,showBodies:s=true}){const p=r.status?ge(r.status):null;const B=!r.status&&!r.error;const{isPro:g}=ue();const[c,f]=H(false);U(()=>{if(c&&g){f(false)}},[c,g]);const k=ye();const L=r.requestData===void 0&&(r.requestBodyOmitted===true||(r.requestSize??0)>0);const y=r.responseData===void 0&&(r.responseBodyOmitted===true||(r.responseSize??0)>0);const x=r.headersOmitted===true;const[C,V]=H(null);const[m,w]=H(false);U(()=>{V(null);if(!k||!L&&!y&&!x){w(false);return}let a=false;w(true);k(r.id).then(S=>{if(!a)V(S)}).catch(()=>{}).finally(()=>{if(!a)w(false)});return()=>{a=true}},[r.id,k,L,y,x]);const b=r.requestData??C?.requestData??void 0;const z=r.responseData??C?.responseData??void 0;const D=(x?C?.requestHeaders:void 0)??r.requestHeaders;const $=(x?C?.responseHeaders:void 0)??r.responseHeaders;const v=()=>{const a={method:r.method,url:r.url,status:r.status,statusText:r.statusText,timestamp:new Date(r.timestamp).toISOString(),duration:r.duration?`${r.duration}ms`:"N/A",requestHeaders:D,requestData:b,responseHeaders:$,responseData:z,requestSize:r.requestSize?q(r.requestSize):"N/A",responseSize:r.responseSize?q(r.responseSize):"N/A",error:r.error,client:r.requestClient};return`# Network Request Details
|
|
2
2
|
|
|
3
3
|
## Request
|
|
4
4
|
- **Method:** ${a.method}
|
|
@@ -32,4 +32,4 @@ ${JSON.stringify(a.responseHeaders,null,2)}
|
|
|
32
32
|
\`\`\`json
|
|
33
33
|
${JSON.stringify(a.responseData,null,2)}
|
|
34
34
|
\`\`\`
|
|
35
|
-
`};return n(W,{children:[n(re,{testID:"buoy-network-detail-scroll",style:t.container,children:[n(l,{style:t.requestDetailsSection,children:[n(l,{style:t.httpHeader,children:[e(l,{style:t.httpMethodBadge,children:e(i,{style:t.httpMethod,children:r.method})}),r.status?e(l,{style:[t.httpStatusBadge,{backgroundColor:`${p?.color}20`}],children:n(i,{style:[t.httpStatusText,{color:p?.color}],children:[p?.text," ",p?.meaning]})}):B?n(l,{style:t.pendingBadge,children:[e(M,{size:10,color:o.color.warning}),e(i,{style:t.pendingBadgeText,children:"Pending"})]}):null,r.condition&&n(i,{style:{color:"#FFCC66"},children:["Conditions: ",r.condition.profile," (+",r.condition.delayMs," ms)"]}),r.duration?n(l,{style:t.httpDuration,children:[e(M,{size:10,color:o.color.textTertiary}),e(i,{style:t.httpDurationText,children:X(r.duration)})]}):null,r.override?n(l,{style:t.overrideBadge,children:[e(de,{size:10,color:o.color.warning}),e(i,{style:t.overrideBadgeText,children:r.override.ruleName||"Overridden"})]}):null,g?e(K,{value:v,buttonStyle:t.copyFullButton}):e(O,{style:t.copyFullButton,onPress:()=>f(true),activeOpacity:.7,children:e(Y,{size:14,color:o.color.textSecondary})})]}),e(xe,{url:r.url,requestData:b,operationName:r.operationName,graphqlVariables:r.graphqlVariables,requestClient:r.requestClient,isPro:g,onUpgradePress:()=>f(true)}),r.error?n(l,{style:t.errorBox,children:[e(le,{size:12,color:o.color.danger}),e(i,{style:t.errorText,children:r.error})]}):null]}),n(l,{style:t.timingSection,children:[n(l,{style:t.timingRow,children:[e(M,{size:12,color:o.color.textSecondary}),e(i,{style:t.timingLabel,children:"Started:"}),e(i,{style:t.timingValue,children:he(r.timestamp)}),n(i,{style:t.timingExact,children:["(",new Date(r.timestamp).toLocaleTimeString(),")"]}),r.requestSize||r.responseSize?n(l,{style:t.sizeRow,children:[r.requestSize!==void 0?n(l,{style:t.sizeItem,children:[e(G,{size:10,color:o.color.info}),e(i,{style:t.sizeLabel,children:"Sent:"}),e(i,{style:t.sizeValue,children:q(r.requestSize)})]}):null,r.responseSize!==void 0?n(l,{style:t.sizeItem,children:[e(J,{size:10,color:A}),e(i,{style:t.sizeLabel,children:"Received:"}),e(i,{style:t.sizeValue,children:q(r.responseSize)})]}):null]}):null]}),r.timings?n(W,{children:[e(l,{style:t.phaseDivider}),e(Se,{timings:r.timings,total:r.duration??r.timings.ttfb+r.timings.download})]}):null]}),e(T,{title:"Request Headers",icon:e(G,{size:14,color:o.color.info}),defaultOpen:false,count:Object.keys(D).length,children:Object.keys(D).length>0?e(l,{style:t.dataViewerContainer,children:e(F,{title:"",data:D,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g})}):e(i,{style:t.emptyText,children:"No request headers"})}),e(T,{title:"Response Headers",icon:e(J,{size:14,color:A}),defaultOpen:false,count:Object.keys($).length,children:Object.keys($).length>0?e(l,{style:t.dataViewerContainer,children:e(F,{title:"",data:$,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g})}):e(i,{style:t.emptyText,children:"No response headers yet"})}),b!==void 0?e(T,{title:"Request Body",icon:e(E,{size:14,color:o.color.accent}),defaultOpen:false,children:e(l,{style:t.dataViewerContainer,children:s?e(F,{title:"",data:b,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g}):e(Z,{})})}):L?e(T,{title:"Request Body",icon:e(E,{size:14,color:o.color.accent}),defaultOpen:true,children:e(i,{style:t.emptyText,children:m?`Loading request body (${q(r.requestSize??0)})\u2026`:"Request body unavailable"})}):null,z!==void 0?e(T,{title:"Response Body",icon:e(E,{size:14,color:A}),defaultOpen:true,children:e(l,{style:t.dataViewerContainer,children:s?e(F,{title:"",data:z,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g}):e(Z,{})})}):y?e(T,{title:"Response Body",icon:e(E,{size:14,color:A}),defaultOpen:true,children:e(i,{style:t.emptyText,children:m?`Loading response body (${q(r.responseSize??0)})\u2026`:"Response body unavailable"})}):null,e(T,{title:"Filter Options",icon:e(ae,{size:14,color:o.color.warning}),defaultOpen:false,children:e(l,{style:t.filterOptionsContainer,children:(()=>{let a="";let S="";try{const j=new URL(r.url);a=j.hostname;S=j.pathname}catch{S=r.url}const I=u.has(a);const P=u.has(S);return n(W,{children:[n(O,{style:[t.filterOption,I&&t.filterOptionActive],onPress:()=>a&&h(a),children:[n(l,{style:t.filterOptionLeft,children:[e(se,{size:16,color:I?o.color.warning:o.color.textTertiary}),n(l,{style:t.filterOptionContent,children:[e(i,{style:t.filterOptionLabel,children:"Ignore Domain"}),e(i,{style:t.filterOptionValue,children:a||"N/A"})]})]}),e(l,{style:[t.filterToggle,I&&t.filterToggleActive],children:e(i,{style:[t.filterToggleText,I&&t.filterToggleTextActive],children:I?"IGNORED":"IGNORE"})})]}),n(O,{style:[t.filterOption,P&&t.filterOptionActive],onPress:()=>S&&h(S),children:[n(l,{style:t.filterOptionLeft,children:[e(ce,{size:16,color:P?o.color.warning:o.color.textTertiary}),n(l,{style:t.filterOptionContent,children:[e(i,{style:t.filterOptionLabel,children:"Ignore URL Pattern"}),e(i,{style:t.filterOptionValue,numberOfLines:1,children:S||"N/A"})]})]}),e(l,{style:[t.filterToggle,P&&t.filterToggleActive],children:e(i,{style:[t.filterToggleText,P&&t.filterToggleTextActive],children:P?"IGNORED":"IGNORE"})})]}),e(l,{style:t.filterInfoBox,children:e(i,{style:t.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),e(pe,{visible:c,onClose:()=>f(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})});const t=oe.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:o.color.surface,borderRadius:8,borderWidth:1,borderColor:o.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:o.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:o.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:o.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:o.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:o.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:o.color.warningSoft},overrideBadgeText:{color:o.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:o.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:o.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:o.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:o.color.textSecondary,fontSize:11,fontFamily:R},urlQueryString:{color:o.color.info,fontSize:11,fontFamily:R},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:o.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:o.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:o.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:o.color.surface,borderRadius:8,borderWidth:1,borderColor:o.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:o.color.textSecondary,fontSize:11},timingValue:{color:o.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:o.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:o.color.textTertiary,fontSize:10},sizeValue:{color:o.color.info,fontSize:10,fontFamily:R,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:o.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:o.color.textSecondary},phaseHint:{fontSize:10,color:o.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:o.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:R,color:o.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:o.color.surface,borderRadius:8,borderWidth:1,borderColor:o.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:o.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:o.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:o.color.textTertiary,fontSize:11.5,fontFamily:R},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:o.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:o.color.danger,fontSize:11,flex:1},emptyText:{color:o.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:o.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:o.color.border},filterOptionActive:{backgroundColor:o.color.warningSoft,borderColor:o.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:o.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:o.color.text,fontSize:13,fontFamily:R},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:o.color.bg,borderWidth:1,borderColor:o.color.border},filterToggleActive:{backgroundColor:o.color.warningSoft,borderColor:o.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:o.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:o.color.warning},filterInfoBox:{backgroundColor:o.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:o.color.info+"33"},filterInfoText:{color:o.color.textSecondary,fontSize:11,lineHeight:16}});
|
|
35
|
+
`};return n(W,{children:[n(re,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-detail-scroll",style:o.container,children:[n(l,{style:o.requestDetailsSection,children:[n(l,{style:o.httpHeader,children:[e(l,{style:o.httpMethodBadge,children:e(i,{style:o.httpMethod,children:r.method})}),r.status?e(l,{style:[o.httpStatusBadge,{backgroundColor:`${p?.color}20`}],children:n(i,{style:[o.httpStatusText,{color:p?.color}],children:[p?.text," ",p?.meaning]})}):B?n(l,{style:o.pendingBadge,children:[e(M,{size:10,color:t.color.warning}),e(i,{style:o.pendingBadgeText,children:"Pending"})]}):null,r.condition&&n(i,{style:{color:"#FFCC66"},children:["Conditions: ",r.condition.profile," (+",r.condition.delayMs," ms)"]}),r.duration?n(l,{style:o.httpDuration,children:[e(M,{size:10,color:t.color.textTertiary}),e(i,{style:o.httpDurationText,children:X(r.duration)})]}):null,r.override?n(l,{style:o.overrideBadge,children:[e(de,{size:10,color:t.color.warning}),e(i,{style:o.overrideBadgeText,children:r.override.ruleName||"Overridden"})]}):null,g?e(K,{value:v,buttonStyle:o.copyFullButton}):e(O,{style:o.copyFullButton,onPress:()=>f(true),activeOpacity:.7,children:e(Y,{size:14,color:t.color.textSecondary})})]}),e(xe,{url:r.url,requestData:b,operationName:r.operationName,graphqlVariables:r.graphqlVariables,requestClient:r.requestClient,isPro:g,onUpgradePress:()=>f(true)}),r.error?n(l,{style:o.errorBox,children:[e(le,{size:12,color:t.color.danger}),e(i,{style:o.errorText,children:r.error})]}):null]}),n(l,{style:o.timingSection,children:[n(l,{style:o.timingRow,children:[e(M,{size:12,color:t.color.textSecondary}),e(i,{style:o.timingLabel,children:"Started:"}),e(i,{style:o.timingValue,children:he(r.timestamp)}),n(i,{style:o.timingExact,children:["(",new Date(r.timestamp).toLocaleTimeString(),")"]}),r.requestSize||r.responseSize?n(l,{style:o.sizeRow,children:[r.requestSize!==void 0?n(l,{style:o.sizeItem,children:[e(G,{size:10,color:t.color.info}),e(i,{style:o.sizeLabel,children:"Sent:"}),e(i,{style:o.sizeValue,children:q(r.requestSize)})]}):null,r.responseSize!==void 0?n(l,{style:o.sizeItem,children:[e(J,{size:10,color:A}),e(i,{style:o.sizeLabel,children:"Received:"}),e(i,{style:o.sizeValue,children:q(r.responseSize)})]}):null]}):null]}),r.timings?n(W,{children:[e(l,{style:o.phaseDivider}),e(Se,{timings:r.timings,total:r.duration??r.timings.ttfb+r.timings.download})]}):null]}),e(T,{title:"Request Headers",icon:e(G,{size:14,color:t.color.info}),defaultOpen:false,count:Object.keys(D).length,children:Object.keys(D).length>0?e(l,{style:o.dataViewerContainer,children:e(F,{title:"",data:D,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g})}):e(i,{style:o.emptyText,children:"No request headers"})}),e(T,{title:"Response Headers",icon:e(J,{size:14,color:A}),defaultOpen:false,count:Object.keys($).length,children:Object.keys($).length>0?e(l,{style:o.dataViewerContainer,children:e(F,{title:"",data:$,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g})}):e(i,{style:o.emptyText,children:"No response headers yet"})}),b!==void 0?e(T,{title:"Request Body",icon:e(E,{size:14,color:t.color.accent}),defaultOpen:false,children:e(l,{style:o.dataViewerContainer,children:s?e(F,{title:"",data:b,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g}):e(Z,{})})}):L?e(T,{title:"Request Body",icon:e(E,{size:14,color:t.color.accent}),defaultOpen:true,children:e(i,{style:o.emptyText,children:m?`Loading request body (${q(r.requestSize??0)})\u2026`:"Request body unavailable"})}):null,z!==void 0?e(T,{title:"Response Body",icon:e(E,{size:14,color:A}),defaultOpen:true,children:e(l,{style:o.dataViewerContainer,children:s?e(F,{title:"",data:z,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!g}):e(Z,{})})}):y?e(T,{title:"Response Body",icon:e(E,{size:14,color:A}),defaultOpen:true,children:e(i,{style:o.emptyText,children:m?`Loading response body (${q(r.responseSize??0)})\u2026`:"Response body unavailable"})}):null,e(T,{title:"Filter Options",icon:e(ae,{size:14,color:t.color.warning}),defaultOpen:false,children:e(l,{style:o.filterOptionsContainer,children:(()=>{let a="";let S="";try{const j=new URL(r.url);a=j.hostname;S=j.pathname}catch{S=r.url}const I=u.has(a);const P=u.has(S);return n(W,{children:[n(O,{style:[o.filterOption,I&&o.filterOptionActive],onPress:()=>a&&h(a),children:[n(l,{style:o.filterOptionLeft,children:[e(se,{size:16,color:I?t.color.warning:t.color.textTertiary}),n(l,{style:o.filterOptionContent,children:[e(i,{style:o.filterOptionLabel,children:"Ignore Domain"}),e(i,{style:o.filterOptionValue,children:a||"N/A"})]})]}),e(l,{style:[o.filterToggle,I&&o.filterToggleActive],children:e(i,{style:[o.filterToggleText,I&&o.filterToggleTextActive],children:I?"IGNORED":"IGNORE"})})]}),n(O,{style:[o.filterOption,P&&o.filterOptionActive],onPress:()=>S&&h(S),children:[n(l,{style:o.filterOptionLeft,children:[e(ce,{size:16,color:P?t.color.warning:t.color.textTertiary}),n(l,{style:o.filterOptionContent,children:[e(i,{style:o.filterOptionLabel,children:"Ignore URL Pattern"}),e(i,{style:o.filterOptionValue,numberOfLines:1,children:S||"N/A"})]})]}),e(l,{style:[o.filterToggle,P&&o.filterToggleActive],children:e(i,{style:[o.filterToggleText,P&&o.filterToggleTextActive],children:P?"IGNORED":"IGNORE"})})]}),e(l,{style:o.filterInfoBox,children:e(i,{style:o.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),e(pe,{visible:c,onClose:()=>f(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})});const o=te.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:t.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:t.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:t.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:t.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:t.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:t.color.warningSoft},overrideBadgeText:{color:t.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:t.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:t.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:t.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:t.color.textSecondary,fontSize:11,fontFamily:R},urlQueryString:{color:t.color.info,fontSize:11,fontFamily:R},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:t.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:t.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:t.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:t.color.textSecondary,fontSize:11},timingValue:{color:t.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:t.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:t.color.textTertiary,fontSize:10},sizeValue:{color:t.color.info,fontSize:10,fontFamily:R,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:t.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:t.color.textSecondary},phaseHint:{fontSize:10,color:t.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:t.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:R,color:t.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:t.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:t.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:t.color.textTertiary,fontSize:11.5,fontFamily:R},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:t.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:t.color.danger,fontSize:11,flex:1},emptyText:{color:t.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:t.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:t.color.border},filterOptionActive:{backgroundColor:t.color.warningSoft,borderColor:t.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:t.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:t.color.text,fontSize:13,fontFamily:R},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:t.color.bg,borderWidth:1,borderColor:t.color.border},filterToggleActive:{backgroundColor:t.color.warningSoft,borderColor:t.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:t.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:t.color.warning},filterInfoBox:{backgroundColor:t.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:t.color.info+"33"},filterInfoText:{color:t.color.textSecondary,fontSize:11,lineHeight:16}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback as $}from"react";import{FlatList as _,StyleSheet as A,Text as m,TouchableOpacity as I,View as c}from"react-native";import{FlaskConical as G,Pin as J,Power as K,macOSColors as e,ToolEmptyState as Q,resolveListEmptyState as X,EVENT_LIST_PRESET as Y,monoFont as Z}from"@buoy-gg/shared-ui";import{NetworkEventItemCompact as w}from"./NetworkEventItemCompact";import{NetworkUpgradeBanner as ee}from"./NetworkUpgradeBanner";import{useNetworkEventList as ne}from"../hooks/useNetworkEventList";import{useNetworkSaved as te}from"../hooks/useNetworkSaved";import{useOverrideRules as re}from"../hooks/useOverrideRules";import{overriddenEvents as oe}from"../overrides/overriddenRows";import{splitPinned as ie}from"../utils/withPinnedFirst";import{jsx as n,jsxs as l}from"react/jsx-runtime";const de=o=>o.id;function se({events:o,onEventPress:a,onLongPress:g,savedLiveIds:p,onClearPinned:i}){if(o.length===0)return null;return l(c,{style:t.pinnedSection,children:[l(c,{style:t.pinnedHeader,children:[n(J,{size:11,active:true,color:e.semantic.info}),l(m,{style:t.pinnedTitle,children:["PINNED \xB7 ",o.length]}),n(I,{onPress:i,"sentry-label":"ignore unpin all",style:t.pinnedClear,children:n(m,{style:t.pinnedClearText,children:"Unpin all"})})]}),o.map(d=>n(w,{event:d,onPress:a,onLongPress:g,pinned:true,saved:p.has(d.id)},d.id))]})}function le({events:o,onEventPress:a,onLongPress:g,savedLiveIds:p,paused:i,onTogglePaused:d}){if(o.length===0)return null;return l(c,{style:[t.overriddenSection,i&&t.overriddenSectionOff],children:[l(c,{style:t.overriddenHeader,children:[n(G,{size:11,color:i?e.text.muted:e.semantic.warning}),n(m,{testID:"buoy-network-overridden-strip",style:[t.overriddenTitle,i&&t.overriddenTitleOff],children:i?`PAUSED \xB7 ${o.length}`:`OVERRIDDEN \xB7 ${o.length}`}),n(I,{onPress:d,"sentry-label":"ignore pause overrides",style:t.overriddenManage,children:n(m,{style:[t.overriddenManageText,i&&t.overriddenTitleOff],children:i?"Resume":"Pause"})})]}),o.map(s=>n(w,{event:s,onPress:a,onLongPress:g,overridden:true,saved:p.has(s.id)},s.id))]})}export function NetworkListScreen({visible:o,paused:a,filter:g,ignoredPatterns:p,isPro:i,searchText:d,onEventPress:s,onUpgradePress:L}){const{visibleEvents:z,hasLockedEvents:S,lockedEventCount:f,totalEvents:B}=ne({filter:g,ignoredPatterns:p,paused:a,visible:o,isPro:i});const{pinnedEvents:N,pinnedLiveIds:D,savedLiveIds:u,togglePin:k,clearPinned:R}=te();const{rules:H,enabled:x,setEnabled:O,isRuleSpent:q}=re();const h=$(r=>{k(r)},[k]);if(!o)return null;const{pinned:E,rest:v}=ie(z,N,D);const F=H.filter(r=>r.enabled&&!q(r));const b=oe([...E,...v],F);const y=new Set(b.map(r=>r.id));const P=E.filter(r=>!y.has(r.id));const T=y.size?v.filter(r=>!y.has(r.id)):v;const C=!a;const V=({item:r})=>n(w,{event:r,onPress:s,onLongPress:h,saved:u.has(r.id)});const W=()=>{if(P.length>0||b.length>0)return null;return n(Q,{testID:"buoy-network-empty",...X({subject:"requests",search:d,total:B,capturing:C,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})})};const j=()=>{if(!S)return null;const r=d.length>0;const M=r?`${f} matching ${f===1?"request":"requests"} in locked history`:`${f} requests locked`;const U=r?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history";return n(ee,{title:M,subtitle:U,onPress:L})};return l(c,{style:t.root,children:[!C?l(c,{style:t.disabledBanner,children:[n(K,{size:14,color:e.semantic.warning}),n(m,{style:t.disabledText,children:"Network interception is disabled"})]}):null,n(le,{events:b,onEventPress:s,onLongPress:h,savedLiveIds:u,paused:!x,onTogglePaused:()=>O(!x)}),n(se,{events:P,onEventPress:s,onLongPress:h,savedLiveIds:u,onClearPinned:R}),T.length>0||S?n(_,{testID:"buoy-network-list",data:T,renderItem:V,keyExtractor:de,contentContainerStyle:t.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,...Y,extraData:u,"sentry-label":"ignore network events list",ListFooterComponent:j}):W()]})}const t=A.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:e.semantic.warning+"44",backgroundColor:e.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:e.border.default,backgroundColor:e.background.card},overriddenTitleOff:{color:e.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:e.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:e.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:e.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:e.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:Z},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:e.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:e.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:e.semantic.warning+"20"},disabledText:{color:e.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});
|
|
1
|
+
"use strict";import{useCallback as $}from"react";import{FlatList as _,StyleSheet as A,Text as m,TouchableOpacity as I,View as c}from"react-native";import{FlaskConical as G,Pin as J,Power as K,macOSColors as e,ToolEmptyState as Q,resolveListEmptyState as X,EVENT_LIST_PRESET as Y,monoFont as Z}from"@buoy-gg/shared-ui";import{NetworkEventItemCompact as w}from"./NetworkEventItemCompact";import{NetworkUpgradeBanner as ee}from"./NetworkUpgradeBanner";import{useNetworkEventList as ne}from"../hooks/useNetworkEventList";import{useNetworkSaved as te}from"../hooks/useNetworkSaved";import{useOverrideRules as re}from"../hooks/useOverrideRules";import{overriddenEvents as oe}from"../overrides/overriddenRows";import{splitPinned as ie}from"../utils/withPinnedFirst";import{jsx as n,jsxs as l}from"react/jsx-runtime";const de=o=>o.id;function se({events:o,onEventPress:a,onLongPress:g,savedLiveIds:p,onClearPinned:i}){if(o.length===0)return null;return l(c,{style:t.pinnedSection,children:[l(c,{style:t.pinnedHeader,children:[n(J,{size:11,active:true,color:e.semantic.info}),l(m,{style:t.pinnedTitle,children:["PINNED \xB7 ",o.length]}),n(I,{onPress:i,"sentry-label":"ignore unpin all",style:t.pinnedClear,children:n(m,{style:t.pinnedClearText,children:"Unpin all"})})]}),o.map(d=>n(w,{event:d,onPress:a,onLongPress:g,pinned:true,saved:p.has(d.id)},d.id))]})}function le({events:o,onEventPress:a,onLongPress:g,savedLiveIds:p,paused:i,onTogglePaused:d}){if(o.length===0)return null;return l(c,{style:[t.overriddenSection,i&&t.overriddenSectionOff],children:[l(c,{style:t.overriddenHeader,children:[n(G,{size:11,color:i?e.text.muted:e.semantic.warning}),n(m,{testID:"buoy-network-overridden-strip",style:[t.overriddenTitle,i&&t.overriddenTitleOff],children:i?`PAUSED \xB7 ${o.length}`:`OVERRIDDEN \xB7 ${o.length}`}),n(I,{onPress:d,"sentry-label":"ignore pause overrides",style:t.overriddenManage,children:n(m,{style:[t.overriddenManageText,i&&t.overriddenTitleOff],children:i?"Resume":"Pause"})})]}),o.map(s=>n(w,{event:s,onPress:a,onLongPress:g,overridden:true,saved:p.has(s.id)},s.id))]})}export function NetworkListScreen({visible:o,paused:a,filter:g,ignoredPatterns:p,isPro:i,searchText:d,onEventPress:s,onUpgradePress:L}){const{visibleEvents:z,hasLockedEvents:S,lockedEventCount:f,totalEvents:B}=ne({filter:g,ignoredPatterns:p,paused:a,visible:o,isPro:i});const{pinnedEvents:N,pinnedLiveIds:D,savedLiveIds:u,togglePin:k,clearPinned:R}=te();const{rules:H,enabled:x,setEnabled:O,isRuleSpent:q}=re();const h=$(r=>{k(r)},[k]);if(!o)return null;const{pinned:E,rest:v}=ie(z,N,D);const F=H.filter(r=>r.enabled&&!q(r));const b=oe([...E,...v],F);const y=new Set(b.map(r=>r.id));const P=E.filter(r=>!y.has(r.id));const T=y.size?v.filter(r=>!y.has(r.id)):v;const C=!a;const V=({item:r})=>n(w,{event:r,onPress:s,onLongPress:h,saved:u.has(r.id)});const W=()=>{if(P.length>0||b.length>0)return null;return n(Q,{testID:"buoy-network-empty",...X({subject:"requests",search:d,total:B,capturing:C,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})})};const j=()=>{if(!S)return null;const r=d.length>0;const M=r?`${f} matching ${f===1?"request":"requests"} in locked history`:`${f} requests locked`;const U=r?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history";return n(ee,{title:M,subtitle:U,onPress:L})};return l(c,{style:t.root,children:[!C?l(c,{style:t.disabledBanner,children:[n(K,{size:14,color:e.semantic.warning}),n(m,{style:t.disabledText,children:"Network interception is disabled"})]}):null,n(le,{events:b,onEventPress:s,onLongPress:h,savedLiveIds:u,paused:!x,onTogglePaused:()=>O(!x)}),n(se,{events:P,onEventPress:s,onLongPress:h,savedLiveIds:u,onClearPinned:R}),T.length>0||S?n(_,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-list",data:T,renderItem:V,keyExtractor:de,contentContainerStyle:t.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,...Y,extraData:u,"sentry-label":"ignore network events list",ListFooterComponent:j}):W()]})}const t=A.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:e.semantic.warning+"44",backgroundColor:e.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:e.border.default,backgroundColor:e.background.card},overriddenTitleOff:{color:e.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:e.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:e.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:e.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:e.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:Z},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:e.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:e.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:e.semantic.warning+"20"},disabledText:{color:e.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as L}from"react";import{FlatList as q,StyleSheet as B,Text as b,TextInput as D,View as u,TouchableOpacity as V}from"react-native";import{Bookmark as N,CopyButton as
|
|
1
|
+
"use strict";import{useState as L}from"react";import{FlatList as q,StyleSheet as B,Text as b,TextInput as D,View as u,TouchableOpacity as V}from"react-native";import{Bookmark as N,CopyButton as P,Search as j,macOSColors as e,useLimit as R,ToolEmptyState as F,resolveListEmptyState as H,EVENT_LIST_PRESET as _,monoFont as $}from"@buoy-gg/shared-ui";import{NetworkEventItemCompact as A}from"./NetworkEventItemCompact";import{NetworkUpgradeBanner as O}from"./NetworkUpgradeBanner";import{generateNetworkCopyText as U}from"../utils/generateNetworkCopyText";import{selectSavedEvents as W}from"../utils/selectSavedEvents";import{useNetworkSaved as K}from"../hooks/useNetworkSaved";import{MAX_SAVED as M}from"../utils/networkSavedStore";import{jsx as t,jsxs as d}from"react/jsx-runtime";const X=c=>c.id;export function NetworkSavedScreen({visible:c,isPro:y,copySettings:v,search:p,onSearchChange:m,onEventPress:S,onUpgradePress:x}){const{savedRecords:o,pinnedLiveIds:h,toggleSave:f,clearSaved:C}=K();const a=R("network.saved");const[k,T]=L("");const g=p!=null&&m!=null;const s=g?p:k;const w=g?m:T;if(!c)return null;const{events:l,lockedCount:n}=W(o,a,s);const E=i=>{f(i)};const I=({item:i})=>t(A,{event:i,onPress:S,onLongPress:E,saved:true,pinned:h.has(i.id)});const z=()=>{if(n===0)return null;return t(O,{title:`${n} saved ${n===1?"request":"requests"} locked`,subtitle:`Your plan keeps ${a}. Upgrade to Pro to unlock the rest.`,onPress:x})};return d(u,{style:r.root,children:[d(u,{style:r.toolbar,children:[t(N,{size:11,color:e.semantic.debug}),d(b,{style:r.toolbarTitle,children:["SAVED \xB7 ",o.length,a>=M?"":`/${a}`]}),y?t(P,{value:()=>U(l,v),size:13,buttonStyle:r.toolbarButton,colors:{idle:e.text.secondary,success:e.semantic.success,error:e.semantic.error},disabled:l.length===0}):null,t(V,{onPress:C,"sentry-label":"ignore clear saved",style:r.toolbarClear,disabled:o.length===0,children:t(b,{style:[r.toolbarClearText,o.length===0&&r.toolbarClearTextDisabled],children:"Clear all"})})]}),o.length>0?d(u,{style:r.searchRow,children:[t(j,{size:13,color:e.text.secondary}),t(D,{style:r.searchInput,placeholder:"Search saved requests\u2026",placeholderTextColor:e.text.muted,value:s,onChangeText:w,"sentry-label":"ignore saved search",accessibilityLabel:"Search saved requests",autoCapitalize:"none",autoCorrect:false,returnKeyType:"search"})]}):null,o.length===0||s.trim().length>0&&l.length===0&&n===0?t(F,{testID:"buoy-network-saved-empty",...H({subject:"saved requests",verb:"kept",search:o.length===0?"":s,total:o.length,waiting:{otto:"empty",title:"No saved requests",message:"Open a request and tap the bookmark to keep it here \u2014 saved requests survive Clear and app restarts."}})}):t(q,{keyboardShouldPersistTaps:"handled",data:l,renderItem:I,keyExtractor:X,contentContainerStyle:r.listContent,showsVerticalScrollIndicator:true,scrollEnabled:true,..._,extraData:h,"sentry-label":"ignore saved requests list",ListFooterComponent:z})]})}const r=B.create({root:{flex:1,minHeight:0},toolbar:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},toolbarTitle:{flex:1,color:e.semantic.debug,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:$},toolbarButton:{width:26,height:26,borderRadius:6,alignItems:"center",justifyContent:"center"},toolbarClear:{paddingHorizontal:6,paddingVertical:2},toolbarClearText:{color:e.text.muted,fontSize:10},toolbarClearTextDisabled:{color:e.text.disabled},searchRow:{flexDirection:"row",alignItems:"center",gap:6,marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5,backgroundColor:e.background.input,borderRadius:10,borderWidth:1,borderColor:e.border.default},searchInput:{flex:1,color:e.text.primary,fontSize:13,paddingVertical:2},listContent:{paddingTop:4}});
|
package/lib/web/index.mjs
CHANGED
|
@@ -40,7 +40,7 @@ ${JSON.stringify(S.responseHeaders,null,2)}
|
|
|
40
40
|
\`\`\`json
|
|
41
41
|
${JSON.stringify(S.responseData,null,2)}
|
|
42
42
|
\`\`\`
|
|
43
|
-
`};return J(Ho,{children:[J(ht,{testID:"buoy-network-detail-scroll",style:R.container,children:[J(f,{style:R.requestDetailsSection,children:[J(f,{style:R.httpHeader,children:[C(f,{style:R.httpMethodBadge,children:C(b,{style:R.httpMethod,children:e.method})}),e.status?C(f,{style:[R.httpStatusBadge,{backgroundColor:`${n?.color}20`}],children:J(b,{style:[R.httpStatusText,{color:n?.color}],children:[n?.text," ",n?.meaning]})}):i?J(f,{style:R.pendingBadge,children:[C(Do,{size:10,color:B.color.warning}),C(b,{style:R.pendingBadgeText,children:"Pending"})]}):null,e.condition&&J(b,{style:{color:"#FFCC66"},children:["Conditions: ",e.condition.profile," (+",e.condition.delayMs," ms)"]}),e.duration?J(f,{style:R.httpDuration,children:[C(Do,{size:10,color:B.color.textTertiary}),C(b,{style:R.httpDurationText,children:Lr(e.duration)})]}):null,e.override?J(f,{style:R.overrideBadge,children:[C(Id,{size:10,color:B.color.warning}),C(b,{style:R.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,s?C(vi,{value:H,buttonStyle:R.copyFullButton}):C(N,{style:R.copyFullButton,onPress:()=>a(true),activeOpacity:.7,children:C(bi,{size:14,color:B.color.textSecondary})})]}),C(jd,{url:e.url,requestData:E,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient,isPro:s,onUpgradePress:()=>a(true)}),e.error?J(f,{style:R.errorBox,children:[C(wd,{size:12,color:B.color.danger}),C(b,{style:R.errorText,children:e.error})]}):null]}),J(f,{style:R.timingSection,children:[J(f,{style:R.timingRow,children:[C(Do,{size:12,color:B.color.textSecondary}),C(b,{style:R.timingLabel,children:"Started:"}),C(b,{style:R.timingValue,children:Ld(e.timestamp)}),J(b,{style:R.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?J(f,{style:R.sizeRow,children:[e.requestSize!==void 0?J(f,{style:R.sizeItem,children:[C(fi,{size:10,color:B.color.info}),C(b,{style:R.sizeLabel,children:"Sent:"}),C(b,{style:R.sizeValue,children:Ye(e.requestSize)})]}):null,e.responseSize!==void 0?J(f,{style:R.sizeItem,children:[C(gi,{size:10,color:qr}),C(b,{style:R.sizeLabel,children:"Received:"}),C(b,{style:R.sizeValue,children:Ye(e.responseSize)})]}):null]}):null]}),e.timings?J(Ho,{children:[C(f,{style:R.phaseDivider}),C($d,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),C(xt,{title:"Request Headers",icon:C(fi,{size:14,color:B.color.info}),defaultOpen:false,count:Object.keys(I).length,children:Object.keys(I).length>0?C(f,{style:R.dataViewerContainer,children:C(nr,{title:"",data:I,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):C(b,{style:R.emptyText,children:"No request headers"})}),C(xt,{title:"Response Headers",icon:C(gi,{size:14,color:qr}),defaultOpen:false,count:Object.keys(D).length,children:Object.keys(D).length>0?C(f,{style:R.dataViewerContainer,children:C(nr,{title:"",data:D,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):C(b,{style:R.emptyText,children:"No response headers yet"})}),E!==void 0?C(xt,{title:"Request Body",icon:C(Pr,{size:14,color:B.color.accent}),defaultOpen:false,children:C(f,{style:R.dataViewerContainer,children:o?C(nr,{title:"",data:E,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):C(Ci,{})})}):u?C(xt,{title:"Request Body",icon:C(Pr,{size:14,color:B.color.accent}),defaultOpen:true,children:C(b,{style:R.emptyText,children:m?`Loading request body (${Ye(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,g!==void 0?C(xt,{title:"Response Body",icon:C(Pr,{size:14,color:qr}),defaultOpen:true,children:C(f,{style:R.dataViewerContainer,children:o?C(nr,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):C(Ci,{})})}):v?C(xt,{title:"Response Body",icon:C(Pr,{size:14,color:qr}),defaultOpen:true,children:C(b,{style:R.emptyText,children:m?`Loading response body (${Ye(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,C(xt,{title:"Filter Options",icon:C(kd,{size:14,color:B.color.warning}),defaultOpen:false,children:C(f,{style:R.filterOptionsContainer,children:(()=>{let S="",z="";try{let h=new URL(e.url);S=h.hostname,z=h.pathname}catch{z=e.url}let w=t.has(S),p=t.has(z);return J(Ho,{children:[J(N,{style:[R.filterOption,w&&R.filterOptionActive],onPress:()=>S&&r(S),children:[J(f,{style:R.filterOptionLeft,children:[C(Rd,{size:16,color:w?B.color.warning:B.color.textTertiary}),J(f,{style:R.filterOptionContent,children:[C(b,{style:R.filterOptionLabel,children:"Ignore Domain"}),C(b,{style:R.filterOptionValue,children:S||"N/A"})]})]}),C(f,{style:[R.filterToggle,w&&R.filterToggleActive],children:C(b,{style:[R.filterToggleText,w&&R.filterToggleTextActive],children:w?"IGNORED":"IGNORE"})})]}),J(N,{style:[R.filterOption,p&&R.filterOptionActive],onPress:()=>z&&r(z),children:[J(f,{style:R.filterOptionLeft,children:[C(Ed,{size:16,color:p?B.color.warning:B.color.textTertiary}),J(f,{style:R.filterOptionContent,children:[C(b,{style:R.filterOptionLabel,children:"Ignore URL Pattern"}),C(b,{style:R.filterOptionValue,numberOfLines:1,children:z||"N/A"})]})]}),C(f,{style:[R.filterToggle,p&&R.filterToggleActive],children:C(b,{style:[R.filterToggleText,p&&R.filterToggleTextActive],children:p?"IGNORED":"IGNORE"})})]}),C(f,{style:R.filterInfoBox,children:C(b,{style:R.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),C(Bd,{visible:l,onClose:()=>a(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})}),R=he.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:B.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:B.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:B.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:B.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:B.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:B.color.warningSoft},overrideBadgeText:{color:B.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:B.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:B.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:B.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:B.color.textSecondary,fontSize:11,fontFamily:Ht},urlQueryString:{color:B.color.info,fontSize:11,fontFamily:Ht},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:B.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:B.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:B.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:B.color.textSecondary,fontSize:11},timingValue:{color:B.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:B.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:B.color.textTertiary,fontSize:10},sizeValue:{color:B.color.info,fontSize:10,fontFamily:Ht,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:B.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:B.color.textSecondary},phaseHint:{fontSize:10,color:B.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:B.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:Ht,color:B.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:B.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:B.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:B.color.textTertiary,fontSize:11.5,fontFamily:Ht},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:B.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:B.color.danger,fontSize:11,flex:1},emptyText:{color:B.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:B.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:B.color.border},filterOptionActive:{backgroundColor:B.color.warningSoft,borderColor:B.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:B.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:B.color.text,fontSize:13,fontFamily:Ht},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:B.color.bg,borderWidth:1,borderColor:B.color.border},filterToggleActive:{backgroundColor:B.color.warningSoft,borderColor:B.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:B.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:B.color.warning},filterInfoBox:{backgroundColor:B.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:B.color.info+"33"},filterInfoText:{color:B.color.textSecondary,fontSize:11,lineHeight:16}});q();pe();import{DynamicFilterView as Ri,macOSColors as je,FileText as Ei,FileCode as Ii,Link as Fd,Zap as Wd,Settings as Vd,Hash as Ud,Eye as _d,ToolbarCopyButton as Xd,formatRelativeTime as Jd,useFeatureGate as Gd,ProFeatureBanner as Kd,ExportPreview as Qd,monoFont as Pi}from"@buoy-gg/shared-ui/web";import{DataViewer as Zd}from"@buoy-gg/shared-ui/web/dataViewer";import{useCallback as Ve,useMemo as wt,useState as Yd}from"react";import{Fragment as eu,jsx as Me,jsxs as Bi}from"react/jsx-runtime";var tu={includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"},ir={urls:{includeMethod:true,includeStatus:false,includeDuration:false,includeTimestamp:false,includeClient:false,includeSizes:false,includeErrors:false,includeRequestHeaders:false,includeResponseHeaders:false,includeRequestBody:false,includeResponseBody:false,bodySizeThreshold:10,format:"plaintext",filterMode:"all"},llm:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"},json:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"json",filterMode:"all"},full:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"markdown",filterMode:"all"}};function ru(e){for(let[t,r]of Object.entries(ir))if(Object.keys(r).every(o=>r[o]===e[o]))return t;return null}var ou=100*1024,nu=500*1024;function iu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function su({settings:e,onSettingsChange:t,events:r=[]}){let{isPro:o}=Gd(),n=Oo(),[i,s]=Yd(false),l=r.length>0,a=wt(()=>{if(!l)return null;let p=r.map(h=>typeof h.timestamp=="number"?h.timestamp:new Date(h.timestamp).getTime());return Math.max(...p)},[r,l]),d=wt(()=>ru(e),[e]),u=Ve(()=>{t(ir.urls)},[t]),v=Ve(()=>{t(ir.llm)},[t]),T=Ve(()=>{t(ir.json)},[t]),x=Ve(()=>{t(ir.full)},[t]),L=Ve((p,h)=>{let[c,y]=p.split("::");if(c==="preset"){switch(y){case"urls":u();break;case"llm":v();break;case"json":T();break;case"full":x();break}return}if(c==="requestInfo"){t({...e,[y]:!e[y]});return}if(c==="headers"){t({...e,[y]:!e[y]});return}if(c==="body"){t(y==="bodySizeThreshold"?{...e,bodySizeThreshold:h}:{...e,[y]:!e[y]});return}if(c==="format"){t({...e,format:h});return}c==="filter"&&t({...e,filterMode:h})},[e,t,u,v,T,x]),m=wt(()=>({method:"POST",url:"https://api.example.com/v1/users",status:201,duration:342,timestamp:new Date().toISOString(),requestHeaders:{"Content-Type":"application/json",Authorization:"Bearer ***"},responseHeaders:{"Content-Type":"application/json","X-Request-ID":"abc123"},requestBody:{name:"John Doe",email:"john@example.com"},responseBody:{id:"user_123",name:"John Doe",email:"john@example.com",createdAt:"2025-01-10T12:00:00Z"}}),[]),k=wt(()=>l?r:[m],[l,r,m]),E=wt(()=>{let p=l?r:[m],h=0;for(let c of p){if(e.includeMethod&&(h+=(c.url?.length||0)+10),e.includeStatus&&(h+=30),e.includeTimestamp&&(h+=30),e.includeRequestHeaders)try{h+=JSON.stringify(c.requestHeaders||{}).length}catch{h+=100}if(e.includeRequestBody){let y="requestBody"in c?c.requestBody:c.requestData;try{h+=JSON.stringify(y||{}).length}catch{h+=100}}if(e.includeResponseBody){let y="responseBody"in c?c.responseBody:c.responseData;try{h+=JSON.stringify(y||{}).length}catch{h+=100}}}return h},[l,r,m,e]),g=wt(()=>E>=nu?"danger":E>=ou?"warning":"none",[E]),I=Ve(()=>{let p=l?r:[m],{format:h,includeMethod:c,includeStatus:y,includeTimestamp:O,includeRequestHeaders:re,includeRequestBody:ne,includeResponseBody:ee}=e,X=A=>{let W={};return c&&(W.method=A.method,W.url=A.url),y&&(W.status=A.status,W.duration=A.duration),O&&(W.timestamp=A.timestamp),re&&(W.requestHeaders=A.requestHeaders),ne&&(W.requestBody="requestBody"in A?A.requestBody:A.requestData),ee&&(W.responseBody="responseBody"in A?A.responseBody:A.responseData),W};if(h==="json"){let A=p.map(X);return JSON.stringify(A,null,2)}return h==="markdown"?p.map((A,W)=>{let $=[];$.push(`# Request ${W+1}`),c&&$.push(`
|
|
43
|
+
`};return J(Ho,{children:[J(ht,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-detail-scroll",style:R.container,children:[J(f,{style:R.requestDetailsSection,children:[J(f,{style:R.httpHeader,children:[C(f,{style:R.httpMethodBadge,children:C(b,{style:R.httpMethod,children:e.method})}),e.status?C(f,{style:[R.httpStatusBadge,{backgroundColor:`${n?.color}20`}],children:J(b,{style:[R.httpStatusText,{color:n?.color}],children:[n?.text," ",n?.meaning]})}):i?J(f,{style:R.pendingBadge,children:[C(Do,{size:10,color:B.color.warning}),C(b,{style:R.pendingBadgeText,children:"Pending"})]}):null,e.condition&&J(b,{style:{color:"#FFCC66"},children:["Conditions: ",e.condition.profile," (+",e.condition.delayMs," ms)"]}),e.duration?J(f,{style:R.httpDuration,children:[C(Do,{size:10,color:B.color.textTertiary}),C(b,{style:R.httpDurationText,children:Lr(e.duration)})]}):null,e.override?J(f,{style:R.overrideBadge,children:[C(Id,{size:10,color:B.color.warning}),C(b,{style:R.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,s?C(vi,{value:H,buttonStyle:R.copyFullButton}):C(N,{style:R.copyFullButton,onPress:()=>a(true),activeOpacity:.7,children:C(bi,{size:14,color:B.color.textSecondary})})]}),C(jd,{url:e.url,requestData:E,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient,isPro:s,onUpgradePress:()=>a(true)}),e.error?J(f,{style:R.errorBox,children:[C(wd,{size:12,color:B.color.danger}),C(b,{style:R.errorText,children:e.error})]}):null]}),J(f,{style:R.timingSection,children:[J(f,{style:R.timingRow,children:[C(Do,{size:12,color:B.color.textSecondary}),C(b,{style:R.timingLabel,children:"Started:"}),C(b,{style:R.timingValue,children:Ld(e.timestamp)}),J(b,{style:R.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?J(f,{style:R.sizeRow,children:[e.requestSize!==void 0?J(f,{style:R.sizeItem,children:[C(fi,{size:10,color:B.color.info}),C(b,{style:R.sizeLabel,children:"Sent:"}),C(b,{style:R.sizeValue,children:Ye(e.requestSize)})]}):null,e.responseSize!==void 0?J(f,{style:R.sizeItem,children:[C(gi,{size:10,color:qr}),C(b,{style:R.sizeLabel,children:"Received:"}),C(b,{style:R.sizeValue,children:Ye(e.responseSize)})]}):null]}):null]}),e.timings?J(Ho,{children:[C(f,{style:R.phaseDivider}),C($d,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),C(xt,{title:"Request Headers",icon:C(fi,{size:14,color:B.color.info}),defaultOpen:false,count:Object.keys(I).length,children:Object.keys(I).length>0?C(f,{style:R.dataViewerContainer,children:C(nr,{title:"",data:I,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):C(b,{style:R.emptyText,children:"No request headers"})}),C(xt,{title:"Response Headers",icon:C(gi,{size:14,color:qr}),defaultOpen:false,count:Object.keys(D).length,children:Object.keys(D).length>0?C(f,{style:R.dataViewerContainer,children:C(nr,{title:"",data:D,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):C(b,{style:R.emptyText,children:"No response headers yet"})}),E!==void 0?C(xt,{title:"Request Body",icon:C(Pr,{size:14,color:B.color.accent}),defaultOpen:false,children:C(f,{style:R.dataViewerContainer,children:o?C(nr,{title:"",data:E,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):C(Ci,{})})}):u?C(xt,{title:"Request Body",icon:C(Pr,{size:14,color:B.color.accent}),defaultOpen:true,children:C(b,{style:R.emptyText,children:m?`Loading request body (${Ye(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,g!==void 0?C(xt,{title:"Response Body",icon:C(Pr,{size:14,color:qr}),defaultOpen:true,children:C(f,{style:R.dataViewerContainer,children:o?C(nr,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):C(Ci,{})})}):v?C(xt,{title:"Response Body",icon:C(Pr,{size:14,color:qr}),defaultOpen:true,children:C(b,{style:R.emptyText,children:m?`Loading response body (${Ye(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,C(xt,{title:"Filter Options",icon:C(kd,{size:14,color:B.color.warning}),defaultOpen:false,children:C(f,{style:R.filterOptionsContainer,children:(()=>{let S="",z="";try{let h=new URL(e.url);S=h.hostname,z=h.pathname}catch{z=e.url}let w=t.has(S),p=t.has(z);return J(Ho,{children:[J(N,{style:[R.filterOption,w&&R.filterOptionActive],onPress:()=>S&&r(S),children:[J(f,{style:R.filterOptionLeft,children:[C(Rd,{size:16,color:w?B.color.warning:B.color.textTertiary}),J(f,{style:R.filterOptionContent,children:[C(b,{style:R.filterOptionLabel,children:"Ignore Domain"}),C(b,{style:R.filterOptionValue,children:S||"N/A"})]})]}),C(f,{style:[R.filterToggle,w&&R.filterToggleActive],children:C(b,{style:[R.filterToggleText,w&&R.filterToggleTextActive],children:w?"IGNORED":"IGNORE"})})]}),J(N,{style:[R.filterOption,p&&R.filterOptionActive],onPress:()=>z&&r(z),children:[J(f,{style:R.filterOptionLeft,children:[C(Ed,{size:16,color:p?B.color.warning:B.color.textTertiary}),J(f,{style:R.filterOptionContent,children:[C(b,{style:R.filterOptionLabel,children:"Ignore URL Pattern"}),C(b,{style:R.filterOptionValue,numberOfLines:1,children:z||"N/A"})]})]}),C(f,{style:[R.filterToggle,p&&R.filterToggleActive],children:C(b,{style:[R.filterToggleText,p&&R.filterToggleTextActive],children:p?"IGNORED":"IGNORE"})})]}),C(f,{style:R.filterInfoBox,children:C(b,{style:R.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),C(Bd,{visible:l,onClose:()=>a(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})}),R=he.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:B.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:B.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:B.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:B.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:B.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:B.color.warningSoft},overrideBadgeText:{color:B.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:B.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:B.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:B.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:B.color.textSecondary,fontSize:11,fontFamily:Ht},urlQueryString:{color:B.color.info,fontSize:11,fontFamily:Ht},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:B.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:B.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:B.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:B.color.textSecondary,fontSize:11},timingValue:{color:B.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:B.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:B.color.textTertiary,fontSize:10},sizeValue:{color:B.color.info,fontSize:10,fontFamily:Ht,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:B.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:B.color.textSecondary},phaseHint:{fontSize:10,color:B.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:B.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:Ht,color:B.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:B.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:B.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:B.color.textTertiary,fontSize:11.5,fontFamily:Ht},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:B.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:B.color.danger,fontSize:11,flex:1},emptyText:{color:B.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:B.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:B.color.border},filterOptionActive:{backgroundColor:B.color.warningSoft,borderColor:B.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:B.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:B.color.text,fontSize:13,fontFamily:Ht},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:B.color.bg,borderWidth:1,borderColor:B.color.border},filterToggleActive:{backgroundColor:B.color.warningSoft,borderColor:B.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:B.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:B.color.warning},filterInfoBox:{backgroundColor:B.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:B.color.info+"33"},filterInfoText:{color:B.color.textSecondary,fontSize:11,lineHeight:16}});q();pe();import{DynamicFilterView as Ri,macOSColors as je,FileText as Ei,FileCode as Ii,Link as Fd,Zap as Wd,Settings as Vd,Hash as Ud,Eye as _d,ToolbarCopyButton as Xd,formatRelativeTime as Jd,useFeatureGate as Gd,ProFeatureBanner as Kd,ExportPreview as Qd,monoFont as Pi}from"@buoy-gg/shared-ui/web";import{DataViewer as Zd}from"@buoy-gg/shared-ui/web/dataViewer";import{useCallback as Ve,useMemo as wt,useState as Yd}from"react";import{Fragment as eu,jsx as Me,jsxs as Bi}from"react/jsx-runtime";var tu={includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"},ir={urls:{includeMethod:true,includeStatus:false,includeDuration:false,includeTimestamp:false,includeClient:false,includeSizes:false,includeErrors:false,includeRequestHeaders:false,includeResponseHeaders:false,includeRequestBody:false,includeResponseBody:false,bodySizeThreshold:10,format:"plaintext",filterMode:"all"},llm:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"},json:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"json",filterMode:"all"},full:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"markdown",filterMode:"all"}};function ru(e){for(let[t,r]of Object.entries(ir))if(Object.keys(r).every(o=>r[o]===e[o]))return t;return null}var ou=100*1024,nu=500*1024;function iu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function su({settings:e,onSettingsChange:t,events:r=[]}){let{isPro:o}=Gd(),n=Oo(),[i,s]=Yd(false),l=r.length>0,a=wt(()=>{if(!l)return null;let p=r.map(h=>typeof h.timestamp=="number"?h.timestamp:new Date(h.timestamp).getTime());return Math.max(...p)},[r,l]),d=wt(()=>ru(e),[e]),u=Ve(()=>{t(ir.urls)},[t]),v=Ve(()=>{t(ir.llm)},[t]),T=Ve(()=>{t(ir.json)},[t]),x=Ve(()=>{t(ir.full)},[t]),L=Ve((p,h)=>{let[c,y]=p.split("::");if(c==="preset"){switch(y){case"urls":u();break;case"llm":v();break;case"json":T();break;case"full":x();break}return}if(c==="requestInfo"){t({...e,[y]:!e[y]});return}if(c==="headers"){t({...e,[y]:!e[y]});return}if(c==="body"){t(y==="bodySizeThreshold"?{...e,bodySizeThreshold:h}:{...e,[y]:!e[y]});return}if(c==="format"){t({...e,format:h});return}c==="filter"&&t({...e,filterMode:h})},[e,t,u,v,T,x]),m=wt(()=>({method:"POST",url:"https://api.example.com/v1/users",status:201,duration:342,timestamp:new Date().toISOString(),requestHeaders:{"Content-Type":"application/json",Authorization:"Bearer ***"},responseHeaders:{"Content-Type":"application/json","X-Request-ID":"abc123"},requestBody:{name:"John Doe",email:"john@example.com"},responseBody:{id:"user_123",name:"John Doe",email:"john@example.com",createdAt:"2025-01-10T12:00:00Z"}}),[]),k=wt(()=>l?r:[m],[l,r,m]),E=wt(()=>{let p=l?r:[m],h=0;for(let c of p){if(e.includeMethod&&(h+=(c.url?.length||0)+10),e.includeStatus&&(h+=30),e.includeTimestamp&&(h+=30),e.includeRequestHeaders)try{h+=JSON.stringify(c.requestHeaders||{}).length}catch{h+=100}if(e.includeRequestBody){let y="requestBody"in c?c.requestBody:c.requestData;try{h+=JSON.stringify(y||{}).length}catch{h+=100}}if(e.includeResponseBody){let y="responseBody"in c?c.responseBody:c.responseData;try{h+=JSON.stringify(y||{}).length}catch{h+=100}}}return h},[l,r,m,e]),g=wt(()=>E>=nu?"danger":E>=ou?"warning":"none",[E]),I=Ve(()=>{let p=l?r:[m],{format:h,includeMethod:c,includeStatus:y,includeTimestamp:O,includeRequestHeaders:re,includeRequestBody:ne,includeResponseBody:ee}=e,X=A=>{let W={};return c&&(W.method=A.method,W.url=A.url),y&&(W.status=A.status,W.duration=A.duration),O&&(W.timestamp=A.timestamp),re&&(W.requestHeaders=A.requestHeaders),ne&&(W.requestBody="requestBody"in A?A.requestBody:A.requestData),ee&&(W.responseBody="responseBody"in A?A.responseBody:A.responseData),W};if(h==="json"){let A=p.map(X);return JSON.stringify(A,null,2)}return h==="markdown"?p.map((A,W)=>{let $=[];$.push(`# Request ${W+1}`),c&&$.push(`
|
|
44
44
|
**${A.method}** ${A.url}`);let oe=[];if(y&&(oe.push(`**Status:** ${A.status}`),oe.push(`**Duration:** ${A.duration}ms`)),O&&oe.push(`**Timestamp:** ${A.timestamp}`),oe.length>0&&$.push(`
|
|
45
45
|
`+oe.join(`
|
|
46
46
|
`)),re){let ge=A.requestHeaders||{};$.push(`
|
|
@@ -87,14 +87,14 @@ ${JSON.stringify(dt||{},null,2)}
|
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
90
|
-
`);return Me(ht,{style:Tt.previewScroll,nestedScrollEnabled:true,children:Me(b,{style:Tt.markdownText,selectable:o,children:W||"No data included"})})}let A=p.map((W,$)=>{let oe=[];if(oe.push(`Request ${$+1}:`),c&&oe.push(`${W.method} ${W.url}`),y&&(oe.push(`Status: ${W.status}`),oe.push(`Duration: ${W.duration}ms`)),O&&oe.push(`Timestamp: ${W.timestamp}`),ne){let ge="requestBody"in W?W.requestBody:W.requestData;oe.push(`
|
|
90
|
+
`);return Me(ht,{keyboardShouldPersistTaps:"handled",style:Tt.previewScroll,nestedScrollEnabled:true,children:Me(b,{style:Tt.markdownText,selectable:o,children:W||"No data included"})})}let A=p.map((W,$)=>{let oe=[];if(oe.push(`Request ${$+1}:`),c&&oe.push(`${W.method} ${W.url}`),y&&(oe.push(`Status: ${W.status}`),oe.push(`Duration: ${W.duration}ms`)),O&&oe.push(`Timestamp: ${W.timestamp}`),ne){let ge="requestBody"in W?W.requestBody:W.requestData;oe.push(`
|
|
91
91
|
Request:`),oe.push(JSON.stringify(ge||{},null,2))}if(ee){let ge="responseBody"in W?W.responseBody:W.responseData;oe.push(`
|
|
92
92
|
Response:`),oe.push(JSON.stringify(ge||{},null,2))}return oe.join(`
|
|
93
93
|
`)}).join(`
|
|
94
94
|
|
|
95
95
|
---
|
|
96
96
|
|
|
97
|
-
`);return Me(ht,{style:Tt.previewScroll,nestedScrollEnabled:true,children:Me(b,{style:Tt.plaintextText,selectable:o,children:A||"No data included"})})},[e,l,r,m,o]),H=Ve(()=>{let p=(l?r:[m]).length;return Me(Qd,{expanded:i,onExpandedChange:s,summary:`${p} request${p!==1?"s":""} \u2022 ~${iu(E)}`,warningLevel:g,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},renderBody:D})},[e,l,r,m,i,E,g,D]),S=Ve(()=>{let p=l&&a?`Live data \u2022 Updated ${Jd(a,n)}`:"Mock data (no events captured)";return Bi(eu,{children:[Me(b,{style:Tt.statusLabel,children:p}),Me(Xd,{value:I()})]})},[l,a,n,I]),z=Ve(()=>H(),[H]),w=wt(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::urls",label:"URLs",icon:Fd,color:je.semantic.info,value:"urls",isActive:d==="urls"},{id:"preset::llm",label:"LLM",icon:Wd,color:je.semantic.success,value:"llm",isActive:d==="llm"},{id:"preset::json",label:"JSON",icon:Ii,color:je.semantic.warning,value:"json",isActive:d==="json"},{id:"preset::full",label:"Full",icon:Ei,color:je.semantic.info,value:"full",isActive:d==="full"},{id:"preset::custom",label:"Custom",icon:Vd,color:je.text.secondary,value:"custom",isActive:d===null}]},{id:"include",title:"Include",type:"custom",data:[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:e.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:e.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:e.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:e.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:e.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:e.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:e.includeErrors}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:Ei,color:je.semantic.info,value:"markdown",isActive:e.format==="markdown"},{id:"format::json",label:"JSON",icon:Ii,color:je.semantic.warning,value:"json",isActive:e.format==="json"},{id:"format::plaintext",label:"Text",icon:Ud,color:je.text.secondary,value:"plaintext",isActive:e.format==="plaintext"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_d,content:z,headerActions:S},onFilterChange:L}),[e,L,z,S,d]);return o?Me(Ri,{...w}):Bi(f,{style:Tt.gatedContainer,children:[Me(Kd,{featureName:"Network Export",description:"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]}),Me(f,{style:Tt.gatedPreview,children:Me(Ri,{...w})})]})}var Tt=he.create({previewScroll:{maxHeight:300},markdownText:{fontFamily:Pi,fontSize:11,color:je.text.primary,lineHeight:18},plaintextText:{fontFamily:Pi,fontSize:11,color:je.text.primary,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:je.text.muted,marginRight:8},gatedContainer:{flex:1,padding:12},gatedPreview:{flex:1}});q();pe();import{Bookmark as Li,CheckCircle as au,XCircle as lu,Clock as du,Copy as uu,Pin as cu,Trash2 as hu,CopyButton as pu,macOSColors as nt,night as te,useLimit as fu,monoFont as qi}from"@buoy-gg/shared-ui/web";q();import{isBuoyRequest as Oi,getAccountAccess as Di}from"@buoy-gg/shared-ui/web";import{BaseEventStore as gu}from"@buoy-gg/shared-ui/web";q();function zi(e){if(!e||typeof e!="object")return null;if("operationName"in e&&e.operationName){let t=e.operationName;if(typeof t=="string"&&t.trim().length>0)return t.trim()}if("query"in e&&typeof e.query=="string"){let t=e.query.match(/(?:query|mutation|subscription)\s+(\w+)/);if(t&&t[1])return t[1]}return null}q();import{isBuoyRequest as mu,devToolsStorageKeys as Ai,persistentStorage as Hi}from"@buoy-gg/shared-ui/web";import{TIER_LIMITS as yu}from"@buoy-gg/shared-ui/web";var Mo=`${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`,Or=25,it=50,Mi=yu["network.saved"].free,st=16*1024,Ni=512*1024;function No(e){if(!e||typeof e!="object")return false;let t=e;return typeof t.id=="string"&&typeof t.url=="string"&&!mu(t.url)}var bu=800;function Dr(e,t){if(!t)return{pinned:false,saved:false};let r=e.pinnedLiveIds.has(t),o=e.savedLiveIds.has(t);if(r||o)return{pinned:r,saved:o};let n=e.records.find(i=>i.event.id===t);return n?{pinned:n.pinned,saved:n.saved}:{pinned:false,saved:false}}var vu={records:[],pinnedEvents:[],savedRecords:[],pinnedLiveIds:new Set,savedLiveIds:new Set};function $i(e){if(e==null)return{value:e,truncated:false};if(typeof e=="string")return e.length<=st?{value:e,truncated:false}:{value:`${e.slice(0,st)}
|
|
97
|
+
`);return Me(ht,{keyboardShouldPersistTaps:"handled",style:Tt.previewScroll,nestedScrollEnabled:true,children:Me(b,{style:Tt.plaintextText,selectable:o,children:A||"No data included"})})},[e,l,r,m,o]),H=Ve(()=>{let p=(l?r:[m]).length;return Me(Qd,{expanded:i,onExpandedChange:s,summary:`${p} request${p!==1?"s":""} \u2022 ~${iu(E)}`,warningLevel:g,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},renderBody:D})},[e,l,r,m,i,E,g,D]),S=Ve(()=>{let p=l&&a?`Live data \u2022 Updated ${Jd(a,n)}`:"Mock data (no events captured)";return Bi(eu,{children:[Me(b,{style:Tt.statusLabel,children:p}),Me(Xd,{value:I()})]})},[l,a,n,I]),z=Ve(()=>H(),[H]),w=wt(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::urls",label:"URLs",icon:Fd,color:je.semantic.info,value:"urls",isActive:d==="urls"},{id:"preset::llm",label:"LLM",icon:Wd,color:je.semantic.success,value:"llm",isActive:d==="llm"},{id:"preset::json",label:"JSON",icon:Ii,color:je.semantic.warning,value:"json",isActive:d==="json"},{id:"preset::full",label:"Full",icon:Ei,color:je.semantic.info,value:"full",isActive:d==="full"},{id:"preset::custom",label:"Custom",icon:Vd,color:je.text.secondary,value:"custom",isActive:d===null}]},{id:"include",title:"Include",type:"custom",data:[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:e.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:e.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:e.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:e.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:e.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:e.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:e.includeErrors}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:Ei,color:je.semantic.info,value:"markdown",isActive:e.format==="markdown"},{id:"format::json",label:"JSON",icon:Ii,color:je.semantic.warning,value:"json",isActive:e.format==="json"},{id:"format::plaintext",label:"Text",icon:Ud,color:je.text.secondary,value:"plaintext",isActive:e.format==="plaintext"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_d,content:z,headerActions:S},onFilterChange:L}),[e,L,z,S,d]);return o?Me(Ri,{...w}):Bi(f,{style:Tt.gatedContainer,children:[Me(Kd,{featureName:"Network Export",description:"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]}),Me(f,{style:Tt.gatedPreview,children:Me(Ri,{...w})})]})}var Tt=he.create({previewScroll:{maxHeight:300},markdownText:{fontFamily:Pi,fontSize:11,color:je.text.primary,lineHeight:18},plaintextText:{fontFamily:Pi,fontSize:11,color:je.text.primary,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:je.text.muted,marginRight:8},gatedContainer:{flex:1,padding:12},gatedPreview:{flex:1}});q();pe();import{Bookmark as Li,CheckCircle as au,XCircle as lu,Clock as du,Copy as uu,Pin as cu,Trash2 as hu,CopyButton as pu,macOSColors as nt,night as te,useLimit as fu,monoFont as qi}from"@buoy-gg/shared-ui/web";q();import{isBuoyRequest as Oi,getAccountAccess as Di}from"@buoy-gg/shared-ui/web";import{BaseEventStore as gu}from"@buoy-gg/shared-ui/web";q();function zi(e){if(!e||typeof e!="object")return null;if("operationName"in e&&e.operationName){let t=e.operationName;if(typeof t=="string"&&t.trim().length>0)return t.trim()}if("query"in e&&typeof e.query=="string"){let t=e.query.match(/(?:query|mutation|subscription)\s+(\w+)/);if(t&&t[1])return t[1]}return null}q();import{isBuoyRequest as mu,devToolsStorageKeys as Ai,persistentStorage as Hi}from"@buoy-gg/shared-ui/web";import{TIER_LIMITS as yu}from"@buoy-gg/shared-ui/web";var Mo=`${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`,Or=25,it=50,Mi=yu["network.saved"].free,st=16*1024,Ni=512*1024;function No(e){if(!e||typeof e!="object")return false;let t=e;return typeof t.id=="string"&&typeof t.url=="string"&&!mu(t.url)}var bu=800;function Dr(e,t){if(!t)return{pinned:false,saved:false};let r=e.pinnedLiveIds.has(t),o=e.savedLiveIds.has(t);if(r||o)return{pinned:r,saved:o};let n=e.records.find(i=>i.event.id===t);return n?{pinned:n.pinned,saved:n.saved}:{pinned:false,saved:false}}var vu={records:[],pinnedEvents:[],savedRecords:[],pinnedLiveIds:new Set,savedLiveIds:new Set};function $i(e){if(e==null)return{value:e,truncated:false};if(typeof e=="string")return e.length<=st?{value:e,truncated:false}:{value:`${e.slice(0,st)}
|
|
98
98
|
|
|
99
99
|
\u2026 truncated by Buoy (body exceeded ${st} bytes)`,truncated:true};try{let t=JSON.stringify(e);return t===void 0?{value:void 0,truncated:false}:t.length<=st?{value:e,truncated:false}:{value:`${t.slice(0,st)}
|
|
100
100
|
|
|
@@ -139,7 +139,7 @@ ${JSON.stringify(n.responseData,null,2)}
|
|
|
139
139
|
`);return`# Network Requests (${r.length} total)
|
|
140
140
|
|
|
141
141
|
`+o}import{Fragment as Wu,jsx as fe,jsxs as Ct}from"react/jsx-runtime";function Vu({activeStatus:e,onToggleStatus:t,ignoredPatterns:r,paused:o}){let n=Ui({ignoredPatterns:r,paused:o});return fe(Ji,{counts:n,activeStatus:e,onToggleStatus:t})}function Ji({counts:e,activeStatus:t,onToggleStatus:r}){return Ct(f,{style:Y.headerChipRow,children:[Ct(N,{style:[Y.headerChip,t==="success"&&Y.headerChipActive],onPress:()=>r("success"),children:[fe(au,{size:12,color:nt.semantic.success}),fe(b,{style:[Y.headerChipValue,{color:nt.semantic.success}],children:e.successful})]}),Ct(N,{style:[Y.headerChip,t==="error"&&Y.headerChipActive],onPress:()=>r("error"),children:[fe(lu,{size:12,color:nt.semantic.error}),fe(b,{style:[Y.headerChipValue,{color:nt.semantic.error}],children:e.failed})]}),Ct(N,{style:[Y.headerChip,t==="pending"&&Y.headerChipActive],onPress:()=>r("pending"),children:[fe(du,{size:12,color:nt.semantic.warning}),fe(b,{style:[Y.headerChipValue,{color:nt.semantic.warning}],children:e.pending})]})]})}function Uu({paused:e}){let t=ju({paused:e});return fe(N,{"sentry-label":"ignore clear events",testID:"buoy-network-clear",accessibilityLabel:"Clear network requests",accessibilityRole:"button",onPress:()=>K.clearEvents(),style:[Y.headerActionButton,!t&&Y.headerActionButtonDisabled],disabled:!t,children:fe(hu,{size:14,color:t?te.color.textSecondary:te.color.textTertiary})})}function _u({onPress:e}){let{savedRecords:t}=Mt(),r=t.length;return Ct(N,{"sentry-label":"ignore open saved",onPress:e,accessibilityLabel:"Saved requests",style:Y.headerActionButton,children:[fe(Li,{size:14,color:r>0?te.color.accent:te.color.textSecondary}),r>0?fe(f,{style:Y.savedBadge,children:fe(b,{style:Y.savedBadgeText,children:r>99?"99+":r})}):null]})}function Gi({isPro:e,onUpgradePress:t}){let r=$o(),o=Mt(),{pinned:n,saved:i}=Dr(o,r),s=fu("network.saved"),l=!n&&o.pinnedEvents.length>=Or,a=!i&&o.savedRecords.length>=s,d=()=>r?K.getEvents().find(T=>T.id===r)??ae.getEventById(r):null,u=()=>{let T=d();T&&o.togglePin(T)},v=()=>{if(a&&!e){t();return}let T=d();T&&o.toggleSave(T)};return Ct(Wu,{children:[fe(N,{"sentry-label":"ignore pin request",onPress:u,disabled:l,testID:"buoy-network-pin",accessibilityRole:"button",accessibilityLabel:n?"Unpin request":"Pin request",accessibilityHint:l?`Pin limit reached (${Or})`:void 0,style:[Y.headerActionButton,n&&Y.headerActionButtonActive,l&&Y.headerActionButtonDisabled],children:fe(cu,{size:14,active:n,color:n?te.color.accent:l?te.color.textTertiary:te.color.textSecondary})}),fe(N,{"sentry-label":"ignore save request",onPress:v,disabled:a&&e,testID:"buoy-network-save",accessibilityRole:"button",accessibilityLabel:i?"Remove from saved":"Save request",accessibilityHint:a&&e?`Saved limit reached (${it})`:void 0,style:[Y.headerActionButton,i&&Y.headerActionButtonSaved,a&&e&&Y.headerActionButtonDisabled],children:fe(Li,{size:14,color:i?te.color.accent:a&&e?te.color.textTertiary:te.color.textSecondary})})]})}function Xu({isPro:e,filter:t,ignoredPatterns:r,copySettings:o,paused:n,onUpgradePress:i,label:s}){let l=Fu({filter:t,ignoredPatterns:r,paused:n});return e?fe(pu,{value:()=>Xi(lr(dr(K.getEvents(),r),t),o),size:14,label:s,buttonStyle:s?Y.copyMenuRow:Y.headerActionButton,labelStyle:Y.copyMenuLabel,colors:{idle:l?te.color.textSecondary:te.color.textTertiary,success:nt.semantic.success,error:nt.semantic.error},disabled:!l}):Ct(N,{"sentry-label":"ignore copy pro",onPress:i,style:[s?Y.copyMenuRow:Y.headerActionButton,!l&&Y.headerActionButtonDisabled],disabled:!l,children:[fe(uu,{size:14,color:l?te.color.textSecondary:te.color.textTertiary}),s?fe(b,{style:Y.copyMenuLabel,children:s}):null]})}var Y=he.create({copyMenuRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:6,paddingVertical:11,justifyContent:"flex-start"},copyMenuLabel:{fontSize:13,fontWeight:"600",color:te.color.text},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:te.color.buttonSurface,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:te.color.border},headerChipActive:{backgroundColor:te.color.accentSoft,borderColor:te.color.accentBorderStrong},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:qi},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:te.color.buttonSurface,borderWidth:1,borderColor:te.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:te.color.accentSoft,borderColor:te.color.accentBorderStrong},headerActionButtonSaved:{backgroundColor:te.color.accentSoft,borderColor:te.color.accentBorderStrong},savedBadge:{position:"absolute",top:-3,right:-3,minWidth:14,height:14,paddingHorizontal:3,borderRadius:7,backgroundColor:te.color.accent,alignItems:"center",justifyContent:"center"},savedBadgeText:{color:te.color.onAccent,fontSize:9,fontWeight:"700",fontFamily:qi}});q();pe();import{useCallback as Ju}from"react";import{FlaskConical as Gu,Pin as Ku,Power as Qu,macOSColors as ve,ToolEmptyState as Zu,resolveListEmptyState as Yu,EVENT_LIST_PRESET as ec,monoFont as tc}from"@buoy-gg/shared-ui/web";q();pe();import{memo as rc}from"react";import{ChevronRight as oc,Upload as nc,Download as ic,Clock as sc,AlertCircle as ac,Bookmark as lc,FlaskConical as dc,Pin as uc,DevToolsCard as cc,MethodBadge as hc,TypeBadge as pc,night as Te,macOSColors as Nt,monoFont as jo}from"@buoy-gg/shared-ui/web";import{formatRelativeTime as fc}from"@buoy-gg/shared-ui/web";import{jsx as ie,jsxs as Xe}from"react/jsx-runtime";function gc(e,t){return t?Nt.semantic.error:e?e>=200&&e<300?Nt.semantic.success:e>=300&&e<400?Nt.semantic.info:e>=400?Nt.semantic.error:Nt.text.muted:Nt.semantic.warning}function mc(e){let t=e?.["content-type"]||e?.["Content-Type"]||"";return t.includes("json")?"JSON":t.includes("xml")?"XML":t.includes("html")?"HTML":t.includes("text")?"TEXT":t.includes("image")?"IMG":t.includes("video")?"VIDEO":t.includes("audio")?"AUDIO":t.includes("form")?"FORM":null}function Ki(e){switch(e){case"fetch":return{backgroundColor:"rgba(74, 144, 226, 0.15)",color:"#4A90E2"};case"graphql":return{backgroundColor:"rgba(229, 53, 171, 0.15)",color:"#E535AB"};case"grpc-web":return{backgroundColor:"rgba(16, 185, 129, 0.15)",color:"#10B981"};case"xhr":return{backgroundColor:"rgba(245, 158, 11, 0.15)",color:"#F59E0B"};default:return{backgroundColor:"rgba(147, 51, 234, 0.15)",color:"#9333EA"}}}function yc({event:e,isPending:t,statusColor:r}){return t?Xe(f,{style:le.pendingBadge,children:[ie(sc,{size:10,color:Te.color.warning}),ie(b,{style:le.pendingText,children:"..."})]}):e.error?Xe(f,{style:le.errorBadge,children:[ie(ac,{size:10,color:Te.color.danger}),ie(b,{style:le.errorText,children:"ERR"})]}):ie(f,{style:le.statusBadge,children:ie(b,{style:[le.statusText,{color:r}],children:String(e.status)})})}function bc({requestSize:e,responseSize:t}){return!e&&!t?null:Xe(f,{style:le.sizeRow,children:[e?Xe(f,{style:le.sizeItem,children:[ie(nc,{size:8,color:Te.color.info}),ie(b,{style:le.sizeText,children:Ye(e)})]}):null,t?Xe(f,{style:le.sizeItem,children:[ie(ic,{size:8,color:Te.color.accent}),ie(b,{style:le.sizeText,children:Ye(t)})]}):null]})}function vc({timestamp:e,duration:t}){let r=Oo(),o=fc(e,r);return t?Xe(b,{style:le.bottomRightText,children:[Lr(t)," ",o]}):ie(b,{style:le.bottomRightText,children:o})}var $t=rc(function({event:e,onPress:t,pinned:r=false,saved:o=false,overridden:n=false,onLongPress:i}){let s=gc(e.status,e.error),l=!e.status&&!e.error,a=mc(e.responseHeaders),d=e.path||e.url.replace(/^https?:\/\/[^/]+/,"");return e.requestClient==="graphql"?e.operationName?d=xi(e.operationName,e.graphqlVariables):d=d.replace(/\/graphql[^?]*/,"/graphql"):e.operationName&&(d=`${d}
|
|
142
|
-
(${e.operationName})`),Xe(cc,{onPress:()=>t(e),onLongPress:i?()=>i(e):void 0,style:le.cardWrapper,contentStyle:[le.container,{borderLeftColor:s}],testID:`buoy-network-row-${e.id}`,accessibilityLabel:`${e.method} ${e.path||e.url}`,children:[Xe(f,{style:le.topRightContainer,children:[r?ie(uc,{size:10,active:true,color:Te.color.info}):null,o?ie(lc,{size:10,color:Te.color.accent}):null,n||e.override?ie(dc,{size:10,color:Te.color.warning}):null,ie(yc,{event:e,isPending:l,statusColor:s}),e.requestClient?ie(f,{style:[le.topRightBadge,{backgroundColor:Ki(e.requestClient).backgroundColor}],children:ie(b,{style:[le.clientText,{color:Ki(e.requestClient).color}],children:e.requestClient==="graphql"?"GQL":e.requestClient==="grpc-web"?"gRPC":e.requestClient==="xhr"?"XHR":e.requestClient})}):null]}),Xe(f,{style:le.leftSection,children:[ie(hc,{method:e.method,size:"small"}),ie(bc,{requestSize:e.requestSize,responseSize:e.responseSize})]}),ie(f,{style:le.middleSection,children:ie(b,{style:le.urlText,numberOfLines:2,children:d})}),Xe(f,{style:le.rightSection,children:[a?ie(pc,{type:a,size:"small"}):null,ie(oc,{size:14,color:Te.color.textTertiary})]}),ie(f,{style:le.bottomRightContainer,children:ie(vc,{timestamp:e.timestamp,duration:e.duration})})]})});$t.displayName="NetworkEventItemCompact";var le=he.create({cardWrapper:{marginHorizontal:8},container:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(12, 12, 12, 0.9)",borderLeftWidth:3,borderLeftColor:"transparent",borderBottomWidth:1},leftSection:{marginRight:8,alignItems:"flex-start"},topRightContainer:{position:"absolute",top:1,right:1,flexDirection:"row",alignItems:"center",gap:4},topRightBadge:{paddingHorizontal:4,paddingVertical:2,borderRadius:4},middleSection:{flex:1,justifyContent:"center",paddingRight:8},urlText:{fontSize:12,color:Te.color.text,lineHeight:16,fontFamily:jo},rightSection:{flexDirection:"row",alignItems:"center",gap:6},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:Te.color.textTertiary,fontFamily:jo},statusBadge:{paddingHorizontal:4,paddingVertical:1,borderRadius:3},statusText:{fontSize:10,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:2,paddingHorizontal:4,paddingVertical:1,backgroundColor:Te.color.warningSoft,borderRadius:3},pendingText:{fontSize:10,color:Te.color.warning,fontWeight:"600"},errorBadge:{flexDirection:"row",alignItems:"center",gap:2,paddingHorizontal:4,paddingVertical:1,backgroundColor:Te.color.dangerSoft,borderRadius:3},errorText:{fontSize:10,color:Te.color.danger,fontWeight:"600"},durationText:{fontSize:9,color:Te.color.textSecondary},sizeRow:{flexDirection:"row",gap:4,marginTop:4},sizeItem:{flexDirection:"row",alignItems:"center",gap:2},sizeText:{fontSize:8,color:Te.color.textSecondary,fontFamily:jo},clientText:{fontSize:8,fontWeight:"700",letterSpacing:.3,textTransform:"uppercase"}});q();pe();import{ProBadge as Sc,Zap as xc,buoyColors as ur}from"@buoy-gg/shared-ui/web";import{jsx as Mr,jsxs as Fo}from"react/jsx-runtime";function Qi({title:e,subtitle:t,onPress:r}){return Fo(N,{style:cr.banner,onPress:r,activeOpacity:.8,children:[Fo(f,{style:cr.content,children:[Fo(f,{style:cr.left,children:[Mr(xc,{size:16,color:ur.primary}),Mr(b,{style:cr.title,children:e})]}),Mr(Sc,{})]}),Mr(b,{style:cr.subtitle,children:t})]})}var cr=he.create({banner:{backgroundColor:ur.card,borderRadius:10,borderWidth:1,borderColor:ur.primary+"40",padding:12,marginHorizontal:12,marginTop:12,marginBottom:34},content:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:4},left:{flexDirection:"row",alignItems:"center",gap:8},title:{color:ur.text,fontSize:13,fontWeight:"600"},subtitle:{color:ur.textMuted,fontSize:11}});q();import{useEffect as Zi,useMemo as Nr,useState as wc}from"react";import{useLimit as Tc}from"@buoy-gg/shared-ui/web";function hr(e){let{filter:t,ignoredPatterns:r,paused:o,visible:n=true,isPro:i}=e,s=Tc("network.requests"),l=i?1/0:s,[a,d]=wc(()=>K.getEvents());Zi(()=>{if(!n)return;if(o){d(K.getEvents());return}let m=null,k=null,E=K.subscribeToEvents(g=>{k=g,m==null&&(m=requestAnimationFrame(()=>{m=null,k&&d(k),k=null}))});return()=>{E(),m!=null&&cancelAnimationFrame(m)}},[o,n]),Zi(()=>K.onClear(()=>{d([])}),[]);let u=Nr(()=>dr(a,r),[a,r]),v=Nr(()=>lr(u,t),[u,t]),T=Nr(()=>{let m=new Set;return a.slice(l).forEach(k=>{m.add(k.id)}),m},[a,l]),x=Nr(()=>T.size===0?v:v.filter(m=>!T.has(m.id)),[v,T]),L=v.length-x.length;return{events:v,visibleEvents:x,hasLockedEvents:L>0,lockedEventCount:L,totalEvents:u.length}}q();import{useCallback as jt,useSyncExternalStore as Cc}from"react";q();import{devToolsStorageKeys as $r,persistentStorage as Yi}from"@buoy-gg/shared-ui/web";var kc=800,Rc=3;function Ec(){let e=`${$r.network.overrides()}_launch`;try{let t=globalThis.sessionStorage;if(!t)return false;if(t.getItem(e))return true;t.setItem(e,"1")}catch{}return false}var Ic=Object.freeze([]),Pc=250,Bc=["respond","fail","delay"];function es(e){if(!Array.isArray(e))return[];let t=[];for(let r of e){if(!r||typeof r!="object")continue;let o=r;if(typeof o.id!="string"||typeof o.urlPattern!="string"||!o.urlPattern)continue;let n=Bc.includes(o.kind)?o.kind:"respond";t.push({id:o.id,enabled:o.enabled!==false,name:typeof o.name=="string"?o.name:void 0,urlPattern:o.urlPattern,methods:Array.isArray(o.methods)?o.methods.filter(i=>typeof i=="string"):void 0,requireHeader:typeof o.requireHeader=="string"&&o.requireHeader?o.requireHeader:void 0,bodyIncludes:typeof o.bodyIncludes=="string"&&o.bodyIncludes?o.bodyIncludes:void 0,kind:n,status:typeof o.status=="number"?Math.min(Zt,Math.max(Qt,o.status)):void 0,statusText:typeof o.statusText=="string"?o.statusText:void 0,headers:o.headers&&typeof o.headers=="object"?o.headers:void 0,body:typeof o.body=="string"?o.body:void 0,failKind:o.failKind==="timeout"?"timeout":void 0,delayMs:typeof o.delayMs=="number"?o.delayMs:void 0,times:typeof o.times=="number"?o.times:null,alternate:o.alternate===true,hits:0,seen:0,createdAt:typeof o.createdAt=="number"?o.createdAt:0})}return t.slice(0,Fe)}var Lc=class{constructor(){this.rules=[];this.enabled=true;this.listeners=new Set;this.loaded=false;this.loadPromise=null;this.dirty=false;this.idCounter=0;this.state={enabled:true,rules:[],autoPaused:false};this.launchStreak=0;this.autoPaused=false;this.keepAlive=null;this.hitEmitTimer=null;this.engineDisabled=false;this.remote=null;this.remoteEchoUntil=0}enableRemoteMode(e){this.remote=e,this.disableEngine()}disableRemoteMode(){this.remote=null}replaceRules(e,t=false){this.remote&&(!t&&ue()<this.remoteEchoUntil||(this.enabled=e.enabled,this.rules=e.rules,this.rebuild(),this.emit()))}markLocalEdit(){this.remote&&(this.remoteEchoUntil=ue()+kc)}disableEngine(){this.engineDisabled=true,this.keepAlive&&(this.keepAlive(),this.keepAlive=null,mt()===0&&Yt())}getState(){return this.state}getRules(){return this.engineDisabled||!this.enabled?Ic:this.rules}async fetchRuleBody(e){let t=this.rules.find(r=>r.id===e);if(!t)return null;if(!t.bodyOmitted)return t.body??null;if(!this.remote?.getRuleBody)return null;try{return await this.remote.getRuleBody(e)}catch{return null}}activeCount(){return this.enabled?this.rules.filter(e=>e.enabled&&!xo(e)).length:0}subscribe(e){return this.listeners.add(e),this.ensureLoaded(),()=>{this.listeners.delete(e)}}setEnabled(e){this.enabled!==e&&(this.remote?.setEnabled(e),this.markLocalEdit(),this.markTouched(),this.enabled=e,this.commit(this.rules))}addRule(e){if(this.rules.length>=Fe)return null;let t={...e,id:`ovr_${Date.now().toString(36)}_${++this.idCounter}`,hits:0,seen:0,createdAt:Date.now()};return this.commit([t,...this.rules]),t}upsertRule(e){this.remote?.upsertRule(e),this.markLocalEdit(),this.markTouched();let{id:t,...r}=e;return t&&this.rules.some(o=>o.id===t)?(this.updateRule(t,r),this.rules.find(o=>o.id===t)??null):this.addRule(r)}replaceAllRules(e,t){if(this.remote)return null;this.markTouched();let r=e.map(o=>o&&typeof o=="object"&&typeof o.id=="string"?o:{...o,id:`ovr_${Date.now().toString(36)}_${++this.idCounter}`,createdAt:Date.now()});return this.enabled=t,this.commit(es(r)),this.rules.slice()}updateRule(e,t){let r=this.rules.findIndex(n=>n.id===e);if(r===-1)return;let o=[...this.rules];o[r]={...o[r],...t,hits:0,seen:0},this.commit(o)}setRuleEnabled(e,t){let r=this.rules.findIndex(n=>n.id===e);if(r===-1||this.rules[r].enabled===t)return;this.remote?.setRuleEnabled(e,t),this.markLocalEdit(),this.markTouched();let o=[...this.rules];o[r]={...o[r],enabled:t,hits:t?0:o[r].hits,seen:t?0:o[r].seen},this.commit(o)}removeRule(e){let t=this.rules.filter(r=>r.id!==e);t.length!==this.rules.length&&(this.remote?.removeRule(e),this.markLocalEdit(),this.markTouched(),this.commit(t))}clearRules(){this.rules.length!==0&&(this.remote?.clearRules(),this.markLocalEdit(),this.markTouched(),this.commit([]))}recordMatch(e){let t=this.rules.findIndex(o=>o.id===e);if(t===-1)return;let r=[...this.rules];r[t]={...r[t],seen:r[t].seen+1},this.rules=r,this.rebuild()}recordHit(e){let t=this.rules.findIndex(s=>s.id===e);if(t===-1)return;let r=this.rules[t],o=r.hits+1,n=typeof r.times=="number"&&o>=r.times,i=[...this.rules];if(i[t]={...r,hits:o,enabled:n?false:r.enabled},n){this.commit(i);return}this.rules=i,this.rebuild(),this.scheduleHitEmit()}ensureLoaded(){return this.remote||this.loaded?Promise.resolve():this.loadPromise?this.loadPromise:(this.loadPromise=(async()=>{let e=null;try{e=await Yi.getItem($r.network.overrides())}catch{}this.hydrate(e)})(),this.loadPromise)}loadNow(){if(this.remote||this.loaded||this.loadPromise)return;let e;try{e=globalThis.localStorage?.getItem($r.network.overrides())??null}catch{return}e!==null&&this.hydrate(e)}hydrate(e){try{if(e&&!this.dirty){let t=JSON.parse(e);this.enabled=t?.enabled!==false,this.rules=es(t?.rules),this.launchStreak=typeof t?.launchStreak=="number"?t.launchStreak:0,this.autoPaused=t?.autoPaused===true&&!this.enabled,this.applyLaunchGuard(),this.rebuild()}}catch{}finally{this.loaded=true,this.syncKeepAlive(),this.emit()}}applyLaunchGuard(){if(!this.enabled||this.activeCount()===0){this.launchStreak=0;return}Ec()||(this.launchStreak+=1,this.launchStreak>=Rc&&(this.enabled=false,this.autoPaused=true,this.launchStreak=0),this.persist())}syncKeepAlive(){let e=!this.engineDisabled&&this.activeCount()>0;if(e&&!this.keepAlive){ei(),this.keepAlive=er(()=>{});return}!e&&this.keepAlive&&(this.keepAlive(),this.keepAlive=null,mt()===0&&Yt())}scheduleHitEmit(){this.hitEmitTimer===null&&(this.hitEmitTimer=setTimeout(()=>{this.hitEmitTimer=null,this.emit()},Pc))}commit(e){this.dirty=true,this.rules=e.slice(0,Fe),this.rebuild(),this.syncKeepAlive(),this.emit(),this.persist()}rebuild(){this.state={enabled:this.enabled,rules:this.rules,autoPaused:this.autoPaused}}markTouched(){this.launchStreak=0,this.autoPaused=false}noteHealthyLaunch(){this.launchStreak===0&&!this.autoPaused||(this.markTouched(),this.persist(),this.rebuild(),this.emit())}persist(){this.remote||Yi.setItem($r.network.overrides(),JSON.stringify({enabled:this.enabled,rules:this.rules,launchStreak:this.launchStreak,autoPaused:this.autoPaused})).catch(()=>{})}emit(){this.listeners.forEach(e=>e())}},U=new Lc;bl({getRules:()=>U.getRules(),recordHit:e=>U.recordHit(e),recordMatch:e=>U.recordMatch(e)});typeof window<"u"&&typeof document<"u"&&!(typeof navigator<"u"&&navigator.product==="ReactNative")&&U.loadNow();function jr(){let e=Cc(jt(s=>U.subscribe(s),[]),()=>U.getState(),()=>U.getState()),t=jt(s=>U.setEnabled(s),[]),r=jt(s=>U.upsertRule(s),[]),o=jt((s,l)=>U.setRuleEnabled(s,l),[]),n=jt(s=>U.removeRule(s),[]),i=jt(()=>U.clearRules(),[]);return{enabled:e.enabled,rules:e.rules,autoPaused:e.autoPaused,activeCount:U.activeCount(),setEnabled:t,upsertRule:r,setRuleEnabled:o,removeRule:n,clearRules:i,isRuleSpent:xo}}q();function qc(e,t){if(t.length===0)return[];let r=new Set(t.map(n=>n.id)),o=new Set;for(let n of t){let i;for(let s of e){if(s.override&&r.has(s.override.ruleId)){o.add(s.id);continue}So(n,s.url,String(s.method||"GET"),s.requestHeaders)&&(s.timestamp>=n.createdAt?o.add(s.id):(!i||s.timestamp>i.timestamp)&&(i=s))}i&&o.add(i.id)}return e.filter(n=>o.has(n.id))}q();var Oc=[];function Wo(e,t,r){return t.length===0?{pinned:Oc,rest:e}:{pinned:t,rest:r.size===0?e:e.filter(o=>!r.has(o.id))}}import{jsx as Se,jsxs as kt}from"react/jsx-runtime";var Dc=e=>e.id;function zc({events:e,onEventPress:t,onLongPress:r,savedLiveIds:o,onClearPinned:n}){return e.length===0?null:kt(f,{style:xe.pinnedSection,children:[kt(f,{style:xe.pinnedHeader,children:[Se(Ku,{size:11,active:true,color:ve.semantic.info}),kt(b,{style:xe.pinnedTitle,children:["PINNED \xB7 ",e.length]}),Se(N,{onPress:n,"sentry-label":"ignore unpin all",style:xe.pinnedClear,children:Se(b,{style:xe.pinnedClearText,children:"Unpin all"})})]}),e.map(i=>Se($t,{event:i,onPress:t,onLongPress:r,pinned:true,saved:o.has(i.id)},i.id))]})}function Ac({events:e,onEventPress:t,onLongPress:r,savedLiveIds:o,paused:n,onTogglePaused:i}){return e.length===0?null:kt(f,{style:[xe.overriddenSection,n&&xe.overriddenSectionOff],children:[kt(f,{style:xe.overriddenHeader,children:[Se(Gu,{size:11,color:n?ve.text.muted:ve.semantic.warning}),Se(b,{testID:"buoy-network-overridden-strip",style:[xe.overriddenTitle,n&&xe.overriddenTitleOff],children:n?`PAUSED \xB7 ${e.length}`:`OVERRIDDEN \xB7 ${e.length}`}),Se(N,{onPress:i,"sentry-label":"ignore pause overrides",style:xe.overriddenManage,children:Se(b,{style:[xe.overriddenManageText,n&&xe.overriddenTitleOff],children:n?"Resume":"Pause"})})]}),e.map(s=>Se($t,{event:s,onPress:t,onLongPress:r,overridden:true,saved:o.has(s.id)},s.id))]})}function Hc({visible:e,paused:t,filter:r,ignoredPatterns:o,isPro:n,searchText:i,onEventPress:s,onUpgradePress:l}){let{visibleEvents:a,hasLockedEvents:d,lockedEventCount:u,totalEvents:v}=hr({filter:r,ignoredPatterns:o,paused:t,visible:e,isPro:n}),{pinnedEvents:T,pinnedLiveIds:x,savedLiveIds:L,togglePin:m,clearPinned:k}=Mt(),{rules:E,enabled:g,setEnabled:I,isRuleSpent:D}=jr(),H=Ju(X=>{m(X)},[m]);if(!e)return null;let{pinned:S,rest:z}=Wo(a,T,x),w=E.filter(X=>X.enabled&&!D(X)),p=qc([...S,...z],w),h=new Set(p.map(X=>X.id)),c=S.filter(X=>!h.has(X.id)),y=h.size?z.filter(X=>!h.has(X.id)):z,O=!t,re=({item:X})=>Se($t,{event:X,onPress:s,onLongPress:H,saved:L.has(X.id)}),ne=()=>c.length>0||p.length>0?null:Se(Zu,{testID:"buoy-network-empty",...Yu({subject:"requests",search:i,total:v,capturing:O,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})}),ee=()=>{if(!d)return null;let X=i.length>0,A=X?`${u} matching ${u===1?"request":"requests"} in locked history`:`${u} requests locked`;return Se(Qi,{title:A,subtitle:X?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history",onPress:l})};return kt(f,{style:xe.root,children:[O?null:kt(f,{style:xe.disabledBanner,children:[Se(Qu,{size:14,color:ve.semantic.warning}),Se(b,{style:xe.disabledText,children:"Network interception is disabled"})]}),Se(Ac,{events:p,onEventPress:s,onLongPress:H,savedLiveIds:L,paused:!g,onTogglePaused:()=>I(!g)}),Se(zc,{events:c,onEventPress:s,onLongPress:H,savedLiveIds:L,onClearPinned:k}),y.length>0||d?Se(po,{testID:"buoy-network-list",data:y,renderItem:re,keyExtractor:Dc,contentContainerStyle:xe.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,...ec,extraData:L,"sentry-label":"ignore network events list",ListFooterComponent:ee}):ne()]})}var xe=he.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:ve.semantic.warning+"44",backgroundColor:ve.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:ve.border.default,backgroundColor:ve.background.card},overriddenTitleOff:{color:ve.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:ve.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:ve.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:ve.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:ve.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:tc},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:ve.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:ve.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:ve.semantic.warning+"20"},disabledText:{color:ve.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});q();pe();import{useState as Mc}from"react";import{Bookmark as Nc,CopyButton as $c,Search as jc,macOSColors as Ne,useLimit as Fc,ToolEmptyState as Wc,resolveListEmptyState as Vc,EVENT_LIST_PRESET as Uc,monoFont as _c}from"@buoy-gg/shared-ui/web";q();function ts(e,t,r){let o=e.slice(0,Math.min(t,it)),n=o.map(i=>i.event);return{events:r?lr(n,{searchText:r}):n,lockedCount:e.length-o.length}}import{jsx as Je,jsxs as Fr}from"react/jsx-runtime";var Xc=e=>e.id;function rs({visible:e,isPro:t,copySettings:r,search:o,onSearchChange:n,onEventPress:i,onUpgradePress:s}){let{savedRecords:l,pinnedLiveIds:a,toggleSave:d,clearSaved:u}=Mt(),v=Fc("network.saved"),[T,x]=Mc(""),L=o!=null&&n!=null,m=L?o:T,k=L?n:x;if(!e)return null;let{events:E,lockedCount:g}=ts(l,v,m),I=S=>{d(S)},D=({item:S})=>Je($t,{event:S,onPress:i,onLongPress:I,saved:true,pinned:a.has(S.id)}),H=()=>g===0?null:Je(Qi,{title:`${g} saved ${g===1?"request":"requests"} locked`,subtitle:`Your plan keeps ${v}. Upgrade to Pro to unlock the rest.`,onPress:s});return Fr(f,{style:Ge.root,children:[Fr(f,{style:Ge.toolbar,children:[Je(Nc,{size:11,color:Ne.semantic.debug}),Fr(b,{style:Ge.toolbarTitle,children:["SAVED \xB7 ",l.length,v>=it?"":`/${v}`]}),t?Je($c,{value:()=>Xi(E,r),size:13,buttonStyle:Ge.toolbarButton,colors:{idle:Ne.text.secondary,success:Ne.semantic.success,error:Ne.semantic.error},disabled:E.length===0}):null,Je(N,{onPress:u,"sentry-label":"ignore clear saved",style:Ge.toolbarClear,disabled:l.length===0,children:Je(b,{style:[Ge.toolbarClearText,l.length===0&&Ge.toolbarClearTextDisabled],children:"Clear all"})})]}),l.length>0?Fr(f,{style:Ge.searchRow,children:[Je(jc,{size:13,color:Ne.text.secondary}),Je(zt,{style:Ge.searchInput,placeholder:"Search saved requests\u2026",placeholderTextColor:Ne.text.muted,value:m,onChangeText:k,"sentry-label":"ignore saved search",accessibilityLabel:"Search saved requests",autoCapitalize:"none",autoCorrect:false,returnKeyType:"search"})]}):null,l.length===0||m.trim().length>0&&E.length===0&&g===0?Je(Wc,{testID:"buoy-network-saved-empty",...Vc({subject:"saved requests",verb:"kept",search:l.length===0?"":m,total:l.length,waiting:{otto:"empty",title:"No saved requests",message:"Open a request and tap the bookmark to keep it here \u2014 saved requests survive Clear and app restarts."}})}):Je(po,{data:E,renderItem:D,keyExtractor:Xc,contentContainerStyle:Ge.listContent,showsVerticalScrollIndicator:true,scrollEnabled:true,...Uc,extraData:a,"sentry-label":"ignore saved requests list",ListFooterComponent:H})]})}var Ge=he.create({root:{flex:1,minHeight:0},toolbar:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},toolbarTitle:{flex:1,color:Ne.semantic.debug,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:_c},toolbarButton:{width:26,height:26,borderRadius:6,alignItems:"center",justifyContent:"center"},toolbarClear:{paddingHorizontal:6,paddingVertical:2},toolbarClearText:{color:Ne.text.muted,fontSize:10},toolbarClearTextDisabled:{color:Ne.text.disabled},searchRow:{flexDirection:"row",alignItems:"center",gap:6,marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5,backgroundColor:Ne.background.input,borderRadius:10,borderWidth:1,borderColor:Ne.border.default},searchInput:{flex:1,color:Ne.text.primary,fontSize:13,paddingVertical:2},listContent:{paddingTop:4}});q();pe();import{useCallback as Jc,useEffect as Wr,useState as Gc}from"react";import{AlertCircle as Kc,AlertTriangle as Qc,DevToolsCard as Zc,EmptyState as Yc,MethodBadge as eh,Plus as th,Trash2 as rh,macOSColors as Q,useLimit as oh,monoFont as nh}from"@buoy-gg/shared-ui/web";q();pe();import{useMemo as os,useState as Vr}from"react";import{ChevronDown as ih,ChevronRight as sh,macOSColors as _,useSafeAreaInsets as ah,monoFont as lh}from"@buoy-gg/shared-ui/web";q();pe();import{useState as Ur,useMemo as _r,useCallback as pr,useRef as Vo,useEffect as dh,memo as Xr}from"react";import{displayValue as uh,buoyColors as P,monoFont as qe}from"@buoy-gg/shared-ui/web";import{CopyButton as ch}from"@buoy-gg/shared-ui/web";import{ChevronRight as hh,ChevronDown as ph,Trash as ns}from"@buoy-gg/shared-ui/web";import{CyberpunkInput as fh}from"@buoy-gg/shared-ui/web/dataViewer";q();var Rt=(e,t,r)=>{if(t.length===0)return r;if(e instanceof Map){let o=new Map(e);if(t.length===1)return o.set(t[0],r),o;let[n,...i]=t,s=o.get(n);return o.set(n,Rt(s??null,i,r)),o}if(e instanceof Set){let o=Rt(Array.from(e),t,r);return new Set(Array.isArray(o)?o:[])}if(Array.isArray(e)){let o=[...e];if(t.length===1)return o[t[0]]=r,o;let[n,...i]=t;return o[n]=Rt(o[n],i,r),o}if(e instanceof Object){let o={...e};if(t.length===1)return o[t[0]]=r,o;let[n,...i]=t;return o[n]=Rt(o[n],i,r),o}return e};q();var Et=(e,t)=>{if(e instanceof Map){let r=new Map(e);if(t.length===1)return r.delete(t[0]),r;let[o,...n]=t;return r.set(o,Et(r.get(o),n)),r}if(e instanceof Set){let r=Et(Array.from(e),t);return new Set(r)}if(Array.isArray(e)){let r=[...e];if(t.length===1)return r.filter((i,s)=>s.toString()!==t[0]);let[o,...n]=t;return r[o]=Et(r[o],n),r}if(e instanceof Object){let r={...e};if(t.length===1)return delete r[t[0]],r;let[o,...n]=t;return r[o]=Et(r[o],n),r}return e};q();import{createContext as gh,useContext as mh}from"react";var is=gh(null);function Jr(){return mh(is)}import{Fragment as Gr,jsx as G,jsxs as Pe}from"react/jsx-runtime";var fr=100,Ft={top:8,bottom:8,left:8,right:8},ss=12,yh=(e,t=fr)=>{if(t<1||e.length===0)return[];let r=[];for(let o=0;o<e.length;o+=t)r.push(e.slice(o,o+t));return r},Uo=Xr(({expanded:e,isFocused:t=false,isMain:r=false})=>G(f,{style:[F.expanderIcon,r&&F.expanderIconMain,e?F.expanded:F.collapsed],children:e?G(ph,{size:r?14:ss,color:t?P.primary:r?P.text:P.textSecondary,strokeWidth:2.5}):G(hh,{size:r?14:ss,color:t?P.primary:r?P.text:P.textSecondary,strokeWidth:2.5})}));Uo.displayName="Expander";var as=Xr(({value:e,isFocused:t=false})=>G(ch,{value:e,isFocused:t,buttonStyle:t?{...F.buttonStyle,...F.buttonStyleFocused}:F.buttonStyle}));as.displayName="CopyButton";var _o=Xr(({dataPath:e,isFocused:t=false})=>{let r=Jr(),o=pr(()=>{r&&r.onChange(Et(r.root,e))},[r,e]);return r?G(N,{"sentry-label":"ignore devtools explorer delete button",onPress:o,style:[F.deleteButton,t&&F.deleteButtonFocused],accessibilityLabel:"Delete item",hitSlop:Ft,activeOpacity:.7,children:G(ns,{size:14,strokeWidth:2,color:t?P.error:P.error+"CC"})}):null});_o.displayName="DeleteItemButton";var ls=Xr(({dataPath:e,isFocused:t=false})=>{let r=Jr(),o=pr(()=>{r&&r.onChange(Rt(r.root,e,[]))},[r,e]);return r?G(N,{"sentry-label":"ignore devtools explorer clear button",style:[F.clearButton,t&&F.clearButtonFocused],"aria-label":"Remove all items",onPress:o,hitSlop:Ft,activeOpacity:.7,children:G(b,{style:[F.clearButtonText,{color:t?P.warning:P.warning+"CC"}],children:"[]"})}):null});ls.displayName="ClearArrayButton";function bh({dataPath:e,value:t,itemsDeletable:r}){let o=Jr(),n=pr(()=>{if(!o)return;let a=typeof t=="boolean"?t:false;o.onChange(Rt(o.root,e,!a))},[o,e,t]),i=pr(()=>{o&&o.onChange(Et(o.root,e))},[o,e]);if(!o)return null;let s=t?F.toggleBadgeTrue:F.toggleBadgeFalse,l=t?F.toggleTextTrue:F.toggleTextFalse;return Pe(N,{"sentry-label":"ignore devtools explorer toggle button",style:F.modernToggleButton,onPress:n,hitSlop:Ft,activeOpacity:.8,children:[G(f,{style:[F.toggleBadge,s],children:G(b,{style:[F.toggleBadgeText,l],children:t?"TRUE":"FALSE"})}),r&&G(N,{"sentry-label":"ignore devtools explorer delete button in toggle",onPress:i,style:F.deleteButtonInToggle,accessibilityLabel:"Delete item",hitSlop:Ft,activeOpacity:.7,children:G(ns,{size:14,strokeWidth:2,color:P.error+"CC"})})]})}function Xo({editable:e,label:t,value:r,defaultExpanded:o,dataPath:n,itemsDeletable:i,dataVersion:s=0}){let l=Jr(),[a,d]=Ur(false),[u,v]=Ur("");dh(()=>{if(r!=null&&(typeof r=="string"||typeof r=="number")){let h=r.toString();v(h)}},[r,t,s]);let T=_r(()=>{let h=t.toUpperCase();return["DATA","QUERY","QUERYKEY","TYPES","STATS","OPTIONS","OBSERVERS"].includes(h)},[t]),[x,L]=Ur((o||[]).includes(t)),m=()=>L(h=>!h),[k,E]=Ur([]),g=_r(()=>r==null||typeof r!="object"?[]:Array.isArray(r)?(r.length>1e3?r.slice(0,1e3):r).map((h,c)=>({label:c.toString(),value:h})):r instanceof Map?Array.from(r.entries()).slice(0,1e3).map(([h,c])=>({label:h.toString(),value:c})):r instanceof Set?Array.from(r).slice(0,1e3).map((h,c)=>({label:c.toString(),value:h})):Object.entries(r).slice(0,1e3).map(([h,c])=>({label:h,value:c})),[r]),I=_r(()=>Array.isArray(r)?"array":r===null||typeof r!="object"?typeof r:r instanceof Map||r instanceof Set?"Iterable":"object",[r]),D=_r(()=>yh(g,fr),[g]),H=n??[],S=Vo(l),z=Vo(H),w=Vo(I);S.current=l,z.current=H,w.current=I;let p=pr((h,c)=>{v(c);let y=S.current;if(!y||h&&isNaN(Number(c)))return;let O=w.current==="number"?Number(c):c;y.onChange(Rt(y.root,z.current,O))},[v]);return G(f,{style:F.minWidthWrapper,children:Pe(f,{style:F.fullWidthMarginRight,children:[D.length>0&&Pe(Gr,{children:[Pe(f,{style:[F.flexRowItemsCenterGap,T&&F.flexRowItemsCenterGapMain],children:[Pe(N,{"sentry-label":"ignore devtools explorer expander button",style:F.expanderButton,onPress:m,hitSlop:Ft,activeOpacity:.6,children:[G(Uo,{expanded:x,isFocused:a,isMain:T}),G(b,{style:[F.labelText,a&&F.labelTextFocused,T&&F.labelTextMain],children:t}),G(b,{style:F.textGray500,children:`${String(I).toLowerCase()==="iterable"?"(Iterable) ":""}${g.length} ${g.length>1?"items":"item"}`})]}),e&&Pe(f,{style:F.flexRowGapItemsCenter,children:[G(as,{value:r,isFocused:a}),i&&l!==null&&G(_o,{dataPath:H,isFocused:a}),I==="array"&&l!==null&&G(ls,{dataPath:H,isFocused:a})]})]}),x&&Pe(Gr,{children:[D.length===1&&G(f,{style:[F.singleEntryContainer,T&&F.singleEntryContainerMain],children:g.map((h,c)=>G(Xo,{defaultExpanded:o,label:h.label,value:h.value,editable:e,dataPath:[...H,h.label],itemsDeletable:I==="array"||I==="Iterable"||I==="object",dataVersion:s},h.label+c))}),D.length>1&&G(f,{style:F.multiEntryContainer,children:D.map((h,c)=>G(f,{children:Pe(f,{style:F.relativeOutlineNone,children:[Pe(N,{"sentry-label":"ignore devtools explorer page toggle",onPress:()=>E(y=>y.includes(c)?y.filter(O=>O!==c):[...y,c]),style:F.pageExpanderButton,hitSlop:Ft,children:[G(Uo,{expanded:k.includes(c)}),Pe(b,{style:F.pageRangeText,children:["[",c*fr,"...",c*fr+fr-1,"]"]})]}),k.includes(c)&&G(f,{style:F.entriesContainer,children:h.map(y=>G(Xo,{defaultExpanded:o,label:y.label,value:y.value,editable:e,dataPath:[...H,y.label],dataVersion:s},y.label))})]})},c))})]})]}),D.length===0&&Pe(f,{style:F.flexRowGapFullWidth,children:[e&&l!==null&&(I==="string"||I==="number"||I==="boolean")?Pe(Gr,{children:[e&&l&&(I==="string"||I==="number")&&G(f,{style:F.nebulaInputWrapper,children:G(fh,{label:t,accessibilityLabel:"Data input field for editing values",style:[I==="number"?F.textNumber:F.textString],keyboardType:I==="number"?"numeric":"default",value:u,onChangeText:h=>p(I==="number",h),onFocus:()=>d(true),onBlur:()=>d(false),showNumberControls:I==="number",onIncrement:()=>{let h=Number(u)||0;p(true,String(h+1))},onDecrement:()=>{let h=Number(u)||0;p(true,String(h-1))},showDeleteButton:i,onDelete:()=>{l.onChange(Et(l.root,H))}})}),I==="boolean"&&Pe(f,{style:F.booleanRowContainer,children:[G(b,{style:F.booleanLabel,children:t}),G(f,{style:F.booleanToggleWrapper,children:G(bh,{dataPath:H,value:r,itemsDeletable:i})})]})]}):Pe(Gr,{children:[G(b,{style:F.text344054,children:t}),G(b,{style:F.displayValueText,children:uh(r)})]}),e&&i&&l!==null&&I!=="string"&&I!=="number"&&I!=="boolean"&&G(_o,{dataPath:H,isFocused:a})]})]})})}var F=he.create({buttonStyle:{backgroundColor:P.card+"E6",borderWidth:1,borderColor:P.textSecondary+"33",borderRadius:6,flexDirection:"row",alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2},buttonStyleFocused:{borderColor:P.primary+"CC",backgroundColor:P.primary+"26",shadowColor:P.primary,shadowOpacity:.3,shadowRadius:4},deleteButton:{backgroundColor:P.error+"1A",borderColor:P.error+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:P.error,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},deleteButtonFocused:{borderColor:P.error+"CC",backgroundColor:P.error+"33",shadowOpacity:.3,shadowRadius:5},deleteButtonInToggle:{backgroundColor:P.error+"1A",borderColor:P.error+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,shadowColor:P.error,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButton:{backgroundColor:P.warning+"1A",borderWidth:1,borderColor:P.warning+"4D",borderRadius:6,flexDirection:"row",padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",zIndex:10,shadowColor:P.warning,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButtonFocused:{borderColor:P.warning+"CC",backgroundColor:P.warning+"33",shadowOpacity:.3,shadowRadius:5},clearButtonText:{fontSize:12,fontWeight:"700",fontFamily:qe},expanderIcon:{width:18,height:18,alignItems:"center",justifyContent:"center",marginRight:1,backgroundColor:P.textSecondary+"14",borderRadius:3},expanderIconMain:{backgroundColor:P.textSecondary+"1A",width:20,height:20,borderRadius:4,borderWidth:.5,borderColor:P.textSecondary+"33"},expanded:{transform:[{rotate:"0deg"}]},collapsed:{transform:[{rotate:"0deg"}]},minWidthWrapper:{minWidth:180,fontSize:11,flexDirection:"row",flexWrap:"wrap",width:"100%",marginVertical:.5},fullWidthMarginRight:{position:"relative",width:"100%",marginRight:1},flexRowItemsCenterGap:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:3,paddingHorizontal:6,marginVertical:1,borderRadius:4,backgroundColor:P.card+"66",borderWidth:.5,borderColor:P.textSecondary+"1A"},flexRowItemsCenterGapMain:{backgroundColor:P.card+"E6",borderLeftWidth:2.5,borderLeftColor:P.textSecondary+"80",borderColor:P.textSecondary+"26",paddingVertical:5,paddingHorizontal:8,marginBottom:3,borderWidth:1,shadowColor:"#000",shadowOffset:{width:0,height:0},shadowOpacity:.08,shadowRadius:3},expanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:"transparent",paddingVertical:1,paddingHorizontal:2,gap:6,borderWidth:0,minHeight:24,flex:1},labelText:{color:P.textSecondary,fontSize:10,fontWeight:"600",marginRight:4,fontFamily:qe,letterSpacing:.4},labelTextFocused:{color:P.text},labelTextMain:{color:P.text,fontSize:11,fontWeight:"700",letterSpacing:.6},textGray500:{color:P.textMuted,fontSize:10,fontWeight:"400",fontFamily:qe,opacity:.7},pageRangeText:{color:P.textSecondary,fontSize:10,fontWeight:"600",fontFamily:qe},flexRowGapItemsCenter:{flexDirection:"row",alignItems:"center",gap:4,paddingLeft:2},singleEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:P.textSecondary+"40"},singleEntryContainerMain:{borderLeftColor:P.textSecondary+"4D",marginLeft:4,paddingLeft:10},multiEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:P.textSecondary+"40"},multiEntryContainerMain:{borderLeftColor:P.textSecondary+"4D",marginLeft:4,paddingLeft:10},relativeOutlineNone:{position:"relative"},pageExpanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:P.card+"66",paddingVertical:3,paddingHorizontal:6,gap:6,borderRadius:4,borderWidth:.5,borderColor:P.textSecondary+"1A",marginBottom:2,minHeight:24},entriesContainer:{marginLeft:2,paddingLeft:8,marginTop:2,borderLeftWidth:1.5,borderLeftColor:P.textSecondary+"40"},textNumber:{color:P.text,fontWeight:"600",fontFamily:qe},textString:{color:P.text,fontFamily:qe},flexRowGapFullWidth:{flexDirection:"row",width:"100%",alignItems:"center",marginVertical:1,gap:6,paddingHorizontal:4,paddingVertical:2,borderRadius:3},text344054:{color:P.textSecondary,fontWeight:"600",fontSize:9,minWidth:50,fontFamily:qe,letterSpacing:.4,opacity:.8},numberInputButtons:{position:"absolute",right:8,top:"50%",transform:[{translateY:-18}],flexDirection:"row",gap:4,zIndex:10},touchableButton:{width:32,height:32,borderRadius:6,backgroundColor:P.card+"E6",borderWidth:1,borderColor:P.textSecondary+"33",alignItems:"center",justifyContent:"center",marginLeft:2,shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2},touchableButtonFocused:{borderColor:P.primary+"CC",backgroundColor:P.primary+"26",shadowColor:P.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:4,elevation:3},nebulaInputWrapper:{flex:1,width:"100%",position:"relative"},displayValueText:{flex:1,color:P.text,fontWeight:"400",fontFamily:qe,fontSize:12,paddingVertical:6,paddingHorizontal:10,borderRadius:6,borderWidth:1,borderColor:P.textMuted+"66",minHeight:34},dataRow:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,minHeight:44,gap:12},dataLabel:{color:P.textSecondary,fontSize:13,fontWeight:"500",minWidth:80,flexShrink:0},dataValueContainer:{flex:1,flexDirection:"row",alignItems:"center"},inputWithActions:{flex:1,position:"relative"},numberControls:{position:"absolute",right:8,top:"50%",transform:[{translateY:-16}],flexDirection:"column",gap:2},numberButton:{width:32,height:16,borderRadius:4,alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:P.primary+"0F"},readOnlyValue:{color:P.text,fontSize:13,fontFamily:qe,paddingVertical:8,paddingHorizontal:12,borderRadius:6,borderWidth:1,borderColor:P.textMuted+"33",flex:1},actionButtons:{flexDirection:"row",gap:6,paddingLeft:8},booleanContainer:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:6,borderWidth:1,borderColor:P.textMuted+"4D",flex:1},booleanText:{marginLeft:8,color:P.warning,fontWeight:"500",fontFamily:qe},modernToggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:6,borderWidth:1,borderColor:P.textMuted+"99",paddingHorizontal:8,paddingVertical:6,marginVertical:2,minHeight:34,gap:8},toggleIconContainer:{marginRight:6},toggleIcon:{padding:8,borderRadius:8,alignItems:"center",justifyContent:"center",width:32,height:32},toggleIconSmall:{width:8,height:8,borderRadius:4},toggleContent:{flex:1,minWidth:0},toggleLabel:{color:"#E5E7EB",fontSize:11,fontWeight:"600",fontFamily:qe,letterSpacing:.3},toggleStatus:{color:"#9CA3AF",fontSize:11},toggleBadge:{marginLeft:6,paddingHorizontal:6,paddingVertical:3,borderRadius:4,borderWidth:1},toggleBadgeText:{fontSize:9,fontWeight:"700",textTransform:"uppercase",letterSpacing:.8,fontFamily:qe},toggleIconTrue:{backgroundColor:P.primary},toggleIconFalse:{backgroundColor:P.textMuted},toggleBadgeTrue:{backgroundColor:P.primary+"1A",borderColor:P.primary+"4D"},toggleBadgeFalse:{backgroundColor:P.textMuted+"1A",borderColor:P.textMuted+"4D"},toggleTextTrue:{color:P.primary,fontWeight:"600"},toggleTextFalse:{color:P.textSecondary,fontWeight:"500"},booleanRowContainer:{flexDirection:"row",alignItems:"center",width:"100%",gap:8,paddingVertical:2},booleanLabel:{color:P.textSecondary,fontSize:10,fontWeight:"600",fontFamily:qe,letterSpacing:.4,minWidth:60,flexShrink:0},booleanToggleWrapper:{flex:1}});q();pe();import{useState as vh}from"react";import{absoluteFill as ds,macOSColors as Be}from"@buoy-gg/shared-ui/web";import{jsx as at,jsxs as Jo}from"react/jsx-runtime";function Go({title:e,hint:t,value:r,placeholder:o="Number",min:n,max:i,onSubmit:s,onCancel:l}){let[a,d]=vh(r!=null?String(r):""),u=()=>{let v=a.trim();if(!v){s(null);return}let T=Number(v);if(!Number.isFinite(T)){s(null);return}let x=T;n!=null&&(x=Math.max(n,x)),i!=null&&(x=Math.min(i,x)),s(x)};return Jo(f,{style:Oe.overlay,children:[at(N,{style:Oe.backdrop,activeOpacity:1,onPress:l,"sentry-label":"ignore dismiss number prompt"}),Jo(f,{style:Oe.panel,children:[at(b,{style:Oe.title,children:e}),at(zt,{style:Oe.input,value:a,onChangeText:d,placeholder:o,placeholderTextColor:Be.text.muted,keyboardType:"number-pad",autoFocus:true,selectTextOnFocus:true,onSubmitEditing:u,returnKeyType:"done","sentry-label":"ignore number prompt input",accessibilityLabel:e}),t?at(b,{style:Oe.hint,children:t}):null,Jo(f,{style:Oe.actions,children:[at(N,{onPress:l,"sentry-label":"ignore cancel number prompt",style:[Oe.button,Oe.cancelButton],children:at(b,{style:Oe.cancelText,children:"Cancel"})}),at(N,{onPress:u,"sentry-label":"ignore save number prompt",style:[Oe.button,Oe.saveButton],children:at(b,{style:Oe.saveText,children:"Set"})})]})]})]})}var Oe=he.create({overlay:{...ds,zIndex:40},backdrop:{...ds,backgroundColor:"rgba(0,0,0,0.6)"},panel:{marginHorizontal:12,marginTop:12,padding:14,borderRadius:10,borderWidth:1,borderColor:Be.border.hover,backgroundColor:Be.background.card,gap:10},title:{fontSize:13,fontWeight:"700",color:Be.text.primary},input:{backgroundColor:Be.background.input,borderWidth:1,borderColor:Be.border.input,borderRadius:6,paddingHorizontal:12,paddingVertical:10,fontSize:16,fontWeight:"700",color:Be.text.primary},hint:{fontSize:10,color:Be.text.muted},actions:{flexDirection:"row",gap:8},button:{flex:1,paddingVertical:10,borderRadius:6,alignItems:"center",borderWidth:1},cancelButton:{borderColor:Be.border.default,backgroundColor:Be.background.base},cancelText:{fontSize:12,fontWeight:"600",color:Be.text.secondary},saveButton:{borderColor:Be.semantic.info,backgroundColor:`${Be.semantic.info}22`},saveText:{fontSize:12,fontWeight:"700",color:Be.semantic.info}});import{Fragment as us,jsx as V,jsxs as Ce}from"react/jsx-runtime";var Sh=["GET","POST","PUT","PATCH","DELETE"],cs=[0,500,1e3,3e3,1e4],hs=[{id:"500",label:"Server error",code:"500",danger:true,patch:{kind:"respond",status:500,statusText:"Internal Server Error"}},{id:"401",label:"Unauthorized",code:"401",danger:true,patch:{kind:"respond",status:401,statusText:"Unauthorized"}},{id:"404",label:"Not found",code:"404",danger:true,patch:{kind:"respond",status:404,statusText:"Not Found"}},{id:"403",label:"Forbidden",code:"403",danger:true,patch:{kind:"respond",status:403,statusText:"Forbidden"}},{id:"429",label:"Rate limited",code:"429",danger:true,patch:{kind:"respond",status:429,statusText:"Too Many Requests"}},{id:"503",label:"Unavailable",code:"503",danger:true,patch:{kind:"respond",status:503,statusText:"Service Unavailable"}},{id:"400",label:"Bad request",code:"400",danger:true,patch:{kind:"respond",status:400,statusText:"Bad Request"}},{id:"200",label:"Success",code:"200",patch:{kind:"respond",status:200,statusText:"OK"}},{id:"offline",label:"Offline",danger:true,patch:{kind:"fail",failKind:"network"}},{id:"timeout",label:"Timeout",danger:true,patch:{kind:"fail",failKind:"timeout"}},{id:"passthrough",label:"Real response",patch:{kind:"delay"}}];function xh(e){return e.kind==="delay"?"passthrough":e.kind==="fail"?e.failKind==="timeout"?"timeout":"offline":String(e.status??200)}function wh({outcome:e,active:t,onPress:r}){let o=e.danger?_.semantic.error:_.semantic.info;return Ce(N,{onPress:r,"sentry-label":"ignore override outcome",testID:`buoy-network-outcome-${e.label.toLowerCase().replace(/\s+/g,"-")}${e.code?`-${e.code}`:""}`,accessibilityRole:"button",accessibilityLabel:`${e.label}${e.code?` ${e.code}`:""}`,style:[M.outcome,t&&{borderColor:o,backgroundColor:`${o}1F`}],children:[V(b,{style:[M.outcomeLabel,t&&{color:o}],children:e.label}),e.code?V(b,{style:[M.outcomeCode,t&&{color:o}],children:e.code}):null]})}function ps({title:e,summary:t,open:r,onToggle:o,children:n}){return Ce(f,{style:M.disclosure,children:[Ce(N,{onPress:o,"sentry-label":"ignore override disclosure",testID:`buoy-network-disclosure-${e.toLowerCase().replace(/\s+/g,"-")}`,accessibilityRole:"button",accessibilityLabel:e,style:M.disclosureHeader,children:[r?V(ih,{size:12,color:_.text.muted}):V(sh,{size:12,color:_.text.muted}),V(b,{style:M.disclosureTitle,children:e}),t&&!r?V(b,{style:M.disclosureSummary,numberOfLines:1,children:t}):null]}),r?V(f,{style:M.disclosureBody,children:n}):null]})}function Wt({label:e,active:t,onPress:r}){return V(N,{onPress:r,"sentry-label":"ignore override chip",testID:`buoy-network-chip-${e.toLowerCase().replace(/\s+/g,"-")}`,accessibilityRole:"button",accessibilityLabel:e,style:[M.chip,t&&M.chipActive],children:V(b,{style:[M.chipText,t&&M.chipTextActive],children:e})})}function Th({draft:e,onChange:t,onSave:r,onCancel:o,saveLabel:n="Save",applySafeAreaInset:i=false}){let s=ah({minBottom:16}),l=i?s.bottom:0,a=y=>t({...e,...y}),[d,u]=Vr(!e.urlPattern.trim()),[v,T]=Vr(false),[x,L]=Vr(null),[m,k]=Vr(null),E=xh(e),g=e.kind==="respond"&&typeof e.status=="number"&&!hs.some(y=>y.code===String(e.status)),I=e.kind==="respond",D=e.methods?.[0],H=`${D??"Any"} ${e.urlPattern||"No URL yet"}`,S=os(()=>{let y=(e.body??"").trim();if(!y)return"Empty";let O=y.split(`
|
|
142
|
+
(${e.operationName})`),Xe(cc,{onPress:()=>t(e),onLongPress:i?()=>i(e):void 0,style:le.cardWrapper,contentStyle:[le.container,{borderLeftColor:s}],testID:`buoy-network-row-${e.id}`,accessibilityLabel:`${e.method} ${e.path||e.url}`,children:[Xe(f,{style:le.topRightContainer,children:[r?ie(uc,{size:10,active:true,color:Te.color.info}):null,o?ie(lc,{size:10,color:Te.color.accent}):null,n||e.override?ie(dc,{size:10,color:Te.color.warning}):null,ie(yc,{event:e,isPending:l,statusColor:s}),e.requestClient?ie(f,{style:[le.topRightBadge,{backgroundColor:Ki(e.requestClient).backgroundColor}],children:ie(b,{style:[le.clientText,{color:Ki(e.requestClient).color}],children:e.requestClient==="graphql"?"GQL":e.requestClient==="grpc-web"?"gRPC":e.requestClient==="xhr"?"XHR":e.requestClient})}):null]}),Xe(f,{style:le.leftSection,children:[ie(hc,{method:e.method,size:"small"}),ie(bc,{requestSize:e.requestSize,responseSize:e.responseSize})]}),ie(f,{style:le.middleSection,children:ie(b,{style:le.urlText,numberOfLines:2,children:d})}),Xe(f,{style:le.rightSection,children:[a?ie(pc,{type:a,size:"small"}):null,ie(oc,{size:14,color:Te.color.textTertiary})]}),ie(f,{style:le.bottomRightContainer,children:ie(vc,{timestamp:e.timestamp,duration:e.duration})})]})});$t.displayName="NetworkEventItemCompact";var le=he.create({cardWrapper:{marginHorizontal:8},container:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(12, 12, 12, 0.9)",borderLeftWidth:3,borderLeftColor:"transparent",borderBottomWidth:1},leftSection:{marginRight:8,alignItems:"flex-start"},topRightContainer:{position:"absolute",top:1,right:1,flexDirection:"row",alignItems:"center",gap:4},topRightBadge:{paddingHorizontal:4,paddingVertical:2,borderRadius:4},middleSection:{flex:1,justifyContent:"center",paddingRight:8},urlText:{fontSize:12,color:Te.color.text,lineHeight:16,fontFamily:jo},rightSection:{flexDirection:"row",alignItems:"center",gap:6},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:Te.color.textTertiary,fontFamily:jo},statusBadge:{paddingHorizontal:4,paddingVertical:1,borderRadius:3},statusText:{fontSize:10,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:2,paddingHorizontal:4,paddingVertical:1,backgroundColor:Te.color.warningSoft,borderRadius:3},pendingText:{fontSize:10,color:Te.color.warning,fontWeight:"600"},errorBadge:{flexDirection:"row",alignItems:"center",gap:2,paddingHorizontal:4,paddingVertical:1,backgroundColor:Te.color.dangerSoft,borderRadius:3},errorText:{fontSize:10,color:Te.color.danger,fontWeight:"600"},durationText:{fontSize:9,color:Te.color.textSecondary},sizeRow:{flexDirection:"row",gap:4,marginTop:4},sizeItem:{flexDirection:"row",alignItems:"center",gap:2},sizeText:{fontSize:8,color:Te.color.textSecondary,fontFamily:jo},clientText:{fontSize:8,fontWeight:"700",letterSpacing:.3,textTransform:"uppercase"}});q();pe();import{ProBadge as Sc,Zap as xc,buoyColors as ur}from"@buoy-gg/shared-ui/web";import{jsx as Mr,jsxs as Fo}from"react/jsx-runtime";function Qi({title:e,subtitle:t,onPress:r}){return Fo(N,{style:cr.banner,onPress:r,activeOpacity:.8,children:[Fo(f,{style:cr.content,children:[Fo(f,{style:cr.left,children:[Mr(xc,{size:16,color:ur.primary}),Mr(b,{style:cr.title,children:e})]}),Mr(Sc,{})]}),Mr(b,{style:cr.subtitle,children:t})]})}var cr=he.create({banner:{backgroundColor:ur.card,borderRadius:10,borderWidth:1,borderColor:ur.primary+"40",padding:12,marginHorizontal:12,marginTop:12,marginBottom:34},content:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:4},left:{flexDirection:"row",alignItems:"center",gap:8},title:{color:ur.text,fontSize:13,fontWeight:"600"},subtitle:{color:ur.textMuted,fontSize:11}});q();import{useEffect as Zi,useMemo as Nr,useState as wc}from"react";import{useLimit as Tc}from"@buoy-gg/shared-ui/web";function hr(e){let{filter:t,ignoredPatterns:r,paused:o,visible:n=true,isPro:i}=e,s=Tc("network.requests"),l=i?1/0:s,[a,d]=wc(()=>K.getEvents());Zi(()=>{if(!n)return;if(o){d(K.getEvents());return}let m=null,k=null,E=K.subscribeToEvents(g=>{k=g,m==null&&(m=requestAnimationFrame(()=>{m=null,k&&d(k),k=null}))});return()=>{E(),m!=null&&cancelAnimationFrame(m)}},[o,n]),Zi(()=>K.onClear(()=>{d([])}),[]);let u=Nr(()=>dr(a,r),[a,r]),v=Nr(()=>lr(u,t),[u,t]),T=Nr(()=>{let m=new Set;return a.slice(l).forEach(k=>{m.add(k.id)}),m},[a,l]),x=Nr(()=>T.size===0?v:v.filter(m=>!T.has(m.id)),[v,T]),L=v.length-x.length;return{events:v,visibleEvents:x,hasLockedEvents:L>0,lockedEventCount:L,totalEvents:u.length}}q();import{useCallback as jt,useSyncExternalStore as Cc}from"react";q();import{devToolsStorageKeys as $r,persistentStorage as Yi}from"@buoy-gg/shared-ui/web";var kc=800,Rc=3;function Ec(){let e=`${$r.network.overrides()}_launch`;try{let t=globalThis.sessionStorage;if(!t)return false;if(t.getItem(e))return true;t.setItem(e,"1")}catch{}return false}var Ic=Object.freeze([]),Pc=250,Bc=["respond","fail","delay"];function es(e){if(!Array.isArray(e))return[];let t=[];for(let r of e){if(!r||typeof r!="object")continue;let o=r;if(typeof o.id!="string"||typeof o.urlPattern!="string"||!o.urlPattern)continue;let n=Bc.includes(o.kind)?o.kind:"respond";t.push({id:o.id,enabled:o.enabled!==false,name:typeof o.name=="string"?o.name:void 0,urlPattern:o.urlPattern,methods:Array.isArray(o.methods)?o.methods.filter(i=>typeof i=="string"):void 0,requireHeader:typeof o.requireHeader=="string"&&o.requireHeader?o.requireHeader:void 0,bodyIncludes:typeof o.bodyIncludes=="string"&&o.bodyIncludes?o.bodyIncludes:void 0,kind:n,status:typeof o.status=="number"?Math.min(Zt,Math.max(Qt,o.status)):void 0,statusText:typeof o.statusText=="string"?o.statusText:void 0,headers:o.headers&&typeof o.headers=="object"?o.headers:void 0,body:typeof o.body=="string"?o.body:void 0,failKind:o.failKind==="timeout"?"timeout":void 0,delayMs:typeof o.delayMs=="number"?o.delayMs:void 0,times:typeof o.times=="number"?o.times:null,alternate:o.alternate===true,hits:0,seen:0,createdAt:typeof o.createdAt=="number"?o.createdAt:0})}return t.slice(0,Fe)}var Lc=class{constructor(){this.rules=[];this.enabled=true;this.listeners=new Set;this.loaded=false;this.loadPromise=null;this.dirty=false;this.idCounter=0;this.state={enabled:true,rules:[],autoPaused:false};this.launchStreak=0;this.autoPaused=false;this.keepAlive=null;this.hitEmitTimer=null;this.engineDisabled=false;this.remote=null;this.remoteEchoUntil=0}enableRemoteMode(e){this.remote=e,this.disableEngine()}disableRemoteMode(){this.remote=null}replaceRules(e,t=false){this.remote&&(!t&&ue()<this.remoteEchoUntil||(this.enabled=e.enabled,this.rules=e.rules,this.rebuild(),this.emit()))}markLocalEdit(){this.remote&&(this.remoteEchoUntil=ue()+kc)}disableEngine(){this.engineDisabled=true,this.keepAlive&&(this.keepAlive(),this.keepAlive=null,mt()===0&&Yt())}getState(){return this.state}getRules(){return this.engineDisabled||!this.enabled?Ic:this.rules}async fetchRuleBody(e){let t=this.rules.find(r=>r.id===e);if(!t)return null;if(!t.bodyOmitted)return t.body??null;if(!this.remote?.getRuleBody)return null;try{return await this.remote.getRuleBody(e)}catch{return null}}activeCount(){return this.enabled?this.rules.filter(e=>e.enabled&&!xo(e)).length:0}subscribe(e){return this.listeners.add(e),this.ensureLoaded(),()=>{this.listeners.delete(e)}}setEnabled(e){this.enabled!==e&&(this.remote?.setEnabled(e),this.markLocalEdit(),this.markTouched(),this.enabled=e,this.commit(this.rules))}addRule(e){if(this.rules.length>=Fe)return null;let t={...e,id:`ovr_${Date.now().toString(36)}_${++this.idCounter}`,hits:0,seen:0,createdAt:Date.now()};return this.commit([t,...this.rules]),t}upsertRule(e){this.remote?.upsertRule(e),this.markLocalEdit(),this.markTouched();let{id:t,...r}=e;return t&&this.rules.some(o=>o.id===t)?(this.updateRule(t,r),this.rules.find(o=>o.id===t)??null):this.addRule(r)}replaceAllRules(e,t){if(this.remote)return null;this.markTouched();let r=e.map(o=>o&&typeof o=="object"&&typeof o.id=="string"?o:{...o,id:`ovr_${Date.now().toString(36)}_${++this.idCounter}`,createdAt:Date.now()});return this.enabled=t,this.commit(es(r)),this.rules.slice()}updateRule(e,t){let r=this.rules.findIndex(n=>n.id===e);if(r===-1)return;let o=[...this.rules];o[r]={...o[r],...t,hits:0,seen:0},this.commit(o)}setRuleEnabled(e,t){let r=this.rules.findIndex(n=>n.id===e);if(r===-1||this.rules[r].enabled===t)return;this.remote?.setRuleEnabled(e,t),this.markLocalEdit(),this.markTouched();let o=[...this.rules];o[r]={...o[r],enabled:t,hits:t?0:o[r].hits,seen:t?0:o[r].seen},this.commit(o)}removeRule(e){let t=this.rules.filter(r=>r.id!==e);t.length!==this.rules.length&&(this.remote?.removeRule(e),this.markLocalEdit(),this.markTouched(),this.commit(t))}clearRules(){this.rules.length!==0&&(this.remote?.clearRules(),this.markLocalEdit(),this.markTouched(),this.commit([]))}recordMatch(e){let t=this.rules.findIndex(o=>o.id===e);if(t===-1)return;let r=[...this.rules];r[t]={...r[t],seen:r[t].seen+1},this.rules=r,this.rebuild()}recordHit(e){let t=this.rules.findIndex(s=>s.id===e);if(t===-1)return;let r=this.rules[t],o=r.hits+1,n=typeof r.times=="number"&&o>=r.times,i=[...this.rules];if(i[t]={...r,hits:o,enabled:n?false:r.enabled},n){this.commit(i);return}this.rules=i,this.rebuild(),this.scheduleHitEmit()}ensureLoaded(){return this.remote||this.loaded?Promise.resolve():this.loadPromise?this.loadPromise:(this.loadPromise=(async()=>{let e=null;try{e=await Yi.getItem($r.network.overrides())}catch{}this.hydrate(e)})(),this.loadPromise)}loadNow(){if(this.remote||this.loaded||this.loadPromise)return;let e;try{e=globalThis.localStorage?.getItem($r.network.overrides())??null}catch{return}e!==null&&this.hydrate(e)}hydrate(e){try{if(e&&!this.dirty){let t=JSON.parse(e);this.enabled=t?.enabled!==false,this.rules=es(t?.rules),this.launchStreak=typeof t?.launchStreak=="number"?t.launchStreak:0,this.autoPaused=t?.autoPaused===true&&!this.enabled,this.applyLaunchGuard(),this.rebuild()}}catch{}finally{this.loaded=true,this.syncKeepAlive(),this.emit()}}applyLaunchGuard(){if(!this.enabled||this.activeCount()===0){this.launchStreak=0;return}Ec()||(this.launchStreak+=1,this.launchStreak>=Rc&&(this.enabled=false,this.autoPaused=true,this.launchStreak=0),this.persist())}syncKeepAlive(){let e=!this.engineDisabled&&this.activeCount()>0;if(e&&!this.keepAlive){ei(),this.keepAlive=er(()=>{});return}!e&&this.keepAlive&&(this.keepAlive(),this.keepAlive=null,mt()===0&&Yt())}scheduleHitEmit(){this.hitEmitTimer===null&&(this.hitEmitTimer=setTimeout(()=>{this.hitEmitTimer=null,this.emit()},Pc))}commit(e){this.dirty=true,this.rules=e.slice(0,Fe),this.rebuild(),this.syncKeepAlive(),this.emit(),this.persist()}rebuild(){this.state={enabled:this.enabled,rules:this.rules,autoPaused:this.autoPaused}}markTouched(){this.launchStreak=0,this.autoPaused=false}noteHealthyLaunch(){this.launchStreak===0&&!this.autoPaused||(this.markTouched(),this.persist(),this.rebuild(),this.emit())}persist(){this.remote||Yi.setItem($r.network.overrides(),JSON.stringify({enabled:this.enabled,rules:this.rules,launchStreak:this.launchStreak,autoPaused:this.autoPaused})).catch(()=>{})}emit(){this.listeners.forEach(e=>e())}},U=new Lc;bl({getRules:()=>U.getRules(),recordHit:e=>U.recordHit(e),recordMatch:e=>U.recordMatch(e)});typeof window<"u"&&typeof document<"u"&&!(typeof navigator<"u"&&navigator.product==="ReactNative")&&U.loadNow();function jr(){let e=Cc(jt(s=>U.subscribe(s),[]),()=>U.getState(),()=>U.getState()),t=jt(s=>U.setEnabled(s),[]),r=jt(s=>U.upsertRule(s),[]),o=jt((s,l)=>U.setRuleEnabled(s,l),[]),n=jt(s=>U.removeRule(s),[]),i=jt(()=>U.clearRules(),[]);return{enabled:e.enabled,rules:e.rules,autoPaused:e.autoPaused,activeCount:U.activeCount(),setEnabled:t,upsertRule:r,setRuleEnabled:o,removeRule:n,clearRules:i,isRuleSpent:xo}}q();function qc(e,t){if(t.length===0)return[];let r=new Set(t.map(n=>n.id)),o=new Set;for(let n of t){let i;for(let s of e){if(s.override&&r.has(s.override.ruleId)){o.add(s.id);continue}So(n,s.url,String(s.method||"GET"),s.requestHeaders)&&(s.timestamp>=n.createdAt?o.add(s.id):(!i||s.timestamp>i.timestamp)&&(i=s))}i&&o.add(i.id)}return e.filter(n=>o.has(n.id))}q();var Oc=[];function Wo(e,t,r){return t.length===0?{pinned:Oc,rest:e}:{pinned:t,rest:r.size===0?e:e.filter(o=>!r.has(o.id))}}import{jsx as Se,jsxs as kt}from"react/jsx-runtime";var Dc=e=>e.id;function zc({events:e,onEventPress:t,onLongPress:r,savedLiveIds:o,onClearPinned:n}){return e.length===0?null:kt(f,{style:xe.pinnedSection,children:[kt(f,{style:xe.pinnedHeader,children:[Se(Ku,{size:11,active:true,color:ve.semantic.info}),kt(b,{style:xe.pinnedTitle,children:["PINNED \xB7 ",e.length]}),Se(N,{onPress:n,"sentry-label":"ignore unpin all",style:xe.pinnedClear,children:Se(b,{style:xe.pinnedClearText,children:"Unpin all"})})]}),e.map(i=>Se($t,{event:i,onPress:t,onLongPress:r,pinned:true,saved:o.has(i.id)},i.id))]})}function Ac({events:e,onEventPress:t,onLongPress:r,savedLiveIds:o,paused:n,onTogglePaused:i}){return e.length===0?null:kt(f,{style:[xe.overriddenSection,n&&xe.overriddenSectionOff],children:[kt(f,{style:xe.overriddenHeader,children:[Se(Gu,{size:11,color:n?ve.text.muted:ve.semantic.warning}),Se(b,{testID:"buoy-network-overridden-strip",style:[xe.overriddenTitle,n&&xe.overriddenTitleOff],children:n?`PAUSED \xB7 ${e.length}`:`OVERRIDDEN \xB7 ${e.length}`}),Se(N,{onPress:i,"sentry-label":"ignore pause overrides",style:xe.overriddenManage,children:Se(b,{style:[xe.overriddenManageText,n&&xe.overriddenTitleOff],children:n?"Resume":"Pause"})})]}),e.map(s=>Se($t,{event:s,onPress:t,onLongPress:r,overridden:true,saved:o.has(s.id)},s.id))]})}function Hc({visible:e,paused:t,filter:r,ignoredPatterns:o,isPro:n,searchText:i,onEventPress:s,onUpgradePress:l}){let{visibleEvents:a,hasLockedEvents:d,lockedEventCount:u,totalEvents:v}=hr({filter:r,ignoredPatterns:o,paused:t,visible:e,isPro:n}),{pinnedEvents:T,pinnedLiveIds:x,savedLiveIds:L,togglePin:m,clearPinned:k}=Mt(),{rules:E,enabled:g,setEnabled:I,isRuleSpent:D}=jr(),H=Ju(X=>{m(X)},[m]);if(!e)return null;let{pinned:S,rest:z}=Wo(a,T,x),w=E.filter(X=>X.enabled&&!D(X)),p=qc([...S,...z],w),h=new Set(p.map(X=>X.id)),c=S.filter(X=>!h.has(X.id)),y=h.size?z.filter(X=>!h.has(X.id)):z,O=!t,re=({item:X})=>Se($t,{event:X,onPress:s,onLongPress:H,saved:L.has(X.id)}),ne=()=>c.length>0||p.length>0?null:Se(Zu,{testID:"buoy-network-empty",...Yu({subject:"requests",search:i,total:v,capturing:O,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})}),ee=()=>{if(!d)return null;let X=i.length>0,A=X?`${u} matching ${u===1?"request":"requests"} in locked history`:`${u} requests locked`;return Se(Qi,{title:A,subtitle:X?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history",onPress:l})};return kt(f,{style:xe.root,children:[O?null:kt(f,{style:xe.disabledBanner,children:[Se(Qu,{size:14,color:ve.semantic.warning}),Se(b,{style:xe.disabledText,children:"Network interception is disabled"})]}),Se(Ac,{events:p,onEventPress:s,onLongPress:H,savedLiveIds:L,paused:!g,onTogglePaused:()=>I(!g)}),Se(zc,{events:c,onEventPress:s,onLongPress:H,savedLiveIds:L,onClearPinned:k}),y.length>0||d?Se(po,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-list",data:y,renderItem:re,keyExtractor:Dc,contentContainerStyle:xe.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,...ec,extraData:L,"sentry-label":"ignore network events list",ListFooterComponent:ee}):ne()]})}var xe=he.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:ve.semantic.warning+"44",backgroundColor:ve.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:ve.border.default,backgroundColor:ve.background.card},overriddenTitleOff:{color:ve.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:ve.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:ve.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:ve.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:ve.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:tc},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:ve.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:ve.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:ve.semantic.warning+"20"},disabledText:{color:ve.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});q();pe();import{useState as Mc}from"react";import{Bookmark as Nc,CopyButton as $c,Search as jc,macOSColors as Ne,useLimit as Fc,ToolEmptyState as Wc,resolveListEmptyState as Vc,EVENT_LIST_PRESET as Uc,monoFont as _c}from"@buoy-gg/shared-ui/web";q();function ts(e,t,r){let o=e.slice(0,Math.min(t,it)),n=o.map(i=>i.event);return{events:r?lr(n,{searchText:r}):n,lockedCount:e.length-o.length}}import{jsx as Je,jsxs as Fr}from"react/jsx-runtime";var Xc=e=>e.id;function rs({visible:e,isPro:t,copySettings:r,search:o,onSearchChange:n,onEventPress:i,onUpgradePress:s}){let{savedRecords:l,pinnedLiveIds:a,toggleSave:d,clearSaved:u}=Mt(),v=Fc("network.saved"),[T,x]=Mc(""),L=o!=null&&n!=null,m=L?o:T,k=L?n:x;if(!e)return null;let{events:E,lockedCount:g}=ts(l,v,m),I=S=>{d(S)},D=({item:S})=>Je($t,{event:S,onPress:i,onLongPress:I,saved:true,pinned:a.has(S.id)}),H=()=>g===0?null:Je(Qi,{title:`${g} saved ${g===1?"request":"requests"} locked`,subtitle:`Your plan keeps ${v}. Upgrade to Pro to unlock the rest.`,onPress:s});return Fr(f,{style:Ge.root,children:[Fr(f,{style:Ge.toolbar,children:[Je(Nc,{size:11,color:Ne.semantic.debug}),Fr(b,{style:Ge.toolbarTitle,children:["SAVED \xB7 ",l.length,v>=it?"":`/${v}`]}),t?Je($c,{value:()=>Xi(E,r),size:13,buttonStyle:Ge.toolbarButton,colors:{idle:Ne.text.secondary,success:Ne.semantic.success,error:Ne.semantic.error},disabled:E.length===0}):null,Je(N,{onPress:u,"sentry-label":"ignore clear saved",style:Ge.toolbarClear,disabled:l.length===0,children:Je(b,{style:[Ge.toolbarClearText,l.length===0&&Ge.toolbarClearTextDisabled],children:"Clear all"})})]}),l.length>0?Fr(f,{style:Ge.searchRow,children:[Je(jc,{size:13,color:Ne.text.secondary}),Je(zt,{style:Ge.searchInput,placeholder:"Search saved requests\u2026",placeholderTextColor:Ne.text.muted,value:m,onChangeText:k,"sentry-label":"ignore saved search",accessibilityLabel:"Search saved requests",autoCapitalize:"none",autoCorrect:false,returnKeyType:"search"})]}):null,l.length===0||m.trim().length>0&&E.length===0&&g===0?Je(Wc,{testID:"buoy-network-saved-empty",...Vc({subject:"saved requests",verb:"kept",search:l.length===0?"":m,total:l.length,waiting:{otto:"empty",title:"No saved requests",message:"Open a request and tap the bookmark to keep it here \u2014 saved requests survive Clear and app restarts."}})}):Je(po,{keyboardShouldPersistTaps:"handled",data:E,renderItem:D,keyExtractor:Xc,contentContainerStyle:Ge.listContent,showsVerticalScrollIndicator:true,scrollEnabled:true,...Uc,extraData:a,"sentry-label":"ignore saved requests list",ListFooterComponent:H})]})}var Ge=he.create({root:{flex:1,minHeight:0},toolbar:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},toolbarTitle:{flex:1,color:Ne.semantic.debug,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:_c},toolbarButton:{width:26,height:26,borderRadius:6,alignItems:"center",justifyContent:"center"},toolbarClear:{paddingHorizontal:6,paddingVertical:2},toolbarClearText:{color:Ne.text.muted,fontSize:10},toolbarClearTextDisabled:{color:Ne.text.disabled},searchRow:{flexDirection:"row",alignItems:"center",gap:6,marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5,backgroundColor:Ne.background.input,borderRadius:10,borderWidth:1,borderColor:Ne.border.default},searchInput:{flex:1,color:Ne.text.primary,fontSize:13,paddingVertical:2},listContent:{paddingTop:4}});q();pe();import{useCallback as Jc,useEffect as Wr,useState as Gc}from"react";import{AlertCircle as Kc,AlertTriangle as Qc,DevToolsCard as Zc,EmptyState as Yc,MethodBadge as eh,Plus as th,Trash2 as rh,macOSColors as Q,useLimit as oh,monoFont as nh}from"@buoy-gg/shared-ui/web";q();pe();import{useMemo as os,useState as Vr}from"react";import{ChevronDown as ih,ChevronRight as sh,macOSColors as _,useSafeAreaInsets as ah,monoFont as lh}from"@buoy-gg/shared-ui/web";q();pe();import{useState as Ur,useMemo as _r,useCallback as pr,useRef as Vo,useEffect as dh,memo as Xr}from"react";import{displayValue as uh,buoyColors as P,monoFont as qe}from"@buoy-gg/shared-ui/web";import{CopyButton as ch}from"@buoy-gg/shared-ui/web";import{ChevronRight as hh,ChevronDown as ph,Trash as ns}from"@buoy-gg/shared-ui/web";import{CyberpunkInput as fh}from"@buoy-gg/shared-ui/web/dataViewer";q();var Rt=(e,t,r)=>{if(t.length===0)return r;if(e instanceof Map){let o=new Map(e);if(t.length===1)return o.set(t[0],r),o;let[n,...i]=t,s=o.get(n);return o.set(n,Rt(s??null,i,r)),o}if(e instanceof Set){let o=Rt(Array.from(e),t,r);return new Set(Array.isArray(o)?o:[])}if(Array.isArray(e)){let o=[...e];if(t.length===1)return o[t[0]]=r,o;let[n,...i]=t;return o[n]=Rt(o[n],i,r),o}if(e instanceof Object){let o={...e};if(t.length===1)return o[t[0]]=r,o;let[n,...i]=t;return o[n]=Rt(o[n],i,r),o}return e};q();var Et=(e,t)=>{if(e instanceof Map){let r=new Map(e);if(t.length===1)return r.delete(t[0]),r;let[o,...n]=t;return r.set(o,Et(r.get(o),n)),r}if(e instanceof Set){let r=Et(Array.from(e),t);return new Set(r)}if(Array.isArray(e)){let r=[...e];if(t.length===1)return r.filter((i,s)=>s.toString()!==t[0]);let[o,...n]=t;return r[o]=Et(r[o],n),r}if(e instanceof Object){let r={...e};if(t.length===1)return delete r[t[0]],r;let[o,...n]=t;return r[o]=Et(r[o],n),r}return e};q();import{createContext as gh,useContext as mh}from"react";var is=gh(null);function Jr(){return mh(is)}import{Fragment as Gr,jsx as G,jsxs as Pe}from"react/jsx-runtime";var fr=100,Ft={top:8,bottom:8,left:8,right:8},ss=12,yh=(e,t=fr)=>{if(t<1||e.length===0)return[];let r=[];for(let o=0;o<e.length;o+=t)r.push(e.slice(o,o+t));return r},Uo=Xr(({expanded:e,isFocused:t=false,isMain:r=false})=>G(f,{style:[F.expanderIcon,r&&F.expanderIconMain,e?F.expanded:F.collapsed],children:e?G(ph,{size:r?14:ss,color:t?P.primary:r?P.text:P.textSecondary,strokeWidth:2.5}):G(hh,{size:r?14:ss,color:t?P.primary:r?P.text:P.textSecondary,strokeWidth:2.5})}));Uo.displayName="Expander";var as=Xr(({value:e,isFocused:t=false})=>G(ch,{value:e,isFocused:t,buttonStyle:t?{...F.buttonStyle,...F.buttonStyleFocused}:F.buttonStyle}));as.displayName="CopyButton";var _o=Xr(({dataPath:e,isFocused:t=false})=>{let r=Jr(),o=pr(()=>{r&&r.onChange(Et(r.root,e))},[r,e]);return r?G(N,{"sentry-label":"ignore devtools explorer delete button",onPress:o,style:[F.deleteButton,t&&F.deleteButtonFocused],accessibilityLabel:"Delete item",hitSlop:Ft,activeOpacity:.7,children:G(ns,{size:14,strokeWidth:2,color:t?P.error:P.error+"CC"})}):null});_o.displayName="DeleteItemButton";var ls=Xr(({dataPath:e,isFocused:t=false})=>{let r=Jr(),o=pr(()=>{r&&r.onChange(Rt(r.root,e,[]))},[r,e]);return r?G(N,{"sentry-label":"ignore devtools explorer clear button",style:[F.clearButton,t&&F.clearButtonFocused],"aria-label":"Remove all items",onPress:o,hitSlop:Ft,activeOpacity:.7,children:G(b,{style:[F.clearButtonText,{color:t?P.warning:P.warning+"CC"}],children:"[]"})}):null});ls.displayName="ClearArrayButton";function bh({dataPath:e,value:t,itemsDeletable:r}){let o=Jr(),n=pr(()=>{if(!o)return;let a=typeof t=="boolean"?t:false;o.onChange(Rt(o.root,e,!a))},[o,e,t]),i=pr(()=>{o&&o.onChange(Et(o.root,e))},[o,e]);if(!o)return null;let s=t?F.toggleBadgeTrue:F.toggleBadgeFalse,l=t?F.toggleTextTrue:F.toggleTextFalse;return Pe(N,{"sentry-label":"ignore devtools explorer toggle button",style:F.modernToggleButton,onPress:n,hitSlop:Ft,activeOpacity:.8,children:[G(f,{style:[F.toggleBadge,s],children:G(b,{style:[F.toggleBadgeText,l],children:t?"TRUE":"FALSE"})}),r&&G(N,{"sentry-label":"ignore devtools explorer delete button in toggle",onPress:i,style:F.deleteButtonInToggle,accessibilityLabel:"Delete item",hitSlop:Ft,activeOpacity:.7,children:G(ns,{size:14,strokeWidth:2,color:P.error+"CC"})})]})}function Xo({editable:e,label:t,value:r,defaultExpanded:o,dataPath:n,itemsDeletable:i,dataVersion:s=0}){let l=Jr(),[a,d]=Ur(false),[u,v]=Ur("");dh(()=>{if(r!=null&&(typeof r=="string"||typeof r=="number")){let h=r.toString();v(h)}},[r,t,s]);let T=_r(()=>{let h=t.toUpperCase();return["DATA","QUERY","QUERYKEY","TYPES","STATS","OPTIONS","OBSERVERS"].includes(h)},[t]),[x,L]=Ur((o||[]).includes(t)),m=()=>L(h=>!h),[k,E]=Ur([]),g=_r(()=>r==null||typeof r!="object"?[]:Array.isArray(r)?(r.length>1e3?r.slice(0,1e3):r).map((h,c)=>({label:c.toString(),value:h})):r instanceof Map?Array.from(r.entries()).slice(0,1e3).map(([h,c])=>({label:h.toString(),value:c})):r instanceof Set?Array.from(r).slice(0,1e3).map((h,c)=>({label:c.toString(),value:h})):Object.entries(r).slice(0,1e3).map(([h,c])=>({label:h,value:c})),[r]),I=_r(()=>Array.isArray(r)?"array":r===null||typeof r!="object"?typeof r:r instanceof Map||r instanceof Set?"Iterable":"object",[r]),D=_r(()=>yh(g,fr),[g]),H=n??[],S=Vo(l),z=Vo(H),w=Vo(I);S.current=l,z.current=H,w.current=I;let p=pr((h,c)=>{v(c);let y=S.current;if(!y||h&&isNaN(Number(c)))return;let O=w.current==="number"?Number(c):c;y.onChange(Rt(y.root,z.current,O))},[v]);return G(f,{style:F.minWidthWrapper,children:Pe(f,{style:F.fullWidthMarginRight,children:[D.length>0&&Pe(Gr,{children:[Pe(f,{style:[F.flexRowItemsCenterGap,T&&F.flexRowItemsCenterGapMain],children:[Pe(N,{"sentry-label":"ignore devtools explorer expander button",style:F.expanderButton,onPress:m,hitSlop:Ft,activeOpacity:.6,children:[G(Uo,{expanded:x,isFocused:a,isMain:T}),G(b,{style:[F.labelText,a&&F.labelTextFocused,T&&F.labelTextMain],children:t}),G(b,{style:F.textGray500,children:`${String(I).toLowerCase()==="iterable"?"(Iterable) ":""}${g.length} ${g.length>1?"items":"item"}`})]}),e&&Pe(f,{style:F.flexRowGapItemsCenter,children:[G(as,{value:r,isFocused:a}),i&&l!==null&&G(_o,{dataPath:H,isFocused:a}),I==="array"&&l!==null&&G(ls,{dataPath:H,isFocused:a})]})]}),x&&Pe(Gr,{children:[D.length===1&&G(f,{style:[F.singleEntryContainer,T&&F.singleEntryContainerMain],children:g.map((h,c)=>G(Xo,{defaultExpanded:o,label:h.label,value:h.value,editable:e,dataPath:[...H,h.label],itemsDeletable:I==="array"||I==="Iterable"||I==="object",dataVersion:s},h.label+c))}),D.length>1&&G(f,{style:F.multiEntryContainer,children:D.map((h,c)=>G(f,{children:Pe(f,{style:F.relativeOutlineNone,children:[Pe(N,{"sentry-label":"ignore devtools explorer page toggle",onPress:()=>E(y=>y.includes(c)?y.filter(O=>O!==c):[...y,c]),style:F.pageExpanderButton,hitSlop:Ft,children:[G(Uo,{expanded:k.includes(c)}),Pe(b,{style:F.pageRangeText,children:["[",c*fr,"...",c*fr+fr-1,"]"]})]}),k.includes(c)&&G(f,{style:F.entriesContainer,children:h.map(y=>G(Xo,{defaultExpanded:o,label:y.label,value:y.value,editable:e,dataPath:[...H,y.label],dataVersion:s},y.label))})]})},c))})]})]}),D.length===0&&Pe(f,{style:F.flexRowGapFullWidth,children:[e&&l!==null&&(I==="string"||I==="number"||I==="boolean")?Pe(Gr,{children:[e&&l&&(I==="string"||I==="number")&&G(f,{style:F.nebulaInputWrapper,children:G(fh,{label:t,accessibilityLabel:"Data input field for editing values",style:[I==="number"?F.textNumber:F.textString],keyboardType:I==="number"?"numeric":"default",value:u,onChangeText:h=>p(I==="number",h),onFocus:()=>d(true),onBlur:()=>d(false),showNumberControls:I==="number",onIncrement:()=>{let h=Number(u)||0;p(true,String(h+1))},onDecrement:()=>{let h=Number(u)||0;p(true,String(h-1))},showDeleteButton:i,onDelete:()=>{l.onChange(Et(l.root,H))}})}),I==="boolean"&&Pe(f,{style:F.booleanRowContainer,children:[G(b,{style:F.booleanLabel,children:t}),G(f,{style:F.booleanToggleWrapper,children:G(bh,{dataPath:H,value:r,itemsDeletable:i})})]})]}):Pe(Gr,{children:[G(b,{style:F.text344054,children:t}),G(b,{style:F.displayValueText,children:uh(r)})]}),e&&i&&l!==null&&I!=="string"&&I!=="number"&&I!=="boolean"&&G(_o,{dataPath:H,isFocused:a})]})]})})}var F=he.create({buttonStyle:{backgroundColor:P.card+"E6",borderWidth:1,borderColor:P.textSecondary+"33",borderRadius:6,flexDirection:"row",alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2},buttonStyleFocused:{borderColor:P.primary+"CC",backgroundColor:P.primary+"26",shadowColor:P.primary,shadowOpacity:.3,shadowRadius:4},deleteButton:{backgroundColor:P.error+"1A",borderColor:P.error+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:P.error,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},deleteButtonFocused:{borderColor:P.error+"CC",backgroundColor:P.error+"33",shadowOpacity:.3,shadowRadius:5},deleteButtonInToggle:{backgroundColor:P.error+"1A",borderColor:P.error+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,shadowColor:P.error,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButton:{backgroundColor:P.warning+"1A",borderWidth:1,borderColor:P.warning+"4D",borderRadius:6,flexDirection:"row",padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",zIndex:10,shadowColor:P.warning,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButtonFocused:{borderColor:P.warning+"CC",backgroundColor:P.warning+"33",shadowOpacity:.3,shadowRadius:5},clearButtonText:{fontSize:12,fontWeight:"700",fontFamily:qe},expanderIcon:{width:18,height:18,alignItems:"center",justifyContent:"center",marginRight:1,backgroundColor:P.textSecondary+"14",borderRadius:3},expanderIconMain:{backgroundColor:P.textSecondary+"1A",width:20,height:20,borderRadius:4,borderWidth:.5,borderColor:P.textSecondary+"33"},expanded:{transform:[{rotate:"0deg"}]},collapsed:{transform:[{rotate:"0deg"}]},minWidthWrapper:{minWidth:180,fontSize:11,flexDirection:"row",flexWrap:"wrap",width:"100%",marginVertical:.5},fullWidthMarginRight:{position:"relative",width:"100%",marginRight:1},flexRowItemsCenterGap:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:3,paddingHorizontal:6,marginVertical:1,borderRadius:4,backgroundColor:P.card+"66",borderWidth:.5,borderColor:P.textSecondary+"1A"},flexRowItemsCenterGapMain:{backgroundColor:P.card+"E6",borderLeftWidth:2.5,borderLeftColor:P.textSecondary+"80",borderColor:P.textSecondary+"26",paddingVertical:5,paddingHorizontal:8,marginBottom:3,borderWidth:1,shadowColor:"#000",shadowOffset:{width:0,height:0},shadowOpacity:.08,shadowRadius:3},expanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:"transparent",paddingVertical:1,paddingHorizontal:2,gap:6,borderWidth:0,minHeight:24,flex:1},labelText:{color:P.textSecondary,fontSize:10,fontWeight:"600",marginRight:4,fontFamily:qe,letterSpacing:.4},labelTextFocused:{color:P.text},labelTextMain:{color:P.text,fontSize:11,fontWeight:"700",letterSpacing:.6},textGray500:{color:P.textMuted,fontSize:10,fontWeight:"400",fontFamily:qe,opacity:.7},pageRangeText:{color:P.textSecondary,fontSize:10,fontWeight:"600",fontFamily:qe},flexRowGapItemsCenter:{flexDirection:"row",alignItems:"center",gap:4,paddingLeft:2},singleEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:P.textSecondary+"40"},singleEntryContainerMain:{borderLeftColor:P.textSecondary+"4D",marginLeft:4,paddingLeft:10},multiEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:P.textSecondary+"40"},multiEntryContainerMain:{borderLeftColor:P.textSecondary+"4D",marginLeft:4,paddingLeft:10},relativeOutlineNone:{position:"relative"},pageExpanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:P.card+"66",paddingVertical:3,paddingHorizontal:6,gap:6,borderRadius:4,borderWidth:.5,borderColor:P.textSecondary+"1A",marginBottom:2,minHeight:24},entriesContainer:{marginLeft:2,paddingLeft:8,marginTop:2,borderLeftWidth:1.5,borderLeftColor:P.textSecondary+"40"},textNumber:{color:P.text,fontWeight:"600",fontFamily:qe},textString:{color:P.text,fontFamily:qe},flexRowGapFullWidth:{flexDirection:"row",width:"100%",alignItems:"center",marginVertical:1,gap:6,paddingHorizontal:4,paddingVertical:2,borderRadius:3},text344054:{color:P.textSecondary,fontWeight:"600",fontSize:9,minWidth:50,fontFamily:qe,letterSpacing:.4,opacity:.8},numberInputButtons:{position:"absolute",right:8,top:"50%",transform:[{translateY:-18}],flexDirection:"row",gap:4,zIndex:10},touchableButton:{width:32,height:32,borderRadius:6,backgroundColor:P.card+"E6",borderWidth:1,borderColor:P.textSecondary+"33",alignItems:"center",justifyContent:"center",marginLeft:2,shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2},touchableButtonFocused:{borderColor:P.primary+"CC",backgroundColor:P.primary+"26",shadowColor:P.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:4,elevation:3},nebulaInputWrapper:{flex:1,width:"100%",position:"relative"},displayValueText:{flex:1,color:P.text,fontWeight:"400",fontFamily:qe,fontSize:12,paddingVertical:6,paddingHorizontal:10,borderRadius:6,borderWidth:1,borderColor:P.textMuted+"66",minHeight:34},dataRow:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,minHeight:44,gap:12},dataLabel:{color:P.textSecondary,fontSize:13,fontWeight:"500",minWidth:80,flexShrink:0},dataValueContainer:{flex:1,flexDirection:"row",alignItems:"center"},inputWithActions:{flex:1,position:"relative"},numberControls:{position:"absolute",right:8,top:"50%",transform:[{translateY:-16}],flexDirection:"column",gap:2},numberButton:{width:32,height:16,borderRadius:4,alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:P.primary+"0F"},readOnlyValue:{color:P.text,fontSize:13,fontFamily:qe,paddingVertical:8,paddingHorizontal:12,borderRadius:6,borderWidth:1,borderColor:P.textMuted+"33",flex:1},actionButtons:{flexDirection:"row",gap:6,paddingLeft:8},booleanContainer:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:6,borderWidth:1,borderColor:P.textMuted+"4D",flex:1},booleanText:{marginLeft:8,color:P.warning,fontWeight:"500",fontFamily:qe},modernToggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:6,borderWidth:1,borderColor:P.textMuted+"99",paddingHorizontal:8,paddingVertical:6,marginVertical:2,minHeight:34,gap:8},toggleIconContainer:{marginRight:6},toggleIcon:{padding:8,borderRadius:8,alignItems:"center",justifyContent:"center",width:32,height:32},toggleIconSmall:{width:8,height:8,borderRadius:4},toggleContent:{flex:1,minWidth:0},toggleLabel:{color:"#E5E7EB",fontSize:11,fontWeight:"600",fontFamily:qe,letterSpacing:.3},toggleStatus:{color:"#9CA3AF",fontSize:11},toggleBadge:{marginLeft:6,paddingHorizontal:6,paddingVertical:3,borderRadius:4,borderWidth:1},toggleBadgeText:{fontSize:9,fontWeight:"700",textTransform:"uppercase",letterSpacing:.8,fontFamily:qe},toggleIconTrue:{backgroundColor:P.primary},toggleIconFalse:{backgroundColor:P.textMuted},toggleBadgeTrue:{backgroundColor:P.primary+"1A",borderColor:P.primary+"4D"},toggleBadgeFalse:{backgroundColor:P.textMuted+"1A",borderColor:P.textMuted+"4D"},toggleTextTrue:{color:P.primary,fontWeight:"600"},toggleTextFalse:{color:P.textSecondary,fontWeight:"500"},booleanRowContainer:{flexDirection:"row",alignItems:"center",width:"100%",gap:8,paddingVertical:2},booleanLabel:{color:P.textSecondary,fontSize:10,fontWeight:"600",fontFamily:qe,letterSpacing:.4,minWidth:60,flexShrink:0},booleanToggleWrapper:{flex:1}});q();pe();import{useState as vh}from"react";import{absoluteFill as ds,macOSColors as Be}from"@buoy-gg/shared-ui/web";import{jsx as at,jsxs as Jo}from"react/jsx-runtime";function Go({title:e,hint:t,value:r,placeholder:o="Number",min:n,max:i,onSubmit:s,onCancel:l}){let[a,d]=vh(r!=null?String(r):""),u=()=>{let v=a.trim();if(!v){s(null);return}let T=Number(v);if(!Number.isFinite(T)){s(null);return}let x=T;n!=null&&(x=Math.max(n,x)),i!=null&&(x=Math.min(i,x)),s(x)};return Jo(f,{style:Oe.overlay,children:[at(N,{style:Oe.backdrop,activeOpacity:1,onPress:l,"sentry-label":"ignore dismiss number prompt"}),Jo(f,{style:Oe.panel,children:[at(b,{style:Oe.title,children:e}),at(zt,{style:Oe.input,value:a,onChangeText:d,placeholder:o,placeholderTextColor:Be.text.muted,keyboardType:"number-pad",autoFocus:true,selectTextOnFocus:true,onSubmitEditing:u,returnKeyType:"done","sentry-label":"ignore number prompt input",accessibilityLabel:e}),t?at(b,{style:Oe.hint,children:t}):null,Jo(f,{style:Oe.actions,children:[at(N,{onPress:l,"sentry-label":"ignore cancel number prompt",style:[Oe.button,Oe.cancelButton],children:at(b,{style:Oe.cancelText,children:"Cancel"})}),at(N,{onPress:u,"sentry-label":"ignore save number prompt",style:[Oe.button,Oe.saveButton],children:at(b,{style:Oe.saveText,children:"Set"})})]})]})]})}var Oe=he.create({overlay:{...ds,zIndex:40},backdrop:{...ds,backgroundColor:"rgba(0,0,0,0.6)"},panel:{marginHorizontal:12,marginTop:12,padding:14,borderRadius:10,borderWidth:1,borderColor:Be.border.hover,backgroundColor:Be.background.card,gap:10},title:{fontSize:13,fontWeight:"700",color:Be.text.primary},input:{backgroundColor:Be.background.input,borderWidth:1,borderColor:Be.border.input,borderRadius:6,paddingHorizontal:12,paddingVertical:10,fontSize:16,fontWeight:"700",color:Be.text.primary},hint:{fontSize:10,color:Be.text.muted},actions:{flexDirection:"row",gap:8},button:{flex:1,paddingVertical:10,borderRadius:6,alignItems:"center",borderWidth:1},cancelButton:{borderColor:Be.border.default,backgroundColor:Be.background.base},cancelText:{fontSize:12,fontWeight:"600",color:Be.text.secondary},saveButton:{borderColor:Be.semantic.info,backgroundColor:`${Be.semantic.info}22`},saveText:{fontSize:12,fontWeight:"700",color:Be.semantic.info}});import{Fragment as us,jsx as V,jsxs as Ce}from"react/jsx-runtime";var Sh=["GET","POST","PUT","PATCH","DELETE"],cs=[0,500,1e3,3e3,1e4],hs=[{id:"500",label:"Server error",code:"500",danger:true,patch:{kind:"respond",status:500,statusText:"Internal Server Error"}},{id:"401",label:"Unauthorized",code:"401",danger:true,patch:{kind:"respond",status:401,statusText:"Unauthorized"}},{id:"404",label:"Not found",code:"404",danger:true,patch:{kind:"respond",status:404,statusText:"Not Found"}},{id:"403",label:"Forbidden",code:"403",danger:true,patch:{kind:"respond",status:403,statusText:"Forbidden"}},{id:"429",label:"Rate limited",code:"429",danger:true,patch:{kind:"respond",status:429,statusText:"Too Many Requests"}},{id:"503",label:"Unavailable",code:"503",danger:true,patch:{kind:"respond",status:503,statusText:"Service Unavailable"}},{id:"400",label:"Bad request",code:"400",danger:true,patch:{kind:"respond",status:400,statusText:"Bad Request"}},{id:"200",label:"Success",code:"200",patch:{kind:"respond",status:200,statusText:"OK"}},{id:"offline",label:"Offline",danger:true,patch:{kind:"fail",failKind:"network"}},{id:"timeout",label:"Timeout",danger:true,patch:{kind:"fail",failKind:"timeout"}},{id:"passthrough",label:"Real response",patch:{kind:"delay"}}];function xh(e){return e.kind==="delay"?"passthrough":e.kind==="fail"?e.failKind==="timeout"?"timeout":"offline":String(e.status??200)}function wh({outcome:e,active:t,onPress:r}){let o=e.danger?_.semantic.error:_.semantic.info;return Ce(N,{onPress:r,"sentry-label":"ignore override outcome",testID:`buoy-network-outcome-${e.label.toLowerCase().replace(/\s+/g,"-")}${e.code?`-${e.code}`:""}`,accessibilityRole:"button",accessibilityLabel:`${e.label}${e.code?` ${e.code}`:""}`,style:[M.outcome,t&&{borderColor:o,backgroundColor:`${o}1F`}],children:[V(b,{style:[M.outcomeLabel,t&&{color:o}],children:e.label}),e.code?V(b,{style:[M.outcomeCode,t&&{color:o}],children:e.code}):null]})}function ps({title:e,summary:t,open:r,onToggle:o,children:n}){return Ce(f,{style:M.disclosure,children:[Ce(N,{onPress:o,"sentry-label":"ignore override disclosure",testID:`buoy-network-disclosure-${e.toLowerCase().replace(/\s+/g,"-")}`,accessibilityRole:"button",accessibilityLabel:e,style:M.disclosureHeader,children:[r?V(ih,{size:12,color:_.text.muted}):V(sh,{size:12,color:_.text.muted}),V(b,{style:M.disclosureTitle,children:e}),t&&!r?V(b,{style:M.disclosureSummary,numberOfLines:1,children:t}):null]}),r?V(f,{style:M.disclosureBody,children:n}):null]})}function Wt({label:e,active:t,onPress:r}){return V(N,{onPress:r,"sentry-label":"ignore override chip",testID:`buoy-network-chip-${e.toLowerCase().replace(/\s+/g,"-")}`,accessibilityRole:"button",accessibilityLabel:e,style:[M.chip,t&&M.chipActive],children:V(b,{style:[M.chipText,t&&M.chipTextActive],children:e})})}function Th({draft:e,onChange:t,onSave:r,onCancel:o,saveLabel:n="Save",applySafeAreaInset:i=false}){let s=ah({minBottom:16}),l=i?s.bottom:0,a=y=>t({...e,...y}),[d,u]=Vr(!e.urlPattern.trim()),[v,T]=Vr(false),[x,L]=Vr(null),[m,k]=Vr(null),E=xh(e),g=e.kind==="respond"&&typeof e.status=="number"&&!hs.some(y=>y.code===String(e.status)),I=e.kind==="respond",D=e.methods?.[0],H=`${D??"Any"} ${e.urlPattern||"No URL yet"}`,S=os(()=>{let y=(e.body??"").trim();if(!y)return"Empty";let O=y.split(`
|
|
143
143
|
`).length;return`${O} line${O===1?"":"s"}`},[e.body]),z=os(()=>{let y=(e.body??"").trim();if(!y)return null;try{return JSON.parse(y)}catch{return null}},[e.body]),w=(e.body??"").trim().length>0&&!z,p=e.delayMs??0,h=p>0&&!cs.includes(p),c=!e.alternate&&typeof e.times=="number"&&e.times!==1;return Ce(f,{style:M.root,children:[Ce(ht,{testID:"buoy-network-editor-scroll",style:M.scroll,contentContainerStyle:M.scrollContent,keyboardShouldPersistTaps:"handled",children:[Ce(ps,{title:"Applies to",summary:H,open:d,onToggle:()=>u(y=>!y),children:[V(zt,{style:M.input,value:e.urlPattern,onChangeText:y=>a({urlPattern:y}),testID:"buoy-network-override-pattern",accessibilityLabel:"Override URL pattern",placeholder:"https://api.example.com/v1/users*",placeholderTextColor:_.text.muted,autoCapitalize:"none",autoCorrect:false,multiline:true,"sentry-label":"ignore override url pattern"}),Ce(f,{style:M.chipRow,children:[V(Wt,{label:"Any",active:!D,onPress:()=>a({methods:void 0})}),Sh.map(y=>V(Wt,{label:y,active:D===y,onPress:()=>a({methods:[y]})},y))]})]}),Ce(f,{style:M.outcomeGrid,children:[hs.map(y=>V(wh,{outcome:y,active:E===y.id,onPress:()=>a(y.patch)},y.id)),V(N,{onPress:()=>k("status"),"sentry-label":"ignore custom status",accessibilityLabel:"Custom status code",style:[M.customField,g&&M.customFieldActive],children:V(b,{style:[M.customValue,g&&M.customInputActive],children:g?String(e.status):"Custom"})})]}),I?V(ps,{title:"Response body",summary:S,open:v,onToggle:()=>T(y=>!y),children:x!==null?Ce(us,{children:[V(zt,{style:[M.input,M.bodyInput],value:x,onChangeText:L,placeholder:"Paste a new body\u2026",placeholderTextColor:_.text.muted,autoCapitalize:"none",autoCorrect:false,autoFocus:true,multiline:true,"sentry-label":"ignore override body paste"}),Ce(f,{style:M.inlineActions,children:[V(N,{onPress:()=>L(null),"sentry-label":"ignore cancel body paste",style:M.textButton,children:V(b,{style:M.textButtonMuted,children:"Cancel"})}),V(N,{onPress:()=>{let y=x.trim();try{a({body:JSON.stringify(JSON.parse(y),null,2)})}catch{a({body:y})}L(null)},disabled:!x.trim(),"sentry-label":"ignore apply body paste",style:M.textButton,children:V(b,{style:[M.textButtonLabel,!x.trim()&&M.textButtonDisabled],children:"Replace"})})]})]}):Ce(us,{children:[z!==null?V(is.Provider,{value:{root:z,onChange:y=>a({body:JSON.stringify(y,null,2)})},children:V(Xo,{editable:true,label:"",value:z,defaultExpanded:[""]})}):V(b,{style:M.emptyBody,children:w?"This body isn't JSON, so there's no tree to show.":"No body yet."}),V(N,{onPress:()=>L(""),"sentry-label":"ignore edit all body",style:M.textButton,children:V(b,{style:M.textButtonLabel,children:"Edit all"})})]})}):null,Ce(f,{style:M.field,children:[V(b,{style:M.subLabel,children:"Delay"}),Ce(f,{style:M.chipRow,children:[cs.map(y=>V(Wt,{label:y===0?"None":`${y/1e3}s`,active:p===y,onPress:()=>a({delayMs:y})},y)),V(N,{onPress:()=>k("delay"),"sentry-label":"ignore custom delay",accessibilityLabel:"Custom delay in seconds",style:[M.customField,h&&M.customFieldActive],children:V(b,{style:[M.customValue,h&&M.customInputActive],children:h?`${p/1e3}s`:"Custom"})})]})]}),Ce(f,{style:M.field,children:[V(b,{style:M.subLabel,children:"Fires"}),V(b,{style:M.subHint,children:"A limited rule switches itself off once it's used up. Every other alternates forever \u2014 the first request through, the next overridden."}),Ce(f,{style:M.chipRow,children:[V(Wt,{label:"Always",active:!e.alternate&&e.times==null,onPress:()=>a({alternate:false,times:null})}),V(Wt,{label:"Once",active:!e.alternate&&e.times===1,onPress:()=>a({alternate:false,times:1})}),V(Wt,{label:"Every other",active:e.alternate===true,onPress:()=>a({alternate:true,times:null})}),V(N,{onPress:()=>{a({alternate:false}),k("times")},"sentry-label":"ignore custom times",accessibilityLabel:"Custom number of times",style:[M.customField,c&&M.customFieldActive],children:V(b,{style:[M.customValue,c&&M.customInputActive],children:c?`${e.times}\xD7`:"Custom"})})]})]})]}),m==="status"?V(Go,{title:"Custom status code",hint:`${Qt}\u2013${Zt}`,value:g?e.status:void 0,min:Qt,max:Zt,onSubmit:y=>{a({kind:"respond",status:y??void 0,statusText:void 0}),k(null)},onCancel:()=>k(null)}):null,m==="delay"?V(Go,{title:"Custom delay",hint:"Seconds",value:h?p/1e3:void 0,min:0,onSubmit:y=>{a({delayMs:y!=null?Math.round(y*1e3):0}),k(null)},onCancel:()=>k(null)}):null,m==="times"?V(Go,{title:"Fires how many times",hint:"Leave empty for always",value:c?e.times:void 0,min:1,onSubmit:y=>{a({alternate:false,times:y&&y>0?y:null}),k(null)},onCancel:()=>k(null)}):null,Ce(f,{style:[M.footer,{paddingBottom:12+l}],children:[V(N,{onPress:o,"sentry-label":"ignore cancel override",testID:"buoy-network-editor-cancel",accessibilityRole:"button",accessibilityLabel:"Cancel",style:[M.footerButton,M.cancelButton],children:V(b,{style:M.cancelText,children:"Cancel"})}),V(N,{onPress:r,disabled:!e.urlPattern.trim(),"sentry-label":"ignore save override",testID:"buoy-network-editor-save",accessibilityRole:"button",accessibilityLabel:n,style:[M.footerButton,M.saveButton,!e.urlPattern.trim()&&M.saveButtonDisabled],children:V(b,{style:M.saveText,children:n})})]})]})}var M=he.create({root:{flex:1},scroll:{flex:1},scrollContent:{padding:12,paddingBottom:24,gap:4},field:{gap:8,paddingVertical:6},outcomeGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,paddingVertical:10},outcome:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:9,borderRadius:6,borderWidth:1,borderColor:_.border.default,backgroundColor:_.background.card},outcomeLabel:{fontSize:12,fontWeight:"600",color:_.text.primary},outcomeCode:{fontSize:10,fontWeight:"700",color:_.text.muted},disclosure:{borderRadius:6,borderWidth:1,borderColor:_.border.default,backgroundColor:_.background.card,overflow:"hidden"},disclosureHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:10},disclosureTitle:{fontSize:12,fontWeight:"600",color:_.text.primary},disclosureSummary:{flex:1,textAlign:"right",fontSize:11,color:_.text.muted},disclosureBody:{paddingHorizontal:10,paddingBottom:10,gap:8},input:{backgroundColor:_.background.input,borderWidth:1,borderColor:_.border.input,borderRadius:6,paddingHorizontal:10,paddingVertical:8,color:_.text.primary,fontSize:12,fontFamily:lh,minHeight:40},bodyInput:{minHeight:140,textAlignVertical:"top"},chipRow:{flexDirection:"row",flexWrap:"wrap",gap:6},chip:{paddingHorizontal:10,paddingVertical:6,borderRadius:5,borderWidth:1,borderColor:_.border.default,backgroundColor:_.background.base},chipActive:{borderColor:_.semantic.info,backgroundColor:`${_.semantic.info}1F`},chipText:{fontSize:11,fontWeight:"600",color:_.text.secondary},chipTextActive:{color:_.semantic.info},customField:{flexDirection:"row",alignItems:"center",paddingHorizontal:8,borderRadius:5,borderWidth:1,borderColor:_.border.default,backgroundColor:_.background.base},customFieldActive:{borderColor:_.semantic.info,backgroundColor:`${_.semantic.info}1F`},customValue:{paddingVertical:6,fontSize:11,fontWeight:"600",color:_.text.secondary},customInputActive:{color:_.semantic.info},subHint:{fontSize:10,lineHeight:14,color:_.text.muted,marginTop:-2},subLabel:{fontSize:10,fontWeight:"700",letterSpacing:.6,color:_.text.muted,textTransform:"uppercase"},textButton:{alignSelf:"flex-start",paddingVertical:4},textButtonLabel:{fontSize:11,fontWeight:"600",color:_.semantic.info},textButtonMuted:{fontSize:11,fontWeight:"600",color:_.text.secondary},textButtonDisabled:{opacity:.4},inlineActions:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},emptyBody:{fontSize:11,color:_.text.muted,paddingVertical:6},footer:{flexDirection:"row",gap:8,padding:12,borderTopWidth:1,borderTopColor:_.border.default,backgroundColor:_.background.base},footerButton:{flex:1,paddingVertical:11,borderRadius:6,alignItems:"center",borderWidth:1},cancelButton:{borderColor:_.border.default,backgroundColor:_.background.card},cancelText:{fontSize:12,fontWeight:"600",color:_.text.secondary},saveButton:{borderColor:_.semantic.info,backgroundColor:`${_.semantic.info}22`},saveButtonDisabled:{opacity:.4},saveText:{fontSize:12,fontWeight:"700",color:_.semantic.info}});import{jsx as de,jsxs as It}from"react/jsx-runtime";function Ch(){return{enabled:true,urlPattern:"",kind:"respond",status:500,body:"",times:null}}function kh(e){let{id:t,hits:r,seen:o,createdAt:n,...i}=e;return i}function Rh(e){let t=e.urlPattern,r=t.indexOf("://");if(r===-1)return t;let o=t.indexOf("/",r+3);return o===-1?t.slice(r+3):t.slice(o)}function Eh(e){let t=[];return e.delayMs&&t.push(`${e.delayMs/1e3}s delay`),e.alternate?t.push("every other"):e.times===1?t.push("once"):typeof e.times=="number"&&t.push(`${e.times}\xD7`),t.join(" \xB7 ")}function Ih(e){if(e.kind==="fail")return Q.semantic.error;if(e.kind==="delay")return Q.semantic.info;let t=e.status??200;return t>=200&&t<300?Q.semantic.success:t>=300&&t<400?Q.semantic.info:Q.semantic.error}function Ph({rule:e,spent:t,onEdit:r,onDelete:o}){let n=e.enabled&&!t,i=Ih(e),s=Eh(e),l=e.methods?.length?e.methods.join("/"):"ANY";return It(Zc,{onPress:r,style:se.cardWrapper,contentStyle:[se.card,{borderLeftColor:n?i:"transparent"}],children:[de(eh,{method:l,size:"small"}),It(f,{style:se.cardMiddle,children:[de(b,{style:[se.urlText,!n&&se.urlTextOff],numberOfLines:2,children:Rh(e)}),s?de(b,{style:se.extrasText,children:s}):null]}),e.hits>0?de(b,{style:se.rowHits,children:e.hits}):null,e.kind==="fail"?It(f,{style:se.failBadge,children:[de(Kc,{size:10,color:Q.semantic.error}),de(b,{style:se.failText,children:e.failKind==="timeout"?"TIMEOUT":"OFFLINE"})]}):de(b,{style:[se.statusText,{color:i}],children:e.kind==="delay"?"PASS":String(e.status??200)}),de(N,{onPress:o,"sentry-label":"ignore delete override rule",testID:"buoy-network-rule-delete",accessibilityRole:"button",accessibilityLabel:"Delete rule",hitSlop:{top:8,bottom:8,left:4,right:4},style:se.rowDelete,children:de(rh,{size:13,color:Q.text.muted})})]})}function Bh(e){return e.visible?de(Lh,{...e}):null}function Lh({isPro:e,onUpgradePress:t,pendingDraft:r,onPendingConsumed:o,backHandlerRef:n,applySafeAreaInset:i}){let s=oh("network.overrideRules"),l=e?Fe:s,{enabled:a,autoPaused:d,rules:u,activeCount:v,setEnabled:T,upsertRule:x,setRuleEnabled:L,removeRule:m,isRuleSpent:k}=jr(),[E,g]=Gc(null);Wr(()=>{U.noteHealthyLaunch()},[]),Wr(()=>{if(n)return n.current=E?()=>(g(null),true):null,()=>{n.current=null}},[n,E]);let I=Jc(w=>{U.fetchRuleBody(w).then(p=>{p!=null&&g(h=>h?.id===w?{...h,draft:{...h.draft,body:p,bodyOmitted:void 0}}:h)})},[]);Wr(()=>{if(!r)return;let{id:w,...p}=r;g({id:w,draft:p}),w&&p.bodyOmitted&&I(w),o?.()},[r,o,I]),Wr(()=>{E?.id&&(u.some(w=>w.id===E.id)||g(null))},[E?.id,u]);let D=w=>{g({id:w.id,draft:kh(w)}),w.bodyOmitted&&I(w.id)},H=w=>{u.filter(p=>p.enabled&&!k(p)).length<=l||u.filter(p=>p.enabled&&!k(p)&&p.id!==w).forEach(p=>L(p.id,false))},S=()=>{if(!E)return;let w={...E.draft,enabled:true,urlPattern:E.draft.urlPattern.trim()};if(!w.urlPattern)return;let p=x({...w,id:E.id});H(p?.id??E.id),T(true),g(null)};if(E)return de(Th,{draft:E.draft,onChange:w=>g({...E,draft:w}),onSave:S,onCancel:()=>g(null),saveLabel:E.id?"Save":"Add",applySafeAreaInset:i});let z=u.length>0;return It(f,{style:se.root,children:[z?It(f,{style:[se.bar,a&&v>0&&se.barOn],children:[a&&v>0?de(Qc,{size:12,color:Q.semantic.warning}):null,de(b,{style:[se.barText,a&&v>0&&se.barTextOn],numberOfLines:2,children:d?"Overrides paused \u2014 they'd been on for 3 launches":a&&v>0?`${v} override${v===1?" is":"s are"} on`:"Overrides are off"}),de(N,{onPress:()=>T(!(a&&v>0)),"sentry-label":"ignore toggle overrides master",testID:"buoy-network-overrides-master",accessibilityRole:"button",style:se.barButton,children:de(b,{style:se.barButtonText,children:a&&v>0?"Turn all off":d?"Turn back on":"Turn on"})})]}):null,It(f,{style:se.listHeader,children:[de(b,{style:se.listHeaderText,children:z?`${u.length} rule${u.length===1?"":"s"}`:""}),de(N,{onPress:()=>g({draft:Ch()}),"sentry-label":"ignore new override rule",accessibilityLabel:"New override rule",style:se.newButton,children:de(th,{size:14,color:Q.semantic.info})})]}),z?It(ht,{style:se.list,contentContainerStyle:se.listContent,keyboardShouldPersistTaps:"handled",children:[u.map(w=>de(Ph,{rule:w,spent:k(w),onEdit:()=>D(w),onDelete:()=>m(w.id)},w.id)),l<Fe?de(b,{style:se.footNote,children:`Your plan: ${l} override at a time. Pro: up to ${Fe}.`}):null]}):de(f,{style:se.emptyWrap,children:de(Yc,{otto:"empty",iconSize:32,title:"Nothing overridden",description:"Open any request and tap Override, or + to write a rule."})})]})}var se=he.create({root:{flex:1},bar:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:Q.border.default,backgroundColor:Q.background.card},barOn:{borderBottomColor:Q.semantic.warning+"44",backgroundColor:Q.semantic.warningBackground},barText:{flex:1,fontSize:12,fontWeight:"600",color:Q.text.secondary},barTextOn:{color:Q.semantic.warning},barButton:{paddingHorizontal:10,paddingVertical:6,borderRadius:5,borderWidth:1,borderColor:Q.border.hover,backgroundColor:Q.background.base},barButtonText:{fontSize:11,fontWeight:"700",color:Q.text.primary},listHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingTop:10,paddingBottom:4},listHeaderText:{fontSize:10,fontWeight:"700",letterSpacing:.6,color:Q.text.muted,textTransform:"uppercase"},newButton:{padding:6,borderRadius:5,borderWidth:1,borderColor:Q.border.default,backgroundColor:Q.background.card},emptyWrap:{flex:1,justifyContent:"center"},list:{flex:1},listContent:{padding:10,gap:6},cardWrapper:{marginHorizontal:0,marginVertical:0},card:{flexDirection:"row",alignItems:"center",gap:8,borderLeftWidth:3,borderLeftColor:"transparent"},cardMiddle:{flex:1},urlText:{fontSize:12,color:Q.text.primary,lineHeight:16,fontFamily:nh},urlTextOff:{color:Q.text.muted},extrasText:{fontSize:10,color:Q.text.secondary,marginTop:2},statusText:{fontSize:11,fontWeight:"600"},failBadge:{flexDirection:"row",alignItems:"center",gap:2,paddingHorizontal:4,paddingVertical:1,backgroundColor:Q.semantic.error+"26",borderRadius:3},failText:{fontSize:10,color:Q.semantic.error,fontWeight:"600"},rowHits:{fontSize:11,fontWeight:"700",color:Q.semantic.warning},rowDelete:{padding:5,borderRadius:5,borderWidth:1,borderColor:Q.border.default,backgroundColor:Q.background.base},footNote:{fontSize:10,lineHeight:14,color:Q.text.muted,paddingHorizontal:4,paddingTop:8}});q();pe();import{FlaskConical as qh,night as Pt}from"@buoy-gg/shared-ui/web";import{jsx as Ko,jsxs as Oh}from"react/jsx-runtime";function Dh({onPress:e}){let{activeCount:t}=jr(),r=t>0;return Oh(N,{onPress:e,"sentry-label":"ignore open overrides",testID:"buoy-network-overrides",accessibilityRole:"button",style:[Kr.button,r&&Kr.buttonActive],accessibilityLabel:r?`Response overrides \u2014 ${t} active`:"Response overrides",children:[Ko(qh,{size:14,color:r?Pt.color.warning:Pt.color.textSecondary}),r?Ko(f,{style:Kr.badge,children:Ko(b,{style:Kr.badgeText,children:t})}):null]})}var Kr=he.create({button:{width:32,height:32,borderRadius:8,alignItems:"center",justifyContent:"center",backgroundColor:Pt.color.buttonSurface,borderWidth:1,borderColor:Pt.color.border},buttonActive:{backgroundColor:Pt.color.warningSoft,borderColor:Pt.color.warning+"77"},badge:{position:"absolute",top:1,right:1,minWidth:12,height:12,borderRadius:6,paddingHorizontal:3,alignItems:"center",justifyContent:"center",backgroundColor:Pt.color.warning},badgeText:{fontSize:8,fontWeight:"800",color:"#000000"}});q();pe();import{night as Vt}from"@buoy-gg/shared-ui/web";q();function zh(e){let t=e.indexOf("?");return t===-1?e:`${e.slice(0,t)}*`}function Ah(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return""}}function Qo(e){return{enabled:true,name:void 0,urlPattern:zh(e.url),methods:[String(e.method||"GET").toUpperCase()],kind:"respond",status:e.status&&e.status>=200?e.status:200,statusText:e.statusText,body:Ah(e.responseData),times:null}}import{jsx as fs}from"react/jsx-runtime";function Hh({onOpen:e}){let t=$o(),{rules:r,isRuleSpent:o}=jr(),n=t?K.getEvents().find(l=>l.id===t)??ae.getEventById(t):null,i=n?r.find(l=>l.enabled&&!o(l)&&So(l,n.url,String(n.method||"GET")))??null:null,s=i!==null;return fs(N,{onPress:()=>{if(n){if(i){let{id:l,hits:a,seen:d,createdAt:u,...v}=i;e(v,l);return}e(Qo(n))}},"sentry-label":"ignore open overrides",testID:"buoy-network-override-request",accessibilityRole:"button",accessibilityLabel:s?"Edit the override on this request":"Override this request",style:[Qr.button,s&&Qr.buttonActive],children:fs(b,{style:[Qr.label,s&&Qr.labelActive],children:"Override"})})}var Qr=he.create({button:{paddingHorizontal:10,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:Vt.color.border,backgroundColor:Vt.color.buttonSurface},buttonActive:{borderColor:Vt.color.warning+"77",backgroundColor:Vt.color.warningSoft},label:{fontSize:11,fontWeight:"700",color:Vt.color.accent},labelActive:{color:Vt.color.warning}});q();pe();import{absoluteFill as gs,night as lt}from"@buoy-gg/shared-ui/web";import{jsx as et,jsxs as Zr}from"react/jsx-runtime";function Mh({onPress:e,isOpen:t,hasIndicator:r}){return Zr(N,{onPress:e,"sentry-label":"ignore toggle header menu",testID:"buoy-network-menu",accessibilityRole:"button",accessibilityLabel:t?"Close menu":"More actions",style:[we.button,t&&we.buttonOpen],children:[Zr(f,{style:we.dots,children:[et(f,{style:[we.dot,t&&we.dotOpen]}),et(f,{style:[we.dot,t&&we.dotOpen]}),et(f,{style:[we.dot,t&&we.dotOpen]})]}),r?et(f,{style:we.indicator}):null]})}function Nh({onClose:e,children:t}){return Zr(f,{style:we.overlay,children:[et(N,{style:we.backdrop,activeOpacity:1,onPress:e,"sentry-label":"ignore dismiss header menu"}),et(f,{style:we.panel,children:t})]})}function Zo({icon:e,label:t,detail:r,testID:o,onPress:n}){return Zr(N,{onPress:n,"sentry-label":"ignore header menu item",testID:o,accessibilityRole:"button",accessibilityLabel:t,style:we.item,children:[et(f,{style:we.itemIcon,children:e}),et(b,{style:we.itemLabel,children:t}),r?et(b,{style:we.itemDetail,children:r}):null]})}var we=he.create({button:{width:32,height:32,borderRadius:8,alignItems:"center",justifyContent:"center"},buttonOpen:{backgroundColor:lt.color.surfaceElevated},dots:{flexDirection:"column",gap:2.5,alignItems:"center"},dot:{width:3,height:3,borderRadius:2,backgroundColor:lt.color.textSecondary},dotOpen:{backgroundColor:lt.color.text},indicator:{position:"absolute",top:6,right:8,width:6,height:6,borderRadius:3,backgroundColor:lt.color.accent},overlay:{...gs,zIndex:50},backdrop:{...gs,backgroundColor:"rgba(0,0,0,0.5)"},panel:{position:"absolute",top:6,right:8,minWidth:196,paddingVertical:4,borderRadius:10,borderWidth:1,borderColor:lt.color.border,backgroundColor:lt.color.surface},item:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:11},itemIcon:{width:16,alignItems:"center"},itemLabel:{flex:1,fontSize:13,fontWeight:"600",color:lt.color.text},itemDetail:{fontSize:11,color:lt.color.textTertiary}});q();import{memo as $h,useEffect as jh,useMemo as Fh}from"react";import{EventStepperFooter as Wh,useLimit as Vh}from"@buoy-gg/shared-ui/web";import{jsx as Uh}from"react/jsx-runtime";var _h=()=>Ue.step(-1),Xh=()=>Ue.step(1),Jh=$h(function({paused:e,filter:t,ignoredPatterns:r,isPro:o,fromSaved:n,savedSearch:i,applySafeAreaInset:s}){let{visibleEvents:l}=hr({filter:t,ignoredPatterns:r,paused:e,isPro:o}),{pinnedEvents:a,pinnedLiveIds:d,savedRecords:u}=Mt(),v=Vh("network.saved"),T=Fh(()=>{if(n)return ts(u,v,i).events;let{pinned:m,rest:k}=Wo(l,a,d);return m.length===0?k:[...m,...k]},[n,u,i,o,l,a,d]);jh(()=>{Ue.setIds(Du(T))},[T]);let{index:x,total:L}=Hu();return x<0?null:Uh(Wh,{currentIndex:x,totalItems:L,itemLabel:"Request",applySafeAreaInset:s,onPrevious:_h,onNext:Xh,variant:"night"})});q();import{useEffect as Gh,useState as Kh}from"react";function Qh(e){return K.getEvents().find(t=>t.id===e)??ae.getEventById(e)}function ms(e,t={}){let{paused:r=false}=t,[o,n]=Kh(null);return Gh(()=>{if(!(!e||r))return K.subscribeToEvents(i=>{let s=i.find(l=>l.id===e);s&&n(l=>l&&l.id===e&&l.event===s?l:{id:e,event:s})})},[e,r]),e?o&&o.id===e?o.event:Qh(e):null}import{Fragment as Zh,jsx as j,jsxs as $e}from"react/jsx-runtime";function Yh({visible:e,paused:t,ignoredPatternValues:r,onTogglePattern:o,isPro:n,filter:i,ignoredPatterns:s,fromSaved:l,savedSearch:a,applySafeAreaInset:d}){let u=$o(),v=Au(),T=u!=null&&u===v,x=ms(u,{paused:t||!e});return St(()=>{e&&x&&T&&Ue.reportRendered(x.id)},[e,x,T]),e?$e(f,{style:Bt.detailRoot,children:[x?j(ki,{event:x,ignoredPatterns:r,onTogglePattern:o,showBodies:T}):j(f,{style:Bt.detailBodyFallback}),j(Jh,{paused:t,filter:i,ignoredPatterns:s,isPro:n,fromSaved:l,savedSearch:a,applySafeAreaInset:d})]}):null}function ep({visible:e,paused:t,isPro:r,filter:o,onFilterChange:n,ignoredPatterns:i,onRemovePattern:s,onAddPattern:l,onTogglePatternMode:a,isTeamPattern:d}){let{events:u}=hr({filter:o,ignoredPatterns:i,paused:t,visible:e,isPro:r});return e?j(bd,{events:u,filter:o,onFilterChange:n,ignoredPatterns:i,onRemovePattern:s,onAddPattern:l,onTogglePatternMode:a,isTeamPattern:d}):null}function tp({visible:e,paused:t,isPro:r,filter:o,ignoredPatterns:n,settings:i,onSettingsChange:s}){let{events:l}=hr({filter:o,ignoredPatterns:n,paused:t,visible:e,isPro:r});return e?j(su,{settings:i,onSettingsChange:s,events:l}):null}function ys({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:n=false,inline:i=false,paused:s,onPausedChange:l,remoteConditions:a}){let{isPro:d}=ed(),[u,v]=ye(false),T=s!=null&&l!=null,x=T?s:u,L=Z=>{let De=typeof Z=="function"?Z(x):Z;T?l(De):v(De)},[m,k]=ye({}),E=zu(),[g,I]=ye(false),[D,H]=ye(false),[S,z]=ye(false),[w,p]=ye(false),[h,c]=ye(0),[y]=ye(Wl);St(()=>{y.update(a)},[y,a]),St(()=>()=>y.update(void 0),[y]);let O=true,[re,ne]=ye(null),[ee,X]=ye("filters"),[A,W]=ye(""),[$,oe]=ye(false),ge=Rr(false),[rt,dt]=ye(""),Es=Rr(null),{patterns:qt,values:Is,add:Ps,remove:Bs,toggle:Ls,toggleMode:qs,isTeamOnly:Os}=od(),[_t,an]=ye(tu),no=Rr(false),[io,so]=ye(false),[Ot,Ds]=ye("export"),Xt=Z=>{Ds(Z),so(true)};St(()=>{io&&d&&so(false)},[io,d]),St(()=>{if(!e||no.current)return;(async()=>{try{let Z=await di.getItem(Er.network.copyOptions());if(Z){let De=JSON.parse(Z);an(De)}}catch{}finally{no.current=true}})()},[e]),St(()=>{if(!no.current)return;(async()=>{try{await di.setItem(Er.network.copyOptions(),JSON.stringify(_t))}catch{}})()},[_t]);let zs=()=>{Ue.clear()},ln=Po(Z=>{Ue.select(Z.id)},[]),As=Po((Z,De)=>{ne(De?{...Z,id:De}:Z),z(true),Ue.clear()},[]),Hs=Po(()=>ne(null),[]),dn=Rr(null),un=Z=>{W(Z),k(De=>({...De,searchText:Z}))},Ms=Z=>{k(De=>({...De,status:De.status===Z?void 0:Z}))},[cn,Ns]=ye("bottomSheet"),$s=Z=>{Ns(Z)};St(()=>{$&&requestAnimationFrame(()=>{Es.current?.focus()})},[$]);let hn=()=>g?$e(me,{children:[j(me.Navigation,{onBack:()=>I(false)}),j(me.Content,{title:"",noMargin:true,children:j(Yl,{size:"sm",tabs:[{key:"filters",label:"Filters"},{key:"copy",label:"Copy"}],activeKey:ee,onChange:Z=>X(Z)})})]}):E?$e(me,{children:[j(me.Navigation,{onBack:zs}),j(me.Content,{title:"Request Details",centered:true}),$e(me.Actions,{children:[O?j(Hh,{onOpen:As}):null,j(Gi,{isPro:d,onUpgradePress:()=>Xt("saved")})]})]}):S&&O?$e(me,{children:[j(me.Navigation,{onBack:()=>{dn.current?.()||(z(false),ne(null))}}),j(me.Content,{title:"Response Overrides",centered:true})]}):D?$e(me,{children:[j(me.Navigation,{onBack:()=>H(false)}),j(me.Content,{title:"Saved Requests",centered:true})]}):$e(me,{children:[r&&j(me.Navigation,{onBack:r}),j(me.Content,{title:"",children:$?j(me.Search,{value:A,onChangeText:un,onCancel:()=>{un(""),oe(false)},onDismiss:()=>oe(false),dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search URL, method, operation, error...",accessibilityLabel:"Search network requests",iconSize:14,testID:"buoy-network-search-input",clearTestID:"buoy-network-search-clear",inputProps:{"sentry-label":"ignore network search header"}}):j(Vu,{activeStatus:m.status,onToggleStatus:Ms,ignoredPatterns:qt,paused:x})}),$e(me.Actions,{children:[j(N,{"sentry-label":"ignore open search",testID:"buoy-network-search-open",accessibilityLabel:"Open search",accessibilityRole:"button",onPress:()=>oe(true),style:Bt.headerActionButton,children:j(Xl,{size:14,color:Qe.color.textSecondary})}),O?j(Dh,{onPress:()=>z(true)}):null,j(rd,{isEnabled:!x,onToggle:()=>L(Z=>!Z),accessibilityLabel:x?"Resume network capture":"Pause network capture",testID:"buoy-network-power"}),j(Uu,{paused:x}),j(Mh,{onPress:()=>p(Z=>!Z),isOpen:w,hasIndicator:ao})]})]}),ao=!!(m.status||m.method||m.contentType),js=n?Er.modal.root():Er.network.modal();if(!e)return null;let Fs=E||!g,pn=$e(Zh,{children:[$e(f,{style:Bt.container,children:[j(Yh,{visible:E,paused:x,ignoredPatternValues:Is,onTogglePattern:Ls,isPro:d,filter:m,ignoredPatterns:qt,fromSaved:D,savedSearch:rt,applySafeAreaInset:!i&&cn==="bottomSheet"}),j(ep,{visible:g&&ee==="filters"&&!E,paused:x,isPro:d,filter:m,onFilterChange:k,ignoredPatterns:qt,onRemovePattern:Bs,onAddPattern:Ps,onTogglePatternMode:qs,isTeamPattern:Os}),j(tp,{visible:g&&ee==="copy"&&!E,paused:x,isPro:d,filter:m,ignoredPatterns:qt,settings:_t,onSettingsChange:an}),j(Bh,{visible:O&&S&&!E&&!g,isPro:d,onUpgradePress:()=>Xt("overrides"),pendingDraft:re,onPendingConsumed:Hs,backHandlerRef:dn,applySafeAreaInset:!i&&cn==="bottomSheet"}),j(rs,{visible:D&&!E&&!g&&!(S&&O),isPro:d,copySettings:_t,search:rt,onSearchChange:dt,onEventPress:ln,onUpgradePress:()=>Xt("saved")}),j(Hc,{visible:!E&&!g&&!D&&!(S&&O),paused:x,filter:m,ignoredPatterns:qt,isPro:d,searchText:A,onEventPress:ln,onUpgradePress:()=>Xt("export")})]}),w?$e(Nh,{onClose:()=>p(false),children:[j(Zo,{icon:j(Jl,{size:14,color:Qe.color.textSecondary}),label:"Network throttling",testID:"buoy-network-menu-throttling",onPress:()=>{p(false),_l(a?y:void 0),i||c(Z=>Z+1)}}),j(Zo,{icon:j(Gl,{size:14,color:ao?Qe.color.accent:Qe.color.textSecondary}),label:"Filters",detail:ao?"Active":void 0,onPress:()=>{p(false),X("filters"),I(true)}}),j(Zo,{icon:j(Kl,{size:14,color:Qe.color.textSecondary}),label:"Saved requests",onPress:()=>{p(false),H(true)}}),j(f,{style:Bt.menuCopyRow,children:j(Xu,{isPro:d,filter:m,ignoredPatterns:qt,copySettings:_t,paused:x,onUpgradePress:()=>{p(false),Xt("export")},label:"Copy requests"})})]}):null,j(td,{visible:io,onClose:()=>so(false),featureName:Ot==="saved"?"Saved Requests":Ot==="overrides"?"Response Overrides":"Network Export",description:Ot==="saved"?"Keep the requests that matter. Saved requests survive Clear, app restarts, and the 500-request history cap.":Ot==="overrides"?"Force any endpoint to fail, stall or return something else \u2014 no backend changes, no code changes. Free keeps one active rule.":"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:Ot==="overrides"?[`Run ${Fe} rules at once (free keeps ${Un})`,"Force a 500, a 401 or an empty list in one tap","Simulate offline, timeouts and slow connections","Rules survive an app reload, so you can test the boot path"]:Ot==="saved"?[`Save up to ${it} requests (free keeps ${Mi})`,"Failed requests stay put through a Clear","Snapshots survive an app restart","Export saved requests to teammates or AI assistants"]:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]})]});return i?$e(f,{style:Bt.inlineRoot,children:[j(f,{style:Bt.inlineHeader,...nd,children:hn()}),pn]}):j(Ql,{visible:e,onClose:t,onMinimize:o,minimizeRequest:h,persistenceKey:js,variant:"night",header:{showToggleButton:true,customContent:hn()},onModeChange:$s,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Fs,styles:{},children:pn})}var Bt=he.create({container:{flex:1,backgroundColor:"transparent"},detailRoot:{flex:1,minHeight:0},detailBodyFallback:{flex:1},inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Zl.border.default,backgroundColor:"transparent"},menuCopyRow:{paddingHorizontal:6},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:Qe.color.buttonSurface,borderWidth:1,borderColor:Qe.color.border,alignItems:"center",justifyContent:"center"},activeFilterButton:{backgroundColor:Qe.color.accentSoft,borderColor:Qe.color.accentBorderStrong}});function bs(e){return j(qo,{children:j(ys,{...e})})}function rp(e={}){return j(qo,{children:j(ys,{...e,inline:true,visible:true,onClose:op})})}var op=()=>{};import{jsx as np}from"react/jsx-runtime";var vs=typeof navigator<"u"&&navigator.product==="ReactNative";vs&&U.ensureLoaded();vs&&typeof ce<"u"&&ce&&K.startBootCapture();var Ss=Ml({id:"network",name:"NET",description:"Network request logger",slot:"both",icon:({size:e})=>np(Al,{size:e}),component:bs,props:{enableSharedModalDimensions:false}}),ip=Hl(Ss,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}));q();function sp(){let e=typeof navigator<"u"&&navigator.product==="ReactNative";if(!e&&(typeof window>"u"||typeof document>"u"))return()=>{};U.ensureLoaded();let t=e?()=>{}:ai(),r=K.subscribeToEvents(()=>{}),o=false;return()=>{o||(o=true,t(),r())}}q();import{useState as Yo,useEffect as ap,useCallback as Yr,useMemo as tt,useRef as lp}from"react";import{useLimit as dp,TIER_LIMITS as up}from"@buoy-gg/shared-ui/web";var Cg=up["network.requests"].free;function cp(e={}){let{isPro:t=false}=e,r=dp("network.requests"),o=t?1/0:r,[n,i]=Yo([]),[s,l]=Yo({}),[a,d]=Yo(true),u=lp(null);ap(()=>(a&&(u.current=K.subscribeToEvents(i)),()=>{u.current&&(u.current(),u.current=null)}),[a]);let v=Yr(()=>{K.clearEvents(),i([])},[]),T=Yr(()=>{d(false)},[]),x=Yr(()=>{d(true)},[]),L=tt(()=>s.searchText?s.searchText.toLowerCase():null,[s.searchText]),m=tt(()=>s.method&&s.method.length>0?new Set(s.method):null,[s.method]),k=tt(()=>s.contentType&&s.contentType.length>0?new Set(s.contentType):null,[s.contentType]),E=tt(()=>{let h=[...n];if(m&&(h=h.filter(c=>m.has(c.method))),s.status&&s.status!=="all")switch(s.status){case"success":h=h.filter(c=>c.status&&c.status>=200&&c.status<300);break;case"error":h=h.filter(c=>c.error||c.status&&c.status>=400);break;case"pending":h=h.filter(c=>!c.status&&!c.error);break}return L&&(h=h.filter(c=>c.url.toLowerCase().includes(L)||c.method.toLowerCase().includes(L)||c.path?.toLowerCase().includes(L)||c.host?.toLowerCase().includes(L)||c.error&&c.error.toLowerCase().includes(L)||c.operationName&&c.operationName.toLowerCase().includes(L)||wi(c.graphqlVariables,L))),s.host&&(h=h.filter(c=>c.host===s.host)),k&&(h=h.filter(c=>{let y=c.responseHeaders||c.requestHeaders,O=y?.["content-type"]||y?.["Content-Type"]||"";for(let re of k)switch(re){case"JSON":if(O.includes("json"))return true;break;case"XML":if(O.includes("xml"))return true;break;case"HTML":if(O.includes("html"))return true;break;case"TEXT":if(O.includes("text"))return true;break;case"IMAGE":if(O.includes("image"))return true;break;case"VIDEO":if(O.includes("video"))return true;break;case"AUDIO":if(O.includes("audio"))return true;break;case"FORM":if(O.includes("form"))return true;break;case"OTHER":if(!O||!O.includes("json")&&!O.includes("xml")&&!O.includes("html")&&!O.includes("text")&&!O.includes("image")&&!O.includes("video")&&!O.includes("audio")&&!O.includes("form"))return true;break}return false})),h},[n,s,L,m,k]),g=tt(()=>{let h=new Set;return n.slice(o).forEach(c=>{h.add(c.id)}),h},[n,o]),I=tt(()=>E.filter(h=>g.has(h.id)),[E,g]),D=I.length>0,H=I.length,S=Yr(h=>g.has(h),[g]),z=tt(()=>{let h=0,c=0,y=0,O=0,re=0,ne=0,ee=0;for(let A of n)A.status&&A.status>=200&&A.status<300?h++:A.error||A.status&&A.status>=400?c++:!A.status&&!A.error&&y++,O+=A.requestSize||0,re+=A.responseSize||0,A.duration&&(ne+=A.duration,ee++);let X=ee>0?ne/ee:0;return{totalRequests:n.length,successfulRequests:h,failedRequests:c,pendingRequests:y,totalDataSent:O,totalDataReceived:re,averageDuration:Math.round(X)}},[n]),w=tt(()=>{let h=new Set;for(let c of n)c.host&&h.add(c.host);return Array.from(h)},[n]),p=tt(()=>{let h=new Set;for(let c of n)h.add(c.method);return Array.from(h)},[n]);return{events:E,allEvents:n,stats:z,filter:s,setFilter:l,clearEvents:v,isCapturing:a,pauseCapturing:T,resumeCapturing:x,hosts:w,methods:p,hasLockedEvents:D,lockedEventCount:H,isEventLocked:S,requestLimit:o,getSubscriberCounts:()=>K.getSubscriberCounts()}}import{useIgnoredPatterns as hp,ignoredPatternsStore as pp,urlMatchesIgnoredPattern as fp,isUrlIgnored as gp}from"@buoy-gg/shared-ui/web";q();import{approxJsonSize as en,isOverWireBudget as mp}from"@buoy-gg/shared-ui/web";import{expandKeyedArrays as yp,patchFromPath as bp,refusalText as vp,shapeKind as xs,suggestedPatch as Sp,typedEditViolations as xp}from"@buoy-gg/shared-ui/web";var tn=16*1024,eo=1.25*1024*1024;function rn(e,t){return e===void 0?false:(t??0)>tn?true:mp(e,tn)}var ws=new WeakMap,Ts=new WeakMap;function on(e){let t=ws.get(e);if(t)return t;let r;try{r=Tp(e)}catch{r=wp(e)}return ws.set(e,r),r}function wp(e){let t={...e,requestData:void 0,responseData:void 0,graphqlVariables:void 0,requestBodyOmitted:e.requestData!==void 0?true:void 0,responseBodyOmitted:e.responseData!==void 0?true:void 0},r=1024;try{r=en(t,eo).bytes}catch{}return{event:t,bytes:r}}function Tp(e){let t=rn(e.requestData,e.requestSize),r=rn(e.responseData,e.responseSize),o=Cs(e.graphqlVariables),n=ks(e.requestHeaders),i=ks(e.responseHeaders),s=t||r||o!==e.graphqlVariables||n!==e.requestHeaders||i!==e.responseHeaders,l=e;return s&&(l={...e},t&&(l.requestData=void 0,l.requestBodyOmitted=true),r&&(l.responseData=void 0,l.responseBodyOmitted=true),o!==e.graphqlVariables&&(l.graphqlVariables=o),n!==e.requestHeaders&&(l.requestHeaders=n,l.headersOmitted=true),i!==e.responseHeaders&&(l.responseHeaders=i,l.headersOmitted=true)),{event:l,bytes:en(l,eo).bytes}}function Cp(e){let t=Ts.get(e);if(t)return t;let{event:r}=on(e),o={...r};o.requestData!==void 0&&(o.requestData=void 0,o.requestBodyOmitted=true),o.responseData!==void 0&&(o.responseData=void 0,o.responseBodyOmitted=true),o.graphqlVariables!==void 0&&(o.graphqlVariables=Cs(o.graphqlVariables,true));let n={event:o,bytes:en(o,eo).bytes};return Ts.set(e,n),n}function kp(e){let t=new Array(e.length),r=0;for(let o=0;o<e.length;o++){let n=on(e[o]);if(r+n.bytes<=eo)t[o]=n.event,r+=n.bytes;else{let i=Cp(e[o]);t[o]=i.event,r+=i.bytes}}return t}function Cs(e,t=false){if(!e||!t&&!rn(e,void 0))return e;let r={};for(let[o,n]of Object.entries(e))(typeof n=="string"&&n.length<=64||typeof n=="number"||typeof n=="boolean")&&(r[o]=n);return Object.keys(r).length>0?r:void 0}var nn=64;function ks(e){if(!e)return e;let t=false,r={};for(let[o,n]of Object.entries(e))typeof n=="string"&&(n.length<=nn?r[o]=n:(r[o]=`${n.slice(0,nn)}\u2026 [${n.length-nn} more]`,t=true));return t?r:e}var Rp=e=>{let t=false,r=e.rules.map(o=>!o.body||o.body.length<=tn?o:(t=true,{...o,body:void 0,bodyOmitted:true}));return t?{...e,rules:r}:e},to=e=>K.getEventById(e)??ae.getEventById(e),Ut=e=>e&&typeof e=="object"?e.id:void 0,ro=(e,t)=>!!(e&&typeof e=="object"&&e[t]),oo=()=>Xn()?{}:{active:false,inactiveReason:vl},Ep=["respond","fail","delay"];function Ip(e,t){if(!e||typeof e!="object")return null;let r=e.rule??e;if(!r||typeof r!="object")return null;let o=r,n=typeof o.urlPattern=="string"&&o.urlPattern.trim()?o.urlPattern.trim():t?.urlPattern??"";if(!n)return null;let i=Ep.includes(o.kind)?o.kind:t?.kind??"respond";return{id:typeof o.id=="string"?o.id:void 0,enabled:o.enabled!==false,name:typeof o.name=="string"?o.name:t?.name,urlPattern:n,methods:Array.isArray(o.methods)?o.methods.filter(s=>typeof s=="string").map(s=>s.toUpperCase()):t?.methods,requireHeader:typeof o.requireHeader=="string"&&o.requireHeader.trim()?o.requireHeader.trim():void 0,bodyIncludes:typeof o.bodyIncludes=="string"&&o.bodyIncludes?o.bodyIncludes.slice(0,4096):t?.bodyIncludes,kind:i,status:typeof o.status=="number"?o.status:t?.status,statusText:typeof o.statusText=="string"?o.statusText:t?.statusText,headers:o.headers&&typeof o.headers=="object"?o.headers:t?.headers,body:Bp(o,t),failKind:o.failKind==="timeout"?"timeout":void 0,delayMs:typeof o.delayMs=="number"?o.delayMs:void 0,times:typeof o.times=="number"?o.times:null,alternate:o.alternate===true}}var Lt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Rs(e,t,r="",o={shrunk:[],breaks:[]}){if(Array.isArray(e)&&Array.isArray(t))return t.length>0&&t.length<e.length&&o.shrunk.push({path:r||"(root)",have:e.length,sent:t.length}),t;if(!Lt(e)||!Lt(t))return t;let n={...e};for(let[i,s]of Object.entries(t)){let l=r?`${r}.${i}`:i;if(i in e){let a=xs(e[i]),d=xs(s);(a==="array"||a==="object")&&a!==d&&o.breaks.push({path:l,from:a,to:d}),n[i]=Rs(e[i],s,l,o)}else n[i]=s}return n}function Pp(e,t){if(e.body!=null||!Lt(e.bodyPatch)||typeof t!="string")return[];try{return xp(JSON.parse(t),e.bodyPatch,{noun:"response body"})}catch{return[]}}function Bp(e,t){if(typeof e.body=="string")return e.body;if(e.body!=null)return JSON.stringify(e.body,null,2);let r=t?.body??(Lt(e.bodyPatch)&&typeof e.id=="string"?U.getState().rules.find(o=>o.id===e.id)?.body:void 0);if(Lt(e.bodyPatch)&&typeof r=="string")try{return JSON.stringify(Rs(JSON.parse(r),e.bodyPatch),null,2)}catch{return r}return r}function Lp(e){if(!e||typeof e!="object")return null;let t=e.rule??e;if(!t||typeof t!="object")return null;let r=t.id;if(typeof r!="string")return null;let o=U.getState().rules.find(n=>n.id===r);return o?{...o}:null}function qp(e){if(!e||typeof e!="object")return null;let t=e.rule??e;if(!t||typeof t!="object")return null;let r=t;if(r.bodyOmitted!==true||typeof r.id!="string")return null;let o=U.getState().rules.find(n=>n.id===r.id);return o?{body:o.body}:null}function Op(e){if(!e||typeof e!="object")return null;let t=e.fromRequestId;if(typeof t!="string"||!t)return null;let r=to(t);return r?Qo(r):null}var Dp={dispose:()=>{U.setEnabled(false)},version:6,getSnapshot:()=>(K.ensureInterception(),{conditions:{version:1,runtimeId:ko,profile:vt(),available:bt()},events:kp(K.getEvents()),overrides:Rp(U.getState()),saved:ae.getRecords().map(e=>({...e,event:on(e.event).event}))}),subscribe:e=>{let t=K.subscribeToEvents(e),r=rr(e),o=ae.subscribe(e),n=U.subscribe(e);return()=>{r(),t(),o(),n()}},actions:{getNetworkConditions:()=>({runtimeId:ko,profile:vt(),available:bt()}),setNetworkConditions:e=>{let t=e&&typeof e=="object"?e.profile:void 0;return{runtimeId:ko,profile:Cr(t),available:bt()}},clearEvents:()=>{K.clearEvents()},getEventBody:e=>{let t=Ut(e);if(!t)return null;let r=to(t);return r?{url:r.url??null,method:r.method??null,status:r.status??null,override:r.override??null,requestData:r.requestData??null,responseData:r.responseData??null,requestHeaders:r.requestHeaders??null,responseHeaders:r.responseHeaders??null}:null},setPinned:e=>{let t=Ut(e);if(!t)return null;let r=to(t);if(!r)return null;let o=ro(e,"pinned");return Dr(ae.getState(),t).pinned===o?{ok:true}:ae.togglePin(r)},setSaved:e=>{let t=Ut(e);if(!t)return null;let r=to(t);if(!r)return null;let o=ro(e,"saved");return Dr(ae.getState(),t).saved===o?{ok:true}:ae.toggleSave(r)},removeSavedRecord:e=>{let t=e&&typeof e=="object"?e.key:void 0;return t?(ae.remove(t),{ok:true}):null},clearSavedRequests:()=>(ae.clearSaved(),{ok:true}),clearPinnedRequests:()=>(ae.clearPinned(),{ok:true}),setOverridesEnabled:e=>(U.setEnabled(ro(e,"enabled")),{ok:true,enabled:U.getState().enabled,...oo()}),upsertOverrideRule:e=>{let t=e?.rule??e,r=!!t&&t.body==null&&(Lt(t.bodyPatch)||typeof t.bodyPath=="string"),o=Op(e)??qp(e)??(r?Lp(e):null);if(t&&typeof t.bodyPath=="string"&&t.body==null){let s=o?.body??(typeof t.id=="string"?U.getState().rules.find(d=>d.id===t.id)?.body:void 0);if(typeof s!="string")return{ok:false,error:"bodyPath needs something to patch: send fromRequestId (the captured request whose real response it addresses) or the id of an existing rule."};if(t.bodyValue===void 0)return{ok:false,error:`Refused: sent \`bodyPath\` without \`bodyValue\`. Say what to set "${t.bodyPath}" to.`};let l;try{l=JSON.parse(s)}catch{return{ok:false,error:"The captured response body is not JSON, so it cannot be addressed by path. Send a whole `body` instead."}}let a=bp(l,t.bodyPath,t.bodyValue);if(!a.ok)return{ok:false,error:`Refused: ${a.error}`};t.bodyPatch=a.patch,delete t.bodyPath,delete t.bodyValue}if(t&&Lt(t.bodyPatch)&&t.body==null){let s=o?.body??(typeof t.id=="string"?U.getState().rules.find(l=>l.id===t.id)?.body:void 0);if(typeof s!="string")return{ok:false,error:"bodyPatch needs something to patch: send fromRequestId (the captured request whose real response the patch is merged into) or the id of an existing rule."};if(t.force!==true){let l;try{let d=yp(JSON.parse(s),t.bodyPatch);l=d.error,d.notes.length&&(t.bodyPatch=d.patch)}catch{}if(l)return{ok:false,error:`Refused: ${l}`};let a=Pp(t,s);if(a.length>0)return{ok:false,error:vp(a,"response body",Sp(t.bodyPatch,a)),violations:a}}}let n=Ip(e,o);if(!n){let s=e?.fromRequestId;return{ok:false,error:s?`No captured request \`${s}\` \u2014 it may have been cleared. Send a urlPattern instead.`:"A rule needs a non-empty urlPattern."}}let i=U.upsertRule(n);return i?(i.enabled&&U.setEnabled(true),{ok:true,rule:{id:i.id,urlPattern:i.urlPattern,enabled:i.enabled,kind:i.kind,status:i.status,times:i.times,bodySize:i.body?i.body.length:0},...i.times===void 0||i.times===null?{lingers:`This rule has no \`times\` budget, so it overrides EVERY matching request until it is disabled or deleted (id \`${i.id}\`). If you meant only the next one, set times:1.`}:{},...oo()}):{ok:false,error:"Override rule limit reached."}},setOverrideRuleEnabled:e=>{let t=Ut(e);return t?(U.setRuleEnabled(t,ro(e,"enabled")),{ok:true,...oo()}):{ok:false,error:"Missing rule id."}},deleteOverrideRule:e=>{let t=Ut(e);return t?(U.removeRule(t),{ok:true}):{ok:false,error:"Missing rule id."}},clearOverrideRules:()=>(U.clearRules(),{ok:true}),replaceOverrideRules:async e=>{let t=e??{};if(!Array.isArray(t.rules))return{ok:false,error:"replaceOverrideRules needs `rules`: an array of rules, first match first."};if(t.rules.length>Fe)return{ok:false,error:`Too many rules: ${t.rules.length}. The most is ${Fe}.`};await U.ensureLoaded();let r=U.replaceAllRules(t.rules,t.enabled!==false);return r?{ok:true,count:r.length,enabled:U.getState().enabled,...oo()}:{ok:false,error:"This copy of the Network tool only mirrors a device, so it can't replace rules."}},listOverrideRules:async()=>(await U.ensureLoaded(),U.getState()),getOverrideRuleBody:e=>{let t=Ut(e);if(!t)return null;let r=U.getState().rules.find(o=>o.id===t);return r?{body:r.body??null}:null},getCaptureStatus:()=>{let e=K.getSubscriberCounts().total,t=null,r=null;try{t=ti(),r=mt()}catch{}let o=null;try{o=Dl()}catch{}return{capturing:e>0,subscribers:e,interceptorInstalled:t,interceptorLive:o,listenerCount:r,eventCount:K.getEvents().length}},debugOverrides:e=>{let{url:t,method:r}=e&&typeof e=="object"?e:{},o=typeof t=="string"?t:"https://example.com/",n=typeof r=="string"&&r.trim()?r.trim().toUpperCase():"GET";return{tested:{url:o,method:n},interceptorInstalled:ti(),listenerCount:mt(),engine:Sl(o,n),store:{enabled:U.getState().enabled,autoPaused:U.getState().autoPaused,ruleCount:U.getState().rules.length,rulesVisibleToEngine:U.getRules().length}}}}};q();var zp=new Set(["content-length","host","connection","accept-encoding"]);function sn(e){return`'${e.replace(/'/g,"'\\''")}'`}function Ap(e){if(e==null)return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return null}}function Hp(e){let t=(e.method||"GET").toUpperCase(),r=Ap(e.requestData),o=[];t!=="GET"&&!(t==="POST"&&r!==null)&&o.push(`-X ${t}`);for(let[i,s]of Object.entries(e.requestHeaders||{}))zp.has(i.toLowerCase())||o.push(`-H ${sn(`${i}: ${s}`)}`);r!==null&&o.push(`--data-raw ${sn(r)}`);let n=`curl ${sn(e.url)}`;return o.length===0?n:`${n} \\
|
|
144
144
|
${o.join(` \\
|
|
145
145
|
`)}`}export{qu as DEFAULT_SETTLE_MS,Un as FREE_TIER_OVERRIDE_LIMIT,Mi as FREE_TIER_SAVED_LIMIT,Fe as MAX_OVERRIDE_RULES,Or as MAX_PINNED,it as MAX_SAVED,tr as NETWORK_CONDITIONS,Ad as NetworkBodyResolverProvider,Gi as NetworkDetailPinActions,ki as NetworkEventDetailView,$t as NetworkEventItemCompact,Ji as NetworkHeaderBadgesView,bs as NetworkModal,_u as NetworkSavedButton,rs as NetworkSavedScreen,rp as NetworkToolView,Zt as OVERRIDE_STATUS_MAX,Qt as OVERRIDE_STATUS_MIN,qo as TickProvider,er as addNetworkListener,ip as createNetworkTool,Qo as draftFromEvent,Dr as flagsForEventId,Ye as formatBytes,Lr as formatDuration,Si as formatHttpStatus,Hp as generateCurl,vt as getNetworkCondition,pp as ignoredPatternsStore,gp as isUrlIgnored,K as networkEventStore,xr as networkListener,ae as networkSavedStore,Ue as networkSelectionStore,Dp as networkSyncAdapter,Ss as networkToolPreset,U as overrideRulesStore,Ol as removeAllNetworkListeners,Cr as setNetworkCondition,Wo as splitPinned,sp as startNetworkCapture,rr as subscribeNetworkConditions,fp as urlMatchesIgnoredPattern,hp as useIgnoredPatterns,ms as useLiveNetworkEvent,Ui as useNetworkBadgeCounts,hr as useNetworkEventList,cp as useNetworkEvents,Mt as useNetworkSaved,Oo as useTickEveryMinute};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/network",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.78",
|
|
4
4
|
"description": "In-app network inspector for React Native — requests, responses, timing & errors live, with GraphQL operation parsing. Part of Buoy devtools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
37
|
+
"@buoy-gg/shared-ui": "^7.0.78"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "*"
|