@buoy-gg/react-query 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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DataEditorActionsFooter=DataEditorActionsFooter;exports.DataEditorMode=DataEditorMode;var _reactNative=require("react-native");var _reactQuery=require("@tanstack/react-query");var _sharedUi=require("@buoy-gg/shared-ui");var _Explorer=_interopRequireDefault(require("./query-browser/Explorer"));var _QueryDetails=_interopRequireDefault(require("./query-browser/QueryDetails"));var _ActionButton=_interopRequireDefault(require("./query-browser/ActionButton"));var _getQueryStatusLabel=require("../utils/getQueryStatusLabel");var _useActionButtons=require("../hooks/useActionButtons");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function DataEditorMode({selectedQuery:t,isFloatingMode:e,disableInternalFooter:r=false,queryVersion:a}){const n=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const s=(0,_reactQuery.useQueryClient)();const o=(0,_useActionButtons.useActionButtons)(t,s,a);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:styles.explorerScrollContainer,contentContainerStyle:[styles.explorerScrollContent,!r&&{paddingBottom:72}],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(DataExplorer,{visible:!!t.state.data,selectedQuery:t,queryVersion:a}),(0,_jsxRuntime.jsx)(DataEmptyState,{visible:!t.state.data,selectedQuery:t})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_QueryDetails.default,{query:t})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.queryExplorerContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-query-explorer-header",style:styles.queryExplorerHeader,children:"Query Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.queryExplorerContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:n.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:o.map((i,l)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${i.variant}`,onClick:i.onPress,text:i.label,variant:i.variant,disabled:i.disabled},l))})})]})}function DataEditorActionsFooter({selectedQuery:t,isFloatingMode:e,queryVersion:r}){const a=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const n=(0,_reactQuery.useQueryClient)();const s=(0,_useActionButtons.useActionButtons)(t,n,r);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:a.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:s.map((o,i)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${o.variant}`,onClick:o.onPress,text:o.label,variant:o.variant,disabled:o.disabled},i))})})}function DataExplorer({visible:t,selectedQuery:e,queryVersion:r=0}){if(!t)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-data-header",style:styles.dataHeader,children:"Data Editor"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"Data",value:e.state.data,defaultExpanded:["Data"],activeQuery:e,dataVersion:r})})]})}function DataEmptyState({visible:t,selectedQuery:e}){if(!t)return null;const r=()=>{if(e.isDisabled()){return{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}}if(e.state.status==="pending"||(0,_getQueryStatusLabel.getQueryStatusLabel)(e)==="fetching"){return{title:e.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}}if(e.state.status==="error"){return{title:"Query Error",description:e.state.error?.message||"An error occurred while fetching data."}}return{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."}};const{title:a,description:n}=r();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-empty-title",style:styles.emptyTitle,children:a}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-empty-description",style:styles.emptyDescription,children:n})]})}const styles=_reactNative.StyleSheet.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:_sharedUi.night.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:_sharedUi.night.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},dataContent:{padding:8}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DataEditorActionsFooter=DataEditorActionsFooter;exports.DataEditorMode=DataEditorMode;var _reactNative=require("react-native");var _reactQuery=require("@tanstack/react-query");var _sharedUi=require("@buoy-gg/shared-ui");var _Explorer=_interopRequireDefault(require("./query-browser/Explorer"));var _QueryDetails=_interopRequireDefault(require("./query-browser/QueryDetails"));var _ActionButton=_interopRequireDefault(require("./query-browser/ActionButton"));var _getQueryStatusLabel=require("../utils/getQueryStatusLabel");var _useActionButtons=require("../hooks/useActionButtons");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function DataEditorMode({selectedQuery:t,isFloatingMode:e,disableInternalFooter:r=false,queryVersion:a}){const n=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const s=(0,_reactQuery.useQueryClient)();const o=(0,_useActionButtons.useActionButtons)(t,s,a);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:styles.explorerScrollContainer,contentContainerStyle:[styles.explorerScrollContent,!r&&{paddingBottom:72}],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(DataExplorer,{visible:!!t.state.data,selectedQuery:t,queryVersion:a}),(0,_jsxRuntime.jsx)(DataEmptyState,{visible:!t.state.data,selectedQuery:t})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_QueryDetails.default,{query:t})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.queryExplorerContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-query-explorer-header",style:styles.queryExplorerHeader,children:"Query Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.queryExplorerContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:n.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:o.map((i,l)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${i.variant}`,onClick:i.onPress,text:i.label,variant:i.variant,disabled:i.disabled},l))})})]})}function DataEditorActionsFooter({selectedQuery:t,isFloatingMode:e,queryVersion:r}){const a=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const n=(0,_reactQuery.useQueryClient)();const s=(0,_useActionButtons.useActionButtons)(t,n,r);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:a.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:s.map((o,i)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${o.variant}`,onClick:o.onPress,text:o.label,variant:o.variant,disabled:o.disabled},i))})})}function DataExplorer({visible:t,selectedQuery:e,queryVersion:r=0}){if(!t)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-data-header",style:styles.dataHeader,children:"Data Editor"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"Data",value:e.state.data,defaultExpanded:["Data"],activeQuery:e,dataVersion:r})})]})}function DataEmptyState({visible:t,selectedQuery:e}){if(!t)return null;const r=()=>{if(e.isDisabled()){return{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}}if(e.state.status==="pending"||(0,_getQueryStatusLabel.getQueryStatusLabel)(e)==="fetching"){return{title:e.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}}if(e.state.status==="error"){return{title:"Query Error",description:e.state.error?.message||"An error occurred while fetching data."}}return{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."}};const{title:a,description:n}=r();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-empty-title",style:styles.emptyTitle,children:a}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-empty-description",style:styles.emptyDescription,children:n})]})}const styles=_reactNative.StyleSheet.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:_sharedUi.night.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:_sharedUi.night.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},dataContent:{padding:8}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.MutationEditorActionsFooter=MutationEditorActionsFooter;exports.MutationEditorMode=MutationEditorMode;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _Explorer=_interopRequireDefault(require("./query-browser/Explorer"));var _MutationDetails=_interopRequireDefault(require("./query-browser/MutationDetails"));var _ActionButton=_interopRequireDefault(require("./query-browser/ActionButton"));var _useMutationActionButtons=require("../hooks/useMutationActionButtons");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function MutationEditorMode({selectedMutation:t,isFloatingMode:e,disableInternalFooter:r=false}){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:styles.explorerScrollContainer,contentContainerStyle:styles.explorerScrollContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(DataExplorer,{visible:!!t.state.data,selectedMutation:t}),(0,_jsxRuntime.jsx)(DataEmptyState,{visible:!t.state.data,selectedMutation:t})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_MutationDetails.default,{selectedMutation:t})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.mutationExplorerContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.mutationExplorerHeader,children:"Mutation Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mutationExplorerContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&(0,_jsxRuntime.jsx)(MutationEditorActionsFooter,{selectedMutation:t,isFloatingMode:e})]})}function MutationEditorActionsFooter({selectedMutation:t,isFloatingMode:e}){const r=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const i=(0,_useMutationActionButtons.useMutationActionButtons)(t);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:r.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsGrid,children:i.map((o,n)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${o.variant}`,onClick:o.onPress,text:o.label,variant:o.variant,disabled:o.disabled},n))})})}function DataExplorer({visible:t,selectedMutation:e}){if(!t)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dataHeader,children:"Data Editor"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"Data",value:e.state.data,defaultExpanded:["Data"]},e.mutationId)})]})}function DataEmptyState({visible:t,selectedMutation:e}){if(!t)return null;const r=()=>{if(e.state.status==="pending"){return{title:"Pending...",description:"The mutation is in progress."}}if(e.state.status==="error"){return{title:"Mutation Error",description:e.state.error?.message||"An error occurred."}}return{title:"No Data Available",description:"This mutation has no data."}};const{title:i,description:o}=r();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-mutation-detail-empty-title",style:styles.emptyTitle,children:i}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-mutation-detail-empty-description",style:styles.emptyDescription,children:o})]})}const styles=_reactNative.StyleSheet.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:_sharedUi.night.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:_sharedUi.night.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},dataContent:{padding:8}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.MutationEditorActionsFooter=MutationEditorActionsFooter;exports.MutationEditorMode=MutationEditorMode;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _Explorer=_interopRequireDefault(require("./query-browser/Explorer"));var _MutationDetails=_interopRequireDefault(require("./query-browser/MutationDetails"));var _ActionButton=_interopRequireDefault(require("./query-browser/ActionButton"));var _useMutationActionButtons=require("../hooks/useMutationActionButtons");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function MutationEditorMode({selectedMutation:t,isFloatingMode:e,disableInternalFooter:r=false}){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:styles.explorerScrollContainer,contentContainerStyle:styles.explorerScrollContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(DataExplorer,{visible:!!t.state.data,selectedMutation:t}),(0,_jsxRuntime.jsx)(DataEmptyState,{visible:!t.state.data,selectedMutation:t})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_MutationDetails.default,{selectedMutation:t})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.mutationExplorerContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.mutationExplorerHeader,children:"Mutation Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mutationExplorerContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&(0,_jsxRuntime.jsx)(MutationEditorActionsFooter,{selectedMutation:t,isFloatingMode:e})]})}function MutationEditorActionsFooter({selectedMutation:t,isFloatingMode:e}){const r=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const i=(0,_useMutationActionButtons.useMutationActionButtons)(t);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:r.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsGrid,children:i.map((o,n)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${o.variant}`,onClick:o.onPress,text:o.label,variant:o.variant,disabled:o.disabled},n))})})}function DataExplorer({visible:t,selectedMutation:e}){if(!t)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dataHeader,children:"Data Editor"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"Data",value:e.state.data,defaultExpanded:["Data"]},e.mutationId)})]})}function DataEmptyState({visible:t,selectedMutation:e}){if(!t)return null;const r=()=>{if(e.state.status==="pending"){return{title:"Pending...",description:"The mutation is in progress."}}if(e.state.status==="error"){return{title:"Mutation Error",description:e.state.error?.message||"An error occurred."}}return{title:"No Data Available",description:"This mutation has no data."}};const{title:i,description:o}=r();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-mutation-detail-empty-title",style:styles.emptyTitle,children:i}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-mutation-detail-empty-description",style:styles.emptyDescription,children:o})]})}const styles=_reactNative.StyleSheet.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:_sharedUi.night.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:_sharedUi.night.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},dataContent:{padding:8}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.QuerySelector=QuerySelector;var _reactNative=require("react-native");var _getQueryStatusColor=require("../utils/getQueryStatusColor");var _QueryDebugInfo=require("./QueryDebugInfo");var _jsxRuntime=require("react/jsx-runtime");function QuerySelector({queries:t,selectedQuery:i,isOpen:s,onClose:l,onSelect:n}){const a=e=>{return Array.isArray(e.queryKey)?e.queryKey.join(" - "):String(e.queryKey)};return(0,_jsxRuntime.jsx)(_reactNative.Modal,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:s,transparent:true,animationType:"fade",onRequestClose:l,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:styles.modalOverlay,onPress:l,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:styles.modalContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.modalHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.modalTitle,children:"Select Query"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.modalSubtitle,children:[t.length," ",t.length===1?"query":"queries"," ","available"]})]}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:styles.scrollView,contentContainerStyle:styles.scrollViewContent,showsVerticalScrollIndicator:true,children:t.length===0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyTitle,children:"No Queries Found"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.emptyDescription,children:["No React Query queries are currently active.","\n\n","To see queries here:","\n","\u2022 Make API calls using useQuery","\n","\u2022 Ensure queries are within QueryClientProvider","\n","\u2022 Check console for debugging info"]}),(0,_jsxRuntime.jsx)(_QueryDebugInfo.QueryDebugInfo,{})]}):t.map((e,c)=>{const r=a(e);const u=(0,_getQueryStatusColor.getQueryStatusColor)({queryState:e.state,observerCount:e.getObserversCount(),isStale:e.isStale()});const y={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"};const d=y[u]||"#6B7280";const o=e===i;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{accessibilityLabel:`Query ${r}`,accessibilityHint:`View query ${r}`,"sentry-label":`ignore query ${r}`,style:[styles.queryItem,o&&styles.selectedQueryItem],onPress:()=>n(e),children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusDot,{backgroundColor:d}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.queryText,o&&styles.selectedQueryText],numberOfLines:1,children:r})]},`${e.queryHash}-${c}`)})})]})})})}const styles=_reactNative.StyleSheet.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},modalContent:{backgroundColor:"#1F1F1F",borderRadius:8,width:"80%",maxHeight:"80%",minHeight:"50%",borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",flex:0},modalHeader:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},modalTitle:{color:"#FFFFFF",fontSize:16,fontWeight:"600",marginBottom:4},modalSubtitle:{color:"#9CA3AF",fontSize:12},scrollView:{flex:1},scrollViewContent:{padding:8,flexGrow:1},emptyState:{padding:32,alignItems:"center",justifyContent:"center"},emptyTitle:{color:"#E5E7EB",fontSize:16,fontWeight:"500",marginBottom:8,textAlign:"center"},emptyDescription:{color:"#9CA3AF",fontSize:14,textAlign:"center",lineHeight:20},queryItem:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:4},selectedQueryItem:{backgroundColor:"rgba(255, 255, 255, 0.1)"},statusDot:{width:8,height:8,borderRadius:4,marginRight:8},queryText:{color:"#E5E7EB",fontSize:14,flex:1},selectedQueryText:{color:"#FFFFFF",fontWeight:"500"},trigger:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:4,paddingHorizontal:8,paddingVertical:6,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",minWidth:120,maxWidth:200},triggerText:{color:"#E5E7EB",fontSize:12,flex:1,marginHorizontal:6}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.QuerySelector=QuerySelector;var _reactNative=require("react-native");var _getQueryStatusColor=require("../utils/getQueryStatusColor");var _QueryDebugInfo=require("./QueryDebugInfo");var _jsxRuntime=require("react/jsx-runtime");function QuerySelector({queries:t,selectedQuery:i,isOpen:s,onClose:l,onSelect:n}){const a=e=>{return Array.isArray(e.queryKey)?e.queryKey.join(" - "):String(e.queryKey)};return(0,_jsxRuntime.jsx)(_reactNative.Modal,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:s,transparent:true,animationType:"fade",onRequestClose:l,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:styles.modalOverlay,onPress:l,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:styles.modalContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.modalHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.modalTitle,children:"Select Query"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.modalSubtitle,children:[t.length," ",t.length===1?"query":"queries"," ","available"]})]}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:styles.scrollView,contentContainerStyle:styles.scrollViewContent,showsVerticalScrollIndicator:true,children:t.length===0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyTitle,children:"No Queries Found"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.emptyDescription,children:["No React Query queries are currently active.","\n\n","To see queries here:","\n","\u2022 Make API calls using useQuery","\n","\u2022 Ensure queries are within QueryClientProvider","\n","\u2022 Check console for debugging info"]}),(0,_jsxRuntime.jsx)(_QueryDebugInfo.QueryDebugInfo,{})]}):t.map((e,c)=>{const r=a(e);const u=(0,_getQueryStatusColor.getQueryStatusColor)({queryState:e.state,observerCount:e.getObserversCount(),isStale:e.isStale()});const y={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"};const d=y[u]||"#6B7280";const o=e===i;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{accessibilityLabel:`Query ${r}`,accessibilityHint:`View query ${r}`,"sentry-label":`ignore query ${r}`,style:[styles.queryItem,o&&styles.selectedQueryItem],onPress:()=>n(e),children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusDot,{backgroundColor:d}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.queryText,o&&styles.selectedQueryText],numberOfLines:1,children:r})]},`${e.queryHash}-${c}`)})})]})})})}const styles=_reactNative.StyleSheet.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},modalContent:{backgroundColor:"#1F1F1F",borderRadius:8,width:"80%",maxHeight:"80%",minHeight:"50%",borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",flex:0},modalHeader:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},modalTitle:{color:"#FFFFFF",fontSize:16,fontWeight:"600",marginBottom:4},modalSubtitle:{color:"#9CA3AF",fontSize:12},scrollView:{flex:1},scrollViewContent:{padding:8,flexGrow:1},emptyState:{padding:32,alignItems:"center",justifyContent:"center"},emptyTitle:{color:"#E5E7EB",fontSize:16,fontWeight:"500",marginBottom:8,textAlign:"center"},emptyDescription:{color:"#9CA3AF",fontSize:14,textAlign:"center",lineHeight:20},queryItem:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:4},selectedQueryItem:{backgroundColor:"rgba(255, 255, 255, 0.1)"},statusDot:{width:8,height:8,borderRadius:4,marginRight:8},queryText:{color:"#E5E7EB",fontSize:14,flex:1},selectedQueryText:{color:"#FFFFFF",fontWeight:"500"},trigger:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:4,paddingHorizontal:8,paddingVertical:6,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",minWidth:120,maxWidth:200},triggerText:{color:"#E5E7EB",fontSize:12,flex:1,marginHorizontal:6}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=MutationInformation;var _Explorer=_interopRequireDefault(require("./Explorer"));var _reactNative=require("react-native");var _MutationDetails=_interopRequireDefault(require("./MutationDetails"));var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function MutationInformation({selectedMutation:e}){return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{"sentry-label":"ignore devtools mutation information scroll",style:styles.flex1,contentContainerStyle:styles.scrollContent,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_MutationDetails.default,{selectedMutation:e})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Variables Details"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Context Details"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Data Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Mutations Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Mutation",defaultExpanded:["Mutation"],value:e})})]})]})}const styles=_reactNative.StyleSheet.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:_sharedUi.night.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:_sharedUi.night.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",fontFamily:_sharedUi.monoFont,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:_sharedUi.night.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,borderTopWidth:0}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=MutationInformation;var _Explorer=_interopRequireDefault(require("./Explorer"));var _reactNative=require("react-native");var _MutationDetails=_interopRequireDefault(require("./MutationDetails"));var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function MutationInformation({selectedMutation:e}){return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools mutation information scroll",style:styles.flex1,contentContainerStyle:styles.scrollContent,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_MutationDetails.default,{selectedMutation:e})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Variables Details"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Context Details"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Data Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textHeader,children:"Mutations Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.padding,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Mutation",defaultExpanded:["Mutation"],value:e})})]})]})}const styles=_reactNative.StyleSheet.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:_sharedUi.night.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:_sharedUi.night.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",fontFamily:_sharedUi.monoFont,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:_sharedUi.night.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,borderTopWidth:0}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=MutationsList;var _react=require("react");var _reactNative=require("react-native");var _MutationButton=_interopRequireDefault(require("./MutationButton"));var _MutationInformation=_interopRequireDefault(require("./MutationInformation"));var _useAllMutations=_interopRequireDefault(require("../../hooks/useAllMutations"));var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function MutationsList({selectedMutation:r,setSelectedMutation:f,activeFilter:o,hideInfoPanel:b=false,contentContainerStyle:x,searchText:u=""}){const{mutations:h}=(0,_useAllMutations.default)();const C=t=>{if(t.state.isPaused)return"paused";const e=t.state.status;return e};const g=(0,_react.useMemo)(()=>{let t=h;if(o){t=t.filter(e=>{const n=C(e);return n===o})}if(u){const e=u.toLowerCase();t=t.filter(n=>{const s=n.options.mutationKey;if(!s)return false;const w=Array.isArray(s)?s:[s];const R=w.filter(c=>c!=null).map(c=>String(c)).join(" ").toLowerCase();return R.includes(e)})}return t},[h,o,u]);const m=_reactNative.Dimensions.get("window").height;const l=m*.4;const p=150;const y=m*.7;const a=(0,_react.useRef)(new _reactNative.Animated.Value(l)).current;const[,d]=(0,_react.useState)(l);const i=(0,_react.useRef)(l);const M=(0,_react.useRef)(_reactNative.PanResponder.create({onMoveShouldSetPanResponder:(t,e)=>{return Math.abs(e.dy)>Math.abs(e.dx)&&Math.abs(e.dy)>10},onPanResponderGrant:()=>{a.stopAnimation(t=>{d(t);i.current=t;a.setValue(t)})},onPanResponderMove:(t,e)=>{const n=i.current-e.dy;const s=Math.max(p,Math.min(y,n));a.setValue(s)},onPanResponderRelease:(t,e)=>{const n=Math.max(p,Math.min(y,i.current-e.dy));d(n);i.current=n;_reactNative.Animated.timing(a,{toValue:n,duration:200,useNativeDriver:false}).start(()=>{a.setValue(n);d(n);i.current=n})}})).current;const I=(0,_react.useCallback)(({item:t})=>(0,_jsxRuntime.jsx)(_MutationButton.default,{selected:r,setSelectedMutation:f,mutation:t}),[r,f]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[g.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.listWrapper,children:(0,_jsxRuntime.jsx)(_reactNative.FlatList,{"sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:g,renderItem:I,keyExtractor:(t,e)=>`${t.mutationId}-${t.state.submittedAt}-${t.state.status}-${e}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:x||styles.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-rq-mutations-empty",otto:o?"filtering":"scanning",title:"No mutations found",message:o?`No ${o} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),r&&!b&&(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.mutationInfo,{height:a}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dragHandle,...M.panHandlers,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dragIndicator})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mutationInfoContent,children:(0,_jsxRuntime.jsx)(_MutationInformation.default,{selectedMutation:r})})]})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:_sharedUi.night.color.surface,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},dragIndicator:{width:40,height:4,backgroundColor:_sharedUi.night.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:_sharedUi.night.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:_sharedUi.monoFont,letterSpacing:.5}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=MutationsList;var _react=require("react");var _reactNative=require("react-native");var _MutationButton=_interopRequireDefault(require("./MutationButton"));var _MutationInformation=_interopRequireDefault(require("./MutationInformation"));var _useAllMutations=_interopRequireDefault(require("../../hooks/useAllMutations"));var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function MutationsList({selectedMutation:r,setSelectedMutation:h,activeFilter:o,hideInfoPanel:b=false,contentContainerStyle:x,searchText:u=""}){const{mutations:f}=(0,_useAllMutations.default)();const C=t=>{if(t.state.isPaused)return"paused";const e=t.state.status;return e};const g=(0,_react.useMemo)(()=>{let t=f;if(o){t=t.filter(e=>{const n=C(e);return n===o})}if(u){const e=u.toLowerCase();t=t.filter(n=>{const s=n.options.mutationKey;if(!s)return false;const w=Array.isArray(s)?s:[s];const R=w.filter(c=>c!=null).map(c=>String(c)).join(" ").toLowerCase();return R.includes(e)})}return t},[f,o,u]);const m=_reactNative.Dimensions.get("window").height;const l=m*.4;const p=150;const y=m*.7;const a=(0,_react.useRef)(new _reactNative.Animated.Value(l)).current;const[,d]=(0,_react.useState)(l);const i=(0,_react.useRef)(l);const M=(0,_react.useRef)(_reactNative.PanResponder.create({onMoveShouldSetPanResponder:(t,e)=>{return Math.abs(e.dy)>Math.abs(e.dx)&&Math.abs(e.dy)>10},onPanResponderGrant:()=>{a.stopAnimation(t=>{d(t);i.current=t;a.setValue(t)})},onPanResponderMove:(t,e)=>{const n=i.current-e.dy;const s=Math.max(p,Math.min(y,n));a.setValue(s)},onPanResponderRelease:(t,e)=>{const n=Math.max(p,Math.min(y,i.current-e.dy));d(n);i.current=n;_reactNative.Animated.timing(a,{toValue:n,duration:200,useNativeDriver:false}).start(()=>{a.setValue(n);d(n);i.current=n})}})).current;const I=(0,_react.useCallback)(({item:t})=>(0,_jsxRuntime.jsx)(_MutationButton.default,{selected:r,setSelectedMutation:h,mutation:t}),[r,h]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[g.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.listWrapper,children:(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:g,renderItem:I,keyExtractor:(t,e)=>`${t.mutationId}-${t.state.submittedAt}-${t.state.status}-${e}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:x||styles.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-rq-mutations-empty",otto:o?"filtering":"scanning",title:"No mutations found",message:o?`No ${o} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),r&&!b&&(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.mutationInfo,{height:a}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dragHandle,...M.panHandlers,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dragIndicator})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mutationInfoContent,children:(0,_jsxRuntime.jsx)(_MutationInformation.default,{selectedMutation:r})})]})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:_sharedUi.night.color.surface,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},dragIndicator:{width:40,height:4,backgroundColor:_sharedUi.night.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:_sharedUi.night.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:_sharedUi.monoFont,letterSpacing:.5}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryBrowser;var _react=require("react");var _reactNative=require("react-native");var _QueryRow=_interopRequireDefault(require("./QueryRow"));var _useAllQueries=_interopRequireDefault(require("../../hooks/useAllQueries"));var _getQueryStatusLabel=require("../../utils/getQueryStatusLabel");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function QueryBrowser({selectedQuery:r,onQuerySelect:u,activeFilter:a,emptyStateMessage:S,emptyState:m,contentContainerStyle:g,queries:p,searchText:i="",ignoredPatterns:l=new Set,includedPatterns:y=new Set}){const q=(0,_useAllQueries.default)();const f=p??q;const d=(0,_react.useMemo)(()=>{let e=f;if(a){e=e.filter(t=>{const o=(0,_getQueryStatusLabel.getQueryStatusLabel)(t);return o===a})}if(i){const t=i.toLowerCase();e=e.filter(o=>{if(!o?.queryKey)return false;const n=Array.isArray(o.queryKey)?o.queryKey:[o.queryKey];const s=n.filter(c=>c!=null).map(c=>String(c)).join(" ").toLowerCase();return s.includes(t)})}if(y.size>0){e=e.filter(t=>{if(!t?.queryKey)return false;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const n=o.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return Array.from(y).some(s=>n.includes(s.toLowerCase()))})}if(l.size>0){e=e.filter(t=>{if(!t?.queryKey)return true;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const n=o.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return!Array.from(l).some(s=>n.includes(s.toLowerCase()))})}e.sort((t,o)=>{const n=t.state.dataUpdatedAt||0;const s=o.state.dataUpdatedAt||0;return s-n});return e},[f,a,i,y,l]);const h=(0,_react.useCallback)(e=>{const t=r?.queryHash===e.queryHash;if(t){u(void 0);return}u(e)},[r?.queryHash,u]);if(d.length===0){return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-rq-empty",...m??{otto:"empty",title:"No queries found",message:S||(a?`No ${a} queries found`:"No queries found")}})}return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{testID:"buoy-rq-query-list",style:styles.listWrapper,contentContainerStyle:g||styles.listContent,data:d,keyExtractor:queryKeyExtractor,renderItem:({item:e})=>(0,_jsxRuntime.jsx)(_QueryRow.default,{query:e,stateSig:computeQueryStateSig(e),isSelected:r?.queryHash===e.queryHash,onSelect:h}),showsVerticalScrollIndicator:true,..._sharedUi.EVENT_LIST_PRESET})}const queryKeyExtractor=r=>r.queryHash;function computeQueryStateSig(r){let u=0;let a=false;try{u=r.getObserversCount();a=r.isStale()}catch{}return`${r.state.dataUpdatedAt}|${r.state.fetchStatus}|${r.state.status}|${u}|${a}`}const styles=_reactNative.StyleSheet.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:_sharedUi.night.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:_sharedUi.monoFont,letterSpacing:.5}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryBrowser;var _react=require("react");var _reactNative=require("react-native");var _QueryRow=_interopRequireDefault(require("./QueryRow"));var _useAllQueries=_interopRequireDefault(require("../../hooks/useAllQueries"));var _getQueryStatusLabel=require("../../utils/getQueryStatusLabel");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function QueryBrowser({selectedQuery:r,onQuerySelect:u,activeFilter:a,emptyStateMessage:S,emptyState:m,contentContainerStyle:g,queries:p,searchText:i="",ignoredPatterns:l=new Set,includedPatterns:y=new Set}){const h=(0,_useAllQueries.default)();const f=p??h;const d=(0,_react.useMemo)(()=>{let e=f;if(a){e=e.filter(t=>{const o=(0,_getQueryStatusLabel.getQueryStatusLabel)(t);return o===a})}if(i){const t=i.toLowerCase();e=e.filter(o=>{if(!o?.queryKey)return false;const n=Array.isArray(o.queryKey)?o.queryKey:[o.queryKey];const s=n.filter(c=>c!=null).map(c=>String(c)).join(" ").toLowerCase();return s.includes(t)})}if(y.size>0){e=e.filter(t=>{if(!t?.queryKey)return false;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const n=o.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return Array.from(y).some(s=>n.includes(s.toLowerCase()))})}if(l.size>0){e=e.filter(t=>{if(!t?.queryKey)return true;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const n=o.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return!Array.from(l).some(s=>n.includes(s.toLowerCase()))})}e.sort((t,o)=>{const n=t.state.dataUpdatedAt||0;const s=o.state.dataUpdatedAt||0;return s-n});return e},[f,a,i,y,l]);const q=(0,_react.useCallback)(e=>{const t=r?.queryHash===e.queryHash;if(t){u(void 0);return}u(e)},[r?.queryHash,u]);if(d.length===0){return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-rq-empty",...m??{otto:"empty",title:"No queries found",message:S||(a?`No ${a} queries found`:"No queries found")}})}return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-query-list",style:styles.listWrapper,contentContainerStyle:g||styles.listContent,data:d,keyExtractor:queryKeyExtractor,renderItem:({item:e})=>(0,_jsxRuntime.jsx)(_QueryRow.default,{query:e,stateSig:computeQueryStateSig(e),isSelected:r?.queryHash===e.queryHash,onSelect:q}),showsVerticalScrollIndicator:true,..._sharedUi.EVENT_LIST_PRESET})}const queryKeyExtractor=r=>r.queryHash;function computeQueryStateSig(r){let u=0;let a=false;try{u=r.getObserversCount();a=r.isStale()}catch{}return`${r.state.dataUpdatedAt}|${r.state.fetchStatus}|${r.state.status}|${u}|${a}`}const styles=_reactNative.StyleSheet.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:_sharedUi.night.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:_sharedUi.monoFont,letterSpacing:.5}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryInformation;var _QueryDetails=_interopRequireDefault(require("./QueryDetails"));var _QueryActions=_interopRequireDefault(require("./QueryActions"));var _Explorer=_interopRequireDefault(require("./Explorer"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function QueryInformation({selectedQuery:e,setSelectedQuery:t}){return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{"sentry-label":"ignore devtools query info scroll",style:styles.flexOne,contentContainerStyle:styles.scrollContent,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_QueryDetails.default,{query:e})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_QueryActions.default,{query:e,setSelectedQuery:t})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerText,children:"Data Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.contentView,children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerText,children:"Query Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.contentView,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Query",value:e,defaultExpanded:["Query","queryKey"],activeQuery:e})})]})]})}const styles=_reactNative.StyleSheet.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:_sharedUi.night.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:_sharedUi.night.color.surface,borderRadius:12,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:16}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryInformation;var _QueryDetails=_interopRequireDefault(require("./QueryDetails"));var _QueryActions=_interopRequireDefault(require("./QueryActions"));var _Explorer=_interopRequireDefault(require("./Explorer"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function QueryInformation({selectedQuery:e,setSelectedQuery:t}){return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools query info scroll",style:styles.flexOne,contentContainerStyle:styles.scrollContent,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_QueryDetails.default,{query:e})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_QueryActions.default,{query:e,setSelectedQuery:t})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerText,children:"Data Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.contentView,children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerText,children:"Query Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.contentView,children:(0,_jsxRuntime.jsx)(_Explorer.default,{label:"Query",value:e,defaultExpanded:["Query","queryKey"],activeQuery:e})})]})]})}const styles=_reactNative.StyleSheet.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:_sharedUi.night.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:_sharedUi.night.color.surface,borderRadius:12,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:16}});
@@ -1 +1 @@
1
- "use strict";import{View as a,Text as m,StyleSheet as C,ScrollView as w}from"react-native";import{useQueryClient as h}from"@tanstack/react-query";import{useSafeAreaInsets as y,night as o,monoFont as f}from"@buoy-gg/shared-ui";import D from"./query-browser/Explorer";import q from"./query-browser/QueryDetails";import g from"./query-browser/ActionButton";import{getQueryStatusLabel as S}from"../utils/getQueryStatusLabel";import{useActionButtons as b}from"../hooks/useActionButtons";import{DataViewer as B}from"@buoy-gg/shared-ui/dataViewer";import{jsx as t,jsxs as c,Fragment as E}from"react/jsx-runtime";export function DataEditorMode({selectedQuery:r,isFloatingMode:i,disableInternalFooter:n=false,queryVersion:s}){const p=y({minBottom:16});const u=h();const l=b(r,u,s);return c(E,{children:[c(w,{testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:e.explorerScrollContainer,contentContainerStyle:[e.explorerScrollContent,!n&&{paddingBottom:72}],children:[c(a,{style:e.section,children:[t(v,{visible:!!r.state.data,selectedQuery:r,queryVersion:s}),t(T,{visible:!r.state.data,selectedQuery:r})]}),t(a,{style:e.section,children:t(q,{query:r})}),t(a,{style:e.section,children:c(a,{style:e.queryExplorerContainer,children:[t(m,{testID:"buoy-rq-query-explorer-header",style:e.queryExplorerHeader,children:"Query Explorer"}),t(a,{style:e.queryExplorerContent,children:t(B,{title:"",data:r,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!n&&t(a,{style:[e.actionFooter,{paddingBottom:i?0:p.bottom+8}],children:t(a,{style:e.actionsRow,children:l.map((d,x)=>t(g,{testID:`buoy-rq-action-${d.variant}`,onClick:d.onPress,text:d.label,variant:d.variant,disabled:d.disabled},x))})})]})}export function DataEditorActionsFooter({selectedQuery:r,isFloatingMode:i,queryVersion:n}){const s=y({minBottom:16});const p=h();const u=b(r,p,n);return t(a,{style:[e.actionFooter,{paddingBottom:i?0:s.bottom+8}],children:t(a,{style:e.actionsRow,children:u.map((l,d)=>t(g,{testID:`buoy-rq-action-${l.variant}`,onClick:l.onPress,text:l.label,variant:l.variant,disabled:l.disabled},d))})})}function v({visible:r,selectedQuery:i,queryVersion:n=0}){if(!r)return null;return c(a,{style:e.dataContainer,children:[t(m,{testID:"buoy-rq-data-header",style:e.dataHeader,children:"Data Editor"}),t(a,{style:e.dataContent,children:t(D,{editable:true,label:"Data",value:i.state.data,defaultExpanded:["Data"],activeQuery:i,dataVersion:n})})]})}function T({visible:r,selectedQuery:i}){if(!r)return null;const n=()=>{if(i.isDisabled()){return{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}}if(i.state.status==="pending"||S(i)==="fetching"){return{title:i.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}}if(i.state.status==="error"){return{title:"Query Error",description:i.state.error?.message||"An error occurred while fetching data."}}return{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."}};const{title:s,description:p}=n();return c(a,{style:e.emptyState,children:[t(m,{testID:"buoy-rq-detail-empty-title",style:e.emptyTitle,children:s}),t(m,{testID:"buoy-rq-detail-empty-description",style:e.emptyDescription,children:p})]})}const e=C.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:o.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:o.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:o.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:o.color.surface,borderRadius:6,borderWidth:1,borderColor:o.color.accent+"4D",overflow:"hidden",shadowColor:o.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:o.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:o.color.accent,borderBottomWidth:1,borderBottomColor:o.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:f},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:o.color.surface,borderRadius:6,borderWidth:1,borderColor:o.color.accent+"4D",overflow:"hidden",shadowColor:o.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:o.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:o.color.accent,borderBottomWidth:1,borderBottomColor:o.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:f},dataContent:{padding:8}});
1
+ "use strict";import{View as i,Text as u,StyleSheet as C,ScrollView as w}from"react-native";import{useQueryClient as h}from"@tanstack/react-query";import{useSafeAreaInsets as y,night as o,monoFont as f}from"@buoy-gg/shared-ui";import D from"./query-browser/Explorer";import q from"./query-browser/QueryDetails";import g from"./query-browser/ActionButton";import{getQueryStatusLabel as S}from"../utils/getQueryStatusLabel";import{useActionButtons as b}from"../hooks/useActionButtons";import{DataViewer as B}from"@buoy-gg/shared-ui/dataViewer";import{jsx as t,jsxs as c,Fragment as E}from"react/jsx-runtime";export function DataEditorMode({selectedQuery:r,isFloatingMode:a,disableInternalFooter:n=false,queryVersion:s}){const p=y({minBottom:16});const m=h();const l=b(r,m,s);return c(E,{children:[c(w,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:e.explorerScrollContainer,contentContainerStyle:[e.explorerScrollContent,!n&&{paddingBottom:72}],children:[c(i,{style:e.section,children:[t(T,{visible:!!r.state.data,selectedQuery:r,queryVersion:s}),t(v,{visible:!r.state.data,selectedQuery:r})]}),t(i,{style:e.section,children:t(q,{query:r})}),t(i,{style:e.section,children:c(i,{style:e.queryExplorerContainer,children:[t(u,{testID:"buoy-rq-query-explorer-header",style:e.queryExplorerHeader,children:"Query Explorer"}),t(i,{style:e.queryExplorerContent,children:t(B,{title:"",data:r,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!n&&t(i,{style:[e.actionFooter,{paddingBottom:a?0:p.bottom+8}],children:t(i,{style:e.actionsRow,children:l.map((d,x)=>t(g,{testID:`buoy-rq-action-${d.variant}`,onClick:d.onPress,text:d.label,variant:d.variant,disabled:d.disabled},x))})})]})}export function DataEditorActionsFooter({selectedQuery:r,isFloatingMode:a,queryVersion:n}){const s=y({minBottom:16});const p=h();const m=b(r,p,n);return t(i,{style:[e.actionFooter,{paddingBottom:a?0:s.bottom+8}],children:t(i,{style:e.actionsRow,children:m.map((l,d)=>t(g,{testID:`buoy-rq-action-${l.variant}`,onClick:l.onPress,text:l.label,variant:l.variant,disabled:l.disabled},d))})})}function T({visible:r,selectedQuery:a,queryVersion:n=0}){if(!r)return null;return c(i,{style:e.dataContainer,children:[t(u,{testID:"buoy-rq-data-header",style:e.dataHeader,children:"Data Editor"}),t(i,{style:e.dataContent,children:t(D,{editable:true,label:"Data",value:a.state.data,defaultExpanded:["Data"],activeQuery:a,dataVersion:n})})]})}function v({visible:r,selectedQuery:a}){if(!r)return null;const n=()=>{if(a.isDisabled()){return{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}}if(a.state.status==="pending"||S(a)==="fetching"){return{title:a.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}}if(a.state.status==="error"){return{title:"Query Error",description:a.state.error?.message||"An error occurred while fetching data."}}return{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."}};const{title:s,description:p}=n();return c(i,{style:e.emptyState,children:[t(u,{testID:"buoy-rq-detail-empty-title",style:e.emptyTitle,children:s}),t(u,{testID:"buoy-rq-detail-empty-description",style:e.emptyDescription,children:p})]})}const e=C.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:o.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:o.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:o.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:o.color.surface,borderRadius:6,borderWidth:1,borderColor:o.color.accent+"4D",overflow:"hidden",shadowColor:o.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:o.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:o.color.accent,borderBottomWidth:1,borderBottomColor:o.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:f},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:o.color.surface,borderRadius:6,borderWidth:1,borderColor:o.color.accent+"4D",overflow:"hidden",shadowColor:o.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:o.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:o.color.accent,borderBottomWidth:1,borderBottomColor:o.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:f},dataContent:{padding:8}});
@@ -1 +1 @@
1
- "use strict";import{View as n,Text as s,StyleSheet as u,ScrollView as h}from"react-native";import{useSafeAreaInsets as f,night as e,monoFont as p}from"@buoy-gg/shared-ui";import y from"./query-browser/Explorer";import g from"./query-browser/MutationDetails";import b from"./query-browser/ActionButton";import{useMutationActionButtons as x}from"../hooks/useMutationActionButtons";import{DataViewer as C}from"@buoy-gg/shared-ui/dataViewer";import{jsx as t,jsxs as l,Fragment as w}from"react/jsx-runtime";export function MutationEditorMode({selectedMutation:r,isFloatingMode:i,disableInternalFooter:d=false}){return l(w,{children:[l(h,{testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:o.explorerScrollContainer,contentContainerStyle:o.explorerScrollContent,children:[l(n,{style:o.section,children:[t(S,{visible:!!r.state.data,selectedMutation:r}),t(D,{visible:!r.state.data,selectedMutation:r})]}),t(n,{style:o.section,children:t(g,{selectedMutation:r})}),t(n,{style:o.section,children:l(n,{style:o.mutationExplorerContainer,children:[t(s,{style:o.mutationExplorerHeader,children:"Mutation Explorer"}),t(n,{style:o.mutationExplorerContent,children:t(C,{title:"",data:r,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!d&&t(MutationEditorActionsFooter,{selectedMutation:r,isFloatingMode:i})]})}export function MutationEditorActionsFooter({selectedMutation:r,isFloatingMode:i}){const d=f({minBottom:16});const c=x(r);return t(n,{style:[o.actionFooter,{paddingBottom:i?0:d.bottom+8}],children:t(n,{style:o.actionsGrid,children:c.map((a,m)=>t(b,{testID:`buoy-rq-action-${a.variant}`,onClick:a.onPress,text:a.label,variant:a.variant,disabled:a.disabled},m))})})}function S({visible:r,selectedMutation:i}){if(!r)return null;return l(n,{style:o.dataContainer,children:[t(s,{style:o.dataHeader,children:"Data Editor"}),t(n,{style:o.dataContent,children:t(y,{editable:true,label:"Data",value:i.state.data,defaultExpanded:["Data"]},i.mutationId)})]})}function D({visible:r,selectedMutation:i}){if(!r)return null;const d=()=>{if(i.state.status==="pending"){return{title:"Pending...",description:"The mutation is in progress."}}if(i.state.status==="error"){return{title:"Mutation Error",description:i.state.error?.message||"An error occurred."}}return{title:"No Data Available",description:"This mutation has no data."}};const{title:c,description:a}=d();return l(n,{style:o.emptyState,children:[t(s,{testID:"buoy-rq-mutation-detail-empty-title",style:o.emptyTitle,children:c}),t(s,{testID:"buoy-rq-mutation-detail-empty-description",style:o.emptyDescription,children:a})]})}const o=u.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:e.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:e.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:e.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:e.color.surface,borderRadius:6,borderWidth:1,borderColor:e.color.accent+"4D",overflow:"hidden",shadowColor:e.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:e.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:e.color.accent,borderBottomWidth:1,borderBottomColor:e.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:p},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:e.color.surface,borderRadius:6,borderWidth:1,borderColor:e.color.accent+"4D",overflow:"hidden",shadowColor:e.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:e.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:e.color.accent,borderBottomWidth:1,borderBottomColor:e.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:p},dataContent:{padding:8}});
1
+ "use strict";import{View as n,Text as s,StyleSheet as u,ScrollView as h}from"react-native";import{useSafeAreaInsets as f,night as e,monoFont as p}from"@buoy-gg/shared-ui";import y from"./query-browser/Explorer";import g from"./query-browser/MutationDetails";import b from"./query-browser/ActionButton";import{useMutationActionButtons as x}from"../hooks/useMutationActionButtons";import{DataViewer as C}from"@buoy-gg/shared-ui/dataViewer";import{jsx as t,jsxs as l,Fragment as w}from"react/jsx-runtime";export function MutationEditorMode({selectedMutation:r,isFloatingMode:i,disableInternalFooter:d=false}){return l(w,{children:[l(h,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:o.explorerScrollContainer,contentContainerStyle:o.explorerScrollContent,children:[l(n,{style:o.section,children:[t(S,{visible:!!r.state.data,selectedMutation:r}),t(D,{visible:!r.state.data,selectedMutation:r})]}),t(n,{style:o.section,children:t(g,{selectedMutation:r})}),t(n,{style:o.section,children:l(n,{style:o.mutationExplorerContainer,children:[t(s,{style:o.mutationExplorerHeader,children:"Mutation Explorer"}),t(n,{style:o.mutationExplorerContent,children:t(C,{title:"",data:r,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!d&&t(MutationEditorActionsFooter,{selectedMutation:r,isFloatingMode:i})]})}export function MutationEditorActionsFooter({selectedMutation:r,isFloatingMode:i}){const d=f({minBottom:16});const c=x(r);return t(n,{style:[o.actionFooter,{paddingBottom:i?0:d.bottom+8}],children:t(n,{style:o.actionsGrid,children:c.map((a,m)=>t(b,{testID:`buoy-rq-action-${a.variant}`,onClick:a.onPress,text:a.label,variant:a.variant,disabled:a.disabled},m))})})}function S({visible:r,selectedMutation:i}){if(!r)return null;return l(n,{style:o.dataContainer,children:[t(s,{style:o.dataHeader,children:"Data Editor"}),t(n,{style:o.dataContent,children:t(y,{editable:true,label:"Data",value:i.state.data,defaultExpanded:["Data"]},i.mutationId)})]})}function D({visible:r,selectedMutation:i}){if(!r)return null;const d=()=>{if(i.state.status==="pending"){return{title:"Pending...",description:"The mutation is in progress."}}if(i.state.status==="error"){return{title:"Mutation Error",description:i.state.error?.message||"An error occurred."}}return{title:"No Data Available",description:"This mutation has no data."}};const{title:c,description:a}=d();return l(n,{style:o.emptyState,children:[t(s,{testID:"buoy-rq-mutation-detail-empty-title",style:o.emptyTitle,children:c}),t(s,{testID:"buoy-rq-mutation-detail-empty-description",style:o.emptyDescription,children:a})]})}const o=u.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:e.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:e.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:e.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:e.color.surface,borderRadius:6,borderWidth:1,borderColor:e.color.accent+"4D",overflow:"hidden",shadowColor:e.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:e.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:e.color.accent,borderBottomWidth:1,borderBottomColor:e.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:p},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:e.color.surface,borderRadius:6,borderWidth:1,borderColor:e.color.accent+"4D",overflow:"hidden",shadowColor:e.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:e.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:e.color.accent,borderBottomWidth:1,borderBottomColor:e.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:p},dataContent:{padding:8}});
@@ -1 +1 @@
1
- "use strict";import{View as s,Text as l,StyleSheet as p,TouchableOpacity as C,Modal as x,ScrollView as S,Pressable as w}from"react-native";import{getQueryStatusColor as F}from"../utils/getQueryStatusColor";import{QueryDebugInfo as Q}from"./QueryDebugInfo";import{jsx as r,jsxs as o}from"react/jsx-runtime";export function QuerySelector({queries:i,selectedQuery:y,isOpen:d,onClose:a,onSelect:u}){const g=t=>{return Array.isArray(t.queryKey)?t.queryKey.join(" - "):String(t.queryKey)};return r(x,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:d,transparent:true,animationType:"fade",onRequestClose:a,children:r(w,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:e.modalOverlay,onPress:a,children:o(s,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:e.modalContent,children:[o(s,{style:e.modalHeader,children:[r(l,{style:e.modalTitle,children:"Select Query"}),o(l,{style:e.modalSubtitle,children:[i.length," ",i.length===1?"query":"queries"," ","available"]})]}),r(S,{accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:e.scrollView,contentContainerStyle:e.scrollViewContent,showsVerticalScrollIndicator:true,children:i.length===0?o(s,{style:e.emptyState,children:[r(l,{style:e.emptyTitle,children:"No Queries Found"}),o(l,{style:e.emptyDescription,children:["No React Query queries are currently active.","\n\n","To see queries here:","\n","\u2022 Make API calls using useQuery","\n","\u2022 Ensure queries are within QueryClientProvider","\n","\u2022 Check console for debugging info"]}),r(Q,{})]}):i.map((t,b)=>{const n=g(t);const m=F({queryState:t.state,observerCount:t.getObserversCount(),isStale:t.isStale()});const h={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"};const f=h[m]||"#6B7280";const c=t===y;return o(C,{accessibilityLabel:`Query ${n}`,accessibilityHint:`View query ${n}`,"sentry-label":`ignore query ${n}`,style:[e.queryItem,c&&e.selectedQueryItem],onPress:()=>u(t),children:[r(s,{style:[e.statusDot,{backgroundColor:f}]}),r(l,{style:[e.queryText,c&&e.selectedQueryText],numberOfLines:1,children:n})]},`${t.queryHash}-${b}`)})})]})})})}const e=p.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},modalContent:{backgroundColor:"#1F1F1F",borderRadius:8,width:"80%",maxHeight:"80%",minHeight:"50%",borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",flex:0},modalHeader:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},modalTitle:{color:"#FFFFFF",fontSize:16,fontWeight:"600",marginBottom:4},modalSubtitle:{color:"#9CA3AF",fontSize:12},scrollView:{flex:1},scrollViewContent:{padding:8,flexGrow:1},emptyState:{padding:32,alignItems:"center",justifyContent:"center"},emptyTitle:{color:"#E5E7EB",fontSize:16,fontWeight:"500",marginBottom:8,textAlign:"center"},emptyDescription:{color:"#9CA3AF",fontSize:14,textAlign:"center",lineHeight:20},queryItem:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:4},selectedQueryItem:{backgroundColor:"rgba(255, 255, 255, 0.1)"},statusDot:{width:8,height:8,borderRadius:4,marginRight:8},queryText:{color:"#E5E7EB",fontSize:14,flex:1},selectedQueryText:{color:"#FFFFFF",fontWeight:"500"},trigger:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:4,paddingHorizontal:8,paddingVertical:6,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",minWidth:120,maxWidth:200},triggerText:{color:"#E5E7EB",fontSize:12,flex:1,marginHorizontal:6}});
1
+ "use strict";import{View as s,Text as l,StyleSheet as p,TouchableOpacity as C,Modal as S,ScrollView as x,Pressable as w}from"react-native";import{getQueryStatusColor as F}from"../utils/getQueryStatusColor";import{QueryDebugInfo as Q}from"./QueryDebugInfo";import{jsx as r,jsxs as o}from"react/jsx-runtime";export function QuerySelector({queries:i,selectedQuery:y,isOpen:d,onClose:a,onSelect:u}){const g=t=>{return Array.isArray(t.queryKey)?t.queryKey.join(" - "):String(t.queryKey)};return r(S,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:d,transparent:true,animationType:"fade",onRequestClose:a,children:r(w,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:e.modalOverlay,onPress:a,children:o(s,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:e.modalContent,children:[o(s,{style:e.modalHeader,children:[r(l,{style:e.modalTitle,children:"Select Query"}),o(l,{style:e.modalSubtitle,children:[i.length," ",i.length===1?"query":"queries"," ","available"]})]}),r(x,{keyboardShouldPersistTaps:"handled",accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:e.scrollView,contentContainerStyle:e.scrollViewContent,showsVerticalScrollIndicator:true,children:i.length===0?o(s,{style:e.emptyState,children:[r(l,{style:e.emptyTitle,children:"No Queries Found"}),o(l,{style:e.emptyDescription,children:["No React Query queries are currently active.","\n\n","To see queries here:","\n","\u2022 Make API calls using useQuery","\n","\u2022 Ensure queries are within QueryClientProvider","\n","\u2022 Check console for debugging info"]}),r(Q,{})]}):i.map((t,b)=>{const n=g(t);const m=F({queryState:t.state,observerCount:t.getObserversCount(),isStale:t.isStale()});const h={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"};const f=h[m]||"#6B7280";const c=t===y;return o(C,{accessibilityLabel:`Query ${n}`,accessibilityHint:`View query ${n}`,"sentry-label":`ignore query ${n}`,style:[e.queryItem,c&&e.selectedQueryItem],onPress:()=>u(t),children:[r(s,{style:[e.statusDot,{backgroundColor:f}]}),r(l,{style:[e.queryText,c&&e.selectedQueryText],numberOfLines:1,children:n})]},`${t.queryHash}-${b}`)})})]})})})}const e=p.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},modalContent:{backgroundColor:"#1F1F1F",borderRadius:8,width:"80%",maxHeight:"80%",minHeight:"50%",borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",flex:0},modalHeader:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},modalTitle:{color:"#FFFFFF",fontSize:16,fontWeight:"600",marginBottom:4},modalSubtitle:{color:"#9CA3AF",fontSize:12},scrollView:{flex:1},scrollViewContent:{padding:8,flexGrow:1},emptyState:{padding:32,alignItems:"center",justifyContent:"center"},emptyTitle:{color:"#E5E7EB",fontSize:16,fontWeight:"500",marginBottom:8,textAlign:"center"},emptyDescription:{color:"#9CA3AF",fontSize:14,textAlign:"center",lineHeight:20},queryItem:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:4},selectedQueryItem:{backgroundColor:"rgba(255, 255, 255, 0.1)"},statusDot:{width:8,height:8,borderRadius:4,marginRight:8},queryText:{color:"#E5E7EB",fontSize:14,flex:1},selectedQueryText:{color:"#FFFFFF",fontWeight:"500"},trigger:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:4,paddingHorizontal:8,paddingVertical:6,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",minWidth:120,maxWidth:200},triggerText:{color:"#E5E7EB",fontSize:12,flex:1,marginHorizontal:6}});
@@ -1 +1 @@
1
- "use strict";import n from"./Explorer";import{ScrollView as d,Text as i,View as o,StyleSheet as s}from"react-native";import c from"./MutationDetails";import{night as l,monoFont as p}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as a}from"react/jsx-runtime";export default function x({selectedMutation:r}){return a(d,{"sentry-label":"ignore devtools mutation information scroll",style:t.flex1,contentContainerStyle:t.scrollContent,children:[e(o,{style:t.section,children:e(c,{selectedMutation:r})}),a(o,{style:t.section,children:[e(i,{style:t.textHeader,children:"Variables Details"}),e(o,{style:t.padding,children:e(n,{label:"Variables",value:r?.state.variables,defaultExpanded:["Variables"]})})]}),a(o,{style:t.section,children:[e(i,{style:t.textHeader,children:"Context Details"}),e(o,{style:t.padding,children:e(n,{label:"Context",value:r?.state.context,defaultExpanded:["Context"]})})]}),a(o,{style:t.section,children:[e(i,{style:t.textHeader,children:"Data Explorer"}),e(o,{style:t.padding,children:e(n,{label:"Data",defaultExpanded:["Data"],value:r?.state.data})})]}),a(o,{style:t.section,children:[e(i,{style:t.textHeader,children:"Mutations Explorer"}),e(o,{style:t.padding,children:e(n,{label:"Mutation",defaultExpanded:["Mutation"],value:r})})]})]})}const t=s.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:l.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:l.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:l.color.accent+"33",fontFamily:p,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:l.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:l.color.border,borderTopWidth:0}});
1
+ "use strict";import n from"./Explorer";import{ScrollView as i,Text as d,View as o,StyleSheet as s}from"react-native";import c from"./MutationDetails";import{night as a,monoFont as p}from"@buoy-gg/shared-ui";import{jsx as t,jsxs as l}from"react/jsx-runtime";export default function x({selectedMutation:r}){return l(i,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools mutation information scroll",style:e.flex1,contentContainerStyle:e.scrollContent,children:[t(o,{style:e.section,children:t(c,{selectedMutation:r})}),l(o,{style:e.section,children:[t(d,{style:e.textHeader,children:"Variables Details"}),t(o,{style:e.padding,children:t(n,{label:"Variables",value:r?.state.variables,defaultExpanded:["Variables"]})})]}),l(o,{style:e.section,children:[t(d,{style:e.textHeader,children:"Context Details"}),t(o,{style:e.padding,children:t(n,{label:"Context",value:r?.state.context,defaultExpanded:["Context"]})})]}),l(o,{style:e.section,children:[t(d,{style:e.textHeader,children:"Data Explorer"}),t(o,{style:e.padding,children:t(n,{label:"Data",defaultExpanded:["Data"],value:r?.state.data})})]}),l(o,{style:e.section,children:[t(d,{style:e.textHeader,children:"Mutations Explorer"}),t(o,{style:e.padding,children:t(n,{label:"Mutation",defaultExpanded:["Mutation"],value:r})})]})]})}const e=s.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:a.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:a.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:a.color.accent+"33",fontFamily:p,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:a.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:a.color.border,borderTopWidth:0}});
@@ -1 +1 @@
1
- "use strict";import{useState as E,useRef as g,useMemo as L,useCallback as T}from"react";import{View as d,StyleSheet as v,PanResponder as B,Animated as y,Dimensions as W,FlatList as $}from"react-native";import D from"./MutationButton";import N from"./MutationInformation";import _ from"../../hooks/useAllMutations";import{night as r,ToolEmptyState as z,monoFont as q}from"@buoy-gg/shared-ui";import{jsx as n,jsxs as H}from"react/jsx-runtime";export default function K({selectedMutation:c,setSelectedMutation:b,activeFilter:s,hideInfoPanel:R=false,contentContainerStyle:S,searchText:m=""}){const{mutations:C}=_();const k=t=>{if(t.state.isPaused)return"paused";const e=t.state.status;return e};const I=L(()=>{let t=C;if(s){t=t.filter(e=>{const o=k(e);return o===s})}if(m){const e=m.toLowerCase();t=t.filter(o=>{const l=o.options.mutationKey;if(!l)return false;const V=Array.isArray(l)?l:[l];const j=V.filter(h=>h!=null).map(h=>String(h)).join(" ").toLowerCase();return j.includes(e)})}return t},[C,s,m]);const M=W.get("window").height;const f=M*.4;const x=150;const w=M*.7;const i=g(new y.Value(f)).current;const[,p]=E(f);const u=g(f);const P=g(B.create({onMoveShouldSetPanResponder:(t,e)=>{return Math.abs(e.dy)>Math.abs(e.dx)&&Math.abs(e.dy)>10},onPanResponderGrant:()=>{i.stopAnimation(t=>{p(t);u.current=t;i.setValue(t)})},onPanResponderMove:(t,e)=>{const o=u.current-e.dy;const l=Math.max(x,Math.min(w,o));i.setValue(l)},onPanResponderRelease:(t,e)=>{const o=Math.max(x,Math.min(w,u.current-e.dy));p(o);u.current=o;y.timing(i,{toValue:o,duration:200,useNativeDriver:false}).start(()=>{i.setValue(o);p(o);u.current=o})}})).current;const A=T(({item:t})=>n(D,{selected:c,setSelectedMutation:b,mutation:t}),[c,b]);return H(d,{style:a.container,children:[I.length>0?n(d,{style:a.listWrapper,children:n($,{"sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:I,renderItem:A,keyExtractor:(t,e)=>`${t.mutationId}-${t.state.submittedAt}-${t.state.status}-${e}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:S||a.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):n(z,{testID:"buoy-rq-mutations-empty",otto:s?"filtering":"scanning",title:"No mutations found",message:s?`No ${s} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),c&&!R&&H(y.View,{style:[a.mutationInfo,{height:i}],children:[n(d,{style:a.dragHandle,...P.panHandlers,children:n(d,{style:a.dragIndicator})}),n(d,{style:a.mutationInfoContent,children:n(N,{selectedMutation:c})})]})]})}const a=v.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:r.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:r.color.surface,borderBottomWidth:1,borderBottomColor:r.color.border},dragIndicator:{width:40,height:4,backgroundColor:r.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:r.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:r.color.border},emptyText:{color:r.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:q,letterSpacing:.5}});
1
+ "use strict";import{useState as T,useRef as g,useMemo as E,useCallback as L}from"react";import{View as d,StyleSheet as v,PanResponder as B,Animated as y,Dimensions as W,FlatList as $}from"react-native";import D from"./MutationButton";import N from"./MutationInformation";import _ from"../../hooks/useAllMutations";import{night as r,ToolEmptyState as z,monoFont as q}from"@buoy-gg/shared-ui";import{jsx as n,jsxs as H}from"react/jsx-runtime";export default function K({selectedMutation:c,setSelectedMutation:b,activeFilter:s,hideInfoPanel:S=false,contentContainerStyle:k,searchText:m=""}){const{mutations:C}=_();const R=t=>{if(t.state.isPaused)return"paused";const e=t.state.status;return e};const I=E(()=>{let t=C;if(s){t=t.filter(e=>{const o=R(e);return o===s})}if(m){const e=m.toLowerCase();t=t.filter(o=>{const l=o.options.mutationKey;if(!l)return false;const V=Array.isArray(l)?l:[l];const j=V.filter(h=>h!=null).map(h=>String(h)).join(" ").toLowerCase();return j.includes(e)})}return t},[C,s,m]);const M=W.get("window").height;const f=M*.4;const x=150;const w=M*.7;const i=g(new y.Value(f)).current;const[,p]=T(f);const u=g(f);const P=g(B.create({onMoveShouldSetPanResponder:(t,e)=>{return Math.abs(e.dy)>Math.abs(e.dx)&&Math.abs(e.dy)>10},onPanResponderGrant:()=>{i.stopAnimation(t=>{p(t);u.current=t;i.setValue(t)})},onPanResponderMove:(t,e)=>{const o=u.current-e.dy;const l=Math.max(x,Math.min(w,o));i.setValue(l)},onPanResponderRelease:(t,e)=>{const o=Math.max(x,Math.min(w,u.current-e.dy));p(o);u.current=o;y.timing(i,{toValue:o,duration:200,useNativeDriver:false}).start(()=>{i.setValue(o);p(o);u.current=o})}})).current;const A=L(({item:t})=>n(D,{selected:c,setSelectedMutation:b,mutation:t}),[c,b]);return H(d,{style:a.container,children:[I.length>0?n(d,{style:a.listWrapper,children:n($,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:I,renderItem:A,keyExtractor:(t,e)=>`${t.mutationId}-${t.state.submittedAt}-${t.state.status}-${e}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:k||a.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):n(z,{testID:"buoy-rq-mutations-empty",otto:s?"filtering":"scanning",title:"No mutations found",message:s?`No ${s} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),c&&!S&&H(y.View,{style:[a.mutationInfo,{height:i}],children:[n(d,{style:a.dragHandle,...P.panHandlers,children:n(d,{style:a.dragIndicator})}),n(d,{style:a.mutationInfoContent,children:n(N,{selectedMutation:c})})]})]})}const a=v.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:r.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:r.color.surface,borderBottomWidth:1,borderBottomColor:r.color.border},dragIndicator:{width:40,height:4,backgroundColor:r.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:r.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:r.color.border},emptyText:{color:r.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:q,letterSpacing:.5}});
@@ -1 +1 @@
1
- "use strict";import{useMemo as K,useCallback as q}from"react";import{StyleSheet as k,FlatList as L}from"react-native";import x from"./QueryRow";import E from"../../hooks/useAllQueries";import{getQueryStatusLabel as j}from"../../utils/getQueryStatusLabel";import{night as c,ToolEmptyState as H,EVENT_LIST_PRESET as I,monoFont as T}from"@buoy-gg/shared-ui";import{jsx as m}from"react/jsx-runtime";export default function $({selectedQuery:s,onQuerySelect:i,activeFilter:n,emptyStateMessage:g,emptyState:C,contentContainerStyle:b,queries:h,searchText:u="",ignoredPatterns:l=new Set,includedPatterns:y=new Set}){const w=E();const d=h??w;const p=K(()=>{let e=d;if(n){e=e.filter(t=>{const o=j(t);return o===n})}if(u){const t=u.toLowerCase();e=e.filter(o=>{if(!o?.queryKey)return false;const a=Array.isArray(o.queryKey)?o.queryKey:[o.queryKey];const r=a.filter(f=>f!=null).map(f=>String(f)).join(" ").toLowerCase();return r.includes(t)})}if(y.size>0){e=e.filter(t=>{if(!t?.queryKey)return false;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const a=o.filter(r=>r!=null).map(r=>String(r)).join(" ").toLowerCase();return Array.from(y).some(r=>a.includes(r.toLowerCase()))})}if(l.size>0){e=e.filter(t=>{if(!t?.queryKey)return true;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const a=o.filter(r=>r!=null).map(r=>String(r)).join(" ").toLowerCase();return!Array.from(l).some(r=>a.includes(r.toLowerCase()))})}e.sort((t,o)=>{const a=t.state.dataUpdatedAt||0;const r=o.state.dataUpdatedAt||0;return r-a});return e},[d,n,u,y,l]);const A=q(e=>{const t=s?.queryHash===e.queryHash;if(t){i(void 0);return}i(e)},[s?.queryHash,i]);if(p.length===0){return m(H,{testID:"buoy-rq-empty",...C??{otto:"empty",title:"No queries found",message:g||(n?`No ${n} queries found`:"No queries found")}})}return m(L,{testID:"buoy-rq-query-list",style:S.listWrapper,contentContainerStyle:b||S.listContent,data:p,keyExtractor:Q,renderItem:({item:e})=>m(x,{query:e,stateSig:N(e),isSelected:s?.queryHash===e.queryHash,onSelect:A}),showsVerticalScrollIndicator:true,...I})}const Q=s=>s.queryHash;function N(s){let i=0;let n=false;try{i=s.getObserversCount();n=s.isStale()}catch{}return`${s.state.dataUpdatedAt}|${s.state.fetchStatus}|${s.state.status}|${i}|${n}`}const S=k.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:c.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:c.color.border},emptyText:{color:c.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:T,letterSpacing:.5}});
1
+ "use strict";import{useMemo as K,useCallback as k}from"react";import{StyleSheet as q,FlatList as L}from"react-native";import x from"./QueryRow";import E from"../../hooks/useAllQueries";import{getQueryStatusLabel as T}from"../../utils/getQueryStatusLabel";import{night as c,ToolEmptyState as j,EVENT_LIST_PRESET as H,monoFont as I}from"@buoy-gg/shared-ui";import{jsx as m}from"react/jsx-runtime";export default function $({selectedQuery:s,onQuerySelect:i,activeFilter:n,emptyStateMessage:g,emptyState:C,contentContainerStyle:h,queries:b,searchText:u="",ignoredPatterns:l=new Set,includedPatterns:y=new Set}){const w=E();const d=b??w;const p=K(()=>{let e=d;if(n){e=e.filter(t=>{const o=T(t);return o===n})}if(u){const t=u.toLowerCase();e=e.filter(o=>{if(!o?.queryKey)return false;const a=Array.isArray(o.queryKey)?o.queryKey:[o.queryKey];const r=a.filter(f=>f!=null).map(f=>String(f)).join(" ").toLowerCase();return r.includes(t)})}if(y.size>0){e=e.filter(t=>{if(!t?.queryKey)return false;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const a=o.filter(r=>r!=null).map(r=>String(r)).join(" ").toLowerCase();return Array.from(y).some(r=>a.includes(r.toLowerCase()))})}if(l.size>0){e=e.filter(t=>{if(!t?.queryKey)return true;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const a=o.filter(r=>r!=null).map(r=>String(r)).join(" ").toLowerCase();return!Array.from(l).some(r=>a.includes(r.toLowerCase()))})}e.sort((t,o)=>{const a=t.state.dataUpdatedAt||0;const r=o.state.dataUpdatedAt||0;return r-a});return e},[d,n,u,y,l]);const A=k(e=>{const t=s?.queryHash===e.queryHash;if(t){i(void 0);return}i(e)},[s?.queryHash,i]);if(p.length===0){return m(j,{testID:"buoy-rq-empty",...C??{otto:"empty",title:"No queries found",message:g||(n?`No ${n} queries found`:"No queries found")}})}return m(L,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-query-list",style:S.listWrapper,contentContainerStyle:h||S.listContent,data:p,keyExtractor:Q,renderItem:({item:e})=>m(x,{query:e,stateSig:N(e),isSelected:s?.queryHash===e.queryHash,onSelect:A}),showsVerticalScrollIndicator:true,...H})}const Q=s=>s.queryHash;function N(s){let i=0;let n=false;try{i=s.getObserversCount();n=s.isStale()}catch{}return`${s.state.dataUpdatedAt}|${s.state.fetchStatus}|${s.state.status}|${i}|${n}`}const S=q.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:c.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:c.color.border},emptyText:{color:c.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:I,letterSpacing:.5}});
@@ -1 +1 @@
1
- "use strict";import c from"./QueryDetails";import d from"./QueryActions";import i from"./Explorer";import{View as o,Text as a,ScrollView as y,StyleSheet as u}from"react-native";import{night as n}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as l}from"react/jsx-runtime";export default function f({selectedQuery:r,setSelectedQuery:s}){return l(y,{"sentry-label":"ignore devtools query info scroll",style:t.flexOne,contentContainerStyle:t.scrollContent,children:[e(o,{style:t.section,children:e(c,{query:r})}),e(o,{style:t.section,children:e(d,{query:r,setSelectedQuery:s})}),l(o,{style:t.section,children:[e(a,{style:t.headerText,children:"Data Explorer"}),e(o,{style:t.contentView,children:e(i,{editable:true,label:"Data",value:r?.state.data,defaultExpanded:["Data"],activeQuery:r})})]}),l(o,{style:t.section,children:[e(a,{style:t.headerText,children:"Query Explorer"}),e(o,{style:t.contentView,children:e(i,{label:"Query",value:r,defaultExpanded:["Query","queryKey"],activeQuery:r})})]})]})}const t=u.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:n.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:n.color.surface,borderRadius:12,borderWidth:1,borderColor:n.color.border,padding:16}});
1
+ "use strict";import d from"./QueryDetails";import c from"./QueryActions";import i from"./Explorer";import{View as o,Text as a,ScrollView as y,StyleSheet as u}from"react-native";import{night as l}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as n}from"react/jsx-runtime";export default function f({selectedQuery:r,setSelectedQuery:s}){return n(y,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools query info scroll",style:t.flexOne,contentContainerStyle:t.scrollContent,children:[e(o,{style:t.section,children:e(d,{query:r})}),e(o,{style:t.section,children:e(c,{query:r,setSelectedQuery:s})}),n(o,{style:t.section,children:[e(a,{style:t.headerText,children:"Data Explorer"}),e(o,{style:t.contentView,children:e(i,{editable:true,label:"Data",value:r?.state.data,defaultExpanded:["Data"],activeQuery:r})})]}),n(o,{style:t.section,children:[e(a,{style:t.headerText,children:"Query Explorer"}),e(o,{style:t.contentView,children:e(i,{label:"Query",value:r,defaultExpanded:["Query","queryKey"],activeQuery:r})})]})]})}const t=u.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:l.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:l.color.surface,borderRadius:12,borderWidth:1,borderColor:l.color.border,padding:16}});
package/lib/web/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- "use client";var qr=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var nn=Object.getOwnPropertyNames;var sn=Object.prototype.hasOwnProperty;var ln=(e,t)=>{for(var r in t)qr(e,r,{get:t[r],enumerable:true})},Mr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of nn(t))!sn.call(e,a)&&a!==r&&qr(e,a,{get:()=>t[a],enumerable:!(o=an(t,a))||o.enumerable});return e},un=(e,t,r)=>(Mr(e,t,"default"),r&&Mr(r,t,"default"));var zc=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import"@tanstack/react-query";import{QueryClientProvider as cn}from"@tanstack/react-query";import{QueryIcon as Tr}from"@buoy-gg/floating-tools-core/web";import{Wifi as Ar}from"@buoy-gg/shared-ui/web";import{useCallback as Fe,useState as tt,useEffect as dn}from"react";import{useQueryClient as yn}from"@tanstack/react-query";import{TickProvider as hn}from"@buoy-gg/shared-ui/web";import{useQueryClient as fn}from"@tanstack/react-query";import{JsModal as mn,useSafeAreaInsets as pn,ModalHeader as jt,TabSelector as gn}from"@buoy-gg/shared-ui/web";import{useEffect as bn,useState as vn,useRef as Sn}from"react";import{useQueryClient as Cn}from"@tanstack/react-query";function Er(e){let{query:t}=Wt(e);return t}function Wt(e){let t=Cn(),[r,o]=vn({query:void 0,version:0}),a=Sn(void 0);return bn(()=>{if(!e){o({query:void 0,version:0}),a.current=void 0;return}let n=t.getQueryCache().find({queryKey:e,exact:true});o({query:n,version:0});let l=JSON.stringify(e);a.current=l;let c=t.getQueryCache().subscribe(s=>{(s.type==="updated"||s.type==="added"||s.type==="removed")&&"query"in s&&s.query&&JSON.stringify(s.query.queryKey)===a.current&&(s.type==="removed"?o({query:void 0,version:0}):o(u=>({query:s.query,version:u.version+1})))});return()=>c()},[t,e]),r}import{ModalHeader as Pe,TabSelector as Rr,Search as xn,Filter as wn,Trash as qn,night as We}from"@buoy-gg/shared-ui/web";import{useState as Mn,useRef as Dr,useEffect as Tn}from"react";var kr={};ln(kr,{AccessibilityInfo:()=>Dn,ActivityIndicator:()=>Ai,Alert:()=>Di,Animated:()=>Z,AppRegistry:()=>In,AppState:()=>Qn,Appearance:()=>kn,BackHandler:()=>Fn,Button:()=>Ei,CheckBox:()=>_n,Clipboard:()=>Pn,DeviceEventEmitter:()=>ui,Dimensions:()=>Ir,Easing:()=>On,FlatList:()=>Vt,I18nManager:()=>zn,Image:()=>Jn,ImageBackground:()=>Gn,InteractionManager:()=>Ln,Keyboard:()=>Kn,KeyboardAvoidingView:()=>Yn,LayoutAnimation:()=>Bn,Linking:()=>Hn,LogBox:()=>li,Modal:()=>Lr,NativeEventEmitter:()=>jn,NativeModules:()=>Rn,PanResponder:()=>$t,Picker:()=>Xn,PixelRatio:()=>Wn,Platform:()=>$n,Pressable:()=>zr,ProgressBar:()=>Zn,RefreshControl:()=>ei,SafeAreaView:()=>ti,ScrollView:()=>be,SectionList:()=>ri,Share:()=>Vn,StatusBar:()=>oi,StyleSheet:()=>T,Switch:()=>Ti,Text:()=>v,TextInput:()=>wi,Touchable:()=>ai,TouchableHighlight:()=>qi,TouchableNativeFeedback:()=>ni,TouchableOpacity:()=>N,TouchableWithoutFeedback:()=>Mi,UIManager:()=>Nn,Vibration:()=>Un,View:()=>f,VirtualizedList:()=>ii,YellowBox:()=>si,findNodeHandle:()=>Ri,unstable_createElement:()=>En,useColorScheme:()=>ci,useLocaleContext:()=>di,useWindowDimensions:()=>yi});un(kr,An);import*as An from"react-native-web";import{unstable_createElement as En,NativeModules as Rn,AccessibilityInfo as Dn,Appearance as kn,AppRegistry as In,AppState as Qn,BackHandler as Fn,Clipboard as Pn,Dimensions as Ir,Easing as On,I18nManager as zn,Keyboard as Kn,InteractionManager as Ln,LayoutAnimation as Bn,Linking as Hn,NativeEventEmitter as jn,PanResponder as $t,PixelRatio as Wn,Platform as $n,Share as Vn,UIManager as Nn,Vibration as Un,CheckBox as _n,FlatList as Vt,Image as Jn,ImageBackground as Gn,KeyboardAvoidingView as Yn,Picker as Xn,ProgressBar as Zn,RefreshControl as ei,SafeAreaView as ti,SectionList as ri,StatusBar as oi,Touchable as ai,TouchableNativeFeedback as ni,VirtualizedList as ii,YellowBox as si,LogBox as li,DeviceEventEmitter as ui,useColorScheme as ci,useLocaleContext as di,useWindowDimensions as yi}from"react-native-web";import*as B from"react-native-web";import{createElement as Nt,forwardRef as Qr,useCallback as hi,useRef as fi}from"react";import{useEffect as mi,useState as pi}from"react";import{createPortal as gi}from"react-dom";var bi='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as vi}from"react/jsx-runtime";var rt=Symbol.for("@buoy-gg/portal-host"),Fr=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function Pr(){let e=document;if(e[rt])return e[rt].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:bi});let r=()=>{let i=document.fullscreenElement,d=i&&i.tagName!=="CANVAS"?i:document.body;t.parentElement!==d&&d.appendChild(t)},o=new Map,a=i=>{(!t.contains(i.target)||!Fr(i.target))&&o.set(i.code||i.key,{key:i.key,code:i.code,location:i.location,keyCode:i.keyCode,which:i.which,altKey:i.altKey,ctrlKey:i.ctrlKey,metaKey:i.metaKey,shiftKey:i.shiftKey})},n=i=>{o.delete(i.code||i.key)},l=()=>o.clear(),c=()=>{let i=[...o.values()];o.clear();for(let d of i)document.dispatchEvent(new KeyboardEvent("keyup",{...d,bubbles:true}))},s=i=>{Fr(i.target)&&i.stopPropagation()},u=i=>i.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",l),t.addEventListener("focusin",c),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",u,{passive:true}),e[rt]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",l),t.remove(),delete e[rt]}},t}function Si({children:e}){let[t,r]=pi(null);return mi(()=>{let o=Pr(),a=document[rt];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?gi(vi("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var $e=B,Ci=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Ve=e=>typeof e=="number"?`${e}px`:e;function Ut(e){if(Array.isArray(e)){let d=e.map(Ut);return d.some((h,g)=>h!==e[g])?d:e}if(!e||typeof e!="object"||!Ci.some(d=>e[d]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:l,textShadowRadius:c,...s}=e;if(t!=null||r!=null||o!=null||a!=null){let d=t??"black",h=o==null?d:`color-mix(in srgb, ${d} ${Math.min(o,1)*100}%, transparent)`,g=`${Ve(r?.width??0)} ${Ve(r?.height??0)} ${Ve(a??0)} ${h}`;s.boxShadow=typeof s.boxShadow=="string"?`${s.boxShadow}, ${g}`:s.boxShadow??g}let{width:u=0,height:i=0}=l??{};if(n&&(u||i||c)){let d=`${Ve(u)} ${Ve(i)} ${Ve(c??0)} ${n}`;s.textShadow=s.textShadow?`${s.textShadow}, ${d}`:d}return s}var xi=$e.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Or(e,t){if(typeof e=="function")return o=>Or(e(o),t);let r=Ut(e);return t?[r,xi[t]]:r}var T={...$e.StyleSheet,create:e=>$e.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Ut(r)])))};function V(e){let t=Qr((o,a)=>{let{accessibilityState:n,accessibilityValue:l,pointerEvents:c,...s}=o;for(let i of["busy","checked","disabled","expanded","selected"])n?.[i]!==void 0&&s[`aria-${i}`]===void 0&&(s[`aria-${i}`]=n[i]);for(let[i,d]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))l?.[i]!==void 0&&s[`aria-${d}`]===void 0&&(s[`aria-${d}`]=l[i]);let u=Or(s.style,c);return u!==s.style&&(s.style=u),Nt(e,{...s,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=V(B.View),v=V(B.Text),Z={...$e.Animated,View:$e.Animated.createAnimatedComponent(f),Text:$e.Animated.createAnimatedComponent(v)},wi=V(B.TextInput),N=V(B.TouchableOpacity),qi=V(B.TouchableHighlight),Mi=V(B.TouchableWithoutFeedback),zr=V(B.Pressable),be=V(B.ScrollView),Kr=Qr((e,t)=>{let r=fi(null),o=hi(a=>{if(a){let n=a;for(;n.parentElement&&n.parentElement!==document.body;)n=n.parentElement;n.parentElement===document.body&&(r.current=n,Object.assign(n.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Pr().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return Nt(Si,null,Nt(B.Modal,{...e,ref:o}))});Kr.displayName="Modal";var Lr=V(Kr),Ti=V(B.Switch),Ai=V(B.ActivityIndicator),Ei=V(B.Button),Ri=B.findNodeHandle,Di={alert(e,t,r,o){if(typeof document>"u")return;let a=document.createElement("dialog");a.dataset.buoyRoot="",a.setAttribute("aria-label",e),a.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",a.appendChild(n),t){let u=document.createElement("p");u.textContent=t,u.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",a.appendChild(u)}let l=document.createElement("div");l.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let c=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let u of c){let i=document.createElement("button");i.type="button",i.textContent=u.text??"OK",i.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,i.onclick=()=>{s(),u.onPress?.()},l.appendChild(i)}a.addEventListener("cancel",u=>{u.preventDefault(),o?.cancelable!==false&&(s(),o?.onDismiss?.())}),a.appendChild(l),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{Wifi as Br}from"@buoy-gg/shared-ui/web";import{useEffect as Hr,useState as ki,useRef as Ii}from"react";import{onlineManager as bt}from"@tanstack/react-query";import{devToolsStorageKeys as jr,persistentStorage as Wr}from"@buoy-gg/shared-ui/web";function $r(){let[e,t]=ki(()=>bt.isOnline()),r=Ii(false);Hr(()=>{if(r.current)return;(async()=>{try{let n=await Wr.getItem(jr.settings.wifiEnabled());if(n!==null){let l=n==="true";t(l),bt.setOnline(l)}r.current=true}catch{}})()},[]);let o=async n=>{try{await Wr.setItem(jr.settings.wifiEnabled(),n.toString())}catch{}},a=()=>{let n=!e;t(n),bt.setOnline(n),o(n)};return Hr(()=>bt.subscribe(n=>{t(n),r.current&&o(n)}),[]),{isOnline:e,handleWifiToggle:a}}import{jsx as _t}from"react/jsx-runtime";function Vr({size:e=16,testID:t}){let{isOnline:r,handleWifiToggle:o}=$r();return _t(N,{"sentry-label":`ignore toggle WiFi ${r?"On":"Off"}`,testID:t,accessibilityRole:"button",accessibilityLabel:`WiFi ${r?"On":"Off"}`,accessibilityHint:`Tap to turn WiFi ${r?"off":"on"} for React Query`,onPress:o,hitSlop:{top:10,bottom:10,left:10,right:10},activeOpacity:.7,style:{alignItems:"center",justifyContent:"center",width:14,flexShrink:0},children:r?_t(Br,{size:e,color:"#10B981"}):_t(Br,{size:e,color:"#DC2626"})})}import{jsx as H,jsxs as vt}from"react/jsx-runtime";function ot({selectedQuery:e,selectedMutation:t,activeTab:r,onTabChange:o,onBack:a,searchText:n="",onSearchChange:l,onFilterPress:c,hasActiveFilters:s=false,onClearCache:u,showWifiToggle:i=false}){let[d,h]=Mn(false),g=Dr(false),y=Dr(null);Tn(()=>{d&&y.current&&y.current.focus()},[d]);let m=()=>{h(!d),d&&l&&l("")},b=C=>{l&&l(C)},p=C=>C?.queryKey&&(Array.isArray(C.queryKey)?C.queryKey:[C.queryKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||"Unknown Query",S=C=>"queryKey"in C?p(C):C.options.mutationKey?(Array.isArray(C.options.mutationKey)?C.options.mutationKey:[C.options.mutationKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||`Mutation #${C.mutationId}`:`Mutation #${C.mutationId}`,w=[{key:"queries",label:"Queries"},{key:"mutations",label:"Mutations"}];return e||t?vt(Pe,{children:[H(Pe.Navigation,{onBack:a}),H(Pe.Content,{title:S(e??t),testID:"buoy-rq-detail-title"})]}):vt(Pe,{children:[H(Pe.Content,{title:"",noMargin:true,children:d?H(Pe.Search,{value:n,onChangeText:b,onCancel:()=>{b(""),h(false)},onDismiss:()=>h(false),dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search query keys...",accessibilityLabel:"Search queries and mutations",iconSize:14,testID:"buoy-rq-search",containerTestID:"buoy-rq-search-field",clearTestID:"buoy-rq-search-clear",inputProps:{"sentry-label":"ignore react query search header"}}):i?vt(f,{style:Oe.tabRow,children:[H(f,{style:Oe.tabSelectorWrap,children:H(Rr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>o(C)})}),H(Vr,{size:16,testID:"buoy-rq-wifi"})]}):H(Rr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>o(C)})}),vt(Pe.Actions,{children:[H(N,{"sentry-label":"ignore open search",testID:"buoy-rq-search-open",accessibilityRole:"button",accessibilityLabel:"Search queries and mutations",onPress:m,style:Oe.headerActionButton,children:H(xn,{size:14,color:We.color.textSecondary})}),c&&H(N,{"sentry-label":"ignore open filter",testID:"buoy-rq-filters",accessibilityRole:"button",accessibilityLabel:s?"Filters, active":"Filters",onPress:c,style:[Oe.headerActionButton,s&&Oe.activeFilterButton],children:H(wn,{size:14,color:s?We.color.accent:We.color.textSecondary})}),u&&H(N,{"sentry-label":"ignore clear cache",testID:"buoy-rq-clear-cache",accessibilityRole:"button",onPress:u,style:[Oe.headerActionButton,Oe.clearCacheButton],accessibilityLabel:`Clear ${r} cache`,children:H(qn,{size:14,color:We.color.warning})})]})]})}var Oe=T.create({tabRow:{flex:1,flexDirection:"row",alignItems:"center",gap:12},tabSelectorWrap:{flex:1},headerActionButton:{padding:6,borderRadius:4},activeFilterButton:{backgroundColor:We.color.accentSoft},clearCacheButton:{backgroundColor:We.color.warningSoft}});import{resolveListEmptyState as Qi}from"@buoy-gg/shared-ui/web";import{useMemo as Fi}from"react";import{useMemo as Pi}from"react";import{useQueryClient as Oi}from"@tanstack/react-query";var Ne=(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[a,...n]=t,l=o.get(a);return o.set(a,Ne(l??null,n,r)),o}if(e instanceof Set){let o=Ne(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[a,...n]=t;return o[a]=Ne(o[a],n,r),o}if(e instanceof Object){let o={...e};if(t.length===1)return o[t[0]]=r,o;let[a,...n]=t;return o[a]=Ne(o[a],n,r),o}return e};var Ue=(e,t)=>{if(e instanceof Map){let r=new Map(e);if(t.length===1)return r.delete(t[0]),r;let[o,...a]=t;return r.set(o,Ue(r.get(o),a)),r}if(e instanceof Set){let r=Ue(Array.from(e),t);return new Set(r)}if(Array.isArray(e)){let r=[...e];if(t.length===1)return r.filter((n,l)=>l.toString()!==t[0]);let[o,...a]=t;return r[o]=Ue(r[o],a),r}if(e instanceof Object){let r={...e};if(t.length===1)return delete r[t[0]],r;let[o,...a]=t;return r[o]=Ue(r[o],a),r}return e};function Nr({activeQuery:e,dataPath:t,queryClient:r}){if(!t)return;let o=e.state.data,a=Ue(o,t),n=JSON.parse(JSON.stringify(a));r.setQueryData(e.queryKey,n)}function Ur(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function _r(e){return(Array.isArray(e)?e:[e]).filter(t=>t!=null).map(Ur).filter(Boolean).join("-")||"unkeyed"}function zi(e){return`buoy-rq-query-row-${_r(e)}`}function Ki(e,t){return e==null?`buoy-rq-mutation-row-id-${t}`:`buoy-rq-mutation-row-${_r(e)}`}function Li(e){return e.length===0?"buoy-rq-explorer-root":`buoy-rq-explorer-${e.map(Ur).filter(Boolean).join("-")}`}import{LiveExplorer as Bi}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as Hi}from"react/jsx-runtime";function me({editable:e,label:t,value:r,defaultExpanded:o,activeQuery:a,dataPath:n,itemsDeletable:l,dataVersion:c=0}){let s=Oi(),u=Pi(()=>{if(a)return{update:(i,d)=>{let h=a.state.data,g=Ne(h,i,d);s.setQueryData(a.queryKey,g)},remove:i=>{Nr({queryClient:s,activeQuery:a,dataPath:i})}}},[s,a]);return Hi(Bi,{editable:e,label:t,value:r,defaultExpanded:o,writer:u,dataPath:n,itemsDeletable:l,dataVersion:c,testIDForPath:Li,debounceMs:0})}import{useMemo as ji,useCallback as Wi}from"react";import{memo as $i}from"react";function se(e){return e.isDisabled()?"disabled":e.state.fetchStatus==="fetching"?"fetching":e.state.status==="error"?"error":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}import{CompactRow as Vi,buoyColors as ve,useRelativeTime as Ni}from"@buoy-gg/shared-ui/web";import{jsx as Ui}from"react/jsx-runtime";var _i=e=>e?.queryKey&&(Array.isArray(e.queryKey)?e.queryKey:[e.queryKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Query",Ji=$i(function({query:e,isSelected:t,onSelect:r}){let o=g=>{switch(g){case"disabled":return ve.textMuted+"80";case"error":return ve.error;case"fresh":return ve.success;case"stale":return ve.warning;case"inactive":return ve.textMuted;case"fetching":return ve.primary;case"paused":return ve.textMuted;default:return ve.textSecondary}},a=se(e),n=e.getObserversCount(),l=e.isDisabled(),c=_i(e),s=(()=>{if(l)return null;if(e.state.dataUpdatedAt&&e.state.dataUpdatedAt>0)return e.state.dataUpdatedAt;let g=e.state;return g.fetchedAt&&g.fetchedAt>0?g.fetchedAt:null})(),u=Ni(s),i=l?"Disabled":u||"Never",d=zi(e.queryKey),h=`${n} observer${n!==1?"s":""}`;return Ui(Vi,{testID:d,statusTestID:`${d}-status`,statusSublabelTestID:`${d}-observers`,accessibilityLabel:`${c}, ${a}, ${h}`,statusDotColor:o(a),statusLabel:a.charAt(0).toUpperCase()+a.slice(1),statusSublabel:h,primaryText:c,bottomRightText:i,badgeText:n,badgeColor:o(a),isSelected:t,onPress:()=>r(e)})}),Jr=Ji;import{useEffect as Gi,useState as Yi,useRef as Gr,useMemo as Xi,useCallback as Yr}from"react";import{useQueryClient as Zi}from"@tanstack/react-query";import{buoyColors as St}from"@buoy-gg/shared-ui/web";var le={base:()=>["#storage"],mmkv:{root:()=>[...le.base(),"mmkv"],key:e=>[...le.mmkv.root(),e],all:()=>[...le.mmkv.root(),"all"]},async:{root:()=>[...le.base(),"async"],key:e=>[...le.async.root(),e],all:()=>[...le.async.root(),"all"]},secure:{root:()=>[...le.base(),"secure"],key:e=>[...le.secure.root(),e],all:()=>[...le.secure.root(),"all"]}};function Se(e){return!Array.isArray(e)||e.length===0?false:e[0]==="#storage"}function Xr(e){if(!Se(e)||e.length<2)return null;let t=e[1];return t==="mmkv"||t==="async"||t==="secure"?t:null}function Zr(e){switch(e){case"mmkv":return"MMKV";case"async":return"Async";case"secure":return"Secure";default:return e}}function eo(e){switch(e){case"mmkv":return"purple";case"async":return"blue";case"secure":return"green";default:return"gray"}}function es(e){switch(e){case"mmkv":return St.primary;case"async":return St.warning;case"secure":return St.success;default:return St.textMuted}}function to(e){return!Se(e)||e.length<3?"Unknown Storage Key":e.slice(2).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Storage Key"}var Ct=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,ts=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,ro=(e,t)=>Ct(e)===Ct(t)?ts(e,t):Ct(e)>Ct(t)?1:-1;function rs(){let e=Zi(),[t,r]=Yi(()=>e.getQueryCache().getAll().filter(c=>!Se(c.queryKey)).sort(ro)),o=Gr(new Map),a=Gr(void 0),n=Yr(c=>{let s=o.current;if(c.length!==s.size)return true;for(let u of c){let i=s.get(u.queryHash);if(!i||i.dataUpdatedAt!==u.state.dataUpdatedAt||i.errorUpdatedAt!==u.state.errorUpdatedAt||i.fetchStatus!==u.state.fetchStatus||i.status!==u.state.status||i.isInvalidated!==u.state.isInvalidated)return true}return false},[]),l=Yr(()=>{let c=e.getQueryCache().getAll().filter(s=>!Se(s.queryKey));if(n(c)){let s=new Map;c.forEach(i=>{s.set(i.queryHash,i.state)}),o.current=s;let u=[...c].sort(ro);r(u)}},[e,n]);return Gi(()=>{l();let c=e.getQueryCache().subscribe(s=>{if(s.type==="added"||s.type==="removed"||s.type==="updated"){if("query"in s&&s.query&&Se(s.query.queryKey))return;a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{l()},10)}});return()=>{c(),a.current&&clearTimeout(a.current)}},[e,l]),Xi(()=>t,[t])}var xt=rs;import{night as Jt,ToolEmptyState as os,EVENT_LIST_PRESET as as,monoFont as ns}from"@buoy-gg/shared-ui/web";import{jsx as Gt}from"react/jsx-runtime";function oo({selectedQuery:e,onQuerySelect:t,activeFilter:r,emptyStateMessage:o,emptyState:a,contentContainerStyle:n,queries:l,searchText:c="",ignoredPatterns:s=new Set,includedPatterns:u=new Set}){let i=xt(),d=l??i,h=ji(()=>{let y=d;if(r&&(y=y.filter(m=>se(m)===r)),c){let m=c.toLowerCase();y=y.filter(b=>b?.queryKey?(Array.isArray(b.queryKey)?b.queryKey:[b.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase().includes(m):false)}return u.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return Array.from(u).some(p=>b.includes(p.toLowerCase()))})),s.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return!Array.from(s).some(p=>b.includes(p.toLowerCase()))})),y.sort((m,b)=>{let p=m.state.dataUpdatedAt||0;return(b.state.dataUpdatedAt||0)-p}),y},[d,r,c,u,s]),g=Wi(y=>{if(e?.queryHash===y.queryHash){t(void 0);return}t(y)},[e?.queryHash,t]);return h.length===0?Gt(os,{testID:"buoy-rq-empty",...a??{otto:"empty",title:"No queries found",message:o||(r?`No ${r} queries found`:"No queries found")}}):Gt(Vt,{testID:"buoy-rq-query-list",style:ao.listWrapper,contentContainerStyle:n||ao.listContent,data:h,keyExtractor:is,renderItem:({item:y})=>Gt(Jr,{query:y,stateSig:ss(y),isSelected:e?.queryHash===y.queryHash,onSelect:g}),showsVerticalScrollIndicator:true,...as})}var is=e=>e.queryHash;function ss(e){let t=0,r=false;try{t=e.getObserversCount(),r=e.isStale()}catch{}return`${e.state.dataUpdatedAt}|${e.state.fetchStatus}|${e.state.status}|${t}|${r}`}var ao=T.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Jt.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Jt.color.border},emptyText:{color:Jt.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:ns,letterSpacing:.5}});import{buoyColors as E,monoFont as ls}from"@buoy-gg/shared-ui/web";import{jsx as no}from"react/jsx-runtime";var us={fresh:E.success+"15",stale:E.warning+"15",fetching:E.primary+"15",paused:E.textMuted+"1A",noObserver:E.textMuted+"1A",error:E.error+"15",inactive:E.textMuted+"1A"},cs={fresh:E.success+"33",stale:E.warning+"33",fetching:E.primary+"33",paused:E.textMuted+"33",noObserver:E.textMuted+"33",error:E.error+"33",inactive:E.textMuted+"33"},ds={fresh:E.success,stale:E.warning,fetching:E.primary,paused:E.textMuted,noObserver:E.textMuted,error:E.error,inactive:E.textMuted};function io({query:e,testID:t}){let r=se(e),o=us[r],a=cs[r],n=ds[r];return no(f,{style:[so.container,{backgroundColor:o,borderColor:a}],children:no(v,{testID:t,style:[so.text,{color:n}],children:r})})}var so=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:ls}});import{displayValue as ys,night as U,monoFont as wt}from"@buoy-gg/shared-ui/web";import{jsx as Ce,jsxs as qt}from"react/jsx-runtime";function Yt({query:e}){if(e===void 0)return null;let t=e.state.dataUpdatedAt?new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true}):"Never";return qt(f,{style:ee.minWidth,children:[Ce(v,{style:ee.headerText,children:"Query Details"}),qt(f,{style:ee.row,children:[Ce(be,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:ee.flexOne,children:Ce(v,{testID:"buoy-rq-detail-key",style:ee.queryKeyText,children:ys(e.queryKey,true)})}),Ce(io,{query:e,testID:"buoy-rq-detail-status"})]}),qt(f,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Observers:"}),Ce(v,{testID:"buoy-rq-detail-observers",style:ee.valueText,children:`${e.getObserversCount()}`})]}),qt(f,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Last Updated:"}),Ce(v,{testID:"buoy-rq-detail-updated",style:ee.valueText,children:`${t}`})]})]})}var ee=T.create({minWidth:{minWidth:200,backgroundColor:U.color.surface,borderRadius:6,borderWidth:1,borderColor:U.color.accent+"4D",overflow:"hidden",shadowColor:U.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:U.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:U.color.accent,borderBottomWidth:1,borderBottomColor:U.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:wt},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:U.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:U.color.text,fontFamily:wt,lineHeight:18,flexShrink:1,backgroundColor:U.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:U.color.accent+"4D"},labelText:{fontSize:10,color:U.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:wt},valueText:{fontSize:12,color:U.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:wt}});import{useQueryClient as hs}from"@tanstack/react-query";import{night as R}from"@buoy-gg/shared-ui/web";import{jsx as lo,jsxs as fs}from"react/jsx-runtime";var ms={refetch:{dotColor:R.color.accent,textColor:R.color.text,borderColor:R.color.border},invalidate:{dotColor:R.color.warning,textColor:R.color.text,borderColor:R.color.border},reset:{dotColor:R.color.textSecondary,textColor:R.color.text,borderColor:R.color.border},remove:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"},triggerLoading:{dotColor:R.color.info,textColor:R.color.info,borderColor:R.color.info+"40"},triggerError:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"}};function ue({onClick:e,text:t,variant:r,disabled:o,testID:a}){let n=ms[r];return fs(N,{"sentry-label":"ignore devtools action button",testID:a,disabled:o,onPress:e,style:[Xt.button,{borderColor:o?R.color.border:n.borderColor,opacity:o?.4:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},children:[lo(f,{style:[Xt.dot,{backgroundColor:o?R.color.textTertiary:n.dotColor}]}),lo(v,{style:[Xt.text,{color:o?R.color.textTertiary:n.textColor}],children:t})]})}var Xt=T.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:4,borderWidth:1,paddingHorizontal:8,paddingVertical:4,backgroundColor:"transparent"},dot:{width:6,height:6,borderRadius:3,marginRight:6},text:{fontSize:12,fontWeight:"500"}});var ps="@tanstack/query-devtools-event";function xe(e,t){try{let r=globalThis;if(typeof r.dispatchEvent!="function"||typeof r.CustomEvent!="function")return;r.dispatchEvent(new r.CustomEvent(ps,{detail:{type:e,queryHash:t},bubbles:true,cancelable:true}))}catch{}}function Zt({query:e}){if(e.state.data===void 0){xe("RESTORE_LOADING",e.queryHash);let t=e.state,r=e.state.fetchMeta?e.state.fetchMeta.__previousQueryOptions:null;e.cancel({silent:true}),e.setState({...t,fetchStatus:"idle",fetchMeta:null}),r&&e.fetch(r)}else{xe("TRIGGER_LOADING",e.queryHash);let t=e.options;e.fetch({...t,queryFn:()=>new Promise(()=>{}),gcTime:-1}),e.setState({data:void 0,status:"pending",fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:t}})}}function er({query:e}){xe("REFETCH",e.queryHash),e.fetch().catch(()=>{})}function uo({query:e,queryClient:t}){xe("RESET",e.queryHash),t.resetQueries({queryKey:e.queryKey,exact:true})}function co({query:e,queryClient:t}){xe("REMOVE",e.queryHash),t.removeQueries(e)}function yo({query:e,queryClient:t}){xe("INVALIDATE",e.queryHash),t.invalidateQueries(e)}function tr({query:e,queryClient:t}){if(e.state.status!=="error"){xe("TRIGGER_ERROR",e.queryHash);let r=new Error("Unknown error from devtools"),o=e.options;e.setState({status:"error",error:r,fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:o}})}else xe("RESTORE_ERROR",e.queryHash),t.resetQueries(e)}import{night as gs}from"@buoy-gg/shared-ui/web";import{jsx as we,jsxs as at}from"react/jsx-runtime";function ho({query:e,setSelectedQuery:t}){let r=hs();if(e===void 0)return null;let o=e.state.status,a=se(e)==="fetching";return at(f,{style:ze.container,children:[at(f,{style:ze.section,children:[we(v,{style:ze.sectionLabel,children:"Actions"}),at(f,{style:ze.buttonsRow,children:[we(ue,{disabled:a,onClick:()=>er({query:e}),variant:"refetch",text:"Refetch"}),we(ue,{disabled:o==="pending",onClick:()=>yo({query:e,queryClient:r}),variant:"invalidate",text:"Invalidate"}),we(ue,{disabled:o==="pending",onClick:()=>uo({queryClient:r,query:e}),variant:"reset",text:"Reset"}),we(ue,{disabled:a,onClick:()=>{co({queryClient:r,query:e}),t(void 0)},variant:"remove",text:"Remove"})]})]}),at(f,{style:ze.section,children:[we(v,{style:ze.sectionLabel,children:"Triggers"}),at(f,{style:ze.buttonsRow,children:[we(ue,{disabled:false,onClick:()=>Zt({query:e}),variant:"triggerLoading",text:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading"}),we(ue,{disabled:o==="pending",onClick:()=>tr({query:e,queryClient:r}),variant:"triggerError",text:o==="error"?"Restore Error":"Trigger Error"})]})]})]})}var ze=T.create({container:{gap:16},section:{gap:8},sectionLabel:{fontSize:11,fontWeight:"600",color:gs.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},buttonsRow:{flexDirection:"row",flexWrap:"wrap",gap:8}});import{night as rr}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as or}from"react/jsx-runtime";function bs({selectedQuery:e,setSelectedQuery:t}){return or(be,{"sentry-label":"ignore devtools query info scroll",style:de.flexOne,contentContainerStyle:de.scrollContent,children:[ce(f,{style:de.section,children:ce(Yt,{query:e})}),ce(f,{style:de.section,children:ce(ho,{query:e,setSelectedQuery:t})}),or(f,{style:de.section,children:[ce(v,{style:de.headerText,children:"Data Explorer"}),ce(f,{style:de.contentView,children:ce(me,{editable:true,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),or(f,{style:de.section,children:[ce(v,{style:de.headerText,children:"Query Explorer"}),ce(f,{style:de.contentView,children:ce(me,{label:"Query",value:e,defaultExpanded:["Query","queryKey"],activeQuery:e})})]})]})}var de=T.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:rr.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:rr.color.surface,borderRadius:12,borderWidth:1,borderColor:rr.color.border,padding:16}});import{buoyColors as F,night as te}from"@buoy-gg/shared-ui/web";import{jsx as ar,jsxs as vs}from"react/jsx-runtime";var Ss=({label:e,color:t,count:r,showLabel:o=true,isActive:a=false,onPress:n,onTouchStart:l,size:c="default",testID:s})=>{let u=c==="large",i=(d=>{let h={green:{bg:F.success+"15",border:F.success+"40",dot:F.success,text:F.success},yellow:{bg:F.warning+"15",border:F.warning+"40",dot:F.warning,text:F.warning},blue:{bg:F.primary+"15",border:F.primary+"40",dot:F.primary,text:F.primary},purple:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary},red:{bg:F.error+"15",border:F.error+"40",dot:F.error,text:F.error},gray:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary}};return h[d]||h.gray})(t);return vs(N,{"sentry-label":"ignore devtools query status",testID:s,accessibilityRole:"button",accessibilityLabel:`${e}, ${r}${a?", selected":""}`,accessibilityState:{selected:a},style:[qe.queryStatusTag,u&&qe.queryStatusTagLarge,a&&{backgroundColor:i.bg,borderColor:i.border}],disabled:!n,onPress:n,onPressIn:l,activeOpacity:.7,children:[ar(f,{style:[qe.dot,u&&qe.dotLarge,{backgroundColor:i.dot}]}),o&&ar(v,{style:[qe.label,u&&qe.labelLarge,a&&{color:i.text}],numberOfLines:1,ellipsizeMode:"tail",children:e}),r>0&&ar(v,{testID:s?`${s}-count`:void 0,style:[qe.count,u&&qe.countLarge,{color:i.dot}],numberOfLines:1,children:r})]})},qe=T.create({queryStatusTag:{flexDirection:"row",alignItems:"center",backgroundColor:te.color.buttonSurface,borderRadius:13,paddingHorizontal:10,paddingVertical:5,height:26,gap:6,borderWidth:1,borderColor:te.color.border},queryStatusTagLarge:{borderRadius:16,paddingHorizontal:13,paddingVertical:6,height:32,gap:7},dot:{width:6,height:6,borderRadius:3},dotLarge:{width:8,height:8,borderRadius:4},label:{fontSize:11,fontWeight:"500",color:te.color.textSecondary,fontFamily:"system"},labelLarge:{fontSize:13,fontWeight:"600",letterSpacing:.2,fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},count:{fontSize:11,fontVariant:["tabular-nums"],fontWeight:"600",marginLeft:"auto",fontFamily:"system"},countLarge:{fontSize:13,fontWeight:"700",fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),re=Ss;import{ChipStrip as Cs,useChipTap as xs}from"@buoy-gg/shared-ui/web";import{useEffect as fo,useState as mo}from"react";import{useQueryClient as po}from"@tanstack/react-query";function ws(){let e=po(),[t,r]=mo({fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});return fo(()=>{let o=()=>{let n=e.getQueryCache().getAll().reduce((l,c)=>{let s=se(c);return l[s]=(l[s]||0)+1,l},{fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});setTimeout(()=>r(n),0)};o();let a=e.getQueryCache().subscribe(o);return()=>a()},[e]),t}var go=ws;function qs(){let e=po(),[t,r]=mo({pending:0,success:0,error:0,paused:0,idle:0});return fo(()=>{let o=()=>{let n=e.getMutationCache().getAll().reduce((l,c)=>{let s=c.state.status;if(c.state.isPaused)l.paused++;else switch(s){case"idle":l.idle++;break;case"pending":l.pending++;break;case"success":l.success++;break;case"error":l.error++;break}return l},{pending:0,success:0,error:0,paused:0,idle:0});setTimeout(()=>r(n),0)};o();let a=e.getMutationCache().subscribe(o);return()=>a()},[e]),t}import{jsx as nt,jsxs as Ms}from"react/jsx-runtime";var Ts=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{fresh:o,stale:a,fetching:n,paused:l,inactive:c}=go(),{scrollProps:s,onTouchStart:u,isTap:i}=xs(),d=(h,g)=>{i(g)&&t&&t(e===h?null:h)};return Ms(Cs,{scrollProps:s,sentryLabel:"ignore devtools query status count scroll",children:[nt(re,{label:"Fresh",color:"green",count:o,isActive:e==="fresh",onPress:h=>d("fresh",h),onTouchStart:u,testID:"buoy-rq-status-fresh",showLabel:true,size:r}),nt(re,{label:"Loading",color:"blue",count:n,isActive:e==="fetching",onPress:h=>d("fetching",h),onTouchStart:u,testID:"buoy-rq-status-fetching",showLabel:true,size:r}),nt(re,{label:"Paused",color:"purple",count:l,isActive:e==="paused",onPress:h=>d("paused",h),onTouchStart:u,testID:"buoy-rq-status-paused",showLabel:true,size:r}),nt(re,{label:"Stale",color:"yellow",count:a,isActive:e==="stale",onPress:h=>d("stale",h),onTouchStart:u,testID:"buoy-rq-status-stale",showLabel:true,size:r}),nt(re,{label:"Idle",color:"gray",count:c,isActive:e==="inactive",onPress:h=>d("inactive",h),onTouchStart:u,testID:"buoy-rq-status-inactive",showLabel:true,size:r})]})},bo=Ts;import{useState as As,useRef as nr,useMemo as Es,useCallback as Rs}from"react";import{QueryIcon as Ds,CheckCircle as ks,Activity as Is,Pause as Qs,XCircle as Fs,buoyColors as Mt}from"@buoy-gg/shared-ui/web";import{jsx as it}from"react/jsx-runtime";function Ps({size:e=24}){return it(Ds,{size:e})}function Os({size:e=14,color:t=Mt.success,strokeWidth:r=2}){return it(ks,{size:e,color:t,strokeWidth:r})}function zs({size:e=14,color:t=Mt.warning,strokeWidth:r=2}){return it(Is,{size:e,color:t,strokeWidth:r})}function Ks({size:e=14,color:t=Mt.textMuted,strokeWidth:r=2}){return it(Qs,{size:e,color:t,strokeWidth:r})}function Ls({size:e=14,color:t=Mt.error,strokeWidth:r=2}){return it(Fs,{size:e,color:t,strokeWidth:r})}import{buoyColors as st,night as Ke,useRelativeTime as Bs,monoFont as vo}from"@buoy-gg/shared-ui/web";import{jsx as oe,jsxs as Tt}from"react/jsx-runtime";var Hs=e=>e.options.mutationKey&&(Array.isArray(e.options.mutationKey)?e.options.mutationKey:[e.options.mutationKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Anonymous Mutation";function So({mutation:e,setSelectedMutation:t,selected:r}){let o=new Date(e.state.submittedAt).toLocaleTimeString(),a=(()=>{if(e.state.submittedAt&&e.state.submittedAt>0)return e.state.submittedAt;let u=e.state;return u.updatedAt&&u.updatedAt>0?u.updatedAt:null})(),n=Bs(a)||`N/A (${e.state.submittedAt||0})`,l=(()=>{if(e.state.isPaused)return{status:"Paused",color:st.textMuted,icon:oe(Ks,{})};switch(e.state.status){case"success":return{status:"Success",color:st.success,icon:oe(Os,{})};case"error":return{status:"Error",color:st.error,icon:oe(Ls,{})};case"pending":return{status:"Loading",color:st.primary,icon:oe(zs,{})};default:return{status:"Idle",color:st.textMuted,icon:null}}})(),c=Hs(e),s=Ki(e.options.mutationKey,e.mutationId);return Tt(N,{"sentry-label":"ignore devtools mutation button",testID:s,accessibilityRole:"button",accessibilityLabel:`${c}, ${l.status}`,onPress:()=>t(e===r?void 0:e),style:[_.button,r?.mutationId===e.mutationId&&_.selected],children:[Tt(f,{style:_.rowContent,children:[Tt(f,{style:_.statusSection,children:[oe(f,{style:[_.statusDot,{backgroundColor:l.color}]}),Tt(f,{style:_.statusInfo,children:[oe(v,{testID:`${s}-status`,style:[_.statusLabel,{color:l.color}],children:l.status}),oe(v,{style:_.submittedText,children:o})]})]}),oe(f,{style:_.mutationSection,children:oe(v,{testID:`${s}-key`,style:_.mutationKey,children:c})})]}),oe(f,{style:_.bottomRightContainer,children:oe(v,{style:_.bottomRightText,children:n})})]})}var _=T.create({button:{backgroundColor:Ke.color.surface,borderRadius:8,borderWidth:1,borderColor:Ke.color.border,marginHorizontal:8,marginVertical:3,padding:12},selected:{backgroundColor:Ke.color.accentSoft,borderColor:Ke.color.accentBorderStrong},rowContent:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},statusSection:{flexDirection:"row",alignItems:"center",gap:8,flex:1},statusDot:{width:8,height:8,borderRadius:4},statusInfo:{flex:1},statusLabel:{fontSize:11,fontWeight:"600",lineHeight:14},submittedText:{fontSize:10,color:Ke.color.textTertiary,marginTop:1},mutationSection:{flex:2,paddingHorizontal:12},mutationKey:{fontFamily:vo,fontSize:12,color:Ke.color.text,lineHeight:16},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:Ke.color.textTertiary,fontFamily:vo}});import{displayValue as js,night as J,monoFont as At}from"@buoy-gg/shared-ui/web";import{buoyColors as G,monoFont as Ws}from"@buoy-gg/shared-ui/web";import{jsx as Co}from"react/jsx-runtime";var $s={success:G.success+"15",error:G.error+"15",pending:G.primary+"15",idle:G.textMuted+"1A"},Vs={success:G.success+"33",error:G.error+"33",pending:G.primary+"33",idle:G.textMuted+"33"},Ns={success:G.success,error:G.error,pending:G.primary,idle:G.textMuted};function xo({status:e,testID:t}){let r=e,o=$s[r],a=Vs[r],n=Ns[r];return Co(f,{style:[wo.container,{backgroundColor:o,borderColor:a}],children:Co(v,{testID:t,style:[wo.text,{color:n}],children:e})})}var wo=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:Ws}});import{jsx as _e,jsxs as ir}from"react/jsx-runtime";function sr({selectedMutation:e}){if(e===void 0)return null;let t=new Date(e.state.submittedAt).toLocaleTimeString();return ir(f,{style:Me.minWidth,children:[_e(v,{style:Me.headerText,children:"Mutation Details"}),ir(f,{style:Me.row,children:[_e(be,{"sentry-label":"ignore devtools mutation details scroll",horizontal:true,style:Me.flex1,children:_e(v,{testID:"buoy-rq-mutation-detail-key",style:Me.flexWrap,children:`${e.options.mutationKey?js(e.options.mutationKey,true):"No mutationKey found"}`})}),_e(xo,{status:e.state.status,testID:"buoy-rq-mutation-detail-status"})]}),ir(f,{style:Me.row,children:[_e(v,{style:Me.labelText,children:"Submitted At:"}),_e(v,{style:Me.valueText,children:t})]})]})}var Me=T.create({minWidth:{minWidth:200,backgroundColor:J.color.surface,borderRadius:6,borderWidth:1,borderColor:J.color.accent+"4D",overflow:"hidden",shadowColor:J.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:J.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:J.color.accent,borderBottomWidth:1,borderBottomColor:J.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:At},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:J.color.separator},flex1:{flex:1,marginRight:8},flexWrap:{fontSize:12,color:J.color.text,fontFamily:At,lineHeight:18,flexShrink:1,backgroundColor:J.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:J.color.accent+"4D"},labelText:{fontSize:10,color:J.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:At},valueText:{fontSize:12,color:J.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:At}});import{night as lt,monoFont as Us}from"@buoy-gg/shared-ui/web";import{jsx as j,jsxs as ut}from"react/jsx-runtime";function qo({selectedMutation:e}){return ut(be,{"sentry-label":"ignore devtools mutation information scroll",style:O.flex1,contentContainerStyle:O.scrollContent,children:[j(f,{style:O.section,children:j(sr,{selectedMutation:e})}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Variables Details"}),j(f,{style:O.padding,children:j(me,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Context Details"}),j(f,{style:O.padding,children:j(me,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Data Explorer"}),j(f,{style:O.padding,children:j(me,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Mutations Explorer"}),j(f,{style:O.padding,children:j(me,{label:"Mutation",defaultExpanded:["Mutation"],value:e})})]})]})}var O=T.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:lt.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:lt.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:lt.color.accent+"33",fontFamily:Us,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:lt.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:lt.color.border,borderTopWidth:0}});import{useCallback as Mo,useEffect as _s,useRef as To,useState as Js}from"react";import{useQueryClient as Gs}from"@tanstack/react-query";function Ys(){let e=Gs(),[t,r]=Js(()=>e.getMutationCache().getAll()),o=To(new Map),a=To(void 0),n=Mo(c=>{let s=o.current;if(c.length!==s.size)return true;for(let u of c){let i=s.get(u.mutationId);if(!i||i.status!==u.state.status||i.submittedAt!==u.state.submittedAt||i.isPaused!==u.state.isPaused)return true}return false},[]),l=Mo(()=>{let c=e.getMutationCache().getAll();if(n(c)){let s=new Map;c.forEach(u=>{s.set(u.mutationId,u.state)}),o.current=s,r(c)}},[e,n]);return _s(()=>{l();let c=e.getMutationCache().subscribe(s=>{(s.type==="added"||s.type==="removed"||s.type==="updated")&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{l()},10))});return()=>{c(),a.current&&clearTimeout(a.current)}},[e,l]),{mutations:t}}var Ao=Ys;import{night as Le,ToolEmptyState as Xs,monoFont as Zs}from"@buoy-gg/shared-ui/web";import{jsx as Te,jsxs as Eo}from"react/jsx-runtime";function Ro({selectedMutation:e,setSelectedMutation:t,activeFilter:r,hideInfoPanel:o=false,contentContainerStyle:a,searchText:n=""}){let{mutations:l}=Ao(),c=S=>S.state.isPaused?"paused":S.state.status,s=Es(()=>{let S=l;if(r&&(S=S.filter(w=>c(w)===r)),n){let w=n.toLowerCase();S=S.filter(C=>{let q=C.options.mutationKey;return q?(Array.isArray(q)?q:[q]).filter(A=>A!=null).map(A=>String(A)).join(" ").toLowerCase().includes(w):false})}return S},[l,r,n]),u=Ir.get("window").height,i=u*.4,d=150,h=u*.7,g=nr(new Z.Value(i)).current,[,y]=As(i),m=nr(i),b=nr($t.create({onMoveShouldSetPanResponder:(S,w)=>Math.abs(w.dy)>Math.abs(w.dx)&&Math.abs(w.dy)>10,onPanResponderGrant:()=>{g.stopAnimation(S=>{y(S),m.current=S,g.setValue(S)})},onPanResponderMove:(S,w)=>{let C=m.current-w.dy,q=Math.max(d,Math.min(h,C));g.setValue(q)},onPanResponderRelease:(S,w)=>{let C=Math.max(d,Math.min(h,m.current-w.dy));y(C),m.current=C,Z.timing(g,{toValue:C,duration:200,useNativeDriver:false}).start(()=>{g.setValue(C),y(C),m.current=C})}})).current,p=Rs(({item:S})=>Te(So,{selected:e,setSelectedMutation:t,mutation:S}),[e,t]);return Eo(f,{style:Be.container,children:[s.length>0?Te(f,{style:Be.listWrapper,children:Te(Vt,{"sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:s,renderItem:p,keyExtractor:(S,w)=>`${S.mutationId}-${S.state.submittedAt}-${S.state.status}-${w}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process<"u"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:a||Be.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):Te(Xs,{testID:"buoy-rq-mutations-empty",otto:r?"filtering":"scanning",title:"No mutations found",message:r?`No ${r} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),e&&!o&&Eo(Z.View,{style:[Be.mutationInfo,{height:g}],children:[Te(f,{style:Be.dragHandle,...b.panHandlers,children:Te(f,{style:Be.dragIndicator})}),Te(f,{style:Be.mutationInfoContent,children:Te(qo,{selectedMutation:e})})]})]})}var Be=T.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:Le.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:Le.color.surface,borderBottomWidth:1,borderBottomColor:Le.color.border},dragIndicator:{width:40,height:4,backgroundColor:Le.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Le.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Le.color.border},emptyText:{color:Le.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Zs,letterSpacing:.5}});import{ChipStrip as el,useChipTap as tl}from"@buoy-gg/shared-ui/web";import{jsx as Et,jsxs as rl}from"react/jsx-runtime";var ol=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{pending:o,success:a,error:n,paused:l}=qs(),{scrollProps:c,onTouchStart:s,isTap:u}=tl(),i=(d,h)=>{u(h)&&t&&t(e===d?null:d)};return rl(el,{scrollProps:c,sentryLabel:"ignore devtools mutation status count scroll",children:[Et(re,{label:"Pending",color:"blue",count:o,isActive:e==="pending",onPress:d=>i("pending",d),onTouchStart:s,testID:"buoy-rq-mstatus-pending",showLabel:true,size:r}),Et(re,{label:"Success",color:"green",count:a,isActive:e==="success",onPress:d=>i("success",d),onTouchStart:s,testID:"buoy-rq-mstatus-success",showLabel:true,size:r}),Et(re,{label:"Error",color:"red",count:n,isActive:e==="error",onPress:d=>i("error",d),onTouchStart:s,testID:"buoy-rq-mstatus-error",showLabel:true,size:r}),Et(re,{label:"Paused",color:"purple",count:l,isActive:e==="paused",onPress:d=>i("paused",d),onTouchStart:s,testID:"buoy-rq-mstatus-paused",showLabel:true,size:r})]})},Do=ol;import{Trash as al,night as Je}from"@buoy-gg/shared-ui/web";import{jsx as ko}from"react/jsx-runtime";var nl=({type:e,onClear:t,disabled:r=false})=>ko(N,{"sentry-label":"ignore devtools clear cache button",style:[Io.button,r&&Io.disabledButton],onPress:t,disabled:r,activeOpacity:.7,accessibilityLabel:`Clear ${e} cache`,accessibilityRole:"button",accessibilityState:{disabled:r},children:ko(al,{size:16,strokeWidth:2,color:r?Je.color.textTertiary:Je.color.warning})}),Io=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:Je.color.warningSoft,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:Je.color.warning+"33"},disabledButton:{opacity:.5,backgroundColor:Je.color.fill,borderColor:Je.color.border}}),il=nl;import{Wifi as Qo,buoyColors as Fo}from"@buoy-gg/shared-ui/web";import{jsx as lr}from"react/jsx-runtime";var sl=({isOffline:e,onToggle:t})=>lr(N,{"sentry-label":"ignore devtools network toggle button",style:[Po.button,e&&Po.offlineButton],onPress:t,activeOpacity:.7,accessibilityLabel:e?"Unset offline mocking behavior":"Mock offline behavior",accessibilityRole:"button",accessibilityState:{selected:e},children:e?lr(Qo,{size:16,color:Fo.error,strokeWidth:2}):lr(Qo,{size:16,color:Fo.success,strokeWidth:2})}),Po=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:"rgba(16, 185, 129, 0.2)"},offlineButton:{backgroundColor:"rgba(239, 68, 68, 0.1)",borderColor:"rgba(239, 68, 68, 0.2)"}}),ll=sl;import{ChipStrip as ul,useChipTap as cl}from"@buoy-gg/shared-ui/web";import{jsx as Oo}from"react/jsx-runtime";var zo=["mmkv","async","secure"],dl=({activeStorageTypes:e=new Set(zo),onStorageTypesChange:t,counts:r})=>{let{scrollProps:o,onTouchStart:a,isTap:n}=cl(),l=(c,s)=>{if(n(s)&&t){let u=new Set(e);u.has(c)?u.delete(c):u.add(c),t(u)}};return Oo(ul,{scrollProps:o,sentryLabel:"ignore devtools storage status count scroll",children:zo.map(c=>{let s=r?.[c]??0;return Oo(re,{label:Zr(c),color:eo(c),count:s,isActive:e.has(c),onPress:u=>l(c,u),onTouchStart:a,showLabel:true},c)})})},yl=dl;import{night as hl,monoFont as fl}from"@buoy-gg/shared-ui/web";import{jsx as Ko,jsxs as ml}from"react/jsx-runtime";function pl({totalCount:e,filteredCount:t,onPress:r}){if(t===e)return null;let o=Ko(f,{style:Lo.container,children:ml(v,{testID:"buoy-rq-filter-badge",style:Lo.text,children:["Showing ",t," of ",e]})});return r?Ko(N,{testID:"buoy-rq-filter-badge-button",accessibilityRole:"button",accessibilityLabel:`Showing ${t} of ${e}, open filters`,onPress:r,activeOpacity:.7,children:o}):o}var Lo=T.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:2},text:{fontSize:9,color:hl.color.textTertiary,fontFamily:fl}});import{jsx as Bo,jsxs as gl}from"react/jsx-runtime";function Ho({selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:o="",ignoredPatterns:a=new Set,includedPatterns:n=new Set,onFilterPress:l}){let c=n.size>0,s=a.size>0,u=xt(),i=Fi(()=>{let d=u;return n.size>0&&(d=d.filter(h=>{if(!h?.queryKey)return false;let g=(Array.isArray(h.queryKey)?h.queryKey:[h.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return Array.from(n).some(y=>g.includes(y.toLowerCase()))})),a.size>0&&(d=d.filter(h=>{if(!h?.queryKey)return true;let g=(Array.isArray(h.queryKey)?h.queryKey:[h.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return!Array.from(a).some(y=>g.includes(y.toLowerCase()))})),d.length},[u,n,a]);return gl(f,{style:jo.queryListContainer,children:[(c||s)&&Bo(pl,{totalCount:u.length,filteredCount:i,onPress:l}),Bo(oo,{selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:o,ignoredPatterns:a,includedPatterns:n,emptyState:Qi({subject:"queries",verb:"active",search:o,total:u.length,blocked:r?`No ${r} queries. Pick another status to see the rest.`:c?`No queries match your "include only" filters. ${n.size} pattern(s) active.`:s?`No queries match the current filters. ${a.size} pattern(s) excluded.`:void 0,waiting:{otto:"scanning",title:"No queries found",message:`No React Query queries are currently active.
1
+ "use client";var qr=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var nn=Object.getOwnPropertyNames;var sn=Object.prototype.hasOwnProperty;var ln=(e,t)=>{for(var r in t)qr(e,r,{get:t[r],enumerable:true})},Mr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of nn(t))!sn.call(e,a)&&a!==r&&qr(e,a,{get:()=>t[a],enumerable:!(o=an(t,a))||o.enumerable});return e},un=(e,t,r)=>(Mr(e,t,"default"),r&&Mr(r,t,"default"));var zc=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import"@tanstack/react-query";import{QueryClientProvider as cn}from"@tanstack/react-query";import{QueryIcon as Tr}from"@buoy-gg/floating-tools-core/web";import{Wifi as Ar}from"@buoy-gg/shared-ui/web";import{useCallback as Fe,useState as tt,useEffect as dn}from"react";import{useQueryClient as yn}from"@tanstack/react-query";import{TickProvider as hn}from"@buoy-gg/shared-ui/web";import{useQueryClient as fn}from"@tanstack/react-query";import{JsModal as mn,useSafeAreaInsets as pn,ModalHeader as jt,TabSelector as gn}from"@buoy-gg/shared-ui/web";import{useEffect as bn,useState as vn,useRef as Sn}from"react";import{useQueryClient as Cn}from"@tanstack/react-query";function Er(e){let{query:t}=Wt(e);return t}function Wt(e){let t=Cn(),[r,o]=vn({query:void 0,version:0}),a=Sn(void 0);return bn(()=>{if(!e){o({query:void 0,version:0}),a.current=void 0;return}let n=t.getQueryCache().find({queryKey:e,exact:true});o({query:n,version:0});let l=JSON.stringify(e);a.current=l;let c=t.getQueryCache().subscribe(s=>{(s.type==="updated"||s.type==="added"||s.type==="removed")&&"query"in s&&s.query&&JSON.stringify(s.query.queryKey)===a.current&&(s.type==="removed"?o({query:void 0,version:0}):o(u=>({query:s.query,version:u.version+1})))});return()=>c()},[t,e]),r}import{ModalHeader as Pe,TabSelector as Rr,Search as xn,Filter as wn,Trash as qn,night as We}from"@buoy-gg/shared-ui/web";import{useState as Mn,useRef as Dr,useEffect as Tn}from"react";var kr={};ln(kr,{AccessibilityInfo:()=>Dn,ActivityIndicator:()=>Ai,Alert:()=>Di,Animated:()=>Z,AppRegistry:()=>In,AppState:()=>Qn,Appearance:()=>kn,BackHandler:()=>Fn,Button:()=>Ei,CheckBox:()=>_n,Clipboard:()=>Pn,DeviceEventEmitter:()=>ui,Dimensions:()=>Ir,Easing:()=>On,FlatList:()=>Vt,I18nManager:()=>zn,Image:()=>Jn,ImageBackground:()=>Gn,InteractionManager:()=>Ln,Keyboard:()=>Kn,KeyboardAvoidingView:()=>Yn,LayoutAnimation:()=>Bn,Linking:()=>Hn,LogBox:()=>li,Modal:()=>Lr,NativeEventEmitter:()=>jn,NativeModules:()=>Rn,PanResponder:()=>$t,Picker:()=>Xn,PixelRatio:()=>Wn,Platform:()=>$n,Pressable:()=>zr,ProgressBar:()=>Zn,RefreshControl:()=>ei,SafeAreaView:()=>ti,ScrollView:()=>be,SectionList:()=>ri,Share:()=>Vn,StatusBar:()=>oi,StyleSheet:()=>T,Switch:()=>Ti,Text:()=>v,TextInput:()=>wi,Touchable:()=>ai,TouchableHighlight:()=>qi,TouchableNativeFeedback:()=>ni,TouchableOpacity:()=>N,TouchableWithoutFeedback:()=>Mi,UIManager:()=>Nn,Vibration:()=>Un,View:()=>f,VirtualizedList:()=>ii,YellowBox:()=>si,findNodeHandle:()=>Ri,unstable_createElement:()=>En,useColorScheme:()=>ci,useLocaleContext:()=>di,useWindowDimensions:()=>yi});un(kr,An);import*as An from"react-native-web";import{unstable_createElement as En,NativeModules as Rn,AccessibilityInfo as Dn,Appearance as kn,AppRegistry as In,AppState as Qn,BackHandler as Fn,Clipboard as Pn,Dimensions as Ir,Easing as On,I18nManager as zn,Keyboard as Kn,InteractionManager as Ln,LayoutAnimation as Bn,Linking as Hn,NativeEventEmitter as jn,PanResponder as $t,PixelRatio as Wn,Platform as $n,Share as Vn,UIManager as Nn,Vibration as Un,CheckBox as _n,FlatList as Vt,Image as Jn,ImageBackground as Gn,KeyboardAvoidingView as Yn,Picker as Xn,ProgressBar as Zn,RefreshControl as ei,SafeAreaView as ti,SectionList as ri,StatusBar as oi,Touchable as ai,TouchableNativeFeedback as ni,VirtualizedList as ii,YellowBox as si,LogBox as li,DeviceEventEmitter as ui,useColorScheme as ci,useLocaleContext as di,useWindowDimensions as yi}from"react-native-web";import*as B from"react-native-web";import{createElement as Nt,forwardRef as Qr,useCallback as hi,useRef as fi}from"react";import{useEffect as mi,useState as pi}from"react";import{createPortal as gi}from"react-dom";var bi='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as vi}from"react/jsx-runtime";var rt=Symbol.for("@buoy-gg/portal-host"),Fr=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function Pr(){let e=document;if(e[rt])return e[rt].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:bi});let r=()=>{let i=document.fullscreenElement,d=i&&i.tagName!=="CANVAS"?i:document.body;t.parentElement!==d&&d.appendChild(t)},o=new Map,a=i=>{(!t.contains(i.target)||!Fr(i.target))&&o.set(i.code||i.key,{key:i.key,code:i.code,location:i.location,keyCode:i.keyCode,which:i.which,altKey:i.altKey,ctrlKey:i.ctrlKey,metaKey:i.metaKey,shiftKey:i.shiftKey})},n=i=>{o.delete(i.code||i.key)},l=()=>o.clear(),c=()=>{let i=[...o.values()];o.clear();for(let d of i)document.dispatchEvent(new KeyboardEvent("keyup",{...d,bubbles:true}))},s=i=>{Fr(i.target)&&i.stopPropagation()},u=i=>i.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",l),t.addEventListener("focusin",c),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",u,{passive:true}),e[rt]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",l),t.remove(),delete e[rt]}},t}function Si({children:e}){let[t,r]=pi(null);return mi(()=>{let o=Pr(),a=document[rt];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?gi(vi("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var $e=B,Ci=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Ve=e=>typeof e=="number"?`${e}px`:e;function Ut(e){if(Array.isArray(e)){let d=e.map(Ut);return d.some((h,g)=>h!==e[g])?d:e}if(!e||typeof e!="object"||!Ci.some(d=>e[d]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:l,textShadowRadius:c,...s}=e;if(t!=null||r!=null||o!=null||a!=null){let d=t??"black",h=o==null?d:`color-mix(in srgb, ${d} ${Math.min(o,1)*100}%, transparent)`,g=`${Ve(r?.width??0)} ${Ve(r?.height??0)} ${Ve(a??0)} ${h}`;s.boxShadow=typeof s.boxShadow=="string"?`${s.boxShadow}, ${g}`:s.boxShadow??g}let{width:u=0,height:i=0}=l??{};if(n&&(u||i||c)){let d=`${Ve(u)} ${Ve(i)} ${Ve(c??0)} ${n}`;s.textShadow=s.textShadow?`${s.textShadow}, ${d}`:d}return s}var xi=$e.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Or(e,t){if(typeof e=="function")return o=>Or(e(o),t);let r=Ut(e);return t?[r,xi[t]]:r}var T={...$e.StyleSheet,create:e=>$e.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Ut(r)])))};function V(e){let t=Qr((o,a)=>{let{accessibilityState:n,accessibilityValue:l,pointerEvents:c,...s}=o;for(let i of["busy","checked","disabled","expanded","selected"])n?.[i]!==void 0&&s[`aria-${i}`]===void 0&&(s[`aria-${i}`]=n[i]);for(let[i,d]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))l?.[i]!==void 0&&s[`aria-${d}`]===void 0&&(s[`aria-${d}`]=l[i]);let u=Or(s.style,c);return u!==s.style&&(s.style=u),Nt(e,{...s,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=V(B.View),v=V(B.Text),Z={...$e.Animated,View:$e.Animated.createAnimatedComponent(f),Text:$e.Animated.createAnimatedComponent(v)},wi=V(B.TextInput),N=V(B.TouchableOpacity),qi=V(B.TouchableHighlight),Mi=V(B.TouchableWithoutFeedback),zr=V(B.Pressable),be=V(B.ScrollView),Kr=Qr((e,t)=>{let r=fi(null),o=hi(a=>{if(a){let n=a;for(;n.parentElement&&n.parentElement!==document.body;)n=n.parentElement;n.parentElement===document.body&&(r.current=n,Object.assign(n.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Pr().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return Nt(Si,null,Nt(B.Modal,{...e,ref:o}))});Kr.displayName="Modal";var Lr=V(Kr),Ti=V(B.Switch),Ai=V(B.ActivityIndicator),Ei=V(B.Button),Ri=B.findNodeHandle,Di={alert(e,t,r,o){if(typeof document>"u")return;let a=document.createElement("dialog");a.dataset.buoyRoot="",a.setAttribute("aria-label",e),a.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",a.appendChild(n),t){let u=document.createElement("p");u.textContent=t,u.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",a.appendChild(u)}let l=document.createElement("div");l.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let c=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let u of c){let i=document.createElement("button");i.type="button",i.textContent=u.text??"OK",i.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,i.onclick=()=>{s(),u.onPress?.()},l.appendChild(i)}a.addEventListener("cancel",u=>{u.preventDefault(),o?.cancelable!==false&&(s(),o?.onDismiss?.())}),a.appendChild(l),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{Wifi as Br}from"@buoy-gg/shared-ui/web";import{useEffect as Hr,useState as ki,useRef as Ii}from"react";import{onlineManager as bt}from"@tanstack/react-query";import{devToolsStorageKeys as jr,persistentStorage as Wr}from"@buoy-gg/shared-ui/web";function $r(){let[e,t]=ki(()=>bt.isOnline()),r=Ii(false);Hr(()=>{if(r.current)return;(async()=>{try{let n=await Wr.getItem(jr.settings.wifiEnabled());if(n!==null){let l=n==="true";t(l),bt.setOnline(l)}r.current=true}catch{}})()},[]);let o=async n=>{try{await Wr.setItem(jr.settings.wifiEnabled(),n.toString())}catch{}},a=()=>{let n=!e;t(n),bt.setOnline(n),o(n)};return Hr(()=>bt.subscribe(n=>{t(n),r.current&&o(n)}),[]),{isOnline:e,handleWifiToggle:a}}import{jsx as _t}from"react/jsx-runtime";function Vr({size:e=16,testID:t}){let{isOnline:r,handleWifiToggle:o}=$r();return _t(N,{"sentry-label":`ignore toggle WiFi ${r?"On":"Off"}`,testID:t,accessibilityRole:"button",accessibilityLabel:`WiFi ${r?"On":"Off"}`,accessibilityHint:`Tap to turn WiFi ${r?"off":"on"} for React Query`,onPress:o,hitSlop:{top:10,bottom:10,left:10,right:10},activeOpacity:.7,style:{alignItems:"center",justifyContent:"center",width:14,flexShrink:0},children:r?_t(Br,{size:e,color:"#10B981"}):_t(Br,{size:e,color:"#DC2626"})})}import{jsx as H,jsxs as vt}from"react/jsx-runtime";function ot({selectedQuery:e,selectedMutation:t,activeTab:r,onTabChange:o,onBack:a,searchText:n="",onSearchChange:l,onFilterPress:c,hasActiveFilters:s=false,onClearCache:u,showWifiToggle:i=false}){let[d,h]=Mn(false),g=Dr(false),y=Dr(null);Tn(()=>{d&&y.current&&y.current.focus()},[d]);let m=()=>{h(!d),d&&l&&l("")},b=C=>{l&&l(C)},p=C=>C?.queryKey&&(Array.isArray(C.queryKey)?C.queryKey:[C.queryKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||"Unknown Query",S=C=>"queryKey"in C?p(C):C.options.mutationKey?(Array.isArray(C.options.mutationKey)?C.options.mutationKey:[C.options.mutationKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||`Mutation #${C.mutationId}`:`Mutation #${C.mutationId}`,w=[{key:"queries",label:"Queries"},{key:"mutations",label:"Mutations"}];return e||t?vt(Pe,{children:[H(Pe.Navigation,{onBack:a}),H(Pe.Content,{title:S(e??t),testID:"buoy-rq-detail-title"})]}):vt(Pe,{children:[H(Pe.Content,{title:"",noMargin:true,children:d?H(Pe.Search,{value:n,onChangeText:b,onCancel:()=>{b(""),h(false)},onDismiss:()=>h(false),dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search query keys...",accessibilityLabel:"Search queries and mutations",iconSize:14,testID:"buoy-rq-search",containerTestID:"buoy-rq-search-field",clearTestID:"buoy-rq-search-clear",inputProps:{"sentry-label":"ignore react query search header"}}):i?vt(f,{style:Oe.tabRow,children:[H(f,{style:Oe.tabSelectorWrap,children:H(Rr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>o(C)})}),H(Vr,{size:16,testID:"buoy-rq-wifi"})]}):H(Rr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>o(C)})}),vt(Pe.Actions,{children:[H(N,{"sentry-label":"ignore open search",testID:"buoy-rq-search-open",accessibilityRole:"button",accessibilityLabel:"Search queries and mutations",onPress:m,style:Oe.headerActionButton,children:H(xn,{size:14,color:We.color.textSecondary})}),c&&H(N,{"sentry-label":"ignore open filter",testID:"buoy-rq-filters",accessibilityRole:"button",accessibilityLabel:s?"Filters, active":"Filters",onPress:c,style:[Oe.headerActionButton,s&&Oe.activeFilterButton],children:H(wn,{size:14,color:s?We.color.accent:We.color.textSecondary})}),u&&H(N,{"sentry-label":"ignore clear cache",testID:"buoy-rq-clear-cache",accessibilityRole:"button",onPress:u,style:[Oe.headerActionButton,Oe.clearCacheButton],accessibilityLabel:`Clear ${r} cache`,children:H(qn,{size:14,color:We.color.warning})})]})]})}var Oe=T.create({tabRow:{flex:1,flexDirection:"row",alignItems:"center",gap:12},tabSelectorWrap:{flex:1},headerActionButton:{padding:6,borderRadius:4},activeFilterButton:{backgroundColor:We.color.accentSoft},clearCacheButton:{backgroundColor:We.color.warningSoft}});import{resolveListEmptyState as Qi}from"@buoy-gg/shared-ui/web";import{useMemo as Fi}from"react";import{useMemo as Pi}from"react";import{useQueryClient as Oi}from"@tanstack/react-query";var Ne=(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[a,...n]=t,l=o.get(a);return o.set(a,Ne(l??null,n,r)),o}if(e instanceof Set){let o=Ne(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[a,...n]=t;return o[a]=Ne(o[a],n,r),o}if(e instanceof Object){let o={...e};if(t.length===1)return o[t[0]]=r,o;let[a,...n]=t;return o[a]=Ne(o[a],n,r),o}return e};var Ue=(e,t)=>{if(e instanceof Map){let r=new Map(e);if(t.length===1)return r.delete(t[0]),r;let[o,...a]=t;return r.set(o,Ue(r.get(o),a)),r}if(e instanceof Set){let r=Ue(Array.from(e),t);return new Set(r)}if(Array.isArray(e)){let r=[...e];if(t.length===1)return r.filter((n,l)=>l.toString()!==t[0]);let[o,...a]=t;return r[o]=Ue(r[o],a),r}if(e instanceof Object){let r={...e};if(t.length===1)return delete r[t[0]],r;let[o,...a]=t;return r[o]=Ue(r[o],a),r}return e};function Nr({activeQuery:e,dataPath:t,queryClient:r}){if(!t)return;let o=e.state.data,a=Ue(o,t),n=JSON.parse(JSON.stringify(a));r.setQueryData(e.queryKey,n)}function Ur(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function _r(e){return(Array.isArray(e)?e:[e]).filter(t=>t!=null).map(Ur).filter(Boolean).join("-")||"unkeyed"}function zi(e){return`buoy-rq-query-row-${_r(e)}`}function Ki(e,t){return e==null?`buoy-rq-mutation-row-id-${t}`:`buoy-rq-mutation-row-${_r(e)}`}function Li(e){return e.length===0?"buoy-rq-explorer-root":`buoy-rq-explorer-${e.map(Ur).filter(Boolean).join("-")}`}import{LiveExplorer as Bi}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as Hi}from"react/jsx-runtime";function me({editable:e,label:t,value:r,defaultExpanded:o,activeQuery:a,dataPath:n,itemsDeletable:l,dataVersion:c=0}){let s=Oi(),u=Pi(()=>{if(a)return{update:(i,d)=>{let h=a.state.data,g=Ne(h,i,d);s.setQueryData(a.queryKey,g)},remove:i=>{Nr({queryClient:s,activeQuery:a,dataPath:i})}}},[s,a]);return Hi(Bi,{editable:e,label:t,value:r,defaultExpanded:o,writer:u,dataPath:n,itemsDeletable:l,dataVersion:c,testIDForPath:Li,debounceMs:0})}import{useMemo as ji,useCallback as Wi}from"react";import{memo as $i}from"react";function se(e){return e.isDisabled()?"disabled":e.state.fetchStatus==="fetching"?"fetching":e.state.status==="error"?"error":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}import{CompactRow as Vi,buoyColors as ve,useRelativeTime as Ni}from"@buoy-gg/shared-ui/web";import{jsx as Ui}from"react/jsx-runtime";var _i=e=>e?.queryKey&&(Array.isArray(e.queryKey)?e.queryKey:[e.queryKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Query",Ji=$i(function({query:e,isSelected:t,onSelect:r}){let o=g=>{switch(g){case"disabled":return ve.textMuted+"80";case"error":return ve.error;case"fresh":return ve.success;case"stale":return ve.warning;case"inactive":return ve.textMuted;case"fetching":return ve.primary;case"paused":return ve.textMuted;default:return ve.textSecondary}},a=se(e),n=e.getObserversCount(),l=e.isDisabled(),c=_i(e),s=(()=>{if(l)return null;if(e.state.dataUpdatedAt&&e.state.dataUpdatedAt>0)return e.state.dataUpdatedAt;let g=e.state;return g.fetchedAt&&g.fetchedAt>0?g.fetchedAt:null})(),u=Ni(s),i=l?"Disabled":u||"Never",d=zi(e.queryKey),h=`${n} observer${n!==1?"s":""}`;return Ui(Vi,{testID:d,statusTestID:`${d}-status`,statusSublabelTestID:`${d}-observers`,accessibilityLabel:`${c}, ${a}, ${h}`,statusDotColor:o(a),statusLabel:a.charAt(0).toUpperCase()+a.slice(1),statusSublabel:h,primaryText:c,bottomRightText:i,badgeText:n,badgeColor:o(a),isSelected:t,onPress:()=>r(e)})}),Jr=Ji;import{useEffect as Gi,useState as Yi,useRef as Gr,useMemo as Xi,useCallback as Yr}from"react";import{useQueryClient as Zi}from"@tanstack/react-query";import{buoyColors as St}from"@buoy-gg/shared-ui/web";var le={base:()=>["#storage"],mmkv:{root:()=>[...le.base(),"mmkv"],key:e=>[...le.mmkv.root(),e],all:()=>[...le.mmkv.root(),"all"]},async:{root:()=>[...le.base(),"async"],key:e=>[...le.async.root(),e],all:()=>[...le.async.root(),"all"]},secure:{root:()=>[...le.base(),"secure"],key:e=>[...le.secure.root(),e],all:()=>[...le.secure.root(),"all"]}};function Se(e){return!Array.isArray(e)||e.length===0?false:e[0]==="#storage"}function Xr(e){if(!Se(e)||e.length<2)return null;let t=e[1];return t==="mmkv"||t==="async"||t==="secure"?t:null}function Zr(e){switch(e){case"mmkv":return"MMKV";case"async":return"Async";case"secure":return"Secure";default:return e}}function eo(e){switch(e){case"mmkv":return"purple";case"async":return"blue";case"secure":return"green";default:return"gray"}}function es(e){switch(e){case"mmkv":return St.primary;case"async":return St.warning;case"secure":return St.success;default:return St.textMuted}}function to(e){return!Se(e)||e.length<3?"Unknown Storage Key":e.slice(2).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Storage Key"}var Ct=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,ts=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,ro=(e,t)=>Ct(e)===Ct(t)?ts(e,t):Ct(e)>Ct(t)?1:-1;function rs(){let e=Zi(),[t,r]=Yi(()=>e.getQueryCache().getAll().filter(c=>!Se(c.queryKey)).sort(ro)),o=Gr(new Map),a=Gr(void 0),n=Yr(c=>{let s=o.current;if(c.length!==s.size)return true;for(let u of c){let i=s.get(u.queryHash);if(!i||i.dataUpdatedAt!==u.state.dataUpdatedAt||i.errorUpdatedAt!==u.state.errorUpdatedAt||i.fetchStatus!==u.state.fetchStatus||i.status!==u.state.status||i.isInvalidated!==u.state.isInvalidated)return true}return false},[]),l=Yr(()=>{let c=e.getQueryCache().getAll().filter(s=>!Se(s.queryKey));if(n(c)){let s=new Map;c.forEach(i=>{s.set(i.queryHash,i.state)}),o.current=s;let u=[...c].sort(ro);r(u)}},[e,n]);return Gi(()=>{l();let c=e.getQueryCache().subscribe(s=>{if(s.type==="added"||s.type==="removed"||s.type==="updated"){if("query"in s&&s.query&&Se(s.query.queryKey))return;a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{l()},10)}});return()=>{c(),a.current&&clearTimeout(a.current)}},[e,l]),Xi(()=>t,[t])}var xt=rs;import{night as Jt,ToolEmptyState as os,EVENT_LIST_PRESET as as,monoFont as ns}from"@buoy-gg/shared-ui/web";import{jsx as Gt}from"react/jsx-runtime";function oo({selectedQuery:e,onQuerySelect:t,activeFilter:r,emptyStateMessage:o,emptyState:a,contentContainerStyle:n,queries:l,searchText:c="",ignoredPatterns:s=new Set,includedPatterns:u=new Set}){let i=xt(),d=l??i,h=ji(()=>{let y=d;if(r&&(y=y.filter(m=>se(m)===r)),c){let m=c.toLowerCase();y=y.filter(b=>b?.queryKey?(Array.isArray(b.queryKey)?b.queryKey:[b.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase().includes(m):false)}return u.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return Array.from(u).some(p=>b.includes(p.toLowerCase()))})),s.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return!Array.from(s).some(p=>b.includes(p.toLowerCase()))})),y.sort((m,b)=>{let p=m.state.dataUpdatedAt||0;return(b.state.dataUpdatedAt||0)-p}),y},[d,r,c,u,s]),g=Wi(y=>{if(e?.queryHash===y.queryHash){t(void 0);return}t(y)},[e?.queryHash,t]);return h.length===0?Gt(os,{testID:"buoy-rq-empty",...a??{otto:"empty",title:"No queries found",message:o||(r?`No ${r} queries found`:"No queries found")}}):Gt(Vt,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-query-list",style:ao.listWrapper,contentContainerStyle:n||ao.listContent,data:h,keyExtractor:is,renderItem:({item:y})=>Gt(Jr,{query:y,stateSig:ss(y),isSelected:e?.queryHash===y.queryHash,onSelect:g}),showsVerticalScrollIndicator:true,...as})}var is=e=>e.queryHash;function ss(e){let t=0,r=false;try{t=e.getObserversCount(),r=e.isStale()}catch{}return`${e.state.dataUpdatedAt}|${e.state.fetchStatus}|${e.state.status}|${t}|${r}`}var ao=T.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Jt.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Jt.color.border},emptyText:{color:Jt.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:ns,letterSpacing:.5}});import{buoyColors as E,monoFont as ls}from"@buoy-gg/shared-ui/web";import{jsx as no}from"react/jsx-runtime";var us={fresh:E.success+"15",stale:E.warning+"15",fetching:E.primary+"15",paused:E.textMuted+"1A",noObserver:E.textMuted+"1A",error:E.error+"15",inactive:E.textMuted+"1A"},cs={fresh:E.success+"33",stale:E.warning+"33",fetching:E.primary+"33",paused:E.textMuted+"33",noObserver:E.textMuted+"33",error:E.error+"33",inactive:E.textMuted+"33"},ds={fresh:E.success,stale:E.warning,fetching:E.primary,paused:E.textMuted,noObserver:E.textMuted,error:E.error,inactive:E.textMuted};function io({query:e,testID:t}){let r=se(e),o=us[r],a=cs[r],n=ds[r];return no(f,{style:[so.container,{backgroundColor:o,borderColor:a}],children:no(v,{testID:t,style:[so.text,{color:n}],children:r})})}var so=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:ls}});import{displayValue as ys,night as U,monoFont as wt}from"@buoy-gg/shared-ui/web";import{jsx as Ce,jsxs as qt}from"react/jsx-runtime";function Yt({query:e}){if(e===void 0)return null;let t=e.state.dataUpdatedAt?new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true}):"Never";return qt(f,{style:ee.minWidth,children:[Ce(v,{style:ee.headerText,children:"Query Details"}),qt(f,{style:ee.row,children:[Ce(be,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:ee.flexOne,children:Ce(v,{testID:"buoy-rq-detail-key",style:ee.queryKeyText,children:ys(e.queryKey,true)})}),Ce(io,{query:e,testID:"buoy-rq-detail-status"})]}),qt(f,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Observers:"}),Ce(v,{testID:"buoy-rq-detail-observers",style:ee.valueText,children:`${e.getObserversCount()}`})]}),qt(f,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Last Updated:"}),Ce(v,{testID:"buoy-rq-detail-updated",style:ee.valueText,children:`${t}`})]})]})}var ee=T.create({minWidth:{minWidth:200,backgroundColor:U.color.surface,borderRadius:6,borderWidth:1,borderColor:U.color.accent+"4D",overflow:"hidden",shadowColor:U.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:U.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:U.color.accent,borderBottomWidth:1,borderBottomColor:U.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:wt},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:U.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:U.color.text,fontFamily:wt,lineHeight:18,flexShrink:1,backgroundColor:U.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:U.color.accent+"4D"},labelText:{fontSize:10,color:U.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:wt},valueText:{fontSize:12,color:U.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:wt}});import{useQueryClient as hs}from"@tanstack/react-query";import{night as R}from"@buoy-gg/shared-ui/web";import{jsx as lo,jsxs as fs}from"react/jsx-runtime";var ms={refetch:{dotColor:R.color.accent,textColor:R.color.text,borderColor:R.color.border},invalidate:{dotColor:R.color.warning,textColor:R.color.text,borderColor:R.color.border},reset:{dotColor:R.color.textSecondary,textColor:R.color.text,borderColor:R.color.border},remove:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"},triggerLoading:{dotColor:R.color.info,textColor:R.color.info,borderColor:R.color.info+"40"},triggerError:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"}};function ue({onClick:e,text:t,variant:r,disabled:o,testID:a}){let n=ms[r];return fs(N,{"sentry-label":"ignore devtools action button",testID:a,disabled:o,onPress:e,style:[Xt.button,{borderColor:o?R.color.border:n.borderColor,opacity:o?.4:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},children:[lo(f,{style:[Xt.dot,{backgroundColor:o?R.color.textTertiary:n.dotColor}]}),lo(v,{style:[Xt.text,{color:o?R.color.textTertiary:n.textColor}],children:t})]})}var Xt=T.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:4,borderWidth:1,paddingHorizontal:8,paddingVertical:4,backgroundColor:"transparent"},dot:{width:6,height:6,borderRadius:3,marginRight:6},text:{fontSize:12,fontWeight:"500"}});var ps="@tanstack/query-devtools-event";function xe(e,t){try{let r=globalThis;if(typeof r.dispatchEvent!="function"||typeof r.CustomEvent!="function")return;r.dispatchEvent(new r.CustomEvent(ps,{detail:{type:e,queryHash:t},bubbles:true,cancelable:true}))}catch{}}function Zt({query:e}){if(e.state.data===void 0){xe("RESTORE_LOADING",e.queryHash);let t=e.state,r=e.state.fetchMeta?e.state.fetchMeta.__previousQueryOptions:null;e.cancel({silent:true}),e.setState({...t,fetchStatus:"idle",fetchMeta:null}),r&&e.fetch(r)}else{xe("TRIGGER_LOADING",e.queryHash);let t=e.options;e.fetch({...t,queryFn:()=>new Promise(()=>{}),gcTime:-1}),e.setState({data:void 0,status:"pending",fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:t}})}}function er({query:e}){xe("REFETCH",e.queryHash),e.fetch().catch(()=>{})}function uo({query:e,queryClient:t}){xe("RESET",e.queryHash),t.resetQueries({queryKey:e.queryKey,exact:true})}function co({query:e,queryClient:t}){xe("REMOVE",e.queryHash),t.removeQueries(e)}function yo({query:e,queryClient:t}){xe("INVALIDATE",e.queryHash),t.invalidateQueries(e)}function tr({query:e,queryClient:t}){if(e.state.status!=="error"){xe("TRIGGER_ERROR",e.queryHash);let r=new Error("Unknown error from devtools"),o=e.options;e.setState({status:"error",error:r,fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:o}})}else xe("RESTORE_ERROR",e.queryHash),t.resetQueries(e)}import{night as gs}from"@buoy-gg/shared-ui/web";import{jsx as we,jsxs as at}from"react/jsx-runtime";function ho({query:e,setSelectedQuery:t}){let r=hs();if(e===void 0)return null;let o=e.state.status,a=se(e)==="fetching";return at(f,{style:ze.container,children:[at(f,{style:ze.section,children:[we(v,{style:ze.sectionLabel,children:"Actions"}),at(f,{style:ze.buttonsRow,children:[we(ue,{disabled:a,onClick:()=>er({query:e}),variant:"refetch",text:"Refetch"}),we(ue,{disabled:o==="pending",onClick:()=>yo({query:e,queryClient:r}),variant:"invalidate",text:"Invalidate"}),we(ue,{disabled:o==="pending",onClick:()=>uo({queryClient:r,query:e}),variant:"reset",text:"Reset"}),we(ue,{disabled:a,onClick:()=>{co({queryClient:r,query:e}),t(void 0)},variant:"remove",text:"Remove"})]})]}),at(f,{style:ze.section,children:[we(v,{style:ze.sectionLabel,children:"Triggers"}),at(f,{style:ze.buttonsRow,children:[we(ue,{disabled:false,onClick:()=>Zt({query:e}),variant:"triggerLoading",text:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading"}),we(ue,{disabled:o==="pending",onClick:()=>tr({query:e,queryClient:r}),variant:"triggerError",text:o==="error"?"Restore Error":"Trigger Error"})]})]})]})}var ze=T.create({container:{gap:16},section:{gap:8},sectionLabel:{fontSize:11,fontWeight:"600",color:gs.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},buttonsRow:{flexDirection:"row",flexWrap:"wrap",gap:8}});import{night as rr}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as or}from"react/jsx-runtime";function bs({selectedQuery:e,setSelectedQuery:t}){return or(be,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools query info scroll",style:de.flexOne,contentContainerStyle:de.scrollContent,children:[ce(f,{style:de.section,children:ce(Yt,{query:e})}),ce(f,{style:de.section,children:ce(ho,{query:e,setSelectedQuery:t})}),or(f,{style:de.section,children:[ce(v,{style:de.headerText,children:"Data Explorer"}),ce(f,{style:de.contentView,children:ce(me,{editable:true,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),or(f,{style:de.section,children:[ce(v,{style:de.headerText,children:"Query Explorer"}),ce(f,{style:de.contentView,children:ce(me,{label:"Query",value:e,defaultExpanded:["Query","queryKey"],activeQuery:e})})]})]})}var de=T.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:rr.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:rr.color.surface,borderRadius:12,borderWidth:1,borderColor:rr.color.border,padding:16}});import{buoyColors as F,night as te}from"@buoy-gg/shared-ui/web";import{jsx as ar,jsxs as vs}from"react/jsx-runtime";var Ss=({label:e,color:t,count:r,showLabel:o=true,isActive:a=false,onPress:n,onTouchStart:l,size:c="default",testID:s})=>{let u=c==="large",i=(d=>{let h={green:{bg:F.success+"15",border:F.success+"40",dot:F.success,text:F.success},yellow:{bg:F.warning+"15",border:F.warning+"40",dot:F.warning,text:F.warning},blue:{bg:F.primary+"15",border:F.primary+"40",dot:F.primary,text:F.primary},purple:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary},red:{bg:F.error+"15",border:F.error+"40",dot:F.error,text:F.error},gray:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary}};return h[d]||h.gray})(t);return vs(N,{"sentry-label":"ignore devtools query status",testID:s,accessibilityRole:"button",accessibilityLabel:`${e}, ${r}${a?", selected":""}`,accessibilityState:{selected:a},style:[qe.queryStatusTag,u&&qe.queryStatusTagLarge,a&&{backgroundColor:i.bg,borderColor:i.border}],disabled:!n,onPress:n,onPressIn:l,activeOpacity:.7,children:[ar(f,{style:[qe.dot,u&&qe.dotLarge,{backgroundColor:i.dot}]}),o&&ar(v,{style:[qe.label,u&&qe.labelLarge,a&&{color:i.text}],numberOfLines:1,ellipsizeMode:"tail",children:e}),r>0&&ar(v,{testID:s?`${s}-count`:void 0,style:[qe.count,u&&qe.countLarge,{color:i.dot}],numberOfLines:1,children:r})]})},qe=T.create({queryStatusTag:{flexDirection:"row",alignItems:"center",backgroundColor:te.color.buttonSurface,borderRadius:13,paddingHorizontal:10,paddingVertical:5,height:26,gap:6,borderWidth:1,borderColor:te.color.border},queryStatusTagLarge:{borderRadius:16,paddingHorizontal:13,paddingVertical:6,height:32,gap:7},dot:{width:6,height:6,borderRadius:3},dotLarge:{width:8,height:8,borderRadius:4},label:{fontSize:11,fontWeight:"500",color:te.color.textSecondary,fontFamily:"system"},labelLarge:{fontSize:13,fontWeight:"600",letterSpacing:.2,fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},count:{fontSize:11,fontVariant:["tabular-nums"],fontWeight:"600",marginLeft:"auto",fontFamily:"system"},countLarge:{fontSize:13,fontWeight:"700",fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),re=Ss;import{ChipStrip as Cs,useChipTap as xs}from"@buoy-gg/shared-ui/web";import{useEffect as fo,useState as mo}from"react";import{useQueryClient as po}from"@tanstack/react-query";function ws(){let e=po(),[t,r]=mo({fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});return fo(()=>{let o=()=>{let n=e.getQueryCache().getAll().reduce((l,c)=>{let s=se(c);return l[s]=(l[s]||0)+1,l},{fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});setTimeout(()=>r(n),0)};o();let a=e.getQueryCache().subscribe(o);return()=>a()},[e]),t}var go=ws;function qs(){let e=po(),[t,r]=mo({pending:0,success:0,error:0,paused:0,idle:0});return fo(()=>{let o=()=>{let n=e.getMutationCache().getAll().reduce((l,c)=>{let s=c.state.status;if(c.state.isPaused)l.paused++;else switch(s){case"idle":l.idle++;break;case"pending":l.pending++;break;case"success":l.success++;break;case"error":l.error++;break}return l},{pending:0,success:0,error:0,paused:0,idle:0});setTimeout(()=>r(n),0)};o();let a=e.getMutationCache().subscribe(o);return()=>a()},[e]),t}import{jsx as nt,jsxs as Ms}from"react/jsx-runtime";var Ts=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{fresh:o,stale:a,fetching:n,paused:l,inactive:c}=go(),{scrollProps:s,onTouchStart:u,isTap:i}=xs(),d=(h,g)=>{i(g)&&t&&t(e===h?null:h)};return Ms(Cs,{scrollProps:s,sentryLabel:"ignore devtools query status count scroll",children:[nt(re,{label:"Fresh",color:"green",count:o,isActive:e==="fresh",onPress:h=>d("fresh",h),onTouchStart:u,testID:"buoy-rq-status-fresh",showLabel:true,size:r}),nt(re,{label:"Loading",color:"blue",count:n,isActive:e==="fetching",onPress:h=>d("fetching",h),onTouchStart:u,testID:"buoy-rq-status-fetching",showLabel:true,size:r}),nt(re,{label:"Paused",color:"purple",count:l,isActive:e==="paused",onPress:h=>d("paused",h),onTouchStart:u,testID:"buoy-rq-status-paused",showLabel:true,size:r}),nt(re,{label:"Stale",color:"yellow",count:a,isActive:e==="stale",onPress:h=>d("stale",h),onTouchStart:u,testID:"buoy-rq-status-stale",showLabel:true,size:r}),nt(re,{label:"Idle",color:"gray",count:c,isActive:e==="inactive",onPress:h=>d("inactive",h),onTouchStart:u,testID:"buoy-rq-status-inactive",showLabel:true,size:r})]})},bo=Ts;import{useState as As,useRef as nr,useMemo as Es,useCallback as Rs}from"react";import{QueryIcon as Ds,CheckCircle as ks,Activity as Is,Pause as Qs,XCircle as Fs,buoyColors as Mt}from"@buoy-gg/shared-ui/web";import{jsx as it}from"react/jsx-runtime";function Ps({size:e=24}){return it(Ds,{size:e})}function Os({size:e=14,color:t=Mt.success,strokeWidth:r=2}){return it(ks,{size:e,color:t,strokeWidth:r})}function zs({size:e=14,color:t=Mt.warning,strokeWidth:r=2}){return it(Is,{size:e,color:t,strokeWidth:r})}function Ks({size:e=14,color:t=Mt.textMuted,strokeWidth:r=2}){return it(Qs,{size:e,color:t,strokeWidth:r})}function Ls({size:e=14,color:t=Mt.error,strokeWidth:r=2}){return it(Fs,{size:e,color:t,strokeWidth:r})}import{buoyColors as st,night as Ke,useRelativeTime as Bs,monoFont as vo}from"@buoy-gg/shared-ui/web";import{jsx as oe,jsxs as Tt}from"react/jsx-runtime";var Hs=e=>e.options.mutationKey&&(Array.isArray(e.options.mutationKey)?e.options.mutationKey:[e.options.mutationKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Anonymous Mutation";function So({mutation:e,setSelectedMutation:t,selected:r}){let o=new Date(e.state.submittedAt).toLocaleTimeString(),a=(()=>{if(e.state.submittedAt&&e.state.submittedAt>0)return e.state.submittedAt;let u=e.state;return u.updatedAt&&u.updatedAt>0?u.updatedAt:null})(),n=Bs(a)||`N/A (${e.state.submittedAt||0})`,l=(()=>{if(e.state.isPaused)return{status:"Paused",color:st.textMuted,icon:oe(Ks,{})};switch(e.state.status){case"success":return{status:"Success",color:st.success,icon:oe(Os,{})};case"error":return{status:"Error",color:st.error,icon:oe(Ls,{})};case"pending":return{status:"Loading",color:st.primary,icon:oe(zs,{})};default:return{status:"Idle",color:st.textMuted,icon:null}}})(),c=Hs(e),s=Ki(e.options.mutationKey,e.mutationId);return Tt(N,{"sentry-label":"ignore devtools mutation button",testID:s,accessibilityRole:"button",accessibilityLabel:`${c}, ${l.status}`,onPress:()=>t(e===r?void 0:e),style:[_.button,r?.mutationId===e.mutationId&&_.selected],children:[Tt(f,{style:_.rowContent,children:[Tt(f,{style:_.statusSection,children:[oe(f,{style:[_.statusDot,{backgroundColor:l.color}]}),Tt(f,{style:_.statusInfo,children:[oe(v,{testID:`${s}-status`,style:[_.statusLabel,{color:l.color}],children:l.status}),oe(v,{style:_.submittedText,children:o})]})]}),oe(f,{style:_.mutationSection,children:oe(v,{testID:`${s}-key`,style:_.mutationKey,children:c})})]}),oe(f,{style:_.bottomRightContainer,children:oe(v,{style:_.bottomRightText,children:n})})]})}var _=T.create({button:{backgroundColor:Ke.color.surface,borderRadius:8,borderWidth:1,borderColor:Ke.color.border,marginHorizontal:8,marginVertical:3,padding:12},selected:{backgroundColor:Ke.color.accentSoft,borderColor:Ke.color.accentBorderStrong},rowContent:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},statusSection:{flexDirection:"row",alignItems:"center",gap:8,flex:1},statusDot:{width:8,height:8,borderRadius:4},statusInfo:{flex:1},statusLabel:{fontSize:11,fontWeight:"600",lineHeight:14},submittedText:{fontSize:10,color:Ke.color.textTertiary,marginTop:1},mutationSection:{flex:2,paddingHorizontal:12},mutationKey:{fontFamily:vo,fontSize:12,color:Ke.color.text,lineHeight:16},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:Ke.color.textTertiary,fontFamily:vo}});import{displayValue as js,night as J,monoFont as At}from"@buoy-gg/shared-ui/web";import{buoyColors as G,monoFont as Ws}from"@buoy-gg/shared-ui/web";import{jsx as Co}from"react/jsx-runtime";var $s={success:G.success+"15",error:G.error+"15",pending:G.primary+"15",idle:G.textMuted+"1A"},Vs={success:G.success+"33",error:G.error+"33",pending:G.primary+"33",idle:G.textMuted+"33"},Ns={success:G.success,error:G.error,pending:G.primary,idle:G.textMuted};function xo({status:e,testID:t}){let r=e,o=$s[r],a=Vs[r],n=Ns[r];return Co(f,{style:[wo.container,{backgroundColor:o,borderColor:a}],children:Co(v,{testID:t,style:[wo.text,{color:n}],children:e})})}var wo=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:Ws}});import{jsx as _e,jsxs as ir}from"react/jsx-runtime";function sr({selectedMutation:e}){if(e===void 0)return null;let t=new Date(e.state.submittedAt).toLocaleTimeString();return ir(f,{style:Me.minWidth,children:[_e(v,{style:Me.headerText,children:"Mutation Details"}),ir(f,{style:Me.row,children:[_e(be,{"sentry-label":"ignore devtools mutation details scroll",horizontal:true,style:Me.flex1,children:_e(v,{testID:"buoy-rq-mutation-detail-key",style:Me.flexWrap,children:`${e.options.mutationKey?js(e.options.mutationKey,true):"No mutationKey found"}`})}),_e(xo,{status:e.state.status,testID:"buoy-rq-mutation-detail-status"})]}),ir(f,{style:Me.row,children:[_e(v,{style:Me.labelText,children:"Submitted At:"}),_e(v,{style:Me.valueText,children:t})]})]})}var Me=T.create({minWidth:{minWidth:200,backgroundColor:J.color.surface,borderRadius:6,borderWidth:1,borderColor:J.color.accent+"4D",overflow:"hidden",shadowColor:J.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:J.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:J.color.accent,borderBottomWidth:1,borderBottomColor:J.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:At},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:J.color.separator},flex1:{flex:1,marginRight:8},flexWrap:{fontSize:12,color:J.color.text,fontFamily:At,lineHeight:18,flexShrink:1,backgroundColor:J.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:J.color.accent+"4D"},labelText:{fontSize:10,color:J.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:At},valueText:{fontSize:12,color:J.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:At}});import{night as lt,monoFont as Us}from"@buoy-gg/shared-ui/web";import{jsx as j,jsxs as ut}from"react/jsx-runtime";function qo({selectedMutation:e}){return ut(be,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools mutation information scroll",style:O.flex1,contentContainerStyle:O.scrollContent,children:[j(f,{style:O.section,children:j(sr,{selectedMutation:e})}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Variables Details"}),j(f,{style:O.padding,children:j(me,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Context Details"}),j(f,{style:O.padding,children:j(me,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Data Explorer"}),j(f,{style:O.padding,children:j(me,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),ut(f,{style:O.section,children:[j(v,{style:O.textHeader,children:"Mutations Explorer"}),j(f,{style:O.padding,children:j(me,{label:"Mutation",defaultExpanded:["Mutation"],value:e})})]})]})}var O=T.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:lt.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:lt.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:lt.color.accent+"33",fontFamily:Us,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:lt.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:lt.color.border,borderTopWidth:0}});import{useCallback as Mo,useEffect as _s,useRef as To,useState as Js}from"react";import{useQueryClient as Gs}from"@tanstack/react-query";function Ys(){let e=Gs(),[t,r]=Js(()=>e.getMutationCache().getAll()),o=To(new Map),a=To(void 0),n=Mo(c=>{let s=o.current;if(c.length!==s.size)return true;for(let u of c){let i=s.get(u.mutationId);if(!i||i.status!==u.state.status||i.submittedAt!==u.state.submittedAt||i.isPaused!==u.state.isPaused)return true}return false},[]),l=Mo(()=>{let c=e.getMutationCache().getAll();if(n(c)){let s=new Map;c.forEach(u=>{s.set(u.mutationId,u.state)}),o.current=s,r(c)}},[e,n]);return _s(()=>{l();let c=e.getMutationCache().subscribe(s=>{(s.type==="added"||s.type==="removed"||s.type==="updated")&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{l()},10))});return()=>{c(),a.current&&clearTimeout(a.current)}},[e,l]),{mutations:t}}var Ao=Ys;import{night as Le,ToolEmptyState as Xs,monoFont as Zs}from"@buoy-gg/shared-ui/web";import{jsx as Te,jsxs as Eo}from"react/jsx-runtime";function Ro({selectedMutation:e,setSelectedMutation:t,activeFilter:r,hideInfoPanel:o=false,contentContainerStyle:a,searchText:n=""}){let{mutations:l}=Ao(),c=S=>S.state.isPaused?"paused":S.state.status,s=Es(()=>{let S=l;if(r&&(S=S.filter(w=>c(w)===r)),n){let w=n.toLowerCase();S=S.filter(C=>{let q=C.options.mutationKey;return q?(Array.isArray(q)?q:[q]).filter(A=>A!=null).map(A=>String(A)).join(" ").toLowerCase().includes(w):false})}return S},[l,r,n]),u=Ir.get("window").height,i=u*.4,d=150,h=u*.7,g=nr(new Z.Value(i)).current,[,y]=As(i),m=nr(i),b=nr($t.create({onMoveShouldSetPanResponder:(S,w)=>Math.abs(w.dy)>Math.abs(w.dx)&&Math.abs(w.dy)>10,onPanResponderGrant:()=>{g.stopAnimation(S=>{y(S),m.current=S,g.setValue(S)})},onPanResponderMove:(S,w)=>{let C=m.current-w.dy,q=Math.max(d,Math.min(h,C));g.setValue(q)},onPanResponderRelease:(S,w)=>{let C=Math.max(d,Math.min(h,m.current-w.dy));y(C),m.current=C,Z.timing(g,{toValue:C,duration:200,useNativeDriver:false}).start(()=>{g.setValue(C),y(C),m.current=C})}})).current,p=Rs(({item:S})=>Te(So,{selected:e,setSelectedMutation:t,mutation:S}),[e,t]);return Eo(f,{style:Be.container,children:[s.length>0?Te(f,{style:Be.listWrapper,children:Te(Vt,{keyboardShouldPersistTaps:"handled","sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:s,renderItem:p,keyExtractor:(S,w)=>`${S.mutationId}-${S.state.submittedAt}-${S.state.status}-${w}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process<"u"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:a||Be.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):Te(Xs,{testID:"buoy-rq-mutations-empty",otto:r?"filtering":"scanning",title:"No mutations found",message:r?`No ${r} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),e&&!o&&Eo(Z.View,{style:[Be.mutationInfo,{height:g}],children:[Te(f,{style:Be.dragHandle,...b.panHandlers,children:Te(f,{style:Be.dragIndicator})}),Te(f,{style:Be.mutationInfoContent,children:Te(qo,{selectedMutation:e})})]})]})}var Be=T.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:Le.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:Le.color.surface,borderBottomWidth:1,borderBottomColor:Le.color.border},dragIndicator:{width:40,height:4,backgroundColor:Le.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Le.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Le.color.border},emptyText:{color:Le.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Zs,letterSpacing:.5}});import{ChipStrip as el,useChipTap as tl}from"@buoy-gg/shared-ui/web";import{jsx as Et,jsxs as rl}from"react/jsx-runtime";var ol=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{pending:o,success:a,error:n,paused:l}=qs(),{scrollProps:c,onTouchStart:s,isTap:u}=tl(),i=(d,h)=>{u(h)&&t&&t(e===d?null:d)};return rl(el,{scrollProps:c,sentryLabel:"ignore devtools mutation status count scroll",children:[Et(re,{label:"Pending",color:"blue",count:o,isActive:e==="pending",onPress:d=>i("pending",d),onTouchStart:s,testID:"buoy-rq-mstatus-pending",showLabel:true,size:r}),Et(re,{label:"Success",color:"green",count:a,isActive:e==="success",onPress:d=>i("success",d),onTouchStart:s,testID:"buoy-rq-mstatus-success",showLabel:true,size:r}),Et(re,{label:"Error",color:"red",count:n,isActive:e==="error",onPress:d=>i("error",d),onTouchStart:s,testID:"buoy-rq-mstatus-error",showLabel:true,size:r}),Et(re,{label:"Paused",color:"purple",count:l,isActive:e==="paused",onPress:d=>i("paused",d),onTouchStart:s,testID:"buoy-rq-mstatus-paused",showLabel:true,size:r})]})},Do=ol;import{Trash as al,night as Je}from"@buoy-gg/shared-ui/web";import{jsx as ko}from"react/jsx-runtime";var nl=({type:e,onClear:t,disabled:r=false})=>ko(N,{"sentry-label":"ignore devtools clear cache button",style:[Io.button,r&&Io.disabledButton],onPress:t,disabled:r,activeOpacity:.7,accessibilityLabel:`Clear ${e} cache`,accessibilityRole:"button",accessibilityState:{disabled:r},children:ko(al,{size:16,strokeWidth:2,color:r?Je.color.textTertiary:Je.color.warning})}),Io=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:Je.color.warningSoft,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:Je.color.warning+"33"},disabledButton:{opacity:.5,backgroundColor:Je.color.fill,borderColor:Je.color.border}}),il=nl;import{Wifi as Qo,buoyColors as Fo}from"@buoy-gg/shared-ui/web";import{jsx as lr}from"react/jsx-runtime";var sl=({isOffline:e,onToggle:t})=>lr(N,{"sentry-label":"ignore devtools network toggle button",style:[Po.button,e&&Po.offlineButton],onPress:t,activeOpacity:.7,accessibilityLabel:e?"Unset offline mocking behavior":"Mock offline behavior",accessibilityRole:"button",accessibilityState:{selected:e},children:e?lr(Qo,{size:16,color:Fo.error,strokeWidth:2}):lr(Qo,{size:16,color:Fo.success,strokeWidth:2})}),Po=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:"rgba(16, 185, 129, 0.2)"},offlineButton:{backgroundColor:"rgba(239, 68, 68, 0.1)",borderColor:"rgba(239, 68, 68, 0.2)"}}),ll=sl;import{ChipStrip as ul,useChipTap as cl}from"@buoy-gg/shared-ui/web";import{jsx as Oo}from"react/jsx-runtime";var zo=["mmkv","async","secure"],dl=({activeStorageTypes:e=new Set(zo),onStorageTypesChange:t,counts:r})=>{let{scrollProps:o,onTouchStart:a,isTap:n}=cl(),l=(c,s)=>{if(n(s)&&t){let u=new Set(e);u.has(c)?u.delete(c):u.add(c),t(u)}};return Oo(ul,{scrollProps:o,sentryLabel:"ignore devtools storage status count scroll",children:zo.map(c=>{let s=r?.[c]??0;return Oo(re,{label:Zr(c),color:eo(c),count:s,isActive:e.has(c),onPress:u=>l(c,u),onTouchStart:a,showLabel:true},c)})})},yl=dl;import{night as hl,monoFont as fl}from"@buoy-gg/shared-ui/web";import{jsx as Ko,jsxs as ml}from"react/jsx-runtime";function pl({totalCount:e,filteredCount:t,onPress:r}){if(t===e)return null;let o=Ko(f,{style:Lo.container,children:ml(v,{testID:"buoy-rq-filter-badge",style:Lo.text,children:["Showing ",t," of ",e]})});return r?Ko(N,{testID:"buoy-rq-filter-badge-button",accessibilityRole:"button",accessibilityLabel:`Showing ${t} of ${e}, open filters`,onPress:r,activeOpacity:.7,children:o}):o}var Lo=T.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:2},text:{fontSize:9,color:hl.color.textTertiary,fontFamily:fl}});import{jsx as Bo,jsxs as gl}from"react/jsx-runtime";function Ho({selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:o="",ignoredPatterns:a=new Set,includedPatterns:n=new Set,onFilterPress:l}){let c=n.size>0,s=a.size>0,u=xt(),i=Fi(()=>{let d=u;return n.size>0&&(d=d.filter(h=>{if(!h?.queryKey)return false;let g=(Array.isArray(h.queryKey)?h.queryKey:[h.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return Array.from(n).some(y=>g.includes(y.toLowerCase()))})),a.size>0&&(d=d.filter(h=>{if(!h?.queryKey)return true;let g=(Array.isArray(h.queryKey)?h.queryKey:[h.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return!Array.from(a).some(y=>g.includes(y.toLowerCase()))})),d.length},[u,n,a]);return gl(f,{style:jo.queryListContainer,children:[(c||s)&&Bo(pl,{totalCount:u.length,filteredCount:i,onPress:l}),Bo(oo,{selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:o,ignoredPatterns:a,includedPatterns:n,emptyState:Qi({subject:"queries",verb:"active",search:o,total:u.length,blocked:r?`No ${r} queries. Pick another status to see the rest.`:c?`No queries match your "include only" filters. ${n.size} pattern(s) active.`:s?`No queries match the current filters. ${a.size} pattern(s) excluded.`:void 0,waiting:{otto:"scanning",title:"No queries found",message:`No React Query queries are currently active.
2
2
 
3
3
  To see queries here:
4
4
  \u2022 Make API calls using useQuery
5
5
  \u2022 Ensure queries are within QueryClientProvider
6
- \u2022 Check console for debugging info`}}),contentContainerStyle:jo.queryListContent})]})}var jo=T.create({queryListContainer:{flex:1,backgroundColor:"transparent"},queryListContent:{padding:8,backgroundColor:"transparent",flexGrow:1}});import{ToolFooter as bl,useSafeAreaInsets as vl}from"@buoy-gg/shared-ui/web";import{jsx as ur}from"react/jsx-runtime";function Wo({activeFilter:e,onFilterChange:t,isFloatingMode:r=true,size:o="default"}){let a=vl({minBottom:16});return ur(bl,{floating:r,safeArea:false,paddingBottom:r?0:a.bottom,style:$o.filterFooter,children:ur(f,{style:$o.filterContainer,children:ur(bo,{activeFilter:e,onFilterChange:t,size:o})})})}var $o=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{useCallback as Sl,useMemo as ct}from"react";import{DynamicFilterView as Cl,buoyColors as Ae,monoFont as xl,night as cr}from"@buoy-gg/shared-ui/web";import{XCircle as Vo,Clock as dr,RefreshCw as wl,Globe as ql,Zap as Ml,Filter as Tl,Eye as Al}from"@buoy-gg/shared-ui/web";import{jsx as yr}from"react/jsx-runtime";var El=()=>false;function Rl({queries:e,activeFilter:t,onFilterChange:r,ignoredPatterns:o,onPatternToggle:a,includedPatterns:n,onIncludedPatternToggle:l,isTeamPattern:c=El}){let s=Sl(y=>c(y)?yr(f,{accessibilityLabel:"Set by your team on buoy.gg",style:[No.teamBadge,{borderColor:`${cr.color.accent}60`,backgroundColor:`${cr.color.accent}15`}],children:yr(v,{style:[No.teamBadgeText,{color:cr.color.accent}],children:"TEAM"})}):null,[c]),u=ct(()=>{let y={all:e.length,disabled:0,fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0};return e.forEach(m=>{let b=se(m);b==="disabled"?y.disabled++:b==="error"?y.error++:b==="fresh"?y.fresh++:b==="stale"?y.stale++:b==="fetching"?y.fetching++:b==="paused"?y.paused++:b==="inactive"&&y.inactive++}),y},[e]),i=ct(()=>{let y=new Set;return e.forEach(m=>{if(!m?.queryKey)return;(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).forEach(b=>{if(b!=null){let p=String(b);/^\d+$/.test(p)||y.add(p)}})}),Array.from(y).sort().slice(0,50)},[e]),d=ct(()=>i,[i]),h=ct(()=>{let y=e;return n.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return Array.from(n).some(p=>b.includes(p.toLowerCase()))})),o.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return!Array.from(o).some(p=>b.includes(p.toLowerCase()))})),y.length},[e,n,o]),g=ct(()=>({filterSummarySection:{enabled:true,totalCount:e.length,filteredCount:h,includePatterns:n,excludePatterns:o},sections:[{id:"status",title:"Status",type:"status",data:[{id:"status::all",label:"All",count:u.all,icon:ql,color:Ae.primary,isActive:!t||t==="all"},{id:"status::disabled",label:"Disabled",count:u.disabled,icon:Vo,color:Ae.textMuted,isActive:t==="disabled"},{id:"status::fresh",label:"Fresh",count:u.fresh,icon:Ml,color:Ae.success,isActive:t==="fresh"},{id:"status::stale",label:"Stale",count:u.stale,icon:dr,color:Ae.warning,isActive:t==="stale"},{id:"status::fetching",label:"Fetching",count:u.fetching,icon:wl,color:Ae.primary,isActive:t==="fetching"},{id:"status::paused",label:"Paused",count:u.paused,icon:dr,color:Ae.textMuted,isActive:t==="paused"},{id:"status::inactive",label:"Inactive",count:u.inactive,icon:dr,color:Ae.textSecondary,isActive:t==="inactive"},{id:"status::error",label:"Error",count:u.error,icon:Vo,color:Ae.error,isActive:t==="error"}]}],addFilterSection:{enabled:true,placeholder:"Enter pattern to exclude...",title:"EXCLUDE FILTERS",icon:Tl},includeOnlySection:{enabled:true,title:"INCLUDE ONLY FILTERS",description:"Show ONLY queries matching these patterns. All non-matching queries will be hidden.",placeholder:"Enter pattern to include...",icon:Al,patterns:n,onPatternToggle:l,onPatternAdd:l,renderPatternMeta:s},availableItemsSection:{enabled:true,title:"AVAILABLE QUERY KEYS",emptyMessage:"No queries found. Query keys will appear here once queries are active.",items:d},howItWorksSection:{enabled:true,title:"HOW QUERY FILTERS WORK",description:"There are two types of query key filters:",examples:["","INCLUDE ONLY (green):","\u2022 Shows ONLY queries matching the pattern","\u2022 Example: 'rewards' \u2192 shows only reward queries","\u2022 When active, non-matching queries are hidden","","EXCLUDE (blue):","\u2022 Hides queries matching the pattern","\u2022 Example: 'analytics' \u2192 hides analytics queries","","Filters are case-insensitive and match partial keys."]},activePatterns:o,renderPatternMeta:s}),[u,t,o,n,d,l,e.length,h,s]);return yr(Cl,{...g,onFilterChange:y=>{let[m,b]=y.split("::");m==="status"?r(b==="all"||t===b?null:b):m==="suggestion"&&a(b)},onPatternToggle:a,onPatternAdd:a})}var No=T.create({teamBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:6,borderWidth:1},teamBadgeText:{fontSize:9,fontFamily:xl,fontWeight:"700",letterSpacing:.5}});import{useState as dt,useCallback as yt,useEffect as Rt,useMemo as Uo,useRef as _o}from"react";import{devToolsStorageKeys as Ee,persistentStorage as Dt,useTeamList as Jo}from"@buoy-gg/shared-ui/web";import{jsx as pe,jsxs as Dl}from"react/jsx-runtime";function Go({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:o,onMinimize:a,activeFilter:n,onFilterChange:l,enableSharedModalDimensions:c=false,onTabChange:s,searchText:u="",onSearchChange:i}){let d=fn(),h=Er(t),g=xt(),y=yt(()=>{d.getQueryCache().clear()},[d]),[m,b]=dt(null),p=n??m,S=l??b,[w,C]=dt(false),[q,A]=dt(new Set),[$,Qe]=dt(new Set),M=_o(null),ae=_o(null);Rt(()=>{(async()=>{try{let x=await Dt.getItem(Ee.reactQuery.ignoredPatterns());if(x){let D=JSON.parse(x);Array.isArray(D)&&(M.current=JSON.stringify(Array.from(new Set(D))),A(new Set(D)))}}catch(x){console.error("[Buoy]","Failed to load ignored patterns:",x)}finally{M.current??(M.current="[]")}})()},[]),Rt(()=>{(async()=>{try{let x=await Dt.getItem(Ee.reactQuery.includedPatterns());if(x){let D=JSON.parse(x);Array.isArray(D)&&(ae.current=JSON.stringify(Array.from(new Set(D))),Qe(new Set(D)))}}catch(x){console.error("[Buoy]","Failed to load included patterns:",x)}finally{ae.current??(ae.current="[]")}})()},[]),Rt(()=>{let x=JSON.stringify(Array.from(q));if(M.current===null||M.current===x)return;M.current=x,(async()=>{try{await Dt.setItem(Ee.reactQuery.ignoredPatterns(),x)}catch(D){console.error("[Buoy]","Failed to save ignored patterns:",D)}})()},[q]),Rt(()=>{let x=JSON.stringify(Array.from($));if(ae.current===null||ae.current===x)return;ae.current=x,(async()=>{try{await Dt.setItem(Ee.reactQuery.includedPatterns(),x)}catch(D){console.error("[Buoy]","Failed to save included patterns:",D)}})()},[$]);let ye=Jo(Ee.reactQuery.ignoredPatterns()),he=Jo(Ee.reactQuery.includedPatterns()),ne=Uo(()=>ye.length?new Set([...q,...ye]):q,[q,ye]),ie=Uo(()=>he.length?new Set([...$,...he]):$,[$,he]),mt=yt(x=>ye.includes(x)&&!q.has(x)||he.includes(x)&&!$.has(x),[ye,he,q,$]),pt=yt(x=>{A(D=>{if(!D.has(x)&&ye.includes(x))return D;let fe=new Set(D);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[ye]),Ht=yt(x=>{Qe(D=>{if(!D.has(x)&&he.includes(x))return D;let fe=new Set(D);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[he]),[gt,Ya]=dt("bottomSheet"),Xa=c?Ee.reactQuery.modal():Ee.reactQuery.browserModal(),Za=yt(x=>{Ya(x)},[]),en=pn({minBottom:16}),tn=gt==="floating"?56:48+en.bottom;if(!e)return null;let rn=()=>{if(w){let x=[{key:"filters",label:"Filters"}];return Dl(jt,{children:[pe(jt.Navigation,{onBack:()=>C(false)}),pe(jt.Content,{title:"",noMargin:true,children:pe(gn,{tabs:x,activeTab:"filters",testIDPrefix:"buoy-rq-filterview-tab",onTabChange:()=>{}})})]})}return pe(ot,{selectedQuery:h,activeTab:"queries",onTabChange:s,onBack:()=>r(void 0),searchText:u,onSearchChange:i,onFilterPress:()=>C(true),hasActiveFilters:p!==null||ne.size>0||ie.size>0,onClearCache:y})},on=pe(Wo,{activeFilter:p,onFilterChange:S,isFloatingMode:gt==="floating"});return pe(mn,{visible:e,onClose:o,onMinimize:a,persistenceKey:Xa,header:{customContent:rn(),showToggleButton:true},onModeChange:Za,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:!w,styles:{},footer:w?void 0:on,footerHeight:w?void 0:tn,children:pe(f,{style:kl.container,children:w?pe(Rl,{queries:g,activeFilter:p,onFilterChange:S,ignoredPatterns:ne,onPatternToggle:pt,includedPatterns:ie,onIncludedPatternToggle:Ht,isTeamPattern:mt}):pe(Ho,{selectedQuery:h,onQuerySelect:r,activeFilter:p,searchText:u,ignoredPatterns:ne,includedPatterns:ie,onFilterPress:()=>C(true)})})})}var kl=T.create({container:{flex:1,backgroundColor:"transparent"}});import{JsModal as Il,devToolsStorageKeys as Yo,useSafeAreaInsets as Ql}from"@buoy-gg/shared-ui/web";import{useQueryClient as Xo}from"@tanstack/react-query";import{useSafeAreaInsets as Zo,night as z,monoFont as ea}from"@buoy-gg/shared-ui/web";import{useMemo as Fl}from"react";function hr(e,t,r){return Fl(()=>{let o=e.state.status;return[{label:"Refetch",variant:"refetch",disabled:se(e)==="fetching",onPress:()=>er({query:e})},{label:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading",variant:"triggerLoading",disabled:false,onPress:()=>Zt({query:e})},{label:o==="error"?"Restore Error":"Trigger Error",variant:"triggerError",disabled:o==="pending",onPress:()=>tr({query:e,queryClient:t})}]},[e,t,r])}import{DataViewer as Pl}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Ol,jsx as k,jsxs as Ge}from"react/jsx-runtime";function ta({selectedQuery:e,isFloatingMode:t,disableInternalFooter:r=false,queryVersion:o}){let a=Zo({minBottom:16}),n=Xo(),l=hr(e,n,o);return Ge(Ol,{children:[Ge(be,{testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:I.explorerScrollContainer,contentContainerStyle:[I.explorerScrollContent,!r&&{paddingBottom:72}],children:[Ge(f,{style:I.section,children:[k(Kl,{visible:!!e.state.data,selectedQuery:e,queryVersion:o}),k(Ll,{visible:!e.state.data,selectedQuery:e})]}),k(f,{style:I.section,children:k(Yt,{query:e})}),k(f,{style:I.section,children:Ge(f,{style:I.queryExplorerContainer,children:[k(v,{testID:"buoy-rq-query-explorer-header",style:I.queryExplorerHeader,children:"Query Explorer"}),k(f,{style:I.queryExplorerContent,children:k(Pl,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&k(f,{style:[I.actionFooter,{paddingBottom:t?0:a.bottom+8}],children:k(f,{style:I.actionsRow,children:l.map((c,s)=>k(ue,{testID:`buoy-rq-action-${c.variant}`,onClick:c.onPress,text:c.label,variant:c.variant,disabled:c.disabled},s))})})]})}function zl({selectedQuery:e,isFloatingMode:t,queryVersion:r}){let o=Zo({minBottom:16}),a=Xo(),n=hr(e,a,r);return k(f,{style:[I.actionFooter,{paddingBottom:t?0:o.bottom+8}],children:k(f,{style:I.actionsRow,children:n.map((l,c)=>k(ue,{testID:`buoy-rq-action-${l.variant}`,onClick:l.onPress,text:l.label,variant:l.variant,disabled:l.disabled},c))})})}function Kl({visible:e,selectedQuery:t,queryVersion:r=0}){return e?Ge(f,{style:I.dataContainer,children:[k(v,{testID:"buoy-rq-data-header",style:I.dataHeader,children:"Data Editor"}),k(f,{style:I.dataContent,children:k(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"],activeQuery:t,dataVersion:r})})]}):null}function Ll({visible:e,selectedQuery:t}){if(!e)return null;let r=()=>t.isDisabled()?{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}:t.state.status==="pending"||se(t)==="fetching"?{title:t.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}:t.state.status==="error"?{title:"Query Error",description:t.state.error?.message||"An error occurred while fetching data."}:{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."},{title:o,description:a}=r();return Ge(f,{style:I.emptyState,children:[k(v,{testID:"buoy-rq-detail-empty-title",style:I.emptyTitle,children:o}),k(v,{testID:"buoy-rq-detail-empty-description",style:I.emptyDescription,children:a})]})}var I=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:z.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:z.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:z.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:z.color.surface,borderRadius:6,borderWidth:1,borderColor:z.color.accent+"4D",overflow:"hidden",shadowColor:z.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:z.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:z.color.accent,borderBottomWidth:1,borderBottomColor:z.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ea},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:z.color.surface,borderRadius:6,borderWidth:1,borderColor:z.color.accent+"4D",overflow:"hidden",shadowColor:z.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:z.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:z.color.accent,borderBottomWidth:1,borderBottomColor:z.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ea},dataContent:{padding:8}});import{useState as Bl,useCallback as Hl,useEffect as jl,useRef as Wl}from"react";import{jsx as kt}from"react/jsx-runtime";function ra({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:o,onMinimize:a,enableSharedModalDimensions:n=false,onTabChange:l}){let{query:c,version:s}=Wt(t),[u,i]=Bl("bottomSheet"),d=t?JSON.stringify(t):void 0,h=Wl(void 0);jl(()=>{if(c){h.current=d;return}e&&h.current!==void 0&&h.current===d&&(h.current=void 0,r(void 0))},[e,c,d,r]);let g=Hl(w=>{i(w)},[]),y=Ql({minBottom:16}),m=u==="floating"?72:80+y.bottom,b=()=>kt(ot,{selectedQuery:c,activeTab:"queries",onTabChange:l,onBack:()=>r(void 0)}),p=n?Yo.reactQuery.modal():`${Yo.reactQuery.modal()}_data_editor`;if(!e||!c)return null;let S=kt(zl,{selectedQuery:c,isFloatingMode:u==="floating",queryVersion:s},`footer-${s}`);return kt(Il,{visible:e,onClose:o,onMinimize:a,persistenceKey:p,header:{customContent:b(),showToggleButton:true},onModeChange:g,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:S,footerHeight:m,children:kt(ta,{selectedQuery:c,isFloatingMode:u==="floating",disableInternalFooter:true,queryVersion:s})})}import{useQueryClient as $l}from"@tanstack/react-query";import{useCallback as fr,useState as oa,useRef as aa}from"react";import{useEffect as Vl,useState as Nl}from"react";import{useQueryClient as Ul}from"@tanstack/react-query";function mr(e){let t=Ul(),[r,o]=Nl(void 0);return Vl(()=>{let a=()=>{if(e!==void 0){let l=t.getMutationCache().getAll().find(c=>c.mutationId===e);o(l)}else o(void 0)};setTimeout(a,0);let n=t.getMutationCache().subscribe(a);return()=>n()},[t,e]),r}import{jsx as na}from"react/jsx-runtime";function ia({selectedMutation:e,onMutationSelect:t,activeFilter:r,searchText:o=""}){let a=n=>{t(typeof n=="function"?n(e):n)};return na(f,{style:sa.mutationListContainer,children:na(Ro,{selectedMutation:e,setSelectedMutation:a,activeFilter:r,searchText:o,hideInfoPanel:true,contentContainerStyle:sa.mutationListContent})})}var sa=T.create({mutationListContainer:{flex:1,backgroundColor:"transparent"},mutationListContent:{padding:8,backgroundColor:"transparent"}});import{ToolFooter as _l,useSafeAreaInsets as Jl}from"@buoy-gg/shared-ui/web";import{useMemo as Gl}from"react";import{jsx as pr}from"react/jsx-runtime";function la({activeFilter:e,onFilterChange:t,modalMode:r,size:o="default"}){let a=r==="floating",n=Jl({minBottom:16}),l=Gl(()=>a?0:n.bottom,[a,n.bottom]);return pr(_l,{floating:a,safeArea:false,paddingBottom:l,style:ua.filterFooter,children:pr(f,{style:ua.filterContainer,children:pr(Do,{activeFilter:e,onFilterChange:t,size:o})})},`footer-${a?"floating":"docked"}`)}var ua=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{JsModal as Yl,useSafeAreaInsets as Xl}from"@buoy-gg/shared-ui/web";import{absoluteFill as Zl}from"@buoy-gg/shared-ui/web";import{useMemo as W}from"react";import{ChevronLeft as eu,ChevronRight as tu,night as It}from"@buoy-gg/shared-ui/web";import{jsx as Ye,jsxs as ru}from"react/jsx-runtime";var He=32,ca=6,da=He,ou=120,Qt=.95,ya=1.15;function ha({translationX:e,maxTranslation:t=ou,canSwipeLeft:r=true,canSwipeRight:o=true}){let a=W(()=>e.interpolate({inputRange:[0,t],outputRange:[0,1],extrapolate:"clamp"}),[e,t]),n=W(()=>a.interpolate({inputRange:[0,1],outputRange:[ca,da]}),[a]),l=W(()=>a.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,ya]}),[a]),c=W(()=>a.interpolate({inputRange:[0,.99,1],outputRange:[0,0,16]}),[a]),s=W(()=>a.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[a]),u=W(()=>a.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[a]),i=W(()=>a.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[a]),d=W(()=>e.interpolate({inputRange:[-t,0],outputRange:[1,0],extrapolate:"clamp"}),[e,t]),h=W(()=>d.interpolate({inputRange:[0,1],outputRange:[ca,da]}),[d]),g=W(()=>d.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,ya]}),[d]),y=W(()=>d.interpolate({inputRange:[0,.99,1],outputRange:[0,0,-16]}),[d]),m=W(()=>d.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[d]),b=W(()=>d.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[d]),p=W(()=>d.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[d]);return ru(f,{style:gr.container,pointerEvents:"none",children:[o&&Ye(Z.View,{style:[gr.leftWrapper,{width:n,height:He,borderRadius:He/2,backgroundColor:It.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:s,transform:[{scale:l},{translateX:c}]}],children:Ye(Z.View,{style:{opacity:u,transform:[{scale:i}]},children:Ye(eu,{size:He*.6,color:It.color.accent,strokeWidth:3})})}),r&&Ye(Z.View,{style:[gr.rightWrapper,{width:h,height:He,borderRadius:He/2,backgroundColor:It.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:m,transform:[{scale:g},{translateX:y}]}],children:Ye(Z.View,{style:{opacity:b,transform:[{scale:p}]},children:Ye(tu,{size:He*.6,color:It.color.accent,strokeWidth:3})})})]})}var gr=T.create({container:{...Zl,zIndex:1e3,justifyContent:"center",alignItems:"center"},leftWrapper:{position:"absolute",left:16},rightWrapper:{position:"absolute",right:16}});import{devToolsStorageKeys as fa}from"@buoy-gg/shared-ui/web";import{jsx as Xe,jsxs as au}from"react/jsx-runtime";function ma({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:o,onMinimize:a,activeFilter:n,onFilterChange:l,onTabChange:c,enableSharedModalDimensions:s=false,searchText:u="",onSearchChange:i}){let d=$l(),h=mr(t),[g,y]=oa(null),m=n??g,b=l??y,p=fr(()=>{d.getMutationCache().clear(),r(void 0)},[d,r]),[S,w]=oa("bottomSheet"),C=s?fa.reactQuery.modal():fa.reactQuery.mutationModal(),q=aa(new Z.Value(0)).current,A=fr(ne=>{ne==="right"&&c("queries")},[c]),$=fr(ne=>{w(ne)},[]),Qe=Xl({minBottom:16}),M=S==="floating"?56:48+Qe.bottom,ae=aa($t.create({onStartShouldSetPanResponder:()=>false,onMoveShouldSetPanResponder:(ne,ie)=>Math.abs(ie.dx)>5&&Math.abs(ie.dy)<10,onPanResponderMove:(ne,ie)=>{q.setValue(ie.dx)},onPanResponderRelease:(ne,ie)=>{let{dx:mt,vx:pt}=ie,Ht=80,gt=.5;Z.spring(q,{toValue:0,useNativeDriver:true}).start(),(Math.abs(mt)>Ht||Math.abs(pt)>gt)&&(mt>0||pt>0?A("right"):A("left"))},onPanResponderTerminate:()=>{Z.spring(q,{toValue:0,useNativeDriver:true}).start()}})).current;if(!e)return null;let ye=()=>Xe(ot,{selectedMutation:h,activeTab:"mutations",onTabChange:c,onBack:()=>r(void 0),searchText:u,onSearchChange:i,onClearCache:p}),he=Xe(la,{activeFilter:m,onFilterChange:b,modalMode:S});return Xe(Yl,{visible:e,onClose:o,onMinimize:a,persistenceKey:C,header:{customContent:ye(),showToggleButton:true},onModeChange:$,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:he,footerHeight:M,children:Xe(f,{style:{flex:1},children:au(f,{...ae.panHandlers,style:{flex:1},children:[Xe(ha,{translationX:q,canSwipeLeft:false,canSwipeRight:true}),Xe(ia,{selectedMutation:h,onMutationSelect:r,activeFilter:m,searchText:u})]})})})}import{JsModal as nu,useSafeAreaInsets as iu,devToolsStorageKeys as pa}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as su,night as K,monoFont as ga}from"@buoy-gg/shared-ui/web";import{useMemo as lu}from"react";import{useQueryClient as uu}from"@tanstack/react-query";function ba(e){let t=uu();return lu(()=>[{label:"Remove",variant:"remove",disabled:false,onPress:()=>t.getMutationCache().remove(e)}],[e,t])}import{DataViewer as cu}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as du,jsx as Q,jsxs as Ze}from"react/jsx-runtime";function va({selectedMutation:e,isFloatingMode:t,disableInternalFooter:r=false}){return Ze(du,{children:[Ze(be,{testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:P.explorerScrollContainer,contentContainerStyle:P.explorerScrollContent,children:[Ze(f,{style:P.section,children:[Q(yu,{visible:!!e.state.data,selectedMutation:e}),Q(hu,{visible:!e.state.data,selectedMutation:e})]}),Q(f,{style:P.section,children:Q(sr,{selectedMutation:e})}),Q(f,{style:P.section,children:Ze(f,{style:P.mutationExplorerContainer,children:[Q(v,{style:P.mutationExplorerHeader,children:"Mutation Explorer"}),Q(f,{style:P.mutationExplorerContent,children:Q(cu,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&Q(Sa,{selectedMutation:e,isFloatingMode:t})]})}function Sa({selectedMutation:e,isFloatingMode:t}){let r=su({minBottom:16}),o=ba(e);return Q(f,{style:[P.actionFooter,{paddingBottom:t?0:r.bottom+8}],children:Q(f,{style:P.actionsGrid,children:o.map((a,n)=>Q(ue,{testID:`buoy-rq-action-${a.variant}`,onClick:a.onPress,text:a.label,variant:a.variant,disabled:a.disabled},n))})})}function yu({visible:e,selectedMutation:t}){return e?Ze(f,{style:P.dataContainer,children:[Q(v,{style:P.dataHeader,children:"Data Editor"}),Q(f,{style:P.dataContent,children:Q(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"]},t.mutationId)})]}):null}function hu({visible:e,selectedMutation:t}){if(!e)return null;let r=()=>t.state.status==="pending"?{title:"Pending...",description:"The mutation is in progress."}:t.state.status==="error"?{title:"Mutation Error",description:t.state.error?.message||"An error occurred."}:{title:"No Data Available",description:"This mutation has no data."},{title:o,description:a}=r();return Ze(f,{style:P.emptyState,children:[Q(v,{testID:"buoy-rq-mutation-detail-empty-title",style:P.emptyTitle,children:o}),Q(v,{testID:"buoy-rq-mutation-detail-empty-description",style:P.emptyDescription,children:a})]})}var P=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:K.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:K.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:K.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ga},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ga},dataContent:{padding:8}});import{useState as fu,useCallback as mu,useEffect as pu,useRef as gu}from"react";import{jsx as Ft}from"react/jsx-runtime";function Ca({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:o,onMinimize:a,onTabChange:n,enableSharedModalDimensions:l=false}){let c=mr(t),[s,u]=fu("bottomSheet"),i=gu(void 0);pu(()=>{if(c){i.current=c.mutationId;return}e&&i.current!==void 0&&i.current===t&&(i.current=void 0,r(void 0))},[e,c,t,r]);let d=mu(p=>{u(p)},[]),h=iu({minBottom:16}),g=s==="floating"?72:80+h.bottom,y=()=>Ft(ot,{selectedMutation:c,activeTab:"mutations",onTabChange:n,onBack:()=>r(void 0)}),m=l?pa.reactQuery.modal():pa.reactQuery.mutationModal();if(!e||!c)return null;let b=Ft(Sa,{selectedMutation:c,isFloatingMode:s==="floating"});return Ft(nu,{visible:e,onClose:o,onMinimize:a,persistenceKey:m,header:{customContent:y(),showToggleButton:true},onModeChange:d,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:b,footerHeight:g,children:Ft(va,{selectedMutation:c,isFloatingMode:s==="floating",disableInternalFooter:true})})}import{Fragment as bu,jsx as Pt,jsxs as vu}from"react/jsx-runtime";function xa({visible:e,selectedQueryKey:t,selectedMutationId:r,onQuerySelect:o,onMutationSelect:a,onClose:n,onMinimize:l,activeFilter:c,onFilterChange:s,activeTab:u,onTabChange:i,enableSharedModalDimensions:d=false,searchText:h="",onSearchChange:g}){let y=!!t||!!r,m=u==="queries",b=u==="mutations",p={onClose:n,onMinimize:l,activeFilter:c,onFilterChange:s,enableSharedModalDimensions:d},S=e&&!y&&m,w=e&&!y&&b,C=e&&y&&m&&!!t,q=e&&y&&b&&!!r;return vu(bu,{children:[Pt(Go,{visible:S,selectedQueryKey:t,onQuerySelect:o,onTabChange:i,searchText:h,onSearchChange:g,...p}),Pt(ma,{visible:w,selectedMutationId:r,onMutationSelect:a,onTabChange:i,searchText:h,onSearchChange:g,...p}),Pt(ra,{visible:C,selectedQueryKey:t,onQuerySelect:o,onTabChange:i,...p}),Pt(Ca,{visible:q,selectedMutationId:r,onMutationSelect:a,onTabChange:i,...p})]})}import{ChangeLog as Su}from"@buoy-gg/shared-ui/web";var Cu=0;function Re(){return`rq-${Date.now()}-${++Cu}`}var xu=class extends Su{constructor(){super({max:200});this.queryClient=null;this.queryUnsubscribe=null;this.mutationUnsubscribe=null;this.fetchStartTimes=new Map;this.mutationStartTimes=new Map;this.lastQueryStates=new Map;this.lastMutationStates=new Map}setQueryClient(e){this.disconnect(),this.queryClient=e,this.queryUnsubscribe=e.getQueryCache().subscribe(t=>{t.type==="updated"&&t.query&&this.handleQueryUpdate(t.query)}),this.mutationUnsubscribe=e.getMutationCache().subscribe(t=>{t.type==="updated"&&t.mutation&&this.handleMutationUpdate(t.mutation)})}disconnect(){this.queryUnsubscribe&&(this.queryUnsubscribe(),this.queryUnsubscribe=null),this.mutationUnsubscribe&&(this.mutationUnsubscribe(),this.mutationUnsubscribe=null),this.queryClient=null,this.lastQueryStates.clear(),this.lastMutationStates.clear(),this.fetchStartTimes.clear(),this.mutationStartTimes.clear()}handleQueryUpdate(e){if(Se(e.queryKey))return;let t=e.queryHash,r={fetchStatus:e.state.fetchStatus,status:e.state.status},o=this.lastQueryStates.get(t);if(!o)r.fetchStatus==="fetching"&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e}));else{let a=o.fetchStatus==="fetching",n=r.fetchStatus==="fetching";if(!a&&n&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})),a&&!n){let l=this.fetchStartTimes.get(t),c=l?Date.now()-l:void 0;this.fetchStartTimes.delete(t),r.status==="error"?this.addEvent({id:Re(),type:"query-fetch-error",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryError:e.state.error,duration:c,query:e}):this.addEvent({id:Re(),type:"query-fetch-success",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryData:e.state.data,duration:c,query:e})}!o.status&&e.state.isInvalidated&&this.addEvent({id:Re(),type:"query-invalidated",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})}this.lastQueryStates.set(t,r)}handleMutationUpdate(e){let t=e.mutationId,r=e.state.status,o=this.lastMutationStates.get(t);if(o!==r){if(r==="pending"&&o!=="pending")this.mutationStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"mutation-start",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutation:e});else if(r==="success"&&o==="pending"){let a=this.mutationStartTimes.get(t),n=a?Date.now()-a:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-success",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationData:e.state.data,duration:n,mutation:e})}else if(r==="error"&&o==="pending"){let a=this.mutationStartTimes.get(t),n=a?Date.now()-a:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-error",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationError:e.state.error,duration:n,mutation:e})}}this.lastMutationStates.set(t,r)}addEvent(e){this.record(e)}getEvents(){return this.items}subscribe(e){let t=super.subscribe(e);return e(this.items),t}clearEvents(){this.clear()}isConnected(){return this.queryClient!==null}},je=new xu,wu=e=>je.setQueryClient(e),qu=()=>je.disconnect();import{jsx as wa}from"react/jsx-runtime";function br({visible:e,onClose:t,onMinimize:r,enableSharedModalDimensions:o=true}){let a=yn();dn(()=>{je.isConnected()||je.setQueryClient(a)},[a]);let[n,l]=tt(void 0),[c,s]=tt(void 0),[u,i]=tt(null),[d,h]=tt("queries"),[g,y]=tt(""),m=Fe(()=>{l(void 0),s(void 0),i(null),h("queries"),y("")},[]),b=Fe(()=>{m(),t()},[t,m]),p=Fe(A=>{l(A?.queryKey)},[]),S=Fe(A=>{s(A?.mutationId)},[]),w=Fe(A=>{i(A)},[]),C=Fe(A=>{h(A),i(null),l(void 0),s(void 0),y("")},[]),q=Fe(A=>{y(A)},[]);return e?wa(hn,{children:wa(xa,{visible:e,selectedQueryKey:n,selectedMutationId:c,onQuerySelect:p,onMutationSelect:S,onClose:b,onMinimize:r,activeFilter:u,onFilterChange:w,activeTab:d,onTabChange:C,searchText:g,onSearchChange:q,enableSharedModalDimensions:o})}):null}import{onlineManager as ge}from"@tanstack/react-query";import{devToolsStorageKeys as qa,persistentStorage as Ma}from"@buoy-gg/shared-ui/web";import{useState as Ta,useEffect as Aa}from"react";import{jsx as Ot}from"react/jsx-runtime";var Ea=()=>null,Ra=async e=>{try{await Ma.setItem(qa.settings.wifiEnabled(),e.toString())}catch{}},Mu=async()=>{try{let e=await Ma.getItem(qa.settings.wifiEnabled());e!==null&&ge.setOnline(e==="true")}catch{}};Mu();function Tu({size:e}){let[t,r]=Ta(()=>ge.isOnline());return Aa(()=>ge.subscribe(o=>{r(o)}),[]),Ot(Ar,{size:e,color:t?"#10B981":"#DC2626"})}var Au={id:"query",name:"QUERY",description:"React Query inspector",slot:"both",icon:({size:e})=>Ot(Tr,{size:e}),component:br,props:{enableSharedModalDimensions:false}};function Eu(e){return{id:e?.id||"query",name:e?.name||"QUERY",description:e?.description||"React Query inspector",slot:"both",icon:({size:t})=>Ot(Tr,{size:t}),component:br,props:{enableSharedModalDimensions:e?.enableSharedModalDimensions!==void 0?e.enableSharedModalDimensions:false}}}var Ru={id:"query-wifi-toggle",name:"WIFI",description:"Toggle React Query online/offline state",slot:"row",icon:Tu,component:Ea,props:{},launchMode:"toggle-only",onPress:()=>{let e=!ge.isOnline();ge.setOnline(e),Ra(e)}};function Du(e){let t=e?.onColor||"#10B981",r=e?.offColor||"#DC2626",o=({size:a})=>{let[n,l]=Ta(()=>ge.isOnline());return Aa(()=>ge.subscribe(c=>{l(c)}),[]),Ot(Ar,{size:a,color:n?t:r})};return{id:e?.id||"query-wifi-toggle",name:e?.name||"WIFI",description:e?.description||"Toggle React Query online/offline state",slot:"row",icon:o,component:Ea,props:{},launchMode:"toggle-only",onPress:()=>{let a=!ge.isOnline();ge.setOnline(a),Ra(a)}}}import{expandKeyedArrays as ku,patchFromPath as Iu,readPath as Qu,refusalText as Fu,shapeSummary as zt,suggestedPatch as Pu,typedEditViolations as Ou,unshapedLists as zu}from"@buoy-gg/shared-ui/web";import{onlineManager as vr}from"@tanstack/react-query";import{isJsonSerializable as Da,isOverWireBudget as ka}from"@buoy-gg/shared-ui/web";var Ku=Object.freeze({__buoyDataOnDevice:true,note:"Query data stays on the device \u2014 fetched on demand via getQueryData."}),Ia=Object.freeze({__buoyUnserializable:true,note:"Query data is not JSON-serializable (circular or bigint) and stayed on the device."}),Lu=16*1024,Qa=8*1024*1024;function Bu(e){return!!e&&typeof e=="object"&&e.__buoyDataOnDevice===true}function Hu(e){return!!e&&typeof e=="object"&&e.__buoyUnserializable===true}function Fa(e){return Bu(e)||Hu(e)}function De(e){if(e!==void 0)return ka(e,Lu)?Da(e)?Ku:Ia:e}function Kt(e){if(e==null)return e;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,o=typeof t.message=="string"?t.message:void 0;if(r!==void 0||o!==void 0)return De({...r!==void 0?{name:r}:{},...o!==void 0?{message:o}:{}})}return De(e)}function ju(e){return ka(e,Qa)?Da(e)?{__buoyTruncated:true,note:`Exceeds the ${Qa/(1024*1024)}MB detail limit \u2014 inspect it on-device.`}:Ia:e}function Wu(e){let t=e.getMutationCache().getAll().map(o=>$u(o)),r=e.getQueryCache().getAll().map(o=>Nu(o));return{mutations:t,queries:r}}function $u(e){let t=e.state;return{mutationId:e.mutationId,mutationKey:e.options.mutationKey,state:{...t,data:De(t.data),variables:De(t.variables),error:Kt(t.error),failureReason:Kt(t.failureReason)},...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:De(e.meta)}}}function Vu(e){let{queryFn:t,select:r,persister:o,initialData:a,placeholderData:n,...l}=e;return{...l,queryFn:void 0,...e.meta?{meta:De(e.meta)}:{}}}function Nu(e){let t=e.observers.map(r=>({queryHash:e.queryHash,options:Vu(r.options)}));return{state:{...e.state,...e.state.data!==void 0&&{data:De(e.state.data)},error:Kt(e.state.error),fetchFailureReason:Kt(e.state.fetchFailureReason)},queryKey:e.queryKey,queryHash:e.queryHash,...e.meta&&{meta:De(e.meta)},observers:t}}function Uu(e,t){let r=e;for(let o of t.split(".")){if(!r||typeof r!="object"||Array.isArray(r)||!(o in r))return false;r=r[o]}return Array.isArray(r)?r.length>0:!!r&&typeof r=="object"}var ht=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Pa(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}function Oa(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(!ht(e)||!ht(t))return t;let a={...e};for(let[n,l]of Object.entries(t)){let c=r?`${r}.${n}`:n;if(n in e){let s=Pa(e[n]),u=Pa(l);(s==="array"||s==="object")&&s!==u&&o.breaks.push({path:c,from:s,to:u}),a[n]=Oa(e[n],l,c,o)}else a[n]=l}return a}function _u(e){let t=e.trim();try{let r=JSON.parse(t);if(Array.isArray(r))return r.map(o=>typeof o=="object"&&o!==null?JSON.stringify(o):String(o))}catch{}return t.includes(",")&&!t.startsWith("[")?t.split(",").map(r=>r.trim().replace(/^["']|["']$/g,"")):null}function Ju(e){let t;for(let r of e.observers??[]){let o=r.options?.refetchInterval,a=o;if(typeof o=="function")try{a=o(e)}catch{a=void 0}typeof a=="number"&&a>0&&(t=t===void 0?a:Math.min(t,a))}return t}function za(e){let t=r=>{let{queryHash:o}=r,a=e.getQueryCache(),n=o?a.get(o):void 0;if(!n&&typeof o=="string"){let l=_u(o);l&&(n=a.getAll().find(c=>{let s=c.queryKey.map(u=>typeof u=="object"?JSON.stringify(u):String(u));return s.length===l.length&&s.every((u,i)=>u===l[i])}))}if(!n)throw new Error(`Query with hash "${o}" not found`);return n};return{version:2,getSnapshot:()=>({dehydratedState:Wu(e),isOnlineManagerOnline:vr.isOnline()}),subscribe:r=>{let o=e.getQueryCache().subscribe(r),a=e.getMutationCache().subscribe(r),n=vr.subscribe(r);return()=>{o(),a(),n()}},actions:{getQueryData:r=>{let{queryHash:o,path:a}=r??{};if(!o)return{found:false,reason:"missing queryHash"};let n=e.getQueryCache().get(o);if(!n)return{found:false,reason:"unknown queryHash"};if(a){let c=Qu(n.state.data,a);return c.ok?{found:true,queryHash:o,path:a,shape:zt(c.value),data:c.value}:{found:false,reason:c.error}}if(n.state.data===void 0){let c=n.state.status,s=n.state.error;return{found:true,queryHash:o,hasData:false,status:c,fetchStatus:n.state.fetchStatus,...s?{error:s instanceof Error?s.message:String(s)}:{},reason:c==="error"?"This query has no data because it FAILED. Report the error, not an empty result.":n.state.fetchStatus==="fetching"?"No data yet \u2014 this query is still fetching.":"This query has never resolved (it may be disabled, or never enabled). It is not empty \u2014 it has nothing."}}let l=zt(n.state.data);return{found:true,queryHash:o,hasData:true,...l?{shape:l}:{},data:ju(n.state.data)}},listQueries:r=>{let{includeData:o=false,staleOnly:a=false,limit:n}=r??{},l=e.getQueryCache().getAll(),c=[...a?l.filter(u=>u.isStale()):l].sort((u,i)=>{let d=+(i.getObserversCount()>0)-+(u.getObserversCount()>0);return d!==0?d:(i.state.dataUpdatedAt??0)-(u.state.dataUpdatedAt??0)}),s=(typeof n=="number"&&n>0?c.slice(0,n):c).map(u=>{let i=u.state.error,d=Ju(u);return{queryHash:u.queryHash,queryKey:u.queryKey,status:se(u),fetchStatus:u.state.fetchStatus,isStale:u.isStale(),observers:u.getObserversCount(),updatedAt:u.state.dataUpdatedAt,...d?{refetchEveryMs:d}:{},error:i?i.message??String(i):void 0,...o?{data:u.state.data}:{},...zt(u.state.data)?{shape:zt(u.state.data)}:{}}});return{queries:s,total:l.length,returned:s.length,includedData:o}},refetch:r=>t(r).fetch().catch(()=>{}),invalidate:r=>e.invalidateQueries(t(r)),reset:r=>e.resetQueries(t(r)),remove:r=>{let o=t(r),a=e.getQueryCache().findAll(o).some(n=>n.getObserversCount()>0);return e.removeQueries(o),{ok:true,...a?{note:"Removed \u2014 but a screen is still watching this query, and React Query leaves that screen rendering its LAST value (including anything written into the cache before this) until something refetches. Nothing on screen will change on its own. Use `reset` instead when you want the screen to go back to loading and fetch again."}:{}}},setQueryData:r=>{let{data:o,merge:a,force:n,path:l,value:c}=r,{queryKey:s,queryHash:u}=r,i=s;if(i===void 0&&typeof u=="string"){let y=e.getQueryCache().get(u);if(!y)return{ok:false,error:`Refused: no query with hash ${u} is in the cache. Read listQueries for the current hashes \u2014 a query that has been removed or whose key includes changing params (a search term, a cart payload) will not match an older hash.`};i=y.queryKey}if(i===void 0)return{ok:false,error:"Refused: no query was named. Send `queryKey` (the array from listQueries) or `queryHash` (its string form)."};let d=e.getQueryData(i),h=e.getQueryCache().find({queryKey:i,exact:true});if(d===void 0&&h&&(o!==void 0||l!==void 0)){let y=h,m=y?.state.status;return{ok:false,error:`Refused: this query has no data to edit \u2014 ${m==="error"?`it FAILED${y?.state.error?` (${y.state.error instanceof Error?y.state.error.message:String(y.state.error)})`:""}`:m==="pending"?"it has never resolved (it may be disabled, or still loading)":"it holds no data"}. There is nothing to merge into. Fix the cause first (restoreError, or let it fetch), or send force:true with the COMPLETE value if you mean to seed the cache from nothing.`,status:m}}if(o===void 0&&l===void 0)return{ok:false,error:"Refused: no change was described. Send `data` (with merge:true for a partial edit), or `path` and `value` to set one value."};let g=o;if(l!==void 0){if(c===void 0)return{ok:false,error:`Refused: sent \`path\` without \`value\`. Say what to set "${l}" to; if you mean to clear it, send value:null and the field must already be nullable.`};let y=Iu(d,l,c);if(!y.ok)return{ok:false,error:`Refused: ${y.error}`};g=y.patch}if(a||l!==void 0){let y=n?{patch:g,notes:[],error:void 0}:ku(d,g);if(y.error)return{ok:false,error:`Refused: ${y.error}`};let m=y.patch;if(!n){let S=Ou(d,m,{noun:"data"});if(S.length>0){let w=Pu(m,S);return{ok:false,error:Fu(S,"data",w),violations:S,...w?{suggestedData:w}:{}}}}let b=Oa(d,m),p=zu(d).filter(S=>Uu(m,S));return e.setQueryData(i,b,{updatedAt:Date.now()}),{ok:true,mode:"merge",...l!==void 0?{path:l}:{},changedKeys:ht(m)?Object.keys(m):void 0,...y.notes.length?{keyed:y.notes}:{},...p.length?{unchecked:p.map(S=>`\`${S}\` was empty, so nothing in the app knows what its items look like and the shape of what you added was NOT checked. If the screen renders a field you left out, it will render undefined \u2014 read the query back and compare against how the screen uses it.`)}:{}}}if(!n&&ht(d)&&ht(o)){let y=Object.keys(d).filter(m=>!(m in o));if(y.length>0)return{ok:false,error:`Refused: the new value drops ${y.length} top-level field(s) the cached value has (${y.slice(0,8).join(", ")}${y.length>8?", \u2026":""}). A screen rendering those fields would crash. To change some fields, send merge:true with ONLY the fields that change. To really replace the whole value, send force:true.`,missingKeys:y}}return e.setQueryData(i,o,{updatedAt:Date.now()}),{ok:true,mode:"replace"}},triggerError:r=>{let o=t(r),a=o.options;o.setState({status:"error",error:new Error("Unknown error from devtools"),fetchMeta:{...o.state.fetchMeta,__previousQueryOptions:a}})},restoreError:r=>(e.resetQueries(t(r)).catch(()=>{}),{restored:true}),triggerLoading:r=>{let o=t(r),a=o.options;o.fetch({...a,queryFn:()=>new Promise(()=>{}),gcTime:-1}).catch(()=>{}),o.setState({data:void 0,status:"pending",fetchMeta:{...o.state.fetchMeta,__previousQueryOptions:a}})},restoreLoading:r=>{let o=t(r),a=o.state,n=o.state.fetchMeta?o.state.fetchMeta.__previousQueryOptions:null;o.cancel({silent:true}),o.setState({...a,fetchStatus:"idle",fetchMeta:null}),n&&o.fetch(n).catch(()=>{})},clearQueryCache:()=>{let r=e.getQueryCache().getAll().filter(o=>o.getObserversCount()>0).length;return e.getQueryCache().clear(),{ok:true,cleared:true,...r?{note:`Cleared \u2014 but ${r} quer${r===1?"y is":"ies are"} still being watched by a screen, and React Query leaves those screens rendering their LAST value until something refetches. The cache is empty; the app on screen is not. Use \`reset\` on a query when you want its screen to reload.`}:{}}},clearMutationCache:()=>{e.getMutationCache().clear()},setOnline:r=>{let{online:o}=r;vr.setOnline(o)}}}}import{useEffect as Gu,useMemo as Yu}from"react";import{useQueryClient as Xu}from"@tanstack/react-query";import{classifyPreviewItem as Zu,createRestoreScope as ec,emptyRestoreResult as tc,failedRestore as rc,registerStateSnapshotProvider as oc,superJsonSerialize as ac}from"@buoy-gg/shared-ui/web";function Ka(e){return{...e,fetchStatus:"idle",fetchMeta:null}}function Sr(e){return{status:e.state.status,error:e.state.error??null,data:e.state.data}}function Cr(e,t){try{let r=JSON.stringify(e);return r.length>60?`${r.slice(0,57)}\u2026`:r}catch{return t}}function La(e){if(e==null)return e??null;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,o=typeof t.message=="string"?t.message:void 0;if(r!==void 0||o!==void 0)return{...r!==void 0?{name:r}:{},...o!==void 0?{message:o}:{}}}return e}function Ba(e){if(e===void 0)return true;try{return ac(e),true}catch{return false}}function Ha(e){let t=[],r=[];for(let o of e.getQueryCache().getAll()){let a=Cr(o.queryKey,o.queryHash);if(!Ba(o.state.data)){t.push(`query ${a}: data can't be serialized (circular reference?) \u2014 not captured`);continue}r.push({queryKey:o.queryKey,queryHash:o.queryHash,...o.meta&&Ba(o.meta)?{meta:o.meta}:{},state:Ka({...o.state,error:La(o.state.error),fetchFailureReason:La(o.state.fetchFailureReason)})})}return{queries:r,warnings:t}}function nc(e){return{id:"query",label:"React Query",status:()=>({canCapture:true,canRestore:true}),async capture(){let{queries:t,warnings:r}=Ha(e),o=e.getMutationCache().getAll().length;return o>0&&r.push(`${o} mutation(s) not captured (mutation functions cannot be restored)`),{data:{queries:t},warnings:r}},async restore(t,r){let o=t,a=ec(r),n=tc();if(!o?.queries)return rc("empty query snapshot");let l=e.getQueryCache(),c=new Set(o.queries.map(i=>i.queryHash));for(let i of o.queries)if(a.allows(i.queryHash)){if(Fa(i.state.data)){n.skipped.push({id:i.queryHash,reason:"captured as an on-device placeholder by an older Buoy \u2014 re-capture this restore point"});continue}try{let d=Ka(i.state),h=l.get(i.queryHash);h?h.setState(d):l.build(e,{queryKey:i.queryKey,queryHash:i.queryHash,...i.meta&&{meta:i.meta}},d),n.applied+=1}catch(d){n.skipped.push({id:i.queryHash,reason:String(d)}),n.ok=false}}for(let i of l.getAll().slice())if(a.allows(i.queryHash)&&!c.has(i.queryHash))try{l.remove(i),n.applied+=1}catch(d){n.skipped.push({id:i.queryHash,reason:String(d)})}let s=e.getMutationCache().getAll().length;s>0&&(e.getMutationCache().clear(),n.warnings.push(`mutation cache cleared (${s} mutation(s))`));let u=a.excludedWarning("quer(y/ies)");return u&&n.warnings.push(u),n},async previewItems(t,r){let o=t?.queries??[],a=r===void 0,n=a?Ha(e).queries:r?.queries??[],l=new Map(n.map(i=>[i.queryHash,i])),c=new Map(o.map(i=>[i.queryHash,i])),s=[],u=[];for(let i of o){let d=Cr(i.queryKey,i.queryHash);if(Fa(i.state.data)){s.push({key:i.queryHash,label:d,verdict:"wont-apply",reason:"data stayed on the device when this was captured (older Buoy) \u2014 re-capture this restore point"});continue}let h=l.get(i.queryHash);s.push(Zu({key:i.queryHash,label:d,oldValue:h?Sr(h):void 0,newValue:Sr(i),inOld:h!==void 0,inNew:true},{tooLargeReason:"query data too large to render a diff \u2014 restore still applies it"}))}for(let i of n)c.has(i.queryHash)||s.push({key:i.queryHash,label:Cr(i.queryKey,i.queryHash),verdict:"removed",oldValue:Sr(i)});if(a){let i=e.getMutationCache().getAll().length;i>0&&u.push(`${i} in-memory mutation record(s) will be cleared`)}return{items:s,notes:u}}}}function ic(e){return oc(nc(e))}function sc(){let e;try{e=Xu()}catch{e=null}return Gu(()=>{if(e)return ic(e)},[e]),Yu(()=>e?za(e):null,[e])}function ja({queryState:e,observerCount:t,isStale:r}){return e.fetchStatus==="fetching"?"blue":e.status==="error"?"red":t?e.fetchStatus==="paused"?"purple":r?"yellow":"green":"gray"}import{useQueryClient as lc}from"@tanstack/react-query";import{jsx as Lt,jsxs as ke}from"react/jsx-runtime";function Wa(){try{let e=lc(),t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return ke(f,{style:Y.container,children:[Lt(v,{style:Y.title,children:"Debug Info"}),Lt(v,{style:Y.info,children:"QueryClient: \u2705 Available"}),ke(v,{style:Y.info,children:["Queries: ",t.length]}),ke(v,{style:Y.info,children:["Mutations: ",r.length]}),t.length>0&&ke(f,{style:Y.queriesList,children:[Lt(v,{style:Y.subtitle,children:"Query Keys:"}),t.slice(0,3).map((o,a)=>ke(v,{style:Y.queryKey,children:["\u2022"," ",Array.isArray(o.queryKey)?o.queryKey.join(" - "):String(o.queryKey)]},a)),t.length>3&&ke(v,{style:Y.more,children:["... and ",t.length-3," more"]})]})]})}catch(e){return ke(f,{style:Y.container,children:[Lt(v,{style:Y.title,children:"Debug Info"}),ke(v,{style:Y.error,children:["\u274C QueryClient Error: ",String(e)]})]})}}var Y=T.create({container:{padding:16,backgroundColor:"rgba(0, 0, 0, 0.3)",borderRadius:8,margin:16,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)"},title:{color:"#FFFFFF",fontSize:14,fontWeight:"600",marginBottom:8},subtitle:{color:"#E5E7EB",fontSize:12,fontWeight:"500",marginTop:8,marginBottom:4},info:{color:"#9CA3AF",fontSize:12,marginBottom:4},error:{color:"#EF4444",fontSize:12,marginBottom:4},queriesList:{marginTop:4},queryKey:{color:"#60A5FA",fontSize:11,marginLeft:8,marginBottom:2},more:{color:"#9CA3AF",fontSize:11,fontStyle:"italic",marginLeft:8}});import{jsx as Ie,jsxs as et}from"react/jsx-runtime";function uc({queries:e,selectedQuery:t,isOpen:r,onClose:o,onSelect:a}){let n=l=>Array.isArray(l.queryKey)?l.queryKey.join(" - "):String(l.queryKey);return Ie(Lr,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:r,transparent:true,animationType:"fade",onRequestClose:o,children:Ie(zr,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:L.modalOverlay,onPress:o,children:et(f,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:L.modalContent,children:[et(f,{style:L.modalHeader,children:[Ie(v,{style:L.modalTitle,children:"Select Query"}),et(v,{style:L.modalSubtitle,children:[e.length," ",e.length===1?"query":"queries"," ","available"]})]}),Ie(be,{accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:L.scrollView,contentContainerStyle:L.scrollViewContent,showsVerticalScrollIndicator:true,children:e.length===0?et(f,{style:L.emptyState,children:[Ie(v,{style:L.emptyTitle,children:"No Queries Found"}),et(v,{style:L.emptyDescription,children:["No React Query queries are currently active.",`
6
+ \u2022 Check console for debugging info`}}),contentContainerStyle:jo.queryListContent})]})}var jo=T.create({queryListContainer:{flex:1,backgroundColor:"transparent"},queryListContent:{padding:8,backgroundColor:"transparent",flexGrow:1}});import{ToolFooter as bl,useSafeAreaInsets as vl}from"@buoy-gg/shared-ui/web";import{jsx as ur}from"react/jsx-runtime";function Wo({activeFilter:e,onFilterChange:t,isFloatingMode:r=true,size:o="default"}){let a=vl({minBottom:16});return ur(bl,{floating:r,safeArea:false,paddingBottom:r?0:a.bottom,style:$o.filterFooter,children:ur(f,{style:$o.filterContainer,children:ur(bo,{activeFilter:e,onFilterChange:t,size:o})})})}var $o=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{useCallback as Sl,useMemo as ct}from"react";import{DynamicFilterView as Cl,buoyColors as Ae,monoFont as xl,night as cr}from"@buoy-gg/shared-ui/web";import{XCircle as Vo,Clock as dr,RefreshCw as wl,Globe as ql,Zap as Ml,Filter as Tl,Eye as Al}from"@buoy-gg/shared-ui/web";import{jsx as yr}from"react/jsx-runtime";var El=()=>false;function Rl({queries:e,activeFilter:t,onFilterChange:r,ignoredPatterns:o,onPatternToggle:a,includedPatterns:n,onIncludedPatternToggle:l,isTeamPattern:c=El}){let s=Sl(y=>c(y)?yr(f,{accessibilityLabel:"Set by your team on buoy.gg",style:[No.teamBadge,{borderColor:`${cr.color.accent}60`,backgroundColor:`${cr.color.accent}15`}],children:yr(v,{style:[No.teamBadgeText,{color:cr.color.accent}],children:"TEAM"})}):null,[c]),u=ct(()=>{let y={all:e.length,disabled:0,fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0};return e.forEach(m=>{let b=se(m);b==="disabled"?y.disabled++:b==="error"?y.error++:b==="fresh"?y.fresh++:b==="stale"?y.stale++:b==="fetching"?y.fetching++:b==="paused"?y.paused++:b==="inactive"&&y.inactive++}),y},[e]),i=ct(()=>{let y=new Set;return e.forEach(m=>{if(!m?.queryKey)return;(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).forEach(b=>{if(b!=null){let p=String(b);/^\d+$/.test(p)||y.add(p)}})}),Array.from(y).sort().slice(0,50)},[e]),d=ct(()=>i,[i]),h=ct(()=>{let y=e;return n.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return Array.from(n).some(p=>b.includes(p.toLowerCase()))})),o.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let b=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return!Array.from(o).some(p=>b.includes(p.toLowerCase()))})),y.length},[e,n,o]),g=ct(()=>({filterSummarySection:{enabled:true,totalCount:e.length,filteredCount:h,includePatterns:n,excludePatterns:o},sections:[{id:"status",title:"Status",type:"status",data:[{id:"status::all",label:"All",count:u.all,icon:ql,color:Ae.primary,isActive:!t||t==="all"},{id:"status::disabled",label:"Disabled",count:u.disabled,icon:Vo,color:Ae.textMuted,isActive:t==="disabled"},{id:"status::fresh",label:"Fresh",count:u.fresh,icon:Ml,color:Ae.success,isActive:t==="fresh"},{id:"status::stale",label:"Stale",count:u.stale,icon:dr,color:Ae.warning,isActive:t==="stale"},{id:"status::fetching",label:"Fetching",count:u.fetching,icon:wl,color:Ae.primary,isActive:t==="fetching"},{id:"status::paused",label:"Paused",count:u.paused,icon:dr,color:Ae.textMuted,isActive:t==="paused"},{id:"status::inactive",label:"Inactive",count:u.inactive,icon:dr,color:Ae.textSecondary,isActive:t==="inactive"},{id:"status::error",label:"Error",count:u.error,icon:Vo,color:Ae.error,isActive:t==="error"}]}],addFilterSection:{enabled:true,placeholder:"Enter pattern to exclude...",title:"EXCLUDE FILTERS",icon:Tl},includeOnlySection:{enabled:true,title:"INCLUDE ONLY FILTERS",description:"Show ONLY queries matching these patterns. All non-matching queries will be hidden.",placeholder:"Enter pattern to include...",icon:Al,patterns:n,onPatternToggle:l,onPatternAdd:l,renderPatternMeta:s},availableItemsSection:{enabled:true,title:"AVAILABLE QUERY KEYS",emptyMessage:"No queries found. Query keys will appear here once queries are active.",items:d},howItWorksSection:{enabled:true,title:"HOW QUERY FILTERS WORK",description:"There are two types of query key filters:",examples:["","INCLUDE ONLY (green):","\u2022 Shows ONLY queries matching the pattern","\u2022 Example: 'rewards' \u2192 shows only reward queries","\u2022 When active, non-matching queries are hidden","","EXCLUDE (blue):","\u2022 Hides queries matching the pattern","\u2022 Example: 'analytics' \u2192 hides analytics queries","","Filters are case-insensitive and match partial keys."]},activePatterns:o,renderPatternMeta:s}),[u,t,o,n,d,l,e.length,h,s]);return yr(Cl,{...g,onFilterChange:y=>{let[m,b]=y.split("::");m==="status"?r(b==="all"||t===b?null:b):m==="suggestion"&&a(b)},onPatternToggle:a,onPatternAdd:a})}var No=T.create({teamBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:6,borderWidth:1},teamBadgeText:{fontSize:9,fontFamily:xl,fontWeight:"700",letterSpacing:.5}});import{useState as dt,useCallback as yt,useEffect as Rt,useMemo as Uo,useRef as _o}from"react";import{devToolsStorageKeys as Ee,persistentStorage as Dt,useTeamList as Jo}from"@buoy-gg/shared-ui/web";import{jsx as pe,jsxs as Dl}from"react/jsx-runtime";function Go({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:o,onMinimize:a,activeFilter:n,onFilterChange:l,enableSharedModalDimensions:c=false,onTabChange:s,searchText:u="",onSearchChange:i}){let d=fn(),h=Er(t),g=xt(),y=yt(()=>{d.getQueryCache().clear()},[d]),[m,b]=dt(null),p=n??m,S=l??b,[w,C]=dt(false),[q,A]=dt(new Set),[$,Qe]=dt(new Set),M=_o(null),ae=_o(null);Rt(()=>{(async()=>{try{let x=await Dt.getItem(Ee.reactQuery.ignoredPatterns());if(x){let D=JSON.parse(x);Array.isArray(D)&&(M.current=JSON.stringify(Array.from(new Set(D))),A(new Set(D)))}}catch(x){console.error("[Buoy]","Failed to load ignored patterns:",x)}finally{M.current??(M.current="[]")}})()},[]),Rt(()=>{(async()=>{try{let x=await Dt.getItem(Ee.reactQuery.includedPatterns());if(x){let D=JSON.parse(x);Array.isArray(D)&&(ae.current=JSON.stringify(Array.from(new Set(D))),Qe(new Set(D)))}}catch(x){console.error("[Buoy]","Failed to load included patterns:",x)}finally{ae.current??(ae.current="[]")}})()},[]),Rt(()=>{let x=JSON.stringify(Array.from(q));if(M.current===null||M.current===x)return;M.current=x,(async()=>{try{await Dt.setItem(Ee.reactQuery.ignoredPatterns(),x)}catch(D){console.error("[Buoy]","Failed to save ignored patterns:",D)}})()},[q]),Rt(()=>{let x=JSON.stringify(Array.from($));if(ae.current===null||ae.current===x)return;ae.current=x,(async()=>{try{await Dt.setItem(Ee.reactQuery.includedPatterns(),x)}catch(D){console.error("[Buoy]","Failed to save included patterns:",D)}})()},[$]);let ye=Jo(Ee.reactQuery.ignoredPatterns()),he=Jo(Ee.reactQuery.includedPatterns()),ne=Uo(()=>ye.length?new Set([...q,...ye]):q,[q,ye]),ie=Uo(()=>he.length?new Set([...$,...he]):$,[$,he]),mt=yt(x=>ye.includes(x)&&!q.has(x)||he.includes(x)&&!$.has(x),[ye,he,q,$]),pt=yt(x=>{A(D=>{if(!D.has(x)&&ye.includes(x))return D;let fe=new Set(D);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[ye]),Ht=yt(x=>{Qe(D=>{if(!D.has(x)&&he.includes(x))return D;let fe=new Set(D);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[he]),[gt,Ya]=dt("bottomSheet"),Xa=c?Ee.reactQuery.modal():Ee.reactQuery.browserModal(),Za=yt(x=>{Ya(x)},[]),en=pn({minBottom:16}),tn=gt==="floating"?56:48+en.bottom;if(!e)return null;let rn=()=>{if(w){let x=[{key:"filters",label:"Filters"}];return Dl(jt,{children:[pe(jt.Navigation,{onBack:()=>C(false)}),pe(jt.Content,{title:"",noMargin:true,children:pe(gn,{tabs:x,activeTab:"filters",testIDPrefix:"buoy-rq-filterview-tab",onTabChange:()=>{}})})]})}return pe(ot,{selectedQuery:h,activeTab:"queries",onTabChange:s,onBack:()=>r(void 0),searchText:u,onSearchChange:i,onFilterPress:()=>C(true),hasActiveFilters:p!==null||ne.size>0||ie.size>0,onClearCache:y})},on=pe(Wo,{activeFilter:p,onFilterChange:S,isFloatingMode:gt==="floating"});return pe(mn,{visible:e,onClose:o,onMinimize:a,persistenceKey:Xa,header:{customContent:rn(),showToggleButton:true},onModeChange:Za,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:!w,styles:{},footer:w?void 0:on,footerHeight:w?void 0:tn,children:pe(f,{style:kl.container,children:w?pe(Rl,{queries:g,activeFilter:p,onFilterChange:S,ignoredPatterns:ne,onPatternToggle:pt,includedPatterns:ie,onIncludedPatternToggle:Ht,isTeamPattern:mt}):pe(Ho,{selectedQuery:h,onQuerySelect:r,activeFilter:p,searchText:u,ignoredPatterns:ne,includedPatterns:ie,onFilterPress:()=>C(true)})})})}var kl=T.create({container:{flex:1,backgroundColor:"transparent"}});import{JsModal as Il,devToolsStorageKeys as Yo,useSafeAreaInsets as Ql}from"@buoy-gg/shared-ui/web";import{useQueryClient as Xo}from"@tanstack/react-query";import{useSafeAreaInsets as Zo,night as z,monoFont as ea}from"@buoy-gg/shared-ui/web";import{useMemo as Fl}from"react";function hr(e,t,r){return Fl(()=>{let o=e.state.status;return[{label:"Refetch",variant:"refetch",disabled:se(e)==="fetching",onPress:()=>er({query:e})},{label:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading",variant:"triggerLoading",disabled:false,onPress:()=>Zt({query:e})},{label:o==="error"?"Restore Error":"Trigger Error",variant:"triggerError",disabled:o==="pending",onPress:()=>tr({query:e,queryClient:t})}]},[e,t,r])}import{DataViewer as Pl}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Ol,jsx as k,jsxs as Ge}from"react/jsx-runtime";function ta({selectedQuery:e,isFloatingMode:t,disableInternalFooter:r=false,queryVersion:o}){let a=Zo({minBottom:16}),n=Xo(),l=hr(e,n,o);return Ge(Ol,{children:[Ge(be,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:I.explorerScrollContainer,contentContainerStyle:[I.explorerScrollContent,!r&&{paddingBottom:72}],children:[Ge(f,{style:I.section,children:[k(Kl,{visible:!!e.state.data,selectedQuery:e,queryVersion:o}),k(Ll,{visible:!e.state.data,selectedQuery:e})]}),k(f,{style:I.section,children:k(Yt,{query:e})}),k(f,{style:I.section,children:Ge(f,{style:I.queryExplorerContainer,children:[k(v,{testID:"buoy-rq-query-explorer-header",style:I.queryExplorerHeader,children:"Query Explorer"}),k(f,{style:I.queryExplorerContent,children:k(Pl,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&k(f,{style:[I.actionFooter,{paddingBottom:t?0:a.bottom+8}],children:k(f,{style:I.actionsRow,children:l.map((c,s)=>k(ue,{testID:`buoy-rq-action-${c.variant}`,onClick:c.onPress,text:c.label,variant:c.variant,disabled:c.disabled},s))})})]})}function zl({selectedQuery:e,isFloatingMode:t,queryVersion:r}){let o=Zo({minBottom:16}),a=Xo(),n=hr(e,a,r);return k(f,{style:[I.actionFooter,{paddingBottom:t?0:o.bottom+8}],children:k(f,{style:I.actionsRow,children:n.map((l,c)=>k(ue,{testID:`buoy-rq-action-${l.variant}`,onClick:l.onPress,text:l.label,variant:l.variant,disabled:l.disabled},c))})})}function Kl({visible:e,selectedQuery:t,queryVersion:r=0}){return e?Ge(f,{style:I.dataContainer,children:[k(v,{testID:"buoy-rq-data-header",style:I.dataHeader,children:"Data Editor"}),k(f,{style:I.dataContent,children:k(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"],activeQuery:t,dataVersion:r})})]}):null}function Ll({visible:e,selectedQuery:t}){if(!e)return null;let r=()=>t.isDisabled()?{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}:t.state.status==="pending"||se(t)==="fetching"?{title:t.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}:t.state.status==="error"?{title:"Query Error",description:t.state.error?.message||"An error occurred while fetching data."}:{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."},{title:o,description:a}=r();return Ge(f,{style:I.emptyState,children:[k(v,{testID:"buoy-rq-detail-empty-title",style:I.emptyTitle,children:o}),k(v,{testID:"buoy-rq-detail-empty-description",style:I.emptyDescription,children:a})]})}var I=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:z.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:z.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:z.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:z.color.surface,borderRadius:6,borderWidth:1,borderColor:z.color.accent+"4D",overflow:"hidden",shadowColor:z.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:z.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:z.color.accent,borderBottomWidth:1,borderBottomColor:z.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ea},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:z.color.surface,borderRadius:6,borderWidth:1,borderColor:z.color.accent+"4D",overflow:"hidden",shadowColor:z.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:z.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:z.color.accent,borderBottomWidth:1,borderBottomColor:z.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ea},dataContent:{padding:8}});import{useState as Bl,useCallback as Hl,useEffect as jl,useRef as Wl}from"react";import{jsx as kt}from"react/jsx-runtime";function ra({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:o,onMinimize:a,enableSharedModalDimensions:n=false,onTabChange:l}){let{query:c,version:s}=Wt(t),[u,i]=Bl("bottomSheet"),d=t?JSON.stringify(t):void 0,h=Wl(void 0);jl(()=>{if(c){h.current=d;return}e&&h.current!==void 0&&h.current===d&&(h.current=void 0,r(void 0))},[e,c,d,r]);let g=Hl(w=>{i(w)},[]),y=Ql({minBottom:16}),m=u==="floating"?72:80+y.bottom,b=()=>kt(ot,{selectedQuery:c,activeTab:"queries",onTabChange:l,onBack:()=>r(void 0)}),p=n?Yo.reactQuery.modal():`${Yo.reactQuery.modal()}_data_editor`;if(!e||!c)return null;let S=kt(zl,{selectedQuery:c,isFloatingMode:u==="floating",queryVersion:s},`footer-${s}`);return kt(Il,{visible:e,onClose:o,onMinimize:a,persistenceKey:p,header:{customContent:b(),showToggleButton:true},onModeChange:g,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:S,footerHeight:m,children:kt(ta,{selectedQuery:c,isFloatingMode:u==="floating",disableInternalFooter:true,queryVersion:s})})}import{useQueryClient as $l}from"@tanstack/react-query";import{useCallback as fr,useState as oa,useRef as aa}from"react";import{useEffect as Vl,useState as Nl}from"react";import{useQueryClient as Ul}from"@tanstack/react-query";function mr(e){let t=Ul(),[r,o]=Nl(void 0);return Vl(()=>{let a=()=>{if(e!==void 0){let l=t.getMutationCache().getAll().find(c=>c.mutationId===e);o(l)}else o(void 0)};setTimeout(a,0);let n=t.getMutationCache().subscribe(a);return()=>n()},[t,e]),r}import{jsx as na}from"react/jsx-runtime";function ia({selectedMutation:e,onMutationSelect:t,activeFilter:r,searchText:o=""}){let a=n=>{t(typeof n=="function"?n(e):n)};return na(f,{style:sa.mutationListContainer,children:na(Ro,{selectedMutation:e,setSelectedMutation:a,activeFilter:r,searchText:o,hideInfoPanel:true,contentContainerStyle:sa.mutationListContent})})}var sa=T.create({mutationListContainer:{flex:1,backgroundColor:"transparent"},mutationListContent:{padding:8,backgroundColor:"transparent"}});import{ToolFooter as _l,useSafeAreaInsets as Jl}from"@buoy-gg/shared-ui/web";import{useMemo as Gl}from"react";import{jsx as pr}from"react/jsx-runtime";function la({activeFilter:e,onFilterChange:t,modalMode:r,size:o="default"}){let a=r==="floating",n=Jl({minBottom:16}),l=Gl(()=>a?0:n.bottom,[a,n.bottom]);return pr(_l,{floating:a,safeArea:false,paddingBottom:l,style:ua.filterFooter,children:pr(f,{style:ua.filterContainer,children:pr(Do,{activeFilter:e,onFilterChange:t,size:o})})},`footer-${a?"floating":"docked"}`)}var ua=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{JsModal as Yl,useSafeAreaInsets as Xl}from"@buoy-gg/shared-ui/web";import{absoluteFill as Zl}from"@buoy-gg/shared-ui/web";import{useMemo as W}from"react";import{ChevronLeft as eu,ChevronRight as tu,night as It}from"@buoy-gg/shared-ui/web";import{jsx as Ye,jsxs as ru}from"react/jsx-runtime";var He=32,ca=6,da=He,ou=120,Qt=.95,ya=1.15;function ha({translationX:e,maxTranslation:t=ou,canSwipeLeft:r=true,canSwipeRight:o=true}){let a=W(()=>e.interpolate({inputRange:[0,t],outputRange:[0,1],extrapolate:"clamp"}),[e,t]),n=W(()=>a.interpolate({inputRange:[0,1],outputRange:[ca,da]}),[a]),l=W(()=>a.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,ya]}),[a]),c=W(()=>a.interpolate({inputRange:[0,.99,1],outputRange:[0,0,16]}),[a]),s=W(()=>a.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[a]),u=W(()=>a.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[a]),i=W(()=>a.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[a]),d=W(()=>e.interpolate({inputRange:[-t,0],outputRange:[1,0],extrapolate:"clamp"}),[e,t]),h=W(()=>d.interpolate({inputRange:[0,1],outputRange:[ca,da]}),[d]),g=W(()=>d.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,ya]}),[d]),y=W(()=>d.interpolate({inputRange:[0,.99,1],outputRange:[0,0,-16]}),[d]),m=W(()=>d.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[d]),b=W(()=>d.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[d]),p=W(()=>d.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[d]);return ru(f,{style:gr.container,pointerEvents:"none",children:[o&&Ye(Z.View,{style:[gr.leftWrapper,{width:n,height:He,borderRadius:He/2,backgroundColor:It.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:s,transform:[{scale:l},{translateX:c}]}],children:Ye(Z.View,{style:{opacity:u,transform:[{scale:i}]},children:Ye(eu,{size:He*.6,color:It.color.accent,strokeWidth:3})})}),r&&Ye(Z.View,{style:[gr.rightWrapper,{width:h,height:He,borderRadius:He/2,backgroundColor:It.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:m,transform:[{scale:g},{translateX:y}]}],children:Ye(Z.View,{style:{opacity:b,transform:[{scale:p}]},children:Ye(tu,{size:He*.6,color:It.color.accent,strokeWidth:3})})})]})}var gr=T.create({container:{...Zl,zIndex:1e3,justifyContent:"center",alignItems:"center"},leftWrapper:{position:"absolute",left:16},rightWrapper:{position:"absolute",right:16}});import{devToolsStorageKeys as fa}from"@buoy-gg/shared-ui/web";import{jsx as Xe,jsxs as au}from"react/jsx-runtime";function ma({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:o,onMinimize:a,activeFilter:n,onFilterChange:l,onTabChange:c,enableSharedModalDimensions:s=false,searchText:u="",onSearchChange:i}){let d=$l(),h=mr(t),[g,y]=oa(null),m=n??g,b=l??y,p=fr(()=>{d.getMutationCache().clear(),r(void 0)},[d,r]),[S,w]=oa("bottomSheet"),C=s?fa.reactQuery.modal():fa.reactQuery.mutationModal(),q=aa(new Z.Value(0)).current,A=fr(ne=>{ne==="right"&&c("queries")},[c]),$=fr(ne=>{w(ne)},[]),Qe=Xl({minBottom:16}),M=S==="floating"?56:48+Qe.bottom,ae=aa($t.create({onStartShouldSetPanResponder:()=>false,onMoveShouldSetPanResponder:(ne,ie)=>Math.abs(ie.dx)>5&&Math.abs(ie.dy)<10,onPanResponderMove:(ne,ie)=>{q.setValue(ie.dx)},onPanResponderRelease:(ne,ie)=>{let{dx:mt,vx:pt}=ie,Ht=80,gt=.5;Z.spring(q,{toValue:0,useNativeDriver:true}).start(),(Math.abs(mt)>Ht||Math.abs(pt)>gt)&&(mt>0||pt>0?A("right"):A("left"))},onPanResponderTerminate:()=>{Z.spring(q,{toValue:0,useNativeDriver:true}).start()}})).current;if(!e)return null;let ye=()=>Xe(ot,{selectedMutation:h,activeTab:"mutations",onTabChange:c,onBack:()=>r(void 0),searchText:u,onSearchChange:i,onClearCache:p}),he=Xe(la,{activeFilter:m,onFilterChange:b,modalMode:S});return Xe(Yl,{visible:e,onClose:o,onMinimize:a,persistenceKey:C,header:{customContent:ye(),showToggleButton:true},onModeChange:$,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:he,footerHeight:M,children:Xe(f,{style:{flex:1},children:au(f,{...ae.panHandlers,style:{flex:1},children:[Xe(ha,{translationX:q,canSwipeLeft:false,canSwipeRight:true}),Xe(ia,{selectedMutation:h,onMutationSelect:r,activeFilter:m,searchText:u})]})})})}import{JsModal as nu,useSafeAreaInsets as iu,devToolsStorageKeys as pa}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as su,night as K,monoFont as ga}from"@buoy-gg/shared-ui/web";import{useMemo as lu}from"react";import{useQueryClient as uu}from"@tanstack/react-query";function ba(e){let t=uu();return lu(()=>[{label:"Remove",variant:"remove",disabled:false,onPress:()=>t.getMutationCache().remove(e)}],[e,t])}import{DataViewer as cu}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as du,jsx as Q,jsxs as Ze}from"react/jsx-runtime";function va({selectedMutation:e,isFloatingMode:t,disableInternalFooter:r=false}){return Ze(du,{children:[Ze(be,{keyboardShouldPersistTaps:"handled",testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:P.explorerScrollContainer,contentContainerStyle:P.explorerScrollContent,children:[Ze(f,{style:P.section,children:[Q(yu,{visible:!!e.state.data,selectedMutation:e}),Q(hu,{visible:!e.state.data,selectedMutation:e})]}),Q(f,{style:P.section,children:Q(sr,{selectedMutation:e})}),Q(f,{style:P.section,children:Ze(f,{style:P.mutationExplorerContainer,children:[Q(v,{style:P.mutationExplorerHeader,children:"Mutation Explorer"}),Q(f,{style:P.mutationExplorerContent,children:Q(cu,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&Q(Sa,{selectedMutation:e,isFloatingMode:t})]})}function Sa({selectedMutation:e,isFloatingMode:t}){let r=su({minBottom:16}),o=ba(e);return Q(f,{style:[P.actionFooter,{paddingBottom:t?0:r.bottom+8}],children:Q(f,{style:P.actionsGrid,children:o.map((a,n)=>Q(ue,{testID:`buoy-rq-action-${a.variant}`,onClick:a.onPress,text:a.label,variant:a.variant,disabled:a.disabled},n))})})}function yu({visible:e,selectedMutation:t}){return e?Ze(f,{style:P.dataContainer,children:[Q(v,{style:P.dataHeader,children:"Data Editor"}),Q(f,{style:P.dataContent,children:Q(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"]},t.mutationId)})]}):null}function hu({visible:e,selectedMutation:t}){if(!e)return null;let r=()=>t.state.status==="pending"?{title:"Pending...",description:"The mutation is in progress."}:t.state.status==="error"?{title:"Mutation Error",description:t.state.error?.message||"An error occurred."}:{title:"No Data Available",description:"This mutation has no data."},{title:o,description:a}=r();return Ze(f,{style:P.emptyState,children:[Q(v,{testID:"buoy-rq-mutation-detail-empty-title",style:P.emptyTitle,children:o}),Q(v,{testID:"buoy-rq-mutation-detail-empty-description",style:P.emptyDescription,children:a})]})}var P=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:K.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:K.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:K.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ga},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ga},dataContent:{padding:8}});import{useState as fu,useCallback as mu,useEffect as pu,useRef as gu}from"react";import{jsx as Ft}from"react/jsx-runtime";function Ca({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:o,onMinimize:a,onTabChange:n,enableSharedModalDimensions:l=false}){let c=mr(t),[s,u]=fu("bottomSheet"),i=gu(void 0);pu(()=>{if(c){i.current=c.mutationId;return}e&&i.current!==void 0&&i.current===t&&(i.current=void 0,r(void 0))},[e,c,t,r]);let d=mu(p=>{u(p)},[]),h=iu({minBottom:16}),g=s==="floating"?72:80+h.bottom,y=()=>Ft(ot,{selectedMutation:c,activeTab:"mutations",onTabChange:n,onBack:()=>r(void 0)}),m=l?pa.reactQuery.modal():pa.reactQuery.mutationModal();if(!e||!c)return null;let b=Ft(Sa,{selectedMutation:c,isFloatingMode:s==="floating"});return Ft(nu,{visible:e,onClose:o,onMinimize:a,persistenceKey:m,header:{customContent:y(),showToggleButton:true},onModeChange:d,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:b,footerHeight:g,children:Ft(va,{selectedMutation:c,isFloatingMode:s==="floating",disableInternalFooter:true})})}import{Fragment as bu,jsx as Pt,jsxs as vu}from"react/jsx-runtime";function xa({visible:e,selectedQueryKey:t,selectedMutationId:r,onQuerySelect:o,onMutationSelect:a,onClose:n,onMinimize:l,activeFilter:c,onFilterChange:s,activeTab:u,onTabChange:i,enableSharedModalDimensions:d=false,searchText:h="",onSearchChange:g}){let y=!!t||!!r,m=u==="queries",b=u==="mutations",p={onClose:n,onMinimize:l,activeFilter:c,onFilterChange:s,enableSharedModalDimensions:d},S=e&&!y&&m,w=e&&!y&&b,C=e&&y&&m&&!!t,q=e&&y&&b&&!!r;return vu(bu,{children:[Pt(Go,{visible:S,selectedQueryKey:t,onQuerySelect:o,onTabChange:i,searchText:h,onSearchChange:g,...p}),Pt(ma,{visible:w,selectedMutationId:r,onMutationSelect:a,onTabChange:i,searchText:h,onSearchChange:g,...p}),Pt(ra,{visible:C,selectedQueryKey:t,onQuerySelect:o,onTabChange:i,...p}),Pt(Ca,{visible:q,selectedMutationId:r,onMutationSelect:a,onTabChange:i,...p})]})}import{ChangeLog as Su}from"@buoy-gg/shared-ui/web";var Cu=0;function Re(){return`rq-${Date.now()}-${++Cu}`}var xu=class extends Su{constructor(){super({max:200});this.queryClient=null;this.queryUnsubscribe=null;this.mutationUnsubscribe=null;this.fetchStartTimes=new Map;this.mutationStartTimes=new Map;this.lastQueryStates=new Map;this.lastMutationStates=new Map}setQueryClient(e){this.disconnect(),this.queryClient=e,this.queryUnsubscribe=e.getQueryCache().subscribe(t=>{t.type==="updated"&&t.query&&this.handleQueryUpdate(t.query)}),this.mutationUnsubscribe=e.getMutationCache().subscribe(t=>{t.type==="updated"&&t.mutation&&this.handleMutationUpdate(t.mutation)})}disconnect(){this.queryUnsubscribe&&(this.queryUnsubscribe(),this.queryUnsubscribe=null),this.mutationUnsubscribe&&(this.mutationUnsubscribe(),this.mutationUnsubscribe=null),this.queryClient=null,this.lastQueryStates.clear(),this.lastMutationStates.clear(),this.fetchStartTimes.clear(),this.mutationStartTimes.clear()}handleQueryUpdate(e){if(Se(e.queryKey))return;let t=e.queryHash,r={fetchStatus:e.state.fetchStatus,status:e.state.status},o=this.lastQueryStates.get(t);if(!o)r.fetchStatus==="fetching"&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e}));else{let a=o.fetchStatus==="fetching",n=r.fetchStatus==="fetching";if(!a&&n&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})),a&&!n){let l=this.fetchStartTimes.get(t),c=l?Date.now()-l:void 0;this.fetchStartTimes.delete(t),r.status==="error"?this.addEvent({id:Re(),type:"query-fetch-error",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryError:e.state.error,duration:c,query:e}):this.addEvent({id:Re(),type:"query-fetch-success",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryData:e.state.data,duration:c,query:e})}!o.status&&e.state.isInvalidated&&this.addEvent({id:Re(),type:"query-invalidated",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})}this.lastQueryStates.set(t,r)}handleMutationUpdate(e){let t=e.mutationId,r=e.state.status,o=this.lastMutationStates.get(t);if(o!==r){if(r==="pending"&&o!=="pending")this.mutationStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"mutation-start",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutation:e});else if(r==="success"&&o==="pending"){let a=this.mutationStartTimes.get(t),n=a?Date.now()-a:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-success",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationData:e.state.data,duration:n,mutation:e})}else if(r==="error"&&o==="pending"){let a=this.mutationStartTimes.get(t),n=a?Date.now()-a:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-error",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationError:e.state.error,duration:n,mutation:e})}}this.lastMutationStates.set(t,r)}addEvent(e){this.record(e)}getEvents(){return this.items}subscribe(e){let t=super.subscribe(e);return e(this.items),t}clearEvents(){this.clear()}isConnected(){return this.queryClient!==null}},je=new xu,wu=e=>je.setQueryClient(e),qu=()=>je.disconnect();import{jsx as wa}from"react/jsx-runtime";function br({visible:e,onClose:t,onMinimize:r,enableSharedModalDimensions:o=true}){let a=yn();dn(()=>{je.isConnected()||je.setQueryClient(a)},[a]);let[n,l]=tt(void 0),[c,s]=tt(void 0),[u,i]=tt(null),[d,h]=tt("queries"),[g,y]=tt(""),m=Fe(()=>{l(void 0),s(void 0),i(null),h("queries"),y("")},[]),b=Fe(()=>{m(),t()},[t,m]),p=Fe(A=>{l(A?.queryKey)},[]),S=Fe(A=>{s(A?.mutationId)},[]),w=Fe(A=>{i(A)},[]),C=Fe(A=>{h(A),i(null),l(void 0),s(void 0),y("")},[]),q=Fe(A=>{y(A)},[]);return e?wa(hn,{children:wa(xa,{visible:e,selectedQueryKey:n,selectedMutationId:c,onQuerySelect:p,onMutationSelect:S,onClose:b,onMinimize:r,activeFilter:u,onFilterChange:w,activeTab:d,onTabChange:C,searchText:g,onSearchChange:q,enableSharedModalDimensions:o})}):null}import{onlineManager as ge}from"@tanstack/react-query";import{devToolsStorageKeys as qa,persistentStorage as Ma}from"@buoy-gg/shared-ui/web";import{useState as Ta,useEffect as Aa}from"react";import{jsx as Ot}from"react/jsx-runtime";var Ea=()=>null,Ra=async e=>{try{await Ma.setItem(qa.settings.wifiEnabled(),e.toString())}catch{}},Mu=async()=>{try{let e=await Ma.getItem(qa.settings.wifiEnabled());e!==null&&ge.setOnline(e==="true")}catch{}};Mu();function Tu({size:e}){let[t,r]=Ta(()=>ge.isOnline());return Aa(()=>ge.subscribe(o=>{r(o)}),[]),Ot(Ar,{size:e,color:t?"#10B981":"#DC2626"})}var Au={id:"query",name:"QUERY",description:"React Query inspector",slot:"both",icon:({size:e})=>Ot(Tr,{size:e}),component:br,props:{enableSharedModalDimensions:false}};function Eu(e){return{id:e?.id||"query",name:e?.name||"QUERY",description:e?.description||"React Query inspector",slot:"both",icon:({size:t})=>Ot(Tr,{size:t}),component:br,props:{enableSharedModalDimensions:e?.enableSharedModalDimensions!==void 0?e.enableSharedModalDimensions:false}}}var Ru={id:"query-wifi-toggle",name:"WIFI",description:"Toggle React Query online/offline state",slot:"row",icon:Tu,component:Ea,props:{},launchMode:"toggle-only",onPress:()=>{let e=!ge.isOnline();ge.setOnline(e),Ra(e)}};function Du(e){let t=e?.onColor||"#10B981",r=e?.offColor||"#DC2626",o=({size:a})=>{let[n,l]=Ta(()=>ge.isOnline());return Aa(()=>ge.subscribe(c=>{l(c)}),[]),Ot(Ar,{size:a,color:n?t:r})};return{id:e?.id||"query-wifi-toggle",name:e?.name||"WIFI",description:e?.description||"Toggle React Query online/offline state",slot:"row",icon:o,component:Ea,props:{},launchMode:"toggle-only",onPress:()=>{let a=!ge.isOnline();ge.setOnline(a),Ra(a)}}}import{expandKeyedArrays as ku,patchFromPath as Iu,readPath as Qu,refusalText as Fu,shapeSummary as zt,suggestedPatch as Pu,typedEditViolations as Ou,unshapedLists as zu}from"@buoy-gg/shared-ui/web";import{onlineManager as vr}from"@tanstack/react-query";import{isJsonSerializable as Da,isOverWireBudget as ka}from"@buoy-gg/shared-ui/web";var Ku=Object.freeze({__buoyDataOnDevice:true,note:"Query data stays on the device \u2014 fetched on demand via getQueryData."}),Ia=Object.freeze({__buoyUnserializable:true,note:"Query data is not JSON-serializable (circular or bigint) and stayed on the device."}),Lu=16*1024,Qa=8*1024*1024;function Bu(e){return!!e&&typeof e=="object"&&e.__buoyDataOnDevice===true}function Hu(e){return!!e&&typeof e=="object"&&e.__buoyUnserializable===true}function Fa(e){return Bu(e)||Hu(e)}function De(e){if(e!==void 0)return ka(e,Lu)?Da(e)?Ku:Ia:e}function Kt(e){if(e==null)return e;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,o=typeof t.message=="string"?t.message:void 0;if(r!==void 0||o!==void 0)return De({...r!==void 0?{name:r}:{},...o!==void 0?{message:o}:{}})}return De(e)}function ju(e){return ka(e,Qa)?Da(e)?{__buoyTruncated:true,note:`Exceeds the ${Qa/(1024*1024)}MB detail limit \u2014 inspect it on-device.`}:Ia:e}function Wu(e){let t=e.getMutationCache().getAll().map(o=>$u(o)),r=e.getQueryCache().getAll().map(o=>Nu(o));return{mutations:t,queries:r}}function $u(e){let t=e.state;return{mutationId:e.mutationId,mutationKey:e.options.mutationKey,state:{...t,data:De(t.data),variables:De(t.variables),error:Kt(t.error),failureReason:Kt(t.failureReason)},...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:De(e.meta)}}}function Vu(e){let{queryFn:t,select:r,persister:o,initialData:a,placeholderData:n,...l}=e;return{...l,queryFn:void 0,...e.meta?{meta:De(e.meta)}:{}}}function Nu(e){let t=e.observers.map(r=>({queryHash:e.queryHash,options:Vu(r.options)}));return{state:{...e.state,...e.state.data!==void 0&&{data:De(e.state.data)},error:Kt(e.state.error),fetchFailureReason:Kt(e.state.fetchFailureReason)},queryKey:e.queryKey,queryHash:e.queryHash,...e.meta&&{meta:De(e.meta)},observers:t}}function Uu(e,t){let r=e;for(let o of t.split(".")){if(!r||typeof r!="object"||Array.isArray(r)||!(o in r))return false;r=r[o]}return Array.isArray(r)?r.length>0:!!r&&typeof r=="object"}var ht=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Pa(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}function Oa(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(!ht(e)||!ht(t))return t;let a={...e};for(let[n,l]of Object.entries(t)){let c=r?`${r}.${n}`:n;if(n in e){let s=Pa(e[n]),u=Pa(l);(s==="array"||s==="object")&&s!==u&&o.breaks.push({path:c,from:s,to:u}),a[n]=Oa(e[n],l,c,o)}else a[n]=l}return a}function _u(e){let t=e.trim();try{let r=JSON.parse(t);if(Array.isArray(r))return r.map(o=>typeof o=="object"&&o!==null?JSON.stringify(o):String(o))}catch{}return t.includes(",")&&!t.startsWith("[")?t.split(",").map(r=>r.trim().replace(/^["']|["']$/g,"")):null}function Ju(e){let t;for(let r of e.observers??[]){let o=r.options?.refetchInterval,a=o;if(typeof o=="function")try{a=o(e)}catch{a=void 0}typeof a=="number"&&a>0&&(t=t===void 0?a:Math.min(t,a))}return t}function za(e){let t=r=>{let{queryHash:o}=r,a=e.getQueryCache(),n=o?a.get(o):void 0;if(!n&&typeof o=="string"){let l=_u(o);l&&(n=a.getAll().find(c=>{let s=c.queryKey.map(u=>typeof u=="object"?JSON.stringify(u):String(u));return s.length===l.length&&s.every((u,i)=>u===l[i])}))}if(!n)throw new Error(`Query with hash "${o}" not found`);return n};return{version:2,getSnapshot:()=>({dehydratedState:Wu(e),isOnlineManagerOnline:vr.isOnline()}),subscribe:r=>{let o=e.getQueryCache().subscribe(r),a=e.getMutationCache().subscribe(r),n=vr.subscribe(r);return()=>{o(),a(),n()}},actions:{getQueryData:r=>{let{queryHash:o,path:a}=r??{};if(!o)return{found:false,reason:"missing queryHash"};let n=e.getQueryCache().get(o);if(!n)return{found:false,reason:"unknown queryHash"};if(a){let c=Qu(n.state.data,a);return c.ok?{found:true,queryHash:o,path:a,shape:zt(c.value),data:c.value}:{found:false,reason:c.error}}if(n.state.data===void 0){let c=n.state.status,s=n.state.error;return{found:true,queryHash:o,hasData:false,status:c,fetchStatus:n.state.fetchStatus,...s?{error:s instanceof Error?s.message:String(s)}:{},reason:c==="error"?"This query has no data because it FAILED. Report the error, not an empty result.":n.state.fetchStatus==="fetching"?"No data yet \u2014 this query is still fetching.":"This query has never resolved (it may be disabled, or never enabled). It is not empty \u2014 it has nothing."}}let l=zt(n.state.data);return{found:true,queryHash:o,hasData:true,...l?{shape:l}:{},data:ju(n.state.data)}},listQueries:r=>{let{includeData:o=false,staleOnly:a=false,limit:n}=r??{},l=e.getQueryCache().getAll(),c=[...a?l.filter(u=>u.isStale()):l].sort((u,i)=>{let d=+(i.getObserversCount()>0)-+(u.getObserversCount()>0);return d!==0?d:(i.state.dataUpdatedAt??0)-(u.state.dataUpdatedAt??0)}),s=(typeof n=="number"&&n>0?c.slice(0,n):c).map(u=>{let i=u.state.error,d=Ju(u);return{queryHash:u.queryHash,queryKey:u.queryKey,status:se(u),fetchStatus:u.state.fetchStatus,isStale:u.isStale(),observers:u.getObserversCount(),updatedAt:u.state.dataUpdatedAt,...d?{refetchEveryMs:d}:{},error:i?i.message??String(i):void 0,...o?{data:u.state.data}:{},...zt(u.state.data)?{shape:zt(u.state.data)}:{}}});return{queries:s,total:l.length,returned:s.length,includedData:o}},refetch:r=>t(r).fetch().catch(()=>{}),invalidate:r=>e.invalidateQueries(t(r)),reset:r=>e.resetQueries(t(r)),remove:r=>{let o=t(r),a=e.getQueryCache().findAll(o).some(n=>n.getObserversCount()>0);return e.removeQueries(o),{ok:true,...a?{note:"Removed \u2014 but a screen is still watching this query, and React Query leaves that screen rendering its LAST value (including anything written into the cache before this) until something refetches. Nothing on screen will change on its own. Use `reset` instead when you want the screen to go back to loading and fetch again."}:{}}},setQueryData:r=>{let{data:o,merge:a,force:n,path:l,value:c}=r,{queryKey:s,queryHash:u}=r,i=s;if(i===void 0&&typeof u=="string"){let y=e.getQueryCache().get(u);if(!y)return{ok:false,error:`Refused: no query with hash ${u} is in the cache. Read listQueries for the current hashes \u2014 a query that has been removed or whose key includes changing params (a search term, a cart payload) will not match an older hash.`};i=y.queryKey}if(i===void 0)return{ok:false,error:"Refused: no query was named. Send `queryKey` (the array from listQueries) or `queryHash` (its string form)."};let d=e.getQueryData(i),h=e.getQueryCache().find({queryKey:i,exact:true});if(d===void 0&&h&&(o!==void 0||l!==void 0)){let y=h,m=y?.state.status;return{ok:false,error:`Refused: this query has no data to edit \u2014 ${m==="error"?`it FAILED${y?.state.error?` (${y.state.error instanceof Error?y.state.error.message:String(y.state.error)})`:""}`:m==="pending"?"it has never resolved (it may be disabled, or still loading)":"it holds no data"}. There is nothing to merge into. Fix the cause first (restoreError, or let it fetch), or send force:true with the COMPLETE value if you mean to seed the cache from nothing.`,status:m}}if(o===void 0&&l===void 0)return{ok:false,error:"Refused: no change was described. Send `data` (with merge:true for a partial edit), or `path` and `value` to set one value."};let g=o;if(l!==void 0){if(c===void 0)return{ok:false,error:`Refused: sent \`path\` without \`value\`. Say what to set "${l}" to; if you mean to clear it, send value:null and the field must already be nullable.`};let y=Iu(d,l,c);if(!y.ok)return{ok:false,error:`Refused: ${y.error}`};g=y.patch}if(a||l!==void 0){let y=n?{patch:g,notes:[],error:void 0}:ku(d,g);if(y.error)return{ok:false,error:`Refused: ${y.error}`};let m=y.patch;if(!n){let S=Ou(d,m,{noun:"data"});if(S.length>0){let w=Pu(m,S);return{ok:false,error:Fu(S,"data",w),violations:S,...w?{suggestedData:w}:{}}}}let b=Oa(d,m),p=zu(d).filter(S=>Uu(m,S));return e.setQueryData(i,b,{updatedAt:Date.now()}),{ok:true,mode:"merge",...l!==void 0?{path:l}:{},changedKeys:ht(m)?Object.keys(m):void 0,...y.notes.length?{keyed:y.notes}:{},...p.length?{unchecked:p.map(S=>`\`${S}\` was empty, so nothing in the app knows what its items look like and the shape of what you added was NOT checked. If the screen renders a field you left out, it will render undefined \u2014 read the query back and compare against how the screen uses it.`)}:{}}}if(!n&&ht(d)&&ht(o)){let y=Object.keys(d).filter(m=>!(m in o));if(y.length>0)return{ok:false,error:`Refused: the new value drops ${y.length} top-level field(s) the cached value has (${y.slice(0,8).join(", ")}${y.length>8?", \u2026":""}). A screen rendering those fields would crash. To change some fields, send merge:true with ONLY the fields that change. To really replace the whole value, send force:true.`,missingKeys:y}}return e.setQueryData(i,o,{updatedAt:Date.now()}),{ok:true,mode:"replace"}},triggerError:r=>{let o=t(r),a=o.options;o.setState({status:"error",error:new Error("Unknown error from devtools"),fetchMeta:{...o.state.fetchMeta,__previousQueryOptions:a}})},restoreError:r=>(e.resetQueries(t(r)).catch(()=>{}),{restored:true}),triggerLoading:r=>{let o=t(r),a=o.options;o.fetch({...a,queryFn:()=>new Promise(()=>{}),gcTime:-1}).catch(()=>{}),o.setState({data:void 0,status:"pending",fetchMeta:{...o.state.fetchMeta,__previousQueryOptions:a}})},restoreLoading:r=>{let o=t(r),a=o.state,n=o.state.fetchMeta?o.state.fetchMeta.__previousQueryOptions:null;o.cancel({silent:true}),o.setState({...a,fetchStatus:"idle",fetchMeta:null}),n&&o.fetch(n).catch(()=>{})},clearQueryCache:()=>{let r=e.getQueryCache().getAll().filter(o=>o.getObserversCount()>0).length;return e.getQueryCache().clear(),{ok:true,cleared:true,...r?{note:`Cleared \u2014 but ${r} quer${r===1?"y is":"ies are"} still being watched by a screen, and React Query leaves those screens rendering their LAST value until something refetches. The cache is empty; the app on screen is not. Use \`reset\` on a query when you want its screen to reload.`}:{}}},clearMutationCache:()=>{e.getMutationCache().clear()},setOnline:r=>{let{online:o}=r;vr.setOnline(o)}}}}import{useEffect as Gu,useMemo as Yu}from"react";import{useQueryClient as Xu}from"@tanstack/react-query";import{classifyPreviewItem as Zu,createRestoreScope as ec,emptyRestoreResult as tc,failedRestore as rc,registerStateSnapshotProvider as oc,superJsonSerialize as ac}from"@buoy-gg/shared-ui/web";function Ka(e){return{...e,fetchStatus:"idle",fetchMeta:null}}function Sr(e){return{status:e.state.status,error:e.state.error??null,data:e.state.data}}function Cr(e,t){try{let r=JSON.stringify(e);return r.length>60?`${r.slice(0,57)}\u2026`:r}catch{return t}}function La(e){if(e==null)return e??null;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,o=typeof t.message=="string"?t.message:void 0;if(r!==void 0||o!==void 0)return{...r!==void 0?{name:r}:{},...o!==void 0?{message:o}:{}}}return e}function Ba(e){if(e===void 0)return true;try{return ac(e),true}catch{return false}}function Ha(e){let t=[],r=[];for(let o of e.getQueryCache().getAll()){let a=Cr(o.queryKey,o.queryHash);if(!Ba(o.state.data)){t.push(`query ${a}: data can't be serialized (circular reference?) \u2014 not captured`);continue}r.push({queryKey:o.queryKey,queryHash:o.queryHash,...o.meta&&Ba(o.meta)?{meta:o.meta}:{},state:Ka({...o.state,error:La(o.state.error),fetchFailureReason:La(o.state.fetchFailureReason)})})}return{queries:r,warnings:t}}function nc(e){return{id:"query",label:"React Query",status:()=>({canCapture:true,canRestore:true}),async capture(){let{queries:t,warnings:r}=Ha(e),o=e.getMutationCache().getAll().length;return o>0&&r.push(`${o} mutation(s) not captured (mutation functions cannot be restored)`),{data:{queries:t},warnings:r}},async restore(t,r){let o=t,a=ec(r),n=tc();if(!o?.queries)return rc("empty query snapshot");let l=e.getQueryCache(),c=new Set(o.queries.map(i=>i.queryHash));for(let i of o.queries)if(a.allows(i.queryHash)){if(Fa(i.state.data)){n.skipped.push({id:i.queryHash,reason:"captured as an on-device placeholder by an older Buoy \u2014 re-capture this restore point"});continue}try{let d=Ka(i.state),h=l.get(i.queryHash);h?h.setState(d):l.build(e,{queryKey:i.queryKey,queryHash:i.queryHash,...i.meta&&{meta:i.meta}},d),n.applied+=1}catch(d){n.skipped.push({id:i.queryHash,reason:String(d)}),n.ok=false}}for(let i of l.getAll().slice())if(a.allows(i.queryHash)&&!c.has(i.queryHash))try{l.remove(i),n.applied+=1}catch(d){n.skipped.push({id:i.queryHash,reason:String(d)})}let s=e.getMutationCache().getAll().length;s>0&&(e.getMutationCache().clear(),n.warnings.push(`mutation cache cleared (${s} mutation(s))`));let u=a.excludedWarning("quer(y/ies)");return u&&n.warnings.push(u),n},async previewItems(t,r){let o=t?.queries??[],a=r===void 0,n=a?Ha(e).queries:r?.queries??[],l=new Map(n.map(i=>[i.queryHash,i])),c=new Map(o.map(i=>[i.queryHash,i])),s=[],u=[];for(let i of o){let d=Cr(i.queryKey,i.queryHash);if(Fa(i.state.data)){s.push({key:i.queryHash,label:d,verdict:"wont-apply",reason:"data stayed on the device when this was captured (older Buoy) \u2014 re-capture this restore point"});continue}let h=l.get(i.queryHash);s.push(Zu({key:i.queryHash,label:d,oldValue:h?Sr(h):void 0,newValue:Sr(i),inOld:h!==void 0,inNew:true},{tooLargeReason:"query data too large to render a diff \u2014 restore still applies it"}))}for(let i of n)c.has(i.queryHash)||s.push({key:i.queryHash,label:Cr(i.queryKey,i.queryHash),verdict:"removed",oldValue:Sr(i)});if(a){let i=e.getMutationCache().getAll().length;i>0&&u.push(`${i} in-memory mutation record(s) will be cleared`)}return{items:s,notes:u}}}}function ic(e){return oc(nc(e))}function sc(){let e;try{e=Xu()}catch{e=null}return Gu(()=>{if(e)return ic(e)},[e]),Yu(()=>e?za(e):null,[e])}function ja({queryState:e,observerCount:t,isStale:r}){return e.fetchStatus==="fetching"?"blue":e.status==="error"?"red":t?e.fetchStatus==="paused"?"purple":r?"yellow":"green":"gray"}import{useQueryClient as lc}from"@tanstack/react-query";import{jsx as Lt,jsxs as ke}from"react/jsx-runtime";function Wa(){try{let e=lc(),t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return ke(f,{style:Y.container,children:[Lt(v,{style:Y.title,children:"Debug Info"}),Lt(v,{style:Y.info,children:"QueryClient: \u2705 Available"}),ke(v,{style:Y.info,children:["Queries: ",t.length]}),ke(v,{style:Y.info,children:["Mutations: ",r.length]}),t.length>0&&ke(f,{style:Y.queriesList,children:[Lt(v,{style:Y.subtitle,children:"Query Keys:"}),t.slice(0,3).map((o,a)=>ke(v,{style:Y.queryKey,children:["\u2022"," ",Array.isArray(o.queryKey)?o.queryKey.join(" - "):String(o.queryKey)]},a)),t.length>3&&ke(v,{style:Y.more,children:["... and ",t.length-3," more"]})]})]})}catch(e){return ke(f,{style:Y.container,children:[Lt(v,{style:Y.title,children:"Debug Info"}),ke(v,{style:Y.error,children:["\u274C QueryClient Error: ",String(e)]})]})}}var Y=T.create({container:{padding:16,backgroundColor:"rgba(0, 0, 0, 0.3)",borderRadius:8,margin:16,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)"},title:{color:"#FFFFFF",fontSize:14,fontWeight:"600",marginBottom:8},subtitle:{color:"#E5E7EB",fontSize:12,fontWeight:"500",marginTop:8,marginBottom:4},info:{color:"#9CA3AF",fontSize:12,marginBottom:4},error:{color:"#EF4444",fontSize:12,marginBottom:4},queriesList:{marginTop:4},queryKey:{color:"#60A5FA",fontSize:11,marginLeft:8,marginBottom:2},more:{color:"#9CA3AF",fontSize:11,fontStyle:"italic",marginLeft:8}});import{jsx as Ie,jsxs as et}from"react/jsx-runtime";function uc({queries:e,selectedQuery:t,isOpen:r,onClose:o,onSelect:a}){let n=l=>Array.isArray(l.queryKey)?l.queryKey.join(" - "):String(l.queryKey);return Ie(Lr,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:r,transparent:true,animationType:"fade",onRequestClose:o,children:Ie(zr,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:L.modalOverlay,onPress:o,children:et(f,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:L.modalContent,children:[et(f,{style:L.modalHeader,children:[Ie(v,{style:L.modalTitle,children:"Select Query"}),et(v,{style:L.modalSubtitle,children:[e.length," ",e.length===1?"query":"queries"," ","available"]})]}),Ie(be,{keyboardShouldPersistTaps:"handled",accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:L.scrollView,contentContainerStyle:L.scrollViewContent,showsVerticalScrollIndicator:true,children:e.length===0?et(f,{style:L.emptyState,children:[Ie(v,{style:L.emptyTitle,children:"No Queries Found"}),et(v,{style:L.emptyDescription,children:["No React Query queries are currently active.",`
7
7
 
8
8
  `,"To see queries here:",`
9
9
  `,"\u2022 Make API calls using useQuery",`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/react-query",
3
- "version": "7.0.76",
3
+ "version": "7.0.78",
4
4
  "description": "TanStack Query devtools inside your React Native app — cache inspection, refetch & invalidate, offline toggle. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -39,8 +39,8 @@
39
39
  "**/checkPeer.*"
40
40
  ],
41
41
  "dependencies": {
42
- "@buoy-gg/shared-ui": "^7.0.76",
43
- "@buoy-gg/floating-tools-core": "^7.0.76"
42
+ "@buoy-gg/floating-tools-core": "^7.0.78",
43
+ "@buoy-gg/shared-ui": "^7.0.78"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@tanstack/react-query": ">=5.0.0",