@buoy-gg/core 7.0.73 → 7.0.75

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 (50) hide show
  1. package/bin/buoy.js +5 -5
  2. package/bundlers/vite.d.ts +11 -4
  3. package/bundlers/vite.mjs +4 -4
  4. package/lib/commonjs/floatingMenu/AppHost.web.js +1 -1
  5. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  6. package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -1
  7. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -1
  8. package/lib/commonjs/floatingMenu/FloatingMenu.js +1 -1
  9. package/lib/commonjs/floatingMenu/TeamToolCloser.js +1 -0
  10. package/lib/commonjs/floatingMenu/dial/DialDevTools.js +1 -1
  11. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +1 -1
  12. package/lib/commonjs/floatingMenu/teamToolsNote.js +1 -0
  13. package/lib/commonjs/telemetry/installPing.js +1 -1
  14. package/lib/commonjs/version.js +1 -1
  15. package/lib/module/floatingMenu/AppHost.web.js +1 -1
  16. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  17. package/lib/module/floatingMenu/FloatingDevTools.js +1 -1
  18. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -1
  19. package/lib/module/floatingMenu/FloatingMenu.js +1 -1
  20. package/lib/module/floatingMenu/TeamToolCloser.js +1 -0
  21. package/lib/module/floatingMenu/dial/DialDevTools.js +1 -1
  22. package/lib/module/floatingMenu/dial/DialDevTools.web.js +1 -1
  23. package/lib/module/floatingMenu/teamToolsNote.js +1 -0
  24. package/lib/module/telemetry/installPing.js +1 -1
  25. package/lib/module/version.js +1 -1
  26. package/lib/typescript/commonjs/Buoy.d.ts +2 -0
  27. package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts +2 -0
  28. package/lib/typescript/commonjs/floatingMenu/TeamToolCloser.d.ts +13 -0
  29. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts +2 -0
  30. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts +3 -1
  31. package/lib/typescript/commonjs/floatingMenu/teamToolsNote.d.ts +6 -0
  32. package/lib/typescript/commonjs/version.d.ts +1 -1
  33. package/lib/typescript/module/Buoy.d.ts +2 -0
  34. package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts +2 -0
  35. package/lib/typescript/module/floatingMenu/TeamToolCloser.d.ts +13 -0
  36. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts +2 -0
  37. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts +3 -1
  38. package/lib/typescript/module/floatingMenu/teamToolsNote.d.ts +6 -0
  39. package/lib/typescript/module/version.d.ts +1 -1
  40. package/lib/web/auto.mjs +1 -1
  41. package/lib/web/chunks/FloatingDevTools.web-NMBTDON7.mjs +1 -0
  42. package/lib/web/chunks/chunk-2N5IPIMV.mjs +10 -0
  43. package/lib/web/chunks/chunk-C6HZO5XT.mjs +1 -0
  44. package/lib/web/chunks/chunk-LU4GPZ5L.mjs +2 -2
  45. package/lib/web/chunks/chunk-RBPDZUHO.mjs +1 -1
  46. package/lib/web/chunks/chunk-V4BVRDHL.mjs +1 -0
  47. package/lib/web/chunks/chunk-Z6I7ZD34.mjs +1 -1
  48. package/lib/web/index.mjs +1 -1
  49. package/lib/web/toolkit.mjs +1 -1
  50. package/package.json +5 -5
@@ -1 +1 @@
1
- "use strict";import{useState as u,useEffect as E,useMemo as Z,useRef as J,useCallback as Q}from"react";import{dialAccessibilityLabel as Ee}from"./dialA11y.js";import{getDialLayout as $e,getAllIconPositions as Le,getGridLineRotations as Fe,getIconStaggerInputRange as We,MAX_DIAL_SLOTS as U,DIAL_ICON_SIZE as Ge,dialAnimationConfig as he,getDialCSSKeyframesString as He,getDialCSSAnimationStyles as _e,dialColors as r,dialStyles as e,withAlpha as ye,floatingToolsColors as je}from"@buoy-gg/floating-tools-react";import{persistentStorage as be,monoFont as Se,ToolBackground as Oe,useToolBackground as qe}from"@buoy-gg/shared-ui";import{DialHyperspace as Ue}from"./DialHyperspace.js";import{OnboardingTooltip as Ke}from"./OnboardingTooltip.web.js";import{jsx as o,Fragment as Ne,jsxs as P}from"react/jsx-runtime";const Ve={x:.5,y:.5};const xe="@react_buoy_settings_tooltip_shown";let we=false;function Xe(){if(we||typeof document==="undefined")return;const n=document.createElement("style");n.textContent=He();document.head.appendChild(n);we=true}const G=n=>1-Math.pow(1-n,3);const de=n=>n*n*n;function Ye({icon:n,index:p,totalIcons:D,position:y,progress:c,onPress:x}){const[B,$]=u(false);const[R,w]=u(false);const C=!n.icon&&n.id.startsWith("empty-");const K=!C&&n.unavailable===true;const v=!C&&!K;const{icons:N}=he;const b=We(p,D);let m=0;if(c<=b[1]){m=0}else if(c<=b[2]){m=(c-b[1])/(b[2]-b[1])}else{m=1}m=Math.max(0,Math.min(1,m));const k=Ge;const ee=N.pressIn.scale;const H=1.1;const V=m*(R?ee:B?H:1);let A=0;if(m<=0){A=0}else if(m<=.3){A=m}else{A=.3+(m-.3)*(.7/.7)}const te=y.x*m;const ne=y.y*m;return o("button",{role:"menuitem","aria-label":C?"Empty slot":Ee(n.id,n.name),"data-testid":n.id?`buoy-dial-${n.id}`:void 0,"aria-disabled":!v,tabIndex:v?0:-1,onClick:v?x:void 0,onPointerEnter:oe=>v&&oe.pointerType==="mouse"&&$(true),onPointerLeave:()=>{$(false);w(false)},onPointerDown:()=>v&&w(true),onPointerUp:()=>w(false),onPointerCancel:()=>w(false),style:{position:"absolute",left:"50%",top:"50%",width:k,height:k,marginLeft:-k/2,marginTop:-k/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:v?"pointer":"default",transform:`translate(${te}px, ${ne}px) scale(${V})`,opacity:A,transition:B||R?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:C?o("div",{style:{width:e.emptySlot.dotSize,height:e.emptySlot.dotSize,borderRadius:e.emptySlot.dotSize/2,backgroundColor:r.emptyDotBackground,border:`${e.emptySlot.borderWidth}px solid ${r.emptyDotBorder}`}}):P(Ne,{children:[o("div",{style:{position:"absolute",width:`${e.icon.gradientBgSizePercent}%`,height:`${e.icon.gradientBgSizePercent}%`,borderRadius:e.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:e.icon.gradientBgOpacity}}),o("div",{style:{position:"absolute",width:`${e.icon.innerGlowSizePercent}%`,height:`${e.icon.innerGlowSizePercent}%`,borderRadius:e.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:e.icon.innerGlowOpacity}}),o("div",{style:{marginBottom:e.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:B?"brightness(1.2)":"none"},children:n.icon}),o("span",{style:{fontSize:n.name.length>8?Math.max(e.icon.label.fontSize*.7,e.icon.label.fontSize*8/n.name.length):e.icon.label.fontSize,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,color:r.iconLabel,letterSpacing:e.icon.label.letterSpacing,marginTop:e.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:n.name}),K&&o("span",{style:{fontSize:e.icon.label.fontSize-1,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,letterSpacing:e.icon.label.letterSpacing,color:je.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Ce({side:n,color:p}){const D=n==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]];return o("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:D.map(([y,c,x,B],$)=>o("line",{x1:y,y1:c,x2:x,y2:B,stroke:p,strokeWidth:2},$))})}function ve({side:n,disabled:p,onClick:D}){const[y,c]=u(false);const x=p?r.emptyDotBorder:r.accent;return P("button",{type:"button","aria-label":`${n==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${n}`,disabled:p,onClick:D,onPointerDown:()=>!p&&c(true),onPointerUp:()=>c(false),onPointerLeave:()=>c(false),onPointerCancel:()=>c(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${r.dialBorder}`,backgroundColor:r.dialBackground,color:p?r.iconLabelMuted:r.centerText,fontSize:12,fontWeight:900,fontFamily:Se,letterSpacing:1.5,textTransform:"uppercase",cursor:p?"default":"pointer",opacity:p?.4:1,boxShadow:p?"none":`0 0 8px ${ye(r.dialShadow,.4)}`,transform:y?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[n==="prev"&&o(Ce,{side:"prev",color:x}),n==="prev"?"PREV":"NEXT",n==="next"&&o(Ce,{side:"next",color:x})]})}export function DialMenu({icons:n,onClose:p,centerLabel:D="MENU",onCenterPress:y,settingsOpen:c=false,hintsDisabled:x=false}){const{id:B}=qe();const[$,R]=u(0);const[w,C]=u(0);const[K,v]=u(0);const[N,b]=u(0);const[m,k]=u(0);const[ee,H]=u(1);const[V,A]=u(false);const[te,ne]=u(false);const[oe,ke]=u(false);const ie=J(null);const ue=J(null);const S=J(null);const X=J(false);const{entrance:_,exit:j,interaction:O}=he;const ze=_e();const[re,Te]=u(()=>({width:window.innerWidth,height:window.innerHeight}));E(()=>{const i=()=>Te({width:window.innerWidth,height:window.innerHeight});window.addEventListener("resize",i);return()=>window.removeEventListener("resize",i)},[]);const s=Z(()=>$e({screenWidth:re.width,maxCircleSize:Math.max(120,Math.min(320,re.height-96))}),[re]);const Pe=Z(()=>Fe(),[]);const Be=Z(()=>Le(U,s.iconRadius),[s.iconRadius]);const[Ie,De]=u(0);const L=Math.max(1,Math.ceil(n.length/U));const z=Math.min(Ie,L-1);const pe=Z(()=>{const i=z*U;const t=[...n.slice(i,i+U)];while(t.length<U){t.push({id:`empty-${t.length}`,name:"",icon:null,onPress:()=>{}})}return t},[n,z]);E(()=>{Xe()},[]);E(()=>{const i=_.backdrop.duration;const t=_.dial.rotation.duration;const f=_.centerButton.delay;const l=_.icons.delay;const d=_.icons.duration;const g=performance.now();const h=I=>{const a=I-g;R(Math.min(1,a/i));const T=Math.min(1,a/400);let F=G(T)*1.1;if(T>.7){F-=(T-.7)*.33}if(T>=1)F=1;C(Math.max(0,Math.min(1.05,F)));const M=Math.min(1,a/t);v(G(M)*360);if(a>=f){const W=Math.min(1,(a-f)/300);let ce=G(W)*1.15;if(W>.6){ce-=(W-.6)*.375}if(W>=1)ce=1;b(Math.max(0,Math.min(1.05,ce)))}if(a>=l){const W=Math.min(1,(a-l)/d);k(G(W))}const le=l+d;if(a<le){S.current=requestAnimationFrame(h)}else{R(1);C(1);v(360);b(1);k(1);ke(true)}};S.current=requestAnimationFrame(h);return()=>{if(S.current)cancelAnimationFrame(S.current)}},[]);const q=Q(()=>{if(X.current)return;X.current=true;ne(true);if(S.current){cancelAnimationFrame(S.current)}const i=performance.now();const t=j.icons.duration;const f=j.centerButton.duration;const l=j.dialScale.duration;const d=Math.max(f,l);const g=j.backdrop.duration;const h=I=>{const a=I-i;if(a<t){const M=de(a/t);k(1-M);S.current=requestAnimationFrame(h);return}const T=t;if(a<T+d){k(0);const M=Math.min(1,(a-T)/f);const le=Math.min(1,(a-T)/l);b(1-de(M));C(1-de(le));S.current=requestAnimationFrame(h);return}const F=T+d;if(a<F+g){C(0);b(0);const M=(a-F)/g;R(1-M);S.current=requestAnimationFrame(h);return}R(0);p()};S.current=requestAnimationFrame(h)},[j,p]);E(()=>{const i=document.activeElement;const t=ie.current;return()=>{if(i?.isConnected&&(document.activeElement===document.body||t?.contains(document.activeElement))){i.focus()}}},[]);E(()=>{if(c)return;ue.current?.focus();const i=t=>{const f=ie.current;if(!f)return;if(t.key==="Escape"){t.preventDefault();q()}else if(t.key==="Tab"){const l=Array.from(f.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(h=>h.getClientRects().length>0);const d=l[0];const g=l[l.length-1];if(!f.contains(document.activeElement)||(t.shiftKey?document.activeElement===d:document.activeElement===g)){t.preventDefault();(t.shiftKey?g:d)?.focus()}}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(t.key)){const l=Array.from(f.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));const d=l.indexOf(document.activeElement);if(d<0||!l.length)return;t.preventDefault();const g=t.key==="Home"?0:t.key==="End"?l.length-1:(d+(t.key==="ArrowRight"||t.key==="ArrowDown"?1:-1)+l.length)%l.length;l[g].focus()}};document.addEventListener("keydown",i);return()=>document.removeEventListener("keydown",i)},[q,c]);const[ae,me]=u(false);E(()=>{if(x)return;let i=false;const t=setTimeout(async()=>{const f=await be.getItem(xe);if(!i&&!f)me(true)},1200);return()=>{i=true;clearTimeout(t)}},[x]);const se=Q(()=>{me(false);void be.setItem(xe,"true")},[]);E(()=>{if(c&&ae){se()}},[c,ae,se]);const Re=Q(i=>{if(i.id.startsWith("empty-")||X.current)return;const[t,f]=O.iconSelect.pulse;const l=performance.now();const d=150;const g=h=>{const I=h-l;if(I<d){const a=G(I/d);H(1-(1-t.scale)*a);requestAnimationFrame(g)}else if(I<d*2){const a=G((I-d)/d);H(t.scale+(f.scale-t.scale)*a);requestAnimationFrame(g)}else{H(1)}};requestAnimationFrame(g);setTimeout(()=>{i.onPress();q()},O.iconSelect.actionDelay)},[O.iconSelect,q]);const fe=Q(i=>{if(X.current)return;const t=Math.max(0,Math.min(i,L-1));if(t!==z)De(t)},[L,z]);const Y=s.buttonSize*e.centerButton.containerRatio;const ge=s.buttonSize*e.centerButton.borderRatio;const Ae=s.buttonSize*e.centerButton.containerRatio/2+6;const Me=oe&&!te;return P("div",{ref:ie,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[o("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:q,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:r.dialBackdrop,opacity:$}}),P("div",{style:{position:"absolute",left:"50%",marginLeft:-s.circleSize/2,bottom:80,width:s.circleSize,height:s.circleSize,borderRadius:"50%",backgroundColor:r.dialBackground,border:`${e.circle.borderWidth}px solid ${r.dialBorder}`,boxShadow:`0 0 ${e.circle.shadowRadius}px ${ye(r.dialShadow,e.circle.shadowOpacity)}`,transform:`scale(${w}) rotate(${K}deg)`,opacity:w>.01?1:0,overflow:"hidden"},children:[o("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:r.dialGradient1,opacity:e.gradientLayers[0].opacity}}),o("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:r.dialGradient2,opacity:e.gradientLayers[1].opacity}}),o("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:r.dialGradient3,opacity:e.gradientLayers[2].opacity}}),Pe.map(i=>o("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:e.grid.lineHeight,transform:`rotate(${i}deg)`,transformOrigin:"center"},children:["left","right"].map(t=>o("div",{style:{position:"absolute",top:0,[t]:0,width:`calc(50% - ${Ae}px)`,height:e.grid.lineHeight,backgroundColor:r.dialGridLine}},t))},i)),o("div",{"data-testid":"dial-background","data-background":B,style:{position:"absolute",inset:0,pointerEvents:"none"},children:B==="hyperspace"?o(Ue,{size:s.circleSize}):o(Oe,{focus:Ve})}),pe.map((i,t)=>o(Ye,{icon:i,index:t,totalIcons:pe.length,position:Be[t],progress:m,onPress:()=>Re(i)},t)),P("div",{style:{position:"absolute",left:"50%",top:"50%",width:Y,height:Y,marginLeft:-Y/2,marginTop:-Y/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:r.hubHalo,borderRadius:s.buttonSize,overflow:"hidden",transform:`scale(${N*ee})`,opacity:N>.01?1:0},children:[o("div",{style:{position:"absolute",inset:0,backgroundColor:r.dialGradient1,opacity:.5,borderRadius:s.buttonSize}}),o("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:r.dialGradient2,opacity:.3,borderRadius:s.buttonSize}}),o("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:r.dialGradient3,opacity:.2,borderRadius:s.buttonSize}}),o("div",{style:{width:ge,height:ge,borderRadius:s.buttonSize*e.centerButton.borderRadiusRatio,backgroundColor:r.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:o("button",{ref:ue,type:"button","aria-label":c?"Close Settings":"Open Dev Tools Settings",disabled:!y,onClick:y,onPointerEnter:i=>i.pointerType==="mouse"&&A(true),onPointerLeave:()=>A(false),style:{border:0,padding:0,background:"transparent",width:s.buttonSize,height:s.buttonSize,borderRadius:s.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:y?"pointer":"default",transform:V?`scale(${O.centerHover.scale})`:"scale(1)",transition:`transform ${O.centerHover.duration}ms ease`,animation:Me&&!V?ze.pulse:"none"},children:c?P("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:e.centerButton.text.fontSize-2,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:r.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${r.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[o("span",{style:{marginBottom:-2},children:"CLOSE"}),o("span",{style:{marginTop:-2},children:"SETTINGS"})]}):o("span",{style:{fontSize:e.centerButton.text.fontSize,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:r.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${r.centerTextGlow}`,textTransform:"uppercase"},children:D})})})]})]}),L>1&&P("div",{style:{position:"absolute",left:"50%",marginLeft:-s.circleSize/2,top:"calc(100% - 64px)",width:s.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,w),transform:`scale(${Math.min(1,w)})`},children:[o(ve,{side:"prev",disabled:z<=0,onClick:()=>fe(z-1)}),P("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Se,letterSpacing:2,color:r.centerText,textShadow:`0 0 6px ${r.centerTextGlow}`},children:[String(z+1).padStart(2,"0"),P("span",{style:{color:r.iconLabelMuted,textShadow:"none"},children:[" / ",String(L).padStart(2,"0")]})]}),o(ve,{side:"next",disabled:z>=L-1,onClick:()=>fe(z+1)})]}),ae&&!c&&o(Ke,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:se,showArrow:false})]})}
1
+ "use strict";import{useState as p,useEffect as E,useMemo as J,useRef as Q,useCallback as ee}from"react";import{dialAccessibilityLabel as $e}from"./dialA11y.js";import{getDialLayout as Le,getAllIconPositions as Fe,getGridLineRotations as We,getIconStaggerInputRange as Ge,MAX_DIAL_SLOTS as K,DIAL_ICON_SIZE as He,dialAnimationConfig as ye,getDialCSSKeyframesString as _e,getDialCSSAnimationStyles as je,dialColors as r,dialStyles as e,withAlpha as be,floatingToolsColors as Oe}from"@buoy-gg/floating-tools-react";import{persistentStorage as Se,monoFont as de,ToolBackground as qe,useToolBackground as Ue}from"@buoy-gg/shared-ui";import{DialHyperspace as Ke}from"./DialHyperspace.js";import{OnboardingTooltip as Ne}from"./OnboardingTooltip.web.js";import{jsx as n,Fragment as Ve,jsxs as k}from"react/jsx-runtime";const Xe={x:.5,y:.5};const xe="@react_buoy_settings_tooltip_shown";let we=false;function Ye(){if(we||typeof document==="undefined")return;const o=document.createElement("style");o.textContent=_e();document.head.appendChild(o);we=true}const H=o=>1-Math.pow(1-o,3);const ue=o=>o*o*o;function Ze({icon:o,index:m,totalIcons:I,position:h,progress:c,onPress:x}){const[z,D]=p(false);const[N,w]=p(false);const b=!o.icon&&o.id.startsWith("empty-");const R=!b&&o.unavailable===true;const T=!b&&!R;const{icons:V}=ye;const P=Ge(m,I);let d=0;if(c<=P[1]){d=0}else if(c<=P[2]){d=(c-P[1])/(P[2]-P[1])}else{d=1}d=Math.max(0,Math.min(1,d));const $=He;const L=V.pressIn.scale;const te=1.1;const _=d*(N?L:z?te:1);let A=0;if(d<=0){A=0}else if(d<=.3){A=d}else{A=.3+(d-.3)*(.7/.7)}const X=h.x*(d-1);const ne=h.y*(d-1);return n("button",{role:"menuitem","aria-label":b?"Empty slot":$e(o.id,o.name),"data-testid":o.id?`buoy-dial-${o.id}`:void 0,"aria-disabled":!T,tabIndex:T?0:-1,onClick:T?x:void 0,onPointerEnter:oe=>T&&oe.pointerType==="mouse"&&D(true),onPointerLeave:()=>{D(false);w(false)},onPointerDown:()=>T&&w(true),onPointerUp:()=>w(false),onPointerCancel:()=>w(false),style:{position:"absolute",left:`calc(50% + ${h.x}px)`,top:`calc(50% + ${h.y}px)`,width:$,height:$,marginLeft:-$/2,marginTop:-$/2,cursor:T?"pointer":"default",background:"none",border:"none",padding:0},children:n("span",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",transform:`translate(${X}px, ${ne}px) scale(${_})`,opacity:A,transition:z||N?"transform 100ms ease":"none"},children:b?n("div",{style:{width:e.emptySlot.dotSize,height:e.emptySlot.dotSize,borderRadius:e.emptySlot.dotSize/2,backgroundColor:r.emptyDotBackground,border:`${e.emptySlot.borderWidth}px solid ${r.emptyDotBorder}`}}):k(Ve,{children:[n("div",{style:{position:"absolute",width:`${e.icon.gradientBgSizePercent}%`,height:`${e.icon.gradientBgSizePercent}%`,borderRadius:e.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:e.icon.gradientBgOpacity}}),n("div",{style:{position:"absolute",width:`${e.icon.innerGlowSizePercent}%`,height:`${e.icon.innerGlowSizePercent}%`,borderRadius:e.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:e.icon.innerGlowOpacity}}),n("div",{style:{marginBottom:e.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:z?"brightness(1.2)":"none"},children:o.icon}),n("span",{style:{fontSize:o.name.length>8?Math.max(e.icon.label.fontSize*.7,e.icon.label.fontSize*8/o.name.length):e.icon.label.fontSize,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,color:r.iconLabel,letterSpacing:e.icon.label.letterSpacing,marginTop:e.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:o.name}),R&&n("span",{style:{fontSize:e.icon.label.fontSize-1,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,letterSpacing:e.icon.label.letterSpacing,color:Oe.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})})}function Ce({side:o,color:m}){const I=o==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]];return n("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:I.map(([h,c,x,z],D)=>n("line",{x1:h,y1:c,x2:x,y2:z,stroke:m,strokeWidth:2},D))})}function ve({side:o,disabled:m,onClick:I}){const[h,c]=p(false);const x=m?r.emptyDotBorder:r.accent;return k("button",{type:"button","aria-label":`${o==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${o}`,disabled:m,onClick:I,onPointerDown:()=>!m&&c(true),onPointerUp:()=>c(false),onPointerLeave:()=>c(false),onPointerCancel:()=>c(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${r.dialBorder}`,backgroundColor:r.dialBackground,color:m?r.iconLabelMuted:r.centerText,fontSize:12,fontWeight:900,fontFamily:de,letterSpacing:1.5,textTransform:"uppercase",cursor:m?"default":"pointer",opacity:m?.4:1,boxShadow:m?"none":`0 0 8px ${be(r.dialShadow,.4)}`,transform:h?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[o==="prev"&&n(Ce,{side:"prev",color:x}),o==="prev"?"PREV":"NEXT",o==="next"&&n(Ce,{side:"next",color:x})]})}export function DialMenu({icons:o,onClose:m,centerLabel:I="MENU",onCenterPress:h,settingsOpen:c=false,hintsDisabled:x=false,emptyNote:z}){const{id:D}=Ue();const[N,w]=p(0);const[b,R]=p(0);const[T,V]=p(0);const[P,d]=p(0);const[$,L]=p(0);const[te,_]=p(1);const[A,X]=p(false);const[ne,oe]=p(false);const[ke,ze]=p(false);const ie=Q(null);const pe=Q(null);const S=Q(null);const Y=Q(false);const{entrance:j,exit:O,interaction:q}=ye;const Te=je();const[re,Pe]=p(()=>({width:window.innerWidth,height:window.innerHeight}));E(()=>{const i=()=>Pe({width:window.innerWidth,height:window.innerHeight});window.addEventListener("resize",i);return()=>window.removeEventListener("resize",i)},[]);const a=J(()=>Le({screenWidth:re.width,maxCircleSize:Math.max(120,Math.min(320,re.height-96))}),[re]);const Be=J(()=>We(),[]);const Ie=J(()=>Fe(K,a.iconRadius),[a.iconRadius]);const[De,Re]=p(0);const F=Math.max(1,Math.ceil(o.length/K));const C=Math.min(De,F-1);const me=J(()=>{const i=C*K;const t=[...o.slice(i,i+K)];while(t.length<K){t.push({id:`empty-${t.length}`,name:"",icon:null,onPress:()=>{}})}return t},[o,C]);E(()=>{Ye()},[]);E(()=>{const i=j.backdrop.duration;const t=j.dial.rotation.duration;const f=j.centerButton.delay;const l=j.icons.delay;const u=j.icons.duration;const g=performance.now();const y=B=>{const s=B-g;w(Math.min(1,s/i));const v=Math.min(1,s/400);let W=H(v)*1.1;if(v>.7){W-=(v-.7)*.33}if(v>=1)W=1;R(Math.max(0,Math.min(1.05,W)));const M=Math.min(1,s/t);V(H(M)*360);if(s>=f){const G=Math.min(1,(s-f)/300);let ce=H(G)*1.15;if(G>.6){ce-=(G-.6)*.375}if(G>=1)ce=1;d(Math.max(0,Math.min(1.05,ce)))}if(s>=l){const G=Math.min(1,(s-l)/u);L(H(G))}const le=l+u;if(s<le){S.current=requestAnimationFrame(y)}else{w(1);R(1);V(360);d(1);L(1);ze(true)}};S.current=requestAnimationFrame(y);return()=>{if(S.current)cancelAnimationFrame(S.current)}},[]);const U=ee(()=>{if(Y.current)return;Y.current=true;oe(true);if(S.current){cancelAnimationFrame(S.current)}const i=performance.now();const t=O.icons.duration;const f=O.centerButton.duration;const l=O.dialScale.duration;const u=Math.max(f,l);const g=O.backdrop.duration;const y=B=>{const s=B-i;if(s<t){const M=ue(s/t);L(1-M);S.current=requestAnimationFrame(y);return}const v=t;if(s<v+u){L(0);const M=Math.min(1,(s-v)/f);const le=Math.min(1,(s-v)/l);d(1-ue(M));R(1-ue(le));S.current=requestAnimationFrame(y);return}const W=v+u;if(s<W+g){R(0);d(0);const M=(s-W)/g;w(1-M);S.current=requestAnimationFrame(y);return}w(0);m()};S.current=requestAnimationFrame(y)},[O,m]);E(()=>{const i=document.activeElement;const t=ie.current;return()=>{if(i?.isConnected&&(document.activeElement===document.body||t?.contains(document.activeElement))){i.focus()}}},[]);E(()=>{if(c)return;pe.current?.focus();const i=t=>{const f=ie.current;if(!f)return;if(t.key==="Escape"){t.preventDefault();U()}else if(t.key==="Tab"){const l=Array.from(f.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(y=>y.getClientRects().length>0);const u=l[0];const g=l[l.length-1];if(!f.contains(document.activeElement)||(t.shiftKey?document.activeElement===u:document.activeElement===g)){t.preventDefault();(t.shiftKey?g:u)?.focus()}}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(t.key)){const l=Array.from(f.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));const u=l.indexOf(document.activeElement);if(u<0||!l.length)return;t.preventDefault();const g=t.key==="Home"?0:t.key==="End"?l.length-1:(u+(t.key==="ArrowRight"||t.key==="ArrowDown"?1:-1)+l.length)%l.length;l[g].focus()}};document.addEventListener("keydown",i);return()=>document.removeEventListener("keydown",i)},[U,c]);const[ae,fe]=p(false);E(()=>{if(x)return;let i=false;const t=setTimeout(async()=>{const f=await Se.getItem(xe);if(!i&&!f)fe(true)},1200);return()=>{i=true;clearTimeout(t)}},[x]);const se=ee(()=>{fe(false);void Se.setItem(xe,"true")},[]);E(()=>{if(c&&ae){se()}},[c,ae,se]);const Ae=ee(i=>{if(i.id.startsWith("empty-")||Y.current)return;const[t,f]=q.iconSelect.pulse;const l=performance.now();const u=150;const g=y=>{const B=y-l;if(B<u){const s=H(B/u);_(1-(1-t.scale)*s);requestAnimationFrame(g)}else if(B<u*2){const s=H((B-u)/u);_(t.scale+(f.scale-t.scale)*s);requestAnimationFrame(g)}else{_(1)}};requestAnimationFrame(g);setTimeout(()=>{i.onPress();U()},q.iconSelect.actionDelay)},[q.iconSelect,U]);const ge=ee(i=>{if(Y.current)return;const t=Math.max(0,Math.min(i,F-1));if(t!==C)Re(t)},[F,C]);const Z=a.buttonSize*e.centerButton.containerRatio;const he=a.buttonSize*e.centerButton.borderRatio;const Me=a.buttonSize*e.centerButton.containerRatio/2+6;const Ee=ke&&!ne;return k("div",{ref:ie,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[n("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:U,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:r.dialBackdrop,opacity:N}}),z?n("div",{role:"status","data-testid":"buoy-dial-empty-note",style:{position:"absolute",left:16,right:16,bottom:80+a.circleSize+16,color:r.iconLabel,fontSize:12,fontFamily:de,textAlign:"center",opacity:b>.01?1:0},children:z}):null,k("div",{style:{position:"absolute",left:"50%",marginLeft:-a.circleSize/2,bottom:80,width:a.circleSize,height:a.circleSize,borderRadius:"50%",backgroundColor:r.dialBackground,border:`${e.circle.borderWidth}px solid ${r.dialBorder}`,boxShadow:`0 0 ${e.circle.shadowRadius}px ${be(r.dialShadow,e.circle.shadowOpacity)}`,transform:`scale(${b}) rotate(${T}deg)`,opacity:b>.01?1:0,overflow:"hidden"},children:[n("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:r.dialGradient1,opacity:e.gradientLayers[0].opacity}}),n("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:r.dialGradient2,opacity:e.gradientLayers[1].opacity}}),n("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:r.dialGradient3,opacity:e.gradientLayers[2].opacity}}),Be.map(i=>n("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:e.grid.lineHeight,transform:`rotate(${i}deg)`,transformOrigin:"center"},children:["left","right"].map(t=>n("div",{style:{position:"absolute",top:0,[t]:0,width:`calc(50% - ${Me}px)`,height:e.grid.lineHeight,backgroundColor:r.dialGridLine}},t))},i)),n("div",{"data-testid":"dial-background","data-background":D,style:{position:"absolute",inset:0,pointerEvents:"none"},children:D==="hyperspace"?n(Ke,{size:a.circleSize}):n(qe,{focus:Xe})}),me.map((i,t)=>n(Ze,{icon:i,index:t,totalIcons:me.length,position:Ie[t],progress:$,onPress:()=>Ae(i)},t)),k("div",{style:{position:"absolute",left:"50%",top:"50%",width:Z,height:Z,marginLeft:-Z/2,marginTop:-Z/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:r.hubHalo,borderRadius:a.buttonSize,overflow:"hidden",transform:`scale(${P*te})`,opacity:P>.01?1:0},children:[n("div",{style:{position:"absolute",inset:0,backgroundColor:r.dialGradient1,opacity:.5,borderRadius:a.buttonSize}}),n("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:r.dialGradient2,opacity:.3,borderRadius:a.buttonSize}}),n("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:r.dialGradient3,opacity:.2,borderRadius:a.buttonSize}}),n("div",{style:{width:he,height:he,borderRadius:a.buttonSize*e.centerButton.borderRadiusRatio,backgroundColor:r.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:n("button",{ref:pe,type:"button","aria-label":c?"Close Settings":"Open Dev Tools Settings",disabled:!h,onClick:h,onPointerEnter:i=>i.pointerType==="mouse"&&X(true),onPointerLeave:()=>X(false),style:{border:0,padding:0,background:"transparent",width:a.buttonSize,height:a.buttonSize,borderRadius:a.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:h?"pointer":"default",transform:A?`scale(${q.centerHover.scale})`:"scale(1)",transition:`transform ${q.centerHover.duration}ms ease`,animation:Ee&&!A?Te.pulse:"none"},children:c?k("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:e.centerButton.text.fontSize-2,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:r.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${r.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[n("span",{style:{marginBottom:-2},children:"CLOSE"}),n("span",{style:{marginTop:-2},children:"SETTINGS"})]}):n("span",{style:{fontSize:e.centerButton.text.fontSize,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:r.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${r.centerTextGlow}`,textTransform:"uppercase"},children:I})})})]})]}),F>1&&k("div",{style:{position:"absolute",left:"50%",marginLeft:-a.circleSize/2,top:"calc(100% - 64px)",width:a.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,b),transform:`scale(${Math.min(1,b)})`},children:[n(ve,{side:"prev",disabled:C<=0,onClick:()=>ge(C-1)}),k("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:de,letterSpacing:2,color:r.centerText,textShadow:`0 0 6px ${r.centerTextGlow}`},children:[String(C+1).padStart(2,"0"),k("span",{style:{color:r.iconLabelMuted,textShadow:"none"},children:[" / ",String(F).padStart(2,"0")]})]}),n(ve,{side:"next",disabled:C>=F-1,onClick:()=>ge(C+1)})]}),ae&&!c&&n(Ne,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:se,showArrow:false})]})}
@@ -0,0 +1 @@
1
+ "use strict";export const NO_TEAM_TOOLS_NOTE="No tools are on for your role. Ask your team admin.";
@@ -1 +1 @@
1
- "use strict";import{Platform as r}from"react-native";import{persistentStorage as s}from"@buoy-gg/shared-ui";import{isCapacitorNative as u}from"@buoy-gg/license";import{SDK_VERSION as c}from"../version.js";const l="@react_buoy_install";const x="https://buoy.gg/api/t";const f=24*60*60*1e3;function p(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16|0;const e=t==="x"?n:n&3|8;return e.toString(16)})}async function d(){try{const t=await s.getItem(l);if(!t)return null;const n=JSON.parse(t);if(typeof n?.installId!=="string")return null;return{installId:n.installId,lastPingAt:typeof n.lastPingAt==="number"?n.lastPingAt:0}}catch{return null}}function m(){console.log("[Buoy] Anonymous usage ping enabled: a random install id, the Buoy version, your platform and framework, and your license tier \u2014 no project, app, or tool data, and only in development. Opt out with Buoy.init({ telemetry: false }). Details: https://buoy.gg/buoy/latest/docs/telemetry")}let o=false;export function detectFramework(){if(r.isTV)return"tv";if(r.OS!=="web")return"react-native";if(u())return"capacitor";const t=globalThis.__BUOY_FRAMEWORK__;if(t==="angular")return"angular";if(t==="solid")return"solid";return"web"}export async function sendInstallPing(t){const n=typeof __DEV__!=="undefined"&&__DEV__;if(!n)return;if(!t.enabled)return;if(o)return;o=true;try{const e=await d();const i=Date.now();if(e&&i-e.lastPingAt<f)return;const a=e?.installId??p();if(!e)m();await s.setItem(l,JSON.stringify({installId:a,lastPingAt:i}));await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:a,version:c,platform:r.OS,tier:t.tier,framework:detectFramework()})})}catch{}}export function __resetInstallPingForTests(){o=false}
1
+ "use strict";import{Platform as r}from"react-native";import{persistentStorage as s}from"@buoy-gg/shared-ui";import{isCapacitorNative as u}from"@buoy-gg/license";import{SDK_VERSION as c}from"../version.js";const l="@react_buoy_install";const x="https://buoy.gg/api/t";const f=24*60*60*1e3;function p(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16|0;const e=t==="x"?n:n&3|8;return e.toString(16)})}async function d(){try{const t=await s.getItem(l);if(!t)return null;const n=JSON.parse(t);if(typeof n?.installId!=="string")return null;return{installId:n.installId,lastPingAt:typeof n.lastPingAt==="number"?n.lastPingAt:0}}catch{return null}}function m(){console.log("[Buoy] Anonymous usage ping enabled: a random install id, the Buoy version, your platform and framework, and your license tier \u2014 no project, app, or tool data, and only in development. Opt out with Buoy.init({ telemetry: false }). Details: https://buoy.gg/buoy/latest/docs/telemetry")}let i=false;export function detectFramework(){if(r.isTV)return"tv";if(r.OS!=="web")return"react-native";if(u())return"capacitor";const t=globalThis.__BUOY_FRAMEWORK__;if(t==="angular")return"angular";if(t==="solid")return"solid";if(t==="vue")return"vue";if(t==="nuxt")return"nuxt";return"web"}export async function sendInstallPing(t){const n=typeof __DEV__!=="undefined"&&__DEV__;if(!n)return;if(!t.enabled)return;if(i)return;i=true;try{const e=await d();const o=Date.now();if(e&&o-e.lastPingAt<f)return;const a=e?.installId??p();if(!e)m();await s.setItem(l,JSON.stringify({installId:a,lastPingAt:o}));await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:a,version:c,platform:r.OS,tier:t.tier,framework:detectFramework()})})}catch{}}export function __resetInstallPingForTests(){i=false}
@@ -1 +1 @@
1
- "use strict";export const SDK_VERSION="7.0.73";
1
+ "use strict";export const SDK_VERSION="7.0.75";
@@ -88,6 +88,8 @@ export declare const Buoy: {
88
88
  tierSource: import("@buoy-gg/license").TierSource;
89
89
  isPro: boolean;
90
90
  access: import("@buoy-gg/license").AccountAccess;
91
+ teamRole: string | null;
92
+ allowedTools: string[] | null;
91
93
  isInitialized: boolean;
92
94
  isValidating: boolean;
93
95
  licenseKey: string | null;
@@ -10,6 +10,8 @@ import type { Environment } from "@buoy-gg/shared-ui";
10
10
  export interface FloatingMenuProps {
11
11
  /** Dev tool apps that can be opened from the floating menu. */
12
12
  apps: InstalledApp[];
13
+ /** Shown on an open dial that has no tools, e.g. a team role with every tool off. */
14
+ emptyNote?: string;
13
15
  /** Shared state object passed to app renderers (e.g. icons) and the dial. */
14
16
  state?: FloatingMenuState;
15
17
  /** Shared action callbacks exposed to app renderers for interacting with the menu. */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * TeamToolCloser — closes an open tool that the team role now hides.
3
+ *
4
+ * Renders nothing. It sits INSIDE `AppHostProvider`, where the open tools
5
+ * live. The role's tool list arrives after launch (the sign-in loads, then
6
+ * refreshes), so a tool restored from last time, or open when an admin
7
+ * changes the role, can be open while hidden. Closing it here also drops it
8
+ * from the saved open tools, so it doesn't come back on the next launch.
9
+ */
10
+ export declare function TeamToolCloser({ allowedTools }: {
11
+ allowedTools: readonly string[] | null;
12
+ }): null;
13
+ //# sourceMappingURL=TeamToolCloser.d.ts.map
@@ -25,6 +25,8 @@ interface DialDevToolsProps {
25
25
  onSettingsPress?: () => void;
26
26
  autoOpenSettings?: boolean;
27
27
  apps: InstalledApp[];
28
+ /** Shown above the dial when it has no tools. */
29
+ emptyNote?: string;
28
30
  state?: FloatingMenuState;
29
31
  actions?: FloatingMenuActions;
30
32
  }
@@ -35,6 +35,8 @@ export interface DialMenuProps {
35
35
  settingsOpen?: boolean;
36
36
  /** Suppress the settings onboarding tooltip (disableHints). */
37
37
  hintsDisabled?: boolean;
38
+ /** Shown above the dial when it has no tools (native DialDevTools emptyNote). */
39
+ emptyNote?: string;
38
40
  }
39
- export declare function DialMenu({ icons, onClose, centerLabel, onCenterPress, settingsOpen, hintsDisabled, }: DialMenuProps): import("react").JSX.Element;
41
+ export declare function DialMenu({ icons, onClose, centerLabel, onCenterPress, settingsOpen, hintsDisabled, emptyNote, }: DialMenuProps): import("react").JSX.Element;
40
42
  //# sourceMappingURL=DialDevTools.web.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * What the dial says when a team role turns every tool off. Ports show the
3
+ * same words (floating-tools-core teamTools.ts lists them).
4
+ */
5
+ export declare const NO_TEAM_TOOLS_NOTE = "No tools are on for your role. Ask your team admin.";
6
+ //# sourceMappingURL=teamToolsNote.d.ts.map
@@ -9,5 +9,5 @@
9
9
  * Drift is prevented by a test that fails when this disagrees with
10
10
  * package.json, so a version bump that forgets this file cannot ship.
11
11
  */
12
- export declare const SDK_VERSION = "7.0.73";
12
+ export declare const SDK_VERSION = "7.0.75";
13
13
  //# sourceMappingURL=version.d.ts.map
@@ -88,6 +88,8 @@ export declare const Buoy: {
88
88
  tierSource: import("@buoy-gg/license").TierSource;
89
89
  isPro: boolean;
90
90
  access: import("@buoy-gg/license").AccountAccess;
91
+ teamRole: string | null;
92
+ allowedTools: string[] | null;
91
93
  isInitialized: boolean;
92
94
  isValidating: boolean;
93
95
  licenseKey: string | null;
@@ -10,6 +10,8 @@ import type { Environment } from "@buoy-gg/shared-ui";
10
10
  export interface FloatingMenuProps {
11
11
  /** Dev tool apps that can be opened from the floating menu. */
12
12
  apps: InstalledApp[];
13
+ /** Shown on an open dial that has no tools, e.g. a team role with every tool off. */
14
+ emptyNote?: string;
13
15
  /** Shared state object passed to app renderers (e.g. icons) and the dial. */
14
16
  state?: FloatingMenuState;
15
17
  /** Shared action callbacks exposed to app renderers for interacting with the menu. */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * TeamToolCloser — closes an open tool that the team role now hides.
3
+ *
4
+ * Renders nothing. It sits INSIDE `AppHostProvider`, where the open tools
5
+ * live. The role's tool list arrives after launch (the sign-in loads, then
6
+ * refreshes), so a tool restored from last time, or open when an admin
7
+ * changes the role, can be open while hidden. Closing it here also drops it
8
+ * from the saved open tools, so it doesn't come back on the next launch.
9
+ */
10
+ export declare function TeamToolCloser({ allowedTools }: {
11
+ allowedTools: readonly string[] | null;
12
+ }): null;
13
+ //# sourceMappingURL=TeamToolCloser.d.ts.map
@@ -25,6 +25,8 @@ interface DialDevToolsProps {
25
25
  onSettingsPress?: () => void;
26
26
  autoOpenSettings?: boolean;
27
27
  apps: InstalledApp[];
28
+ /** Shown above the dial when it has no tools. */
29
+ emptyNote?: string;
28
30
  state?: FloatingMenuState;
29
31
  actions?: FloatingMenuActions;
30
32
  }
@@ -35,6 +35,8 @@ export interface DialMenuProps {
35
35
  settingsOpen?: boolean;
36
36
  /** Suppress the settings onboarding tooltip (disableHints). */
37
37
  hintsDisabled?: boolean;
38
+ /** Shown above the dial when it has no tools (native DialDevTools emptyNote). */
39
+ emptyNote?: string;
38
40
  }
39
- export declare function DialMenu({ icons, onClose, centerLabel, onCenterPress, settingsOpen, hintsDisabled, }: DialMenuProps): import("react").JSX.Element;
41
+ export declare function DialMenu({ icons, onClose, centerLabel, onCenterPress, settingsOpen, hintsDisabled, emptyNote, }: DialMenuProps): import("react").JSX.Element;
40
42
  //# sourceMappingURL=DialDevTools.web.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * What the dial says when a team role turns every tool off. Ports show the
3
+ * same words (floating-tools-core teamTools.ts lists them).
4
+ */
5
+ export declare const NO_TEAM_TOOLS_NOTE = "No tools are on for your role. Ask your team admin.";
6
+ //# sourceMappingURL=teamToolsNote.d.ts.map
@@ -9,5 +9,5 @@
9
9
  * Drift is prevented by a test that fails when this disagrees with
10
10
  * package.json, so a version bump that forgets this file cannot ship.
11
11
  */
12
- export declare const SDK_VERSION = "7.0.73";
12
+ export declare const SDK_VERSION = "7.0.75";
13
13
  //# sourceMappingURL=version.d.ts.map
package/lib/web/auto.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{a as t,e as u}from"./chunks/chunk-LOPXJLVB.mjs";import{createElement as n,lazy as c,Suspense as p,useEffect as d,useState as y}from"react";function a(){if(typeof window>"u")return false;let o=window.Capacitor,e=false;try{e=o?.isNativePlatform?.()===true}catch{e=false}return e?o?.DEBUG===true:typeof u<"u"?!!u:process.env.NODE_ENV!=="production"}t(a,"shouldShowBuoy");var s;function l(){return s??(s=c(()=>import("./chunks/FloatingDevTools.web-FENSHQGD.mjs").then(o=>({default:o.FloatingDevTools})))),s}t(l,"loadHost");function r({enabled:o,...e}){let[i,f]=y(false);return d(()=>{f(o??a())},[o]),i?n(p,{fallback:null},n(l(),e)):null}t(r,"BuoyDevTools");export{r as BuoyDevTools,a as shouldShowBuoy};
1
+ "use client";import{a as t,e as u}from"./chunks/chunk-LOPXJLVB.mjs";import{createElement as n,lazy as c,Suspense as p,useEffect as d,useState as y}from"react";function a(){if(typeof window>"u")return false;let o=window.Capacitor,e=false;try{e=o?.isNativePlatform?.()===true}catch{e=false}return e?o?.DEBUG===true:typeof u<"u"?!!u:process.env.NODE_ENV!=="production"}t(a,"shouldShowBuoy");var s;function l(){return s??(s=c(()=>import("./chunks/FloatingDevTools.web-NMBTDON7.mjs").then(o=>({default:o.FloatingDevTools})))),s}t(l,"loadHost");function r({enabled:o,...e}){let[i,f]=y(false);return d(()=>{f(o??a())},[o]),i?n(p,{fallback:null},n(l(),e)):null}t(r,"BuoyDevTools");export{r as BuoyDevTools,a as shouldShowBuoy};
@@ -0,0 +1 @@
1
+ "use client";import{v as o}from"./chunk-2N5IPIMV.mjs";import"./chunk-C6HZO5XT.mjs";import"./chunk-D2FYORGY.mjs";import"./chunk-LOPXJLVB.mjs";export{o as FloatingDevTools};
@@ -0,0 +1,10 @@
1
+ "use client";import{a as ct,b as H,c as U,d as Me,e as dt,f as sr,g as To,h as lr,i as kl,j as Io,k as Ne}from"./chunk-C6HZO5XT.mjs";import{b as cr,c as dr}from"./chunk-D2FYORGY.mjs";import{a as r,b as Co,e as He}from"./chunk-LOPXJLVB.mjs";import{BuoyPortal as ur,FloatingToolHost as pr}from"@buoy-gg/shared-ui/web/floating";import*as mr from"@buoy-gg/license/web";import{LicenseManager as gr,useLicense as ko,sameLicenseKey as fr,resolveDevBuild as hr,capacitorDebug as yr,isCapacitorNative as br,loadCapacitorAppHost as vr}from"@buoy-gg/license/web";import{AccountSetup as Sr,HintsProvider as wr,normalizeEnvironment as xr,registerToolOpener as zo,startSettingsSync as Tr}from"@buoy-gg/shared-ui/web";import{useState as Pt,useMemo as he,useCallback as We,useEffect as Z,useRef as Ao}from"react";import{useSettings as Ir,getToolLabel as ut,getToolDescription as Cr,getToolColor as Bo}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Oe,devToolsStorageKeys as pt,EnvironmentIndicator as kr,EnvironmentSelectorInline as zr}from"@buoy-gg/shared-ui/web";var Ar=[];function Ro(){return[]}r(Ro,"autoDiscoverWebPresets");function Et(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}r(Et,"autoDiscoverWithCustom");function mt(e,t){return e.filter(o=>{let i=o.slot||"both";return i==="both"||i===t})}r(mt,"getToolsBySlot");function Do(e,t){let o=t instanceof Set?t:new Set(t);return e.filter(i=>o.has(i.id))}r(Do,"getEnabledTools");import{filterTeamTools as Br,isTeamToolAllowed as Rr}from"@buoy-gg/floating-tools-core/web";var Dr="No tools are on for your role. Ask your team admin.";import{FloatingTool as Mo,FloatingToolDivider as Mr,FloatingToolUserStatus as Oo,getBubbleAnchorPosition as Or}from"@buoy-gg/shared-ui/web/floating";import{useState as te,useEffect as Pe,useMemo as gt,useRef as ft,useCallback as ht}from"react";var Po={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 Eo(e,t){return e&&Po[e]?Po[e]:t}r(Eo,"dialAccessibilityLabel");import{getDialLayout as Pr,getAllIconPositions as Er,getGridLineRotations as Lr,getIconStaggerInputRange as Fr,MAX_DIAL_SLOTS as Qe,DIAL_ICON_SIZE as $r,dialAnimationConfig as Lo,getDialCSSKeyframesString as jr,getDialCSSAnimationStyles as Nr,dialColors as j,dialStyles as w,withAlpha as Fo,floatingToolsColors as Hr}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as $o,monoFont as Lt,ToolBackground as Wr,useToolBackground as _r}from"@buoy-gg/shared-ui/web";import{memo as Ur}from"react";import{RasterLayer as Kr,scatter as Vr,useLoop as Gr,withBgAlpha as qr}from"@buoy-gg/shared-ui/web";import{Fragment as Jr,jsx as Ze}from"react/jsx-runtime";var Yr=.94,Xr=6,Qr=2400,yt=3,jo=16,Zr=Array.from({length:yt},(e,t)=>Vr(22343^t*40503,jo*4)),No=["#FFFFFF","#B3D9FF","#8CB3FF"],Ho=Math.PI/3,Wo=14*Math.PI/180;function _o(e){let t=Math.min(5,Math.floor(e*6)),o=e*6-t;return t*Ho+Wo/2+o*(Ho-Wo)}r(_o,"spokeClearAngle");function Uo(e){return Math.min(Xr,1/(1-e*Yr))}r(Uo,"scaleAt");function Ko(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}r(Ko,"opacityAt");function Vo(e){let t=e/yt,o=[],i=12;for(let d=0;d<=i;d++)o.push(d/i);let n=(1-t)%1;n>.001&&n<1-.001&&o.push(n-1e-4,n+1e-4),o.sort((d,u)=>d-u);let s=[],l=[],c=[];for(let d of o){let u=t===0&&d===1?1:(d+t)%1;s.push(d),l.push(Uo(u)),c.push(Ko(u))}return{input:s,scale:l,opacity:c}}r(Vo,"shellStops");var ea=Array.from({length:yt},(e,t)=>Vo(t)),ta=Ur(r(function({size:e}){let t=Gr(Qr),o=e/2,i=[];for(let n=0;n<yt;n++){let s=Zr[n],l=ea[n],c=[];for(let d=0;d<jo;d++){let u=_o(s[d*4]),g=(.15+.85*Math.sqrt(s[d*4+1]))*.5*o,S=No[Math.floor(s[d*4+3]*No.length)%3],h=o+Math.cos(u)*g,B=o+Math.sin(u)*g,I=.6,R=I*2.4;c.push(Ze(H,{style:{position:"absolute",left:h-R/2,top:B-R/2,width:R,height:R,borderRadius:R/2,backgroundColor:qr(S,.3)}},`${d}-h`),Ze(H,{style:{position:"absolute",left:h-I/2,top:B-I/2,width:I,height:I,borderRadius:I/2,backgroundColor:S}},d))}i.push(Ze(Me.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:l.input,outputRange:l.opacity}),transform:[{scale:t.interpolate({inputRange:l.input,outputRange:l.scale})}]},pointerEvents:"none",children:Ze(Kr,{style:{width:e,height:e},raster:false,children:c})},n))}return Ze(Jr,{children:i})},"DialHyperspace"));import{useEffect as oa,useState as Go}from"react";import{dialColors as _e,withAlpha as qo}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as na,ARROW_HEIGHT as ia,SPACING_GAP as Vl,getScreenCenterY as Gl,calculateTooltipPosition as ra,calculateTargetPosition as ql}from"@buoy-gg/shared-ui/web/floating";import{monoFont as Jo}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as Yo}from"react/jsx-runtime";var Xo=false;function Qo(){if(Xo||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),Xo=true}r(Qo,"injectOnboardingKeyframes");var Ft=_e.accent;function $t({title:e,message:t,onDismiss:o,showArrow:i=true}){let[n,s]=Go(false),[l,c]=Go(false);oa(()=>{Qo();let u=requestAnimationFrame(()=>s(true));return()=>cancelAnimationFrame(u)},[]);let d={fontFamily:Jo,textTransform:"uppercase"};return Ue("div",{style:{position:"fixed",left:"50%",bottom:ra(),transform:`translateX(-50%) scale(${n?1:.8})`,opacity:n?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:Yo("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ue("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Yo("div",{style:{position:"relative",maxWidth:280,backgroundColor:_e.dialBackground,borderRadius:16,border:`1px solid ${_e.dialBorder}`,padding:20,boxShadow:`0 0 20px ${qo(_e.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ue("span",{style:{...d,fontSize:16,fontWeight:900,letterSpacing:1,color:Ft,textAlign:"center"},children:e}),Ue("span",{style:{fontFamily:Jo,fontSize:13,lineHeight:"20px",color:_e.centerText,textAlign:"center"},children:t}),Ue("button",{onClick:o,onPointerDown:()=>c(true),onPointerUp:()=>c(false),onPointerLeave:()=>c(false),onPointerCancel:()=>c(false),style:{...d,marginTop:8,borderRadius:8,border:"none",backgroundColor:Ft,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:l?.7:1,transform:l?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ue("div",{style:{position:"absolute",left:"50%",bottom:na,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${ia}px solid ${Ft}`,filter:`drop-shadow(0 0 10px ${qo(_e.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}r($t,"OnboardingTooltip");import{Fragment as aa,jsx as E,jsxs as we}from"react/jsx-runtime";var sa={x:.5,y:.5},Zo="@react_buoy_settings_tooltip_shown",en=false;function tn(){if(en||typeof document>"u")return;let e=document.createElement("style");e.textContent=jr(),document.head.appendChild(e),en=true}r(tn,"injectKeyframes");var Ke=r(e=>1-Math.pow(1-e,3),"easeOutCubic"),jt=r(e=>e*e*e,"easeInCubic");function on({icon:e,index:t,totalIcons:o,position:i,progress:n,onPress:s}){let[l,c]=te(false),[d,u]=te(false),g=!e.icon&&e.id.startsWith("empty-"),S=!g&&e.unavailable===true,h=!g&&!S,{icons:B}=Lo,I=Fr(t,o),R=0;n<=I[1]?R=0:n<=I[2]?R=(n-I[1])/(I[2]-I[1]):R=1,R=Math.max(0,Math.min(1,R));let L=$r,M=B.pressIn.scale,P=R*(d?M:l?1.1:1),z=0;R<=0?z=0:R<=.3?z=R:z=.3+(R-.3)*(.7/.7);let v=i.x*(R-1),C=i.y*(R-1);return E("button",{role:"menuitem","aria-label":g?"Empty slot":Eo(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!h,tabIndex:h?0:-1,onClick:h?s:void 0,onPointerEnter:F=>h&&F.pointerType==="mouse"&&c(true),onPointerLeave:()=>{c(false),u(false)},onPointerDown:()=>h&&u(true),onPointerUp:()=>u(false),onPointerCancel:()=>u(false),style:{position:"absolute",left:`calc(50% + ${i.x}px)`,top:`calc(50% + ${i.y}px)`,width:L,height:L,marginLeft:-L/2,marginTop:-L/2,cursor:h?"pointer":"default",background:"none",border:"none",padding:0},children:E("span",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",transform:`translate(${v}px, ${C}px) scale(${P})`,opacity:z,transition:l||d?"transform 100ms ease":"none"},children:g?E("div",{style:{width:w.emptySlot.dotSize,height:w.emptySlot.dotSize,borderRadius:w.emptySlot.dotSize/2,backgroundColor:j.emptyDotBackground,border:`${w.emptySlot.borderWidth}px solid ${j.emptyDotBorder}`}}):we(aa,{children:[E("div",{style:{position:"absolute",width:`${w.icon.gradientBgSizePercent}%`,height:`${w.icon.gradientBgSizePercent}%`,borderRadius:w.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:w.icon.gradientBgOpacity}}),E("div",{style:{position:"absolute",width:`${w.icon.innerGlowSizePercent}%`,height:`${w.icon.innerGlowSizePercent}%`,borderRadius:w.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:w.icon.innerGlowOpacity}}),E("div",{style:{marginBottom:w.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:l?"brightness(1.2)":"none"},children:e.icon}),E("span",{style:{fontSize:e.name.length>8?Math.max(w.icon.label.fontSize*.7,w.icon.label.fontSize*8/e.name.length):w.icon.label.fontSize,fontWeight:w.icon.label.fontWeight,fontFamily:w.icon.label.fontFamily,color:j.iconLabel,letterSpacing:w.icon.label.letterSpacing,marginTop:w.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),S&&E("span",{style:{fontSize:w.icon.label.fontSize-1,fontWeight:w.icon.label.fontWeight,fontFamily:w.icon.label.fontFamily,letterSpacing:w.icon.label.letterSpacing,color:Hr.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})})}r(on,"DialIconItem");function Nt({side:e,color:t}){return E("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(([o,i,n,s],l)=>E("line",{x1:o,y1:i,x2:n,y2:s,stroke:t,strokeWidth:2},l))})}r(Nt,"PagerChevron");function Ht({side:e,disabled:t,onClick:o}){let[i,n]=te(false),s=t?j.emptyDotBorder:j.accent;return we("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:o,onPointerDown:()=>!t&&n(true),onPointerUp:()=>n(false),onPointerLeave:()=>n(false),onPointerCancel:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${j.dialBorder}`,backgroundColor:j.dialBackground,color:t?j.iconLabelMuted:j.centerText,fontSize:12,fontWeight:900,fontFamily:Lt,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${Fo(j.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&E(Nt,{side:"prev",color:s}),e==="prev"?"PREV":"NEXT",e==="next"&&E(Nt,{side:"next",color:s})]})}r(Ht,"PagerButton");function Wt({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:i,settingsOpen:n=false,hintsDisabled:s=false,emptyNote:l}){let{id:c}=_r(),[d,u]=te(0),[g,S]=te(0),[h,B]=te(0),[I,R]=te(0),[L,M]=te(0),[P,z]=te(1),[v,C]=te(false),[F,D]=te(false),[T,ee]=te(false),V=ft(null),K=ft(null),J=ft(null),G=ft(false),{entrance:ne,exit:Q,interaction:ue}=Lo,xe=Nr(),[be,ie]=te(()=>({width:window.innerWidth,height:window.innerHeight}));Pe(()=>{let O=r(()=>ie({width:window.innerWidth,height:window.innerHeight}),"resize");return window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]);let _=gt(()=>Pr({screenWidth:be.width,maxCircleSize:Math.max(120,Math.min(320,be.height-96))}),[be]),me=gt(()=>Lr(),[]),Re=gt(()=>Er(Qe,_.iconRadius),[_.iconRadius]),[Te,$e]=te(0),pe=Math.max(1,Math.ceil(e.length/Qe)),oe=Math.min(Te,pe-1),Ie=gt(()=>{let O=oe*Qe,a=[...e.slice(O,O+Qe)];for(;a.length<Qe;)a.push({id:`empty-${a.length}`,name:"",icon:null,onPress:r(()=>{},"onPress")});return a},[e,oe]);Pe(()=>{tn()},[]),Pe(()=>{let O=ne.backdrop.duration,a=ne.dial.rotation.duration,x=ne.centerButton.delay,A=ne.icons.delay,W=ne.icons.duration,q=performance.now(),Y=r(m=>{let f=m-q;u(Math.min(1,f/O));let k=Math.min(1,f/400),X=Ke(k)*1.1;k>.7&&(X-=(k-.7)*.33),k>=1&&(X=1),S(Math.max(0,Math.min(1.05,X)));let se=Math.min(1,f/a);if(B(Ke(se)*360),f>=x){let Se=Math.min(1,(f-x)/300),Ot=Ke(Se)*1.15;Se>.6&&(Ot-=(Se-.6)*.375),Se>=1&&(Ot=1),R(Math.max(0,Math.min(1.05,Ot)))}if(f>=A){let Se=Math.min(1,(f-A)/W);M(Ke(Se))}let Xe=A+W;f<Xe?J.current=requestAnimationFrame(Y):(u(1),S(1),B(360),R(1),M(1),ee(true))},"animate");return J.current=requestAnimationFrame(Y),()=>{J.current&&cancelAnimationFrame(J.current)}},[]);let ge=ht(()=>{if(G.current)return;G.current=true,D(true),J.current&&cancelAnimationFrame(J.current);let O=performance.now(),a=Q.icons.duration,x=Q.centerButton.duration,A=Q.dialScale.duration,W=Math.max(x,A),q=Q.backdrop.duration,Y=r(m=>{let f=m-O;if(f<a){let se=jt(f/a);M(1-se),J.current=requestAnimationFrame(Y);return}let k=a;if(f<k+W){M(0);let se=Math.min(1,(f-k)/x),Xe=Math.min(1,(f-k)/A);R(1-jt(se)),S(1-jt(Xe)),J.current=requestAnimationFrame(Y);return}let X=k+W;if(f<X+q){S(0),R(0);let se=(f-X)/q;u(1-se),J.current=requestAnimationFrame(Y);return}u(0),t()},"animate");J.current=requestAnimationFrame(Y)},[Q,t]);Pe(()=>{let O=document.activeElement,a=V.current;return()=>{O?.isConnected&&(document.activeElement===document.body||a?.contains(document.activeElement))&&O.focus()}},[]),Pe(()=>{if(n)return;K.current?.focus();let O=r(a=>{let x=V.current;if(x){if(a.key==="Escape")a.preventDefault(),ge();else if(a.key==="Tab"){let A=Array.from(x.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(Y=>Y.getClientRects().length>0),W=A[0],q=A[A.length-1];(!x.contains(document.activeElement)||(a.shiftKey?document.activeElement===W:document.activeElement===q))&&(a.preventDefault(),(a.shiftKey?q:W)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(a.key)){let A=Array.from(x.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),W=A.indexOf(document.activeElement);if(W<0||!A.length)return;a.preventDefault();let q=a.key==="Home"?0:a.key==="End"?A.length-1:(W+(a.key==="ArrowRight"||a.key==="ArrowDown"?1:-1)+A.length)%A.length;A[q].focus()}}},"handleKeyDown");return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[ge,n]);let[ae,Ce]=te(false);Pe(()=>{if(s)return;let O=false,a=setTimeout(async()=>{let x=await $o.getItem(Zo);!O&&!x&&Ce(true)},1200);return()=>{O=true,clearTimeout(a)}},[s]);let ke=ht(()=>{Ce(false),$o.setItem(Zo,"true")},[]);Pe(()=>{n&&ae&&ke()},[n,ae,ke]);let Ye=ht(O=>{if(O.id.startsWith("empty-")||G.current)return;let[a,x]=ue.iconSelect.pulse,A=performance.now(),W=150,q=r(Y=>{let m=Y-A;if(m<W){let f=Ke(m/W);z(1-(1-a.scale)*f),requestAnimationFrame(q)}else if(m<W*2){let f=Ke((m-W)/W);z(a.scale+(x.scale-a.scale)*f),requestAnimationFrame(q)}else z(1)},"animatePulse");requestAnimationFrame(q),setTimeout(()=>{O.onPress(),ge()},ue.iconSelect.actionDelay)},[ue.iconSelect,ge]),je=ht(O=>{if(G.current)return;let a=Math.max(0,Math.min(O,pe-1));a!==oe&&$e(a)},[pe,oe]),ve=_.buttonSize*w.centerButton.containerRatio,De=_.buttonSize*w.centerButton.borderRatio,fe=_.buttonSize*w.centerButton.containerRatio/2+6,ze=T&&!F;return we("div",{ref:V,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[E("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:ge,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:j.dialBackdrop,opacity:d}}),l?E("div",{role:"status","data-testid":"buoy-dial-empty-note",style:{position:"absolute",left:16,right:16,bottom:80+_.circleSize+16,color:j.iconLabel,fontSize:12,fontFamily:Lt,textAlign:"center",opacity:g>.01?1:0},children:l}):null,we("div",{style:{position:"absolute",left:"50%",marginLeft:-_.circleSize/2,bottom:80,width:_.circleSize,height:_.circleSize,borderRadius:"50%",backgroundColor:j.dialBackground,border:`${w.circle.borderWidth}px solid ${j.dialBorder}`,boxShadow:`0 0 ${w.circle.shadowRadius}px ${Fo(j.dialShadow,w.circle.shadowOpacity)}`,transform:`scale(${g}) rotate(${h}deg)`,opacity:g>.01?1:0,overflow:"hidden"},children:[E("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:j.dialGradient1,opacity:w.gradientLayers[0].opacity}}),E("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:j.dialGradient2,opacity:w.gradientLayers[1].opacity}}),E("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:j.dialGradient3,opacity:w.gradientLayers[2].opacity}}),me.map(O=>E("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:w.grid.lineHeight,transform:`rotate(${O}deg)`,transformOrigin:"center"},children:["left","right"].map(a=>E("div",{style:{position:"absolute",top:0,[a]:0,width:`calc(50% - ${fe}px)`,height:w.grid.lineHeight,backgroundColor:j.dialGridLine}},a))},O)),E("div",{"data-testid":"dial-background","data-background":c,style:{position:"absolute",inset:0,pointerEvents:"none"},children:c==="hyperspace"?E(ta,{size:_.circleSize}):E(Wr,{focus:sa})}),Ie.map((O,a)=>E(on,{icon:O,index:a,totalIcons:Ie.length,position:Re[a],progress:L,onPress:()=>Ye(O)},a)),we("div",{style:{position:"absolute",left:"50%",top:"50%",width:ve,height:ve,marginLeft:-ve/2,marginTop:-ve/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:j.hubHalo,borderRadius:_.buttonSize,overflow:"hidden",transform:`scale(${I*P})`,opacity:I>.01?1:0},children:[E("div",{style:{position:"absolute",inset:0,backgroundColor:j.dialGradient1,opacity:.5,borderRadius:_.buttonSize}}),E("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:j.dialGradient2,opacity:.3,borderRadius:_.buttonSize}}),E("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:j.dialGradient3,opacity:.2,borderRadius:_.buttonSize}}),E("div",{style:{width:De,height:De,borderRadius:_.buttonSize*w.centerButton.borderRadiusRatio,backgroundColor:j.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:E("button",{ref:K,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,onPointerEnter:O=>O.pointerType==="mouse"&&C(true),onPointerLeave:()=>C(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:v?`scale(${ue.centerHover.scale})`:"scale(1)",transition:`transform ${ue.centerHover.duration}ms ease`,animation:ze&&!v?xe.pulse:"none"},children:n?we("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:w.centerButton.text.fontSize-2,fontWeight:w.centerButton.text.fontWeight,fontFamily:w.centerButton.text.fontFamily,color:j.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${j.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[E("span",{style:{marginBottom:-2},children:"CLOSE"}),E("span",{style:{marginTop:-2},children:"SETTINGS"})]}):E("span",{style:{fontSize:w.centerButton.text.fontSize,fontWeight:w.centerButton.text.fontWeight,fontFamily:w.centerButton.text.fontFamily,color:j.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${j.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),pe>1&&we("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,g),transform:`scale(${Math.min(1,g)})`},children:[E(Ht,{side:"prev",disabled:oe<=0,onClick:()=>je(oe-1)}),we("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Lt,letterSpacing:2,color:j.centerText,textShadow:`0 0 6px ${j.centerTextGlow}`},children:[String(oe+1).padStart(2,"0"),we("span",{style:{color:j.iconLabelMuted,textShadow:"none"},children:[" / ",String(pe).padStart(2,"0")]})]}),E(Ht,{side:"next",disabled:oe>=pe-1,onClick:()=>je(oe+1)})]}),ae&&!n&&E($t,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:ke,showArrow:false})]})}r(Wt,"DialMenu");import{persistentStorage as nn,devToolsStorageKeys as la}from"@buoy-gg/shared-ui/web";import{recordUsage as ca,pruneUsage as da}from"@buoy-gg/floating-tools-core/web";var rn=la.dial.usage(),Ve={},an=false,_t=null;function Ut(){return _t||(_t=(async()=>{try{let e=await nn.getItem(rn);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ve=t)}}catch{}finally{an=true}})(),_t)}r(Ut,"loadDialUsage");Ut();function sn(e){return e.map((t,o)=>({id:t,index:o,lastUsed:Ve[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}r(sn,"getRankedToolIds");async function ln(e){if(!e)return;an||await Ut();let t=Math.max(Date.now(),...Object.values(Ve).map(o=>o.lastUsed+1));Ve=da(ca(Ve,e,t),t);try{await nn.setItem(rn,JSON.stringify(Ve))}catch{}}r(ln,"recordToolUsage");import{useCallback as ua,useMemo as cn}from"react";import{persistentStorage as pa}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Ae,useCallback as bt,useMemo as vt}from"react";import{settingsEventBus as St}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as ma}from"react";import{getRegisteredToolModule as ga}from"@buoy-gg/shared-ui/web";var fa=r(()=>()=>{},"noopSubscribe"),ha=r(()=>null,"serverSnapshot");function dn(){let e=ga("@buoy-gg/external-sync");return ma(e?.subscribeSyncStatus??fa,()=>e?.getSyncStatus?.()??null,ha)}r(dn,"useDesktopSyncStatus");import{SentryIcon as ya,WifiCircuitIcon as ba,ImageOverlayIcon as va,RenderCountIcon as Sa,Info as Kt,Layers as wa,ChevronRightIcon as un,ChevronDown as pn,getStorageBackendType as xa,getUseLicense as Ta,signOutOfBuoy as Ia,persistentStorage as Ee,Trash2 as Ca,CheckCircle2 as mn,BuoyUpgradeSheet as ka,BackgroundSwitcher as za,night as b,NightCard as Le,NightRows as Vt,NightSectionLabel as Aa,NightFootnote as gn,NightSwitch as fn,NightButton as Gt,NightSegmented as Ba,NightBadge as ye,NightSeparator as Ra,monoFont as hn}from"@buoy-gg/shared-ui/web";import{EnvIcon as yn,StorageIcon as Da,RoutesIcon as Ma,NetworkIcon as Oa,QueryIcon as Pa,HighlighterIcon as Ea,ReduxIcon as La,EventsIcon as Fa}from"@buoy-gg/floating-tools-core/web";import $a,{createContext as ja,useContext as Na}from"react";import{jsx as Ha}from"react/jsx-runtime";var bn=ja({});function qt({children:e,defaultFloatingTools:t,defaultDialTools:o}){let i=$a.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return Ha(bn.Provider,{value:i,children:e})}r(qt,"DefaultConfigProvider");function Jt(){return Na(bn)}r(Jt,"useDefaultConfig");import Wa from"react";import{toolTheme as _a}from"@buoy-gg/shared-ui/web";import{jsx as vn}from"react/jsx-runtime";function Sn({label:e,size:t,color:o=_a.colors.text}){let i=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=i<=2?t:t*1.6,s=Math.max(7,Math.min(t*(i===1?.7:.62),n/(.62*i)));return vn("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:s,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}r(Sn,"AppTextIcon");function Yt(e,t){return e==null?e:typeof e=="function"?Wa.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?vn(Sn,{label:String(e),size:t.size,color:t.color}):e}r(Yt,"renderAppIcon");import{JsModal as Ua,devToolsStorageKeys as Xt,onSettingsApplied as Ka,expandableWindowControlsSupported as Va}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Ga}from"@buoy-gg/shared-ui/web";import{Fragment as et,jsx as p,jsxs as N}from"react/jsx-runtime";var Ge="@react_buoy_dev_tools_settings",qa=6,wt=r(e=>{let t=qa,o={};for(let[i,n]of Object.entries(e))n&&t>0?(o[i]=true,t-=1):o[i]=false;return o},"enforceDialLimit"),Ja=r((e,t)=>{let{userStatus:o,environment:i,...n}=e,s=t?Object.entries(n).filter(([l])=>t.includes(l)):Object.entries(n);return{...Object.fromEntries(s),environment:i??false}},"sanitizeFloating"),wn=r((e,t,o)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(i).filter(([s])=>o.allowedDialKeys?.includes(s)):Object.entries(i);return{dialTools:wt(Object.fromEntries(n)),floatingTools:Ja({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},"mergeWithDefaults"),Ya=r((e=[],t,o)=>{let i={},n={},s=new Set(t??[]),l=new Set(o??[]),c=!o||o.length===0;for(let d of e){let{id:u,slot:g="both"}=d;(g==="dial"||g==="both")&&(i[u]=c?true:l.has(u)),(g==="row"||g==="both")&&(n[u]=s.has(u))}return{dialTools:wt(i),floatingTools:{...n,environment:s.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},"generateDefaultSettings"),Xa=r(({visible:e,onClose:t,onSettingsChange:o,initialSettings:i,availableApps:n=[],storage:s=Ee,zIndex:l})=>{let{defaultFloatingTools:c,defaultDialTools:d}=Jt(),u=vt(()=>Ya(n,c,d),[n,c,d]),g=vt(()=>Object.keys(u.dialTools),[u]),S=vt(()=>Object.keys(u.floatingTools).filter(m=>m!=="environment"),[u]),[h,B]=re(i||tt||u),[I,R]=re(Qt??"floating"),[L,M]=re(Qt!==null),[P,z]=re(new Set),[v,C]=re(false),[F,D]=re(false);Ae(()=>{let m=requestAnimationFrame(()=>D(true));return()=>cancelAnimationFrame(m)},[]);let T=dn();Ae(()=>{r(async()=>{try{let m=await Ee.getItem(Xt.settings.activeTab());if(m&&["floating","settings","pro"].includes(m)){let f=m;Qt=f,R(k=>k===f?k:f)}}catch{}finally{M(true)}},"loadActiveTab")()},[]),Ae(()=>{L&&Ee.setItem(Xt.settings.activeTab(),I).catch(m=>{console.warn("[Buoy]","Failed to save settings active tab:",m)})},[I,L]);let ee=Ta()?.(),V=ee?.isPro??false,K=!V&&ee?.licenseKey?ee.error:null,J=ee?.errorKind==="transport",[G,ne]=re(xn),[Q,ue]=re(false),[xe,be]=re(false),[ie,_]=re(false),[me,Re]=re([]),[Te,$e]=re(false),pe=Ga(),oe=Io.get("window").height,Ie=Io.get("window").width,ge=Math.floor(oe*.33),ae=Math.min(Ie-32,400),Ce=bt(async()=>{try{let m=await s.getItem(Ge);if(m){let f=JSON.parse(m),k=wn(u,f,{allowedDialKeys:g,allowedFloatingKeys:S});tt=k,B(X=>Tn(X,k)?X:k);return}tt=u,B(f=>Tn(f,u)?f:u)}catch(m){console.error("[Buoy]","Failed to load dev tools settings:",m),B(u)}},[u,g,S,s]);Ae(()=>{Ce()},[Ce]),Ae(()=>{xa().then(m=>{xn=m,ne(f=>f===m?f:m)})},[]),Ae(()=>{ie&&($e(true),Ee.getAllKeys().then(m=>{Re(m.sort())}).catch(()=>{Re([])}).finally(()=>{$e(false)}))},[ie]);let ke=r(async m=>{try{let f=null;try{let X=await s?.getItem(Ge);f=X?JSON.parse(X):null}catch{}let k={...m,dialTools:{...f?.dialTools,...wt(m.dialTools)},floatingTools:{...f?.floatingTools,...m.floatingTools}};await s.setItem(Ge,JSON.stringify(k)),tt=k,B(k),o?.(k),St.emit(k)}catch(f){console.error("[Buoy]","Failed to save dev tools settings:",f)}},"saveSettings"),Ye=r(m=>{let f={...h,floatingTools:{...h.floatingTools,[m]:!h.floatingTools[m]}};ke(f)},"toggleFloatingTool"),je=r(m=>{let f={...h,globalSettings:{...h.globalSettings,[m]:!h.globalSettings?.[m]}};ke(f)},"toggleGlobalSetting"),ve=r(async()=>{ue(true),be(false);try{await Ee.clear(),be(true),B(u),s!==Ee&&await s.setItem(Ge,JSON.stringify(u)),o?.(u),St.emit(u),setTimeout(()=>be(false),2e3)}catch(m){console.error("[Buoy]","Failed to clear storage:",m)}finally{ue(false)}},"handleClearStorage"),De=bt(m=>{},[]),fe=r(m=>{let f=n.find(k=>k.id===m);return f?.description?f.description:m==="environment"?"Environment badge.":""},"getToolDescription"),ze=r(m=>m==="environment"?"Env Badge":n.find(f=>f.id===m)?.name??m.toUpperCase().replace(/_/g," "),"getToolLabel"),O=r(m=>{if(!F)return null;switch(m){case"query":return p(Pa,{size:18});case"env":return p(yn,{size:18});case"sentry":return p(ya,{size:18,color:"#9945FF"});case"storage":return p(Da,{size:18,bgColor:b.color.surface});case"wifi":case"query-wifi-toggle":return p(ba,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(Ma,{size:18,bgColor:b.color.surface});case"network":return p(Oa,{size:18});case"environment":return p(yn,{size:18});case"debug-borders":return p(wa,{size:18,color:b.color.accent});case"highlight-updates":return p(Sa,{size:18,color:b.color.accent});case"highlight-updates-modal":return p(Ea,{size:18});case"redux":return p(La,{size:18});case"image-overlay":return p(va,{size:18});case"events":return p(Fa,{size:18});case"zustand":try{let{ZustandIcon:f}=Co("@buoy-gg/zustand/web");return p(f,{size:18})}catch{return p(Kt,{size:18,color:b.color.textSecondary})}case"jotai":try{let{JotaiIcon:f}=Co("@buoy-gg/jotai/web");return p(f,{size:18})}catch{return p(Kt,{size:18,color:b.color.textSecondary})}default:{let f=n.find(k=>k.id===m);return f?.icon!=null?Yt(f.icon,{slot:"row",size:18,color:f.color}):p(Kt,{size:18,color:b.color.textSecondary})}}},"getToolIcon"),a=r((m,f,k,X)=>{let se=fe(m);return N(dt,{activeOpacity:k?1:.7,onPress:()=>!k&&X(),accessibilityLabel:ze(m),accessibilityRole:"button",style:[y.toolRow,k&&y.rowDisabled],children:[p(H,{style:y.toolIconSlot,children:O(m)}),N(H,{style:y.rowInfo,children:[N(U,{style:y.rowLabel,children:[ze(m),k?" \xB7 max 6":""]}),se?p(U,{style:y.rowCaption,numberOfLines:1,children:se}):null]}),p(fn,{value:f,disabled:k,onValueChange:()=>X(),accessibilityLabel:ze(m)})]},m)},"renderToolRow"),x=r(m=>{z(f=>{let k=new Set(f);return k.has(m)?k.delete(m):k.add(m),k})},"toggleSettingExpanded"),A=r((m,f,k,X,se)=>{let Xe=h.globalSettings?.[m]??false,Se=P.has(m);return N(H,{children:[N(dt,{activeOpacity:.7,onPress:()=>x(m),accessibilityLabel:f,style:y.settingRow,children:[N(H,{style:y.rowInfo,children:[p(U,{style:y.rowLabel,children:f}),p(U,{style:y.rowCaption,numberOfLines:Se?0:1,children:k})]}),p(fn,{value:Xe,onValueChange:()=>je(m),accessibilityLabel:f})]}),Se&&N(H,{style:y.settingRowBody,children:[p(U,{style:y.settingRowBodyText,children:X}),p(U,{style:y.settingRowBodyHint,children:se})]})]},m)},"renderGlobalSettingRow"),W=r((m,f,k)=>N(H,{children:[p(Aa,{children:m}),f,k]}),"renderSection"),q=G==="filesystem"?p(ye,{label:"File System",tone:"accent"}):G==="asyncstorage"?p(ye,{label:"Async Storage",tone:"warning"}):G==="localstorage"?p(ye,{label:"Local Storage",tone:"accent"}):G==="memory"?p(ye,{label:"Memory",tone:"danger"}):p(ye,{label:"Loading\u2026",tone:"neutral"}),Y=r(()=>N(H,{style:y.container,children:[N(To,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[I==="floating"&&p(et,{children:W("Floating Tools",p(Le,{glass:true,children:p(Vt,{children:Object.entries(h.floatingTools).map(([m,f])=>a(m,f,false,()=>Ye(m)))})}),p(gn,{children:"Tools switched on here appear in the floating bubble row."}))}),I==="settings"&&N(et,{children:[W("Background",p(Le,{glass:true,padded:true,children:p(za,{embedded:true})})),W("Storage",N(Le,{glass:true,children:[N(dt,{activeOpacity:.7,onPress:()=>_(!ie),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(U,{style:y.rowLabel,children:"Storage Type"})}),q,ie?p(pn,{size:16,color:b.color.textTertiary}):p(un,{size:16,color:b.color.textTertiary})]}),ie&&N(et,{children:[N(H,{style:y.settingRowBody,children:[p(U,{style:y.settingRowBodyText,children:G==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":G==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":G==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":G==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),G==="asyncstorage"&&p(U,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),G==="memory"&&p(U,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(Ra,{}),N(H,{style:y.storageExpanded,children:[N(H,{style:y.storageExpandedHeader,children:[p(U,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(U,{style:y.storageExpandedCount,children:Te?"\u2026":`${me.length} keys`})]}),Te?p(U,{style:y.storageKeyEmpty,children:"Loading\u2026"}):me.length===0?p(U,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(To,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:me.map(m=>p(H,{style:y.storageKeyItem,children:p(U,{style:y.storageKeyText,numberOfLines:1,children:m.replace("@react_buoy_","")})},m))})]}),p(H,{style:y.cardButtonWrap,children:p(Gt,{label:xe?"Cleared":Q?"Clearing\u2026":"Clear All Settings",variant:xe?"secondary":"destructive",size:"md",disabled:Q,onPress:ve,icon:xe?p(mn,{size:15,color:b.color.accent}):p(Ca,{size:15,color:Q?b.color.textTertiary:b.color.danger})})})]})]})),T&&T.state!=="idle"&&W("Desktop Sync",N(Le,{glass:true,children:[N(dt,{activeOpacity:.7,onPress:()=>x("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(U,{style:y.rowLabel,children:"Buoy Desktop"})}),T.state==="connected"?p(ye,{label:"Connected",tone:"accent"}):T.state==="connecting"?p(ye,{label:"Connecting\u2026",tone:"neutral"}):p(ye,{label:"Retrying",tone:"warning"}),P.has("desktopSync")?p(pn,{size:16,color:b.color.textTertiary}):p(un,{size:16,color:b.color.textTertiary})]}),P.has("desktopSync")&&N(H,{style:y.settingRowBody,children:[N(U,{style:y.settingRowBodyText,children:[T.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(U,{style:y.footnoteMono,children:T.targetURL??"(unknown URL)"}),T.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),T.state==="retrying"&&T.lastError&&N(U,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",T.lastError]})]})]})),W("Modal Behavior",p(Le,{glass:true,children:N(Vt,{children:[A("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."),Va(Ne.OS==="web")?A("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]})}))]}),I==="pro"&&N(et,{children:[W("License",N(Le,{glass:true,children:[N(H,{style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(U,{style:y.rowLabel,children:"License Status"})}),p(H,{testID:"buoy-settings-license-status",accessibilityLabel:V?"License: Active":"License: Free",children:V?p(ye,{label:"Active",tone:"accent"}):p(ye,{label:"Free",tone:"neutral"})})]}),ee?.tierSource==="session"?N(H,{style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(U,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Gt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void Ia(),testID:"buoy-settings-signout"})]}):null,ee?.teamRole?p(H,{style:y.settingRow,testID:"buoy-settings-team-role",children:N(H,{style:y.rowInfo,children:[N(U,{style:y.rowLabel,children:["Role: ",ee.teamRole]}),p(U,{style:y.rowCaption,children:ee.allowedTools?"Your team picks the tools you see.":"You see all tools."})]})}):null]}),p(gn,{children:V?"You have full access to all Buoy DevTools features.":K?J?`Couldn't reach the license server (${K}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${K}.`:"Upgrade to Pro to unlock all features and support development."})),!V&&N(et,{children:[W("Pro Features",p(Le,{glass:true,children:p(Vt,{children:["Advanced Settings","Priority Support"].map(m=>N(H,{style:y.featureRow,children:[p(mn,{size:16,color:b.color.accent}),p(U,{style:y.rowLabel,children:m})]},m))})})),p(Gt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),p(ka,{visible:v,onClose:()=>C(false)})]}),"renderContent");return p(Ua,{visible:e,onClose:t,zIndex:l,variant:"night",header:{showToggleButton:false,customContent:p(H,{style:y.headerRow,children:p(Ba,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:I,onChange:m=>R(m)})})},initialMode:"bottomSheet",onModeChange:De,persistenceKey:Xt.settings.root(),enablePersistence:true,maxHeight:oe-pe.top,initialHeight:ge,initialFloatingPosition:{x:(Ie-ae)/2,y:pe.top+20},enableGlitchEffects:true,children:Y()})},"DevToolsSettingsModal"),Qa={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Za=r((e,t)=>{let o=new Set(e??[]),i=new Set(t??[]),n={};for(let l of i)n[l]=true;let s={environment:o.has("environment")};for(let l of o)l!=="environment"&&(s[l]=true);return{dialTools:wt(n),floatingTools:s,globalSettings:{enableSharedModalDimensions:false}}},"createDefaultsFromConfig"),tt=null,Qt=null,xn=null,Tn=r((e,t)=>JSON.stringify(e)===JSON.stringify(t),"sameSettings");St.addListener(e=>{e&&(tt=e)});var In=r(()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Jt(),o=vt(()=>!e&&!t?Qa:Za(e,t),[e,t]),[i,n]=re(o),s=bt(async()=>{try{let c=await Ee.getItem(Ge);if(c){let d=JSON.parse(c),u=wn(o,d);n(u);return}n(o)}catch(c){console.error("[Buoy]","Failed to load dev tools settings:",c),n(o)}},[o]);Ae(()=>Ka(c=>{c.includes(Ge)&&s()}),[s]),Ae(()=>{s();let c=St.addListener(d=>{try{d&&n(d)}catch{}});return()=>{c()}},[s]);let l=bt(()=>{s()},[s]);return{settings:i,refreshSettings:l}},"useDevToolsSettings"),y=ct.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:b.gutter,paddingRight:b.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:b.gutter,paddingTop:8,paddingBottom:24,gap:b.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:b.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:b.rowPadH,paddingVertical:b.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:b.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:b.color.text,fontSize:b.font.row,fontWeight:"500"},rowCaption:{color:b.color.textTertiary,fontSize:b.font.label},settingRowBody:{paddingHorizontal:b.rowPadH,paddingBottom:b.rowPadV,gap:6},settingRowBodyText:{color:b.color.textSecondary,fontSize:b.font.caption,lineHeight:b.font.caption*1.45},settingRowBodyHint:{color:b.color.textTertiary,fontSize:b.font.caption,lineHeight:b.font.caption*1.45},bodyWarning:{color:b.color.warning},bodyDanger:{color:b.color.danger},cardButtonWrap:{paddingHorizontal:b.cardPad,paddingTop:10,paddingBottom:b.cardPad},storageExpanded:{paddingHorizontal:b.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:b.color.textSecondary,fontSize:b.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:b.color.textTertiary,fontSize:b.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:b.color.glassElevated,borderRadius:b.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:b.color.textSecondary,fontSize:b.font.micro,fontFamily:hn},storageKeyEmpty:{color:b.color.textTertiary,fontSize:b.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:hn,fontSize:b.font.label,color:b.color.textSecondary}});import{jsx as Cn}from"react/jsx-runtime";var es=[];function Zt({visible:e,onClose:t,availableTools:o=es,defaultFloatingTools:i,defaultDialTools:n,storage:s=pa,onSettingsChange:l}){let c=cn(()=>({getItem:r(async g=>s.getItem(g),"getItem"),setItem:r(async(g,S)=>s.setItem(g,S),"setItem")}),[s]),d=cn(()=>o.map(g=>({...g,name:g.name??g.id,icon:typeof g.icon=="function"?S=>g.icon(S.size):g.icon})),[o]),u=ua(g=>{l?.(g)},[l]);return Cn(qt,{defaultFloatingTools:i,defaultDialTools:n,children:Cn(Xa,{visible:e,onClose:t,zIndex:11e3,availableApps:d,storage:c,onSettingsChange:u})})}r(Zt,"SettingsModal");import{listenBuoyKeydown as ts}from"@buoy-gg/shared-ui/web/floating";import{persistentStorage as kn,setExpandableWindowControls as os}from"@buoy-gg/shared-ui/web";import{createContext as ns,useCallback as Be,useContext as is,useEffect as xt,useMemo as rs,useRef as ot,useState as zn}from"react";var as=r((e,t,o)=>{if(t.singleton){let n=e.find(s=>s.id===t.id);if(n){let s=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:s,apps:[...e.filter(l=>l.instanceId!==n.instanceId),{...n,minimized:false}]}}}let i=o();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}},"resolveOpenAppsState");import{createContext as ss,useCallback as An,useContext as ls,useEffect as Tt,useMemo as cs,useRef as Bn,useState as It}from"react";import{JsModal as ds,ModalHeader as nt,HeaderSearchButton as us,TickProvider as ps,ToolScreenHeaderContext as ms,devToolsStorageKeys as Rn,buoyColors as Dn,gameUIColors as eo}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as Ct}from"react/jsx-runtime";var it=r(()=>{},"noop"),gs={search:"",isSearchActive:false,clearSearch:it,close:it,minimize:it,showToast:it,setHeaderOverride:it},Mn=ss(null);function to(){return ls(Mn)??gs}r(to,"useToolHost");function On(e,t){let{setHeaderOverride:o}=to();Tt(()=>(o(e),()=>o(null)),t)}r(On,"useToolHeader");var Pn=2200,fs={success:eo.success,error:eo.error,info:eo.info};function En({message:e,type:t,nonce:o}){let i=Bn(new Me.Value(0)).current;Tt(()=>{i.setValue(0),Me.sequence([Me.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Me.delay(Pn-450),Me.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,i]);let n=fs[t];return Ct(Me.View,{pointerEvents:"none",style:[kt.toast,{opacity:i,borderColor:n+"60"}],children:[le(H,{style:[kt.toastDot,{backgroundColor:n}]}),le(U,{style:kt.toastText,numberOfLines:2,children:e})]})}r(En,"ToastView");function Ln({app:e,config:t,visible:o,zIndex:i,onClose:n,onMinimize:s,initialModalState:l,enableSharedModalDimensions:c,bodyProps:d}){let u=e.component,[g,S]=It(false),[h,B]=It(""),[I,R]=It(null),[L,M]=It(null),P=Bn(null),z=An(()=>{S(false),B("")},[]),v=An((G,ne="info")=>{P.current&&clearTimeout(P.current),M(Q=>({message:G,type:ne,nonce:(Q?.nonce??0)+1})),P.current=setTimeout(()=>M(null),Pn)},[]);Tt(()=>()=>{P.current&&clearTimeout(P.current)},[]);let C=cs(()=>({search:g?h:"",isSearchActive:g,clearSearch:z,close:n,minimize:r(()=>s(),"minimize"),showToast:v,setHeaderOverride:R,instanceId:e.instanceId}),[h,g,z,n,s,v,e.instanceId]),F=I?.title??t.title??e.title??e.id,D=I?.subtitle??t.subtitle,T=I?.onBack,ee=I?.actions??t.headerActions,V=I?.searchable??t.searchable;Tt(()=>{!V&&g&&z()},[V,g,z]);let K=c?Rn.modal.root():Rn.custom(e.id).modal(),J=Ct(nt,{children:[T&&!g&&le(nt.Navigation,{onBack:T}),g?le(nt.Search,{value:h,onChangeText:B,onCancel:z,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):le(nt.Content,{title:F,subtitle:D}),Ct(nt.Actions,{children:[!g&&ee,V&&!g&&le(us,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>S(true)})]})]});return le(Mn.Provider,{value:C,children:le(ds,{visible:o,onClose:n,onBack:T,onMinimize:s,initialModalState:l,zIndex:i,persistenceKey:K,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:J,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Ct(H,{style:kt.bodyRoot,children:[le(ps,{children:le(ms.Provider,{value:R,children:le(u,{...d})})}),L&&le(En,{message:L.message,type:L.type,nonce:L.nonce})]})})})}r(Ln,"ToolModalShell");var kt=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:Dn.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:Dn.text}});import{useEffect as hs,useRef as ys}from"react";import{capacitorPlatform as bs,capacitorPlugin as vs}from"@buoy-gg/license/web";function Fn(){return globalThis.__BUOY_HOLDS_BACK__===true}r(Fn,"isBuoyHoldingBackButton");var Ss=99.5;function $n(){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}}r($n,"ionicHandlesBack");function jn(e,t){let o=ys(t);o.current=t,hs(()=>{if(!e||bs()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let n;if($n()){let s=r(l=>{l.detail?.register?.(Ss,()=>{o.current()})},"listener");document.addEventListener("ionBackButton",s),n=r(()=>document.removeEventListener("ionBackButton",s),"cleanup")}else{let s=vs("App");if(!s?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let l=false,c=null;Promise.resolve(s.addListener("backButton",()=>o.current())).then(d=>{l?d.remove():c=d}).catch(()=>{}),n=r(()=>{l=true,c&&c.remove()},"cleanup")}return()=>{n(),i.__BUOY_HOLDS_BACK__=false}},[e])}r(jn,"useCapacitorBackButton");import{Fragment as ws,jsx as ce}from"react/jsx-runtime";var Nn=ns(null),Hn="@react_buoy_open_apps",oo=44,xs=12,Ts=100,Is=16,Cs=r(e=>({x:window.innerWidth-oo-Is,y:window.innerHeight-Ts-oo-e*(oo+xs)}),"dockIconPosition"),Wn=r(({children:e})=>{let[t,o]=zn([]),[i,n]=zn(false),s=ot([]),l=ot(null),c=ot(false),d=ot(false),u=ot(false),g=Be(v=>{let C="";return o(F=>{let{apps:D,instanceId:T}=as(F,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=T,D}),C},[]),S=Be(()=>{if(c.current||!d.current||!u.current)return;c.current=true;let v=l.current;if(!v||v.length===0){n(true);return}l.current=null,v.forEach(({id:C,minimized:F})=>{let D=s.current.find(T=>T.id===C);if(D&&D.component){let T=Yt(D.icon,{slot:"dial",size:20,color:D.color});g({id:D.id,title:D.name,component:D.component,props:D.props,modal:D.modal,launchMode:D.launchMode||"self-modal",singleton:D.singleton??true,icon:T,color:D.color,minimized:F})}}),n(true)},[g]);xt(()=>{let v=false;return r(async()=>{try{let C=await kn.getItem(Hn);if(v)return;if(C){let F=JSON.parse(C),D;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?D=F.map(T=>({id:T,minimized:false})):D=F.filter(T=>typeof T=="object"&&T!==null&&typeof T.id=="string"),D.length&&(l.current=D))}}catch{}v||(d.current=true,S())},"restoreOpenApps")(),()=>{v=true}},[S]),xt(()=>{if(!i)return;let v=t.map(C=>({id:C.id,minimized:C.minimized??false}));kn.setItem(Hn,JSON.stringify(v))},[t,i]);let h=Be(v=>{s.current=v,u.current=true,S()},[S]),B=Be(v=>{o(C=>C.length?v?C.filter(F=>F.instanceId!==v):C.slice(0,-1):C)},[]),I=Be(()=>o([]),[]),R=Be((v,C)=>{o(F=>F.map(D=>D.instanceId===v?{...D,minimized:true,restoreState:C}:D))},[]),L=Be((v,C)=>{o(F=>{let D=F.find(T=>T.instanceId===v);return D?[...F.filter(T=>T!==D),{...D,minimized:false,restoreState:C??D.restoreState}]:F})},[]),M=Be(v=>t.find(C=>C.instanceId===v)?.minimized??false,[t]),P=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);xt(()=>P?ts(r(v=>{if(v.key!=="Escape"||v.defaultPrevented)return;let C=[...t].reverse().find(F=>F.launchMode!=="toggle-only"&&!F.minimized);C&&B(C.instanceId)},"handler")):void 0,[P,B,t]),jn(t.length>0,()=>B());let z=rs(()=>({openApps:t,isAnyOpen:P,open:g,close:B,closeAll:I,registerApps:h,minimize:R,restore:L,isMinimized:M}),[t,P,g,B,I,h,R,L,M]);return ce(Nn.Provider,{value:z,children:e})},"AppHostProvider"),rt=r(()=>{let e=is(Nn);return e||{openApps:[],isAnyOpen:false,open:r(()=>"","open"),close:r(()=>{},"close"),closeAll:r(()=>{},"closeAll"),registerApps:r(()=>{},"registerApps"),minimize:r(()=>{},"minimize"),restore:r(()=>{},"restore"),isMinimized:r(()=>false,"isMinimized")}},"useAppHost"),ks=9e3,zs={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},As={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Bs=r(({app:e,zIndex:t,onClose:o,onMinimize:i,minimizeTargetPosition:n,enableSharedModalDimensions:s})=>{let l=e.component,c=!e.minimized,d={...e.props??{},...s?{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(Ln,{app:e,config:e.modal,visible:c,zIndex:t,onClose:o,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:s,bodyProps:d})}):e.launchMode==="self-modal"?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(l,{...d,visible:c,onClose:o,onRequestClose:o,onMinimize:i,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?c?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(l,{...d,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...zs,zIndex:t,display:c?"flex":"none"},children:ce("div",{style:As,children:ce(l,{...d,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},"AppRenderer"),_n=r(()=>{let{openApps:e,close:t,minimize:o}=rt(),{settings:i}=In();xt(()=>{os(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let n=e.filter(c=>c.launchMode!=="toggle-only");if(n.length===0)return null;let s=n.filter(c=>c.minimized).length,l=Or()??Cs(s);return ce(ws,{children:n.map((c,d)=>ce(Bs,{app:c,zIndex:ks+d,onClose:()=>t(c.instanceId),onMinimize:u=>o(c.instanceId,u),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:l},c.instanceId))})},"AppOverlay");import{useCallback as Rs,useEffect as no,useRef as Ds,useState as Un,useSyncExternalStore as Kn}from"react";import{persistentStorage as Vn,getToolAttention as io,subscribeToolAttention as Gn}from"@buoy-gg/shared-ui/web";import{jsx as de,jsxs as zt}from"react/jsx-runtime";function qn(e){return Kn(Gn,()=>io(e),()=>io(e))}r(qn,"useToolAttention");var Jn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},Yn={needsInput:3,failed:2,done:1},Xn=new Map;function ro(e){let t=null;for(let i of e?e.split("|"):[]){let n=io(i);n&&(!t||Yn[n.kind]>Yn[t.kind])&&(t=n)}let o=Xn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(Xn.set(e,t),t)}r(ro,"strongest");function Qn(e){let t=e.join("|");return Kn(Gn,()=>ro(t),()=>ro(t))}r(Qn,"useStrongestAttention");var Zn=28,ao=32,so=6,ei=8,ti=24,oi="@react_buoy_minimized_stack_expanded",Ms=80,ni=2e3,Os=6e3,Ps="#1A1A1A",at="#888888";function lo({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:at,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}r(lo,"ChevronGlyph");function ii({id:e,title:t,icon:o,index:i,onPress:n}){let s=qn(e),l=Ds(null);return no(()=>{let c=true,d,u=r(()=>{l.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:Ms,easing:"linear"})},"runGlitch"),g=r(S=>{let h=S?500+Math.random()*1500+i*200:ni+Math.random()*(Os-ni)+i*300;d=setTimeout(()=>{c&&(u(),g(false))},h)},"schedule");return g(true),()=>{c=false,clearTimeout(d)}},[i]),zt("button",{type:"button","aria-label":s?`${t} \u2014 ${s.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:ao,height:ao,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[de("div",{ref:l,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),s?de("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${s.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:Jn[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(ii,"GlitchToolButton");function ri({containerWidth:e=32}){let{openApps:t,restore:o}=rt(),i=t.filter(h=>h.minimized&&h.launchMode!=="toggle-only"),[n,s]=Un(false),[l,c]=Un(false),d=Qn(i.map(h=>h.id));no(()=>{let h=false;return r(async()=>{let B=await Vn.getItem(oi);!h&&B==="true"&&s(true),h||c(true)},"load")(),()=>{h=true}},[]),no(()=>{l&&Vn.setItem(oi,n?"true":"false")},[n,l]);let u=Rs(h=>{o(h)},[o]);if(i.length===0)return null;let g=ei+i.length*ao+(i.length-1)*so+so+ti+4,S={backgroundColor:Ps,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${at}66`,borderLeft:`1px solid ${at}66`,borderRight:`1px solid ${at}66`,borderBottom:"none",boxSizing:"border-box"};return zt("div",{style:{height:Zn,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:n?"visible":"hidden",height:n?g:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...S},children:zt("div",{style:{height:g,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:ei,gap:so,boxSizing:"border-box"},children:[n&&[...i].reverse().map((h,B)=>de(ii,{id:h.id,title:h.title||h.id,icon:h.icon??de("span",{style:{color:"#fff",fontSize:13},children:(h.title||h.id).slice(0,1).toUpperCase()}),index:B,onPress:()=>u(h.instanceId)},h.instanceId)),de("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>s(false),style:{width:"100%",height:ti,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:de(lo,{down:true})})]})}),zt("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>s(true),style:{position:"absolute",bottom:0,left:0,width:e,height:Zn,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...S},children:[de(lo,{}),d?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:Jn[d.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.kind==="needsInput"?"!":""}):null,i.length>1&&de("span",{style:{fontSize:9,fontWeight:600,color:at,marginLeft:1},children:i.length})]})]})}r(ri,"MinimizedToolsStack");import{registerToolModules as Es}from"@buoy-gg/shared-ui/web";import{createElement as Ls}from"react";function qe(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ls(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}r(qe,"createWebTool");import{createContext as Fs,useContext as $s,useState as ai,useMemo as si}from"react";import{jsx as js}from"react/jsx-runtime";var li=Fs(null);function co({children:e}){let[t,o]=ai(false),[i,n]=ai(false),s=si(()=>t||i,[t,i]),l=si(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:s,setDialOpen:o,setToolOpen:n}),[t,i,s]);return js(li.Provider,{value:l,children:e})}r(co,"DevToolsVisibilityProvider");function At(){let e=$s(li);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:r(()=>{},"setDialOpen"),setToolOpen:r(()=>{},"setToolOpen")}}r(At,"useDevToolsVisibility");import*as Ns from"@buoy-gg/license/web";import*as Hs from"@buoy-gg/shared-ui/web";import*as Ws from"@buoy-gg/shared-ui/web/dataViewer";function uo(e){Es({core:{useDevToolsVisibility:At},license:Ns,"shared-ui":Hs,"shared-ui/dataViewer":Ws,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([i,n])=>!i.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[qe(n)])))}r(uo,"createWebTools");import{useEffect as Bt,useMemo as Rt,useRef as _s}from"react";import{LicenseManager as ci,installCapacitorBridge as Us,resolveDevBuild as di,useLicense as Ks}from"@buoy-gg/license/web";import{registerToolAdapters as Vs}from"@buoy-gg/shared-ui/web";function po(e){return typeof e=="object"&&e!==null?e:void 0}r(po,"externalSyncOptions");function ui({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:i}){if(o===false||!i)return false;if(e)return true;let n=po(o);return t&&n?.enableInRelease===true&&mo(n.socketURL,n)===null}r(ui,"shouldMountExternalSync");var pi="http://localhost:42831";function mi(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}r(mi,"isLoopbackHost");function mo(e,t){let o=e??pi;if(t?.allowInsecureNetwork===true)return null;let i;try{i=new URL(o)}catch{return`[Buoy] externalSync.socketURL "${o}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return i.protocol==="https:"||i.protocol==="wss:"||mi(i.hostname)?null:`[Buoy] This release build won't connect to ${o}: 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.`}r(mo,"releaseTransportProblem");var Gs={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function gi(e,t,o){if(t)return e;let i=null;for(let[n,s]of Object.entries(Gs)){if(o?.includes(n))continue;let l=e[n];if(!l?.actions)continue;let c={...l.actions};for(let d of s)d in c&&(c[d]=()=>{throw new Error(`${n}.${d} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${n}"] }}.`)});i??(i={...e}),i[n]={...l,actions:c}}return i??e}r(gi,"applyReleaseActionPolicy");import{useEffect as qs,useMemo as Js,useState as Ys}from"react";import{devToolsStorageKeys as Xs,persistentStorage as Qs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as Zs}from"@buoy-gg/license/web";var el=8;function fi(){let e="";for(;e.length<el;)e+=(Math.random()*16|0).toString(16);return e}r(fi,"generateInstallId");function hi(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}r(hi,"slugify");function yi({appName:e,hardwareName:t,platform:o,installId:i,deviceId:n}){let s=hi(e??"buoy")||"buoy",l=e??"Buoy Device",c=t?.trim()||o;return n?{deviceId:n,deviceName:`${l} (${c})`}:{deviceId:`${s}-${o}-${i}`,deviceName:`${l} (${c} \xB7 ${i.slice(-4)})`}}r(yi,"buildDeviceIdentity");function bi(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}r(bi,"sessionStore");function vi(){let e=globalThis;try{return e.localStorage??null}catch{return null}}r(vi,"localStore");async function Si({platform:e=Ne.OS,store:t,mint:o=fi}={}){let i=Xs.sync.deviceId(),n=t===void 0?Zs()?vi():e==="web"?bi():Qs:t;if(!n)return o();try{let s=await n.getItem(i);if(s&&s.length>0)return s;let l=o();return await n.setItem(i,l),l}catch{return o()}}r(Si,"loadInstallId");var go=null;function wi(){return go||(go=Si()),go}r(wi,"getInstallId");function xi(e,t){let o=e?.deviceId,i=e?.deviceName,n=t.loadId??wi,s=t.platform??Ne.OS,[l,c]=Ys(null);return qs(()=>{if(o)return;let d=false;return n().then(u=>{d||c(u)}),()=>{d=true}},[o,n]),Js(()=>{if(!o&&!l)return null;let d=yi({appName:t.appName,hardwareName:t.hardwareName,platform:s,installId:l??"",deviceId:o});return i?{...d,deviceName:i}:d},[o,i,l,t.appName,t.hardwareName,s])}r(xi,"useDeviceIdentity");import{useEffect as tl,useState as ol}from"react";import{capacitorPlatform as nl,capacitorPlugin as Dt,isCapacitorNative as il}from"@buoy-gg/license/web";function Ti(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let o=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!o||o==="K"?null:o}r(Ti,"hardwareFromUserAgent");function Ii(e){return/sdk_gphone|Android SDK built for|Android ATD built for|google_sdk|Emulator|generic_/i.test(e)}r(Ii,"isAndroidEmulatorUserAgent");function fo(){return typeof navigator>"u"?"":navigator.userAgent??""}r(fo,"userAgent");function Mt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}r(Mt,"firstPageTitle");var Ci="@react_buoy_capacitor_app_name";function ki(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem(Ci);if(o)return o;e&&t.setItem(Ci,e)}catch{}return e}r(ki,"persistedAppName");function zi(){let e=nl();if(!e)return{platform:"web",appName:Mt(),hardwareName:"Browser",ready:true};let t=!!Dt("App");return{platform:e,appName:t?Mt():ki(Mt()),hardwareName:Ti(fo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Dt("Device")}}r(zi,"initialHostInfo");function Ai(){let[e,t]=ol(zi);return tl(()=>{if(!il())return;let o=false,i=Dt("App"),n=Dt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([s,l])=>{if(o)return;let c=s?.name?.trim(),d=l?.name?.trim()||l?.model?.trim();t(u=>({...u,appName:c||u.appName,hardwareName:d||u.hardwareName,ready:true}))}),()=>{o=true}},[]),e}r(Ai,"useHostInfo");function ho(){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:fo(),serverUrl:typeof e=="string"?e:null}}r(ho,"pageInfo");function yo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}r(yo,"schemeHost");function Bi(e,t){if(e==="ios"){let o=yo(t.serverUrl);return o?o===yo(t.origin):t.protocol==="capacitor:"}return Ri.has(t.hostname)}r(Bi,"isBundledPage");var Ri=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Di(e,t,o,i=ho()){if(o==="web"||!i)return e;let n;try{n=new URL(e)}catch{return e}let s=Bi(o,i);return!t&&s&&n.hostname===i.hostname&&(n.hostname="localhost"),o==="android"&&Ri.has(n.hostname)&&Ii(i.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}r(Di,"capacitorBrokerURL");function Mi(e,t,o=ho()){return t!=="android"||!o||o.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${o.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.`}r(Mi,"capacitorTransportProblem");import{getDevServerOrigin as rl,resolveReloadStrategy as al,scheduleReloadApp as sl}from"@buoy-gg/shared-ui/web";var Oi=Date.now(),Pi=rl(),ll={platform:Ne.OS,isTV:Ne.isTV===true,isTVOS:Ne.isTVOS===true},Ei={version:3,getSnapshot:r(()=>{let e=al("auto");return{startedAt:Oi,devServerOrigin:Pi,device:ll,reload:{available:e!==null,strategy:e}}},"getSnapshot"),subscribe:r(e=>()=>{},"subscribe"),actions:{ping:r(()=>({ok:true,startedAt:Oi,devServerOrigin:Pi}),"ping"),reloadApp:r(e=>{let t=e??{},{strategy:o,delayMs:i}=sl({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:i}},"reloadApp")}};import{Fragment as cl,jsx as Fe,jsxs as dl}from"react/jsx-runtime";var ul=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],pl=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Li(e){let t=Rt(()=>Object.fromEntries(Object.entries(e.modules).map(([i,n])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?Fe(Fi,{...e,modules:t,query:o}):Fe(bo,{...e,modules:t})}r(Li,"BrowserToolRuntime");function Fi(e){let t=e.query.useReactQuerySyncAdapter();return Fe(bo,{...e,queryAdapter:t})}r(Fi,"QueryRuntime");function bo({modules:e,apps:t,requiredEnvVars:o,externalSync:i,headless:n,sentryGetClient:s,queryAdapter:l}){let{isPro:c,tier:d}=Ks(),u=Rt(()=>{let L={app:Ei};for(let[M,P]of Object.entries(e))for(let[z,v]of Object.entries(P))z.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(L[M]=v);l&&(L.query=l),e.env?.createEnvSyncAdapter&&(L.env=e.env.createEnvSyncAdapter(o??[]));for(let M of t??[])M.sync&&(L[`custom:${M.id}`]=M.sync);return L},[e,t,o,l]),g=_s(u);g.current=u,Bt(()=>Vs(()=>g.current),[]),Bt(()=>{let L=[],M=r(P=>{let z=P?.();typeof z=="function"&&L.push(z)},"start");return M(e.network?.startNetworkCapture),M(e.storage?.startBrowserStorageCapture),M(e.assets?.startBrowserAssetCapture),M(e.three?.startThreeCapture),di(typeof He<"u"?He:process.env.NODE_ENV!=="production")&&M(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&M(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&M(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let P of L.reverse())P()}},[e]);let S=e["external-sync"],h=di(typeof He<"u"?He:process.env.NODE_ENV!=="production"),B=ui({isDevelopment:h,isLicensed:c,externalSync:i,isAvailable:!!S}),I=po(i);Us({release:!h&&!!I?.enableInRelease}),!h&&I?.enableInRelease&&vo(mo(I.socketURL,I));let R=e.sentry?.SentryRoot;return dl(cl,{children:[Object.entries(e).flatMap(([L,M])=>ul.map(P=>{let z=M[P];return z?Fe(z,{},`${L}:${P}`):null})),R&&Fe(R,{getClient:s}),Object.entries(e).flatMap(([L,M])=>pl.map(P=>{let z=M[P];return z&&(!n||P==="ScenariosOverlay"||P==="ImpersonateOverlay")?Fe(z,{},`${L}:${P}`):null})),B&&Fe(ji,{module:S,tools:u,options:I,isPro:c,tier:d,dev:h})]})}r(bo,"ToolRuntime");var $i=null;function vo(e){!e||e===$i||($i=e,console.warn("[Buoy]",e))}r(vo,"warnOnce");function ji({module:e,tools:t,options:o,isPro:i,tier:n,dev:s}){let l=Ai(),c=xi(o,{appName:l.appName,hardwareName:l.hardwareName,platform:l.platform}),d=Rt(()=>Di(o?.socketURL??(s?e.getDefaultSocketURL():pi),!!o?.socketURL,l.platform),[o?.socketURL,s,e,l.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:c?.deviceName??"Buoy Browser",socketURL:d,persistentDeviceId:l.ready?c?.deviceId??null:null,platform:l.platform,extraDeviceInfo:l.extraDeviceInfo,enableLogs:o?.enableLogs});Bt(()=>{let h=Mi(d,l.platform);if(!u||!h)return;let B=r(()=>vo(h),"onError");return u.on("connect_error",B),()=>{u.off("connect_error",B)}},[u,d,l.platform]),Bt(()=>{if(!u)return;let h=r(()=>{if(!u.connected||!ci.hasAccountAccess())return;let B=ci.getState();!i&&(B.isInitialized===false||B.isValidating===true)||u.emit("device-license",{isPro:i?"1":"0",tier:n})},"emit");return h(),u.on("connect",h),()=>{u.off("connect",h)}},[u,i,n]);let g=o?.releaseActions?.join(",")??"",S=Rt(()=>gi(t,s,g?g.split(","):void 0),[t,s,g]);return e.useExternalSync({tools:S,socket:u,deviceId:l.ready?c?.deviceId??null:null,enableLogs:o?.enableLogs}),null}r(ji,"BrowserExternalSync");import{useState as Ni}from"react";import{BuoyPortal as ml}from"@buoy-gg/shared-ui/web/floating";import{useBuoySession as gl}from"@buoy-gg/license/web";import{Fragment as Hi,jsx as Je,jsxs as Wi}from"react/jsx-runtime";var _i="#20C997";function Ui(){let{status:e,signIn:t,signOut:o}=gl(),[i,n]=Ni(false),[s,l]=Ni(null);if(typeof document>"u")return null;let c=r(()=>{l(null),n(true),t().catch(u=>l(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},"start"),d=e.state==="active";return Je(ml,{children:Je("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:d||s?"12px 14px":0,borderRadius:16,background:d||s?"#0f1419":"transparent",color:"#e6edf3",boxShadow:d||s?"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:d?Wi(Hi,{children:[Je("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),Je("button",{type:"button",onClick:()=>void o(),style:fl,"data-testid":"buoy-signout",children:"Sign out"})]}):Wi(Hi,{children:[s?Je("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:s}):null,Je("button",{type:"button",onClick:c,disabled:i,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:_i,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"})]})})})}r(Ui,"BuoySignIn");var fl={marginTop:8,padding:0,border:"none",background:"none",color:_i,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as hl}from"react";import{AccountSetupButton as yl,BuoyNeedsPlanCard as bl,BuoySignInCard as vl,useSignInState as Sl}from"@buoy-gg/shared-ui/web";import{jsx as st,jsxs as Ki}from"react/jsx-runtime";function So({needsPlan:e=false}){let[t,o]=hl(false),i=Sl();return Ki(H,{pointerEvents:"box-none",style:Vi.root,children:[st(yl,{expanded:t,onPress:()=>o(true)}),t?st(lr,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:Ki(H,{style:Vi.overlay,accessibilityViewIsModal:true,children:[st(sr,{style:ct.absoluteFill,onPress:()=>o(false),accessible:false}),e&&i==="active"?st(bl,{onClose:()=>o(false)}):st(vl,{onClose:()=>o(false)})]})}):null]})}r(So,"BuoySignIn");var Vi=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 wo(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}r(wo,"validateDialConfig");import{installedTools as wl,installedToolsFound as xl}from"@buoy-gg/core/web/installed-tools";import{Fragment as xo,jsx as $,jsxs as lt}from"react/jsx-runtime";var Gi={},qi="@react_buoy_floating_menu_tooltip_shown",Tl=Oe;function Ji({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),i=Math.max(1,e/16);return $("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:i,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,s)=>$("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},s))})}r(Ji,"MenuLauncherIcon");function Yi(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:i=false,children:n}=e,s=he(()=>o&&wo(o),[o]);return $(qt,{defaultFloatingTools:t,defaultDialTools:s,children:$(wr,{disableHints:i,children:lt(co,{children:[$(Wn,{children:$(tr,{...e})}),n]})})})}r(Yi,"AdmittedFloatingDevTools");var Il=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function Xi({modules:e=Gi}){return $(xo,{children:Object.entries(e).flatMap(([t,o])=>Il.map(i=>{let n=o[i];return n?$(n,{},`${t}:${i}`):null}))})}r(Xi,"StartupCapture");function Qi(){let{openApps:e,restore:t}=rt();return Z(()=>zo(o=>{let i=e.find(n=>n.id===o);return i?(t(i.instanceId),true):false}),[e,t]),null}r(Qi,"WebToolOpenerBridge");function Zi(){let e=yr();return xr((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}r(Zi,"defaultEnvironment");function er(e,t,o,i){let n=r(g=>Object.entries(e).find(([S])=>S.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===g)?.[1],"find"),s=[],l=n("env");t?.length&&l?.createEnvTool&&l.createEnvVarConfig&&s.push(qe(l.createEnvTool({requiredEnvVars:l.createEnvVarConfig(t)})));let c=n("storage");o?.length&&c?.createStorageTool&&s.push(qe(c.createStorageTool({requiredStorageKeys:o})));let d=n("ask-buoy"),u=i==="hosted"?d?.hostedAskBuoy?.():i;return u&&d?.createAskBuoyTool&&s.push(qe(d.createAskBuoyTool(u))),s}r(er,"configOverrides");function tr({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:i,apps:n,modules:s=Gi,externalSync:l,requiredEnvVars:c,sentryGetClient:d,disableHints:u=false,headless:g=false,hidden:S=false,defaultFloatingTools:h,defaultDialTools:B,zustandStores:I,requiredStorageKeys:R,askBuoy:L}){let M=e??Zi(),P=he(()=>B?wo(B):void 0,[B]),[z,v]=Pt(false),[C,F]=Pt(false),D=Ao(false),T=rt(),ee=he(()=>er(s,c,R,L),[s,c,R,L]),{allowedTools:V}=ko(),K=he(()=>Br(Et([...uo(s),...n??[],...ee]),V),[n,s,ee,V]),{openApps:J,close:G}=T;Z(()=>{if(V)for(let a of J)Rr(a.id,V)||G(a.instanceId)},[J,V,G]);let ne=he(()=>Object.entries(s).find(([a])=>a.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[s]);Z(()=>{if(!I||typeof ne?.watchStores!="function")return;let a=ne.watchStores(I);return typeof a=="function"?a:void 0},[I,ne]);let Q=At(),ue=T.openApps.some(a=>!a.minimized);Z(()=>{Q.setDialOpen(z)},[z,Q.setDialOpen]),Z(()=>{Q.setToolOpen(ue||C)},[ue,C,Q.setToolOpen]);let{registerApps:xe}=T;Z(()=>{xe(K.map(a=>{let x=a.icon;return{...a,icon:typeof x=="function"?({size:A})=>x(A):x}}))},[xe,K]);let be=he(()=>K.map(a=>({id:a.id,name:a.name,description:a.description,slot:a.slot})),[K]);Ir({availableTools:be,storage:Tl}),Z(()=>{let a=false;return r(async()=>{let[x,A]=await Promise.all([Oe.getItem(pt.dial.isOpen()),Oe.getItem(pt.settings.modalOpen())]);a||(x==="true"&&v(true),A==="true"&&(v(true),F(true)),D.current=true)},"restore")(),()=>{a=true}},[]),Z(()=>{D.current&&Oe.setItem(pt.dial.isOpen(),z?"true":"false")},[z]),Z(()=>{D.current&&Oe.setItem(pt.settings.modalOpen(),C?"true":"false")},[C]);let ie=We(a=>{if(ln(a.id),a.launchMode==="toggle-only"){a.onPress?.();return}if(a.component){let x=typeof a.icon=="function"?a.icon(20):a.icon;T.open({id:a.id,title:a.name||ut(a.id),component:a.component,props:a.props,modal:a.modal,launchMode:a.launchMode||"self-modal",singleton:a.singleton??true,icon:x,color:a.color||Bo(a.id)})}else a.onPress?.()},[T]),_=Ao({tools:K,openApps:T.openApps,openTool:ie});_.current={tools:K,openApps:T.openApps,openTool:ie},Z(()=>zo(a=>{let{tools:x,openApps:A,openTool:W}=_.current;if(A.some(Y=>Y.id===a))return false;let q=x.find(Y=>Y.id===a);return!q||q.launchMode==="toggle-only"?false:(W(q),true)}),[]);let me=he(()=>mt(K,"dial").map(a=>{let x=a.color||Bo(a.id),A;return typeof a.icon=="string"?A=a.icon:typeof a.icon=="function"?A=a.icon(32):A=null,{id:a.id,name:a.name||ut(a.id),icon:A,unavailable:!a.component&&!a.onPress,color:x,onPress:r(()=>{ie(a),v(false)},"onPress")}}),[K,ie]),Re=he(()=>{if(!z)return me;let a=new Map(me.map(x=>[x.id,x]));return sn(me.map(x=>x.id)).map(x=>a.get(x)).filter(x=>!!x)},[z,me]),{settings:Te}=In(),$e=he(()=>mt(K,"row").filter(a=>(Te.floatingTools[a.id]??false)===true&&(a.component||a.onPress)),[K,Te.floatingTools]),pe=he(()=>K.map(a=>({id:a.id,name:a.name||ut(a.id),description:a.description||Cr(a.id),slot:a.slot,icon:a.icon,color:a.color})),[K]),[oe,Ie]=Pt(false),ge=T.openApps.some(a=>!a.minimized);Z(()=>{if(u)return;let a=false,x=setTimeout(async()=>{let A=await Oe.getItem(qi);!a&&!A&&Ie(true)},1e3);return()=>{a=true,clearTimeout(x)}},[u]);let ae=We(()=>{Ie(false),Oe.setItem(qi,"true")},[]),Ce=We(()=>{ae(),v(true)},[ae]),ke=We(()=>{v(false),F(false)},[]),Ye=We(()=>{F(a=>!a)},[]),je=We(()=>F(false),[]),ve=!!(o?.length&&i),De=Te.floatingTools.environment!==false,fe=oe&&!z&&!ge&&!S;Z(()=>{if(!fe)return;let a=r(A=>{(!(A.target instanceof Element)||!A.target.closest("[data-buoy-root]"))&&ae()},"onPointerDown"),x=r(A=>{A.key==="Escape"&&ae()},"onKeyDown");return document.addEventListener("pointerdown",a,true),document.addEventListener("keydown",x),()=>{document.removeEventListener("pointerdown",a,true),document.removeEventListener("keydown",x)}},[fe,ae]);let ze=T.openApps.some(a=>a.minimized&&a.launchMode!=="toggle-only"),O=$(Li,{modules:s,apps:n,requiredEnvVars:c,externalSync:l,headless:g,sentryGetClient:d});return g?O:lt("div",{"data-buoy-root":"",style:{display:"contents"},children:[O,$(Qi,{}),fe&&$("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),$("div",{style:S?{visibility:"hidden"}:{display:"contents"},"aria-hidden":S||void 0,children:lt(Mo,{enablePositionPersistence:!fe,pushToSide:z||ge,suspendPointerEvents:z,centerOnboarding:fe,minimizedStack:ze?$(ri,{}):void 0,hasMinimizedStack:ze,children:[M&&De&&!ve&&$(kr,{environment:M}),ve&&De&&$(zr,{currentEnvironment:M??"local",availableEnvironments:o,onSelect:i}),t?$(Oo,{userRole:t,onPress:Ce}):$("button",{"aria-label":"Open dev tools",onClick:Ce,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:$(Ji,{})}),$e.map(a=>$("button",{"aria-label":a.name||ut(a.id),title:a.description,onClick:()=>ie(a),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof a.icon=="function"?a.icon(16):a.icon},a.id))]})}),fe&&$($t,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:ae}),z&&!S&&$(Wt,{icons:Re,onClose:ke,centerLabel:"BUOY",onCenterPress:Ye,settingsOpen:C,hintsDisabled:u,emptyNote:V&&Re.length===0?Dr:void 0}),C&&!S&&$(Zt,{visible:true,onClose:je,availableTools:pe,defaultFloatingTools:h,defaultDialTools:P,onSettingsChange:a=>{}}),!S&&lt(xo,{children:[$(_n,{}),$(pr,{})]})]})}r(tr,"FloatingDevToolsInner");function or(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;Z(()=>{if(!o)return;let i=false,n=mr.SessionManager;if(!n)return;let s=r(l=>{i||!l||(n.configure({audience:`app:${l}`}),n.load().catch(()=>{}))},"apply");return t?s(t):vr().then(l=>s(l?.bundleId)).catch(()=>{}),()=>{i=true}},[o,t])}r(or,"useCapacitorSignInAudience");var nr=false;function ir(e){return e.modules?e:(!xl&&!nr&&typeof console<"u"&&(nr=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:wl})}r(ir,"withInstalledTools");function rr(e){return $(ur,{children:$(ar,{...ir(e)})})}r(rr,"FloatingDevTools");function ar(e){let{access:t,isPro:o,licenseKey:i}=ko();Z(()=>{gr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||fr(e.licenseKey,i),s=hr(typeof He<"u"?He:process.env.NODE_ENV!=="production"),l=n&&t.status==="admitted";Z(()=>{l&&Tr()},[l]),Z(()=>{s||t.status==="initializing"||(o&&l?cr():dr())},[s,o,l,t.status]);let c=br();return or(c?e.signIn:void 0),!s&&!o?!e.signIn||e.headless?null:c?$(So,{needsPlan:true}):$(Ui,{}):l?$(Yi,{...e}):lt(xo,{children:[t.status==="initializing"&&$(Xi,{modules:e.modules}),e.headless?null:e.signIn&&c?$(So,{}):$(Sr,{})]})}r(ar,"FloatingDevToolsContent");export{Ar as a,Ro as b,Et as c,mt as d,Do as e,Mo as f,Mr as g,Oo as h,Wt as i,Zt as j,to as k,On as l,Fn as m,Wn as n,rt as o,_n as p,qe as q,co as r,At as s,uo as t,Ei as u,rr as v};
@@ -0,0 +1 @@
1
+ "use client";import{a as c,c as j,d as F}from"./chunk-LOPXJLVB.mjs";var g={};j(g,{AccessibilityInfo:()=>W,ActivityIndicator:()=>He,Alert:()=>We,Animated:()=>M,AppRegistry:()=>Y,AppState:()=>_,Appearance:()=>U,BackHandler:()=>q,Button:()=>De,CheckBox:()=>le,Clipboard:()=>G,DeviceEventEmitter:()=>ke,Dimensions:()=>L,Easing:()=>J,FlatList:()=>de,I18nManager:()=>Q,Image:()=>ce,ImageBackground:()=>ue,InteractionManager:()=>Z,Keyboard:()=>X,KeyboardAvoidingView:()=>pe,LayoutAnimation:()=>ee,Linking:()=>te,LogBox:()=>Se,Modal:()=>N,NativeEventEmitter:()=>ae,NativeModules:()=>z,PanResponder:()=>oe,Picker:()=>me,PixelRatio:()=>ne,Platform:()=>T,Pressable:()=>R,ProgressBar:()=>ye,RefreshControl:()=>he,SafeAreaView:()=>be,ScrollView:()=>V,SectionList:()=>fe,Share:()=>se,StatusBar:()=>xe,StyleSheet:()=>P,Switch:()=>Fe,Text:()=>C,TextInput:()=>Ke,Touchable:()=>ve,TouchableHighlight:()=>Ne,TouchableNativeFeedback:()=>we,TouchableOpacity:()=>O,TouchableWithoutFeedback:()=>je,UIManager:()=>ie,Vibration:()=>re,View:()=>A,VirtualizedList:()=>ge,YellowBox:()=>Ee,findNodeHandle:()=>ze,unstable_createElement:()=>D,useColorScheme:()=>Ae,useLocaleContext:()=>Ce,useWindowDimensions:()=>Le});F(g,H);import*as H from"react-native-web";import{unstable_createElement as D,NativeModules as z,AccessibilityInfo as W,Appearance as U,AppRegistry as Y,AppState as _,BackHandler as q,Clipboard as G,Dimensions as L,Easing as J,I18nManager as Q,Keyboard as X,InteractionManager as Z,LayoutAnimation as ee,Linking as te,NativeEventEmitter as ae,PanResponder as oe,PixelRatio as ne,Platform as T,Share as se,UIManager as ie,Vibration as re,CheckBox as le,FlatList as de,Image as ce,ImageBackground as ue,KeyboardAvoidingView as pe,Picker as me,ProgressBar as ye,RefreshControl as he,SafeAreaView as be,SectionList as fe,StatusBar as xe,Touchable as ve,TouchableNativeFeedback as we,VirtualizedList as ge,YellowBox as Ee,LogBox as Se,DeviceEventEmitter as ke,useColorScheme as Ae,useLocaleContext as Ce,useWindowDimensions as Le}from"react-native-web";import*as u from"react-native-web";import{createElement as E,forwardRef as $,useCallback as Te,useRef as $e}from"react";import{useEffect as Be,useState as Ie}from"react";import{createPortal as Pe}from"react-dom";var Me='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Oe}from"react/jsx-runtime";var f=Symbol.for("@buoy-gg/portal-host"),B=c(a=>{if(!(a instanceof Element))return false;if(a.closest("input, textarea, select"))return true;let t=a.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"},"isTextField");function S(){let a=document;if(a[f])return a[f].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Me});let n=c(()=>{let e=document.fullscreenElement,l=e&&e.tagName!=="CANVAS"?e:document.body;t.parentElement!==l&&l.appendChild(t)},"move"),r=new Map,o=c(e=>{(!t.contains(e.target)||!B(e.target))&&r.set(e.code||e.key,{key:e.key,code:e.code,location:e.location,keyCode:e.keyCode,which:e.which,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey})},"down"),i=c(e=>{r.delete(e.code||e.key)},"up"),m=c(()=>r.clear(),"clear"),y=c(()=>{let e=[...r.values()];r.clear();for(let l of e)document.dispatchEvent(new KeyboardEvent("keyup",{...l,bubbles:true}))},"focus"),s=c(e=>{B(e.target)&&e.stopPropagation()},"key"),d=c(e=>e.stopPropagation(),"wheel");return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",o,true),document.addEventListener("keyup",i,true),window.addEventListener("blur",m),t.addEventListener("focusin",y),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",d,{passive:true}),a[f]={host:t,users:0,dispose:c(()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",o,true),document.removeEventListener("keyup",i,true),window.removeEventListener("blur",m),t.remove(),delete a[f]},"dispose")},t}c(S,"getBuoyPortalHost");function I({children:a}){let[t,n]=Ie(null);return Be(()=>{let r=S(),o=document[f];return o.users++,n(r),()=>{--o.users===0&&o.dispose()}},[]),t?Pe(Oe("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:a}),t):null}c(I,"BuoyPortal");var h=u,Re=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],b=c(a=>typeof a=="number"?`${a}px`:a,"px");function v(a){if(Array.isArray(a)){let l=a.map(v);return l.some((w,x)=>w!==a[x])?l:a}if(!a||typeof a!="object"||!Re.some(l=>a[l]!=null))return a;let{shadowColor:t,shadowOffset:n,shadowOpacity:r,shadowRadius:o,textShadowColor:i,textShadowOffset:m,textShadowRadius:y,...s}=a;if(t!=null||n!=null||r!=null||o!=null){let l=t??"black",w=r==null?l:`color-mix(in srgb, ${l} ${Math.min(r,1)*100}%, transparent)`,x=`${b(n?.width??0)} ${b(n?.height??0)} ${b(o??0)} ${w}`;s.boxShadow=typeof s.boxShadow=="string"?`${s.boxShadow}, ${x}`:s.boxShadow??x}let{width:d=0,height:e=0}=m??{};if(i&&(d||e||y)){let l=`${b(d)} ${b(e)} ${b(y??0)} ${i}`;s.textShadow=s.textShadow?`${s.textShadow}, ${l}`:l}return s}c(v,"webShadows");var Ve=h.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function k(a,t){if(typeof a=="function")return r=>k(a(r),t);let n=v(a);return t?[n,Ve[t]]:n}c(k,"webStyle");var P={...h.StyleSheet,create:c(a=>h.StyleSheet.create(Object.fromEntries(Object.entries(a).map(([t,n])=>[t,v(n)]))),"create")};function p(a){let t=$((r,o)=>{let{accessibilityState:i,accessibilityValue:m,pointerEvents:y,...s}=r;for(let e of["busy","checked","disabled","expanded","selected"])i?.[e]!==void 0&&s[`aria-${e}`]===void 0&&(s[`aria-${e}`]=i[e]);for(let[e,l]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))m?.[e]!==void 0&&s[`aria-${l}`]===void 0&&(s[`aria-${l}`]=m[e]);let d=k(s.style,y);return d!==s.style&&(s.style=d),E(a,{...s,ref:o})}),n=a.State;return n&&Object.assign(t,{State:n}),t.displayName=a.displayName??a.name??"NativeWebView",t}c(p,"withAccessibility");var A=p(u.View),C=p(u.Text),M={...h.Animated,View:h.Animated.createAnimatedComponent(A),Text:h.Animated.createAnimatedComponent(C)},Ke=p(u.TextInput),O=p(u.TouchableOpacity),Ne=p(u.TouchableHighlight),je=p(u.TouchableWithoutFeedback),R=p(u.Pressable),V=p(u.ScrollView),K=$((a,t)=>{let n=$e(null),r=Te(o=>{if(o){let i=o;for(;i.parentElement&&i.parentElement!==document.body;)i=i.parentElement;i.parentElement===document.body&&(n.current=i,Object.assign(i.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),S().appendChild(i))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof t=="function"?t(o):t&&(t.current=o)},[t]);return E(I,null,E(u.Modal,{...a,ref:r}))});K.displayName="Modal";var N=p(K),Fe=p(u.Switch),He=p(u.ActivityIndicator),De=p(u.Button),ze=u.findNodeHandle,We={alert(a,t,n,r){if(typeof document>"u")return;let o=document.createElement("dialog");o.dataset.buoyRoot="",o.setAttribute("aria-label",a),o.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 i=document.createElement("h2");if(i.textContent=a,i.style.cssText="font-size:18px;margin:0 0 12px",o.appendChild(i),t){let d=document.createElement("p");d.textContent=t,d.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",o.appendChild(d)}let m=document.createElement("div");m.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let y=n?.length?n:[{text:"OK"}],s=c(()=>{o.close?.(),o.remove()},"close");for(let d of y){let e=document.createElement("button");e.type="button",e.textContent=d.text??"OK",e.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${d.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,e.onclick=()=>{s(),d.onPress?.()},m.appendChild(e)}o.addEventListener("cancel",d=>{d.preventDefault(),r?.cancelable!==false&&(s(),r?.onDismiss?.())}),o.appendChild(m),document.body.appendChild(o),o.showModal?o.showModal():o.setAttribute("open","")}};export{P as a,A as b,C as c,M as d,O as e,R as f,V as g,N as h,g as i,L as j,T as k};