@buoy-gg/react-query 7.0.73 → 7.0.75

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.default=QueryDetails;var _QueryDetailsChip=_interopRequireDefault(require("./QueryDetailsChip"));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 QueryDetails({query:e}){if(e===void 0){return null}const t=new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.minWidth,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerText,children:"Query Details"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:styles.flexOne,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-key",style:styles.queryKeyText,children:(0,_sharedUi.displayValue)(e.queryKey,true)})}),(0,_jsxRuntime.jsx)(_QueryDetailsChip.default,{query:e,testID:"buoy-rq-detail-status"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Observers:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-observers",style:styles.valueText,children:`${e.getObserversCount()}`})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Last Updated:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-updated",style:styles.valueText,children:`${t}`})]})]})}const styles=_reactNative.StyleSheet.create({minWidth:{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},headerText:{backgroundColor:_sharedUi.night.color.accent+"15",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},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,lineHeight:18,flexShrink:1,backgroundColor:_sharedUi.night.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D"},labelText:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},valueText:{fontSize:12,color:_sharedUi.night.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:_sharedUi.monoFont}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryDetails;var _QueryDetailsChip=_interopRequireDefault(require("./QueryDetailsChip"));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 QueryDetails({query:e}){if(e===void 0){return null}const 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(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.minWidth,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerText,children:"Query Details"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:styles.flexOne,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-key",style:styles.queryKeyText,children:(0,_sharedUi.displayValue)(e.queryKey,true)})}),(0,_jsxRuntime.jsx)(_QueryDetailsChip.default,{query:e,testID:"buoy-rq-detail-status"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Observers:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-observers",style:styles.valueText,children:`${e.getObserversCount()}`})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Last Updated:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-updated",style:styles.valueText,children:`${t}`})]})]})}const styles=_reactNative.StyleSheet.create({minWidth:{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},headerText:{backgroundColor:_sharedUi.night.color.accent+"15",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},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,lineHeight:18,flexShrink:1,backgroundColor:_sharedUi.night.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D"},labelText:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},valueText:{fontSize:12,color:_sharedUi.night.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:_sharedUi.monoFont}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=require("react");var _getQueryStatusLabel=require("../../utils/getQueryStatusLabel");var _sharedUi=require("@buoy-gg/shared-ui");var _testIDs=require("../../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const getQueryText=e=>{if(!e?.queryKey)return"Unknown Query";const t=Array.isArray(e.queryKey)?e.queryKey:[e.queryKey];return t.filter(s=>s!=null).map(s=>String(s)).join(" \u203A ")||"Unknown Query"};const QueryRow=(0,_react.memo)(function e({query:t,isSelected:s,onSelect:d}){const n=a=>{switch(a){case"disabled":return _sharedUi.buoyColors.textMuted+"80";case"error":return _sharedUi.buoyColors.error;case"fresh":return _sharedUi.buoyColors.success;case"stale":return _sharedUi.buoyColors.warning;case"inactive":return _sharedUi.buoyColors.textMuted;case"fetching":return _sharedUi.buoyColors.primary;case"paused":return _sharedUi.buoyColors.textMuted;default:return _sharedUi.buoyColors.textSecondary}};const r=(0,_getQueryStatusLabel.getQueryStatusLabel)(t);const o=t.getObserversCount();const i=t.isDisabled();const l=getQueryText(t);const b=(()=>{if(i)return null;if(t.state.dataUpdatedAt&&t.state.dataUpdatedAt>0){return t.state.dataUpdatedAt}const a=t.state;if(a.fetchedAt&&a.fetchedAt>0){return a.fetchedAt}return null})();const y=(0,_sharedUi.useRelativeTime)(b);const p=i?"Disabled":y||(t.state.dataUpdatedAt===0?"Not fetched":`N/A (${t.state.dataUpdatedAt||0})`);const u=(0,_testIDs.queryRowTestID)(t.queryKey);const c=`${o} observer${o!==1?"s":""}`;return(0,_jsxRuntime.jsx)(_sharedUi.CompactRow,{testID:u,statusTestID:`${u}-status`,statusSublabelTestID:`${u}-observers`,accessibilityLabel:`${l}, ${r}, ${c}`,statusDotColor:n(r),statusLabel:r.charAt(0).toUpperCase()+r.slice(1),statusSublabel:c,primaryText:l,bottomRightText:p,badgeText:o,badgeColor:n(r),isSelected:s,onPress:()=>d(t)})});var _default=exports.default=QueryRow;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=require("react");var _getQueryStatusLabel=require("../../utils/getQueryStatusLabel");var _sharedUi=require("@buoy-gg/shared-ui");var _testIDs=require("../../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const getQueryText=t=>{if(!t?.queryKey)return"Unknown Query";const e=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];return e.filter(s=>s!=null).map(s=>String(s)).join(" \u203A ")||"Unknown Query"};const QueryRow=(0,_react.memo)(function t({query:e,isSelected:s,onSelect:d}){const n=a=>{switch(a){case"disabled":return _sharedUi.buoyColors.textMuted+"80";case"error":return _sharedUi.buoyColors.error;case"fresh":return _sharedUi.buoyColors.success;case"stale":return _sharedUi.buoyColors.warning;case"inactive":return _sharedUi.buoyColors.textMuted;case"fetching":return _sharedUi.buoyColors.primary;case"paused":return _sharedUi.buoyColors.textMuted;default:return _sharedUi.buoyColors.textSecondary}};const r=(0,_getQueryStatusLabel.getQueryStatusLabel)(e);const o=e.getObserversCount();const i=e.isDisabled();const l=getQueryText(e);const b=(()=>{if(i)return null;if(e.state.dataUpdatedAt&&e.state.dataUpdatedAt>0){return e.state.dataUpdatedAt}const a=e.state;if(a.fetchedAt&&a.fetchedAt>0){return a.fetchedAt}return null})();const y=(0,_sharedUi.useRelativeTime)(b);const v=i?"Disabled":y||"Never";const u=(0,_testIDs.queryRowTestID)(e.queryKey);const c=`${o} observer${o!==1?"s":""}`;return(0,_jsxRuntime.jsx)(_sharedUi.CompactRow,{testID:u,statusTestID:`${u}-status`,statusSublabelTestID:`${u}-observers`,accessibilityLabel:`${l}, ${r}, ${c}`,statusDotColor:n(r),statusLabel:r.charAt(0).toUpperCase()+r.slice(1),statusSublabel:c,primaryText:l,bottomRightText:v,badgeText:o,badgeColor:n(r),isSelected:s,onPress:()=>d(e)})});var _default=exports.default=QueryRow;
@@ -1 +1 @@
1
- "use strict";import s from"./QueryDetailsChip";import{View as i,Text as r,ScrollView as c,StyleSheet as h}from"react-native";import{displayValue as u,night as e,monoFont as a}from"@buoy-gg/shared-ui";import{jsx as o,jsxs as n}from"react/jsx-runtime";export default function y({query:l}){if(l===void 0){return null}const d=new Date(l.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});return n(i,{style:t.minWidth,children:[o(r,{style:t.headerText,children:"Query Details"}),n(i,{style:t.row,children:[o(c,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:t.flexOne,children:o(r,{testID:"buoy-rq-detail-key",style:t.queryKeyText,children:u(l.queryKey,true)})}),o(s,{query:l,testID:"buoy-rq-detail-status"})]}),n(i,{style:t.row,children:[o(r,{style:t.labelText,children:"Observers:"}),o(r,{testID:"buoy-rq-detail-observers",style:t.valueText,children:`${l.getObserversCount()}`})]}),n(i,{style:t.row,children:[o(r,{style:t.labelText,children:"Last Updated:"}),o(r,{testID:"buoy-rq-detail-updated",style:t.valueText,children:`${d}`})]})]})}const t=h.create({minWidth:{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},headerText:{backgroundColor:e.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:e.color.accent,borderBottomWidth:1,borderBottomColor:e.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:a},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:e.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:e.color.text,fontFamily:a,lineHeight:18,flexShrink:1,backgroundColor:e.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:e.color.accent+"4D"},labelText:{fontSize:10,color:e.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:a},valueText:{fontSize:12,color:e.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:a}});
1
+ "use strict";import s from"./QueryDetailsChip";import{View as i,Text as l,ScrollView as c,StyleSheet as h}from"react-native";import{displayValue as u,night as e,monoFont as a}from"@buoy-gg/shared-ui";import{jsx as o,jsxs as n}from"react/jsx-runtime";export default function y({query:r}){if(r===void 0){return null}const d=r.state.dataUpdatedAt?new Date(r.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true}):"Never";return n(i,{style:t.minWidth,children:[o(l,{style:t.headerText,children:"Query Details"}),n(i,{style:t.row,children:[o(c,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:t.flexOne,children:o(l,{testID:"buoy-rq-detail-key",style:t.queryKeyText,children:u(r.queryKey,true)})}),o(s,{query:r,testID:"buoy-rq-detail-status"})]}),n(i,{style:t.row,children:[o(l,{style:t.labelText,children:"Observers:"}),o(l,{testID:"buoy-rq-detail-observers",style:t.valueText,children:`${r.getObserversCount()}`})]}),n(i,{style:t.row,children:[o(l,{style:t.labelText,children:"Last Updated:"}),o(l,{testID:"buoy-rq-detail-updated",style:t.valueText,children:`${d}`})]})]})}const t=h.create({minWidth:{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},headerText:{backgroundColor:e.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:e.color.accent,borderBottomWidth:1,borderBottomColor:e.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:a},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:e.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:e.color.text,fontFamily:a,lineHeight:18,flexShrink:1,backgroundColor:e.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:e.color.accent+"4D"},labelText:{fontSize:10,color:e.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:a},valueText:{fontSize:12,color:e.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:a}});
@@ -1 +1 @@
1
- "use strict";import{memo as x}from"react";import{getQueryStatusLabel as y}from"../../utils/getQueryStatusLabel";import{CompactRow as A,buoyColors as e,useRelativeTime as T}from"@buoy-gg/shared-ui";import{queryRowTestID as g}from"../../utils/testIDs";import{jsx as h}from"react/jsx-runtime";const D=s=>{if(!s?.queryKey)return"Unknown Query";const t=Array.isArray(s.queryKey)?s.queryKey:[s.queryKey];return t.filter(r=>r!=null).map(r=>String(r)).join(" \u203A ")||"Unknown Query"};const U=x(function s({query:t,isSelected:r,onSelect:b}){const c=o=>{switch(o){case"disabled":return e.textMuted+"80";case"error":return e.error;case"fresh":return e.success;case"stale":return e.warning;case"inactive":return e.textMuted;case"fetching":return e.primary;case"paused":return e.textMuted;default:return e.textSecondary}};const a=y(t);const n=t.getObserversCount();const i=t.isDisabled();const d=D(t);const m=(()=>{if(i)return null;if(t.state.dataUpdatedAt&&t.state.dataUpdatedAt>0){return t.state.dataUpdatedAt}const o=t.state;if(o.fetchedAt&&o.fetchedAt>0){return o.fetchedAt}return null})();const p=T(m);const f=i?"Disabled":p||(t.state.dataUpdatedAt===0?"Not fetched":`N/A (${t.state.dataUpdatedAt||0})`);const u=g(t.queryKey);const l=`${n} observer${n!==1?"s":""}`;return h(A,{testID:u,statusTestID:`${u}-status`,statusSublabelTestID:`${u}-observers`,accessibilityLabel:`${d}, ${a}, ${l}`,statusDotColor:c(a),statusLabel:a.charAt(0).toUpperCase()+a.slice(1),statusSublabel:l,primaryText:d,bottomRightText:f,badgeText:n,badgeColor:c(a),isSelected:r,onPress:()=>b(t)})});export default U;
1
+ "use strict";import{memo as y}from"react";import{getQueryStatusLabel as x}from"../../utils/getQueryStatusLabel";import{CompactRow as T,buoyColors as e,useRelativeTime as g}from"@buoy-gg/shared-ui";import{queryRowTestID as A}from"../../utils/testIDs";import{jsx as h}from"react/jsx-runtime";const v=s=>{if(!s?.queryKey)return"Unknown Query";const t=Array.isArray(s.queryKey)?s.queryKey:[s.queryKey];return t.filter(r=>r!=null).map(r=>String(r)).join(" \u203A ")||"Unknown Query"};const D=y(function s({query:t,isSelected:r,onSelect:b}){const i=o=>{switch(o){case"disabled":return e.textMuted+"80";case"error":return e.error;case"fresh":return e.success;case"stale":return e.warning;case"inactive":return e.textMuted;case"fetching":return e.primary;case"paused":return e.textMuted;default:return e.textSecondary}};const a=x(t);const n=t.getObserversCount();const c=t.isDisabled();const l=v(t);const m=(()=>{if(c)return null;if(t.state.dataUpdatedAt&&t.state.dataUpdatedAt>0){return t.state.dataUpdatedAt}const o=t.state;if(o.fetchedAt&&o.fetchedAt>0){return o.fetchedAt}return null})();const f=g(m);const p=c?"Disabled":f||"Never";const u=A(t.queryKey);const d=`${n} observer${n!==1?"s":""}`;return h(T,{testID:u,statusTestID:`${u}-status`,statusSublabelTestID:`${u}-observers`,accessibilityLabel:`${l}, ${a}, ${d}`,statusDotColor:i(a),statusLabel:a.charAt(0).toUpperCase()+a.slice(1),statusSublabel:d,primaryText:l,bottomRightText:p,badgeText:n,badgeColor:i(a),isSelected:r,onPress:()=>b(t)})});export default D;
@@ -35,8 +35,8 @@ export declare function createReactQuerySyncAdapter(queryClient: QueryClient): {
35
35
  found: true;
36
36
  queryHash: string;
37
37
  hasData: false;
38
- status: import("@tanstack/query-core").QueryStatus;
39
- fetchStatus: import("@tanstack/query-core").FetchStatus;
38
+ status: import("@tanstack/react-query").QueryStatus;
39
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
40
40
  path?: undefined;
41
41
  shape?: undefined;
42
42
  data?: undefined;
@@ -71,7 +71,7 @@ export declare function createReactQuerySyncAdapter(queryClient: QueryClient): {
71
71
  queryHash: string;
72
72
  queryKey: readonly unknown[];
73
73
  status: "error" | "fetching" | "paused" | "disabled" | "inactive" | "stale" | "fresh";
74
- fetchStatus: import("@tanstack/query-core").FetchStatus;
74
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
75
75
  isStale: boolean;
76
76
  observers: number;
77
77
  updatedAt: number;
@@ -111,7 +111,7 @@ export declare function createReactQuerySyncAdapter(queryClient: QueryClient): {
111
111
  } | {
112
112
  ok: boolean;
113
113
  error: string;
114
- status: import("@tanstack/query-core").QueryStatus;
114
+ status: import("@tanstack/react-query").QueryStatus;
115
115
  missingKeys?: undefined;
116
116
  mode?: undefined;
117
117
  } | {
package/lib/web/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- "use client";var Cr=Object.defineProperty;var en=Object.getOwnPropertyDescriptor;var tn=Object.getOwnPropertyNames;var rn=Object.prototype.hasOwnProperty;var on=(e,t)=>{for(var r in t)Cr(e,r,{get:t[r],enumerable:true})},xr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of tn(t))!rn.call(e,a)&&a!==r&&Cr(e,a,{get:()=>t[a],enumerable:!(o=en(t,a))||o.enumerable});return e},an=(e,t,r)=>(xr(e,t,"default"),r&&xr(r,t,"default"));var kc=(()=>{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 nn}from"@tanstack/react-query";import{QueryIcon as wr}from"@buoy-gg/floating-tools-core/web";import{Wifi as qr}from"@buoy-gg/shared-ui/web";import{useCallback as Fe,useState as Ze,useEffect as sn}from"react";import{useQueryClient as ln}from"@tanstack/react-query";import{TickProvider as un}from"@buoy-gg/shared-ui/web";import{useQueryClient as cn}from"@tanstack/react-query";import{JsModal as dn,useSafeAreaInsets as yn,ModalHeader as Bt,TabSelector as hn}from"@buoy-gg/shared-ui/web";import{useEffect as fn,useState as mn,useRef as pn}from"react";import{useQueryClient as gn}from"@tanstack/react-query";function Mr(e){let{query:t}=Ht(e);return t}function Ht(e){let t=gn(),[r,o]=mn({query:void 0,version:0}),a=pn(void 0);return fn(()=>{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 s=JSON.stringify(e);a.current=s;let u=t.getQueryCache().subscribe(l=>{(l.type==="updated"||l.type==="added"||l.type==="removed")&&"query"in l&&l.query&&JSON.stringify(l.query.queryKey)===a.current&&(l.type==="removed"?o({query:void 0,version:0}):o(c=>({query:l.query,version:c.version+1})))});return()=>u()},[t,e]),r}import{ModalHeader as Pe,TabSelector as Tr,Search as bn,Filter as vn,Trash as Sn,night as je}from"@buoy-gg/shared-ui/web";import{useState as Cn,useRef as Ar,useEffect as xn}from"react";var Er={};on(Er,{AccessibilityInfo:()=>Tn,ActivityIndicator:()=>Ci,Alert:()=>qi,Animated:()=>Z,AppRegistry:()=>En,AppState:()=>Dn,Appearance:()=>An,BackHandler:()=>Rn,Button:()=>xi,CheckBox:()=>Vn,Clipboard:()=>kn,DeviceEventEmitter:()=>ni,Dimensions:()=>Dr,Easing:()=>In,FlatList:()=>jt,I18nManager:()=>Qn,Image:()=>$n,ImageBackground:()=>Nn,InteractionManager:()=>Pn,Keyboard:()=>Fn,KeyboardAvoidingView:()=>Un,LayoutAnimation:()=>On,Linking:()=>Kn,LogBox:()=>ai,Modal:()=>Pr,NativeEventEmitter:()=>zn,NativeModules:()=>Mn,PanResponder:()=>Wt,Picker:()=>_n,PixelRatio:()=>Ln,Platform:()=>Bn,Pressable:()=>Qr,ProgressBar:()=>Jn,RefreshControl:()=>Gn,SafeAreaView:()=>Yn,ScrollView:()=>be,SectionList:()=>Xn,Share:()=>Hn,StatusBar:()=>Zn,StyleSheet:()=>T,Switch:()=>Si,Text:()=>v,TextInput:()=>gi,Touchable:()=>ei,TouchableHighlight:()=>bi,TouchableNativeFeedback:()=>ti,TouchableOpacity:()=>N,TouchableWithoutFeedback:()=>vi,UIManager:()=>Wn,Vibration:()=>jn,View:()=>h,VirtualizedList:()=>ri,YellowBox:()=>oi,findNodeHandle:()=>wi,unstable_createElement:()=>qn,useColorScheme:()=>ii,useLocaleContext:()=>si,useWindowDimensions:()=>li});an(Er,wn);import*as wn from"react-native-web";import{unstable_createElement as qn,NativeModules as Mn,AccessibilityInfo as Tn,Animated as Z,Appearance as An,AppRegistry as En,AppState as Dn,BackHandler as Rn,Clipboard as kn,Dimensions as Dr,Easing as In,I18nManager as Qn,Keyboard as Fn,InteractionManager as Pn,LayoutAnimation as On,Linking as Kn,NativeEventEmitter as zn,PanResponder as Wt,PixelRatio as Ln,Platform as Bn,Share as Hn,StyleSheet as T,UIManager as Wn,Vibration as jn,CheckBox as Vn,FlatList as jt,Image as $n,ImageBackground as Nn,KeyboardAvoidingView as Un,Picker as _n,ProgressBar as Jn,RefreshControl as Gn,SafeAreaView as Yn,SectionList as Xn,StatusBar as Zn,Touchable as ei,TouchableNativeFeedback as ti,VirtualizedList as ri,YellowBox as oi,LogBox as ai,DeviceEventEmitter as ni,useColorScheme as ii,useLocaleContext as si,useWindowDimensions as li}from"react-native-web";import*as V from"react-native-web";import{createElement as Vt,forwardRef as Rr,useCallback as ui,useRef as ci}from"react";import{useEffect as di,useState as yi}from"react";import{createPortal as hi}from"react-dom";var fi='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as mi}from"react/jsx-runtime";var et=Symbol.for("@buoy-gg/portal-host"),kr=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 Ir(){let e=document;if(e[et])return e[et].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:fi});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)||!kr(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)},s=()=>o.clear(),u=()=>{let i=[...o.values()];o.clear();for(let d of i)document.dispatchEvent(new KeyboardEvent("keyup",{...d,bubbles:true}))},l=i=>{kr(i.target)&&i.stopPropagation()},c=i=>i.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",s),t.addEventListener("focusin",u),t.addEventListener("keydown",l),t.addEventListener("keyup",l),t.addEventListener("keypress",l),t.addEventListener("wheel",c,{passive:true}),e[et]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",s),t.remove(),delete e[et]}},t}function pi({children:e}){let[t,r]=yi(null);return di(()=>{let o=Ir(),a=document[et];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?hi(mi("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}function $(e){let t=Rr((o,a)=>{let{accessibilityState:n,accessibilityValue:s,...u}=o;for(let l of["busy","checked","disabled","expanded","selected"])n?.[l]!==void 0&&u[`aria-${l}`]===void 0&&(u[`aria-${l}`]=n[l]);for(let[l,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[l]!==void 0&&u[`aria-${c}`]===void 0&&(u[`aria-${c}`]=s[l]);return Vt(e,{...u,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var h=$(V.View),v=$(V.Text),gi=$(V.TextInput),N=$(V.TouchableOpacity),bi=$(V.TouchableHighlight),vi=$(V.TouchableWithoutFeedback),Qr=$(V.Pressable),be=$(V.ScrollView),Fr=Rr((e,t)=>{let r=ci(null),o=ui(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"}),Ir().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return Vt(pi,null,Vt(V.Modal,{...e,ref:o}))});Fr.displayName="Modal";var Pr=$(Fr),Si=$(V.Switch),Ci=$(V.ActivityIndicator),xi=$(V.Button),wi=V.findNodeHandle,qi={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 c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",a.appendChild(c)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let u=r?.length?r:[{text:"OK"}],l=()=>{a.close?.(),a.remove()};for(let c of u){let i=document.createElement("button");i.type="button",i.textContent=c.text??"OK",i.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,i.onclick=()=>{l(),c.onPress?.()},s.appendChild(i)}a.addEventListener("cancel",c=>{c.preventDefault(),o?.cancelable!==false&&(l(),o?.onDismiss?.())}),a.appendChild(s),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{Wifi as Or}from"@buoy-gg/shared-ui/web";import{useEffect as Kr,useState as Mi,useRef as Ti}from"react";import{onlineManager as pt}from"@tanstack/react-query";import{devToolsStorageKeys as zr,persistentStorage as Lr}from"@buoy-gg/shared-ui/web";function Br(){let[e,t]=Mi(()=>pt.isOnline()),r=Ti(false);Kr(()=>{if(r.current)return;(async()=>{try{let n=await Lr.getItem(zr.settings.wifiEnabled());if(n!==null){let s=n==="true";t(s),pt.setOnline(s)}r.current=true}catch{}})()},[]);let o=async n=>{try{await Lr.setItem(zr.settings.wifiEnabled(),n.toString())}catch{}},a=()=>{let n=!e;t(n),pt.setOnline(n),o(n)};return Kr(()=>pt.subscribe(n=>{t(n),r.current&&o(n)}),[]),{isOnline:e,handleWifiToggle:a}}import{jsx as $t}from"react/jsx-runtime";function Hr({size:e=16,testID:t}){let{isOnline:r,handleWifiToggle:o}=Br();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(Or,{size:e,color:"#10B981"}):$t(Or,{size:e,color:"#DC2626"})})}import{jsx as B,jsxs as gt}from"react/jsx-runtime";function tt({selectedQuery:e,selectedMutation:t,activeTab:r,onTabChange:o,onBack:a,searchText:n="",onSearchChange:s,onFilterPress:u,hasActiveFilters:l=false,onClearCache:c,showWifiToggle:i=false}){let[d,f]=Cn(false),b=Ar(false),y=Ar(null);xn(()=>{d&&y.current&&y.current.focus()},[d]);let m=()=>{f(!d),d&&s&&s("")},g=C=>{s&&s(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?gt(Pe,{children:[B(Pe.Navigation,{onBack:a}),B(Pe.Content,{title:S(e??t),testID:"buoy-rq-detail-title"})]}):gt(Pe,{children:[B(Pe.Content,{title:"",noMargin:true,children:d?B(Pe.Search,{value:n,onChangeText:g,onCancel:()=>{g(""),f(false)},onDismiss:()=>f(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?gt(h,{style:Oe.tabRow,children:[B(h,{style:Oe.tabSelectorWrap,children:B(Tr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>o(C)})}),B(Hr,{size:16,testID:"buoy-rq-wifi"})]}):B(Tr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>o(C)})}),gt(Pe.Actions,{children:[B(N,{"sentry-label":"ignore open search",testID:"buoy-rq-search-open",accessibilityRole:"button",accessibilityLabel:"Search queries and mutations",onPress:m,style:Oe.headerActionButton,children:B(bn,{size:14,color:je.color.textSecondary})}),u&&B(N,{"sentry-label":"ignore open filter",testID:"buoy-rq-filters",accessibilityRole:"button",accessibilityLabel:l?"Filters, active":"Filters",onPress:u,style:[Oe.headerActionButton,l&&Oe.activeFilterButton],children:B(vn,{size:14,color:l?je.color.accent:je.color.textSecondary})}),c&&B(N,{"sentry-label":"ignore clear cache",testID:"buoy-rq-clear-cache",accessibilityRole:"button",onPress:c,style:[Oe.headerActionButton,Oe.clearCacheButton],accessibilityLabel:`Clear ${r} cache`,children:B(Sn,{size:14,color:je.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:je.color.accentSoft},clearCacheButton:{backgroundColor:je.color.warningSoft}});import{resolveListEmptyState as Ai}from"@buoy-gg/shared-ui/web";import{useMemo as Ei}from"react";import{useMemo as Di}from"react";import{useQueryClient as Ri}from"@tanstack/react-query";var Ve=(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,s=o.get(a);return o.set(a,Ve(s??null,n,r)),o}if(e instanceof Set){let o=Ve(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]=Ve(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]=Ve(o[a],n,r),o}return e};var $e=(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,$e(r.get(o),a)),r}if(e instanceof Set){let r=$e(Array.from(e),t);return new Set(r)}if(Array.isArray(e)){let r=[...e];if(t.length===1)return r.filter((n,s)=>s.toString()!==t[0]);let[o,...a]=t;return r[o]=$e(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]=$e(r[o],a),r}return e};function Wr({activeQuery:e,dataPath:t,queryClient:r}){if(!t)return;let o=e.state.data,a=$e(o,t),n=JSON.parse(JSON.stringify(a));r.setQueryData(e.queryKey,n)}function jr(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Vr(e){return(Array.isArray(e)?e:[e]).filter(t=>t!=null).map(jr).filter(Boolean).join("-")||"unkeyed"}function ki(e){return`buoy-rq-query-row-${Vr(e)}`}function Ii(e,t){return e==null?`buoy-rq-mutation-row-id-${t}`:`buoy-rq-mutation-row-${Vr(e)}`}function Qi(e){return e.length===0?"buoy-rq-explorer-root":`buoy-rq-explorer-${e.map(jr).filter(Boolean).join("-")}`}import{LiveExplorer as Fi}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as Pi}from"react/jsx-runtime";function me({editable:e,label:t,value:r,defaultExpanded:o,activeQuery:a,dataPath:n,itemsDeletable:s,dataVersion:u=0}){let l=Ri(),c=Di(()=>{if(a)return{update:(i,d)=>{let f=a.state.data,b=Ve(f,i,d);l.setQueryData(a.queryKey,b)},remove:i=>{Wr({queryClient:l,activeQuery:a,dataPath:i})}}},[l,a]);return Pi(Fi,{editable:e,label:t,value:r,defaultExpanded:o,writer:c,dataPath:n,itemsDeletable:s,dataVersion:u,testIDForPath:Qi,debounceMs:0})}import{useMemo as Oi,useCallback as Ki}from"react";import{memo as zi}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 Li,buoyColors as ve,useRelativeTime as Bi}from"@buoy-gg/shared-ui/web";import{jsx as Hi}from"react/jsx-runtime";var Wi=e=>e?.queryKey&&(Array.isArray(e.queryKey)?e.queryKey:[e.queryKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Query",ji=zi(function({query:e,isSelected:t,onSelect:r}){let o=b=>{switch(b){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(),s=e.isDisabled(),u=Wi(e),l=(()=>{if(s)return null;if(e.state.dataUpdatedAt&&e.state.dataUpdatedAt>0)return e.state.dataUpdatedAt;let b=e.state;return b.fetchedAt&&b.fetchedAt>0?b.fetchedAt:null})(),c=Bi(l),i=s?"Disabled":c||(e.state.dataUpdatedAt===0?"Not fetched":`N/A (${e.state.dataUpdatedAt||0})`),d=ki(e.queryKey),f=`${n} observer${n!==1?"s":""}`;return Hi(Li,{testID:d,statusTestID:`${d}-status`,statusSublabelTestID:`${d}-observers`,accessibilityLabel:`${u}, ${a}, ${f}`,statusDotColor:o(a),statusLabel:a.charAt(0).toUpperCase()+a.slice(1),statusSublabel:f,primaryText:u,bottomRightText:i,badgeText:n,badgeColor:o(a),isSelected:t,onPress:()=>r(e)})}),$r=ji;import{useEffect as Vi,useState as $i,useRef as Nr,useMemo as Ni,useCallback as Ur}from"react";import{useQueryClient as Ui}from"@tanstack/react-query";import{buoyColors as bt}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 _r(e){if(!Se(e)||e.length<2)return null;let t=e[1];return t==="mmkv"||t==="async"||t==="secure"?t:null}function Jr(e){switch(e){case"mmkv":return"MMKV";case"async":return"Async";case"secure":return"Secure";default:return e}}function Gr(e){switch(e){case"mmkv":return"purple";case"async":return"blue";case"secure":return"green";default:return"gray"}}function _i(e){switch(e){case"mmkv":return bt.primary;case"async":return bt.warning;case"secure":return bt.success;default:return bt.textMuted}}function Yr(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 vt=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,Ji=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,Xr=(e,t)=>vt(e)===vt(t)?Ji(e,t):vt(e)>vt(t)?1:-1;function Gi(){let e=Ui(),[t,r]=$i(()=>e.getQueryCache().getAll().filter(u=>!Se(u.queryKey)).sort(Xr)),o=Nr(new Map),a=Nr(void 0),n=Ur(u=>{let l=o.current;if(u.length!==l.size)return true;for(let c of u){let i=l.get(c.queryHash);if(!i||i.dataUpdatedAt!==c.state.dataUpdatedAt||i.errorUpdatedAt!==c.state.errorUpdatedAt||i.fetchStatus!==c.state.fetchStatus||i.status!==c.state.status||i.isInvalidated!==c.state.isInvalidated)return true}return false},[]),s=Ur(()=>{let u=e.getQueryCache().getAll().filter(l=>!Se(l.queryKey));if(n(u)){let l=new Map;u.forEach(i=>{l.set(i.queryHash,i.state)}),o.current=l;let c=[...u].sort(Xr);r(c)}},[e,n]);return Vi(()=>{s();let u=e.getQueryCache().subscribe(l=>{if(l.type==="added"||l.type==="removed"||l.type==="updated"){if("query"in l&&l.query&&Se(l.query.queryKey))return;a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{s()},10)}});return()=>{u(),a.current&&clearTimeout(a.current)}},[e,s]),Ni(()=>t,[t])}var St=Gi;import{night as Nt,ToolEmptyState as Yi,EVENT_LIST_PRESET as Xi,monoFont as Zi}from"@buoy-gg/shared-ui/web";import{jsx as Ut}from"react/jsx-runtime";function Zr({selectedQuery:e,onQuerySelect:t,activeFilter:r,emptyStateMessage:o,emptyState:a,contentContainerStyle:n,queries:s,searchText:u="",ignoredPatterns:l=new Set,includedPatterns:c=new Set}){let i=St(),d=s??i,f=Oi(()=>{let y=d;if(r&&(y=y.filter(m=>se(m)===r)),u){let m=u.toLowerCase();y=y.filter(g=>g?.queryKey?(Array.isArray(g.queryKey)?g.queryKey:[g.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase().includes(m):false)}return c.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let g=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return Array.from(c).some(p=>g.includes(p.toLowerCase()))})),l.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let g=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return!Array.from(l).some(p=>g.includes(p.toLowerCase()))})),y.sort((m,g)=>{let p=m.state.dataUpdatedAt||0;return(g.state.dataUpdatedAt||0)-p}),y},[d,r,u,c,l]),b=Ki(y=>{if(e?.queryHash===y.queryHash){t(void 0);return}t(y)},[e?.queryHash,t]);return f.length===0?Ut(Yi,{testID:"buoy-rq-empty",...a??{otto:"empty",title:"No queries found",message:o||(r?`No ${r} queries found`:"No queries found")}}):Ut(jt,{testID:"buoy-rq-query-list",style:eo.listWrapper,contentContainerStyle:n||eo.listContent,data:f,keyExtractor:es,renderItem:({item:y})=>Ut($r,{query:y,stateSig:ts(y),isSelected:e?.queryHash===y.queryHash,onSelect:b}),showsVerticalScrollIndicator:true,...Xi})}var es=e=>e.queryHash;function ts(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 eo=T.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Nt.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Nt.color.border},emptyText:{color:Nt.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Zi,letterSpacing:.5}});import{buoyColors as E,monoFont as rs}from"@buoy-gg/shared-ui/web";import{jsx as to}from"react/jsx-runtime";var os={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"},as={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"},ns={fresh:E.success,stale:E.warning,fetching:E.primary,paused:E.textMuted,noObserver:E.textMuted,error:E.error,inactive:E.textMuted};function ro({query:e,testID:t}){let r=se(e),o=os[r],a=as[r],n=ns[r];return to(h,{style:[oo.container,{backgroundColor:o,borderColor:a}],children:to(v,{testID:t,style:[oo.text,{color:n}],children:r})})}var oo=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:rs}});import{displayValue as is,night as U,monoFont as Ct}from"@buoy-gg/shared-ui/web";import{jsx as Ce,jsxs as xt}from"react/jsx-runtime";function _t({query:e}){if(e===void 0)return null;let t=new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});return xt(h,{style:ee.minWidth,children:[Ce(v,{style:ee.headerText,children:"Query Details"}),xt(h,{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:is(e.queryKey,true)})}),Ce(ro,{query:e,testID:"buoy-rq-detail-status"})]}),xt(h,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Observers:"}),Ce(v,{testID:"buoy-rq-detail-observers",style:ee.valueText,children:`${e.getObserversCount()}`})]}),xt(h,{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:Ct},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:Ct,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:Ct},valueText:{fontSize:12,color:U.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:Ct}});import{useQueryClient as ss}from"@tanstack/react-query";import{night as D}from"@buoy-gg/shared-ui/web";import{jsx as ao,jsxs as ls}from"react/jsx-runtime";var us={refetch:{dotColor:D.color.accent,textColor:D.color.text,borderColor:D.color.border},invalidate:{dotColor:D.color.warning,textColor:D.color.text,borderColor:D.color.border},reset:{dotColor:D.color.textSecondary,textColor:D.color.text,borderColor:D.color.border},remove:{dotColor:D.color.danger,textColor:D.color.danger,borderColor:D.color.danger+"40"},triggerLoading:{dotColor:D.color.info,textColor:D.color.info,borderColor:D.color.info+"40"},triggerError:{dotColor:D.color.danger,textColor:D.color.danger,borderColor:D.color.danger+"40"}};function ue({onClick:e,text:t,variant:r,disabled:o,testID:a}){let n=us[r];return ls(N,{"sentry-label":"ignore devtools action button",testID:a,disabled:o,onPress:e,style:[Jt.button,{borderColor:o?D.color.border:n.borderColor,opacity:o?.4:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},children:[ao(h,{style:[Jt.dot,{backgroundColor:o?D.color.textTertiary:n.dotColor}]}),ao(v,{style:[Jt.text,{color:o?D.color.textTertiary:n.textColor}],children:t})]})}var Jt=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 cs="@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(cs,{detail:{type:e,queryHash:t},bubbles:true,cancelable:true}))}catch{}}function Gt({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 Yt({query:e}){xe("REFETCH",e.queryHash),e.fetch().catch(()=>{})}function no({query:e,queryClient:t}){xe("RESET",e.queryHash),t.resetQueries({queryKey:e.queryKey,exact:true})}function io({query:e,queryClient:t}){xe("REMOVE",e.queryHash),t.removeQueries(e)}function so({query:e,queryClient:t}){xe("INVALIDATE",e.queryHash),t.invalidateQueries(e)}function Xt({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 ds}from"@buoy-gg/shared-ui/web";import{jsx as we,jsxs as rt}from"react/jsx-runtime";function lo({query:e,setSelectedQuery:t}){let r=ss();if(e===void 0)return null;let o=e.state.status,a=se(e)==="fetching";return rt(h,{style:Ke.container,children:[rt(h,{style:Ke.section,children:[we(v,{style:Ke.sectionLabel,children:"Actions"}),rt(h,{style:Ke.buttonsRow,children:[we(ue,{disabled:a,onClick:()=>Yt({query:e}),variant:"refetch",text:"Refetch"}),we(ue,{disabled:o==="pending",onClick:()=>so({query:e,queryClient:r}),variant:"invalidate",text:"Invalidate"}),we(ue,{disabled:o==="pending",onClick:()=>no({queryClient:r,query:e}),variant:"reset",text:"Reset"}),we(ue,{disabled:a,onClick:()=>{io({queryClient:r,query:e}),t(void 0)},variant:"remove",text:"Remove"})]})]}),rt(h,{style:Ke.section,children:[we(v,{style:Ke.sectionLabel,children:"Triggers"}),rt(h,{style:Ke.buttonsRow,children:[we(ue,{disabled:false,onClick:()=>Gt({query:e}),variant:"triggerLoading",text:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading"}),we(ue,{disabled:o==="pending",onClick:()=>Xt({query:e,queryClient:r}),variant:"triggerError",text:o==="error"?"Restore Error":"Trigger Error"})]})]})]})}var Ke=T.create({container:{gap:16},section:{gap:8},sectionLabel:{fontSize:11,fontWeight:"600",color:ds.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},buttonsRow:{flexDirection:"row",flexWrap:"wrap",gap:8}});import{night as Zt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as er}from"react/jsx-runtime";function ys({selectedQuery:e,setSelectedQuery:t}){return er(be,{"sentry-label":"ignore devtools query info scroll",style:de.flexOne,contentContainerStyle:de.scrollContent,children:[ce(h,{style:de.section,children:ce(_t,{query:e})}),ce(h,{style:de.section,children:ce(lo,{query:e,setSelectedQuery:t})}),er(h,{style:de.section,children:[ce(v,{style:de.headerText,children:"Data Explorer"}),ce(h,{style:de.contentView,children:ce(me,{editable:true,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),er(h,{style:de.section,children:[ce(v,{style:de.headerText,children:"Query Explorer"}),ce(h,{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:Zt.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:Zt.color.surface,borderRadius:12,borderWidth:1,borderColor:Zt.color.border,padding:16}});import{buoyColors as F,night as te}from"@buoy-gg/shared-ui/web";import{jsx as tr,jsxs as hs}from"react/jsx-runtime";var fs=({label:e,color:t,count:r,showLabel:o=true,isActive:a=false,onPress:n,onTouchStart:s,size:u="default",testID:l})=>{let c=u==="large",i=(d=>{let f={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 f[d]||f.gray})(t);return hs(N,{"sentry-label":"ignore devtools query status",testID:l,accessibilityRole:"button",accessibilityLabel:`${e}, ${r}${a?", selected":""}`,accessibilityState:{selected:a},style:[qe.queryStatusTag,c&&qe.queryStatusTagLarge,a&&{backgroundColor:i.bg,borderColor:i.border}],disabled:!n,onPress:n,onPressIn:s,activeOpacity:.7,children:[tr(h,{style:[qe.dot,c&&qe.dotLarge,{backgroundColor:i.dot}]}),o&&tr(v,{style:[qe.label,c&&qe.labelLarge,a&&{color:i.text}],numberOfLines:1,ellipsizeMode:"tail",children:e}),r>0&&tr(v,{testID:l?`${l}-count`:void 0,style:[qe.count,c&&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=fs;import{ChipStrip as ms,useChipTap as ps}from"@buoy-gg/shared-ui/web";import{useEffect as uo,useState as co}from"react";import{useQueryClient as yo}from"@tanstack/react-query";function gs(){let e=yo(),[t,r]=co({fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});return uo(()=>{let o=()=>{let n=e.getQueryCache().getAll().reduce((s,u)=>{let l=se(u);return s[l]=(s[l]||0)+1,s},{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 ho=gs;function bs(){let e=yo(),[t,r]=co({pending:0,success:0,error:0,paused:0,idle:0});return uo(()=>{let o=()=>{let n=e.getMutationCache().getAll().reduce((s,u)=>{let l=u.state.status;if(u.state.isPaused)s.paused++;else switch(l){case"idle":s.idle++;break;case"pending":s.pending++;break;case"success":s.success++;break;case"error":s.error++;break}return s},{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 ot,jsxs as vs}from"react/jsx-runtime";var Ss=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{fresh:o,stale:a,fetching:n,paused:s,inactive:u}=ho(),{scrollProps:l,onTouchStart:c,isTap:i}=ps(),d=(f,b)=>{i(b)&&t&&t(e===f?null:f)};return vs(ms,{scrollProps:l,sentryLabel:"ignore devtools query status count scroll",children:[ot(re,{label:"Fresh",color:"green",count:o,isActive:e==="fresh",onPress:f=>d("fresh",f),onTouchStart:c,testID:"buoy-rq-status-fresh",showLabel:true,size:r}),ot(re,{label:"Loading",color:"blue",count:n,isActive:e==="fetching",onPress:f=>d("fetching",f),onTouchStart:c,testID:"buoy-rq-status-fetching",showLabel:true,size:r}),ot(re,{label:"Paused",color:"purple",count:s,isActive:e==="paused",onPress:f=>d("paused",f),onTouchStart:c,testID:"buoy-rq-status-paused",showLabel:true,size:r}),ot(re,{label:"Stale",color:"yellow",count:a,isActive:e==="stale",onPress:f=>d("stale",f),onTouchStart:c,testID:"buoy-rq-status-stale",showLabel:true,size:r}),ot(re,{label:"Idle",color:"gray",count:u,isActive:e==="inactive",onPress:f=>d("inactive",f),onTouchStart:c,testID:"buoy-rq-status-inactive",showLabel:true,size:r})]})},fo=Ss;import{useState as Cs,useRef as rr,useMemo as xs,useCallback as ws}from"react";import{QueryIcon as qs,CheckCircle as Ms,Activity as Ts,Pause as As,XCircle as Es,buoyColors as wt}from"@buoy-gg/shared-ui/web";import{jsx as at}from"react/jsx-runtime";function Ds({size:e=24}){return at(qs,{size:e})}function Rs({size:e=14,color:t=wt.success,strokeWidth:r=2}){return at(Ms,{size:e,color:t,strokeWidth:r})}function ks({size:e=14,color:t=wt.warning,strokeWidth:r=2}){return at(Ts,{size:e,color:t,strokeWidth:r})}function Is({size:e=14,color:t=wt.textMuted,strokeWidth:r=2}){return at(As,{size:e,color:t,strokeWidth:r})}function Qs({size:e=14,color:t=wt.error,strokeWidth:r=2}){return at(Es,{size:e,color:t,strokeWidth:r})}import{buoyColors as nt,night as ze,useRelativeTime as Fs,monoFont as mo}from"@buoy-gg/shared-ui/web";import{jsx as oe,jsxs as qt}from"react/jsx-runtime";var Ps=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 po({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 c=e.state;return c.updatedAt&&c.updatedAt>0?c.updatedAt:null})(),n=Fs(a)||`N/A (${e.state.submittedAt||0})`,s=(()=>{if(e.state.isPaused)return{status:"Paused",color:nt.textMuted,icon:oe(Is,{})};switch(e.state.status){case"success":return{status:"Success",color:nt.success,icon:oe(Rs,{})};case"error":return{status:"Error",color:nt.error,icon:oe(Qs,{})};case"pending":return{status:"Loading",color:nt.primary,icon:oe(ks,{})};default:return{status:"Idle",color:nt.textMuted,icon:null}}})(),u=Ps(e),l=Ii(e.options.mutationKey,e.mutationId);return qt(N,{"sentry-label":"ignore devtools mutation button",testID:l,accessibilityRole:"button",accessibilityLabel:`${u}, ${s.status}`,onPress:()=>t(e===r?void 0:e),style:[_.button,r?.mutationId===e.mutationId&&_.selected],children:[qt(h,{style:_.rowContent,children:[qt(h,{style:_.statusSection,children:[oe(h,{style:[_.statusDot,{backgroundColor:s.color}]}),qt(h,{style:_.statusInfo,children:[oe(v,{testID:`${l}-status`,style:[_.statusLabel,{color:s.color}],children:s.status}),oe(v,{style:_.submittedText,children:o})]})]}),oe(h,{style:_.mutationSection,children:oe(v,{testID:`${l}-key`,style:_.mutationKey,children:u})})]}),oe(h,{style:_.bottomRightContainer,children:oe(v,{style:_.bottomRightText,children:n})})]})}var _=T.create({button:{backgroundColor:ze.color.surface,borderRadius:8,borderWidth:1,borderColor:ze.color.border,marginHorizontal:8,marginVertical:3,padding:12},selected:{backgroundColor:ze.color.accentSoft,borderColor:ze.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:ze.color.textTertiary,marginTop:1},mutationSection:{flex:2,paddingHorizontal:12},mutationKey:{fontFamily:mo,fontSize:12,color:ze.color.text,lineHeight:16},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:ze.color.textTertiary,fontFamily:mo}});import{displayValue as Os,night as J,monoFont as Mt}from"@buoy-gg/shared-ui/web";import{buoyColors as G,monoFont as Ks}from"@buoy-gg/shared-ui/web";import{jsx as go}from"react/jsx-runtime";var zs={success:G.success+"15",error:G.error+"15",pending:G.primary+"15",idle:G.textMuted+"1A"},Ls={success:G.success+"33",error:G.error+"33",pending:G.primary+"33",idle:G.textMuted+"33"},Bs={success:G.success,error:G.error,pending:G.primary,idle:G.textMuted};function bo({status:e,testID:t}){let r=e,o=zs[r],a=Ls[r],n=Bs[r];return go(h,{style:[vo.container,{backgroundColor:o,borderColor:a}],children:go(v,{testID:t,style:[vo.text,{color:n}],children:e})})}var vo=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:Ks}});import{jsx as Ne,jsxs as or}from"react/jsx-runtime";function ar({selectedMutation:e}){if(e===void 0)return null;let t=new Date(e.state.submittedAt).toLocaleTimeString();return or(h,{style:Me.minWidth,children:[Ne(v,{style:Me.headerText,children:"Mutation Details"}),or(h,{style:Me.row,children:[Ne(be,{"sentry-label":"ignore devtools mutation details scroll",horizontal:true,style:Me.flex1,children:Ne(v,{testID:"buoy-rq-mutation-detail-key",style:Me.flexWrap,children:`${e.options.mutationKey?Os(e.options.mutationKey,true):"No mutationKey found"}`})}),Ne(bo,{status:e.state.status,testID:"buoy-rq-mutation-detail-status"})]}),or(h,{style:Me.row,children:[Ne(v,{style:Me.labelText,children:"Submitted At:"}),Ne(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:Mt},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:Mt,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:Mt},valueText:{fontSize:12,color:J.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:Mt}});import{night as it,monoFont as Hs}from"@buoy-gg/shared-ui/web";import{jsx as H,jsxs as st}from"react/jsx-runtime";function So({selectedMutation:e}){return st(be,{"sentry-label":"ignore devtools mutation information scroll",style:O.flex1,contentContainerStyle:O.scrollContent,children:[H(h,{style:O.section,children:H(ar,{selectedMutation:e})}),st(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Variables Details"}),H(h,{style:O.padding,children:H(me,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),st(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Context Details"}),H(h,{style:O.padding,children:H(me,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),st(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Data Explorer"}),H(h,{style:O.padding,children:H(me,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),st(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Mutations Explorer"}),H(h,{style:O.padding,children:H(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:it.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:it.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:it.color.accent+"33",fontFamily:Hs,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:it.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:it.color.border,borderTopWidth:0}});import{useCallback as Co,useEffect as Ws,useRef as xo,useState as js}from"react";import{useQueryClient as Vs}from"@tanstack/react-query";function $s(){let e=Vs(),[t,r]=js(()=>e.getMutationCache().getAll()),o=xo(new Map),a=xo(void 0),n=Co(u=>{let l=o.current;if(u.length!==l.size)return true;for(let c of u){let i=l.get(c.mutationId);if(!i||i.status!==c.state.status||i.submittedAt!==c.state.submittedAt||i.isPaused!==c.state.isPaused)return true}return false},[]),s=Co(()=>{let u=e.getMutationCache().getAll();if(n(u)){let l=new Map;u.forEach(c=>{l.set(c.mutationId,c.state)}),o.current=l,r(u)}},[e,n]);return Ws(()=>{s();let u=e.getMutationCache().subscribe(l=>{(l.type==="added"||l.type==="removed"||l.type==="updated")&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{s()},10))});return()=>{u(),a.current&&clearTimeout(a.current)}},[e,s]),{mutations:t}}var wo=$s;import{night as Le,ToolEmptyState as Ns,monoFont as Us}from"@buoy-gg/shared-ui/web";import{jsx as Te,jsxs as qo}from"react/jsx-runtime";function Mo({selectedMutation:e,setSelectedMutation:t,activeFilter:r,hideInfoPanel:o=false,contentContainerStyle:a,searchText:n=""}){let{mutations:s}=wo(),u=S=>S.state.isPaused?"paused":S.state.status,l=xs(()=>{let S=s;if(r&&(S=S.filter(w=>u(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},[s,r,n]),c=Dr.get("window").height,i=c*.4,d=150,f=c*.7,b=rr(new Z.Value(i)).current,[,y]=Cs(i),m=rr(i),g=rr(Wt.create({onMoveShouldSetPanResponder:(S,w)=>Math.abs(w.dy)>Math.abs(w.dx)&&Math.abs(w.dy)>10,onPanResponderGrant:()=>{b.stopAnimation(S=>{y(S),m.current=S,b.setValue(S)})},onPanResponderMove:(S,w)=>{let C=m.current-w.dy,q=Math.max(d,Math.min(f,C));b.setValue(q)},onPanResponderRelease:(S,w)=>{let C=Math.max(d,Math.min(f,m.current-w.dy));y(C),m.current=C,Z.timing(b,{toValue:C,duration:200,useNativeDriver:false}).start(()=>{b.setValue(C),y(C),m.current=C})}})).current,p=ws(({item:S})=>Te(po,{selected:e,setSelectedMutation:t,mutation:S}),[e,t]);return qo(h,{style:Be.container,children:[l.length>0?Te(h,{style:Be.listWrapper,children:Te(jt,{"sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:l,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(Ns,{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&&qo(Z.View,{style:[Be.mutationInfo,{height:b}],children:[Te(h,{style:Be.dragHandle,...g.panHandlers,children:Te(h,{style:Be.dragIndicator})}),Te(h,{style:Be.mutationInfoContent,children:Te(So,{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:Us,letterSpacing:.5}});import{ChipStrip as _s,useChipTap as Js}from"@buoy-gg/shared-ui/web";import{jsx as Tt,jsxs as Gs}from"react/jsx-runtime";var Ys=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{pending:o,success:a,error:n,paused:s}=bs(),{scrollProps:u,onTouchStart:l,isTap:c}=Js(),i=(d,f)=>{c(f)&&t&&t(e===d?null:d)};return Gs(_s,{scrollProps:u,sentryLabel:"ignore devtools mutation status count scroll",children:[Tt(re,{label:"Pending",color:"blue",count:o,isActive:e==="pending",onPress:d=>i("pending",d),onTouchStart:l,testID:"buoy-rq-mstatus-pending",showLabel:true,size:r}),Tt(re,{label:"Success",color:"green",count:a,isActive:e==="success",onPress:d=>i("success",d),onTouchStart:l,testID:"buoy-rq-mstatus-success",showLabel:true,size:r}),Tt(re,{label:"Error",color:"red",count:n,isActive:e==="error",onPress:d=>i("error",d),onTouchStart:l,testID:"buoy-rq-mstatus-error",showLabel:true,size:r}),Tt(re,{label:"Paused",color:"purple",count:s,isActive:e==="paused",onPress:d=>i("paused",d),onTouchStart:l,testID:"buoy-rq-mstatus-paused",showLabel:true,size:r})]})},To=Ys;import{Trash as Xs,night as Ue}from"@buoy-gg/shared-ui/web";import{jsx as Ao}from"react/jsx-runtime";var Zs=({type:e,onClear:t,disabled:r=false})=>Ao(N,{"sentry-label":"ignore devtools clear cache button",style:[Eo.button,r&&Eo.disabledButton],onPress:t,disabled:r,activeOpacity:.7,accessibilityLabel:`Clear ${e} cache`,accessibilityRole:"button",accessibilityState:{disabled:r},children:Ao(Xs,{size:16,strokeWidth:2,color:r?Ue.color.textTertiary:Ue.color.warning})}),Eo=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:Ue.color.warningSoft,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:Ue.color.warning+"33"},disabledButton:{opacity:.5,backgroundColor:Ue.color.fill,borderColor:Ue.color.border}}),el=Zs;import{Wifi as Do,buoyColors as Ro}from"@buoy-gg/shared-ui/web";import{jsx as nr}from"react/jsx-runtime";var tl=({isOffline:e,onToggle:t})=>nr(N,{"sentry-label":"ignore devtools network toggle button",style:[ko.button,e&&ko.offlineButton],onPress:t,activeOpacity:.7,accessibilityLabel:e?"Unset offline mocking behavior":"Mock offline behavior",accessibilityRole:"button",accessibilityState:{selected:e},children:e?nr(Do,{size:16,color:Ro.error,strokeWidth:2}):nr(Do,{size:16,color:Ro.success,strokeWidth:2})}),ko=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)"}}),rl=tl;import{ChipStrip as ol,useChipTap as al}from"@buoy-gg/shared-ui/web";import{jsx as Io}from"react/jsx-runtime";var Qo=["mmkv","async","secure"],nl=({activeStorageTypes:e=new Set(Qo),onStorageTypesChange:t,counts:r})=>{let{scrollProps:o,onTouchStart:a,isTap:n}=al(),s=(u,l)=>{if(n(l)&&t){let c=new Set(e);c.has(u)?c.delete(u):c.add(u),t(c)}};return Io(ol,{scrollProps:o,sentryLabel:"ignore devtools storage status count scroll",children:Qo.map(u=>{let l=r?.[u]??0;return Io(re,{label:Jr(u),color:Gr(u),count:l,isActive:e.has(u),onPress:c=>s(u,c),onTouchStart:a,showLabel:true},u)})})},il=nl;import{night as sl,monoFont as ll}from"@buoy-gg/shared-ui/web";import{jsx as Fo,jsxs as ul}from"react/jsx-runtime";function cl({totalCount:e,filteredCount:t,onPress:r}){if(t===e)return null;let o=Fo(h,{style:Po.container,children:ul(v,{testID:"buoy-rq-filter-badge",style:Po.text,children:["Showing ",t," of ",e]})});return r?Fo(N,{testID:"buoy-rq-filter-badge-button",accessibilityRole:"button",accessibilityLabel:`Showing ${t} of ${e}, open filters`,onPress:r,activeOpacity:.7,children:o}):o}var Po=T.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:2},text:{fontSize:9,color:sl.color.textTertiary,fontFamily:ll}});import{jsx as Oo,jsxs as dl}from"react/jsx-runtime";function Ko({selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:o="",ignoredPatterns:a=new Set,includedPatterns:n=new Set,onFilterPress:s}){let u=n.size>0,l=a.size>0,c=St(),i=Ei(()=>{let d=c;return n.size>0&&(d=d.filter(f=>{if(!f?.queryKey)return false;let b=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return Array.from(n).some(y=>b.includes(y.toLowerCase()))})),a.size>0&&(d=d.filter(f=>{if(!f?.queryKey)return true;let b=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return!Array.from(a).some(y=>b.includes(y.toLowerCase()))})),d.length},[c,n,a]);return dl(h,{style:zo.queryListContainer,children:[(u||l)&&Oo(cl,{totalCount:c.length,filteredCount:i,onPress:s}),Oo(Zr,{selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:o,ignoredPatterns:a,includedPatterns:n,emptyState:Ai({subject:"queries",verb:"active",search:o,total:c.length,blocked:r?`No ${r} queries. Pick another status to see the rest.`:u?`No queries match your "include only" filters. ${n.size} pattern(s) active.`:l?`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,{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.
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:zo.queryListContent})]})}var zo=T.create({queryListContainer:{flex:1,backgroundColor:"transparent"},queryListContent:{padding:8,backgroundColor:"transparent",flexGrow:1}});import{ToolFooter as yl,useSafeAreaInsets as hl}from"@buoy-gg/shared-ui/web";import{jsx as ir}from"react/jsx-runtime";function Lo({activeFilter:e,onFilterChange:t,isFloatingMode:r=true,size:o="default"}){let a=hl({minBottom:16});return ir(yl,{floating:r,safeArea:false,paddingBottom:r?0:a.bottom,style:Bo.filterFooter,children:ir(h,{style:Bo.filterContainer,children:ir(fo,{activeFilter:e,onFilterChange:t,size:o})})})}var Bo=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{useCallback as fl,useMemo as lt}from"react";import{DynamicFilterView as ml,buoyColors as Ae,monoFont as pl,night as sr}from"@buoy-gg/shared-ui/web";import{XCircle as Ho,Clock as lr,RefreshCw as gl,Globe as bl,Zap as vl,Filter as Sl,Eye as Cl}from"@buoy-gg/shared-ui/web";import{jsx as ur}from"react/jsx-runtime";var xl=()=>false;function wl({queries:e,activeFilter:t,onFilterChange:r,ignoredPatterns:o,onPatternToggle:a,includedPatterns:n,onIncludedPatternToggle:s,isTeamPattern:u=xl}){let l=fl(y=>u(y)?ur(h,{accessibilityLabel:"Set by your team on buoy.gg",style:[Wo.teamBadge,{borderColor:`${sr.color.accent}60`,backgroundColor:`${sr.color.accent}15`}],children:ur(v,{style:[Wo.teamBadgeText,{color:sr.color.accent}],children:"TEAM"})}):null,[u]),c=lt(()=>{let y={all:e.length,disabled:0,fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0};return e.forEach(m=>{let g=se(m);g==="disabled"?y.disabled++:g==="error"?y.error++:g==="fresh"?y.fresh++:g==="stale"?y.stale++:g==="fetching"?y.fetching++:g==="paused"?y.paused++:g==="inactive"&&y.inactive++}),y},[e]),i=lt(()=>{let y=new Set;return e.forEach(m=>{if(!m?.queryKey)return;(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).forEach(g=>{if(g!=null){let p=String(g);/^\d+$/.test(p)||y.add(p)}})}),Array.from(y).sort().slice(0,50)},[e]),d=lt(()=>i,[i]),f=lt(()=>{let y=e;return n.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let g=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return Array.from(n).some(p=>g.includes(p.toLowerCase()))})),o.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let g=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(p=>p!=null).map(p=>String(p)).join(" ").toLowerCase();return!Array.from(o).some(p=>g.includes(p.toLowerCase()))})),y.length},[e,n,o]),b=lt(()=>({filterSummarySection:{enabled:true,totalCount:e.length,filteredCount:f,includePatterns:n,excludePatterns:o},sections:[{id:"status",title:"Status",type:"status",data:[{id:"status::all",label:"All",count:c.all,icon:bl,color:Ae.primary,isActive:!t||t==="all"},{id:"status::disabled",label:"Disabled",count:c.disabled,icon:Ho,color:Ae.textMuted,isActive:t==="disabled"},{id:"status::fresh",label:"Fresh",count:c.fresh,icon:vl,color:Ae.success,isActive:t==="fresh"},{id:"status::stale",label:"Stale",count:c.stale,icon:lr,color:Ae.warning,isActive:t==="stale"},{id:"status::fetching",label:"Fetching",count:c.fetching,icon:gl,color:Ae.primary,isActive:t==="fetching"},{id:"status::paused",label:"Paused",count:c.paused,icon:lr,color:Ae.textMuted,isActive:t==="paused"},{id:"status::inactive",label:"Inactive",count:c.inactive,icon:lr,color:Ae.textSecondary,isActive:t==="inactive"},{id:"status::error",label:"Error",count:c.error,icon:Ho,color:Ae.error,isActive:t==="error"}]}],addFilterSection:{enabled:true,placeholder:"Enter pattern to exclude...",title:"EXCLUDE FILTERS",icon:Sl},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:Cl,patterns:n,onPatternToggle:s,onPatternAdd:s,renderPatternMeta:l},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:l}),[c,t,o,n,d,s,e.length,f,l]);return ur(ml,{...b,onFilterChange:y=>{let[m,g]=y.split("::");m==="status"?r(g==="all"||t===g?null:g):m==="suggestion"&&a(g)},onPatternToggle:a,onPatternAdd:a})}var Wo=T.create({teamBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:6,borderWidth:1},teamBadgeText:{fontSize:9,fontFamily:pl,fontWeight:"700",letterSpacing:.5}});import{useState as ut,useCallback as ct,useEffect as At,useMemo as jo,useRef as Vo}from"react";import{devToolsStorageKeys as Ee,persistentStorage as Et,useTeamList as $o}from"@buoy-gg/shared-ui/web";import{jsx as pe,jsxs as ql}from"react/jsx-runtime";function No({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:o,onMinimize:a,activeFilter:n,onFilterChange:s,enableSharedModalDimensions:u=false,onTabChange:l,searchText:c="",onSearchChange:i}){let d=cn(),f=Mr(t),b=St(),y=ct(()=>{d.getQueryCache().clear()},[d]),[m,g]=ut(null),p=n??m,S=s??g,[w,C]=ut(false),[q,A]=ut(new Set),[j,Qe]=ut(new Set),M=Vo(null),ae=Vo(null);At(()=>{(async()=>{try{let x=await Et.getItem(Ee.reactQuery.ignoredPatterns());if(x){let R=JSON.parse(x);Array.isArray(R)&&(M.current=JSON.stringify(Array.from(new Set(R))),A(new Set(R)))}}catch(x){console.error("[Buoy]","Failed to load ignored patterns:",x)}finally{M.current??(M.current="[]")}})()},[]),At(()=>{(async()=>{try{let x=await Et.getItem(Ee.reactQuery.includedPatterns());if(x){let R=JSON.parse(x);Array.isArray(R)&&(ae.current=JSON.stringify(Array.from(new Set(R))),Qe(new Set(R)))}}catch(x){console.error("[Buoy]","Failed to load included patterns:",x)}finally{ae.current??(ae.current="[]")}})()},[]),At(()=>{let x=JSON.stringify(Array.from(q));if(M.current===null||M.current===x)return;M.current=x,(async()=>{try{await Et.setItem(Ee.reactQuery.ignoredPatterns(),x)}catch(R){console.error("[Buoy]","Failed to save ignored patterns:",R)}})()},[q]),At(()=>{let x=JSON.stringify(Array.from(j));if(ae.current===null||ae.current===x)return;ae.current=x,(async()=>{try{await Et.setItem(Ee.reactQuery.includedPatterns(),x)}catch(R){console.error("[Buoy]","Failed to save included patterns:",R)}})()},[j]);let ye=$o(Ee.reactQuery.ignoredPatterns()),he=$o(Ee.reactQuery.includedPatterns()),ne=jo(()=>ye.length?new Set([...q,...ye]):q,[q,ye]),ie=jo(()=>he.length?new Set([...j,...he]):j,[j,he]),ht=ct(x=>ye.includes(x)&&!q.has(x)||he.includes(x)&&!j.has(x),[ye,he,q,j]),ft=ct(x=>{A(R=>{if(!R.has(x)&&ye.includes(x))return R;let fe=new Set(R);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[ye]),Lt=ct(x=>{Qe(R=>{if(!R.has(x)&&he.includes(x))return R;let fe=new Set(R);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[he]),[mt,Ua]=ut("bottomSheet"),_a=u?Ee.reactQuery.modal():Ee.reactQuery.browserModal(),Ja=ct(x=>{Ua(x)},[]),Ga=yn({minBottom:16}),Ya=mt==="floating"?56:48+Ga.bottom;if(!e)return null;let Xa=()=>{if(w){let x=[{key:"filters",label:"Filters"}];return ql(Bt,{children:[pe(Bt.Navigation,{onBack:()=>C(false)}),pe(Bt.Content,{title:"",noMargin:true,children:pe(hn,{tabs:x,activeTab:"filters",testIDPrefix:"buoy-rq-filterview-tab",onTabChange:()=>{}})})]})}return pe(tt,{selectedQuery:f,activeTab:"queries",onTabChange:l,onBack:()=>r(void 0),searchText:c,onSearchChange:i,onFilterPress:()=>C(true),hasActiveFilters:p!==null||ne.size>0||ie.size>0,onClearCache:y})},Za=pe(Lo,{activeFilter:p,onFilterChange:S,isFloatingMode:mt==="floating"});return pe(dn,{visible:e,onClose:o,onMinimize:a,persistenceKey:_a,header:{customContent:Xa(),showToggleButton:true},onModeChange:Ja,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:!w,styles:{},footer:w?void 0:Za,footerHeight:w?void 0:Ya,children:pe(h,{style:Ml.container,children:w?pe(wl,{queries:b,activeFilter:p,onFilterChange:S,ignoredPatterns:ne,onPatternToggle:ft,includedPatterns:ie,onIncludedPatternToggle:Lt,isTeamPattern:ht}):pe(Ko,{selectedQuery:f,onQuerySelect:r,activeFilter:p,searchText:c,ignoredPatterns:ne,includedPatterns:ie,onFilterPress:()=>C(true)})})})}var Ml=T.create({container:{flex:1,backgroundColor:"transparent"}});import{JsModal as Tl,devToolsStorageKeys as Uo,useSafeAreaInsets as Al}from"@buoy-gg/shared-ui/web";import{useQueryClient as _o}from"@tanstack/react-query";import{useSafeAreaInsets as Jo,night as K,monoFont as Go}from"@buoy-gg/shared-ui/web";import{useMemo as El}from"react";function cr(e,t,r){return El(()=>{let o=e.state.status;return[{label:"Refetch",variant:"refetch",disabled:se(e)==="fetching",onPress:()=>Yt({query:e})},{label:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading",variant:"triggerLoading",disabled:false,onPress:()=>Gt({query:e})},{label:o==="error"?"Restore Error":"Trigger Error",variant:"triggerError",disabled:o==="pending",onPress:()=>Xt({query:e,queryClient:t})}]},[e,t,r])}import{DataViewer as Dl}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Rl,jsx as k,jsxs as _e}from"react/jsx-runtime";function Yo({selectedQuery:e,isFloatingMode:t,disableInternalFooter:r=false,queryVersion:o}){let a=Jo({minBottom:16}),n=_o(),s=cr(e,n,o);return _e(Rl,{children:[_e(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:[_e(h,{style:I.section,children:[k(Il,{visible:!!e.state.data,selectedQuery:e,queryVersion:o}),k(Ql,{visible:!e.state.data,selectedQuery:e})]}),k(h,{style:I.section,children:k(_t,{query:e})}),k(h,{style:I.section,children:_e(h,{style:I.queryExplorerContainer,children:[k(v,{testID:"buoy-rq-query-explorer-header",style:I.queryExplorerHeader,children:"Query Explorer"}),k(h,{style:I.queryExplorerContent,children:k(Dl,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&k(h,{style:[I.actionFooter,{paddingBottom:t?0:a.bottom+8}],children:k(h,{style:I.actionsRow,children:s.map((u,l)=>k(ue,{testID:`buoy-rq-action-${u.variant}`,onClick:u.onPress,text:u.label,variant:u.variant,disabled:u.disabled},l))})})]})}function kl({selectedQuery:e,isFloatingMode:t,queryVersion:r}){let o=Jo({minBottom:16}),a=_o(),n=cr(e,a,r);return k(h,{style:[I.actionFooter,{paddingBottom:t?0:o.bottom+8}],children:k(h,{style:I.actionsRow,children:n.map((s,u)=>k(ue,{testID:`buoy-rq-action-${s.variant}`,onClick:s.onPress,text:s.label,variant:s.variant,disabled:s.disabled},u))})})}function Il({visible:e,selectedQuery:t,queryVersion:r=0}){return e?_e(h,{style:I.dataContainer,children:[k(v,{testID:"buoy-rq-data-header",style:I.dataHeader,children:"Data Editor"}),k(h,{style:I.dataContent,children:k(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"],activeQuery:t,dataVersion:r})})]}):null}function Ql({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 _e(h,{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: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,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{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},queryExplorerHeader:{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:Go},queryExplorerContent:{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,marginTop:8},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:Go},dataContent:{padding:8}});import{useState as Fl,useCallback as Pl,useEffect as Ol,useRef as Kl}from"react";import{jsx as Dt}from"react/jsx-runtime";function Xo({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:o,onMinimize:a,enableSharedModalDimensions:n=false,onTabChange:s}){let{query:u,version:l}=Ht(t),[c,i]=Fl("bottomSheet"),d=t?JSON.stringify(t):void 0,f=Kl(void 0);Ol(()=>{if(u){f.current=d;return}e&&f.current!==void 0&&f.current===d&&(f.current=void 0,r(void 0))},[e,u,d,r]);let b=Pl(w=>{i(w)},[]),y=Al({minBottom:16}),m=c==="floating"?72:80+y.bottom,g=()=>Dt(tt,{selectedQuery:u,activeTab:"queries",onTabChange:s,onBack:()=>r(void 0)}),p=n?Uo.reactQuery.modal():`${Uo.reactQuery.modal()}_data_editor`;if(!e||!u)return null;let S=Dt(kl,{selectedQuery:u,isFloatingMode:c==="floating",queryVersion:l},`footer-${l}`);return Dt(Tl,{visible:e,onClose:o,onMinimize:a,persistenceKey:p,header:{customContent:g(),showToggleButton:true},onModeChange:b,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:S,footerHeight:m,children:Dt(Yo,{selectedQuery:u,isFloatingMode:c==="floating",disableInternalFooter:true,queryVersion:l})})}import{useQueryClient as zl}from"@tanstack/react-query";import{useCallback as dr,useState as Zo,useRef as ea}from"react";import{useEffect as Ll,useState as Bl}from"react";import{useQueryClient as Hl}from"@tanstack/react-query";function yr(e){let t=Hl(),[r,o]=Bl(void 0);return Ll(()=>{let a=()=>{if(e!==void 0){let s=t.getMutationCache().getAll().find(u=>u.mutationId===e);o(s)}else o(void 0)};setTimeout(a,0);let n=t.getMutationCache().subscribe(a);return()=>n()},[t,e]),r}import{jsx as ta}from"react/jsx-runtime";function ra({selectedMutation:e,onMutationSelect:t,activeFilter:r,searchText:o=""}){let a=n=>{t(typeof n=="function"?n(e):n)};return ta(h,{style:oa.mutationListContainer,children:ta(Mo,{selectedMutation:e,setSelectedMutation:a,activeFilter:r,searchText:o,hideInfoPanel:true,contentContainerStyle:oa.mutationListContent})})}var oa=T.create({mutationListContainer:{flex:1,backgroundColor:"transparent"},mutationListContent:{padding:8,backgroundColor:"transparent"}});import{ToolFooter as Wl,useSafeAreaInsets as jl}from"@buoy-gg/shared-ui/web";import{useMemo as Vl}from"react";import{jsx as hr}from"react/jsx-runtime";function aa({activeFilter:e,onFilterChange:t,modalMode:r,size:o="default"}){let a=r==="floating",n=jl({minBottom:16}),s=Vl(()=>a?0:n.bottom,[a,n.bottom]);return hr(Wl,{floating:a,safeArea:false,paddingBottom:s,style:na.filterFooter,children:hr(h,{style:na.filterContainer,children:hr(To,{activeFilter:e,onFilterChange:t,size:o})})},`footer-${a?"floating":"docked"}`)}var na=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{JsModal as $l,useSafeAreaInsets as Nl}from"@buoy-gg/shared-ui/web";import{absoluteFill as Ul}from"@buoy-gg/shared-ui/web";import{useMemo as W}from"react";import{ChevronLeft as _l,ChevronRight as Jl,night as Rt}from"@buoy-gg/shared-ui/web";import{jsx as Je,jsxs as Gl}from"react/jsx-runtime";var He=32,ia=6,sa=He,Yl=120,kt=.95,la=1.15;function ua({translationX:e,maxTranslation:t=Yl,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:[ia,sa]}),[a]),s=W(()=>a.interpolate({inputRange:[0,kt,1],outputRange:[1,1,la]}),[a]),u=W(()=>a.interpolate({inputRange:[0,.99,1],outputRange:[0,0,16]}),[a]),l=W(()=>a.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[a]),c=W(()=>a.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[a]),i=W(()=>a.interpolate({inputRange:[0,.5,kt,1],outputRange:[.8,.8,1,1.2]}),[a]),d=W(()=>e.interpolate({inputRange:[-t,0],outputRange:[1,0],extrapolate:"clamp"}),[e,t]),f=W(()=>d.interpolate({inputRange:[0,1],outputRange:[ia,sa]}),[d]),b=W(()=>d.interpolate({inputRange:[0,kt,1],outputRange:[1,1,la]}),[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]),g=W(()=>d.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[d]),p=W(()=>d.interpolate({inputRange:[0,.5,kt,1],outputRange:[.8,.8,1,1.2]}),[d]);return Gl(h,{style:fr.container,pointerEvents:"none",children:[o&&Je(Z.View,{style:[fr.leftWrapper,{width:n,height:He,borderRadius:He/2,backgroundColor:Rt.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:l,transform:[{scale:s},{translateX:u}]}],children:Je(Z.View,{style:{opacity:c,transform:[{scale:i}]},children:Je(_l,{size:He*.6,color:Rt.color.accent,strokeWidth:3})})}),r&&Je(Z.View,{style:[fr.rightWrapper,{width:f,height:He,borderRadius:He/2,backgroundColor:Rt.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:m,transform:[{scale:b},{translateX:y}]}],children:Je(Z.View,{style:{opacity:g,transform:[{scale:p}]},children:Je(Jl,{size:He*.6,color:Rt.color.accent,strokeWidth:3})})})]})}var fr=T.create({container:{...Ul,zIndex:1e3,justifyContent:"center",alignItems:"center"},leftWrapper:{position:"absolute",left:16},rightWrapper:{position:"absolute",right:16}});import{devToolsStorageKeys as ca}from"@buoy-gg/shared-ui/web";import{jsx as Ge,jsxs as Xl}from"react/jsx-runtime";function da({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:o,onMinimize:a,activeFilter:n,onFilterChange:s,onTabChange:u,enableSharedModalDimensions:l=false,searchText:c="",onSearchChange:i}){let d=zl(),f=yr(t),[b,y]=Zo(null),m=n??b,g=s??y,p=dr(()=>{d.getMutationCache().clear(),r(void 0)},[d,r]),[S,w]=Zo("bottomSheet"),C=l?ca.reactQuery.modal():ca.reactQuery.mutationModal(),q=ea(new Z.Value(0)).current,A=dr(ne=>{ne==="right"&&u("queries")},[u]),j=dr(ne=>{w(ne)},[]),Qe=Nl({minBottom:16}),M=S==="floating"?56:48+Qe.bottom,ae=ea(Wt.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:ht,vx:ft}=ie,Lt=80,mt=.5;Z.spring(q,{toValue:0,useNativeDriver:true}).start(),(Math.abs(ht)>Lt||Math.abs(ft)>mt)&&(ht>0||ft>0?A("right"):A("left"))},onPanResponderTerminate:()=>{Z.spring(q,{toValue:0,useNativeDriver:true}).start()}})).current;if(!e)return null;let ye=()=>Ge(tt,{selectedMutation:f,activeTab:"mutations",onTabChange:u,onBack:()=>r(void 0),searchText:c,onSearchChange:i,onClearCache:p}),he=Ge(aa,{activeFilter:m,onFilterChange:g,modalMode:S});return Ge($l,{visible:e,onClose:o,onMinimize:a,persistenceKey:C,header:{customContent:ye(),showToggleButton:true},onModeChange:j,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:he,footerHeight:M,children:Ge(h,{style:{flex:1},children:Xl(h,{...ae.panHandlers,style:{flex:1},children:[Ge(ua,{translationX:q,canSwipeLeft:false,canSwipeRight:true}),Ge(ra,{selectedMutation:f,onMutationSelect:r,activeFilter:m,searchText:c})]})})})}import{JsModal as Zl,useSafeAreaInsets as eu,devToolsStorageKeys as ya}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as tu,night as z,monoFont as ha}from"@buoy-gg/shared-ui/web";import{useMemo as ru}from"react";import{useQueryClient as ou}from"@tanstack/react-query";function fa(e){let t=ou();return ru(()=>[{label:"Remove",variant:"remove",disabled:false,onPress:()=>t.getMutationCache().remove(e)}],[e,t])}import{DataViewer as au}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as nu,jsx as Q,jsxs as Ye}from"react/jsx-runtime";function ma({selectedMutation:e,isFloatingMode:t,disableInternalFooter:r=false}){return Ye(nu,{children:[Ye(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:[Ye(h,{style:P.section,children:[Q(iu,{visible:!!e.state.data,selectedMutation:e}),Q(su,{visible:!e.state.data,selectedMutation:e})]}),Q(h,{style:P.section,children:Q(ar,{selectedMutation:e})}),Q(h,{style:P.section,children:Ye(h,{style:P.mutationExplorerContainer,children:[Q(v,{style:P.mutationExplorerHeader,children:"Mutation Explorer"}),Q(h,{style:P.mutationExplorerContent,children:Q(au,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&Q(pa,{selectedMutation:e,isFloatingMode:t})]})}function pa({selectedMutation:e,isFloatingMode:t}){let r=tu({minBottom:16}),o=fa(e);return Q(h,{style:[P.actionFooter,{paddingBottom:t?0:r.bottom+8}],children:Q(h,{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 iu({visible:e,selectedMutation:t}){return e?Ye(h,{style:P.dataContainer,children:[Q(v,{style:P.dataHeader,children:"Data Editor"}),Q(h,{style:P.dataContent,children:Q(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"]},t.mutationId)})]}):null}function su({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 Ye(h,{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: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,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{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},mutationExplorerHeader:{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:ha},mutationExplorerContent:{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},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:ha},dataContent:{padding:8}});import{useState as lu,useCallback as uu,useEffect as cu,useRef as du}from"react";import{jsx as It}from"react/jsx-runtime";function ga({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:o,onMinimize:a,onTabChange:n,enableSharedModalDimensions:s=false}){let u=yr(t),[l,c]=lu("bottomSheet"),i=du(void 0);cu(()=>{if(u){i.current=u.mutationId;return}e&&i.current!==void 0&&i.current===t&&(i.current=void 0,r(void 0))},[e,u,t,r]);let d=uu(p=>{c(p)},[]),f=eu({minBottom:16}),b=l==="floating"?72:80+f.bottom,y=()=>It(tt,{selectedMutation:u,activeTab:"mutations",onTabChange:n,onBack:()=>r(void 0)}),m=s?ya.reactQuery.modal():ya.reactQuery.mutationModal();if(!e||!u)return null;let g=It(pa,{selectedMutation:u,isFloatingMode:l==="floating"});return It(Zl,{visible:e,onClose:o,onMinimize:a,persistenceKey:m,header:{customContent:y(),showToggleButton:true},onModeChange:d,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:g,footerHeight:b,children:It(ma,{selectedMutation:u,isFloatingMode:l==="floating",disableInternalFooter:true})})}import{Fragment as yu,jsx as Qt,jsxs as hu}from"react/jsx-runtime";function ba({visible:e,selectedQueryKey:t,selectedMutationId:r,onQuerySelect:o,onMutationSelect:a,onClose:n,onMinimize:s,activeFilter:u,onFilterChange:l,activeTab:c,onTabChange:i,enableSharedModalDimensions:d=false,searchText:f="",onSearchChange:b}){let y=!!t||!!r,m=c==="queries",g=c==="mutations",p={onClose:n,onMinimize:s,activeFilter:u,onFilterChange:l,enableSharedModalDimensions:d},S=e&&!y&&m,w=e&&!y&&g,C=e&&y&&m&&!!t,q=e&&y&&g&&!!r;return hu(yu,{children:[Qt(No,{visible:S,selectedQueryKey:t,onQuerySelect:o,onTabChange:i,searchText:f,onSearchChange:b,...p}),Qt(da,{visible:w,selectedMutationId:r,onMutationSelect:a,onTabChange:i,searchText:f,onSearchChange:b,...p}),Qt(Xo,{visible:C,selectedQueryKey:t,onQuerySelect:o,onTabChange:i,...p}),Qt(ga,{visible:q,selectedMutationId:r,onMutationSelect:a,onTabChange:i,...p})]})}import{ChangeLog as fu}from"@buoy-gg/shared-ui/web";var mu=0;function De(){return`rq-${Date.now()}-${++mu}`}var pu=class extends fu{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:De(),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:De(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})),a&&!n){let s=this.fetchStartTimes.get(t),u=s?Date.now()-s:void 0;this.fetchStartTimes.delete(t),r.status==="error"?this.addEvent({id:De(),type:"query-fetch-error",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryError:e.state.error,duration:u,query:e}):this.addEvent({id:De(),type:"query-fetch-success",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryData:e.state.data,duration:u,query:e})}!o.status&&e.state.isInvalidated&&this.addEvent({id:De(),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:De(),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:De(),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:De(),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}},We=new pu,gu=e=>We.setQueryClient(e),bu=()=>We.disconnect();import{jsx as va}from"react/jsx-runtime";function mr({visible:e,onClose:t,onMinimize:r,enableSharedModalDimensions:o=true}){let a=ln();sn(()=>{We.isConnected()||We.setQueryClient(a)},[a]);let[n,s]=Ze(void 0),[u,l]=Ze(void 0),[c,i]=Ze(null),[d,f]=Ze("queries"),[b,y]=Ze(""),m=Fe(()=>{s(void 0),l(void 0),i(null),f("queries"),y("")},[]),g=Fe(()=>{m(),t()},[t,m]),p=Fe(A=>{s(A?.queryKey)},[]),S=Fe(A=>{l(A?.mutationId)},[]),w=Fe(A=>{i(A)},[]),C=Fe(A=>{f(A),i(null),s(void 0),l(void 0),y("")},[]),q=Fe(A=>{y(A)},[]);return e?va(un,{children:va(ba,{visible:e,selectedQueryKey:n,selectedMutationId:u,onQuerySelect:p,onMutationSelect:S,onClose:g,onMinimize:r,activeFilter:c,onFilterChange:w,activeTab:d,onTabChange:C,searchText:b,onSearchChange:q,enableSharedModalDimensions:o})}):null}import{onlineManager as ge}from"@tanstack/react-query";import{devToolsStorageKeys as Sa,persistentStorage as Ca}from"@buoy-gg/shared-ui/web";import{useState as xa,useEffect as wa}from"react";import{jsx as Ft}from"react/jsx-runtime";var qa=()=>null,Ma=async e=>{try{await Ca.setItem(Sa.settings.wifiEnabled(),e.toString())}catch{}},vu=async()=>{try{let e=await Ca.getItem(Sa.settings.wifiEnabled());e!==null&&ge.setOnline(e==="true")}catch{}};vu();function Su({size:e}){let[t,r]=xa(()=>ge.isOnline());return wa(()=>ge.subscribe(o=>{r(o)}),[]),Ft(qr,{size:e,color:t?"#10B981":"#DC2626"})}var Cu={id:"query",name:"QUERY",description:"React Query inspector",slot:"both",icon:({size:e})=>Ft(wr,{size:e}),component:mr,props:{enableSharedModalDimensions:false}};function xu(e){return{id:e?.id||"query",name:e?.name||"QUERY",description:e?.description||"React Query inspector",slot:"both",icon:({size:t})=>Ft(wr,{size:t}),component:mr,props:{enableSharedModalDimensions:e?.enableSharedModalDimensions!==void 0?e.enableSharedModalDimensions:false}}}var wu={id:"query-wifi-toggle",name:"WIFI",description:"Toggle React Query online/offline state",slot:"row",icon:Su,component:qa,props:{},launchMode:"toggle-only",onPress:()=>{let e=!ge.isOnline();ge.setOnline(e),Ma(e)}};function qu(e){let t=e?.onColor||"#10B981",r=e?.offColor||"#DC2626",o=({size:a})=>{let[n,s]=xa(()=>ge.isOnline());return wa(()=>ge.subscribe(u=>{s(u)}),[]),Ft(qr,{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:qa,props:{},launchMode:"toggle-only",onPress:()=>{let a=!ge.isOnline();ge.setOnline(a),Ma(a)}}}import{expandKeyedArrays as Mu,patchFromPath as Tu,readPath as Au,refusalText as Eu,shapeSummary as Pt,suggestedPatch as Du,typedEditViolations as Ru,unshapedLists as ku}from"@buoy-gg/shared-ui/web";import{onlineManager as pr}from"@tanstack/react-query";import{isJsonSerializable as Ta,isOverWireBudget as Aa}from"@buoy-gg/shared-ui/web";var Iu=Object.freeze({__buoyDataOnDevice:true,note:"Query data stays on the device \u2014 fetched on demand via getQueryData."}),Ea=Object.freeze({__buoyUnserializable:true,note:"Query data is not JSON-serializable (circular or bigint) and stayed on the device."}),Qu=16*1024,Da=8*1024*1024;function Fu(e){return!!e&&typeof e=="object"&&e.__buoyDataOnDevice===true}function Pu(e){return!!e&&typeof e=="object"&&e.__buoyUnserializable===true}function Ra(e){return Fu(e)||Pu(e)}function Re(e){if(e!==void 0)return Aa(e,Qu)?Ta(e)?Iu:Ea:e}function Ot(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 Re({...r!==void 0?{name:r}:{},...o!==void 0?{message:o}:{}})}return Re(e)}function Ou(e){return Aa(e,Da)?Ta(e)?{__buoyTruncated:true,note:`Exceeds the ${Da/(1024*1024)}MB detail limit \u2014 inspect it on-device.`}:Ea:e}function Ku(e){let t=e.getMutationCache().getAll().map(o=>zu(o)),r=e.getQueryCache().getAll().map(o=>Bu(o));return{mutations:t,queries:r}}function zu(e){let t=e.state;return{mutationId:e.mutationId,mutationKey:e.options.mutationKey,state:{...t,data:Re(t.data),variables:Re(t.variables),error:Ot(t.error),failureReason:Ot(t.failureReason)},...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:Re(e.meta)}}}function Lu(e){let{queryFn:t,select:r,persister:o,initialData:a,placeholderData:n,...s}=e;return{...s,queryFn:void 0,...e.meta?{meta:Re(e.meta)}:{}}}function Bu(e){let t=e.observers.map(r=>({queryHash:e.queryHash,options:Lu(r.options)}));return{state:{...e.state,...e.state.data!==void 0&&{data:Re(e.state.data)},error:Ot(e.state.error),fetchFailureReason:Ot(e.state.fetchFailureReason)},queryKey:e.queryKey,queryHash:e.queryHash,...e.meta&&{meta:Re(e.meta)},observers:t}}function Hu(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 dt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function ka(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}function Ia(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(!dt(e)||!dt(t))return t;let a={...e};for(let[n,s]of Object.entries(t)){let u=r?`${r}.${n}`:n;if(n in e){let l=ka(e[n]),c=ka(s);(l==="array"||l==="object")&&l!==c&&o.breaks.push({path:u,from:l,to:c}),a[n]=Ia(e[n],s,u,o)}else a[n]=s}return a}function Wu(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 Qa(e){let t=r=>{let{queryHash:o}=r,a=e.getQueryCache(),n=o?a.get(o):void 0;if(!n&&typeof o=="string"){let s=Wu(o);s&&(n=a.getAll().find(u=>{let l=u.queryKey.map(c=>typeof c=="object"?JSON.stringify(c):String(c));return l.length===s.length&&l.every((c,i)=>c===s[i])}))}if(!n)throw new Error(`Query with hash "${o}" not found`);return n};return{version:2,getSnapshot:()=>({dehydratedState:Ku(e),isOnlineManagerOnline:pr.isOnline()}),subscribe:r=>{let o=e.getQueryCache().subscribe(r),a=e.getMutationCache().subscribe(r),n=pr.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 u=Au(n.state.data,a);return u.ok?{found:true,queryHash:o,path:a,shape:Pt(u.value),data:u.value}:{found:false,reason:u.error}}if(n.state.data===void 0){let u=n.state.status,l=n.state.error;return{found:true,queryHash:o,hasData:false,status:u,fetchStatus:n.state.fetchStatus,...l?{error:l instanceof Error?l.message:String(l)}:{},reason:u==="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 s=Pt(n.state.data);return{found:true,queryHash:o,hasData:true,...s?{shape:s}:{},data:Ou(n.state.data)}},listQueries:r=>{let{includeData:o=false,staleOnly:a=false,limit:n}=r??{},s=e.getQueryCache().getAll(),u=[...a?s.filter(c=>c.isStale()):s].sort((c,i)=>{let d=+(i.getObserversCount()>0)-+(c.getObserversCount()>0);return d!==0?d:(i.state.dataUpdatedAt??0)-(c.state.dataUpdatedAt??0)}),l=(typeof n=="number"&&n>0?u.slice(0,n):u).map(c=>{let i=c.state.error,d=ju(c);return{queryHash:c.queryHash,queryKey:c.queryKey,status:se(c),fetchStatus:c.state.fetchStatus,isStale:c.isStale(),observers:c.getObserversCount(),updatedAt:c.state.dataUpdatedAt,...d?{refetchEveryMs:d}:{},error:i?i.message??String(i):void 0,...o?{data:c.state.data}:{},...Pt(c.state.data)?{shape:Pt(c.state.data)}:{}}});return{queries:l,total:s.length,returned:l.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:s,value:u}=r,{queryKey:l,queryHash:c}=r,i=l;if(i===void 0&&typeof c=="string"){let y=e.getQueryCache().get(c);if(!y)return{ok:false,error:`Refused: no query with hash ${c} 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),f=e.getQueryCache().find({queryKey:i,exact:true});if(d===void 0&&f&&(o!==void 0||s!==void 0)){let y=f,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&&s===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 b=o;if(s!==void 0){if(u===void 0)return{ok:false,error:`Refused: sent \`path\` without \`value\`. Say what to set "${s}" to; if you mean to clear it, send value:null and the field must already be nullable.`};let y=Tu(d,s,u);if(!y.ok)return{ok:false,error:`Refused: ${y.error}`};b=y.patch}if(a||s!==void 0){let y=n?{patch:b,notes:[],error:void 0}:Mu(d,b);if(y.error)return{ok:false,error:`Refused: ${y.error}`};let m=y.patch;if(!n){let S=Ru(d,m,{noun:"data"});if(S.length>0){let w=Du(m,S);return{ok:false,error:Eu(S,"data",w),violations:S,...w?{suggestedData:w}:{}}}}let g=Ia(d,m),p=ku(d).filter(S=>Hu(m,S));return e.setQueryData(i,g,{updatedAt:Date.now()}),{ok:true,mode:"merge",...s!==void 0?{path:s}:{},changedKeys:dt(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&&dt(d)&&dt(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;pr.setOnline(o)}}}}import{useEffect as Vu,useMemo as $u}from"react";import{useQueryClient as Nu}from"@tanstack/react-query";import{classifyPreviewItem as Uu,createRestoreScope as _u,emptyRestoreResult as Ju,failedRestore as Gu,registerStateSnapshotProvider as Yu,superJsonSerialize as Xu}from"@buoy-gg/shared-ui/web";function Fa(e){return{...e,fetchStatus:"idle",fetchMeta:null}}function gr(e){return{status:e.state.status,error:e.state.error??null,data:e.state.data}}function br(e,t){try{let r=JSON.stringify(e);return r.length>60?`${r.slice(0,57)}\u2026`:r}catch{return t}}function Pa(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 Oa(e){if(e===void 0)return true;try{return Xu(e),true}catch{return false}}function Ka(e){let t=[],r=[];for(let o of e.getQueryCache().getAll()){let a=br(o.queryKey,o.queryHash);if(!Oa(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&&Oa(o.meta)?{meta:o.meta}:{},state:Fa({...o.state,error:Pa(o.state.error),fetchFailureReason:Pa(o.state.fetchFailureReason)})})}return{queries:r,warnings:t}}function Zu(e){return{id:"query",label:"React Query",status:()=>({canCapture:true,canRestore:true}),async capture(){let{queries:t,warnings:r}=Ka(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=_u(r),n=Ju();if(!o?.queries)return Gu("empty query snapshot");let s=e.getQueryCache(),u=new Set(o.queries.map(i=>i.queryHash));for(let i of o.queries)if(a.allows(i.queryHash)){if(Ra(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=Fa(i.state),f=s.get(i.queryHash);f?f.setState(d):s.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 s.getAll().slice())if(a.allows(i.queryHash)&&!u.has(i.queryHash))try{s.remove(i),n.applied+=1}catch(d){n.skipped.push({id:i.queryHash,reason:String(d)})}let l=e.getMutationCache().getAll().length;l>0&&(e.getMutationCache().clear(),n.warnings.push(`mutation cache cleared (${l} mutation(s))`));let c=a.excludedWarning("quer(y/ies)");return c&&n.warnings.push(c),n},async previewItems(t,r){let o=t?.queries??[],a=r===void 0,n=a?Ka(e).queries:r?.queries??[],s=new Map(n.map(i=>[i.queryHash,i])),u=new Map(o.map(i=>[i.queryHash,i])),l=[],c=[];for(let i of o){let d=br(i.queryKey,i.queryHash);if(Ra(i.state.data)){l.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 f=s.get(i.queryHash);l.push(Uu({key:i.queryHash,label:d,oldValue:f?gr(f):void 0,newValue:gr(i),inOld:f!==void 0,inNew:true},{tooLargeReason:"query data too large to render a diff \u2014 restore still applies it"}))}for(let i of n)u.has(i.queryHash)||l.push({key:i.queryHash,label:br(i.queryKey,i.queryHash),verdict:"removed",oldValue:gr(i)});if(a){let i=e.getMutationCache().getAll().length;i>0&&c.push(`${i} in-memory mutation record(s) will be cleared`)}return{items:l,notes:c}}}}function ec(e){return Yu(Zu(e))}function tc(){let e;try{e=Nu()}catch{e=null}return Vu(()=>{if(e)return ec(e)},[e]),$u(()=>e?Qa(e):null,[e])}function za({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 rc}from"@tanstack/react-query";import{jsx as Kt,jsxs as ke}from"react/jsx-runtime";function La(){try{let e=rc(),t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return ke(h,{style:Y.container,children:[Kt(v,{style:Y.title,children:"Debug Info"}),Kt(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(h,{style:Y.queriesList,children:[Kt(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(h,{style:Y.container,children:[Kt(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 Xe}from"react/jsx-runtime";function oc({queries:e,selectedQuery:t,isOpen:r,onClose:o,onSelect:a}){let n=s=>Array.isArray(s.queryKey)?s.queryKey.join(" - "):String(s.queryKey);return Ie(Pr,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:r,transparent:true,animationType:"fade",onRequestClose:o,children:Ie(Qr,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:L.modalOverlay,onPress:o,children:Xe(h,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:L.modalContent,children:[Xe(h,{style:L.modalHeader,children:[Ie(v,{style:L.modalTitle,children:"Select Query"}),Xe(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?Xe(h,{style:L.emptyState,children:[Ie(v,{style:L.emptyTitle,children:"No Queries Found"}),Xe(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,{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.",`
7
7
 
8
8
  `,"To see queries here:",`
9
9
  `,"\u2022 Make API calls using useQuery",`
10
10
  `,"\u2022 Ensure queries are within QueryClientProvider",`
11
- `,"\u2022 Check console for debugging info"]}),Ie(La,{})]}):e.map((s,u)=>{let l=n(s),c=za({queryState:s.state,observerCount:s.getObserversCount(),isStale:s.isStale()}),i={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"}[c]||"#6B7280",d=s===t;return Xe(N,{accessibilityLabel:`Query ${l}`,accessibilityHint:`View query ${l}`,"sentry-label":`ignore query ${l}`,style:[L.queryItem,d&&L.selectedQueryItem],onPress:()=>a(s),children:[Ie(h,{style:[L.statusDot,{backgroundColor:i}]}),Ie(v,{style:[L.queryText,d&&L.selectedQueryText],numberOfLines:1,children:l})]},`${s.queryHash}-${u}`)})})]})})})}var L=T.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}});import{CyberpunkSectionButton as ac,buoyColors as Ba}from"@buoy-gg/shared-ui/web";import{jsx as vr}from"react/jsx-runtime";var nc=()=>vr(h,{style:{width:24,height:24},children:vr(Ds,{})});function ic({onPress:e,getReactBuoySubtitle:t}){return vr(ac,{id:"react-buoy-dev-tools",title:"QUERY",subtitle:(()=>{let r=t().match(/(\d+) queries • (\d+) mutations/);return r?`${r[1]}Q \u2022 ${r[2]}M`:"No data"})(),icon:nc,iconColor:Ba.error,iconBackgroundColor:Ba.error+"1A",onPress:e,index:1})}import{useContext as sc,useEffect as lc}from"react";import{QueryClientContext as uc}from"@tanstack/react-query";function cc(){let e=sc(uc);return lc(()=>{e&&(We.isConnected()||We.setQueryClient(e))},[e]),null}import{VirtualizedDataExplorer as dc,DataViewer as yc,TypeLegend as hc}from"@buoy-gg/shared-ui/web/dataViewer";import{useMemo as fc}from"react";import{useQueryClient as mc}from"@tanstack/react-query";import{isDevToolsStorageKey as pc}from"@buoy-gg/shared-ui/web";function Ha(e){let t={mmkv:0,async:0,secure:0,total:0};return e.filter(r=>Se(r.queryKey)).forEach(r=>{let o=_r(r.queryKey);if(o){let a=Yr(r.queryKey);pc(a)||(t[o]++,t.total++)}}),t}function gc(){let e=mc();return fc(()=>{let t=e.getQueryCache().getAll();return Ha(t)},[e])}function bc(e){return{getReactBuoySubtitle:()=>{try{let t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return`${t.length} queries \u2022 ${r.length} mutations`}catch{return"Data management & cache inspector"}}}}import{useState as X,useEffect as vc}from"react";import{useEffect as Sc,useCallback as Sr}from"react";import{persistentStorage as Wa}from"@buoy-gg/shared-ui/web";var yt=async(e,t)=>{await Wa.setItem(e,t)},zt=async e=>Wa.getItem(e),Cc=async(e,t)=>{try{await yt(`${e}_panel_dimensions`,JSON.stringify(t))}catch{}},xc=async(e,t)=>{try{await yt(`${e}_panel_height`,t.toString())}catch{}},wc=async(e,t)=>{try{await yt(`${e}_is_floating_mode`,t.toString())}catch{}},qc=async e=>{try{let[t,r,o]=await Promise.all([zt(`${e}_panel_dimensions`),zt(`${e}_panel_height`),zt(`${e}_is_floating_mode`)]),a=t?JSON.parse(t):null,n=r?parseInt(r,10):null;return{dimensions:a,height:n,isFloating:o?o==="true":null}}catch{return{dimensions:null,height:null,isFloating:null}}},ja=async(e,t)=>{try{let r=JSON.stringify(t);await yt(e,r)}catch{}},Va=async e=>{try{let t=await zt(e);return t&&t!==""?JSON.parse(t):null}catch{return null}},$a=async e=>{try{await yt(e,"")}catch{}};function Na({storagePrefix:e,isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:o=false,isSentryModalOpen:a=false,isStorageModalOpen:n=false,isNetworkModalOpen:s=false,selectedQueryKey:u,selectedSection:l,activeFilter:c,activeTab:i,selectedMutationId:d,isStateRestored:f}){let b=Sr(async()=>{let g={isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:o,isSentryModalOpen:a,isStorageModalOpen:n,isNetworkModalOpen:s,selectedQueryKey:u?JSON.stringify(u):void 0,selectedSection:l||void 0,activeFilter:c||void 0,activeTab:i||void 0,selectedMutationId:d?.toString()||void 0};await ja(e,g)},[e,t,r,o,a,n,s,u,l,c,i,d]),y=Sr(async()=>await Va(e),[e]),m=Sr(async()=>{await $a(e)},[e]);return Sc(()=>{f&&(t||r||o||a||n||s?b():m())},[t,r,o,a,n,s,u,l,c,i,d,f,b,m]),{saveCurrentState:b,loadSavedState:y,clearSavedState:m}}import{devToolsStorageKeys as Mc}from"@buoy-gg/shared-ui/web";function Tc(){let[e,t]=X(false),[r,o]=X(false),[a,n]=X(false),[s,u]=X(false),[l,c]=X(false),[i,d]=X(false),[f,b]=X(void 0),[y,m]=X(null),[g,p]=X(null),[S,w]=X(false),[C,q]=X("queries"),[A,j]=X(void 0),{loadSavedState:Qe}=Na({storagePrefix:Mc.modal.state(),isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:a,isSentryModalOpen:s,isStorageModalOpen:l,isNetworkModalOpen:i,selectedQueryKey:f,selectedSection:y,activeFilter:g,activeTab:C,selectedMutationId:A,isStateRestored:S});return vc(()=>{(async()=>{if(!S)try{let M=await Qe();if(M){if(t(M.isModalOpen),o(M.isDebugModalOpen),n(M.isEnvModalOpen||false),u(M.isSentryModalOpen||false),c(M.isStorageModalOpen||false),d(M.isNetworkModalOpen||false),M.selectedQueryKey)try{let ae=JSON.parse(M.selectedQueryKey);b(ae)}catch{}M.selectedSection&&m(M.selectedSection),M.activeFilter&&p(M.activeFilter),M.activeTab&&q(M.activeTab),M.selectedMutationId&&j(Number(M.selectedMutationId))}}catch{}finally{w(true)}})()},[S,Qe]),{isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:a,isSentryModalOpen:s,isStorageModalOpen:l,isNetworkModalOpen:i,selectedQueryKey:f,selectedSection:y,activeFilter:g,isStateRestored:S,activeTab:C,selectedMutationId:A,setSelectedSection:m,setActiveFilter:p,setActiveTab:q,handleModalDismiss:()=>{t(false),b(void 0)},handleDebugModalDismiss:()=>{o(false),m(null)},handleEnvModalDismiss:()=>{n(false)},handleSentryModalDismiss:()=>{u(false)},handleStorageModalDismiss:()=>{c(false)},handleNetworkModalDismiss:()=>{d(false)},handleQuerySelect:M=>{b(M?.queryKey)},handleQueryPress:()=>{t(true)},handleStatusPress:()=>{o(true)},handleEnvPress:()=>{n(true)},handleSentryPress:()=>{u(true)},handleStoragePress:()=>{c(true)},handleNetworkPress:()=>{d(true)},handleTabChange:M=>{M!==C&&(b(void 0),j(void 0),p(null)),q(M)},handleMutationSelect:M=>{j(M?.mutationId)}}}import{safeStringify as Ac,displayValue as Ec,parseDisplayValue as Dc}from"@buoy-gg/shared-ui/web";function Rc(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof Map)&&!(e instanceof Set)&&!(e instanceof RegExp)&&typeof e!="function"}export{ue as ActionButton,el as ClearCacheButton,Xo as DataEditorModal,Yo as DataEditorMode,yc as DataViewer,me as Explorer,aa as MutationBrowserFooter,da as MutationBrowserModal,ra as MutationBrowserMode,po as MutationButton,ar as MutationDetails,bo as MutationDetailsChips,ga as MutationEditorModal,ma as MutationEditorMode,So as MutationInformation,To as MutationStatusCount,Mo as MutationsList,rl as NetworkToggleButton,lo as QueryActions,Zr as QueryBrowser,Lo as QueryBrowserFooter,No as QueryBrowserModal,Ko as QueryBrowserMode,nn as QueryClientProvider,La as QueryDebugInfo,_t as QueryDetails,ro as QueryDetailsChip,ys as QueryInformation,$r as QueryRow,oc as QuerySelector,re as QueryStatus,fo as QueryStatusCount,mr as ReactQueryDevToolsModal,ba as ReactQueryModal,tt as ReactQueryModalHeader,ic as ReactQuerySection,cc as ReactQueryTracker,il as StorageStatusCount,ua as SwipeIndicator,hc as TypeLegend,dc as VirtualizedDataExplorer,Hr as WifiToggle,$a as clearModalVisibilityState,Qa as createReactQuerySyncAdapter,xu as createReactQueryTool,qu as createWifiToggleTool,Wr as deleteItem,$e as deleteNestedDataByPath,bu as disconnectQueryClient,Ec as displayValue,Yr as getCleanStorageKey,za as getQueryStatusColor,se as getQueryStatusLabel,Ha as getStorageQueryCounts,_r as getStorageType,Gr as getStorageTypeColor,_i as getStorageTypeHexColor,Jr as getStorageTypeLabel,so as invalidate,Rc as isPlainObject,Se as isStorageQuery,Va as loadModalVisibilityState,qc as loadPanelState,Dc as parseDisplayValue,We as reactQueryEventStore,Cu as reactQueryToolPreset,Yt as refetch,io as remove,no as reset,Ac as safeStringify,wc as saveFloatingMode,ja as saveModalVisibilityState,Cc as savePanelDimensions,xc as savePanelHeight,gu as setQueryClient,le as storageQueryKeys,Xt as triggerError,Gt as triggerLoading,Ve as updateNestedDataByPath,cr as useActionButtons,wo as useAllMutations,St as useAllQueries,yr as useGetMutationById,Mr as useGetQueryByQueryKey,Ht as useGetQueryByQueryKeyWithVersion,Tc as useModalManager,Na as useModalPersistence,fa as useMutationActionButtons,ho as useQueryStatusCounts,bc as useReactQueryState,tc as useReactQuerySyncAdapter,gc as useStorageQueryCounts,Br as useWifiState,wu as wifiTogglePreset};
11
+ `,"\u2022 Check console for debugging info"]}),Ie(Wa,{})]}):e.map((l,c)=>{let s=n(l),u=ja({queryState:l.state,observerCount:l.getObserversCount(),isStale:l.isStale()}),i={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"}[u]||"#6B7280",d=l===t;return et(N,{accessibilityLabel:`Query ${s}`,accessibilityHint:`View query ${s}`,"sentry-label":`ignore query ${s}`,style:[L.queryItem,d&&L.selectedQueryItem],onPress:()=>a(l),children:[Ie(f,{style:[L.statusDot,{backgroundColor:i}]}),Ie(v,{style:[L.queryText,d&&L.selectedQueryText],numberOfLines:1,children:s})]},`${l.queryHash}-${c}`)})})]})})})}var L=T.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}});import{CyberpunkSectionButton as cc,buoyColors as $a}from"@buoy-gg/shared-ui/web";import{jsx as xr}from"react/jsx-runtime";var dc=()=>xr(f,{style:{width:24,height:24},children:xr(Ps,{})});function yc({onPress:e,getReactBuoySubtitle:t}){return xr(cc,{id:"react-buoy-dev-tools",title:"QUERY",subtitle:(()=>{let r=t().match(/(\d+) queries • (\d+) mutations/);return r?`${r[1]}Q \u2022 ${r[2]}M`:"No data"})(),icon:dc,iconColor:$a.error,iconBackgroundColor:$a.error+"1A",onPress:e,index:1})}import{useContext as hc,useEffect as fc}from"react";import{QueryClientContext as mc}from"@tanstack/react-query";function pc(){let e=hc(mc);return fc(()=>{e&&(je.isConnected()||je.setQueryClient(e))},[e]),null}import{VirtualizedDataExplorer as gc,DataViewer as bc,TypeLegend as vc}from"@buoy-gg/shared-ui/web/dataViewer";import{useMemo as Sc}from"react";import{useQueryClient as Cc}from"@tanstack/react-query";import{isDevToolsStorageKey as xc}from"@buoy-gg/shared-ui/web";function Va(e){let t={mmkv:0,async:0,secure:0,total:0};return e.filter(r=>Se(r.queryKey)).forEach(r=>{let o=Xr(r.queryKey);if(o){let a=to(r.queryKey);xc(a)||(t[o]++,t.total++)}}),t}function wc(){let e=Cc();return Sc(()=>{let t=e.getQueryCache().getAll();return Va(t)},[e])}function qc(e){return{getReactBuoySubtitle:()=>{try{let t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return`${t.length} queries \u2022 ${r.length} mutations`}catch{return"Data management & cache inspector"}}}}import{useState as X,useEffect as Mc}from"react";import{useEffect as Tc,useCallback as wr}from"react";import{persistentStorage as Na}from"@buoy-gg/shared-ui/web";var ft=async(e,t)=>{await Na.setItem(e,t)},Bt=async e=>Na.getItem(e),Ac=async(e,t)=>{try{await ft(`${e}_panel_dimensions`,JSON.stringify(t))}catch{}},Ec=async(e,t)=>{try{await ft(`${e}_panel_height`,t.toString())}catch{}},Rc=async(e,t)=>{try{await ft(`${e}_is_floating_mode`,t.toString())}catch{}},Dc=async e=>{try{let[t,r,o]=await Promise.all([Bt(`${e}_panel_dimensions`),Bt(`${e}_panel_height`),Bt(`${e}_is_floating_mode`)]),a=t?JSON.parse(t):null,n=r?parseInt(r,10):null;return{dimensions:a,height:n,isFloating:o?o==="true":null}}catch{return{dimensions:null,height:null,isFloating:null}}},Ua=async(e,t)=>{try{let r=JSON.stringify(t);await ft(e,r)}catch{}},_a=async e=>{try{let t=await Bt(e);return t&&t!==""?JSON.parse(t):null}catch{return null}},Ja=async e=>{try{await ft(e,"")}catch{}};function Ga({storagePrefix:e,isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:o=false,isSentryModalOpen:a=false,isStorageModalOpen:n=false,isNetworkModalOpen:l=false,selectedQueryKey:c,selectedSection:s,activeFilter:u,activeTab:i,selectedMutationId:d,isStateRestored:h}){let g=wr(async()=>{let b={isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:o,isSentryModalOpen:a,isStorageModalOpen:n,isNetworkModalOpen:l,selectedQueryKey:c?JSON.stringify(c):void 0,selectedSection:s||void 0,activeFilter:u||void 0,activeTab:i||void 0,selectedMutationId:d?.toString()||void 0};await Ua(e,b)},[e,t,r,o,a,n,l,c,s,u,i,d]),y=wr(async()=>await _a(e),[e]),m=wr(async()=>{await Ja(e)},[e]);return Tc(()=>{h&&(t||r||o||a||n||l?g():m())},[t,r,o,a,n,l,c,s,u,i,d,h,g,m]),{saveCurrentState:g,loadSavedState:y,clearSavedState:m}}import{devToolsStorageKeys as kc}from"@buoy-gg/shared-ui/web";function Ic(){let[e,t]=X(false),[r,o]=X(false),[a,n]=X(false),[l,c]=X(false),[s,u]=X(false),[i,d]=X(false),[h,g]=X(void 0),[y,m]=X(null),[b,p]=X(null),[S,w]=X(false),[C,q]=X("queries"),[A,$]=X(void 0),{loadSavedState:Qe}=Ga({storagePrefix:kc.modal.state(),isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:a,isSentryModalOpen:l,isStorageModalOpen:s,isNetworkModalOpen:i,selectedQueryKey:h,selectedSection:y,activeFilter:b,activeTab:C,selectedMutationId:A,isStateRestored:S});return Mc(()=>{(async()=>{if(!S)try{let M=await Qe();if(M){if(t(M.isModalOpen),o(M.isDebugModalOpen),n(M.isEnvModalOpen||false),c(M.isSentryModalOpen||false),u(M.isStorageModalOpen||false),d(M.isNetworkModalOpen||false),M.selectedQueryKey)try{let ae=JSON.parse(M.selectedQueryKey);g(ae)}catch{}M.selectedSection&&m(M.selectedSection),M.activeFilter&&p(M.activeFilter),M.activeTab&&q(M.activeTab),M.selectedMutationId&&$(Number(M.selectedMutationId))}}catch{}finally{w(true)}})()},[S,Qe]),{isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:a,isSentryModalOpen:l,isStorageModalOpen:s,isNetworkModalOpen:i,selectedQueryKey:h,selectedSection:y,activeFilter:b,isStateRestored:S,activeTab:C,selectedMutationId:A,setSelectedSection:m,setActiveFilter:p,setActiveTab:q,handleModalDismiss:()=>{t(false),g(void 0)},handleDebugModalDismiss:()=>{o(false),m(null)},handleEnvModalDismiss:()=>{n(false)},handleSentryModalDismiss:()=>{c(false)},handleStorageModalDismiss:()=>{u(false)},handleNetworkModalDismiss:()=>{d(false)},handleQuerySelect:M=>{g(M?.queryKey)},handleQueryPress:()=>{t(true)},handleStatusPress:()=>{o(true)},handleEnvPress:()=>{n(true)},handleSentryPress:()=>{c(true)},handleStoragePress:()=>{u(true)},handleNetworkPress:()=>{d(true)},handleTabChange:M=>{M!==C&&(g(void 0),$(void 0),p(null)),q(M)},handleMutationSelect:M=>{$(M?.mutationId)}}}import{safeStringify as Qc,displayValue as Fc,parseDisplayValue as Pc}from"@buoy-gg/shared-ui/web";function Oc(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof Map)&&!(e instanceof Set)&&!(e instanceof RegExp)&&typeof e!="function"}export{ue as ActionButton,il as ClearCacheButton,ra as DataEditorModal,ta as DataEditorMode,bc as DataViewer,me as Explorer,la as MutationBrowserFooter,ma as MutationBrowserModal,ia as MutationBrowserMode,So as MutationButton,sr as MutationDetails,xo as MutationDetailsChips,Ca as MutationEditorModal,va as MutationEditorMode,qo as MutationInformation,Do as MutationStatusCount,Ro as MutationsList,ll as NetworkToggleButton,ho as QueryActions,oo as QueryBrowser,Wo as QueryBrowserFooter,Go as QueryBrowserModal,Ho as QueryBrowserMode,cn as QueryClientProvider,Wa as QueryDebugInfo,Yt as QueryDetails,io as QueryDetailsChip,bs as QueryInformation,Jr as QueryRow,uc as QuerySelector,re as QueryStatus,bo as QueryStatusCount,br as ReactQueryDevToolsModal,xa as ReactQueryModal,ot as ReactQueryModalHeader,yc as ReactQuerySection,pc as ReactQueryTracker,yl as StorageStatusCount,ha as SwipeIndicator,vc as TypeLegend,gc as VirtualizedDataExplorer,Vr as WifiToggle,Ja as clearModalVisibilityState,za as createReactQuerySyncAdapter,Eu as createReactQueryTool,Du as createWifiToggleTool,Nr as deleteItem,Ue as deleteNestedDataByPath,qu as disconnectQueryClient,Fc as displayValue,to as getCleanStorageKey,ja as getQueryStatusColor,se as getQueryStatusLabel,Va as getStorageQueryCounts,Xr as getStorageType,eo as getStorageTypeColor,es as getStorageTypeHexColor,Zr as getStorageTypeLabel,yo as invalidate,Oc as isPlainObject,Se as isStorageQuery,_a as loadModalVisibilityState,Dc as loadPanelState,Pc as parseDisplayValue,je as reactQueryEventStore,Au as reactQueryToolPreset,er as refetch,co as remove,uo as reset,Qc as safeStringify,Rc as saveFloatingMode,Ua as saveModalVisibilityState,Ac as savePanelDimensions,Ec as savePanelHeight,wu as setQueryClient,le as storageQueryKeys,tr as triggerError,Zt as triggerLoading,Ne as updateNestedDataByPath,hr as useActionButtons,Ao as useAllMutations,xt as useAllQueries,mr as useGetMutationById,Er as useGetQueryByQueryKey,Wt as useGetQueryByQueryKeyWithVersion,Ic as useModalManager,Ga as useModalPersistence,ba as useMutationActionButtons,go as useQueryStatusCounts,qc as useReactQueryState,sc as useReactQuerySyncAdapter,wc as useStorageQueryCounts,$r as useWifiState,Ru as wifiTogglePreset};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/react-query",
3
- "version": "7.0.73",
3
+ "version": "7.0.75",
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/floating-tools-core": "^7.0.73",
43
- "@buoy-gg/shared-ui": "^7.0.73"
42
+ "@buoy-gg/floating-tools-core": "^7.0.75",
43
+ "@buoy-gg/shared-ui": "^7.0.75"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@tanstack/react-query": ">=5.0.0",