@buoy-gg/redux 7.0.63 → 7.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/redux/components/ReduxActionItem.js +1 -1
- package/lib/commonjs/redux/hooks/useAutoInstrumentRedux.js +1 -1
- package/lib/commonjs/redux/utils/activeStoreRegistry.js +1 -1
- package/lib/commonjs/redux/utils/connectReduxAdapter.js +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/redux/components/ReduxActionItem.js +1 -1
- package/lib/module/redux/hooks/useAutoInstrumentRedux.js +1 -1
- package/lib/module/redux/utils/activeStoreRegistry.js +1 -1
- package/lib/module/redux/utils/connectReduxAdapter.js +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/redux/utils/activeStoreRegistry.d.ts +1 -1
- package/lib/typescript/redux/utils/connectReduxAdapter.d.ts +4 -0
- package/lib/web/index.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -25,3 +25,17 @@ The [Redux guide](https://buoy.gg/buoy/latest/docs/tools/redux) covers setup, wh
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
27
|
<sub>Part of <a href="https://buoy.gg">Buoy</a>, developer tools that live inside your app. Proprietary software. © Buoy LLC. <a href="https://buoy.gg/terms">Terms</a></sub>
|
|
28
|
+
|
|
29
|
+
### Angular stores
|
|
30
|
+
|
|
31
|
+
NgRx apps can use `provideBuoyNgRx` from `@buoy-gg/angular/ngrx`.
|
|
32
|
+
It gives NgRx its own DevTools object through DI.
|
|
33
|
+
It never claims the browser's Redux extension global.
|
|
34
|
+
NGXS 22 apps use `provideBuoyNgxs` from `@buoy-gg/angular/ngxs`.
|
|
35
|
+
Use just one bridge for the Redux tool per app.
|
|
36
|
+
See the [Angular setup](https://buoy.gg/buoy/latest/docs/web/angular) for each one.
|
|
37
|
+
|
|
38
|
+
A store bridge can call `connectReduxAdapter(store)`.
|
|
39
|
+
The store must read state and dispatch actions.
|
|
40
|
+
It must also handle `@@buoy/JUMP_TO_STATE` with a state payload.
|
|
41
|
+
Call the returned stop function when the adapter stops.
|
package/lib/commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"BUOY_JUMP_TO_STATE",{enumerable:true,get:function(){return _buoyReduxMiddleware.BUOY_JUMP_TO_STATE}});Object.defineProperty(exports,"BUOY_REPLAY_ACTION",{enumerable:true,get:function(){return _buoyReduxMiddleware.BUOY_REPLAY_ACTION}});Object.defineProperty(exports,"FREE_TIER_ACTION_LIMIT",{enumerable:true,get:function(){return _ReduxModal.FREE_TIER_ACTION_LIMIT}});Object.defineProperty(exports,"REDUX_TEST_ID",{enumerable:true,get:function(){return _testIDs.REDUX_TEST_ID}});Object.defineProperty(exports,"ReduxActionDetailContent",{enumerable:true,get:function(){return _ReduxActionDetailContent.ReduxActionDetailContent}});Object.defineProperty(exports,"ReduxActionDetailFooter",{enumerable:true,get:function(){return _ReduxActionDetailContent.ReduxActionDetailFooter}});Object.defineProperty(exports,"ReduxActionDetailView",{enumerable:true,get:function(){return _ReduxActionDetailView.ReduxActionDetailView}});Object.defineProperty(exports,"ReduxActionItem",{enumerable:true,get:function(){return _ReduxActionItem.ReduxActionItem}});Object.defineProperty(exports,"ReduxAutoInstrument",{enumerable:true,get:function(){return _ReduxAutoInstrument.ReduxAutoInstrument}});Object.defineProperty(exports,"ReduxIcon",{enumerable:true,get:function(){return _ReduxIcon.ReduxIcon}});Object.defineProperty(exports,"ReduxModal",{enumerable:true,get:function(){return _ReduxModal.ReduxModal}});Object.defineProperty(exports,"ReduxToolView",{enumerable:true,get:function(){return _ReduxModal.ReduxToolView}});Object.defineProperty(exports,"actionRowTestID",{enumerable:true,get:function(){return _testIDs.actionRowTestID}});Object.defineProperty(exports,"buildActionRowTestIDs",{enumerable:true,get:function(){return _testIDs.buildActionRowTestIDs}});Object.defineProperty(exports,"buoyDevtoolsEnhancer",{enumerable:true,get:function(){return _devtoolsHook.buoyDevtoolsEnhancer}});Object.defineProperty(exports,"buoyReduxMiddleware",{enumerable:true,get:function(){return _buoyReduxMiddleware.buoyReduxMiddleware}});Object.defineProperty(exports,"claimDevtoolsHook",{enumerable:true,get:function(){return _devtoolsHook.claimDevtoolsHook}});Object.defineProperty(exports,"createBuoyReduxMiddleware",{enumerable:true,get:function(){return _buoyReduxMiddleware.createBuoyReduxMiddleware}});Object.defineProperty(exports,"createReduxHistoryAdapter",{enumerable:true,get:function(){return _createReduxHistoryAdapter.createReduxHistoryAdapter}});Object.defineProperty(exports,"createReduxTool",{enumerable:true,get:function(){return _preset.createReduxTool}});Object.defineProperty(exports,"getActiveStore",{enumerable:true,get:function(){return _autoInstrument.getActiveStore}});Object.defineProperty(exports,"getInstrumentationStatus",{enumerable:true,get:function(){return _autoInstrument.getInstrumentationStatus}});Object.defineProperty(exports,"instrumentStore",{enumerable:true,get:function(){return _autoInstrument.instrumentStore}});Object.defineProperty(exports,"isAutoInstrumentActive",{enumerable:true,get:function(){return _autoInstrument.isAutoInstrumentActive}});Object.defineProperty(exports,"isDevtoolsHookClaimed",{enumerable:true,get:function(){return _devtoolsHook.isDevtoolsHookClaimed}});Object.defineProperty(exports,"isStoreInstrumented",{enumerable:true,get:function(){return _autoInstrument.isStoreInstrumented}});Object.defineProperty(exports,"jumpToState",{enumerable:true,get:function(){return _buoyReduxMiddleware.jumpToState}});Object.defineProperty(exports,"reduxActionStore",{enumerable:true,get:function(){return _reduxActionStore.reduxActionStore}});Object.defineProperty(exports,"reduxHistoryAdapter",{enumerable:true,get:function(){return _createReduxHistoryAdapter.reduxHistoryAdapter}});Object.defineProperty(exports,"reduxSyncAdapter",{enumerable:true,get:function(){return _reduxSyncAdapter.reduxSyncAdapter}});Object.defineProperty(exports,"reduxToolPreset",{enumerable:true,get:function(){return _preset.reduxToolPreset}});Object.defineProperty(exports,"registerReduxStore",{enumerable:true,get:function(){return _autoInstrument.registerReduxStore}});Object.defineProperty(exports,"replayAction",{enumerable:true,get:function(){return _buoyReduxMiddleware.replayAction}});Object.defineProperty(exports,"slugForTestID",{enumerable:true,get:function(){return _testIDs.slugForTestID}});Object.defineProperty(exports,"uninstrumentStore",{enumerable:true,get:function(){return _autoInstrument.uninstrumentStore}});Object.defineProperty(exports,"useAutoInstrumentRedux",{enumerable:true,get:function(){return _useAutoInstrumentRedux.useAutoInstrumentRedux}});Object.defineProperty(exports,"useReduxActions",{enumerable:true,get:function(){return _useReduxActions.useReduxActions}});Object.defineProperty(exports,"useReduxAvailability",{enumerable:true,get:function(){return _useAutoInstrumentRedux.useReduxAvailability}});Object.defineProperty(exports,"withBuoyDevTools",{enumerable:true,get:function(){return _buoyReduxMiddleware.withBuoyDevTools}});require("./redux/utils/snapshotProvider");var _devtoolsHook=require("./redux/utils/devtoolsHook");var _preset=require("./preset");var _buoyReduxMiddleware=require("./redux/utils/buoyReduxMiddleware");var _autoInstrument=require("./redux/utils/autoInstrument");var _createReduxHistoryAdapter=require("./redux/utils/createReduxHistoryAdapter");var _reduxSyncAdapter=require("./redux/sync/reduxSyncAdapter");var _useReduxActions=require("./redux/hooks/useReduxActions");var _useAutoInstrumentRedux=require("./redux/hooks/useAutoInstrumentRedux");var _ReduxModal=require("./redux/components/ReduxModal");var _ReduxActionItem=require("./redux/components/ReduxActionItem");var _ReduxActionDetailView=require("./redux/components/ReduxActionDetailView");var _ReduxActionDetailContent=require("./redux/components/ReduxActionDetailContent");var _ReduxIcon=require("./redux/components/ReduxIcon");var _ReduxAutoInstrument=require("./redux/components/ReduxAutoInstrument");var _testIDs=require("./redux/utils/testIDs");var _reduxActionStore=require("./redux/utils/reduxActionStore");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"BUOY_JUMP_TO_STATE",{enumerable:true,get:function(){return _buoyReduxMiddleware.BUOY_JUMP_TO_STATE}});Object.defineProperty(exports,"BUOY_REPLAY_ACTION",{enumerable:true,get:function(){return _buoyReduxMiddleware.BUOY_REPLAY_ACTION}});Object.defineProperty(exports,"FREE_TIER_ACTION_LIMIT",{enumerable:true,get:function(){return _ReduxModal.FREE_TIER_ACTION_LIMIT}});Object.defineProperty(exports,"REDUX_TEST_ID",{enumerable:true,get:function(){return _testIDs.REDUX_TEST_ID}});Object.defineProperty(exports,"ReduxActionDetailContent",{enumerable:true,get:function(){return _ReduxActionDetailContent.ReduxActionDetailContent}});Object.defineProperty(exports,"ReduxActionDetailFooter",{enumerable:true,get:function(){return _ReduxActionDetailContent.ReduxActionDetailFooter}});Object.defineProperty(exports,"ReduxActionDetailView",{enumerable:true,get:function(){return _ReduxActionDetailView.ReduxActionDetailView}});Object.defineProperty(exports,"ReduxActionItem",{enumerable:true,get:function(){return _ReduxActionItem.ReduxActionItem}});Object.defineProperty(exports,"ReduxAutoInstrument",{enumerable:true,get:function(){return _ReduxAutoInstrument.ReduxAutoInstrument}});Object.defineProperty(exports,"ReduxIcon",{enumerable:true,get:function(){return _ReduxIcon.ReduxIcon}});Object.defineProperty(exports,"ReduxModal",{enumerable:true,get:function(){return _ReduxModal.ReduxModal}});Object.defineProperty(exports,"ReduxToolView",{enumerable:true,get:function(){return _ReduxModal.ReduxToolView}});Object.defineProperty(exports,"actionRowTestID",{enumerable:true,get:function(){return _testIDs.actionRowTestID}});Object.defineProperty(exports,"buildActionRowTestIDs",{enumerable:true,get:function(){return _testIDs.buildActionRowTestIDs}});Object.defineProperty(exports,"buoyDevtoolsEnhancer",{enumerable:true,get:function(){return _devtoolsHook.buoyDevtoolsEnhancer}});Object.defineProperty(exports,"buoyReduxMiddleware",{enumerable:true,get:function(){return _buoyReduxMiddleware.buoyReduxMiddleware}});Object.defineProperty(exports,"claimDevtoolsHook",{enumerable:true,get:function(){return _devtoolsHook.claimDevtoolsHook}});Object.defineProperty(exports,"connectReduxAdapter",{enumerable:true,get:function(){return _connectReduxAdapter.connectReduxAdapter}});Object.defineProperty(exports,"createBuoyReduxMiddleware",{enumerable:true,get:function(){return _buoyReduxMiddleware.createBuoyReduxMiddleware}});Object.defineProperty(exports,"createReduxHistoryAdapter",{enumerable:true,get:function(){return _createReduxHistoryAdapter.createReduxHistoryAdapter}});Object.defineProperty(exports,"createReduxTool",{enumerable:true,get:function(){return _preset.createReduxTool}});Object.defineProperty(exports,"getActiveStore",{enumerable:true,get:function(){return _autoInstrument.getActiveStore}});Object.defineProperty(exports,"getInstrumentationStatus",{enumerable:true,get:function(){return _autoInstrument.getInstrumentationStatus}});Object.defineProperty(exports,"instrumentStore",{enumerable:true,get:function(){return _autoInstrument.instrumentStore}});Object.defineProperty(exports,"isAutoInstrumentActive",{enumerable:true,get:function(){return _autoInstrument.isAutoInstrumentActive}});Object.defineProperty(exports,"isDevtoolsHookClaimed",{enumerable:true,get:function(){return _devtoolsHook.isDevtoolsHookClaimed}});Object.defineProperty(exports,"isStoreInstrumented",{enumerable:true,get:function(){return _autoInstrument.isStoreInstrumented}});Object.defineProperty(exports,"jumpToState",{enumerable:true,get:function(){return _buoyReduxMiddleware.jumpToState}});Object.defineProperty(exports,"reduxActionStore",{enumerable:true,get:function(){return _reduxActionStore.reduxActionStore}});Object.defineProperty(exports,"reduxHistoryAdapter",{enumerable:true,get:function(){return _createReduxHistoryAdapter.reduxHistoryAdapter}});Object.defineProperty(exports,"reduxSyncAdapter",{enumerable:true,get:function(){return _reduxSyncAdapter.reduxSyncAdapter}});Object.defineProperty(exports,"reduxToolPreset",{enumerable:true,get:function(){return _preset.reduxToolPreset}});Object.defineProperty(exports,"registerReduxStore",{enumerable:true,get:function(){return _autoInstrument.registerReduxStore}});Object.defineProperty(exports,"replayAction",{enumerable:true,get:function(){return _buoyReduxMiddleware.replayAction}});Object.defineProperty(exports,"slugForTestID",{enumerable:true,get:function(){return _testIDs.slugForTestID}});Object.defineProperty(exports,"uninstrumentStore",{enumerable:true,get:function(){return _autoInstrument.uninstrumentStore}});Object.defineProperty(exports,"useAutoInstrumentRedux",{enumerable:true,get:function(){return _useAutoInstrumentRedux.useAutoInstrumentRedux}});Object.defineProperty(exports,"useReduxActions",{enumerable:true,get:function(){return _useReduxActions.useReduxActions}});Object.defineProperty(exports,"useReduxAvailability",{enumerable:true,get:function(){return _useAutoInstrumentRedux.useReduxAvailability}});Object.defineProperty(exports,"withBuoyDevTools",{enumerable:true,get:function(){return _buoyReduxMiddleware.withBuoyDevTools}});require("./redux/utils/snapshotProvider");var _devtoolsHook=require("./redux/utils/devtoolsHook");var _preset=require("./preset");var _buoyReduxMiddleware=require("./redux/utils/buoyReduxMiddleware");var _autoInstrument=require("./redux/utils/autoInstrument");var _createReduxHistoryAdapter=require("./redux/utils/createReduxHistoryAdapter");var _reduxSyncAdapter=require("./redux/sync/reduxSyncAdapter");var _useReduxActions=require("./redux/hooks/useReduxActions");var _useAutoInstrumentRedux=require("./redux/hooks/useAutoInstrumentRedux");var _ReduxModal=require("./redux/components/ReduxModal");var _ReduxActionItem=require("./redux/components/ReduxActionItem");var _ReduxActionDetailView=require("./redux/components/ReduxActionDetailView");var _ReduxActionDetailContent=require("./redux/components/ReduxActionDetailContent");var _ReduxIcon=require("./redux/components/ReduxIcon");var _ReduxAutoInstrument=require("./redux/components/ReduxAutoInstrument");var _testIDs=require("./redux/utils/testIDs");var _reduxActionStore=require("./redux/utils/reduxActionStore");var _connectReduxAdapter=require("./redux/utils/connectReduxAdapter");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionItem=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _reduxActionStore=require("../utils/reduxActionStore");var _jsxRuntime=require("react/jsx-runtime");const OPERATION_COLORS=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function getOperationColor(t){if(t<=0)return{bg:"rgba(142, 142, 147, 0.2)",text:_sharedUi.buoyColors.textSecondary};return OPERATION_COLORS[(t-1)%OPERATION_COLORS.length]}const SLICE_COLORS={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function getSliceColor(t){if(!t)return"#6B7280";const e=t.toLowerCase();if(SLICE_COLORS[e]){return SLICE_COLORS[e]}for(const[r,n]of Object.entries(SLICE_COLORS)){if(e.includes(r)){return n}}const s=t.split("").reduce((r,n)=>r+n.charCodeAt(0),0);const u=s*137%360;return`hsl(${u}, 70%, 60%)`}function getStatusLabel(t,e){switch(t){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return e?e.charAt(0).toUpperCase()+e.slice(1):"Action"}}function getStatusColor(t,e,s){switch(t){case"pending":return _sharedUi.buoyColors.warning;case"fulfilled":return _sharedUi.buoyColors.success;case"rejected":return _sharedUi.buoyColors.error;case"internal":return _sharedUi.buoyColors.textMuted;case"query":return _sharedUi.buoyColors.info;case"mutation":return _sharedUi.buoyColors.info;default:return getSliceColor(s)}}function getSublabel(t){const e=[];if(t.duration!==void 0&&t.duration>=.1){e.push(`${t.duration.toFixed(1)}ms`)}if(t.hasStateChange){if(t.changedKeysCount&&t.changedKeysCount>0){e.push(`${t.changedKeysCount} key${t.changedKeysCount>1?"s":""} changed`)}else{e.push(t.diffSummary||"state changed")}}else{e.push("no state change")}return e.join(" \xB7 ")}function getActionBadge(t){return t.actionName?.toUpperCase()||t.type.split("/").pop()?.toUpperCase()||""}function getPrimaryText(t){if(t.category==="internal"){return t.type}const e=t.type.split("/");if(e.length>=3&&["pending","fulfilled","rejected"].includes(e[e.length-1])){return e.slice(0,-1).join("/")}return t.type}const ReduxActionItem=exports.ReduxActionItem=(0,_react.memo)(function t({action:e,onPress:s,linkedCount:u,testID:r}){const n=e.sliceName??void 0;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionItem=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _reduxActionStore=require("../utils/reduxActionStore");var _jsxRuntime=require("react/jsx-runtime");const OPERATION_COLORS=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function getOperationColor(t){if(t<=0)return{bg:"rgba(142, 142, 147, 0.2)",text:_sharedUi.buoyColors.textSecondary};return OPERATION_COLORS[(t-1)%OPERATION_COLORS.length]}const SLICE_COLORS={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function getSliceColor(t){if(!t)return"#6B7280";const e=t.toLowerCase();if(SLICE_COLORS[e]){return SLICE_COLORS[e]}for(const[r,n]of Object.entries(SLICE_COLORS)){if(e.includes(r)){return n}}const s=t.split("").reduce((r,n)=>r+n.charCodeAt(0),0);const u=s*137%360;return`hsl(${u}, 70%, 60%)`}function getStatusLabel(t,e){switch(t){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return e?e.charAt(0).toUpperCase()+e.slice(1):"Action"}}function getStatusColor(t,e,s){switch(t){case"pending":return _sharedUi.buoyColors.warning;case"fulfilled":return _sharedUi.buoyColors.success;case"rejected":return _sharedUi.buoyColors.error;case"internal":return _sharedUi.buoyColors.textMuted;case"query":return _sharedUi.buoyColors.info;case"mutation":return _sharedUi.buoyColors.info;default:return getSliceColor(s)}}function getSublabel(t){const e=[];if(t.duration!==void 0&&t.duration>=.1){e.push(`${t.duration.toFixed(1)}ms`)}if(t.hasStateChange){if(t.changedKeysCount&&t.changedKeysCount>0){e.push(`${t.changedKeysCount} key${t.changedKeysCount>1?"s":""} changed`)}else{e.push(t.diffSummary||"state changed")}}else{e.push("no state change")}return e.join(" \xB7 ")}function getActionBadge(t){return t.actionName?.toUpperCase()||t.type.split("/").pop()?.toUpperCase()||""}function getPrimaryText(t){if(t.category==="internal"){return t.type}const e=t.type.split("/");if(e.length>=3&&["pending","fulfilled","rejected"].includes(e[e.length-1])){return e.slice(0,-1).join("/")}return t.type}const ReduxActionItem=exports.ReduxActionItem=(0,_react.memo)(function t({action:e,onPress:s,linkedCount:u,testID:r}){const n=e.sliceName??void 0;const b=getStatusColor(e.category,e.hasStateChange,n);const g=getStatusLabel(e.category,n);const l=getSublabel(e);const i=getPrimaryText(e);const c=getActionBadge(e);const h=c&&c!==i.toUpperCase()?c:void 0;const o=(u??0)>1;const p=o?_reduxActionStore.reduxActionStore.getLinkedActions(e):[];const y=o?p.findIndex(C=>C.id===e.id)+1:0;const f=o&&e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationIndex(e.meta.requestId):0;const x=getOperationColor(f);const d=o?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:x.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:x.text}],testID:r?`${r}-seq`:void 0,children:[y,"/",u," #",f]})}):void 0;const a={statusColor:b,statusLabel:g,sublabel:l,primaryText:i,timestamp:e.timestamp,onPress:()=>s(e),testID:r,accessibilityLabel:`${i}, ${g}, ${l}`};if(e.isSlowAction){return(0,_jsxRuntime.jsx)(_sharedUi.ChangeRow,{...a,badgePrefix:d,slow:true})}if(e.category==="rejected"){return(0,_jsxRuntime.jsx)(_sharedUi.ChangeRow,{...a,customBadge:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[d,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,testID:r?`${r}-error`:void 0,children:(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.buoyColors.error})})]})})}if(o){return(0,_jsxRuntime.jsx)(_sharedUi.ChangeRow,{...a,badgePrefix:d,changed:e.hasStateChange})}if(e.hasStateChange){return(0,_jsxRuntime.jsx)(_sharedUi.ChangeRow,{...a,badgeText:h,changed:true})}return(0,_jsxRuntime.jsx)(_sharedUi.ChangeRow,{...a,plainBadgeText:h})});const styles=_reactNative.StyleSheet.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:_sharedUi.monoFont}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useAutoInstrumentRedux=useAutoInstrumentRedux;exports.useReduxAvailability=useReduxAvailability;var _reduxPeer=require("./reduxPeer");var _react=require("react");var _autoInstrument=require("../utils/autoInstrument");var _activeStoreRegistry=require("../utils/activeStoreRegistry");function useAutoInstrumentRedux(r={}){const{autoStart:e=true}=r;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useAutoInstrumentRedux=useAutoInstrumentRedux;exports.useReduxAvailability=useReduxAvailability;var _reduxPeer=require("./reduxPeer");var _react=require("react");var _autoInstrument=require("../utils/autoInstrument");var _activeStoreRegistry=require("../utils/activeStoreRegistry");function useAutoInstrumentRedux(r={}){const{autoStart:e=true}=r;const m=(0,_react.useRef)(r);m.current=r;const[v,n]=(0,_react.useState)(false);const[S,u]=(0,_react.useState)(true);const[g,a]=(0,_react.useState)(null);const[o,i]=(0,_react.useState)(null);const l=(0,_react.useRef)(null);const c=(0,_reduxPeer.getReactReduxUseStore)();const p=c!==null;let s=null;let d=null;let f=null;if(c){try{s=c()}catch(t){f="no-provider";d=t instanceof Error?t.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}}else{f="no-react-redux";d="react-redux is not installed or not available"}const x=(0,_autoInstrument.getInstrumentationStatus)().mechanism==="extension"?(0,_activeStoreRegistry.getActiveStore)():null;const R=(0,_react.useCallback)(()=>{if(!s&&x){n(true);i(x);a(null);u(false);return}if(!s){(0,_activeStoreRegistry.setReduxDiagnostic)(f);a(d||"No Redux store available");u(false);return}try{const t=(0,_autoInstrument.instrumentStore)(s,m.current);l.current=t;n(true);i(s);a(null)}catch(t){a(t instanceof Error?t.message:"Failed to instrument Redux store");n(false)}finally{u(false)}},[s,x]);const I=(0,_react.useCallback)(()=>{if(l.current){l.current();l.current=null}if(o){(0,_autoInstrument.uninstrumentStore)(o)}n(false);i(null)},[o]);(0,_react.useEffect)(()=>{if(e){R()}else{u(false)}return()=>{}},[e,R]);return{isInstrumented:v,isLoading:S,error:g,isReactReduxAvailable:p,captureMechanism:(0,_autoInstrument.getInstrumentationStatus)().mechanism,startInstrumentation:R,stopInstrumentation:I,store:o}}function useReduxAvailability(){const r=(0,_reduxPeer.getReactReduxUseStore)();if(!r){return{isAvailable:false,error:"react-redux is not installed"}}try{const e=r();return{isAvailable:e!==null&&e!==void 0,error:null}}catch(e){return{isAvailable:false,error:e instanceof Error?e.message:"Not inside a Redux Provider"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ENHANCER_SYMBOL=void 0;exports.getActiveStore=getActiveStore;exports.getCaptureMechanism=getCaptureMechanism;exports.getInstrumentationStatus=getInstrumentationStatus;exports.isTimeTravelAvailable=isTimeTravelAvailable;exports.markTimeTravelReducer=markTimeTravelReducer;exports.registerActiveStore=registerActiveStore;exports.setReduxDiagnostic=setReduxDiagnostic;exports.unregisterActiveStore=unregisterActiveStore;const ENHANCER_SYMBOL=exports.ENHANCER_SYMBOL=Symbol.for("@@buoy/enhancerInstrumented");let activeStore=null;let mechanism=null;let diagnostic=null;let timeTravelReducer=false;function registerActiveStore(e,t){activeStore=e;mechanism=t;diagnostic=null}function unregisterActiveStore(e){if(activeStore===e){activeStore=null;mechanism=null}}function getActiveStore(){return activeStore}function getCaptureMechanism(){return mechanism}function markTimeTravelReducer(){timeTravelReducer=true}function isTimeTravelAvailable(){return timeTravelReducer&&activeStore!==null}function setReduxDiagnostic(e){diagnostic=e}function getInstrumentationStatus(){return{mechanism,capture:mechanism==="enhancer"||mechanism==="middleware"?"full":mechanism==="patch"?"top-level-only":"none",hasStore:activeStore!==null,timeTravel:isTimeTravelAvailable(),diagnostic}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ENHANCER_SYMBOL=void 0;exports.getActiveStore=getActiveStore;exports.getCaptureMechanism=getCaptureMechanism;exports.getInstrumentationStatus=getInstrumentationStatus;exports.isTimeTravelAvailable=isTimeTravelAvailable;exports.markTimeTravelReducer=markTimeTravelReducer;exports.registerActiveStore=registerActiveStore;exports.setReduxDiagnostic=setReduxDiagnostic;exports.unregisterActiveStore=unregisterActiveStore;const ENHANCER_SYMBOL=exports.ENHANCER_SYMBOL=Symbol.for("@@buoy/enhancerInstrumented");let activeStore=null;let mechanism=null;let diagnostic=null;let timeTravelReducer=false;function registerActiveStore(e,t){activeStore=e;mechanism=t;diagnostic=null}function unregisterActiveStore(e){if(activeStore===e){activeStore=null;mechanism=null}}function getActiveStore(){return activeStore}function getCaptureMechanism(){return mechanism}function markTimeTravelReducer(){timeTravelReducer=true}function isTimeTravelAvailable(){return timeTravelReducer&&activeStore!==null}function setReduxDiagnostic(e){diagnostic=e}function getInstrumentationStatus(){return{mechanism,capture:mechanism==="enhancer"||mechanism==="middleware"||mechanism==="extension"?"full":mechanism==="patch"?"top-level-only":"none",hasStore:activeStore!==null,timeTravel:isTimeTravelAvailable(),diagnostic}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.connectReduxAdapter=connectReduxAdapter;var _activeStoreRegistry=require("./activeStoreRegistry");function connectReduxAdapter(e){(0,_activeStoreRegistry.registerActiveStore)(e,"extension");(0,_activeStoreRegistry.markTimeTravelReducer)();return()=>(0,_activeStoreRegistry.unregisterActiveStore)(e)}
|
package/lib/module/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import"./redux/utils/snapshotProvider";import"./redux/utils/devtoolsHook";export{reduxToolPreset,createReduxTool}from"./preset";export{buoyReduxMiddleware,createBuoyReduxMiddleware,withBuoyDevTools,jumpToState,replayAction,BUOY_JUMP_TO_STATE,BUOY_REPLAY_ACTION}from"./redux/utils/buoyReduxMiddleware";export{instrumentStore,uninstrumentStore,isStoreInstrumented,isAutoInstrumentActive,getActiveStore,getInstrumentationStatus,registerReduxStore}from"./redux/utils/autoInstrument";export{buoyDevtoolsEnhancer,claimDevtoolsHook,isDevtoolsHookClaimed}from"./redux/utils/devtoolsHook";export{createReduxHistoryAdapter,reduxHistoryAdapter}from"./redux/utils/createReduxHistoryAdapter";export{reduxSyncAdapter}from"./redux/sync/reduxSyncAdapter";export{useReduxActions}from"./redux/hooks/useReduxActions";export{useAutoInstrumentRedux,useReduxAvailability}from"./redux/hooks/useAutoInstrumentRedux";export{ReduxModal,ReduxToolView,FREE_TIER_ACTION_LIMIT}from"./redux/components/ReduxModal";export{ReduxActionItem}from"./redux/components/ReduxActionItem";export{ReduxActionDetailView}from"./redux/components/ReduxActionDetailView";export{ReduxActionDetailContent,ReduxActionDetailFooter}from"./redux/components/ReduxActionDetailContent";export{ReduxIcon}from"./redux/components/ReduxIcon";export{ReduxAutoInstrument}from"./redux/components/ReduxAutoInstrument";export{REDUX_TEST_ID,actionRowTestID,buildActionRowTestIDs,slugForTestID}from"./redux/utils/testIDs";export{reduxActionStore}from"./redux/utils/reduxActionStore";
|
|
1
|
+
"use strict";import"./redux/utils/snapshotProvider";import"./redux/utils/devtoolsHook";export{reduxToolPreset,createReduxTool}from"./preset";export{buoyReduxMiddleware,createBuoyReduxMiddleware,withBuoyDevTools,jumpToState,replayAction,BUOY_JUMP_TO_STATE,BUOY_REPLAY_ACTION}from"./redux/utils/buoyReduxMiddleware";export{instrumentStore,uninstrumentStore,isStoreInstrumented,isAutoInstrumentActive,getActiveStore,getInstrumentationStatus,registerReduxStore}from"./redux/utils/autoInstrument";export{buoyDevtoolsEnhancer,claimDevtoolsHook,isDevtoolsHookClaimed}from"./redux/utils/devtoolsHook";export{createReduxHistoryAdapter,reduxHistoryAdapter}from"./redux/utils/createReduxHistoryAdapter";export{reduxSyncAdapter}from"./redux/sync/reduxSyncAdapter";export{useReduxActions}from"./redux/hooks/useReduxActions";export{useAutoInstrumentRedux,useReduxAvailability}from"./redux/hooks/useAutoInstrumentRedux";export{ReduxModal,ReduxToolView,FREE_TIER_ACTION_LIMIT}from"./redux/components/ReduxModal";export{ReduxActionItem}from"./redux/components/ReduxActionItem";export{ReduxActionDetailView}from"./redux/components/ReduxActionDetailView";export{ReduxActionDetailContent,ReduxActionDetailFooter}from"./redux/components/ReduxActionDetailContent";export{ReduxIcon}from"./redux/components/ReduxIcon";export{ReduxAutoInstrument}from"./redux/components/ReduxAutoInstrument";export{REDUX_TEST_ID,actionRowTestID,buildActionRowTestIDs,slugForTestID}from"./redux/utils/testIDs";export{reduxActionStore}from"./redux/utils/reduxActionStore";export{connectReduxAdapter}from"./redux/utils/connectReduxAdapter";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{memo as
|
|
1
|
+
"use strict";import{memo as L}from"react";import{View as h,Text as O,StyleSheet as $}from"react-native";import{ChangeRow as c,buoyColors as n,AlertCircle as T,monoFont as P}from"@buoy-gg/shared-ui";import{reduxActionStore as B}from"../utils/reduxActionStore";import{jsxs as A,jsx as s}from"react/jsx-runtime";const F=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function R(t){if(t<=0)return{bg:"rgba(142, 142, 147, 0.2)",text:n.textSecondary};return F[(t-1)%F.length]}const b={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function k(t){if(!t)return"#6B7280";const e=t.toLowerCase();if(b[e]){return b[e]}for(const[r,o]of Object.entries(b)){if(e.includes(r)){return o}}const a=t.split("").reduce((r,o)=>r+o.charCodeAt(0),0);const d=a*137%360;return`hsl(${d}, 70%, 60%)`}function E(t,e){switch(t){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return e?e.charAt(0).toUpperCase()+e.slice(1):"Action"}}function z(t,e,a){switch(t){case"pending":return n.warning;case"fulfilled":return n.success;case"rejected":return n.error;case"internal":return n.textMuted;case"query":return n.info;case"mutation":return n.info;default:return k(a)}}function D(t){const e=[];if(t.duration!==void 0&&t.duration>=.1){e.push(`${t.duration.toFixed(1)}ms`)}if(t.hasStateChange){if(t.changedKeysCount&&t.changedKeysCount>0){e.push(`${t.changedKeysCount} key${t.changedKeysCount>1?"s":""} changed`)}else{e.push(t.diffSummary||"state changed")}}else{e.push("no state change")}return e.join(" \xB7 ")}function K(t){return t.actionName?.toUpperCase()||t.type.split("/").pop()?.toUpperCase()||""}function U(t){if(t.category==="internal"){return t.type}const e=t.type.split("/");if(e.length>=3&&["pending","fulfilled","rejected"].includes(e[e.length-1])){return e.slice(0,-1).join("/")}return t.type}export const ReduxActionItem=L(function t({action:e,onPress:a,linkedCount:d,testID:r}){const o=e.sliceName??void 0;const j=z(e.category,e.hasStateChange,o);const y=E(e.category,o);const C=D(e);const l=U(e);const f=K(e);const x=f&&f!==l.toUpperCase()?f:void 0;const u=(d??0)>1;const q=u?B.getLinkedActions(e):[];const w=u?q.findIndex(I=>I.id===e.id)+1:0;const m=u&&e.meta?.requestId?B.getAsyncOperationIndex(e.meta.requestId):0;const S=R(m);const p=u?s(h,{style:[g.asyncSequenceBadge,{backgroundColor:S.bg}],children:A(O,{style:[g.asyncSequenceText,{color:S.text}],testID:r?`${r}-seq`:void 0,children:[w,"/",d," #",m]})}):void 0;const i={statusColor:j,statusLabel:y,sublabel:C,primaryText:l,timestamp:e.timestamp,onPress:()=>a(e),testID:r,accessibilityLabel:`${l}, ${y}, ${C}`};if(e.isSlowAction){return s(c,{...i,badgePrefix:p,slow:true})}if(e.category==="rejected"){return s(c,{...i,customBadge:A(h,{style:g.badgeContainer,children:[p,s(h,{style:g.errorBadge,testID:r?`${r}-error`:void 0,children:s(T,{size:12,color:n.error})})]})})}if(u){return s(c,{...i,badgePrefix:p,changed:e.hasStateChange})}if(e.hasStateChange){return s(c,{...i,badgeText:x,changed:true})}return s(c,{...i,plainBadgeText:x})});const g=$.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:P}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{getReactReduxUseStore as
|
|
1
|
+
"use strict";import{getReactReduxUseStore as S}from"./reduxPeer";import{useEffect as k,useState as i,useRef as v,useCallback as g}from"react";import{instrumentStore as D,uninstrumentStore as F,getInstrumentationStatus as b}from"../utils/autoInstrument";import{setReduxDiagnostic as H,getActiveStore as L}from"../utils/activeStoreRegistry";export function useAutoInstrumentRedux(r={}){const{autoStart:e=true}=r;const p=v(r);p.current=r;const[I,s]=i(false);const[A,o]=i(true);const[h,u]=i(null);const[a,c]=i(null);const l=v(null);const f=S();const y=f!==null;let n=null;let d=null;let m=null;if(f){try{n=f()}catch(t){m="no-provider";d=t instanceof Error?t.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}}else{m="no-react-redux";d="react-redux is not installed or not available"}const x=b().mechanism==="extension"?L():null;const R=g(()=>{if(!n&&x){s(true);c(x);u(null);o(false);return}if(!n){H(m);u(d||"No Redux store available");o(false);return}try{const t=D(n,p.current);l.current=t;s(true);c(n);u(null)}catch(t){u(t instanceof Error?t.message:"Failed to instrument Redux store");s(false)}finally{o(false)}},[n,x]);const E=g(()=>{if(l.current){l.current();l.current=null}if(a){F(a)}s(false);c(null)},[a]);k(()=>{if(e){R()}else{o(false)}return()=>{}},[e,R]);return{isInstrumented:I,isLoading:A,error:h,isReactReduxAvailable:y,captureMechanism:b().mechanism,startInstrumentation:R,stopInstrumentation:E,store:a}}export function useReduxAvailability(){const r=S();if(!r){return{isAvailable:false,error:"react-redux is not installed"}}try{const e=r();return{isAvailable:e!==null&&e!==void 0,error:null}}catch(e){return{isAvailable:false,error:e instanceof Error?e.message:"Not inside a Redux Provider"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const ENHANCER_SYMBOL=Symbol.for("@@buoy/enhancerInstrumented");let t=null;let e=null;let r=null;let l=false;export function registerActiveStore(n,
|
|
1
|
+
"use strict";export const ENHANCER_SYMBOL=Symbol.for("@@buoy/enhancerInstrumented");let t=null;let e=null;let r=null;let l=false;export function registerActiveStore(n,o){t=n;e=o;r=null}export function unregisterActiveStore(n){if(t===n){t=null;e=null}}export function getActiveStore(){return t}export function getCaptureMechanism(){return e}export function markTimeTravelReducer(){l=true}export function isTimeTravelAvailable(){return l&&t!==null}export function setReduxDiagnostic(n){r=n}export function getInstrumentationStatus(){return{mechanism:e,capture:e==="enhancer"||e==="middleware"||e==="extension"?"full":e==="patch"?"top-level-only":"none",hasStore:t!==null,timeTravel:isTimeTravelAvailable(),diagnostic:r}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{registerActiveStore as r,unregisterActiveStore as t,markTimeTravelReducer as i}from"./activeStoreRegistry";export function connectReduxAdapter(e){r(e,"extension");i();return()=>t(e)}
|
|
@@ -73,4 +73,5 @@ export { REDUX_TEST_ID, actionRowTestID, buildActionRowTestIDs, slugForTestID, }
|
|
|
73
73
|
export type { ActionCategory, ActionMeta, ReduxAction, ReduxFilter, ReduxConnectorOptions, ReduxStoreMinimal, BuoyReduxMiddlewareOptions, } from "./redux/types";
|
|
74
74
|
/** @internal */
|
|
75
75
|
export { reduxActionStore } from "./redux/utils/reduxActionStore";
|
|
76
|
+
export { connectReduxAdapter } from './redux/utils/connectReduxAdapter';
|
|
76
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -20,7 +20,7 @@ export interface ActiveReduxStore {
|
|
|
20
20
|
* fallback). TOP-LEVEL-ONLY capture: actions dispatched from
|
|
21
21
|
* inside middleware/thunks bypass the patch.
|
|
22
22
|
*/
|
|
23
|
-
export type CaptureMechanism = "enhancer" | "middleware" | "patch";
|
|
23
|
+
export type CaptureMechanism = "enhancer" | "middleware" | "patch" | "extension";
|
|
24
24
|
/** Why there is no bound store, when there isn't one. */
|
|
25
25
|
export type ReduxDiagnostic = "no-react-redux" | "no-provider" | null;
|
|
26
26
|
/** Marks stores created through the Buoy devtools-hook enhancer. */
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ActiveReduxStore } from './activeStoreRegistry';
|
|
2
|
+
/** Bind a framework adapter that supports state reads, dispatch, and jumps. */
|
|
3
|
+
export declare function connectReduxAdapter(store: ActiveReduxStore): () => void;
|
|
4
|
+
//# sourceMappingURL=connectReduxAdapter.d.ts.map
|
package/lib/web/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var Bt=Object.defineProperty;var kr=Object.getOwnPropertyDescriptor;var Er=Object.getOwnPropertyNames;var $r=Object.prototype.hasOwnProperty;var Vr=(e,t)=>{for(var r in t)Bt(e,r,{get:t[r],enumerable:true})},Rt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Er(t))!$r.call(e,a)&&a!==r&&Bt(e,a,{get:()=>t[a],enumerable:!(o=kr(t,a))||o.enumerable});return e},zr=(e,t,r)=>(Rt(e,t,"default"),r&&Rt(r,t,"default"));var kt=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{classifyPreviewItem as Or,createRestoreScope as jr,registerStateSnapshotProvider as Lr,skippedRestore as Qe,unionKeys as Pr,wontApply as Wr}from"@buoy-gg/shared-ui/web";var Ze=Symbol.for("@@buoy/enhancerInstrumented"),me=null,be=null,et=null,Et=false;function ce(e,t){me=e,be=t,et=null}function Fr(e){me===e&&(me=null,be=null)}function de(){return me}function $t(){Et=true}function Re(){return Et&&me!==null}function Nr(e){et=e}function ue(){return{mechanism:be,capture:be==="enhancer"||be==="middleware"?"full":be==="patch"?"top-level-only":"none",hasStore:me!==null,timeTravel:Re(),diagnostic:et}}import{ChangeLog as Mr,approxJsonSize as Hr}from"@buoy-gg/shared-ui/web";var tt=25,rt=Object.freeze({__buoyStateEvicted:true,note:`Raw state retained for the ${tt} most recent actions only.`}),Vt=Object.freeze({__buoyStateOnDevice:true,note:"State trees stay on the device \u2014 fetched on demand via getActionDetail."}),_r=Object.freeze({__buoyPayloadOnDevice:true,note:"Payload stays on the device \u2014 fetched on demand via getActionDetail."});function ke(e){return typeof e=="object"&&e!==null&&e.__buoyPayloadOnDevice===true}function ee(e){if(typeof e!="object"||e===null)return false;let t=e;return t.__buoyStateEvicted===true||t.__buoyStateOnDevice===true}function qr(e){return e.startsWith("@@")?"internal":e.includes("/pending")?"pending":e.includes("/fulfilled")?"fulfilled":e.includes("/rejected")?"rejected":e.includes("/executeQuery")?"query":e.includes("/executeMutation")?"mutation":"action"}function Ur(e){if(e.startsWith("@@")){let r=e.split("/");return{sliceName:null,actionName:r[r.length-1]||e}}let t=e.split("/");if(t.length>=2){let r=t[0],o=t[1];return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])&&(o=t.slice(1,-1).join("/")),{sliceName:r,actionName:o.toUpperCase()}}return{sliceName:null,actionName:e.toUpperCase()}}function zt(e,t){return Hr(e,t).bytes>t}function Kr(e,t=40){if(e===void 0)return"";if(e===null)return"null";try{if(typeof e=="string")return e.length>t?`"${e.slice(0,t-3)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";if(zt(e,t))return`[${e.length} items]`;let r=JSON.stringify(e);return r.length>t?`[${e.length} items]`:r}if(typeof e=="object"){let r=Object.keys(e);if(r.length===0)return"{}";if(zt(e,t))return`{ ${r.length} keys }`;let o=JSON.stringify(e);return o.length<=t?o:`{ ${r.length} keys }`}return String(e).slice(0,t)}catch{return"[complex]"}}function Yr(e,t){if(e===t)return{summary:"no change",changedCount:0};if(typeof e!="object"||typeof t!="object"||e===null||t===null)return{summary:"changed",changedCount:1};let r=Object.keys(e),o=Object.keys(t),a=o.filter(u=>!r.includes(u)).length,n=r.filter(u=>!o.includes(u)).length,c=0;for(let u of r)o.includes(u)&&e[u]!==t[u]&&c++;let l=[];a>0&&l.push(`+${a}`),n>0&&l.push(`-${n}`),c>0&&l.push(`~${c}`);let s=a+n+c;return l.length===0?{summary:"nested change",changedCount:1}:{summary:`${l.join(" ")} ${s===1?"key":"keys"}`,changedCount:s}}function Jr(e){let t=e.meta;if(t)return{requestId:t.requestId,requestStatus:t.requestStatus,arg:t.arg,rejectedWithValue:t.rejectedWithValue,aborted:t.aborted,condition:t.condition}}var Gr=class extends Mr{addAction(e,t,r,o){if(!this.canRecord())return;let a=e.type||"";if(!a)return;let n=t!==r,c=qr(a),{sliceName:l,actionName:s}=Ur(a),u=Jr(e),h=Kr(e.payload),{summary:y,changedCount:b}=Yr(t,r),E=(o??0)>16,j={id:this.nextId(),type:a,payload:e.payload,action:e,timestamp:Date.now(),prevState:t,nextState:r,duration:o,hasStateChange:n,category:c,sliceName:l,actionName:s,meta:u,error:e.error,payloadPreview:h,diffSummary:y,changedKeysCount:b,isSlowAction:E};this.push(j);for(let V=tt;V<this.items.length;V++){let z=this.items[V];if(z.prevState!==rt)z.prevState=rt,z.nextState=rt;else break}this.notifyListeners()}getActions(){return this.getAll()}getActionById(e){return this.getById(e)}clearActions(){this.clear()}replaceActions(e){if(!this.getEnabled())return;let t=new Map;for(let o of this.items)o.prevState!==void 0&&!ee(o.prevState)&&t.set(o.id,o);let r=e.slice(0,this.max).map(o=>{let a=t.get(o.id);return!a||!ee(o.prevState)?o:{...o,prevState:a.prevState,nextState:a.nextState,payload:ke(o.payload)?a.payload:o.payload,action:ke(o.action)?a.action:o.action,meta:ke(o.meta?.arg)?a.meta:o.meta,error:ke(o.error)?a.error:o.error}});this.setItems(r)}hydrateAction(e,t){this.hydrateById(e,t)}setMaxActions(e){this.setMax(e)}getStats(){let e=this.items.length,t=this.items.filter(n=>n.hasStateChange).length,r=new Set(this.items.map(n=>n.type)),o=this.items.filter(n=>n.duration!==void 0).map(n=>n.duration),a=o.length>0?o.reduce((n,c)=>n+c,0)/o.length:0;return{totalActions:e,actionsWithChanges:t,actionsWithoutChanges:e-t,uniqueActionTypes:r.size,averageDuration:Math.round(a*100)/100}}filterActions(e){let t=[...this.items];if(e.searchText){let r=e.searchText.toLowerCase();t=t.filter(o=>o.type.toLowerCase().includes(r))}return e.actionTypes&&e.actionTypes.length>0&&(t=t.filter(r=>e.actionTypes.includes(r.type))),e.onlyWithChanges&&(t=t.filter(r=>r.hasStateChange)),t}getUniqueActionTypes(){return Array.from(new Set(this.items.map(e=>e.type))).sort()}getRelatedActions(e){return this.items.filter(t=>t.meta?.requestId===e).sort((t,r)=>t.timestamp-r.timestamp)}getLinkedActions(e){return e.meta?.requestId?this.getRelatedActions(e.meta.requestId):[]}getLinkedActionsCount(e){return e.meta?.requestId?this.items.filter(t=>t.meta?.requestId===e.meta?.requestId).length:0}getAsyncOperationDuration(e){let t=this.getRelatedActions(e);if(t.length<2)return null;let r=t.find(a=>a.category==="pending"),o=t.find(a=>a.category==="fulfilled"||a.category==="rejected");return r&&o?o.timestamp-r.timestamp:null}getBaseActionType(e){let t=e.split("/");if(t.length>=2){let r=t[t.length-1];if(["pending","fulfilled","rejected"].includes(r))return t.slice(0,-1).join("/")}return e}getAsyncOperationIndex(e){let t=new Map;for(let o of this.items)o.meta?.requestId&&!t.has(o.meta.requestId)&&t.set(o.meta.requestId,o.timestamp);let r=Array.from(t.entries()).sort((o,a)=>o[1]-a[1]).map(([o])=>o).indexOf(e);return r>=0?r+1:0}},x=new Gr;var ot=false;function Ot(){return ot}var xe="@@buoy/JUMP_TO_STATE",Xr="@@buoy/REPLAY_ACTION";function jt(e){if(ee(e)){console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");return}let t=de();if(!t){console.warn("[BuoyRedux] Cannot jump to state - no store instrumented");return}if(!Re()){console.warn("[BuoyRedux] Cannot jump to state - the root reducer cannot serve a state jump. Capture and time travel are wired separately: either put `import '@buoy-gg/redux';` first in your app entry (so Buoy is the store enhancer), or wrap your root reducer with withBuoyDevTools().");return}t.dispatch({type:xe,payload:e})}function Lt(e){let t=de();t?t.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}function Qr(e){return $t(),(t,r)=>r.type===xe?r.payload:e(t,r)}var Zr=e=>(ot=true,ce(e,"middleware"),t=>r=>{let o=r;if(o.type?.startsWith("@@buoy/"))return t(r);let a=performance.now(),n=e.getState(),c=t(r),l=e.getState(),s=performance.now()-a;return x.addAction(o,n,l,s),c});function eo(e={}){let{maxActions:t=200,ignoreActions:r=[]}=e;return x.setMaxActions(t),o=>(ot=true,ce(o,"middleware"),a=>n=>{let c=n,l=c.type||"";if(l?.startsWith("@@buoy/")||r.includes(l))return a(n);let s=performance.now(),u=o.getState(),h=a(n),y=o.getState(),b=performance.now()-s;return x.addAction(c,u,y,b),h})}var Ee="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function to(){let{mechanism:e,hasStore:t,diagnostic:r}=ue();return t?e==="patch"?{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${Ee}`}:{canCapture:true,canRestore:true,detail:e==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}:{canCapture:false,canRestore:false,detail:r==="no-react-redux"?"react-redux not installed":r==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}async function ro(){let e=de();return e?{data:{state:e.getState()},warnings:[]}:{data:null,warnings:["no Redux store instrumented"]}}async function oo(e,t){let r=e,o=de();if(!o||r===void 0||r===null)return Qe("redux",o?"empty redux snapshot":"no Redux store instrumented");let{mechanism:a}=ue();if(a==="patch")return Qe("redux",`restore unavailable on auto-instrumented stores \u2014 ${Ee}`);let n=jr(t),c=Object.keys(r.state??{}).filter(s=>!n.touch(s)),l=r.state;if(c.length>0){let s=o.getState(),u={...r.state};for(let h of c)u[h]=s?.[h];l=u}if(o.dispatch({type:xe,payload:l}),o.getState()===l){let s=c.length>0?[`${c.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:s}}return Qe("redux",`store ignored the state jump \u2014 ${Ee}`)}async function ao(e,t){let r=e?.state,o=t===void 0,a=de(),n=o?a?.getState():t?.state,c=[],l=[],s;if(o){let{mechanism:y,hasStore:b}=ue();b?y==="patch"&&(s=`auto-instrumented store cannot be restored \u2014 ${Ee}`):s="no Redux store instrumented"}let u=n??{},h=r??{};for(let y of Pr(u,h)){let b=Or({key:y,label:y,oldValue:u[y],newValue:h[y],inOld:Object.prototype.hasOwnProperty.call(u,y),inNew:Object.prototype.hasOwnProperty.call(h,y)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});s&&(b=Wr(b,s)),c.push(b)}return s&&l.push(`Redux restore unavailable: ${s}`),{items:c,notes:l}}Lr({id:"redux",label:"Redux",status:to,capture:ro,restore:oo,previewItems:ao});function at(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...o)=>t(r(...o)))}function Pt(e){return $t(),(t,r)=>r&&r.type===xe?r.payload:e(t,r)}function no(e){if(typeof e!="object"||e===null)return false;let t=e.type;return typeof t!="string"?false:!t.startsWith("@@buoy/")&&!t.startsWith("@@redux/")}var $e=e=>(t,r)=>{let o=e(Pt(t),r),a={...o,dispatch:n=>{if(!no(n)||Ot())return o.dispatch(n);let c=performance.now(),l=o.getState(),s=o.dispatch(n);return x.addAction(n,l,o.getState(),performance.now()-c),s},replaceReducer:n=>o.replaceReducer(Pt(n)),[Ze]:true};return ce(a,"enhancer"),a};function io(...e){return e.length===0?at($e):e.length===1&&typeof e[0]=="object"&&e[0]!==null?(...t)=>at(...t,$e):at(...e,$e)}var nt=false;function Wt(){if(!(typeof kt<"u"&&kt))return false;let e=globalThis;return e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||(e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__=io,nt=true),nt}function lo(){return nt}Wt();import{useState as Ve,useMemo as we,useRef as ze,useCallback as te,useEffect as Ft}from"react";var Nt={};Vr(Nt,{AccessibilityInfo:()=>po,ActivityIndicator:()=>ia,Alert:()=>ca,Animated:()=>go,AppRegistry:()=>fo,AppState:()=>yo,Appearance:()=>ho,BackHandler:()=>mo,Button:()=>la,CheckBox:()=>Vo,Clipboard:()=>bo,DeviceEventEmitter:()=>Yo,Dimensions:()=>xo,Easing:()=>Co,FlatList:()=>Mt,I18nManager:()=>So,Image:()=>zo,ImageBackground:()=>Oo,InteractionManager:()=>vo,Keyboard:()=>wo,KeyboardAvoidingView:()=>jo,LayoutAnimation:()=>To,Linking:()=>Ao,LogBox:()=>Ko,Modal:()=>aa,NativeEventEmitter:()=>Io,NativeModules:()=>uo,PanResponder:()=>Do,Picker:()=>Lo,PixelRatio:()=>Bo,Platform:()=>Ro,Pressable:()=>oa,ProgressBar:()=>Po,RefreshControl:()=>Wo,SafeAreaView:()=>Fo,ScrollView:()=>Oe,SectionList:()=>No,Share:()=>ko,StatusBar:()=>Mo,StyleSheet:()=>pe,Switch:()=>na,Text:()=>f,TextInput:()=>ea,Touchable:()=>Ho,TouchableHighlight:()=>ta,TouchableNativeFeedback:()=>_o,TouchableOpacity:()=>J,TouchableWithoutFeedback:()=>ra,UIManager:()=>Eo,Vibration:()=>$o,View:()=>i,VirtualizedList:()=>qo,YellowBox:()=>Uo,findNodeHandle:()=>sa,unstable_createElement:()=>co,useColorScheme:()=>Jo,useLocaleContext:()=>Go,useWindowDimensions:()=>Xo});zr(Nt,so);import*as so from"react-native-web";import{unstable_createElement as co,NativeModules as uo,AccessibilityInfo as po,Animated as go,Appearance as ho,AppRegistry as fo,AppState as yo,BackHandler as mo,Clipboard as bo,Dimensions as xo,Easing as Co,I18nManager as So,Keyboard as wo,InteractionManager as vo,LayoutAnimation as To,Linking as Ao,NativeEventEmitter as Io,PanResponder as Do,PixelRatio as Bo,Platform as Ro,Share as ko,StyleSheet as pe,UIManager as Eo,Vibration as $o,CheckBox as Vo,FlatList as Mt,Image as zo,ImageBackground as Oo,KeyboardAvoidingView as jo,Picker as Lo,ProgressBar as Po,RefreshControl as Wo,SafeAreaView as Fo,SectionList as No,StatusBar as Mo,Touchable as Ho,TouchableNativeFeedback as _o,VirtualizedList as qo,YellowBox as Uo,LogBox as Ko,DeviceEventEmitter as Yo,useColorScheme as Jo,useLocaleContext as Go,useWindowDimensions as Xo}from"react-native-web";import*as H from"react-native-web";import{createElement as Qo,forwardRef as Zo}from"react";function q(e){let t=Zo((o,a)=>{let{accessibilityState:n,accessibilityValue:c,...l}=o;for(let s of["busy","checked","disabled","expanded","selected"])n?.[s]!==void 0&&l[`aria-${s}`]===void 0&&(l[`aria-${s}`]=n[s]);for(let[s,u]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[s]!==void 0&&l[`aria-${u}`]===void 0&&(l[`aria-${u}`]=c[s]);return Qo(e,{...l,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var i=q(H.View),f=q(H.Text),ea=q(H.TextInput),J=q(H.TouchableOpacity),ta=q(H.TouchableHighlight),ra=q(H.TouchableWithoutFeedback),oa=q(H.Pressable),Oe=q(H.ScrollView),aa=q(H.Modal),na=q(H.Switch),ia=q(H.ActivityIndicator),la=q(H.Button),sa=H.findNodeHandle,ca={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 c=document.createElement("div");c.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let l=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let u of l){let h=document.createElement("button");h.type="button",h.textContent=u.text??"OK",h.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,h.onclick=()=>{s(),u.onPress?.()},c.appendChild(h)}a.addEventListener("cancel",u=>{u.preventDefault(),o?.cancelable!==false&&(s(),o?.onDismiss?.())}),a.appendChild(c),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{JsModal as da,ModalHeader as re,macOSColors as G,night as v,Search as ua,Trash2 as pa,Power as ga,Zap as ha,CheckCircle as fa,Copy as ya,Lock as ma,AlertTriangle as Ht,devToolsStorageKeys as ba,copyToClipboard as xa,ProUpgradeModal as Ca,PowerToggleButton as Sa,TickProvider as _t,useLimit as wa,TIER_LIMITS as va,windowDragProps as Ta,ToolEmptyState as Aa,resolveListEmptyState as Ia,EVENT_LIST_PRESET as Da,monoFont as Ba}from"@buoy-gg/shared-ui/web";import{useIsPro as Ra}from"@buoy-gg/license/web";import{useState as ka,useMemo as qt,useCallback as Ut}from"react";import{useChangeLog as Ea}from"@buoy-gg/shared-ui/web";var $a=(e,t)=>x.filterActions(t);function Kt(){let e=Ea(x,{filterItems:$a}),[t,r]=ka(null),o=qt(()=>x.getStats(),[e.items]),a=qt(()=>x.getUniqueActionTypes(),[e.items]),n=Ut(()=>{x.clearActions(),r(null)},[]),c=Ut(l=>x.getActionById(l),[]);return{actions:e.items,filteredActions:e.filteredItems,filter:e.filter,setFilter:e.setFilter,stats:o,clearActions:n,isEnabled:e.isEnabled,toggleCapture:e.toggleCapture,actionTypes:a,getActionById:c,selectedAction:t,setSelectedAction:r}}import{useStore as Va}from"react-redux";function Yt(){return Va}import{useEffect as za,useState as je,useRef as Jt,useCallback as Gt}from"react";var ve=Symbol.for("@@buoy/instrumented"),it=Symbol.for("@@buoy/originalDispatch");function Oa(e){let t=e;return t[ve]===true||t[Ze]===true}function lt(e,t={}){let r=e;if(r[Ze])return ce(e,"enhancer"),()=>{};if(Ot())return ce(e,"middleware"),()=>{};if(r[ve])return ce(e,"patch"),()=>{};let{maxActions:o=200,ignoreActions:a=[]}=t;x.setMaxActions(o);let n=e.dispatch.bind(e);r[it]=n;let c=(l=>{if(typeof l!="object"||l===null||typeof l.type!="string")return n(l);let s=l.type;if(s.startsWith("@@buoy/")||s.startsWith("@@redux/")||a.includes(s))return n(l);let u=performance.now(),h=e.getState(),y=n(l),b=e.getState(),E=performance.now()-u;return x.addAction(l,h,b,E),y});return e.dispatch=c,r[ve]=true,ce(e,"patch"),()=>{st(e)}}function st(e){let t=e;if(t[ve]){let r=t[it];r&&(e.dispatch=r),delete t[ve],delete t[it]}Fr(e)}function ja(e,t={}){return lt(e,t)}function Le(){return de()}function La(){return de()!==null}function ct(e={}){let{autoStart:t=true}=e,r=Jt(e);r.current=e;let[o,a]=je(false),[n,c]=je(true),[l,s]=je(null),[u,h]=je(null),y=Jt(null),b=Yt(),E=b!==null,j=null,V=null,z=null;if(b)try{j=b()}catch(L){z="no-provider",V=L instanceof Error?L.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else z="no-react-redux",V="react-redux is not installed or not available";let F=Gt(()=>{if(!j){Nr(z),s(V||"No Redux store available"),c(false);return}try{let L=lt(j,r.current);y.current=L,a(true),h(j),s(null)}catch(L){s(L instanceof Error?L.message:"Failed to instrument Redux store"),a(false)}finally{c(false)}},[j]),B=Gt(()=>{y.current&&(y.current(),y.current=null),u&&st(u),a(false),h(null)},[u]);return za(()=>(t?F():c(false),()=>{}),[t,F]),{isInstrumented:o,isLoading:n,error:l,isReactReduxAvailable:E,captureMechanism:ue().mechanism,startInstrumentation:F,stopInstrumentation:B,store:u}}function Pa(){let e=Yt();if(!e)return{isAvailable:false,error:"react-redux is not installed"};try{let t=e();return{isAvailable:t!=null,error:null}}catch(t){return{isAvailable:false,error:t instanceof Error?t.message:"Not inside a Redux Provider"}}}import{memo as Wa}from"react";import{ChangeRow as Te,buoyColors as oe,AlertCircle as Fa,monoFont as Na}from"@buoy-gg/shared-ui/web";import{jsx as ae,jsxs as Xt}from"react/jsx-runtime";var Qt=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function Ma(e){return e<=0?{bg:"rgba(142, 142, 147, 0.2)",text:oe.textSecondary}:Qt[(e-1)%Qt.length]}var dt={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function Ha(e){if(!e)return"#6B7280";let t=e.toLowerCase();if(dt[t])return dt[t];for(let[r,o]of Object.entries(dt))if(t.includes(r))return o;return`hsl(${e.split("").reduce((r,o)=>r+o.charCodeAt(0),0)*137%360}, 70%, 60%)`}function _a(e,t){switch(e){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return t?t.charAt(0).toUpperCase()+t.slice(1):"Action"}}function qa(e,t,r){switch(e){case"pending":return oe.warning;case"fulfilled":return oe.success;case"rejected":return oe.error;case"internal":return oe.textMuted;case"query":return oe.info;case"mutation":return oe.info;default:return Ha(r)}}function Ua(e){let t=[];return e.duration!==void 0&&e.duration>=.1&&t.push(`${e.duration.toFixed(1)}ms`),e.hasStateChange?e.changedKeysCount&&e.changedKeysCount>0?t.push(`${e.changedKeysCount} key${e.changedKeysCount>1?"s":""} changed`):t.push(e.diffSummary||"state changed"):t.push("no state change"),t.join(" \xB7 ")}function Ka(e){return e.actionName?.toUpperCase()||e.type.split("/").pop()?.toUpperCase()||""}function Ya(e){if(e.category==="internal")return e.type;let t=e.type.split("/");return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])?t.slice(0,-1).join("/"):e.type}var Zt=Wa(function({action:e,onPress:t,linkedCount:r,testID:o}){let a=e.sliceName??void 0,n=qa(e.category,e.hasStateChange,a),c=_a(e.category,a),l=Ua(e),s=Ya(e),u=Ka(e),h=(r??0)>1,y=h?x.getLinkedActions(e):[],b=h?y.findIndex(F=>F.id===e.id)+1:0,E=h&&e.meta?.requestId?x.getAsyncOperationIndex(e.meta.requestId):0,j=Ma(E),V=h?ae(i,{style:[Pe.asyncSequenceBadge,{backgroundColor:j.bg}],children:Xt(f,{style:[Pe.asyncSequenceText,{color:j.text}],testID:o?`${o}-seq`:void 0,children:[b,"/",r," #",E]})}):void 0,z={statusColor:n,statusLabel:c,sublabel:l,primaryText:s,timestamp:e.timestamp,onPress:()=>t(e),testID:o,accessibilityLabel:`${s}, ${c}, ${l}`};return e.isSlowAction?ae(Te,{...z,badgePrefix:V,slow:true}):e.category==="rejected"?ae(Te,{...z,customBadge:Xt(i,{style:Pe.badgeContainer,children:[V,ae(i,{style:Pe.errorBadge,testID:o?`${o}-error`:void 0,children:ae(Fa,{size:12,color:oe.error})})]})}):h?ae(Te,{...z,badgePrefix:V,changed:e.hasStateChange}):e.hasStateChange?ae(Te,{...z,badgeText:u,changed:true}):ae(Te,{...z,plainBadgeText:u})}),Pe=pe.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:Na}});import{useState as er,useCallback as We,useMemo as tr}from"react";import{macOSColors as Ae,night as X,EventStepperFooter as rr,formatRelativeTime as Fe,parseValue as Ne,monoFont as Ie}from"@buoy-gg/shared-ui/web";import{DataViewer as Ja,SplitDiffViewer as Ga,TreeDiffViewer as Xa,diffThemes as Qa}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as Za}from"react";import{DetailViewToggle as en,FileText as tn,Database as rn,GitBranch as on}from"@buoy-gg/shared-ui/web";import{jsx as an}from"react/jsx-runtime";var nn=[{key:"action",label:"ACTION",description:"View action details",icon:tn},{key:"state",label:"STATE",description:"View current state",icon:rn},{key:"diff",label:"DIFF",description:"Compare changes",icon:on}],ln=["diff"],sn=Za(function({activeView:e,onViewChange:t,diffDisabled:r=false}){return an(en,{views:nn,activeView:e,onViewChange:t,disabledKeys:r?ln:void 0,testIDPrefix:"buoy-redux"})});import{memo as cn,useMemo as dn,useCallback as Me,useState as un,useEffect as pn}from"react";import{buoyColors as I,night as S,Clock as gn,AlertTriangle as hn,Zap as fn,Hash as or,Info as yn,Box as mn,AlertCircle as bn,FileText as xn,parseValue as He,ProUpgradeModal as Cn,copyToClipboard as ar,InfoRow as ne,monoFont as ie}from"@buoy-gg/shared-ui/web";import{useIsPro as Sn}from"@buoy-gg/license/web";import{DataViewer as _e}from"@buoy-gg/shared-ui/web/dataViewer";import{night as D,monoFont as wn}from"@buoy-gg/shared-ui/web";import{jsx as nr,jsxs as vn}from"react/jsx-runtime";var Tn={replay:{color:D.color.accent,backgroundColor:D.color.accent+"15",borderColor:D.color.accent+"40",textColor:D.color.accent},copy:{color:D.color.accent,backgroundColor:D.color.accent+"15",borderColor:D.color.accent+"40",textColor:D.color.accent},jump:{color:D.color.warning,backgroundColor:D.color.warning+"15",borderColor:D.color.warning+"40",textColor:D.color.warning},skip:{color:D.color.textSecondary,backgroundColor:D.color.textSecondary+"26",borderColor:D.color.textSecondary+"59",textColor:D.color.textSecondary},clear:{color:D.color.danger,backgroundColor:D.color.danger+"15",borderColor:D.color.danger+"40",textColor:D.color.danger},diff:{color:D.color.info,backgroundColor:D.color.info+"15",borderColor:D.color.info+"40",textColor:D.color.info}};function qe({onPress:e,text:t,type:r,disabled:o=false,testID:a}){let n=Tn[r];return vn(J,{testID:a,disabled:o,onPress:e,style:[ut.button,{backgroundColor:o?D.color.textTertiary+"1A":n.backgroundColor,borderColor:o?D.color.textTertiary+"33":n.borderColor,opacity:o?.5:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},children:[nr(i,{style:[ut.dot,{backgroundColor:o?D.color.textTertiary:n.color}]}),nr(f,{style:[ut.text,{color:o?D.color.textTertiary:n.textColor}],children:t})]})}var ut=pe.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:6,borderWidth:1,paddingHorizontal:12,paddingVertical:6,height:25,minWidth:80,shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:2},dot:{width:5,height:5,borderRadius:3,marginRight:6,shadowColor:D.color.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:wn,height:12}});var g="buoy-redux";function ir(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function lr(e,t){return`${g}-row-${ir(e)}-${t}`}function sr(e){let t=new Map,r=new Map;for(let o of e){let a=(t.get(o.type)??0)+1;t.set(o.type,a),r.set(o.id,lr(o.type,a))}return r}import{jsx as p,jsxs as R}from"react/jsx-runtime";function cr(e){switch(e){case"pending":return{label:"PENDING",color:I.warning,bgColor:I.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:I.success,bgColor:I.success+"26"};case"rejected":return{label:"REJECTED",color:I.error,bgColor:I.error+"26"};case"internal":return{label:"INTERNAL",color:I.textMuted,bgColor:I.textMuted+"26"};case"query":return{label:"QUERY",color:I.info,bgColor:I.info+"26"};case"mutation":return{label:"MUTATION",color:I.info,bgColor:I.info+"26"};default:return{label:"ACTION",color:I.info,bgColor:I.info+"26"}}}function An(e){return e===void 0?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function Ce({icon:e,title:t,badge:r,testID:o}){return R(i,{style:d.sectionHeader,testID:o,children:[R(i,{style:d.sectionHeaderLeft,children:[p(e,{size:14,color:S.color.accent}),p(f,{style:d.sectionTitle,children:t})]}),r]})}function In(e){let t=new Date(e),r=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0"),n=t.getMilliseconds().toString().padStart(3,"0");return`${r}:${o}:${a}.${n}`}var Dn=cn(function({action:e,onNavigateToAction:t}){let r=Sn(),[o,a]=un(false);pn(()=>{o&&r&&a(false)},[o,r]);let n=cr(e.category),c=ee(e.nextState),l=Re(),s=c||!l,u=e.payload!==void 0,h=e.meta&&Object.keys(e.meta).length>0,y=e.error!==void 0,b=dn(()=>x.getLinkedActions(e),[e]),E=b.length>1,j=E?x.getBaseActionType(e.type):null,V=e.meta?.requestId?x.getAsyncOperationDuration(e.meta.requestId):null,z=Me(async()=>{if(!r){a(true);return}await ar(e.action)},[e,r]),F=Me(async()=>{if(!r){a(true);return}await ar(e.payload)},[e.payload,r]),B=Me(()=>{e.action&&typeof e.action=="object"&&"type"in e.action&&Lt(e.action)},[e]),L=Me(()=>{e.nextState!==void 0&&jt(e.nextState)},[e]);return R(Oe,{testID:`${g}-detail-scroll`,style:d.container,contentContainerStyle:d.contentContainer,showsVerticalScrollIndicator:false,children:[R(i,{style:d.card,testID:`${g}-info-card`,children:[p(Ce,{icon:yn,title:"ACTION INFO"}),R(i,{style:d.cardContent,children:[p(ne,{label:"Type",value:e.type,mono:true,testID:`${g}-info-type`}),e.sliceName&&p(ne,{label:"Slice",value:e.sliceName,mono:true,testID:`${g}-info-slice`}),p(ne,{label:"Action",value:e.actionName,mono:true,testID:`${g}-info-action`}),R(i,{style:d.badgeRow,children:[p(i,{style:[d.categoryBadge,{backgroundColor:n.bgColor}],children:p(f,{style:[d.categoryText,{color:n.color}],testID:`${g}-info-category`,children:n.label})}),R(i,{style:[d.durationBadge,e.isSlowAction&&d.durationBadgeSlow],children:[p(gn,{size:10,color:e.isSlowAction?I.error:S.color.textSecondary}),p(f,{style:[d.durationText,e.isSlowAction&&d.durationTextSlow],testID:`${g}-info-duration`,children:An(e.duration)}),e.isSlowAction&&p(hn,{size:10,color:I.error})]}),e.hasStateChange?R(i,{style:d.changesBadge,children:[p(fn,{size:10,color:I.success}),p(f,{style:d.changesText,testID:`${g}-info-changes`,children:e.diffSummary||"changed"})]}):p(i,{style:d.noChangesBadge,children:p(f,{style:d.noChangesText,testID:`${g}-info-no-changes`,children:"no change"})})]})]})]}),E&&R(i,{style:d.card,testID:`${g}-async-card`,children:[p(Ce,{icon:or,title:"ASYNC FLOW",badge:p(i,{style:d.asyncBadge,children:R(f,{style:d.asyncBadgeText,testID:`${g}-async-count`,children:[b.length," ACTIONS"]})})}),R(i,{style:d.cardContent,children:[p(f,{style:d.baseActionType,testID:`${g}-async-base`,children:j}),V!==null&&R(i,{style:d.totalDurationRow,children:[p(f,{style:d.totalDurationLabel,children:"Total Duration"}),R(f,{style:d.totalDurationValue,testID:`${g}-async-total`,children:[V,"ms"]})]}),p(i,{style:d.timeline,children:b.map((M,N)=>{let Q=cr(M.category),Y=M.id===e.id;return R(J,{style:[d.timelineItem,Y&&d.timelineItemCurrent],onPress:()=>t?.(M),disabled:Y||!t,activeOpacity:.7,testID:`${g}-async-step-${N}`,children:[N<b.length-1&&p(i,{style:d.timelineConnector}),p(i,{style:[d.timelineDot,{backgroundColor:Q.color}]}),R(i,{style:d.timelineContent,children:[R(i,{style:d.timelineHeader,children:[p(i,{style:[d.timelineStatusBadge,{backgroundColor:Q.bgColor}],children:p(f,{style:[d.timelineStatusText,{color:Q.color}],testID:`${g}-async-step-${N}-status`,children:Q.label})}),Y&&p(i,{style:d.currentBadge,testID:`${g}-async-step-${N}-current`,children:p(f,{style:d.currentBadgeText,children:"CURRENT"})})]}),p(f,{style:d.timelineTime,children:In(M.timestamp)})]})]},M.id)})})]})]}),u&&R(i,{style:d.card,testID:`${g}-payload-card`,children:[p(Ce,{icon:mn,title:"PAYLOAD",badge:p(i,{style:d.typeBadge,children:p(f,{style:d.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload=="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),p(i,{style:d.dataViewerContainer,children:p(_e,{title:"",data:He(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),h&&R(i,{style:d.card,testID:`${g}-meta-card`,children:[p(Ce,{icon:or,title:"ASYNC METADATA",badge:p(i,{style:[d.categoryBadge,{backgroundColor:n.bgColor}],children:p(f,{style:[d.categoryText,{color:n.color}],children:"RTK THUNK"})})}),R(i,{style:d.cardContent,children:[e.meta?.requestId&&p(ne,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&p(ne,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:n.color,testID:`${g}-meta-status`}),e.meta?.arg!==void 0&&R(i,{style:d.argSection,children:[p(f,{style:d.argLabel,children:"Original Argument"}),p(i,{style:d.argValueContainer,children:typeof e.meta.arg=="object"?p(_e,{title:"",data:He(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):p(f,{style:d.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&p(ne,{label:"Rejected With Value",value:"true",valueColor:I.error}),e.meta?.aborted&&p(ne,{label:"Aborted",value:"true",valueColor:I.warning}),e.meta?.condition&&p(ne,{label:"Condition",value:"true",valueColor:S.color.textTertiary})]})]}),y&&R(i,{style:[d.card,d.errorCard],testID:`${g}-error-card`,children:[p(Ce,{icon:bn,title:"ERROR",badge:p(i,{style:d.errorBadge,children:p(f,{style:d.errorBadgeText,testID:`${g}-error-badge`,children:"REJECTED"})})}),p(i,{style:d.dataViewerContainer,children:typeof e.error=="object"?p(_e,{title:"",data:He(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):p(f,{style:d.errorText,children:String(e.error)})})]}),R(i,{style:d.card,testID:`${g}-full-action-card`,children:[p(Ce,{icon:xn,title:"FULL ACTION OBJECT"}),p(i,{style:d.dataViewerContainer,children:p(_e,{title:"",data:He(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),p(i,{style:d.actionFooter,children:R(i,{style:d.actionsGrid,children:[R(i,{style:d.actionButtonWrapper,children:[p(qe,{type:"replay",text:"REPLAY",onPress:B,testID:`${g}-replay`}),p(f,{style:d.actionDescription,children:"Dispatch again"})]}),R(i,{style:d.actionButtonWrapper,children:[p(qe,{type:"jump",text:"JUMP",onPress:L,disabled:s,testID:`${g}-jump`}),p(f,{style:d.actionDescription,testID:`${g}-jump-description`,children:c?"State not retained":l?"Restore this state":"Time travel not wired"})]}),R(i,{style:d.actionButtonWrapper,children:[p(qe,{type:"copy",text:"COPY ACTION",onPress:z,testID:`${g}-copy-action`}),p(f,{style:d.actionDescription,children:r?"Copy to clipboard":"Pro feature"})]}),u&&R(i,{style:d.actionButtonWrapper,children:[p(qe,{type:"copy",text:"COPY PAYLOAD",onPress:F,testID:`${g}-copy-payload`}),p(f,{style:d.actionDescription,children:r?"Copy payload only":"Pro feature"})]})]})}),p(Cn,{visible:o,onClose:()=>a(false),featureName:"Copy"})]})}),d=pe.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:S.color.surface,borderRadius:6,borderWidth:1,borderColor:S.color.accent+"4D",overflow:"hidden",shadowColor:S.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:I.error+"4D",shadowColor:I.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:S.color.accent+"33",backgroundColor:S.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:S.color.accent,fontFamily:ie},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.surfaceElevated},durationBadgeSlow:{backgroundColor:I.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:S.color.textSecondary,fontFamily:ie},durationTextSlow:{color:I.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:I.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:I.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:S.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:S.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:S.color.textTertiary,fontFamily:ie},dataViewerContainer:{backgroundColor:S.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:S.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:S.color.bg,borderRadius:6,borderWidth:1,borderColor:S.color.border,overflow:"hidden"},argValue:{fontSize:11,color:S.color.text,fontFamily:ie,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:I.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:I.error,letterSpacing:.3},errorText:{fontSize:12,color:I.error,fontFamily:ie,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:S.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:S.color.text,fontFamily:ie,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:S.color.border},totalDurationLabel:{fontSize:11,color:S.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:I.success,fontFamily:ie},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:S.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:S.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:S.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:S.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:S.color.textTertiary,fontFamily:ie},actionFooter:{backgroundColor:S.color.surface,borderRadius:6,borderWidth:1,borderColor:S.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:S.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:S.color.textTertiary,textAlign:"center"}});import{DiffModeTabs as Bn,CompareBar as Rn}from"@buoy-gg/shared-ui/web";import{jsx as k,jsxs as ge}from"react/jsx-runtime";function pt(e){return e.includes("/pending")?Ae.semantic.warning:e.includes("/fulfilled")?Ae.semantic.success:e.includes("/rejected")?Ae.semantic.error:e.startsWith("@@")?Ae.text.muted:Ae.semantic.info}function dr(e){if(e.includes("/pending"))return"PENDING";if(e.includes("/fulfilled"))return"FULFILLED";if(e.includes("/rejected"))return"REJECTED";if(e.startsWith("@@"))return"INTERNAL";let t=e.split("/");return t[t.length-1]?.toUpperCase()||"ACTION"}function kn(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}function ur(e){return new Date(e).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var En=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function pr({action:e,actions:t,selectedIndex:r,onIndexChange:o,disableInternalFooter:a=false,initialView:n="action"}){let[c,l]=er(n),[s,u]=er("tree"),h=t.length,y=ee(e.nextState),b=pt(e.type),E=dr(e.type),j=kn(Ne(e.nextState)),V=h-r,z=V-1,F=r<h-1?r+1:null,B=F!==null?t[F]:null,L=tr(()=>({index:F??0,label:z>0?`#${z}`:"Initial",timestamp:B?ur(B.timestamp):"",relativeTime:B?Fe(new Date(B.timestamp)):"state",badge:B?k(i,{style:[$.actionBadgeSmall,{backgroundColor:`${pt(B.type)}20`}],children:k(f,{style:[$.actionTextSmall,{color:pt(B.type)}],children:dr(B.type)})}):void 0}),[F,B,z]),M=tr(()=>({index:r,label:`#${V}`,timestamp:ur(e.timestamp),relativeTime:Fe(new Date(e.timestamp)),badge:k(i,{style:[$.actionBadgeSmall,{backgroundColor:`${b}20`}],children:k(f,{style:[$.actionTextSmall,{color:b}],children:E})})}),[r,e.timestamp,b,E,V]),N=We(()=>{if(y)return ge(i,{style:$.contentCard,testID:`${g}-state-evicted`,children:[k(i,{style:$.valueHeader,children:k(f,{style:$.valueLabel,children:"STATE AFTER ACTION"})}),k(f,{style:$.evictedText,children:`Not retained. Raw state is kept for the ${tt} most recent actions, so this action's before/after trees have been released.`})]});let he=Ne(e.nextState);return ge(i,{style:$.contentCard,testID:`${g}-state-card`,children:[ge(i,{style:$.valueHeader,children:[k(f,{style:$.valueLabel,children:"STATE AFTER ACTION"}),ge(i,{style:$.valueHeaderBadges,children:[k(i,{style:[$.actionBadge,{backgroundColor:`${b}20`}],children:k(f,{style:[$.actionText,{color:b}],children:E})}),k(i,{style:$.typeBadge,children:k(f,{style:$.typeText,testID:`${g}-state-type`,children:j.toUpperCase()})})]})]}),k(i,{style:$.dataViewerContainer,children:k(Ja,{title:"",data:he,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,b,E,j,y]),Q=We(()=>{let he=Ne(e.prevState),fe=Ne(e.nextState);return s==="split"?k(Oe,{style:{flex:1},showsVerticalScrollIndicator:true,children:k(Ga,{oldValue:he,newValue:fe,theme:Qa.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})}):k(Xa,{oldValue:he,newValue:fe})},[e.prevState,e.nextState,s]),Y=We(()=>{o(Math.min(h-1,r+1))},[r,h,o]),Je=We(()=>{o(Math.max(0,r-1))},[r,o]),P=y||ee(e.prevState)||e.prevState===void 0,Z=!a&&h>1;return ge(i,{style:$.container,children:[k(sn,{activeView:c,onViewChange:l,diffDisabled:P}),ge(i,{style:[$.contentArea,Z&&$.contentAreaFooterPad],children:[c==="action"&&k(Dn,{action:e}),c==="state"&&k(i,{style:$.stateContainer,children:N()}),c==="diff"&&ge(i,{style:$.diffContainer,testID:`${g}-diff`,children:[k(Bn,{tabs:En,activeTab:s,onTabChange:u,testIDPrefix:`${g}-diff-tab`}),k(Rn,{leftEvent:L,rightEvent:M}),k(i,{style:$.diffContent,testID:`${g}-diff-content`,children:Q()})]})]}),Z&&k(rr,{currentIndex:V-1,totalItems:h,onPrevious:Y,onNext:Je,itemLabel:"Action",subtitle:Fe(new Date(e.timestamp)),absolute:true})]})}function gr({action:e,actions:t,selectedIndex:r,onIndexChange:o}){let a=t.length;if(a<=1)return null;let n=a-r;return k(rr,{currentIndex:n-1,totalItems:a,onPrevious:()=>o(Math.min(a-1,r+1)),onNext:()=>o(Math.max(0,r-1)),itemLabel:"Action",subtitle:Fe(new Date(e.timestamp))})}var $=pe.create({container:{flex:1,backgroundColor:"transparent"},contentArea:{flex:1},contentAreaFooterPad:{paddingBottom:96},stateContainer:{flex:1,padding:14},contentCard:{backgroundColor:X.color.surface,borderRadius:14,padding:14,borderWidth:1,borderColor:X.color.border},valueHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:8},valueLabel:{fontSize:10,color:X.color.textSecondary,fontFamily:Ie,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:Ie,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:X.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:X.color.textTertiary,fontFamily:Ie},valueBox:{backgroundColor:X.color.bg,borderRadius:6,borderWidth:1,borderColor:X.color.border,padding:8},evictedText:{fontSize:12,color:X.color.textSecondary,lineHeight:18},valueText:{fontSize:12,color:X.color.text,fontFamily:Ie,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:Ie},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});import{Fragment as $n,jsx as m,jsxs as W}from"react/jsx-runtime";var Vn=va["redux.actions"].free;function zn({isEnabled:e,query:t,totalActions:r}){let o=Ia({subject:"actions",search:t,total:r,capturing:e,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return m(Aa,{...o,testID:`${g}-empty`})}function gt({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,onActionSelect:c,initialSelectedActionId:l,initialDetailView:s}){let u=Ra(),h=wa("redux.actions"),[y,b]=Ve(false),{isInstrumented:E,isLoading:j,error:V,isReactReduxAvailable:z,captureMechanism:F}=ct(),{filteredActions:B,filter:L,setFilter:M,stats:N,clearActions:Q,isEnabled:Y,toggleCapture:Je}=Kt(),P=we(()=>B.slice(0,h),[B,h]),Z=we(()=>Math.max(0,B.length-h),[B.length,h]),he=Z>0,[fe,Be]=Ve(null),ye=we(()=>{if(fe===null)return null;let C=P.findIndex(O=>O.id===fe);return C>=0?C:null},[fe,P]),K=ye!==null?P[ye]:null,yt=ze(null);Ft(()=>{if(!c)return;let C=K?.id??null;C===null||C===yt.current||(yt.current=C,c(K))},[K,c]);let mt=ze(null);Ft(()=>{!l||mt.current===l||P.findIndex(C=>C.id===l)<0||(mt.current=l,Be(l))},[l,P]);let[Se,bt]=Ve(""),[xt,Ge]=Ve(false),ai=ze(null),br=ze(null),xr=te(C=>{},[]),Cr=C=>{bt(C),M(O=>({...O,searchText:C}))},Sr=te(()=>{bt(""),M(C=>({...C,searchText:""})),Ge(false)},[M]),Ct=te(C=>{Be(C.id)},[]),wr=te(()=>{b(true)},[]),vr=te(()=>{Be(null)},[]),St=te(C=>{let O=P[C];O&&Be(O.id)},[P]),Tr=async()=>{if(!u){b(true);return}let C=B.map(O=>({id:O.id,type:O.type,...O.payload!==void 0&&{payload:O.payload},timestamp:O.timestamp,prevState:O.prevState,nextState:O.nextState,hasStateChange:O.hasStateChange}));await xa(C)},Ar=te(C=>C.id,[]),wt=we(()=>sr(P),[P]),vt=we(()=>{let C=new Map;for(let O of x.getActions()){let Xe=O.meta?.requestId;Xe&&C.set(Xe,(C.get(Xe)??0)+1)}return C},[B]),Ir=te(({item:C})=>{let O=C.meta?.requestId;return m(Zt,{action:C,onPress:Ct,linkedCount:O?vt.get(O)??0:0,testID:wt.get(C.id)})},[Ct,wt,vt]),Tt=()=>K?W(re,{children:[m(re.Navigation,{onBack:vr}),m(re.Content,{title:K.type,centered:true,testID:`${g}-detail-title`})]}):W(re,{children:[r&&m(re.Navigation,{onBack:r}),m(re.Content,{title:"",children:xt?m(re.Search,{value:Se,onChangeText:Cr,onCancel:Sr,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${g}-search-field`,containerTestID:`${g}-search`,clearTestID:`${g}-search-clear`,onBlur:()=>{Se.length===0&&Ge(false)}}):W(i,{style:A.headerChipRow,children:[W(J,{style:[A.headerChip,!L.onlyWithChanges&&A.headerChipActive],onPress:()=>M(C=>({...C,onlyWithChanges:false})),testID:`${g}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${N.totalActions} captured`,accessibilityState:{selected:!L.onlyWithChanges},children:[m(f,{style:A.headerChipLabel,children:"ALL"}),m(f,{style:[A.headerChipValue,{color:v.color.text}],testID:`${g}-chip-all-value`,children:N.totalActions})]}),W(J,{style:[A.headerChip,L.onlyWithChanges&&A.headerChipActive],onPress:()=>M(C=>({...C,onlyWithChanges:true})),testID:`${g}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${N.actionsWithChanges} of them`,accessibilityState:{selected:!!L.onlyWithChanges},children:[m(ha,{size:12,color:G.semantic.warning}),m(f,{style:[A.headerChipValue,{color:G.semantic.warning}],testID:`${g}-chip-changed-value`,children:N.actionsWithChanges})]}),W(i,{style:A.headerChip,testID:`${g}-chip-types`,accessibilityLabel:`${N.uniqueActionTypes} distinct action types`,children:[m(fa,{size:12,color:G.semantic.success}),m(f,{style:[A.headerChipValue,{color:G.semantic.success}],testID:`${g}-chip-types-value`,children:N.uniqueActionTypes})]})]})}),W(re.Actions,{children:[!xt&&m(J,{onPress:()=>Ge(true),style:[A.headerActionButton,Se.length>0&&A.headerActionButtonActive],testID:`${g}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:m(ua,{size:14,color:Se.length>0?v.color.accent:v.color.textSecondary})}),m(J,{onPress:Tr,style:[A.headerActionButton,B.length===0&&A.headerActionButtonDisabled],disabled:B.length===0,testID:`${g}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:B.length===0},children:m(ya,{size:14,color:B.length>0?v.color.textSecondary:v.color.textTertiary})}),m(Sa,{isEnabled:Y,onToggle:Je,accessibilityLabel:"Toggle Redux action capture",testID:`${g}-power`}),m(J,{onPress:Q,style:[A.headerActionButton,B.length===0&&A.headerActionButtonDisabled],disabled:B.length===0,testID:`${g}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:B.length===0},children:m(pa,{size:14,color:B.length>0?v.color.textTertiary:v.color.textTertiary})})]})]}),Dr=a?ba.modal.root():"buoy-redux-modal";if(!e)return null;let At=K&&ye!==null?m(gr,{action:K,actions:P,selectedIndex:ye,onIndexChange:St}):null,Br=K&&P.length>1?68:0,Rr=K==null,It=m(i,{style:A.container,children:K&&ye!==null?m(pr,{action:K,actions:P,selectedIndex:ye,onIndexChange:St,disableInternalFooter:true,initialView:s}):W($n,{children:[V&&!E&&!x.isCaptureSuppressed()&&W(i,{style:A.errorBanner,testID:`${g}-banner-error`,children:[m(Ht,{size:14,color:v.color.danger}),m(f,{style:A.errorText,children:z?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!Y&&E&&W(i,{style:A.disabledBanner,testID:`${g}-banner-disabled`,children:[m(ga,{size:14,color:v.color.warning}),m(f,{style:A.disabledText,children:"Action capture is disabled"})]}),F==="patch"&&!x.isCaptureSuppressed()&&W(i,{style:A.disabledBanner,testID:`${g}-banner-patch`,children:[m(Ht,{size:14,color:v.color.warning}),m(f,{style:A.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),he&&W(J,{style:A.lockedBanner,onPress:wr,activeOpacity:.8,testID:`${g}-locked`,accessibilityRole:"button",accessibilityLabel:`${Z} older ${Z===1?"action":"actions"} locked. Upgrade to see them.`,children:[m(ma,{size:14,color:v.color.accent}),W(f,{style:A.lockedText,testID:`${g}-locked-text`,children:[Z," older ",Z===1?"action":"actions"," locked"]}),m(i,{style:A.upgradeBadge,children:m(f,{style:A.upgradeBadgeText,children:"UPGRADE"})})]}),P.length>0?m(Mt,{ref:br,testID:`${g}-list`,data:P,renderItem:Ir,keyExtractor:Ar,contentContainerStyle:A.listContent,showsVerticalScrollIndicator:true,...Da}):m(zn,{isEnabled:Y,query:Se,totalActions:N.totalActions})]})}),Dt=m(Ca,{visible:y,onClose:()=>b(false),featureName:"Full Action History"});return n?W(_t,{children:[W(i,{style:A.inlineRoot,children:[m(i,{style:A.inlineHeader,...Ta,children:Tt()}),It,At]}),Dt]}):W(_t,{children:[m(da,{visible:e,onClose:t,onMinimize:o,persistenceKey:Dr,header:{showToggleButton:true,customContent:Tt()},onModeChange:xr,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Rr,styles:{},footer:At,footerHeight:Br,children:It}),Dt]})}function On(e={}){return m(gt,{...e,inline:true,visible:true,onClose:()=>{}})}var A=pe.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:G.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:v.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:v.color.border},headerChipActive:{backgroundColor:v.color.accentSoft,borderColor:v.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:v.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:Ba},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:v.color.surfaceElevated,borderWidth:1,borderColor:v.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:v.color.accentSoft,borderColor:v.color.accentBorderStrong},startButton:{backgroundColor:G.semantic.successBackground,borderColor:G.semantic.success+"40"},stopButton:{backgroundColor:G.semantic.errorBackground,borderColor:G.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:v.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:v.color.danger+"20"},errorText:{color:v.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:v.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:v.color.warning+"20"},disabledText:{color:v.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:v.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:v.color.accentBorder},lockedText:{color:v.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:v.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:v.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});import{ReduxIcon as Ue,REDUX_ICON_COLOR as ji}from"@buoy-gg/floating-tools-core/web";import{createToolFactory as jn,defineToolPreset as Ln}from"@buoy-gg/shared-ui/web";import{jsx as hr}from"react/jsx-runtime";var fr=Ln({id:"redux",name:"REDUX",description:"Redux action & state inspector",slot:"both",icon:({size:e})=>hr(Ue,{size:e}),component:gt,props:{enableSharedModalDimensions:false}}),Pn=jn(fr,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}),e=>({icon:({size:t})=>hr(Ue,{size:t,color:e.iconColor})}));var Wn={timeTravel:false,toggle:false,edit:false,diff:true,export:true,import:false,reset:true,recording:true};function Fn(e,t,r){return{id:e.id,label:e.type,timestamp:e.timestamp,data:e.payload??e.action,prevState:e.prevState,nextState:e.nextState,hasStateChange:e.hasStateChange,duration:e.duration,source:"redux",isCurrent:t===0,isInFuture:false,isSkipped:false,meta:{fullAction:e.action}}}function yr(e){let{icon:t=Ue,color:r="#764ABC",name:o="Redux"}=e??{},a=0;return{id:"redux",name:o,icon:t,color:r,capabilities:Wn,subscribe:n=>x.subscribe(()=>{n()}),getEntries:()=>{let n=x.getActions();return n.map((c,l)=>Fn(c,l,n.length))},getEntryCount:()=>x.getActions().length,getCurrentState:()=>{let n=x.getActions();if(n.length!==0)return n[0].nextState},getStateAtEntry:n=>x.getActionById(String(n))?.nextState,get currentIndex(){return a},jumpTo:n=>{let c=x.getActions().findIndex(l=>l.id===String(n));c!==-1&&(a=c)},get isRecording(){return x.getEnabled()},setRecording:n=>{x.setEnabled(n)},reset:()=>{x.clearActions(),a=0},exportHistory:()=>{let n=x.getActions();return JSON.stringify(n,null,2)}}}var Nn=yr();import{WIRE_DETAIL_LIMIT_BYTES as Mn,capDetail as Hn,createSyncAdapter as _n,memoByIdentity as qn,readParams as De,toWire as Un}from"@buoy-gg/shared-ui/web";var Ke=e=>Un(e,_r),Kn=qn(e=>{let t=ee(e.prevState)?{...e}:{...e,prevState:Vt,nextState:Vt};if(t.payload=Ke(t.payload),t.action=Ke(t.action),t.error=Ke(t.error),t.meta){let r=Ke(t.meta.arg);r!==t.meta.arg&&(t.meta={...t.meta,arg:r})}return t});function Yn(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e):[]}function Jn(e,t){let{path:r,value:o,remove:a}=t;if(!r)return{ok:false,error:'setState needs a `path`, like "offers.added.<id>".'};if(!a&&o===void 0)return{ok:false,error:"Sent `path` without `value`. Send value (null is fine) or remove:true."};let n=r.split(".").filter(Boolean),c=y=>Array.isArray(y)?[...y]:{...y},l=c(e),s=l;for(let y=0;y<n.length-1;y++){let b=n[y],E=s[b];if(!E||typeof E!="object")return{ok:false,error:`No object at "${n.slice(0,y+1).join(".")}" \u2014 read getState for the real shape.`};let j=c(E);s[b]=j,s=j}let u=n[n.length-1],h=s[u];if(a){if(!(u in s))return{ok:false,error:`Nothing at "${r}" to remove.`};Array.isArray(s)?s.splice(Number(u),1):delete s[u]}else s[u]=o;return{ok:true,next:l,prev:h}}function Gn(e){let t={};if(!e||typeof e!="object"||Array.isArray(e))return t;for(let[r,o]of Object.entries(e).slice(0,40))o&&typeof o=="object"&&!Array.isArray(o)&&(t[r]=Object.keys(o).slice(0,12));return t}function ht(){let e=ue().diagnostic??"not-instrumented";return{available:false,slices:[],reason:e}}var Xn=_n({version:2,getSnapshot:()=>x.getActions().map(Kn),subscribe:e=>x.subscribe(e),actions:{clearEvents:()=>{x.clearActions()},getActionDetail:e=>{let{id:t}=De(e);if(!t)return{found:false,reason:"missing id"};let r=x.getActionById(t);if(!r)return{found:false,reason:"unknown id"};if(ee(r.prevState))return{found:true,id:t,evicted:true,reason:"Raw state was evicted (retained for recent actions only)."};let o=n=>Hn(n,Mn),a=n=>{if(!n)return n;let c=o(n.arg);return c===n.arg?n:{...n,arg:c}};return{found:true,id:t,prevState:o(r.prevState),nextState:o(r.nextState),payload:o(r.payload),action:o(r.action),meta:a(r.meta),error:o(r.error)}},getState:e=>{let{includeValues:t=false}=De(e),r=Le();if(!r)return ht();let o=r.getState(),a=ue();return{available:true,slices:Yn(o),sliceFields:Gn(o),capture:a.capture,mechanism:a.mechanism,...t?{state:o}:{}}},dispatch:e=>{let{action:t}=De(e),r=Le();if(!r)return{dispatched:false,...ht()};if(!t)throw new Error("dispatch requires an `action`");return r.dispatch(t),{dispatched:true,type:t.type}},setState:e=>{let t=Le();if(!t)return{ok:false,...ht()};if(!Re())return{ok:false,error:"This store has no Buoy time-travel reducer, so its state can't be edited directly. Dispatch one of the app's own actions instead."};let r=Jn(t.getState(),De(e));return r.ok?(t.dispatch({type:xe,payload:r.next}),{ok:true,path:De(e).path,previous:r.prev}):r}}});import{useState as Qn}from"react";import{macOSColors as le,night as U,TabSelector as Zn,DataInspector as se,CollapsibleSection as Ye,CopyButton as ei,monoFont as ft}from"@buoy-gg/shared-ui/web";import{jsx as w,jsxs as _}from"react/jsx-runtime";function ti({action:e}){let[t,r]=Qn("action"),o=[{key:"action",label:"Action"},{key:"state",label:"State"},{key:"diff",label:"Diff"}],a=new Date(e.timestamp).toLocaleTimeString(),n=()=>JSON.stringify({type:e.type,payload:e.payload,timestamp:e.timestamp,duration:e.duration,hasStateChange:e.hasStateChange},null,2);return _(i,{style:T.container,children:[_(i,{style:T.header,children:[_(i,{style:T.headerContent,children:[w(f,{style:T.actionType,numberOfLines:2,children:e.type}),_(i,{style:T.headerMeta,children:[w(f,{style:T.metaText,children:a}),e.duration!==void 0&&_(f,{style:T.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&w(i,{style:T.changeBadge,children:w(f,{style:T.changeBadgeText,children:"State Changed"})})]})]}),w(ei,{value:n(),size:16})]}),w(i,{style:T.tabContainer,children:w(Zn,{tabs:o,activeTab:t,onTabChange:c=>r(c)})}),_(Oe,{style:T.content,showsVerticalScrollIndicator:true,children:[t==="action"&&_(i,{style:T.section,children:[w(Ye,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?w(se,{data:e.payload}):w(f,{style:T.emptyText,children:"No payload"})}),w(Ye,{title:"Full Action",defaultOpen:false,children:w(se,{data:e.action})})]}),t==="state"&&_(i,{style:T.section,children:[w(Ye,{title:"Previous State",defaultOpen:false,children:w(se,{data:e.prevState})}),w(Ye,{title:"Next State",defaultOpen:true,children:w(se,{data:e.nextState})})]}),t==="diff"&&w(i,{style:T.section,children:e.hasStateChange?w(ri,{prevState:e.prevState,nextState:e.nextState}):w(i,{style:T.noChangeContainer,children:w(f,{style:T.noChangeText,children:"No state changes from this action"})})})]})]})}function ri({prevState:e,nextState:t}){let r=mr(e,t);return r.length===0?w(i,{style:T.noChangeContainer,children:w(f,{style:T.noChangeText,children:"No differences detected"})}):w(i,{children:r.map((o,a)=>_(i,{style:T.diffItem,children:[_(i,{style:T.diffHeader,children:[w(i,{style:[T.diffTypeBadge,{backgroundColor:o.type==="added"?le.semantic.successBackground:o.type==="removed"?le.semantic.errorBackground:le.semantic.warningBackground}],children:w(f,{style:[T.diffTypeText,{color:o.type==="added"?le.semantic.success:o.type==="removed"?le.semantic.error:le.semantic.warning}],children:o.type.toUpperCase()})}),w(f,{style:T.diffPath,children:o.path})]}),o.type==="modified"&&_(i,{style:T.diffValues,children:[_(i,{style:T.diffValue,children:[w(f,{style:T.diffLabel,children:"Before:"}),w(se,{data:o.oldValue})]}),_(i,{style:T.diffValue,children:[w(f,{style:T.diffLabel,children:"After:"}),w(se,{data:o.newValue})]})]}),o.type==="added"&&w(i,{style:T.diffValue,children:w(se,{data:o.newValue})}),o.type==="removed"&&w(i,{style:T.diffValue,children:w(se,{data:o.oldValue})})]},a))})}function mr(e,t,r=""){let o=[];if(typeof e!="object"||typeof t!="object")return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;if(e===null||t===null)return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;let a=e,n=t,c=new Set([...Object.keys(a),...Object.keys(n)]);for(let l of c){let s=r?`${r}.${l}`:l,u=a[l],h=n[l];l in a?l in n?u!==h&&(typeof u=="object"&&typeof h=="object"&&u!==null&&h!==null&&!Array.isArray(u)&&!Array.isArray(h)?s.split(".").length<3?o.push(...mr(u,h,s)):o.push({type:"modified",path:s,oldValue:u,newValue:h}):o.push({type:"modified",path:s,oldValue:u,newValue:h})):o.push({type:"removed",path:s,oldValue:u}):o.push({type:"added",path:s,newValue:h})}return o}var T=pe.create({container:{flex:1},header:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:12,backgroundColor:U.color.surface,borderBottomWidth:1,borderBottomColor:U.color.border},headerContent:{flex:1,marginRight:12},actionType:{fontSize:14,fontWeight:"600",color:U.color.text,fontFamily:ft,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:U.color.textTertiary},durationText:{fontSize:11,color:U.color.textTertiary,fontFamily:ft},changeBadge:{backgroundColor:le.semantic.warningBackground,paddingHorizontal:6,paddingVertical:2,borderRadius:4},changeBadgeText:{fontSize:10,color:le.semantic.warning,fontWeight:"600"},tabContainer:{paddingHorizontal:12,paddingVertical:8},content:{flex:1},section:{paddingHorizontal:12,paddingBottom:20},emptyText:{fontSize:12,color:U.color.textTertiary,fontStyle:"italic",padding:8},noChangeContainer:{padding:20,alignItems:"center"},noChangeText:{fontSize:13,color:U.color.textTertiary},diffItem:{marginBottom:12,backgroundColor:U.color.surface,borderRadius:8,borderWidth:1,borderColor:U.color.border,overflow:"hidden"},diffHeader:{flexDirection:"row",alignItems:"center",gap:8,padding:8,borderBottomWidth:1,borderBottomColor:U.color.border},diffTypeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},diffTypeText:{fontSize:10,fontWeight:"700"},diffPath:{fontSize:12,color:U.color.text,fontFamily:ft},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:U.color.textTertiary,marginBottom:4,fontWeight:"600"}});function oi(){return ct(),null}export{xe as BUOY_JUMP_TO_STATE,Xr as BUOY_REPLAY_ACTION,Vn as FREE_TIER_ACTION_LIMIT,g as REDUX_TEST_ID,pr as ReduxActionDetailContent,gr as ReduxActionDetailFooter,ti as ReduxActionDetailView,Zt as ReduxActionItem,oi as ReduxAutoInstrument,Ue as ReduxIcon,gt as ReduxModal,On as ReduxToolView,lr as actionRowTestID,sr as buildActionRowTestIDs,$e as buoyDevtoolsEnhancer,Zr as buoyReduxMiddleware,Wt as claimDevtoolsHook,eo as createBuoyReduxMiddleware,yr as createReduxHistoryAdapter,Pn as createReduxTool,Le as getActiveStore,ue as getInstrumentationStatus,lt as instrumentStore,La as isAutoInstrumentActive,lo as isDevtoolsHookClaimed,Oa as isStoreInstrumented,jt as jumpToState,x as reduxActionStore,Nn as reduxHistoryAdapter,Xn as reduxSyncAdapter,fr as reduxToolPreset,ja as registerReduxStore,Lt as replayAction,ir as slugForTestID,st as uninstrumentStore,ct as useAutoInstrumentRedux,Kt as useReduxActions,Pa as useReduxAvailability,Qr as withBuoyDevTools};
|
|
1
|
+
"use client";var Et=Object.defineProperty;var jr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Wr=Object.prototype.hasOwnProperty;var Nr=(e,t)=>{for(var r in t)Et(e,r,{get:t[r],enumerable:true})},$t=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Pr(t))!Wr.call(e,a)&&a!==r&&Et(e,a,{get:()=>t[a],enumerable:!(o=jr(t,a))||o.enumerable});return e},Fr=(e,t,r)=>($t(e,t,"default"),r&&$t(r,t,"default"));var Vt=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{classifyPreviewItem as Mr,createRestoreScope as Hr,registerStateSnapshotProvider as _r,skippedRestore as Ze,unionKeys as qr,wontApply as Ur}from"@buoy-gg/shared-ui/web";var et=Symbol.for("@@buoy/enhancerInstrumented"),be=null,pe=null,tt=null,Ot=false;function ee(e,t){be=e,pe=t,tt=null}function zt(e){be===e&&(be=null,pe=null)}function te(){return be}function rt(){Ot=true}function ke(){return Ot&&be!==null}function Kr(e){tt=e}function re(){return{mechanism:pe,capture:pe==="enhancer"||pe==="middleware"||pe==="extension"?"full":pe==="patch"?"top-level-only":"none",hasStore:be!==null,timeTravel:ke(),diagnostic:tt}}import{ChangeLog as Yr,approxJsonSize as Jr}from"@buoy-gg/shared-ui/web";var ot=25,at=Object.freeze({__buoyStateEvicted:true,note:`Raw state retained for the ${ot} most recent actions only.`}),Lt=Object.freeze({__buoyStateOnDevice:true,note:"State trees stay on the device \u2014 fetched on demand via getActionDetail."}),Gr=Object.freeze({__buoyPayloadOnDevice:true,note:"Payload stays on the device \u2014 fetched on demand via getActionDetail."});function Ee(e){return typeof e=="object"&&e!==null&&e.__buoyPayloadOnDevice===true}function oe(e){if(typeof e!="object"||e===null)return false;let t=e;return t.__buoyStateEvicted===true||t.__buoyStateOnDevice===true}function Xr(e){return e.startsWith("@@")?"internal":e.includes("/pending")?"pending":e.includes("/fulfilled")?"fulfilled":e.includes("/rejected")?"rejected":e.includes("/executeQuery")?"query":e.includes("/executeMutation")?"mutation":"action"}function Qr(e){if(e.startsWith("@@")){let r=e.split("/");return{sliceName:null,actionName:r[r.length-1]||e}}let t=e.split("/");if(t.length>=2){let r=t[0],o=t[1];return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])&&(o=t.slice(1,-1).join("/")),{sliceName:r,actionName:o.toUpperCase()}}return{sliceName:null,actionName:e.toUpperCase()}}function jt(e,t){return Jr(e,t).bytes>t}function Zr(e,t=40){if(e===void 0)return"";if(e===null)return"null";try{if(typeof e=="string")return e.length>t?`"${e.slice(0,t-3)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";if(jt(e,t))return`[${e.length} items]`;let r=JSON.stringify(e);return r.length>t?`[${e.length} items]`:r}if(typeof e=="object"){let r=Object.keys(e);if(r.length===0)return"{}";if(jt(e,t))return`{ ${r.length} keys }`;let o=JSON.stringify(e);return o.length<=t?o:`{ ${r.length} keys }`}return String(e).slice(0,t)}catch{return"[complex]"}}function eo(e,t){if(e===t)return{summary:"no change",changedCount:0};if(typeof e!="object"||typeof t!="object"||e===null||t===null)return{summary:"changed",changedCount:1};let r=Object.keys(e),o=Object.keys(t),a=o.filter(p=>!r.includes(p)).length,n=r.filter(p=>!o.includes(p)).length,d=0;for(let p of r)o.includes(p)&&e[p]!==t[p]&&d++;let c=[];a>0&&c.push(`+${a}`),n>0&&c.push(`-${n}`),d>0&&c.push(`~${d}`);let s=a+n+d;return c.length===0?{summary:"nested change",changedCount:1}:{summary:`${c.join(" ")} ${s===1?"key":"keys"}`,changedCount:s}}function to(e){let t=e.meta;if(t)return{requestId:t.requestId,requestStatus:t.requestStatus,arg:t.arg,rejectedWithValue:t.rejectedWithValue,aborted:t.aborted,condition:t.condition}}var ro=class extends Yr{addAction(e,t,r,o){if(!this.canRecord())return;let a=e.type||"";if(!a)return;let n=t!==r,d=Xr(a),{sliceName:c,actionName:s}=Qr(a),p=to(e),l=Zr(e.payload),{summary:y,changedCount:b}=eo(t,r),$=(o??0)>16,O={id:this.nextId(),type:a,payload:e.payload,action:e,timestamp:Date.now(),prevState:t,nextState:r,duration:o,hasStateChange:n,category:d,sliceName:c,actionName:s,meta:p,error:e.error,payloadPreview:l,diffSummary:y,changedKeysCount:b,isSlowAction:$};this.push(O);for(let z=ot;z<this.items.length;z++){let j=this.items[z];if(j.prevState!==at)j.prevState=at,j.nextState=at;else break}this.notifyListeners()}getActions(){return this.getAll()}getActionById(e){return this.getById(e)}clearActions(){this.clear()}replaceActions(e){if(!this.getEnabled())return;let t=new Map;for(let o of this.items)o.prevState!==void 0&&!oe(o.prevState)&&t.set(o.id,o);let r=e.slice(0,this.max).map(o=>{let a=t.get(o.id);return!a||!oe(o.prevState)?o:{...o,prevState:a.prevState,nextState:a.nextState,payload:Ee(o.payload)?a.payload:o.payload,action:Ee(o.action)?a.action:o.action,meta:Ee(o.meta?.arg)?a.meta:o.meta,error:Ee(o.error)?a.error:o.error}});this.setItems(r)}hydrateAction(e,t){this.hydrateById(e,t)}setMaxActions(e){this.setMax(e)}getStats(){let e=this.items.length,t=this.items.filter(n=>n.hasStateChange).length,r=new Set(this.items.map(n=>n.type)),o=this.items.filter(n=>n.duration!==void 0).map(n=>n.duration),a=o.length>0?o.reduce((n,d)=>n+d,0)/o.length:0;return{totalActions:e,actionsWithChanges:t,actionsWithoutChanges:e-t,uniqueActionTypes:r.size,averageDuration:Math.round(a*100)/100}}filterActions(e){let t=[...this.items];if(e.searchText){let r=e.searchText.toLowerCase();t=t.filter(o=>o.type.toLowerCase().includes(r))}return e.actionTypes&&e.actionTypes.length>0&&(t=t.filter(r=>e.actionTypes.includes(r.type))),e.onlyWithChanges&&(t=t.filter(r=>r.hasStateChange)),t}getUniqueActionTypes(){return Array.from(new Set(this.items.map(e=>e.type))).sort()}getRelatedActions(e){return this.items.filter(t=>t.meta?.requestId===e).sort((t,r)=>t.timestamp-r.timestamp)}getLinkedActions(e){return e.meta?.requestId?this.getRelatedActions(e.meta.requestId):[]}getLinkedActionsCount(e){return e.meta?.requestId?this.items.filter(t=>t.meta?.requestId===e.meta?.requestId).length:0}getAsyncOperationDuration(e){let t=this.getRelatedActions(e);if(t.length<2)return null;let r=t.find(a=>a.category==="pending"),o=t.find(a=>a.category==="fulfilled"||a.category==="rejected");return r&&o?o.timestamp-r.timestamp:null}getBaseActionType(e){let t=e.split("/");if(t.length>=2){let r=t[t.length-1];if(["pending","fulfilled","rejected"].includes(r))return t.slice(0,-1).join("/")}return e}getAsyncOperationIndex(e){let t=new Map;for(let o of this.items)o.meta?.requestId&&!t.has(o.meta.requestId)&&t.set(o.meta.requestId,o.timestamp);let r=Array.from(t.entries()).sort((o,a)=>o[1]-a[1]).map(([o])=>o).indexOf(e);return r>=0?r+1:0}},x=new ro;var nt=false;function Pt(){return nt}var xe="@@buoy/JUMP_TO_STATE",oo="@@buoy/REPLAY_ACTION";function Wt(e){if(oe(e)){console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");return}let t=te();if(!t){console.warn("[BuoyRedux] Cannot jump to state - no store instrumented");return}if(!ke()){console.warn("[BuoyRedux] Cannot jump to state - the root reducer cannot serve a state jump. Capture and time travel are wired separately: either put `import '@buoy-gg/redux';` first in your app entry (so Buoy is the store enhancer), or wrap your root reducer with withBuoyDevTools().");return}t.dispatch({type:xe,payload:e})}function Nt(e){let t=te();t?t.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}function ao(e){return rt(),(t,r)=>r.type===xe?r.payload:e(t,r)}var no=e=>(nt=true,ee(e,"middleware"),t=>r=>{let o=r;if(o.type?.startsWith("@@buoy/"))return t(r);let a=performance.now(),n=e.getState(),d=t(r),c=e.getState(),s=performance.now()-a;return x.addAction(o,n,c,s),d});function io(e={}){let{maxActions:t=200,ignoreActions:r=[]}=e;return x.setMaxActions(t),o=>(nt=true,ee(o,"middleware"),a=>n=>{let d=n,c=d.type||"";if(c?.startsWith("@@buoy/")||r.includes(c))return a(n);let s=performance.now(),p=o.getState(),l=a(n),y=o.getState(),b=performance.now()-s;return x.addAction(d,p,y,b),l})}var $e="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function lo(){let{mechanism:e,hasStore:t,diagnostic:r}=re();return t?e==="patch"?{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${$e}`}:{canCapture:true,canRestore:true,detail:e==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}:{canCapture:false,canRestore:false,detail:r==="no-react-redux"?"react-redux not installed":r==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}async function so(){let e=te();return e?{data:{state:e.getState()},warnings:[]}:{data:null,warnings:["no Redux store instrumented"]}}async function co(e,t){let r=e,o=te();if(!o||r===void 0||r===null)return Ze("redux",o?"empty redux snapshot":"no Redux store instrumented");let{mechanism:a}=re();if(a==="patch")return Ze("redux",`restore unavailable on auto-instrumented stores \u2014 ${$e}`);let n=Hr(t),d=Object.keys(r.state??{}).filter(s=>!n.touch(s)),c=r.state;if(d.length>0){let s=o.getState(),p={...r.state};for(let l of d)p[l]=s?.[l];c=p}if(o.dispatch({type:xe,payload:c}),o.getState()===c){let s=d.length>0?[`${d.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:s}}return Ze("redux",`store ignored the state jump \u2014 ${$e}`)}async function uo(e,t){let r=e?.state,o=t===void 0,a=te(),n=o?a?.getState():t?.state,d=[],c=[],s;if(o){let{mechanism:y,hasStore:b}=re();b?y==="patch"&&(s=`auto-instrumented store cannot be restored \u2014 ${$e}`):s="no Redux store instrumented"}let p=n??{},l=r??{};for(let y of qr(p,l)){let b=Mr({key:y,label:y,oldValue:p[y],newValue:l[y],inOld:Object.prototype.hasOwnProperty.call(p,y),inNew:Object.prototype.hasOwnProperty.call(l,y)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});s&&(b=Ur(b,s)),d.push(b)}return s&&c.push(`Redux restore unavailable: ${s}`),{items:d,notes:c}}_r({id:"redux",label:"Redux",status:lo,capture:so,restore:co,previewItems:uo});function it(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...o)=>t(r(...o)))}function Ft(e){return rt(),(t,r)=>r&&r.type===xe?r.payload:e(t,r)}function po(e){if(typeof e!="object"||e===null)return false;let t=e.type;return typeof t!="string"?false:!t.startsWith("@@buoy/")&&!t.startsWith("@@redux/")}var Ve=e=>(t,r)=>{let o=e(Ft(t),r),a={...o,dispatch:n=>{if(!po(n)||Pt())return o.dispatch(n);let d=performance.now(),c=o.getState(),s=o.dispatch(n);return x.addAction(n,c,o.getState(),performance.now()-d),s},replaceReducer:n=>o.replaceReducer(Ft(n)),[et]:true};return ee(a,"enhancer"),a};function go(...e){return e.length===0?it(Ve):e.length===1&&typeof e[0]=="object"&&e[0]!==null?(...t)=>it(...t,Ve):it(...e,Ve)}var lt=false;function Mt(){if(!(typeof Vt<"u"&&Vt))return false;let e=globalThis;return e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||(e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__=go,lt=true),lt}function ho(){return lt}Mt();import{useState as Oe,useMemo as ve,useRef as ze,useCallback as ae,useEffect as Ht}from"react";var _t={};Nr(_t,{AccessibilityInfo:()=>bo,ActivityIndicator:()=>ba,Alert:()=>Sa,Animated:()=>xo,AppRegistry:()=>So,AppState:()=>vo,Appearance:()=>Co,BackHandler:()=>wo,Button:()=>xa,CheckBox:()=>Wo,Clipboard:()=>To,DeviceEventEmitter:()=>ea,Dimensions:()=>Ao,Easing:()=>Io,FlatList:()=>qt,I18nManager:()=>Do,Image:()=>No,ImageBackground:()=>Fo,InteractionManager:()=>Ro,Keyboard:()=>Bo,KeyboardAvoidingView:()=>Mo,LayoutAnimation:()=>ko,Linking:()=>Eo,LogBox:()=>Zo,Modal:()=>ya,NativeEventEmitter:()=>$o,NativeModules:()=>mo,PanResponder:()=>Vo,Picker:()=>Ho,PixelRatio:()=>Oo,Platform:()=>zo,Pressable:()=>fa,ProgressBar:()=>_o,RefreshControl:()=>qo,SafeAreaView:()=>Uo,ScrollView:()=>Le,SectionList:()=>Ko,Share:()=>Lo,StatusBar:()=>Yo,StyleSheet:()=>ge,Switch:()=>ma,Text:()=>f,TextInput:()=>pa,Touchable:()=>Jo,TouchableHighlight:()=>ga,TouchableNativeFeedback:()=>Go,TouchableOpacity:()=>J,TouchableWithoutFeedback:()=>ha,UIManager:()=>jo,Vibration:()=>Po,View:()=>i,VirtualizedList:()=>Xo,YellowBox:()=>Qo,findNodeHandle:()=>Ca,unstable_createElement:()=>yo,useColorScheme:()=>ta,useLocaleContext:()=>ra,useWindowDimensions:()=>oa});Fr(_t,fo);import*as fo from"react-native-web";import{unstable_createElement as yo,NativeModules as mo,AccessibilityInfo as bo,Animated as xo,Appearance as Co,AppRegistry as So,AppState as vo,BackHandler as wo,Clipboard as To,Dimensions as Ao,Easing as Io,I18nManager as Do,Keyboard as Bo,InteractionManager as Ro,LayoutAnimation as ko,Linking as Eo,NativeEventEmitter as $o,PanResponder as Vo,PixelRatio as Oo,Platform as zo,Share as Lo,StyleSheet as ge,UIManager as jo,Vibration as Po,CheckBox as Wo,FlatList as qt,Image as No,ImageBackground as Fo,KeyboardAvoidingView as Mo,Picker as Ho,ProgressBar as _o,RefreshControl as qo,SafeAreaView as Uo,SectionList as Ko,StatusBar as Yo,Touchable as Jo,TouchableNativeFeedback as Go,VirtualizedList as Xo,YellowBox as Qo,LogBox as Zo,DeviceEventEmitter as ea,useColorScheme as ta,useLocaleContext as ra,useWindowDimensions as oa}from"react-native-web";import*as M from"react-native-web";import{createElement as st,forwardRef as Ut,useCallback as aa,useRef as na}from"react";import{useEffect as ia,useState as la}from"react";import{createPortal as sa}from"react-dom";var ca='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as da}from"react/jsx-runtime";var we=Symbol.for("@buoy-gg/portal-host"),Kt=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function Yt(){let e=document;if(e[we])return e[we].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:ca});let r=()=>{let l=document.fullscreenElement,y=l&&l.tagName!=="CANVAS"?l:document.body;t.parentElement!==y&&y.appendChild(t)},o=new Map,a=l=>{(!t.contains(l.target)||!Kt(l.target))&&o.set(l.code||l.key,{key:l.key,code:l.code,location:l.location,keyCode:l.keyCode,which:l.which,altKey:l.altKey,ctrlKey:l.ctrlKey,metaKey:l.metaKey,shiftKey:l.shiftKey})},n=l=>{o.delete(l.code||l.key)},d=()=>o.clear(),c=()=>{let l=[...o.values()];o.clear();for(let y of l)document.dispatchEvent(new KeyboardEvent("keyup",{...y,bubbles:true}))},s=l=>{Kt(l.target)&&l.stopPropagation()},p=l=>l.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",d),t.addEventListener("focusin",c),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",p,{passive:true}),e[we]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",d),t.remove(),delete e[we]}},t}function ua({children:e}){let[t,r]=la(null);return ia(()=>{let o=Yt(),a=document[we];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?sa(da("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}function _(e){let t=Ut((o,a)=>{let{accessibilityState:n,accessibilityValue:d,...c}=o;for(let s of["busy","checked","disabled","expanded","selected"])n?.[s]!==void 0&&c[`aria-${s}`]===void 0&&(c[`aria-${s}`]=n[s]);for(let[s,p]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))d?.[s]!==void 0&&c[`aria-${p}`]===void 0&&(c[`aria-${p}`]=d[s]);return st(e,{...c,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var i=_(M.View),f=_(M.Text),pa=_(M.TextInput),J=_(M.TouchableOpacity),ga=_(M.TouchableHighlight),ha=_(M.TouchableWithoutFeedback),fa=_(M.Pressable),Le=_(M.ScrollView),Jt=Ut((e,t)=>{let r=na(null),o=aa(a=>{if(a){let n=a;for(;n.parentElement&&n.parentElement!==document.body;)n=n.parentElement;n.parentElement===document.body&&(r.current=n,Object.assign(n.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Yt().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return st(ua,null,st(M.Modal,{...e,ref:o}))});Jt.displayName="Modal";var ya=_(Jt),ma=_(M.Switch),ba=_(M.ActivityIndicator),xa=_(M.Button),Ca=M.findNodeHandle,Sa={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 p=document.createElement("p");p.textContent=t,p.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",a.appendChild(p)}let d=document.createElement("div");d.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let c=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let p of c){let l=document.createElement("button");l.type="button",l.textContent=p.text??"OK",l.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${p.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,l.onclick=()=>{s(),p.onPress?.()},d.appendChild(l)}a.addEventListener("cancel",p=>{p.preventDefault(),o?.cancelable!==false&&(s(),o?.onDismiss?.())}),a.appendChild(d),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{JsModal as va,ModalHeader as ne,macOSColors as G,night as T,Search as wa,Trash2 as Ta,Power as Aa,Zap as Ia,CheckCircle as Da,Copy as Ba,Lock as Ra,AlertTriangle as Gt,devToolsStorageKeys as ka,copyToClipboard as Ea,ProUpgradeModal as $a,PowerToggleButton as Va,TickProvider as Xt,useLimit as Oa,TIER_LIMITS as za,windowDragProps as La,ToolEmptyState as ja,resolveListEmptyState as Pa,EVENT_LIST_PRESET as Wa,monoFont as Na}from"@buoy-gg/shared-ui/web";import{useIsPro as Fa}from"@buoy-gg/license/web";import{useState as Ma,useMemo as Qt,useCallback as Zt}from"react";import{useChangeLog as Ha}from"@buoy-gg/shared-ui/web";var _a=(e,t)=>x.filterActions(t);function er(){let e=Ha(x,{filterItems:_a}),[t,r]=Ma(null),o=Qt(()=>x.getStats(),[e.items]),a=Qt(()=>x.getUniqueActionTypes(),[e.items]),n=Zt(()=>{x.clearActions(),r(null)},[]),d=Zt(c=>x.getActionById(c),[]);return{actions:e.items,filteredActions:e.filteredItems,filter:e.filter,setFilter:e.setFilter,stats:o,clearActions:n,isEnabled:e.isEnabled,toggleCapture:e.toggleCapture,actionTypes:a,getActionById:d,selectedAction:t,setSelectedAction:r}}import{useStore as qa}from"react-redux";function tr(){return qa}import{useEffect as Ua,useState as je,useRef as rr,useCallback as or}from"react";var Te=Symbol.for("@@buoy/instrumented"),ct=Symbol.for("@@buoy/originalDispatch");function Ka(e){let t=e;return t[Te]===true||t[et]===true}function dt(e,t={}){let r=e;if(r[et])return ee(e,"enhancer"),()=>{};if(Pt())return ee(e,"middleware"),()=>{};if(r[Te])return ee(e,"patch"),()=>{};let{maxActions:o=200,ignoreActions:a=[]}=t;x.setMaxActions(o);let n=e.dispatch.bind(e);r[ct]=n;let d=(c=>{if(typeof c!="object"||c===null||typeof c.type!="string")return n(c);let s=c.type;if(s.startsWith("@@buoy/")||s.startsWith("@@redux/")||a.includes(s))return n(c);let p=performance.now(),l=e.getState(),y=n(c),b=e.getState(),$=performance.now()-p;return x.addAction(c,l,b,$),y});return e.dispatch=d,r[Te]=true,ee(e,"patch"),()=>{ut(e)}}function ut(e){let t=e;if(t[Te]){let r=t[ct];r&&(e.dispatch=r),delete t[Te],delete t[ct]}zt(e)}function Ya(e,t={}){return dt(e,t)}function Pe(){return te()}function Ja(){return te()!==null}function pt(e={}){let{autoStart:t=true}=e,r=rr(e);r.current=e;let[o,a]=je(false),[n,d]=je(true),[c,s]=je(null),[p,l]=je(null),y=rr(null),b=tr(),$=b!==null,O=null,z=null,j=null;if(b)try{O=b()}catch(V){j="no-provider",z=V instanceof Error?V.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else j="no-react-redux",z="react-redux is not installed or not available";let P=re().mechanism==="extension"?te():null,w=or(()=>{if(!O&&P){a(true),l(P),s(null),d(false);return}if(!O){Kr(j),s(z||"No Redux store available"),d(false);return}try{let V=dt(O,r.current);y.current=V,a(true),l(O),s(null)}catch(V){s(V instanceof Error?V.message:"Failed to instrument Redux store"),a(false)}finally{d(false)}},[O,P]),K=or(()=>{y.current&&(y.current(),y.current=null),p&&ut(p),a(false),l(null)},[p]);return Ua(()=>(t?w():d(false),()=>{}),[t,w]),{isInstrumented:o,isLoading:n,error:c,isReactReduxAvailable:$,captureMechanism:re().mechanism,startInstrumentation:w,stopInstrumentation:K,store:p}}function Ga(){let e=tr();if(!e)return{isAvailable:false,error:"react-redux is not installed"};try{let t=e();return{isAvailable:t!=null,error:null}}catch(t){return{isAvailable:false,error:t instanceof Error?t.message:"Not inside a Redux Provider"}}}import{memo as Xa}from"react";import{ChangeRow as Ae,buoyColors as ie,AlertCircle as Qa,monoFont as Za}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as ar}from"react/jsx-runtime";var nr=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function en(e){return e<=0?{bg:"rgba(142, 142, 147, 0.2)",text:ie.textSecondary}:nr[(e-1)%nr.length]}var gt={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function tn(e){if(!e)return"#6B7280";let t=e.toLowerCase();if(gt[t])return gt[t];for(let[r,o]of Object.entries(gt))if(t.includes(r))return o;return`hsl(${e.split("").reduce((r,o)=>r+o.charCodeAt(0),0)*137%360}, 70%, 60%)`}function rn(e,t){switch(e){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return t?t.charAt(0).toUpperCase()+t.slice(1):"Action"}}function on(e,t,r){switch(e){case"pending":return ie.warning;case"fulfilled":return ie.success;case"rejected":return ie.error;case"internal":return ie.textMuted;case"query":return ie.info;case"mutation":return ie.info;default:return tn(r)}}function an(e){let t=[];return e.duration!==void 0&&e.duration>=.1&&t.push(`${e.duration.toFixed(1)}ms`),e.hasStateChange?e.changedKeysCount&&e.changedKeysCount>0?t.push(`${e.changedKeysCount} key${e.changedKeysCount>1?"s":""} changed`):t.push(e.diffSummary||"state changed"):t.push("no state change"),t.join(" \xB7 ")}function nn(e){return e.actionName?.toUpperCase()||e.type.split("/").pop()?.toUpperCase()||""}function ln(e){if(e.category==="internal")return e.type;let t=e.type.split("/");return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])?t.slice(0,-1).join("/"):e.type}var ir=Xa(function({action:e,onPress:t,linkedCount:r,testID:o}){let a=e.sliceName??void 0,n=on(e.category,e.hasStateChange,a),d=rn(e.category,a),c=an(e),s=ln(e),p=nn(e),l=p&&p!==s.toUpperCase()?p:void 0,y=(r??0)>1,b=y?x.getLinkedActions(e):[],$=y?b.findIndex(w=>w.id===e.id)+1:0,O=y&&e.meta?.requestId?x.getAsyncOperationIndex(e.meta.requestId):0,z=en(O),j=y?le(i,{style:[We.asyncSequenceBadge,{backgroundColor:z.bg}],children:ar(f,{style:[We.asyncSequenceText,{color:z.text}],testID:o?`${o}-seq`:void 0,children:[$,"/",r," #",O]})}):void 0,P={statusColor:n,statusLabel:d,sublabel:c,primaryText:s,timestamp:e.timestamp,onPress:()=>t(e),testID:o,accessibilityLabel:`${s}, ${d}, ${c}`};return e.isSlowAction?le(Ae,{...P,badgePrefix:j,slow:true}):e.category==="rejected"?le(Ae,{...P,customBadge:ar(i,{style:We.badgeContainer,children:[j,le(i,{style:We.errorBadge,testID:o?`${o}-error`:void 0,children:le(Qa,{size:12,color:ie.error})})]})}):y?le(Ae,{...P,badgePrefix:j,changed:e.hasStateChange}):e.hasStateChange?le(Ae,{...P,badgeText:l,changed:true}):le(Ae,{...P,plainBadgeText:l})}),We=ge.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:Za}});import{useState as lr,useCallback as Ne,useMemo as sr}from"react";import{macOSColors as Ie,night as X,EventStepperFooter as cr,formatRelativeTime as Fe,parseValue as Me,monoFont as De}from"@buoy-gg/shared-ui/web";import{DataViewer as sn,SplitDiffViewer as cn,TreeDiffViewer as dn,diffThemes as un}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as pn}from"react";import{DetailViewToggle as gn,FileText as hn,Database as fn,GitBranch as yn}from"@buoy-gg/shared-ui/web";import{jsx as mn}from"react/jsx-runtime";var bn=[{key:"action",label:"ACTION",description:"View action details",icon:hn},{key:"state",label:"STATE",description:"View current state",icon:fn},{key:"diff",label:"DIFF",description:"Compare changes",icon:yn}],xn=["diff"],Cn=pn(function({activeView:e,onViewChange:t,diffDisabled:r=false}){return mn(gn,{views:bn,activeView:e,onViewChange:t,disabledKeys:r?xn:void 0,testIDPrefix:"buoy-redux"})});import{memo as Sn,useMemo as vn,useCallback as He,useState as wn,useEffect as Tn}from"react";import{buoyColors as D,night as S,Clock as An,AlertTriangle as In,Zap as Dn,Hash as dr,Info as Bn,Box as Rn,AlertCircle as kn,FileText as En,parseValue as _e,ProUpgradeModal as $n,copyToClipboard as ur,InfoRow as se,monoFont as ce}from"@buoy-gg/shared-ui/web";import{useIsPro as Vn}from"@buoy-gg/license/web";import{DataViewer as qe}from"@buoy-gg/shared-ui/web/dataViewer";import{night as B,monoFont as On}from"@buoy-gg/shared-ui/web";import{jsx as pr,jsxs as zn}from"react/jsx-runtime";var Ln={replay:{color:B.color.accent,backgroundColor:B.color.accent+"15",borderColor:B.color.accent+"40",textColor:B.color.accent},copy:{color:B.color.accent,backgroundColor:B.color.accent+"15",borderColor:B.color.accent+"40",textColor:B.color.accent},jump:{color:B.color.warning,backgroundColor:B.color.warning+"15",borderColor:B.color.warning+"40",textColor:B.color.warning},skip:{color:B.color.textSecondary,backgroundColor:B.color.textSecondary+"26",borderColor:B.color.textSecondary+"59",textColor:B.color.textSecondary},clear:{color:B.color.danger,backgroundColor:B.color.danger+"15",borderColor:B.color.danger+"40",textColor:B.color.danger},diff:{color:B.color.info,backgroundColor:B.color.info+"15",borderColor:B.color.info+"40",textColor:B.color.info}};function Ue({onPress:e,text:t,type:r,disabled:o=false,testID:a}){let n=Ln[r];return zn(J,{testID:a,disabled:o,onPress:e,style:[ht.button,{backgroundColor:o?B.color.textTertiary+"1A":n.backgroundColor,borderColor:o?B.color.textTertiary+"33":n.borderColor,opacity:o?.5:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},children:[pr(i,{style:[ht.dot,{backgroundColor:o?B.color.textTertiary:n.color}]}),pr(f,{style:[ht.text,{color:o?B.color.textTertiary:n.textColor}],children:t})]})}var ht=ge.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:6,borderWidth:1,paddingHorizontal:12,paddingVertical:6,height:25,minWidth:80,shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:2},dot:{width:5,height:5,borderRadius:3,marginRight:6,shadowColor:B.color.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:On,height:12}});var h="buoy-redux";function gr(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function hr(e,t){return`${h}-row-${gr(e)}-${t}`}function fr(e){let t=new Map,r=new Map;for(let o of e){let a=(t.get(o.type)??0)+1;t.set(o.type,a),r.set(o.id,hr(o.type,a))}return r}import{jsx as g,jsxs as R}from"react/jsx-runtime";function yr(e){switch(e){case"pending":return{label:"PENDING",color:D.warning,bgColor:D.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:D.success,bgColor:D.success+"26"};case"rejected":return{label:"REJECTED",color:D.error,bgColor:D.error+"26"};case"internal":return{label:"INTERNAL",color:D.textMuted,bgColor:D.textMuted+"26"};case"query":return{label:"QUERY",color:D.info,bgColor:D.info+"26"};case"mutation":return{label:"MUTATION",color:D.info,bgColor:D.info+"26"};default:return{label:"ACTION",color:D.info,bgColor:D.info+"26"}}}function jn(e){return e===void 0?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function Ce({icon:e,title:t,badge:r,testID:o}){return R(i,{style:u.sectionHeader,testID:o,children:[R(i,{style:u.sectionHeaderLeft,children:[g(e,{size:14,color:S.color.accent}),g(f,{style:u.sectionTitle,children:t})]}),r]})}function Pn(e){let t=new Date(e),r=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0"),n=t.getMilliseconds().toString().padStart(3,"0");return`${r}:${o}:${a}.${n}`}var Wn=Sn(function({action:e,onNavigateToAction:t}){let r=Vn(),[o,a]=wn(false);Tn(()=>{o&&r&&a(false)},[o,r]);let n=yr(e.category),d=oe(e.nextState),c=ke(),s=d||!c,p=e.payload!==void 0,l=e.meta&&Object.keys(e.meta).length>0,y=e.error!==void 0,b=vn(()=>x.getLinkedActions(e),[e]),$=b.length>1,O=$?x.getBaseActionType(e.type):null,z=e.meta?.requestId?x.getAsyncOperationDuration(e.meta.requestId):null,j=He(async()=>{if(!r){a(true);return}await ur(e.action)},[e,r]),P=He(async()=>{if(!r){a(true);return}await ur(e.payload)},[e.payload,r]),w=He(()=>{e.action&&typeof e.action=="object"&&"type"in e.action&&Nt(e.action)},[e]),K=He(()=>{e.nextState!==void 0&&Wt(e.nextState)},[e]);return R(Le,{testID:`${h}-detail-scroll`,style:u.container,contentContainerStyle:u.contentContainer,showsVerticalScrollIndicator:false,children:[R(i,{style:u.card,testID:`${h}-info-card`,children:[g(Ce,{icon:Bn,title:"ACTION INFO"}),R(i,{style:u.cardContent,children:[g(se,{label:"Type",value:e.type,mono:true,testID:`${h}-info-type`}),e.sliceName&&g(se,{label:"Slice",value:e.sliceName,mono:true,testID:`${h}-info-slice`}),g(se,{label:"Action",value:e.actionName,mono:true,testID:`${h}-info-action`}),R(i,{style:u.badgeRow,children:[g(i,{style:[u.categoryBadge,{backgroundColor:n.bgColor}],children:g(f,{style:[u.categoryText,{color:n.color}],testID:`${h}-info-category`,children:n.label})}),R(i,{style:[u.durationBadge,e.isSlowAction&&u.durationBadgeSlow],children:[g(An,{size:10,color:e.isSlowAction?D.error:S.color.textSecondary}),g(f,{style:[u.durationText,e.isSlowAction&&u.durationTextSlow],testID:`${h}-info-duration`,children:jn(e.duration)}),e.isSlowAction&&g(In,{size:10,color:D.error})]}),e.hasStateChange?R(i,{style:u.changesBadge,children:[g(Dn,{size:10,color:D.success}),g(f,{style:u.changesText,testID:`${h}-info-changes`,children:e.diffSummary||"changed"})]}):g(i,{style:u.noChangesBadge,children:g(f,{style:u.noChangesText,testID:`${h}-info-no-changes`,children:"no change"})})]})]})]}),$&&R(i,{style:u.card,testID:`${h}-async-card`,children:[g(Ce,{icon:dr,title:"ASYNC FLOW",badge:g(i,{style:u.asyncBadge,children:R(f,{style:u.asyncBadgeText,testID:`${h}-async-count`,children:[b.length," ACTIONS"]})})}),R(i,{style:u.cardContent,children:[g(f,{style:u.baseActionType,testID:`${h}-async-base`,children:O}),z!==null&&R(i,{style:u.totalDurationRow,children:[g(f,{style:u.totalDurationLabel,children:"Total Duration"}),R(f,{style:u.totalDurationValue,testID:`${h}-async-total`,children:[z,"ms"]})]}),g(i,{style:u.timeline,children:b.map((V,F)=>{let Q=yr(V.category),Y=V.id===e.id;return R(J,{style:[u.timelineItem,Y&&u.timelineItemCurrent],onPress:()=>t?.(V),disabled:Y||!t,activeOpacity:.7,testID:`${h}-async-step-${F}`,children:[F<b.length-1&&g(i,{style:u.timelineConnector}),g(i,{style:[u.timelineDot,{backgroundColor:Q.color}]}),R(i,{style:u.timelineContent,children:[R(i,{style:u.timelineHeader,children:[g(i,{style:[u.timelineStatusBadge,{backgroundColor:Q.bgColor}],children:g(f,{style:[u.timelineStatusText,{color:Q.color}],testID:`${h}-async-step-${F}-status`,children:Q.label})}),Y&&g(i,{style:u.currentBadge,testID:`${h}-async-step-${F}-current`,children:g(f,{style:u.currentBadgeText,children:"CURRENT"})})]}),g(f,{style:u.timelineTime,children:Pn(V.timestamp)})]})]},V.id)})})]})]}),p&&R(i,{style:u.card,testID:`${h}-payload-card`,children:[g(Ce,{icon:Rn,title:"PAYLOAD",badge:g(i,{style:u.typeBadge,children:g(f,{style:u.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload=="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),g(i,{style:u.dataViewerContainer,children:g(qe,{title:"",data:_e(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),l&&R(i,{style:u.card,testID:`${h}-meta-card`,children:[g(Ce,{icon:dr,title:"ASYNC METADATA",badge:g(i,{style:[u.categoryBadge,{backgroundColor:n.bgColor}],children:g(f,{style:[u.categoryText,{color:n.color}],children:"RTK THUNK"})})}),R(i,{style:u.cardContent,children:[e.meta?.requestId&&g(se,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&g(se,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:n.color,testID:`${h}-meta-status`}),e.meta?.arg!==void 0&&R(i,{style:u.argSection,children:[g(f,{style:u.argLabel,children:"Original Argument"}),g(i,{style:u.argValueContainer,children:typeof e.meta.arg=="object"?g(qe,{title:"",data:_e(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):g(f,{style:u.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&g(se,{label:"Rejected With Value",value:"true",valueColor:D.error}),e.meta?.aborted&&g(se,{label:"Aborted",value:"true",valueColor:D.warning}),e.meta?.condition&&g(se,{label:"Condition",value:"true",valueColor:S.color.textTertiary})]})]}),y&&R(i,{style:[u.card,u.errorCard],testID:`${h}-error-card`,children:[g(Ce,{icon:kn,title:"ERROR",badge:g(i,{style:u.errorBadge,children:g(f,{style:u.errorBadgeText,testID:`${h}-error-badge`,children:"REJECTED"})})}),g(i,{style:u.dataViewerContainer,children:typeof e.error=="object"?g(qe,{title:"",data:_e(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):g(f,{style:u.errorText,children:String(e.error)})})]}),R(i,{style:u.card,testID:`${h}-full-action-card`,children:[g(Ce,{icon:En,title:"FULL ACTION OBJECT"}),g(i,{style:u.dataViewerContainer,children:g(qe,{title:"",data:_e(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),g(i,{style:u.actionFooter,children:R(i,{style:u.actionsGrid,children:[R(i,{style:u.actionButtonWrapper,children:[g(Ue,{type:"replay",text:"REPLAY",onPress:w,testID:`${h}-replay`}),g(f,{style:u.actionDescription,children:"Dispatch again"})]}),R(i,{style:u.actionButtonWrapper,children:[g(Ue,{type:"jump",text:"JUMP",onPress:K,disabled:s,testID:`${h}-jump`}),g(f,{style:u.actionDescription,testID:`${h}-jump-description`,children:d?"State not retained":c?"Restore this state":"Time travel not wired"})]}),R(i,{style:u.actionButtonWrapper,children:[g(Ue,{type:"copy",text:"COPY ACTION",onPress:j,testID:`${h}-copy-action`}),g(f,{style:u.actionDescription,children:r?"Copy to clipboard":"Pro feature"})]}),p&&R(i,{style:u.actionButtonWrapper,children:[g(Ue,{type:"copy",text:"COPY PAYLOAD",onPress:P,testID:`${h}-copy-payload`}),g(f,{style:u.actionDescription,children:r?"Copy payload only":"Pro feature"})]})]})}),g($n,{visible:o,onClose:()=>a(false),featureName:"Copy"})]})}),u=ge.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:S.color.surface,borderRadius:6,borderWidth:1,borderColor:S.color.accent+"4D",overflow:"hidden",shadowColor:S.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:D.error+"4D",shadowColor:D.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:S.color.accent+"33",backgroundColor:S.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:S.color.accent,fontFamily:ce},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.surfaceElevated},durationBadgeSlow:{backgroundColor:D.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:S.color.textSecondary,fontFamily:ce},durationTextSlow:{color:D.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:D.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:D.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:S.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:S.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:S.color.textTertiary,fontFamily:ce},dataViewerContainer:{backgroundColor:S.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:S.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:S.color.bg,borderRadius:6,borderWidth:1,borderColor:S.color.border,overflow:"hidden"},argValue:{fontSize:11,color:S.color.text,fontFamily:ce,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:D.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:D.error,letterSpacing:.3},errorText:{fontSize:12,color:D.error,fontFamily:ce,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:S.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:S.color.text,fontFamily:ce,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:S.color.border},totalDurationLabel:{fontSize:11,color:S.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:D.success,fontFamily:ce},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:S.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:S.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:S.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:S.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:S.color.textTertiary,fontFamily:ce},actionFooter:{backgroundColor:S.color.surface,borderRadius:6,borderWidth:1,borderColor:S.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:S.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:S.color.textTertiary,textAlign:"center"}});import{DiffModeTabs as Nn,CompareBar as Fn}from"@buoy-gg/shared-ui/web";import{jsx as k,jsxs as he}from"react/jsx-runtime";function ft(e){return e.includes("/pending")?Ie.semantic.warning:e.includes("/fulfilled")?Ie.semantic.success:e.includes("/rejected")?Ie.semantic.error:e.startsWith("@@")?Ie.text.muted:Ie.semantic.info}function mr(e){if(e.includes("/pending"))return"PENDING";if(e.includes("/fulfilled"))return"FULFILLED";if(e.includes("/rejected"))return"REJECTED";if(e.startsWith("@@"))return"INTERNAL";let t=e.split("/");return t[t.length-1]?.toUpperCase()||"ACTION"}function Mn(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}function br(e){return new Date(e).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var Hn=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function xr({action:e,actions:t,selectedIndex:r,onIndexChange:o,disableInternalFooter:a=false,initialView:n="action"}){let[d,c]=lr(n),[s,p]=lr("tree"),l=t.length,y=oe(e.nextState),b=ft(e.type),$=mr(e.type),O=Mn(Me(e.nextState)),z=l-r,j=z-1,P=r<l-1?r+1:null,w=P!==null?t[P]:null,K=sr(()=>({index:P??0,label:j>0?`#${j}`:"Initial",timestamp:w?br(w.timestamp):"",relativeTime:w?Fe(new Date(w.timestamp)):"state",badge:w?k(i,{style:[E.actionBadgeSmall,{backgroundColor:`${ft(w.type)}20`}],children:k(f,{style:[E.actionTextSmall,{color:ft(w.type)}],children:mr(w.type)})}):void 0}),[P,w,j]),V=sr(()=>({index:r,label:`#${z}`,timestamp:br(e.timestamp),relativeTime:Fe(new Date(e.timestamp)),badge:k(i,{style:[E.actionBadgeSmall,{backgroundColor:`${b}20`}],children:k(f,{style:[E.actionTextSmall,{color:b}],children:$})})}),[r,e.timestamp,b,$,z]),F=Ne(()=>{if(y)return he(i,{style:E.contentCard,testID:`${h}-state-evicted`,children:[k(i,{style:E.valueHeader,children:k(f,{style:E.valueLabel,children:"STATE AFTER ACTION"})}),k(f,{style:E.evictedText,children:`Not retained. Raw state is kept for the ${ot} most recent actions, so this action's before/after trees have been released.`})]});let fe=Me(e.nextState);return he(i,{style:E.contentCard,testID:`${h}-state-card`,children:[he(i,{style:E.valueHeader,children:[k(f,{style:E.valueLabel,children:"STATE AFTER ACTION"}),he(i,{style:E.valueHeaderBadges,children:[k(i,{style:[E.actionBadge,{backgroundColor:`${b}20`}],children:k(f,{style:[E.actionText,{color:b}],children:$})}),k(i,{style:E.typeBadge,children:k(f,{style:E.typeText,testID:`${h}-state-type`,children:O.toUpperCase()})})]})]}),k(i,{style:E.dataViewerContainer,children:k(sn,{title:"",data:fe,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,b,$,O,y]),Q=Ne(()=>{let fe=Me(e.prevState),ye=Me(e.nextState);return s==="split"?k(Le,{style:{flex:1},showsVerticalScrollIndicator:true,children:k(cn,{oldValue:fe,newValue:ye,theme:un.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})}):k(dn,{oldValue:fe,newValue:ye})},[e.prevState,e.nextState,s]),Y=Ne(()=>{o(Math.min(l-1,r+1))},[r,l,o]),Ge=Ne(()=>{o(Math.max(0,r-1))},[r,o]),W=y||oe(e.prevState)||e.prevState===void 0,Z=!a&&l>1;return he(i,{style:E.container,children:[k(Cn,{activeView:d,onViewChange:c,diffDisabled:W}),he(i,{style:[E.contentArea,Z&&E.contentAreaFooterPad],children:[d==="action"&&k(Wn,{action:e}),d==="state"&&k(i,{style:E.stateContainer,children:F()}),d==="diff"&&he(i,{style:E.diffContainer,testID:`${h}-diff`,children:[k(Nn,{tabs:Hn,activeTab:s,onTabChange:p,testIDPrefix:`${h}-diff-tab`}),k(Fn,{leftEvent:K,rightEvent:V}),k(i,{style:E.diffContent,testID:`${h}-diff-content`,children:Q()})]})]}),Z&&k(cr,{currentIndex:z-1,totalItems:l,onPrevious:Y,onNext:Ge,itemLabel:"Action",subtitle:Fe(new Date(e.timestamp)),absolute:true})]})}function Cr({action:e,actions:t,selectedIndex:r,onIndexChange:o}){let a=t.length;if(a<=1)return null;let n=a-r;return k(cr,{currentIndex:n-1,totalItems:a,onPrevious:()=>o(Math.min(a-1,r+1)),onNext:()=>o(Math.max(0,r-1)),itemLabel:"Action",subtitle:Fe(new Date(e.timestamp))})}var E=ge.create({container:{flex:1,backgroundColor:"transparent"},contentArea:{flex:1},contentAreaFooterPad:{paddingBottom:96},stateContainer:{flex:1,padding:14},contentCard:{backgroundColor:X.color.surface,borderRadius:14,padding:14,borderWidth:1,borderColor:X.color.border},valueHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:8},valueLabel:{fontSize:10,color:X.color.textSecondary,fontFamily:De,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:De,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:X.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:X.color.textTertiary,fontFamily:De},valueBox:{backgroundColor:X.color.bg,borderRadius:6,borderWidth:1,borderColor:X.color.border,padding:8},evictedText:{fontSize:12,color:X.color.textSecondary,lineHeight:18},valueText:{fontSize:12,color:X.color.text,fontFamily:De,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:De},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});import{Fragment as _n,jsx as m,jsxs as N}from"react/jsx-runtime";var qn=za["redux.actions"].free;function Un({isEnabled:e,query:t,totalActions:r}){let o=Pa({subject:"actions",search:t,total:r,capturing:e,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return m(ja,{...o,testID:`${h}-empty`})}function yt({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,onActionSelect:d,initialSelectedActionId:c,initialDetailView:s}){let p=Fa(),l=Oa("redux.actions"),[y,b]=Oe(false),{isInstrumented:$,isLoading:O,error:z,isReactReduxAvailable:j,captureMechanism:P}=pt(),{filteredActions:w,filter:K,setFilter:V,stats:F,clearActions:Q,isEnabled:Y,toggleCapture:Ge}=er(),W=ve(()=>w.slice(0,l),[w,l]),Z=ve(()=>Math.max(0,w.length-l),[w.length,l]),fe=Z>0,[ye,Re]=Oe(null),me=ve(()=>{if(ye===null)return null;let C=W.findIndex(L=>L.id===ye);return C>=0?C:null},[ye,W]),U=me!==null?W[me]:null,xt=ze(null);Ht(()=>{if(!d)return;let C=U?.id??null;C===null||C===xt.current||(xt.current=C,d(U))},[U,d]);let Ct=ze(null);Ht(()=>{!c||Ct.current===c||W.findIndex(C=>C.id===c)<0||(Ct.current=c,Re(c))},[c,W]);let[Se,St]=Oe(""),[vt,Xe]=Oe(false),mi=ze(null),Ar=ze(null),Ir=ae(C=>{},[]),Dr=C=>{St(C),V(L=>({...L,searchText:C}))},Br=ae(()=>{St(""),V(C=>({...C,searchText:""})),Xe(false)},[V]),wt=ae(C=>{Re(C.id)},[]),Rr=ae(()=>{b(true)},[]),kr=ae(()=>{Re(null)},[]),Tt=ae(C=>{let L=W[C];L&&Re(L.id)},[W]),Er=async()=>{if(!p){b(true);return}let C=w.map(L=>({id:L.id,type:L.type,...L.payload!==void 0&&{payload:L.payload},timestamp:L.timestamp,prevState:L.prevState,nextState:L.nextState,hasStateChange:L.hasStateChange}));await Ea(C)},$r=ae(C=>C.id,[]),At=ve(()=>fr(W),[W]),It=ve(()=>{let C=new Map;for(let L of x.getActions()){let Qe=L.meta?.requestId;Qe&&C.set(Qe,(C.get(Qe)??0)+1)}return C},[w]),Vr=ae(({item:C})=>{let L=C.meta?.requestId;return m(ir,{action:C,onPress:wt,linkedCount:L?It.get(L)??0:0,testID:At.get(C.id)})},[wt,At,It]),Dt=()=>U?N(ne,{children:[m(ne.Navigation,{onBack:kr}),m(ne.Content,{title:U.type,centered:true,testID:`${h}-detail-title`})]}):N(ne,{children:[r&&m(ne.Navigation,{onBack:r}),m(ne.Content,{title:"",children:vt?m(ne.Search,{value:Se,onChangeText:Dr,onCancel:Br,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${h}-search-field`,containerTestID:`${h}-search`,clearTestID:`${h}-search-clear`,onBlur:()=>{Se.length===0&&Xe(false)}}):N(i,{style:I.headerChipRow,children:[N(J,{style:[I.headerChip,!K.onlyWithChanges&&I.headerChipActive],onPress:()=>V(C=>({...C,onlyWithChanges:false})),testID:`${h}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${F.totalActions} captured`,accessibilityState:{selected:!K.onlyWithChanges},children:[m(f,{style:I.headerChipLabel,children:"ALL"}),m(f,{style:[I.headerChipValue,{color:T.color.text}],testID:`${h}-chip-all-value`,children:F.totalActions})]}),N(J,{style:[I.headerChip,K.onlyWithChanges&&I.headerChipActive],onPress:()=>V(C=>({...C,onlyWithChanges:true})),testID:`${h}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${F.actionsWithChanges} of them`,accessibilityState:{selected:!!K.onlyWithChanges},children:[m(Ia,{size:12,color:G.semantic.warning}),m(f,{style:[I.headerChipValue,{color:G.semantic.warning}],testID:`${h}-chip-changed-value`,children:F.actionsWithChanges})]}),N(i,{style:I.headerChip,testID:`${h}-chip-types`,accessibilityLabel:`${F.uniqueActionTypes} distinct action types`,children:[m(Da,{size:12,color:G.semantic.success}),m(f,{style:[I.headerChipValue,{color:G.semantic.success}],testID:`${h}-chip-types-value`,children:F.uniqueActionTypes})]})]})}),N(ne.Actions,{children:[!vt&&m(J,{onPress:()=>Xe(true),style:[I.headerActionButton,Se.length>0&&I.headerActionButtonActive],testID:`${h}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:m(wa,{size:14,color:Se.length>0?T.color.accent:T.color.textSecondary})}),m(J,{onPress:Er,style:[I.headerActionButton,w.length===0&&I.headerActionButtonDisabled],disabled:w.length===0,testID:`${h}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:w.length===0},children:m(Ba,{size:14,color:w.length>0?T.color.textSecondary:T.color.textTertiary})}),m(Va,{isEnabled:Y,onToggle:Ge,accessibilityLabel:"Toggle Redux action capture",testID:`${h}-power`}),m(J,{onPress:Q,style:[I.headerActionButton,w.length===0&&I.headerActionButtonDisabled],disabled:w.length===0,testID:`${h}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:w.length===0},children:m(Ta,{size:14,color:w.length>0?T.color.textTertiary:T.color.textTertiary})})]})]}),Or=a?ka.modal.root():"buoy-redux-modal";if(!e)return null;let Bt=U&&me!==null?m(Cr,{action:U,actions:W,selectedIndex:me,onIndexChange:Tt}):null,zr=U&&W.length>1?68:0,Lr=U==null,Rt=m(i,{style:I.container,children:U&&me!==null?m(xr,{action:U,actions:W,selectedIndex:me,onIndexChange:Tt,disableInternalFooter:true,initialView:s}):N(_n,{children:[z&&!$&&!x.isCaptureSuppressed()&&N(i,{style:I.errorBanner,testID:`${h}-banner-error`,children:[m(Gt,{size:14,color:T.color.danger}),m(f,{style:I.errorText,children:j?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!Y&&$&&N(i,{style:I.disabledBanner,testID:`${h}-banner-disabled`,children:[m(Aa,{size:14,color:T.color.warning}),m(f,{style:I.disabledText,children:"Action capture is disabled"})]}),P==="patch"&&!x.isCaptureSuppressed()&&N(i,{style:I.disabledBanner,testID:`${h}-banner-patch`,children:[m(Gt,{size:14,color:T.color.warning}),m(f,{style:I.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),fe&&N(J,{style:I.lockedBanner,onPress:Rr,activeOpacity:.8,testID:`${h}-locked`,accessibilityRole:"button",accessibilityLabel:`${Z} older ${Z===1?"action":"actions"} locked. Upgrade to see them.`,children:[m(Ra,{size:14,color:T.color.accent}),N(f,{style:I.lockedText,testID:`${h}-locked-text`,children:[Z," older ",Z===1?"action":"actions"," locked"]}),m(i,{style:I.upgradeBadge,children:m(f,{style:I.upgradeBadgeText,children:"UPGRADE"})})]}),W.length>0?m(qt,{ref:Ar,testID:`${h}-list`,data:W,renderItem:Vr,keyExtractor:$r,contentContainerStyle:I.listContent,showsVerticalScrollIndicator:true,...Wa}):m(Un,{isEnabled:Y,query:Se,totalActions:F.totalActions})]})}),kt=m($a,{visible:y,onClose:()=>b(false),featureName:"Full Action History"});return n?N(Xt,{children:[N(i,{style:I.inlineRoot,children:[m(i,{style:I.inlineHeader,...La,children:Dt()}),Rt,Bt]}),kt]}):N(Xt,{children:[m(va,{visible:e,onClose:t,onMinimize:o,persistenceKey:Or,header:{showToggleButton:true,customContent:Dt()},onModeChange:Ir,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Lr,styles:{},footer:Bt,footerHeight:zr,children:Rt}),kt]})}function Kn(e={}){return m(yt,{...e,inline:true,visible:true,onClose:()=>{}})}var I=ge.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:G.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:T.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:T.color.border},headerChipActive:{backgroundColor:T.color.accentSoft,borderColor:T.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:T.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:Na},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:T.color.surfaceElevated,borderWidth:1,borderColor:T.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:T.color.accentSoft,borderColor:T.color.accentBorderStrong},startButton:{backgroundColor:G.semantic.successBackground,borderColor:G.semantic.success+"40"},stopButton:{backgroundColor:G.semantic.errorBackground,borderColor:G.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:T.color.danger+"20"},errorText:{color:T.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:T.color.warning+"20"},disabledText:{color:T.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:T.color.accentBorder},lockedText:{color:T.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:T.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:T.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});import{ReduxIcon as Ke,REDUX_ICON_COLOR as Qi}from"@buoy-gg/floating-tools-core/web";import{createToolFactory as Yn,defineToolPreset as Jn}from"@buoy-gg/shared-ui/web";import{jsx as Sr}from"react/jsx-runtime";var vr=Jn({id:"redux",name:"REDUX",description:"Redux action & state inspector",slot:"both",icon:({size:e})=>Sr(Ke,{size:e}),component:yt,props:{enableSharedModalDimensions:false}}),Gn=Yn(vr,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}),e=>({icon:({size:t})=>Sr(Ke,{size:t,color:e.iconColor})}));var Xn={timeTravel:false,toggle:false,edit:false,diff:true,export:true,import:false,reset:true,recording:true};function Qn(e,t,r){return{id:e.id,label:e.type,timestamp:e.timestamp,data:e.payload??e.action,prevState:e.prevState,nextState:e.nextState,hasStateChange:e.hasStateChange,duration:e.duration,source:"redux",isCurrent:t===0,isInFuture:false,isSkipped:false,meta:{fullAction:e.action}}}function wr(e){let{icon:t=Ke,color:r="#764ABC",name:o="Redux"}=e??{},a=0;return{id:"redux",name:o,icon:t,color:r,capabilities:Xn,subscribe:n=>x.subscribe(()=>{n()}),getEntries:()=>{let n=x.getActions();return n.map((d,c)=>Qn(d,c,n.length))},getEntryCount:()=>x.getActions().length,getCurrentState:()=>{let n=x.getActions();if(n.length!==0)return n[0].nextState},getStateAtEntry:n=>x.getActionById(String(n))?.nextState,get currentIndex(){return a},jumpTo:n=>{let d=x.getActions().findIndex(c=>c.id===String(n));d!==-1&&(a=d)},get isRecording(){return x.getEnabled()},setRecording:n=>{x.setEnabled(n)},reset:()=>{x.clearActions(),a=0},exportHistory:()=>{let n=x.getActions();return JSON.stringify(n,null,2)}}}var Zn=wr();import{WIRE_DETAIL_LIMIT_BYTES as ei,capDetail as ti,createSyncAdapter as ri,memoByIdentity as oi,readParams as Be,toWire as ai}from"@buoy-gg/shared-ui/web";var Ye=e=>ai(e,Gr),ni=oi(e=>{let t=oe(e.prevState)?{...e}:{...e,prevState:Lt,nextState:Lt};if(t.payload=Ye(t.payload),t.action=Ye(t.action),t.error=Ye(t.error),t.meta){let r=Ye(t.meta.arg);r!==t.meta.arg&&(t.meta={...t.meta,arg:r})}return t});function ii(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e):[]}function li(e,t){let{path:r,value:o,remove:a}=t;if(!r)return{ok:false,error:'setState needs a `path`, like "offers.added.<id>".'};if(!a&&o===void 0)return{ok:false,error:"Sent `path` without `value`. Send value (null is fine) or remove:true."};let n=r.split(".").filter(Boolean),d=y=>Array.isArray(y)?[...y]:{...y},c=d(e),s=c;for(let y=0;y<n.length-1;y++){let b=n[y],$=s[b];if(!$||typeof $!="object")return{ok:false,error:`No object at "${n.slice(0,y+1).join(".")}" \u2014 read getState for the real shape.`};let O=d($);s[b]=O,s=O}let p=n[n.length-1],l=s[p];if(a){if(!(p in s))return{ok:false,error:`Nothing at "${r}" to remove.`};Array.isArray(s)?s.splice(Number(p),1):delete s[p]}else s[p]=o;return{ok:true,next:c,prev:l}}function si(e){let t={};if(!e||typeof e!="object"||Array.isArray(e))return t;for(let[r,o]of Object.entries(e).slice(0,40))o&&typeof o=="object"&&!Array.isArray(o)&&(t[r]=Object.keys(o).slice(0,12));return t}function mt(){let e=re().diagnostic??"not-instrumented";return{available:false,slices:[],reason:e}}var ci=ri({version:2,getSnapshot:()=>x.getActions().map(ni),subscribe:e=>x.subscribe(e),actions:{clearEvents:()=>{x.clearActions()},getActionDetail:e=>{let{id:t}=Be(e);if(!t)return{found:false,reason:"missing id"};let r=x.getActionById(t);if(!r)return{found:false,reason:"unknown id"};if(oe(r.prevState))return{found:true,id:t,evicted:true,reason:"Raw state was evicted (retained for recent actions only)."};let o=n=>ti(n,ei),a=n=>{if(!n)return n;let d=o(n.arg);return d===n.arg?n:{...n,arg:d}};return{found:true,id:t,prevState:o(r.prevState),nextState:o(r.nextState),payload:o(r.payload),action:o(r.action),meta:a(r.meta),error:o(r.error)}},getState:e=>{let{includeValues:t=false}=Be(e),r=Pe();if(!r)return mt();let o=r.getState(),a=re();return{available:true,slices:ii(o),sliceFields:si(o),capture:a.capture,mechanism:a.mechanism,...t?{state:o}:{}}},dispatch:e=>{let{action:t}=Be(e),r=Pe();if(!r)return{dispatched:false,...mt()};if(!t)throw new Error("dispatch requires an `action`");return r.dispatch(t),{dispatched:true,type:t.type}},setState:e=>{let t=Pe();if(!t)return{ok:false,...mt()};if(!ke())return{ok:false,error:"This store has no Buoy time-travel reducer, so its state can't be edited directly. Dispatch one of the app's own actions instead."};let r=li(t.getState(),Be(e));return r.ok?(t.dispatch({type:xe,payload:r.next}),{ok:true,path:Be(e).path,previous:r.prev}):r}}});import{useState as di}from"react";import{macOSColors as de,night as q,TabSelector as ui,DataInspector as ue,CollapsibleSection as Je,CopyButton as pi,monoFont as bt}from"@buoy-gg/shared-ui/web";import{jsx as v,jsxs as H}from"react/jsx-runtime";function gi({action:e}){let[t,r]=di("action"),o=[{key:"action",label:"Action"},{key:"state",label:"State"},{key:"diff",label:"Diff"}],a=new Date(e.timestamp).toLocaleTimeString(),n=()=>JSON.stringify({type:e.type,payload:e.payload,timestamp:e.timestamp,duration:e.duration,hasStateChange:e.hasStateChange},null,2);return H(i,{style:A.container,children:[H(i,{style:A.header,children:[H(i,{style:A.headerContent,children:[v(f,{style:A.actionType,numberOfLines:2,children:e.type}),H(i,{style:A.headerMeta,children:[v(f,{style:A.metaText,children:a}),e.duration!==void 0&&H(f,{style:A.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&v(i,{style:A.changeBadge,children:v(f,{style:A.changeBadgeText,children:"State Changed"})})]})]}),v(pi,{value:n(),size:16})]}),v(i,{style:A.tabContainer,children:v(ui,{tabs:o,activeTab:t,onTabChange:d=>r(d)})}),H(Le,{style:A.content,showsVerticalScrollIndicator:true,children:[t==="action"&&H(i,{style:A.section,children:[v(Je,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?v(ue,{data:e.payload}):v(f,{style:A.emptyText,children:"No payload"})}),v(Je,{title:"Full Action",defaultOpen:false,children:v(ue,{data:e.action})})]}),t==="state"&&H(i,{style:A.section,children:[v(Je,{title:"Previous State",defaultOpen:false,children:v(ue,{data:e.prevState})}),v(Je,{title:"Next State",defaultOpen:true,children:v(ue,{data:e.nextState})})]}),t==="diff"&&v(i,{style:A.section,children:e.hasStateChange?v(hi,{prevState:e.prevState,nextState:e.nextState}):v(i,{style:A.noChangeContainer,children:v(f,{style:A.noChangeText,children:"No state changes from this action"})})})]})]})}function hi({prevState:e,nextState:t}){let r=Tr(e,t);return r.length===0?v(i,{style:A.noChangeContainer,children:v(f,{style:A.noChangeText,children:"No differences detected"})}):v(i,{children:r.map((o,a)=>H(i,{style:A.diffItem,children:[H(i,{style:A.diffHeader,children:[v(i,{style:[A.diffTypeBadge,{backgroundColor:o.type==="added"?de.semantic.successBackground:o.type==="removed"?de.semantic.errorBackground:de.semantic.warningBackground}],children:v(f,{style:[A.diffTypeText,{color:o.type==="added"?de.semantic.success:o.type==="removed"?de.semantic.error:de.semantic.warning}],children:o.type.toUpperCase()})}),v(f,{style:A.diffPath,children:o.path})]}),o.type==="modified"&&H(i,{style:A.diffValues,children:[H(i,{style:A.diffValue,children:[v(f,{style:A.diffLabel,children:"Before:"}),v(ue,{data:o.oldValue})]}),H(i,{style:A.diffValue,children:[v(f,{style:A.diffLabel,children:"After:"}),v(ue,{data:o.newValue})]})]}),o.type==="added"&&v(i,{style:A.diffValue,children:v(ue,{data:o.newValue})}),o.type==="removed"&&v(i,{style:A.diffValue,children:v(ue,{data:o.oldValue})})]},a))})}function Tr(e,t,r=""){let o=[];if(typeof e!="object"||typeof t!="object")return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;if(e===null||t===null)return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;let a=e,n=t,d=new Set([...Object.keys(a),...Object.keys(n)]);for(let c of d){let s=r?`${r}.${c}`:c,p=a[c],l=n[c];c in a?c in n?p!==l&&(typeof p=="object"&&typeof l=="object"&&p!==null&&l!==null&&!Array.isArray(p)&&!Array.isArray(l)?s.split(".").length<3?o.push(...Tr(p,l,s)):o.push({type:"modified",path:s,oldValue:p,newValue:l}):o.push({type:"modified",path:s,oldValue:p,newValue:l})):o.push({type:"removed",path:s,oldValue:p}):o.push({type:"added",path:s,newValue:l})}return o}var A=ge.create({container:{flex:1},header:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:12,backgroundColor:q.color.surface,borderBottomWidth:1,borderBottomColor:q.color.border},headerContent:{flex:1,marginRight:12},actionType:{fontSize:14,fontWeight:"600",color:q.color.text,fontFamily:bt,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:q.color.textTertiary},durationText:{fontSize:11,color:q.color.textTertiary,fontFamily:bt},changeBadge:{backgroundColor:de.semantic.warningBackground,paddingHorizontal:6,paddingVertical:2,borderRadius:4},changeBadgeText:{fontSize:10,color:de.semantic.warning,fontWeight:"600"},tabContainer:{paddingHorizontal:12,paddingVertical:8},content:{flex:1},section:{paddingHorizontal:12,paddingBottom:20},emptyText:{fontSize:12,color:q.color.textTertiary,fontStyle:"italic",padding:8},noChangeContainer:{padding:20,alignItems:"center"},noChangeText:{fontSize:13,color:q.color.textTertiary},diffItem:{marginBottom:12,backgroundColor:q.color.surface,borderRadius:8,borderWidth:1,borderColor:q.color.border,overflow:"hidden"},diffHeader:{flexDirection:"row",alignItems:"center",gap:8,padding:8,borderBottomWidth:1,borderBottomColor:q.color.border},diffTypeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},diffTypeText:{fontSize:10,fontWeight:"700"},diffPath:{fontSize:12,color:q.color.text,fontFamily:bt},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:q.color.textTertiary,marginBottom:4,fontWeight:"600"}});function fi(){return pt(),null}function yi(e){return ee(e,"extension"),rt(),()=>zt(e)}export{xe as BUOY_JUMP_TO_STATE,oo as BUOY_REPLAY_ACTION,qn as FREE_TIER_ACTION_LIMIT,h as REDUX_TEST_ID,xr as ReduxActionDetailContent,Cr as ReduxActionDetailFooter,gi as ReduxActionDetailView,ir as ReduxActionItem,fi as ReduxAutoInstrument,Ke as ReduxIcon,yt as ReduxModal,Kn as ReduxToolView,hr as actionRowTestID,fr as buildActionRowTestIDs,Ve as buoyDevtoolsEnhancer,no as buoyReduxMiddleware,Mt as claimDevtoolsHook,yi as connectReduxAdapter,io as createBuoyReduxMiddleware,wr as createReduxHistoryAdapter,Gn as createReduxTool,Pe as getActiveStore,re as getInstrumentationStatus,dt as instrumentStore,Ja as isAutoInstrumentActive,ho as isDevtoolsHookClaimed,Ka as isStoreInstrumented,Wt as jumpToState,x as reduxActionStore,Zn as reduxHistoryAdapter,ci as reduxSyncAdapter,vr as reduxToolPreset,Ya as registerReduxStore,Nt as replayAction,gr as slugForTestID,ut as uninstrumentStore,pt as useAutoInstrumentRedux,er as useReduxActions,Ga as useReduxAvailability,ao as withBuoyDevTools};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/redux",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.64",
|
|
4
4
|
"description": "Inspect a connected Redux store, captured actions and state changes, and dispatch supported actions from Buoy tools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"./lib/web/**/*.mjs"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@buoy-gg/
|
|
44
|
-
"@buoy-gg/
|
|
45
|
-
"@buoy-gg/
|
|
43
|
+
"@buoy-gg/license": "^7.0.64",
|
|
44
|
+
"@buoy-gg/shared-ui": "^7.0.64",
|
|
45
|
+
"@buoy-gg/floating-tools-core": "^7.0.64"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@reduxjs/toolkit": ">=1.9.0",
|