@buoy-gg/react-query 7.0.41 → 7.0.43

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