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