react-native-inapp-inspector 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,l,r,a){a===void 0&&(a=r);var s=Object.getOwnPropertyDescriptor(l,r);(!s||("get"in s?!l.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return l[r]}}),Object.defineProperty(n,a,s)}):(function(n,l,r,a){a===void 0&&(a=r),n[a]=l[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,l){Object.defineProperty(n,"default",{enumerable:!0,value:l})}):function(n,l){n.default=l}),__importStar=this&&this.__importStar||(function(){var n=function(l){return n=Object.getOwnPropertyNames||function(r){var a=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(a[a.length]=s);return a},n(l)};return function(l){if(l&&l.__esModule)return l;var r={};if(l!=null)for(var a=n(l),s=0;s<a.length;s++)a[s]!=="default"&&__createBinding(r,l,a[s]);return __setModuleDefault(r,l),r}})(),__importDefault=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),AnalyticsEventCard_1=__importDefault(require("../AnalyticsEventCard")),AnalyticsFilterModal_1=__importDefault(require("./AnalyticsFilterModal")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),EmptyState_1=__importDefault(require("../EmptyState")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),i18n_1=require("../../i18n"),TouchableScale_1=__importDefault(require("../TouchableScale")),helpers_1=require("../../helpers"),NetworkIcons_1=require("../NetworkIcons"),AnalyticsTab=react_1.default.memo(()=>{const{t:n}=(0,i18n_1.useTranslation)(),{analyticsEvents:l,filteredAnalyticsEvents:r,analyticsSearch:a,setAnalyticsSearch:s,analyticsFilters:w,setAnalyticsFilters:T,handleDelete:L,selectedEvent:z,setSelectedEvent:x,newEventIds:V,logRouteMapRef:F,isAnalyticsLayoutReady:E,setIsAnalyticsLayoutReady:B,isAnalyticsFilterApplied:v}=(0,InspectorContext_1.useInspector)(),N=(0,react_1.useRef)(null),[R,O]=(0,react_1.useState)(!1),[P,k]=(0,react_1.useState)(100),A=(0,react_1.useMemo)(()=>r.slice(0,P),[r,P]),u=(0,react_1.useMemo)(()=>{let e=0,o=0,t=0,i=0;for(const m of l){const C=(0,helpers_1.getEventCategory)(m.name),c=m.count||1;C==="ecommerce"?e+=c:C==="page_view"?o+=c:C==="system"?t+=c:i+=c}const _=e+o+t+i;return{ecommerce:e,page_view:o,system:t,custom:i,totalCount:_}},[l]),q=(0,react_1.useCallback)(e=>{(0,InspectorContext_1.animateNextLayout)(),T(o=>{if(e==="all")return{...o,categories:new Set(["all"])};const t=new Set(o.categories);if(t.has("all"))t.delete("all"),t.add(e);else if(t.has(e))t.delete(e),t.size===0&&t.add("all");else if(t.add(e),t.has("ecommerce")&&t.has("page_view")&&t.has("system")&&t.has("custom"))return{...o,categories:new Set(["all"])};return{...o,categories:t}})},[T]),D=(0,react_1.useCallback)((e,o)=>e?.id?.toString()??o.toString(),[]),j=(0,react_1.useCallback)(({item:e,index:o})=>{const t=r[o+1],i=r[o-1],_=t?e.timestamp-t.timestamp:void 0,m=Math.floor(e.timestamp/6e4),C=i?Math.floor(i.timestamp/6e4):-1,c=o===0||m!==C;return<AnalyticsEventCard_1.default event={e}onPress={()=>{x(e)}}isNew={V.has(e.id)}searchStr={a}isFirst={o===0}isLast={o===r.length-1}msSincePrev={_}showTimestamp={c}computedScreenName={(()=>{if(!e)return"";const b=e.screenName||e.screenClass||e.pageTitle||e.pageLocation||e.params?.firebase_screen||e.params?.screen_name||e.params?.firebase_screen_class||e.params?.screen_class;let S=typeof b=="string"?b:b?JSON.stringify(b):"";const I=F.current.get(e.id+1e6);if(!S&&I&&I.path!=="Navigators"){const M=I.path.split(" \u2794 ");S=M[M.length-1]}return S})()}/>},[r,a,V,x,F]),$=(0,react_1.useCallback)((e,o)=>({length:86,offset:86*o,index:o}),[]);return<>
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,l,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(l,a);(!s||("get"in s?!l.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return l[a]}}),Object.defineProperty(n,o,s)}):(function(n,l,a,o){o===void 0&&(o=a),n[o]=l[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,l){Object.defineProperty(n,"default",{enumerable:!0,value:l})}):function(n,l){n.default=l}),__importStar=this&&this.__importStar||(function(){var n=function(l){return n=Object.getOwnPropertyNames||function(a){var o=[];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(o[o.length]=s);return o},n(l)};return function(l){if(l&&l.__esModule)return l;var a={};if(l!=null)for(var o=n(l),s=0;s<o.length;s++)o[s]!=="default"&&__createBinding(a,l,o[s]);return __setModuleDefault(a,l),a}})(),__importDefault=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),AnalyticsEventCard_1=__importDefault(require("../AnalyticsEventCard")),AnalyticsFilterModal_1=__importDefault(require("./AnalyticsFilterModal")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),EmptyState_1=__importDefault(require("../EmptyState")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),i18n_1=require("../../i18n"),TouchableScale_1=__importDefault(require("../TouchableScale")),helpers_1=require("../../helpers"),NetworkIcons_1=require("../NetworkIcons"),LOAD_MORE_STEP=10,AnalyticsTab=react_1.default.memo(()=>{const{t:n}=(0,i18n_1.useTranslation)(),{analyticsEvents:l,filteredAnalyticsEvents:a,analyticsSearch:o,setAnalyticsSearch:s,analyticsFilters:m,setAnalyticsFilters:x,handleDelete:B,selectedEvent:R,setSelectedEvent:V,newEventIds:O,logRouteMapRef:F,isAnalyticsLayoutReady:N,setIsAnalyticsLayoutReady:k,isAnalyticsFilterApplied:w,maxAnalyticsEventsLimit:A}=(0,InspectorContext_1.useInspector)(),q=A||100,P=(0,react_1.useRef)(null),[D,E]=(0,react_1.useState)(!1),[L,M]=(0,react_1.useState)(q);react_1.default.useEffect(()=>{M(A||100),P.current?.scrollToOffset({offset:0,animated:!1})},[o,m,A]);const S=(0,react_1.useMemo)(()=>a.slice(0,L),[a,L]),u=(0,react_1.useMemo)(()=>{let e=0,r=0,t=0,i=0;for(const b of l){const C=(0,helpers_1.getEventCategory)(b.name),c=b.count||1;C==="ecommerce"?e+=c:C==="page_view"?r+=c:C==="system"?t+=c:i+=c}const _=e+r+t+i;return{ecommerce:e,page_view:r,system:t,custom:i,totalCount:_}},[l]),j=(0,react_1.useCallback)(e=>{(0,InspectorContext_1.animateNextLayout)(),x(r=>{if(e==="all")return{...r,categories:new Set(["all"])};const t=new Set(r.categories);if(t.has("all"))t.delete("all"),t.add(e);else if(t.has(e))t.delete(e),t.size===0&&t.add("all");else if(t.add(e),t.has("ecommerce")&&t.has("page_view")&&t.has("system")&&t.has("custom"))return{...r,categories:new Set(["all"])};return{...r,categories:t}})},[x]),$=(0,react_1.useCallback)((e,r)=>e?.id?.toString()??r.toString(),[]),H=(0,react_1.useCallback)(({item:e,index:r})=>{const t=a[r+1],i=a[r-1],_=t?e.timestamp-t.timestamp:void 0,b=Math.floor(e.timestamp/6e4),C=i?Math.floor(i.timestamp/6e4):-1,c=r===0||b!==C;return<AnalyticsEventCard_1.default event={e}onPress={()=>{V(e)}}isNew={O.has(e.id)}searchStr={o}isFirst={r===0}isLast={r===a.length-1}msSincePrev={_}showTimestamp={c}computedScreenName={(()=>{if(!e)return"";const v=e.screenName||e.screenClass||e.pageTitle||e.pageLocation||e.params?.firebase_screen||e.params?.screen_name||e.params?.firebase_screen_class||e.params?.screen_class;let I=typeof v=="string"?v:v?JSON.stringify(v):"";const T=F.current.get(e.id+1e6);if(!I&&T&&T.path!=="Navigators"){const z=T.path.split(" \u2794 ");I=z[z.length-1]}return I})()}/>},[a,o,O,V,F]),W=(0,react_1.useCallback)((e,r)=>({length:86,offset:86*r,index:r}),[]);return<>
2
2
 
3
- {z==null&&<react_native_1.View style={{backgroundColor:AppColors_1.AppColors.white,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor,paddingBottom:6}}>
3
+ {R==null&&<react_native_1.View style={{backgroundColor:AppColors_1.AppColors.white,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor,paddingBottom:6}}>
4
4
  <react_native_1.View style={[styles_1.default.toolbarRow,{marginTop:12,marginBottom:8}]}>
5
5
  <react_native_1.View style={styles_1.default.searchContainer}>
6
6
  <NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak}size={16}/>
7
- <react_native_1.TextInput placeholder={n("analytics.searchPlaceholder","Search events...")}placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={a}onChangeText={s}style={styles_1.default.searchInput}autoCorrect={!1}autoCapitalize="none"/>
8
- {a.length>0&&<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:4}}>
7
+ <react_native_1.TextInput placeholder={n("analytics.searchPlaceholder","Search events...")}placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={o}onChangeText={s}style={styles_1.default.searchInput}autoCorrect={!1}autoCapitalize="none"/>
8
+ {o.length>0&&<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:4}}>
9
9
  <react_native_1.View style={{backgroundColor:`${AppColors_1.AppColors.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
10
10
  <react_native_1.Text style={{color:AppColors_1.AppColors.purple,fontSize:9.5,fontFamily:AppFonts_1.AppFonts.interBold}}>
11
- {r.length}
11
+ {a.length}
12
12
  </react_native_1.Text>
13
13
  </react_native_1.View>
14
14
  <react_native_1.Pressable onPress={()=>s("")}hitSlop={10}style={styles_1.default.clearBtn}>
@@ -18,12 +18,12 @@
18
18
  </react_native_1.View>
19
19
  <react_native_1.View style={styles_1.default.toolbarRight}>
20
20
 
21
- <react_native_1.TouchableOpacity style={[styles_1.default.toolbarBtn,v&&{borderColor:`${AppColors_1.AppColors.brandPurple}60`,backgroundColor:`${AppColors_1.AppColors.brandPurple}15`}]}onPress={()=>O(!0)}hitSlop={6}>
22
- <NetworkIcons_1.FilterIcon color={v?AppColors_1.AppColors.brandPurple:AppColors_1.AppColors.grayTextStrong}size={15}/>
23
- {v&&<react_native_1.View style={{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:3.5,backgroundColor:AppColors_1.AppColors.darkOrange,borderWidth:1,borderColor:AppColors_1.AppColors.white}}/>}
21
+ <react_native_1.TouchableOpacity style={[styles_1.default.toolbarBtn,w&&{borderColor:`${AppColors_1.AppColors.brandPurple}60`,backgroundColor:`${AppColors_1.AppColors.brandPurple}15`}]}onPress={()=>E(!0)}hitSlop={6}>
22
+ <NetworkIcons_1.FilterIcon color={w?AppColors_1.AppColors.brandPurple:AppColors_1.AppColors.grayTextStrong}size={15}/>
23
+ {w&&<react_native_1.View style={{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:3.5,backgroundColor:AppColors_1.AppColors.darkOrange,borderWidth:1,borderColor:AppColors_1.AppColors.white}}/>}
24
24
  </react_native_1.TouchableOpacity>
25
25
 
26
- <react_native_1.TouchableOpacity style={[styles_1.default.toolbarBtn,{borderColor:`${AppColors_1.AppColors.errorColor}38`,backgroundColor:`${AppColors_1.AppColors.errorColor}0F`}]}onPress={L}hitSlop={6}>
26
+ <react_native_1.TouchableOpacity style={[styles_1.default.toolbarBtn,{borderColor:`${AppColors_1.AppColors.errorColor}38`,backgroundColor:`${AppColors_1.AppColors.errorColor}0F`}]}onPress={B}hitSlop={6}>
27
27
  <NetworkIcons_1.TrashIcon color={AppColors_1.AppColors.errorColor}size={15}/>
28
28
  </react_native_1.TouchableOpacity>
29
29
  </react_native_1.View>
@@ -32,14 +32,14 @@
32
32
 
33
33
  <react_native_1.View style={{flexDirection:"row",alignItems:"center",marginBottom:8,paddingHorizontal:12,gap:6}}>
34
34
  <react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}style={{flex:1}}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:6,paddingRight:6}}>
35
- {[{id:"all",label:n("common.all","All"),count:u.totalCount,color:AppColors_1.AppColors.purple,Icon:NetworkIcons_1.LayersIcon},{id:"ecommerce",label:"Ecommerce",count:u.ecommerce,color:AppColors_1.AppColors.amber600,Icon:NetworkIcons_1.CartIcon},{id:"page_view",label:"Screens",count:u.page_view,color:AppColors_1.AppColors.sky600,Icon:NetworkIcons_1.GlobeIcon},{id:"system",label:"System",count:u.system,color:AppColors_1.AppColors.violet600,Icon:NetworkIcons_1.BoltIcon},{id:"custom",label:"Custom",count:u.custom,color:AppColors_1.AppColors.teal600,Icon:NetworkIcons_1.SparkleIcon}].map(e=>{const o=e.id==="all"?w.categories.has("all"):!w.categories.has("all")&&w.categories.has(e.id),t=e.color||AppColors_1.AppColors.purple,i=o?AppColors_1.AppColors.white:t,_=e.Icon;return<TouchableScale_1.default key={e.id}onPress={()=>q(e.id)}>
36
- <react_native_1.View style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:o?t:`${t}12`,borderWidth:1,borderColor:o?t:`${t}30`,gap:5}}>
35
+ {[{id:"all",label:n("common.all","All"),count:u.totalCount,color:AppColors_1.AppColors.purple,Icon:NetworkIcons_1.LayersIcon},{id:"ecommerce",label:"Ecommerce",count:u.ecommerce,color:AppColors_1.AppColors.amber600,Icon:NetworkIcons_1.CartIcon},{id:"page_view",label:"Screens",count:u.page_view,color:AppColors_1.AppColors.sky600,Icon:NetworkIcons_1.GlobeIcon},{id:"system",label:"System",count:u.system,color:AppColors_1.AppColors.violet600,Icon:NetworkIcons_1.BoltIcon},{id:"custom",label:"Custom",count:u.custom,color:AppColors_1.AppColors.teal600,Icon:NetworkIcons_1.SparkleIcon}].map(e=>{const r=e.id==="all"?m.categories.has("all"):!m.categories.has("all")&&m.categories.has(e.id),t=e.color||AppColors_1.AppColors.purple,i=r?AppColors_1.AppColors.white:t,_=e.Icon;return<TouchableScale_1.default key={e.id}onPress={()=>j(e.id)}>
36
+ <react_native_1.View style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:r?t:`${t}12`,borderWidth:1,borderColor:r?t:`${t}30`,gap:5}}>
37
37
  <_ size={11}color={i}/>
38
- <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5,color:o?AppColors_1.AppColors.white:AppColors_1.AppColors.primaryBlack}}>
38
+ <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5,color:r?AppColors_1.AppColors.white:AppColors_1.AppColors.primaryBlack}}>
39
39
  {e.label}
40
40
  </react_native_1.Text>
41
- <react_native_1.View style={{backgroundColor:o?"rgba(255,255,255,0.25)":`${t}20`,paddingHorizontal:5,paddingVertical:1,borderRadius:8,alignItems:"center",justifyContent:"center"}}>
42
- <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,color:o?AppColors_1.AppColors.white:t}}>
41
+ <react_native_1.View style={{backgroundColor:r?"rgba(255,255,255,0.25)":`${t}20`,paddingHorizontal:5,paddingVertical:1,borderRadius:8,alignItems:"center",justifyContent:"center"}}>
42
+ <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,color:r?AppColors_1.AppColors.white:t}}>
43
43
  {e.count}
44
44
  </react_native_1.Text>
45
45
  </react_native_1.View>
@@ -50,11 +50,11 @@
50
50
  </react_native_1.View>}
51
51
 
52
52
 
53
- <AnalyticsFilterModal_1.default visible={R}onClose={()=>O(!1)}/>
53
+ <AnalyticsFilterModal_1.default visible={D}onClose={()=>E(!1)}/>
54
54
 
55
- <react_native_1.View style={{flex:1}}onLayout={()=>B(!0)}>
56
- {E?<>
57
- <react_native_1.FlatList ref={N}data={A}keyExtractor={D}renderItem={j}getItemLayout={$}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<EmptyState_1.default isSearch={a.length>0}searchQuery={a}customTitle={a.length>0?"No matching analytics events":"No analytics events yet"}customSub={a.length>0?`No events matched "${a}"`:"Call setupAnalyticsLogger(analytics()) at app start."}onClearSearch={()=>s("")}/>}ListFooterComponent={r.length>0?<EndOfListFooter_1.default count={A.length}totalCount={r.length}label="events"hasMore={A.length<r.length}onLoadMore={()=>k(e=>e+10)}/>:null}contentContainerStyle={[styles_1.default.listContent,r.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
55
+ <react_native_1.View style={{flex:1}}onLayout={()=>k(!0)}>
56
+ {N?<>
57
+ <react_native_1.FlatList ref={P}data={S}keyExtractor={$}renderItem={H}getItemLayout={W}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<EmptyState_1.default isSearch={o.length>0}searchQuery={o}customTitle={o.length>0?"No matching analytics events":"No analytics events yet"}customSub={o.length>0?`No events matched "${o}"`:"Call setupAnalyticsLogger(analytics()) at app start."}onClearSearch={()=>s("")}/>}ListFooterComponent={a.length>0?<EndOfListFooter_1.default count={S.length}totalCount={a.length}label="events"loadMoreStep={LOAD_MORE_STEP}hasMore={S.length<a.length}onLoadMore={()=>M(e=>e+LOAD_MORE_STEP)}/>:null}contentContainerStyle={[styles_1.default.listContent,a.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
58
58
  </>:null}
59
59
  </react_native_1.View>
60
60
  </>});exports.default=AnalyticsTab;
@@ -1,23 +1,23 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,o,l,n){n===void 0&&(n=l);var a=Object.getOwnPropertyDescriptor(o,l);(!a||("get"in a?!o.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(t,n,a)}):(function(t,o,l,n){n===void 0&&(n=l),t[n]=o[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,o){Object.defineProperty(t,"default",{enumerable:!0,value:o})}):function(t,o){t.default=o}),__importStar=this&&this.__importStar||(function(){var t=function(o){return t=Object.getOwnPropertyNames||function(l){var n=[];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(n[n.length]=a);return n},t(o)};return function(o){if(o&&o.__esModule)return o;var l={};if(o!=null)for(var n=t(o),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(l,o,n[a]);return __setModuleDefault(l,o),l}})(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),i18n_1=require("../../i18n"),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),ConsoleLogCard_1=require("../ConsoleLogCard"),EmptyState_1=__importDefault(require("../EmptyState")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),types_1=require("../../types"),NetworkIcons_1=require("../NetworkIcons"),ConsoleTab=react_1.default.memo(()=>{const{t}=(0,i18n_1.useTranslation)(),{logSearch:o,setLogSearch:l,logSortOrder:n,setLogSortOrder:a,handleDelete:I,logFilters:c,setLogFilters:A,logCounts:_,filteredConsoleLogs:s,visibleConsoleLogs:m}=(0,InspectorContext_1.useInspector)(),v=(0,react_1.useRef)(null),[b,x]=react_1.default.useState(100),S=(0,react_1.useMemo)(()=>s.slice(0,b),[s,b]),L=(0,react_1.useCallback)(({item:e,index:r})=><AnimatedEntrance_1.default index={r}distance={8}>
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,o,l,n){n===void 0&&(n=l);var a=Object.getOwnPropertyDescriptor(o,l);(!a||("get"in a?!o.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(t,n,a)}):(function(t,o,l,n){n===void 0&&(n=l),t[n]=o[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,o){Object.defineProperty(t,"default",{enumerable:!0,value:o})}):function(t,o){t.default=o}),__importStar=this&&this.__importStar||(function(){var t=function(o){return t=Object.getOwnPropertyNames||function(l){var n=[];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(n[n.length]=a);return n},t(o)};return function(o){if(o&&o.__esModule)return o;var l={};if(o!=null)for(var n=t(o),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(l,o,n[a]);return __setModuleDefault(l,o),l}})(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),i18n_1=require("../../i18n"),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),ConsoleLogCard_1=require("../ConsoleLogCard"),EmptyState_1=__importDefault(require("../EmptyState")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),types_1=require("../../types"),NetworkIcons_1=require("../NetworkIcons"),LOAD_MORE_STEP=10,ConsoleTab=react_1.default.memo(()=>{const{t}=(0,i18n_1.useTranslation)(),{logSearch:o,setLogSearch:l,logSortOrder:n,setLogSortOrder:a,handleDelete:L,logFilters:s,setLogFilters:A,logCounts:_,filteredConsoleLogs:c,visibleConsoleLogs:b,maxConsoleLogs:S}=(0,InspectorContext_1.useInspector)(),V=S||100,T=(0,react_1.useRef)(null),[I,v]=react_1.default.useState(V);react_1.default.useEffect(()=>{v(S||100),T.current?.scrollToOffset({offset:0,animated:!1})},[o,s,S]);const w=(0,react_1.useMemo)(()=>c.slice(0,I),[c,I]),F=(0,react_1.useCallback)(({item:e,index:r})=><AnimatedEntrance_1.default index={r}distance={8}>
2
2
  <ConsoleLogCard_1.ConsoleLogCard item={e}searchStr={o}/>
3
- </AnimatedEntrance_1.default>,[o]),V=(0,react_1.useCallback)((e,r)=>({length:148,offset:148*r,index:r}),[]),F=(0,react_1.useCallback)((e,r)=>e?.id?.toString()??r.toString(),[]),z=(0,react_1.useMemo)(()=>{const e=m.length,r=s.length;if(c.has("all")||!Array.from(c).some(h=>h!=="all"))return<react_native_1.View style={{paddingHorizontal:12,paddingTop:8,paddingBottom:3}}>
3
+ </AnimatedEntrance_1.default>,[o]),z=(0,react_1.useCallback)((e,r)=>({length:148,offset:148*r,index:r}),[]),O=(0,react_1.useCallback)((e,r)=>e?.id?.toString()??r.toString(),[]),E=(0,react_1.useMemo)(()=>{const e=b.length,r=c.length;if(s.has("all")||!Array.from(s).some(h=>h!=="all"))return<react_native_1.View style={{paddingHorizontal:12,paddingTop:8,paddingBottom:3}}>
4
4
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:11,color:AppColors_1.AppColors.grayTextWeak,letterSpacing:.2}}>
5
5
  {r===e?`Showing ${e} logs`:`Showing ${r} of ${e} logs`}
6
6
  </react_native_1.Text>
7
- </react_native_1.View>;{const h=Array.from(c).filter(C=>C!=="all").map(C=>C==="user-log"?"Log":C==="analytics"?"Analytics":C.charAt(0).toUpperCase()+C.slice(1));return<react_native_1.View style={{paddingHorizontal:12,paddingTop:8,paddingBottom:3}}>
7
+ </react_native_1.View>;{const h=Array.from(s).filter(C=>C!=="all").map(C=>C==="user-log"?"Log":C==="analytics"?"Analytics":C.charAt(0).toUpperCase()+C.slice(1));return<react_native_1.View style={{paddingHorizontal:12,paddingTop:8,paddingBottom:3}}>
8
8
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:11,color:AppColors_1.AppColors.grayTextWeak,letterSpacing:.2}}>
9
9
  Filtered by {h.join(", ")} ({r} of {e} logs)
10
10
  </react_native_1.Text>
11
- </react_native_1.View>}},[m.length,s.length,c]),[w,T]=react_1.default.useState(!1),P=(0,react_1.useMemo)(()=>["[AXIOS]","[API]","[GRAPHQL]","[REDUX]","[ANALYTICS]","[AUTH]","[NAV]","[STORAGE]","[PERF]","[WS]","[PUSH]","[PAYMENT]","[SYNC]","[BLE]","[LOCATION]","[TEST]","[DEBUG]"],[]),B=(0,react_1.useMemo)(()=>[{id:types_1.LogFilter.All,label:t("common.all","All"),count:_.all?.split("/")?.[0]??"0",color:AppColors_1.AppColors.purple,Icon:NetworkIcons_1.LayersIcon},{id:types_1.LogFilter.UserLog,label:t("console.log","Log"),count:_["user-log"]?.split("/")?.[0]??"0",color:AppColors_1.AppColors.teal600,Icon:NetworkIcons_1.UserIcon},{id:types_1.LogFilter.Info,label:t("console.info","Info"),count:_.info?.split("/")?.[0]??"0",color:AppColors_1.AppColors.sky600,Icon:NetworkIcons_1.InfoCircleIcon},{id:types_1.LogFilter.Warn,label:t("console.warning","Warn"),count:_.warn?.split("/")?.[0]??"0",color:AppColors_1.AppColors.amber600,Icon:NetworkIcons_1.WarningTriangleIcon},{id:types_1.LogFilter.Error,label:t("console.error","Error"),count:_.error?.split("/")?.[0]??"0",color:AppColors_1.AppColors.errorColor,Icon:NetworkIcons_1.ErrorCircleIcon},{id:types_1.LogFilter.Analytics,label:t("console.analytics","Analytics"),count:_.analytics?.split("/")?.[0]??"0",color:AppColors_1.AppColors.violet600,Icon:NetworkIcons_1.AnalyticsIcon}],[_,t]);return<react_native_1.View style={{flex:1}}>
11
+ </react_native_1.View>}},[b.length,c.length,s]),[m,x]=react_1.default.useState(!1),P=(0,react_1.useMemo)(()=>["[AXIOS]","[API]","[GRAPHQL]","[REDUX]","[ANALYTICS]","[AUTH]","[NAV]","[STORAGE]","[PERF]","[WS]","[PUSH]","[PAYMENT]","[SYNC]","[BLE]","[LOCATION]","[TEST]","[DEBUG]"],[]),B=(0,react_1.useMemo)(()=>[{id:types_1.LogFilter.All,label:t("common.all","All"),count:_.all?.split("/")?.[0]??"0",color:AppColors_1.AppColors.purple,Icon:NetworkIcons_1.LayersIcon},{id:types_1.LogFilter.UserLog,label:t("console.log","Log"),count:_["user-log"]?.split("/")?.[0]??"0",color:AppColors_1.AppColors.teal600,Icon:NetworkIcons_1.UserIcon},{id:types_1.LogFilter.Info,label:t("console.info","Info"),count:_.info?.split("/")?.[0]??"0",color:AppColors_1.AppColors.sky600,Icon:NetworkIcons_1.InfoCircleIcon},{id:types_1.LogFilter.Warn,label:t("console.warning","Warn"),count:_.warn?.split("/")?.[0]??"0",color:AppColors_1.AppColors.amber600,Icon:NetworkIcons_1.WarningTriangleIcon},{id:types_1.LogFilter.Error,label:t("console.error","Error"),count:_.error?.split("/")?.[0]??"0",color:AppColors_1.AppColors.errorColor,Icon:NetworkIcons_1.ErrorCircleIcon},{id:types_1.LogFilter.Analytics,label:t("console.analytics","Analytics"),count:_.analytics?.split("/")?.[0]??"0",color:AppColors_1.AppColors.violet600,Icon:NetworkIcons_1.AnalyticsIcon}],[_,t]);return<react_native_1.View style={{flex:1}}>
12
12
  <react_native_1.View style={{backgroundColor:AppColors_1.AppColors.white,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor,paddingBottom:6}}>
13
13
  <react_native_1.View style={[styles_1.default.toolbarRow,{marginTop:12,marginBottom:8}]}>
14
- <react_native_1.View style={[styles_1.default.searchContainer,w&&{borderColor:AppColors_1.AppColors.purple,borderWidth:1.5}]}>
15
- <NetworkIcons_1.SearchIcon color={w?AppColors_1.AppColors.purple:AppColors_1.AppColors.grayTextWeak}size={16}/>
16
- <react_native_1.TextInput placeholder={t("console.searchPlaceholder")}placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={o}onChangeText={l}onFocus={()=>T(!0)}onBlur={()=>T(!1)}style={styles_1.default.searchInput}autoCorrect={!1}autoCapitalize="none"/>
14
+ <react_native_1.View style={[styles_1.default.searchContainer,m&&{borderColor:AppColors_1.AppColors.purple,borderWidth:1.5}]}>
15
+ <NetworkIcons_1.SearchIcon color={m?AppColors_1.AppColors.purple:AppColors_1.AppColors.grayTextWeak}size={16}/>
16
+ <react_native_1.TextInput placeholder={t("console.searchPlaceholder")}placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={o}onChangeText={l}onFocus={()=>x(!0)}onBlur={()=>x(!1)}style={styles_1.default.searchInput}autoCorrect={!1}autoCapitalize="none"/>
17
17
  {o.length>0&&<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:4}}>
18
18
  <react_native_1.View style={{backgroundColor:`${AppColors_1.AppColors.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:2}}>
19
19
  <react_native_1.Text style={{color:AppColors_1.AppColors.purple,fontSize:10,fontFamily:AppFonts_1.AppFonts.interBold}}>
20
- {s.length}
20
+ {c.length}
21
21
  </react_native_1.Text>
22
22
  </react_native_1.View>
23
23
  <react_native_1.Pressable onPress={()=>l("")}hitSlop={10}style={styles_1.default.clearBtn}>
@@ -30,14 +30,14 @@
30
30
  <TouchableScale_1.default style={styles_1.default.toolbarBtn}onPress={()=>a(e=>e==="newest"?"oldest":"newest")}hitSlop={10}>
31
31
  <NetworkIcons_1.SortArrowIcon color={AppColors_1.AppColors.grayTextStrong}size={18}direction={n==="newest"?"down":"up"}/>
32
32
  </TouchableScale_1.default>
33
- <TouchableScale_1.default style={[styles_1.default.toolbarBtn,{borderColor:`${AppColors_1.AppColors.errorColor}38`,backgroundColor:`${AppColors_1.AppColors.errorColor}0F`}]}onPress={I}hitSlop={6}>
33
+ <TouchableScale_1.default style={[styles_1.default.toolbarBtn,{borderColor:`${AppColors_1.AppColors.errorColor}38`,backgroundColor:`${AppColors_1.AppColors.errorColor}0F`}]}onPress={L}hitSlop={6}>
34
34
  <NetworkIcons_1.TrashIcon color={AppColors_1.AppColors.errorColor}size={15}/>
35
35
  </TouchableScale_1.default>
36
36
  </react_native_1.View>
37
37
  </react_native_1.View>
38
38
 
39
39
 
40
- {(w||o.length>0)&&<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}style={{marginBottom:6,maxHeight:30}}contentContainerStyle={{paddingHorizontal:16,flexDirection:"row",alignItems:"center",gap:6}}>
40
+ {(m||o.length>0)&&<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}style={{marginBottom:6,maxHeight:30}}contentContainerStyle={{paddingHorizontal:16,flexDirection:"row",alignItems:"center",gap:6}}>
41
41
  {P.map(e=>{const r=o.includes(e);return<TouchableScale_1.default key={e}onPress={()=>{l(r?i=>i.replace(e,"").trim():i=>i?`${i} ${e}`.trim():e)}}>
42
42
  <react_native_1.View style={{paddingHorizontal:8,paddingVertical:3,borderRadius:6,backgroundColor:r?AppColors_1.AppColors.purple:`${AppColors_1.AppColors.purple}14`,borderWidth:1,borderColor:r?AppColors_1.AppColors.purple:`${AppColors_1.AppColors.purple}30`}}>
43
43
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10,color:r?AppColors_1.AppColors.white:AppColors_1.AppColors.purple}}>
@@ -50,7 +50,7 @@
50
50
 
51
51
  <react_native_1.View style={{flexDirection:"row",alignItems:"center",marginBottom:8,paddingHorizontal:12,gap:6}}>
52
52
  <react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}style={{flex:1}}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:6,paddingRight:6}}>
53
- {B.map(e=>{const r=e.id==="all"?c.has("all"):c.has(e.id)&&!c.has("all"),i=e.color||AppColors_1.AppColors.purple,h=r?AppColors_1.AppColors.white:i,C=e.Icon;return<TouchableScale_1.default key={e.id}onPress={()=>{e.id==="all"?A(new Set(["all"])):A(O=>{const y=new Set(O);return y.delete("all"),y.has(e.id)?y.delete(e.id):y.add(e.id),y.size===0&&y.add("all"),y})}}>
53
+ {B.map(e=>{const r=e.id==="all"?s.has("all"):s.has(e.id)&&!s.has("all"),i=e.color||AppColors_1.AppColors.purple,h=r?AppColors_1.AppColors.white:i,C=e.Icon;return<TouchableScale_1.default key={e.id}onPress={()=>{e.id==="all"?A(new Set(["all"])):A(H=>{const y=new Set(H);return y.delete("all"),y.has(e.id)?y.delete(e.id):y.add(e.id),y.size===0&&y.add("all"),y})}}>
54
54
  <react_native_1.View style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:r?i:`${i}12`,borderWidth:1,borderColor:r?i:`${i}30`,gap:5}}>
55
55
  <C size={11}color={h}/>
56
56
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5,color:r?AppColors_1.AppColors.white:AppColors_1.AppColors.primaryBlack}}>
@@ -67,5 +67,5 @@
67
67
  </react_native_1.View>
68
68
  </react_native_1.View>
69
69
 
70
- <react_native_1.FlatList ref={v}data={S}keyExtractor={F}ListHeaderComponent={z}renderItem={L}getItemLayout={V}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<EmptyState_1.default isSearch={o.length>0||!c.has("all")}searchQuery={o}customTitle={o.length>0?"No matching console logs":"No console logs"}onClearSearch={()=>{l(""),A(new Set(["all"]))}}/>}ListFooterComponent={s.length>0?<EndOfListFooter_1.default count={S.length}totalCount={s.length}label="logs"hasMore={S.length<s.length}onLoadMore={()=>x(e=>e+10)}/>:null}contentContainerStyle={[styles_1.default.listContent,s.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
70
+ <react_native_1.FlatList ref={T}data={w}keyExtractor={O}ListHeaderComponent={E}renderItem={F}getItemLayout={z}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<EmptyState_1.default isSearch={o.length>0||!s.has("all")}searchQuery={o}customTitle={o.length>0?"No matching console logs":"No console logs"}onClearSearch={()=>{l(""),A(new Set(["all"]))}}/>}ListFooterComponent={c.length>0?<EndOfListFooter_1.default count={w.length}totalCount={c.length}label="logs"loadMoreStep={LOAD_MORE_STEP}hasMore={w.length<c.length}onLoadMore={()=>v(e=>e+LOAD_MORE_STEP)}/>:null}contentContainerStyle={[styles_1.default.listContent,c.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
71
71
  </react_native_1.View>});exports.default=ConsoleTab;
@@ -1,4 +1,4 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,o,s,i){i===void 0&&(i=s);var n=Object.getOwnPropertyDescriptor(o,s);(!n||("get"in n?!o.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(t,i,n)}):(function(t,o,s,i){i===void 0&&(i=s),t[i]=o[s]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,o){Object.defineProperty(t,"default",{enumerable:!0,value:o})}):function(t,o){t.default=o}),__importStar=this&&this.__importStar||(function(){var t=function(o){return t=Object.getOwnPropertyNames||function(s){var i=[];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(i[i.length]=n);return i},t(o)};return function(o){if(o&&o.__esModule)return o;var s={};if(o!=null)for(var i=t(o),n=0;n<i.length;n++)i[n]!=="default"&&__createBinding(s,o,i[n]);return __setModuleDefault(s,o),s}})(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),i18n_1=require("../../i18n"),InspectorContext_1=require("./InspectorContext"),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),FeatureUnderDevNotice_1=__importDefault(require("./FeatureUnderDevNotice")),HighlightText_1=__importDefault(require("../HighlightText")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),crashHandler_1=require("../../customHooks/crashHandler"),CrashFilterModal_1=__importStar(require("./CrashFilterModal")),NetworkIcons_1=require("../NetworkIcons"),getRelativeTime=t=>{const o=Date.now(),s=Math.max(0,o-t),i=Math.floor(s/1e3),n=Math.floor(i/60),T=Math.floor(n/60),g=Math.floor(T/24);return i<60?`${i}s ago`:n<60?`${n}m ago`:T<24?`${T}h ago`:`${g}d ago`},CrashTab=react_1.default.memo(()=>{const{t}=(0,i18n_1.useTranslation)(),{crashRecords:o,setSelectedCrash:s}=(0,InspectorContext_1.useInspector)(),i=(0,react_1.useRef)(null),[n,T]=(0,react_1.useState)(100),[g,x]=(0,react_1.useState)(""),[y,A]=(0,react_1.useState)("all"),[l,b]=(0,react_1.useState)(CrashFilterModal_1.DEFAULT_CRASH_FILTERS),[V,v]=(0,react_1.useState)(!1),f=(0,react_1.useMemo)(()=>{const e=o.length;let r=0,a=0,h=0,C=0,w=0;return o.forEach(m=>{m.isFatal&&r++,m.type==="js"?a++:m.type==="promise"?h++:m.type==="render"?C++:m.type==="native"&&w++}),{total:e,fatalCount:r,jsCount:a,promiseCount:h,renderCount:C,nativeCount:w}},[o]),_=(0,react_1.useMemo)(()=>{let e=o.filter(r=>{if(y==="fatal"&&!r.isFatal||y==="js"&&r.type!=="js"||y==="promise"&&r.type!=="promise"||y==="render"&&r.type!=="render"||y==="native"&&r.type!=="native"||l.types.size>0&&!l.types.has("all")&&!(l.types.has("fatal")&&r.isFatal||l.types.has("js")&&r.type==="js"||l.types.has("promise")&&r.type==="promise"||l.types.has("render")&&r.type==="render"||l.types.has("native")&&r.type==="native"))return!1;if(l.timeWindow!=="all"){const a=Date.now(),h=l.timeWindow==="15m"?a-900*1e3:l.timeWindow==="1h"?a-3600*1e3:l.timeWindow==="24h"?a-1440*60*1e3:a-10080*60*1e3;if(r.timestamp<h)return!1}if(l.platform!=="all"&&(r.deviceInfo?.platform||"").toLowerCase()!==l.platform)return!1;if(l.engine!=="all"){const a=r.deviceInfo?.isHermes;if(l.engine==="hermes"&&a!==!0||l.engine==="jsc"&&a===!0)return!1}if(g.trim().length>0){const a=g.trim().toLowerCase().split(/\s+/).filter(Boolean),h=[r.message||"",r.name||"",r.stack||"",r.type||"",r.deviceInfo?.platform||"",...(r.breadcrumbs||[]).map(C=>`${C.type||""} ${C.message||""}`)].join(" ").toLowerCase();return a.every(C=>h.includes(C))}return!0});return l.sortBy==="time_asc"&&(e=[...e].sort((r,a)=>r.timestamp-a.timestamp)),e},[o,y,g,l]),S=()=>{react_native_1.Alert.alert(t("crash.clearTitle"),t("crash.clearMessage"),[{text:t("crash.clearCancel"),style:"cancel"},{text:t("crash.clearConfirm"),style:"destructive",onPress:()=>(0,crashHandler_1.clearCrashRecords)()}])},F=(0,react_1.useCallback)(({item:e,index:r})=>{const a=e.isFatal,h=e.type.toUpperCase(),C=e.parsedStack&&e.parsedStack.length>0?e.parsedStack.find(I=>I.isAppCode)||e.parsedStack[0]:null,w=e.type==="native"?`${AppColors_1.AppColors.errorColor}22`:e.type==="render"?`${AppColors_1.AppColors.purple}22`:e.type==="promise"?`${AppColors_1.AppColors.darkOrange}22`:`${AppColors_1.AppColors.offerPurple}22`,m=e.type==="native"?AppColors_1.AppColors.errorColor:e.type==="render"?AppColors_1.AppColors.purple:e.type==="promise"?AppColors_1.AppColors.darkOrange:AppColors_1.AppColors.offerPurple;return<AnimatedEntrance_1.default index={r}distance={8}>
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,o,s,n){n===void 0&&(n=s);var i=Object.getOwnPropertyDescriptor(o,s);(!i||("get"in i?!o.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(t,n,i)}):(function(t,o,s,n){n===void 0&&(n=s),t[n]=o[s]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,o){Object.defineProperty(t,"default",{enumerable:!0,value:o})}):function(t,o){t.default=o}),__importStar=this&&this.__importStar||(function(){var t=function(o){return t=Object.getOwnPropertyNames||function(s){var n=[];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[n.length]=i);return n},t(o)};return function(o){if(o&&o.__esModule)return o;var s={};if(o!=null)for(var n=t(o),i=0;i<n.length;i++)n[i]!=="default"&&__createBinding(s,o,n[i]);return __setModuleDefault(s,o),s}})(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),i18n_1=require("../../i18n"),InspectorContext_1=require("./InspectorContext"),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),FeatureUnderDevNotice_1=__importDefault(require("./FeatureUnderDevNotice")),HighlightText_1=__importDefault(require("../HighlightText")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),crashHandler_1=require("../../customHooks/crashHandler"),CrashFilterModal_1=__importStar(require("./CrashFilterModal")),NetworkIcons_1=require("../NetworkIcons"),getRelativeTime=t=>{const o=Date.now(),s=Math.max(0,o-t),n=Math.floor(s/1e3),i=Math.floor(n/60),T=Math.floor(i/60),x=Math.floor(T/24);return n<60?`${n}s ago`:i<60?`${i}m ago`:T<24?`${T}h ago`:`${x}d ago`},LOAD_MORE_STEP=10,CrashTab=react_1.default.memo(()=>{const{t}=(0,i18n_1.useTranslation)(),{crashRecords:o,setSelectedCrash:s,maxCrashLogs:n}=(0,InspectorContext_1.useInspector)(),i=n||50,T=(0,react_1.useRef)(null),[x,b]=(0,react_1.useState)(i),[f,A]=(0,react_1.useState)(""),[y,v]=(0,react_1.useState)("all"),[l,S]=(0,react_1.useState)(CrashFilterModal_1.DEFAULT_CRASH_FILTERS),[F,V]=(0,react_1.useState)(!1);(0,react_1.useEffect)(()=>{b(n||50),T.current?.scrollToOffset({offset:0,animated:!1})},[f,y,l,n]);const g=(0,react_1.useMemo)(()=>{const e=o.length;let r=0,a=0,h=0,C=0,w=0;return o.forEach(m=>{m.isFatal&&r++,m.type==="js"?a++:m.type==="promise"?h++:m.type==="render"?C++:m.type==="native"&&w++}),{total:e,fatalCount:r,jsCount:a,promiseCount:h,renderCount:C,nativeCount:w}},[o]),_=(0,react_1.useMemo)(()=>{let e=o.filter(r=>{if(y==="fatal"&&!r.isFatal||y==="js"&&r.type!=="js"||y==="promise"&&r.type!=="promise"||y==="render"&&r.type!=="render"||y==="native"&&r.type!=="native"||l.types.size>0&&!l.types.has("all")&&!(l.types.has("fatal")&&r.isFatal||l.types.has("js")&&r.type==="js"||l.types.has("promise")&&r.type==="promise"||l.types.has("render")&&r.type==="render"||l.types.has("native")&&r.type==="native"))return!1;if(l.timeWindow!=="all"){const a=Date.now(),h=l.timeWindow==="15m"?a-900*1e3:l.timeWindow==="1h"?a-3600*1e3:l.timeWindow==="24h"?a-1440*60*1e3:a-10080*60*1e3;if(r.timestamp<h)return!1}if(l.platform!=="all"&&(r.deviceInfo?.platform||"").toLowerCase()!==l.platform)return!1;if(l.engine!=="all"){const a=r.deviceInfo?.isHermes;if(l.engine==="hermes"&&a!==!0||l.engine==="jsc"&&a===!0)return!1}if(f.trim().length>0){const a=f.trim().toLowerCase().split(/\s+/).filter(Boolean),h=[r.message||"",r.name||"",r.stack||"",r.type||"",r.deviceInfo?.platform||"",...(r.breadcrumbs||[]).map(C=>`${C.type||""} ${C.message||""}`)].join(" ").toLowerCase();return a.every(C=>h.includes(C))}return!0});return l.sortBy==="time_asc"&&(e=[...e].sort((r,a)=>r.timestamp-a.timestamp)),e},[o,y,f,l]),I=()=>{react_native_1.Alert.alert(t("crash.clearTitle"),t("crash.clearMessage"),[{text:t("crash.clearCancel"),style:"cancel"},{text:t("crash.clearConfirm"),style:"destructive",onPress:()=>(0,crashHandler_1.clearCrashRecords)()}])},B=(0,react_1.useCallback)(({item:e,index:r})=>{const a=e.isFatal,h=e.type.toUpperCase(),C=e.parsedStack&&e.parsedStack.length>0?e.parsedStack.find(k=>k.isAppCode)||e.parsedStack[0]:null,w=e.type==="native"?`${AppColors_1.AppColors.errorColor}22`:e.type==="render"?`${AppColors_1.AppColors.purple}22`:e.type==="promise"?`${AppColors_1.AppColors.darkOrange}22`:`${AppColors_1.AppColors.offerPurple}22`,m=e.type==="native"?AppColors_1.AppColors.errorColor:e.type==="render"?AppColors_1.AppColors.purple:e.type==="promise"?AppColors_1.AppColors.darkOrange:AppColors_1.AppColors.offerPurple;return<AnimatedEntrance_1.default index={r}distance={8}>
2
2
  <TouchableScale_1.default onPress={()=>{s(e)}}style={[localStyles.cardContainer,a&&localStyles.fatalCardBorder]}>
3
3
 
4
4
  <react_native_1.View style={localStyles.cardHeader}>
@@ -35,7 +35,7 @@
35
35
 
36
36
 
37
37
  <react_native_1.View style={{marginVertical:6}}>
38
- <HighlightText_1.default text={e.message||t("crash.unknownException")}highlight={g}numberOfLines={3}style={localStyles.errorMessageText}/>
38
+ <HighlightText_1.default text={e.message||t("crash.unknownException")}highlight={f}numberOfLines={3}style={localStyles.errorMessageText}/>
39
39
  </react_native_1.View>
40
40
 
41
41
 
@@ -84,47 +84,47 @@
84
84
  </react_native_1.View>
85
85
  </react_native_1.View>
86
86
  </TouchableScale_1.default>
87
- </AnimatedEntrance_1.default>},[g,s]);return<react_native_1.View style={localStyles.container}>
87
+ </AnimatedEntrance_1.default>},[f,s]);return<react_native_1.View style={localStyles.container}>
88
88
  {o.length>0&&<>
89
89
 
90
90
  <react_native_1.View style={localStyles.statsBar}>
91
91
  <react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={localStyles.statsScrollContent}>
92
92
  <react_native_1.View style={[localStyles.statChip,localStyles.statChipActive]}>
93
- <react_native_1.Text style={localStyles.statChipValue}>{f.total}</react_native_1.Text>
93
+ <react_native_1.Text style={localStyles.statChipValue}>{g.total}</react_native_1.Text>
94
94
  <react_native_1.Text style={localStyles.statChipLabel}>{t("crash.statCrashes")}</react_native_1.Text>
95
95
  </react_native_1.View>
96
96
 
97
97
  <react_native_1.View style={localStyles.statChip}>
98
98
  <react_native_1.Text style={[localStyles.statChipValue,{color:AppColors_1.AppColors.errorColor}]}>
99
- {f.fatalCount}
99
+ {g.fatalCount}
100
100
  </react_native_1.Text>
101
101
  <react_native_1.Text style={localStyles.statChipLabel}>{t("crash.statFatal")}</react_native_1.Text>
102
102
  </react_native_1.View>
103
103
 
104
104
  <react_native_1.View style={localStyles.statChip}>
105
105
  <react_native_1.Text style={[localStyles.statChipValue,{color:AppColors_1.AppColors.offerPurple}]}>
106
- {f.jsCount}
106
+ {g.jsCount}
107
107
  </react_native_1.Text>
108
108
  <react_native_1.Text style={localStyles.statChipLabel}>{t("crash.statJsErrors")}</react_native_1.Text>
109
109
  </react_native_1.View>
110
110
 
111
111
  <react_native_1.View style={localStyles.statChip}>
112
112
  <react_native_1.Text style={[localStyles.statChipValue,{color:AppColors_1.AppColors.darkOrange}]}>
113
- {f.promiseCount}
113
+ {g.promiseCount}
114
114
  </react_native_1.Text>
115
115
  <react_native_1.Text style={localStyles.statChipLabel}>{t("crash.statPromises")}</react_native_1.Text>
116
116
  </react_native_1.View>
117
117
 
118
118
  <react_native_1.View style={localStyles.statChip}>
119
119
  <react_native_1.Text style={[localStyles.statChipValue,{color:AppColors_1.AppColors.purple}]}>
120
- {f.renderCount}
120
+ {g.renderCount}
121
121
  </react_native_1.Text>
122
122
  <react_native_1.Text style={localStyles.statChipLabel}>{t("crash.statRender")}</react_native_1.Text>
123
123
  </react_native_1.View>
124
124
 
125
125
  <react_native_1.View style={localStyles.statChip}>
126
126
  <react_native_1.Text style={[localStyles.statChipValue,{color:AppColors_1.AppColors.skyBlue}]}>
127
- {f.nativeCount}
127
+ {g.nativeCount}
128
128
  </react_native_1.Text>
129
129
  <react_native_1.Text style={localStyles.statChipLabel}>{t("crash.statNative")}</react_native_1.Text>
130
130
  </react_native_1.View>
@@ -136,27 +136,27 @@
136
136
  <react_native_1.View style={localStyles.searchRow}>
137
137
  <react_native_1.View style={localStyles.searchInputWrapper}>
138
138
  <NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak}size={14}/>
139
- <react_native_1.TextInput value={g}onChangeText={x}placeholder={t("crash.searchPlaceholder")}placeholderTextColor={AppColors_1.AppColors.grayTextWeak}style={localStyles.searchInput}autoCapitalize="none"autoCorrect={!1}/>
140
- {g.length>0&&<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:4}}>
139
+ <react_native_1.TextInput value={f}onChangeText={A}placeholder={t("crash.searchPlaceholder")}placeholderTextColor={AppColors_1.AppColors.grayTextWeak}style={localStyles.searchInput}autoCapitalize="none"autoCorrect={!1}/>
140
+ {f.length>0&&<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:4}}>
141
141
  <react_native_1.View style={{backgroundColor:`${AppColors_1.AppColors.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
142
142
  <react_native_1.Text style={{color:AppColors_1.AppColors.purple,fontSize:9.5,fontFamily:AppFonts_1.AppFonts.interBold}}>
143
143
  {_.length}
144
144
  </react_native_1.Text>
145
145
  </react_native_1.View>
146
- <react_native_1.TouchableOpacity onPress={()=>x("")}hitSlop={8}>
146
+ <react_native_1.TouchableOpacity onPress={()=>A("")}hitSlop={8}>
147
147
  <NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak}size={14}/>
148
148
  </react_native_1.TouchableOpacity>
149
149
  </react_native_1.View>}
150
150
  </react_native_1.View>
151
151
 
152
152
 
153
- <TouchableScale_1.default onPress={()=>v(!0)}style={[localStyles.filterButton,!(0,CrashFilterModal_1.isCrashFiltersDefault)(l)&&{borderColor:`${AppColors_1.AppColors.brandPurple}60`,backgroundColor:`${AppColors_1.AppColors.brandPurple}15`}]}>
153
+ <TouchableScale_1.default onPress={()=>V(!0)}style={[localStyles.filterButton,!(0,CrashFilterModal_1.isCrashFiltersDefault)(l)&&{borderColor:`${AppColors_1.AppColors.brandPurple}60`,backgroundColor:`${AppColors_1.AppColors.brandPurple}15`}]}>
154
154
  <NetworkIcons_1.FilterIcon size={14}color={(0,CrashFilterModal_1.isCrashFiltersDefault)(l)?AppColors_1.AppColors.grayTextStrong:AppColors_1.AppColors.brandPurple}/>
155
155
  {!(0,CrashFilterModal_1.isCrashFiltersDefault)(l)&&<react_native_1.View style={{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:3.5,backgroundColor:AppColors_1.AppColors.darkOrange,borderWidth:1,borderColor:AppColors_1.AppColors.white}}/>}
156
156
  </TouchableScale_1.default>
157
157
 
158
158
 
159
- <TouchableScale_1.default onPress={S}style={localStyles.clearButton}>
159
+ <TouchableScale_1.default onPress={I}style={localStyles.clearButton}>
160
160
  <NetworkIcons_1.TrashIcon size={14}color={AppColors_1.AppColors.errorColor}/>
161
161
  </TouchableScale_1.default>
162
162
  </react_native_1.View>
@@ -166,7 +166,7 @@
166
166
 
167
167
  <react_native_1.View style={{flexDirection:"row",alignItems:"center",marginBottom:8,paddingHorizontal:12,gap:6}}>
168
168
  <react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}style={{flex:1}}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:6,paddingRight:6}}>
169
- {[{key:"all",label:t("crash.filterAll"),Icon:NetworkIcons_1.LayersIcon,count:f.total,themeColor:AppColors_1.AppColors.purple},{key:"fatal",label:t("crash.filterFatal"),Icon:NetworkIcons_1.SkullIcon,count:f.fatalCount,themeColor:AppColors_1.AppColors.errorColor},{key:"js",label:t("crash.filterJsError"),Icon:NetworkIcons_1.JsIcon,count:f.jsCount,themeColor:AppColors_1.AppColors.amber600},{key:"promise",label:t("crash.filterPromise"),Icon:NetworkIcons_1.HourglassIcon,count:f.promiseCount,themeColor:AppColors_1.AppColors.orange600},{key:"render",label:t("crash.filterRender"),Icon:NetworkIcons_1.LayoutIcon,count:f.renderCount,themeColor:AppColors_1.AppColors.violet600},{key:"native",label:t("crash.filterNative"),Icon:NetworkIcons_1.ChipIcon,count:f.nativeCount,themeColor:AppColors_1.AppColors.cyan600}].map(e=>{const r=y===e.key,a=e.themeColor||AppColors_1.AppColors.purple,h=r?AppColors_1.AppColors.white:a,C=e.Icon;return<TouchableScale_1.default key={e.key}onPress={()=>A(e.key)}>
169
+ {[{key:"all",label:t("crash.filterAll"),Icon:NetworkIcons_1.LayersIcon,count:g.total,themeColor:AppColors_1.AppColors.purple},{key:"fatal",label:t("crash.filterFatal"),Icon:NetworkIcons_1.SkullIcon,count:g.fatalCount,themeColor:AppColors_1.AppColors.errorColor},{key:"js",label:t("crash.filterJsError"),Icon:NetworkIcons_1.JsIcon,count:g.jsCount,themeColor:AppColors_1.AppColors.amber600},{key:"promise",label:t("crash.filterPromise"),Icon:NetworkIcons_1.HourglassIcon,count:g.promiseCount,themeColor:AppColors_1.AppColors.orange600},{key:"render",label:t("crash.filterRender"),Icon:NetworkIcons_1.LayoutIcon,count:g.renderCount,themeColor:AppColors_1.AppColors.violet600},{key:"native",label:t("crash.filterNative"),Icon:NetworkIcons_1.ChipIcon,count:g.nativeCount,themeColor:AppColors_1.AppColors.cyan600}].map(e=>{const r=y===e.key,a=e.themeColor||AppColors_1.AppColors.purple,h=r?AppColors_1.AppColors.white:a,C=e.Icon;return<TouchableScale_1.default key={e.key}onPress={()=>v(e.key)}>
170
170
  <react_native_1.View style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:r?a:`${a}12`,borderWidth:1,borderColor:r?a:`${a}30`,gap:5}}>
171
171
  <C size={11}color={h}/>
172
172
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5,color:r?AppColors_1.AppColors.white:AppColors_1.AppColors.primaryBlack}}>
@@ -190,20 +190,20 @@
190
190
  <NetworkIcons_1.ShieldAlertIcon size={38}color={AppColors_1.AppColors.greenColor}/>
191
191
  </react_native_1.View>
192
192
  <react_native_1.Text style={localStyles.emptyTitle}>
193
- {g.length>0?"No matching crash entries":y!=="all"||!(0,CrashFilterModal_1.isCrashFiltersDefault)(l)?"No crashes match filters":t("crash.emptyTitle")}
193
+ {f.length>0?"No matching crash entries":y!=="all"||!(0,CrashFilterModal_1.isCrashFiltersDefault)(l)?"No crashes match filters":t("crash.emptyTitle")}
194
194
  </react_native_1.Text>
195
195
  <react_native_1.Text style={localStyles.emptySub}>
196
- {g?`No crash entries matched "${g}"`:y!=="all"||!(0,CrashFilterModal_1.isCrashFiltersDefault)(l)?"Try adjusting your filters or search keywords.":t("crash.emptySubtitle")}
196
+ {f?`No crash entries matched "${f}"`:y!=="all"||!(0,CrashFilterModal_1.isCrashFiltersDefault)(l)?"Try adjusting your filters or search keywords.":t("crash.emptySubtitle")}
197
197
  </react_native_1.Text>
198
- {(g.length>0||y!=="all"||!(0,CrashFilterModal_1.isCrashFiltersDefault)(l))&&<TouchableScale_1.default onPress={()=>{x(""),A("all"),b(CrashFilterModal_1.DEFAULT_CRASH_FILTERS)}}style={{marginTop:10,paddingHorizontal:14,paddingVertical:7,borderRadius:8,backgroundColor:AppColors_1.AppColors.purple}}>
198
+ {(f.length>0||y!=="all"||!(0,CrashFilterModal_1.isCrashFiltersDefault)(l))&&<TouchableScale_1.default onPress={()=>{A(""),v("all"),S(CrashFilterModal_1.DEFAULT_CRASH_FILTERS)}}style={{marginTop:10,paddingHorizontal:14,paddingVertical:7,borderRadius:8,backgroundColor:AppColors_1.AppColors.purple}}>
199
199
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:11.5,color:AppColors_1.AppColors.white}}>
200
200
  Clear Search & Filters
201
201
  </react_native_1.Text>
202
202
  </TouchableScale_1.default>}
203
203
  </react_native_1.ScrollView>:<>
204
- <react_native_1.FlatList ref={i}data={_.slice(0,n)}keyExtractor={e=>e.id}renderItem={F}initialNumToRender={12}maxToRenderPerBatch={8}windowSize={5}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}contentContainerStyle={localStyles.listContent}showsVerticalScrollIndicator={!1}ListFooterComponent={_.length>0?<EndOfListFooter_1.default count={Math.min(n,_.length)}totalCount={_.length}label="crashes"hasMore={_.length>n}onLoadMore={()=>T(e=>e+10)}/>:null}/>
204
+ <react_native_1.FlatList ref={T}data={_.slice(0,x)}keyExtractor={e=>e.id}renderItem={B}initialNumToRender={12}maxToRenderPerBatch={8}windowSize={5}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}contentContainerStyle={localStyles.listContent}showsVerticalScrollIndicator={!1}ListFooterComponent={_.length>0?<EndOfListFooter_1.default count={Math.min(x,_.length)}totalCount={_.length}label="crashes"loadMoreStep={LOAD_MORE_STEP}hasMore={_.length>x}onLoadMore={()=>b(e=>e+LOAD_MORE_STEP)}/>:null}/>
205
205
  </>}
206
206
 
207
207
 
208
- <CrashFilterModal_1.default visible={V}onClose={()=>v(!1)}filters={l}onApply={b}searchQuery={g}/>
208
+ <CrashFilterModal_1.default visible={F}onClose={()=>V(!1)}filters={l}onApply={S}searchQuery={f}/>
209
209
  </react_native_1.View>});exports.default=CrashTab;const localStyles=react_native_1.StyleSheet.create({container:{flex:1,backgroundColor:AppColors_1.AppColors.grayBackground},statsBar:{backgroundColor:AppColors_1.AppColors.primaryLight,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.grayBorderSecondary,paddingVertical:10},statsScrollContent:{paddingHorizontal:16,gap:8},statChip:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:8,backgroundColor:AppColors_1.AppColors.purpleShade50,borderWidth:1,borderColor:`${AppColors_1.AppColors.purple}14`},statChipActive:{backgroundColor:`${AppColors_1.AppColors.purple}14`,borderColor:`${AppColors_1.AppColors.purple}33`},statChipValue:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:13,color:AppColors_1.AppColors.primaryBlack},statChipLabel:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:11,color:AppColors_1.AppColors.grayText},controlsContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:6,backgroundColor:AppColors_1.AppColors.grayBackground},searchRow:{flexDirection:"row",alignItems:"center",gap:8},searchInputWrapper:{flex:1,flexDirection:"row",alignItems:"center",backgroundColor:AppColors_1.AppColors.primaryLight,borderWidth:1,borderColor:AppColors_1.AppColors.grayBorderSecondary,borderRadius:10,paddingHorizontal:10,height:38,gap:8},searchInput:{flex:1,fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:13,color:AppColors_1.AppColors.primaryBlack,paddingVertical:0},clearButton:{width:38,height:38,borderRadius:10,backgroundColor:`${AppColors_1.AppColors.errorColor}14`,borderWidth:1,borderColor:`${AppColors_1.AppColors.errorColor}22`,alignItems:"center",justifyContent:"center"},filterButton:{width:38,height:38,borderRadius:10,backgroundColor:`${AppColors_1.AppColors.brandPurple}0F`,borderWidth:1,borderColor:`${AppColors_1.AppColors.brandPurple}30`,alignItems:"center",justifyContent:"center"},filterScrollContent:{paddingVertical:10,gap:6},filterChip:{flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:AppColors_1.AppColors.primaryLight,borderWidth:1,borderColor:AppColors_1.AppColors.grayBorderSecondary},filterChipActive:{backgroundColor:AppColors_1.AppColors.purple,borderColor:AppColors_1.AppColors.purple},filterChipText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:12,color:AppColors_1.AppColors.grayText},filterChipTextActive:{fontFamily:AppFonts_1.AppFonts.interBold,color:AppColors_1.AppColors.white},listContent:{paddingHorizontal:16,paddingTop:4,paddingBottom:24,gap:10},cardContainer:{backgroundColor:AppColors_1.AppColors.primaryLight,borderRadius:12,borderWidth:1,borderColor:AppColors_1.AppColors.grayBorderSecondary,padding:14,shadowColor:AppColors_1.AppColors.shadowColorString,shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:3,elevation:2},fatalCardBorder:{borderColor:`${AppColors_1.AppColors.errorColor}44`},cardHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},badgeRow:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:1},sNoBadge:{backgroundColor:AppColors_1.AppColors.grayBackground,borderWidth:1,borderColor:AppColors_1.AppColors.grayBorderSecondary,paddingHorizontal:6,paddingVertical:3,borderRadius:5},sNoBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,color:AppColors_1.AppColors.grayText,letterSpacing:.3},fatalBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:AppColors_1.AppColors.errorColor,paddingHorizontal:6,paddingVertical:3,borderRadius:5},fatalBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,color:AppColors_1.AppColors.white,letterSpacing:.5},caughtBadge:{backgroundColor:`${AppColors_1.AppColors.greenColor}1F`,paddingHorizontal:6,paddingVertical:3,borderRadius:5},caughtBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,color:AppColors_1.AppColors.greenColor,letterSpacing:.5},typeBadge:{paddingHorizontal:6,paddingVertical:3,borderRadius:5},typeBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,letterSpacing:.5},timeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:1},timestampText:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:11,color:AppColors_1.AppColors.grayTextWeak},relativeTimeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10,color:AppColors_1.AppColors.grayTextWeak,backgroundColor:AppColors_1.AppColors.grayBackground,paddingHorizontal:5,paddingVertical:1,borderRadius:4,overflow:"hidden"},errorMessageText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:13.5,color:AppColors_1.AppColors.primaryBlack,lineHeight:18},locationRow:{flexDirection:"row",alignItems:"center",gap:6,marginTop:2,marginBottom:6,backgroundColor:AppColors_1.AppColors.purpleShade50,paddingHorizontal:8,paddingVertical:4,borderRadius:6},locationText:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:11,color:AppColors_1.AppColors.grayText,flex:1},cardFooter:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:6,paddingTop:8,borderTopWidth:1,borderTopColor:AppColors_1.AppColors.dividerColor},metaPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:AppColors_1.AppColors.purpleShade50,paddingHorizontal:6,paddingVertical:2,borderRadius:4},metaPillText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:10,color:AppColors_1.AppColors.grayTextWeak},emptyContainer:{flexGrow:1,alignItems:"center",justifyContent:"center",padding:32,paddingBottom:80},emptyIconCircle:{width:72,height:72,borderRadius:36,backgroundColor:`${AppColors_1.AppColors.greenColor}1F`,alignItems:"center",justifyContent:"center",marginBottom:16},emptyTitle:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:17,color:AppColors_1.AppColors.primaryBlack,marginBottom:6},emptySub:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:13,color:AppColors_1.AppColors.grayText,textAlign:"center",lineHeight:18,maxWidth:280}});
@@ -1,18 +1,18 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(a,r,o,l){l===void 0&&(l=o);var i=Object.getOwnPropertyDescriptor(r,o);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(a,l,i)}):(function(a,r,o,l){l===void 0&&(l=o),a[l]=r[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(a,r){Object.defineProperty(a,"default",{enumerable:!0,value:r})}):function(a,r){a.default=r}),__importStar=this&&this.__importStar||(function(){var a=function(r){return a=Object.getOwnPropertyNames||function(o){var l=[];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(l[l.length]=i);return l},a(r)};return function(r){if(r&&r.__esModule)return r;var o={};if(r!=null)for(var l=a(r),i=0;i<l.length;i++)l[i]!=="default"&&__createBinding(o,r,l[i]);return __setModuleDefault(o,r),o}})(),__importDefault=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),DomainHeader_1=__importDefault(require("../DomainHeader")),LogCard_1=__importDefault(require("../LogCard")),EmptyState_1=__importDefault(require("../EmptyState")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),NetworkFilterModal_1=__importDefault(require("./NetworkFilterModal")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),constants_1=require("../../constants"),i18n_1=require("../../i18n"),NetworkIcons_1=require("../NetworkIcons"),NetworkTab=react_1.default.memo(()=>{const{groupedData:a,loadMoreSection:r,search:o,setSearch:l,setSearchScope:i,quickFilter:A,setQuickFilter:V,handleDelete:D,selectedLogs:b,sortOrder:z,setSortOrder:m,statusFilters:c,setStatusFilters:C,methodFilters:d,setMethodFilters:_,filteredLogs:w,logs:h,toggleSectionFilter:I,toggleSectionCollapse:R,minStart:O,totalRange:q,newLogIds:k,toggleSelect:L,setSelected:B}=(0,InspectorContext_1.useInspector)(),{t:v}=(0,i18n_1.useTranslation)(),N=(0,react_1.useRef)(null),[$,x]=react_1.default.useState(!1),[P,M]=react_1.default.useState(!1),E=(0,react_1.useMemo)(()=>({statusCodes:c.size>0?new Set(c):new Set(["all"]),methods:d.size>0?new Set(d):new Set(["all"]),latency:"all",protocol:"all",sortBy:z==="newest"?"time_desc":"time_asc"}),[c,d,z]),H=(0,react_1.useCallback)(e=>{e.statusCodes.has("all")||e.statusCodes.size===0?C(new Set):C(new Set(e.statusCodes)),e.methods.has("all")||e.methods.size===0?_(new Set):_(new Set([...e.methods].map(n=>n))),e.sortBy==="time_asc"?m("oldest"):m("newest")},[C,_,m]),p=(0,react_1.useMemo)(()=>{let e=0,n=0,s=0,u=0,y=0,T=0;return h.forEach(t=>{const g=typeof t.status=="number"?t.status:parseInt(String(t.status),10);t.status===0||t.status==null||!isNaN(g)&&g>=400?e++:!isNaN(g)&&g>=200&&g<400&&n++,(t.duration||0)>=500&&s++;const f=(t.method||"").toUpperCase();f==="POST"&&u++,f==="GET"&&y++;const F=(t.url||"").toLowerCase(),S=(t.client||"").toLowerCase();(F.includes("graphql")||S.includes("graphql")||S.includes("apollo"))&&T++}),{all:h.length,errors:e,success:n,slow:s,post:u,get:y,graphql:T}},[h]),j=(0,react_1.useMemo)(()=>[{id:"all",label:"All",count:p.all,color:AppColors_1.AppColors.purple},{id:"errors",label:"Errors",count:p.errors,color:AppColors_1.AppColors.errorColor},{id:"success",label:"2xx OK",count:p.success,color:AppColors_1.AppColors.greenColor},{id:"slow",label:"Slow >500ms",count:p.slow,color:AppColors_1.AppColors.warningIconGold},{id:"POST",label:"POST",count:p.post,color:constants_1.METHOD_COLORS.POST||"#3B82F6"},{id:"GET",label:"GET",count:p.get,color:constants_1.METHOD_COLORS.GET||"#10B981"},{id:"graphql",label:"GraphQL",count:p.graphql,color:AppColors_1.AppColors.graphqlPink}],[p]),W=(0,react_1.useCallback)(({item:e,index:n})=>{if(e.type==="header")return<AnimatedEntrance_1.default index={n}distance={8}>
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(a,r,o,l){l===void 0&&(l=o);var i=Object.getOwnPropertyDescriptor(r,o);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(a,l,i)}):(function(a,r,o,l){l===void 0&&(l=o),a[l]=r[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(a,r){Object.defineProperty(a,"default",{enumerable:!0,value:r})}):function(a,r){a.default=r}),__importStar=this&&this.__importStar||(function(){var a=function(r){return a=Object.getOwnPropertyNames||function(o){var l=[];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(l[l.length]=i);return l},a(r)};return function(r){if(r&&r.__esModule)return r;var o={};if(r!=null)for(var l=a(r),i=0;i<l.length;i++)l[i]!=="default"&&__createBinding(o,r,l[i]);return __setModuleDefault(o,r),o}})(),__importDefault=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),DomainHeader_1=__importDefault(require("../DomainHeader")),LogCard_1=__importDefault(require("../LogCard")),EmptyState_1=__importDefault(require("../EmptyState")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),NetworkFilterModal_1=__importDefault(require("./NetworkFilterModal")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),constants_1=require("../../constants"),i18n_1=require("../../i18n"),NetworkIcons_1=require("../NetworkIcons"),NetworkTab=react_1.default.memo(()=>{const{groupedData:a,loadMoreSection:r,search:o,setSearch:l,setSearchScope:i,quickFilter:A,setQuickFilter:V,handleDelete:D,selectedLogs:b,sortOrder:z,setSortOrder:m,statusFilters:c,setStatusFilters:_,methodFilters:d,setMethodFilters:h,filteredLogs:w,logs:y,toggleSectionFilter:I,toggleSectionCollapse:R,minStart:O,totalRange:q,newLogIds:k,toggleSelect:L,setSelected:B}=(0,InspectorContext_1.useInspector)(),{t:v}=(0,i18n_1.useTranslation)(),N=(0,react_1.useRef)(null),[$,x]=react_1.default.useState(!1),[P,M]=react_1.default.useState(!1),E=(0,react_1.useMemo)(()=>({statusCodes:c.size>0?new Set(c):new Set(["all"]),methods:d.size>0?new Set(d):new Set(["all"]),latency:"all",protocol:"all",sortBy:z==="newest"?"time_desc":"time_asc"}),[c,d,z]),H=(0,react_1.useCallback)(e=>{e.statusCodes.has("all")||e.statusCodes.size===0?_(new Set):_(new Set(e.statusCodes)),e.methods.has("all")||e.methods.size===0?h(new Set):h(new Set([...e.methods].map(n=>n))),e.sortBy==="time_asc"?m("oldest"):m("newest")},[_,h,m]),p=(0,react_1.useMemo)(()=>{let e=0,n=0,s=0,u=0,S=0,T=0;return y.forEach(t=>{const g=typeof t.status=="number"?t.status:parseInt(String(t.status),10);t.status===0||t.status==null||!isNaN(g)&&g>=400?e++:!isNaN(g)&&g>=200&&g<400&&n++,(t.duration||0)>=500&&s++;const f=(t.method||"").toUpperCase();f==="POST"&&u++,f==="GET"&&S++;const F=(t.url||"").toLowerCase(),C=(t.client||"").toLowerCase();(F.includes("graphql")||C.includes("graphql")||C.includes("apollo"))&&T++}),{all:y.length,errors:e,success:n,slow:s,post:u,get:S,graphql:T}},[y]),j=(0,react_1.useMemo)(()=>[{id:"all",label:"All",count:p.all,color:AppColors_1.AppColors.purple},{id:"errors",label:"Errors",count:p.errors,color:AppColors_1.AppColors.errorColor},{id:"success",label:"2xx OK",count:p.success,color:AppColors_1.AppColors.greenColor},{id:"slow",label:"Slow >500ms",count:p.slow,color:AppColors_1.AppColors.warningIconGold},{id:"POST",label:"POST",count:p.post,color:constants_1.METHOD_COLORS.POST||"#3B82F6"},{id:"GET",label:"GET",count:p.get,color:constants_1.METHOD_COLORS.GET||"#10B981"},{id:"graphql",label:"GraphQL",count:p.graphql,color:AppColors_1.AppColors.graphqlPink}],[p]),W=(0,react_1.useCallback)(({item:e,index:n})=>{if(e.type==="header")return<AnimatedEntrance_1.default index={n}distance={8}>
2
2
  <DomainHeader_1.default pageName={e.pageName}color={e.color}stats={e.stats}activeFilters={e.activeFilters}onToggleFilter={I}isCollapsed={e.isCollapsed}onToggleCollapse={R}isFirst={e.isFirst}timestamp={e.timestamp}/>
3
- </AnimatedEntrance_1.default>;if(e.type==="loadMore"){const{pageName:T,color:t,remainingCount:g,totalCount:f,loadedCount:F,loadMoreStep:S,hasMore:G}=e;return<react_native_1.View style={[styles_1.default.treeNodeRow,styles_1.default.treeNodeRowLast]}>
3
+ </AnimatedEntrance_1.default>;if(e.type==="loadMore"){const{pageName:T,color:t,remainingCount:g,totalCount:f,loadedCount:F,loadMoreStep:C,hasMore:G}=e;return<react_native_1.View style={[styles_1.default.treeNodeRow,styles_1.default.treeNodeRowLast]}>
4
4
  <react_native_1.View style={styles_1.default.treeLines}>
5
5
  <react_native_1.View style={[styles_1.default.modernTreeLine,{borderColor:t},styles_1.default.modernTreeLineLast]}/>
6
6
  </react_native_1.View>
7
7
  <react_native_1.View style={styles_1.default.treeCardWrapper}>
8
- {G?<TouchableScale_1.default onPress={()=>r(T,50)}hitSlop={6}style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:9,paddingHorizontal:12,marginVertical:3,marginRight:2,borderRadius:10,backgroundColor:`${t}14`,borderWidth:1.5,borderColor:`${t}40`,shadowColor:t,shadowOffset:{width:0,height:1.5},shadowOpacity:.1,shadowRadius:3,elevation:2}}>
8
+ {G?<TouchableScale_1.default onPress={()=>r(T,C||10)}hitSlop={6}style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:9,paddingHorizontal:12,marginVertical:3,marginRight:2,borderRadius:10,backgroundColor:`${t}14`,borderWidth:1.5,borderColor:`${t}40`,shadowColor:t,shadowOffset:{width:0,height:1.5},shadowOpacity:.1,shadowRadius:3,elevation:2}}>
9
9
  <react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:8}}>
10
10
  <react_native_1.View style={{width:22,height:22,borderRadius:11,backgroundColor:t,alignItems:"center",justifyContent:"center",shadowColor:t,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:2,elevation:1}}>
11
11
  <NetworkIcons_1.ChevronIcon color={AppColors_1.AppColors.white}size={9}direction="down"/>
12
12
  </react_native_1.View>
13
13
  <react_native_1.View>
14
14
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:12,color:t}}>
15
- {v("footer.loadMoreRequests",{count:S,defaultValue:`Load ${S} More Requests`})}
15
+ {v("footer.loadMoreRequests",{count:C,defaultValue:`Load ${C} More Requests`})}
16
16
  </react_native_1.Text>
17
17
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:9.5,color:AppColors_1.AppColors.grayTextWeak,marginTop:1}}>
18
18
  Showing {F} of {f} requests
@@ -45,10 +45,10 @@
45
45
  </react_native_1.View>
46
46
  </react_native_1.View>}
47
47
  </react_native_1.View>
48
- </react_native_1.View>}const{log:s,isLast:u,color:y}=e;return<AnimatedEntrance_1.default index={n}distance={8}style={[styles_1.default.treeNodeRow,u&&styles_1.default.treeNodeRowLast]}>
48
+ </react_native_1.View>}const{log:s,isLast:u,color:S}=e;return<AnimatedEntrance_1.default index={n}distance={8}style={[styles_1.default.treeNodeRow,u&&styles_1.default.treeNodeRowLast]}>
49
49
  <react_native_1.View style={styles_1.default.treeLines}>
50
- <react_native_1.View style={[styles_1.default.modernTreeLine,{borderColor:y},u&&styles_1.default.modernTreeLineLast]}/>
51
- {!u&&<react_native_1.View style={[styles_1.default.modernTreeBranch,{borderColor:y}]}/>}
50
+ <react_native_1.View style={[styles_1.default.modernTreeLine,{borderColor:S},u&&styles_1.default.modernTreeLineLast]}/>
51
+ {!u&&<react_native_1.View style={[styles_1.default.modernTreeBranch,{borderColor:S}]}/>}
52
52
  </react_native_1.View>
53
53
  <react_native_1.View style={styles_1.default.treeCardWrapper}>
54
54
  <LogCard_1.default item={s}isSelected={b.has(s.id)}onToggleSelect={L}onPress={()=>{B(s)}}timelineMinStart={O}timelineTotalRange={q}isNew={k.has(s.id)}searchStr={o}/>
@@ -134,11 +134,11 @@
134
134
  </react_native_1.View>
135
135
 
136
136
 
137
- {(A!=="all"||o.trim().length>0||c.size>0||d.size>0||w.length!==h.length)&&<react_native_1.View style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5.5,backgroundColor:`${AppColors_1.AppColors.purple}10`,borderRadius:8,borderWidth:1,borderColor:`${AppColors_1.AppColors.purple}25`}}>
137
+ {(A!=="all"||o.trim().length>0||c.size>0||d.size>0||w.length!==y.length)&&<react_native_1.View style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5.5,backgroundColor:`${AppColors_1.AppColors.purple}10`,borderRadius:8,borderWidth:1,borderColor:`${AppColors_1.AppColors.purple}25`}}>
138
138
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:10.5,color:AppColors_1.AppColors.purple}}>
139
- Showing {w.length} of {h.length} requests
139
+ Showing {w.length} of {y.length} requests
140
140
  </react_native_1.Text>
141
- <TouchableScale_1.default onPress={()=>{l(""),V("all"),C(new Set),_(new Set)}}>
141
+ <TouchableScale_1.default onPress={()=>{l(""),V("all"),_(new Set),h(new Set)}}>
142
142
  <react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5,color:AppColors_1.AppColors.errorColor}}>
143
143
  Clear All Filters
144
144
  </react_native_1.Text>
@@ -146,7 +146,7 @@
146
146
  </react_native_1.View>}
147
147
  </react_native_1.View>
148
148
 
149
- <react_native_1.FlatList ref={N}data={a}keyExtractor={e=>e?.id?.toString()}renderItem={W}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<EmptyState_1.default isSearch={o.length>0||c.size>0||d.size>0||A!=="all"}searchQuery={o}customTitle={o.length>0?"No matching API requests":"No network activity"}onClearSearch={()=>{l(""),C(new Set),_(new Set),V("all"),i("all")}}/>}ListFooterComponent={a.length>0?<EndOfListFooter_1.default count={w.length}totalCount={w.length}label="requests"/>:null}contentContainerStyle={[styles_1.default.listContent,w.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
149
+ <react_native_1.FlatList ref={N}data={a}keyExtractor={e=>e?.id?.toString()}renderItem={W}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={react_native_1.Platform.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<EmptyState_1.default isSearch={o.length>0||c.size>0||d.size>0||A!=="all"}searchQuery={o}customTitle={o.length>0?"No matching API requests":"No network activity"}onClearSearch={()=>{l(""),_(new Set),h(new Set),V("all"),i("all")}}/>}ListFooterComponent={a.length>0?<EndOfListFooter_1.default count={w.length}totalCount={w.length}label="requests"/>:null}contentContainerStyle={[styles_1.default.listContent,w.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
150
150
 
151
151
 
152
152
  <NetworkFilterModal_1.default visible={$}onClose={()=>x(!1)}filters={E}onApply={H}searchQuery={o}/>
@@ -1,6 +1,6 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(l,e,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(l,n,a)}):(function(l,e,r,n){n===void 0&&(n=r),l[n]=e[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(l,e){Object.defineProperty(l,"default",{enumerable:!0,value:e})}):function(l,e){l.default=e}),__importStar=this&&this.__importStar||(function(){var l=function(e){return l=Object.getOwnPropertyNames||function(r){var n=[];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[n.length]=a);return n},l(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=l(e),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(r,e,n[a]);return __setModuleDefault(r,e),r}})(),__importDefault=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),PushCard_1=__importDefault(require("./PushCard")),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),EmptyState_1=__importDefault(require("../EmptyState")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),NetworkIcons_1=require("../NetworkIcons"),PushTab=react_1.default.memo(()=>{const{pushRecords:l,filteredPushRecords:e,pushSearch:r,setPushSearch:n,pushQuickFilter:a,setPushQuickFilter:u,setSelectedPush:d,clearAllPushLogs:g,simulatePush:p}=(0,InspectorContext_1.useInspector)(),y=(0,react_1.useRef)(null),[f,m]=(0,react_1.useState)(0),h=["salesforce","fcm","apns","deeplink","rich_media"],S=(0,react_1.useCallback)(()=>{const o=h[f%h.length];p(o),m(t=>t+1)},[f,p]),C=(0,react_1.useMemo)(()=>{let o=0,t=0,s=0;const i={};return l.forEach(c=>{const b=(c.appState||"").toLowerCase();b==="foreground"&&o++,b==="background"&&t++,c.action==="opened"&&s++;const _=(c.source||"other").toLowerCase();i[_]=(i[_]||0)+1}),{all:l.length,foreground:o,background:t,opened:s,sources:i}},[l]),w=(0,react_1.useMemo)(()=>{const o=[{id:"all",label:"All",color:AppColors_1.AppColors.purple,icon:t=><NetworkIcons_1.BellIcon size={12}color={t}/>},{id:"foreground",label:"Foreground",color:AppColors_1.AppColors.greenColor,icon:t=><NetworkIcons_1.SunIcon size={12}color={t}/>},{id:"background",label:"Background",color:AppColors_1.AppColors.darkOrange,icon:t=><NetworkIcons_1.MoonIcon size={12}color={t}/>},{id:"opened",label:"Opened",color:AppColors_1.AppColors.brandPurple,icon:t=><NetworkIcons_1.ExternalLinkIcon size={12}color={t}/>}];return Object.entries(C.sources).forEach(([t,s])=>{s>0&&t!=="all"&&o.push({id:`source:${t}`,label:t.toUpperCase(),color:t==="salesforce"?AppColors_1.AppColors.sky600:AppColors_1.AppColors.brandPurple,icon:i=><NetworkIcons_1.CloudPushIcon size={12}color={i}/>})}),o},[C]),P=(0,react_1.useCallback)(({item:o,index:t})=><AnimatedEntrance_1.default index={t}distance={8}>
2
- <PushCard_1.default item={o}searchStr={r}onPress={()=>d(o)}/>
3
- </AnimatedEntrance_1.default>,[r,d]),A=(0,react_1.useCallback)(o=>o.id||`push_${o.timestamp}`,[]);return<react_native_1.View style={{flex:1}}>
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(l,e,o,n){n===void 0&&(n=o);var a=Object.getOwnPropertyDescriptor(e,o);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(l,n,a)}):(function(l,e,o,n){n===void 0&&(n=o),l[n]=e[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(l,e){Object.defineProperty(l,"default",{enumerable:!0,value:e})}):function(l,e){l.default=e}),__importStar=this&&this.__importStar||(function(){var l=function(e){return l=Object.getOwnPropertyNames||function(o){var n=[];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[n.length]=a);return n},l(e)};return function(e){if(e&&e.__esModule)return e;var o={};if(e!=null)for(var n=l(e),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(o,e,n[a]);return __setModuleDefault(o,e),o}})(),__importDefault=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),PushCard_1=__importDefault(require("./PushCard")),TouchableScale_1=__importDefault(require("../TouchableScale")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),EmptyState_1=__importDefault(require("../EmptyState")),EndOfListFooter_1=__importDefault(require("../EndOfListFooter")),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),NetworkIcons_1=require("../NetworkIcons"),LOAD_MORE_STEP=10,PushTab=react_1.default.memo(()=>{const{pushRecords:l,filteredPushRecords:e,pushSearch:o,setPushSearch:n,pushQuickFilter:a,setPushQuickFilter:p,setSelectedPush:f,clearAllPushLogs:w,simulatePush:h,maxPushLogs:c}=(0,InspectorContext_1.useInspector)(),A=c||50,C=(0,react_1.useRef)(null),[b,v]=(0,react_1.useState)(0),[g,_]=(0,react_1.useState)(A);react_1.default.useEffect(()=>{_(c||50),C.current?.scrollToOffset({offset:0,animated:!1})},[o,a,c]);const u=(0,react_1.useMemo)(()=>e.slice(0,g),[e,g]),y=["salesforce","fcm","apns","deeplink","rich_media"],T=(0,react_1.useCallback)(()=>{const t=y[b%y.length];h(t),v(r=>r+1)},[b,h]),m=(0,react_1.useMemo)(()=>{let t=0,r=0,s=0;const i={};return l.forEach(d=>{const S=(d.appState||"").toLowerCase();S==="foreground"&&t++,S==="background"&&r++,d.action==="opened"&&s++;const P=(d.source||"other").toLowerCase();i[P]=(i[P]||0)+1}),{all:l.length,foreground:t,background:r,opened:s,sources:i}},[l]),x=(0,react_1.useMemo)(()=>{const t=[{id:"all",label:"All",color:AppColors_1.AppColors.purple,icon:r=><NetworkIcons_1.BellIcon size={12}color={r}/>},{id:"foreground",label:"Foreground",color:AppColors_1.AppColors.greenColor,icon:r=><NetworkIcons_1.SunIcon size={12}color={r}/>},{id:"background",label:"Background",color:AppColors_1.AppColors.darkOrange,icon:r=><NetworkIcons_1.MoonIcon size={12}color={r}/>},{id:"opened",label:"Opened",color:AppColors_1.AppColors.brandPurple,icon:r=><NetworkIcons_1.ExternalLinkIcon size={12}color={r}/>}];return Object.entries(m.sources).forEach(([r,s])=>{s>0&&r!=="all"&&t.push({id:`source:${r}`,label:r.toUpperCase(),color:r==="salesforce"?AppColors_1.AppColors.sky600:AppColors_1.AppColors.brandPurple,icon:i=><NetworkIcons_1.CloudPushIcon size={12}color={i}/>})}),t},[m]),I=(0,react_1.useCallback)(({item:t,index:r})=><AnimatedEntrance_1.default index={r}distance={8}>
2
+ <PushCard_1.default item={t}searchStr={o}onPress={()=>f(t)}/>
3
+ </AnimatedEntrance_1.default>,[o,f]),V=(0,react_1.useCallback)(t=>t.id||`push_${t.timestamp}`,[]);return<react_native_1.View style={{flex:1}}>
4
4
 
5
5
  <react_native_1.View style={{marginTop:6}}>
6
6
  <react_native_1.View style={styles_1.default.toolbarRow}>
@@ -8,8 +8,8 @@
8
8
  <react_native_1.View style={styles_1.default.searchIcon}>
9
9
  <NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak}size={15}/>
10
10
  </react_native_1.View>
11
- <react_native_1.TextInput style={[styles_1.default.searchInput,{paddingVertical:0}]}placeholder="Search notifications..."placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={r}onChangeText={n}autoCapitalize="none"autoCorrect={!1}returnKeyType="search"clearButtonMode="while-editing"/>
12
- {r.length>0&&react_native_1.Platform.OS==="android"&&<react_native_1.View style={{position:"absolute",right:8,top:0,bottom:0,justifyContent:"center"}}>
11
+ <react_native_1.TextInput style={[styles_1.default.searchInput,{paddingVertical:0}]}placeholder="Search notifications..."placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={o}onChangeText={n}autoCapitalize="none"autoCorrect={!1}returnKeyType="search"clearButtonMode="while-editing"/>
12
+ {o.length>0&&react_native_1.Platform.OS==="android"&&<react_native_1.View style={{position:"absolute",right:8,top:0,bottom:0,justifyContent:"center"}}>
13
13
  <react_native_1.Pressable onPress={()=>n("")}hitSlop={10}style={styles_1.default.clearBtn}>
14
14
  <NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak}size={13}/>
15
15
  </react_native_1.Pressable>
@@ -17,11 +17,11 @@
17
17
  </react_native_1.View>
18
18
 
19
19
  <react_native_1.View style={styles_1.default.toolbarRight}>
20
- <TouchableScale_1.default style={[styles_1.default.toolbarBtn,{backgroundColor:`${AppColors_1.AppColors.brandPurple}14`,borderColor:`${AppColors_1.AppColors.brandPurple}30`}]}onPress={S}hitSlop={6}accessibilityRole="button"accessibilityLabel="Simulate incoming push notification">
20
+ <TouchableScale_1.default style={[styles_1.default.toolbarBtn,{backgroundColor:`${AppColors_1.AppColors.brandPurple}14`,borderColor:`${AppColors_1.AppColors.brandPurple}30`}]}onPress={T}hitSlop={6}accessibilityRole="button"accessibilityLabel="Simulate incoming push notification">
21
21
  <NetworkIcons_1.BoltIcon color={AppColors_1.AppColors.brandPurple}size={15}/>
22
22
  </TouchableScale_1.default>
23
23
 
24
- {l.length>0&&<TouchableScale_1.default style={[styles_1.default.toolbarBtn,{borderColor:`${AppColors_1.AppColors.errorColor}38`,backgroundColor:`${AppColors_1.AppColors.errorColor}0F`}]}onPress={g}hitSlop={6}accessibilityRole="button"accessibilityLabel="Clear all push notification history">
24
+ {l.length>0&&<TouchableScale_1.default style={[styles_1.default.toolbarBtn,{borderColor:`${AppColors_1.AppColors.errorColor}38`,backgroundColor:`${AppColors_1.AppColors.errorColor}0F`}]}onPress={w}hitSlop={6}accessibilityRole="button"accessibilityLabel="Clear all push notification history">
25
25
  <NetworkIcons_1.TrashIcon color={AppColors_1.AppColors.errorColor}size={15}/>
26
26
  </TouchableScale_1.default>}
27
27
  </react_native_1.View>
@@ -31,15 +31,15 @@
31
31
 
32
32
  <react_native_1.View style={pushTabStyles.carouselWrapper}>
33
33
  <react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={pushTabStyles.carouselContent}>
34
- {w.map(o=>{const t=a===o.id;return<TouchableScale_1.default key={o.id}onPress={()=>u(o.id)}style={[pushTabStyles.filterPill,t&&{backgroundColor:o.color,borderColor:o.color}]}>
35
- {o.icon?o.icon(t?AppColors_1.AppColors.white:o.color):null}
36
- <react_native_1.Text style={[pushTabStyles.filterPillText,t&&{color:AppColors_1.AppColors.white}]}>
37
- {o.label}
34
+ {x.map(t=>{const r=a===t.id;return<TouchableScale_1.default key={t.id}onPress={()=>p(t.id)}style={[pushTabStyles.filterPill,r&&{backgroundColor:t.color,borderColor:t.color}]}>
35
+ {t.icon?t.icon(r?AppColors_1.AppColors.white:t.color):null}
36
+ <react_native_1.Text style={[pushTabStyles.filterPillText,r&&{color:AppColors_1.AppColors.white}]}>
37
+ {t.label}
38
38
  </react_native_1.Text>
39
39
  </TouchableScale_1.default>})}
40
40
  </react_native_1.ScrollView>
41
41
  </react_native_1.View>
42
42
 
43
43
 
44
- <react_native_1.FlatList ref={y}data={e}renderItem={P}keyExtractor={A}contentContainerStyle={pushTabStyles.listContent}initialNumToRender={15}maxToRenderPerBatch={20}windowSize={11}removeClippedSubviews={react_native_1.Platform.OS==="android"}ListEmptyComponent={<EmptyState_1.default isSearch={!!(r||a!=="all")}searchQuery={r}customTitle={r||a!=="all"?"No matching push notifications":"No push notifications captured yet"}customSub={r||a!=="all"?"Try adjusting your search query or filter chips.":"Incoming or opened push payloads from any domain (Salesforce, FCM, APNs, etc.) will appear here automatically."}onClearSearch={()=>{n(""),u("all")}}showReload={!1}/>}ListFooterComponent={e.length>0?<EndOfListFooter_1.default totalCount={e.length}label="End of push notification history"/>:null}/>
44
+ <react_native_1.FlatList ref={C}data={u}renderItem={I}keyExtractor={V}contentContainerStyle={pushTabStyles.listContent}initialNumToRender={15}maxToRenderPerBatch={20}windowSize={11}removeClippedSubviews={react_native_1.Platform.OS==="android"}ListEmptyComponent={<EmptyState_1.default isSearch={!!(o||a!=="all")}searchQuery={o}customTitle={o||a!=="all"?"No matching push notifications":"No push notifications captured yet"}customSub={o||a!=="all"?"Try adjusting your search query or filter chips.":"Incoming or opened push payloads from any domain (Salesforce, FCM, APNs, etc.) will appear here automatically."}onClearSearch={()=>{n(""),p("all")}}showReload={!1}/>}ListFooterComponent={e.length>0?<EndOfListFooter_1.default count={u.length}totalCount={e.length}label="push notifications"loadMoreStep={LOAD_MORE_STEP}hasMore={u.length<e.length}onLoadMore={()=>_(t=>t+LOAD_MORE_STEP)}/>:null}/>
45
45
  </react_native_1.View>}),pushTabStyles=react_native_1.StyleSheet.create({carouselWrapper:{paddingVertical:6,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor,backgroundColor:AppColors_1.AppColors.white},carouselContent:{paddingHorizontal:8,gap:6,flexDirection:"row",alignItems:"center"},filterPill:{flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:9,paddingVertical:4.5,borderRadius:20,backgroundColor:AppColors_1.AppColors.grayBackground,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor},filterPillText:{fontSize:11,fontFamily:AppFonts_1.AppFonts.interMedium,color:AppColors_1.AppColors.primaryBlack},countBadge:{paddingHorizontal:5,paddingVertical:1,borderRadius:10},countBadgeText:{fontSize:9.5,fontFamily:AppFonts_1.AppFonts.interBold},listContent:{padding:8,paddingBottom:24}});PushTab.displayName="PushTab",exports.default=PushTab;