@buoy-gg/react-query 7.0.39 → 7.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/lib/commonjs/checkPeer.js +8 -0
- package/lib/commonjs/checkPeer.web.js +3 -0
- package/lib/commonjs/index.js +2 -81
- package/lib/module/checkPeer.js +8 -0
- package/lib/module/checkPeer.web.js +3 -0
- package/lib/module/index.js +1 -6
- package/lib/typescript/checkPeer.d.ts +1 -0
- package/lib/typescript/checkPeer.d.ts.map +1 -0
- package/lib/typescript/checkPeer.web.d.ts +2 -0
- package/lib/typescript/checkPeer.web.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/web/index.mjs +12 -0
- package/package.json +36 -12
package/README.md
CHANGED
|
@@ -83,3 +83,7 @@ Use a Free or Pro Buoy account. History limits and paid features vary by tool; s
|
|
|
83
83
|
📚 [Full docs](https://buoy.gg/buoy/latest/docs/tools/react-query) · [All Buoy tools](https://github.com/Buoy-gg/buoy)
|
|
84
84
|
|
|
85
85
|
Proprietary software. © Buoy LLC. [Terms](https://buoy.gg/terms)
|
|
86
|
+
|
|
87
|
+
## Web support (unreleased)
|
|
88
|
+
|
|
89
|
+
Use the app’s existing QueryClientProvider. The browser host mounts the shared tracker and cache adapter. The browser build is available in this checkout and has not been published yet. See the [web setup guide](https://buoy.gg/buoy/latest/docs/web-preview) for registration, dependencies, and browser boundaries.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Check if @tanstack/react-query is installed
|
|
4
|
+
try {
|
|
5
|
+
require("@tanstack/react-query");
|
|
6
|
+
} catch (error) {
|
|
7
|
+
throw new Error("\n\n[@buoy-gg/react-query] ERROR: Missing required peer dependency\n\n" + "This package requires @tanstack/react-query to be installed.\n\n" + "Install it with:\n" + " npm install @tanstack/react-query\n" + " or\n" + " pnpm add @tanstack/react-query\n" + " or\n" + " yarn add @tanstack/react-query\n\n" + "For more information, visit: https://tanstack.com/query/latest\n");
|
|
8
|
+
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -523,6 +523,7 @@ Object.defineProperty(exports, "wifiTogglePreset", {
|
|
|
523
523
|
return _preset.wifiTogglePreset;
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
|
+
require("./checkPeer");
|
|
526
527
|
var _preset = require("./preset");
|
|
527
528
|
var _reactQueryEventStore = require("./react-query/stores/reactQueryEventStore");
|
|
528
529
|
var _reactQuerySyncAdapter = require("./react-query/sync/reactQuerySyncAdapter");
|
|
@@ -653,84 +654,4 @@ Object.keys(_deleteNestedDataByPath).forEach(function (key) {
|
|
|
653
654
|
});
|
|
654
655
|
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
655
656
|
var _types = require("./react-query/types/types");
|
|
656
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
657
|
-
/**
|
|
658
|
-
* @buoy-gg/react-query
|
|
659
|
-
*
|
|
660
|
-
* React Query DevTools for React Native.
|
|
661
|
-
*
|
|
662
|
-
* PUBLIC API - Only these exports are supported for external use.
|
|
663
|
-
* Internal stores and event subscription mechanisms are not exported
|
|
664
|
-
* to prevent bypassing the tool's intended usage patterns.
|
|
665
|
-
*/
|
|
666
|
-
|
|
667
|
-
// Check if @tanstack/react-query is installed
|
|
668
|
-
try {
|
|
669
|
-
require("@tanstack/react-query");
|
|
670
|
-
} catch (error) {
|
|
671
|
-
throw new Error("\n\n[@buoy-gg/react-query] ERROR: Missing required peer dependency\n\n" + "This package requires @tanstack/react-query to be installed.\n\n" + "Install it with:\n" + " npm install @tanstack/react-query\n" + " or\n" + " pnpm add @tanstack/react-query\n" + " or\n" + " yarn add @tanstack/react-query\n\n" + "For more information, visit: https://tanstack.com/query/latest\n");
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// =============================================================================
|
|
675
|
-
// PRESET (Primary entry point for users)
|
|
676
|
-
// =============================================================================
|
|
677
|
-
|
|
678
|
-
// =============================================================================
|
|
679
|
-
// QUERY CLIENT CONNECTION (Required for users to connect their QueryClient)
|
|
680
|
-
// =============================================================================
|
|
681
|
-
|
|
682
|
-
// =============================================================================
|
|
683
|
-
// EXTERNAL SYNC (Adapter factory for @buoy-gg/external-sync's useExternalSync)
|
|
684
|
-
// =============================================================================
|
|
685
|
-
|
|
686
|
-
// =============================================================================
|
|
687
|
-
// COMPONENTS (For custom UI implementations)
|
|
688
|
-
// =============================================================================
|
|
689
|
-
|
|
690
|
-
// Main modals
|
|
691
|
-
|
|
692
|
-
// Query browser components
|
|
693
|
-
|
|
694
|
-
// Mode components
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* Connects the event store to the app's QueryClient at startup. Auto-rendered
|
|
698
|
-
* by `FloatingDevTools`; exported so a host that does not use the floating menu
|
|
699
|
-
* can mount it itself.
|
|
700
|
-
*/
|
|
701
|
-
|
|
702
|
-
// Shared data viewer components
|
|
703
|
-
|
|
704
|
-
// =============================================================================
|
|
705
|
-
// HOOKS (For consuming React Query data)
|
|
706
|
-
// =============================================================================
|
|
707
|
-
|
|
708
|
-
// =============================================================================
|
|
709
|
-
// UTILITIES (Public helpers only)
|
|
710
|
-
// =============================================================================
|
|
711
|
-
|
|
712
|
-
// Action utilities
|
|
713
|
-
|
|
714
|
-
// Query status utilities
|
|
715
|
-
|
|
716
|
-
// Storage utilities
|
|
717
|
-
|
|
718
|
-
// Data manipulation utilities
|
|
719
|
-
|
|
720
|
-
// =============================================================================
|
|
721
|
-
// TYPES
|
|
722
|
-
// =============================================================================
|
|
723
|
-
|
|
724
|
-
// =============================================================================
|
|
725
|
-
// INTERNAL EXPORTS (For @buoy-gg/* packages only - not part of public API)
|
|
726
|
-
// =============================================================================
|
|
727
|
-
/** @internal */
|
|
728
|
-
|
|
729
|
-
// =============================================================================
|
|
730
|
-
// NOT EXPORTED (Internal controls)
|
|
731
|
-
// =============================================================================
|
|
732
|
-
// The following are intentionally NOT exported to prevent bypassing:
|
|
733
|
-
// - getReactQueryEvents (internal store access)
|
|
734
|
-
// - subscribeToReactQueryEvents (internal subscription)
|
|
735
|
-
// - clearReactQueryEvents (internal store control)
|
|
736
|
-
// - isReactQueryConnected (internal state query)
|
|
657
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Check if @tanstack/react-query is installed
|
|
4
|
+
try {
|
|
5
|
+
require("@tanstack/react-query");
|
|
6
|
+
} catch (error) {
|
|
7
|
+
throw new Error("\n\n[@buoy-gg/react-query] ERROR: Missing required peer dependency\n\n" + "This package requires @tanstack/react-query to be installed.\n\n" + "Install it with:\n" + " npm install @tanstack/react-query\n" + " or\n" + " pnpm add @tanstack/react-query\n" + " or\n" + " yarn add @tanstack/react-query\n\n" + "For more information, visit: https://tanstack.com/query/latest\n");
|
|
8
|
+
}
|
package/lib/module/index.js
CHANGED
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
* to prevent bypassing the tool's intended usage patterns.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
require("@tanstack/react-query");
|
|
16
|
-
} catch (error) {
|
|
17
|
-
throw new Error("\n\n[@buoy-gg/react-query] ERROR: Missing required peer dependency\n\n" + "This package requires @tanstack/react-query to be installed.\n\n" + "Install it with:\n" + " npm install @tanstack/react-query\n" + " or\n" + " pnpm add @tanstack/react-query\n" + " or\n" + " yarn add @tanstack/react-query\n\n" + "For more information, visit: https://tanstack.com/query/latest\n");
|
|
18
|
-
}
|
|
13
|
+
import './checkPeer';
|
|
19
14
|
|
|
20
15
|
// =============================================================================
|
|
21
16
|
// PRESET (Primary entry point for users)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=checkPeer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkPeer.d.ts","sourceRoot":"","sources":["../../src/checkPeer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkPeer.web.d.ts","sourceRoot":"","sources":["../../src/checkPeer.web.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Internal stores and event subscription mechanisms are not exported
|
|
8
8
|
* to prevent bypassing the tool's intended usage patterns.
|
|
9
9
|
*/
|
|
10
|
+
import './checkPeer';
|
|
10
11
|
export { reactQueryToolPreset, createReactQueryTool, wifiTogglePreset, createWifiToggleTool, } from "./preset";
|
|
11
12
|
export { setQueryClient, disconnectQueryClient, type ReactQueryEvent, type ReactQueryEventType, } from "./react-query/stores/reactQueryEventStore";
|
|
12
13
|
export { createReactQuerySyncAdapter } from "./react-query/sync/reactQuerySyncAdapter";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,aAAa,CAAC;AAKrB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAKlB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,2CAA2C,CAAC;AAKnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,YAAY,EACV,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,GACd,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAGhF,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F;;;;GAIG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAG/E,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,UAAU,GACX,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,gCAAgC,GACjC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAOhE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAGvF,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AAGxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,4CAA4C,CAAC;AAG3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAKpF,YAAY,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAK1D,gBAAgB;AAChB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var yo=Object.defineProperty;var sa=Object.getOwnPropertyDescriptor;var ua=Object.getOwnPropertyNames;var la=Object.prototype.hasOwnProperty;var ca=(e,r)=>{for(var t in r)yo(e,t,{get:r[t],enumerable:!0})},co=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ua(r))!la.call(e,n)&&n!==t&&yo(e,n,{get:()=>r[n],enumerable:!(o=sa(r,n))||o.enumerable});return e},R=(e,r,t)=>(co(e,r,"default"),t&&co(t,r,"default"));typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import"@tanstack/react-query";import{QueryIcon as In}from"@buoy-gg/floating-tools-core/web";import{Wifi as Pn}from"@buoy-gg/shared-ui/web";import{useCallback as _e,useState as At,useEffect as Uu}from"react";import{useQueryClient as Gu}from"@tanstack/react-query";import{TickProvider as Ju}from"@buoy-gg/shared-ui/web";import{useQueryClient as js}from"@tanstack/react-query";import{JsModal as Xs,useSafeAreaInsets as Ys,ModalHeader as Or,TabSelector as Zs}from"@buoy-gg/shared-ui/web";import{useEffect as da,useState as ya,useRef as fa}from"react";import{useQueryClient as pa}from"@tanstack/react-query";function mr(e){let{query:r}=Ft(e);return r}function Ft(e){let r=pa(),[t,o]=ya({query:void 0,version:0}),n=fa(void 0);return da(()=>{if(!e){o({query:void 0,version:0}),n.current=void 0;return}let a=r.getQueryCache().find({queryKey:e,exact:!0});o({query:a,version:0});let u=JSON.stringify(e);n.current=u;let i=r.getQueryCache().subscribe(s=>{(s.type==="updated"||s.type==="added"||s.type==="removed")&&"query"in s&&s.query&&JSON.stringify(s.query.queryKey)===n.current&&(s.type==="removed"?o({query:void 0,version:0}):o(d=>({query:s.query,version:d.version+1})))});return()=>i()},[r,e]),t}import{ModalHeader as Fe,TabSelector as ho,Search as yi,Filter as fi,Trash as pi,night as Ue}from"@buoy-gg/shared-ui/web";import{useState as mi,useRef as bo,useEffect as gi}from"react";var x={};ca(x,{AccessibilityInfo:()=>ka,ActivityIndicator:()=>Ca,Alert:()=>Qa,Animated:()=>X,AppRegistry:()=>Da,AppState:()=>Ra,Appearance:()=>Aa,BackHandler:()=>Ea,Button:()=>xa,CheckBox:()=>$a,Clipboard:()=>Ia,DeviceEventEmitter:()=>ii,Dimensions:()=>br,Easing:()=>Pa,FlatList:()=>dt,I18nManager:()=>qa,Image:()=>_a,ImageBackground:()=>Ua,InteractionManager:()=>Fa,Keyboard:()=>Va,KeyboardAvoidingView:()=>Ga,LayoutAnimation:()=>Ba,Linking:()=>Oa,LogBox:()=>ai,Modal:()=>hr,NativeEventEmitter:()=>Ka,NativeModules:()=>Ta,PanResponder:()=>ct,Picker:()=>Ja,PixelRatio:()=>La,Platform:()=>Ha,Pressable:()=>gr,ProgressBar:()=>ja,RefreshControl:()=>Xa,SafeAreaView:()=>Ya,ScrollView:()=>z,SectionList:()=>Za,Share:()=>Wa,StatusBar:()=>ei,StyleSheet:()=>w,Switch:()=>wa,Text:()=>b,TextInput:()=>ha,Touchable:()=>ti,TouchableHighlight:()=>ba,TouchableNativeFeedback:()=>ri,TouchableOpacity:()=>E,TouchableWithoutFeedback:()=>Sa,UIManager:()=>za,Vibration:()=>Na,View:()=>y,VirtualizedList:()=>oi,YellowBox:()=>ni,findNodeHandle:()=>Ma,unstable_createElement:()=>va,useColorScheme:()=>si,useLocaleContext:()=>ui,useWindowDimensions:()=>li});R(x,uc);import*as uc from"react-native-web";import{unstable_createElement as va,NativeModules as Ta,AccessibilityInfo as ka,Animated as X,Appearance as Aa,AppRegistry as Da,AppState as Ra,BackHandler as Ea,Clipboard as Ia,Dimensions as br,Easing as Pa,I18nManager as qa,Keyboard as Va,InteractionManager as Fa,LayoutAnimation as Ba,Linking as Oa,NativeEventEmitter as Ka,PanResponder as ct,PixelRatio as La,Platform as Ha,Share as Wa,StyleSheet as w,UIManager as za,Vibration as Na,CheckBox as $a,FlatList as dt,Image as _a,ImageBackground as Ua,KeyboardAvoidingView as Ga,Picker as Ja,ProgressBar as ja,RefreshControl as Xa,SafeAreaView as Ya,SectionList as Za,StatusBar as ei,Touchable as ti,TouchableNativeFeedback as ri,VirtualizedList as oi,YellowBox as ni,LogBox as ai,DeviceEventEmitter as ii,useColorScheme as si,useLocaleContext as ui,useWindowDimensions as li}from"react-native-web";import*as k from"react-native-web";import{createElement as ma,forwardRef as ga}from"react";function oe(e){let r=ga((o,n)=>{let{accessibilityState:a,accessibilityValue:u,...i}=o;for(let s of["busy","checked","disabled","expanded","selected"])a?.[s]!==void 0&&i[`aria-${s}`]===void 0&&(i[`aria-${s}`]=a[s]);for(let[s,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))u?.[s]!==void 0&&i[`aria-${c}`]===void 0&&(i[`aria-${c}`]=u[s]);return ma(e,{...i,ref:n})}),t=e.State;return t&&Object.assign(r,{State:t}),r.displayName=e.displayName??e.name??"NativeWebView",r}var y=oe(k.View),b=oe(k.Text),ha=oe(k.TextInput),E=oe(k.TouchableOpacity),ba=oe(k.TouchableHighlight),Sa=oe(k.TouchableWithoutFeedback),gr=oe(k.Pressable),z=oe(k.ScrollView),hr=oe(k.Modal),wa=oe(k.Switch),Ca=oe(k.ActivityIndicator),xa=oe(k.Button),Ma=k.findNodeHandle,Qa={alert(e,r,t,o){if(typeof document>"u")return;let n=document.createElement("dialog");n.dataset.buoyRoot="",n.setAttribute("aria-label",e),n.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 a=document.createElement("h2");if(a.textContent=e,a.style.cssText="font-size:18px;margin:0 0 12px",n.appendChild(a),r){let c=document.createElement("p");c.textContent=r,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",n.appendChild(c)}let u=document.createElement("div");u.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let i=t?.length?t:[{text:"OK"}],s=()=>{n.close?.(),n.remove()};for(let c of i){let l=document.createElement("button");l.type="button",l.textContent=c.text??"OK",l.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,l.onclick=()=>{s(),c.onPress?.()},u.appendChild(l)}n.addEventListener("cancel",c=>{c.preventDefault(),o?.cancelable!==!1&&(s(),o?.onDismiss?.())}),n.appendChild(u),document.body.appendChild(n),n.showModal?n.showModal():n.setAttribute("open","")}};import{Wifi as go}from"@buoy-gg/shared-ui/web";import{useEffect as fo,useState as ci,useRef as di}from"react";import{onlineManager as Bt}from"@tanstack/react-query";import{devToolsStorageKeys as po,persistentStorage as mo}from"@buoy-gg/shared-ui/web";function Sr(){let[e,r]=ci(()=>Bt.isOnline()),t=di(!1);fo(()=>{if(t.current)return;(async()=>{try{let u=await mo.getItem(po.settings.wifiEnabled());if(u!==null){let i=u==="true";r(i),Bt.setOnline(i)}t.current=!0}catch{}})()},[]);let o=async a=>{try{await mo.setItem(po.settings.wifiEnabled(),a.toString())}catch{}},n=()=>{let a=!e;r(a),Bt.setOnline(a),o(a)};return fo(()=>Bt.subscribe(u=>{r(u),t.current&&o(u)}),[]),{isOnline:e,handleWifiToggle:n}}import{jsx as wr}from"react/jsx-runtime";function Cr({size:e=16,testID:r}){let{isOnline:t,handleWifiToggle:o}=Sr();return wr(E,{"sentry-label":`ignore toggle WiFi ${t?"On":"Off"}`,testID:r,accessibilityRole:"button",accessibilityLabel:`WiFi ${t?"On":"Off"}`,accessibilityHint:`Tap to turn WiFi ${t?"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:t?wr(go,{size:e,color:"#10B981"}):wr(go,{size:e,color:"#DC2626"})})}import{jsx as Y,jsxs as Ot}from"react/jsx-runtime";function Se({selectedQuery:e,selectedMutation:r,activeTab:t,onTabChange:o,onBack:n,searchText:a="",onSearchChange:u,onFilterPress:i,hasActiveFilters:s=!1,onClearCache:c,showWifiToggle:l=!1}){let[d,p]=mi(!1),h=bo(!1),f=bo(null);gi(()=>{d&&f.current&&f.current.focus()},[d]);let m=()=>{p(!d),d&&u&&u("")},Q=M=>{u&&u(M)},C=M=>M?.queryKey&&(Array.isArray(M.queryKey)?M.queryKey:[M.queryKey]).filter(A=>A!=null).map(A=>String(A)).join(" \u203A ")||"Unknown Query",S=M=>"queryKey"in M?C(M):M.options.mutationKey?(Array.isArray(M.options.mutationKey)?M.options.mutationKey:[M.options.mutationKey]).filter(T=>T!=null).map(T=>String(T)).join(" \u203A ")||`Mutation #${M.mutationId}`:`Mutation #${M.mutationId}`,v=[{key:"queries",label:"Queries"},{key:"mutations",label:"Mutations"}];return e||r?Ot(Fe,{children:[Y(Fe.Navigation,{onBack:n}),Y(Fe.Content,{title:S(e??r),testID:"buoy-rq-detail-title"})]}):Ot(Fe,{children:[Y(Fe.Content,{title:"",noMargin:!0,children:d?Y(Fe.Search,{value:a,onChangeText:Q,onCancel:()=>{Q(""),p(!1)},onDismiss:()=>p(!1),dismissOnBlur:!0,clearOnlyWhenText:!0,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"}}):l?Ot(y,{style:Be.tabRow,children:[Y(y,{style:Be.tabSelectorWrap,children:Y(ho,{tabs:v,activeTab:t,testIDPrefix:"buoy-rq-tab",onTabChange:M=>o(M)})}),Y(Cr,{size:16,testID:"buoy-rq-wifi"})]}):Y(ho,{tabs:v,activeTab:t,testIDPrefix:"buoy-rq-tab",onTabChange:M=>o(M)})}),Ot(Fe.Actions,{children:[Y(E,{"sentry-label":"ignore open search",testID:"buoy-rq-search-open",accessibilityRole:"button",accessibilityLabel:"Search queries and mutations",onPress:m,style:Be.headerActionButton,children:Y(yi,{size:14,color:Ue.color.textSecondary})}),i&&Y(E,{"sentry-label":"ignore open filter",testID:"buoy-rq-filters",accessibilityRole:"button",accessibilityLabel:s?"Filters, active":"Filters",onPress:i,style:[Be.headerActionButton,s&&Be.activeFilterButton],children:Y(fi,{size:14,color:s?Ue.color.accent:Ue.color.textSecondary})}),c&&Y(E,{"sentry-label":"ignore clear cache",testID:"buoy-rq-clear-cache",accessibilityRole:"button",onPress:c,style:[Be.headerActionButton,Be.clearCacheButton],accessibilityLabel:`Clear ${t} cache`,children:Y(pi,{size:14,color:Ue.color.warning})})]})]})}var Be=w.create({tabRow:{flex:1,flexDirection:"row",alignItems:"center",gap:12},tabSelectorWrap:{flex:1},headerActionButton:{padding:6,borderRadius:4},activeFilterButton:{backgroundColor:Ue.color.accentSoft},clearCacheButton:{backgroundColor:Ue.color.warningSoft}});import{resolveListEmptyState as Os}from"@buoy-gg/shared-ui/web";import{useMemo as Ks}from"react";import{useMemo as hi}from"react";import{useQueryClient as bi}from"@tanstack/react-query";var Ge=(e,r,t)=>{if(r.length===0)return t;if(e instanceof Map){let o=new Map(e);if(r.length===1)return o.set(r[0],t),o;let[n,...a]=r,u=o.get(n);return o.set(n,Ge(u??null,a,t)),o}if(e instanceof Set){let o=Ge(Array.from(e),r,t);return new Set(Array.isArray(o)?o:[])}if(Array.isArray(e)){let o=[...e];if(r.length===1)return o[r[0]]=t,o;let[n,...a]=r;return o[n]=Ge(o[n],a,t),o}if(e instanceof Object){let o={...e};if(r.length===1)return o[r[0]]=t,o;let[n,...a]=r;return o[n]=Ge(o[n],a,t),o}return e};var Je=(e,r)=>{if(e instanceof Map){let t=new Map(e);if(r.length===1)return t.delete(r[0]),t;let[o,...n]=r;return t.set(o,Je(t.get(o),n)),t}if(e instanceof Set){let t=Je(Array.from(e),r);return new Set(t)}if(Array.isArray(e)){let t=[...e];if(r.length===1)return t.filter((a,u)=>u.toString()!==r[0]);let[o,...n]=r;return t[o]=Je(t[o],n),t}if(e instanceof Object){let t={...e};if(r.length===1)return delete t[r[0]],t;let[o,...n]=r;return t[o]=Je(t[o],n),t}return e};function Kt({activeQuery:e,dataPath:r,queryClient:t}){if(!r)return;let o=e.state.data,n=Je(o,r),a=JSON.parse(JSON.stringify(n));t.setQueryData(e.queryKey,a)}function So(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function wo(e){return(Array.isArray(e)?e:[e]).filter(t=>t!=null).map(So).filter(Boolean).join("-")||"unkeyed"}function Co(e){return`buoy-rq-query-row-${wo(e)}`}function xo(e,r){return e==null?`buoy-rq-mutation-row-id-${r}`:`buoy-rq-mutation-row-${wo(e)}`}function Mo(e){return e.length===0?"buoy-rq-explorer-root":`buoy-rq-explorer-${e.map(So).filter(Boolean).join("-")}`}import{LiveExplorer as Si}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as wi}from"react/jsx-runtime";function N({editable:e,label:r,value:t,defaultExpanded:o,activeQuery:n,dataPath:a,itemsDeletable:u,dataVersion:i=0}){let s=bi(),c=hi(()=>{if(n)return{update:(l,d)=>{let p=n.state.data,h=Ge(p,l,d);s.setQueryData(n.queryKey,h)},remove:l=>{Kt({queryClient:s,activeQuery:n,dataPath:l})}}},[s,n]);return wi(Si,{editable:e,label:r,value:t,defaultExpanded:o,writer:c,dataPath:a,itemsDeletable:u,dataVersion:i,testIDForPath:Mo,debounceMs:0})}import{useMemo as Pi,useCallback as qi}from"react";import{memo as Ci}from"react";function V(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 xi,buoyColors as Qe,useRelativeTime as Mi}from"@buoy-gg/shared-ui/web";import{jsx as Ti}from"react/jsx-runtime";var Qi=e=>e?.queryKey&&(Array.isArray(e.queryKey)?e.queryKey:[e.queryKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Query",vi=Ci(function({query:r,isSelected:t,onSelect:o}){let n=f=>{switch(f){case"disabled":return Qe.textMuted+"80";case"error":return Qe.error;case"fresh":return Qe.success;case"stale":return Qe.warning;case"inactive":return Qe.textMuted;case"fetching":return Qe.primary;case"paused":return Qe.textMuted;default:return Qe.textSecondary}},a=V(r),u=r.getObserversCount(),i=r.isDisabled(),s=Qi(r),c=(()=>{if(i)return null;if(r.state.dataUpdatedAt&&r.state.dataUpdatedAt>0)return r.state.dataUpdatedAt;let f=r.state;return f.fetchedAt&&f.fetchedAt>0?f.fetchedAt:null})(),l=Mi(c),d=i?"Disabled":l||(r.state.dataUpdatedAt===0?"Not fetched":`N/A (${r.state.dataUpdatedAt||0})`),p=Co(r.queryKey),h=`${u} observer${u!==1?"s":""}`;return Ti(xi,{testID:p,statusTestID:`${p}-status`,statusSublabelTestID:`${p}-observers`,accessibilityLabel:`${s}, ${a}, ${h}`,statusDotColor:n(a),statusLabel:a.charAt(0).toUpperCase()+a.slice(1),statusSublabel:h,primaryText:s,bottomRightText:d,badgeText:u,badgeColor:n(a),isSelected:t,onPress:()=>o(r)})}),Lt=vi;import{useEffect as ki,useState as Ai,useRef as Ao,useMemo as Di,useCallback as Do}from"react";import{useQueryClient as Ri}from"@tanstack/react-query";import{buoyColors as Ht}from"@buoy-gg/shared-ui/web";var we={base:()=>["#storage"],mmkv:{root:()=>[...we.base(),"mmkv"],key:e=>[...we.mmkv.root(),e],all:()=>[...we.mmkv.root(),"all"]},async:{root:()=>[...we.base(),"async"],key:e=>[...we.async.root(),e],all:()=>[...we.async.root(),"all"]},secure:{root:()=>[...we.base(),"secure"],key:e=>[...we.secure.root(),e],all:()=>[...we.secure.root(),"all"]}};function pe(e){return!Array.isArray(e)||e.length===0?!1:e[0]==="#storage"}function Qo(e){if(!pe(e)||e.length<2)return null;let r=e[1];return r==="mmkv"||r==="async"||r==="secure"?r:null}function vo(e){switch(e){case"mmkv":return"MMKV";case"async":return"Async";case"secure":return"Secure";default:return e}}function To(e){switch(e){case"mmkv":return"purple";case"async":return"blue";case"secure":return"green";default:return"gray"}}function id(e){switch(e){case"mmkv":return Ht.primary;case"async":return Ht.warning;case"secure":return Ht.success;default:return Ht.textMuted}}function ko(e){return!pe(e)||e.length<3?"Unknown Storage Key":e.slice(2).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Storage Key"}var Wt=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,Ei=(e,r)=>e.state.dataUpdatedAt<r.state.dataUpdatedAt?1:-1,Ro=(e,r)=>Wt(e)===Wt(r)?Ei(e,r):Wt(e)>Wt(r)?1:-1;function Ii(){let e=Ri(),[r,t]=Ai(()=>e.getQueryCache().getAll().filter(s=>!pe(s.queryKey)).sort(Ro)),o=Ao(new Map),n=Ao(void 0),a=Do(i=>{let s=o.current;if(i.length!==s.size)return!0;for(let c of i){let l=s.get(c.queryHash);if(!l||l.dataUpdatedAt!==c.state.dataUpdatedAt||l.errorUpdatedAt!==c.state.errorUpdatedAt||l.fetchStatus!==c.state.fetchStatus||l.status!==c.state.status||l.isInvalidated!==c.state.isInvalidated)return!0}return!1},[]),u=Do(()=>{let s=e.getQueryCache().getAll().filter(c=>!pe(c.queryKey));if(a(s)){let c=new Map;s.forEach(d=>{c.set(d.queryHash,d.state)}),o.current=c;let l=[...s].sort(Ro);t(l)}},[e,a]);return ki(()=>{u();let i=e.getQueryCache().subscribe(s=>{if(s.type==="added"||s.type==="removed"||s.type==="updated"){if("query"in s&&s.query&&pe(s.query.queryKey))return;n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{u()},10)}});return()=>{i(),n.current&&clearTimeout(n.current)}},[e,u]),Di(()=>r,[r])}var Oe=Ii;import{night as xr,ToolEmptyState as Vi,EVENT_LIST_PRESET as Fi,monoFont as Bi}from"@buoy-gg/shared-ui/web";import{jsx as Mr}from"react/jsx-runtime";function yt({selectedQuery:e,onQuerySelect:r,activeFilter:t,emptyStateMessage:o,emptyState:n,contentContainerStyle:a,queries:u,searchText:i="",ignoredPatterns:s=new Set,includedPatterns:c=new Set}){let l=Oe(),d=u??l,p=Pi(()=>{let f=d;if(t&&(f=f.filter(m=>V(m)===t)),i){let m=i.toLowerCase();f=f.filter(Q=>Q?.queryKey?(Array.isArray(Q.queryKey)?Q.queryKey:[Q.queryKey]).filter(v=>v!=null).map(v=>String(v)).join(" ").toLowerCase().includes(m):!1)}return c.size>0&&(f=f.filter(m=>{if(!m?.queryKey)return!1;let C=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(S=>S!=null).map(S=>String(S)).join(" ").toLowerCase();return Array.from(c).some(S=>C.includes(S.toLowerCase()))})),s.size>0&&(f=f.filter(m=>{if(!m?.queryKey)return!0;let C=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(S=>S!=null).map(S=>String(S)).join(" ").toLowerCase();return!Array.from(s).some(S=>C.includes(S.toLowerCase()))})),f.sort((m,Q)=>{let C=m.state.dataUpdatedAt||0;return(Q.state.dataUpdatedAt||0)-C}),f},[d,t,i,c,s]),h=qi(f=>{if(e?.queryHash===f.queryHash){r(void 0);return}r(f)},[e?.queryHash,r]);return p.length===0?Mr(Vi,{testID:"buoy-rq-empty",...n??{otto:"empty",title:"No queries found",message:o||(t?`No ${t} queries found`:"No queries found")}}):Mr(dt,{testID:"buoy-rq-query-list",style:Eo.listWrapper,contentContainerStyle:a||Eo.listContent,data:p,keyExtractor:Oi,renderItem:({item:f})=>Mr(Lt,{query:f,stateSig:Ki(f),isSelected:e?.queryHash===f.queryHash,onSelect:h}),showsVerticalScrollIndicator:!0,...Fi})}var Oi=e=>e.queryHash;function Ki(e){let r=0,t=!1;try{r=e.getObserversCount(),t=e.isStale()}catch{}return`${e.state.dataUpdatedAt}|${e.state.fetchStatus}|${e.state.status}|${r}|${t}`}var Eo=w.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:xr.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:xr.color.border},emptyText:{color:xr.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Bi,letterSpacing:.5}});import{buoyColors as I,monoFont as Li}from"@buoy-gg/shared-ui/web";import{jsx as Po}from"react/jsx-runtime";var Hi={fresh:I.success+"15",stale:I.warning+"15",fetching:I.primary+"15",paused:I.textMuted+"1A",noObserver:I.textMuted+"1A",error:I.error+"15",inactive:I.textMuted+"1A"},Wi={fresh:I.success+"33",stale:I.warning+"33",fetching:I.primary+"33",paused:I.textMuted+"33",noObserver:I.textMuted+"33",error:I.error+"33",inactive:I.textMuted+"33"},zi={fresh:I.success,stale:I.warning,fetching:I.primary,paused:I.textMuted,noObserver:I.textMuted,error:I.error,inactive:I.textMuted};function ft({query:e,testID:r}){let t=V(e),o=Hi[t],n=Wi[t],a=zi[t];return Po(y,{style:[Io.container,{backgroundColor:o,borderColor:n}],children:Po(b,{testID:r,style:[Io.text,{color:a}],children:t})})}var Io=w.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:Li}});import{displayValue as Ni,night as ne,monoFont as zt}from"@buoy-gg/shared-ui/web";import{jsx as ve,jsxs as Nt}from"react/jsx-runtime";function Ke({query:e}){if(e===void 0)return null;let r=new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0});return Nt(y,{style:de.minWidth,children:[ve(b,{style:de.headerText,children:"Query Details"}),Nt(y,{style:de.row,children:[ve(z,{"sentry-label":"ignore devtools query details scroll",horizontal:!0,style:de.flexOne,children:ve(b,{testID:"buoy-rq-detail-key",style:de.queryKeyText,children:Ni(e.queryKey,!0)})}),ve(ft,{query:e,testID:"buoy-rq-detail-status"})]}),Nt(y,{style:de.row,children:[ve(b,{style:de.labelText,children:"Observers:"}),ve(b,{testID:"buoy-rq-detail-observers",style:de.valueText,children:`${e.getObserversCount()}`})]}),Nt(y,{style:de.row,children:[ve(b,{style:de.labelText,children:"Last Updated:"}),ve(b,{testID:"buoy-rq-detail-updated",style:de.valueText,children:`${r}`})]})]})}var de=w.create({minWidth:{minWidth:200,backgroundColor:ne.color.surface,borderRadius:6,borderWidth:1,borderColor:ne.color.accent+"4D",overflow:"hidden",shadowColor:ne.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:ne.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:ne.color.accent,borderBottomWidth:1,borderBottomColor:ne.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:zt},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:ne.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:ne.color.text,fontFamily:zt,lineHeight:18,flexShrink:1,backgroundColor:ne.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:ne.color.accent+"4D"},labelText:{fontSize:10,color:ne.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:zt},valueText:{fontSize:12,color:ne.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:zt}});import{useQueryClient as Gi}from"@tanstack/react-query";import{night as P}from"@buoy-gg/shared-ui/web";import{jsx as qo,jsxs as _i}from"react/jsx-runtime";var $i={refetch:{dotColor:P.color.accent,textColor:P.color.text,borderColor:P.color.border},invalidate:{dotColor:P.color.warning,textColor:P.color.text,borderColor:P.color.border},reset:{dotColor:P.color.textSecondary,textColor:P.color.text,borderColor:P.color.border},remove:{dotColor:P.color.danger,textColor:P.color.danger,borderColor:P.color.danger+"40"},triggerLoading:{dotColor:P.color.info,textColor:P.color.info,borderColor:P.color.info+"40"},triggerError:{dotColor:P.color.danger,textColor:P.color.danger,borderColor:P.color.danger+"40"}};function $({onClick:e,text:r,variant:t,disabled:o,testID:n}){let a=$i[t];return _i(E,{"sentry-label":"ignore devtools action button",testID:n,disabled:o,onPress:e,style:[Qr.button,{borderColor:o?P.color.border:a.borderColor,opacity:o?.4:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:r,accessibilityState:{disabled:o},children:[qo(y,{style:[Qr.dot,{backgroundColor:o?P.color.textTertiary:a.dotColor}]}),qo(b,{style:[Qr.text,{color:o?P.color.textTertiary:a.textColor}],children:r})]})}var Qr=w.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 Ui="@tanstack/query-devtools-event";function Z(e,r){try{let t=globalThis;if(typeof t.dispatchEvent!="function"||typeof t.CustomEvent!="function")return;t.dispatchEvent(new t.CustomEvent(Ui,{detail:{type:e,queryHash:r},bubbles:!0,cancelable:!0}))}catch{}}function je({query:e}){if(e.state.data===void 0){Z("RESTORE_LOADING",e.queryHash);let r=e.state,t=e.state.fetchMeta?e.state.fetchMeta.__previousQueryOptions:null;e.cancel({silent:!0}),e.setState({...r,fetchStatus:"idle",fetchMeta:null}),t&&e.fetch(t)}else{Z("TRIGGER_LOADING",e.queryHash);let r=e.options;e.fetch({...r,queryFn:()=>new Promise(()=>{}),gcTime:-1}),e.setState({data:void 0,status:"pending",fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:r}})}}function Xe({query:e}){Z("REFETCH",e.queryHash),e.fetch().catch(()=>{})}function $t({query:e,queryClient:r}){Z("RESET",e.queryHash),r.resetQueries({queryKey:e.queryKey,exact:!0})}function _t({query:e,queryClient:r}){Z("REMOVE",e.queryHash),r.removeQueries(e)}function Ut({query:e,queryClient:r}){Z("INVALIDATE",e.queryHash),r.invalidateQueries(e)}function Ye({query:e,queryClient:r}){if(e.state.status!=="error"){Z("TRIGGER_ERROR",e.queryHash);let t=new Error("Unknown error from devtools"),o=e.options;e.setState({status:"error",error:t,fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:o}})}else Z("RESTORE_ERROR",e.queryHash),r.resetQueries(e)}import{night as Ji}from"@buoy-gg/shared-ui/web";import{jsx as Te,jsxs as pt}from"react/jsx-runtime";function mt({query:e,setSelectedQuery:r}){let t=Gi();if(e===void 0)return null;let o=e.state.status,n=V(e)==="fetching";return pt(y,{style:Le.container,children:[pt(y,{style:Le.section,children:[Te(b,{style:Le.sectionLabel,children:"Actions"}),pt(y,{style:Le.buttonsRow,children:[Te($,{disabled:n,onClick:()=>Xe({query:e}),variant:"refetch",text:"Refetch"}),Te($,{disabled:o==="pending",onClick:()=>Ut({query:e,queryClient:t}),variant:"invalidate",text:"Invalidate"}),Te($,{disabled:o==="pending",onClick:()=>$t({queryClient:t,query:e}),variant:"reset",text:"Reset"}),Te($,{disabled:n,onClick:()=>{_t({queryClient:t,query:e}),r(void 0)},variant:"remove",text:"Remove"})]})]}),pt(y,{style:Le.section,children:[Te(b,{style:Le.sectionLabel,children:"Triggers"}),pt(y,{style:Le.buttonsRow,children:[Te($,{disabled:!1,onClick:()=>je({query:e}),variant:"triggerLoading",text:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading"}),Te($,{disabled:o==="pending",onClick:()=>Ye({query:e,queryClient:t}),variant:"triggerError",text:o==="error"?"Restore Error":"Trigger Error"})]})]})]})}var Le=w.create({container:{gap:16},section:{gap:8},sectionLabel:{fontSize:11,fontWeight:"600",color:Ji.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},buttonsRow:{flexDirection:"row",flexWrap:"wrap",gap:8}});import{night as vr}from"@buoy-gg/shared-ui/web";import{jsx as ge,jsxs as Tr}from"react/jsx-runtime";function kr({selectedQuery:e,setSelectedQuery:r}){return Tr(z,{"sentry-label":"ignore devtools query info scroll",style:me.flexOne,contentContainerStyle:me.scrollContent,children:[ge(y,{style:me.section,children:ge(Ke,{query:e})}),ge(y,{style:me.section,children:ge(mt,{query:e,setSelectedQuery:r})}),Tr(y,{style:me.section,children:[ge(b,{style:me.headerText,children:"Data Explorer"}),ge(y,{style:me.contentView,children:ge(N,{editable:!0,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),Tr(y,{style:me.section,children:[ge(b,{style:me.headerText,children:"Query Explorer"}),ge(y,{style:me.contentView,children:ge(N,{label:"Query",value:e,defaultExpanded:["Query","queryKey"],activeQuery:e})})]})]})}var me=w.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:vr.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:vr.color.surface,borderRadius:12,borderWidth:1,borderColor:vr.color.border,padding:16}});import{buoyColors as H,night as ye}from"@buoy-gg/shared-ui/web";import{jsx as Ar,jsxs as Xi}from"react/jsx-runtime";var ji=({label:e,color:r,count:t,showLabel:o=!0,isActive:n=!1,onPress:a,onTouchStart:u,size:i="default",testID:s})=>{let c=i==="large",d=(p=>{let h={green:{bg:H.success+"15",border:H.success+"40",dot:H.success,text:H.success},yellow:{bg:H.warning+"15",border:H.warning+"40",dot:H.warning,text:H.warning},blue:{bg:H.primary+"15",border:H.primary+"40",dot:H.primary,text:H.primary},purple:{bg:ye.color.fillSecondary,border:ye.color.fillTertiary,dot:ye.color.textTertiary,text:ye.color.textTertiary},red:{bg:H.error+"15",border:H.error+"40",dot:H.error,text:H.error},gray:{bg:ye.color.fillSecondary,border:ye.color.fillTertiary,dot:ye.color.textTertiary,text:ye.color.textTertiary}};return h[p]||h.gray})(r);return Xi(E,{"sentry-label":"ignore devtools query status",testID:s,accessibilityRole:"button",accessibilityLabel:`${e}, ${t}${n?", selected":""}`,accessibilityState:{selected:n},style:[ke.queryStatusTag,c&&ke.queryStatusTagLarge,n&&{backgroundColor:d.bg,borderColor:d.border}],disabled:!a,onPress:a,onPressIn:u,activeOpacity:.7,children:[Ar(y,{style:[ke.dot,c&&ke.dotLarge,{backgroundColor:d.dot}]}),o&&Ar(b,{style:[ke.label,c&&ke.labelLarge,n&&{color:d.text}],numberOfLines:1,ellipsizeMode:"tail",children:e}),t>0&&Ar(b,{testID:s?`${s}-count`:void 0,style:[ke.count,c&&ke.countLarge,{color:d.dot}],numberOfLines:1,children:t})]})},ke=w.create({queryStatusTag:{flexDirection:"row",alignItems:"center",backgroundColor:ye.color.buttonSurface,borderRadius:13,paddingHorizontal:10,paddingVertical:5,height:26,gap:6,borderWidth:1,borderColor:ye.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:ye.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'}}),_=ji;import{ChipStrip as Zi,useChipTap as es}from"@buoy-gg/shared-ui/web";import{useEffect as Vo,useState as Fo}from"react";import{useQueryClient as Bo}from"@tanstack/react-query";function Yi(){let e=Bo(),[r,t]=Fo({fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});return Vo(()=>{let o=()=>{let u=e.getQueryCache().getAll().reduce((i,s)=>{let c=V(s);return i[c]=(i[c]||0)+1,i},{fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});setTimeout(()=>t(u),0)};o();let n=e.getQueryCache().subscribe(o);return()=>n()},[e]),r}var Dr=Yi;function Oo(){let e=Bo(),[r,t]=Fo({pending:0,success:0,error:0,paused:0,idle:0});return Vo(()=>{let o=()=>{let u=e.getMutationCache().getAll().reduce((i,s)=>{let c=s.state.status;if(s.state.isPaused)i.paused++;else switch(c){case"idle":i.idle++;break;case"pending":i.pending++;break;case"success":i.success++;break;case"error":i.error++;break}return i},{pending:0,success:0,error:0,paused:0,idle:0});setTimeout(()=>t(u),0)};o();let n=e.getMutationCache().subscribe(o);return()=>n()},[e]),r}import{jsx as gt,jsxs as rs}from"react/jsx-runtime";var ts=({activeFilter:e,onFilterChange:r,size:t="default"})=>{let{fresh:o,stale:n,fetching:a,paused:u,inactive:i}=Dr(),{scrollProps:s,onTouchStart:c,isTap:l}=es(),d=(p,h)=>{l(h)&&r&&r(e===p?null:p)};return rs(Zi,{scrollProps:s,sentryLabel:"ignore devtools query status count scroll",children:[gt(_,{label:"Fresh",color:"green",count:o,isActive:e==="fresh",onPress:p=>d("fresh",p),onTouchStart:c,testID:"buoy-rq-status-fresh",showLabel:!0,size:t}),gt(_,{label:"Loading",color:"blue",count:a,isActive:e==="fetching",onPress:p=>d("fetching",p),onTouchStart:c,testID:"buoy-rq-status-fetching",showLabel:!0,size:t}),gt(_,{label:"Paused",color:"purple",count:u,isActive:e==="paused",onPress:p=>d("paused",p),onTouchStart:c,testID:"buoy-rq-status-paused",showLabel:!0,size:t}),gt(_,{label:"Stale",color:"yellow",count:n,isActive:e==="stale",onPress:p=>d("stale",p),onTouchStart:c,testID:"buoy-rq-status-stale",showLabel:!0,size:t}),gt(_,{label:"Idle",color:"gray",count:i,isActive:e==="inactive",onPress:p=>d("inactive",p),onTouchStart:c,testID:"buoy-rq-status-inactive",showLabel:!0,size:t})]})},Gt=ts;import{useState as ws,useRef as Ir,useMemo as Cs,useCallback as xs}from"react";import{QueryIcon as os,CheckCircle as ns,Activity as as,Pause as is,XCircle as ss,buoyColors as Jt}from"@buoy-gg/shared-ui/web";import{jsx as ht}from"react/jsx-runtime";function Ko({size:e=24}){return ht(os,{size:e})}function Lo({size:e=14,color:r=Jt.success,strokeWidth:t=2}){return ht(ns,{size:e,color:r,strokeWidth:t})}function Ho({size:e=14,color:r=Jt.warning,strokeWidth:t=2}){return ht(as,{size:e,color:r,strokeWidth:t})}function Wo({size:e=14,color:r=Jt.textMuted,strokeWidth:t=2}){return ht(is,{size:e,color:r,strokeWidth:t})}function zo({size:e=14,color:r=Jt.error,strokeWidth:t=2}){return ht(ss,{size:e,color:r,strokeWidth:t})}import{buoyColors as bt,night as He,useRelativeTime as us,monoFont as No}from"@buoy-gg/shared-ui/web";import{jsx as fe,jsxs as jt}from"react/jsx-runtime";var ls=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 St({mutation:e,setSelectedMutation:r,selected:t}){let o=new Date(e.state.submittedAt).toLocaleTimeString(),n=(()=>{if(e.state.submittedAt&&e.state.submittedAt>0)return e.state.submittedAt;let d=e.state;return d.updatedAt&&d.updatedAt>0?d.updatedAt:null})(),u=us(n)||`N/A (${e.state.submittedAt||0})`,s=(()=>{if(e.state.isPaused)return{status:"Paused",color:bt.textMuted,icon:fe(Wo,{})};switch(e.state.status){case"success":return{status:"Success",color:bt.success,icon:fe(Lo,{})};case"error":return{status:"Error",color:bt.error,icon:fe(zo,{})};case"pending":return{status:"Loading",color:bt.primary,icon:fe(Ho,{})};default:return{status:"Idle",color:bt.textMuted,icon:null}}})(),c=ls(e),l=xo(e.options.mutationKey,e.mutationId);return jt(E,{"sentry-label":"ignore devtools mutation button",testID:l,accessibilityRole:"button",accessibilityLabel:`${c}, ${s.status}`,onPress:()=>r(e===t?void 0:e),style:[ae.button,t?.mutationId===e.mutationId&&ae.selected],children:[jt(y,{style:ae.rowContent,children:[jt(y,{style:ae.statusSection,children:[fe(y,{style:[ae.statusDot,{backgroundColor:s.color}]}),jt(y,{style:ae.statusInfo,children:[fe(b,{testID:`${l}-status`,style:[ae.statusLabel,{color:s.color}],children:s.status}),fe(b,{style:ae.submittedText,children:o})]})]}),fe(y,{style:ae.mutationSection,children:fe(b,{testID:`${l}-key`,style:ae.mutationKey,children:c})})]}),fe(y,{style:ae.bottomRightContainer,children:fe(b,{style:ae.bottomRightText,children:u})})]})}var ae=w.create({button:{backgroundColor:He.color.surface,borderRadius:8,borderWidth:1,borderColor:He.color.border,marginHorizontal:8,marginVertical:3,padding:12},selected:{backgroundColor:He.color.accentSoft,borderColor:He.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:He.color.textTertiary,marginTop:1},mutationSection:{flex:2,paddingHorizontal:12},mutationKey:{fontFamily:No,fontSize:12,color:He.color.text,lineHeight:16},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:He.color.textTertiary,fontFamily:No}});import{displayValue as ps,night as se,monoFont as Xt}from"@buoy-gg/shared-ui/web";import{buoyColors as ie,monoFont as cs}from"@buoy-gg/shared-ui/web";import{jsx as _o}from"react/jsx-runtime";var ds={success:ie.success+"15",error:ie.error+"15",pending:ie.primary+"15",idle:ie.textMuted+"1A"},ys={success:ie.success+"33",error:ie.error+"33",pending:ie.primary+"33",idle:ie.textMuted+"33"},fs={success:ie.success,error:ie.error,pending:ie.primary,idle:ie.textMuted};function wt({status:e,testID:r}){let t=e,o=ds[t],n=ys[t],a=fs[t];return _o(y,{style:[$o.container,{backgroundColor:o,borderColor:n}],children:_o(b,{testID:r,style:[$o.text,{color:a}],children:e})})}var $o=w.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:cs}});import{jsx as Ze,jsxs as Rr}from"react/jsx-runtime";function We({selectedMutation:e}){if(e===void 0)return null;let r=new Date(e.state.submittedAt).toLocaleTimeString();return Rr(y,{style:Ae.minWidth,children:[Ze(b,{style:Ae.headerText,children:"Mutation Details"}),Rr(y,{style:Ae.row,children:[Ze(z,{"sentry-label":"ignore devtools mutation details scroll",horizontal:!0,style:Ae.flex1,children:Ze(b,{testID:"buoy-rq-mutation-detail-key",style:Ae.flexWrap,children:`${e.options.mutationKey?ps(e.options.mutationKey,!0):"No mutationKey found"}`})}),Ze(wt,{status:e.state.status,testID:"buoy-rq-mutation-detail-status"})]}),Rr(y,{style:Ae.row,children:[Ze(b,{style:Ae.labelText,children:"Submitted At:"}),Ze(b,{style:Ae.valueText,children:r})]})]})}var Ae=w.create({minWidth:{minWidth:200,backgroundColor:se.color.surface,borderRadius:6,borderWidth:1,borderColor:se.color.accent+"4D",overflow:"hidden",shadowColor:se.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:se.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:se.color.accent,borderBottomWidth:1,borderBottomColor:se.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:Xt},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:se.color.separator},flex1:{flex:1,marginRight:8},flexWrap:{fontSize:12,color:se.color.text,fontFamily:Xt,lineHeight:18,flexShrink:1,backgroundColor:se.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:se.color.accent+"4D"},labelText:{fontSize:10,color:se.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:Xt},valueText:{fontSize:12,color:se.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:Xt}});import{night as Ct,monoFont as ms}from"@buoy-gg/shared-ui/web";import{jsx as ee,jsxs as xt}from"react/jsx-runtime";function Mt({selectedMutation:e}){return xt(z,{"sentry-label":"ignore devtools mutation information scroll",style:U.flex1,contentContainerStyle:U.scrollContent,children:[ee(y,{style:U.section,children:ee(We,{selectedMutation:e})}),xt(y,{style:U.section,children:[ee(b,{style:U.textHeader,children:"Variables Details"}),ee(y,{style:U.padding,children:ee(N,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),xt(y,{style:U.section,children:[ee(b,{style:U.textHeader,children:"Context Details"}),ee(y,{style:U.padding,children:ee(N,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),xt(y,{style:U.section,children:[ee(b,{style:U.textHeader,children:"Data Explorer"}),ee(y,{style:U.padding,children:ee(N,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),xt(y,{style:U.section,children:[ee(b,{style:U.textHeader,children:"Mutations Explorer"}),ee(y,{style:U.padding,children:ee(N,{label:"Mutation",defaultExpanded:["Mutation"],value:e})})]})]})}var U=w.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:Ct.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:Ct.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:Ct.color.accent+"33",fontFamily:ms,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:Ct.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:Ct.color.border,borderTopWidth:0}});import{useCallback as Uo,useEffect as gs,useRef as Go,useState as hs}from"react";import{useQueryClient as bs}from"@tanstack/react-query";function Ss(){let e=bs(),[r,t]=hs(()=>e.getMutationCache().getAll()),o=Go(new Map),n=Go(void 0),a=Uo(i=>{let s=o.current;if(i.length!==s.size)return!0;for(let c of i){let l=s.get(c.mutationId);if(!l||l.status!==c.state.status||l.submittedAt!==c.state.submittedAt||l.isPaused!==c.state.isPaused)return!0}return!1},[]),u=Uo(()=>{let i=e.getMutationCache().getAll();if(a(i)){let s=new Map;i.forEach(c=>{s.set(c.mutationId,c.state)}),o.current=s,t(i)}},[e,a]);return gs(()=>{u();let i=e.getMutationCache().subscribe(s=>{(s.type==="added"||s.type==="removed"||s.type==="updated")&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{u()},10))});return()=>{i(),n.current&&clearTimeout(n.current)}},[e,u]),{mutations:r}}var Er=Ss;import{night as ze,ToolEmptyState as Ms,monoFont as Qs}from"@buoy-gg/shared-ui/web";import{jsx as De,jsxs as Jo}from"react/jsx-runtime";function Qt({selectedMutation:e,setSelectedMutation:r,activeFilter:t,hideInfoPanel:o=!1,contentContainerStyle:n,searchText:a=""}){let{mutations:u}=Er(),i=S=>S.state.isPaused?"paused":S.state.status,s=Cs(()=>{let S=u;if(t&&(S=S.filter(v=>i(v)===t)),a){let v=a.toLowerCase();S=S.filter(M=>{let T=M.options.mutationKey;return T?(Array.isArray(T)?T:[T]).filter(ce=>ce!=null).map(ce=>String(ce)).join(" ").toLowerCase().includes(v):!1})}return S},[u,t,a]),c=br.get("window").height,l=c*.4,d=150,p=c*.7,h=Ir(new X.Value(l)).current,[,f]=ws(l),m=Ir(l),Q=Ir(ct.create({onMoveShouldSetPanResponder:(S,v)=>Math.abs(v.dy)>Math.abs(v.dx)&&Math.abs(v.dy)>10,onPanResponderGrant:()=>{h.stopAnimation(S=>{f(S),m.current=S,h.setValue(S)})},onPanResponderMove:(S,v)=>{let M=m.current-v.dy,T=Math.max(d,Math.min(p,M));h.setValue(T)},onPanResponderRelease:(S,v)=>{let M=Math.max(d,Math.min(p,m.current-v.dy));f(M),m.current=M,X.timing(h,{toValue:M,duration:200,useNativeDriver:!1}).start(()=>{h.setValue(M),f(M),m.current=M})}})).current,C=xs(({item:S})=>De(St,{selected:e,setSelectedMutation:r,mutation:S}),[e,r]);return Jo(y,{style:Ne.container,children:[s.length>0?De(y,{style:Ne.listWrapper,children:De(dt,{"sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:s,renderItem:C,keyExtractor:(S,v)=>`${S.mutationId}-${S.state.submittedAt}-${S.state.status}-${v}`,inverted:!0,showsVerticalScrollIndicator:!0,removeClippedSubviews:!(typeof process<"u"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:n||Ne.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:!1})}):De(Ms,{testID:"buoy-rq-mutations-empty",otto:t?"filtering":"scanning",title:"No mutations found",message:t?`No ${t} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),e&&!o&&Jo(X.View,{style:[Ne.mutationInfo,{height:h}],children:[De(y,{style:Ne.dragHandle,...Q.panHandlers,children:De(y,{style:Ne.dragIndicator})}),De(y,{style:Ne.mutationInfoContent,children:De(Mt,{selectedMutation:e})})]})]})}var Ne=w.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:ze.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:ze.color.surface,borderBottomWidth:1,borderBottomColor:ze.color.border},dragIndicator:{width:40,height:4,backgroundColor:ze.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:ze.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:ze.color.border},emptyText:{color:ze.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Qs,letterSpacing:.5}});import{ChipStrip as vs,useChipTap as Ts}from"@buoy-gg/shared-ui/web";import{jsx as Yt,jsxs as As}from"react/jsx-runtime";var ks=({activeFilter:e,onFilterChange:r,size:t="default"})=>{let{pending:o,success:n,error:a,paused:u}=Oo(),{scrollProps:i,onTouchStart:s,isTap:c}=Ts(),l=(d,p)=>{c(p)&&r&&r(e===d?null:d)};return As(vs,{scrollProps:i,sentryLabel:"ignore devtools mutation status count scroll",children:[Yt(_,{label:"Pending",color:"blue",count:o,isActive:e==="pending",onPress:d=>l("pending",d),onTouchStart:s,testID:"buoy-rq-mstatus-pending",showLabel:!0,size:t}),Yt(_,{label:"Success",color:"green",count:n,isActive:e==="success",onPress:d=>l("success",d),onTouchStart:s,testID:"buoy-rq-mstatus-success",showLabel:!0,size:t}),Yt(_,{label:"Error",color:"red",count:a,isActive:e==="error",onPress:d=>l("error",d),onTouchStart:s,testID:"buoy-rq-mstatus-error",showLabel:!0,size:t}),Yt(_,{label:"Paused",color:"purple",count:u,isActive:e==="paused",onPress:d=>l("paused",d),onTouchStart:s,testID:"buoy-rq-mstatus-paused",showLabel:!0,size:t})]})},Zt=ks;import{Trash as Ds,night as et}from"@buoy-gg/shared-ui/web";import{jsx as Xo}from"react/jsx-runtime";var Rs=({type:e,onClear:r,disabled:t=!1})=>Xo(E,{"sentry-label":"ignore devtools clear cache button",style:[jo.button,t&&jo.disabledButton],onPress:r,disabled:t,activeOpacity:.7,accessibilityLabel:`Clear ${e} cache`,accessibilityRole:"button",accessibilityState:{disabled:t},children:Xo(Ds,{size:16,strokeWidth:2,color:t?et.color.textTertiary:et.color.warning})}),jo=w.create({button:{width:32,height:32,borderRadius:6,backgroundColor:et.color.warningSoft,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:et.color.warning+"33"},disabledButton:{opacity:.5,backgroundColor:et.color.fill,borderColor:et.color.border}}),Yo=Rs;import{Wifi as Zo,buoyColors as en}from"@buoy-gg/shared-ui/web";import{jsx as Pr}from"react/jsx-runtime";var Es=({isOffline:e,onToggle:r})=>Pr(E,{"sentry-label":"ignore devtools network toggle button",style:[tn.button,e&&tn.offlineButton],onPress:r,activeOpacity:.7,accessibilityLabel:e?"Unset offline mocking behavior":"Mock offline behavior",accessibilityRole:"button",accessibilityState:{selected:e},children:e?Pr(Zo,{size:16,color:en.error,strokeWidth:2}):Pr(Zo,{size:16,color:en.success,strokeWidth:2})}),tn=w.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)"}}),rn=Es;import{ChipStrip as Is,useChipTap as Ps}from"@buoy-gg/shared-ui/web";import{jsx as nn}from"react/jsx-runtime";var on=["mmkv","async","secure"],qs=({activeStorageTypes:e=new Set(on),onStorageTypesChange:r,counts:t})=>{let{scrollProps:o,onTouchStart:n,isTap:a}=Ps(),u=(i,s)=>{if(a(s)&&r){let c=new Set(e);c.has(i)?c.delete(i):c.add(i),r(c)}};return nn(Is,{scrollProps:o,sentryLabel:"ignore devtools storage status count scroll",children:on.map(i=>{let s=t?.[i]??0;return nn(_,{label:vo(i),color:To(i),count:s,isActive:e.has(i),onPress:c=>u(i,c),onTouchStart:n,showLabel:!0},i)})})},an=qs;import{night as Vs,monoFont as Fs}from"@buoy-gg/shared-ui/web";import{jsx as un,jsxs as Bs}from"react/jsx-runtime";function ln({totalCount:e,filteredCount:r,onPress:t}){if(r===e)return null;let o=un(y,{style:sn.container,children:Bs(b,{testID:"buoy-rq-filter-badge",style:sn.text,children:["Showing ",r," of ",e]})});return t?un(E,{testID:"buoy-rq-filter-badge-button",accessibilityRole:"button",accessibilityLabel:`Showing ${r} of ${e}, open filters`,onPress:t,activeOpacity:.7,children:o}):o}var sn=w.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:2},text:{fontSize:9,color:Vs.color.textTertiary,fontFamily:Fs}});import{jsx as dn,jsxs as Ls}from"react/jsx-runtime";function qr({selectedQuery:e,onQuerySelect:r,activeFilter:t,searchText:o="",ignoredPatterns:n=new Set,includedPatterns:a=new Set,onFilterPress:u}){let i=a.size>0,s=n.size>0,c=Oe(),l=Ks(()=>{let d=c;return a.size>0&&(d=d.filter(p=>{if(!p?.queryKey)return!1;let f=(Array.isArray(p.queryKey)?p.queryKey:[p.queryKey]).filter(m=>m!=null).map(m=>String(m)).join(" ").toLowerCase();return Array.from(a).some(m=>f.includes(m.toLowerCase()))})),n.size>0&&(d=d.filter(p=>{if(!p?.queryKey)return!0;let f=(Array.isArray(p.queryKey)?p.queryKey:[p.queryKey]).filter(m=>m!=null).map(m=>String(m)).join(" ").toLowerCase();return!Array.from(n).some(m=>f.includes(m.toLowerCase()))})),d.length},[c,a,n]);return Ls(y,{style:cn.queryListContainer,children:[(i||s)&&dn(ln,{totalCount:c.length,filteredCount:l,onPress:u}),dn(yt,{selectedQuery:e,onQuerySelect:r,activeFilter:t,searchText:o,ignoredPatterns:n,includedPatterns:a,emptyState:Os({subject:"queries",verb:"active",search:o,total:c.length,blocked:t?`No ${t} queries. Pick another status to see the rest.`:i?`No queries match your "include only" filters. ${a.size} pattern(s) active.`:s?`No queries match the current filters. ${n.size} pattern(s) excluded.`:void 0,waiting:{otto:"scanning",title:"No queries found",message:`No React Query queries are currently active.
|
|
3
|
+
|
|
4
|
+
To see queries here:
|
|
5
|
+
\u2022 Make API calls using useQuery
|
|
6
|
+
\u2022 Ensure queries are within QueryClientProvider
|
|
7
|
+
\u2022 Check console for debugging info`}}),contentContainerStyle:cn.queryListContent})]})}var cn=w.create({queryListContainer:{flex:1,backgroundColor:"transparent"},queryListContent:{padding:8,backgroundColor:"transparent",flexGrow:1}});import{ToolFooter as Hs,useSafeAreaInsets as Ws}from"@buoy-gg/shared-ui/web";import{jsx as Vr}from"react/jsx-runtime";function Fr({activeFilter:e,onFilterChange:r,isFloatingMode:t=!0,size:o="default"}){let n=Ws({minBottom:16});return Vr(Hs,{floating:t,safeArea:!1,paddingBottom:t?0:n.bottom,style:yn.filterFooter,children:Vr(y,{style:yn.filterContainer,children:Vr(Gt,{activeFilter:e,onFilterChange:r,size:o})})})}var yn=w.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{useMemo as vt}from"react";import{DynamicFilterView as zs,buoyColors as Re}from"@buoy-gg/shared-ui/web";import{XCircle as fn,Clock as Br,RefreshCw as Ns,Globe as $s,Zap as _s,Filter as Us,Eye as Gs}from"@buoy-gg/shared-ui/web";import{jsx as Js}from"react/jsx-runtime";function pn({queries:e,activeFilter:r,onFilterChange:t,ignoredPatterns:o,onPatternToggle:n,includedPatterns:a,onIncludedPatternToggle:u}){let i=vt(()=>{let h={all:e.length,disabled:0,fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0};return e.forEach(f=>{let m=V(f);m==="disabled"?h.disabled++:m==="error"?h.error++:m==="fresh"?h.fresh++:m==="stale"?h.stale++:m==="fetching"?h.fetching++:m==="paused"?h.paused++:m==="inactive"&&h.inactive++}),h},[e]),s=vt(()=>{let h=new Set;return e.forEach(f=>{if(!f?.queryKey)return;(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).forEach(Q=>{if(Q!=null){let C=String(Q);/^\d+$/.test(C)||h.add(C)}})}),Array.from(h).sort().slice(0,50)},[e]),c=vt(()=>s,[s]),l=vt(()=>{let h=e;return a.size>0&&(h=h.filter(f=>{if(!f?.queryKey)return!1;let Q=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(C=>C!=null).map(C=>String(C)).join(" ").toLowerCase();return Array.from(a).some(C=>Q.includes(C.toLowerCase()))})),o.size>0&&(h=h.filter(f=>{if(!f?.queryKey)return!0;let Q=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(C=>C!=null).map(C=>String(C)).join(" ").toLowerCase();return!Array.from(o).some(C=>Q.includes(C.toLowerCase()))})),h.length},[e,a,o]),d=vt(()=>({filterSummarySection:{enabled:!0,totalCount:e.length,filteredCount:l,includePatterns:a,excludePatterns:o},sections:[{id:"status",title:"Status",type:"status",data:[{id:"status::all",label:"All",count:i.all,icon:$s,color:Re.primary,isActive:!r||r==="all"},{id:"status::disabled",label:"Disabled",count:i.disabled,icon:fn,color:Re.textMuted,isActive:r==="disabled"},{id:"status::fresh",label:"Fresh",count:i.fresh,icon:_s,color:Re.success,isActive:r==="fresh"},{id:"status::stale",label:"Stale",count:i.stale,icon:Br,color:Re.warning,isActive:r==="stale"},{id:"status::fetching",label:"Fetching",count:i.fetching,icon:Ns,color:Re.primary,isActive:r==="fetching"},{id:"status::paused",label:"Paused",count:i.paused,icon:Br,color:Re.textMuted,isActive:r==="paused"},{id:"status::inactive",label:"Inactive",count:i.inactive,icon:Br,color:Re.textSecondary,isActive:r==="inactive"},{id:"status::error",label:"Error",count:i.error,icon:fn,color:Re.error,isActive:r==="error"}]}],addFilterSection:{enabled:!0,placeholder:"Enter pattern to exclude...",title:"EXCLUDE FILTERS",icon:Us},includeOnlySection:{enabled:!0,title:"INCLUDE ONLY FILTERS",description:"Show ONLY queries matching these patterns. All non-matching queries will be hidden.",placeholder:"Enter pattern to include...",icon:Gs,patterns:a,onPatternToggle:u,onPatternAdd:u},availableItemsSection:{enabled:!0,title:"AVAILABLE QUERY KEYS",emptyMessage:"No queries found. Query keys will appear here once queries are active.",items:c},howItWorksSection:{enabled:!0,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}),[i,r,o,a,c,u,e.length,l]);return Js(zs,{...d,onFilterChange:h=>{let[f,m]=h.split("::");f==="status"?t(m==="all"||r===m?null:m):f==="suggestion"&&n(m)},onPatternToggle:n,onPatternAdd:n})}import{useState as Tt,useCallback as er,useEffect as tr}from"react";import{devToolsStorageKeys as tt,persistentStorage as rr}from"@buoy-gg/shared-ui/web";import{jsx as Ce,jsxs as tu}from"react/jsx-runtime";function Kr({visible:e,selectedQueryKey:r,onQuerySelect:t,onClose:o,onMinimize:n,activeFilter:a,onFilterChange:u,enableSharedModalDimensions:i=!1,onTabChange:s,searchText:c="",onSearchChange:l}){let d=js(),p=mr(r),h=Oe(),f=er(()=>{d.getQueryCache().clear()},[d]),[m,Q]=Tt(null),C=a??m,S=u??Q,[v,M]=Tt(!1),[T,A]=Tt(new Set),[re,ce]=Tt(new Set);tr(()=>{(async()=>{try{let D=await rr.getItem(tt.reactQuery.ignoredPatterns());if(D){let L=JSON.parse(D);Array.isArray(L)&&A(new Set(L))}}catch(D){console.error("Failed to load ignored patterns:",D)}})()},[]),tr(()=>{(async()=>{try{let D=await rr.getItem(tt.reactQuery.includedPatterns());if(D){let L=JSON.parse(D);Array.isArray(L)&&ce(new Set(L))}}catch(D){console.error("Failed to load included patterns:",D)}})()},[]),tr(()=>{(async()=>{try{let D=Array.from(T);await rr.setItem(tt.reactQuery.ignoredPatterns(),JSON.stringify(D))}catch(D){console.error("Failed to save ignored patterns:",D)}})()},[T]),tr(()=>{(async()=>{try{let D=Array.from(re);await rr.setItem(tt.reactQuery.includedPatterns(),JSON.stringify(D))}catch(D){console.error("Failed to save included patterns:",D)}})()},[re]);let Et=er(K=>{A(D=>{let L=new Set(D);return L.has(K)?L.delete(K):L.add(K),L})},[]),It=er(K=>{ce(D=>{let L=new Set(D);return L.has(K)?L.delete(K):L.add(K),L})},[]),[st,Pt]=Tt("bottomSheet"),he=i?tt.reactQuery.modal():tt.reactQuery.browserModal(),be=er(K=>{Pt(K)},[]),ut=Ys({minBottom:16}),lt=st==="floating"?56:48+ut.bottom;if(!e)return null;let qt=()=>{if(v){let K=[{key:"filters",label:"Filters"}];return tu(Or,{children:[Ce(Or.Navigation,{onBack:()=>M(!1)}),Ce(Or.Content,{title:"",noMargin:!0,children:Ce(Zs,{tabs:K,activeTab:"filters",testIDPrefix:"buoy-rq-filterview-tab",onTabChange:()=>{}})})]})}return Ce(Se,{selectedQuery:p,activeTab:"queries",onTabChange:s,onBack:()=>t(void 0),searchText:c,onSearchChange:l,onFilterPress:()=>M(!0),hasActiveFilters:C!==null||T.size>0||re.size>0,onClearCache:f})},Vt=Ce(Fr,{activeFilter:C,onFilterChange:S,isFloatingMode:st==="floating"});return Ce(Xs,{visible:e,onClose:o,onMinimize:n,persistenceKey:he,header:{customContent:qt(),showToggleButton:!0},onModeChange:be,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,disableScrollWrapper:!v,styles:{},footer:v?void 0:Vt,footerHeight:v?void 0:lt,children:Ce(y,{style:eu.container,children:v?Ce(pn,{queries:h,activeFilter:C,onFilterChange:S,ignoredPatterns:T,onPatternToggle:Et,includedPatterns:re,onIncludedPatternToggle:It}):Ce(qr,{selectedQuery:p,onQuerySelect:t,activeFilter:C,searchText:c,ignoredPatterns:T,includedPatterns:re,onFilterPress:()=>M(!0)})})})}var eu=w.create({container:{flex:1,backgroundColor:"transparent"}});import{JsModal as su,devToolsStorageKeys as Sn,useSafeAreaInsets as uu}from"@buoy-gg/shared-ui/web";import{useQueryClient as gn}from"@tanstack/react-query";import{useSafeAreaInsets as hn,night as G,monoFont as mn}from"@buoy-gg/shared-ui/web";import{useMemo as ru}from"react";function or(e,r,t){return ru(()=>{let n=e.state.status;return[{label:"Refetch",variant:"refetch",disabled:V(e)==="fetching",onPress:()=>Xe({query:e})},{label:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading",variant:"triggerLoading",disabled:!1,onPress:()=>je({query:e})},{label:n==="error"?"Restore Error":"Trigger Error",variant:"triggerError",disabled:n==="pending",onPress:()=>Ye({query:e,queryClient:r})}]},[e,r,t])}import{DataViewer as ou}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as iu,jsx as q,jsxs as rt}from"react/jsx-runtime";function Lr({selectedQuery:e,isFloatingMode:r,disableInternalFooter:t=!1,queryVersion:o}){let n=hn({minBottom:16}),a=gn(),u=or(e,a,o);return rt(iu,{children:[rt(z,{testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:F.explorerScrollContainer,contentContainerStyle:[F.explorerScrollContent,!t&&{paddingBottom:72}],children:[rt(y,{style:F.section,children:[q(nu,{visible:!!e.state.data,selectedQuery:e,queryVersion:o}),q(au,{visible:!e.state.data,selectedQuery:e})]}),q(y,{style:F.section,children:q(Ke,{query:e})}),q(y,{style:F.section,children:rt(y,{style:F.queryExplorerContainer,children:[q(b,{testID:"buoy-rq-query-explorer-header",style:F.queryExplorerHeader,children:"Query Explorer"}),q(y,{style:F.queryExplorerContent,children:q(ou,{title:"",data:e,maxDepth:10,rawMode:!0,showTypeFilter:!0,initialExpanded:!1})})]})})]}),!t&&q(y,{style:[F.actionFooter,{paddingBottom:r?0:n.bottom+8}],children:q(y,{style:F.actionsRow,children:u.map((i,s)=>q($,{testID:`buoy-rq-action-${i.variant}`,onClick:i.onPress,text:i.label,variant:i.variant,disabled:i.disabled},s))})})]})}function bn({selectedQuery:e,isFloatingMode:r,queryVersion:t}){let o=hn({minBottom:16}),n=gn(),a=or(e,n,t);return q(y,{style:[F.actionFooter,{paddingBottom:r?0:o.bottom+8}],children:q(y,{style:F.actionsRow,children:a.map((u,i)=>q($,{testID:`buoy-rq-action-${u.variant}`,onClick:u.onPress,text:u.label,variant:u.variant,disabled:u.disabled},i))})})}function nu({visible:e,selectedQuery:r,queryVersion:t=0}){return e?rt(y,{style:F.dataContainer,children:[q(b,{testID:"buoy-rq-data-header",style:F.dataHeader,children:"Data Editor"}),q(y,{style:F.dataContent,children:q(N,{editable:!0,label:"Data",value:r.state.data,defaultExpanded:["Data"],activeQuery:r,dataVersion:t})})]}):null}function au({visible:e,selectedQuery:r}){if(!e)return null;let t=()=>r.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."}:r.state.status==="pending"||V(r)==="fetching"?{title:r.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}:r.state.status==="error"?{title:"Query Error",description:r.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:n}=t();return rt(y,{style:F.emptyState,children:[q(b,{testID:"buoy-rq-detail-empty-title",style:F.emptyTitle,children:o}),q(b,{testID:"buoy-rq-detail-empty-description",style:F.emptyDescription,children:n})]})}var F=w.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:G.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:G.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:G.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:G.color.surface,borderRadius:6,borderWidth:1,borderColor:G.color.accent+"4D",overflow:"hidden",shadowColor:G.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:G.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:G.color.accent,borderBottomWidth:1,borderBottomColor:G.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:mn},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:G.color.surface,borderRadius:6,borderWidth:1,borderColor:G.color.accent+"4D",overflow:"hidden",shadowColor:G.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:G.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:G.color.accent,borderBottomWidth:1,borderBottomColor:G.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:mn},dataContent:{padding:8}});import{useState as lu,useCallback as cu,useEffect as du,useRef as yu}from"react";import{jsx as nr}from"react/jsx-runtime";function Hr({visible:e,selectedQueryKey:r,onQuerySelect:t,onClose:o,onMinimize:n,enableSharedModalDimensions:a=!1,onTabChange:u}){let{query:i,version:s}=Ft(r),[c,l]=lu("bottomSheet"),d=r?JSON.stringify(r):void 0,p=yu(void 0);du(()=>{if(i){p.current=d;return}e&&p.current!==void 0&&p.current===d&&(p.current=void 0,t(void 0))},[e,i,d,t]);let h=cu(v=>{l(v)},[]),f=uu({minBottom:16}),m=c==="floating"?72:80+f.bottom,Q=()=>nr(Se,{selectedQuery:i,activeTab:"queries",onTabChange:u,onBack:()=>t(void 0)}),C=a?Sn.reactQuery.modal():`${Sn.reactQuery.modal()}_data_editor`;if(!e||!i)return null;let S=nr(bn,{selectedQuery:i,isFloatingMode:c==="floating",queryVersion:s},`footer-${s}`);return nr(su,{visible:e,onClose:o,onMinimize:n,persistenceKey:C,header:{customContent:Q(),showToggleButton:!0},onModeChange:h,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:S,footerHeight:m,children:nr(Lr,{selectedQuery:i,isFloatingMode:c==="floating",disableInternalFooter:!0,queryVersion:s})})}import{useQueryClient as Qu}from"@tanstack/react-query";import{useCallback as Ur,useState as Tn,useRef as kn}from"react";import{useEffect as fu,useState as pu}from"react";import{useQueryClient as mu}from"@tanstack/react-query";function kt(e){let r=mu(),[t,o]=pu(void 0);return fu(()=>{let n=()=>{if(e!==void 0){let u=r.getMutationCache().getAll().find(i=>i.mutationId===e);o(u)}else o(void 0)};setTimeout(n,0);let a=r.getMutationCache().subscribe(n);return()=>a()},[r,e]),t}import{jsx as Cn}from"react/jsx-runtime";function Wr({selectedMutation:e,onMutationSelect:r,activeFilter:t,searchText:o=""}){let n=a=>{r(typeof a=="function"?a(e):a)};return Cn(y,{style:wn.mutationListContainer,children:Cn(Qt,{selectedMutation:e,setSelectedMutation:n,activeFilter:t,searchText:o,hideInfoPanel:!0,contentContainerStyle:wn.mutationListContent})})}var wn=w.create({mutationListContainer:{flex:1,backgroundColor:"transparent"},mutationListContent:{padding:8,backgroundColor:"transparent"}});import{ToolFooter as gu,useSafeAreaInsets as hu}from"@buoy-gg/shared-ui/web";import{useMemo as bu}from"react";import{jsx as zr}from"react/jsx-runtime";function Nr({activeFilter:e,onFilterChange:r,modalMode:t,size:o="default"}){let n=t==="floating",a=hu({minBottom:16}),u=bu(()=>n?0:a.bottom,[n,a.bottom]);return zr(gu,{floating:n,safeArea:!1,paddingBottom:u,style:xn.filterFooter,children:zr(y,{style:xn.filterContainer,children:zr(Zt,{activeFilter:e,onFilterChange:r,size:o})})},`footer-${n?"floating":"docked"}`)}var xn=w.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{JsModal as vu,useSafeAreaInsets as Tu}from"@buoy-gg/shared-ui/web";import{absoluteFill as Su}from"@buoy-gg/shared-ui/web";import{useMemo as te}from"react";import{ChevronLeft as wu,ChevronRight as Cu,night as ar}from"@buoy-gg/shared-ui/web";import{jsx as ot,jsxs as Mu}from"react/jsx-runtime";var $e=32,Mn=6,Qn=$e,xu=120,ir=.95,vn=1.15;function _r({translationX:e,maxTranslation:r=xu,canSwipeLeft:t=!0,canSwipeRight:o=!0}){let n=te(()=>e.interpolate({inputRange:[0,r],outputRange:[0,1],extrapolate:"clamp"}),[e,r]),a=te(()=>n.interpolate({inputRange:[0,1],outputRange:[Mn,Qn]}),[n]),u=te(()=>n.interpolate({inputRange:[0,ir,1],outputRange:[1,1,vn]}),[n]),i=te(()=>n.interpolate({inputRange:[0,.99,1],outputRange:[0,0,16]}),[n]),s=te(()=>n.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[n]),c=te(()=>n.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[n]),l=te(()=>n.interpolate({inputRange:[0,.5,ir,1],outputRange:[.8,.8,1,1.2]}),[n]),d=te(()=>e.interpolate({inputRange:[-r,0],outputRange:[1,0],extrapolate:"clamp"}),[e,r]),p=te(()=>d.interpolate({inputRange:[0,1],outputRange:[Mn,Qn]}),[d]),h=te(()=>d.interpolate({inputRange:[0,ir,1],outputRange:[1,1,vn]}),[d]),f=te(()=>d.interpolate({inputRange:[0,.99,1],outputRange:[0,0,-16]}),[d]),m=te(()=>d.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[d]),Q=te(()=>d.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[d]),C=te(()=>d.interpolate({inputRange:[0,.5,ir,1],outputRange:[.8,.8,1,1.2]}),[d]);return Mu(y,{style:$r.container,pointerEvents:"none",children:[o&&ot(X.View,{style:[$r.leftWrapper,{width:a,height:$e,borderRadius:$e/2,backgroundColor:ar.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:s,transform:[{scale:u},{translateX:i}]}],children:ot(X.View,{style:{opacity:c,transform:[{scale:l}]},children:ot(wu,{size:$e*.6,color:ar.color.accent,strokeWidth:3})})}),t&&ot(X.View,{style:[$r.rightWrapper,{width:p,height:$e,borderRadius:$e/2,backgroundColor:ar.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:m,transform:[{scale:h},{translateX:f}]}],children:ot(X.View,{style:{opacity:Q,transform:[{scale:C}]},children:ot(Cu,{size:$e*.6,color:ar.color.accent,strokeWidth:3})})})]})}var $r=w.create({container:{...Su,zIndex:1e3,justifyContent:"center",alignItems:"center"},leftWrapper:{position:"absolute",left:16},rightWrapper:{position:"absolute",right:16}});import{devToolsStorageKeys as An}from"@buoy-gg/shared-ui/web";import{jsx as nt,jsxs as ku}from"react/jsx-runtime";function Gr({visible:e,selectedMutationId:r,onMutationSelect:t,onClose:o,onMinimize:n,activeFilter:a,onFilterChange:u,onTabChange:i,enableSharedModalDimensions:s=!1,searchText:c="",onSearchChange:l}){let d=Qu(),p=kt(r),[h,f]=Tn(null),m=a??h,Q=u??f,C=Ur(()=>{d.getMutationCache().clear(),t(void 0)},[d,t]),[S,v]=Tn("bottomSheet"),M=s?An.reactQuery.modal():An.reactQuery.mutationModal(),T=kn(new X.Value(0)).current,A=Ur(he=>{he==="right"&&i("queries")},[i]),re=Ur(he=>{v(he)},[]),ce=Tu({minBottom:16}),Et=S==="floating"?56:48+ce.bottom,It=kn(ct.create({onStartShouldSetPanResponder:()=>!1,onMoveShouldSetPanResponder:(he,be)=>Math.abs(be.dx)>5&&Math.abs(be.dy)<10,onPanResponderMove:(he,be)=>{T.setValue(be.dx)},onPanResponderRelease:(he,be)=>{let{dx:ut,vx:lt}=be,qt=80,Vt=.5;X.spring(T,{toValue:0,useNativeDriver:!0}).start(),(Math.abs(ut)>qt||Math.abs(lt)>Vt)&&(ut>0||lt>0?A("right"):A("left"))},onPanResponderTerminate:()=>{X.spring(T,{toValue:0,useNativeDriver:!0}).start()}})).current;if(!e)return null;let st=()=>nt(Se,{selectedMutation:p,activeTab:"mutations",onTabChange:i,onBack:()=>t(void 0),searchText:c,onSearchChange:l,onClearCache:C}),Pt=nt(Nr,{activeFilter:m,onFilterChange:Q,modalMode:S});return nt(vu,{visible:e,onClose:o,onMinimize:n,persistenceKey:M,header:{customContent:st(),showToggleButton:!0},onModeChange:re,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:Pt,footerHeight:Et,children:nt(y,{style:{flex:1},children:ku(y,{...It.panHandlers,style:{flex:1},children:[nt(_r,{translationX:T,canSwipeLeft:!1,canSwipeRight:!0}),nt(Wr,{selectedMutation:p,onMutationSelect:t,activeFilter:m,searchText:c})]})})})}import{JsModal as Vu,useSafeAreaInsets as Fu,devToolsStorageKeys as Rn}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Ru,night as J,monoFont as Dn}from"@buoy-gg/shared-ui/web";import{useMemo as Au}from"react";import{useQueryClient as Du}from"@tanstack/react-query";function Jr(e){let r=Du();return Au(()=>[{label:"Remove",variant:"remove",disabled:!1,onPress:()=>r.getMutationCache().remove(e)}],[e,r])}import{DataViewer as Eu}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as qu,jsx as O,jsxs as at}from"react/jsx-runtime";function jr({selectedMutation:e,isFloatingMode:r,disableInternalFooter:t=!1}){return at(qu,{children:[at(z,{testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:W.explorerScrollContainer,contentContainerStyle:W.explorerScrollContent,children:[at(y,{style:W.section,children:[O(Iu,{visible:!!e.state.data,selectedMutation:e}),O(Pu,{visible:!e.state.data,selectedMutation:e})]}),O(y,{style:W.section,children:O(We,{selectedMutation:e})}),O(y,{style:W.section,children:at(y,{style:W.mutationExplorerContainer,children:[O(b,{style:W.mutationExplorerHeader,children:"Mutation Explorer"}),O(y,{style:W.mutationExplorerContent,children:O(Eu,{title:"",data:e,maxDepth:10,rawMode:!0,showTypeFilter:!0,initialExpanded:!1})})]})})]}),!t&&O(Xr,{selectedMutation:e,isFloatingMode:r})]})}function Xr({selectedMutation:e,isFloatingMode:r}){let t=Ru({minBottom:16}),o=Jr(e);return O(y,{style:[W.actionFooter,{paddingBottom:r?0:t.bottom+8}],children:O(y,{style:W.actionsGrid,children:o.map((n,a)=>O($,{testID:`buoy-rq-action-${n.variant}`,onClick:n.onPress,text:n.label,variant:n.variant,disabled:n.disabled},a))})})}function Iu({visible:e,selectedMutation:r}){return e?at(y,{style:W.dataContainer,children:[O(b,{style:W.dataHeader,children:"Data Editor"}),O(y,{style:W.dataContent,children:O(N,{editable:!0,label:"Data",value:r.state.data,defaultExpanded:["Data"]},r.mutationId)})]}):null}function Pu({visible:e,selectedMutation:r}){if(!e)return null;let t=()=>r.state.status==="pending"?{title:"Pending...",description:"The mutation is in progress."}:r.state.status==="error"?{title:"Mutation Error",description:r.state.error?.message||"An error occurred."}:{title:"No Data Available",description:"This mutation has no data."},{title:o,description:n}=t();return at(y,{style:W.emptyState,children:[O(b,{testID:"buoy-rq-mutation-detail-empty-title",style:W.emptyTitle,children:o}),O(b,{testID:"buoy-rq-mutation-detail-empty-description",style:W.emptyDescription,children:n})]})}var W=w.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:J.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:J.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:J.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: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},mutationExplorerHeader:{backgroundColor:J.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:J.color.accent,borderBottomWidth:1,borderBottomColor:J.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:Dn},mutationExplorerContent:{padding:8},dataContainer:{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},dataHeader:{backgroundColor:J.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:J.color.accent,borderBottomWidth:1,borderBottomColor:J.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:Dn},dataContent:{padding:8}});import{useState as Bu,useCallback as Ou,useEffect as Ku,useRef as Lu}from"react";import{jsx as sr}from"react/jsx-runtime";function Yr({visible:e,selectedMutationId:r,onMutationSelect:t,onClose:o,onMinimize:n,onTabChange:a,enableSharedModalDimensions:u=!1}){let i=kt(r),[s,c]=Bu("bottomSheet"),l=Lu(void 0);Ku(()=>{if(i){l.current=i.mutationId;return}e&&l.current!==void 0&&l.current===r&&(l.current=void 0,t(void 0))},[e,i,r,t]);let d=Ou(C=>{c(C)},[]),p=Fu({minBottom:16}),h=s==="floating"?72:80+p.bottom,f=()=>sr(Se,{selectedMutation:i,activeTab:"mutations",onTabChange:a,onBack:()=>t(void 0)}),m=u?Rn.reactQuery.modal():Rn.reactQuery.mutationModal();if(!e||!i)return null;let Q=sr(Xr,{selectedMutation:i,isFloatingMode:s==="floating"});return sr(Vu,{visible:e,onClose:o,onMinimize:n,persistenceKey:m,header:{customContent:f(),showToggleButton:!0},onModeChange:d,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:Q,footerHeight:h,children:sr(jr,{selectedMutation:i,isFloatingMode:s==="floating",disableInternalFooter:!0})})}import{Fragment as Hu,jsx as ur,jsxs as Wu}from"react/jsx-runtime";function Zr({visible:e,selectedQueryKey:r,selectedMutationId:t,onQuerySelect:o,onMutationSelect:n,onClose:a,onMinimize:u,activeFilter:i,onFilterChange:s,activeTab:c,onTabChange:l,enableSharedModalDimensions:d=!1,searchText:p="",onSearchChange:h}){let f=!!r||!!t,m=c==="queries",Q=c==="mutations",C={onClose:a,onMinimize:u,activeFilter:i,onFilterChange:s,enableSharedModalDimensions:d},S=e&&!f&&m,v=e&&!f&&Q,M=e&&f&&m&&!!r,T=e&&f&&Q&&!!t;return Wu(Hu,{children:[ur(Kr,{visible:S,selectedQueryKey:r,onQuerySelect:o,onTabChange:l,searchText:p,onSearchChange:h,...C}),ur(Gr,{visible:v,selectedMutationId:t,onMutationSelect:n,onTabChange:l,searchText:p,onSearchChange:h,...C}),ur(Hr,{visible:M,selectedQueryKey:r,onQuerySelect:o,onTabChange:l,...C}),ur(Yr,{visible:T,selectedMutationId:t,onMutationSelect:n,onTabChange:l,...C})]})}import{ChangeLog as zu}from"@buoy-gg/shared-ui/web";var Nu=0;function Ee(){return`rq-${Date.now()}-${++Nu}`}var eo=class extends zu{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(t){this.disconnect(),this.queryClient=t,this.queryUnsubscribe=t.getQueryCache().subscribe(o=>{o.type==="updated"&&o.query&&this.handleQueryUpdate(o.query)}),this.mutationUnsubscribe=t.getMutationCache().subscribe(o=>{o.type==="updated"&&o.mutation&&this.handleMutationUpdate(o.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(t){if(pe(t.queryKey))return;let o=t.queryHash,n={fetchStatus:t.state.fetchStatus,status:t.state.status},a=this.lastQueryStates.get(o);if(!a)n.fetchStatus==="fetching"&&(this.fetchStartTimes.set(o,Date.now()),this.addEvent({id:Ee(),type:"query-fetch-start",timestamp:Date.now(),queryKey:t.queryKey,queryHash:o,query:t}));else{let u=a.fetchStatus==="fetching",i=n.fetchStatus==="fetching";if(!u&&i&&(this.fetchStartTimes.set(o,Date.now()),this.addEvent({id:Ee(),type:"query-fetch-start",timestamp:Date.now(),queryKey:t.queryKey,queryHash:o,query:t})),u&&!i){let s=this.fetchStartTimes.get(o),c=s?Date.now()-s:void 0;this.fetchStartTimes.delete(o),n.status==="error"?this.addEvent({id:Ee(),type:"query-fetch-error",timestamp:Date.now(),queryKey:t.queryKey,queryHash:o,queryError:t.state.error,duration:c,query:t}):this.addEvent({id:Ee(),type:"query-fetch-success",timestamp:Date.now(),queryKey:t.queryKey,queryHash:o,queryData:t.state.data,duration:c,query:t})}!a.status&&t.state.isInvalidated&&this.addEvent({id:Ee(),type:"query-invalidated",timestamp:Date.now(),queryKey:t.queryKey,queryHash:o,query:t})}this.lastQueryStates.set(o,n)}handleMutationUpdate(t){let o=t.mutationId,n=t.state.status,a=this.lastMutationStates.get(o);if(a!==n){if(n==="pending"&&a!=="pending")this.mutationStartTimes.set(o,Date.now()),this.addEvent({id:Ee(),type:"mutation-start",timestamp:Date.now(),mutationId:o,mutationKey:t.options.mutationKey,mutationVariables:t.state.variables,mutation:t});else if(n==="success"&&a==="pending"){let u=this.mutationStartTimes.get(o),i=u?Date.now()-u:void 0;this.mutationStartTimes.delete(o),this.addEvent({id:Ee(),type:"mutation-success",timestamp:Date.now(),mutationId:o,mutationKey:t.options.mutationKey,mutationVariables:t.state.variables,mutationData:t.state.data,duration:i,mutation:t})}else if(n==="error"&&a==="pending"){let u=this.mutationStartTimes.get(o),i=u?Date.now()-u:void 0;this.mutationStartTimes.delete(o),this.addEvent({id:Ee(),type:"mutation-error",timestamp:Date.now(),mutationId:o,mutationKey:t.options.mutationKey,mutationVariables:t.state.variables,mutationError:t.state.error,duration:i,mutation:t})}}this.lastMutationStates.set(o,n)}addEvent(t){this.record(t)}getEvents(){return this.items}subscribe(t){let o=super.subscribe(t);return t(this.items),o}clearEvents(){this.clear()}isConnected(){return this.queryClient!==null}},xe=new eo,$u=e=>xe.setQueryClient(e),_u=()=>xe.disconnect();import{jsx as En}from"react/jsx-runtime";function lr({visible:e,onClose:r,onMinimize:t,enableSharedModalDimensions:o=!0}){let n=Gu();Uu(()=>{xe.isConnected()||xe.setQueryClient(n)},[n]);let[a,u]=At(void 0),[i,s]=At(void 0),[c,l]=At(null),[d,p]=At("queries"),[h,f]=At(""),m=_e(()=>{u(void 0),s(void 0),l(null),p("queries"),f("")},[]),Q=_e(()=>{m(),r()},[r,m]),C=_e(A=>{u(A?.queryKey)},[]),S=_e(A=>{s(A?.mutationId)},[]),v=_e(A=>{l(A)},[]),M=_e(A=>{p(A),l(null),u(void 0),s(void 0),f("")},[]),T=_e(A=>{f(A)},[]);return e?En(Ju,{children:En(Zr,{visible:e,selectedQueryKey:a,selectedMutationId:i,onQuerySelect:C,onMutationSelect:S,onClose:Q,onMinimize:t,activeFilter:c,onFilterChange:v,activeTab:d,onTabChange:M,searchText:h,onSearchChange:T,enableSharedModalDimensions:o})}):null}import{onlineManager as Me}from"@tanstack/react-query";import{devToolsStorageKeys as qn,persistentStorage as Vn}from"@buoy-gg/shared-ui/web";import{useState as On,useEffect as Kn}from"react";import{jsx as cr}from"react/jsx-runtime";var Fn=()=>null,Bn=async e=>{try{await Vn.setItem(qn.settings.wifiEnabled(),e.toString())}catch{}},ju=async()=>{try{let e=await Vn.getItem(qn.settings.wifiEnabled());e!==null&&Me.setOnline(e==="true")}catch{}};ju();function Xu({size:e}){let[r,t]=On(()=>Me.isOnline());return Kn(()=>Me.subscribe(a=>{t(a)}),[]),cr(Pn,{size:e,color:r?"#10B981":"#DC2626"})}var Yu={id:"query",name:"QUERY",description:"React Query inspector",slot:"both",icon:({size:e})=>cr(In,{size:e}),component:lr,props:{enableSharedModalDimensions:!1}};function Zu(e){return{id:e?.id||"query",name:e?.name||"QUERY",description:e?.description||"React Query inspector",slot:"both",icon:({size:r})=>cr(In,{size:r}),component:lr,props:{enableSharedModalDimensions:e?.enableSharedModalDimensions!==void 0?e.enableSharedModalDimensions:!1}}}var el={id:"query-wifi-toggle",name:"WIFI",description:"Toggle React Query online/offline state",slot:"row",icon:Xu,component:Fn,props:{},launchMode:"toggle-only",onPress:()=>{let e=!Me.isOnline();Me.setOnline(e),Bn(e)}};function tl(e){let r=e?.onColor||"#10B981",t=e?.offColor||"#DC2626",o=({size:n})=>{let[a,u]=On(()=>Me.isOnline());return Kn(()=>Me.subscribe(s=>{u(s)}),[]),cr(Pn,{size:n,color:a?r:t})};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:Fn,props:{},launchMode:"toggle-only",onPress:()=>{let n=!Me.isOnline();Me.setOnline(n),Bn(n)}}}import{expandKeyedArrays as ll,patchFromPath as cl,readPath as dl,refusalText as yl,shapeSummary as yr,suggestedPatch as fl,typedEditViolations as pl,unshapedLists as ml}from"@buoy-gg/shared-ui/web";import{onlineManager as ro}from"@tanstack/react-query";import{isJsonSerializable as Hn,isOverWireBudget as Wn}from"@buoy-gg/shared-ui/web";var rl=Object.freeze({__buoyDataOnDevice:!0,note:"Query data stays on the device \u2014 fetched on demand via getQueryData."}),zn=Object.freeze({__buoyUnserializable:!0,note:"Query data is not JSON-serializable (circular or bigint) and stayed on the device."}),ol=16*1024,Ln=8*1024*1024;function nl(e){return!!e&&typeof e=="object"&&e.__buoyDataOnDevice===!0}function al(e){return!!e&&typeof e=="object"&&e.__buoyUnserializable===!0}function to(e){return nl(e)||al(e)}function Ie(e){if(e!==void 0)return Wn(e,ol)?Hn(e)?rl:zn:e}function dr(e){if(e==null)return e;if(typeof e=="object"){let r=e,t=typeof r.name=="string"?r.name:void 0,o=typeof r.message=="string"?r.message:void 0;if(t!==void 0||o!==void 0)return Ie({...t!==void 0?{name:t}:{},...o!==void 0?{message:o}:{}})}return Ie(e)}function Nn(e){return Wn(e,Ln)?Hn(e)?{__buoyTruncated:!0,note:`Exceeds the ${Ln/(1024*1024)}MB detail limit \u2014 inspect it on-device.`}:zn:e}function $n(e){let r=e.getMutationCache().getAll().map(o=>il(o)),t=e.getQueryCache().getAll().map(o=>ul(o));return{mutations:r,queries:t}}function il(e){let r=e.state;return{mutationId:e.mutationId,mutationKey:e.options.mutationKey,state:{...r,data:Ie(r.data),variables:Ie(r.variables),error:dr(r.error),failureReason:dr(r.failureReason)},...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:Ie(e.meta)}}}function sl(e){let{queryFn:r,select:t,persister:o,initialData:n,placeholderData:a,...u}=e;return{...u,queryFn:void 0,...e.meta?{meta:Ie(e.meta)}:{}}}function ul(e){let r=e.observers.map(t=>({queryHash:e.queryHash,options:sl(t.options)}));return{state:{...e.state,...e.state.data!==void 0&&{data:Ie(e.state.data)},error:dr(e.state.error),fetchFailureReason:dr(e.state.fetchFailureReason)},queryKey:e.queryKey,queryHash:e.queryHash,...e.meta&&{meta:Ie(e.meta)},observers:r}}function gl(e,r){let t=e;for(let o of r.split(".")){if(!t||typeof t!="object"||Array.isArray(t)||!(o in t))return!1;t=t[o]}return Array.isArray(t)?t.length>0:!!t&&typeof t=="object"}var Dt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function _n(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}function Un(e,r,t="",o={shrunk:[],breaks:[]}){if(Array.isArray(e)&&Array.isArray(r))return r.length>0&&r.length<e.length&&o.shrunk.push({path:t||"(root)",have:e.length,sent:r.length}),r;if(!Dt(e)||!Dt(r))return r;let n={...e};for(let[a,u]of Object.entries(r)){let i=t?`${t}.${a}`:a;if(a in e){let s=_n(e[a]),c=_n(u);(s==="array"||s==="object")&&s!==c&&o.breaks.push({path:i,from:s,to:c}),n[a]=Un(e[a],u,i,o)}else n[a]=u}return n}function hl(e){let r=e.trim();try{let t=JSON.parse(r);if(Array.isArray(t))return t.map(o=>typeof o=="object"&&o!==null?JSON.stringify(o):String(o))}catch{}return r.includes(",")&&!r.startsWith("[")?r.split(",").map(t=>t.trim().replace(/^["']|["']$/g,"")):null}function oo(e){let r=t=>{let{queryHash:o}=t,n=e.getQueryCache(),a=o?n.get(o):void 0;if(!a&&typeof o=="string"){let u=hl(o);u&&(a=n.getAll().find(i=>{let s=i.queryKey.map(c=>typeof c=="object"?JSON.stringify(c):String(c));return s.length===u.length&&s.every((c,l)=>c===u[l])}))}if(!a)throw new Error(`Query with hash "${o}" not found`);return a};return{version:2,getSnapshot:()=>({dehydratedState:$n(e),isOnlineManagerOnline:ro.isOnline()}),subscribe:t=>{let o=e.getQueryCache().subscribe(t),n=e.getMutationCache().subscribe(t),a=ro.subscribe(t);return()=>{o(),n(),a()}},actions:{getQueryData:t=>{let{queryHash:o,path:n}=t??{};if(!o)return{found:!1,reason:"missing queryHash"};let a=e.getQueryCache().get(o);if(!a)return{found:!1,reason:"unknown queryHash"};if(n){let i=dl(a.state.data,n);return i.ok?{found:!0,queryHash:o,path:n,shape:yr(i.value),data:i.value}:{found:!1,reason:i.error}}if(a.state.data===void 0){let i=a.state.status,s=a.state.error;return{found:!0,queryHash:o,hasData:!1,status:i,fetchStatus:a.state.fetchStatus,...s?{error:s instanceof Error?s.message:String(s)}:{},reason:i==="error"?"This query has no data because it FAILED. Report the error, not an empty result.":a.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 u=yr(a.state.data);return{found:!0,queryHash:o,hasData:!0,...u?{shape:u}:{},data:Nn(a.state.data)}},listQueries:t=>{let{includeData:o=!1,staleOnly:n=!1,limit:a}=t??{},u=e.getQueryCache().getAll(),s=[...n?u.filter(d=>d.isStale()):u].sort((d,p)=>{let h=+(p.getObserversCount()>0)-+(d.getObserversCount()>0);return h!==0?h:(p.state.dataUpdatedAt??0)-(d.state.dataUpdatedAt??0)}),l=(typeof a=="number"&&a>0?s.slice(0,a):s).map(d=>{let p=d.state.error;return{queryHash:d.queryHash,queryKey:d.queryKey,status:V(d),fetchStatus:d.state.fetchStatus,isStale:d.isStale(),observers:d.getObserversCount(),updatedAt:d.state.dataUpdatedAt,error:p?p.message??String(p):void 0,...o?{data:d.state.data}:{},...yr(d.state.data)?{shape:yr(d.state.data)}:{}}});return{queries:l,total:u.length,returned:l.length,includedData:o}},refetch:t=>r(t).fetch().catch(()=>{}),invalidate:t=>e.invalidateQueries(r(t)),reset:t=>e.resetQueries(r(t)),remove:t=>{let o=r(t),n=e.getQueryCache().findAll(o).some(a=>a.getObserversCount()>0);return e.removeQueries(o),{ok:!0,...n?{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:t=>{let{data:o,merge:n,force:a,path:u,value:i}=t,{queryKey:s,queryHash:c}=t,l=s;if(l===void 0&&typeof c=="string"){let f=e.getQueryCache().get(c);if(!f)return{ok:!1,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.`};l=f.queryKey}if(l===void 0)return{ok:!1,error:"Refused: no query was named. Send `queryKey` (the array from listQueries) or `queryHash` (its string form)."};let d=e.getQueryData(l),p=e.getQueryCache().find({queryKey:l,exact:!0});if(d===void 0&&p&&(o!==void 0||u!==void 0)){let f=p,m=f?.state.status;return{ok:!1,error:`Refused: this query has no data to edit \u2014 ${m==="error"?`it FAILED${f?.state.error?` (${f.state.error instanceof Error?f.state.error.message:String(f.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&&u===void 0)return{ok:!1,error:"Refused: no change was described. Send `data` (with merge:true for a partial edit), or `path` and `value` to set one value."};let h=o;if(u!==void 0){if(i===void 0)return{ok:!1,error:`Refused: sent \`path\` without \`value\`. Say what to set "${u}" to; if you mean to clear it, send value:null and the field must already be nullable.`};let f=cl(d,u,i);if(!f.ok)return{ok:!1,error:`Refused: ${f.error}`};h=f.patch}if(n||u!==void 0){let f=a?{patch:h,notes:[],error:void 0}:ll(d,h);if(f.error)return{ok:!1,error:`Refused: ${f.error}`};let m=f.patch;if(!a){let S=pl(d,m,{noun:"data"});if(S.length>0){let v=fl(m,S);return{ok:!1,error:yl(S,"data",v),violations:S,...v?{suggestedData:v}:{}}}}let Q=Un(d,m),C=ml(d).filter(S=>gl(m,S));return e.setQueryData(l,Q,{updatedAt:Date.now()}),{ok:!0,mode:"merge",...u!==void 0?{path:u}:{},changedKeys:Dt(m)?Object.keys(m):void 0,...f.notes.length?{keyed:f.notes}:{},...C.length?{unchecked:C.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(!a&&Dt(d)&&Dt(o)){let f=Object.keys(d).filter(m=>!(m in o));if(f.length>0)return{ok:!1,error:`Refused: the new value drops ${f.length} top-level field(s) the cached value has (${f.slice(0,8).join(", ")}${f.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:f}}return e.setQueryData(l,o,{updatedAt:Date.now()}),{ok:!0,mode:"replace"}},triggerError:t=>{let o=r(t),n=o.options;o.setState({status:"error",error:new Error("Unknown error from devtools"),fetchMeta:{...o.state.fetchMeta,__previousQueryOptions:n}})},restoreError:t=>e.resetQueries(r(t)),triggerLoading:t=>{let o=r(t),n=o.options;o.fetch({...n,queryFn:()=>new Promise(()=>{}),gcTime:-1}).catch(()=>{}),o.setState({data:void 0,status:"pending",fetchMeta:{...o.state.fetchMeta,__previousQueryOptions:n}})},restoreLoading:t=>{let o=r(t),n=o.state,a=o.state.fetchMeta?o.state.fetchMeta.__previousQueryOptions:null;o.cancel({silent:!0}),o.setState({...n,fetchStatus:"idle",fetchMeta:null}),a&&o.fetch(a).catch(()=>{})},clearQueryCache:()=>{let t=e.getQueryCache().getAll().filter(o=>o.getObserversCount()>0).length;return e.getQueryCache().clear(),{ok:!0,cleared:!0,...t?{note:`Cleared \u2014 but ${t} quer${t===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:t=>{let{online:o}=t;ro.setOnline(o)}}}}import{useEffect as vl,useMemo as Tl}from"react";import{useQueryClient as kl}from"@tanstack/react-query";import{classifyPreviewItem as bl,createRestoreScope as Sl,emptyRestoreResult as wl,failedRestore as Cl,registerStateSnapshotProvider as xl,superJsonSerialize as Ml}from"@buoy-gg/shared-ui/web";function Xn(e){return{...e,fetchStatus:"idle",fetchMeta:null}}function no(e){return{status:e.state.status,error:e.state.error??null,data:e.state.data}}function ao(e,r){try{let t=JSON.stringify(e);return t.length>60?`${t.slice(0,57)}\u2026`:t}catch{return r}}function Gn(e){if(e==null)return e??null;if(typeof e=="object"){let r=e,t=typeof r.name=="string"?r.name:void 0,o=typeof r.message=="string"?r.message:void 0;if(t!==void 0||o!==void 0)return{...t!==void 0?{name:t}:{},...o!==void 0?{message:o}:{}}}return e}function Jn(e){if(e===void 0)return!0;try{return Ml(e),!0}catch{return!1}}function jn(e){let r=[],t=[];for(let o of e.getQueryCache().getAll()){let n=ao(o.queryKey,o.queryHash);if(!Jn(o.state.data)){r.push(`query ${n}: data can't be serialized (circular reference?) \u2014 not captured`);continue}t.push({queryKey:o.queryKey,queryHash:o.queryHash,...o.meta&&Jn(o.meta)?{meta:o.meta}:{},state:Xn({...o.state,error:Gn(o.state.error),fetchFailureReason:Gn(o.state.fetchFailureReason)})})}return{queries:t,warnings:r}}function Ql(e){return{id:"query",label:"React Query",status:()=>({canCapture:!0,canRestore:!0}),async capture(){let{queries:r,warnings:t}=jn(e),o=e.getMutationCache().getAll().length;return o>0&&t.push(`${o} mutation(s) not captured (mutation functions cannot be restored)`),{data:{queries:r},warnings:t}},async restore(r,t){let o=r,n=Sl(t),a=wl();if(!o?.queries)return Cl("empty query snapshot");let u=e.getQueryCache(),i=new Set(o.queries.map(l=>l.queryHash));for(let l of o.queries)if(n.allows(l.queryHash)){if(to(l.state.data)){a.skipped.push({id:l.queryHash,reason:"captured as an on-device placeholder by an older Buoy \u2014 re-capture this restore point"});continue}try{let d=Xn(l.state),p=u.get(l.queryHash);p?p.setState(d):u.build(e,{queryKey:l.queryKey,queryHash:l.queryHash,...l.meta&&{meta:l.meta}},d),a.applied+=1}catch(d){a.skipped.push({id:l.queryHash,reason:String(d)}),a.ok=!1}}for(let l of u.getAll().slice())if(n.allows(l.queryHash)&&!i.has(l.queryHash))try{u.remove(l),a.applied+=1}catch(d){a.skipped.push({id:l.queryHash,reason:String(d)})}let s=e.getMutationCache().getAll().length;s>0&&(e.getMutationCache().clear(),a.warnings.push(`mutation cache cleared (${s} mutation(s))`));let c=n.excludedWarning("quer(y/ies)");return c&&a.warnings.push(c),a},async previewItems(r,t){let o=r?.queries??[],n=t===void 0,a=n?jn(e).queries:t?.queries??[],u=new Map(a.map(l=>[l.queryHash,l])),i=new Map(o.map(l=>[l.queryHash,l])),s=[],c=[];for(let l of o){let d=ao(l.queryKey,l.queryHash);if(to(l.state.data)){s.push({key:l.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 p=u.get(l.queryHash);s.push(bl({key:l.queryHash,label:d,oldValue:p?no(p):void 0,newValue:no(l),inOld:p!==void 0,inNew:!0},{tooLargeReason:"query data too large to render a diff \u2014 restore still applies it"}))}for(let l of a)i.has(l.queryHash)||s.push({key:l.queryHash,label:ao(l.queryKey,l.queryHash),verdict:"removed",oldValue:no(l)});if(n){let l=e.getMutationCache().getAll().length;l>0&&c.push(`${l} in-memory mutation record(s) will be cleared`)}return{items:s,notes:c}}}}function Yn(e){return xl(Ql(e))}function Al(){let e;try{e=kl()}catch{e=null}return vl(()=>{if(e)return Yn(e)},[e]),Tl(()=>e?oo(e):null,[e])}function Zn({queryState:e,observerCount:r,isStale:t}){return e.fetchStatus==="fetching"?"blue":e.status==="error"?"red":r?e.fetchStatus==="paused"?"purple":t?"yellow":"green":"gray"}import{useQueryClient as Dl}from"@tanstack/react-query";import{jsx as fr,jsxs as Pe}from"react/jsx-runtime";function io(){try{let e=Dl(),r=e.getQueryCache().getAll(),t=e.getMutationCache().getAll();return Pe(y,{style:ue.container,children:[fr(b,{style:ue.title,children:"Debug Info"}),fr(b,{style:ue.info,children:"QueryClient: \u2705 Available"}),Pe(b,{style:ue.info,children:["Queries: ",r.length]}),Pe(b,{style:ue.info,children:["Mutations: ",t.length]}),r.length>0&&Pe(y,{style:ue.queriesList,children:[fr(b,{style:ue.subtitle,children:"Query Keys:"}),r.slice(0,3).map((o,n)=>Pe(b,{style:ue.queryKey,children:["\u2022"," ",Array.isArray(o.queryKey)?o.queryKey.join(" - "):String(o.queryKey)]},n)),r.length>3&&Pe(b,{style:ue.more,children:["... and ",r.length-3," more"]})]})]})}catch(e){return Pe(y,{style:ue.container,children:[fr(b,{style:ue.title,children:"Debug Info"}),Pe(b,{style:ue.error,children:["\u274C QueryClient Error: ",String(e)]})]})}}var ue=w.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 qe,jsxs as it}from"react/jsx-runtime";function Rl({queries:e,selectedQuery:r,isOpen:t,onClose:o,onSelect:n}){let a=u=>Array.isArray(u.queryKey)?u.queryKey.join(" - "):String(u.queryKey);return qe(hr,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:t,transparent:!0,animationType:"fade",onRequestClose:o,children:qe(gr,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:j.modalOverlay,onPress:o,children:it(y,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:j.modalContent,children:[it(y,{style:j.modalHeader,children:[qe(b,{style:j.modalTitle,children:"Select Query"}),it(b,{style:j.modalSubtitle,children:[e.length," ",e.length===1?"query":"queries"," ","available"]})]}),qe(z,{accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:j.scrollView,contentContainerStyle:j.scrollViewContent,showsVerticalScrollIndicator:!0,children:e.length===0?it(y,{style:j.emptyState,children:[qe(b,{style:j.emptyTitle,children:"No Queries Found"}),it(b,{style:j.emptyDescription,children:["No React Query queries are currently active.",`
|
|
8
|
+
|
|
9
|
+
`,"To see queries here:",`
|
|
10
|
+
`,"\u2022 Make API calls using useQuery",`
|
|
11
|
+
`,"\u2022 Ensure queries are within QueryClientProvider",`
|
|
12
|
+
`,"\u2022 Check console for debugging info"]}),qe(io,{})]}):e.map((u,i)=>{let s=a(u),c=Zn({queryState:u.state,observerCount:u.getObserversCount(),isStale:u.isStale()}),d={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"}[c]||"#6B7280",p=u===r;return it(E,{accessibilityLabel:`Query ${s}`,accessibilityHint:`View query ${s}`,"sentry-label":`ignore query ${s}`,style:[j.queryItem,p&&j.selectedQueryItem],onPress:()=>n(u),children:[qe(y,{style:[j.statusDot,{backgroundColor:d}]}),qe(b,{style:[j.queryText,p&&j.selectedQueryText],numberOfLines:1,children:s})]},`${u.queryHash}-${i}`)})})]})})})}var j=w.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 El,buoyColors as ea}from"@buoy-gg/shared-ui/web";import{jsx as so}from"react/jsx-runtime";var Il=()=>so(y,{style:{width:24,height:24},children:so(Ko,{})});function Pl({onPress:e,getReactBuoySubtitle:r}){return so(El,{id:"react-buoy-dev-tools",title:"QUERY",subtitle:(()=>{let n=r().match(/(\d+) queries • (\d+) mutations/);return n?`${n[1]}Q \u2022 ${n[2]}M`:"No data"})(),icon:Il,iconColor:ea.error,iconBackgroundColor:ea.error+"1A",onPress:e,index:1})}import{useContext as ql,useEffect as Vl}from"react";import{QueryClientContext as Fl}from"@tanstack/react-query";function Bl(){let e=ql(Fl);return Vl(()=>{e&&(xe.isConnected()||xe.setQueryClient(e))},[e]),null}import{VirtualizedDataExplorer as DS,DataViewer as RS,TypeLegend as ES}from"@buoy-gg/shared-ui/web/dataViewer";import{useMemo as Kl}from"react";import{useQueryClient as Ll}from"@tanstack/react-query";import{isDevToolsStorageKey as Ol}from"@buoy-gg/shared-ui/web";function ta(e){let r={mmkv:0,async:0,secure:0,total:0};return e.filter(o=>pe(o.queryKey)).forEach(o=>{let n=Qo(o.queryKey);if(n){let a=ko(o.queryKey);Ol(a)||(r[n]++,r.total++)}}),r}function Hl(){let e=Ll();return Kl(()=>{let t=e.getQueryCache().getAll();return ta(t)},[e])}function Wl(e){return{getReactBuoySubtitle:()=>{try{let t=e.getQueryCache().getAll(),o=e.getMutationCache().getAll();return`${t.length} queries \u2022 ${o.length} mutations`}catch{return"Data management & cache inspector"}}}}import{useState as le,useEffect as Nl}from"react";import{useEffect as zl,useCallback as uo}from"react";import{persistentStorage as ra}from"@buoy-gg/shared-ui/web";var Rt=async(e,r)=>{await ra.setItem(e,r)},pr=async e=>ra.getItem(e),Bb=async(e,r)=>{try{await Rt(`${e}_panel_dimensions`,JSON.stringify(r))}catch{}},Ob=async(e,r)=>{try{await Rt(`${e}_panel_height`,r.toString())}catch{}},Kb=async(e,r)=>{try{await Rt(`${e}_is_floating_mode`,r.toString())}catch{}},Lb=async e=>{try{let[r,t,o]=await Promise.all([pr(`${e}_panel_dimensions`),pr(`${e}_panel_height`),pr(`${e}_is_floating_mode`)]),n=r?JSON.parse(r):null,a=t?parseInt(t,10):null;return{dimensions:n,height:a,isFloating:o?o==="true":null}}catch{return{dimensions:null,height:null,isFloating:null}}},oa=async(e,r)=>{try{let t=JSON.stringify(r);await Rt(e,t)}catch{}},na=async e=>{try{let t=await pr(e);return t&&t!==""?JSON.parse(t):null}catch{return null}},aa=async e=>{try{await Rt(e,"")}catch{}};function lo({storagePrefix:e,isModalOpen:r,isDebugModalOpen:t,isEnvModalOpen:o=!1,isSentryModalOpen:n=!1,isStorageModalOpen:a=!1,isNetworkModalOpen:u=!1,selectedQueryKey:i,selectedSection:s,activeFilter:c,activeTab:l,selectedMutationId:d,isStateRestored:p}){let h=uo(async()=>{let Q={isModalOpen:r,isDebugModalOpen:t,isEnvModalOpen:o,isSentryModalOpen:n,isStorageModalOpen:a,isNetworkModalOpen:u,selectedQueryKey:i?JSON.stringify(i):void 0,selectedSection:s||void 0,activeFilter:c||void 0,activeTab:l||void 0,selectedMutationId:d?.toString()||void 0};await oa(e,Q)},[e,r,t,o,n,a,u,i,s,c,l,d]),f=uo(async()=>await na(e),[e]),m=uo(async()=>{await aa(e)},[e]);return zl(()=>{p&&(r||t||o||n||a||u?h():m())},[r,t,o,n,a,u,i,s,c,l,d,p,h,m]),{saveCurrentState:h,loadSavedState:f,clearSavedState:m}}import{devToolsStorageKeys as $l}from"@buoy-gg/shared-ui/web";function _l(){let[e,r]=le(!1),[t,o]=le(!1),[n,a]=le(!1),[u,i]=le(!1),[s,c]=le(!1),[l,d]=le(!1),[p,h]=le(void 0),[f,m]=le(null),[Q,C]=le(null),[S,v]=le(!1),[M,T]=le("queries"),[A,re]=le(void 0),{loadSavedState:ce}=lo({storagePrefix:$l.modal.state(),isModalOpen:e,isDebugModalOpen:t,isEnvModalOpen:n,isSentryModalOpen:u,isStorageModalOpen:s,isNetworkModalOpen:l,selectedQueryKey:p,selectedSection:f,activeFilter:Q,activeTab:M,selectedMutationId:A,isStateRestored:S});return Nl(()=>{(async()=>{if(!S)try{let B=await ce();if(B){if(r(B.isModalOpen),o(B.isDebugModalOpen),a(B.isEnvModalOpen||!1),i(B.isSentryModalOpen||!1),c(B.isStorageModalOpen||!1),d(B.isNetworkModalOpen||!1),B.selectedQueryKey)try{let ia=JSON.parse(B.selectedQueryKey);h(ia)}catch{}B.selectedSection&&m(B.selectedSection),B.activeFilter&&C(B.activeFilter),B.activeTab&&T(B.activeTab),B.selectedMutationId&&re(Number(B.selectedMutationId))}}catch{}finally{v(!0)}})()},[S,ce]),{isModalOpen:e,isDebugModalOpen:t,isEnvModalOpen:n,isSentryModalOpen:u,isStorageModalOpen:s,isNetworkModalOpen:l,selectedQueryKey:p,selectedSection:f,activeFilter:Q,isStateRestored:S,activeTab:M,selectedMutationId:A,setSelectedSection:m,setActiveFilter:C,setActiveTab:T,handleModalDismiss:()=>{r(!1),h(void 0)},handleDebugModalDismiss:()=>{o(!1),m(null)},handleEnvModalDismiss:()=>{a(!1)},handleSentryModalDismiss:()=>{i(!1)},handleStorageModalDismiss:()=>{c(!1)},handleNetworkModalDismiss:()=>{d(!1)},handleQuerySelect:Ve=>{h(Ve?.queryKey)},handleQueryPress:()=>{r(!0)},handleStatusPress:()=>{o(!0)},handleEnvPress:()=>{a(!0)},handleSentryPress:()=>{i(!0)},handleStoragePress:()=>{c(!0)},handleNetworkPress:()=>{d(!0)},handleTabChange:Ve=>{Ve!==M&&(h(void 0),re(void 0),C(null)),T(Ve)},handleMutationSelect:Ve=>{re(Ve?.mutationId)}}}import{safeStringify as aw,displayValue as iw,parseDisplayValue as sw}from"@buoy-gg/shared-ui/web";function Ul(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{$ as ActionButton,Yo as ClearCacheButton,Hr as DataEditorModal,Lr as DataEditorMode,RS as DataViewer,N as Explorer,Nr as MutationBrowserFooter,Gr as MutationBrowserModal,Wr as MutationBrowserMode,St as MutationButton,We as MutationDetails,wt as MutationDetailsChips,Yr as MutationEditorModal,jr as MutationEditorMode,Mt as MutationInformation,Zt as MutationStatusCount,Qt as MutationsList,rn as NetworkToggleButton,mt as QueryActions,yt as QueryBrowser,Fr as QueryBrowserFooter,Kr as QueryBrowserModal,qr as QueryBrowserMode,io as QueryDebugInfo,Ke as QueryDetails,ft as QueryDetailsChip,kr as QueryInformation,Lt as QueryRow,Rl as QuerySelector,_ as QueryStatus,Gt as QueryStatusCount,lr as ReactQueryDevToolsModal,Zr as ReactQueryModal,Se as ReactQueryModalHeader,Pl as ReactQuerySection,Bl as ReactQueryTracker,an as StorageStatusCount,_r as SwipeIndicator,ES as TypeLegend,DS as VirtualizedDataExplorer,Cr as WifiToggle,aa as clearModalVisibilityState,oo as createReactQuerySyncAdapter,Zu as createReactQueryTool,tl as createWifiToggleTool,Kt as deleteItem,Je as deleteNestedDataByPath,_u as disconnectQueryClient,iw as displayValue,ko as getCleanStorageKey,Zn as getQueryStatusColor,V as getQueryStatusLabel,ta as getStorageQueryCounts,Qo as getStorageType,To as getStorageTypeColor,id as getStorageTypeHexColor,vo as getStorageTypeLabel,Ut as invalidate,Ul as isPlainObject,pe as isStorageQuery,na as loadModalVisibilityState,Lb as loadPanelState,sw as parseDisplayValue,xe as reactQueryEventStore,Yu as reactQueryToolPreset,Xe as refetch,_t as remove,$t as reset,aw as safeStringify,Kb as saveFloatingMode,oa as saveModalVisibilityState,Bb as savePanelDimensions,Ob as savePanelHeight,$u as setQueryClient,we as storageQueryKeys,Ye as triggerError,je as triggerLoading,Ge as updateNestedDataByPath,or as useActionButtons,Er as useAllMutations,Oe as useAllQueries,kt as useGetMutationById,mr as useGetQueryByQueryKey,Ft as useGetQueryByQueryKeyWithVersion,_l as useModalManager,lo as useModalPersistence,Jr as useMutationActionButtons,Dr as useQueryStatusCounts,Wl as useReactQueryState,Al as useReactQuerySyncAdapter,Hl as useStorageQueryCounts,Sr as useWifiState,el as wifiTogglePreset};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/react-query",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.41",
|
|
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",
|
|
@@ -10,32 +10,44 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"react-native": "./lib/module/index.js",
|
|
13
|
+
"browser": {
|
|
14
|
+
"types": "./lib/typescript/index.d.ts",
|
|
15
|
+
"default": "./lib/web/index.mjs"
|
|
16
|
+
},
|
|
13
17
|
"import": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
18
|
+
"types": "./lib/typescript/index.d.ts",
|
|
19
|
+
"default": "./lib/module/index.js"
|
|
16
20
|
},
|
|
17
21
|
"require": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
22
|
+
"types": "./lib/typescript/index.d.ts",
|
|
23
|
+
"default": "./lib/commonjs/index.js"
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
|
-
"./package.json": "./package.json"
|
|
26
|
+
"./package.json": "./package.json",
|
|
27
|
+
"./web": {
|
|
28
|
+
"types": "./lib/typescript/index.d.ts",
|
|
29
|
+
"default": "./lib/web/index.mjs"
|
|
30
|
+
}
|
|
23
31
|
},
|
|
24
32
|
"files": [
|
|
25
33
|
"lib"
|
|
26
34
|
],
|
|
27
35
|
"sideEffects": [
|
|
28
36
|
"**/snapshotProvider.js",
|
|
29
|
-
"**/snapshotProvider.ts"
|
|
37
|
+
"**/snapshotProvider.ts",
|
|
38
|
+
"./lib/web/**/*.mjs",
|
|
39
|
+
"**/checkPeer.*"
|
|
30
40
|
],
|
|
31
41
|
"dependencies": {
|
|
32
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
33
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
42
|
+
"@buoy-gg/floating-tools-core": "^7.0.41",
|
|
43
|
+
"@buoy-gg/shared-ui": "^7.0.41"
|
|
34
44
|
},
|
|
35
45
|
"peerDependencies": {
|
|
36
46
|
"@tanstack/react-query": ">=5.0.0",
|
|
37
47
|
"react": "*",
|
|
38
|
-
"react-native": "*"
|
|
48
|
+
"react-native": "*",
|
|
49
|
+
"react-native-web": "^0.21.0",
|
|
50
|
+
"react-dom": ">=18"
|
|
39
51
|
},
|
|
40
52
|
"devDependencies": {
|
|
41
53
|
"@tanstack/react-query": "^5.89.0",
|
|
@@ -91,10 +103,22 @@
|
|
|
91
103
|
"tanstack-query",
|
|
92
104
|
"cache-inspector"
|
|
93
105
|
],
|
|
106
|
+
"peerDependenciesMeta": {
|
|
107
|
+
"react-native": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
110
|
+
"react-native-web": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
113
|
+
"react-dom": {
|
|
114
|
+
"optional": true
|
|
115
|
+
}
|
|
116
|
+
},
|
|
94
117
|
"scripts": {
|
|
95
|
-
"build": "bob build",
|
|
118
|
+
"build": "bob build && pnpm run build:web",
|
|
96
119
|
"typecheck": "tsc --noEmit",
|
|
97
120
|
"clean": "rimraf lib",
|
|
98
|
-
"test": "pnpm run typecheck"
|
|
121
|
+
"test": "pnpm run typecheck",
|
|
122
|
+
"build:web": "node ../../scripts/build-web.mjs react-query"
|
|
99
123
|
}
|
|
100
124
|
}
|