@buoy-gg/redux 7.0.84 → 7.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getReactReduxUseStore=getReactReduxUseStore;var _reactRedux=require("react-redux");function getReactReduxUseStore(){return _reactRedux.useStore}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getReactReduxContext=getReactReduxContext;exports.getReactReduxUseStore=getReactReduxUseStore;var _react=require("react");const ContextKey=Symbol.for("react-redux-context");function getReactReduxContext(){const e=globalThis;const r=e[ContextKey]??=new Map;let t=r.get(_react.createContext);if(!t){t=(0,_react.createContext)(null);r.set(_react.createContext,t)}return t}function useStore(){const e=(0,_react.useContext)(getReactReduxContext());if(!e)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>. On the web, Buoy needs react-redux 8.1 or newer.");return e.store}function getReactReduxUseStore(){return useStore}
@@ -1 +1 @@
1
- "use strict";var _sharedUi=require("@buoy-gg/shared-ui");var _activeStoreRegistry=require("./activeStoreRegistry");var _buoyReduxMiddleware=require("./buoyReduxMiddleware");const ENABLE_HINT="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function status(){const{mechanism:n,hasStore:a,diagnostic:s}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(!a){return{canCapture:false,canRestore:false,detail:s==="no-react-redux"?"react-redux not installed":s==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}if(n==="patch"){return{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${ENABLE_HINT}`}}return{canCapture:true,canRestore:true,detail:n==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}}async function capture(){const n=(0,_activeStoreRegistry.getActiveStore)();if(!n){return{data:null,warnings:["no Redux store instrumented"]}}return{data:{state:n.getState()},warnings:[]}}async function restore(n,a){const s=n;const i=(0,_activeStoreRegistry.getActiveStore)();if(!i||s===void 0||s===null){return(0,_sharedUi.skippedRestore)("redux",i?"empty redux snapshot":"no Redux store instrumented")}const{mechanism:p}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(p==="patch"){return(0,_sharedUi.skippedRestore)("redux",`restore unavailable on auto-instrumented stores \u2014 ${ENABLE_HINT}`)}const d=(0,_sharedUi.createRestoreScope)(a);const u=s.state??{};const l=!!(a?.includeKeys||a?.excludeKeys?.length);const o=Object.keys(u).filter(r=>!d.touch(r));let c=s.state;if(l){const r=i.getState()??{};const e={...r};for(const t of new Set([...Object.keys(r),...Object.keys(u)])){if(!d.touch(t))continue;if(t in u)e[t]=u[t];else delete e[t]}c=e}i.dispatch({type:_buoyReduxMiddleware.BUOY_JUMP_TO_STATE,payload:c});if(i.getState()===c){const r=o.length>0?[`${o.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:r}}return(0,_sharedUi.skippedRestore)("redux",`store ignored the state jump \u2014 ${ENABLE_HINT}`)}async function previewItems(n,a){const s=n?.state;const i=a===void 0;const p=(0,_activeStoreRegistry.getActiveStore)();const d=i?p?.getState():a?.state;const u=[];const l=[];let o;if(i){const{mechanism:e,hasStore:t}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(!t)o="no Redux store instrumented";else if(e==="patch"){o=`auto-instrumented store cannot be restored \u2014 ${ENABLE_HINT}`}}const c=d??{};const r=s??{};for(const e of(0,_sharedUi.unionKeys)(c,r)){let t=(0,_sharedUi.classifyPreviewItem)({key:e,label:e,oldValue:c[e],newValue:r[e],inOld:Object.prototype.hasOwnProperty.call(c,e),inNew:Object.prototype.hasOwnProperty.call(r,e)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});if(o)t=(0,_sharedUi.wontApply)(t,o);u.push(t)}if(o)l.push(`Redux restore unavailable: ${o}`);return{items:u,notes:l}}(0,_sharedUi.registerStateSnapshotProvider)({id:"redux",label:"Redux",status,capture,restore,previewItems});
1
+ "use strict";var _sharedUi=require("@buoy-gg/shared-ui");var _activeStoreRegistry=require("./activeStoreRegistry");var _buoyReduxMiddleware=require("./buoyReduxMiddleware");const ENABLE_HINT="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function status(){const{mechanism:n,hasStore:a,diagnostic:s}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(!a){return{canCapture:false,canRestore:false,detail:s==="no-react-redux"?"react-redux not installed":s==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}if(n==="patch"){return{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${ENABLE_HINT}`}}return{canCapture:true,canRestore:true,detail:n==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}}async function capture(){const n=(0,_activeStoreRegistry.getActiveStore)();if(!n){return{data:null,warnings:["no Redux store instrumented"]}}return{data:{state:n.getState()},warnings:[]}}async function restore(n,a){const s=n;const i=(0,_activeStoreRegistry.getActiveStore)();if(!i||s===void 0||s===null){return(0,_sharedUi.skippedRestore)("redux",i?"empty redux snapshot":"no Redux store instrumented")}const{mechanism:p}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(p==="patch"){return{...(0,_sharedUi.skippedRestore)("redux",`restore unavailable on auto-instrumented stores \u2014 ${ENABLE_HINT}`),untouched:true}}if(!(0,_activeStoreRegistry.isTimeTravelAvailable)()){return{...(0,_sharedUi.skippedRestore)("redux",`store cannot take a state jump \u2014 ${ENABLE_HINT}`),untouched:true}}const d=(0,_sharedUi.createRestoreScope)(a);const u=s.state??{};const l=!!(a?.includeKeys||a?.excludeKeys?.length);const o=Object.keys(u).filter(r=>!d.touch(r));let c=s.state;if(l){const r=i.getState()??{};const e={...r};for(const t of new Set([...Object.keys(r),...Object.keys(u)])){if(!d.touch(t))continue;if(t in u)e[t]=u[t];else delete e[t]}c=e}i.dispatch({type:_buoyReduxMiddleware.BUOY_JUMP_TO_STATE,payload:c});if(i.getState()===c){const r=o.length>0?[`${o.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:r}}return(0,_sharedUi.skippedRestore)("redux",`store ignored the state jump \u2014 ${ENABLE_HINT}`)}async function previewItems(n,a){const s=n?.state;const i=a===void 0;const p=(0,_activeStoreRegistry.getActiveStore)();const d=i?p?.getState():a?.state;const u=[];const l=[];let o;if(i){const{mechanism:e,hasStore:t}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(!t)o="no Redux store instrumented";else if(e==="patch"){o=`auto-instrumented store cannot be restored \u2014 ${ENABLE_HINT}`}}const c=d??{};const r=s??{};for(const e of(0,_sharedUi.unionKeys)(c,r)){let t=(0,_sharedUi.classifyPreviewItem)({key:e,label:e,oldValue:c[e],newValue:r[e],inOld:Object.prototype.hasOwnProperty.call(c,e),inNew:Object.prototype.hasOwnProperty.call(r,e)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});if(o)t=(0,_sharedUi.wontApply)(t,o);u.push(t)}if(o)l.push(`Redux restore unavailable: ${o}`);return{items:u,notes:l}}(0,_sharedUi.registerStateSnapshotProvider)({id:"redux",label:"Redux",status,capture,restore,previewItems});
@@ -1 +1 @@
1
- "use strict";import{useStore as e}from"react-redux";export function getReactReduxUseStore(){return e}
1
+ "use strict";import{createContext as o,useContext as r}from"react";const u=Symbol.for("react-redux-context");export function getReactReduxContext(){const e=globalThis;const n=e[u]??=new Map;let t=n.get(o);if(!t){t=o(null);n.set(o,t)}return t}function c(){const e=r(getReactReduxContext());if(!e)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>. On the web, Buoy needs react-redux 8.1 or newer.");return e.store}export function getReactReduxUseStore(){return c}
@@ -1 +1 @@
1
- "use strict";import{classifyPreviewItem as g,createRestoreScope as w,registerStateSnapshotProvider as x,skippedRestore as m,unionKeys as b,wontApply as R}from"@buoy-gg/shared-ui";import{getActiveStore as y,getInstrumentationStatus as h}from"./activeStoreRegistry";import{BUOY_JUMP_TO_STATE as S}from"./buoyReduxMiddleware";const p="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function v(){const{mechanism:r,hasStore:a,diagnostic:o}=h();if(!a){return{canCapture:false,canRestore:false,detail:o==="no-react-redux"?"react-redux not installed":o==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}if(r==="patch"){return{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${p}`}}return{canCapture:true,canRestore:true,detail:r==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}}async function O(){const r=y();if(!r){return{data:null,warnings:["no Redux store instrumented"]}}return{data:{state:r.getState()},warnings:[]}}async function j(r,a){const o=r;const i=y();if(!i||o===void 0||o===null){return m("redux",i?"empty redux snapshot":"no Redux store instrumented")}const{mechanism:f}=h();if(f==="patch"){return m("redux",`restore unavailable on auto-instrumented stores \u2014 ${p}`)}const d=w(a);const u=o.state??{};const l=!!(a?.includeKeys||a?.excludeKeys?.length);const s=Object.keys(u).filter(n=>!d.touch(n));let c=o.state;if(l){const n=i.getState()??{};const e={...n};for(const t of new Set([...Object.keys(n),...Object.keys(u)])){if(!d.touch(t))continue;if(t in u)e[t]=u[t];else delete e[t]}c=e}i.dispatch({type:S,payload:c});if(i.getState()===c){const n=s.length>0?[`${s.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:n}}return m("redux",`store ignored the state jump \u2014 ${p}`)}async function k(r,a){const o=r?.state;const i=a===void 0;const f=y();const d=i?f?.getState():a?.state;const u=[];const l=[];let s;if(i){const{mechanism:e,hasStore:t}=h();if(!t)s="no Redux store instrumented";else if(e==="patch"){s=`auto-instrumented store cannot be restored \u2014 ${p}`}}const c=d??{};const n=o??{};for(const e of b(c,n)){let t=g({key:e,label:e,oldValue:c[e],newValue:n[e],inOld:Object.prototype.hasOwnProperty.call(c,e),inNew:Object.prototype.hasOwnProperty.call(n,e)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});if(s)t=R(t,s);u.push(t)}if(s)l.push(`Redux restore unavailable: ${s}`);return{items:u,notes:l}}x({id:"redux",label:"Redux",status:v,capture:O,restore:j,previewItems:k});
1
+ "use strict";import{classifyPreviewItem as g,createRestoreScope as x,registerStateSnapshotProvider as b,skippedRestore as f,unionKeys as w,wontApply as R}from"@buoy-gg/shared-ui";import{getActiveStore as h,getInstrumentationStatus as y,isTimeTravelAvailable as S}from"./activeStoreRegistry";import{BUOY_JUMP_TO_STATE as v}from"./buoyReduxMiddleware";const d="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function O(){const{mechanism:n,hasStore:a,diagnostic:o}=y();if(!a){return{canCapture:false,canRestore:false,detail:o==="no-react-redux"?"react-redux not installed":o==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}if(n==="patch"){return{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${d}`}}return{canCapture:true,canRestore:true,detail:n==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}}async function j(){const n=h();if(!n){return{data:null,warnings:["no Redux store instrumented"]}}return{data:{state:n.getState()},warnings:[]}}async function k(n,a){const o=n;const i=h();if(!i||o===void 0||o===null){return f("redux",i?"empty redux snapshot":"no Redux store instrumented")}const{mechanism:m}=y();if(m==="patch"){return{...f("redux",`restore unavailable on auto-instrumented stores \u2014 ${d}`),untouched:true}}if(!S()){return{...f("redux",`store cannot take a state jump \u2014 ${d}`),untouched:true}}const l=x(a);const u=o.state??{};const p=!!(a?.includeKeys||a?.excludeKeys?.length);const s=Object.keys(u).filter(r=>!l.touch(r));let c=o.state;if(p){const r=i.getState()??{};const e={...r};for(const t of new Set([...Object.keys(r),...Object.keys(u)])){if(!l.touch(t))continue;if(t in u)e[t]=u[t];else delete e[t]}c=e}i.dispatch({type:v,payload:c});if(i.getState()===c){const r=s.length>0?[`${s.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:r}}return f("redux",`store ignored the state jump \u2014 ${d}`)}async function T(n,a){const o=n?.state;const i=a===void 0;const m=h();const l=i?m?.getState():a?.state;const u=[];const p=[];let s;if(i){const{mechanism:e,hasStore:t}=y();if(!t)s="no Redux store instrumented";else if(e==="patch"){s=`auto-instrumented store cannot be restored \u2014 ${d}`}}const c=l??{};const r=o??{};for(const e of w(c,r)){let t=g({key:e,label:e,oldValue:c[e],newValue:r[e],inOld:Object.prototype.hasOwnProperty.call(c,e),inNew:Object.prototype.hasOwnProperty.call(r,e)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});if(s)t=R(t,s);u.push(t)}if(s)p.push(`Redux restore unavailable: ${s}`);return{items:u,notes:p}}b({id:"redux",label:"Redux",status:O,capture:j,restore:k,previewItems:T});
@@ -1,2 +1,9 @@
1
- export declare function getReactReduxUseStore(): import("react-redux").UseStore<import("redux").Store<unknown, import("redux").Action, unknown>>;
1
+ import { type Context } from 'react';
2
+ import type { Store } from '@reduxjs/toolkit';
3
+ type ReduxContext = Context<{
4
+ store: Store;
5
+ } | null>;
6
+ export declare function getReactReduxContext(): ReduxContext;
7
+ export declare function getReactReduxUseStore(): (() => Store) | null;
8
+ export {};
2
9
  //# sourceMappingURL=reduxPeer.web.d.ts.map
package/lib/web/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";var Vt=Object.defineProperty;var Fr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Hr=Object.prototype.hasOwnProperty;var _r=(e,t)=>{for(var r in t)Vt(e,r,{get:t[r],enumerable:true})},jt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Mr(t))!Hr.call(e,a)&&a!==r&&Vt(e,a,{get:()=>t[a],enumerable:!(o=Fr(t,a))||o.enumerable});return e},qr=(e,t,r)=>(jt(e,t,"default"),r&&jt(r,t,"default"));var zt=(()=>{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 Ur,createRestoreScope as Kr,registerStateSnapshotProvider as Yr,skippedRestore as tt,unionKeys as Jr,wontApply as Gr}from"@buoy-gg/shared-ui/web";var rt=Symbol.for("@@buoy/enhancerInstrumented"),be=null,pe=null,ot=null,Lt=false;function ee(e,t){be=e,pe=t,ot=null}function Pt(e){be===e&&(be=null,pe=null)}function te(){return be}function at(){Lt=true}function $e(){return Lt&&be!==null}function Xr(e){ot=e}function re(){return{mechanism:pe,capture:pe==="enhancer"||pe==="middleware"||pe==="extension"?"full":pe==="patch"?"top-level-only":"none",hasStore:be!==null,timeTravel:$e(),diagnostic:ot}}import{ChangeLog as Qr,approxJsonSize as Zr}from"@buoy-gg/shared-ui/web";var nt=25,it=Object.freeze({__buoyStateEvicted:true,note:`Raw state retained for the ${nt} most recent actions only.`}),Wt=Object.freeze({__buoyStateOnDevice:true,note:"State trees stay on the device \u2014 fetched on demand via getActionDetail."}),eo=Object.freeze({__buoyPayloadOnDevice:true,note:"Payload stays on the device \u2014 fetched on demand via getActionDetail."});function Oe(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 to(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 ro(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 Nt(e,t){return Zr(e,t).bytes>t}function oo(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(Nt(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(Nt(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 ao(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 d=[];a>0&&d.push(`+${a}`),n>0&&d.push(`-${n}`),c>0&&d.push(`~${c}`);let s=a+n+c;return d.length===0?{summary:"nested change",changedCount:1}:{summary:`${d.join(" ")} ${s===1?"key":"keys"}`,changedCount:s}}function no(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 io=class extends Qr{addAction(e,t,r,o){if(!this.canRecord())return;let a=e.type||"";if(!a)return;let n=t!==r,c=to(a),{sliceName:d,actionName:s}=ro(a),u=no(e),i=oo(e.payload),{summary:g,changedCount:m}=ao(t,r),R=(o??0)>16,V={id:this.nextId(),type:a,payload:e.payload,action:e,timestamp:Date.now(),prevState:t,nextState:r,duration:o,hasStateChange:n,category:c,sliceName:d,actionName:s,meta:u,error:e.error,payloadPreview:i,diffSummary:g,changedKeysCount:m,isSlowAction:R};this.push(V);for(let j=nt;j<this.items.length;j++){let L=this.items[j];if(L.prevState!==it)L.prevState=it,L.nextState=it;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:Oe(o.payload)?a.payload:o.payload,action:Oe(o.action)?a.action:o.action,meta:Oe(o.meta?.arg)?a.meta:o.meta,error:Oe(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 io;var lt=false;function Ft(){return lt}var xe="@@buoy/JUMP_TO_STATE",lo="@@buoy/REPLAY_ACTION";function Mt(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(!$e()){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 Ht(e){let t=te();t?t.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}function so(e){return at(),(t,r)=>r.type===xe?r.payload:e(t,r)}var co=e=>(lt=true,ee(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),d=e.getState(),s=performance.now()-a;return x.addAction(o,n,d,s),c});function uo(e={}){let{maxActions:t=200,ignoreActions:r=[]}=e;return x.setMaxActions(t),o=>(lt=true,ee(o,"middleware"),a=>n=>{let c=n,d=c.type||"";if(d?.startsWith("@@buoy/")||r.includes(d))return a(n);let s=performance.now(),u=o.getState(),i=a(n),g=o.getState(),m=performance.now()-s;return x.addAction(c,u,g,m),i})}var Ve="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function po(){let{mechanism:e,hasStore:t,diagnostic:r}=re();return t?e==="patch"?{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${Ve}`}:{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 go(){let e=te();return e?{data:{state:e.getState()},warnings:[]}:{data:null,warnings:["no Redux store instrumented"]}}async function ho(e,t){let r=e,o=te();if(!o||r===void 0||r===null)return tt("redux",o?"empty redux snapshot":"no Redux store instrumented");let{mechanism:a}=re();if(a==="patch")return tt("redux",`restore unavailable on auto-instrumented stores \u2014 ${Ve}`);let n=Kr(t),c=r.state??{},d=!!(t?.includeKeys||t?.excludeKeys?.length),s=Object.keys(c).filter(i=>!n.touch(i)),u=r.state;if(d){let i=o.getState()??{},g={...i};for(let m of new Set([...Object.keys(i),...Object.keys(c)]))n.touch(m)&&(m in c?g[m]=c[m]:delete g[m]);u=g}if(o.dispatch({type:xe,payload:u}),o.getState()===u){let i=s.length>0?[`${s.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:i}}return tt("redux",`store ignored the state jump \u2014 ${Ve}`)}async function fo(e,t){let r=e?.state,o=t===void 0,a=te(),n=o?a?.getState():t?.state,c=[],d=[],s;if(o){let{mechanism:g,hasStore:m}=re();m?g==="patch"&&(s=`auto-instrumented store cannot be restored \u2014 ${Ve}`):s="no Redux store instrumented"}let u=n??{},i=r??{};for(let g of Jr(u,i)){let m=Ur({key:g,label:g,oldValue:u[g],newValue:i[g],inOld:Object.prototype.hasOwnProperty.call(u,g),inNew:Object.prototype.hasOwnProperty.call(i,g)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});s&&(m=Gr(m,s)),c.push(m)}return s&&d.push(`Redux restore unavailable: ${s}`),{items:c,notes:d}}Yr({id:"redux",label:"Redux",status:po,capture:go,restore:ho,previewItems:fo});function st(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...o)=>t(r(...o)))}function _t(e){return at(),(t,r)=>r&&r.type===xe?r.payload:e(t,r)}function yo(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 je=e=>(t,r)=>{let o=e(_t(t),r),a={...o,dispatch:n=>{if(!yo(n)||Ft())return o.dispatch(n);let c=performance.now(),d=o.getState(),s=o.dispatch(n);return x.addAction(n,d,o.getState(),performance.now()-c),s},replaceReducer:n=>o.replaceReducer(_t(n)),[rt]:true};return ee(a,"enhancer"),a};function mo(...e){return e.length===0?st(je):e.length===1&&typeof e[0]=="object"&&e[0]!==null?(...t)=>st(...t,je):st(...e,je)}var ct=false;function qt(){if(!(typeof zt<"u"&&zt))return false;let e=globalThis;return e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||(e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__=mo,ct=true),ct}function bo(){return ct}qt();import{useState as ze,useMemo as Te,useRef as Le,useCallback as ae,useEffect as Ut}from"react";var Kt={};_r(Kt,{AccessibilityInfo:()=>wo,ActivityIndicator:()=>Ta,Alert:()=>Da,Animated:()=>ma,AppRegistry:()=>To,AppState:()=>Ao,Appearance:()=>vo,BackHandler:()=>Io,Button:()=>Aa,CheckBox:()=>Mo,Clipboard:()=>Do,DeviceEventEmitter:()=>oa,Dimensions:()=>Bo,Easing:()=>Ro,FlatList:()=>Yt,I18nManager:()=>ko,Image:()=>Ho,ImageBackground:()=>_o,InteractionManager:()=>$o,Keyboard:()=>Eo,KeyboardAvoidingView:()=>qo,LayoutAnimation:()=>Oo,Linking:()=>Vo,LogBox:()=>ra,Modal:()=>wa,NativeEventEmitter:()=>jo,NativeModules:()=>Co,PanResponder:()=>zo,Picker:()=>Uo,PixelRatio:()=>Lo,Platform:()=>Po,Pressable:()=>Ca,ProgressBar:()=>Ko,RefreshControl:()=>Yo,SafeAreaView:()=>Jo,ScrollView:()=>Pe,SectionList:()=>Go,Share:()=>Wo,StatusBar:()=>Xo,StyleSheet:()=>ge,Switch:()=>va,Text:()=>y,TextInput:()=>ba,Touchable:()=>Qo,TouchableHighlight:()=>xa,TouchableNativeFeedback:()=>Zo,TouchableOpacity:()=>J,TouchableWithoutFeedback:()=>Sa,UIManager:()=>No,Vibration:()=>Fo,View:()=>l,VirtualizedList:()=>ea,YellowBox:()=>ta,findNodeHandle:()=>Ia,unstable_createElement:()=>So,useColorScheme:()=>aa,useLocaleContext:()=>na,useWindowDimensions:()=>ia});qr(Kt,xo);import*as xo from"react-native-web";import{unstable_createElement as So,NativeModules as Co,AccessibilityInfo as wo,Appearance as vo,AppRegistry as To,AppState as Ao,BackHandler as Io,Clipboard as Do,Dimensions as Bo,Easing as Ro,I18nManager as ko,Keyboard as Eo,InteractionManager as $o,LayoutAnimation as Oo,Linking as Vo,NativeEventEmitter as jo,PanResponder as zo,PixelRatio as Lo,Platform as Po,Share as Wo,UIManager as No,Vibration as Fo,CheckBox as Mo,FlatList as Yt,Image as Ho,ImageBackground as _o,KeyboardAvoidingView as qo,Picker as Uo,ProgressBar as Ko,RefreshControl as Yo,SafeAreaView as Jo,SectionList as Go,StatusBar as Xo,Touchable as Qo,TouchableNativeFeedback as Zo,VirtualizedList as ea,YellowBox as ta,LogBox as ra,DeviceEventEmitter as oa,useColorScheme as aa,useLocaleContext as na,useWindowDimensions as ia}from"react-native-web";import*as M from"react-native-web";import{createElement as dt,forwardRef as Jt,useCallback as la,useRef as sa}from"react";import{useEffect as ca,useState as da}from"react";import{createPortal as ua}from"react-dom";var pa='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as ga}from"react/jsx-runtime";var Ae=Symbol.for("@buoy-gg/portal-host"),Gt=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 Xt(){let e=document;if(e[Ae])return e[Ae].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:pa});let r=()=>{let i=document.fullscreenElement,g=i&&i.tagName!=="CANVAS"?i:document.body;t.parentElement!==g&&g.appendChild(t)},o=new Map,a=i=>{(!t.contains(i.target)||!Gt(i.target))&&o.set(i.code||i.key,{key:i.key,code:i.code,location:i.location,keyCode:i.keyCode,which:i.which,altKey:i.altKey,ctrlKey:i.ctrlKey,metaKey:i.metaKey,shiftKey:i.shiftKey})},n=i=>{o.delete(i.code||i.key)},c=()=>o.clear(),d=()=>{let i=[...o.values()];o.clear();for(let g of i)document.dispatchEvent(new KeyboardEvent("keyup",{...g,bubbles:true}))},s=i=>{Gt(i.target)&&i.stopPropagation()},u=i=>i.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",c),t.addEventListener("focusin",d),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",u,{passive:true}),e[Ae]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",c),t.remove(),delete e[Ae]}},t}function ha({children:e}){let[t,r]=da(null);return ca(()=>{let o=Xt(),a=document[Ae];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?ua(ga("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var Se=M,fa=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Ce=e=>typeof e=="number"?`${e}px`:e;function ut(e){if(Array.isArray(e)){let g=e.map(ut);return g.some((m,R)=>m!==e[R])?g:e}if(!e||typeof e!="object"||!fa.some(g=>e[g]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:c,textShadowRadius:d,...s}=e;if(t!=null||r!=null||o!=null||a!=null){let g=t??"black",m=o==null?g:`color-mix(in srgb, ${g} ${Math.min(o,1)*100}%, transparent)`,R=`${Ce(r?.width??0)} ${Ce(r?.height??0)} ${Ce(a??0)} ${m}`;s.boxShadow=typeof s.boxShadow=="string"?`${s.boxShadow}, ${R}`:s.boxShadow??R}let{width:u=0,height:i=0}=c??{};if(n&&(u||i||d)){let g=`${Ce(u)} ${Ce(i)} ${Ce(d??0)} ${n}`;s.textShadow=s.textShadow?`${s.textShadow}, ${g}`:g}return s}var ya=Se.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Qt(e,t){if(typeof e=="function")return o=>Qt(e(o),t);let r=ut(e);return t?[r,ya[t]]:r}var ge={...Se.StyleSheet,create:e=>Se.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ut(r)])))};function _(e){let t=Jt((o,a)=>{let{accessibilityState:n,accessibilityValue:c,pointerEvents:d,...s}=o;for(let i of["busy","checked","disabled","expanded","selected"])n?.[i]!==void 0&&s[`aria-${i}`]===void 0&&(s[`aria-${i}`]=n[i]);for(let[i,g]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[i]!==void 0&&s[`aria-${g}`]===void 0&&(s[`aria-${g}`]=c[i]);let u=Qt(s.style,d);return u!==s.style&&(s.style=u),dt(e,{...s,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var l=_(M.View),y=_(M.Text),ma={...Se.Animated,View:Se.Animated.createAnimatedComponent(l),Text:Se.Animated.createAnimatedComponent(y)},ba=_(M.TextInput),J=_(M.TouchableOpacity),xa=_(M.TouchableHighlight),Sa=_(M.TouchableWithoutFeedback),Ca=_(M.Pressable),Pe=_(M.ScrollView),Zt=Jt((e,t)=>{let r=sa(null),o=la(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"}),Xt().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return dt(ha,null,dt(M.Modal,{...e,ref:o}))});Zt.displayName="Modal";var wa=_(Zt),va=_(M.Switch),Ta=_(M.ActivityIndicator),Aa=_(M.Button),Ia=M.findNodeHandle,Da={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 d=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let u of d){let i=document.createElement("button");i.type="button",i.textContent=u.text??"OK",i.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,i.onclick=()=>{s(),u.onPress?.()},c.appendChild(i)}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 Ba,ModalHeader as ne,macOSColors as G,night as T,Search as Ra,Trash2 as ka,Power as Ea,Zap as $a,CheckCircle as Oa,Copy as Va,Lock as ja,AlertTriangle as er,devToolsStorageKeys as za,copyToClipboard as La,ProUpgradeModal as Pa,PowerToggleButton as Wa,TickProvider as tr,useLimit as Na,TIER_LIMITS as Fa,windowDragProps as Ma,ToolEmptyState as Ha,resolveListEmptyState as _a,EVENT_LIST_PRESET as qa,monoFont as Ua}from"@buoy-gg/shared-ui/web";import{useIsPro as Ka}from"@buoy-gg/license/web";import{useState as Ya,useMemo as rr,useCallback as or}from"react";import{useChangeLog as Ja}from"@buoy-gg/shared-ui/web";var Ga=(e,t)=>x.filterActions(t);function ar(){let e=Ja(x,{filterItems:Ga}),[t,r]=Ya(null),o=rr(()=>x.getStats(),[e.items]),a=rr(()=>x.getUniqueActionTypes(),[e.items]),n=or(()=>{x.clearActions(),r(null)},[]),c=or(d=>x.getActionById(d),[]);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 Xa}from"react-redux";function nr(){return Xa}import{useEffect as Qa,useState as We,useRef as ir,useCallback as lr}from"react";var Ie=Symbol.for("@@buoy/instrumented"),pt=Symbol.for("@@buoy/originalDispatch");function Za(e){let t=e;return t[Ie]===true||t[rt]===true}function gt(e,t={}){let r=e;if(r[rt])return ee(e,"enhancer"),()=>{};if(Ft())return ee(e,"middleware"),()=>{};if(r[Ie])return ee(e,"patch"),()=>{};let{maxActions:o=200,ignoreActions:a=[]}=t;x.setMaxActions(o);let n=e.dispatch.bind(e);r[pt]=n;let c=(d=>{if(typeof d!="object"||d===null||typeof d.type!="string")return n(d);let s=d.type;if(s.startsWith("@@buoy/")||s.startsWith("@@redux/")||a.includes(s))return n(d);let u=performance.now(),i=e.getState(),g=n(d),m=e.getState(),R=performance.now()-u;return x.addAction(d,i,m,R),g});return e.dispatch=c,r[Ie]=true,ee(e,"patch"),()=>{ht(e)}}function ht(e){let t=e;if(t[Ie]){let r=t[pt];r&&(e.dispatch=r),delete t[Ie],delete t[pt]}Pt(e)}function en(e,t={}){return gt(e,t)}function Ne(){return te()}function tn(){return te()!==null}function ft(e={}){let{autoStart:t=true}=e,r=ir(e);r.current=e;let[o,a]=We(false),[n,c]=We(true),[d,s]=We(null),[u,i]=We(null),g=ir(null),m=nr(),R=m!==null,V=null,j=null,L=null;if(m)try{V=m()}catch(O){L="no-provider",j=O instanceof Error?O.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else L="no-react-redux",j="react-redux is not installed or not available";let P=re().mechanism==="extension"?te():null,v=lr(()=>{if(!V&&P){a(true),i(P),s(null),c(false);return}if(!V){Xr(L),s(j||"No Redux store available"),c(false);return}try{let O=gt(V,r.current);g.current=O,a(true),i(V),s(null)}catch(O){s(O instanceof Error?O.message:"Failed to instrument Redux store"),a(false)}finally{c(false)}},[V,P]),K=lr(()=>{g.current&&(g.current(),g.current=null),u&&ht(u),a(false),i(null)},[u]);return Qa(()=>(t?v():c(false),()=>{}),[t,v]),{isInstrumented:o,isLoading:n,error:d,isReactReduxAvailable:R,captureMechanism:re().mechanism,startInstrumentation:v,stopInstrumentation:K,store:u}}function rn(){let e=nr();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 on}from"react";import{ChangeRow as De,buoyColors as ie,AlertCircle as an,monoFont as nn}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as sr}from"react/jsx-runtime";var cr=[{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 ln(e){return e<=0?{bg:"rgba(142, 142, 147, 0.2)",text:ie.textSecondary}:cr[(e-1)%cr.length]}var yt={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function sn(e){if(!e)return"#6B7280";let t=e.toLowerCase();if(yt[t])return yt[t];for(let[r,o]of Object.entries(yt))if(t.includes(r))return o;return`hsl(${e.split("").reduce((r,o)=>r+o.charCodeAt(0),0)*137%360}, 70%, 60%)`}function cn(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 dn(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 sn(r)}}function un(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 pn(e){return e.actionName?.toUpperCase()||e.type.split("/").pop()?.toUpperCase()||""}function gn(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 dr=on(function({action:e,onPress:t,linkedCount:r,testID:o}){let a=e.sliceName??void 0,n=dn(e.category,e.hasStateChange,a),c=cn(e.category,a),d=un(e),s=gn(e),u=pn(e),i=u&&u!==s.toUpperCase()?u:void 0,g=(r??0)>1,m=g?x.getLinkedActions(e):[],R=g?m.findIndex(v=>v.id===e.id)+1:0,V=g&&e.meta?.requestId?x.getAsyncOperationIndex(e.meta.requestId):0,j=ln(V),L=g?le(l,{style:[Fe.asyncSequenceBadge,{backgroundColor:j.bg}],children:sr(y,{style:[Fe.asyncSequenceText,{color:j.text}],testID:o?`${o}-seq`:void 0,children:[R,"/",r," #",V]})}):void 0,P={statusColor:n,statusLabel:c,sublabel:d,primaryText:s,timestamp:e.timestamp,onPress:()=>t(e),testID:o,accessibilityLabel:`${s}, ${c}, ${d}`};return e.isSlowAction?le(De,{...P,badgePrefix:L,slow:true}):e.category==="rejected"?le(De,{...P,customBadge:sr(l,{style:Fe.badgeContainer,children:[L,le(l,{style:Fe.errorBadge,testID:o?`${o}-error`:void 0,children:le(an,{size:12,color:ie.error})})]})}):g?le(De,{...P,badgePrefix:L,changed:e.hasStateChange}):e.hasStateChange?le(De,{...P,badgeText:i,changed:true}):le(De,{...P,plainBadgeText:i})}),Fe=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:nn}});import{useState as ur,useCallback as Me,useMemo as pr}from"react";import{macOSColors as Be,night as X,EventStepperFooter as gr,formatRelativeTime as He,parseValue as _e,monoFont as Re}from"@buoy-gg/shared-ui/web";import{DataViewer as hn,SplitDiffViewer as fn,TreeDiffViewer as yn,diffThemes as mn}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as bn}from"react";import{DetailViewToggle as xn,FileText as Sn,Database as Cn,GitBranch as wn}from"@buoy-gg/shared-ui/web";import{jsx as vn}from"react/jsx-runtime";var Tn=[{key:"action",label:"ACTION",description:"View action details",icon:Sn},{key:"state",label:"STATE",description:"View current state",icon:Cn},{key:"diff",label:"DIFF",description:"Compare changes",icon:wn}],An=["diff"],In=bn(function({activeView:e,onViewChange:t,diffDisabled:r=false}){return vn(xn,{views:Tn,activeView:e,onViewChange:t,disabledKeys:r?An:void 0,testIDPrefix:"buoy-redux"})});import{memo as Dn,useMemo as Bn,useCallback as qe,useState as Rn,useEffect as kn}from"react";import{buoyColors as D,night as C,Clock as En,AlertTriangle as $n,Zap as On,Hash as hr,Info as Vn,Box as jn,AlertCircle as zn,FileText as Ln,parseValue as Ue,ProUpgradeModal as Pn,copyToClipboard as fr,InfoRow as se,monoFont as ce}from"@buoy-gg/shared-ui/web";import{useIsPro as Wn}from"@buoy-gg/license/web";import{DataViewer as Ke}from"@buoy-gg/shared-ui/web/dataViewer";import{night as B,monoFont as Nn}from"@buoy-gg/shared-ui/web";import{jsx as yr,jsxs as Fn}from"react/jsx-runtime";var Mn={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 Ye({onPress:e,text:t,type:r,disabled:o=false,testID:a}){let n=Mn[r];return Fn(J,{testID:a,disabled:o,onPress:e,style:[mt.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:[yr(l,{style:[mt.dot,{backgroundColor:o?B.color.textTertiary:n.color}]}),yr(y,{style:[mt.text,{color:o?B.color.textTertiary:n.textColor}],children:t})]})}var mt=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:Nn,height:12}});var f="buoy-redux";function mr(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function br(e,t){return`${f}-row-${mr(e)}-${t}`}function xr(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,br(o.type,a))}return r}import{jsx as h,jsxs as k}from"react/jsx-runtime";function Sr(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 Hn(e){return e===void 0?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function we({icon:e,title:t,badge:r,testID:o}){return k(l,{style:p.sectionHeader,testID:o,children:[k(l,{style:p.sectionHeaderLeft,children:[h(e,{size:14,color:C.color.accent}),h(y,{style:p.sectionTitle,children:t})]}),r]})}function _n(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 qn=Dn(function({action:e,onNavigateToAction:t}){let r=Wn(),[o,a]=Rn(false);kn(()=>{o&&r&&a(false)},[o,r]);let n=Sr(e.category),c=oe(e.nextState),d=$e(),s=c||!d,u=e.payload!==void 0,i=e.meta&&Object.keys(e.meta).length>0,g=e.error!==void 0,m=Bn(()=>x.getLinkedActions(e),[e]),R=m.length>1,V=R?x.getBaseActionType(e.type):null,j=e.meta?.requestId?x.getAsyncOperationDuration(e.meta.requestId):null,L=qe(async()=>{if(!r){a(true);return}await fr(e.action)},[e,r]),P=qe(async()=>{if(!r){a(true);return}await fr(e.payload)},[e.payload,r]),v=qe(()=>{e.action&&typeof e.action=="object"&&"type"in e.action&&Ht(e.action)},[e]),K=qe(()=>{e.nextState!==void 0&&Mt(e.nextState)},[e]);return k(Pe,{keyboardShouldPersistTaps:"handled",testID:`${f}-detail-scroll`,style:p.container,contentContainerStyle:p.contentContainer,showsVerticalScrollIndicator:false,children:[k(l,{style:p.card,testID:`${f}-info-card`,children:[h(we,{icon:Vn,title:"ACTION INFO"}),k(l,{style:p.cardContent,children:[h(se,{label:"Type",value:e.type,mono:true,testID:`${f}-info-type`}),e.sliceName&&h(se,{label:"Slice",value:e.sliceName,mono:true,testID:`${f}-info-slice`}),h(se,{label:"Action",value:e.actionName,mono:true,testID:`${f}-info-action`}),k(l,{style:p.badgeRow,children:[h(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:h(y,{style:[p.categoryText,{color:n.color}],testID:`${f}-info-category`,children:n.label})}),k(l,{style:[p.durationBadge,e.isSlowAction&&p.durationBadgeSlow],children:[h(En,{size:10,color:e.isSlowAction?D.error:C.color.textSecondary}),h(y,{style:[p.durationText,e.isSlowAction&&p.durationTextSlow],testID:`${f}-info-duration`,children:Hn(e.duration)}),e.isSlowAction&&h($n,{size:10,color:D.error})]}),e.hasStateChange?k(l,{style:p.changesBadge,children:[h(On,{size:10,color:D.success}),h(y,{style:p.changesText,testID:`${f}-info-changes`,children:e.diffSummary||"changed"})]}):h(l,{style:p.noChangesBadge,children:h(y,{style:p.noChangesText,testID:`${f}-info-no-changes`,children:"no change"})})]})]})]}),R&&k(l,{style:p.card,testID:`${f}-async-card`,children:[h(we,{icon:hr,title:"ASYNC FLOW",badge:h(l,{style:p.asyncBadge,children:k(y,{style:p.asyncBadgeText,testID:`${f}-async-count`,children:[m.length," ACTIONS"]})})}),k(l,{style:p.cardContent,children:[h(y,{style:p.baseActionType,testID:`${f}-async-base`,children:V}),j!==null&&k(l,{style:p.totalDurationRow,children:[h(y,{style:p.totalDurationLabel,children:"Total Duration"}),k(y,{style:p.totalDurationValue,testID:`${f}-async-total`,children:[j,"ms"]})]}),h(l,{style:p.timeline,children:m.map((O,F)=>{let Q=Sr(O.category),Y=O.id===e.id;return k(J,{style:[p.timelineItem,Y&&p.timelineItemCurrent],onPress:()=>t?.(O),disabled:Y||!t,activeOpacity:.7,testID:`${f}-async-step-${F}`,children:[F<m.length-1&&h(l,{style:p.timelineConnector}),h(l,{style:[p.timelineDot,{backgroundColor:Q.color}]}),k(l,{style:p.timelineContent,children:[k(l,{style:p.timelineHeader,children:[h(l,{style:[p.timelineStatusBadge,{backgroundColor:Q.bgColor}],children:h(y,{style:[p.timelineStatusText,{color:Q.color}],testID:`${f}-async-step-${F}-status`,children:Q.label})}),Y&&h(l,{style:p.currentBadge,testID:`${f}-async-step-${F}-current`,children:h(y,{style:p.currentBadgeText,children:"CURRENT"})})]}),h(y,{style:p.timelineTime,children:_n(O.timestamp)})]})]},O.id)})})]})]}),u&&k(l,{style:p.card,testID:`${f}-payload-card`,children:[h(we,{icon:jn,title:"PAYLOAD",badge:h(l,{style:p.typeBadge,children:h(y,{style:p.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload=="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),h(l,{style:p.dataViewerContainer,children:h(Ke,{title:"",data:Ue(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),i&&k(l,{style:p.card,testID:`${f}-meta-card`,children:[h(we,{icon:hr,title:"ASYNC METADATA",badge:h(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:h(y,{style:[p.categoryText,{color:n.color}],children:"RTK THUNK"})})}),k(l,{style:p.cardContent,children:[e.meta?.requestId&&h(se,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&h(se,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:n.color,testID:`${f}-meta-status`}),e.meta?.arg!==void 0&&k(l,{style:p.argSection,children:[h(y,{style:p.argLabel,children:"Original Argument"}),h(l,{style:p.argValueContainer,children:typeof e.meta.arg=="object"?h(Ke,{title:"",data:Ue(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):h(y,{style:p.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&h(se,{label:"Rejected With Value",value:"true",valueColor:D.error}),e.meta?.aborted&&h(se,{label:"Aborted",value:"true",valueColor:D.warning}),e.meta?.condition&&h(se,{label:"Condition",value:"true",valueColor:C.color.textTertiary})]})]}),g&&k(l,{style:[p.card,p.errorCard],testID:`${f}-error-card`,children:[h(we,{icon:zn,title:"ERROR",badge:h(l,{style:p.errorBadge,children:h(y,{style:p.errorBadgeText,testID:`${f}-error-badge`,children:"REJECTED"})})}),h(l,{style:p.dataViewerContainer,children:typeof e.error=="object"?h(Ke,{title:"",data:Ue(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):h(y,{style:p.errorText,children:String(e.error)})})]}),k(l,{style:p.card,testID:`${f}-full-action-card`,children:[h(we,{icon:Ln,title:"FULL ACTION OBJECT"}),h(l,{style:p.dataViewerContainer,children:h(Ke,{title:"",data:Ue(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),h(l,{style:p.actionFooter,children:k(l,{style:p.actionsGrid,children:[k(l,{style:p.actionButtonWrapper,children:[h(Ye,{type:"replay",text:"REPLAY",onPress:v,testID:`${f}-replay`}),h(y,{style:p.actionDescription,children:"Dispatch again"})]}),k(l,{style:p.actionButtonWrapper,children:[h(Ye,{type:"jump",text:"JUMP",onPress:K,disabled:s,testID:`${f}-jump`}),h(y,{style:p.actionDescription,testID:`${f}-jump-description`,children:c?"State not retained":d?"Restore this state":"Time travel not wired"})]}),k(l,{style:p.actionButtonWrapper,children:[h(Ye,{type:"copy",text:"COPY ACTION",onPress:L,testID:`${f}-copy-action`}),h(y,{style:p.actionDescription,children:r?"Copy to clipboard":"Pro feature"})]}),u&&k(l,{style:p.actionButtonWrapper,children:[h(Ye,{type:"copy",text:"COPY PAYLOAD",onPress:P,testID:`${f}-copy-payload`}),h(y,{style:p.actionDescription,children:r?"Copy payload only":"Pro feature"})]})]})}),h(Pn,{visible:o,onClose:()=>a(false),featureName:"Copy"})]})}),p=ge.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:C.color.surface,borderRadius:6,borderWidth:1,borderColor:C.color.accent+"4D",overflow:"hidden",shadowColor:C.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:C.color.accent+"33",backgroundColor:C.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:C.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:C.color.surfaceElevated},durationBadgeSlow:{backgroundColor:D.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:C.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:C.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:C.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:C.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:C.color.textTertiary,fontFamily:ce},dataViewerContainer:{backgroundColor:C.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:C.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:C.color.bg,borderRadius:6,borderWidth:1,borderColor:C.color.border,overflow:"hidden"},argValue:{fontSize:11,color:C.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:C.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:C.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:C.color.text,fontFamily:ce,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:C.color.border},totalDurationLabel:{fontSize:11,color:C.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:C.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:C.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:C.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:C.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:C.color.textTertiary,fontFamily:ce},actionFooter:{backgroundColor:C.color.surface,borderRadius:6,borderWidth:1,borderColor:C.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:C.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:C.color.textTertiary,textAlign:"center"}});import{DiffModeTabs as Un,CompareBar as Kn}from"@buoy-gg/shared-ui/web";import{jsx as E,jsxs as he}from"react/jsx-runtime";function bt(e){return e.includes("/pending")?Be.semantic.warning:e.includes("/fulfilled")?Be.semantic.success:e.includes("/rejected")?Be.semantic.error:e.startsWith("@@")?Be.text.muted:Be.semantic.info}function Cr(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 Yn(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}function wr(e){return new Date(e).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var Jn=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function vr({action:e,actions:t,selectedIndex:r,onIndexChange:o,disableInternalFooter:a=false,initialView:n="action"}){let[c,d]=ur(n),[s,u]=ur("tree"),i=t.length,g=oe(e.nextState),m=bt(e.type),R=Cr(e.type),V=Yn(_e(e.nextState)),j=i-r,L=j-1,P=r<i-1?r+1:null,v=P!==null?t[P]:null,K=pr(()=>({index:P??0,label:L>0?`#${L}`:"Initial",timestamp:v?wr(v.timestamp):"",relativeTime:v?He(new Date(v.timestamp)):"state",badge:v?E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${bt(v.type)}20`}],children:E(y,{style:[$.actionTextSmall,{color:bt(v.type)}],children:Cr(v.type)})}):void 0}),[P,v,L]),O=pr(()=>({index:r,label:`#${j}`,timestamp:wr(e.timestamp),relativeTime:He(new Date(e.timestamp)),badge:E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionTextSmall,{color:m}],children:R})})}),[r,e.timestamp,m,R,j]),F=Me(()=>{if(g)return he(l,{style:$.contentCard,testID:`${f}-state-evicted`,children:[E(l,{style:$.valueHeader,children:E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"})}),E(y,{style:$.evictedText,children:`Not retained. Raw state is kept for the ${nt} most recent actions, so this action's before/after trees have been released.`})]});let fe=_e(e.nextState);return he(l,{style:$.contentCard,testID:`${f}-state-card`,children:[he(l,{style:$.valueHeader,children:[E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"}),he(l,{style:$.valueHeaderBadges,children:[E(l,{style:[$.actionBadge,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionText,{color:m}],children:R})}),E(l,{style:$.typeBadge,children:E(y,{style:$.typeText,testID:`${f}-state-type`,children:V.toUpperCase()})})]})]}),E(l,{style:$.dataViewerContainer,children:E(hn,{title:"",data:fe,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,m,R,V,g]),Q=Me(()=>{let fe=_e(e.prevState),ye=_e(e.nextState);return s==="split"?E(Pe,{keyboardShouldPersistTaps:"handled",style:{flex:1},showsVerticalScrollIndicator:true,children:E(fn,{oldValue:fe,newValue:ye,theme:mn.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})}):E(yn,{oldValue:fe,newValue:ye})},[e.prevState,e.nextState,s]),Y=Me(()=>{o(Math.min(i-1,r+1))},[r,i,o]),Qe=Me(()=>{o(Math.max(0,r-1))},[r,o]),W=g||oe(e.prevState)||e.prevState===void 0,Z=!a&&i>1;return he(l,{style:$.container,children:[E(In,{activeView:c,onViewChange:d,diffDisabled:W}),he(l,{style:[$.contentArea,Z&&$.contentAreaFooterPad],children:[c==="action"&&E(qn,{action:e}),c==="state"&&E(l,{style:$.stateContainer,children:F()}),c==="diff"&&he(l,{style:$.diffContainer,testID:`${f}-diff`,children:[E(Un,{tabs:Jn,activeTab:s,onTabChange:u,testIDPrefix:`${f}-diff-tab`}),E(Kn,{leftEvent:K,rightEvent:O}),E(l,{style:$.diffContent,testID:`${f}-diff-content`,children:Q()})]})]}),Z&&E(gr,{currentIndex:j-1,totalItems:i,onPrevious:Y,onNext:Qe,itemLabel:"Action",subtitle:He(new Date(e.timestamp)),absolute:true})]})}function Tr({action:e,actions:t,selectedIndex:r,onIndexChange:o}){let a=t.length;if(a<=1)return null;let n=a-r;return E(gr,{currentIndex:n-1,totalItems:a,onPrevious:()=>o(Math.min(a-1,r+1)),onNext:()=>o(Math.max(0,r-1)),itemLabel:"Action",subtitle:He(new Date(e.timestamp))})}var $=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:Re,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:Re,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:X.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:X.color.textTertiary,fontFamily:Re},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:Re,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:Re},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});import{Fragment as Gn,jsx as b,jsxs as N}from"react/jsx-runtime";var Xn=Fa["redux.actions"].free;function Qn({isEnabled:e,query:t,totalActions:r}){let o=_a({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 b(Ha,{...o,testID:`${f}-empty`})}function xt({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,onActionSelect:c,initialSelectedActionId:d,initialDetailView:s}){let u=Ka(),i=Na("redux.actions"),[g,m]=ze(false),{isInstrumented:R,isLoading:V,error:j,isReactReduxAvailable:L,captureMechanism:P}=ft(),{filteredActions:v,filter:K,setFilter:O,stats:F,clearActions:Q,isEnabled:Y,toggleCapture:Qe}=ar(),W=Te(()=>v.slice(0,i),[v,i]),Z=Te(()=>Math.max(0,v.length-i),[v.length,i]),fe=Z>0,[ye,Ee]=ze(null),me=Te(()=>{if(ye===null)return null;let S=W.findIndex(z=>z.id===ye);return S>=0?S:null},[ye,W]),U=me!==null?W[me]:null,wt=Le(null);Ut(()=>{if(!c)return;let S=U?.id??null;S===null||S===wt.current||(wt.current=S,c(U))},[U,c]);let vt=Le(null);Ut(()=>{!d||vt.current===d||W.findIndex(S=>S.id===d)<0||(vt.current=d,Ee(d))},[d,W]);let[ve,Tt]=ze(""),[At,Ze]=ze(false),vi=Le(null),Rr=Le(null),kr=ae(S=>{},[]),Er=S=>{Tt(S),O(z=>({...z,searchText:S}))},$r=ae(()=>{Tt(""),O(S=>({...S,searchText:""})),Ze(false)},[O]),It=ae(S=>{Ee(S.id)},[]),Or=ae(()=>{m(true)},[]),Vr=ae(()=>{Ee(null)},[]),Dt=ae(S=>{let z=W[S];z&&Ee(z.id)},[W]),jr=async()=>{if(!u){m(true);return}let S=v.map(z=>({id:z.id,type:z.type,...z.payload!==void 0&&{payload:z.payload},timestamp:z.timestamp,prevState:z.prevState,nextState:z.nextState,hasStateChange:z.hasStateChange}));await La(S)},zr=ae(S=>S.id,[]),Bt=Te(()=>xr(W),[W]),Rt=Te(()=>{let S=new Map;for(let z of x.getActions()){let et=z.meta?.requestId;et&&S.set(et,(S.get(et)??0)+1)}return S},[v]),Lr=ae(({item:S})=>{let z=S.meta?.requestId;return b(dr,{action:S,onPress:It,linkedCount:z?Rt.get(z)??0:0,testID:Bt.get(S.id)})},[It,Bt,Rt]),kt=()=>U?N(ne,{children:[b(ne.Navigation,{onBack:Vr}),b(ne.Content,{title:U.type,centered:true,testID:`${f}-detail-title`})]}):N(ne,{children:[r&&b(ne.Navigation,{onBack:r}),b(ne.Content,{title:"",children:At?b(ne.Search,{value:ve,onChangeText:Er,onCancel:$r,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${f}-search-field`,containerTestID:`${f}-search`,clearTestID:`${f}-search-clear`,onBlur:()=>{ve.length===0&&Ze(false)}}):N(l,{style:I.headerChipRow,children:[N(J,{style:[I.headerChip,!K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(S=>({...S,onlyWithChanges:false})),testID:`${f}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${F.totalActions} captured`,accessibilityState:{selected:!K.onlyWithChanges},children:[b(y,{style:I.headerChipLabel,children:"ALL"}),b(y,{style:[I.headerChipValue,{color:T.color.text}],testID:`${f}-chip-all-value`,children:F.totalActions})]}),N(J,{style:[I.headerChip,K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(S=>({...S,onlyWithChanges:true})),testID:`${f}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${F.actionsWithChanges} of them`,accessibilityState:{selected:!!K.onlyWithChanges},children:[b($a,{size:12,color:G.semantic.warning}),b(y,{style:[I.headerChipValue,{color:G.semantic.warning}],testID:`${f}-chip-changed-value`,children:F.actionsWithChanges})]}),N(l,{style:I.headerChip,testID:`${f}-chip-types`,accessibilityLabel:`${F.uniqueActionTypes} distinct action types`,children:[b(Oa,{size:12,color:G.semantic.success}),b(y,{style:[I.headerChipValue,{color:G.semantic.success}],testID:`${f}-chip-types-value`,children:F.uniqueActionTypes})]})]})}),N(ne.Actions,{children:[!At&&b(J,{onPress:()=>Ze(true),style:[I.headerActionButton,ve.length>0&&I.headerActionButtonActive],testID:`${f}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:b(Ra,{size:14,color:ve.length>0?T.color.accent:T.color.textSecondary})}),b(J,{onPress:jr,style:[I.headerActionButton,v.length===0&&I.headerActionButtonDisabled],disabled:v.length===0,testID:`${f}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:v.length===0},children:b(Va,{size:14,color:v.length>0?T.color.textSecondary:T.color.textTertiary})}),b(Wa,{isEnabled:Y,onToggle:Qe,accessibilityLabel:"Toggle Redux action capture",testID:`${f}-power`}),b(J,{onPress:Q,style:[I.headerActionButton,v.length===0&&I.headerActionButtonDisabled],disabled:v.length===0,testID:`${f}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:v.length===0},children:b(ka,{size:14,color:v.length>0?T.color.textTertiary:T.color.textTertiary})})]})]}),Pr=a?za.modal.root():"buoy-redux-modal";if(!e)return null;let Et=U&&me!==null?b(Tr,{action:U,actions:W,selectedIndex:me,onIndexChange:Dt}):null,Wr=U&&W.length>1?68:0,Nr=U==null,$t=b(l,{style:I.container,children:U&&me!==null?b(vr,{action:U,actions:W,selectedIndex:me,onIndexChange:Dt,disableInternalFooter:true,initialView:s}):N(Gn,{children:[j&&!R&&!x.isCaptureSuppressed()&&N(l,{style:I.errorBanner,testID:`${f}-banner-error`,children:[b(er,{size:14,color:T.color.danger}),b(y,{style:I.errorText,children:L?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!Y&&R&&N(l,{style:I.disabledBanner,testID:`${f}-banner-disabled`,children:[b(Ea,{size:14,color:T.color.warning}),b(y,{style:I.disabledText,children:"Action capture is disabled"})]}),P==="patch"&&!x.isCaptureSuppressed()&&N(l,{style:I.disabledBanner,testID:`${f}-banner-patch`,children:[b(er,{size:14,color:T.color.warning}),b(y,{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:Or,activeOpacity:.8,testID:`${f}-locked`,accessibilityRole:"button",accessibilityLabel:`${Z} older ${Z===1?"action":"actions"} locked. Upgrade to see them.`,children:[b(ja,{size:14,color:T.color.accent}),N(y,{style:I.lockedText,testID:`${f}-locked-text`,children:[Z," older ",Z===1?"action":"actions"," locked"]}),b(l,{style:I.upgradeBadge,children:b(y,{style:I.upgradeBadgeText,children:"UPGRADE"})})]}),W.length>0?b(Yt,{keyboardShouldPersistTaps:"handled",ref:Rr,testID:`${f}-list`,data:W,renderItem:Lr,keyExtractor:zr,contentContainerStyle:I.listContent,showsVerticalScrollIndicator:true,...qa}):b(Qn,{isEnabled:Y,query:ve,totalActions:F.totalActions})]})}),Ot=b(Pa,{visible:g,onClose:()=>m(false),featureName:"Full Action History"});return n?N(tr,{children:[N(l,{style:I.inlineRoot,children:[b(l,{style:I.inlineHeader,...Ma,children:kt()}),$t,Et]}),Ot]}):N(tr,{children:[b(Ba,{visible:e,onClose:t,onMinimize:o,persistenceKey:Pr,header:{showToggleButton:true,customContent:kt()},onModeChange:kr,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Nr,styles:{},footer:Et,footerHeight:Wr,children:$t}),Ot]})}function Zn(e={}){return b(xt,{...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:Ua},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 Je,REDUX_ICON_COLOR as al}from"@buoy-gg/floating-tools-core/web";import{createToolFactory as ei,defineToolPreset as ti}from"@buoy-gg/shared-ui/web";import{jsx as Ar}from"react/jsx-runtime";var Ir=ti({id:"redux",name:"REDUX",description:"Redux action & state inspector",slot:"both",icon:({size:e})=>Ar(Je,{size:e}),component:xt,props:{enableSharedModalDimensions:false}}),ri=ei(Ir,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}),e=>({icon:({size:t})=>Ar(Je,{size:t,color:e.iconColor})}));var oi={timeTravel:false,toggle:false,edit:false,diff:true,export:true,import:false,reset:true,recording:true};function ai(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 Dr(e){let{icon:t=Je,color:r="#764ABC",name:o="Redux"}=e??{},a=0;return{id:"redux",name:o,icon:t,color:r,capabilities:oi,subscribe:n=>x.subscribe(()=>{n()}),getEntries:()=>{let n=x.getActions();return n.map((c,d)=>ai(c,d,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(d=>d.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 ni=Dr();import{WIRE_DETAIL_LIMIT_BYTES as ii,capDetail as li,createSyncAdapter as si,memoByIdentity as ci,readParams as ke,toWire as di}from"@buoy-gg/shared-ui/web";var Ge=e=>di(e,eo),ui=ci(e=>{let t=oe(e.prevState)?{...e}:{...e,prevState:Wt,nextState:Wt};if(t.payload=Ge(t.payload),t.action=Ge(t.action),t.error=Ge(t.error),t.meta){let r=Ge(t.meta.arg);r!==t.meta.arg&&(t.meta={...t.meta,arg:r})}return t});function pi(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e):[]}function gi(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=g=>Array.isArray(g)?[...g]:{...g},d=c(e),s=d;for(let g=0;g<n.length-1;g++){let m=n[g],R=s[m];if(!R||typeof R!="object")return{ok:false,error:`No object at "${n.slice(0,g+1).join(".")}" \u2014 read getState for the real shape.`};let V=c(R);s[m]=V,s=V}let u=n[n.length-1],i=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:d,prev:i}}function hi(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 St(){let e=re().diagnostic??"not-instrumented";return{available:false,slices:[],reason:e}}var fi=si({version:2,getSnapshot:()=>x.getActions().map(ui),subscribe:e=>x.subscribe(e),actions:{clearEvents:()=>{x.clearActions()},getActionDetail:e=>{let{id:t}=ke(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=>li(n,ii),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}=ke(e),r=Ne();if(!r)return St();let o=r.getState(),a=re();return{available:true,slices:pi(o),sliceFields:hi(o),capture:a.capture,mechanism:a.mechanism,...t?{state:o}:{}}},dispatch:e=>{let{action:t}=ke(e),r=Ne();if(!r)return{dispatched:false,...St()};if(!t)throw new Error("dispatch requires an `action`");return r.dispatch(t),{dispatched:true,type:t.type}},setState:e=>{let t=Ne();if(!t)return{ok:false,...St()};if(!$e())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=gi(t.getState(),ke(e));return r.ok?(t.dispatch({type:xe,payload:r.next}),{ok:true,path:ke(e).path,previous:r.prev}):r}}});import{useState as yi}from"react";import{macOSColors as de,night as q,TabSelector as mi,DataInspector as ue,CollapsibleSection as Xe,CopyButton as bi,monoFont as Ct}from"@buoy-gg/shared-ui/web";import{jsx as w,jsxs as H}from"react/jsx-runtime";function xi({action:e}){let[t,r]=yi("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(l,{style:A.container,children:[H(l,{style:A.header,children:[H(l,{style:A.headerContent,children:[w(y,{style:A.actionType,numberOfLines:2,children:e.type}),H(l,{style:A.headerMeta,children:[w(y,{style:A.metaText,children:a}),e.duration!==void 0&&H(y,{style:A.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&w(l,{style:A.changeBadge,children:w(y,{style:A.changeBadgeText,children:"State Changed"})})]})]}),w(bi,{value:n(),size:16})]}),w(l,{style:A.tabContainer,children:w(mi,{tabs:o,activeTab:t,onTabChange:c=>r(c)})}),H(Pe,{keyboardShouldPersistTaps:"handled",style:A.content,showsVerticalScrollIndicator:true,children:[t==="action"&&H(l,{style:A.section,children:[w(Xe,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?w(ue,{data:e.payload}):w(y,{style:A.emptyText,children:"No payload"})}),w(Xe,{title:"Full Action",defaultOpen:false,children:w(ue,{data:e.action})})]}),t==="state"&&H(l,{style:A.section,children:[w(Xe,{title:"Previous State",defaultOpen:false,children:w(ue,{data:e.prevState})}),w(Xe,{title:"Next State",defaultOpen:true,children:w(ue,{data:e.nextState})})]}),t==="diff"&&w(l,{style:A.section,children:e.hasStateChange?w(Si,{prevState:e.prevState,nextState:e.nextState}):w(l,{style:A.noChangeContainer,children:w(y,{style:A.noChangeText,children:"No state changes from this action"})})})]})]})}function Si({prevState:e,nextState:t}){let r=Br(e,t);return r.length===0?w(l,{style:A.noChangeContainer,children:w(y,{style:A.noChangeText,children:"No differences detected"})}):w(l,{children:r.map((o,a)=>H(l,{style:A.diffItem,children:[H(l,{style:A.diffHeader,children:[w(l,{style:[A.diffTypeBadge,{backgroundColor:o.type==="added"?de.semantic.successBackground:o.type==="removed"?de.semantic.errorBackground:de.semantic.warningBackground}],children:w(y,{style:[A.diffTypeText,{color:o.type==="added"?de.semantic.success:o.type==="removed"?de.semantic.error:de.semantic.warning}],children:o.type.toUpperCase()})}),w(y,{style:A.diffPath,children:o.path})]}),o.type==="modified"&&H(l,{style:A.diffValues,children:[H(l,{style:A.diffValue,children:[w(y,{style:A.diffLabel,children:"Before:"}),w(ue,{data:o.oldValue})]}),H(l,{style:A.diffValue,children:[w(y,{style:A.diffLabel,children:"After:"}),w(ue,{data:o.newValue})]})]}),o.type==="added"&&w(l,{style:A.diffValue,children:w(ue,{data:o.newValue})}),o.type==="removed"&&w(l,{style:A.diffValue,children:w(ue,{data:o.oldValue})})]},a))})}function Br(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 d of c){let s=r?`${r}.${d}`:d,u=a[d],i=n[d];d in a?d in n?u!==i&&(typeof u=="object"&&typeof i=="object"&&u!==null&&i!==null&&!Array.isArray(u)&&!Array.isArray(i)?s.split(".").length<3?o.push(...Br(u,i,s)):o.push({type:"modified",path:s,oldValue:u,newValue:i}):o.push({type:"modified",path:s,oldValue:u,newValue:i})):o.push({type:"removed",path:s,oldValue:u}):o.push({type:"added",path:s,newValue:i})}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:Ct,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:q.color.textTertiary},durationText:{fontSize:11,color:q.color.textTertiary,fontFamily:Ct},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:Ct},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:q.color.textTertiary,marginBottom:4,fontWeight:"600"}});function Ci(){return ft(),null}function wi(e){return ee(e,"extension"),at(),()=>Pt(e)}export{xe as BUOY_JUMP_TO_STATE,lo as BUOY_REPLAY_ACTION,Xn as FREE_TIER_ACTION_LIMIT,f as REDUX_TEST_ID,vr as ReduxActionDetailContent,Tr as ReduxActionDetailFooter,xi as ReduxActionDetailView,dr as ReduxActionItem,Ci as ReduxAutoInstrument,Je as ReduxIcon,xt as ReduxModal,Zn as ReduxToolView,br as actionRowTestID,xr as buildActionRowTestIDs,je as buoyDevtoolsEnhancer,co as buoyReduxMiddleware,qt as claimDevtoolsHook,wi as connectReduxAdapter,uo as createBuoyReduxMiddleware,Dr as createReduxHistoryAdapter,ri as createReduxTool,Ne as getActiveStore,re as getInstrumentationStatus,gt as instrumentStore,tn as isAutoInstrumentActive,bo as isDevtoolsHookClaimed,Za as isStoreInstrumented,Mt as jumpToState,x as reduxActionStore,ni as reduxHistoryAdapter,fi as reduxSyncAdapter,Ir as reduxToolPreset,en as registerReduxStore,Ht as replayAction,mr as slugForTestID,ht as uninstrumentStore,ft as useAutoInstrumentRedux,ar as useReduxActions,rn as useReduxAvailability,so as withBuoyDevTools};
1
+ "use client";var jt=Object.defineProperty;var Hr=Object.getOwnPropertyDescriptor;var _r=Object.getOwnPropertyNames;var qr=Object.prototype.hasOwnProperty;var Ur=(e,t)=>{for(var r in t)jt(e,r,{get:t[r],enumerable:true})},zt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of _r(t))!qr.call(e,a)&&a!==r&&jt(e,a,{get:()=>t[a],enumerable:!(o=Hr(t,a))||o.enumerable});return e},Kr=(e,t,r)=>(zt(e,t,"default"),r&&zt(r,t,"default"));var Lt=(()=>{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 Yr,createRestoreScope as Jr,registerStateSnapshotProvider as Gr,skippedRestore as Ve,unionKeys as Xr,wontApply as Qr}from"@buoy-gg/shared-ui/web";var rt=Symbol.for("@@buoy/enhancerInstrumented"),be=null,pe=null,ot=null,Pt=false;function ee(e,t){be=e,pe=t,ot=null}function Wt(e){be===e&&(be=null,pe=null)}function te(){return be}function at(){Pt=true}function Te(){return Pt&&be!==null}function Zr(e){ot=e}function re(){return{mechanism:pe,capture:pe==="enhancer"||pe==="middleware"||pe==="extension"?"full":pe==="patch"?"top-level-only":"none",hasStore:be!==null,timeTravel:Te(),diagnostic:ot}}import{ChangeLog as eo,approxJsonSize as to}from"@buoy-gg/shared-ui/web";var nt=25,it=Object.freeze({__buoyStateEvicted:true,note:`Raw state retained for the ${nt} most recent actions only.`}),Nt=Object.freeze({__buoyStateOnDevice:true,note:"State trees stay on the device \u2014 fetched on demand via getActionDetail."}),ro=Object.freeze({__buoyPayloadOnDevice:true,note:"Payload stays on the device \u2014 fetched on demand via getActionDetail."});function je(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 oo(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 ao(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 Ft(e,t){return to(e,t).bytes>t}function no(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(Ft(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(Ft(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 io(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 d=[];a>0&&d.push(`+${a}`),n>0&&d.push(`-${n}`),c>0&&d.push(`~${c}`);let s=a+n+c;return d.length===0?{summary:"nested change",changedCount:1}:{summary:`${d.join(" ")} ${s===1?"key":"keys"}`,changedCount:s}}function lo(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 so=class extends eo{addAction(e,t,r,o){if(!this.canRecord())return;let a=e.type||"";if(!a)return;let n=t!==r,c=oo(a),{sliceName:d,actionName:s}=ao(a),u=lo(e),i=no(e.payload),{summary:g,changedCount:m}=io(t,r),R=(o??0)>16,V={id:this.nextId(),type:a,payload:e.payload,action:e,timestamp:Date.now(),prevState:t,nextState:r,duration:o,hasStateChange:n,category:c,sliceName:d,actionName:s,meta:u,error:e.error,payloadPreview:i,diffSummary:g,changedKeysCount:m,isSlowAction:R};this.push(V);for(let j=nt;j<this.items.length;j++){let L=this.items[j];if(L.prevState!==it)L.prevState=it,L.nextState=it;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:je(o.payload)?a.payload:o.payload,action:je(o.action)?a.action:o.action,meta:je(o.meta?.arg)?a.meta:o.meta,error:je(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 so;var lt=false;function Mt(){return lt}var xe="@@buoy/JUMP_TO_STATE",co="@@buoy/REPLAY_ACTION";function Ht(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(!Te()){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 _t(e){let t=te();t?t.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}function uo(e){return at(),(t,r)=>r.type===xe?r.payload:e(t,r)}var po=e=>(lt=true,ee(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),d=e.getState(),s=performance.now()-a;return x.addAction(o,n,d,s),c});function go(e={}){let{maxActions:t=200,ignoreActions:r=[]}=e;return x.setMaxActions(t),o=>(lt=true,ee(o,"middleware"),a=>n=>{let c=n,d=c.type||"";if(d?.startsWith("@@buoy/")||r.includes(d))return a(n);let s=performance.now(),u=o.getState(),i=a(n),g=o.getState(),m=performance.now()-s;return x.addAction(c,u,g,m),i})}var Ae="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function ho(){let{mechanism:e,hasStore:t,diagnostic:r}=re();return t?e==="patch"?{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${Ae}`}:{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 fo(){let e=te();return e?{data:{state:e.getState()},warnings:[]}:{data:null,warnings:["no Redux store instrumented"]}}async function yo(e,t){let r=e,o=te();if(!o||r===void 0||r===null)return Ve("redux",o?"empty redux snapshot":"no Redux store instrumented");let{mechanism:a}=re();if(a==="patch")return{...Ve("redux",`restore unavailable on auto-instrumented stores \u2014 ${Ae}`),untouched:true};if(!Te())return{...Ve("redux",`store cannot take a state jump \u2014 ${Ae}`),untouched:true};let n=Jr(t),c=r.state??{},d=!!(t?.includeKeys||t?.excludeKeys?.length),s=Object.keys(c).filter(i=>!n.touch(i)),u=r.state;if(d){let i=o.getState()??{},g={...i};for(let m of new Set([...Object.keys(i),...Object.keys(c)]))n.touch(m)&&(m in c?g[m]=c[m]:delete g[m]);u=g}if(o.dispatch({type:xe,payload:u}),o.getState()===u){let i=s.length>0?[`${s.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:i}}return Ve("redux",`store ignored the state jump \u2014 ${Ae}`)}async function mo(e,t){let r=e?.state,o=t===void 0,a=te(),n=o?a?.getState():t?.state,c=[],d=[],s;if(o){let{mechanism:g,hasStore:m}=re();m?g==="patch"&&(s=`auto-instrumented store cannot be restored \u2014 ${Ae}`):s="no Redux store instrumented"}let u=n??{},i=r??{};for(let g of Xr(u,i)){let m=Yr({key:g,label:g,oldValue:u[g],newValue:i[g],inOld:Object.prototype.hasOwnProperty.call(u,g),inNew:Object.prototype.hasOwnProperty.call(i,g)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});s&&(m=Qr(m,s)),c.push(m)}return s&&d.push(`Redux restore unavailable: ${s}`),{items:c,notes:d}}Gr({id:"redux",label:"Redux",status:ho,capture:fo,restore:yo,previewItems:mo});function st(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...o)=>t(r(...o)))}function qt(e){return at(),(t,r)=>r&&r.type===xe?r.payload:e(t,r)}function bo(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 ze=e=>(t,r)=>{let o=e(qt(t),r),a={...o,dispatch:n=>{if(!bo(n)||Mt())return o.dispatch(n);let c=performance.now(),d=o.getState(),s=o.dispatch(n);return x.addAction(n,d,o.getState(),performance.now()-c),s},replaceReducer:n=>o.replaceReducer(qt(n)),[rt]:true};return ee(a,"enhancer"),a};function xo(...e){return e.length===0?st(ze):e.length===1&&typeof e[0]=="object"&&e[0]!==null?(...t)=>st(...t,ze):st(...e,ze)}var ct=false;function Ut(){if(!(typeof Lt<"u"&&Lt))return false;let e=globalThis;return e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||(e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__=xo,ct=true),ct}function Co(){return ct}Ut();import{useState as Le,useMemo as Ie,useRef as Pe,useCallback as ae,useEffect as Kt}from"react";var Yt={};Ur(Yt,{AccessibilityInfo:()=>To,ActivityIndicator:()=>Ia,Alert:()=>Ra,Animated:()=>xa,AppRegistry:()=>Io,AppState:()=>Do,Appearance:()=>Ao,BackHandler:()=>Bo,Button:()=>Da,CheckBox:()=>_o,Clipboard:()=>Ro,DeviceEventEmitter:()=>na,Dimensions:()=>ko,Easing:()=>Eo,FlatList:()=>Jt,I18nManager:()=>$o,Image:()=>qo,ImageBackground:()=>Uo,InteractionManager:()=>Vo,Keyboard:()=>Oo,KeyboardAvoidingView:()=>Ko,LayoutAnimation:()=>jo,Linking:()=>zo,LogBox:()=>aa,Modal:()=>Ta,NativeEventEmitter:()=>Lo,NativeModules:()=>vo,PanResponder:()=>Po,Picker:()=>Yo,PixelRatio:()=>Wo,Platform:()=>No,Pressable:()=>va,ProgressBar:()=>Jo,RefreshControl:()=>Go,SafeAreaView:()=>Xo,ScrollView:()=>We,SectionList:()=>Qo,Share:()=>Fo,StatusBar:()=>Zo,StyleSheet:()=>ge,Switch:()=>Aa,Text:()=>y,TextInput:()=>Ca,Touchable:()=>ea,TouchableHighlight:()=>Sa,TouchableNativeFeedback:()=>ta,TouchableOpacity:()=>J,TouchableWithoutFeedback:()=>wa,UIManager:()=>Mo,Vibration:()=>Ho,View:()=>l,VirtualizedList:()=>ra,YellowBox:()=>oa,findNodeHandle:()=>Ba,unstable_createElement:()=>wo,useColorScheme:()=>ia,useLocaleContext:()=>la,useWindowDimensions:()=>sa});Kr(Yt,So);import*as So from"react-native-web";import{unstable_createElement as wo,NativeModules as vo,AccessibilityInfo as To,Appearance as Ao,AppRegistry as Io,AppState as Do,BackHandler as Bo,Clipboard as Ro,Dimensions as ko,Easing as Eo,I18nManager as $o,Keyboard as Oo,InteractionManager as Vo,LayoutAnimation as jo,Linking as zo,NativeEventEmitter as Lo,PanResponder as Po,PixelRatio as Wo,Platform as No,Share as Fo,UIManager as Mo,Vibration as Ho,CheckBox as _o,FlatList as Jt,Image as qo,ImageBackground as Uo,KeyboardAvoidingView as Ko,Picker as Yo,ProgressBar as Jo,RefreshControl as Go,SafeAreaView as Xo,SectionList as Qo,StatusBar as Zo,Touchable as ea,TouchableNativeFeedback as ta,VirtualizedList as ra,YellowBox as oa,LogBox as aa,DeviceEventEmitter as na,useColorScheme as ia,useLocaleContext as la,useWindowDimensions as sa}from"react-native-web";import*as M from"react-native-web";import{createElement as dt,forwardRef as Gt,useCallback as ca,useRef as da}from"react";import{useEffect as ua,useState as pa}from"react";import{createPortal as ga}from"react-dom";var ha='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as fa}from"react/jsx-runtime";var De=Symbol.for("@buoy-gg/portal-host"),Xt=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 Qt(){let e=document;if(e[De])return e[De].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:ha});let r=()=>{let i=document.fullscreenElement,g=i&&i.tagName!=="CANVAS"?i:document.body;t.parentElement!==g&&g.appendChild(t)},o=new Map,a=i=>{(!t.contains(i.target)||!Xt(i.target))&&o.set(i.code||i.key,{key:i.key,code:i.code,location:i.location,keyCode:i.keyCode,which:i.which,altKey:i.altKey,ctrlKey:i.ctrlKey,metaKey:i.metaKey,shiftKey:i.shiftKey})},n=i=>{o.delete(i.code||i.key)},c=()=>o.clear(),d=()=>{let i=[...o.values()];o.clear();for(let g of i)document.dispatchEvent(new KeyboardEvent("keyup",{...g,bubbles:true}))},s=i=>{Xt(i.target)&&i.stopPropagation()},u=i=>i.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",c),t.addEventListener("focusin",d),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",u,{passive:true}),e[De]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",c),t.remove(),delete e[De]}},t}function ya({children:e}){let[t,r]=pa(null);return ua(()=>{let o=Qt(),a=document[De];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?ga(fa("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var Ce=M,ma=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Se=e=>typeof e=="number"?`${e}px`:e;function ut(e){if(Array.isArray(e)){let g=e.map(ut);return g.some((m,R)=>m!==e[R])?g:e}if(!e||typeof e!="object"||!ma.some(g=>e[g]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:c,textShadowRadius:d,...s}=e;if(t!=null||r!=null||o!=null||a!=null){let g=t??"black",m=o==null?g:`color-mix(in srgb, ${g} ${Math.min(o,1)*100}%, transparent)`,R=`${Se(r?.width??0)} ${Se(r?.height??0)} ${Se(a??0)} ${m}`;s.boxShadow=typeof s.boxShadow=="string"?`${s.boxShadow}, ${R}`:s.boxShadow??R}let{width:u=0,height:i=0}=c??{};if(n&&(u||i||d)){let g=`${Se(u)} ${Se(i)} ${Se(d??0)} ${n}`;s.textShadow=s.textShadow?`${s.textShadow}, ${g}`:g}return s}var ba=Ce.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Zt(e,t){if(typeof e=="function")return o=>Zt(e(o),t);let r=ut(e);return t?[r,ba[t]]:r}var ge={...Ce.StyleSheet,create:e=>Ce.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ut(r)])))};function _(e){let t=Gt((o,a)=>{let{accessibilityState:n,accessibilityValue:c,pointerEvents:d,...s}=o;for(let i of["busy","checked","disabled","expanded","selected"])n?.[i]!==void 0&&s[`aria-${i}`]===void 0&&(s[`aria-${i}`]=n[i]);for(let[i,g]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[i]!==void 0&&s[`aria-${g}`]===void 0&&(s[`aria-${g}`]=c[i]);let u=Zt(s.style,d);return u!==s.style&&(s.style=u),dt(e,{...s,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var l=_(M.View),y=_(M.Text),xa={...Ce.Animated,View:Ce.Animated.createAnimatedComponent(l),Text:Ce.Animated.createAnimatedComponent(y)},Ca=_(M.TextInput),J=_(M.TouchableOpacity),Sa=_(M.TouchableHighlight),wa=_(M.TouchableWithoutFeedback),va=_(M.Pressable),We=_(M.ScrollView),er=Gt((e,t)=>{let r=da(null),o=ca(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"}),Qt().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return dt(ya,null,dt(M.Modal,{...e,ref:o}))});er.displayName="Modal";var Ta=_(er),Aa=_(M.Switch),Ia=_(M.ActivityIndicator),Da=_(M.Button),Ba=M.findNodeHandle,Ra={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 d=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let u of d){let i=document.createElement("button");i.type="button",i.textContent=u.text??"OK",i.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,i.onclick=()=>{s(),u.onPress?.()},c.appendChild(i)}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 ka,ModalHeader as ne,macOSColors as G,night as T,Search as Ea,Trash2 as $a,Power as Oa,Zap as Va,CheckCircle as ja,Copy as za,Lock as La,AlertTriangle as tr,devToolsStorageKeys as Pa,copyToClipboard as Wa,ProUpgradeModal as Na,PowerToggleButton as Fa,TickProvider as rr,useLimit as Ma,TIER_LIMITS as Ha,windowDragProps as _a,ToolEmptyState as qa,resolveListEmptyState as Ua,EVENT_LIST_PRESET as Ka,monoFont as Ya}from"@buoy-gg/shared-ui/web";import{useIsPro as Ja}from"@buoy-gg/license/web";import{useState as Ga,useMemo as or,useCallback as ar}from"react";import{useChangeLog as Xa}from"@buoy-gg/shared-ui/web";var Qa=(e,t)=>x.filterActions(t);function nr(){let e=Xa(x,{filterItems:Qa}),[t,r]=Ga(null),o=or(()=>x.getStats(),[e.items]),a=or(()=>x.getUniqueActionTypes(),[e.items]),n=ar(()=>{x.clearActions(),r(null)},[]),c=ar(d=>x.getActionById(d),[]);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{createContext as pt,useContext as Za}from"react";var ir=Symbol.for("react-redux-context");function en(){let e=globalThis,t=e[ir]??(e[ir]=new Map),r=t.get(pt);return r||(r=pt(null),t.set(pt,r)),r}function tn(){let e=Za(en());if(!e)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>. On the web, Buoy needs react-redux 8.1 or newer.");return e.store}function lr(){return tn}import{useEffect as rn,useState as Ne,useRef as sr,useCallback as cr}from"react";var Be=Symbol.for("@@buoy/instrumented"),gt=Symbol.for("@@buoy/originalDispatch");function on(e){let t=e;return t[Be]===true||t[rt]===true}function ht(e,t={}){let r=e;if(r[rt])return ee(e,"enhancer"),()=>{};if(Mt())return ee(e,"middleware"),()=>{};if(r[Be])return ee(e,"patch"),()=>{};let{maxActions:o=200,ignoreActions:a=[]}=t;x.setMaxActions(o);let n=e.dispatch.bind(e);r[gt]=n;let c=(d=>{if(typeof d!="object"||d===null||typeof d.type!="string")return n(d);let s=d.type;if(s.startsWith("@@buoy/")||s.startsWith("@@redux/")||a.includes(s))return n(d);let u=performance.now(),i=e.getState(),g=n(d),m=e.getState(),R=performance.now()-u;return x.addAction(d,i,m,R),g});return e.dispatch=c,r[Be]=true,ee(e,"patch"),()=>{ft(e)}}function ft(e){let t=e;if(t[Be]){let r=t[gt];r&&(e.dispatch=r),delete t[Be],delete t[gt]}Wt(e)}function an(e,t={}){return ht(e,t)}function Fe(){return te()}function nn(){return te()!==null}function yt(e={}){let{autoStart:t=true}=e,r=sr(e);r.current=e;let[o,a]=Ne(false),[n,c]=Ne(true),[d,s]=Ne(null),[u,i]=Ne(null),g=sr(null),m=lr(),R=m!==null,V=null,j=null,L=null;if(m)try{V=m()}catch(O){L="no-provider",j=O instanceof Error?O.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else L="no-react-redux",j="react-redux is not installed or not available";let P=re().mechanism==="extension"?te():null,v=cr(()=>{if(!V&&P){a(true),i(P),s(null),c(false);return}if(!V){Zr(L),s(j||"No Redux store available"),c(false);return}try{let O=ht(V,r.current);g.current=O,a(true),i(V),s(null)}catch(O){s(O instanceof Error?O.message:"Failed to instrument Redux store"),a(false)}finally{c(false)}},[V,P]),K=cr(()=>{g.current&&(g.current(),g.current=null),u&&ft(u),a(false),i(null)},[u]);return rn(()=>(t?v():c(false),()=>{}),[t,v]),{isInstrumented:o,isLoading:n,error:d,isReactReduxAvailable:R,captureMechanism:re().mechanism,startInstrumentation:v,stopInstrumentation:K,store:u}}function ln(){let e=lr();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 sn}from"react";import{ChangeRow as Re,buoyColors as ie,AlertCircle as cn,monoFont as dn}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as dr}from"react/jsx-runtime";var ur=[{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 un(e){return e<=0?{bg:"rgba(142, 142, 147, 0.2)",text:ie.textSecondary}:ur[(e-1)%ur.length]}var mt={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function pn(e){if(!e)return"#6B7280";let t=e.toLowerCase();if(mt[t])return mt[t];for(let[r,o]of Object.entries(mt))if(t.includes(r))return o;return`hsl(${e.split("").reduce((r,o)=>r+o.charCodeAt(0),0)*137%360}, 70%, 60%)`}function gn(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 hn(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 pn(r)}}function fn(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 yn(e){return e.actionName?.toUpperCase()||e.type.split("/").pop()?.toUpperCase()||""}function mn(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 pr=sn(function({action:e,onPress:t,linkedCount:r,testID:o}){let a=e.sliceName??void 0,n=hn(e.category,e.hasStateChange,a),c=gn(e.category,a),d=fn(e),s=mn(e),u=yn(e),i=u&&u!==s.toUpperCase()?u:void 0,g=(r??0)>1,m=g?x.getLinkedActions(e):[],R=g?m.findIndex(v=>v.id===e.id)+1:0,V=g&&e.meta?.requestId?x.getAsyncOperationIndex(e.meta.requestId):0,j=un(V),L=g?le(l,{style:[Me.asyncSequenceBadge,{backgroundColor:j.bg}],children:dr(y,{style:[Me.asyncSequenceText,{color:j.text}],testID:o?`${o}-seq`:void 0,children:[R,"/",r," #",V]})}):void 0,P={statusColor:n,statusLabel:c,sublabel:d,primaryText:s,timestamp:e.timestamp,onPress:()=>t(e),testID:o,accessibilityLabel:`${s}, ${c}, ${d}`};return e.isSlowAction?le(Re,{...P,badgePrefix:L,slow:true}):e.category==="rejected"?le(Re,{...P,customBadge:dr(l,{style:Me.badgeContainer,children:[L,le(l,{style:Me.errorBadge,testID:o?`${o}-error`:void 0,children:le(cn,{size:12,color:ie.error})})]})}):g?le(Re,{...P,badgePrefix:L,changed:e.hasStateChange}):e.hasStateChange?le(Re,{...P,badgeText:i,changed:true}):le(Re,{...P,plainBadgeText:i})}),Me=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:dn}});import{useState as gr,useCallback as He,useMemo as hr}from"react";import{macOSColors as ke,night as X,EventStepperFooter as fr,formatRelativeTime as _e,parseValue as qe,monoFont as Ee}from"@buoy-gg/shared-ui/web";import{DataViewer as bn,SplitDiffViewer as xn,TreeDiffViewer as Cn,diffThemes as Sn}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as wn}from"react";import{DetailViewToggle as vn,FileText as Tn,Database as An,GitBranch as In}from"@buoy-gg/shared-ui/web";import{jsx as Dn}from"react/jsx-runtime";var Bn=[{key:"action",label:"ACTION",description:"View action details",icon:Tn},{key:"state",label:"STATE",description:"View current state",icon:An},{key:"diff",label:"DIFF",description:"Compare changes",icon:In}],Rn=["diff"],kn=wn(function({activeView:e,onViewChange:t,diffDisabled:r=false}){return Dn(vn,{views:Bn,activeView:e,onViewChange:t,disabledKeys:r?Rn:void 0,testIDPrefix:"buoy-redux"})});import{memo as En,useMemo as $n,useCallback as Ue,useState as On,useEffect as Vn}from"react";import{buoyColors as D,night as S,Clock as jn,AlertTriangle as zn,Zap as Ln,Hash as yr,Info as Pn,Box as Wn,AlertCircle as Nn,FileText as Fn,parseValue as Ke,ProUpgradeModal as Mn,copyToClipboard as mr,InfoRow as se,monoFont as ce}from"@buoy-gg/shared-ui/web";import{useIsPro as Hn}from"@buoy-gg/license/web";import{DataViewer as Ye}from"@buoy-gg/shared-ui/web/dataViewer";import{night as B,monoFont as _n}from"@buoy-gg/shared-ui/web";import{jsx as br,jsxs as qn}from"react/jsx-runtime";var Un={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 Je({onPress:e,text:t,type:r,disabled:o=false,testID:a}){let n=Un[r];return qn(J,{testID:a,disabled:o,onPress:e,style:[bt.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:[br(l,{style:[bt.dot,{backgroundColor:o?B.color.textTertiary:n.color}]}),br(y,{style:[bt.text,{color:o?B.color.textTertiary:n.textColor}],children:t})]})}var bt=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:_n,height:12}});var f="buoy-redux";function xr(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function Cr(e,t){return`${f}-row-${xr(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,Cr(o.type,a))}return r}import{jsx as h,jsxs as k}from"react/jsx-runtime";function wr(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 Kn(e){return e===void 0?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function we({icon:e,title:t,badge:r,testID:o}){return k(l,{style:p.sectionHeader,testID:o,children:[k(l,{style:p.sectionHeaderLeft,children:[h(e,{size:14,color:S.color.accent}),h(y,{style:p.sectionTitle,children:t})]}),r]})}function Yn(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 Jn=En(function({action:e,onNavigateToAction:t}){let r=Hn(),[o,a]=On(false);Vn(()=>{o&&r&&a(false)},[o,r]);let n=wr(e.category),c=oe(e.nextState),d=Te(),s=c||!d,u=e.payload!==void 0,i=e.meta&&Object.keys(e.meta).length>0,g=e.error!==void 0,m=$n(()=>x.getLinkedActions(e),[e]),R=m.length>1,V=R?x.getBaseActionType(e.type):null,j=e.meta?.requestId?x.getAsyncOperationDuration(e.meta.requestId):null,L=Ue(async()=>{if(!r){a(true);return}await mr(e.action)},[e,r]),P=Ue(async()=>{if(!r){a(true);return}await mr(e.payload)},[e.payload,r]),v=Ue(()=>{e.action&&typeof e.action=="object"&&"type"in e.action&&_t(e.action)},[e]),K=Ue(()=>{e.nextState!==void 0&&Ht(e.nextState)},[e]);return k(We,{keyboardShouldPersistTaps:"handled",testID:`${f}-detail-scroll`,style:p.container,contentContainerStyle:p.contentContainer,showsVerticalScrollIndicator:false,children:[k(l,{style:p.card,testID:`${f}-info-card`,children:[h(we,{icon:Pn,title:"ACTION INFO"}),k(l,{style:p.cardContent,children:[h(se,{label:"Type",value:e.type,mono:true,testID:`${f}-info-type`}),e.sliceName&&h(se,{label:"Slice",value:e.sliceName,mono:true,testID:`${f}-info-slice`}),h(se,{label:"Action",value:e.actionName,mono:true,testID:`${f}-info-action`}),k(l,{style:p.badgeRow,children:[h(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:h(y,{style:[p.categoryText,{color:n.color}],testID:`${f}-info-category`,children:n.label})}),k(l,{style:[p.durationBadge,e.isSlowAction&&p.durationBadgeSlow],children:[h(jn,{size:10,color:e.isSlowAction?D.error:S.color.textSecondary}),h(y,{style:[p.durationText,e.isSlowAction&&p.durationTextSlow],testID:`${f}-info-duration`,children:Kn(e.duration)}),e.isSlowAction&&h(zn,{size:10,color:D.error})]}),e.hasStateChange?k(l,{style:p.changesBadge,children:[h(Ln,{size:10,color:D.success}),h(y,{style:p.changesText,testID:`${f}-info-changes`,children:e.diffSummary||"changed"})]}):h(l,{style:p.noChangesBadge,children:h(y,{style:p.noChangesText,testID:`${f}-info-no-changes`,children:"no change"})})]})]})]}),R&&k(l,{style:p.card,testID:`${f}-async-card`,children:[h(we,{icon:yr,title:"ASYNC FLOW",badge:h(l,{style:p.asyncBadge,children:k(y,{style:p.asyncBadgeText,testID:`${f}-async-count`,children:[m.length," ACTIONS"]})})}),k(l,{style:p.cardContent,children:[h(y,{style:p.baseActionType,testID:`${f}-async-base`,children:V}),j!==null&&k(l,{style:p.totalDurationRow,children:[h(y,{style:p.totalDurationLabel,children:"Total Duration"}),k(y,{style:p.totalDurationValue,testID:`${f}-async-total`,children:[j,"ms"]})]}),h(l,{style:p.timeline,children:m.map((O,F)=>{let Q=wr(O.category),Y=O.id===e.id;return k(J,{style:[p.timelineItem,Y&&p.timelineItemCurrent],onPress:()=>t?.(O),disabled:Y||!t,activeOpacity:.7,testID:`${f}-async-step-${F}`,children:[F<m.length-1&&h(l,{style:p.timelineConnector}),h(l,{style:[p.timelineDot,{backgroundColor:Q.color}]}),k(l,{style:p.timelineContent,children:[k(l,{style:p.timelineHeader,children:[h(l,{style:[p.timelineStatusBadge,{backgroundColor:Q.bgColor}],children:h(y,{style:[p.timelineStatusText,{color:Q.color}],testID:`${f}-async-step-${F}-status`,children:Q.label})}),Y&&h(l,{style:p.currentBadge,testID:`${f}-async-step-${F}-current`,children:h(y,{style:p.currentBadgeText,children:"CURRENT"})})]}),h(y,{style:p.timelineTime,children:Yn(O.timestamp)})]})]},O.id)})})]})]}),u&&k(l,{style:p.card,testID:`${f}-payload-card`,children:[h(we,{icon:Wn,title:"PAYLOAD",badge:h(l,{style:p.typeBadge,children:h(y,{style:p.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload=="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),h(l,{style:p.dataViewerContainer,children:h(Ye,{title:"",data:Ke(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),i&&k(l,{style:p.card,testID:`${f}-meta-card`,children:[h(we,{icon:yr,title:"ASYNC METADATA",badge:h(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:h(y,{style:[p.categoryText,{color:n.color}],children:"RTK THUNK"})})}),k(l,{style:p.cardContent,children:[e.meta?.requestId&&h(se,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&h(se,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:n.color,testID:`${f}-meta-status`}),e.meta?.arg!==void 0&&k(l,{style:p.argSection,children:[h(y,{style:p.argLabel,children:"Original Argument"}),h(l,{style:p.argValueContainer,children:typeof e.meta.arg=="object"?h(Ye,{title:"",data:Ke(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):h(y,{style:p.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&h(se,{label:"Rejected With Value",value:"true",valueColor:D.error}),e.meta?.aborted&&h(se,{label:"Aborted",value:"true",valueColor:D.warning}),e.meta?.condition&&h(se,{label:"Condition",value:"true",valueColor:S.color.textTertiary})]})]}),g&&k(l,{style:[p.card,p.errorCard],testID:`${f}-error-card`,children:[h(we,{icon:Nn,title:"ERROR",badge:h(l,{style:p.errorBadge,children:h(y,{style:p.errorBadgeText,testID:`${f}-error-badge`,children:"REJECTED"})})}),h(l,{style:p.dataViewerContainer,children:typeof e.error=="object"?h(Ye,{title:"",data:Ke(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):h(y,{style:p.errorText,children:String(e.error)})})]}),k(l,{style:p.card,testID:`${f}-full-action-card`,children:[h(we,{icon:Fn,title:"FULL ACTION OBJECT"}),h(l,{style:p.dataViewerContainer,children:h(Ye,{title:"",data:Ke(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),h(l,{style:p.actionFooter,children:k(l,{style:p.actionsGrid,children:[k(l,{style:p.actionButtonWrapper,children:[h(Je,{type:"replay",text:"REPLAY",onPress:v,testID:`${f}-replay`}),h(y,{style:p.actionDescription,children:"Dispatch again"})]}),k(l,{style:p.actionButtonWrapper,children:[h(Je,{type:"jump",text:"JUMP",onPress:K,disabled:s,testID:`${f}-jump`}),h(y,{style:p.actionDescription,testID:`${f}-jump-description`,children:c?"State not retained":d?"Restore this state":"Time travel not wired"})]}),k(l,{style:p.actionButtonWrapper,children:[h(Je,{type:"copy",text:"COPY ACTION",onPress:L,testID:`${f}-copy-action`}),h(y,{style:p.actionDescription,children:r?"Copy to clipboard":"Pro feature"})]}),u&&k(l,{style:p.actionButtonWrapper,children:[h(Je,{type:"copy",text:"COPY PAYLOAD",onPress:P,testID:`${f}-copy-payload`}),h(y,{style:p.actionDescription,children:r?"Copy payload only":"Pro feature"})]})]})}),h(Mn,{visible:o,onClose:()=>a(false),featureName:"Copy"})]})}),p=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 Gn,CompareBar as Xn}from"@buoy-gg/shared-ui/web";import{jsx as E,jsxs as he}from"react/jsx-runtime";function xt(e){return e.includes("/pending")?ke.semantic.warning:e.includes("/fulfilled")?ke.semantic.success:e.includes("/rejected")?ke.semantic.error:e.startsWith("@@")?ke.text.muted:ke.semantic.info}function vr(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 Qn(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}function Tr(e){return new Date(e).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var Zn=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function Ar({action:e,actions:t,selectedIndex:r,onIndexChange:o,disableInternalFooter:a=false,initialView:n="action"}){let[c,d]=gr(n),[s,u]=gr("tree"),i=t.length,g=oe(e.nextState),m=xt(e.type),R=vr(e.type),V=Qn(qe(e.nextState)),j=i-r,L=j-1,P=r<i-1?r+1:null,v=P!==null?t[P]:null,K=hr(()=>({index:P??0,label:L>0?`#${L}`:"Initial",timestamp:v?Tr(v.timestamp):"",relativeTime:v?_e(new Date(v.timestamp)):"state",badge:v?E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${xt(v.type)}20`}],children:E(y,{style:[$.actionTextSmall,{color:xt(v.type)}],children:vr(v.type)})}):void 0}),[P,v,L]),O=hr(()=>({index:r,label:`#${j}`,timestamp:Tr(e.timestamp),relativeTime:_e(new Date(e.timestamp)),badge:E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionTextSmall,{color:m}],children:R})})}),[r,e.timestamp,m,R,j]),F=He(()=>{if(g)return he(l,{style:$.contentCard,testID:`${f}-state-evicted`,children:[E(l,{style:$.valueHeader,children:E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"})}),E(y,{style:$.evictedText,children:`Not retained. Raw state is kept for the ${nt} most recent actions, so this action's before/after trees have been released.`})]});let fe=qe(e.nextState);return he(l,{style:$.contentCard,testID:`${f}-state-card`,children:[he(l,{style:$.valueHeader,children:[E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"}),he(l,{style:$.valueHeaderBadges,children:[E(l,{style:[$.actionBadge,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionText,{color:m}],children:R})}),E(l,{style:$.typeBadge,children:E(y,{style:$.typeText,testID:`${f}-state-type`,children:V.toUpperCase()})})]})]}),E(l,{style:$.dataViewerContainer,children:E(bn,{title:"",data:fe,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,m,R,V,g]),Q=He(()=>{let fe=qe(e.prevState),ye=qe(e.nextState);return s==="split"?E(We,{keyboardShouldPersistTaps:"handled",style:{flex:1},showsVerticalScrollIndicator:true,children:E(xn,{oldValue:fe,newValue:ye,theme:Sn.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})}):E(Cn,{oldValue:fe,newValue:ye})},[e.prevState,e.nextState,s]),Y=He(()=>{o(Math.min(i-1,r+1))},[r,i,o]),Ze=He(()=>{o(Math.max(0,r-1))},[r,o]),W=g||oe(e.prevState)||e.prevState===void 0,Z=!a&&i>1;return he(l,{style:$.container,children:[E(kn,{activeView:c,onViewChange:d,diffDisabled:W}),he(l,{style:[$.contentArea,Z&&$.contentAreaFooterPad],children:[c==="action"&&E(Jn,{action:e}),c==="state"&&E(l,{style:$.stateContainer,children:F()}),c==="diff"&&he(l,{style:$.diffContainer,testID:`${f}-diff`,children:[E(Gn,{tabs:Zn,activeTab:s,onTabChange:u,testIDPrefix:`${f}-diff-tab`}),E(Xn,{leftEvent:K,rightEvent:O}),E(l,{style:$.diffContent,testID:`${f}-diff-content`,children:Q()})]})]}),Z&&E(fr,{currentIndex:j-1,totalItems:i,onPrevious:Y,onNext:Ze,itemLabel:"Action",subtitle:_e(new Date(e.timestamp)),absolute:true})]})}function Ir({action:e,actions:t,selectedIndex:r,onIndexChange:o}){let a=t.length;if(a<=1)return null;let n=a-r;return E(fr,{currentIndex:n-1,totalItems:a,onPrevious:()=>o(Math.min(a-1,r+1)),onNext:()=>o(Math.max(0,r-1)),itemLabel:"Action",subtitle:_e(new Date(e.timestamp))})}var $=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:Ee,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:Ee,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:X.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:X.color.textTertiary,fontFamily:Ee},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:Ee,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:Ee},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});import{Fragment as ei,jsx as b,jsxs as N}from"react/jsx-runtime";var ti=Ha["redux.actions"].free;function ri({isEnabled:e,query:t,totalActions:r}){let o=Ua({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 b(qa,{...o,testID:`${f}-empty`})}function Ct({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,onActionSelect:c,initialSelectedActionId:d,initialDetailView:s}){let u=Ja(),i=Ma("redux.actions"),[g,m]=Le(false),{isInstrumented:R,isLoading:V,error:j,isReactReduxAvailable:L,captureMechanism:P}=yt(),{filteredActions:v,filter:K,setFilter:O,stats:F,clearActions:Q,isEnabled:Y,toggleCapture:Ze}=nr(),W=Ie(()=>v.slice(0,i),[v,i]),Z=Ie(()=>Math.max(0,v.length-i),[v.length,i]),fe=Z>0,[ye,Oe]=Le(null),me=Ie(()=>{if(ye===null)return null;let C=W.findIndex(z=>z.id===ye);return C>=0?C:null},[ye,W]),U=me!==null?W[me]:null,vt=Pe(null);Kt(()=>{if(!c)return;let C=U?.id??null;C===null||C===vt.current||(vt.current=C,c(U))},[U,c]);let Tt=Pe(null);Kt(()=>{!d||Tt.current===d||W.findIndex(C=>C.id===d)<0||(Tt.current=d,Oe(d))},[d,W]);let[ve,At]=Le(""),[It,et]=Le(false),Di=Pe(null),Er=Pe(null),$r=ae(C=>{},[]),Or=C=>{At(C),O(z=>({...z,searchText:C}))},Vr=ae(()=>{At(""),O(C=>({...C,searchText:""})),et(false)},[O]),Dt=ae(C=>{Oe(C.id)},[]),jr=ae(()=>{m(true)},[]),zr=ae(()=>{Oe(null)},[]),Bt=ae(C=>{let z=W[C];z&&Oe(z.id)},[W]),Lr=async()=>{if(!u){m(true);return}let C=v.map(z=>({id:z.id,type:z.type,...z.payload!==void 0&&{payload:z.payload},timestamp:z.timestamp,prevState:z.prevState,nextState:z.nextState,hasStateChange:z.hasStateChange}));await Wa(C)},Pr=ae(C=>C.id,[]),Rt=Ie(()=>Sr(W),[W]),kt=Ie(()=>{let C=new Map;for(let z of x.getActions()){let tt=z.meta?.requestId;tt&&C.set(tt,(C.get(tt)??0)+1)}return C},[v]),Wr=ae(({item:C})=>{let z=C.meta?.requestId;return b(pr,{action:C,onPress:Dt,linkedCount:z?kt.get(z)??0:0,testID:Rt.get(C.id)})},[Dt,Rt,kt]),Et=()=>U?N(ne,{children:[b(ne.Navigation,{onBack:zr}),b(ne.Content,{title:U.type,centered:true,testID:`${f}-detail-title`})]}):N(ne,{children:[r&&b(ne.Navigation,{onBack:r}),b(ne.Content,{title:"",children:It?b(ne.Search,{value:ve,onChangeText:Or,onCancel:Vr,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${f}-search-field`,containerTestID:`${f}-search`,clearTestID:`${f}-search-clear`,onBlur:()=>{ve.length===0&&et(false)}}):N(l,{style:I.headerChipRow,children:[N(J,{style:[I.headerChip,!K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(C=>({...C,onlyWithChanges:false})),testID:`${f}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${F.totalActions} captured`,accessibilityState:{selected:!K.onlyWithChanges},children:[b(y,{style:I.headerChipLabel,children:"ALL"}),b(y,{style:[I.headerChipValue,{color:T.color.text}],testID:`${f}-chip-all-value`,children:F.totalActions})]}),N(J,{style:[I.headerChip,K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(C=>({...C,onlyWithChanges:true})),testID:`${f}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${F.actionsWithChanges} of them`,accessibilityState:{selected:!!K.onlyWithChanges},children:[b(Va,{size:12,color:G.semantic.warning}),b(y,{style:[I.headerChipValue,{color:G.semantic.warning}],testID:`${f}-chip-changed-value`,children:F.actionsWithChanges})]}),N(l,{style:I.headerChip,testID:`${f}-chip-types`,accessibilityLabel:`${F.uniqueActionTypes} distinct action types`,children:[b(ja,{size:12,color:G.semantic.success}),b(y,{style:[I.headerChipValue,{color:G.semantic.success}],testID:`${f}-chip-types-value`,children:F.uniqueActionTypes})]})]})}),N(ne.Actions,{children:[!It&&b(J,{onPress:()=>et(true),style:[I.headerActionButton,ve.length>0&&I.headerActionButtonActive],testID:`${f}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:b(Ea,{size:14,color:ve.length>0?T.color.accent:T.color.textSecondary})}),b(J,{onPress:Lr,style:[I.headerActionButton,v.length===0&&I.headerActionButtonDisabled],disabled:v.length===0,testID:`${f}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:v.length===0},children:b(za,{size:14,color:v.length>0?T.color.textSecondary:T.color.textTertiary})}),b(Fa,{isEnabled:Y,onToggle:Ze,accessibilityLabel:"Toggle Redux action capture",testID:`${f}-power`}),b(J,{onPress:Q,style:[I.headerActionButton,v.length===0&&I.headerActionButtonDisabled],disabled:v.length===0,testID:`${f}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:v.length===0},children:b($a,{size:14,color:v.length>0?T.color.textTertiary:T.color.textTertiary})})]})]}),Nr=a?Pa.modal.root():"buoy-redux-modal";if(!e)return null;let $t=U&&me!==null?b(Ir,{action:U,actions:W,selectedIndex:me,onIndexChange:Bt}):null,Fr=U&&W.length>1?68:0,Mr=U==null,Ot=b(l,{style:I.container,children:U&&me!==null?b(Ar,{action:U,actions:W,selectedIndex:me,onIndexChange:Bt,disableInternalFooter:true,initialView:s}):N(ei,{children:[j&&!R&&!x.isCaptureSuppressed()&&N(l,{style:I.errorBanner,testID:`${f}-banner-error`,children:[b(tr,{size:14,color:T.color.danger}),b(y,{style:I.errorText,children:L?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!Y&&R&&N(l,{style:I.disabledBanner,testID:`${f}-banner-disabled`,children:[b(Oa,{size:14,color:T.color.warning}),b(y,{style:I.disabledText,children:"Action capture is disabled"})]}),P==="patch"&&!x.isCaptureSuppressed()&&N(l,{style:I.disabledBanner,testID:`${f}-banner-patch`,children:[b(tr,{size:14,color:T.color.warning}),b(y,{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:jr,activeOpacity:.8,testID:`${f}-locked`,accessibilityRole:"button",accessibilityLabel:`${Z} older ${Z===1?"action":"actions"} locked. Upgrade to see them.`,children:[b(La,{size:14,color:T.color.accent}),N(y,{style:I.lockedText,testID:`${f}-locked-text`,children:[Z," older ",Z===1?"action":"actions"," locked"]}),b(l,{style:I.upgradeBadge,children:b(y,{style:I.upgradeBadgeText,children:"UPGRADE"})})]}),W.length>0?b(Jt,{keyboardShouldPersistTaps:"handled",ref:Er,testID:`${f}-list`,data:W,renderItem:Wr,keyExtractor:Pr,contentContainerStyle:I.listContent,showsVerticalScrollIndicator:true,...Ka}):b(ri,{isEnabled:Y,query:ve,totalActions:F.totalActions})]})}),Vt=b(Na,{visible:g,onClose:()=>m(false),featureName:"Full Action History"});return n?N(rr,{children:[N(l,{style:I.inlineRoot,children:[b(l,{style:I.inlineHeader,..._a,children:Et()}),Ot,$t]}),Vt]}):N(rr,{children:[b(ka,{visible:e,onClose:t,onMinimize:o,persistenceKey:Nr,header:{showToggleButton:true,customContent:Et()},onModeChange:$r,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Mr,styles:{},footer:$t,footerHeight:Fr,children:Ot}),Vt]})}function oi(e={}){return b(Ct,{...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:Ya},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 Ge,REDUX_ICON_COLOR as sl}from"@buoy-gg/floating-tools-core/web";import{createToolFactory as ai,defineToolPreset as ni}from"@buoy-gg/shared-ui/web";import{jsx as Dr}from"react/jsx-runtime";var Br=ni({id:"redux",name:"REDUX",description:"Redux action & state inspector",slot:"both",icon:({size:e})=>Dr(Ge,{size:e}),component:Ct,props:{enableSharedModalDimensions:false}}),ii=ai(Br,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}),e=>({icon:({size:t})=>Dr(Ge,{size:t,color:e.iconColor})}));var li={timeTravel:false,toggle:false,edit:false,diff:true,export:true,import:false,reset:true,recording:true};function si(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 Rr(e){let{icon:t=Ge,color:r="#764ABC",name:o="Redux"}=e??{},a=0;return{id:"redux",name:o,icon:t,color:r,capabilities:li,subscribe:n=>x.subscribe(()=>{n()}),getEntries:()=>{let n=x.getActions();return n.map((c,d)=>si(c,d,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(d=>d.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 ci=Rr();import{WIRE_DETAIL_LIMIT_BYTES as di,capDetail as ui,createSyncAdapter as pi,memoByIdentity as gi,readParams as $e,toWire as hi}from"@buoy-gg/shared-ui/web";var Xe=e=>hi(e,ro),fi=gi(e=>{let t=oe(e.prevState)?{...e}:{...e,prevState:Nt,nextState:Nt};if(t.payload=Xe(t.payload),t.action=Xe(t.action),t.error=Xe(t.error),t.meta){let r=Xe(t.meta.arg);r!==t.meta.arg&&(t.meta={...t.meta,arg:r})}return t});function yi(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e):[]}function mi(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=g=>Array.isArray(g)?[...g]:{...g},d=c(e),s=d;for(let g=0;g<n.length-1;g++){let m=n[g],R=s[m];if(!R||typeof R!="object")return{ok:false,error:`No object at "${n.slice(0,g+1).join(".")}" \u2014 read getState for the real shape.`};let V=c(R);s[m]=V,s=V}let u=n[n.length-1],i=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:d,prev:i}}function bi(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 St(){let e=re().diagnostic??"not-instrumented";return{available:false,slices:[],reason:e}}var xi=pi({version:2,getSnapshot:()=>x.getActions().map(fi),subscribe:e=>x.subscribe(e),actions:{clearEvents:()=>{x.clearActions()},getActionDetail:e=>{let{id:t}=$e(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=>ui(n,di),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}=$e(e),r=Fe();if(!r)return St();let o=r.getState(),a=re();return{available:true,slices:yi(o),sliceFields:bi(o),capture:a.capture,mechanism:a.mechanism,...t?{state:o}:{}}},dispatch:e=>{let{action:t}=$e(e),r=Fe();if(!r)return{dispatched:false,...St()};if(!t)throw new Error("dispatch requires an `action`");return r.dispatch(t),{dispatched:true,type:t.type}},setState:e=>{let t=Fe();if(!t)return{ok:false,...St()};if(!Te())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=mi(t.getState(),$e(e));return r.ok?(t.dispatch({type:xe,payload:r.next}),{ok:true,path:$e(e).path,previous:r.prev}):r}}});import{useState as Ci}from"react";import{macOSColors as de,night as q,TabSelector as Si,DataInspector as ue,CollapsibleSection as Qe,CopyButton as wi,monoFont as wt}from"@buoy-gg/shared-ui/web";import{jsx as w,jsxs as H}from"react/jsx-runtime";function vi({action:e}){let[t,r]=Ci("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(l,{style:A.container,children:[H(l,{style:A.header,children:[H(l,{style:A.headerContent,children:[w(y,{style:A.actionType,numberOfLines:2,children:e.type}),H(l,{style:A.headerMeta,children:[w(y,{style:A.metaText,children:a}),e.duration!==void 0&&H(y,{style:A.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&w(l,{style:A.changeBadge,children:w(y,{style:A.changeBadgeText,children:"State Changed"})})]})]}),w(wi,{value:n(),size:16})]}),w(l,{style:A.tabContainer,children:w(Si,{tabs:o,activeTab:t,onTabChange:c=>r(c)})}),H(We,{keyboardShouldPersistTaps:"handled",style:A.content,showsVerticalScrollIndicator:true,children:[t==="action"&&H(l,{style:A.section,children:[w(Qe,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?w(ue,{data:e.payload}):w(y,{style:A.emptyText,children:"No payload"})}),w(Qe,{title:"Full Action",defaultOpen:false,children:w(ue,{data:e.action})})]}),t==="state"&&H(l,{style:A.section,children:[w(Qe,{title:"Previous State",defaultOpen:false,children:w(ue,{data:e.prevState})}),w(Qe,{title:"Next State",defaultOpen:true,children:w(ue,{data:e.nextState})})]}),t==="diff"&&w(l,{style:A.section,children:e.hasStateChange?w(Ti,{prevState:e.prevState,nextState:e.nextState}):w(l,{style:A.noChangeContainer,children:w(y,{style:A.noChangeText,children:"No state changes from this action"})})})]})]})}function Ti({prevState:e,nextState:t}){let r=kr(e,t);return r.length===0?w(l,{style:A.noChangeContainer,children:w(y,{style:A.noChangeText,children:"No differences detected"})}):w(l,{children:r.map((o,a)=>H(l,{style:A.diffItem,children:[H(l,{style:A.diffHeader,children:[w(l,{style:[A.diffTypeBadge,{backgroundColor:o.type==="added"?de.semantic.successBackground:o.type==="removed"?de.semantic.errorBackground:de.semantic.warningBackground}],children:w(y,{style:[A.diffTypeText,{color:o.type==="added"?de.semantic.success:o.type==="removed"?de.semantic.error:de.semantic.warning}],children:o.type.toUpperCase()})}),w(y,{style:A.diffPath,children:o.path})]}),o.type==="modified"&&H(l,{style:A.diffValues,children:[H(l,{style:A.diffValue,children:[w(y,{style:A.diffLabel,children:"Before:"}),w(ue,{data:o.oldValue})]}),H(l,{style:A.diffValue,children:[w(y,{style:A.diffLabel,children:"After:"}),w(ue,{data:o.newValue})]})]}),o.type==="added"&&w(l,{style:A.diffValue,children:w(ue,{data:o.newValue})}),o.type==="removed"&&w(l,{style:A.diffValue,children:w(ue,{data:o.oldValue})})]},a))})}function kr(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 d of c){let s=r?`${r}.${d}`:d,u=a[d],i=n[d];d in a?d in n?u!==i&&(typeof u=="object"&&typeof i=="object"&&u!==null&&i!==null&&!Array.isArray(u)&&!Array.isArray(i)?s.split(".").length<3?o.push(...kr(u,i,s)):o.push({type:"modified",path:s,oldValue:u,newValue:i}):o.push({type:"modified",path:s,oldValue:u,newValue:i})):o.push({type:"removed",path:s,oldValue:u}):o.push({type:"added",path:s,newValue:i})}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:wt,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:q.color.textTertiary},durationText:{fontSize:11,color:q.color.textTertiary,fontFamily:wt},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:wt},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:q.color.textTertiary,marginBottom:4,fontWeight:"600"}});function Ai(){return yt(),null}function Ii(e){return ee(e,"extension"),at(),()=>Wt(e)}export{xe as BUOY_JUMP_TO_STATE,co as BUOY_REPLAY_ACTION,ti as FREE_TIER_ACTION_LIMIT,f as REDUX_TEST_ID,Ar as ReduxActionDetailContent,Ir as ReduxActionDetailFooter,vi as ReduxActionDetailView,pr as ReduxActionItem,Ai as ReduxAutoInstrument,Ge as ReduxIcon,Ct as ReduxModal,oi as ReduxToolView,Cr as actionRowTestID,Sr as buildActionRowTestIDs,ze as buoyDevtoolsEnhancer,po as buoyReduxMiddleware,Ut as claimDevtoolsHook,Ii as connectReduxAdapter,go as createBuoyReduxMiddleware,Rr as createReduxHistoryAdapter,ii as createReduxTool,Fe as getActiveStore,re as getInstrumentationStatus,ht as instrumentStore,nn as isAutoInstrumentActive,Co as isDevtoolsHookClaimed,on as isStoreInstrumented,Ht as jumpToState,x as reduxActionStore,ci as reduxHistoryAdapter,xi as reduxSyncAdapter,Br as reduxToolPreset,an as registerReduxStore,_t as replayAction,xr as slugForTestID,ft as uninstrumentStore,yt as useAutoInstrumentRedux,nr as useReduxActions,ln as useReduxAvailability,uo as withBuoyDevTools};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/redux",
3
- "version": "7.0.84",
3
+ "version": "7.0.86",
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/shared-ui": "^7.0.84",
44
- "@buoy-gg/floating-tools-core": "^7.0.84",
45
- "@buoy-gg/license": "^7.0.84"
43
+ "@buoy-gg/license": "^7.0.86",
44
+ "@buoy-gg/floating-tools-core": "^7.0.86",
45
+ "@buoy-gg/shared-ui": "^7.0.86"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@reduxjs/toolkit": ">=1.9.0",