@buoy-gg/core 7.0.60 → 7.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +3 -0
  2. package/bundlers/vite.d.ts +36 -0
  3. package/bundlers/vite.mjs +6 -0
  4. package/lib/commonjs/auto.web.js +1 -0
  5. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -1
  6. package/lib/commonjs/installedTools.js +1 -0
  7. package/lib/commonjs/version.js +1 -1
  8. package/lib/module/auto.web.js +1 -0
  9. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -1
  10. package/lib/module/installedTools.js +1 -0
  11. package/lib/module/version.js +1 -1
  12. package/lib/typescript/commonjs/auto.web.d.ts +21 -0
  13. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +11 -4
  14. package/lib/typescript/commonjs/installedTools.d.ts +14 -0
  15. package/lib/typescript/commonjs/version.d.ts +1 -1
  16. package/lib/typescript/module/auto.web.d.ts +21 -0
  17. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +11 -4
  18. package/lib/typescript/module/installedTools.d.ts +14 -0
  19. package/lib/typescript/module/version.d.ts +1 -1
  20. package/lib/web/auto.mjs +1 -0
  21. package/lib/web/chunks/FloatingDevTools.web-M3ASH5EV.mjs +1 -0
  22. package/lib/web/chunks/FloatingDevTools.web-OQERI2YM.mjs +1 -0
  23. package/lib/web/chunks/chunk-3YORPV22.mjs +10 -0
  24. package/lib/web/chunks/chunk-7G3P7Z7K.mjs +1 -0
  25. package/lib/web/chunks/chunk-JGFWBADO.mjs +10 -0
  26. package/lib/web/chunks/chunk-T6BXEQLL.mjs +1 -1
  27. package/lib/web/chunks/chunk-ZD6O2YPD.mjs +1 -0
  28. package/lib/web/index.mjs +1 -10
  29. package/lib/web/installed-tools.mjs +1 -0
  30. package/lib/web/register.mjs +1 -1
  31. package/lib/web/toolkit.mjs +1 -1
  32. package/package.json +19 -6
  33. package/lib/web/chunks/chunk-GLXZCY6W.mjs +0 -1
@@ -0,0 +1,10 @@
1
+ "use client";import{a as N,b as H,c as lt,d as Xo,e as Jt,f as Qo,g as bl,h as Ee,i as Yt,j as Ne,k as ct}from"./chunk-7G3P7Z7K.mjs";import{b as Zo,c as ei}from"./chunk-5SGL6QL4.mjs";import{a as Xt,d as _e}from"./chunk-CLXYMJTS.mjs";import{FloatingToolHost as ti}from"@buoy-gg/shared-ui/web/floating";import*as ni from"@buoy-gg/license/web";import{LicenseManager as oi,useLicense as ii,sameLicenseKey as ri,resolveDevBuild as ai,capacitorDebug as si,isCapacitorNative as li,loadCapacitorAppHost as ci}from"@buoy-gg/license/web";import{AccountSetup as di,HintsProvider as ui,normalizeEnvironment as pi,registerToolOpener as mi,startSettingsSync as gi}from"@buoy-gg/shared-ui/web";import{useState as Bt,useMemo as ge,useCallback as We,useEffect as ee,useRef as fi}from"react";import{useSettings as hi,getToolLabel as dt,getToolDescription as yi,getToolColor as Qt}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Ae,devToolsStorageKeys as ut,EnvironmentIndicator as bi,EnvironmentSelectorInline as vi}from"@buoy-gg/shared-ui/web";var Si=[];function wi(){return[]}function Zt(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}function Rt(e,t){return e.filter(n=>{let i=n.slot||"both";return i==="both"||i===t})}function xi(e,t){let n=t instanceof Set?t:new Set(t);return e.filter(i=>n.has(i.id))}import{FloatingTool as en,FloatingToolDivider as Ci,FloatingToolUserStatus as tn,getBubbleAnchorPosition as Ii}from"@buoy-gg/shared-ui/web/floating";import{useState as Q,useEffect as Oe,useMemo as pt,useRef as mt,useCallback as gt}from"react";var nn={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock",permissions:"Permissions","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};function Ti(e,t){return e&&nn[e]?nn[e]:t}import{getDialLayout as ki,getAllIconPositions as zi,getGridLineRotations as Mi,getIconStaggerInputRange as Bi,MAX_DIAL_SLOTS as Ge,DIAL_ICON_SIZE as Ri,dialAnimationConfig as on,getDialCSSKeyframesString as Ei,getDialCSSAnimationStyles as Ai,dialColors as L,dialStyles as S,withAlpha as rn,floatingToolsColors as Oi}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as an,monoFont as sn,ToolBackground as Di,useToolBackground as Pi}from"@buoy-gg/shared-ui/web";import{memo as Li}from"react";import{RasterLayer as Fi,scatter as $i,useLoop as ji,withBgAlpha as Ni}from"@buoy-gg/shared-ui/web";import{Fragment as _i,jsx as Je}from"react/jsx-runtime";var Wi=.94,Hi=6,Ui=2400,ft=3,ln=16,Ki=Array.from({length:ft},(e,t)=>$i(22343^t*40503,ln*4)),cn=["#FFFFFF","#B3D9FF","#8CB3FF"],dn=Math.PI/3,un=14*Math.PI/180;function Vi(e){let t=Math.min(5,Math.floor(e*6)),n=e*6-t;return t*dn+un/2+n*(dn-un)}function qi(e){return Math.min(Hi,1/(1-e*Wi))}function Gi(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}function Ji(e){let t=e/ft,n=[],i=12;for(let s=0;s<=i;s++)n.push(s/i);let o=(1-t)%1;o>.001&&o<1-.001&&n.push(o-1e-4,o+1e-4),n.sort((s,u)=>s-u);let r=[],a=[],l=[];for(let s of n){let u=t===0&&s===1?1:(s+t)%1;r.push(s),a.push(qi(u)),l.push(Gi(u))}return{input:r,scale:a,opacity:l}}var Yi=Array.from({length:ft},(e,t)=>Ji(t)),Xi=Li(function({size:e}){let t=ji(Ui),n=e/2,i=[];for(let o=0;o<ft;o++){let r=Ki[o],a=Yi[o],l=[];for(let s=0;s<ln;s++){let u=Vi(r[s*4]),m=(.15+.85*Math.sqrt(r[s*4+1]))*.5*n,C=cn[Math.floor(r[s*4+3]*cn.length)%3],g=n+Math.cos(u)*m,B=n+Math.sin(u)*m,w=.6,R=w*2.4;l.push(Je(N,{style:{position:"absolute",left:g-R/2,top:B-R/2,width:R,height:R,borderRadius:R/2,backgroundColor:Ni(C,.3)}},`${s}-h`),Je(N,{style:{position:"absolute",left:g-w/2,top:B-w/2,width:w,height:w,borderRadius:w/2,backgroundColor:C}},s))}i.push(Je(Ee.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:a.input,outputRange:a.opacity}),transform:[{scale:t.interpolate({inputRange:a.input,outputRange:a.scale})}]},pointerEvents:"none",children:Je(Fi,{style:{width:e,height:e},raster:false,children:l})},o))}return Je(_i,{children:i})});import{useEffect as Qi,useState as pn}from"react";import{dialColors as He,withAlpha as mn}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Zi,ARROW_HEIGHT as er,SPACING_GAP as Fl,getScreenCenterY as $l,calculateTooltipPosition as tr,calculateTargetPosition as jl}from"@buoy-gg/shared-ui/web/floating";import{monoFont as gn}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as fn}from"react/jsx-runtime";var hn=false;function nr(){if(hn||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
2
+ @keyframes buoyOnboardPulse {
3
+ 0%, 100% { transform: scale(1); }
4
+ 50% { transform: scale(1.02); }
5
+ }
6
+ @keyframes buoyOnboardArrowBounce {
7
+ 0%, 100% { transform: translateY(0); }
8
+ 50% { transform: translateY(-8px); }
9
+ }
10
+ `,document.head.appendChild(e),hn=true}var Et=He.accent;function yn({title:e,message:t,onDismiss:n,showArrow:i=true}){let[o,r]=pn(false),[a,l]=pn(false);Qi(()=>{nr();let u=requestAnimationFrame(()=>r(true));return()=>cancelAnimationFrame(u)},[]);let s={fontFamily:gn,textTransform:"uppercase"};return Ue("div",{style:{position:"fixed",left:"50%",bottom:tr(),transform:`translateX(-50%) scale(${o?1:.8})`,opacity:o?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:fn("div",{style:{position:"relative",animation:o?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ue("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),fn("div",{style:{position:"relative",maxWidth:280,backgroundColor:He.dialBackground,borderRadius:16,border:`1px solid ${He.dialBorder}`,padding:20,boxShadow:`0 0 20px ${mn(He.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ue("span",{style:{...s,fontSize:16,fontWeight:900,letterSpacing:1,color:Et,textAlign:"center"},children:e}),Ue("span",{style:{fontFamily:gn,fontSize:13,lineHeight:"20px",color:He.centerText,textAlign:"center"},children:t}),Ue("button",{onClick:n,onPointerDown:()=>l(true),onPointerUp:()=>l(false),onPointerLeave:()=>l(false),onPointerCancel:()=>l(false),style:{...s,marginTop:8,borderRadius:8,border:"none",backgroundColor:Et,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:a?.7:1,transform:a?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ue("div",{style:{position:"absolute",left:"50%",bottom:Zi,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${er}px solid ${Et}`,filter:`drop-shadow(0 0 10px ${mn(He.dialShadow,.5)})`,animation:o?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as or,jsx as D,jsxs as be}from"react/jsx-runtime";var ir={x:.5,y:.5},bn="@react_buoy_settings_tooltip_shown",vn=false;function rr(){if(vn||typeof document>"u")return;let e=document.createElement("style");e.textContent=Ei(),document.head.appendChild(e),vn=true}var Ke=e=>1-Math.pow(1-e,3),At=e=>e*e*e;function ar({icon:e,index:t,totalIcons:n,position:i,progress:o,onPress:r}){let[a,l]=Q(false),[s,u]=Q(false),m=!e.icon&&e.id.startsWith("empty-"),C=!m&&e.unavailable===true,g=!m&&!C,{icons:B}=on,w=Bi(t,n),R=0;o<=w[1]?R=0:o<=w[2]?R=(o-w[1])/(w[2]-w[1]):R=1,R=Math.max(0,Math.min(1,R));let z=Ri,A=B.pressIn.scale,M=R*(s?A:a?1.1:1),k=0;R<=0?k=0:R<=.3?k=R:k=.3+(R-.3)*(.7/.7);let v=i.x*R,T=i.y*R;return D("button",{role:"menuitem","aria-label":m?"Empty slot":Ti(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!g,tabIndex:g?0:-1,onClick:g?r:void 0,onPointerEnter:P=>g&&P.pointerType==="mouse"&&l(true),onPointerLeave:()=>{l(false),u(false)},onPointerDown:()=>g&&u(true),onPointerUp:()=>u(false),onPointerCancel:()=>u(false),style:{position:"absolute",left:"50%",top:"50%",width:z,height:z,marginLeft:-z/2,marginTop:-z/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:g?"pointer":"default",transform:`translate(${v}px, ${T}px) scale(${M})`,opacity:k,transition:a||s?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:m?D("div",{style:{width:S.emptySlot.dotSize,height:S.emptySlot.dotSize,borderRadius:S.emptySlot.dotSize/2,backgroundColor:L.emptyDotBackground,border:`${S.emptySlot.borderWidth}px solid ${L.emptyDotBorder}`}}):be(or,{children:[D("div",{style:{position:"absolute",width:`${S.icon.gradientBgSizePercent}%`,height:`${S.icon.gradientBgSizePercent}%`,borderRadius:S.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:S.icon.gradientBgOpacity}}),D("div",{style:{position:"absolute",width:`${S.icon.innerGlowSizePercent}%`,height:`${S.icon.innerGlowSizePercent}%`,borderRadius:S.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:S.icon.innerGlowOpacity}}),D("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:a?"brightness(1.2)":"none"},children:e.icon}),D("span",{style:{fontSize:e.name.length>8?Math.max(S.icon.label.fontSize*.7,S.icon.label.fontSize*8/e.name.length):S.icon.label.fontSize,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,color:L.iconLabel,letterSpacing:S.icon.label.letterSpacing,marginTop:S.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),C&&D("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:Oi.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Sn({side:e,color:t}){return D("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(e==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]]).map(([n,i,o,r],a)=>D("line",{x1:n,y1:i,x2:o,y2:r,stroke:t,strokeWidth:2},a))})}function wn({side:e,disabled:t,onClick:n}){let[i,o]=Q(false),r=t?L.emptyDotBorder:L.accent;return be("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:n,onPointerDown:()=>!t&&o(true),onPointerUp:()=>o(false),onPointerLeave:()=>o(false),onPointerCancel:()=>o(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${L.dialBorder}`,backgroundColor:L.dialBackground,color:t?L.iconLabelMuted:L.centerText,fontSize:12,fontWeight:900,fontFamily:sn,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${rn(L.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&D(Sn,{side:"prev",color:r}),e==="prev"?"PREV":"NEXT",e==="next"&&D(Sn,{side:"next",color:r})]})}function xn({icons:e,onClose:t,centerLabel:n="MENU",onCenterPress:i,settingsOpen:o=false,hintsDisabled:r=false}){let{id:a}=Pi(),[l,s]=Q(0),[u,m]=Q(0),[C,g]=Q(0),[B,w]=Q(0),[R,z]=Q(0),[A,M]=Q(1),[k,v]=Q(false),[T,P]=Q(false),[I,E]=Q(false),Z=mt(null),W=mt(null),q=mt(null),te=mt(false),{entrance:K,exit:re,interaction:ne}=on,ve=Ai(),[ae,Te]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));Oe(()=>{let b=()=>Te({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let $=pt(()=>ki({screenWidth:ae.width,maxCircleSize:Math.max(120,Math.min(320,ae.height-96))}),[ae]),qe=pt(()=>Mi(),[]),ke=pt(()=>zi(Ge,$.iconRadius),[$.iconRadius]),[Fe,ze]=Q(0),se=Math.max(1,Math.ceil(e.length/Ge)),J=Math.min(Fe,se-1),Se=pt(()=>{let b=J*Ge,x=[...e.slice(b,b+Ge)];for(;x.length<Ge;)x.push({id:`empty-${x.length}`,name:"",icon:null,onPress:()=>{}});return x},[e,J]);Oe(()=>{rr()},[]),Oe(()=>{let b=K.backdrop.duration,x=K.dial.rotation.duration,Y=K.centerButton.delay,U=K.icons.delay,G=K.icons.duration,V=performance.now(),oe=me=>{let c=me-V;s(Math.min(1,c/b));let f=Math.min(1,c/400),O=Ke(f)*1.1;f>.7&&(O-=(f-.7)*.33),f>=1&&(O=1),m(Math.max(0,Math.min(1.05,O)));let X=Math.min(1,c/x);if(g(Ke(X)*360),c>=Y){let xe=Math.min(1,(c-Y)/300),je=Ke(xe)*1.15;xe>.6&&(je-=(xe-.6)*.375),xe>=1&&(je=1),w(Math.max(0,Math.min(1.05,je)))}if(c>=U){let xe=Math.min(1,(c-U)/G);z(Ke(xe))}let we=U+G;c<we?q.current=requestAnimationFrame(oe):(s(1),m(1),g(360),w(1),z(1),E(true))};return q.current=requestAnimationFrame(oe),()=>{q.current&&cancelAnimationFrame(q.current)}},[]);let pe=gt(()=>{if(te.current)return;te.current=true,P(true),q.current&&cancelAnimationFrame(q.current);let b=performance.now(),x=re.icons.duration,Y=re.centerButton.duration,U=re.dialScale.duration,G=Math.max(Y,U),V=re.backdrop.duration,oe=me=>{let c=me-b;if(c<x){let X=At(c/x);z(1-X),q.current=requestAnimationFrame(oe);return}let f=x;if(c<f+G){z(0);let X=Math.min(1,(c-f)/Y),we=Math.min(1,(c-f)/U);w(1-At(X)),m(1-At(we)),q.current=requestAnimationFrame(oe);return}let O=f+G;if(c<O+V){m(0),w(0);let X=(c-O)/V;s(1-X),q.current=requestAnimationFrame(oe);return}s(0),t()};q.current=requestAnimationFrame(oe)},[re,t]);Oe(()=>{let b=document.activeElement,x=Z.current;return()=>{b?.isConnected&&(document.activeElement===document.body||x?.contains(document.activeElement))&&b.focus()}},[]),Oe(()=>{if(o)return;W.current?.focus();let b=x=>{let Y=Z.current;if(Y){if(x.key==="Escape")x.preventDefault(),pe();else if(x.key==="Tab"){let U=Array.from(Y.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(oe=>oe.getClientRects().length>0),G=U[0],V=U[U.length-1];(!Y.contains(document.activeElement)||(x.shiftKey?document.activeElement===G:document.activeElement===V))&&(x.preventDefault(),(x.shiftKey?V:G)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(x.key)){let U=Array.from(Y.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),G=U.indexOf(document.activeElement);if(G<0||!U.length)return;x.preventDefault();let V=x.key==="Home"?0:x.key==="End"?U.length-1:(G+(x.key==="ArrowRight"||x.key==="ArrowDown"?1:-1)+U.length)%U.length;U[V].focus()}}};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[pe,o]);let[Me,$e]=Q(false);Oe(()=>{if(r)return;let b=false,x=setTimeout(async()=>{let Y=await an.getItem(bn);!b&&!Y&&$e(true)},1200);return()=>{b=true,clearTimeout(x)}},[r]);let he=gt(()=>{$e(false),an.setItem(bn,"true")},[]);Oe(()=>{o&&Me&&he()},[o,Me,he]);let Be=gt(b=>{if(b.id.startsWith("empty-")||te.current)return;let[x,Y]=ne.iconSelect.pulse,U=performance.now(),G=150,V=oe=>{let me=oe-U;if(me<G){let c=Ke(me/G);M(1-(1-x.scale)*c),requestAnimationFrame(V)}else if(me<G*2){let c=Ke((me-G)/G);M(x.scale+(Y.scale-x.scale)*c),requestAnimationFrame(V)}else M(1)};requestAnimationFrame(V),setTimeout(()=>{b.onPress(),pe()},ne.iconSelect.actionDelay)},[ne.iconSelect,pe]),ue=gt(b=>{if(te.current)return;let x=Math.max(0,Math.min(b,se-1));x!==J&&ze(x)},[se,J]),ye=$.buttonSize*S.centerButton.containerRatio,Re=$.buttonSize*S.centerButton.borderRatio,d=$.buttonSize*S.centerButton.containerRatio/2+6,_=I&&!T;return be("div",{ref:Z,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[D("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:pe,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:L.dialBackdrop,opacity:l}}),be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,bottom:80,width:$.circleSize,height:$.circleSize,borderRadius:"50%",backgroundColor:L.dialBackground,border:`${S.circle.borderWidth}px solid ${L.dialBorder}`,boxShadow:`0 0 ${S.circle.shadowRadius}px ${rn(L.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${u}) rotate(${C}deg)`,opacity:u>.01?1:0,overflow:"hidden"},children:[D("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:L.dialGradient1,opacity:S.gradientLayers[0].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:L.dialGradient2,opacity:S.gradientLayers[1].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:L.dialGradient3,opacity:S.gradientLayers[2].opacity}}),qe.map(b=>D("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:S.grid.lineHeight,transform:`rotate(${b}deg)`,transformOrigin:"center"},children:["left","right"].map(x=>D("div",{style:{position:"absolute",top:0,[x]:0,width:`calc(50% - ${d}px)`,height:S.grid.lineHeight,backgroundColor:L.dialGridLine}},x))},b)),D("div",{"data-testid":"dial-background","data-background":a,style:{position:"absolute",inset:0,pointerEvents:"none"},children:a==="hyperspace"?D(Xi,{size:$.circleSize}):D(Di,{focus:ir})}),Se.map((b,x)=>D(ar,{icon:b,index:x,totalIcons:Se.length,position:ke[x],progress:R,onPress:()=>Be(b)},x)),be("div",{style:{position:"absolute",left:"50%",top:"50%",width:ye,height:ye,marginLeft:-ye/2,marginTop:-ye/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:L.hubHalo,borderRadius:$.buttonSize,overflow:"hidden",transform:`scale(${B*A})`,opacity:B>.01?1:0},children:[D("div",{style:{position:"absolute",inset:0,backgroundColor:L.dialGradient1,opacity:.5,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:L.dialGradient2,opacity:.3,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:L.dialGradient3,opacity:.2,borderRadius:$.buttonSize}}),D("div",{style:{width:Re,height:Re,borderRadius:$.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:L.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:D("button",{ref:W,type:"button","aria-label":o?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,onPointerEnter:b=>b.pointerType==="mouse"&&v(true),onPointerLeave:()=>v(false),style:{border:0,padding:0,background:"transparent",width:$.buttonSize,height:$.buttonSize,borderRadius:$.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default",transform:k?`scale(${ne.centerHover.scale})`:"scale(1)",transition:`transform ${ne.centerHover.duration}ms ease`,animation:_&&!k?ve.pulse:"none"},children:o?be("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:S.centerButton.text.fontSize-2,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[D("span",{style:{marginBottom:-2},children:"CLOSE"}),D("span",{style:{marginTop:-2},children:"SETTINGS"})]}):D("span",{style:{fontSize:S.centerButton.text.fontSize,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase"},children:n})})})]})]}),se>1&&be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,top:"calc(100% - 64px)",width:$.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,u),transform:`scale(${Math.min(1,u)})`},children:[D(wn,{side:"prev",disabled:J<=0,onClick:()=>ue(J-1)}),be("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:sn,letterSpacing:2,color:L.centerText,textShadow:`0 0 6px ${L.centerTextGlow}`},children:[String(J+1).padStart(2,"0"),be("span",{style:{color:L.iconLabelMuted,textShadow:"none"},children:[" / ",String(se).padStart(2,"0")]})]}),D(wn,{side:"next",disabled:J>=se-1,onClick:()=>ue(J+1)})]}),Me&&!o&&D(yn,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:he,showArrow:false})]})}import{persistentStorage as Cn,devToolsStorageKeys as sr}from"@buoy-gg/shared-ui/web";import{recordUsage as lr,pruneUsage as cr}from"@buoy-gg/floating-tools-core/web";var In=sr.dial.usage(),Ve={},Tn=false,Ot=null;function kn(){return Ot||(Ot=(async()=>{try{let e=await Cn.getItem(In);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ve=t)}}catch{}finally{Tn=true}})(),Ot)}kn();function dr(e){return e.map((t,n)=>({id:t,index:n,lastUsed:Ve[t]?.lastUsed??0})).sort((t,n)=>n.lastUsed-t.lastUsed||t.index-n.index).map(({id:t})=>t)}async function ur(e){if(!e)return;Tn||await kn();let t=Math.max(Date.now(),...Object.values(Ve).map(n=>n.lastUsed+1));Ve=cr(lr(Ve,e,t),t);try{await Cn.setItem(In,JSON.stringify(Ve))}catch{}}import{useCallback as pr,useMemo as zn}from"react";import{persistentStorage as mr}from"@buoy-gg/shared-ui/web";import{useState as ie,useEffect as Ce,useCallback as ht,useMemo as yt}from"react";import{settingsEventBus as bt}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as gr}from"react";import{getRegisteredToolModule as fr}from"@buoy-gg/shared-ui/web";var hr=()=>()=>{},yr=()=>null;function br(){let e=fr("@buoy-gg/external-sync");return gr(e?.subscribeSyncStatus??hr,()=>e?.getSyncStatus?.()??null,yr)}import{SentryIcon as vr,WifiCircuitIcon as Sr,ImageOverlayIcon as wr,RenderCountIcon as xr,Info as Dt,Layers as Cr,ChevronRightIcon as Mn,ChevronDown as Bn,getStorageBackendType as Ir,getUseLicense as Tr,signOutOfBuoy as kr,persistentStorage as De,Trash2 as zr,CheckCircle2 as Rn,BuoyUpgradeSheet as Mr,BackgroundSwitcher as Br,night as h,NightCard as Pe,NightRows as Pt,NightSectionLabel as Rr,NightFootnote as En,NightSwitch as An,NightButton as Lt,NightSegmented as Er,NightBadge as fe,NightSeparator as Ar,monoFont as On}from"@buoy-gg/shared-ui/web";import{EnvIcon as Dn,StorageIcon as Or,RoutesIcon as Dr,NetworkIcon as Pr,QueryIcon as Lr,HighlighterIcon as Fr,ReduxIcon as $r,EventsIcon as jr}from"@buoy-gg/floating-tools-core/web";import Nr,{createContext as _r,useContext as Wr}from"react";import{jsx as Hr}from"react/jsx-runtime";var Pn=_r({});function Ln({children:e,defaultFloatingTools:t,defaultDialTools:n}){let i=Nr.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:n}),[t,n]);return Hr(Pn.Provider,{value:i,children:e})}function Fn(){return Wr(Pn)}import Ur from"react";import{toolTheme as Kr}from"@buoy-gg/shared-ui/web";import{jsx as $n}from"react/jsx-runtime";function Vr({label:e,size:t,color:n=Kr.colors.text}){let i=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),o=i<=2?t:t*1.6,r=Math.max(7,Math.min(t*(i===1?.7:.62),o/(.62*i)));return $n("span",{style:{display:"inline-flex",minWidth:t,maxWidth:o,height:t,alignItems:"center",justifyContent:"center",color:n,fontSize:r,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function jn(e,t){return e==null?e:typeof e=="function"?Ur.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?$n(Vr,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as qr,devToolsStorageKeys as Ft,onSettingsApplied as Gr,expandableWindowControlsSupported as Jr}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Yr}from"@buoy-gg/shared-ui/web";import{Fragment as Ye,jsx as p,jsxs as j}from"react/jsx-runtime";var Xe="@react_buoy_dev_tools_settings",Xr=6,vt=e=>{let t=Xr,n={};for(let[i,o]of Object.entries(e))o&&t>0?(n[i]=true,t-=1):n[i]=false;return n},Qr=(e,t)=>{let{userStatus:n,environment:i,...o}=e,r=t?Object.entries(o).filter(([a])=>t.includes(a)):Object.entries(o);return{...Object.fromEntries(r),environment:i??false}},Nn=(e,t,n)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},o=n?.allowedDialKeys?Object.entries(i).filter(([r])=>n.allowedDialKeys?.includes(r)):Object.entries(i);return{dialTools:vt(Object.fromEntries(o)),floatingTools:Qr({...e.floatingTools,...t.floatingTools??{}},n?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},Zr=(e=[],t,n)=>{let i={},o={},r=new Set(t??[]),a=new Set(n??[]),l=!n||n.length===0;for(let s of e){let{id:u,slot:m="both"}=s;(m==="dial"||m==="both")&&(i[u]=l?true:a.has(u)),(m==="row"||m==="both")&&(o[u]=r.has(u))}return{dialTools:vt(i),floatingTools:{...o,environment:r.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},ea=({visible:e,onClose:t,onSettingsChange:n,initialSettings:i,availableApps:o=[],storage:r=De,zIndex:a})=>{let{defaultFloatingTools:l,defaultDialTools:s}=Fn(),u=yt(()=>Zr(o,l,s),[o,l,s]),m=yt(()=>Object.keys(u.dialTools),[u]),C=yt(()=>Object.keys(u.floatingTools).filter(c=>c!=="environment"),[u]),[g,B]=ie(i||Qe||u),[w,R]=ie($t??"floating"),[z,A]=ie($t!==null),[M,k]=ie(new Set),[v,T]=ie(false),[P,I]=ie(false);Ce(()=>{let c=requestAnimationFrame(()=>I(true));return()=>cancelAnimationFrame(c)},[]);let E=br();Ce(()=>{(async()=>{try{let c=await De.getItem(Ft.settings.activeTab());if(c&&["floating","settings","pro"].includes(c)){let f=c;$t=f,R(O=>O===f?O:f)}}catch{}finally{A(true)}})()},[]),Ce(()=>{z&&De.setItem(Ft.settings.activeTab(),w).catch(c=>{console.warn("Failed to save settings active tab:",c)})},[w,z]);let Z=Tr()?.(),W=Z?.isPro??false,q=!W&&Z?.licenseKey?Z.error:null,te=Z?.errorKind==="transport",[K,re]=ie(_n),[ne,ve]=ie(false),[ae,Te]=ie(false),[$,qe]=ie(false),[ke,Fe]=ie([]),[ze,se]=ie(false),J=Yr(),Se=Yt.get("window").height,pe=Yt.get("window").width,Me=Math.floor(Se*.33),$e=Math.min(pe-32,400),he=ht(async()=>{try{let c=await r.getItem(Xe);if(c){let f=JSON.parse(c),O=Nn(u,f,{allowedDialKeys:m,allowedFloatingKeys:C});Qe=O,B(X=>Wn(X,O)?X:O);return}Qe=u,B(f=>Wn(f,u)?f:u)}catch(c){console.error("Failed to load dev tools settings:",c),B(u)}},[u,m,C,r]);Ce(()=>{he()},[he]),Ce(()=>{Ir().then(c=>{_n=c,re(f=>f===c?f:c)})},[]),Ce(()=>{$&&(se(true),De.getAllKeys().then(c=>{Fe(c.sort())}).catch(()=>{Fe([])}).finally(()=>{se(false)}))},[$]);let Be=async c=>{try{let f={...c,dialTools:vt(c.dialTools)};await r.setItem(Xe,JSON.stringify(f)),Qe=f,B(f),n?.(f),bt.emit(f)}catch(f){console.error("Failed to save dev tools settings:",f)}},ue=c=>{let f={...g,floatingTools:{...g.floatingTools,[c]:!g.floatingTools[c]}};Be(f)},ye=c=>{let f={...g,globalSettings:{...g.globalSettings,[c]:!g.globalSettings?.[c]}};Be(f)},Re=async()=>{ve(true),Te(false);try{await De.clear(),Te(true),B(u),r!==De&&await r.setItem(Xe,JSON.stringify(u)),n?.(u),bt.emit(u),setTimeout(()=>Te(false),2e3)}catch(c){console.error("Failed to clear storage:",c)}finally{ve(false)}},d=ht(c=>{},[]),_=c=>{let f=o.find(O=>O.id===c);return f?.description?f.description:c==="environment"?"Environment badge.":""},b=c=>c==="environment"?"Env Badge":o.find(f=>f.id===c)?.name??c.toUpperCase().replace(/_/g," "),x=c=>{if(!P)return null;switch(c){case"query":return p(Lr,{size:18});case"env":return p(Dn,{size:18});case"sentry":return p(vr,{size:18,color:"#9945FF"});case"storage":return p(Or,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return p(Sr,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(Dr,{size:18,bgColor:h.color.surface});case"network":return p(Pr,{size:18});case"environment":return p(Dn,{size:18});case"debug-borders":return p(Cr,{size:18,color:h.color.accent});case"highlight-updates":return p(xr,{size:18,color:h.color.accent});case"highlight-updates-modal":return p(Fr,{size:18});case"redux":return p($r,{size:18});case"image-overlay":return p(wr,{size:18});case"events":return p(jr,{size:18});case"zustand":try{let{ZustandIcon:f}=Xt("@buoy-gg/zustand/web");return p(f,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:f}=Xt("@buoy-gg/jotai/web");return p(f,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}default:{let f=o.find(O=>O.id===c);return f?.icon!=null?jn(f.icon,{slot:"row",size:18,color:f.color}):p(Dt,{size:18,color:h.color.textSecondary})}}},Y=(c,f,O,X)=>{let we=_(c);return j(lt,{activeOpacity:O?1:.7,onPress:()=>!O&&X(),accessibilityLabel:b(c),accessibilityRole:"button",style:[y.toolRow,O&&y.rowDisabled],children:[p(N,{style:y.toolIconSlot,children:x(c)}),j(N,{style:y.rowInfo,children:[j(H,{style:y.rowLabel,children:[b(c),O?" \xB7 max 6":""]}),we?p(H,{style:y.rowCaption,numberOfLines:1,children:we}):null]}),p(An,{value:f,disabled:O,onValueChange:()=>X()})]},c)},U=c=>{k(f=>{let O=new Set(f);return O.has(c)?O.delete(c):O.add(c),O})},G=(c,f,O,X,we)=>{let xe=g.globalSettings?.[c]??false,je=M.has(c);return j(N,{children:[j(lt,{activeOpacity:.7,onPress:()=>U(c),accessibilityLabel:f,style:y.settingRow,children:[j(N,{style:y.rowInfo,children:[p(H,{style:y.rowLabel,children:f}),p(H,{style:y.rowCaption,numberOfLines:je?0:1,children:O})]}),p(An,{value:xe,onValueChange:()=>ye(c)})]}),je&&j(N,{style:y.settingRowBody,children:[p(H,{style:y.settingRowBodyText,children:X}),p(H,{style:y.settingRowBodyHint,children:we})]})]},c)},V=(c,f,O)=>j(N,{children:[p(Rr,{children:c}),f,O]}),oe=K==="filesystem"?p(fe,{label:"File System",tone:"accent"}):K==="asyncstorage"?p(fe,{label:"Async Storage",tone:"warning"}):K==="localstorage"?p(fe,{label:"Local Storage",tone:"accent"}):K==="memory"?p(fe,{label:"Memory",tone:"danger"}):p(fe,{label:"Loading\u2026",tone:"neutral"}),me=()=>j(N,{style:y.container,children:[j(Jt,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[w==="floating"&&p(Ye,{children:V("Floating Tools",p(Pe,{glass:true,children:p(Pt,{children:Object.entries(g.floatingTools).map(([c,f])=>Y(c,f,false,()=>ue(c)))})}),p(En,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&j(Ye,{children:[V("Background",p(Pe,{glass:true,padded:true,children:p(Br,{embedded:true})})),V("Storage",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>qe(!$),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Storage Type"})}),oe,$?p(Bn,{size:16,color:h.color.textTertiary}):p(Mn,{size:16,color:h.color.textTertiary})]}),$&&j(Ye,{children:[j(N,{style:y.settingRowBody,children:[p(H,{style:y.settingRowBodyText,children:K==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":K==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":K==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":K==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),K==="asyncstorage"&&p(H,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),K==="memory"&&p(H,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(Ar,{}),j(N,{style:y.storageExpanded,children:[j(N,{style:y.storageExpandedHeader,children:[p(H,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(H,{style:y.storageExpandedCount,children:ze?"\u2026":`${ke.length} keys`})]}),ze?p(H,{style:y.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?p(H,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(Jt,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(c=>p(N,{style:y.storageKeyItem,children:p(H,{style:y.storageKeyText,numberOfLines:1,children:c.replace("@react_buoy_","")})},c))})]}),p(N,{style:y.cardButtonWrap,children:p(Lt,{label:ae?"Cleared":ne?"Clearing\u2026":"Clear All Settings",variant:ae?"secondary":"destructive",size:"md",disabled:ne,onPress:Re,icon:ae?p(Rn,{size:15,color:h.color.accent}):p(zr,{size:15,color:ne?h.color.textTertiary:h.color.danger})})})]})]})),E&&E.state!=="idle"&&V("Desktop Sync",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>U("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Buoy Desktop"})}),E.state==="connected"?p(fe,{label:"Connected",tone:"accent"}):E.state==="connecting"?p(fe,{label:"Connecting\u2026",tone:"neutral"}):p(fe,{label:"Retrying",tone:"warning"}),M.has("desktopSync")?p(Bn,{size:16,color:h.color.textTertiary}):p(Mn,{size:16,color:h.color.textTertiary})]}),M.has("desktopSync")&&j(N,{style:y.settingRowBody,children:[j(H,{style:y.settingRowBodyText,children:[E.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(H,{style:y.footnoteMono,children:E.targetURL??"(unknown URL)"}),E.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),E.state==="retrying"&&E.lastError&&j(H,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",E.lastError]})]})]})),V("Modal Behavior",p(Pe,{glass:true,children:j(Pt,{children:[G("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Jr(Ne.OS==="web")?G("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),w==="pro"&&j(Ye,{children:[V("License",j(Pe,{glass:true,children:[j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"License Status"})}),p(N,{testID:"buoy-settings-license-status",accessibilityLabel:W?"License: Active":"License: Free",children:W?p(fe,{label:"Active",tone:"accent"}):p(fe,{label:"Free",tone:"neutral"})})]}),Z?.tierSource==="session"?j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Lt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void kr(),testID:"buoy-settings-signout"})]}):null]}),p(En,{children:W?"You have full access to all Buoy DevTools features.":q?te?`Couldn't reach the license server (${q}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${q}.`:"Upgrade to Pro to unlock all features and support development."})),!W&&j(Ye,{children:[V("Pro Features",p(Pe,{glass:true,children:p(Pt,{children:["Advanced Settings","Priority Support"].map(c=>j(N,{style:y.featureRow,children:[p(Rn,{size:16,color:h.color.accent}),p(H,{style:y.rowLabel,children:c})]},c))})})),p(Lt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>T(true)})]})]})]}),p(Mr,{visible:v,onClose:()=>T(false)})]});return p(qr,{visible:e,onClose:t,zIndex:a,variant:"night",header:{showToggleButton:false,customContent:p(N,{style:y.headerRow,children:p(Er,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:c=>R(c)})})},initialMode:"bottomSheet",onModeChange:d,persistenceKey:Ft.settings.root(),enablePersistence:true,maxHeight:Se-J.top,initialHeight:Me,initialFloatingPosition:{x:(pe-$e)/2,y:J.top+20},enableGlitchEffects:true,children:me()})},ta={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},na=(e,t)=>{let n=new Set(e??[]),i=new Set(t??[]),o={};for(let a of i)o[a]=true;let r={environment:n.has("environment")};for(let a of n)a!=="environment"&&(r[a]=true);return{dialTools:vt(o),floatingTools:r,globalSettings:{enableSharedModalDimensions:false}}},Qe=null,$t=null,_n=null,Wn=(e,t)=>JSON.stringify(e)===JSON.stringify(t);bt.addListener(e=>{e&&(Qe=e)});var Hn=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Fn(),n=yt(()=>!e&&!t?ta:na(e,t),[e,t]),[i,o]=ie(n),r=ht(async()=>{try{let l=await De.getItem(Xe);if(l){let s=JSON.parse(l),u=Nn(n,s);o(u);return}o(n)}catch(l){console.error("Failed to load dev tools settings:",l),o(n)}},[n]);Ce(()=>Gr(l=>{l.includes(Xe)&&r()}),[r]),Ce(()=>{r();let l=bt.addListener(s=>{try{s&&o(s)}catch{}});return()=>{l()}},[r]);let a=ht(()=>{r()},[r]);return{settings:i,refreshSettings:a}},y=ct.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:h.gutter,paddingRight:h.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:h.gutter,paddingTop:8,paddingBottom:24,gap:h.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:h.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:h.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:h.color.text,fontSize:h.font.row,fontWeight:"500"},rowCaption:{color:h.color.textTertiary,fontSize:h.font.label},settingRowBody:{paddingHorizontal:h.rowPadH,paddingBottom:h.rowPadV,gap:6},settingRowBodyText:{color:h.color.textSecondary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},settingRowBodyHint:{color:h.color.textTertiary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},bodyWarning:{color:h.color.warning},bodyDanger:{color:h.color.danger},cardButtonWrap:{paddingHorizontal:h.cardPad,paddingTop:10,paddingBottom:h.cardPad},storageExpanded:{paddingHorizontal:h.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:h.color.textSecondary,fontSize:h.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:h.color.textTertiary,fontSize:h.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:h.color.glassElevated,borderRadius:h.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:h.color.textSecondary,fontSize:h.font.micro,fontFamily:On},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:On,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Un}from"react/jsx-runtime";var oa=[];function Kn({visible:e,onClose:t,availableTools:n=oa,defaultFloatingTools:i,defaultDialTools:o,storage:r=mr,onSettingsChange:a}){let l=zn(()=>({getItem:async m=>r.getItem(m),setItem:async(m,C)=>r.setItem(m,C)}),[r]),s=zn(()=>n.map(m=>({...m,name:m.name??m.id,icon:typeof m.icon=="function"?C=>m.icon(C.size):m.icon})),[n]),u=pr(m=>{a?.(m)},[a]);return Un(Ln,{defaultFloatingTools:i,defaultDialTools:o,children:Un(ea,{visible:e,onClose:t,zIndex:11e3,availableApps:s,storage:l,onSettingsChange:u})})}import{persistentStorage as Vn,setExpandableWindowControls as ia}from"@buoy-gg/shared-ui/web";import{createContext as ra,useCallback as Ie,useContext as aa,useEffect as St,useMemo as sa,useRef as Ze,useState as qn}from"react";var la=(e,t,n)=>{if(t.singleton){let o=e.find(r=>r.id===t.id);if(o){let r=o.minimized??false;return{instanceId:o.instanceId,wasMinimized:r,apps:[...e.filter(a=>a.instanceId!==o.instanceId),{...o,minimized:false}]}}}let i=n();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}};import{createContext as ca,useCallback as Gn,useContext as da,useEffect as wt,useMemo as ua,useRef as Jn,useState as xt}from"react";import{JsModal as pa,ModalHeader as et,HeaderSearchButton as ma,TickProvider as ga,ToolScreenHeaderContext as fa,devToolsStorageKeys as Yn,buoyColors as Xn,gameUIColors as jt}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as Ct}from"react/jsx-runtime";var tt=()=>{},ha={search:"",isSearchActive:false,clearSearch:tt,close:tt,minimize:tt,showToast:tt,setHeaderOverride:tt},Qn=ca(null);function Zn(){return da(Qn)??ha}function ya(e,t){let{setHeaderOverride:n}=Zn();wt(()=>(n(e),()=>n(null)),t)}var eo=2200,ba={success:jt.success,error:jt.error,info:jt.info};function va({message:e,type:t,nonce:n}){let i=Jn(new Ee.Value(0)).current;wt(()=>{i.setValue(0),Ee.sequence([Ee.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Ee.delay(eo-450),Ee.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[n,i]);let o=ba[t];return Ct(Ee.View,{pointerEvents:"none",style:[It.toast,{opacity:i,borderColor:o+"60"}],children:[le(N,{style:[It.toastDot,{backgroundColor:o}]}),le(H,{style:It.toastText,numberOfLines:2,children:e})]})}function Sa({app:e,config:t,visible:n,zIndex:i,onClose:o,onMinimize:r,initialModalState:a,enableSharedModalDimensions:l,bodyProps:s}){let u=e.component,[m,C]=xt(false),[g,B]=xt(""),[w,R]=xt(null),[z,A]=xt(null),M=Jn(null),k=Gn(()=>{C(false),B("")},[]),v=Gn((K,re="info")=>{M.current&&clearTimeout(M.current),A(ne=>({message:K,type:re,nonce:(ne?.nonce??0)+1})),M.current=setTimeout(()=>A(null),eo)},[]);wt(()=>()=>{M.current&&clearTimeout(M.current)},[]);let T=ua(()=>({search:m?g:"",isSearchActive:m,clearSearch:k,close:o,minimize:()=>r(),showToast:v,setHeaderOverride:R,instanceId:e.instanceId}),[g,m,k,o,r,v,e.instanceId]),P=w?.title??t.title??e.title??e.id,I=w?.subtitle??t.subtitle,E=w?.onBack,Z=w?.actions??t.headerActions,W=w?.searchable??t.searchable;wt(()=>{!W&&m&&k()},[W,m,k]);let q=l?Yn.modal.root():Yn.custom(e.id).modal(),te=Ct(et,{children:[E&&!m&&le(et.Navigation,{onBack:E}),m?le(et.Search,{value:g,onChangeText:B,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):le(et.Content,{title:P,subtitle:I}),Ct(et.Actions,{children:[!m&&Z,W&&!m&&le(ma,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>C(true)})]})]});return le(Qn.Provider,{value:T,children:le(pa,{visible:n,onClose:o,onBack:E,onMinimize:r,initialModalState:a,zIndex:i,persistenceKey:q,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:te,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Ct(N,{style:It.bodyRoot,children:[le(ga,{children:le(fa.Provider,{value:R,children:le(u,{...s})})}),z&&le(va,{message:z.message,type:z.type,nonce:z.nonce})]})})})}var It=ct.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:Xn.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:Xn.text}});import{useEffect as wa,useRef as xa}from"react";import{capacitorPlatform as Ca,capacitorPlugin as Ia}from"@buoy-gg/license/web";function Ta(){return globalThis.__BUOY_HOLDS_BACK__===true}var ka=99.5;function za(){if(typeof document>"u")return false;let e=globalThis.Ionic;if(!e&&!document.querySelector("ion-app"))return false;try{return e?.config?.get?.("hardwareBackButton",true)!==false}catch{return true}}function Ma(e,t){let n=xa(t);n.current=t,wa(()=>{if(!e||Ca()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let o;if(za()){let r=a=>{a.detail?.register?.(ka,()=>{n.current()})};document.addEventListener("ionBackButton",r),o=()=>document.removeEventListener("ionBackButton",r)}else{let r=Ia("App");if(!r?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let a=false,l=null;Promise.resolve(r.addListener("backButton",()=>n.current())).then(s=>{a?s.remove():l=s}).catch(()=>{}),o=()=>{a=true,l&&l.remove()}}return()=>{o(),i.__BUOY_HOLDS_BACK__=false}},[e])}import{Fragment as Ba,jsx as ce}from"react/jsx-runtime";var to=ra(null),no="@react_buoy_open_apps",Nt=44,Ra=12,Ea=100,Aa=16,Oa=e=>({x:window.innerWidth-Nt-Aa,y:window.innerHeight-Ea-Nt-e*(Nt+Ra)}),oo=({children:e})=>{let[t,n]=qn([]),[i,o]=qn(false),r=Ze([]),a=Ze(null),l=Ze(false),s=Ze(false),u=Ze(false),m=Ie(v=>{let T="";return n(P=>{let{apps:I,instanceId:E}=la(P,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return T=E,I}),T},[]),C=Ie(()=>{if(l.current||!s.current||!u.current)return;l.current=true;let v=a.current;if(!v||v.length===0){o(true);return}a.current=null,v.forEach(({id:T,minimized:P})=>{let I=r.current.find(E=>E.id===T);if(I&&I.component){let E=jn(I.icon,{slot:"dial",size:20,color:I.color});m({id:I.id,title:I.name,component:I.component,props:I.props,modal:I.modal,launchMode:I.launchMode||"self-modal",singleton:I.singleton??true,icon:E,color:I.color,minimized:P})}}),o(true)},[m]);St(()=>{let v=false;return(async()=>{try{let T=await Vn.getItem(no);if(v)return;if(T){let P=JSON.parse(T),I;Array.isArray(P)&&P.length>0&&(typeof P[0]=="string"?I=P.map(E=>({id:E,minimized:false})):I=P.filter(E=>typeof E=="object"&&E!==null&&typeof E.id=="string"),I.length&&(a.current=I))}}catch{}v||(s.current=true,C())})(),()=>{v=true}},[C]),St(()=>{if(!i)return;let v=t.map(T=>({id:T.id,minimized:T.minimized??false}));Vn.setItem(no,JSON.stringify(v))},[t,i]);let g=Ie(v=>{r.current=v,u.current=true,C()},[C]),B=Ie(v=>{n(T=>T.length?v?T.filter(P=>P.instanceId!==v):T.slice(0,-1):T)},[]),w=Ie(()=>n([]),[]),R=Ie((v,T)=>{n(P=>P.map(I=>I.instanceId===v?{...I,minimized:true,restoreState:T}:I))},[]),z=Ie((v,T)=>{n(P=>P.map(I=>I.instanceId===v?{...I,minimized:false,restoreState:T??I.restoreState}:I))},[]),A=Ie(v=>t.find(T=>T.instanceId===v)?.minimized??false,[t]),M=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);St(()=>{if(!M)return;let v=T=>{if(T.key!=="Escape"||T.defaultPrevented)return;let P=[...t].reverse().find(I=>I.launchMode!=="toggle-only"&&!I.minimized);P&&B(P.instanceId)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[M,B,t]),Ma(t.length>0,()=>B());let k=sa(()=>({openApps:t,isAnyOpen:M,open:m,close:B,closeAll:w,registerApps:g,minimize:R,restore:z,isMinimized:A}),[t,M,m,B,w,g,R,z,A]);return ce(to.Provider,{value:k,children:e})},nt=()=>{let e=aa(to);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},Da=9e3,Pa={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},La={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Fa=({app:e,zIndex:t,onClose:n,onMinimize:i,minimizeTargetPosition:o,enableSharedModalDimensions:r})=>{let a=e.component,l=!e.minimized,s={...e.props??{},...r?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(Sa,{app:e,config:e.modal,visible:l,zIndex:t,onClose:n,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:r,bodyProps:s})}):e.launchMode==="self-modal"?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,visible:l,onClose:n,onRequestClose:n,onMinimize:i,minimizeTargetPosition:o,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?l?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,onClose:n,onMinimize:i,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Pa,zIndex:t,display:l?"flex":"none"},children:ce("div",{style:La,children:ce(a,{...s,onClose:n,onMinimize:i,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})})})},io=()=>{let{openApps:e,close:t,minimize:n}=nt(),{settings:i}=Hn();St(()=>{ia(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let o=e.filter(l=>l.launchMode!=="toggle-only");if(o.length===0)return null;let r=o.filter(l=>l.minimized).length,a=Ii()??Oa(r);return ce(Ba,{children:o.map((l,s)=>ce(Fa,{app:l,zIndex:Da+s,onClose:()=>t(l.instanceId),onMinimize:u=>n(l.instanceId,u),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:a},l.instanceId))})};import{useCallback as $a,useEffect as _t,useRef as ja,useState as ro,useSyncExternalStore as ao}from"react";import{persistentStorage as so,getToolAttention as Wt,subscribeToolAttention as lo}from"@buoy-gg/shared-ui/web";import{jsx as de,jsxs as Tt}from"react/jsx-runtime";function Na(e){return ao(lo,()=>Wt(e),()=>Wt(e))}var co={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},uo={needsInput:3,failed:2,done:1},po=new Map;function mo(e){let t=null;for(let i of e?e.split("|"):[]){let o=Wt(i);o&&(!t||uo[o.kind]>uo[t.kind])&&(t=o)}let n=po.get(e);return n&&t&&n.kind===t.kind&&n.label===t.label?n:!n&&!t?null:(po.set(e,t),t)}function _a(e){let t=e.join("|");return ao(lo,()=>mo(t),()=>mo(t))}var go=28,Ht=32,Ut=6,fo=8,ho=24,yo="@react_buoy_minimized_stack_expanded",Wa=80,bo=2e3,Ha=6e3,Ua="#1A1A1A",ot="#888888";function vo({down:e=false}){return de("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:de("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:ot,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ka({id:e,title:t,icon:n,index:i,onPress:o}){let r=Na(e),a=ja(null);return _t(()=>{let l=true,s,u=()=>{a.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:Wa,easing:"linear"})},m=C=>{let g=C?500+Math.random()*1500+i*200:bo+Math.random()*(Ha-bo)+i*300;s=setTimeout(()=>{l&&(u(),m(false))},g)};return m(true),()=>{l=false,clearTimeout(s)}},[i]),Tt("button",{type:"button","aria-label":r?`${t} \u2014 ${r.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:o,style:{width:Ht,height:Ht,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[de("div",{ref:a,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n}),r?de("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${r.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:co[r.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:r.kind==="needsInput"?"!":""}):null]})}function Va({containerWidth:e=32}){let{openApps:t,restore:n}=nt(),i=t.filter(g=>g.minimized&&g.launchMode!=="toggle-only"),[o,r]=ro(false),[a,l]=ro(false),s=_a(i.map(g=>g.id));_t(()=>{let g=false;return(async()=>{let B=await so.getItem(yo);!g&&B==="true"&&r(true),g||l(true)})(),()=>{g=true}},[]),_t(()=>{a&&so.setItem(yo,o?"true":"false")},[o,a]);let u=$a(g=>{n(g)},[n]);if(i.length===0)return null;let m=fo+i.length*Ht+(i.length-1)*Ut+Ut+ho+4,C={backgroundColor:Ua,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${ot}66`,borderLeft:`1px solid ${ot}66`,borderRight:`1px solid ${ot}66`,borderBottom:"none",boxSizing:"border-box"};return Tt("div",{style:{height:go,overflow:"visible",position:"relative"},children:[de("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:o?"visible":"hidden",height:o?m:0,opacity:o?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:o?"auto":"none",...C},children:Tt("div",{style:{height:m,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:fo,gap:Ut,boxSizing:"border-box"},children:[o&&[...i].reverse().map((g,B)=>de(Ka,{id:g.id,title:g.title||g.id,icon:g.icon??de("span",{style:{color:"#fff",fontSize:13},children:(g.title||g.id).slice(0,1).toUpperCase()}),index:B,onPress:()=>u(g.instanceId)},g.instanceId)),de("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>r(false),style:{width:"100%",height:ho,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:de(vo,{down:true})})]})}),Tt("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:o?-1:0,"aria-hidden":o,onClick:()=>r(true),style:{position:"absolute",bottom:0,left:0,width:e,height:go,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:o?0:1,transform:o?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:o?"none":"auto",...C},children:[de(vo,{}),s?de("span",{"aria-hidden":true,"data-testid":"buoy-dock-peek-attention",style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:co[s.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:s.kind==="needsInput"?"!":""}):null,i.length>1&&de("span",{style:{fontSize:9,fontWeight:600,color:ot,marginLeft:1},children:i.length})]})]})}import{registerToolModules as qa}from"@buoy-gg/shared-ui/web";import{createElement as Ga}from"react";function it(e){let t=e.icon;return{...e,icon:typeof t=="function"?n=>Ga(t,{size:n,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Ja,useContext as Ya,useState as So,useMemo as wo}from"react";import{jsx as Xa}from"react/jsx-runtime";var xo=Ja(null);function Co({children:e}){let[t,n]=So(false),[i,o]=So(false),r=wo(()=>t||i,[t,i]),a=wo(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:r,setDialOpen:n,setToolOpen:o}),[t,i,r]);return Xa(xo.Provider,{value:a,children:e})}function Kt(){let e=Ya(xo);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as Qa from"@buoy-gg/license/web";import*as Za from"@buoy-gg/shared-ui/web";import*as es from"@buoy-gg/shared-ui/web/dataViewer";function Io(e){qa({core:{useDevToolsVisibility:Kt},license:Qa,"shared-ui":Za,"shared-ui/dataViewer":es,...e});let t=new Set;return Object.values(e).flatMap(n=>Object.entries(n).flatMap(([i,o])=>!i.endsWith("Preset")||!o||typeof o.id!="string"||!o.component||t.has(o.id)?[]:(t.add(o.id),[it(o)])))}import{useEffect as kt,useMemo as zt,useRef as ts}from"react";import{LicenseManager as ns,installCapacitorBridge as os,resolveDevBuild as To,useLicense as is}from"@buoy-gg/license/web";import{registerToolAdapters as rs}from"@buoy-gg/shared-ui/web";function ko(e){return typeof e=="object"&&e!==null?e:void 0}function as({isDevelopment:e,isLicensed:t,externalSync:n,isAvailable:i}){if(n===false||!i)return false;if(e)return true;let o=ko(n);return t&&o?.enableInRelease===true&&Mo(o.socketURL,o)===null}var zo="http://localhost:42831";function ss(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function Mo(e,t){let n=e??zo;if(t?.allowInsecureNetwork===true)return null;let i;try{i=new URL(n)}catch{return`[Buoy] externalSync.socketURL "${n}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return i.protocol==="https:"||i.protocol==="wss:"||ss(i.hostname)?null:`[Buoy] This release build won't connect to ${n}: release sync carries real user data, and plain http to another machine is readable by anyone on the same network. Use a simulator, an emulator or adb reverse (localhost), an https:// broker, or set externalSync.allowInsecureNetwork: true for a network you trust.`}var ls={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function cs(e,t,n){if(t)return e;let i=null;for(let[o,r]of Object.entries(ls)){if(n?.includes(o))continue;let a=e[o];if(!a?.actions)continue;let l={...a.actions};for(let s of r)s in l&&(l[s]=()=>{throw new Error(`${o}.${s} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${o}"] }}.`)});i??(i={...e}),i[o]={...a,actions:l}}return i??e}import{useEffect as ds,useMemo as us,useState as ps}from"react";import{devToolsStorageKeys as ms,persistentStorage as gs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as fs}from"@buoy-gg/license/web";var hs=8;function ys(){let e="";for(;e.length<hs;)e+=(Math.random()*16|0).toString(16);return e}function bs(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function vs({appName:e,hardwareName:t,platform:n,installId:i,deviceId:o}){let r=bs(e??"buoy")||"buoy",a=e??"Buoy Device",l=t?.trim()||n;return o?{deviceId:o,deviceName:`${a} (${l})`}:{deviceId:`${r}-${n}-${i}`,deviceName:`${a} (${l} \xB7 ${i.slice(-4)})`}}function Ss(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}function ws(){let e=globalThis;try{return e.localStorage??null}catch{return null}}async function xs({platform:e=Ne.OS,store:t,mint:n=ys}={}){let i=ms.sync.deviceId(),o=t===void 0?fs()?ws():e==="web"?Ss():gs:t;if(!o)return n();try{let r=await o.getItem(i);if(r&&r.length>0)return r;let a=n();return await o.setItem(i,a),a}catch{return n()}}var Vt=null;function Cs(){return Vt||(Vt=xs()),Vt}function Is(e,t){let n=e?.deviceId,i=e?.deviceName,o=t.loadId??Cs,r=t.platform??Ne.OS,[a,l]=ps(null);return ds(()=>{if(n)return;let s=false;return o().then(u=>{s||l(u)}),()=>{s=true}},[n,o]),us(()=>{if(!n&&!a)return null;let s=vs({appName:t.appName,hardwareName:t.hardwareName,platform:r,installId:a??"",deviceId:n});return i?{...s,deviceName:i}:s},[n,i,a,t.appName,t.hardwareName,r])}import{useEffect as Ts,useState as ks}from"react";import{capacitorPlatform as zs,capacitorPlugin as Mt,isCapacitorNative as Ms}from"@buoy-gg/license/web";function Bs(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let n=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!n||n==="K"?null:n}function Rs(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function Bo(){return typeof navigator>"u"?"":navigator.userAgent??""}function qt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}var Ro="@react_buoy_capacitor_app_name";function Es(e){try{let t=globalThis.localStorage;if(!t)return e;let n=t.getItem(Ro);if(n)return n;e&&t.setItem(Ro,e)}catch{}return e}function As(){let e=zs();if(!e)return{platform:"web",appName:qt(),hardwareName:"Browser",ready:true};let t=!!Mt("App");return{platform:e,appName:t?qt():Es(qt()),hardwareName:Bs(Bo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Mt("Device")}}function Os(){let[e,t]=ks(As);return Ts(()=>{if(!Ms())return;let n=false,i=Mt("App"),o=Mt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([r,a])=>{if(n)return;let l=r?.name?.trim(),s=a?.name?.trim()||a?.model?.trim();t(u=>({...u,appName:l||u.appName,hardwareName:s||u.hardwareName,ready:true}))}),()=>{n=true}},[]),e}function Eo(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:Bo(),serverUrl:typeof e=="string"?e:null}}function Ao(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function Ds(e,t){if(e==="ios"){let n=Ao(t.serverUrl);return n?n===Ao(t.origin):t.protocol==="capacitor:"}return Oo.has(t.hostname)}var Oo=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Ps(e,t,n,i=Eo()){if(n==="web"||!i)return e;let o;try{o=new URL(e)}catch{return e}let r=Ds(n,i);return!t&&r&&o.hostname===i.hostname&&(o.hostname="localhost"),n==="android"&&Oo.has(o.hostname)&&Rs(i.userAgent)&&(o.hostname="10.0.2.2"),o.toString().replace(/\/$/,"")}function Ls(e,t,n=Eo()){return t!=="android"||!n||n.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${n.hostname} and blocks plain http/ws by default. For debug builds, set android.allowMixedContent: true and server.cleartext: true in capacitor.config, then run cap sync.`}import{getDevServerOrigin as Fs,resolveReloadStrategy as $s,scheduleReloadApp as js}from"@buoy-gg/shared-ui/web";var Do=Date.now(),Po=Fs(),Ns={platform:Ne.OS,isTV:Ne.isTV===true,isTVOS:Ne.isTVOS===true},Lo={version:3,getSnapshot:()=>{let e=$s("auto");return{startedAt:Do,devServerOrigin:Po,device:Ns,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:Do,devServerOrigin:Po}),reloadApp:e=>{let t=e??{},{strategy:n,delayMs:i}=js({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:n,delayMs:i}}}};import{Fragment as _s,jsx as Le,jsxs as Ws}from"react/jsx-runtime";var Hs=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],Us=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Ks(e){let t=zt(()=>Object.fromEntries(Object.entries(e.modules).map(([i,o])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),o])),[e.modules]),n=t["react-query"];return n?.useReactQuerySyncAdapter?Le(Vs,{...e,modules:t,query:n}):Le(Fo,{...e,modules:t})}function Vs(e){let t=e.query.useReactQuerySyncAdapter();return Le(Fo,{...e,queryAdapter:t})}function Fo({modules:e,apps:t,requiredEnvVars:n,externalSync:i,headless:o,sentryGetClient:r,queryAdapter:a}){let{isPro:l,tier:s}=is(),u=zt(()=>{let z={app:Lo};for(let[A,M]of Object.entries(e))for(let[k,v]of Object.entries(M))k.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(z[A]=v);a&&(z.query=a),e.env?.createEnvSyncAdapter&&(z.env=e.env.createEnvSyncAdapter(n??[]));for(let A of t??[])A.sync&&(z[`custom:${A.id}`]=A.sync);return z},[e,t,n,a]),m=ts(u);m.current=u,kt(()=>rs(()=>m.current),[]),kt(()=>{let z=[],A=M=>{let k=M?.();typeof k=="function"&&z.push(k)};return A(e.network?.startNetworkCapture),A(e.storage?.startBrowserStorageCapture),A(e.assets?.startBrowserAssetCapture),To(typeof _e<"u"?_e:process.env.NODE_ENV!=="production")&&A(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&A(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&A(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let M of z.reverse())M()}},[e]);let C=e["external-sync"],g=To(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),B=as({isDevelopment:g,isLicensed:l,externalSync:i,isAvailable:!!C}),w=ko(i);os({release:!g&&!!w?.enableInRelease}),!g&&w?.enableInRelease&&jo(Mo(w.socketURL,w));let R=e.sentry?.SentryRoot;return Ws(_s,{children:[Object.entries(e).flatMap(([z,A])=>Hs.map(M=>{let k=A[M];return k?Le(k,{},`${z}:${M}`):null})),R&&Le(R,{getClient:r}),Object.entries(e).flatMap(([z,A])=>Us.map(M=>{let k=A[M];return k&&(!o||M==="ScenariosOverlay"||M==="ImpersonateOverlay")?Le(k,{},`${z}:${M}`):null})),B&&Le(qs,{module:C,tools:u,options:w,isPro:l,tier:s,dev:g})]})}var $o=null;function jo(e){!e||e===$o||($o=e,console.warn(e))}function qs({module:e,tools:t,options:n,isPro:i,tier:o,dev:r}){let a=Os(),l=Is(n,{appName:a.appName,hardwareName:a.hardwareName,platform:a.platform}),s=zt(()=>Ps(n?.socketURL??(r?e.getDefaultSocketURL():zo),!!n?.socketURL,a.platform),[n?.socketURL,r,e,a.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:l?.deviceName??"Buoy Browser",socketURL:s,persistentDeviceId:a.ready?l?.deviceId??null:null,platform:a.platform,extraDeviceInfo:a.extraDeviceInfo,enableLogs:n?.enableLogs});kt(()=>{let g=Ls(s,a.platform);if(!u||!g)return;let B=()=>jo(g);return u.on("connect_error",B),()=>{u.off("connect_error",B)}},[u,s,a.platform]),kt(()=>{if(!u)return;let g=()=>{u.connected&&ns.hasAccountAccess()&&u.emit("device-license",{isPro:i?"1":"0",tier:o})};return g(),u.on("connect",g),()=>{u.off("connect",g)}},[u,i,o]);let m=n?.releaseActions?.join(",")??"",C=zt(()=>cs(t,r,m?m.split(","):void 0),[t,r,m]);return e.useExternalSync({tools:C,socket:u,deviceId:a.ready?l?.deviceId??null:null,enableLogs:n?.enableLogs}),null}import{useState as No}from"react";import{createPortal as Gs}from"react-dom";import{useBuoySession as Js}from"@buoy-gg/license/web";import{Fragment as _o,jsx as rt,jsxs as Wo}from"react/jsx-runtime";var Ho="#20C997";function Ys(){let{status:e,signIn:t,signOut:n}=Js(),[i,o]=No(false),[r,a]=No(null);if(typeof document>"u")return null;let l=()=>{a(null),o(true),t().catch(u=>a(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>o(false))},s=e.state==="active";return Gs(rt("div",{"data-buoy-signin":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,maxWidth:"min(320px, calc(100vw - 32px))",padding:s||r?"12px 14px":0,borderRadius:16,background:s||r?"#0f1419":"transparent",color:"#e6edf3",boxShadow:s||r?"0 10px 30px rgba(0,0,0,.35)":"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:14,lineHeight:1.45},children:s?Wo(_o,{children:[rt("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),rt("button",{type:"button",onClick:()=>void n(),style:Xs,"data-testid":"buoy-signout",children:"Sign out"})]}):Wo(_o,{children:[r?rt("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:r}):null,rt("button",{type:"button",onClick:l,disabled:i,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Ho,color:"#04130d",fontWeight:600,fontSize:14,cursor:i?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:i?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var Xs={marginTop:8,padding:0,border:"none",background:"none",color:Ho,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as Qs}from"react";import{AccountSetupButton as Zs,BuoyNeedsPlanCard as el,BuoySignInCard as tl,useSignInState as nl}from"@buoy-gg/shared-ui/web";import{jsx as at,jsxs as Uo}from"react/jsx-runtime";function Ko({needsPlan:e=false}){let[t,n]=Qs(false),i=nl();return Uo(N,{pointerEvents:"box-none",style:Vo.root,children:[at(Zs,{expanded:t,onPress:()=>n(true)}),t?at(Qo,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>n(false),children:Uo(N,{style:Vo.overlay,accessibilityViewIsModal:true,children:[at(Xo,{style:ct.absoluteFill,onPress:()=>n(false),accessible:false}),e&&i==="active"?at(el,{onClose:()=>n(false)}):at(tl,{onClose:()=>n(false)})]})}):null]})}var Vo=ct.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20}});function qo(e){if(e.length>6){let t=e.map(n=>`"${n}"`).join(", ");return e.slice(0,6)}return e}import{installedTools as ol,installedToolsFound as il}from"@buoy-gg/core/web/installed-tools";import{Fragment as Gt,jsx as F,jsxs as st}from"react/jsx-runtime";var Go={},Jo="@react_buoy_floating_menu_tooltip_shown",rl=Ae;function al({size:e=14,color:t="#20C997"}){let n=Math.max(2,e/4),i=Math.max(1,e/16);return F("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${n}px)`,gap:i,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((o,r)=>F("div",{style:{width:n,height:n,borderRadius:n/2,backgroundColor:t}},r))})}function sl(e){let{defaultFloatingTools:t,defaultDialTools:n,disableHints:i=false,children:o}=e,r=ge(()=>n&&qo(n),[n]);return F(Ln,{defaultFloatingTools:t,defaultDialTools:r,children:F(ui,{disableHints:i,children:st(Co,{children:[F(oo,{children:F(ml,{...e})}),o]})})})}var ll=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function cl({modules:e=Go}){return F(Gt,{children:Object.entries(e).flatMap(([t,n])=>ll.map(i=>{let o=n[i];return o?F(o,{},`${t}:${i}`):null}))})}function dl(){let{openApps:e,restore:t}=nt();return ee(()=>mi(n=>{let i=e.find(o=>o.id===n);return i?(t(i.instanceId),true):false}),[e,t]),null}function ul(){let e=si();return pi((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}function pl(e,t,n,i){let o=m=>Object.entries(e).find(([C])=>C.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===m)?.[1],r=[],a=o("env");t?.length&&a?.createEnvTool&&a.createEnvVarConfig&&r.push(it(a.createEnvTool({requiredEnvVars:a.createEnvVarConfig(t)})));let l=o("storage");n?.length&&l?.createStorageTool&&r.push(it(l.createStorageTool({requiredStorageKeys:n})));let s=o("ask-buoy"),u=i==="hosted"?s?.hostedAskBuoy?.():i;return u&&s?.createAskBuoyTool&&r.push(it(s.createAskBuoyTool(u))),r}function ml({environment:e,userRole:t="admin",availableEnvironments:n,onEnvironmentSwitch:i,apps:o,modules:r=Go,externalSync:a,requiredEnvVars:l,sentryGetClient:s,disableHints:u=false,headless:m=false,hidden:C=false,defaultFloatingTools:g,defaultDialTools:B,zustandStores:w,requiredStorageKeys:R,askBuoy:z}){let A=e??ul(),M=ge(()=>B?qo(B):void 0,[B]),[k,v]=Bt(false),[T,P]=Bt(false),I=fi(false),E=nt(),Z=ge(()=>pl(r,l,R,z),[r,l,R,z]),W=ge(()=>Zt([...Io(r),...o??[],...Z]),[o,r,Z]),q=ge(()=>Object.entries(r).find(([d])=>d.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[r]);ee(()=>{if(!w||typeof q?.watchStores!="function")return;let d=q.watchStores(w);return typeof d=="function"?d:void 0},[w,q]);let te=Kt(),K=E.openApps.some(d=>!d.minimized);ee(()=>{te.setDialOpen(k)},[k,te.setDialOpen]),ee(()=>{te.setToolOpen(K||T)},[K,T,te.setToolOpen]);let{registerApps:re}=E;ee(()=>{re(W.map(d=>{let _=d.icon;return{...d,icon:typeof _=="function"?({size:b})=>_(b):_}}))},[re,W]);let ne=ge(()=>W.map(d=>({id:d.id,name:d.name,description:d.description,slot:d.slot})),[W]);hi({availableTools:ne,storage:rl}),ee(()=>{let d=false;return(async()=>{let[_,b]=await Promise.all([Ae.getItem(ut.dial.isOpen()),Ae.getItem(ut.settings.modalOpen())]);d||(_==="true"&&v(true),b==="true"&&(v(true),P(true)),I.current=true)})(),()=>{d=true}},[]),ee(()=>{I.current&&Ae.setItem(ut.dial.isOpen(),k?"true":"false")},[k]),ee(()=>{I.current&&Ae.setItem(ut.settings.modalOpen(),T?"true":"false")},[T]);let ve=We(d=>{if(ur(d.id),d.launchMode==="toggle-only"){d.onPress?.();return}if(d.component){let _=typeof d.icon=="function"?d.icon(20):d.icon;E.open({id:d.id,title:d.name||dt(d.id),component:d.component,props:d.props,modal:d.modal,launchMode:d.launchMode||"self-modal",singleton:d.singleton??true,icon:_,color:d.color||Qt(d.id)})}else d.onPress?.()},[E]),ae=ge(()=>Rt(W,"dial").map(d=>{let _=d.color||Qt(d.id),b;return typeof d.icon=="string"?b=d.icon:typeof d.icon=="function"?b=d.icon(32):b=null,{id:d.id,name:d.name||dt(d.id),icon:b,unavailable:!d.component&&!d.onPress,color:_,onPress:()=>{ve(d),v(false)}}}),[W,ve]),Te=ge(()=>{if(!k)return ae;let d=new Map(ae.map(_=>[_.id,_]));return dr(ae.map(_=>_.id)).map(_=>d.get(_)).filter(_=>!!_)},[k,ae]),{settings:$}=Hn(),qe=ge(()=>Rt(W,"row").filter(d=>($.floatingTools[d.id]??false)===true&&(d.component||d.onPress)),[W,$.floatingTools]),ke=ge(()=>W.map(d=>({id:d.id,name:d.name||dt(d.id),description:d.description||yi(d.id),slot:d.slot,icon:d.icon,color:d.color})),[W]),[Fe,ze]=Bt(false),se=E.openApps.some(d=>!d.minimized);ee(()=>{if(u)return;let d=false,_=setTimeout(async()=>{let b=await Ae.getItem(Jo);!d&&!b&&ze(true)},1e3);return()=>{d=true,clearTimeout(_)}},[u]);let J=We(()=>{ze(false),Ae.setItem(Jo,"true")},[]),Se=We(()=>{J(),v(true)},[J]),pe=We(()=>{v(false),P(false)},[]),Me=We(()=>{P(d=>!d)},[]),$e=We(()=>P(false),[]),he=!!(n?.length&&i),Be=$.floatingTools.environment!==false,ue=Fe&&!k&&!se&&!C;ee(()=>{if(!ue)return;let d=b=>{(!(b.target instanceof Element)||!b.target.closest("[data-buoy-root]"))&&J()},_=b=>{b.key==="Escape"&&J()};return document.addEventListener("pointerdown",d,true),document.addEventListener("keydown",_),()=>{document.removeEventListener("pointerdown",d,true),document.removeEventListener("keydown",_)}},[ue,J]);let ye=E.openApps.some(d=>d.minimized&&d.launchMode!=="toggle-only"),Re=F(Ks,{modules:r,apps:o,requiredEnvVars:l,externalSync:a,headless:m,sentryGetClient:s});return m?Re:st("div",{"data-buoy-root":"",style:{display:"contents"},children:[Re,F(dl,{}),ue&&F("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),F("div",{style:C?{visibility:"hidden"}:{display:"contents"},"aria-hidden":C||void 0,children:st(en,{enablePositionPersistence:!ue,pushToSide:k||se,suspendPointerEvents:k,centerOnboarding:ue,minimizedStack:ye?F(Va,{}):void 0,hasMinimizedStack:ye,children:[A&&Be&&!he&&F(bi,{environment:A}),he&&Be&&F(vi,{currentEnvironment:A??"local",availableEnvironments:n,onSelect:i}),t?F(tn,{userRole:t,onPress:Se}):F("button",{"aria-label":"Open dev tools",onClick:Se,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:F(al,{})}),qe.map(d=>F("button",{"aria-label":d.name||dt(d.id),title:d.description,onClick:()=>ve(d),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof d.icon=="function"?d.icon(16):d.icon},d.id))]})}),ue&&F(yn,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:J}),k&&!C&&F(xn,{icons:Te,onClose:pe,centerLabel:"BUOY",onCenterPress:Me,settingsOpen:T,hintsDisabled:u}),T&&!C&&F(Kn,{visible:true,onClose:$e,availableTools:ke,defaultFloatingTools:g,defaultDialTools:M,onSettingsChange:d=>{}}),!C&&st(Gt,{children:[F(io,{}),F(ti,{})]})]})}function gl(e){let t=e&&typeof e=="object"?e.appId:void 0,n=!!e;ee(()=>{if(!n)return;let i=false,o=ni.SessionManager;if(!o)return;let r=a=>{i||!a||(o.configure({audience:`app:${a}`}),o.load().catch(()=>{}))};return t?r(t):ci().then(a=>r(a?.bundleId)).catch(()=>{}),()=>{i=true}},[n,t])}var Yo=false;function fl(e){return e.modules?e:(!il&&!Yo&&typeof console<"u"&&(Yo=true,console.info("[Buoy] No tools loaded. Add buoy() from '@buoy-gg/core/vite' to your Vite plugins, or pass modules to FloatingDevTools.")),{...e,modules:ol})}function hl(e){let t=fl(e),{access:n,isPro:i,licenseKey:o}=ii();ee(()=>{oi.configure(t.licenseKey)},[t.licenseKey]);let r=t.licenseKey===void 0||ri(t.licenseKey,o),a=ai(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),l=r&&n.status==="admitted";ee(()=>{l&&gi()},[l]),ee(()=>{a||n.status==="initializing"||(i&&l?Zo():ei())},[a,i,l,n.status]);let s=li();return gl(s?t.signIn:void 0),!a&&!i?!t.signIn||t.headless?null:s?F(Ko,{needsPlan:true}):F(Ys,{}):l?F(sl,{...t}):st(Gt,{children:[n.status==="initializing"&&F(cl,{modules:t.modules}),t.headless?null:t.signIn&&s?F(Ko,{}):F(di,{})]})}export{Si as a,wi as b,Zt as c,Rt as d,xi as e,en as f,Ci as g,tn as h,xn as i,Kn as j,Zn as k,ya as l,Ta as m,oo as n,nt as o,io as p,it as q,Co as r,Kt as s,Io as t,Lo as u,hl as v};
@@ -0,0 +1 @@
1
+ "use client";import{b as k,c as E}from"./chunk-CLXYMJTS.mjs";var m={};k(m,{AccessibilityInfo:()=>I,ActivityIndicator:()=>ye,Alert:()=>Se,Animated:()=>b,AppRegistry:()=>V,AppState:()=>P,Appearance:()=>L,BackHandler:()=>M,Button:()=>ve,CheckBox:()=>_,Clipboard:()=>N,DeviceEventEmitter:()=>ce,Dimensions:()=>x,Easing:()=>R,FlatList:()=>q,I18nManager:()=>D,Image:()=>G,ImageBackground:()=>J,InteractionManager:()=>H,Keyboard:()=>F,KeyboardAvoidingView:()=>Q,LayoutAnimation:()=>K,Linking:()=>O,LogBox:()=>le,Modal:()=>A,NativeEventEmitter:()=>W,NativeModules:()=>B,PanResponder:()=>$,Picker:()=>X,PixelRatio:()=>j,Platform:()=>h,Pressable:()=>w,ProgressBar:()=>Z,RefreshControl:()=>ee,SafeAreaView:()=>ae,ScrollView:()=>S,SectionList:()=>te,Share:()=>z,StatusBar:()=>ie,StyleSheet:()=>f,Switch:()=>ge,Text:()=>y,TextInput:()=>xe,Touchable:()=>oe,TouchableHighlight:()=>he,TouchableNativeFeedback:()=>se,TouchableOpacity:()=>v,TouchableWithoutFeedback:()=>fe,UIManager:()=>U,Vibration:()=>Y,View:()=>g,VirtualizedList:()=>ne,YellowBox:()=>re,findNodeHandle:()=>we,unstable_createElement:()=>C,useColorScheme:()=>de,useLocaleContext:()=>pe,useWindowDimensions:()=>ue});E(m,T);import*as T from"react-native-web";import{unstable_createElement as C,NativeModules as B,AccessibilityInfo as I,Animated as b,Appearance as L,AppRegistry as V,AppState as P,BackHandler as M,Clipboard as N,Dimensions as x,Easing as R,I18nManager as D,Keyboard as F,InteractionManager as H,LayoutAnimation as K,Linking as O,NativeEventEmitter as W,PanResponder as $,PixelRatio as j,Platform as h,Share as z,StyleSheet as f,UIManager as U,Vibration as Y,CheckBox as _,FlatList as q,Image as G,ImageBackground as J,KeyboardAvoidingView as Q,Picker as X,ProgressBar as Z,RefreshControl as ee,SafeAreaView as ae,SectionList as te,StatusBar as ie,Touchable as oe,TouchableNativeFeedback as se,VirtualizedList as ne,YellowBox as re,LogBox as le,DeviceEventEmitter as ce,useColorScheme as de,useLocaleContext as pe,useWindowDimensions as ue}from"react-native-web";import*as a from"react-native-web";import{createElement as me,forwardRef as be}from"react";function i(s){let r=be((u,e)=>{let{accessibilityState:l,accessibilityValue:c,...n}=u;for(let o of["busy","checked","disabled","expanded","selected"])l?.[o]!==void 0&&n[`aria-${o}`]===void 0&&(n[`aria-${o}`]=l[o]);for(let[o,t]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[o]!==void 0&&n[`aria-${t}`]===void 0&&(n[`aria-${t}`]=c[o]);return me(s,{...n,ref:e})}),d=s.State;return d&&Object.assign(r,{State:d}),r.displayName=s.displayName??s.name??"NativeWebView",r}var g=i(a.View),y=i(a.Text),xe=i(a.TextInput),v=i(a.TouchableOpacity),he=i(a.TouchableHighlight),fe=i(a.TouchableWithoutFeedback),w=i(a.Pressable),S=i(a.ScrollView),A=i(a.Modal),ge=i(a.Switch),ye=i(a.ActivityIndicator),ve=i(a.Button),we=a.findNodeHandle,Se={alert(s,r,d,u){if(typeof document>"u")return;let e=document.createElement("dialog");e.dataset.buoyRoot="",e.setAttribute("aria-label",s),e.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 l=document.createElement("h2");if(l.textContent=s,l.style.cssText="font-size:18px;margin:0 0 12px",e.appendChild(l),r){let t=document.createElement("p");t.textContent=r,t.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",e.appendChild(t)}let c=document.createElement("div");c.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let n=d?.length?d:[{text:"OK"}],o=()=>{e.close?.(),e.remove()};for(let t of n){let p=document.createElement("button");p.type="button",p.textContent=t.text??"OK",p.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${t.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,p.onclick=()=>{o(),t.onPress?.()},c.appendChild(p)}e.addEventListener("cancel",t=>{t.preventDefault(),u?.cancelable!==false&&(o(),u?.onDismiss?.())}),e.appendChild(c),document.body.appendChild(e),e.showModal?e.showModal():e.setAttribute("open","")}};export{g as a,y as b,v as c,w as d,S as e,A as f,m as g,b as h,x as i,h as j,f as k};
@@ -0,0 +1,10 @@
1
+ "use client";import{a as N,b as H,c as lt,d as Xo,e as Jt,f as Qo,g as bl,h as Ae,i as Yt,j as Ne,k as ct}from"./chunk-7G3P7Z7K.mjs";import{b as Zo,c as er}from"./chunk-5SGL6QL4.mjs";import{a as Xt,d as _e}from"./chunk-CLXYMJTS.mjs";import{FloatingToolHost as tr}from"@buoy-gg/shared-ui/web/floating";import*as nr from"@buoy-gg/license/web";import{LicenseManager as or,useLicense as rr,sameLicenseKey as ir,resolveDevBuild as ar,capacitorDebug as sr,isCapacitorNative as lr,loadCapacitorAppHost as cr}from"@buoy-gg/license/web";import{AccountSetup as dr,HintsProvider as ur,normalizeEnvironment as pr,registerToolOpener as fr,startSettingsSync as mr}from"@buoy-gg/shared-ui/web";import{useState as Mt,useMemo as me,useCallback as We,useEffect as ee,useRef as gr}from"react";import{useSettings as hr,getToolLabel as dt,getToolDescription as yr,getToolColor as Qt}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Ee,devToolsStorageKeys as ut,EnvironmentIndicator as br,EnvironmentSelectorInline as vr}from"@buoy-gg/shared-ui/web";var Sr=[];function wr(){return[]}function Zt(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}function Bt(e,t){return e.filter(n=>{let r=n.slot||"both";return r==="both"||r===t})}function xr(e,t){let n=t instanceof Set?t:new Set(t);return e.filter(r=>n.has(r.id))}import{FloatingTool as en,FloatingToolDivider as Tr,FloatingToolUserStatus as tn,getBubbleAnchorPosition as Cr}from"@buoy-gg/shared-ui/web/floating";import{useState as Q,useEffect as Oe,useMemo as pt,useRef as ft,useCallback as mt}from"react";var nn={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock",permissions:"Permissions","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};function Ir(e,t){return e&&nn[e]?nn[e]:t}import{getDialLayout as kr,getAllIconPositions as zr,getGridLineRotations as Rr,getIconStaggerInputRange as Mr,MAX_DIAL_SLOTS as Ge,DIAL_ICON_SIZE as Br,dialAnimationConfig as on,getDialCSSKeyframesString as Ar,getDialCSSAnimationStyles as Er,dialColors as L,dialStyles as S,withAlpha as rn,floatingToolsColors as Or}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as an,monoFont as sn,ToolBackground as Dr,useToolBackground as Pr}from"@buoy-gg/shared-ui/web";import{memo as Lr}from"react";import{RasterLayer as Fr,scatter as $r,useLoop as jr,withBgAlpha as Nr}from"@buoy-gg/shared-ui/web";import{Fragment as _r,jsx as Je}from"react/jsx-runtime";var Wr=.94,Hr=6,Ur=2400,gt=3,ln=16,Kr=Array.from({length:gt},(e,t)=>$r(22343^t*40503,ln*4)),cn=["#FFFFFF","#B3D9FF","#8CB3FF"],dn=Math.PI/3,un=14*Math.PI/180;function Vr(e){let t=Math.min(5,Math.floor(e*6)),n=e*6-t;return t*dn+un/2+n*(dn-un)}function qr(e){return Math.min(Hr,1/(1-e*Wr))}function Gr(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}function Jr(e){let t=e/gt,n=[],r=12;for(let s=0;s<=r;s++)n.push(s/r);let o=(1-t)%1;o>.001&&o<1-.001&&n.push(o-1e-4,o+1e-4),n.sort((s,u)=>s-u);let i=[],a=[],l=[];for(let s of n){let u=t===0&&s===1?1:(s+t)%1;i.push(s),a.push(qr(u)),l.push(Gr(u))}return{input:i,scale:a,opacity:l}}var Yr=Array.from({length:gt},(e,t)=>Jr(t)),Xr=Lr(function({size:e}){let t=jr(Ur),n=e/2,r=[];for(let o=0;o<gt;o++){let i=Kr[o],a=Yr[o],l=[];for(let s=0;s<ln;s++){let u=Vr(i[s*4]),f=(.15+.85*Math.sqrt(i[s*4+1]))*.5*n,I=cn[Math.floor(i[s*4+3]*cn.length)%3],m=n+Math.cos(u)*f,M=n+Math.sin(u)*f,w=.6,B=w*2.4;l.push(Je(N,{style:{position:"absolute",left:m-B/2,top:M-B/2,width:B,height:B,borderRadius:B/2,backgroundColor:Nr(I,.3)}},`${s}-h`),Je(N,{style:{position:"absolute",left:m-w/2,top:M-w/2,width:w,height:w,borderRadius:w/2,backgroundColor:I}},s))}r.push(Je(Ae.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:a.input,outputRange:a.opacity}),transform:[{scale:t.interpolate({inputRange:a.input,outputRange:a.scale})}]},pointerEvents:"none",children:Je(Fr,{style:{width:e,height:e},raster:false,children:l})},o))}return Je(_r,{children:r})});import{useEffect as Qr,useState as pn}from"react";import{dialColors as He,withAlpha as fn}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Zr,ARROW_HEIGHT as ei,SPACING_GAP as Fl,getScreenCenterY as $l,calculateTooltipPosition as ti,calculateTargetPosition as jl}from"@buoy-gg/shared-ui/web/floating";import{monoFont as mn}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as gn}from"react/jsx-runtime";var hn=false;function ni(){if(hn||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
2
+ @keyframes buoyOnboardPulse {
3
+ 0%, 100% { transform: scale(1); }
4
+ 50% { transform: scale(1.02); }
5
+ }
6
+ @keyframes buoyOnboardArrowBounce {
7
+ 0%, 100% { transform: translateY(0); }
8
+ 50% { transform: translateY(-8px); }
9
+ }
10
+ `,document.head.appendChild(e),hn=true}var At=He.accent;function yn({title:e,message:t,onDismiss:n,showArrow:r=true}){let[o,i]=pn(false),[a,l]=pn(false);Qr(()=>{ni();let u=requestAnimationFrame(()=>i(true));return()=>cancelAnimationFrame(u)},[]);let s={fontFamily:mn,textTransform:"uppercase"};return Ue("div",{style:{position:"fixed",left:"50%",bottom:ti(),transform:`translateX(-50%) scale(${o?1:.8})`,opacity:o?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:gn("div",{style:{position:"relative",animation:o?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ue("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),gn("div",{style:{position:"relative",maxWidth:280,backgroundColor:He.dialBackground,borderRadius:16,border:`1px solid ${He.dialBorder}`,padding:20,boxShadow:`0 0 20px ${fn(He.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ue("span",{style:{...s,fontSize:16,fontWeight:900,letterSpacing:1,color:At,textAlign:"center"},children:e}),Ue("span",{style:{fontFamily:mn,fontSize:13,lineHeight:"20px",color:He.centerText,textAlign:"center"},children:t}),Ue("button",{onClick:n,onPointerDown:()=>l(true),onPointerUp:()=>l(false),onPointerLeave:()=>l(false),onPointerCancel:()=>l(false),style:{...s,marginTop:8,borderRadius:8,border:"none",backgroundColor:At,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:a?.7:1,transform:a?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),r&&Ue("div",{style:{position:"absolute",left:"50%",bottom:Zr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${ei}px solid ${At}`,filter:`drop-shadow(0 0 10px ${fn(He.dialShadow,.5)})`,animation:o?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as oi,jsx as D,jsxs as be}from"react/jsx-runtime";var ri={x:.5,y:.5},bn="@react_buoy_settings_tooltip_shown",vn=false;function ii(){if(vn||typeof document>"u")return;let e=document.createElement("style");e.textContent=Ar(),document.head.appendChild(e),vn=true}var Ke=e=>1-Math.pow(1-e,3),Et=e=>e*e*e;function ai({icon:e,index:t,totalIcons:n,position:r,progress:o,onPress:i}){let[a,l]=Q(false),[s,u]=Q(false),f=!e.icon&&e.id.startsWith("empty-"),I=!f&&e.unavailable===true,m=!f&&!I,{icons:M}=on,w=Mr(t,n),B=0;o<=w[1]?B=0:o<=w[2]?B=(o-w[1])/(w[2]-w[1]):B=1,B=Math.max(0,Math.min(1,B));let z=Br,E=M.pressIn.scale,R=B*(s?E:a?1.1:1),k=0;B<=0?k=0:B<=.3?k=B:k=.3+(B-.3)*(.7/.7);let v=r.x*B,C=r.y*B;return D("button",{role:"menuitem","aria-label":f?"Empty slot":Ir(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!m,tabIndex:m?0:-1,onClick:m?i:void 0,onPointerEnter:P=>m&&P.pointerType==="mouse"&&l(true),onPointerLeave:()=>{l(false),u(false)},onPointerDown:()=>m&&u(true),onPointerUp:()=>u(false),onPointerCancel:()=>u(false),style:{position:"absolute",left:"50%",top:"50%",width:z,height:z,marginLeft:-z/2,marginTop:-z/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:m?"pointer":"default",transform:`translate(${v}px, ${C}px) scale(${R})`,opacity:k,transition:a||s?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:f?D("div",{style:{width:S.emptySlot.dotSize,height:S.emptySlot.dotSize,borderRadius:S.emptySlot.dotSize/2,backgroundColor:L.emptyDotBackground,border:`${S.emptySlot.borderWidth}px solid ${L.emptyDotBorder}`}}):be(oi,{children:[D("div",{style:{position:"absolute",width:`${S.icon.gradientBgSizePercent}%`,height:`${S.icon.gradientBgSizePercent}%`,borderRadius:S.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:S.icon.gradientBgOpacity}}),D("div",{style:{position:"absolute",width:`${S.icon.innerGlowSizePercent}%`,height:`${S.icon.innerGlowSizePercent}%`,borderRadius:S.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:S.icon.innerGlowOpacity}}),D("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:a?"brightness(1.2)":"none"},children:e.icon}),D("span",{style:{fontSize:e.name.length>8?Math.max(S.icon.label.fontSize*.7,S.icon.label.fontSize*8/e.name.length):S.icon.label.fontSize,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,color:L.iconLabel,letterSpacing:S.icon.label.letterSpacing,marginTop:S.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&D("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:Or.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Sn({side:e,color:t}){return D("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(e==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]]).map(([n,r,o,i],a)=>D("line",{x1:n,y1:r,x2:o,y2:i,stroke:t,strokeWidth:2},a))})}function wn({side:e,disabled:t,onClick:n}){let[r,o]=Q(false),i=t?L.emptyDotBorder:L.accent;return be("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:n,onPointerDown:()=>!t&&o(true),onPointerUp:()=>o(false),onPointerLeave:()=>o(false),onPointerCancel:()=>o(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${L.dialBorder}`,backgroundColor:L.dialBackground,color:t?L.iconLabelMuted:L.centerText,fontSize:12,fontWeight:900,fontFamily:sn,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${rn(L.dialShadow,.4)}`,transform:r?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&D(Sn,{side:"prev",color:i}),e==="prev"?"PREV":"NEXT",e==="next"&&D(Sn,{side:"next",color:i})]})}function xn({icons:e,onClose:t,centerLabel:n="MENU",onCenterPress:r,settingsOpen:o=false,hintsDisabled:i=false}){let{id:a}=Pr(),[l,s]=Q(0),[u,f]=Q(0),[I,m]=Q(0),[M,w]=Q(0),[B,z]=Q(0),[E,R]=Q(1),[k,v]=Q(false),[C,P]=Q(false),[T,A]=Q(false),Z=ft(null),W=ft(null),q=ft(null),te=ft(false),{entrance:K,exit:ie,interaction:ne}=on,ve=Er(),[ae,Ie]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));Oe(()=>{let b=()=>Ie({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let $=pt(()=>kr({screenWidth:ae.width,maxCircleSize:Math.max(120,Math.min(320,ae.height-96))}),[ae]),qe=pt(()=>Rr(),[]),ke=pt(()=>zr(Ge,$.iconRadius),[$.iconRadius]),[Fe,ze]=Q(0),se=Math.max(1,Math.ceil(e.length/Ge)),J=Math.min(Fe,se-1),Se=pt(()=>{let b=J*Ge,x=[...e.slice(b,b+Ge)];for(;x.length<Ge;)x.push({id:`empty-${x.length}`,name:"",icon:null,onPress:()=>{}});return x},[e,J]);Oe(()=>{ii()},[]),Oe(()=>{let b=K.backdrop.duration,x=K.dial.rotation.duration,Y=K.centerButton.delay,U=K.icons.delay,G=K.icons.duration,V=performance.now(),oe=fe=>{let c=fe-V;s(Math.min(1,c/b));let g=Math.min(1,c/400),O=Ke(g)*1.1;g>.7&&(O-=(g-.7)*.33),g>=1&&(O=1),f(Math.max(0,Math.min(1.05,O)));let X=Math.min(1,c/x);if(m(Ke(X)*360),c>=Y){let xe=Math.min(1,(c-Y)/300),je=Ke(xe)*1.15;xe>.6&&(je-=(xe-.6)*.375),xe>=1&&(je=1),w(Math.max(0,Math.min(1.05,je)))}if(c>=U){let xe=Math.min(1,(c-U)/G);z(Ke(xe))}let we=U+G;c<we?q.current=requestAnimationFrame(oe):(s(1),f(1),m(360),w(1),z(1),A(true))};return q.current=requestAnimationFrame(oe),()=>{q.current&&cancelAnimationFrame(q.current)}},[]);let pe=mt(()=>{if(te.current)return;te.current=true,P(true),q.current&&cancelAnimationFrame(q.current);let b=performance.now(),x=ie.icons.duration,Y=ie.centerButton.duration,U=ie.dialScale.duration,G=Math.max(Y,U),V=ie.backdrop.duration,oe=fe=>{let c=fe-b;if(c<x){let X=Et(c/x);z(1-X),q.current=requestAnimationFrame(oe);return}let g=x;if(c<g+G){z(0);let X=Math.min(1,(c-g)/Y),we=Math.min(1,(c-g)/U);w(1-Et(X)),f(1-Et(we)),q.current=requestAnimationFrame(oe);return}let O=g+G;if(c<O+V){f(0),w(0);let X=(c-O)/V;s(1-X),q.current=requestAnimationFrame(oe);return}s(0),t()};q.current=requestAnimationFrame(oe)},[ie,t]);Oe(()=>{let b=document.activeElement,x=Z.current;return()=>{b?.isConnected&&(document.activeElement===document.body||x?.contains(document.activeElement))&&b.focus()}},[]),Oe(()=>{if(o)return;W.current?.focus();let b=x=>{let Y=Z.current;if(Y){if(x.key==="Escape")x.preventDefault(),pe();else if(x.key==="Tab"){let U=Array.from(Y.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(oe=>oe.getClientRects().length>0),G=U[0],V=U[U.length-1];(!Y.contains(document.activeElement)||(x.shiftKey?document.activeElement===G:document.activeElement===V))&&(x.preventDefault(),(x.shiftKey?V:G)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(x.key)){let U=Array.from(Y.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),G=U.indexOf(document.activeElement);if(G<0||!U.length)return;x.preventDefault();let V=x.key==="Home"?0:x.key==="End"?U.length-1:(G+(x.key==="ArrowRight"||x.key==="ArrowDown"?1:-1)+U.length)%U.length;U[V].focus()}}};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[pe,o]);let[Re,$e]=Q(false);Oe(()=>{if(i)return;let b=false,x=setTimeout(async()=>{let Y=await an.getItem(bn);!b&&!Y&&$e(true)},1200);return()=>{b=true,clearTimeout(x)}},[i]);let he=mt(()=>{$e(false),an.setItem(bn,"true")},[]);Oe(()=>{o&&Re&&he()},[o,Re,he]);let Me=mt(b=>{if(b.id.startsWith("empty-")||te.current)return;let[x,Y]=ne.iconSelect.pulse,U=performance.now(),G=150,V=oe=>{let fe=oe-U;if(fe<G){let c=Ke(fe/G);R(1-(1-x.scale)*c),requestAnimationFrame(V)}else if(fe<G*2){let c=Ke((fe-G)/G);R(x.scale+(Y.scale-x.scale)*c),requestAnimationFrame(V)}else R(1)};requestAnimationFrame(V),setTimeout(()=>{b.onPress(),pe()},ne.iconSelect.actionDelay)},[ne.iconSelect,pe]),ue=mt(b=>{if(te.current)return;let x=Math.max(0,Math.min(b,se-1));x!==J&&ze(x)},[se,J]),ye=$.buttonSize*S.centerButton.containerRatio,Be=$.buttonSize*S.centerButton.borderRatio,d=$.buttonSize*S.centerButton.containerRatio/2+6,_=T&&!C;return be("div",{ref:Z,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[D("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:pe,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:L.dialBackdrop,opacity:l}}),be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,bottom:80,width:$.circleSize,height:$.circleSize,borderRadius:"50%",backgroundColor:L.dialBackground,border:`${S.circle.borderWidth}px solid ${L.dialBorder}`,boxShadow:`0 0 ${S.circle.shadowRadius}px ${rn(L.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${u}) rotate(${I}deg)`,opacity:u>.01?1:0,overflow:"hidden"},children:[D("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:L.dialGradient1,opacity:S.gradientLayers[0].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:L.dialGradient2,opacity:S.gradientLayers[1].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:L.dialGradient3,opacity:S.gradientLayers[2].opacity}}),qe.map(b=>D("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:S.grid.lineHeight,transform:`rotate(${b}deg)`,transformOrigin:"center"},children:["left","right"].map(x=>D("div",{style:{position:"absolute",top:0,[x]:0,width:`calc(50% - ${d}px)`,height:S.grid.lineHeight,backgroundColor:L.dialGridLine}},x))},b)),D("div",{"data-testid":"dial-background","data-background":a,style:{position:"absolute",inset:0,pointerEvents:"none"},children:a==="hyperspace"?D(Xr,{size:$.circleSize}):D(Dr,{focus:ri})}),Se.map((b,x)=>D(ai,{icon:b,index:x,totalIcons:Se.length,position:ke[x],progress:B,onPress:()=>Me(b)},x)),be("div",{style:{position:"absolute",left:"50%",top:"50%",width:ye,height:ye,marginLeft:-ye/2,marginTop:-ye/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:L.hubHalo,borderRadius:$.buttonSize,overflow:"hidden",transform:`scale(${M*E})`,opacity:M>.01?1:0},children:[D("div",{style:{position:"absolute",inset:0,backgroundColor:L.dialGradient1,opacity:.5,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:L.dialGradient2,opacity:.3,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:L.dialGradient3,opacity:.2,borderRadius:$.buttonSize}}),D("div",{style:{width:Be,height:Be,borderRadius:$.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:L.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:D("button",{ref:W,type:"button","aria-label":o?"Close Settings":"Open Dev Tools Settings",disabled:!r,onClick:r,onPointerEnter:b=>b.pointerType==="mouse"&&v(true),onPointerLeave:()=>v(false),style:{border:0,padding:0,background:"transparent",width:$.buttonSize,height:$.buttonSize,borderRadius:$.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:r?"pointer":"default",transform:k?`scale(${ne.centerHover.scale})`:"scale(1)",transition:`transform ${ne.centerHover.duration}ms ease`,animation:_&&!k?ve.pulse:"none"},children:o?be("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:S.centerButton.text.fontSize-2,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[D("span",{style:{marginBottom:-2},children:"CLOSE"}),D("span",{style:{marginTop:-2},children:"SETTINGS"})]}):D("span",{style:{fontSize:S.centerButton.text.fontSize,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase"},children:n})})})]})]}),se>1&&be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,top:"calc(100% - 64px)",width:$.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,u),transform:`scale(${Math.min(1,u)})`},children:[D(wn,{side:"prev",disabled:J<=0,onClick:()=>ue(J-1)}),be("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:sn,letterSpacing:2,color:L.centerText,textShadow:`0 0 6px ${L.centerTextGlow}`},children:[String(J+1).padStart(2,"0"),be("span",{style:{color:L.iconLabelMuted,textShadow:"none"},children:[" / ",String(se).padStart(2,"0")]})]}),D(wn,{side:"next",disabled:J>=se-1,onClick:()=>ue(J+1)})]}),Re&&!o&&D(yn,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:he,showArrow:false})]})}import{persistentStorage as Tn,devToolsStorageKeys as si}from"@buoy-gg/shared-ui/web";import{recordUsage as li,pruneUsage as ci}from"@buoy-gg/floating-tools-core/web";var Cn=si.dial.usage(),Ve={},In=false,Ot=null;function kn(){return Ot||(Ot=(async()=>{try{let e=await Tn.getItem(Cn);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ve=t)}}catch{}finally{In=true}})(),Ot)}kn();function di(e){return e.map((t,n)=>({id:t,index:n,lastUsed:Ve[t]?.lastUsed??0})).sort((t,n)=>n.lastUsed-t.lastUsed||t.index-n.index).map(({id:t})=>t)}async function ui(e){if(!e)return;In||await kn();let t=Math.max(Date.now(),...Object.values(Ve).map(n=>n.lastUsed+1));Ve=ci(li(Ve,e,t),t);try{await Tn.setItem(Cn,JSON.stringify(Ve))}catch{}}import{useCallback as pi,useMemo as zn}from"react";import{persistentStorage as fi}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Te,useCallback as ht,useMemo as yt}from"react";import{settingsEventBus as bt}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as mi}from"react";import{getRegisteredToolModule as gi}from"@buoy-gg/shared-ui/web";var hi=()=>()=>{},yi=()=>null;function bi(){let e=gi("@buoy-gg/external-sync");return mi(e?.subscribeSyncStatus??hi,()=>e?.getSyncStatus?.()??null,yi)}import{SentryIcon as vi,WifiCircuitIcon as Si,ImageOverlayIcon as wi,RenderCountIcon as xi,Info as Dt,Layers as Ti,ChevronRightIcon as Rn,ChevronDown as Mn,getStorageBackendType as Ci,getUseLicense as Ii,signOutOfBuoy as ki,persistentStorage as De,Trash2 as zi,CheckCircle2 as Bn,BuoyUpgradeSheet as Ri,BackgroundSwitcher as Mi,night as h,NightCard as Pe,NightRows as Pt,NightSectionLabel as Bi,NightFootnote as An,NightSwitch as En,NightButton as Lt,NightSegmented as Ai,NightBadge as ge,NightSeparator as Ei,monoFont as On}from"@buoy-gg/shared-ui/web";import{EnvIcon as Dn,StorageIcon as Oi,RoutesIcon as Di,NetworkIcon as Pi,QueryIcon as Li,HighlighterIcon as Fi,ReduxIcon as $i,EventsIcon as ji}from"@buoy-gg/floating-tools-core/web";import Ni,{createContext as _i,useContext as Wi}from"react";import{jsx as Hi}from"react/jsx-runtime";var Pn=_i({});function Ln({children:e,defaultFloatingTools:t,defaultDialTools:n}){let r=Ni.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:n}),[t,n]);return Hi(Pn.Provider,{value:r,children:e})}function Fn(){return Wi(Pn)}import Ui from"react";import{toolTheme as Ki}from"@buoy-gg/shared-ui/web";import{jsx as $n}from"react/jsx-runtime";function Vi({label:e,size:t,color:n=Ki.colors.text}){let r=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),o=r<=2?t:t*1.6,i=Math.max(7,Math.min(t*(r===1?.7:.62),o/(.62*r)));return $n("span",{style:{display:"inline-flex",minWidth:t,maxWidth:o,height:t,alignItems:"center",justifyContent:"center",color:n,fontSize:i,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function jn(e,t){return e==null?e:typeof e=="function"?Ui.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?$n(Vi,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as qi,devToolsStorageKeys as Ft,onSettingsApplied as Gi,expandableWindowControlsSupported as Ji}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Yi}from"@buoy-gg/shared-ui/web";import{Fragment as Ye,jsx as p,jsxs as j}from"react/jsx-runtime";var Xe="@react_buoy_dev_tools_settings",Xi=6,vt=e=>{let t=Xi,n={};for(let[r,o]of Object.entries(e))o&&t>0?(n[r]=true,t-=1):n[r]=false;return n},Qi=(e,t)=>{let{userStatus:n,environment:r,...o}=e,i=t?Object.entries(o).filter(([a])=>t.includes(a)):Object.entries(o);return{...Object.fromEntries(i),environment:r??false}},Nn=(e,t,n)=>{if(!t)return e;let r={...e.dialTools,...t.dialTools??{}},o=n?.allowedDialKeys?Object.entries(r).filter(([i])=>n.allowedDialKeys?.includes(i)):Object.entries(r);return{dialTools:vt(Object.fromEntries(o)),floatingTools:Qi({...e.floatingTools,...t.floatingTools??{}},n?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},Zi=(e=[],t,n)=>{let r={},o={},i=new Set(t??[]),a=new Set(n??[]),l=!n||n.length===0;for(let s of e){let{id:u,slot:f="both"}=s;(f==="dial"||f==="both")&&(r[u]=l?true:a.has(u)),(f==="row"||f==="both")&&(o[u]=i.has(u))}return{dialTools:vt(r),floatingTools:{...o,environment:i.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},ea=({visible:e,onClose:t,onSettingsChange:n,initialSettings:r,availableApps:o=[],storage:i=De,zIndex:a})=>{let{defaultFloatingTools:l,defaultDialTools:s}=Fn(),u=yt(()=>Zi(o,l,s),[o,l,s]),f=yt(()=>Object.keys(u.dialTools),[u]),I=yt(()=>Object.keys(u.floatingTools).filter(c=>c!=="environment"),[u]),[m,M]=re(r||Qe||u),[w,B]=re($t??"floating"),[z,E]=re($t!==null),[R,k]=re(new Set),[v,C]=re(false),[P,T]=re(false);Te(()=>{let c=requestAnimationFrame(()=>T(true));return()=>cancelAnimationFrame(c)},[]);let A=bi();Te(()=>{(async()=>{try{let c=await De.getItem(Ft.settings.activeTab());if(c&&["floating","settings","pro"].includes(c)){let g=c;$t=g,B(O=>O===g?O:g)}}catch{}finally{E(true)}})()},[]),Te(()=>{z&&De.setItem(Ft.settings.activeTab(),w).catch(c=>{console.warn("Failed to save settings active tab:",c)})},[w,z]);let Z=Ii()?.(),W=Z?.isPro??false,q=!W&&Z?.licenseKey?Z.error:null,te=Z?.errorKind==="transport",[K,ie]=re(_n),[ne,ve]=re(false),[ae,Ie]=re(false),[$,qe]=re(false),[ke,Fe]=re([]),[ze,se]=re(false),J=Yi(),Se=Yt.get("window").height,pe=Yt.get("window").width,Re=Math.floor(Se*.33),$e=Math.min(pe-32,400),he=ht(async()=>{try{let c=await i.getItem(Xe);if(c){let g=JSON.parse(c),O=Nn(u,g,{allowedDialKeys:f,allowedFloatingKeys:I});Qe=O,M(X=>Wn(X,O)?X:O);return}Qe=u,M(g=>Wn(g,u)?g:u)}catch(c){console.error("Failed to load dev tools settings:",c),M(u)}},[u,f,I,i]);Te(()=>{he()},[he]),Te(()=>{Ci().then(c=>{_n=c,ie(g=>g===c?g:c)})},[]),Te(()=>{$&&(se(true),De.getAllKeys().then(c=>{Fe(c.sort())}).catch(()=>{Fe([])}).finally(()=>{se(false)}))},[$]);let Me=async c=>{try{let g={...c,dialTools:vt(c.dialTools)};await i.setItem(Xe,JSON.stringify(g)),Qe=g,M(g),n?.(g),bt.emit(g)}catch(g){console.error("Failed to save dev tools settings:",g)}},ue=c=>{let g={...m,floatingTools:{...m.floatingTools,[c]:!m.floatingTools[c]}};Me(g)},ye=c=>{let g={...m,globalSettings:{...m.globalSettings,[c]:!m.globalSettings?.[c]}};Me(g)},Be=async()=>{ve(true),Ie(false);try{await De.clear(),Ie(true),M(u),i!==De&&await i.setItem(Xe,JSON.stringify(u)),n?.(u),bt.emit(u),setTimeout(()=>Ie(false),2e3)}catch(c){console.error("Failed to clear storage:",c)}finally{ve(false)}},d=ht(c=>{},[]),_=c=>{let g=o.find(O=>O.id===c);return g?.description?g.description:c==="environment"?"Environment badge.":""},b=c=>c==="environment"?"Env Badge":o.find(g=>g.id===c)?.name??c.toUpperCase().replace(/_/g," "),x=c=>{if(!P)return null;switch(c){case"query":return p(Li,{size:18});case"env":return p(Dn,{size:18});case"sentry":return p(vi,{size:18,color:"#9945FF"});case"storage":return p(Oi,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return p(Si,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(Di,{size:18,bgColor:h.color.surface});case"network":return p(Pi,{size:18});case"environment":return p(Dn,{size:18});case"debug-borders":return p(Ti,{size:18,color:h.color.accent});case"highlight-updates":return p(xi,{size:18,color:h.color.accent});case"highlight-updates-modal":return p(Fi,{size:18});case"redux":return p($i,{size:18});case"image-overlay":return p(wi,{size:18});case"events":return p(ji,{size:18});case"zustand":try{let{ZustandIcon:g}=Xt("@buoy-gg/zustand/web");return p(g,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:g}=Xt("@buoy-gg/jotai/web");return p(g,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}default:{let g=o.find(O=>O.id===c);return g?.icon!=null?jn(g.icon,{slot:"row",size:18,color:g.color}):p(Dt,{size:18,color:h.color.textSecondary})}}},Y=(c,g,O,X)=>{let we=_(c);return j(lt,{activeOpacity:O?1:.7,onPress:()=>!O&&X(),accessibilityLabel:b(c),accessibilityRole:"button",style:[y.toolRow,O&&y.rowDisabled],children:[p(N,{style:y.toolIconSlot,children:x(c)}),j(N,{style:y.rowInfo,children:[j(H,{style:y.rowLabel,children:[b(c),O?" \xB7 max 6":""]}),we?p(H,{style:y.rowCaption,numberOfLines:1,children:we}):null]}),p(En,{value:g,disabled:O,onValueChange:()=>X()})]},c)},U=c=>{k(g=>{let O=new Set(g);return O.has(c)?O.delete(c):O.add(c),O})},G=(c,g,O,X,we)=>{let xe=m.globalSettings?.[c]??false,je=R.has(c);return j(N,{children:[j(lt,{activeOpacity:.7,onPress:()=>U(c),accessibilityLabel:g,style:y.settingRow,children:[j(N,{style:y.rowInfo,children:[p(H,{style:y.rowLabel,children:g}),p(H,{style:y.rowCaption,numberOfLines:je?0:1,children:O})]}),p(En,{value:xe,onValueChange:()=>ye(c)})]}),je&&j(N,{style:y.settingRowBody,children:[p(H,{style:y.settingRowBodyText,children:X}),p(H,{style:y.settingRowBodyHint,children:we})]})]},c)},V=(c,g,O)=>j(N,{children:[p(Bi,{children:c}),g,O]}),oe=K==="filesystem"?p(ge,{label:"File System",tone:"accent"}):K==="asyncstorage"?p(ge,{label:"Async Storage",tone:"warning"}):K==="localstorage"?p(ge,{label:"Local Storage",tone:"accent"}):K==="memory"?p(ge,{label:"Memory",tone:"danger"}):p(ge,{label:"Loading\u2026",tone:"neutral"}),fe=()=>j(N,{style:y.container,children:[j(Jt,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[w==="floating"&&p(Ye,{children:V("Floating Tools",p(Pe,{glass:true,children:p(Pt,{children:Object.entries(m.floatingTools).map(([c,g])=>Y(c,g,false,()=>ue(c)))})}),p(An,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&j(Ye,{children:[V("Background",p(Pe,{glass:true,padded:true,children:p(Mi,{embedded:true})})),V("Storage",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>qe(!$),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Storage Type"})}),oe,$?p(Mn,{size:16,color:h.color.textTertiary}):p(Rn,{size:16,color:h.color.textTertiary})]}),$&&j(Ye,{children:[j(N,{style:y.settingRowBody,children:[p(H,{style:y.settingRowBodyText,children:K==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":K==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":K==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":K==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),K==="asyncstorage"&&p(H,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),K==="memory"&&p(H,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(Ei,{}),j(N,{style:y.storageExpanded,children:[j(N,{style:y.storageExpandedHeader,children:[p(H,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(H,{style:y.storageExpandedCount,children:ze?"\u2026":`${ke.length} keys`})]}),ze?p(H,{style:y.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?p(H,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(Jt,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(c=>p(N,{style:y.storageKeyItem,children:p(H,{style:y.storageKeyText,numberOfLines:1,children:c.replace("@react_buoy_","")})},c))})]}),p(N,{style:y.cardButtonWrap,children:p(Lt,{label:ae?"Cleared":ne?"Clearing\u2026":"Clear All Settings",variant:ae?"secondary":"destructive",size:"md",disabled:ne,onPress:Be,icon:ae?p(Bn,{size:15,color:h.color.accent}):p(zi,{size:15,color:ne?h.color.textTertiary:h.color.danger})})})]})]})),A&&A.state!=="idle"&&V("Desktop Sync",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>U("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Buoy Desktop"})}),A.state==="connected"?p(ge,{label:"Connected",tone:"accent"}):A.state==="connecting"?p(ge,{label:"Connecting\u2026",tone:"neutral"}):p(ge,{label:"Retrying",tone:"warning"}),R.has("desktopSync")?p(Mn,{size:16,color:h.color.textTertiary}):p(Rn,{size:16,color:h.color.textTertiary})]}),R.has("desktopSync")&&j(N,{style:y.settingRowBody,children:[j(H,{style:y.settingRowBodyText,children:[A.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(H,{style:y.footnoteMono,children:A.targetURL??"(unknown URL)"}),A.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),A.state==="retrying"&&A.lastError&&j(H,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",A.lastError]})]})]})),V("Modal Behavior",p(Pe,{glass:true,children:j(Pt,{children:[G("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Ji(Ne.OS==="web")?G("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),w==="pro"&&j(Ye,{children:[V("License",j(Pe,{glass:true,children:[j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"License Status"})}),p(N,{testID:"buoy-settings-license-status",accessibilityLabel:W?"License: Active":"License: Free",children:W?p(ge,{label:"Active",tone:"accent"}):p(ge,{label:"Free",tone:"neutral"})})]}),Z?.tierSource==="session"?j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Lt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void ki(),testID:"buoy-settings-signout"})]}):null]}),p(An,{children:W?"You have full access to all Buoy DevTools features.":q?te?`Couldn't reach the license server (${q}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${q}.`:"Upgrade to Pro to unlock all features and support development."})),!W&&j(Ye,{children:[V("Pro Features",p(Pe,{glass:true,children:p(Pt,{children:["Advanced Settings","Priority Support"].map(c=>j(N,{style:y.featureRow,children:[p(Bn,{size:16,color:h.color.accent}),p(H,{style:y.rowLabel,children:c})]},c))})})),p(Lt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),p(Ri,{visible:v,onClose:()=>C(false)})]});return p(qi,{visible:e,onClose:t,zIndex:a,variant:"night",header:{showToggleButton:false,customContent:p(N,{style:y.headerRow,children:p(Ai,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:c=>B(c)})})},initialMode:"bottomSheet",onModeChange:d,persistenceKey:Ft.settings.root(),enablePersistence:true,maxHeight:Se-J.top,initialHeight:Re,initialFloatingPosition:{x:(pe-$e)/2,y:J.top+20},enableGlitchEffects:true,children:fe()})},ta={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},na=(e,t)=>{let n=new Set(e??[]),r=new Set(t??[]),o={};for(let a of r)o[a]=true;let i={environment:n.has("environment")};for(let a of n)a!=="environment"&&(i[a]=true);return{dialTools:vt(o),floatingTools:i,globalSettings:{enableSharedModalDimensions:false}}},Qe=null,$t=null,_n=null,Wn=(e,t)=>JSON.stringify(e)===JSON.stringify(t);bt.addListener(e=>{e&&(Qe=e)});var Hn=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Fn(),n=yt(()=>!e&&!t?ta:na(e,t),[e,t]),[r,o]=re(n),i=ht(async()=>{try{let l=await De.getItem(Xe);if(l){let s=JSON.parse(l),u=Nn(n,s);o(u);return}o(n)}catch(l){console.error("Failed to load dev tools settings:",l),o(n)}},[n]);Te(()=>Gi(l=>{l.includes(Xe)&&i()}),[i]),Te(()=>{i();let l=bt.addListener(s=>{try{s&&o(s)}catch{}});return()=>{l()}},[i]);let a=ht(()=>{i()},[i]);return{settings:r,refreshSettings:a}},y=ct.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:h.gutter,paddingRight:h.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:h.gutter,paddingTop:8,paddingBottom:24,gap:h.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:h.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:h.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:h.color.text,fontSize:h.font.row,fontWeight:"500"},rowCaption:{color:h.color.textTertiary,fontSize:h.font.label},settingRowBody:{paddingHorizontal:h.rowPadH,paddingBottom:h.rowPadV,gap:6},settingRowBodyText:{color:h.color.textSecondary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},settingRowBodyHint:{color:h.color.textTertiary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},bodyWarning:{color:h.color.warning},bodyDanger:{color:h.color.danger},cardButtonWrap:{paddingHorizontal:h.cardPad,paddingTop:10,paddingBottom:h.cardPad},storageExpanded:{paddingHorizontal:h.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:h.color.textSecondary,fontSize:h.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:h.color.textTertiary,fontSize:h.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:h.color.glassElevated,borderRadius:h.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:h.color.textSecondary,fontSize:h.font.micro,fontFamily:On},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:On,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Un}from"react/jsx-runtime";var oa=[];function Kn({visible:e,onClose:t,availableTools:n=oa,defaultFloatingTools:r,defaultDialTools:o,storage:i=fi,onSettingsChange:a}){let l=zn(()=>({getItem:async f=>i.getItem(f),setItem:async(f,I)=>i.setItem(f,I)}),[i]),s=zn(()=>n.map(f=>({...f,name:f.name??f.id,icon:typeof f.icon=="function"?I=>f.icon(I.size):f.icon})),[n]),u=pi(f=>{a?.(f)},[a]);return Un(Ln,{defaultFloatingTools:r,defaultDialTools:o,children:Un(ea,{visible:e,onClose:t,zIndex:11e3,availableApps:s,storage:l,onSettingsChange:u})})}import{persistentStorage as Vn,setExpandableWindowControls as ra}from"@buoy-gg/shared-ui/web";import{createContext as ia,useCallback as Ce,useContext as aa,useEffect as St,useMemo as sa,useRef as Ze,useState as qn}from"react";var la=(e,t,n)=>{if(t.singleton){let o=e.find(i=>i.id===t.id);if(o){let i=o.minimized??false;return{instanceId:o.instanceId,wasMinimized:i,apps:[...e.filter(a=>a.instanceId!==o.instanceId),{...o,minimized:false}]}}}let r=n();return{instanceId:r,wasMinimized:false,apps:[...e,{...t,instanceId:r}]}};import{createContext as ca,useCallback as Gn,useContext as da,useEffect as wt,useMemo as ua,useRef as Jn,useState as xt}from"react";import{JsModal as pa,ModalHeader as et,HeaderSearchButton as fa,TickProvider as ma,ToolScreenHeaderContext as ga,devToolsStorageKeys as Yn,buoyColors as Xn,gameUIColors as jt}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as Tt}from"react/jsx-runtime";var tt=()=>{},ha={search:"",isSearchActive:false,clearSearch:tt,close:tt,minimize:tt,showToast:tt,setHeaderOverride:tt},Qn=ca(null);function Zn(){return da(Qn)??ha}function ya(e,t){let{setHeaderOverride:n}=Zn();wt(()=>(n(e),()=>n(null)),t)}var eo=2200,ba={success:jt.success,error:jt.error,info:jt.info};function va({message:e,type:t,nonce:n}){let r=Jn(new Ae.Value(0)).current;wt(()=>{r.setValue(0),Ae.sequence([Ae.timing(r,{toValue:1,duration:150,useNativeDriver:true}),Ae.delay(eo-450),Ae.timing(r,{toValue:0,duration:300,useNativeDriver:true})]).start()},[n,r]);let o=ba[t];return Tt(Ae.View,{pointerEvents:"none",style:[Ct.toast,{opacity:r,borderColor:o+"60"}],children:[le(N,{style:[Ct.toastDot,{backgroundColor:o}]}),le(H,{style:Ct.toastText,numberOfLines:2,children:e})]})}function Sa({app:e,config:t,visible:n,zIndex:r,onClose:o,onMinimize:i,initialModalState:a,enableSharedModalDimensions:l,bodyProps:s}){let u=e.component,[f,I]=xt(false),[m,M]=xt(""),[w,B]=xt(null),[z,E]=xt(null),R=Jn(null),k=Gn(()=>{I(false),M("")},[]),v=Gn((K,ie="info")=>{R.current&&clearTimeout(R.current),E(ne=>({message:K,type:ie,nonce:(ne?.nonce??0)+1})),R.current=setTimeout(()=>E(null),eo)},[]);wt(()=>()=>{R.current&&clearTimeout(R.current)},[]);let C=ua(()=>({search:f?m:"",isSearchActive:f,clearSearch:k,close:o,minimize:()=>i(),showToast:v,setHeaderOverride:B,instanceId:e.instanceId}),[m,f,k,o,i,v,e.instanceId]),P=w?.title??t.title??e.title??e.id,T=w?.subtitle??t.subtitle,A=w?.onBack,Z=w?.actions??t.headerActions,W=w?.searchable??t.searchable;wt(()=>{!W&&f&&k()},[W,f,k]);let q=l?Yn.modal.root():Yn.custom(e.id).modal(),te=Tt(et,{children:[A&&!f&&le(et.Navigation,{onBack:A}),f?le(et.Search,{value:m,onChangeText:M,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):le(et.Content,{title:P,subtitle:T}),Tt(et.Actions,{children:[!f&&Z,W&&!f&&le(fa,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return le(Qn.Provider,{value:C,children:le(pa,{visible:n,onClose:o,onBack:A,onMinimize:i,initialModalState:a,zIndex:r,persistenceKey:q,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:te,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Tt(N,{style:Ct.bodyRoot,children:[le(ma,{children:le(ga.Provider,{value:B,children:le(u,{...s})})}),z&&le(va,{message:z.message,type:z.type,nonce:z.nonce})]})})})}var Ct=ct.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:Xn.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:Xn.text}});import{useEffect as wa,useRef as xa}from"react";import{capacitorPlatform as Ta,capacitorPlugin as Ca}from"@buoy-gg/license/web";function Ia(){return globalThis.__BUOY_HOLDS_BACK__===true}var ka=99.5;function za(){if(typeof document>"u")return false;let e=globalThis.Ionic;if(!e&&!document.querySelector("ion-app"))return false;try{return e?.config?.get?.("hardwareBackButton",true)!==false}catch{return true}}function Ra(e,t){let n=xa(t);n.current=t,wa(()=>{if(!e||Ta()!=="android")return;let r=globalThis;r.__BUOY_HOLDS_BACK__=true;let o;if(za()){let i=a=>{a.detail?.register?.(ka,()=>{n.current()})};document.addEventListener("ionBackButton",i),o=()=>document.removeEventListener("ionBackButton",i)}else{let i=Ca("App");if(!i?.addListener){r.__BUOY_HOLDS_BACK__=false;return}let a=false,l=null;Promise.resolve(i.addListener("backButton",()=>n.current())).then(s=>{a?s.remove():l=s}).catch(()=>{}),o=()=>{a=true,l&&l.remove()}}return()=>{o(),r.__BUOY_HOLDS_BACK__=false}},[e])}import{Fragment as Ma,jsx as ce}from"react/jsx-runtime";var to=ia(null),no="@react_buoy_open_apps",Nt=44,Ba=12,Aa=100,Ea=16,Oa=e=>({x:window.innerWidth-Nt-Ea,y:window.innerHeight-Aa-Nt-e*(Nt+Ba)}),oo=({children:e})=>{let[t,n]=qn([]),[r,o]=qn(false),i=Ze([]),a=Ze(null),l=Ze(false),s=Ze(false),u=Ze(false),f=Ce(v=>{let C="";return n(P=>{let{apps:T,instanceId:A}=la(P,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=A,T}),C},[]),I=Ce(()=>{if(l.current||!s.current||!u.current)return;l.current=true;let v=a.current;if(!v||v.length===0){o(true);return}a.current=null,v.forEach(({id:C,minimized:P})=>{let T=i.current.find(A=>A.id===C);if(T&&T.component){let A=jn(T.icon,{slot:"dial",size:20,color:T.color});f({id:T.id,title:T.name,component:T.component,props:T.props,modal:T.modal,launchMode:T.launchMode||"self-modal",singleton:T.singleton??true,icon:A,color:T.color,minimized:P})}}),o(true)},[f]);St(()=>{let v=false;return(async()=>{try{let C=await Vn.getItem(no);if(v)return;if(C){let P=JSON.parse(C),T;Array.isArray(P)&&P.length>0&&(typeof P[0]=="string"?T=P.map(A=>({id:A,minimized:false})):T=P.filter(A=>typeof A=="object"&&A!==null&&typeof A.id=="string"),T.length&&(a.current=T))}}catch{}v||(s.current=true,I())})(),()=>{v=true}},[I]),St(()=>{if(!r)return;let v=t.map(C=>({id:C.id,minimized:C.minimized??false}));Vn.setItem(no,JSON.stringify(v))},[t,r]);let m=Ce(v=>{i.current=v,u.current=true,I()},[I]),M=Ce(v=>{n(C=>C.length?v?C.filter(P=>P.instanceId!==v):C.slice(0,-1):C)},[]),w=Ce(()=>n([]),[]),B=Ce((v,C)=>{n(P=>P.map(T=>T.instanceId===v?{...T,minimized:true,restoreState:C}:T))},[]),z=Ce((v,C)=>{n(P=>P.map(T=>T.instanceId===v?{...T,minimized:false,restoreState:C??T.restoreState}:T))},[]),E=Ce(v=>t.find(C=>C.instanceId===v)?.minimized??false,[t]),R=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);St(()=>{if(!R)return;let v=C=>{if(C.key!=="Escape"||C.defaultPrevented)return;let P=[...t].reverse().find(T=>T.launchMode!=="toggle-only"&&!T.minimized);P&&M(P.instanceId)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[R,M,t]),Ra(t.length>0,()=>M());let k=sa(()=>({openApps:t,isAnyOpen:R,open:f,close:M,closeAll:w,registerApps:m,minimize:B,restore:z,isMinimized:E}),[t,R,f,M,w,m,B,z,E]);return ce(to.Provider,{value:k,children:e})},nt=()=>{let e=aa(to);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},Da=9e3,Pa={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},La={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Fa=({app:e,zIndex:t,onClose:n,onMinimize:r,minimizeTargetPosition:o,enableSharedModalDimensions:i})=>{let a=e.component,l=!e.minimized,s={...e.props??{},...i?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(Sa,{app:e,config:e.modal,visible:l,zIndex:t,onClose:n,onMinimize:r,initialModalState:e.restoreState,enableSharedModalDimensions:i,bodyProps:s})}):e.launchMode==="self-modal"?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,visible:l,onClose:n,onRequestClose:n,onMinimize:r,minimizeTargetPosition:o,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?l?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,onClose:n,onMinimize:r,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Pa,zIndex:t,display:l?"flex":"none"},children:ce("div",{style:La,children:ce(a,{...s,onClose:n,onMinimize:r,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})})})},ro=()=>{let{openApps:e,close:t,minimize:n}=nt(),{settings:r}=Hn();St(()=>{ra(r.globalSettings?.expandableWindowControls!==false)},[r.globalSettings?.expandableWindowControls]);let o=e.filter(l=>l.launchMode!=="toggle-only");if(o.length===0)return null;let i=o.filter(l=>l.minimized).length,a=Cr()??Oa(i);return ce(Ma,{children:o.map((l,s)=>ce(Fa,{app:l,zIndex:Da+s,onClose:()=>t(l.instanceId),onMinimize:u=>n(l.instanceId,u),enableSharedModalDimensions:r.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:a},l.instanceId))})};import{useCallback as $a,useEffect as _t,useRef as ja,useState as io,useSyncExternalStore as ao}from"react";import{persistentStorage as so,getToolAttention as Wt,subscribeToolAttention as lo}from"@buoy-gg/shared-ui/web";import{jsx as de,jsxs as It}from"react/jsx-runtime";function Na(e){return ao(lo,()=>Wt(e),()=>Wt(e))}var co={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},uo={needsInput:3,failed:2,done:1},po=new Map;function fo(e){let t=null;for(let r of e?e.split("|"):[]){let o=Wt(r);o&&(!t||uo[o.kind]>uo[t.kind])&&(t=o)}let n=po.get(e);return n&&t&&n.kind===t.kind&&n.label===t.label?n:!n&&!t?null:(po.set(e,t),t)}function _a(e){let t=e.join("|");return ao(lo,()=>fo(t),()=>fo(t))}var mo=28,Ht=32,Ut=6,go=8,ho=24,yo="@react_buoy_minimized_stack_expanded",Wa=80,bo=2e3,Ha=6e3,Ua="#1A1A1A",ot="#888888";function vo({down:e=false}){return de("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:de("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:ot,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ka({id:e,title:t,icon:n,index:r,onPress:o}){let i=Na(e),a=ja(null);return _t(()=>{let l=true,s,u=()=>{a.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:Wa,easing:"linear"})},f=I=>{let m=I?500+Math.random()*1500+r*200:bo+Math.random()*(Ha-bo)+r*300;s=setTimeout(()=>{l&&(u(),f(false))},m)};return f(true),()=>{l=false,clearTimeout(s)}},[r]),It("button",{type:"button","aria-label":i?`${t} \u2014 ${i.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:o,style:{width:Ht,height:Ht,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[de("div",{ref:a,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n}),i?de("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${i.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:co[i.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:i.kind==="needsInput"?"!":""}):null]})}function Va({containerWidth:e=32}){let{openApps:t,restore:n}=nt(),r=t.filter(m=>m.minimized&&m.launchMode!=="toggle-only"),[o,i]=io(false),[a,l]=io(false),s=_a(r.map(m=>m.id));_t(()=>{let m=false;return(async()=>{let M=await so.getItem(yo);!m&&M==="true"&&i(true),m||l(true)})(),()=>{m=true}},[]),_t(()=>{a&&so.setItem(yo,o?"true":"false")},[o,a]);let u=$a(m=>{n(m)},[n]);if(r.length===0)return null;let f=go+r.length*Ht+(r.length-1)*Ut+Ut+ho+4,I={backgroundColor:Ua,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${ot}66`,borderLeft:`1px solid ${ot}66`,borderRight:`1px solid ${ot}66`,borderBottom:"none",boxSizing:"border-box"};return It("div",{style:{height:mo,overflow:"visible",position:"relative"},children:[de("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:o?"visible":"hidden",height:o?f:0,opacity:o?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:o?"auto":"none",...I},children:It("div",{style:{height:f,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:go,gap:Ut,boxSizing:"border-box"},children:[o&&[...r].reverse().map((m,M)=>de(Ka,{id:m.id,title:m.title||m.id,icon:m.icon??de("span",{style:{color:"#fff",fontSize:13},children:(m.title||m.id).slice(0,1).toUpperCase()}),index:M,onPress:()=>u(m.instanceId)},m.instanceId)),de("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>i(false),style:{width:"100%",height:ho,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:de(vo,{down:true})})]})}),It("button",{type:"button","aria-label":`Show ${r.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:o?-1:0,"aria-hidden":o,onClick:()=>i(true),style:{position:"absolute",bottom:0,left:0,width:e,height:mo,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:o?0:1,transform:o?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:o?"none":"auto",...I},children:[de(vo,{}),s?de("span",{"aria-hidden":true,"data-testid":"buoy-dock-peek-attention",style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:co[s.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:s.kind==="needsInput"?"!":""}):null,r.length>1&&de("span",{style:{fontSize:9,fontWeight:600,color:ot,marginLeft:1},children:r.length})]})]})}import{registerToolModules as qa}from"@buoy-gg/shared-ui/web";import{createElement as Ga}from"react";function rt(e){let t=e.icon;return{...e,icon:typeof t=="function"?n=>Ga(t,{size:n,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Ja,useContext as Ya,useState as So,useMemo as wo}from"react";import{jsx as Xa}from"react/jsx-runtime";var xo=Ja(null);function To({children:e}){let[t,n]=So(false),[r,o]=So(false),i=wo(()=>t||r,[t,r]),a=wo(()=>({isDialOpen:t,isToolOpen:r,isDevToolsActive:i,setDialOpen:n,setToolOpen:o}),[t,r,i]);return Xa(xo.Provider,{value:a,children:e})}function Kt(){let e=Ya(xo);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as Qa from"@buoy-gg/license/web";import*as Za from"@buoy-gg/shared-ui/web";import*as es from"@buoy-gg/shared-ui/web/dataViewer";function Co(e){qa({core:{useDevToolsVisibility:Kt},license:Qa,"shared-ui":Za,"shared-ui/dataViewer":es,...e});let t=new Set;return Object.values(e).flatMap(n=>Object.entries(n).flatMap(([r,o])=>!r.endsWith("Preset")||!o||typeof o.id!="string"||!o.component||t.has(o.id)?[]:(t.add(o.id),[rt(o)])))}import{useEffect as kt,useMemo as zt,useRef as ts}from"react";import{LicenseManager as ns,installCapacitorBridge as os,resolveDevBuild as Io,useLicense as rs}from"@buoy-gg/license/web";import{registerToolAdapters as is}from"@buoy-gg/shared-ui/web";function ko(e){return typeof e=="object"&&e!==null?e:void 0}function as({isDevelopment:e,isLicensed:t,externalSync:n,isAvailable:r}){if(n===false||!r)return false;if(e)return true;let o=ko(n);return t&&o?.enableInRelease===true&&Ro(o.socketURL,o)===null}var zo="http://localhost:42831";function ss(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function Ro(e,t){let n=e??zo;if(t?.allowInsecureNetwork===true)return null;let r;try{r=new URL(n)}catch{return`[Buoy] externalSync.socketURL "${n}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return r.protocol==="https:"||r.protocol==="wss:"||ss(r.hostname)?null:`[Buoy] This release build won't connect to ${n}: release sync carries real user data, and plain http to another machine is readable by anyone on the same network. Use a simulator, an emulator or adb reverse (localhost), an https:// broker, or set externalSync.allowInsecureNetwork: true for a network you trust.`}var ls={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function cs(e,t,n){if(t)return e;let r=null;for(let[o,i]of Object.entries(ls)){if(n?.includes(o))continue;let a=e[o];if(!a?.actions)continue;let l={...a.actions};for(let s of i)s in l&&(l[s]=()=>{throw new Error(`${o}.${s} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${o}"] }}.`)});r??(r={...e}),r[o]={...a,actions:l}}return r??e}import{useEffect as ds,useMemo as us,useState as ps}from"react";import{devToolsStorageKeys as fs,persistentStorage as ms}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as gs}from"@buoy-gg/license/web";var hs=8;function ys(){let e="";for(;e.length<hs;)e+=(Math.random()*16|0).toString(16);return e}function bs(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function vs({appName:e,hardwareName:t,platform:n,installId:r,deviceId:o}){let i=bs(e??"buoy")||"buoy",a=e??"Buoy Device",l=t?.trim()||n;return o?{deviceId:o,deviceName:`${a} (${l})`}:{deviceId:`${i}-${n}-${r}`,deviceName:`${a} (${l} \xB7 ${r.slice(-4)})`}}function Ss(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}function ws(){let e=globalThis;try{return e.localStorage??null}catch{return null}}async function xs({platform:e=Ne.OS,store:t,mint:n=ys}={}){let r=fs.sync.deviceId(),o=t===void 0?gs()?ws():e==="web"?Ss():ms:t;if(!o)return n();try{let i=await o.getItem(r);if(i&&i.length>0)return i;let a=n();return await o.setItem(r,a),a}catch{return n()}}var Vt=null;function Ts(){return Vt||(Vt=xs()),Vt}function Cs(e,t){let n=e?.deviceId,r=e?.deviceName,o=t.loadId??Ts,i=t.platform??Ne.OS,[a,l]=ps(null);return ds(()=>{if(n)return;let s=false;return o().then(u=>{s||l(u)}),()=>{s=true}},[n,o]),us(()=>{if(!n&&!a)return null;let s=vs({appName:t.appName,hardwareName:t.hardwareName,platform:i,installId:a??"",deviceId:n});return r?{...s,deviceName:r}:s},[n,r,a,t.appName,t.hardwareName,i])}import{useEffect as Is,useState as ks}from"react";import{capacitorPlatform as zs,capacitorPlugin as Rt,isCapacitorNative as Rs}from"@buoy-gg/license/web";function Ms(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let n=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!n||n==="K"?null:n}function Bs(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function Mo(){return typeof navigator>"u"?"":navigator.userAgent??""}function qt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}var Bo="@react_buoy_capacitor_app_name";function As(e){try{let t=globalThis.localStorage;if(!t)return e;let n=t.getItem(Bo);if(n)return n;e&&t.setItem(Bo,e)}catch{}return e}function Es(){let e=zs();if(!e)return{platform:"web",appName:qt(),hardwareName:"Browser",ready:true};let t=!!Rt("App");return{platform:e,appName:t?qt():As(qt()),hardwareName:Ms(Mo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Rt("Device")}}function Os(){let[e,t]=ks(Es);return Is(()=>{if(!Rs())return;let n=false,r=Rt("App"),o=Rt("Device");return Promise.all([r?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([i,a])=>{if(n)return;let l=i?.name?.trim(),s=a?.name?.trim()||a?.model?.trim();t(u=>({...u,appName:l||u.appName,hardwareName:s||u.hardwareName,ready:true}))}),()=>{n=true}},[]),e}function Ao(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:Mo(),serverUrl:typeof e=="string"?e:null}}function Eo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function Ds(e,t){if(e==="ios"){let n=Eo(t.serverUrl);return n?n===Eo(t.origin):t.protocol==="capacitor:"}return Oo.has(t.hostname)}var Oo=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Ps(e,t,n,r=Ao()){if(n==="web"||!r)return e;let o;try{o=new URL(e)}catch{return e}let i=Ds(n,r);return!t&&i&&o.hostname===r.hostname&&(o.hostname="localhost"),n==="android"&&Oo.has(o.hostname)&&Bs(r.userAgent)&&(o.hostname="10.0.2.2"),o.toString().replace(/\/$/,"")}function Ls(e,t,n=Ao()){return t!=="android"||!n||n.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${n.hostname} and blocks plain http/ws by default. For debug builds, set android.allowMixedContent: true and server.cleartext: true in capacitor.config, then run cap sync.`}import{getDevServerOrigin as Fs,resolveReloadStrategy as $s,scheduleReloadApp as js}from"@buoy-gg/shared-ui/web";var Do=Date.now(),Po=Fs(),Ns={platform:Ne.OS,isTV:Ne.isTV===true,isTVOS:Ne.isTVOS===true},Lo={version:3,getSnapshot:()=>{let e=$s("auto");return{startedAt:Do,devServerOrigin:Po,device:Ns,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:Do,devServerOrigin:Po}),reloadApp:e=>{let t=e??{},{strategy:n,delayMs:r}=js({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:n,delayMs:r}}}};import{Fragment as _s,jsx as Le,jsxs as Ws}from"react/jsx-runtime";var Hs=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],Us=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Ks(e){let t=zt(()=>Object.fromEntries(Object.entries(e.modules).map(([r,o])=>[r.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),o])),[e.modules]),n=t["react-query"];return n?.useReactQuerySyncAdapter?Le(Vs,{...e,modules:t,query:n}):Le(Fo,{...e,modules:t})}function Vs(e){let t=e.query.useReactQuerySyncAdapter();return Le(Fo,{...e,queryAdapter:t})}function Fo({modules:e,apps:t,requiredEnvVars:n,externalSync:r,headless:o,sentryGetClient:i,queryAdapter:a}){let{isPro:l,tier:s}=rs(),u=zt(()=>{let z={app:Lo};for(let[E,R]of Object.entries(e))for(let[k,v]of Object.entries(R))k.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(z[E]=v);a&&(z.query=a),e.env?.createEnvSyncAdapter&&(z.env=e.env.createEnvSyncAdapter(n??[]));for(let E of t??[])E.sync&&(z[`custom:${E.id}`]=E.sync);return z},[e,t,n,a]),f=ts(u);f.current=u,kt(()=>is(()=>f.current),[]),kt(()=>{let z=[],E=R=>{let k=R?.();typeof k=="function"&&z.push(k)};return E(e.network?.startNetworkCapture),E(e.storage?.startBrowserStorageCapture),E(e.assets?.startBrowserAssetCapture),Io(typeof _e<"u"?_e:process.env.NODE_ENV!=="production")&&E(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&E(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&E(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let R of z.reverse())R()}},[e]);let I=e["external-sync"],m=Io(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),M=as({isDevelopment:m,isLicensed:l,externalSync:r,isAvailable:!!I}),w=ko(r);os({release:!m&&!!w?.enableInRelease}),!m&&w?.enableInRelease&&jo(Ro(w.socketURL,w));let B=e.sentry?.SentryRoot;return Ws(_s,{children:[Object.entries(e).flatMap(([z,E])=>Hs.map(R=>{let k=E[R];return k?Le(k,{},`${z}:${R}`):null})),B&&Le(B,{getClient:i}),Object.entries(e).flatMap(([z,E])=>Us.map(R=>{let k=E[R];return k&&(!o||R==="ScenariosOverlay"||R==="ImpersonateOverlay")?Le(k,{},`${z}:${R}`):null})),M&&Le(qs,{module:I,tools:u,options:w,isPro:l,tier:s,dev:m})]})}var $o=null;function jo(e){!e||e===$o||($o=e,console.warn(e))}function qs({module:e,tools:t,options:n,isPro:r,tier:o,dev:i}){let a=Os(),l=Cs(n,{appName:a.appName,hardwareName:a.hardwareName,platform:a.platform}),s=zt(()=>Ps(n?.socketURL??(i?e.getDefaultSocketURL():zo),!!n?.socketURL,a.platform),[n?.socketURL,i,e,a.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:l?.deviceName??"Buoy Browser",socketURL:s,persistentDeviceId:a.ready?l?.deviceId??null:null,platform:a.platform,extraDeviceInfo:a.extraDeviceInfo,enableLogs:n?.enableLogs});kt(()=>{let m=Ls(s,a.platform);if(!u||!m)return;let M=()=>jo(m);return u.on("connect_error",M),()=>{u.off("connect_error",M)}},[u,s,a.platform]),kt(()=>{if(!u)return;let m=()=>{u.connected&&ns.hasAccountAccess()&&u.emit("device-license",{isPro:r?"1":"0",tier:o})};return m(),u.on("connect",m),()=>{u.off("connect",m)}},[u,r,o]);let f=n?.releaseActions?.join(",")??"",I=zt(()=>cs(t,i,f?f.split(","):void 0),[t,i,f]);return e.useExternalSync({tools:I,socket:u,deviceId:a.ready?l?.deviceId??null:null,enableLogs:n?.enableLogs}),null}import{useState as No}from"react";import{createPortal as Gs}from"react-dom";import{useBuoySession as Js}from"@buoy-gg/license/web";import{Fragment as _o,jsx as it,jsxs as Wo}from"react/jsx-runtime";var Ho="#20C997";function Ys(){let{status:e,signIn:t,signOut:n}=Js(),[r,o]=No(false),[i,a]=No(null);if(typeof document>"u")return null;let l=()=>{a(null),o(true),t().catch(u=>a(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>o(false))},s=e.state==="active";return Gs(it("div",{"data-buoy-signin":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,maxWidth:"min(320px, calc(100vw - 32px))",padding:s||i?"12px 14px":0,borderRadius:16,background:s||i?"#0f1419":"transparent",color:"#e6edf3",boxShadow:s||i?"0 10px 30px rgba(0,0,0,.35)":"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:14,lineHeight:1.45},children:s?Wo(_o,{children:[it("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),it("button",{type:"button",onClick:()=>void n(),style:Xs,"data-testid":"buoy-signout",children:"Sign out"})]}):Wo(_o,{children:[i?it("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:i}):null,it("button",{type:"button",onClick:l,disabled:r,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Ho,color:"#04130d",fontWeight:600,fontSize:14,cursor:r?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:r?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var Xs={marginTop:8,padding:0,border:"none",background:"none",color:Ho,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as Qs}from"react";import{AccountSetupButton as Zs,BuoyNeedsPlanCard as el,BuoySignInCard as tl,useSignInState as nl}from"@buoy-gg/shared-ui/web";import{jsx as at,jsxs as Uo}from"react/jsx-runtime";function Ko({needsPlan:e=false}){let[t,n]=Qs(false),r=nl();return Uo(N,{pointerEvents:"box-none",style:Vo.root,children:[at(Zs,{expanded:t,onPress:()=>n(true)}),t?at(Qo,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>n(false),children:Uo(N,{style:Vo.overlay,accessibilityViewIsModal:true,children:[at(Xo,{style:ct.absoluteFill,onPress:()=>n(false),accessible:false}),e&&r==="active"?at(el,{onClose:()=>n(false)}):at(tl,{onClose:()=>n(false)})]})}):null]})}var Vo=ct.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20}});function qo(e){if(e.length>6){let t=e.map(n=>`"${n}"`).join(", ");return e.slice(0,6)}return e}import{installedTools as ol,installedToolsFound as rl}from"@buoy-gg/core/web/installed-tools";import{Fragment as Gt,jsx as F,jsxs as st}from"react/jsx-runtime";var Go={},Jo="@react_buoy_floating_menu_tooltip_shown",il=Ee;function al({size:e=14,color:t="#20C997"}){let n=Math.max(2,e/4),r=Math.max(1,e/16);return F("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${n}px)`,gap:r,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((o,i)=>F("div",{style:{width:n,height:n,borderRadius:n/2,backgroundColor:t}},i))})}function sl(e){let{defaultFloatingTools:t,defaultDialTools:n,disableHints:r=false,children:o}=e,i=me(()=>n&&qo(n),[n]);return F(Ln,{defaultFloatingTools:t,defaultDialTools:i,children:F(ur,{disableHints:r,children:st(To,{children:[F(oo,{children:F(fl,{...e})}),o]})})})}var ll=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function cl({modules:e=Go}){return F(Gt,{children:Object.entries(e).flatMap(([t,n])=>ll.map(r=>{let o=n[r];return o?F(o,{},`${t}:${r}`):null}))})}function dl(){let{openApps:e,restore:t}=nt();return ee(()=>fr(n=>{let r=e.find(o=>o.id===n);return r?(t(r.instanceId),true):false}),[e,t]),null}function ul(){let e=sr();return pr((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}function pl(e,t,n,r){let o=u=>Object.entries(e).find(([f])=>f.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===u)?.[1],i=[],a=o("env");t?.length&&a?.createEnvTool&&a.createEnvVarConfig&&i.push(rt(a.createEnvTool({requiredEnvVars:a.createEnvVarConfig(t)})));let l=o("storage");n?.length&&l?.createStorageTool&&i.push(rt(l.createStorageTool({requiredStorageKeys:n})));let s=o("ask-buoy");return r&&s?.createAskBuoyTool&&i.push(rt(s.createAskBuoyTool(r))),i}function fl({environment:e,userRole:t="admin",availableEnvironments:n,onEnvironmentSwitch:r,apps:o,modules:i=Go,externalSync:a,requiredEnvVars:l,sentryGetClient:s,disableHints:u=false,headless:f=false,hidden:I=false,defaultFloatingTools:m,defaultDialTools:M,zustandStores:w,requiredStorageKeys:B,askBuoy:z}){let E=e??ul(),R=me(()=>M?qo(M):void 0,[M]),[k,v]=Mt(false),[C,P]=Mt(false),T=gr(false),A=nt(),Z=me(()=>pl(i,l,B,z),[i,l,B,z]),W=me(()=>Zt([...Co(i),...o??[],...Z]),[o,i,Z]),q=me(()=>Object.entries(i).find(([d])=>d.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[i]);ee(()=>{if(!w||typeof q?.watchStores!="function")return;let d=q.watchStores(w);return typeof d=="function"?d:void 0},[w,q]);let te=Kt(),K=A.openApps.some(d=>!d.minimized);ee(()=>{te.setDialOpen(k)},[k,te.setDialOpen]),ee(()=>{te.setToolOpen(K||C)},[K,C,te.setToolOpen]);let{registerApps:ie}=A;ee(()=>{ie(W.map(d=>{let _=d.icon;return{...d,icon:typeof _=="function"?({size:b})=>_(b):_}}))},[ie,W]);let ne=me(()=>W.map(d=>({id:d.id,name:d.name,description:d.description,slot:d.slot})),[W]);hr({availableTools:ne,storage:il}),ee(()=>{let d=false;return(async()=>{let[_,b]=await Promise.all([Ee.getItem(ut.dial.isOpen()),Ee.getItem(ut.settings.modalOpen())]);d||(_==="true"&&v(true),b==="true"&&(v(true),P(true)),T.current=true)})(),()=>{d=true}},[]),ee(()=>{T.current&&Ee.setItem(ut.dial.isOpen(),k?"true":"false")},[k]),ee(()=>{T.current&&Ee.setItem(ut.settings.modalOpen(),C?"true":"false")},[C]);let ve=We(d=>{if(ui(d.id),d.launchMode==="toggle-only"){d.onPress?.();return}if(d.component){let _=typeof d.icon=="function"?d.icon(20):d.icon;A.open({id:d.id,title:d.name||dt(d.id),component:d.component,props:d.props,modal:d.modal,launchMode:d.launchMode||"self-modal",singleton:d.singleton??true,icon:_,color:d.color||Qt(d.id)})}else d.onPress?.()},[A]),ae=me(()=>Bt(W,"dial").map(d=>{let _=d.color||Qt(d.id),b;return typeof d.icon=="string"?b=d.icon:typeof d.icon=="function"?b=d.icon(32):b=null,{id:d.id,name:d.name||dt(d.id),icon:b,unavailable:!d.component&&!d.onPress,color:_,onPress:()=>{ve(d),v(false)}}}),[W,ve]),Ie=me(()=>{if(!k)return ae;let d=new Map(ae.map(_=>[_.id,_]));return di(ae.map(_=>_.id)).map(_=>d.get(_)).filter(_=>!!_)},[k,ae]),{settings:$}=Hn(),qe=me(()=>Bt(W,"row").filter(d=>($.floatingTools[d.id]??false)===true&&(d.component||d.onPress)),[W,$.floatingTools]),ke=me(()=>W.map(d=>({id:d.id,name:d.name||dt(d.id),description:d.description||yr(d.id),slot:d.slot,icon:d.icon,color:d.color})),[W]),[Fe,ze]=Mt(false),se=A.openApps.some(d=>!d.minimized);ee(()=>{if(u)return;let d=false,_=setTimeout(async()=>{let b=await Ee.getItem(Jo);!d&&!b&&ze(true)},1e3);return()=>{d=true,clearTimeout(_)}},[u]);let J=We(()=>{ze(false),Ee.setItem(Jo,"true")},[]),Se=We(()=>{J(),v(true)},[J]),pe=We(()=>{v(false),P(false)},[]),Re=We(()=>{P(d=>!d)},[]),$e=We(()=>P(false),[]),he=!!(n?.length&&r),Me=$.floatingTools.environment!==false,ue=Fe&&!k&&!se&&!I;ee(()=>{if(!ue)return;let d=b=>{(!(b.target instanceof Element)||!b.target.closest("[data-buoy-root]"))&&J()},_=b=>{b.key==="Escape"&&J()};return document.addEventListener("pointerdown",d,true),document.addEventListener("keydown",_),()=>{document.removeEventListener("pointerdown",d,true),document.removeEventListener("keydown",_)}},[ue,J]);let ye=A.openApps.some(d=>d.minimized&&d.launchMode!=="toggle-only"),Be=F(Ks,{modules:i,apps:o,requiredEnvVars:l,externalSync:a,headless:f,sentryGetClient:s});return f?Be:st("div",{"data-buoy-root":"",style:{display:"contents"},children:[Be,F(dl,{}),ue&&F("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),F("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:st(en,{enablePositionPersistence:!ue,pushToSide:k||se,suspendPointerEvents:k,centerOnboarding:ue,minimizedStack:ye?F(Va,{}):void 0,hasMinimizedStack:ye,children:[E&&Me&&!he&&F(br,{environment:E}),he&&Me&&F(vr,{currentEnvironment:E??"local",availableEnvironments:n,onSelect:r}),t?F(tn,{userRole:t,onPress:Se}):F("button",{"aria-label":"Open dev tools",onClick:Se,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:F(al,{})}),qe.map(d=>F("button",{"aria-label":d.name||dt(d.id),title:d.description,onClick:()=>ve(d),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof d.icon=="function"?d.icon(16):d.icon},d.id))]})}),ue&&F(yn,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:J}),k&&!I&&F(xn,{icons:Ie,onClose:pe,centerLabel:"BUOY",onCenterPress:Re,settingsOpen:C,hintsDisabled:u}),C&&!I&&F(Kn,{visible:true,onClose:$e,availableTools:ke,defaultFloatingTools:m,defaultDialTools:R,onSettingsChange:d=>{}}),!I&&st(Gt,{children:[F(ro,{}),F(tr,{})]})]})}function ml(e){let t=e&&typeof e=="object"?e.appId:void 0,n=!!e;ee(()=>{if(!n)return;let r=false,o=nr.SessionManager;if(!o)return;let i=a=>{r||!a||(o.configure({audience:`app:${a}`}),o.load().catch(()=>{}))};return t?i(t):cr().then(a=>i(a?.bundleId)).catch(()=>{}),()=>{r=true}},[n,t])}var Yo=false;function gl(e){return e.modules?e:(!rl&&!Yo&&typeof console<"u"&&(Yo=true,console.info("[Buoy] No tools loaded. Add buoy() from '@buoy-gg/core/vite' to your Vite plugins, or pass modules to FloatingDevTools.")),{...e,modules:ol})}function hl(e){let t=gl(e),{access:n,isPro:r,licenseKey:o}=rr();ee(()=>{or.configure(t.licenseKey)},[t.licenseKey]);let i=t.licenseKey===void 0||ir(t.licenseKey,o),a=ar(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),l=i&&n.status==="admitted";ee(()=>{l&&mr()},[l]),ee(()=>{a||n.status==="initializing"||(r&&l?Zo():er())},[a,r,l,n.status]);let s=lr();return ml(s?t.signIn:void 0),!a&&!r?!t.signIn||t.headless?null:s?F(Ko,{needsPlan:true}):F(Ys,{}):l?F(sl,{...t}):st(Gt,{children:[n.status==="initializing"&&F(cl,{modules:t.modules}),t.headless?null:t.signIn&&s?F(Ko,{}):F(dr,{})]})}export{Sr as a,wr as b,Zt as c,Bt as d,xr as e,en as f,Tr as g,tn as h,xn as i,Kn as j,Zn as k,ya as l,Ia as m,oo as n,nt as o,ro as p,rt as q,To as r,Kt as s,Co as t,Lo as u,hl as v};
@@ -1 +1 @@
1
- "use client";import{b as V,c as L}from"./chunk-CLXYMJTS.mjs";import{toolTheme as P}from"@buoy-gg/shared-ui/web";var v={};V(v,{AccessibilityInfo:()=>H,ActivityIndicator:()=>ke,Alert:()=>Me,Animated:()=>w,AppRegistry:()=>z,AppState:()=>N,Appearance:()=>F,BackHandler:()=>O,Button:()=>Ae,CheckBox:()=>ee,Clipboard:()=>U,DeviceEventEmitter:()=>ge,Dimensions:()=>S,Easing:()=>W,FlatList:()=>ae,I18nManager:()=>K,Image:()=>se,ImageBackground:()=>te,InteractionManager:()=>$,Keyboard:()=>j,KeyboardAvoidingView:()=>oe,LayoutAnimation:()=>G,Linking:()=>q,LogBox:()=>he,Modal:()=>A,NativeEventEmitter:()=>J,NativeModules:()=>R,PanResponder:()=>_,Picker:()=>re,PixelRatio:()=>X,Platform:()=>C,Pressable:()=>E,ProgressBar:()=>ie,RefreshControl:()=>ne,SafeAreaView:()=>le,ScrollView:()=>k,SectionList:()=>ce,Share:()=>Y,StatusBar:()=>de,StyleSheet:()=>b,Switch:()=>Ee,Text:()=>x,TextInput:()=>Se,Touchable:()=>ue,TouchableHighlight:()=>Ce,TouchableNativeFeedback:()=>me,TouchableOpacity:()=>T,TouchableWithoutFeedback:()=>Te,UIManager:()=>Z,Vibration:()=>Q,View:()=>f,VirtualizedList:()=>pe,YellowBox:()=>fe,findNodeHandle:()=>Be,unstable_createElement:()=>D,useColorScheme:()=>xe,useLocaleContext:()=>be,useWindowDimensions:()=>ye});L(v,I);import*as I from"react-native-web";import{unstable_createElement as D,NativeModules as R,AccessibilityInfo as H,Animated as w,Appearance as F,AppRegistry as z,AppState as N,BackHandler as O,Clipboard as U,Dimensions as S,Easing as W,I18nManager as K,Keyboard as j,InteractionManager as $,LayoutAnimation as G,Linking as q,NativeEventEmitter as J,PanResponder as _,PixelRatio as X,Platform as C,Share as Y,StyleSheet as b,UIManager as Z,Vibration as Q,CheckBox as ee,FlatList as ae,Image as se,ImageBackground as te,KeyboardAvoidingView as oe,Picker as re,ProgressBar as ie,RefreshControl as ne,SafeAreaView as le,SectionList as ce,StatusBar as de,Touchable as ue,TouchableNativeFeedback as me,VirtualizedList as pe,YellowBox as fe,LogBox as he,DeviceEventEmitter as ge,useColorScheme as xe,useLocaleContext as be,useWindowDimensions as ye}from"react-native-web";import*as i from"react-native-web";import{createElement as ve,forwardRef as we}from"react";function l(a){let t=we((r,s)=>{let{accessibilityState:c,accessibilityValue:m,...u}=r;for(let d of["busy","checked","disabled","expanded","selected"])c?.[d]!==void 0&&u[`aria-${d}`]===void 0&&(u[`aria-${d}`]=c[d]);for(let[d,n]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))m?.[d]!==void 0&&u[`aria-${n}`]===void 0&&(u[`aria-${n}`]=m[d]);return ve(a,{...u,ref:s})}),o=a.State;return o&&Object.assign(t,{State:o}),t.displayName=a.displayName??a.name??"NativeWebView",t}var f=l(i.View),x=l(i.Text),Se=l(i.TextInput),T=l(i.TouchableOpacity),Ce=l(i.TouchableHighlight),Te=l(i.TouchableWithoutFeedback),E=l(i.Pressable),k=l(i.ScrollView),A=l(i.Modal),Ee=l(i.Switch),ke=l(i.ActivityIndicator),Ae=l(i.Button),Be=i.findNodeHandle,Me={alert(a,t,o,r){if(typeof document>"u")return;let s=document.createElement("dialog");s.dataset.buoyRoot="",s.setAttribute("aria-label",a),s.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 c=document.createElement("h2");if(c.textContent=a,c.style.cssText="font-size:18px;margin:0 0 12px",s.appendChild(c),t){let n=document.createElement("p");n.textContent=t,n.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",s.appendChild(n)}let m=document.createElement("div");m.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let u=o?.length?o:[{text:"OK"}],d=()=>{s.close?.(),s.remove()};for(let n of u){let g=document.createElement("button");g.type="button",g.textContent=n.text??"OK",g.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${n.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,g.onclick=()=>{d(),n.onPress?.()},m.appendChild(g)}s.addEventListener("cancel",n=>{n.preventDefault(),r?.cancelable!==false&&(d(),r?.onDismiss?.())}),s.appendChild(m),document.body.appendChild(s),s.showModal?s.showModal():s.setAttribute("open","")}};import{CopyButton as Ve,toolTheme as e}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as Le,SplitDiffViewer as Pe}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as p,jsxs as B}from"react/jsx-runtime";var Ie={success:e.colors.success,active:e.colors.success,connected:e.colors.success,error:e.colors.error,failed:e.colors.error,warning:e.colors.warning,stale:e.colors.warning,pending:e.colors.info,loading:e.colors.info,fetching:e.colors.info,info:e.colors.info,inactive:e.colors.textMuted,idle:e.colors.textMuted};function M(a){return Ie[a.toLowerCase()]??e.colors.textMuted}var De={GET:e.colors.info,POST:e.colors.success,PUT:e.colors.warning,PATCH:e.colors.warning,DELETE:e.colors.error};function Re(a){return De[a.toUpperCase()]??e.colors.textSecondary}var He={string:e.colors.success,number:e.colors.info,boolean:e.colors.warning,object:e.colors.accent,array:e.colors.accent,function:e.colors.error,null:e.colors.textMuted,undefined:e.colors.textMuted};function Fe(a){return He[a.toLowerCase()]??e.colors.textSecondary}function ze({children:a,color:t=e.colors.textSecondary,icon:o,size:r="small",pill:s=false,mono:c=false,style:m}){let u=typeof a=="string"||typeof a=="number";return B(f,{style:[h.base,r==="medium"&&h.medium,s&&h.pill,{backgroundColor:t+"1A",borderColor:t+"40"},m],children:[o,u?p(x,{style:[h.text,r==="medium"&&h.textMedium,c&&h.textMono,{color:t}],numberOfLines:1,children:a}):a]})}var h=b.create({base:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",gap:4,borderWidth:1,borderRadius:e.radius.sm,paddingHorizontal:6,paddingVertical:2},medium:{paddingHorizontal:8,paddingVertical:3},pill:{borderRadius:e.radius.pill,minWidth:20,justifyContent:"center"},text:{fontSize:10,fontWeight:"600",letterSpacing:.3},textMedium:{fontSize:12},textMono:{fontFamily:e.text.mono.fontFamily}});function Ne({status:a,color:t,size:o=8,style:r}){let s=t??(a?M(a):e.colors.textMuted);return p(f,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:s},r]})}function Oe({label:a,value:t,copyable:o=false,style:r}){let s=typeof t=="string"||typeof t=="number";return B(f,{style:[y.row,r],children:[p(x,{style:y.label,numberOfLines:1,children:a}),p(f,{style:y.value,children:s?p(x,{style:y.valueText,numberOfLines:2,children:String(t)}):t}),o&&t!=null&&p(Ve,{value:t,size:12})]})}var y=b.create({row:{flexDirection:"row",alignItems:"center",gap:e.spacing.sm,paddingVertical:3},label:{...e.text.label,color:e.colors.textMuted,minWidth:72},value:{flex:1,flexDirection:"row",alignItems:"center"},valueText:{...e.text.mono,color:e.colors.text}});function Ue({oldValue:a,newValue:t,mode:o="tree",showUnchanged:r=true,scrollEnabled:s=false,height:c=220}){return o==="text"?p(Pe,{oldValue:a,newValue:t,height:c}):p(Le,{oldValue:a,newValue:t,showUnchanged:r,scrollEnabled:s})}import{ToolButton as We,CopyButton as Ke,PowerToggleButton as je}from"@buoy-gg/shared-ui/web";import{CompactRow as $e,DevToolsCard as Ge}from"@buoy-gg/shared-ui/web";import{SectionHeader as qe,CollapsibleSection as Je,TabSelector as _e,EmptyState as Xe,SearchBar as Ye,EventStepperFooter as Ze}from"@buoy-gg/shared-ui/web";import{DataViewer as Qe}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as ea}from"@buoy-gg/shared-ui/web";import{RelativeTime as aa}from"@buoy-gg/shared-ui/web";import{formatBytes as sa,formatDuration as ta,formatNumber as oa,truncateMiddle as ra,safeStringify as ia}from"@buoy-gg/shared-ui/web";import{usePersistedState as na,persistentStorage as la,devToolsStorageKeys as ca}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as da,copyToClipboard as ua}from"@buoy-gg/shared-ui/web";import{JsModal as ma}from"@buoy-gg/shared-ui/web";import{Activity as pa,AlertTriangle as fa,Bug as ha,Check as ga,CheckCircle as xa,ChevronDown as ba,ChevronLeft as ya,ChevronRight as va,ChevronUp as wa,Clock as Sa,Copy as Ca,Database as Ta,Eye as Ea,EyeOff as ka,FileJson as Aa,FileText as Ba,Filter as Ma,FlaskConical as Va,Globe as La,Hash as Pa,Info as Ia,Key as Da,Layers as Ra,Lock as Ha,Pause as Fa,Play as za,Plus as Na,Power as Oa,RefreshCw as Ua,Search as Wa,Settings as Ka,Shield as ja,Trash2 as $a,User as Ga,Wifi as qa,X as Ja,Zap as _a,AlertCircle as Xa,BarChart3 as Ya,Bookmark as Za,Cloud as Qa,Download as es,Edit3 as as,GitBranch as ss,HardDrive as ts,HelpCircle as os,Home as rs,Image as is,Link as ns,Maximize2 as ls,Minus as cs,Palette as ds,Pin as us,Route as ms,Server as ps,Smartphone as fs,Square as hs,CheckSquare as gs,Timer as xs,Unlock as bs,Upload as ys,Users as vs,XCircle as ws}from"@buoy-gg/shared-ui/web";export{f as a,x as b,T as c,E as d,k as e,A as f,v as g,w as h,S as i,C as j,b as k,M as l,Re as m,Fe as n,ze as o,Ne as p,Oe as q,Ue as r,P as s,We as t,Ke as u,je as v,$e as w,Ge as x,qe as y,Je as z,_e as A,Xe as B,Ye as C,Ze as D,Qe as E,ea as F,aa as G,sa as H,ta as I,oa as J,ra as K,ia as L,na as M,la as N,ca as O,da as P,ua as Q,ma as R,pa as S,fa as T,ha as U,ga as V,xa as W,ba as X,ya as Y,va as Z,wa as _,Sa as $,Ca as aa,Ta as ba,Ea as ca,ka as da,Aa as ea,Ba as fa,Ma as ga,Va as ha,La as ia,Pa as ja,Ia as ka,Da as la,Ra as ma,Ha as na,Fa as oa,za as pa,Na as qa,Oa as ra,Ua as sa,Wa as ta,Ka as ua,ja as va,$a as wa,Ga as xa,qa as ya,Ja as za,_a as Aa,Xa as Ba,Ya as Ca,Za as Da,Qa as Ea,es as Fa,as as Ga,ss as Ha,ts as Ia,os as Ja,rs as Ka,is as La,ns as Ma,ls as Na,cs as Oa,ds as Pa,us as Qa,ms as Ra,ps as Sa,fs as Ta,hs as Ua,gs as Va,xs as Wa,bs as Xa,ys as Ya,vs as Za,ws as _a};
1
+ "use client";import{b as V,c as L}from"./chunk-CLXYMJTS.mjs";import{toolTheme as P}from"@buoy-gg/shared-ui/web";var v={};V(v,{AccessibilityInfo:()=>H,ActivityIndicator:()=>ka,Alert:()=>Ma,Animated:()=>w,AppRegistry:()=>z,AppState:()=>N,Appearance:()=>F,BackHandler:()=>O,Button:()=>Aa,CheckBox:()=>aa,Clipboard:()=>U,DeviceEventEmitter:()=>ga,Dimensions:()=>S,Easing:()=>W,FlatList:()=>ea,I18nManager:()=>K,Image:()=>sa,ImageBackground:()=>ta,InteractionManager:()=>$,Keyboard:()=>j,KeyboardAvoidingView:()=>oa,LayoutAnimation:()=>G,Linking:()=>q,LogBox:()=>ha,Modal:()=>A,NativeEventEmitter:()=>J,NativeModules:()=>R,PanResponder:()=>X,Picker:()=>ra,PixelRatio:()=>Y,Platform:()=>C,Pressable:()=>E,ProgressBar:()=>ia,RefreshControl:()=>na,SafeAreaView:()=>la,ScrollView:()=>k,SectionList:()=>ca,Share:()=>_,StatusBar:()=>da,StyleSheet:()=>x,Switch:()=>Ea,Text:()=>b,TextInput:()=>Sa,Touchable:()=>ua,TouchableHighlight:()=>Ca,TouchableNativeFeedback:()=>ma,TouchableOpacity:()=>T,TouchableWithoutFeedback:()=>Ta,UIManager:()=>Z,Vibration:()=>Q,View:()=>f,VirtualizedList:()=>pa,YellowBox:()=>fa,findNodeHandle:()=>Ba,unstable_createElement:()=>D,useColorScheme:()=>ba,useLocaleContext:()=>xa,useWindowDimensions:()=>ya});L(v,I);import*as I from"react-native-web";import{unstable_createElement as D,NativeModules as R,AccessibilityInfo as H,Animated as w,Appearance as F,AppRegistry as z,AppState as N,BackHandler as O,Clipboard as U,Dimensions as S,Easing as W,I18nManager as K,Keyboard as j,InteractionManager as $,LayoutAnimation as G,Linking as q,NativeEventEmitter as J,PanResponder as X,PixelRatio as Y,Platform as C,Share as _,StyleSheet as x,UIManager as Z,Vibration as Q,CheckBox as aa,FlatList as ea,Image as sa,ImageBackground as ta,KeyboardAvoidingView as oa,Picker as ra,ProgressBar as ia,RefreshControl as na,SafeAreaView as la,SectionList as ca,StatusBar as da,Touchable as ua,TouchableNativeFeedback as ma,VirtualizedList as pa,YellowBox as fa,LogBox as ha,DeviceEventEmitter as ga,useColorScheme as ba,useLocaleContext as xa,useWindowDimensions as ya}from"react-native-web";import*as i from"react-native-web";import{createElement as va,forwardRef as wa}from"react";function l(e){let t=wa((r,s)=>{let{accessibilityState:c,accessibilityValue:m,...u}=r;for(let d of["busy","checked","disabled","expanded","selected"])c?.[d]!==void 0&&u[`aria-${d}`]===void 0&&(u[`aria-${d}`]=c[d]);for(let[d,n]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))m?.[d]!==void 0&&u[`aria-${n}`]===void 0&&(u[`aria-${n}`]=m[d]);return va(e,{...u,ref:s})}),o=e.State;return o&&Object.assign(t,{State:o}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=l(i.View),b=l(i.Text),Sa=l(i.TextInput),T=l(i.TouchableOpacity),Ca=l(i.TouchableHighlight),Ta=l(i.TouchableWithoutFeedback),E=l(i.Pressable),k=l(i.ScrollView),A=l(i.Modal),Ea=l(i.Switch),ka=l(i.ActivityIndicator),Aa=l(i.Button),Ba=i.findNodeHandle,Ma={alert(e,t,o,r){if(typeof document>"u")return;let s=document.createElement("dialog");s.dataset.buoyRoot="",s.setAttribute("aria-label",e),s.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 c=document.createElement("h2");if(c.textContent=e,c.style.cssText="font-size:18px;margin:0 0 12px",s.appendChild(c),t){let n=document.createElement("p");n.textContent=t,n.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",s.appendChild(n)}let m=document.createElement("div");m.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let u=o?.length?o:[{text:"OK"}],d=()=>{s.close?.(),s.remove()};for(let n of u){let g=document.createElement("button");g.type="button",g.textContent=n.text??"OK",g.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${n.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,g.onclick=()=>{d(),n.onPress?.()},m.appendChild(g)}s.addEventListener("cancel",n=>{n.preventDefault(),r?.cancelable!==false&&(d(),r?.onDismiss?.())}),s.appendChild(m),document.body.appendChild(s),s.showModal?s.showModal():s.setAttribute("open","")}};import{CopyButton as Va,toolTheme as a}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as La,SplitDiffViewer as Pa}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as p,jsxs as B}from"react/jsx-runtime";var Ia={success:a.colors.success,active:a.colors.success,connected:a.colors.success,error:a.colors.error,failed:a.colors.error,warning:a.colors.warning,stale:a.colors.warning,pending:a.colors.info,loading:a.colors.info,fetching:a.colors.info,info:a.colors.info,inactive:a.colors.textMuted,idle:a.colors.textMuted};function M(e){return Ia[e.toLowerCase()]??a.colors.textMuted}var Da={GET:a.colors.info,POST:a.colors.success,PUT:a.colors.warning,PATCH:a.colors.warning,DELETE:a.colors.error};function Ra(e){return Da[e.toUpperCase()]??a.colors.textSecondary}var Ha={string:a.colors.success,number:a.colors.info,boolean:a.colors.warning,object:a.colors.accent,array:a.colors.accent,function:a.colors.error,null:a.colors.textMuted,undefined:a.colors.textMuted};function Fa(e){return Ha[e.toLowerCase()]??a.colors.textSecondary}function za({children:e,color:t=a.colors.textSecondary,icon:o,size:r="small",pill:s=false,mono:c=false,style:m}){let u=typeof e=="string"||typeof e=="number";return B(f,{style:[h.base,r==="medium"&&h.medium,s&&h.pill,{backgroundColor:t+"1A",borderColor:t+"40"},m],children:[o,u?p(b,{style:[h.text,r==="medium"&&h.textMedium,c&&h.textMono,{color:t}],numberOfLines:1,children:e}):e]})}var h=x.create({base:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",gap:4,borderWidth:1,borderRadius:a.radius.sm,paddingHorizontal:6,paddingVertical:2},medium:{paddingHorizontal:8,paddingVertical:3},pill:{borderRadius:a.radius.pill,minWidth:20,justifyContent:"center"},text:{fontSize:10,fontWeight:"600",letterSpacing:.3},textMedium:{fontSize:12},textMono:{fontFamily:a.text.mono.fontFamily}});function Na({status:e,color:t,size:o=8,style:r}){let s=t??(e?M(e):a.colors.textMuted);return p(f,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:s},r]})}function Oa({label:e,value:t,copyable:o=false,style:r}){let s=typeof t=="string"||typeof t=="number";return B(f,{style:[y.row,r],children:[p(b,{style:y.label,numberOfLines:1,children:e}),p(f,{style:y.value,children:s?p(b,{style:y.valueText,numberOfLines:2,children:String(t)}):t}),o&&t!=null&&p(Va,{value:t,size:12})]})}var y=x.create({row:{flexDirection:"row",alignItems:"center",gap:a.spacing.sm,paddingVertical:3},label:{...a.text.label,color:a.colors.textMuted,minWidth:72},value:{flex:1,flexDirection:"row",alignItems:"center"},valueText:{...a.text.mono,color:a.colors.text}});function Ua({oldValue:e,newValue:t,mode:o="tree",showUnchanged:r=true,scrollEnabled:s=false,height:c=220}){return o==="text"?p(Pa,{oldValue:e,newValue:t,height:c}):p(La,{oldValue:e,newValue:t,showUnchanged:r,scrollEnabled:s})}import{ToolButton as Wa,CopyButton as Ka,PowerToggleButton as ja}from"@buoy-gg/shared-ui/web";import{CompactRow as $a,DevToolsCard as Ga}from"@buoy-gg/shared-ui/web";import{SectionHeader as qa,CollapsibleSection as Ja,TabSelector as Xa,EmptyState as Ya,SearchBar as _a,EventStepperFooter as Za}from"@buoy-gg/shared-ui/web";import{DataViewer as Qa}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as ae}from"@buoy-gg/shared-ui/web";import{RelativeTime as ee}from"@buoy-gg/shared-ui/web";import{formatBytes as se,formatDuration as te,formatNumber as oe,truncateMiddle as re,safeStringify as ie}from"@buoy-gg/shared-ui/web";import{usePersistedState as ne,persistentStorage as le,devToolsStorageKeys as ce}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as de,copyToClipboard as ue}from"@buoy-gg/shared-ui/web";import{JsModal as me}from"@buoy-gg/shared-ui/web";import{Activity as pe,AlertTriangle as fe,Bug as he,Check as ge,CheckCircle as be,ChevronDown as xe,ChevronLeft as ye,ChevronRight as ve,ChevronUp as we,Clock as Se,Copy as Ce,Database as Te,Eye as Ee,EyeOff as ke,FileJson as Ae,FileText as Be,Filter as Me,FlaskConical as Ve,Globe as Le,Hash as Pe,Info as Ie,Key as De,Layers as Re,Lock as He,Pause as Fe,Play as ze,Plus as Ne,Power as Oe,RefreshCw as Ue,Search as We,Settings as Ke,Shield as je,Trash2 as $e,User as Ge,Wifi as qe,X as Je,Zap as Xe,AlertCircle as Ye,BarChart3 as _e,Bookmark as Ze,Cloud as Qe,Download as as,Edit3 as es,GitBranch as ss,HardDrive as ts,HelpCircle as os,Home as rs,Image as is,Link as ns,Maximize2 as ls,Minus as cs,Palette as ds,Pin as us,Route as ms,Server as ps,Smartphone as fs,Square as hs,CheckSquare as gs,Timer as bs,Unlock as xs,Upload as ys,Users as vs,XCircle as ws}from"@buoy-gg/shared-ui/web";export{f as a,b,T as c,E as d,k as e,A as f,v as g,w as h,S as i,C as j,x as k,M as l,Ra as m,Fa as n,za as o,Na as p,Oa as q,Ua as r,P as s,Wa as t,Ka as u,ja as v,$a as w,Ga as x,qa as y,Ja as z,Xa as A,Ya as B,_a as C,Za as D,Qa as E,ae as F,ee as G,se as H,te as I,oe as J,re as K,ie as L,ne as M,le as N,ce as O,de as P,ue as Q,me as R,pe as S,fe as T,he as U,ge as V,be as W,xe as X,ye as Y,ve as Z,we as _,Se as $,Ce as aa,Te as ba,Ee as ca,ke as da,Ae as ea,Be as fa,Me as ga,Ve as ha,Le as ia,Pe as ja,Ie as ka,De as la,Re as ma,He as na,Fe as oa,ze as pa,Ne as qa,Oe as ra,Ue as sa,We as ta,Ke as ua,je as va,$e as wa,Ge as xa,qe as ya,Je as za,Xe as Aa,Ye as Ba,_e as Ca,Ze as Da,Qe as Ea,as as Fa,es as Ga,ss as Ha,ts as Ia,os as Ja,rs as Ka,is as La,ns as Ma,ls as Na,cs as Oa,ds as Pa,us as Qa,ms as Ra,ps as Sa,fs as Ta,hs as Ua,gs as Va,bs as Wa,xs as Xa,ys as Ya,vs as Za,ws as _a};
@@ -0,0 +1 @@
1
+ "use client";import{a as n,b as d,g as de,k as m}from"./chunk-7G3P7Z7K.mjs";import{toolTheme as y}from"@buoy-gg/shared-ui/web";import{CopyButton as x,toolTheme as a}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as b,SplitDiffViewer as C}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as t,jsxs as f}from"react/jsx-runtime";var S={success:a.colors.success,active:a.colors.success,connected:a.colors.success,error:a.colors.error,failed:a.colors.error,warning:a.colors.warning,stale:a.colors.warning,pending:a.colors.info,loading:a.colors.info,fetching:a.colors.info,info:a.colors.info,inactive:a.colors.textMuted,idle:a.colors.textMuted};function p(e){return S[e.toLowerCase()]??a.colors.textMuted}var w={GET:a.colors.info,POST:a.colors.success,PUT:a.colors.warning,PATCH:a.colors.warning,DELETE:a.colors.error};function v(e){return w[e.toUpperCase()]??a.colors.textSecondary}var T={string:a.colors.success,number:a.colors.info,boolean:a.colors.warning,object:a.colors.accent,array:a.colors.accent,function:a.colors.error,null:a.colors.textMuted,undefined:a.colors.textMuted};function M(e){return T[e.toLowerCase()]??a.colors.textSecondary}function D({children:e,color:s=a.colors.textSecondary,icon:o,size:r="small",pill:l=false,mono:u=false,style:g}){let h=typeof e=="string"||typeof e=="number";return f(n,{style:[i.base,r==="medium"&&i.medium,l&&i.pill,{backgroundColor:s+"1A",borderColor:s+"40"},g],children:[o,h?t(d,{style:[i.text,r==="medium"&&i.textMedium,u&&i.textMono,{color:s}],numberOfLines:1,children:e}):e]})}var i=m.create({base:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",gap:4,borderWidth:1,borderRadius:a.radius.sm,paddingHorizontal:6,paddingVertical:2},medium:{paddingHorizontal:8,paddingVertical:3},pill:{borderRadius:a.radius.pill,minWidth:20,justifyContent:"center"},text:{fontSize:10,fontWeight:"600",letterSpacing:.3},textMedium:{fontSize:12},textMono:{fontFamily:a.text.mono.fontFamily}});function k({status:e,color:s,size:o=8,style:r}){let l=s??(e?p(e):a.colors.textMuted);return t(n,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:l},r]})}function B({label:e,value:s,copyable:o=false,style:r}){let l=typeof s=="string"||typeof s=="number";return f(n,{style:[c.row,r],children:[t(d,{style:c.label,numberOfLines:1,children:e}),t(n,{style:c.value,children:l?t(d,{style:c.valueText,numberOfLines:2,children:String(s)}):s}),o&&s!=null&&t(x,{value:s,size:12})]})}var c=m.create({row:{flexDirection:"row",alignItems:"center",gap:a.spacing.sm,paddingVertical:3},label:{...a.text.label,color:a.colors.textMuted,minWidth:72},value:{flex:1,flexDirection:"row",alignItems:"center"},valueText:{...a.text.mono,color:a.colors.text}});function E({oldValue:e,newValue:s,mode:o="tree",showUnchanged:r=true,scrollEnabled:l=false,height:u=220}){return o==="text"?t(C,{oldValue:e,newValue:s,height:u}):t(b,{oldValue:e,newValue:s,showUnchanged:r,scrollEnabled:l})}import{ToolButton as P,CopyButton as V,PowerToggleButton as L}from"@buoy-gg/shared-ui/web";import{CompactRow as z,DevToolsCard as H}from"@buoy-gg/shared-ui/web";import{SectionHeader as R,CollapsibleSection as U,TabSelector as F,EmptyState as I,SearchBar as A,EventStepperFooter as O}from"@buoy-gg/shared-ui/web";import{DataViewer as j}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as G}from"@buoy-gg/shared-ui/web";import{RelativeTime as W}from"@buoy-gg/shared-ui/web";import{formatBytes as J,formatDuration as K,formatNumber as q,truncateMiddle as X,safeStringify as N}from"@buoy-gg/shared-ui/web";import{usePersistedState as Z,persistentStorage as Q,devToolsStorageKeys as _}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as $,copyToClipboard as Y}from"@buoy-gg/shared-ui/web";import{JsModal as aa}from"@buoy-gg/shared-ui/web";import{Activity as ea,AlertTriangle as sa,Bug as oa,Check as ra,CheckCircle as ta,ChevronDown as la,ChevronLeft as ia,ChevronRight as na,ChevronUp as ca,Clock as ua,Copy as da,Database as ma,Eye as fa,EyeOff as pa,FileJson as ga,FileText as ha,Filter as ya,FlaskConical as xa,Globe as ba,Hash as Ca,Info as Sa,Key as wa,Layers as va,Lock as Ta,Pause as Ma,Play as Da,Plus as ka,Power as Ba,RefreshCw as Ea,Search as Pa,Settings as Va,Shield as La,Trash2 as za,User as Ha,Wifi as Ra,X as Ua,Zap as Fa,AlertCircle as Ia,BarChart3 as Aa,Bookmark as Oa,Cloud as ja,Download as Ga,Edit3 as Wa,GitBranch as Ja,HardDrive as Ka,HelpCircle as qa,Home as Xa,Image as Na,Link as Za,Maximize2 as Qa,Minus as _a,Palette as $a,Pin as Ya,Route as ae,Server as ee,Smartphone as se,Square as oe,CheckSquare as re,Timer as te,Unlock as le,Upload as ie,Users as ne,XCircle as ce}from"@buoy-gg/shared-ui/web";export{p as a,v as b,M as c,D as d,k as e,B as f,E as g,y as h,P as i,V as j,L as k,z as l,H as m,R as n,U as o,F as p,I as q,A as r,O as s,j as t,G as u,W as v,J as w,K as x,q as y,X as z,N as A,Z as B,Q as C,_ as D,$ as E,Y as F,aa as G,ea as H,sa as I,oa as J,ra as K,ta as L,la as M,ia as N,na as O,ca as P,ua as Q,da as R,ma as S,fa as T,pa as U,ga as V,ha as W,ya as X,xa as Y,ba as Z,Ca as _,Sa as $,wa as aa,va as ba,Ta as ca,Ma as da,Da as ea,ka as fa,Ba as ga,Ea as ha,Pa as ia,Va as ja,La as ka,za as la,Ha as ma,Ra as na,Ua as oa,Fa as pa,Ia as qa,Aa as ra,Oa as sa,ja as ta,Ga as ua,Wa as va,Ja as wa,Ka as xa,qa as ya,Xa as za,Na as Aa,Za as Ba,Qa as Ca,_a as Da,$a as Ea,Ya as Fa,ae as Ga,ee as Ha,se as Ia,oe as Ja,re as Ka,te as La,le as Ma,ie as Na,ne as Oa,ce as Pa};