@buoy-gg/react-query 7.0.77 → 7.0.79

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