@buoy-gg/core 7.0.66 → 7.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BrowserToolRuntime=BrowserToolRuntime;var _react=require("react");var _license=require("@buoy-gg/license");var _sharedUi=require("@buoy-gg/shared-ui");var _externalSyncGate=require("./externalSyncGate.js");var _deviceIdentity=require("./deviceIdentity.js");var _capacitorHostInfo=require("./capacitorHostInfo.js");var _appSyncAdapter=require("./sync/appSyncAdapter.js");var _jsxRuntime=require("react/jsx-runtime");const roots=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"];const overlays=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function BrowserToolRuntime(e){const a=(0,_react.useMemo)(()=>Object.fromEntries(Object.entries(e.modules).map(([l,f])=>[l.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),f])),[e.modules]);const o=a["react-query"];return o?.useReactQuerySyncAdapter?(0,_jsxRuntime.jsx)(QueryRuntime,{...e,modules:a,query:o}):(0,_jsxRuntime.jsx)(ToolRuntime,{...e,modules:a})}function QueryRuntime(e){const a=e.query.useReactQuerySyncAdapter();return(0,_jsxRuntime.jsx)(ToolRuntime,{...e,queryAdapter:a})}function ToolRuntime({modules:e,apps:a,requiredEnvVars:o,externalSync:l,headless:f,sentryGetClient:p,queryAdapter:r}){const{isPro:y,tier:v}=(0,_license.useLicense)();const n=(0,_react.useMemo)(()=>{const c={app:_appSyncAdapter.appSyncAdapter};for(const[t,s]of Object.entries(e)){for(const[u,b]of Object.entries(s)){if(u.endsWith("SyncAdapter")&&b&&typeof b==="object")c[t]=b}}if(r)c.query=r;if(e.env?.createEnvSyncAdapter)c.env=e.env.createEnvSyncAdapter(o??[]);for(const t of a??[])if(t.sync)c[`custom:${t.id}`]=t.sync;return c},[e,a,o,r]);const d=(0,_react.useRef)(n);d.current=n;(0,_react.useEffect)(()=>(0,_sharedUi.registerToolAdapters)(()=>d.current),[]);(0,_react.useEffect)(()=>{const c=[];const t=s=>{const u=s?.();if(typeof u==="function")c.push(u)};t(e.network?.startNetworkCapture);t(e.storage?.startBrowserStorageCapture);t(e.assets?.startBrowserAssetCapture);t(e.three?.startThreeCapture);if((0,_license.resolveDevBuild)(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production")){t(e["time-machine"]?.startTimeMachineFloatingToolPersistence)}if(e.storage?.storageSyncAdapter?.subscribe)t(()=>e.storage.storageSyncAdapter.subscribe(()=>{}));if(e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe)t(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{}));return()=>{for(const s of c.reverse())s()}},[e]);const R=e["external-sync"];const i=(0,_license.resolveDevBuild)(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const S=(0,_externalSyncGate.shouldMountExternalSync)({isDevelopment:i,isLicensed:y,externalSync:l,isAvailable:Boolean(R)});const _=(0,_externalSyncGate.externalSyncOptions)(l);(0,_license.installCapacitorBridge)({release:!i&&Boolean(_?.enableInRelease)});if(!i&&_?.enableInRelease)warnOnce((0,_externalSyncGate.releaseTransportProblem)(_.socketURL,_));const g=e.sentry?.SentryRoot;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[Object.entries(e).flatMap(([c,t])=>roots.map(s=>{const u=t[s];return u?(0,_jsxRuntime.jsx)(u,{},`${c}:${s}`):null})),g&&(0,_jsxRuntime.jsx)(g,{getClient:p}),Object.entries(e).flatMap(([c,t])=>overlays.map(s=>{const u=t[s];return u&&(!f||s==="ScenariosOverlay"||s==="ImpersonateOverlay")?(0,_jsxRuntime.jsx)(u,{},`${c}:${s}`):null})),S&&(0,_jsxRuntime.jsx)(BrowserExternalSync,{module:R,tools:n,options:_,isPro:y,tier:v,dev:i})]})}let warned=null;function warnOnce(e){if(!e||e===warned)return;warned=e;console.warn("[Buoy]",e)}function BrowserExternalSync({module:e,tools:a,options:o,isPro:l,tier:f,dev:p}){const r=(0,_capacitorHostInfo.useHostInfo)();const y=(0,_deviceIdentity.useDeviceIdentity)(o,{appName:r.appName,hardwareName:r.hardwareName,platform:r.platform});const v=(0,_react.useMemo)(()=>(0,_capacitorHostInfo.capacitorBrokerURL)(o?.socketURL??(p?e.getDefaultSocketURL():_externalSyncGate.RELEASE_DEFAULT_SOCKET_URL),Boolean(o?.socketURL),r.platform),[o?.socketURL,p,e,r.platform]);const{socket:n}=e.useExternalSyncSocket({deviceName:y?.deviceName??"Buoy Browser",socketURL:v,persistentDeviceId:r.ready?y?.deviceId??null:null,platform:r.platform,extraDeviceInfo:r.extraDeviceInfo,enableLogs:o?.enableLogs});(0,_react.useEffect)(()=>{const i=(0,_capacitorHostInfo.capacitorTransportProblem)(v,r.platform);if(!n||!i)return;const S=()=>warnOnce(i);n.on("connect_error",S);return()=>{n.off("connect_error",S)}},[n,v,r.platform]);(0,_react.useEffect)(()=>{if(!n)return;const i=()=>{if(n.connected&&_license.LicenseManager.hasAccountAccess())n.emit("device-license",{isPro:l?"1":"0",tier:f})};i();n.on("connect",i);return()=>{n.off("connect",i)}},[n,l,f]);const d=o?.releaseActions?.join(",")??"";const R=(0,_react.useMemo)(()=>(0,_externalSyncGate.applyReleaseActionPolicy)(a,p,d?d.split(","):void 0),[a,p,d]);e.useExternalSync({tools:R,socket:n,deviceId:r.ready?y?.deviceId??null:null,enableLogs:o?.enableLogs});return null}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BrowserToolRuntime=BrowserToolRuntime;var _react=require("react");var _license=require("@buoy-gg/license");var _sharedUi=require("@buoy-gg/shared-ui");var _externalSyncGate=require("./externalSyncGate.js");var _deviceIdentity=require("./deviceIdentity.js");var _capacitorHostInfo=require("./capacitorHostInfo.js");var _appSyncAdapter=require("./sync/appSyncAdapter.js");var _jsxRuntime=require("react/jsx-runtime");const roots=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"];const overlays=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function BrowserToolRuntime(e){const c=(0,_react.useMemo)(()=>Object.fromEntries(Object.entries(e.modules).map(([l,p])=>[l.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),p])),[e.modules]);const o=c["react-query"];return o?.useReactQuerySyncAdapter?(0,_jsxRuntime.jsx)(QueryRuntime,{...e,modules:c,query:o}):(0,_jsxRuntime.jsx)(ToolRuntime,{...e,modules:c})}function QueryRuntime(e){const c=e.query.useReactQuerySyncAdapter();return(0,_jsxRuntime.jsx)(ToolRuntime,{...e,queryAdapter:c})}function ToolRuntime({modules:e,apps:c,requiredEnvVars:o,externalSync:l,headless:p,sentryGetClient:y,queryAdapter:r}){const{isPro:d,tier:_}=(0,_license.useLicense)();const n=(0,_react.useMemo)(()=>{const a={app:_appSyncAdapter.appSyncAdapter};for(const[t,s]of Object.entries(e)){for(const[u,S]of Object.entries(s)){if(u.endsWith("SyncAdapter")&&S&&typeof S==="object")a[t]=S}}if(r)a.query=r;if(e.env?.createEnvSyncAdapter)a.env=e.env.createEnvSyncAdapter(o??[]);for(const t of c??[])if(t.sync)a[`custom:${t.id}`]=t.sync;return a},[e,c,o,r]);const v=(0,_react.useRef)(n);v.current=n;(0,_react.useEffect)(()=>(0,_sharedUi.registerToolAdapters)(()=>v.current),[]);(0,_react.useEffect)(()=>{const a=[];const t=s=>{const u=s?.();if(typeof u==="function")a.push(u)};t(e.network?.startNetworkCapture);t(e.storage?.startBrowserStorageCapture);t(e.assets?.startBrowserAssetCapture);t(e.three?.startThreeCapture);if((0,_license.resolveDevBuild)(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production")){t(e["time-machine"]?.startTimeMachineFloatingToolPersistence)}if(e.storage?.storageSyncAdapter?.subscribe)t(()=>e.storage.storageSyncAdapter.subscribe(()=>{}));if(e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe)t(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{}));return()=>{for(const s of a.reverse())s()}},[e]);const R=e["external-sync"];const i=(0,_license.resolveDevBuild)(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const f=(0,_externalSyncGate.shouldMountExternalSync)({isDevelopment:i,isLicensed:d,externalSync:l,isAvailable:Boolean(R)});const g=(0,_externalSyncGate.externalSyncOptions)(l);(0,_license.installCapacitorBridge)({release:!i&&Boolean(g?.enableInRelease)});if(!i&&g?.enableInRelease)warnOnce((0,_externalSyncGate.releaseTransportProblem)(g.socketURL,g));const b=e.sentry?.SentryRoot;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[Object.entries(e).flatMap(([a,t])=>roots.map(s=>{const u=t[s];return u?(0,_jsxRuntime.jsx)(u,{},`${a}:${s}`):null})),b&&(0,_jsxRuntime.jsx)(b,{getClient:y}),Object.entries(e).flatMap(([a,t])=>overlays.map(s=>{const u=t[s];return u&&(!p||s==="ScenariosOverlay"||s==="ImpersonateOverlay")?(0,_jsxRuntime.jsx)(u,{},`${a}:${s}`):null})),f&&(0,_jsxRuntime.jsx)(BrowserExternalSync,{module:R,tools:n,options:g,isPro:d,tier:_,dev:i})]})}let warned=null;function warnOnce(e){if(!e||e===warned)return;warned=e;console.warn("[Buoy]",e)}function BrowserExternalSync({module:e,tools:c,options:o,isPro:l,tier:p,dev:y}){const r=(0,_capacitorHostInfo.useHostInfo)();const d=(0,_deviceIdentity.useDeviceIdentity)(o,{appName:r.appName,hardwareName:r.hardwareName,platform:r.platform});const _=(0,_react.useMemo)(()=>(0,_capacitorHostInfo.capacitorBrokerURL)(o?.socketURL??(y?e.getDefaultSocketURL():_externalSyncGate.RELEASE_DEFAULT_SOCKET_URL),Boolean(o?.socketURL),r.platform),[o?.socketURL,y,e,r.platform]);const{socket:n}=e.useExternalSyncSocket({deviceName:d?.deviceName??"Buoy Browser",socketURL:_,persistentDeviceId:r.ready?d?.deviceId??null:null,platform:r.platform,extraDeviceInfo:r.extraDeviceInfo,enableLogs:o?.enableLogs});(0,_react.useEffect)(()=>{const i=(0,_capacitorHostInfo.capacitorTransportProblem)(_,r.platform);if(!n||!i)return;const f=()=>warnOnce(i);n.on("connect_error",f);return()=>{n.off("connect_error",f)}},[n,_,r.platform]);(0,_react.useEffect)(()=>{if(!n)return;const i=()=>{if(!n.connected||!_license.LicenseManager.hasAccountAccess())return;const f=_license.LicenseManager.getState();if(!l&&(f.isInitialized===false||f.isValidating===true))return;n.emit("device-license",{isPro:l?"1":"0",tier:p})};i();n.on("connect",i);return()=>{n.off("connect",i)}},[n,l,p]);const v=o?.releaseActions?.join(",")??"";const R=(0,_react.useMemo)(()=>(0,_externalSyncGate.applyReleaseActionPolicy)(c,y,v?v.split(","):void 0),[c,y,v]);e.useExternalSync({tools:R,socket:n,deviceId:r.ready?d?.deviceId??null:null,enableLogs:o?.enableLogs});return null}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AutoExternalSync=AutoExternalSync;exports.ToolRegistryPublisher=ToolRegistryPublisher;exports.isExternalSyncAvailable=isExternalSyncAvailable;exports.useToolAdapterMap=useToolAdapterMap;var _react=require("react");var _reactNative=require("react-native");var _license=require("@buoy-gg/license");var _optionalRequire=require("./optionalRequire.js");var _appSyncAdapter=require("./sync/appSyncAdapter.js");var _deviceIdentity=require("./deviceIdentity.js");var _externalSyncGate=require("./externalSyncGate.js");var _sharedUi=require("@buoy-gg/shared-ui");let externalSyncModule=null;let storageModule=null;let networkModule=null;let reactQueryModule=null;let routeEventsModule=null;let reduxModule=null;let zustandModule=null;let jotaiModule=null;let eventsModule=null;let consoleModule=null;let clockModule=null;let permissionsModule=null;let lifecycleModule=null;let locationModule=null;let sentryModule=null;let notificationsModule=null;try{notificationsModule=require("@buoy-gg/notifications")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/notifications",e)}let envModule=null;let highlightUpdatesModule=null;let debugBordersModule=null;let impersonateModule=null;let perfMonitorModule=null;let jsTopModule=null;let imagesModule=null;let assetsModule=null;let tvRemoteModule=null;let focusInspectorModule=null;let expoConstantsModule=null;try{externalSyncModule=require("@buoy-gg/external-sync")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/external-sync",e)}try{storageModule=require("@buoy-gg/storage")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/storage",e)}try{networkModule=require("@buoy-gg/network")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/network",e)}try{reactQueryModule=require("@buoy-gg/react-query")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/react-query",e)}try{routeEventsModule=require("@buoy-gg/route-events")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/route-events",e)}try{reduxModule=require("@buoy-gg/redux")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/redux",e)}try{zustandModule=require("@buoy-gg/zustand")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/zustand",e)}try{jotaiModule=require("@buoy-gg/jotai")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/jotai",e)}try{eventsModule=require("@buoy-gg/events")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/events",e)}try{consoleModule=require("@buoy-gg/console")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/console",e)}try{clockModule=require("@buoy-gg/clock")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/clock",e)}try{lifecycleModule=require("@buoy-gg/lifecycle")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/lifecycle",e)}try{locationModule=require("@buoy-gg/location")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/location",e)}try{permissionsModule=require("@buoy-gg/permissions")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/permissions",e)}try{sentryModule=require("@buoy-gg/sentry")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/sentry",e)}try{envModule=require("@buoy-gg/env")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/env",e)}try{highlightUpdatesModule=require("@buoy-gg/highlight-updates")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/highlight-updates",e)}try{debugBordersModule=require("@buoy-gg/debug-borders")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/debug-borders",e)}try{impersonateModule=require("@buoy-gg/impersonate")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/impersonate",e)}try{perfMonitorModule=require("@buoy-gg/perf-monitor")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/perf-monitor",e)}try{jsTopModule=require("@buoy-gg/js-top")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/js-top",e)}try{imagesModule=require("@buoy-gg/images")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/images",e)}try{assetsModule=require("@buoy-gg/assets")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/assets",e)}try{tvRemoteModule=require("@buoy-gg/tv-remote")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/tv-remote",e)}try{focusInspectorModule=require("@buoy-gg/focus-inspector")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/focus-inspector",e)}try{expoConstantsModule=require("expo-constants")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("expo-constants",e)}function isExternalSyncAvailable(){return!!externalSyncModule?.useExternalSyncSocket}function getAppName(){const e=expoConstantsModule?.default??expoConstantsModule;return e?.expoConfig?.name??e?.manifest2?.extra?.expoClient?.name??null}function getHardwareName(){const e=expoConstantsModule?.default??expoConstantsModule;const o=e?.deviceName;return typeof o==="string"&&o.length>0?o:null}function useToolAdapterMap({requiredEnvVars:e,customApps:o}){const n=reactQueryModule?.useReactQuerySyncAdapter?reactQueryModule.useReactQuerySyncAdapter():null;return useToolAdapterMapInner(n,e,o)}function ToolRegistryPublisher({requiredEnvVars:e,customApps:o}){const n=useToolAdapterMap({requiredEnvVars:e,customApps:o});const r=(0,_react.useRef)(n);r.current=n;(0,_react.useEffect)(()=>(0,_sharedUi.registerToolAdapters)(()=>r.current),[]);return null}function AutoExternalSync({options:e,requiredEnvVars:o,isPro:n,tier:r,licenseKey:t,customApps:p}){const{useExternalSyncSocket:g,useExternalSync:d}=externalSyncModule;const l=useToolAdapterMap({requiredEnvVars:o,customApps:p});const s=(0,_deviceIdentity.useDeviceIdentity)(e,{appName:getAppName(),hardwareName:getHardwareName(),platform:_reactNative.Platform.OS});const y=s?.deviceId??null;const{socket:u}=g({deviceName:s?.deviceName??"Buoy Device",socketURL:e?.socketURL??externalSyncModule.getDefaultSocketURL?.()??"http://localhost:42831",persistentDeviceId:y,platform:_reactNative.Platform.OS,enableLogs:e?.enableLogs});const c=(0,_react.useRef)({isPro:n,tier:r,licenseKey:t});c.current={isPro:n,tier:r,licenseKey:t};(0,_react.useEffect)(()=>{if(!u)return;const i=()=>{if(!_license.LicenseManager.hasAccountAccess()||!u.connected)return;u.emit("device-license",{isPro:c.current.isPro?"1":"0",tier:c.current.tier??(c.current.isPro?"pro":"free")})};if(u.connected)i();u.on("connect",i);return()=>{u.off("connect",i)}},[u,n,r,t]);const a=e?.releaseActions?.join(",")??"";const f=(0,_react.useMemo)(()=>(0,_externalSyncGate.applyReleaseActionPolicy)(l,typeof __DEV__!=="undefined"&&__DEV__,a?a.split(","):void 0),[l,a]);d({tools:f,socket:u,deviceId:y,enableLogs:e?.enableLogs});return null}function useToolAdapterMapInner(e,o,n){return(0,_react.useMemo)(()=>{const r={app:_appSyncAdapter.appSyncAdapter};if(storageModule?.storageSyncAdapter){r.storage=storageModule.storageSyncAdapter}if(networkModule?.networkSyncAdapter){r.network=networkModule.networkSyncAdapter}if(e){r.query=e}if(routeEventsModule?.routeEventsSyncAdapter){r["route-events"]=routeEventsModule.routeEventsSyncAdapter}if(reduxModule?.reduxSyncAdapter){r.redux=reduxModule.reduxSyncAdapter}if(zustandModule?.zustandSyncAdapter){r.zustand=zustandModule.zustandSyncAdapter}if(jotaiModule?.jotaiSyncAdapter){r.jotai=jotaiModule.jotaiSyncAdapter}if(eventsModule?.eventsSyncAdapter){r.events=eventsModule.eventsSyncAdapter}if(consoleModule?.consoleSyncAdapter){r.console=consoleModule.consoleSyncAdapter}if(clockModule?.clockSyncAdapter){r.clock=clockModule.clockSyncAdapter}if(permissionsModule?.permissionsSyncAdapter){r.permissions=permissionsModule.permissionsSyncAdapter}if(lifecycleModule?.lifecycleSyncAdapter){r.lifecycle=lifecycleModule.lifecycleSyncAdapter}if(locationModule?.locationSyncAdapter){r.location=locationModule.locationSyncAdapter}if(notificationsModule?.notificationSyncAdapter){r["push-notifications"]=notificationsModule.notificationSyncAdapter}if(sentryModule?.sentrySyncAdapter){r.sentry=sentryModule.sentrySyncAdapter}try{const t=require("@buoy-gg/time-machine");if(t?.timeMachineSyncAdapter){r["time-machine"]=t.timeMachineSyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/time-machine",t)}try{const t=require("@buoy-gg/scenarios");if(t?.scenariosSyncAdapter){r.scenarios=t.scenariosSyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/scenarios",t)}try{const t=require("@buoy-gg/ask-buoy");if(t?.askBuoySyncAdapter){r["ask-buoy"]=t.askBuoySyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/ask-buoy",t)}if(envModule?.createEnvSyncAdapter){r.env=envModule.createEnvSyncAdapter(o??[])}if(highlightUpdatesModule?.highlightUpdatesSyncAdapter){r["highlight-updates"]=highlightUpdatesModule.highlightUpdatesSyncAdapter}if(debugBordersModule?.debugBordersSyncAdapter){r["debug-borders"]=debugBordersModule.debugBordersSyncAdapter}if(impersonateModule?.impersonateSyncAdapter){r.impersonate=impersonateModule.impersonateSyncAdapter}if(perfMonitorModule?.perfMonitorSyncAdapter){r["perf-monitor"]=perfMonitorModule.perfMonitorSyncAdapter}if(jsTopModule?.jsTopSyncAdapter){r["js-top"]=jsTopModule.jsTopSyncAdapter}if(imagesModule?.imagesSyncAdapter){r.images=imagesModule.imagesSyncAdapter}if(assetsModule?.assetsSyncAdapter){r.assets=assetsModule.assetsSyncAdapter}if(tvRemoteModule?.tvRemoteSyncAdapter){r["tv-remote"]=tvRemoteModule.tvRemoteSyncAdapter}if(focusInspectorModule?.focusInspectorSyncAdapter){r["focus-inspector"]=focusInspectorModule.focusInspectorSyncAdapter}for(const t of n??[]){if(t?.sync){r[`custom:${t.id}`]=t.sync}}return r},[e,o,n])}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AutoExternalSync=AutoExternalSync;exports.ToolRegistryPublisher=ToolRegistryPublisher;exports.isExternalSyncAvailable=isExternalSyncAvailable;exports.useToolAdapterMap=useToolAdapterMap;var _react=require("react");var _reactNative=require("react-native");var _license=require("@buoy-gg/license");var _optionalRequire=require("./optionalRequire.js");var _appSyncAdapter=require("./sync/appSyncAdapter.js");var _deviceIdentity=require("./deviceIdentity.js");var _externalSyncGate=require("./externalSyncGate.js");var _sharedUi=require("@buoy-gg/shared-ui");let externalSyncModule=null;let storageModule=null;let networkModule=null;let reactQueryModule=null;let routeEventsModule=null;let reduxModule=null;let zustandModule=null;let jotaiModule=null;let eventsModule=null;let consoleModule=null;let clockModule=null;let permissionsModule=null;let lifecycleModule=null;let locationModule=null;let sentryModule=null;let notificationsModule=null;try{notificationsModule=require("@buoy-gg/notifications")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/notifications",e)}let envModule=null;let highlightUpdatesModule=null;let debugBordersModule=null;let impersonateModule=null;let perfMonitorModule=null;let jsTopModule=null;let imagesModule=null;let assetsModule=null;let tvRemoteModule=null;let focusInspectorModule=null;let expoConstantsModule=null;try{externalSyncModule=require("@buoy-gg/external-sync")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/external-sync",e)}try{storageModule=require("@buoy-gg/storage")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/storage",e)}try{networkModule=require("@buoy-gg/network")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/network",e)}try{reactQueryModule=require("@buoy-gg/react-query")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/react-query",e)}try{routeEventsModule=require("@buoy-gg/route-events")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/route-events",e)}try{reduxModule=require("@buoy-gg/redux")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/redux",e)}try{zustandModule=require("@buoy-gg/zustand")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/zustand",e)}try{jotaiModule=require("@buoy-gg/jotai")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/jotai",e)}try{eventsModule=require("@buoy-gg/events")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/events",e)}try{consoleModule=require("@buoy-gg/console")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/console",e)}try{clockModule=require("@buoy-gg/clock")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/clock",e)}try{lifecycleModule=require("@buoy-gg/lifecycle")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/lifecycle",e)}try{locationModule=require("@buoy-gg/location")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/location",e)}try{permissionsModule=require("@buoy-gg/permissions")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/permissions",e)}try{sentryModule=require("@buoy-gg/sentry")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/sentry",e)}try{envModule=require("@buoy-gg/env")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/env",e)}try{highlightUpdatesModule=require("@buoy-gg/highlight-updates")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/highlight-updates",e)}try{debugBordersModule=require("@buoy-gg/debug-borders")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/debug-borders",e)}try{impersonateModule=require("@buoy-gg/impersonate")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/impersonate",e)}try{perfMonitorModule=require("@buoy-gg/perf-monitor")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/perf-monitor",e)}try{jsTopModule=require("@buoy-gg/js-top")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/js-top",e)}try{imagesModule=require("@buoy-gg/images")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/images",e)}try{assetsModule=require("@buoy-gg/assets")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/assets",e)}try{tvRemoteModule=require("@buoy-gg/tv-remote")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/tv-remote",e)}try{focusInspectorModule=require("@buoy-gg/focus-inspector")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/focus-inspector",e)}try{expoConstantsModule=require("expo-constants")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("expo-constants",e)}function isExternalSyncAvailable(){return!!externalSyncModule?.useExternalSyncSocket}function getAppName(){const e=expoConstantsModule?.default??expoConstantsModule;return e?.expoConfig?.name??e?.manifest2?.extra?.expoClient?.name??null}function getHardwareName(){const e=expoConstantsModule?.default??expoConstantsModule;const o=e?.deviceName;return typeof o==="string"&&o.length>0?o:null}function useToolAdapterMap({requiredEnvVars:e,customApps:o}){const n=reactQueryModule?.useReactQuerySyncAdapter?reactQueryModule.useReactQuerySyncAdapter():null;return useToolAdapterMapInner(n,e,o)}function ToolRegistryPublisher({requiredEnvVars:e,customApps:o}){const n=useToolAdapterMap({requiredEnvVars:e,customApps:o});const r=(0,_react.useRef)(n);r.current=n;(0,_react.useEffect)(()=>(0,_sharedUi.registerToolAdapters)(()=>r.current),[]);return null}function AutoExternalSync({options:e,requiredEnvVars:o,isPro:n,tier:r,licenseKey:t,customApps:g}){const{useExternalSyncSocket:d,useExternalSync:f}=externalSyncModule;const l=useToolAdapterMap({requiredEnvVars:o,customApps:g});const s=(0,_deviceIdentity.useDeviceIdentity)(e,{appName:getAppName(),hardwareName:getHardwareName(),platform:_reactNative.Platform.OS});const y=s?.deviceId??null;const{socket:i}=d({deviceName:s?.deviceName??"Buoy Device",socketURL:e?.socketURL??externalSyncModule.getDefaultSocketURL?.()??"http://localhost:42831",persistentDeviceId:y,platform:_reactNative.Platform.OS,enableLogs:e?.enableLogs});const a=(0,_react.useRef)({isPro:n,tier:r,licenseKey:t});a.current={isPro:n,tier:r,licenseKey:t};(0,_react.useEffect)(()=>{if(!i)return;const c=()=>{if(!_license.LicenseManager.hasAccountAccess()||!i.connected)return;const p=_license.LicenseManager.getState();if(!a.current.isPro&&(p.isInitialized===false||p.isValidating===true))return;i.emit("device-license",{isPro:a.current.isPro?"1":"0",tier:a.current.tier??(a.current.isPro?"pro":"free")})};if(i.connected)c();i.on("connect",c);return()=>{i.off("connect",c)}},[i,n,r,t]);const u=e?.releaseActions?.join(",")??"";const b=(0,_react.useMemo)(()=>(0,_externalSyncGate.applyReleaseActionPolicy)(l,typeof __DEV__!=="undefined"&&__DEV__,u?u.split(","):void 0),[l,u]);f({tools:b,socket:i,deviceId:y,enableLogs:e?.enableLogs});return null}function useToolAdapterMapInner(e,o,n){return(0,_react.useMemo)(()=>{const r={app:_appSyncAdapter.appSyncAdapter};if(storageModule?.storageSyncAdapter){r.storage=storageModule.storageSyncAdapter}if(networkModule?.networkSyncAdapter){r.network=networkModule.networkSyncAdapter}if(e){r.query=e}if(routeEventsModule?.routeEventsSyncAdapter){r["route-events"]=routeEventsModule.routeEventsSyncAdapter}if(reduxModule?.reduxSyncAdapter){r.redux=reduxModule.reduxSyncAdapter}if(zustandModule?.zustandSyncAdapter){r.zustand=zustandModule.zustandSyncAdapter}if(jotaiModule?.jotaiSyncAdapter){r.jotai=jotaiModule.jotaiSyncAdapter}if(eventsModule?.eventsSyncAdapter){r.events=eventsModule.eventsSyncAdapter}if(consoleModule?.consoleSyncAdapter){r.console=consoleModule.consoleSyncAdapter}if(clockModule?.clockSyncAdapter){r.clock=clockModule.clockSyncAdapter}if(permissionsModule?.permissionsSyncAdapter){r.permissions=permissionsModule.permissionsSyncAdapter}if(lifecycleModule?.lifecycleSyncAdapter){r.lifecycle=lifecycleModule.lifecycleSyncAdapter}if(locationModule?.locationSyncAdapter){r.location=locationModule.locationSyncAdapter}if(notificationsModule?.notificationSyncAdapter){r["push-notifications"]=notificationsModule.notificationSyncAdapter}if(sentryModule?.sentrySyncAdapter){r.sentry=sentryModule.sentrySyncAdapter}try{const t=require("@buoy-gg/time-machine");if(t?.timeMachineSyncAdapter){r["time-machine"]=t.timeMachineSyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/time-machine",t)}try{const t=require("@buoy-gg/scenarios");if(t?.scenariosSyncAdapter){r.scenarios=t.scenariosSyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/scenarios",t)}try{const t=require("@buoy-gg/ask-buoy");if(t?.askBuoySyncAdapter){r["ask-buoy"]=t.askBuoySyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/ask-buoy",t)}if(envModule?.createEnvSyncAdapter){r.env=envModule.createEnvSyncAdapter(o??[])}if(highlightUpdatesModule?.highlightUpdatesSyncAdapter){r["highlight-updates"]=highlightUpdatesModule.highlightUpdatesSyncAdapter}if(debugBordersModule?.debugBordersSyncAdapter){r["debug-borders"]=debugBordersModule.debugBordersSyncAdapter}if(impersonateModule?.impersonateSyncAdapter){r.impersonate=impersonateModule.impersonateSyncAdapter}if(perfMonitorModule?.perfMonitorSyncAdapter){r["perf-monitor"]=perfMonitorModule.perfMonitorSyncAdapter}if(jsTopModule?.jsTopSyncAdapter){r["js-top"]=jsTopModule.jsTopSyncAdapter}if(imagesModule?.imagesSyncAdapter){r.images=imagesModule.imagesSyncAdapter}if(assetsModule?.assetsSyncAdapter){r.assets=assetsModule.assetsSyncAdapter}if(tvRemoteModule?.tvRemoteSyncAdapter){r["tv-remote"]=tvRemoteModule.tvRemoteSyncAdapter}if(focusInspectorModule?.focusInspectorSyncAdapter){r["focus-inspector"]=focusInspectorModule.focusInspectorSyncAdapter}for(const t of n??[]){if(t?.sync){r[`custom:${t.id}`]=t.sync}}return r},[e,o,n])}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.__resetInstallPingForTests=__resetInstallPingForTests;exports.sendInstallPing=sendInstallPing;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _version=require("../version.js");const STORAGE_KEY="@react_buoy_install";const ENDPOINT="https://buoy.gg/api/t";const PING_INTERVAL_MS=24*60*60*1e3;function uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;const n=e==="x"?t:t&3|8;return n.toString(16)})}async function readState(){try{const e=await _sharedUi.persistentStorage.getItem(STORAGE_KEY);if(!e)return null;const t=JSON.parse(e);if(typeof t?.installId!=="string")return null;return{installId:t.installId,lastPingAt:typeof t.lastPingAt==="number"?t.lastPingAt:0}}catch{return null}}function announceOnce(){console.log("[Buoy] Anonymous usage ping enabled: a random install id, the Buoy version, your platform, 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 sentThisSession=false;async function sendInstallPing(e){const t=typeof __DEV__!=="undefined"&&__DEV__;if(!t)return;if(!e.enabled)return;if(sentThisSession)return;sentThisSession=true;try{const n=await readState();const r=Date.now();if(n&&r-n.lastPingAt<PING_INTERVAL_MS)return;const s=n?.installId??uuid();if(!n)announceOnce();await _sharedUi.persistentStorage.setItem(STORAGE_KEY,JSON.stringify({installId:s,lastPingAt:r}));await fetch(ENDPOINT,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:s,version:_version.SDK_VERSION,platform:_reactNative.Platform.OS,tier:e.tier})})}catch{}}function __resetInstallPingForTests(){sentThisSession=false}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.__resetInstallPingForTests=__resetInstallPingForTests;exports.detectFramework=detectFramework;exports.sendInstallPing=sendInstallPing;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _version=require("../version.js");const STORAGE_KEY="@react_buoy_install";const ENDPOINT="https://buoy.gg/api/t";const PING_INTERVAL_MS=24*60*60*1e3;function uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;const n=t==="x"?e:e&3|8;return n.toString(16)})}async function readState(){try{const t=await _sharedUi.persistentStorage.getItem(STORAGE_KEY);if(!t)return null;const e=JSON.parse(t);if(typeof e?.installId!=="string")return null;return{installId:e.installId,lastPingAt:typeof e.lastPingAt==="number"?e.lastPingAt:0}}catch{return null}}function announceOnce(){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 sentThisSession=false;function detectFramework(){if(_reactNative.Platform.isTV)return"tv";if(_reactNative.Platform.OS!=="web")return"react-native";if((0,_license.isCapacitorNative)())return"capacitor";const t=globalThis.__BUOY_FRAMEWORK__;if(t==="angular")return"angular";return"web"}async function sendInstallPing(t){const e=typeof __DEV__!=="undefined"&&__DEV__;if(!e)return;if(!t.enabled)return;if(sentThisSession)return;sentThisSession=true;try{const n=await readState();const r=Date.now();if(n&&r-n.lastPingAt<PING_INTERVAL_MS)return;const a=n?.installId??uuid();if(!n)announceOnce();await _sharedUi.persistentStorage.setItem(STORAGE_KEY,JSON.stringify({installId:a,lastPingAt:r}));await fetch(ENDPOINT,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:a,version:_version.SDK_VERSION,platform:_reactNative.Platform.OS,tier:t.tier,framework:detectFramework()})})}catch{}}function __resetInstallPingForTests(){sentThisSession=false}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.66";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.68";
@@ -1 +1 @@
1
- "use strict";import{useEffect as g,useMemo as S,useRef as h}from"react";import{LicenseManager as B,installCapacitorBridge as T,resolveDevBuild as O,useLicense as k}from"@buoy-gg/license";import{registerToolAdapters as w}from"@buoy-gg/shared-ui";import{RELEASE_DEFAULT_SOCKET_URL as x,applyReleaseActionPolicy as j,externalSyncOptions as N,releaseTransportProblem as U,shouldMountExternalSync as C}from"./externalSyncGate.js";import{useDeviceIdentity as M}from"./deviceIdentity.js";import{capacitorBrokerURL as P,capacitorTransportProblem as $,useHostInfo as V}from"./capacitorHostInfo.js";import{appSyncAdapter as F}from"./sync/appSyncAdapter.js";import{jsx as f,Fragment as Q,jsxs as q}from"react/jsx-runtime";const H=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"];const K=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];export function BrowserToolRuntime(e){const a=S(()=>Object.fromEntries(Object.entries(e.modules).map(([u,p])=>[u.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),p])),[e.modules]);const o=a["react-query"];return o?.useReactQuerySyncAdapter?f(J,{...e,modules:a,query:o}):f(I,{...e,modules:a})}function J(e){const a=e.query.useReactQuerySyncAdapter();return f(I,{...e,queryAdapter:a})}function I({modules:e,apps:a,requiredEnvVars:o,externalSync:u,headless:p,sentryGetClient:y,queryAdapter:r}){const{isPro:d,tier:v}=k();const n=S(()=>{const c={app:F};for(const[t,s]of Object.entries(e)){for(const[l,A]of Object.entries(s)){if(l.endsWith("SyncAdapter")&&A&&typeof A==="object")c[t]=A}}if(r)c.query=r;if(e.env?.createEnvSyncAdapter)c.env=e.env.createEnvSyncAdapter(o??[]);for(const t of a??[])if(t.sync)c[`custom:${t.id}`]=t.sync;return c},[e,a,o,r]);const m=h(n);m.current=n;g(()=>w(()=>m.current),[]);g(()=>{const c=[];const t=s=>{const l=s?.();if(typeof l==="function")c.push(l)};t(e.network?.startNetworkCapture);t(e.storage?.startBrowserStorageCapture);t(e.assets?.startBrowserAssetCapture);t(e.three?.startThreeCapture);if(O(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production")){t(e["time-machine"]?.startTimeMachineFloatingToolPersistence)}if(e.storage?.storageSyncAdapter?.subscribe)t(()=>e.storage.storageSyncAdapter.subscribe(()=>{}));if(e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe)t(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{}));return()=>{for(const s of c.reverse())s()}},[e]);const _=e["external-sync"];const i=O(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const b=C({isDevelopment:i,isLicensed:d,externalSync:u,isAvailable:Boolean(_)});const R=N(u);T({release:!i&&Boolean(R?.enableInRelease)});if(!i&&R?.enableInRelease)D(U(R.socketURL,R));const E=e.sentry?.SentryRoot;return q(Q,{children:[Object.entries(e).flatMap(([c,t])=>H.map(s=>{const l=t[s];return l?f(l,{},`${c}:${s}`):null})),E&&f(E,{getClient:y}),Object.entries(e).flatMap(([c,t])=>K.map(s=>{const l=t[s];return l&&(!p||s==="ScenariosOverlay"||s==="ImpersonateOverlay")?f(l,{},`${c}:${s}`):null})),b&&f(W,{module:_,tools:n,options:R,isPro:d,tier:v,dev:i})]})}let L=null;function D(e){if(!e||e===L)return;L=e;console.warn("[Buoy]",e)}function W({module:e,tools:a,options:o,isPro:u,tier:p,dev:y}){const r=V();const d=M(o,{appName:r.appName,hardwareName:r.hardwareName,platform:r.platform});const v=S(()=>P(o?.socketURL??(y?e.getDefaultSocketURL():x),Boolean(o?.socketURL),r.platform),[o?.socketURL,y,e,r.platform]);const{socket:n}=e.useExternalSyncSocket({deviceName:d?.deviceName??"Buoy Browser",socketURL:v,persistentDeviceId:r.ready?d?.deviceId??null:null,platform:r.platform,extraDeviceInfo:r.extraDeviceInfo,enableLogs:o?.enableLogs});g(()=>{const i=$(v,r.platform);if(!n||!i)return;const b=()=>D(i);n.on("connect_error",b);return()=>{n.off("connect_error",b)}},[n,v,r.platform]);g(()=>{if(!n)return;const i=()=>{if(n.connected&&B.hasAccountAccess())n.emit("device-license",{isPro:u?"1":"0",tier:p})};i();n.on("connect",i);return()=>{n.off("connect",i)}},[n,u,p]);const m=o?.releaseActions?.join(",")??"";const _=S(()=>j(a,y,m?m.split(","):void 0),[a,y,m]);e.useExternalSync({tools:_,socket:n,deviceId:r.ready?d?.deviceId??null:null,enableLogs:o?.enableLogs});return null}
1
+ "use strict";import{useEffect as _,useMemo as b,useRef as B}from"react";import{LicenseManager as O,installCapacitorBridge as T,resolveDevBuild as I,useLicense as k}from"@buoy-gg/license";import{registerToolAdapters as w}from"@buoy-gg/shared-ui";import{RELEASE_DEFAULT_SOCKET_URL as x,applyReleaseActionPolicy as j,externalSyncOptions as N,releaseTransportProblem as U,shouldMountExternalSync as C}from"./externalSyncGate.js";import{useDeviceIdentity as M}from"./deviceIdentity.js";import{capacitorBrokerURL as P,capacitorTransportProblem as V,useHostInfo as $}from"./capacitorHostInfo.js";import{appSyncAdapter as F}from"./sync/appSyncAdapter.js";import{jsx as p,Fragment as Q,jsxs as q}from"react/jsx-runtime";const H=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"];const K=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];export function BrowserToolRuntime(e){const a=b(()=>Object.fromEntries(Object.entries(e.modules).map(([u,y])=>[u.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),y])),[e.modules]);const o=a["react-query"];return o?.useReactQuerySyncAdapter?p(z,{...e,modules:a,query:o}):p(L,{...e,modules:a})}function z(e){const a=e.query.useReactQuerySyncAdapter();return p(L,{...e,queryAdapter:a})}function L({modules:e,apps:a,requiredEnvVars:o,externalSync:u,headless:y,sentryGetClient:d,queryAdapter:r}){const{isPro:m,tier:R}=k();const n=b(()=>{const c={app:F};for(const[t,s]of Object.entries(e)){for(const[l,A]of Object.entries(s)){if(l.endsWith("SyncAdapter")&&A&&typeof A==="object")c[t]=A}}if(r)c.query=r;if(e.env?.createEnvSyncAdapter)c.env=e.env.createEnvSyncAdapter(o??[]);for(const t of a??[])if(t.sync)c[`custom:${t.id}`]=t.sync;return c},[e,a,o,r]);const v=B(n);v.current=n;_(()=>w(()=>v.current),[]);_(()=>{const c=[];const t=s=>{const l=s?.();if(typeof l==="function")c.push(l)};t(e.network?.startNetworkCapture);t(e.storage?.startBrowserStorageCapture);t(e.assets?.startBrowserAssetCapture);t(e.three?.startThreeCapture);if(I(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production")){t(e["time-machine"]?.startTimeMachineFloatingToolPersistence)}if(e.storage?.storageSyncAdapter?.subscribe)t(()=>e.storage.storageSyncAdapter.subscribe(()=>{}));if(e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe)t(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{}));return()=>{for(const s of c.reverse())s()}},[e]);const S=e["external-sync"];const i=I(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const f=C({isDevelopment:i,isLicensed:m,externalSync:u,isAvailable:Boolean(S)});const g=N(u);T({release:!i&&Boolean(g?.enableInRelease)});if(!i&&g?.enableInRelease)h(U(g.socketURL,g));const E=e.sentry?.SentryRoot;return q(Q,{children:[Object.entries(e).flatMap(([c,t])=>H.map(s=>{const l=t[s];return l?p(l,{},`${c}:${s}`):null})),E&&p(E,{getClient:d}),Object.entries(e).flatMap(([c,t])=>K.map(s=>{const l=t[s];return l&&(!y||s==="ScenariosOverlay"||s==="ImpersonateOverlay")?p(l,{},`${c}:${s}`):null})),f&&p(J,{module:S,tools:n,options:g,isPro:m,tier:R,dev:i})]})}let D=null;function h(e){if(!e||e===D)return;D=e;console.warn("[Buoy]",e)}function J({module:e,tools:a,options:o,isPro:u,tier:y,dev:d}){const r=$();const m=M(o,{appName:r.appName,hardwareName:r.hardwareName,platform:r.platform});const R=b(()=>P(o?.socketURL??(d?e.getDefaultSocketURL():x),Boolean(o?.socketURL),r.platform),[o?.socketURL,d,e,r.platform]);const{socket:n}=e.useExternalSyncSocket({deviceName:m?.deviceName??"Buoy Browser",socketURL:R,persistentDeviceId:r.ready?m?.deviceId??null:null,platform:r.platform,extraDeviceInfo:r.extraDeviceInfo,enableLogs:o?.enableLogs});_(()=>{const i=V(R,r.platform);if(!n||!i)return;const f=()=>h(i);n.on("connect_error",f);return()=>{n.off("connect_error",f)}},[n,R,r.platform]);_(()=>{if(!n)return;const i=()=>{if(!n.connected||!O.hasAccountAccess())return;const f=O.getState();if(!u&&(f.isInitialized===false||f.isValidating===true))return;n.emit("device-license",{isPro:u?"1":"0",tier:y})};i();n.on("connect",i);return()=>{n.off("connect",i)}},[n,u,y]);const v=o?.releaseActions?.join(",")??"";const S=b(()=>j(a,d,v?v.split(","):void 0),[a,d,v]);e.useExternalSync({tools:S,socket:n,deviceId:r.ready?m?.deviceId??null:null,enableLogs:o?.enableLogs});return null}
@@ -1 +1 @@
1
- "use strict";import{useEffect as C,useMemo as O,useRef as Q}from"react";import{Platform as H}from"react-native";import{LicenseManager as J}from"@buoy-gg/license";import{reportOptionalRequireError as r}from"./optionalRequire.js";import{appSyncAdapter as W}from"./sync/appSyncAdapter.js";import{useDeviceIdentity as X}from"./deviceIdentity.js";import{applyReleaseActionPolicy as Y}from"./externalSyncGate.js";import{registerToolAdapters as Z}from"@buoy-gg/shared-ui";let i=null;let g=null;let d=null;let p=null;let f=null;let b=null;let m=null;let S=null;let A=null;let h=null;let M=null;let v=null;let q=null;let k=null;let x=null;let R=null;try{R=require("@buoy-gg/notifications")}catch(e){r("@buoy-gg/notifications",e)}let j=null;let E=null;let L=null;let w=null;let I=null;let T=null;let _=null;let B=null;let N=null;let z=null;let a=null;try{i=require("@buoy-gg/external-sync")}catch(e){r("@buoy-gg/external-sync",e)}try{g=require("@buoy-gg/storage")}catch(e){r("@buoy-gg/storage",e)}try{d=require("@buoy-gg/network")}catch(e){r("@buoy-gg/network",e)}try{p=require("@buoy-gg/react-query")}catch(e){r("@buoy-gg/react-query",e)}try{f=require("@buoy-gg/route-events")}catch(e){r("@buoy-gg/route-events",e)}try{b=require("@buoy-gg/redux")}catch(e){r("@buoy-gg/redux",e)}try{m=require("@buoy-gg/zustand")}catch(e){r("@buoy-gg/zustand",e)}try{S=require("@buoy-gg/jotai")}catch(e){r("@buoy-gg/jotai",e)}try{A=require("@buoy-gg/events")}catch(e){r("@buoy-gg/events",e)}try{h=require("@buoy-gg/console")}catch(e){r("@buoy-gg/console",e)}try{M=require("@buoy-gg/clock")}catch(e){r("@buoy-gg/clock",e)}try{q=require("@buoy-gg/lifecycle")}catch(e){r("@buoy-gg/lifecycle",e)}try{k=require("@buoy-gg/location")}catch(e){r("@buoy-gg/location",e)}try{v=require("@buoy-gg/permissions")}catch(e){r("@buoy-gg/permissions",e)}try{x=require("@buoy-gg/sentry")}catch(e){r("@buoy-gg/sentry",e)}try{j=require("@buoy-gg/env")}catch(e){r("@buoy-gg/env",e)}try{E=require("@buoy-gg/highlight-updates")}catch(e){r("@buoy-gg/highlight-updates",e)}try{L=require("@buoy-gg/debug-borders")}catch(e){r("@buoy-gg/debug-borders",e)}try{w=require("@buoy-gg/impersonate")}catch(e){r("@buoy-gg/impersonate",e)}try{I=require("@buoy-gg/perf-monitor")}catch(e){r("@buoy-gg/perf-monitor",e)}try{T=require("@buoy-gg/js-top")}catch(e){r("@buoy-gg/js-top",e)}try{_=require("@buoy-gg/images")}catch(e){r("@buoy-gg/images",e)}try{B=require("@buoy-gg/assets")}catch(e){r("@buoy-gg/assets",e)}try{N=require("@buoy-gg/tv-remote")}catch(e){r("@buoy-gg/tv-remote",e)}try{z=require("@buoy-gg/focus-inspector")}catch(e){r("@buoy-gg/focus-inspector",e)}try{a=require("expo-constants")}catch(e){r("expo-constants",e)}export function isExternalSyncAvailable(){return!!i?.useExternalSyncSocket}function K(){const e=a?.default??a;return e?.expoConfig?.name??e?.manifest2?.extra?.expoClient?.name??null}function ee(){const e=a?.default??a;const n=e?.deviceName;return typeof n==="string"&&n.length>0?n:null}export function useToolAdapterMap({requiredEnvVars:e,customApps:n}){const c=p?.useReactQuerySyncAdapter?p.useReactQuerySyncAdapter():null;return te(c,e,n)}export function ToolRegistryPublisher({requiredEnvVars:e,customApps:n}){const c=useToolAdapterMap({requiredEnvVars:e,customApps:n});const t=Q(c);t.current=c;C(()=>Z(()=>t.current),[]);return null}export function AutoExternalSync({options:e,requiredEnvVars:n,isPro:c,tier:t,licenseKey:o,customApps:V}){const{useExternalSyncSocket:$,useExternalSync:F}=i;const D=useToolAdapterMap({requiredEnvVars:n,customApps:V});const U=X(e,{appName:K(),hardwareName:ee(),platform:H.OS});const P=U?.deviceId??null;const{socket:u}=$({deviceName:U?.deviceName??"Buoy Device",socketURL:e?.socketURL??i.getDefaultSocketURL?.()??"http://localhost:42831",persistentDeviceId:P,platform:H.OS,enableLogs:e?.enableLogs});const s=Q({isPro:c,tier:t,licenseKey:o});s.current={isPro:c,tier:t,licenseKey:o};C(()=>{if(!u)return;const y=()=>{if(!J.hasAccountAccess()||!u.connected)return;u.emit("device-license",{isPro:s.current.isPro?"1":"0",tier:s.current.tier??(s.current.isPro?"pro":"free")})};if(u.connected)y();u.on("connect",y);return()=>{u.off("connect",y)}},[u,c,t,o]);const l=e?.releaseActions?.join(",")??"";const G=O(()=>Y(D,typeof __DEV__!=="undefined"&&__DEV__,l?l.split(","):void 0),[D,l]);F({tools:G,socket:u,deviceId:P,enableLogs:e?.enableLogs});return null}function te(e,n,c){return O(()=>{const t={app:W};if(g?.storageSyncAdapter){t.storage=g.storageSyncAdapter}if(d?.networkSyncAdapter){t.network=d.networkSyncAdapter}if(e){t.query=e}if(f?.routeEventsSyncAdapter){t["route-events"]=f.routeEventsSyncAdapter}if(b?.reduxSyncAdapter){t.redux=b.reduxSyncAdapter}if(m?.zustandSyncAdapter){t.zustand=m.zustandSyncAdapter}if(S?.jotaiSyncAdapter){t.jotai=S.jotaiSyncAdapter}if(A?.eventsSyncAdapter){t.events=A.eventsSyncAdapter}if(h?.consoleSyncAdapter){t.console=h.consoleSyncAdapter}if(M?.clockSyncAdapter){t.clock=M.clockSyncAdapter}if(v?.permissionsSyncAdapter){t.permissions=v.permissionsSyncAdapter}if(q?.lifecycleSyncAdapter){t.lifecycle=q.lifecycleSyncAdapter}if(k?.locationSyncAdapter){t.location=k.locationSyncAdapter}if(R?.notificationSyncAdapter){t["push-notifications"]=R.notificationSyncAdapter}if(x?.sentrySyncAdapter){t.sentry=x.sentrySyncAdapter}try{const o=require("@buoy-gg/time-machine");if(o?.timeMachineSyncAdapter){t["time-machine"]=o.timeMachineSyncAdapter}}catch(o){r("@buoy-gg/time-machine",o)}try{const o=require("@buoy-gg/scenarios");if(o?.scenariosSyncAdapter){t.scenarios=o.scenariosSyncAdapter}}catch(o){r("@buoy-gg/scenarios",o)}try{const o=require("@buoy-gg/ask-buoy");if(o?.askBuoySyncAdapter){t["ask-buoy"]=o.askBuoySyncAdapter}}catch(o){r("@buoy-gg/ask-buoy",o)}if(j?.createEnvSyncAdapter){t.env=j.createEnvSyncAdapter(n??[])}if(E?.highlightUpdatesSyncAdapter){t["highlight-updates"]=E.highlightUpdatesSyncAdapter}if(L?.debugBordersSyncAdapter){t["debug-borders"]=L.debugBordersSyncAdapter}if(w?.impersonateSyncAdapter){t.impersonate=w.impersonateSyncAdapter}if(I?.perfMonitorSyncAdapter){t["perf-monitor"]=I.perfMonitorSyncAdapter}if(T?.jsTopSyncAdapter){t["js-top"]=T.jsTopSyncAdapter}if(_?.imagesSyncAdapter){t.images=_.imagesSyncAdapter}if(B?.assetsSyncAdapter){t.assets=B.assetsSyncAdapter}if(N?.tvRemoteSyncAdapter){t["tv-remote"]=N.tvRemoteSyncAdapter}if(z?.focusInspectorSyncAdapter){t["focus-inspector"]=z.focusInspectorSyncAdapter}for(const o of c??[]){if(o?.sync){t[`custom:${o.id}`]=o.sync}}return t},[e,n,c])}
1
+ "use strict";import{useEffect as O,useMemo as Q,useRef as V}from"react";import{Platform as H}from"react-native";import{LicenseManager as $}from"@buoy-gg/license";import{reportOptionalRequireError as r}from"./optionalRequire.js";import{appSyncAdapter as X}from"./sync/appSyncAdapter.js";import{useDeviceIdentity as Y}from"./deviceIdentity.js";import{applyReleaseActionPolicy as Z}from"./externalSyncGate.js";import{registerToolAdapters as K}from"@buoy-gg/shared-ui";let s=null;let g=null;let d=null;let p=null;let f=null;let b=null;let m=null;let S=null;let A=null;let h=null;let M=null;let v=null;let q=null;let k=null;let x=null;let R=null;try{R=require("@buoy-gg/notifications")}catch(e){r("@buoy-gg/notifications",e)}let j=null;let E=null;let I=null;let L=null;let w=null;let T=null;let _=null;let z=null;let B=null;let N=null;let i=null;try{s=require("@buoy-gg/external-sync")}catch(e){r("@buoy-gg/external-sync",e)}try{g=require("@buoy-gg/storage")}catch(e){r("@buoy-gg/storage",e)}try{d=require("@buoy-gg/network")}catch(e){r("@buoy-gg/network",e)}try{p=require("@buoy-gg/react-query")}catch(e){r("@buoy-gg/react-query",e)}try{f=require("@buoy-gg/route-events")}catch(e){r("@buoy-gg/route-events",e)}try{b=require("@buoy-gg/redux")}catch(e){r("@buoy-gg/redux",e)}try{m=require("@buoy-gg/zustand")}catch(e){r("@buoy-gg/zustand",e)}try{S=require("@buoy-gg/jotai")}catch(e){r("@buoy-gg/jotai",e)}try{A=require("@buoy-gg/events")}catch(e){r("@buoy-gg/events",e)}try{h=require("@buoy-gg/console")}catch(e){r("@buoy-gg/console",e)}try{M=require("@buoy-gg/clock")}catch(e){r("@buoy-gg/clock",e)}try{q=require("@buoy-gg/lifecycle")}catch(e){r("@buoy-gg/lifecycle",e)}try{k=require("@buoy-gg/location")}catch(e){r("@buoy-gg/location",e)}try{v=require("@buoy-gg/permissions")}catch(e){r("@buoy-gg/permissions",e)}try{x=require("@buoy-gg/sentry")}catch(e){r("@buoy-gg/sentry",e)}try{j=require("@buoy-gg/env")}catch(e){r("@buoy-gg/env",e)}try{E=require("@buoy-gg/highlight-updates")}catch(e){r("@buoy-gg/highlight-updates",e)}try{I=require("@buoy-gg/debug-borders")}catch(e){r("@buoy-gg/debug-borders",e)}try{L=require("@buoy-gg/impersonate")}catch(e){r("@buoy-gg/impersonate",e)}try{w=require("@buoy-gg/perf-monitor")}catch(e){r("@buoy-gg/perf-monitor",e)}try{T=require("@buoy-gg/js-top")}catch(e){r("@buoy-gg/js-top",e)}try{_=require("@buoy-gg/images")}catch(e){r("@buoy-gg/images",e)}try{z=require("@buoy-gg/assets")}catch(e){r("@buoy-gg/assets",e)}try{B=require("@buoy-gg/tv-remote")}catch(e){r("@buoy-gg/tv-remote",e)}try{N=require("@buoy-gg/focus-inspector")}catch(e){r("@buoy-gg/focus-inspector",e)}try{i=require("expo-constants")}catch(e){r("expo-constants",e)}export function isExternalSyncAvailable(){return!!s?.useExternalSyncSocket}function ee(){const e=i?.default??i;return e?.expoConfig?.name??e?.manifest2?.extra?.expoClient?.name??null}function te(){const e=i?.default??i;const n=e?.deviceName;return typeof n==="string"&&n.length>0?n:null}export function useToolAdapterMap({requiredEnvVars:e,customApps:n}){const c=p?.useReactQuerySyncAdapter?p.useReactQuerySyncAdapter():null;return re(c,e,n)}export function ToolRegistryPublisher({requiredEnvVars:e,customApps:n}){const c=useToolAdapterMap({requiredEnvVars:e,customApps:n});const t=V(c);t.current=c;O(()=>K(()=>t.current),[]);return null}export function AutoExternalSync({options:e,requiredEnvVars:n,isPro:c,tier:t,licenseKey:o,customApps:F}){const{useExternalSyncSocket:G,useExternalSync:J}=s;const D=useToolAdapterMap({requiredEnvVars:n,customApps:F});const U=Y(e,{appName:ee(),hardwareName:te(),platform:H.OS});const P=U?.deviceId??null;const{socket:u}=G({deviceName:U?.deviceName??"Buoy Device",socketURL:e?.socketURL??s.getDefaultSocketURL?.()??"http://localhost:42831",persistentDeviceId:P,platform:H.OS,enableLogs:e?.enableLogs});const a=V({isPro:c,tier:t,licenseKey:o});a.current={isPro:c,tier:t,licenseKey:o};O(()=>{if(!u)return;const y=()=>{if(!$.hasAccountAccess()||!u.connected)return;const C=$.getState();if(!a.current.isPro&&(C.isInitialized===false||C.isValidating===true))return;u.emit("device-license",{isPro:a.current.isPro?"1":"0",tier:a.current.tier??(a.current.isPro?"pro":"free")})};if(u.connected)y();u.on("connect",y);return()=>{u.off("connect",y)}},[u,c,t,o]);const l=e?.releaseActions?.join(",")??"";const W=Q(()=>Z(D,typeof __DEV__!=="undefined"&&__DEV__,l?l.split(","):void 0),[D,l]);J({tools:W,socket:u,deviceId:P,enableLogs:e?.enableLogs});return null}function re(e,n,c){return Q(()=>{const t={app:X};if(g?.storageSyncAdapter){t.storage=g.storageSyncAdapter}if(d?.networkSyncAdapter){t.network=d.networkSyncAdapter}if(e){t.query=e}if(f?.routeEventsSyncAdapter){t["route-events"]=f.routeEventsSyncAdapter}if(b?.reduxSyncAdapter){t.redux=b.reduxSyncAdapter}if(m?.zustandSyncAdapter){t.zustand=m.zustandSyncAdapter}if(S?.jotaiSyncAdapter){t.jotai=S.jotaiSyncAdapter}if(A?.eventsSyncAdapter){t.events=A.eventsSyncAdapter}if(h?.consoleSyncAdapter){t.console=h.consoleSyncAdapter}if(M?.clockSyncAdapter){t.clock=M.clockSyncAdapter}if(v?.permissionsSyncAdapter){t.permissions=v.permissionsSyncAdapter}if(q?.lifecycleSyncAdapter){t.lifecycle=q.lifecycleSyncAdapter}if(k?.locationSyncAdapter){t.location=k.locationSyncAdapter}if(R?.notificationSyncAdapter){t["push-notifications"]=R.notificationSyncAdapter}if(x?.sentrySyncAdapter){t.sentry=x.sentrySyncAdapter}try{const o=require("@buoy-gg/time-machine");if(o?.timeMachineSyncAdapter){t["time-machine"]=o.timeMachineSyncAdapter}}catch(o){r("@buoy-gg/time-machine",o)}try{const o=require("@buoy-gg/scenarios");if(o?.scenariosSyncAdapter){t.scenarios=o.scenariosSyncAdapter}}catch(o){r("@buoy-gg/scenarios",o)}try{const o=require("@buoy-gg/ask-buoy");if(o?.askBuoySyncAdapter){t["ask-buoy"]=o.askBuoySyncAdapter}}catch(o){r("@buoy-gg/ask-buoy",o)}if(j?.createEnvSyncAdapter){t.env=j.createEnvSyncAdapter(n??[])}if(E?.highlightUpdatesSyncAdapter){t["highlight-updates"]=E.highlightUpdatesSyncAdapter}if(I?.debugBordersSyncAdapter){t["debug-borders"]=I.debugBordersSyncAdapter}if(L?.impersonateSyncAdapter){t.impersonate=L.impersonateSyncAdapter}if(w?.perfMonitorSyncAdapter){t["perf-monitor"]=w.perfMonitorSyncAdapter}if(T?.jsTopSyncAdapter){t["js-top"]=T.jsTopSyncAdapter}if(_?.imagesSyncAdapter){t.images=_.imagesSyncAdapter}if(z?.assetsSyncAdapter){t.assets=z.assetsSyncAdapter}if(B?.tvRemoteSyncAdapter){t["tv-remote"]=B.tvRemoteSyncAdapter}if(N?.focusInspectorSyncAdapter){t["focus-inspector"]=N.focusInspectorSyncAdapter}for(const o of c??[]){if(o?.sync){t[`custom:${o.id}`]=o.sync}}return t},[e,n,c])}
@@ -1 +1 @@
1
- "use strict";import{Platform as l}from"react-native";import{persistentStorage as s}from"@buoy-gg/shared-ui";import{SDK_VERSION as u}from"../version.js";const a="@react_buoy_install";const x="https://buoy.gg/api/t";const c=24*60*60*1e3;function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const t=Math.random()*16|0;const e=n==="x"?t:t&3|8;return e.toString(16)})}async function p(){try{const n=await s.getItem(a);if(!n)return null;const t=JSON.parse(n);if(typeof t?.installId!=="string")return null;return{installId:t.installId,lastPingAt:typeof t.lastPingAt==="number"?t.lastPingAt:0}}catch{return null}}function y(){console.log("[Buoy] Anonymous usage ping enabled: a random install id, the Buoy version, your platform, 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 async function sendInstallPing(n){const t=typeof __DEV__!=="undefined"&&__DEV__;if(!t)return;if(!n.enabled)return;if(o)return;o=true;try{const e=await p();const r=Date.now();if(e&&r-e.lastPingAt<c)return;const i=e?.installId??f();if(!e)y();await s.setItem(a,JSON.stringify({installId:i,lastPingAt:r}));await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:i,version:u,platform:l.OS,tier:n.tier})})}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 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";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 a=Date.now();if(e&&a-e.lastPingAt<f)return;const i=e?.installId??p();if(!e)m();await s.setItem(l,JSON.stringify({installId:i,lastPingAt:a}));await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:i,version:c,platform:r.OS,tier:t.tier,framework:detectFramework()})})}catch{}}export function __resetInstallPingForTests(){o=false}
@@ -1 +1 @@
1
- "use strict";export const SDK_VERSION="7.0.66";
1
+ "use strict";export const SDK_VERSION="7.0.68";
@@ -16,13 +16,20 @@
16
16
  * It is not derived from hardware, account, project, or app identity, so it
17
17
  * cannot be correlated to a person or joined against anything else we hold.
18
18
  * - **No tool usage.** What you open and inspect stays on your machine, which
19
- * is the whole security story for enterprise adoption. Only the four fields
19
+ * is the whole security story for enterprise adoption. Only the five fields
20
20
  * below ever leave.
21
21
  * - **Silent and harmless.** Fire-and-forget, throttled to once a day, and
22
22
  * every failure path is swallowed. It can never block, slow, or break an app.
23
23
  *
24
24
  * Opt out with `Buoy.init({ telemetry: false })`.
25
25
  */
26
+ /**
27
+ * Which kind of app this is, so the dashboard can count each port on its own.
28
+ * `Platform.OS` alone says "web" for Angular, Capacitor and plain web alike,
29
+ * and "ios" for a TV app. A Capacitor shell wins over Angular: it is the
30
+ * shell, and an Ionic Angular app is a Capacitor app first.
31
+ */
32
+ export declare function detectFramework(): string;
26
33
  /**
27
34
  * What the ping reports about the account: the tier of an admitted account,
28
35
  * or "locked" for an install that has not been admitted (no key, or a key the
@@ -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.66";
12
+ export declare const SDK_VERSION = "7.0.68";
13
13
  //# sourceMappingURL=version.d.ts.map
@@ -16,13 +16,20 @@
16
16
  * It is not derived from hardware, account, project, or app identity, so it
17
17
  * cannot be correlated to a person or joined against anything else we hold.
18
18
  * - **No tool usage.** What you open and inspect stays on your machine, which
19
- * is the whole security story for enterprise adoption. Only the four fields
19
+ * is the whole security story for enterprise adoption. Only the five fields
20
20
  * below ever leave.
21
21
  * - **Silent and harmless.** Fire-and-forget, throttled to once a day, and
22
22
  * every failure path is swallowed. It can never block, slow, or break an app.
23
23
  *
24
24
  * Opt out with `Buoy.init({ telemetry: false })`.
25
25
  */
26
+ /**
27
+ * Which kind of app this is, so the dashboard can count each port on its own.
28
+ * `Platform.OS` alone says "web" for Angular, Capacitor and plain web alike,
29
+ * and "ios" for a TV app. A Capacitor shell wins over Angular: it is the
30
+ * shell, and an Ionic Angular app is a Capacitor app first.
31
+ */
32
+ export declare function detectFramework(): string;
26
33
  /**
27
34
  * What the ping reports about the account: the tier of an admitted account,
28
35
  * or "locked" for an install that has not been admitted (no key, or a key the
@@ -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.66";
12
+ export declare const SDK_VERSION = "7.0.68";
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-P3PAM3FD.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-ZQZDFWH3.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 +1 @@
1
- "use client";import{v as o}from"./chunk-NKUQECQ2.mjs";import"./chunk-Z6I7ZD34.mjs";import"./chunk-D2FYORGY.mjs";import"./chunk-LOPXJLVB.mjs";export{o as FloatingDevTools};
1
+ "use client";import{v as o}from"./chunk-4A5JHNVM.mjs";import"./chunk-Z6I7ZD34.mjs";import"./chunk-D2FYORGY.mjs";import"./chunk-LOPXJLVB.mjs";export{o as FloatingDevTools};
@@ -1,4 +1,4 @@
1
- "use client";import{a as H,b as U,c as ct,d as or,e as wo,f as nr,g as xl,h as Re,i as xo,j as He,k as dt}from"./chunk-Z6I7ZD34.mjs";import{b as ir,c as rr}from"./chunk-D2FYORGY.mjs";import{a as r,b as To,e as We}from"./chunk-LOPXJLVB.mjs";import{BuoyPortal as ar,FloatingToolHost as sr}from"@buoy-gg/shared-ui/web/floating";import*as lr from"@buoy-gg/license/web";import{LicenseManager as cr,useLicense as dr,sameLicenseKey as ur,resolveDevBuild as pr,capacitorDebug as mr,isCapacitorNative as gr,loadCapacitorAppHost as fr}from"@buoy-gg/license/web";import{AccountSetup as hr,HintsProvider as yr,normalizeEnvironment as br,registerToolOpener as vr,startSettingsSync as Sr}from"@buoy-gg/shared-ui/web";import{useState as Et,useMemo as fe,useCallback as _e,useEffect as te,useRef as wr}from"react";import{useSettings as xr,getToolLabel as ut,getToolDescription as Tr,getToolColor as Co}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Ee,devToolsStorageKeys as pt,EnvironmentIndicator as Cr,EnvironmentSelectorInline as Ir}from"@buoy-gg/shared-ui/web";var kr=[];function Io(){return[]}r(Io,"autoDiscoverWebPresets");function Ot(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}r(Ot,"autoDiscoverWithCustom");function mt(e,t){return e.filter(o=>{let i=o.slot||"both";return i==="both"||i===t})}r(mt,"getToolsBySlot");function ko(e,t){let o=t instanceof Set?t:new Set(t);return e.filter(i=>o.has(i.id))}r(ko,"getEnabledTools");import{FloatingTool as zo,FloatingToolDivider as zr,FloatingToolUserStatus as Bo,getBubbleAnchorPosition as Br}from"@buoy-gg/shared-ui/web/floating";import{useState as Z,useEffect as Oe,useMemo as gt,useRef as ft,useCallback as ht}from"react";var Ao={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 Do(e,t){return e&&Ao[e]?Ao[e]:t}r(Do,"dialAccessibilityLabel");import{getDialLayout as Ar,getAllIconPositions as Dr,getGridLineRotations as Mr,getIconStaggerInputRange as Rr,MAX_DIAL_SLOTS as Xe,DIAL_ICON_SIZE as Er,dialAnimationConfig as Mo,getDialCSSKeyframesString as Or,getDialCSSAnimationStyles as Pr,dialColors as $,dialStyles as w,withAlpha as Ro,floatingToolsColors as Lr}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Eo,monoFont as Oo,ToolBackground as Fr,useToolBackground as $r}from"@buoy-gg/shared-ui/web";import{memo as jr}from"react";import{RasterLayer as Nr,scatter as Hr,useLoop as Wr,withBgAlpha as _r}from"@buoy-gg/shared-ui/web";import{Fragment as Ur,jsx as Qe}from"react/jsx-runtime";var Kr=.94,Vr=6,qr=2400,yt=3,Po=16,Gr=Array.from({length:yt},(e,t)=>Hr(22343^t*40503,Po*4)),Lo=["#FFFFFF","#B3D9FF","#8CB3FF"],Fo=Math.PI/3,$o=14*Math.PI/180;function jo(e){let t=Math.min(5,Math.floor(e*6)),o=e*6-t;return t*Fo+$o/2+o*(Fo-$o)}r(jo,"spokeClearAngle");function No(e){return Math.min(Vr,1/(1-e*Kr))}r(No,"scaleAt");function Ho(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}r(Ho,"opacityAt");function Wo(e){let t=e/yt,o=[],i=12;for(let c=0;c<=i;c++)o.push(c/i);let n=(1-t)%1;n>.001&&n<1-.001&&o.push(n-1e-4,n+1e-4),o.sort((c,p)=>c-p);let a=[],s=[],u=[];for(let c of o){let p=t===0&&c===1?1:(c+t)%1;a.push(c),s.push(No(p)),u.push(Ho(p))}return{input:a,scale:s,opacity:u}}r(Wo,"shellStops");var Jr=Array.from({length:yt},(e,t)=>Wo(t)),Yr=jr(r(function({size:e}){let t=Wr(qr),o=e/2,i=[];for(let n=0;n<yt;n++){let a=Gr[n],s=Jr[n],u=[];for(let c=0;c<Po;c++){let p=jo(a[c*4]),g=(.15+.85*Math.sqrt(a[c*4+1]))*.5*o,C=Lo[Math.floor(a[c*4+3]*Lo.length)%3],f=o+Math.cos(p)*g,D=o+Math.sin(p)*g,x=.6,M=x*2.4;u.push(Qe(H,{style:{position:"absolute",left:f-M/2,top:D-M/2,width:M,height:M,borderRadius:M/2,backgroundColor:_r(C,.3)}},`${c}-h`),Qe(H,{style:{position:"absolute",left:f-x/2,top:D-x/2,width:x,height:x,borderRadius:x/2,backgroundColor:C}},c))}i.push(Qe(Re.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:s.input,outputRange:s.opacity}),transform:[{scale:t.interpolate({inputRange:s.input,outputRange:s.scale})}]},pointerEvents:"none",children:Qe(Nr,{style:{width:e,height:e},raster:false,children:u})},n))}return Qe(Ur,{children:i})},"DialHyperspace"));import{useEffect as Xr,useState as _o}from"react";import{dialColors as Ue,withAlpha as Uo}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Qr,ARROW_HEIGHT as Zr,SPACING_GAP as Hl,getScreenCenterY as Wl,calculateTooltipPosition as ea,calculateTargetPosition as _l}from"@buoy-gg/shared-ui/web/floating";import{monoFont as Ko}from"@buoy-gg/shared-ui/web";import{jsx as Ke,jsxs as Vo}from"react/jsx-runtime";var qo=false;function Go(){if(qo||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
1
+ "use client";import{a as H,b as U,c as ct,d as nr,e as wo,f as ir,g as xl,h as Me,i as xo,j as He,k as dt}from"./chunk-Z6I7ZD34.mjs";import{b as rr,c as ar}from"./chunk-D2FYORGY.mjs";import{a as r,b as To,e as We}from"./chunk-LOPXJLVB.mjs";import{BuoyPortal as sr,FloatingToolHost as lr}from"@buoy-gg/shared-ui/web/floating";import*as cr from"@buoy-gg/license/web";import{LicenseManager as dr,useLicense as ur,sameLicenseKey as pr,resolveDevBuild as mr,capacitorDebug as gr,isCapacitorNative as fr,loadCapacitorAppHost as hr}from"@buoy-gg/license/web";import{AccountSetup as yr,HintsProvider as br,normalizeEnvironment as vr,registerToolOpener as Sr,startSettingsSync as wr}from"@buoy-gg/shared-ui/web";import{useState as Ot,useMemo as fe,useCallback as _e,useEffect as te,useRef as xr}from"react";import{useSettings as Tr,getToolLabel as ut,getToolDescription as Ir,getToolColor as Io}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Oe,devToolsStorageKeys as pt,EnvironmentIndicator as Cr,EnvironmentSelectorInline as zr}from"@buoy-gg/shared-ui/web";var kr=[];function Co(){return[]}r(Co,"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 zo(e,t){let o=t instanceof Set?t:new Set(t);return e.filter(i=>o.has(i.id))}r(zo,"getEnabledTools");import{FloatingTool as ko,FloatingToolDivider as Ar,FloatingToolUserStatus as Ao,getBubbleAnchorPosition as Br}from"@buoy-gg/shared-ui/web/floating";import{useState as Z,useEffect as Ee,useMemo as gt,useRef as ft,useCallback as ht}from"react";var Bo={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 Do(e,t){return e&&Bo[e]?Bo[e]:t}r(Do,"dialAccessibilityLabel");import{getDialLayout as Dr,getAllIconPositions as Rr,getGridLineRotations as Mr,getIconStaggerInputRange as Or,MAX_DIAL_SLOTS as Xe,DIAL_ICON_SIZE as Er,dialAnimationConfig as Ro,getDialCSSKeyframesString as Pr,getDialCSSAnimationStyles as Lr,dialColors as $,dialStyles as w,withAlpha as Mo,floatingToolsColors as Fr}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Oo,monoFont as Eo,ToolBackground as $r,useToolBackground as jr}from"@buoy-gg/shared-ui/web";import{memo as Nr}from"react";import{RasterLayer as Hr,scatter as Wr,useLoop as _r,withBgAlpha as Ur}from"@buoy-gg/shared-ui/web";import{Fragment as Kr,jsx as Qe}from"react/jsx-runtime";var Vr=.94,qr=6,Gr=2400,yt=3,Po=16,Jr=Array.from({length:yt},(e,t)=>Wr(22343^t*40503,Po*4)),Lo=["#FFFFFF","#B3D9FF","#8CB3FF"],Fo=Math.PI/3,$o=14*Math.PI/180;function jo(e){let t=Math.min(5,Math.floor(e*6)),o=e*6-t;return t*Fo+$o/2+o*(Fo-$o)}r(jo,"spokeClearAngle");function No(e){return Math.min(qr,1/(1-e*Vr))}r(No,"scaleAt");function Ho(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}r(Ho,"opacityAt");function Wo(e){let t=e/yt,o=[],i=12;for(let c=0;c<=i;c++)o.push(c/i);let n=(1-t)%1;n>.001&&n<1-.001&&o.push(n-1e-4,n+1e-4),o.sort((c,p)=>c-p);let a=[],s=[],u=[];for(let c of o){let p=t===0&&c===1?1:(c+t)%1;a.push(c),s.push(No(p)),u.push(Ho(p))}return{input:a,scale:s,opacity:u}}r(Wo,"shellStops");var Yr=Array.from({length:yt},(e,t)=>Wo(t)),Xr=Nr(r(function({size:e}){let t=_r(Gr),o=e/2,i=[];for(let n=0;n<yt;n++){let a=Jr[n],s=Yr[n],u=[];for(let c=0;c<Po;c++){let p=jo(a[c*4]),g=(.15+.85*Math.sqrt(a[c*4+1]))*.5*o,I=Lo[Math.floor(a[c*4+3]*Lo.length)%3],f=o+Math.cos(p)*g,k=o+Math.sin(p)*g,x=.6,R=x*2.4;u.push(Qe(H,{style:{position:"absolute",left:f-R/2,top:k-R/2,width:R,height:R,borderRadius:R/2,backgroundColor:Ur(I,.3)}},`${c}-h`),Qe(H,{style:{position:"absolute",left:f-x/2,top:k-x/2,width:x,height:x,borderRadius:x/2,backgroundColor:I}},c))}i.push(Qe(Me.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:s.input,outputRange:s.opacity}),transform:[{scale:t.interpolate({inputRange:s.input,outputRange:s.scale})}]},pointerEvents:"none",children:Qe(Hr,{style:{width:e,height:e},raster:false,children:u})},n))}return Qe(Kr,{children:i})},"DialHyperspace"));import{useEffect as Qr,useState as _o}from"react";import{dialColors as Ue,withAlpha as Uo}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Zr,ARROW_HEIGHT as ea,SPACING_GAP as Hl,getScreenCenterY as Wl,calculateTooltipPosition as ta,calculateTargetPosition as _l}from"@buoy-gg/shared-ui/web/floating";import{monoFont as Ko}from"@buoy-gg/shared-ui/web";import{jsx as Ke,jsxs as Vo}from"react/jsx-runtime";var qo=false;function Go(){if(qo||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
2
2
  @keyframes buoyOnboardPulse {
3
3
  0%, 100% { transform: scale(1); }
4
4
  50% { transform: scale(1.02); }
@@ -7,4 +7,4 @@
7
7
  0%, 100% { transform: translateY(0); }
8
8
  50% { transform: translateY(-8px); }
9
9
  }
10
- `,document.head.appendChild(e),qo=true}r(Go,"injectOnboardingKeyframes");var Pt=Ue.accent;function Lt({title:e,message:t,onDismiss:o,showArrow:i=true}){let[n,a]=_o(false),[s,u]=_o(false);Xr(()=>{Go();let p=requestAnimationFrame(()=>a(true));return()=>cancelAnimationFrame(p)},[]);let c={fontFamily:Ko,textTransform:"uppercase"};return Ke("div",{style:{position:"fixed",left:"50%",bottom:ea(),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:Vo("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ke("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Vo("div",{style:{position:"relative",maxWidth:280,backgroundColor:Ue.dialBackground,borderRadius:16,border:`1px solid ${Ue.dialBorder}`,padding:20,boxShadow:`0 0 20px ${Uo(Ue.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ke("span",{style:{...c,fontSize:16,fontWeight:900,letterSpacing:1,color:Pt,textAlign:"center"},children:e}),Ke("span",{style:{fontFamily:Ko,fontSize:13,lineHeight:"20px",color:Ue.centerText,textAlign:"center"},children:t}),Ke("button",{onClick:o,onPointerDown:()=>u(true),onPointerUp:()=>u(false),onPointerLeave:()=>u(false),onPointerCancel:()=>u(false),style:{...c,marginTop:8,borderRadius:8,border:"none",backgroundColor:Pt,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:s?.7:1,transform:s?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ke("div",{style:{position:"absolute",left:"50%",bottom:Qr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${Zr}px solid ${Pt}`,filter:`drop-shadow(0 0 10px ${Uo(Ue.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}r(Lt,"OnboardingTooltip");import{Fragment as ta,jsx as P,jsxs as ve}from"react/jsx-runtime";var oa={x:.5,y:.5},Jo="@react_buoy_settings_tooltip_shown",Yo=false;function Xo(){if(Yo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Or(),document.head.appendChild(e),Yo=true}r(Xo,"injectKeyframes");var Ve=r(e=>1-Math.pow(1-e,3),"easeOutCubic"),Ft=r(e=>e*e*e,"easeInCubic");function Qo({icon:e,index:t,totalIcons:o,position:i,progress:n,onPress:a}){let[s,u]=Z(false),[c,p]=Z(false),g=!e.icon&&e.id.startsWith("empty-"),C=!g&&e.unavailable===true,f=!g&&!C,{icons:D}=Mo,x=Rr(t,o),M=0;n<=x[1]?M=0:n<=x[2]?M=(n-x[1])/(x[2]-x[1]):M=1,M=Math.max(0,Math.min(1,M));let B=Er,E=D.pressIn.scale,A=M*(c?E:s?1.1:1),k=0;M<=0?k=0:M<=.3?k=M:k=.3+(M-.3)*(.7/.7);let S=i.x*M,I=i.y*M;return P("button",{role:"menuitem","aria-label":g?"Empty slot":Do(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!f,tabIndex:f?0:-1,onClick:f?a:void 0,onPointerEnter:F=>f&&F.pointerType==="mouse"&&u(true),onPointerLeave:()=>{u(false),p(false)},onPointerDown:()=>f&&p(true),onPointerUp:()=>p(false),onPointerCancel:()=>p(false),style:{position:"absolute",left:"50%",top:"50%",width:B,height:B,marginLeft:-B/2,marginTop:-B/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:f?"pointer":"default",transform:`translate(${S}px, ${I}px) scale(${A})`,opacity:k,transition:s||c?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:g?P("div",{style:{width:w.emptySlot.dotSize,height:w.emptySlot.dotSize,borderRadius:w.emptySlot.dotSize/2,backgroundColor:$.emptyDotBackground,border:`${w.emptySlot.borderWidth}px solid ${$.emptyDotBorder}`}}):ve(ta,{children:[P("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}}),P("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}}),P("div",{style:{marginBottom:w.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:s?"brightness(1.2)":"none"},children:e.icon}),P("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:$.iconLabel,letterSpacing:w.icon.label.letterSpacing,marginTop:w.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),C&&P("span",{style:{fontSize:w.icon.label.fontSize-1,fontWeight:w.icon.label.fontWeight,fontFamily:w.icon.label.fontFamily,letterSpacing:w.icon.label.letterSpacing,color:Lr.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}r(Qo,"DialIconItem");function $t({side:e,color:t}){return P("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,a],s)=>P("line",{x1:o,y1:i,x2:n,y2:a,stroke:t,strokeWidth:2},s))})}r($t,"PagerChevron");function jt({side:e,disabled:t,onClick:o}){let[i,n]=Z(false),a=t?$.emptyDotBorder:$.accent;return ve("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 ${$.dialBorder}`,backgroundColor:$.dialBackground,color:t?$.iconLabelMuted:$.centerText,fontSize:12,fontWeight:900,fontFamily:Oo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${Ro($.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&P($t,{side:"prev",color:a}),e==="prev"?"PREV":"NEXT",e==="next"&&P($t,{side:"next",color:a})]})}r(jt,"PagerButton");function Nt({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:i,settingsOpen:n=false,hintsDisabled:a=false}){let{id:s}=$r(),[u,c]=Z(0),[p,g]=Z(0),[C,f]=Z(0),[D,x]=Z(0),[M,B]=Z(0),[E,A]=Z(1),[k,S]=Z(false),[I,F]=Z(false),[z,R]=Z(false),ee=ft(null),_=ft(null),G=ft(null),oe=ft(false),{entrance:V,exit:ae,interaction:ne}=Mo,Se=Pr(),[se,ke]=Z(()=>({width:window.innerWidth,height:window.innerHeight}));Oe(()=>{let v=r(()=>ke({width:window.innerWidth,height:window.innerHeight}),"resize");return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);let j=gt(()=>Ar({screenWidth:se.width,maxCircleSize:Math.max(120,Math.min(320,se.height-96))}),[se]),Ye=gt(()=>Mr(),[]),ze=gt(()=>Dr(Xe,j.iconRadius),[j.iconRadius]),[$e,Be]=Z(0),le=Math.max(1,Math.ceil(e.length/Xe)),Y=Math.min($e,le-1),we=gt(()=>{let v=Y*Xe,T=[...e.slice(v,v+Xe)];for(;T.length<Xe;)T.push({id:`empty-${T.length}`,name:"",icon:null,onPress:r(()=>{},"onPress")});return T},[e,Y]);Oe(()=>{Xo()},[]),Oe(()=>{let v=V.backdrop.duration,T=V.dial.rotation.duration,X=V.centerButton.delay,K=V.icons.delay,J=V.icons.duration,q=performance.now(),ie=r(ge=>{let l=ge-q;c(Math.min(1,l/v));let h=Math.min(1,l/400),O=Ve(h)*1.1;h>.7&&(O-=(h-.7)*.33),h>=1&&(O=1),g(Math.max(0,Math.min(1.05,O)));let Q=Math.min(1,l/T);if(f(Ve(Q)*360),l>=X){let Te=Math.min(1,(l-X)/300),Ne=Ve(Te)*1.15;Te>.6&&(Ne-=(Te-.6)*.375),Te>=1&&(Ne=1),x(Math.max(0,Math.min(1.05,Ne)))}if(l>=K){let Te=Math.min(1,(l-K)/J);B(Ve(Te))}let xe=K+J;l<xe?G.current=requestAnimationFrame(ie):(c(1),g(1),f(360),x(1),B(1),R(true))},"animate");return G.current=requestAnimationFrame(ie),()=>{G.current&&cancelAnimationFrame(G.current)}},[]);let me=ht(()=>{if(oe.current)return;oe.current=true,F(true),G.current&&cancelAnimationFrame(G.current);let v=performance.now(),T=ae.icons.duration,X=ae.centerButton.duration,K=ae.dialScale.duration,J=Math.max(X,K),q=ae.backdrop.duration,ie=r(ge=>{let l=ge-v;if(l<T){let Q=Ft(l/T);B(1-Q),G.current=requestAnimationFrame(ie);return}let h=T;if(l<h+J){B(0);let Q=Math.min(1,(l-h)/X),xe=Math.min(1,(l-h)/K);x(1-Ft(Q)),g(1-Ft(xe)),G.current=requestAnimationFrame(ie);return}let O=h+J;if(l<O+q){g(0),x(0);let Q=(l-O)/q;c(1-Q),G.current=requestAnimationFrame(ie);return}c(0),t()},"animate");G.current=requestAnimationFrame(ie)},[ae,t]);Oe(()=>{let v=document.activeElement,T=ee.current;return()=>{v?.isConnected&&(document.activeElement===document.body||T?.contains(document.activeElement))&&v.focus()}},[]),Oe(()=>{if(n)return;_.current?.focus();let v=r(T=>{let X=ee.current;if(X){if(T.key==="Escape")T.preventDefault(),me();else if(T.key==="Tab"){let K=Array.from(X.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(ie=>ie.getClientRects().length>0),J=K[0],q=K[K.length-1];(!X.contains(document.activeElement)||(T.shiftKey?document.activeElement===J:document.activeElement===q))&&(T.preventDefault(),(T.shiftKey?q:J)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(T.key)){let K=Array.from(X.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),J=K.indexOf(document.activeElement);if(J<0||!K.length)return;T.preventDefault();let q=T.key==="Home"?0:T.key==="End"?K.length-1:(J+(T.key==="ArrowRight"||T.key==="ArrowDown"?1:-1)+K.length)%K.length;K[q].focus()}}},"handleKeyDown");return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[me,n]);let[Ae,je]=Z(false);Oe(()=>{if(a)return;let v=false,T=setTimeout(async()=>{let X=await Eo.getItem(Jo);!v&&!X&&je(true)},1200);return()=>{v=true,clearTimeout(T)}},[a]);let ye=ht(()=>{je(false),Eo.setItem(Jo,"true")},[]);Oe(()=>{n&&Ae&&ye()},[n,Ae,ye]);let De=ht(v=>{if(v.id.startsWith("empty-")||oe.current)return;let[T,X]=ne.iconSelect.pulse,K=performance.now(),J=150,q=r(ie=>{let ge=ie-K;if(ge<J){let l=Ve(ge/J);A(1-(1-T.scale)*l),requestAnimationFrame(q)}else if(ge<J*2){let l=Ve((ge-J)/J);A(T.scale+(X.scale-T.scale)*l),requestAnimationFrame(q)}else A(1)},"animatePulse");requestAnimationFrame(q),setTimeout(()=>{v.onPress(),me()},ne.iconSelect.actionDelay)},[ne.iconSelect,me]),pe=ht(v=>{if(oe.current)return;let T=Math.max(0,Math.min(v,le-1));T!==Y&&Be(T)},[le,Y]),be=j.buttonSize*w.centerButton.containerRatio,Me=j.buttonSize*w.centerButton.borderRatio,d=j.buttonSize*w.centerButton.containerRatio/2+6,W=z&&!I;return ve("div",{ref:ee,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[P("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:me,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:$.dialBackdrop,opacity:u}}),ve("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,bottom:80,width:j.circleSize,height:j.circleSize,borderRadius:"50%",backgroundColor:$.dialBackground,border:`${w.circle.borderWidth}px solid ${$.dialBorder}`,boxShadow:`0 0 ${w.circle.shadowRadius}px ${Ro($.dialShadow,w.circle.shadowOpacity)}`,transform:`scale(${p}) rotate(${C}deg)`,opacity:p>.01?1:0,overflow:"hidden"},children:[P("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:$.dialGradient1,opacity:w.gradientLayers[0].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:$.dialGradient2,opacity:w.gradientLayers[1].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:$.dialGradient3,opacity:w.gradientLayers[2].opacity}}),Ye.map(v=>P("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:w.grid.lineHeight,transform:`rotate(${v}deg)`,transformOrigin:"center"},children:["left","right"].map(T=>P("div",{style:{position:"absolute",top:0,[T]:0,width:`calc(50% - ${d}px)`,height:w.grid.lineHeight,backgroundColor:$.dialGridLine}},T))},v)),P("div",{"data-testid":"dial-background","data-background":s,style:{position:"absolute",inset:0,pointerEvents:"none"},children:s==="hyperspace"?P(Yr,{size:j.circleSize}):P(Fr,{focus:oa})}),we.map((v,T)=>P(Qo,{icon:v,index:T,totalIcons:we.length,position:ze[T],progress:M,onPress:()=>De(v)},T)),ve("div",{style:{position:"absolute",left:"50%",top:"50%",width:be,height:be,marginLeft:-be/2,marginTop:-be/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:$.hubHalo,borderRadius:j.buttonSize,overflow:"hidden",transform:`scale(${D*E})`,opacity:D>.01?1:0},children:[P("div",{style:{position:"absolute",inset:0,backgroundColor:$.dialGradient1,opacity:.5,borderRadius:j.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:$.dialGradient2,opacity:.3,borderRadius:j.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:$.dialGradient3,opacity:.2,borderRadius:j.buttonSize}}),P("div",{style:{width:Me,height:Me,borderRadius:j.buttonSize*w.centerButton.borderRadiusRatio,backgroundColor:$.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:P("button",{ref:_,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,onPointerEnter:v=>v.pointerType==="mouse"&&S(true),onPointerLeave:()=>S(false),style:{border:0,padding:0,background:"transparent",width:j.buttonSize,height:j.buttonSize,borderRadius:j.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default",transform:k?`scale(${ne.centerHover.scale})`:"scale(1)",transition:`transform ${ne.centerHover.duration}ms ease`,animation:W&&!k?Se.pulse:"none"},children:n?ve("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:$.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[P("span",{style:{marginBottom:-2},children:"CLOSE"}),P("span",{style:{marginTop:-2},children:"SETTINGS"})]}):P("span",{style:{fontSize:w.centerButton.text.fontSize,fontWeight:w.centerButton.text.fontWeight,fontFamily:w.centerButton.text.fontFamily,color:$.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),le>1&&ve("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,top:"calc(100% - 64px)",width:j.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,p),transform:`scale(${Math.min(1,p)})`},children:[P(jt,{side:"prev",disabled:Y<=0,onClick:()=>pe(Y-1)}),ve("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Oo,letterSpacing:2,color:$.centerText,textShadow:`0 0 6px ${$.centerTextGlow}`},children:[String(Y+1).padStart(2,"0"),ve("span",{style:{color:$.iconLabelMuted,textShadow:"none"},children:[" / ",String(le).padStart(2,"0")]})]}),P(jt,{side:"next",disabled:Y>=le-1,onClick:()=>pe(Y+1)})]}),Ae&&!n&&P(Lt,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:ye,showArrow:false})]})}r(Nt,"DialMenu");import{persistentStorage as Zo,devToolsStorageKeys as na}from"@buoy-gg/shared-ui/web";import{recordUsage as ia,pruneUsage as ra}from"@buoy-gg/floating-tools-core/web";var en=na.dial.usage(),qe={},tn=false,Ht=null;function Wt(){return Ht||(Ht=(async()=>{try{let e=await Zo.getItem(en);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(qe=t)}}catch{}finally{tn=true}})(),Ht)}r(Wt,"loadDialUsage");Wt();function on(e){return e.map((t,o)=>({id:t,index:o,lastUsed:qe[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}r(on,"getRankedToolIds");async function nn(e){if(!e)return;tn||await Wt();let t=Math.max(Date.now(),...Object.values(qe).map(o=>o.lastUsed+1));qe=ra(ia(qe,e,t),t);try{await Zo.setItem(en,JSON.stringify(qe))}catch{}}r(nn,"recordToolUsage");import{useCallback as aa,useMemo as rn}from"react";import{persistentStorage as sa}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Ce,useCallback as bt,useMemo as vt}from"react";import{settingsEventBus as St}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as la}from"react";import{getRegisteredToolModule as ca}from"@buoy-gg/shared-ui/web";var da=r(()=>()=>{},"noopSubscribe"),ua=r(()=>null,"serverSnapshot");function an(){let e=ca("@buoy-gg/external-sync");return la(e?.subscribeSyncStatus??da,()=>e?.getSyncStatus?.()??null,ua)}r(an,"useDesktopSyncStatus");import{SentryIcon as pa,WifiCircuitIcon as ma,ImageOverlayIcon as ga,RenderCountIcon as fa,Info as _t,Layers as ha,ChevronRightIcon as sn,ChevronDown as ln,getStorageBackendType as ya,getUseLicense as ba,signOutOfBuoy as va,persistentStorage as Pe,Trash2 as Sa,CheckCircle2 as cn,BuoyUpgradeSheet as wa,BackgroundSwitcher as xa,night as y,NightCard as Le,NightRows as Ut,NightSectionLabel as Ta,NightFootnote as dn,NightSwitch as un,NightButton as Kt,NightSegmented as Ca,NightBadge as he,NightSeparator as Ia,monoFont as pn}from"@buoy-gg/shared-ui/web";import{EnvIcon as mn,StorageIcon as ka,RoutesIcon as za,NetworkIcon as Ba,QueryIcon as Aa,HighlighterIcon as Da,ReduxIcon as Ma,EventsIcon as Ra}from"@buoy-gg/floating-tools-core/web";import Ea,{createContext as Oa,useContext as Pa}from"react";import{jsx as La}from"react/jsx-runtime";var gn=Oa({});function Vt({children:e,defaultFloatingTools:t,defaultDialTools:o}){let i=Ea.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return La(gn.Provider,{value:i,children:e})}r(Vt,"DefaultConfigProvider");function qt(){return Pa(gn)}r(qt,"useDefaultConfig");import Fa from"react";import{toolTheme as $a}from"@buoy-gg/shared-ui/web";import{jsx as fn}from"react/jsx-runtime";function hn({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,a=Math.max(7,Math.min(t*(i===1?.7:.62),n/(.62*i)));return fn("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:a,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}r(hn,"AppTextIcon");function Gt(e,t){return e==null?e:typeof e=="function"?Fa.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?fn(hn,{label:String(e),size:t.size,color:t.color}):e}r(Gt,"renderAppIcon");import{JsModal as ja,devToolsStorageKeys as Jt,onSettingsApplied as Na,expandableWindowControlsSupported as Ha}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Wa}from"@buoy-gg/shared-ui/web";import{Fragment as Ze,jsx as m,jsxs as N}from"react/jsx-runtime";var et="@react_buoy_dev_tools_settings",_a=6,wt=r(e=>{let t=_a,o={};for(let[i,n]of Object.entries(e))n&&t>0?(o[i]=true,t-=1):o[i]=false;return o},"enforceDialLimit"),Ua=r((e,t)=>{let{userStatus:o,environment:i,...n}=e,a=t?Object.entries(n).filter(([s])=>t.includes(s)):Object.entries(n);return{...Object.fromEntries(a),environment:i??false}},"sanitizeFloating"),yn=r((e,t,o)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(i).filter(([a])=>o.allowedDialKeys?.includes(a)):Object.entries(i);return{dialTools:wt(Object.fromEntries(n)),floatingTools:Ua({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},"mergeWithDefaults"),Ka=r((e=[],t,o)=>{let i={},n={},a=new Set(t??[]),s=new Set(o??[]),u=!o||o.length===0;for(let c of e){let{id:p,slot:g="both"}=c;(g==="dial"||g==="both")&&(i[p]=u?true:s.has(p)),(g==="row"||g==="both")&&(n[p]=a.has(p))}return{dialTools:wt(i),floatingTools:{...n,environment:a.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},"generateDefaultSettings"),Va=r(({visible:e,onClose:t,onSettingsChange:o,initialSettings:i,availableApps:n=[],storage:a=Pe,zIndex:s})=>{let{defaultFloatingTools:u,defaultDialTools:c}=qt(),p=vt(()=>Ka(n,u,c),[n,u,c]),g=vt(()=>Object.keys(p.dialTools),[p]),C=vt(()=>Object.keys(p.floatingTools).filter(l=>l!=="environment"),[p]),[f,D]=re(i||tt||p),[x,M]=re(Yt??"floating"),[B,E]=re(Yt!==null),[A,k]=re(new Set),[S,I]=re(false),[F,z]=re(false);Ce(()=>{let l=requestAnimationFrame(()=>z(true));return()=>cancelAnimationFrame(l)},[]);let R=an();Ce(()=>{r(async()=>{try{let l=await Pe.getItem(Jt.settings.activeTab());if(l&&["floating","settings","pro"].includes(l)){let h=l;Yt=h,M(O=>O===h?O:h)}}catch{}finally{E(true)}},"loadActiveTab")()},[]),Ce(()=>{B&&Pe.setItem(Jt.settings.activeTab(),x).catch(l=>{console.warn("[Buoy]","Failed to save settings active tab:",l)})},[x,B]);let ee=ba()?.(),_=ee?.isPro??false,G=!_&&ee?.licenseKey?ee.error:null,oe=ee?.errorKind==="transport",[V,ae]=re(bn),[ne,Se]=re(false),[se,ke]=re(false),[j,Ye]=re(false),[ze,$e]=re([]),[Be,le]=re(false),Y=Wa(),we=xo.get("window").height,me=xo.get("window").width,Ae=Math.floor(we*.33),je=Math.min(me-32,400),ye=bt(async()=>{try{let l=await a.getItem(et);if(l){let h=JSON.parse(l),O=yn(p,h,{allowedDialKeys:g,allowedFloatingKeys:C});tt=O,D(Q=>vn(Q,O)?Q:O);return}tt=p,D(h=>vn(h,p)?h:p)}catch(l){console.error("[Buoy]","Failed to load dev tools settings:",l),D(p)}},[p,g,C,a]);Ce(()=>{ye()},[ye]),Ce(()=>{ya().then(l=>{bn=l,ae(h=>h===l?h:l)})},[]),Ce(()=>{j&&(le(true),Pe.getAllKeys().then(l=>{$e(l.sort())}).catch(()=>{$e([])}).finally(()=>{le(false)}))},[j]);let De=r(async l=>{try{let h={...l,dialTools:wt(l.dialTools)};await a.setItem(et,JSON.stringify(h)),tt=h,D(h),o?.(h),St.emit(h)}catch(h){console.error("[Buoy]","Failed to save dev tools settings:",h)}},"saveSettings"),pe=r(l=>{let h={...f,floatingTools:{...f.floatingTools,[l]:!f.floatingTools[l]}};De(h)},"toggleFloatingTool"),be=r(l=>{let h={...f,globalSettings:{...f.globalSettings,[l]:!f.globalSettings?.[l]}};De(h)},"toggleGlobalSetting"),Me=r(async()=>{Se(true),ke(false);try{await Pe.clear(),ke(true),D(p),a!==Pe&&await a.setItem(et,JSON.stringify(p)),o?.(p),St.emit(p),setTimeout(()=>ke(false),2e3)}catch(l){console.error("[Buoy]","Failed to clear storage:",l)}finally{Se(false)}},"handleClearStorage"),d=bt(l=>{},[]),W=r(l=>{let h=n.find(O=>O.id===l);return h?.description?h.description:l==="environment"?"Environment badge.":""},"getToolDescription"),v=r(l=>l==="environment"?"Env Badge":n.find(h=>h.id===l)?.name??l.toUpperCase().replace(/_/g," "),"getToolLabel"),T=r(l=>{if(!F)return null;switch(l){case"query":return m(Aa,{size:18});case"env":return m(mn,{size:18});case"sentry":return m(pa,{size:18,color:"#9945FF"});case"storage":return m(ka,{size:18,bgColor:y.color.surface});case"wifi":case"query-wifi-toggle":return m(ma,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return m(za,{size:18,bgColor:y.color.surface});case"network":return m(Ba,{size:18});case"environment":return m(mn,{size:18});case"debug-borders":return m(ha,{size:18,color:y.color.accent});case"highlight-updates":return m(fa,{size:18,color:y.color.accent});case"highlight-updates-modal":return m(Da,{size:18});case"redux":return m(Ma,{size:18});case"image-overlay":return m(ga,{size:18});case"events":return m(Ra,{size:18});case"zustand":try{let{ZustandIcon:h}=To("@buoy-gg/zustand/web");return m(h,{size:18})}catch{return m(_t,{size:18,color:y.color.textSecondary})}case"jotai":try{let{JotaiIcon:h}=To("@buoy-gg/jotai/web");return m(h,{size:18})}catch{return m(_t,{size:18,color:y.color.textSecondary})}default:{let h=n.find(O=>O.id===l);return h?.icon!=null?Gt(h.icon,{slot:"row",size:18,color:h.color}):m(_t,{size:18,color:y.color.textSecondary})}}},"getToolIcon"),X=r((l,h,O,Q)=>{let xe=W(l);return N(ct,{activeOpacity:O?1:.7,onPress:()=>!O&&Q(),accessibilityLabel:v(l),accessibilityRole:"button",style:[b.toolRow,O&&b.rowDisabled],children:[m(H,{style:b.toolIconSlot,children:T(l)}),N(H,{style:b.rowInfo,children:[N(U,{style:b.rowLabel,children:[v(l),O?" \xB7 max 6":""]}),xe?m(U,{style:b.rowCaption,numberOfLines:1,children:xe}):null]}),m(un,{value:h,disabled:O,onValueChange:()=>Q()})]},l)},"renderToolRow"),K=r(l=>{k(h=>{let O=new Set(h);return O.has(l)?O.delete(l):O.add(l),O})},"toggleSettingExpanded"),J=r((l,h,O,Q,xe)=>{let Te=f.globalSettings?.[l]??false,Ne=A.has(l);return N(H,{children:[N(ct,{activeOpacity:.7,onPress:()=>K(l),accessibilityLabel:h,style:b.settingRow,children:[N(H,{style:b.rowInfo,children:[m(U,{style:b.rowLabel,children:h}),m(U,{style:b.rowCaption,numberOfLines:Ne?0:1,children:O})]}),m(un,{value:Te,onValueChange:()=>be(l)})]}),Ne&&N(H,{style:b.settingRowBody,children:[m(U,{style:b.settingRowBodyText,children:Q}),m(U,{style:b.settingRowBodyHint,children:xe})]})]},l)},"renderGlobalSettingRow"),q=r((l,h,O)=>N(H,{children:[m(Ta,{children:l}),h,O]}),"renderSection"),ie=V==="filesystem"?m(he,{label:"File System",tone:"accent"}):V==="asyncstorage"?m(he,{label:"Async Storage",tone:"warning"}):V==="localstorage"?m(he,{label:"Local Storage",tone:"accent"}):V==="memory"?m(he,{label:"Memory",tone:"danger"}):m(he,{label:"Loading\u2026",tone:"neutral"}),ge=r(()=>N(H,{style:b.container,children:[N(wo,{style:b.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:b.scrollContainer,children:[x==="floating"&&m(Ze,{children:q("Floating Tools",m(Le,{glass:true,children:m(Ut,{children:Object.entries(f.floatingTools).map(([l,h])=>X(l,h,false,()=>pe(l)))})}),m(dn,{children:"Tools switched on here appear in the floating bubble row."}))}),x==="settings"&&N(Ze,{children:[q("Background",m(Le,{glass:true,padded:true,children:m(xa,{embedded:true})})),q("Storage",N(Le,{glass:true,children:[N(ct,{activeOpacity:.7,onPress:()=>Ye(!j),accessibilityLabel:"Storage Type",style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Storage Type"})}),ie,j?m(ln,{size:16,color:y.color.textTertiary}):m(sn,{size:16,color:y.color.textTertiary})]}),j&&N(Ze,{children:[N(H,{style:b.settingRowBody,children:[m(U,{style:b.settingRowBodyText,children:V==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":V==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":V==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":V==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),V==="asyncstorage"&&m(U,{style:[b.settingRowBodyText,b.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),V==="memory"&&m(U,{style:[b.settingRowBodyText,b.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),m(Ia,{}),N(H,{style:b.storageExpanded,children:[N(H,{style:b.storageExpandedHeader,children:[m(U,{style:b.storageExpandedTitle,children:"SAVED SETTINGS"}),m(U,{style:b.storageExpandedCount,children:Be?"\u2026":`${ze.length} keys`})]}),Be?m(U,{style:b.storageKeyEmpty,children:"Loading\u2026"}):ze.length===0?m(U,{style:b.storageKeyEmpty,children:"No settings saved yet"}):m(wo,{style:b.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ze.map(l=>m(H,{style:b.storageKeyItem,children:m(U,{style:b.storageKeyText,numberOfLines:1,children:l.replace("@react_buoy_","")})},l))})]}),m(H,{style:b.cardButtonWrap,children:m(Kt,{label:se?"Cleared":ne?"Clearing\u2026":"Clear All Settings",variant:se?"secondary":"destructive",size:"md",disabled:ne,onPress:Me,icon:se?m(cn,{size:15,color:y.color.accent}):m(Sa,{size:15,color:ne?y.color.textTertiary:y.color.danger})})})]})]})),R&&R.state!=="idle"&&q("Desktop Sync",N(Le,{glass:true,children:[N(ct,{activeOpacity:.7,onPress:()=>K("desktopSync"),accessibilityLabel:"Buoy Desktop",style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Buoy Desktop"})}),R.state==="connected"?m(he,{label:"Connected",tone:"accent"}):R.state==="connecting"?m(he,{label:"Connecting\u2026",tone:"neutral"}):m(he,{label:"Retrying",tone:"warning"}),A.has("desktopSync")?m(ln,{size:16,color:y.color.textTertiary}):m(sn,{size:16,color:y.color.textTertiary})]}),A.has("desktopSync")&&N(H,{style:b.settingRowBody,children:[N(U,{style:b.settingRowBodyText,children:[R.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",m(U,{style:b.footnoteMono,children:R.targetURL??"(unknown URL)"}),R.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),R.state==="retrying"&&R.lastError&&N(U,{style:[b.settingRowBodyText,b.bodyWarning],children:["Last error: ",R.lastError]})]})]})),q("Modal Behavior",m(Le,{glass:true,children:N(Ut,{children:[J("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."),Ha(He.OS==="web")?J("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]})}))]}),x==="pro"&&N(Ze,{children:[q("License",N(Le,{glass:true,children:[N(H,{style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"License Status"})}),m(H,{testID:"buoy-settings-license-status",accessibilityLabel:_?"License: Active":"License: Free",children:_?m(he,{label:"Active",tone:"accent"}):m(he,{label:"Free",tone:"neutral"})})]}),ee?.tierSource==="session"?N(H,{style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Signed in with Buoy"})}),m(Kt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void va(),testID:"buoy-settings-signout"})]}):null]}),m(dn,{children:_?"You have full access to all Buoy DevTools features.":G?oe?`Couldn't reach the license server (${G}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${G}.`:"Upgrade to Pro to unlock all features and support development."})),!_&&N(Ze,{children:[q("Pro Features",m(Le,{glass:true,children:m(Ut,{children:["Advanced Settings","Priority Support"].map(l=>N(H,{style:b.featureRow,children:[m(cn,{size:16,color:y.color.accent}),m(U,{style:b.rowLabel,children:l})]},l))})})),m(Kt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>I(true)})]})]})]}),m(wa,{visible:S,onClose:()=>I(false)})]}),"renderContent");return m(ja,{visible:e,onClose:t,zIndex:s,variant:"night",header:{showToggleButton:false,customContent:m(H,{style:b.headerRow,children:m(Ca,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:x,onChange:l=>M(l)})})},initialMode:"bottomSheet",onModeChange:d,persistenceKey:Jt.settings.root(),enablePersistence:true,maxHeight:we-Y.top,initialHeight:Ae,initialFloatingPosition:{x:(me-je)/2,y:Y.top+20},enableGlitchEffects:true,children:ge()})},"DevToolsSettingsModal"),qa={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Ga=r((e,t)=>{let o=new Set(e??[]),i=new Set(t??[]),n={};for(let s of i)n[s]=true;let a={environment:o.has("environment")};for(let s of o)s!=="environment"&&(a[s]=true);return{dialTools:wt(n),floatingTools:a,globalSettings:{enableSharedModalDimensions:false}}},"createDefaultsFromConfig"),tt=null,Yt=null,bn=null,vn=r((e,t)=>JSON.stringify(e)===JSON.stringify(t),"sameSettings");St.addListener(e=>{e&&(tt=e)});var Sn=r(()=>{let{defaultFloatingTools:e,defaultDialTools:t}=qt(),o=vt(()=>!e&&!t?qa:Ga(e,t),[e,t]),[i,n]=re(o),a=bt(async()=>{try{let u=await Pe.getItem(et);if(u){let c=JSON.parse(u),p=yn(o,c);n(p);return}n(o)}catch(u){console.error("[Buoy]","Failed to load dev tools settings:",u),n(o)}},[o]);Ce(()=>Na(u=>{u.includes(et)&&a()}),[a]),Ce(()=>{a();let u=St.addListener(c=>{try{c&&n(c)}catch{}});return()=>{u()}},[a]);let s=bt(()=>{a()},[a]);return{settings:i,refreshSettings:s}},"useDevToolsSettings"),b=dt.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:y.gutter,paddingRight:y.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:y.gutter,paddingTop:8,paddingBottom:24,gap:y.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:y.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:y.rowPadH,paddingVertical:y.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:y.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:y.color.text,fontSize:y.font.row,fontWeight:"500"},rowCaption:{color:y.color.textTertiary,fontSize:y.font.label},settingRowBody:{paddingHorizontal:y.rowPadH,paddingBottom:y.rowPadV,gap:6},settingRowBodyText:{color:y.color.textSecondary,fontSize:y.font.caption,lineHeight:y.font.caption*1.45},settingRowBodyHint:{color:y.color.textTertiary,fontSize:y.font.caption,lineHeight:y.font.caption*1.45},bodyWarning:{color:y.color.warning},bodyDanger:{color:y.color.danger},cardButtonWrap:{paddingHorizontal:y.cardPad,paddingTop:10,paddingBottom:y.cardPad},storageExpanded:{paddingHorizontal:y.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:y.color.textSecondary,fontSize:y.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:y.color.textTertiary,fontSize:y.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:y.color.glassElevated,borderRadius:y.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:y.color.textSecondary,fontSize:y.font.micro,fontFamily:pn},storageKeyEmpty:{color:y.color.textTertiary,fontSize:y.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:pn,fontSize:y.font.label,color:y.color.textSecondary}});import{jsx as wn}from"react/jsx-runtime";var Ja=[];function Xt({visible:e,onClose:t,availableTools:o=Ja,defaultFloatingTools:i,defaultDialTools:n,storage:a=sa,onSettingsChange:s}){let u=rn(()=>({getItem:r(async g=>a.getItem(g),"getItem"),setItem:r(async(g,C)=>a.setItem(g,C),"setItem")}),[a]),c=rn(()=>o.map(g=>({...g,name:g.name??g.id,icon:typeof g.icon=="function"?C=>g.icon(C.size):g.icon})),[o]),p=aa(g=>{s?.(g)},[s]);return wn(Vt,{defaultFloatingTools:i,defaultDialTools:n,children:wn(Va,{visible:e,onClose:t,zIndex:11e3,availableApps:c,storage:u,onSettingsChange:p})})}r(Xt,"SettingsModal");import{listenBuoyKeydown as Ya}from"@buoy-gg/shared-ui/web/floating";import{persistentStorage as xn,setExpandableWindowControls as Xa}from"@buoy-gg/shared-ui/web";import{createContext as Qa,useCallback as Ie,useContext as Za,useEffect as xt,useMemo as es,useRef as ot,useState as Tn}from"react";var ts=r((e,t,o)=>{if(t.singleton){let n=e.find(a=>a.id===t.id);if(n){let a=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:a,apps:[...e.filter(s=>s.instanceId!==n.instanceId),{...n,minimized:false}]}}}let i=o();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}},"resolveOpenAppsState");import{createContext as os,useCallback as Cn,useContext as ns,useEffect as Tt,useMemo as is,useRef as In,useState as Ct}from"react";import{JsModal as rs,ModalHeader as nt,HeaderSearchButton as as,TickProvider as ss,ToolScreenHeaderContext as ls,devToolsStorageKeys as kn,buoyColors as zn,gameUIColors as Qt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as It}from"react/jsx-runtime";var it=r(()=>{},"noop"),cs={search:"",isSearchActive:false,clearSearch:it,close:it,minimize:it,showToast:it,setHeaderOverride:it},Bn=os(null);function Zt(){return ns(Bn)??cs}r(Zt,"useToolHost");function An(e,t){let{setHeaderOverride:o}=Zt();Tt(()=>(o(e),()=>o(null)),t)}r(An,"useToolHeader");var Dn=2200,ds={success:Qt.success,error:Qt.error,info:Qt.info};function Mn({message:e,type:t,nonce:o}){let i=In(new Re.Value(0)).current;Tt(()=>{i.setValue(0),Re.sequence([Re.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Re.delay(Dn-450),Re.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,i]);let n=ds[t];return It(Re.View,{pointerEvents:"none",style:[kt.toast,{opacity:i,borderColor:n+"60"}],children:[ce(H,{style:[kt.toastDot,{backgroundColor:n}]}),ce(U,{style:kt.toastText,numberOfLines:2,children:e})]})}r(Mn,"ToastView");function Rn({app:e,config:t,visible:o,zIndex:i,onClose:n,onMinimize:a,initialModalState:s,enableSharedModalDimensions:u,bodyProps:c}){let p=e.component,[g,C]=Ct(false),[f,D]=Ct(""),[x,M]=Ct(null),[B,E]=Ct(null),A=In(null),k=Cn(()=>{C(false),D("")},[]),S=Cn((V,ae="info")=>{A.current&&clearTimeout(A.current),E(ne=>({message:V,type:ae,nonce:(ne?.nonce??0)+1})),A.current=setTimeout(()=>E(null),Dn)},[]);Tt(()=>()=>{A.current&&clearTimeout(A.current)},[]);let I=is(()=>({search:g?f:"",isSearchActive:g,clearSearch:k,close:n,minimize:r(()=>a(),"minimize"),showToast:S,setHeaderOverride:M,instanceId:e.instanceId}),[f,g,k,n,a,S,e.instanceId]),F=x?.title??t.title??e.title??e.id,z=x?.subtitle??t.subtitle,R=x?.onBack,ee=x?.actions??t.headerActions,_=x?.searchable??t.searchable;Tt(()=>{!_&&g&&k()},[_,g,k]);let G=u?kn.modal.root():kn.custom(e.id).modal(),oe=It(nt,{children:[R&&!g&&ce(nt.Navigation,{onBack:R}),g?ce(nt.Search,{value:f,onChangeText:D,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ce(nt.Content,{title:F,subtitle:z}),It(nt.Actions,{children:[!g&&ee,_&&!g&&ce(as,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>C(true)})]})]});return ce(Bn.Provider,{value:I,children:ce(rs,{visible:o,onClose:n,onBack:R,onMinimize:a,initialModalState:s,zIndex:i,persistenceKey:G,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:oe,showToggleButton:true},disableScrollWrapper:true,styles:{},children:It(H,{style:kt.bodyRoot,children:[ce(ss,{children:ce(ls.Provider,{value:M,children:ce(p,{...c})})}),B&&ce(Mn,{message:B.message,type:B.type,nonce:B.nonce})]})})})}r(Rn,"ToolModalShell");var kt=dt.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:zn.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:zn.text}});import{useEffect as us,useRef as ps}from"react";import{capacitorPlatform as ms,capacitorPlugin as gs}from"@buoy-gg/license/web";function En(){return globalThis.__BUOY_HOLDS_BACK__===true}r(En,"isBuoyHoldingBackButton");var fs=99.5;function On(){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(On,"ionicHandlesBack");function Pn(e,t){let o=ps(t);o.current=t,us(()=>{if(!e||ms()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let n;if(On()){let a=r(s=>{s.detail?.register?.(fs,()=>{o.current()})},"listener");document.addEventListener("ionBackButton",a),n=r(()=>document.removeEventListener("ionBackButton",a),"cleanup")}else{let a=gs("App");if(!a?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let s=false,u=null;Promise.resolve(a.addListener("backButton",()=>o.current())).then(c=>{s?c.remove():u=c}).catch(()=>{}),n=r(()=>{s=true,u&&u.remove()},"cleanup")}return()=>{n(),i.__BUOY_HOLDS_BACK__=false}},[e])}r(Pn,"useCapacitorBackButton");import{Fragment as hs,jsx as de}from"react/jsx-runtime";var Ln=Qa(null),Fn="@react_buoy_open_apps",eo=44,ys=12,bs=100,vs=16,Ss=r(e=>({x:window.innerWidth-eo-vs,y:window.innerHeight-bs-eo-e*(eo+ys)}),"dockIconPosition"),$n=r(({children:e})=>{let[t,o]=Tn([]),[i,n]=Tn(false),a=ot([]),s=ot(null),u=ot(false),c=ot(false),p=ot(false),g=Ie(S=>{let I="";return o(F=>{let{apps:z,instanceId:R}=ts(F,S,()=>`${S.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return I=R,z}),I},[]),C=Ie(()=>{if(u.current||!c.current||!p.current)return;u.current=true;let S=s.current;if(!S||S.length===0){n(true);return}s.current=null,S.forEach(({id:I,minimized:F})=>{let z=a.current.find(R=>R.id===I);if(z&&z.component){let R=Gt(z.icon,{slot:"dial",size:20,color:z.color});g({id:z.id,title:z.name,component:z.component,props:z.props,modal:z.modal,launchMode:z.launchMode||"self-modal",singleton:z.singleton??true,icon:R,color:z.color,minimized:F})}}),n(true)},[g]);xt(()=>{let S=false;return r(async()=>{try{let I=await xn.getItem(Fn);if(S)return;if(I){let F=JSON.parse(I),z;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?z=F.map(R=>({id:R,minimized:false})):z=F.filter(R=>typeof R=="object"&&R!==null&&typeof R.id=="string"),z.length&&(s.current=z))}}catch{}S||(c.current=true,C())},"restoreOpenApps")(),()=>{S=true}},[C]),xt(()=>{if(!i)return;let S=t.map(I=>({id:I.id,minimized:I.minimized??false}));xn.setItem(Fn,JSON.stringify(S))},[t,i]);let f=Ie(S=>{a.current=S,p.current=true,C()},[C]),D=Ie(S=>{o(I=>I.length?S?I.filter(F=>F.instanceId!==S):I.slice(0,-1):I)},[]),x=Ie(()=>o([]),[]),M=Ie((S,I)=>{o(F=>F.map(z=>z.instanceId===S?{...z,minimized:true,restoreState:I}:z))},[]),B=Ie((S,I)=>{o(F=>F.map(z=>z.instanceId===S?{...z,minimized:false,restoreState:I??z.restoreState}:z))},[]),E=Ie(S=>t.find(I=>I.instanceId===S)?.minimized??false,[t]),A=t.some(S=>S.launchMode!=="toggle-only"&&!S.minimized);xt(()=>A?Ya(r(S=>{if(S.key!=="Escape"||S.defaultPrevented)return;let I=[...t].reverse().find(F=>F.launchMode!=="toggle-only"&&!F.minimized);I&&D(I.instanceId)},"handler")):void 0,[A,D,t]),Pn(t.length>0,()=>D());let k=es(()=>({openApps:t,isAnyOpen:A,open:g,close:D,closeAll:x,registerApps:f,minimize:M,restore:B,isMinimized:E}),[t,A,g,D,x,f,M,B,E]);return de(Ln.Provider,{value:k,children:e})},"AppHostProvider"),rt=r(()=>{let e=Za(Ln);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"),ws=9e3,xs={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Ts={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Cs=r(({app:e,zIndex:t,onClose:o,onMinimize:i,minimizeTargetPosition:n,enableSharedModalDimensions:a})=>{let s=e.component,u=!e.minimized,c={...e.props??{},...a?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(Rn,{app:e,config:e.modal,visible:u,zIndex:t,onClose:o,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:a,bodyProps:c})}):e.launchMode==="self-modal"?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...c,visible:u,onClose:o,onRequestClose:o,onMinimize:i,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?u?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...c,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...xs,zIndex:t,display:u?"flex":"none"},children:de("div",{style:Ts,children:de(s,{...c,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},"AppRenderer"),jn=r(()=>{let{openApps:e,close:t,minimize:o}=rt(),{settings:i}=Sn();xt(()=>{Xa(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let n=e.filter(u=>u.launchMode!=="toggle-only");if(n.length===0)return null;let a=n.filter(u=>u.minimized).length,s=Br()??Ss(a);return de(hs,{children:n.map((u,c)=>de(Cs,{app:u,zIndex:ws+c,onClose:()=>t(u.instanceId),onMinimize:p=>o(u.instanceId,p),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:s},u.instanceId))})},"AppOverlay");import{useCallback as Is,useEffect as to,useRef as ks,useState as Nn,useSyncExternalStore as Hn}from"react";import{persistentStorage as Wn,getToolAttention as oo,subscribeToolAttention as _n}from"@buoy-gg/shared-ui/web";import{jsx as ue,jsxs as zt}from"react/jsx-runtime";function Un(e){return Hn(_n,()=>oo(e),()=>oo(e))}r(Un,"useToolAttention");var Kn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},Vn={needsInput:3,failed:2,done:1},qn=new Map;function no(e){let t=null;for(let i of e?e.split("|"):[]){let n=oo(i);n&&(!t||Vn[n.kind]>Vn[t.kind])&&(t=n)}let o=qn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(qn.set(e,t),t)}r(no,"strongest");function Gn(e){let t=e.join("|");return Hn(_n,()=>no(t),()=>no(t))}r(Gn,"useStrongestAttention");var Jn=28,io=32,ro=6,Yn=8,Xn=24,Qn="@react_buoy_minimized_stack_expanded",zs=80,Zn=2e3,Bs=6e3,As="#1A1A1A",at="#888888";function ao({down:e=false}){return ue("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:ue("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:at,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}r(ao,"ChevronGlyph");function ei({id:e,title:t,icon:o,index:i,onPress:n}){let a=Un(e),s=ks(null);return to(()=>{let u=true,c,p=r(()=>{s.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:zs,easing:"linear"})},"runGlitch"),g=r(C=>{let f=C?500+Math.random()*1500+i*200:Zn+Math.random()*(Bs-Zn)+i*300;c=setTimeout(()=>{u&&(p(),g(false))},f)},"schedule");return g(true),()=>{u=false,clearTimeout(c)}},[i]),zt("button",{type:"button","aria-label":a?`${t} \u2014 ${a.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:io,height:io,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[ue("div",{ref:s,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),a?ue("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:Kn[a.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:a.kind==="needsInput"?"!":""}):null]})}r(ei,"GlitchToolButton");function ti({containerWidth:e=32}){let{openApps:t,restore:o}=rt(),i=t.filter(f=>f.minimized&&f.launchMode!=="toggle-only"),[n,a]=Nn(false),[s,u]=Nn(false),c=Gn(i.map(f=>f.id));to(()=>{let f=false;return r(async()=>{let D=await Wn.getItem(Qn);!f&&D==="true"&&a(true),f||u(true)},"load")(),()=>{f=true}},[]),to(()=>{s&&Wn.setItem(Qn,n?"true":"false")},[n,s]);let p=Is(f=>{o(f)},[o]);if(i.length===0)return null;let g=Yn+i.length*io+(i.length-1)*ro+ro+Xn+4,C={backgroundColor:As,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:Jn,overflow:"visible",position:"relative"},children:[ue("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",...C},children:zt("div",{style:{height:g,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:Yn,gap:ro,boxSizing:"border-box"},children:[n&&[...i].reverse().map((f,D)=>ue(ei,{id:f.id,title:f.title||f.id,icon:f.icon??ue("span",{style:{color:"#fff",fontSize:13},children:(f.title||f.id).slice(0,1).toUpperCase()}),index:D,onPress:()=>p(f.instanceId)},f.instanceId)),ue("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>a(false),style:{width:"100%",height:Xn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:ue(ao,{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:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:Jn,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",...C},children:[ue(ao,{}),c?ue("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:Kn[c.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:c.kind==="needsInput"?"!":""}):null,i.length>1&&ue("span",{style:{fontSize:9,fontWeight:600,color:at,marginLeft:1},children:i.length})]})]})}r(ti,"MinimizedToolsStack");import{registerToolModules as Ds}from"@buoy-gg/shared-ui/web";import{createElement as Ms}from"react";function Ge(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ms(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}r(Ge,"createWebTool");import{createContext as Rs,useContext as Es,useState as oi,useMemo as ni}from"react";import{jsx as Os}from"react/jsx-runtime";var ii=Rs(null);function so({children:e}){let[t,o]=oi(false),[i,n]=oi(false),a=ni(()=>t||i,[t,i]),s=ni(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:a,setDialOpen:o,setToolOpen:n}),[t,i,a]);return Os(ii.Provider,{value:s,children:e})}r(so,"DevToolsVisibilityProvider");function Bt(){let e=Es(ii);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:r(()=>{},"setDialOpen"),setToolOpen:r(()=>{},"setToolOpen")}}r(Bt,"useDevToolsVisibility");import*as Ps from"@buoy-gg/license/web";import*as Ls from"@buoy-gg/shared-ui/web";import*as Fs from"@buoy-gg/shared-ui/web/dataViewer";function lo(e){Ds({core:{useDevToolsVisibility:Bt},license:Ps,"shared-ui":Ls,"shared-ui/dataViewer":Fs,...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),[Ge(n)])))}r(lo,"createWebTools");import{useEffect as At,useMemo as Dt,useRef as $s}from"react";import{LicenseManager as js,installCapacitorBridge as Ns,resolveDevBuild as ri,useLicense as Hs}from"@buoy-gg/license/web";import{registerToolAdapters as Ws}from"@buoy-gg/shared-ui/web";function co(e){return typeof e=="object"&&e!==null?e:void 0}r(co,"externalSyncOptions");function ai({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:i}){if(o===false||!i)return false;if(e)return true;let n=co(o);return t&&n?.enableInRelease===true&&uo(n.socketURL,n)===null}r(ai,"shouldMountExternalSync");var si="http://localhost:42831";function li(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}r(li,"isLoopbackHost");function uo(e,t){let o=e??si;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:"||li(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(uo,"releaseTransportProblem");var _s={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function ci(e,t,o){if(t)return e;let i=null;for(let[n,a]of Object.entries(_s)){if(o?.includes(n))continue;let s=e[n];if(!s?.actions)continue;let u={...s.actions};for(let c of a)c in u&&(u[c]=()=>{throw new Error(`${n}.${c} 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]={...s,actions:u}}return i??e}r(ci,"applyReleaseActionPolicy");import{useEffect as Us,useMemo as Ks,useState as Vs}from"react";import{devToolsStorageKeys as qs,persistentStorage as Gs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as Js}from"@buoy-gg/license/web";var Ys=8;function di(){let e="";for(;e.length<Ys;)e+=(Math.random()*16|0).toString(16);return e}r(di,"generateInstallId");function ui(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}r(ui,"slugify");function pi({appName:e,hardwareName:t,platform:o,installId:i,deviceId:n}){let a=ui(e??"buoy")||"buoy",s=e??"Buoy Device",u=t?.trim()||o;return n?{deviceId:n,deviceName:`${s} (${u})`}:{deviceId:`${a}-${o}-${i}`,deviceName:`${s} (${u} \xB7 ${i.slice(-4)})`}}r(pi,"buildDeviceIdentity");function mi(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}r(mi,"sessionStore");function gi(){let e=globalThis;try{return e.localStorage??null}catch{return null}}r(gi,"localStore");async function fi({platform:e=He.OS,store:t,mint:o=di}={}){let i=qs.sync.deviceId(),n=t===void 0?Js()?gi():e==="web"?mi():Gs:t;if(!n)return o();try{let a=await n.getItem(i);if(a&&a.length>0)return a;let s=o();return await n.setItem(i,s),s}catch{return o()}}r(fi,"loadInstallId");var po=null;function hi(){return po||(po=fi()),po}r(hi,"getInstallId");function yi(e,t){let o=e?.deviceId,i=e?.deviceName,n=t.loadId??hi,a=t.platform??He.OS,[s,u]=Vs(null);return Us(()=>{if(o)return;let c=false;return n().then(p=>{c||u(p)}),()=>{c=true}},[o,n]),Ks(()=>{if(!o&&!s)return null;let c=pi({appName:t.appName,hardwareName:t.hardwareName,platform:a,installId:s??"",deviceId:o});return i?{...c,deviceName:i}:c},[o,i,s,t.appName,t.hardwareName,a])}r(yi,"useDeviceIdentity");import{useEffect as Xs,useState as Qs}from"react";import{capacitorPlatform as Zs,capacitorPlugin as Mt,isCapacitorNative as el}from"@buoy-gg/license/web";function bi(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(bi,"hardwareFromUserAgent");function vi(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}r(vi,"isAndroidEmulatorUserAgent");function mo(){return typeof navigator>"u"?"":navigator.userAgent??""}r(mo,"userAgent");function Rt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}r(Rt,"firstPageTitle");var Si="@react_buoy_capacitor_app_name";function wi(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem(Si);if(o)return o;e&&t.setItem(Si,e)}catch{}return e}r(wi,"persistedAppName");function xi(){let e=Zs();if(!e)return{platform:"web",appName:Rt(),hardwareName:"Browser",ready:true};let t=!!Mt("App");return{platform:e,appName:t?Rt():wi(Rt()),hardwareName:bi(mo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Mt("Device")}}r(xi,"initialHostInfo");function Ti(){let[e,t]=Qs(xi);return Xs(()=>{if(!el())return;let o=false,i=Mt("App"),n=Mt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([a,s])=>{if(o)return;let u=a?.name?.trim(),c=s?.name?.trim()||s?.model?.trim();t(p=>({...p,appName:u||p.appName,hardwareName:c||p.hardwareName,ready:true}))}),()=>{o=true}},[]),e}r(Ti,"useHostInfo");function go(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:mo(),serverUrl:typeof e=="string"?e:null}}r(go,"pageInfo");function fo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}r(fo,"schemeHost");function Ci(e,t){if(e==="ios"){let o=fo(t.serverUrl);return o?o===fo(t.origin):t.protocol==="capacitor:"}return Ii.has(t.hostname)}r(Ci,"isBundledPage");var Ii=new Set(["localhost","127.0.0.1","[::1]","::1"]);function ki(e,t,o,i=go()){if(o==="web"||!i)return e;let n;try{n=new URL(e)}catch{return e}let a=Ci(o,i);return!t&&a&&n.hostname===i.hostname&&(n.hostname="localhost"),o==="android"&&Ii.has(n.hostname)&&vi(i.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}r(ki,"capacitorBrokerURL");function zi(e,t,o=go()){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(zi,"capacitorTransportProblem");import{getDevServerOrigin as tl,resolveReloadStrategy as ol,scheduleReloadApp as nl}from"@buoy-gg/shared-ui/web";var Bi=Date.now(),Ai=tl(),il={platform:He.OS,isTV:He.isTV===true,isTVOS:He.isTVOS===true},Di={version:3,getSnapshot:r(()=>{let e=ol("auto");return{startedAt:Bi,devServerOrigin:Ai,device:il,reload:{available:e!==null,strategy:e}}},"getSnapshot"),subscribe:r(e=>()=>{},"subscribe"),actions:{ping:r(()=>({ok:true,startedAt:Bi,devServerOrigin:Ai}),"ping"),reloadApp:r(e=>{let t=e??{},{strategy:o,delayMs:i}=nl({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:i}},"reloadApp")}};import{Fragment as rl,jsx as Fe,jsxs as al}from"react/jsx-runtime";var sl=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],ll=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Mi(e){let t=Dt(()=>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(Ri,{...e,modules:t,query:o}):Fe(ho,{...e,modules:t})}r(Mi,"BrowserToolRuntime");function Ri(e){let t=e.query.useReactQuerySyncAdapter();return Fe(ho,{...e,queryAdapter:t})}r(Ri,"QueryRuntime");function ho({modules:e,apps:t,requiredEnvVars:o,externalSync:i,headless:n,sentryGetClient:a,queryAdapter:s}){let{isPro:u,tier:c}=Hs(),p=Dt(()=>{let B={app:Di};for(let[E,A]of Object.entries(e))for(let[k,S]of Object.entries(A))k.endsWith("SyncAdapter")&&S&&typeof S=="object"&&(B[E]=S);s&&(B.query=s),e.env?.createEnvSyncAdapter&&(B.env=e.env.createEnvSyncAdapter(o??[]));for(let E of t??[])E.sync&&(B[`custom:${E.id}`]=E.sync);return B},[e,t,o,s]),g=$s(p);g.current=p,At(()=>Ws(()=>g.current),[]),At(()=>{let B=[],E=r(A=>{let k=A?.();typeof k=="function"&&B.push(k)},"start");return E(e.network?.startNetworkCapture),E(e.storage?.startBrowserStorageCapture),E(e.assets?.startBrowserAssetCapture),E(e.three?.startThreeCapture),ri(typeof We<"u"?We:process.env.NODE_ENV!=="production")&&E(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&E(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&E(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let A of B.reverse())A()}},[e]);let C=e["external-sync"],f=ri(typeof We<"u"?We:process.env.NODE_ENV!=="production"),D=ai({isDevelopment:f,isLicensed:u,externalSync:i,isAvailable:!!C}),x=co(i);Ns({release:!f&&!!x?.enableInRelease}),!f&&x?.enableInRelease&&yo(uo(x.socketURL,x));let M=e.sentry?.SentryRoot;return al(rl,{children:[Object.entries(e).flatMap(([B,E])=>sl.map(A=>{let k=E[A];return k?Fe(k,{},`${B}:${A}`):null})),M&&Fe(M,{getClient:a}),Object.entries(e).flatMap(([B,E])=>ll.map(A=>{let k=E[A];return k&&(!n||A==="ScenariosOverlay"||A==="ImpersonateOverlay")?Fe(k,{},`${B}:${A}`):null})),D&&Fe(Oi,{module:C,tools:p,options:x,isPro:u,tier:c,dev:f})]})}r(ho,"ToolRuntime");var Ei=null;function yo(e){!e||e===Ei||(Ei=e,console.warn("[Buoy]",e))}r(yo,"warnOnce");function Oi({module:e,tools:t,options:o,isPro:i,tier:n,dev:a}){let s=Ti(),u=yi(o,{appName:s.appName,hardwareName:s.hardwareName,platform:s.platform}),c=Dt(()=>ki(o?.socketURL??(a?e.getDefaultSocketURL():si),!!o?.socketURL,s.platform),[o?.socketURL,a,e,s.platform]),{socket:p}=e.useExternalSyncSocket({deviceName:u?.deviceName??"Buoy Browser",socketURL:c,persistentDeviceId:s.ready?u?.deviceId??null:null,platform:s.platform,extraDeviceInfo:s.extraDeviceInfo,enableLogs:o?.enableLogs});At(()=>{let f=zi(c,s.platform);if(!p||!f)return;let D=r(()=>yo(f),"onError");return p.on("connect_error",D),()=>{p.off("connect_error",D)}},[p,c,s.platform]),At(()=>{if(!p)return;let f=r(()=>{p.connected&&js.hasAccountAccess()&&p.emit("device-license",{isPro:i?"1":"0",tier:n})},"emit");return f(),p.on("connect",f),()=>{p.off("connect",f)}},[p,i,n]);let g=o?.releaseActions?.join(",")??"",C=Dt(()=>ci(t,a,g?g.split(","):void 0),[t,a,g]);return e.useExternalSync({tools:C,socket:p,deviceId:s.ready?u?.deviceId??null:null,enableLogs:o?.enableLogs}),null}r(Oi,"BrowserExternalSync");import{useState as Pi}from"react";import{BuoyPortal as cl}from"@buoy-gg/shared-ui/web/floating";import{useBuoySession as dl}from"@buoy-gg/license/web";import{Fragment as Li,jsx as Je,jsxs as Fi}from"react/jsx-runtime";var $i="#20C997";function ji(){let{status:e,signIn:t,signOut:o}=dl(),[i,n]=Pi(false),[a,s]=Pi(null);if(typeof document>"u")return null;let u=r(()=>{s(null),n(true),t().catch(p=>s(p instanceof Error?p.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},"start"),c=e.state==="active";return Je(cl,{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:c||a?"12px 14px":0,borderRadius:16,background:c||a?"#0f1419":"transparent",color:"#e6edf3",boxShadow:c||a?"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:c?Fi(Li,{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:ul,"data-testid":"buoy-signout",children:"Sign out"})]}):Fi(Li,{children:[a?Je("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:a}):null,Je("button",{type:"button",onClick:u,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(ji,"BuoySignIn");var ul={marginTop:8,padding:0,border:"none",background:"none",color:$i,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as pl}from"react";import{AccountSetupButton as ml,BuoyNeedsPlanCard as gl,BuoySignInCard as fl,useSignInState as hl}from"@buoy-gg/shared-ui/web";import{jsx as st,jsxs as Ni}from"react/jsx-runtime";function bo({needsPlan:e=false}){let[t,o]=pl(false),i=hl();return Ni(H,{pointerEvents:"box-none",style:Hi.root,children:[st(ml,{expanded:t,onPress:()=>o(true)}),t?st(nr,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:Ni(H,{style:Hi.overlay,accessibilityViewIsModal:true,children:[st(or,{style:dt.absoluteFill,onPress:()=>o(false),accessible:false}),e&&i==="active"?st(gl,{onClose:()=>o(false)}):st(fl,{onClose:()=>o(false)})]})}):null]})}r(bo,"BuoySignIn");var Hi=dt.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 vo(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}r(vo,"validateDialConfig");import{installedTools as yl,installedToolsFound as bl}from"@buoy-gg/core/web/installed-tools";import{Fragment as So,jsx as L,jsxs as lt}from"react/jsx-runtime";var Wi={},_i="@react_buoy_floating_menu_tooltip_shown",vl=Ee;function Ui({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),i=Math.max(1,e/16);return L("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,a)=>L("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},a))})}r(Ui,"MenuLauncherIcon");function Ki(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:i=false,children:n}=e,a=fe(()=>o&&vo(o),[o]);return L(Vt,{defaultFloatingTools:t,defaultDialTools:a,children:L(yr,{disableHints:i,children:lt(so,{children:[L($n,{children:L(Yi,{...e})}),n]})})})}r(Ki,"AdmittedFloatingDevTools");var Sl=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function Vi({modules:e=Wi}){return L(So,{children:Object.entries(e).flatMap(([t,o])=>Sl.map(i=>{let n=o[i];return n?L(n,{},`${t}:${i}`):null}))})}r(Vi,"StartupCapture");function qi(){let{openApps:e,restore:t}=rt();return te(()=>vr(o=>{let i=e.find(n=>n.id===o);return i?(t(i.instanceId),true):false}),[e,t]),null}r(qi,"WebToolOpenerBridge");function Gi(){let e=mr();return br((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}r(Gi,"defaultEnvironment");function Ji(e,t,o,i){let n=r(g=>Object.entries(e).find(([C])=>C.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===g)?.[1],"find"),a=[],s=n("env");t?.length&&s?.createEnvTool&&s.createEnvVarConfig&&a.push(Ge(s.createEnvTool({requiredEnvVars:s.createEnvVarConfig(t)})));let u=n("storage");o?.length&&u?.createStorageTool&&a.push(Ge(u.createStorageTool({requiredStorageKeys:o})));let c=n("ask-buoy"),p=i==="hosted"?c?.hostedAskBuoy?.():i;return p&&c?.createAskBuoyTool&&a.push(Ge(c.createAskBuoyTool(p))),a}r(Ji,"configOverrides");function Yi({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:i,apps:n,modules:a=Wi,externalSync:s,requiredEnvVars:u,sentryGetClient:c,disableHints:p=false,headless:g=false,hidden:C=false,defaultFloatingTools:f,defaultDialTools:D,zustandStores:x,requiredStorageKeys:M,askBuoy:B}){let E=e??Gi(),A=fe(()=>D?vo(D):void 0,[D]),[k,S]=Et(false),[I,F]=Et(false),z=wr(false),R=rt(),ee=fe(()=>Ji(a,u,M,B),[a,u,M,B]),_=fe(()=>Ot([...lo(a),...n??[],...ee]),[n,a,ee]),G=fe(()=>Object.entries(a).find(([d])=>d.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[a]);te(()=>{if(!x||typeof G?.watchStores!="function")return;let d=G.watchStores(x);return typeof d=="function"?d:void 0},[x,G]);let oe=Bt(),V=R.openApps.some(d=>!d.minimized);te(()=>{oe.setDialOpen(k)},[k,oe.setDialOpen]),te(()=>{oe.setToolOpen(V||I)},[V,I,oe.setToolOpen]);let{registerApps:ae}=R;te(()=>{ae(_.map(d=>{let W=d.icon;return{...d,icon:typeof W=="function"?({size:v})=>W(v):W}}))},[ae,_]);let ne=fe(()=>_.map(d=>({id:d.id,name:d.name,description:d.description,slot:d.slot})),[_]);xr({availableTools:ne,storage:vl}),te(()=>{let d=false;return r(async()=>{let[W,v]=await Promise.all([Ee.getItem(pt.dial.isOpen()),Ee.getItem(pt.settings.modalOpen())]);d||(W==="true"&&S(true),v==="true"&&(S(true),F(true)),z.current=true)},"restore")(),()=>{d=true}},[]),te(()=>{z.current&&Ee.setItem(pt.dial.isOpen(),k?"true":"false")},[k]),te(()=>{z.current&&Ee.setItem(pt.settings.modalOpen(),I?"true":"false")},[I]);let Se=_e(d=>{if(nn(d.id),d.launchMode==="toggle-only"){d.onPress?.();return}if(d.component){let W=typeof d.icon=="function"?d.icon(20):d.icon;R.open({id:d.id,title:d.name||ut(d.id),component:d.component,props:d.props,modal:d.modal,launchMode:d.launchMode||"self-modal",singleton:d.singleton??true,icon:W,color:d.color||Co(d.id)})}else d.onPress?.()},[R]),se=fe(()=>mt(_,"dial").map(d=>{let W=d.color||Co(d.id),v;return typeof d.icon=="string"?v=d.icon:typeof d.icon=="function"?v=d.icon(32):v=null,{id:d.id,name:d.name||ut(d.id),icon:v,unavailable:!d.component&&!d.onPress,color:W,onPress:r(()=>{Se(d),S(false)},"onPress")}}),[_,Se]),ke=fe(()=>{if(!k)return se;let d=new Map(se.map(W=>[W.id,W]));return on(se.map(W=>W.id)).map(W=>d.get(W)).filter(W=>!!W)},[k,se]),{settings:j}=Sn(),Ye=fe(()=>mt(_,"row").filter(d=>(j.floatingTools[d.id]??false)===true&&(d.component||d.onPress)),[_,j.floatingTools]),ze=fe(()=>_.map(d=>({id:d.id,name:d.name||ut(d.id),description:d.description||Tr(d.id),slot:d.slot,icon:d.icon,color:d.color})),[_]),[$e,Be]=Et(false),le=R.openApps.some(d=>!d.minimized);te(()=>{if(p)return;let d=false,W=setTimeout(async()=>{let v=await Ee.getItem(_i);!d&&!v&&Be(true)},1e3);return()=>{d=true,clearTimeout(W)}},[p]);let Y=_e(()=>{Be(false),Ee.setItem(_i,"true")},[]),we=_e(()=>{Y(),S(true)},[Y]),me=_e(()=>{S(false),F(false)},[]),Ae=_e(()=>{F(d=>!d)},[]),je=_e(()=>F(false),[]),ye=!!(o?.length&&i),De=j.floatingTools.environment!==false,pe=$e&&!k&&!le&&!C;te(()=>{if(!pe)return;let d=r(v=>{(!(v.target instanceof Element)||!v.target.closest("[data-buoy-root]"))&&Y()},"onPointerDown"),W=r(v=>{v.key==="Escape"&&Y()},"onKeyDown");return document.addEventListener("pointerdown",d,true),document.addEventListener("keydown",W),()=>{document.removeEventListener("pointerdown",d,true),document.removeEventListener("keydown",W)}},[pe,Y]);let be=R.openApps.some(d=>d.minimized&&d.launchMode!=="toggle-only"),Me=L(Mi,{modules:a,apps:n,requiredEnvVars:u,externalSync:s,headless:g,sentryGetClient:c});return g?Me:lt("div",{"data-buoy-root":"",style:{display:"contents"},children:[Me,L(qi,{}),pe&&L("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),L("div",{style:C?{visibility:"hidden"}:{display:"contents"},"aria-hidden":C||void 0,children:lt(zo,{enablePositionPersistence:!pe,pushToSide:k||le,suspendPointerEvents:k,centerOnboarding:pe,minimizedStack:be?L(ti,{}):void 0,hasMinimizedStack:be,children:[E&&De&&!ye&&L(Cr,{environment:E}),ye&&De&&L(Ir,{currentEnvironment:E??"local",availableEnvironments:o,onSelect:i}),t?L(Bo,{userRole:t,onPress:we}):L("button",{"aria-label":"Open dev tools",onClick:we,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:L(Ui,{})}),Ye.map(d=>L("button",{"aria-label":d.name||ut(d.id),title:d.description,onClick:()=>Se(d),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof d.icon=="function"?d.icon(16):d.icon},d.id))]})}),pe&&L(Lt,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:Y}),k&&!C&&L(Nt,{icons:ke,onClose:me,centerLabel:"BUOY",onCenterPress:Ae,settingsOpen:I,hintsDisabled:p}),I&&!C&&L(Xt,{visible:true,onClose:je,availableTools:ze,defaultFloatingTools:f,defaultDialTools:A,onSettingsChange:d=>{}}),!C&&lt(So,{children:[L(jn,{}),L(sr,{})]})]})}r(Yi,"FloatingDevToolsInner");function Xi(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;te(()=>{if(!o)return;let i=false,n=lr.SessionManager;if(!n)return;let a=r(s=>{i||!s||(n.configure({audience:`app:${s}`}),n.load().catch(()=>{}))},"apply");return t?a(t):fr().then(s=>a(s?.bundleId)).catch(()=>{}),()=>{i=true}},[o,t])}r(Xi,"useCapacitorSignInAudience");var Qi=false;function Zi(e){return e.modules?e:(!bl&&!Qi&&typeof console<"u"&&(Qi=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:yl})}r(Zi,"withInstalledTools");function er(e){return L(ar,{children:L(tr,{...Zi(e)})})}r(er,"FloatingDevTools");function tr(e){let{access:t,isPro:o,licenseKey:i}=dr();te(()=>{cr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||ur(e.licenseKey,i),a=pr(typeof We<"u"?We:process.env.NODE_ENV!=="production"),s=n&&t.status==="admitted";te(()=>{s&&Sr()},[s]),te(()=>{a||t.status==="initializing"||(o&&s?ir():rr())},[a,o,s,t.status]);let u=gr();return Xi(u?e.signIn:void 0),!a&&!o?!e.signIn||e.headless?null:u?L(bo,{needsPlan:true}):L(ji,{}):s?L(Ki,{...e}):lt(So,{children:[t.status==="initializing"&&L(Vi,{modules:e.modules}),e.headless?null:e.signIn&&u?L(bo,{}):L(hr,{})]})}r(tr,"FloatingDevToolsContent");export{kr as a,Io as b,Ot as c,mt as d,ko as e,zo as f,zr as g,Bo as h,Nt as i,Xt as j,Zt as k,An as l,En as m,$n as n,rt as o,jn as p,Ge as q,so as r,Bt as s,lo as t,Di as u,er as v};
10
+ `,document.head.appendChild(e),qo=true}r(Go,"injectOnboardingKeyframes");var Pt=Ue.accent;function Lt({title:e,message:t,onDismiss:o,showArrow:i=true}){let[n,a]=_o(false),[s,u]=_o(false);Qr(()=>{Go();let p=requestAnimationFrame(()=>a(true));return()=>cancelAnimationFrame(p)},[]);let c={fontFamily:Ko,textTransform:"uppercase"};return Ke("div",{style:{position:"fixed",left:"50%",bottom:ta(),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:Vo("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ke("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Vo("div",{style:{position:"relative",maxWidth:280,backgroundColor:Ue.dialBackground,borderRadius:16,border:`1px solid ${Ue.dialBorder}`,padding:20,boxShadow:`0 0 20px ${Uo(Ue.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ke("span",{style:{...c,fontSize:16,fontWeight:900,letterSpacing:1,color:Pt,textAlign:"center"},children:e}),Ke("span",{style:{fontFamily:Ko,fontSize:13,lineHeight:"20px",color:Ue.centerText,textAlign:"center"},children:t}),Ke("button",{onClick:o,onPointerDown:()=>u(true),onPointerUp:()=>u(false),onPointerLeave:()=>u(false),onPointerCancel:()=>u(false),style:{...c,marginTop:8,borderRadius:8,border:"none",backgroundColor:Pt,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:s?.7:1,transform:s?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ke("div",{style:{position:"absolute",left:"50%",bottom:Zr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${ea}px solid ${Pt}`,filter:`drop-shadow(0 0 10px ${Uo(Ue.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}r(Lt,"OnboardingTooltip");import{Fragment as oa,jsx as P,jsxs as ve}from"react/jsx-runtime";var na={x:.5,y:.5},Jo="@react_buoy_settings_tooltip_shown",Yo=false;function Xo(){if(Yo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Pr(),document.head.appendChild(e),Yo=true}r(Xo,"injectKeyframes");var Ve=r(e=>1-Math.pow(1-e,3),"easeOutCubic"),Ft=r(e=>e*e*e,"easeInCubic");function Qo({icon:e,index:t,totalIcons:o,position:i,progress:n,onPress:a}){let[s,u]=Z(false),[c,p]=Z(false),g=!e.icon&&e.id.startsWith("empty-"),I=!g&&e.unavailable===true,f=!g&&!I,{icons:k}=Ro,x=Or(t,o),R=0;n<=x[1]?R=0:n<=x[2]?R=(n-x[1])/(x[2]-x[1]):R=1,R=Math.max(0,Math.min(1,R));let B=Er,O=k.pressIn.scale,D=R*(c?O:s?1.1:1),z=0;R<=0?z=0:R<=.3?z=R:z=.3+(R-.3)*(.7/.7);let S=i.x*R,C=i.y*R;return P("button",{role:"menuitem","aria-label":g?"Empty slot":Do(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!f,tabIndex:f?0:-1,onClick:f?a:void 0,onPointerEnter:F=>f&&F.pointerType==="mouse"&&u(true),onPointerLeave:()=>{u(false),p(false)},onPointerDown:()=>f&&p(true),onPointerUp:()=>p(false),onPointerCancel:()=>p(false),style:{position:"absolute",left:"50%",top:"50%",width:B,height:B,marginLeft:-B/2,marginTop:-B/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:f?"pointer":"default",transform:`translate(${S}px, ${C}px) scale(${D})`,opacity:z,transition:s||c?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:g?P("div",{style:{width:w.emptySlot.dotSize,height:w.emptySlot.dotSize,borderRadius:w.emptySlot.dotSize/2,backgroundColor:$.emptyDotBackground,border:`${w.emptySlot.borderWidth}px solid ${$.emptyDotBorder}`}}):ve(oa,{children:[P("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}}),P("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}}),P("div",{style:{marginBottom:w.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:s?"brightness(1.2)":"none"},children:e.icon}),P("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:$.iconLabel,letterSpacing:w.icon.label.letterSpacing,marginTop:w.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&P("span",{style:{fontSize:w.icon.label.fontSize-1,fontWeight:w.icon.label.fontWeight,fontFamily:w.icon.label.fontFamily,letterSpacing:w.icon.label.letterSpacing,color:Fr.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}r(Qo,"DialIconItem");function $t({side:e,color:t}){return P("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,a],s)=>P("line",{x1:o,y1:i,x2:n,y2:a,stroke:t,strokeWidth:2},s))})}r($t,"PagerChevron");function jt({side:e,disabled:t,onClick:o}){let[i,n]=Z(false),a=t?$.emptyDotBorder:$.accent;return ve("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 ${$.dialBorder}`,backgroundColor:$.dialBackground,color:t?$.iconLabelMuted:$.centerText,fontSize:12,fontWeight:900,fontFamily:Eo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${Mo($.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&P($t,{side:"prev",color:a}),e==="prev"?"PREV":"NEXT",e==="next"&&P($t,{side:"next",color:a})]})}r(jt,"PagerButton");function Nt({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:i,settingsOpen:n=false,hintsDisabled:a=false}){let{id:s}=jr(),[u,c]=Z(0),[p,g]=Z(0),[I,f]=Z(0),[k,x]=Z(0),[R,B]=Z(0),[O,D]=Z(1),[z,S]=Z(false),[C,F]=Z(false),[A,M]=Z(false),ee=ft(null),_=ft(null),G=ft(null),oe=ft(false),{entrance:V,exit:ae,interaction:ne}=Ro,Se=Lr(),[se,ze]=Z(()=>({width:window.innerWidth,height:window.innerHeight}));Ee(()=>{let v=r(()=>ze({width:window.innerWidth,height:window.innerHeight}),"resize");return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);let j=gt(()=>Dr({screenWidth:se.width,maxCircleSize:Math.max(120,Math.min(320,se.height-96))}),[se]),Ye=gt(()=>Mr(),[]),ke=gt(()=>Rr(Xe,j.iconRadius),[j.iconRadius]),[$e,Ae]=Z(0),le=Math.max(1,Math.ceil(e.length/Xe)),Y=Math.min($e,le-1),we=gt(()=>{let v=Y*Xe,T=[...e.slice(v,v+Xe)];for(;T.length<Xe;)T.push({id:`empty-${T.length}`,name:"",icon:null,onPress:r(()=>{},"onPress")});return T},[e,Y]);Ee(()=>{Xo()},[]),Ee(()=>{let v=V.backdrop.duration,T=V.dial.rotation.duration,X=V.centerButton.delay,K=V.icons.delay,J=V.icons.duration,q=performance.now(),ie=r(ge=>{let l=ge-q;c(Math.min(1,l/v));let h=Math.min(1,l/400),E=Ve(h)*1.1;h>.7&&(E-=(h-.7)*.33),h>=1&&(E=1),g(Math.max(0,Math.min(1.05,E)));let Q=Math.min(1,l/T);if(f(Ve(Q)*360),l>=X){let Te=Math.min(1,(l-X)/300),Ne=Ve(Te)*1.15;Te>.6&&(Ne-=(Te-.6)*.375),Te>=1&&(Ne=1),x(Math.max(0,Math.min(1.05,Ne)))}if(l>=K){let Te=Math.min(1,(l-K)/J);B(Ve(Te))}let xe=K+J;l<xe?G.current=requestAnimationFrame(ie):(c(1),g(1),f(360),x(1),B(1),M(true))},"animate");return G.current=requestAnimationFrame(ie),()=>{G.current&&cancelAnimationFrame(G.current)}},[]);let me=ht(()=>{if(oe.current)return;oe.current=true,F(true),G.current&&cancelAnimationFrame(G.current);let v=performance.now(),T=ae.icons.duration,X=ae.centerButton.duration,K=ae.dialScale.duration,J=Math.max(X,K),q=ae.backdrop.duration,ie=r(ge=>{let l=ge-v;if(l<T){let Q=Ft(l/T);B(1-Q),G.current=requestAnimationFrame(ie);return}let h=T;if(l<h+J){B(0);let Q=Math.min(1,(l-h)/X),xe=Math.min(1,(l-h)/K);x(1-Ft(Q)),g(1-Ft(xe)),G.current=requestAnimationFrame(ie);return}let E=h+J;if(l<E+q){g(0),x(0);let Q=(l-E)/q;c(1-Q),G.current=requestAnimationFrame(ie);return}c(0),t()},"animate");G.current=requestAnimationFrame(ie)},[ae,t]);Ee(()=>{let v=document.activeElement,T=ee.current;return()=>{v?.isConnected&&(document.activeElement===document.body||T?.contains(document.activeElement))&&v.focus()}},[]),Ee(()=>{if(n)return;_.current?.focus();let v=r(T=>{let X=ee.current;if(X){if(T.key==="Escape")T.preventDefault(),me();else if(T.key==="Tab"){let K=Array.from(X.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(ie=>ie.getClientRects().length>0),J=K[0],q=K[K.length-1];(!X.contains(document.activeElement)||(T.shiftKey?document.activeElement===J:document.activeElement===q))&&(T.preventDefault(),(T.shiftKey?q:J)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(T.key)){let K=Array.from(X.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),J=K.indexOf(document.activeElement);if(J<0||!K.length)return;T.preventDefault();let q=T.key==="Home"?0:T.key==="End"?K.length-1:(J+(T.key==="ArrowRight"||T.key==="ArrowDown"?1:-1)+K.length)%K.length;K[q].focus()}}},"handleKeyDown");return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[me,n]);let[Be,je]=Z(false);Ee(()=>{if(a)return;let v=false,T=setTimeout(async()=>{let X=await Oo.getItem(Jo);!v&&!X&&je(true)},1200);return()=>{v=true,clearTimeout(T)}},[a]);let ye=ht(()=>{je(false),Oo.setItem(Jo,"true")},[]);Ee(()=>{n&&Be&&ye()},[n,Be,ye]);let De=ht(v=>{if(v.id.startsWith("empty-")||oe.current)return;let[T,X]=ne.iconSelect.pulse,K=performance.now(),J=150,q=r(ie=>{let ge=ie-K;if(ge<J){let l=Ve(ge/J);D(1-(1-T.scale)*l),requestAnimationFrame(q)}else if(ge<J*2){let l=Ve((ge-J)/J);D(T.scale+(X.scale-T.scale)*l),requestAnimationFrame(q)}else D(1)},"animatePulse");requestAnimationFrame(q),setTimeout(()=>{v.onPress(),me()},ne.iconSelect.actionDelay)},[ne.iconSelect,me]),pe=ht(v=>{if(oe.current)return;let T=Math.max(0,Math.min(v,le-1));T!==Y&&Ae(T)},[le,Y]),be=j.buttonSize*w.centerButton.containerRatio,Re=j.buttonSize*w.centerButton.borderRatio,d=j.buttonSize*w.centerButton.containerRatio/2+6,W=A&&!C;return ve("div",{ref:ee,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[P("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:me,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:$.dialBackdrop,opacity:u}}),ve("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,bottom:80,width:j.circleSize,height:j.circleSize,borderRadius:"50%",backgroundColor:$.dialBackground,border:`${w.circle.borderWidth}px solid ${$.dialBorder}`,boxShadow:`0 0 ${w.circle.shadowRadius}px ${Mo($.dialShadow,w.circle.shadowOpacity)}`,transform:`scale(${p}) rotate(${I}deg)`,opacity:p>.01?1:0,overflow:"hidden"},children:[P("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:$.dialGradient1,opacity:w.gradientLayers[0].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:$.dialGradient2,opacity:w.gradientLayers[1].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:$.dialGradient3,opacity:w.gradientLayers[2].opacity}}),Ye.map(v=>P("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:w.grid.lineHeight,transform:`rotate(${v}deg)`,transformOrigin:"center"},children:["left","right"].map(T=>P("div",{style:{position:"absolute",top:0,[T]:0,width:`calc(50% - ${d}px)`,height:w.grid.lineHeight,backgroundColor:$.dialGridLine}},T))},v)),P("div",{"data-testid":"dial-background","data-background":s,style:{position:"absolute",inset:0,pointerEvents:"none"},children:s==="hyperspace"?P(Xr,{size:j.circleSize}):P($r,{focus:na})}),we.map((v,T)=>P(Qo,{icon:v,index:T,totalIcons:we.length,position:ke[T],progress:R,onPress:()=>De(v)},T)),ve("div",{style:{position:"absolute",left:"50%",top:"50%",width:be,height:be,marginLeft:-be/2,marginTop:-be/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:$.hubHalo,borderRadius:j.buttonSize,overflow:"hidden",transform:`scale(${k*O})`,opacity:k>.01?1:0},children:[P("div",{style:{position:"absolute",inset:0,backgroundColor:$.dialGradient1,opacity:.5,borderRadius:j.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:$.dialGradient2,opacity:.3,borderRadius:j.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:$.dialGradient3,opacity:.2,borderRadius:j.buttonSize}}),P("div",{style:{width:Re,height:Re,borderRadius:j.buttonSize*w.centerButton.borderRadiusRatio,backgroundColor:$.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:P("button",{ref:_,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,onPointerEnter:v=>v.pointerType==="mouse"&&S(true),onPointerLeave:()=>S(false),style:{border:0,padding:0,background:"transparent",width:j.buttonSize,height:j.buttonSize,borderRadius:j.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default",transform:z?`scale(${ne.centerHover.scale})`:"scale(1)",transition:`transform ${ne.centerHover.duration}ms ease`,animation:W&&!z?Se.pulse:"none"},children:n?ve("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:$.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[P("span",{style:{marginBottom:-2},children:"CLOSE"}),P("span",{style:{marginTop:-2},children:"SETTINGS"})]}):P("span",{style:{fontSize:w.centerButton.text.fontSize,fontWeight:w.centerButton.text.fontWeight,fontFamily:w.centerButton.text.fontFamily,color:$.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),le>1&&ve("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,top:"calc(100% - 64px)",width:j.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,p),transform:`scale(${Math.min(1,p)})`},children:[P(jt,{side:"prev",disabled:Y<=0,onClick:()=>pe(Y-1)}),ve("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Eo,letterSpacing:2,color:$.centerText,textShadow:`0 0 6px ${$.centerTextGlow}`},children:[String(Y+1).padStart(2,"0"),ve("span",{style:{color:$.iconLabelMuted,textShadow:"none"},children:[" / ",String(le).padStart(2,"0")]})]}),P(jt,{side:"next",disabled:Y>=le-1,onClick:()=>pe(Y+1)})]}),Be&&!n&&P(Lt,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:ye,showArrow:false})]})}r(Nt,"DialMenu");import{persistentStorage as Zo,devToolsStorageKeys as ia}from"@buoy-gg/shared-ui/web";import{recordUsage as ra,pruneUsage as aa}from"@buoy-gg/floating-tools-core/web";var en=ia.dial.usage(),qe={},tn=false,Ht=null;function Wt(){return Ht||(Ht=(async()=>{try{let e=await Zo.getItem(en);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(qe=t)}}catch{}finally{tn=true}})(),Ht)}r(Wt,"loadDialUsage");Wt();function on(e){return e.map((t,o)=>({id:t,index:o,lastUsed:qe[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}r(on,"getRankedToolIds");async function nn(e){if(!e)return;tn||await Wt();let t=Math.max(Date.now(),...Object.values(qe).map(o=>o.lastUsed+1));qe=aa(ra(qe,e,t),t);try{await Zo.setItem(en,JSON.stringify(qe))}catch{}}r(nn,"recordToolUsage");import{useCallback as sa,useMemo as rn}from"react";import{persistentStorage as la}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Ie,useCallback as bt,useMemo as vt}from"react";import{settingsEventBus as St}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as ca}from"react";import{getRegisteredToolModule as da}from"@buoy-gg/shared-ui/web";var ua=r(()=>()=>{},"noopSubscribe"),pa=r(()=>null,"serverSnapshot");function an(){let e=da("@buoy-gg/external-sync");return ca(e?.subscribeSyncStatus??ua,()=>e?.getSyncStatus?.()??null,pa)}r(an,"useDesktopSyncStatus");import{SentryIcon as ma,WifiCircuitIcon as ga,ImageOverlayIcon as fa,RenderCountIcon as ha,Info as _t,Layers as ya,ChevronRightIcon as sn,ChevronDown as ln,getStorageBackendType as ba,getUseLicense as va,signOutOfBuoy as Sa,persistentStorage as Pe,Trash2 as wa,CheckCircle2 as cn,BuoyUpgradeSheet as xa,BackgroundSwitcher as Ta,night as y,NightCard as Le,NightRows as Ut,NightSectionLabel as Ia,NightFootnote as dn,NightSwitch as un,NightButton as Kt,NightSegmented as Ca,NightBadge as he,NightSeparator as za,monoFont as pn}from"@buoy-gg/shared-ui/web";import{EnvIcon as mn,StorageIcon as ka,RoutesIcon as Aa,NetworkIcon as Ba,QueryIcon as Da,HighlighterIcon as Ra,ReduxIcon as Ma,EventsIcon as Oa}from"@buoy-gg/floating-tools-core/web";import Ea,{createContext as Pa,useContext as La}from"react";import{jsx as Fa}from"react/jsx-runtime";var gn=Pa({});function Vt({children:e,defaultFloatingTools:t,defaultDialTools:o}){let i=Ea.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return Fa(gn.Provider,{value:i,children:e})}r(Vt,"DefaultConfigProvider");function qt(){return La(gn)}r(qt,"useDefaultConfig");import $a from"react";import{toolTheme as ja}from"@buoy-gg/shared-ui/web";import{jsx as fn}from"react/jsx-runtime";function hn({label:e,size:t,color:o=ja.colors.text}){let i=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=i<=2?t:t*1.6,a=Math.max(7,Math.min(t*(i===1?.7:.62),n/(.62*i)));return fn("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:a,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}r(hn,"AppTextIcon");function Gt(e,t){return e==null?e:typeof e=="function"?$a.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?fn(hn,{label:String(e),size:t.size,color:t.color}):e}r(Gt,"renderAppIcon");import{JsModal as Na,devToolsStorageKeys as Jt,onSettingsApplied as Ha,expandableWindowControlsSupported as Wa}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as _a}from"@buoy-gg/shared-ui/web";import{Fragment as Ze,jsx as m,jsxs as N}from"react/jsx-runtime";var et="@react_buoy_dev_tools_settings",Ua=6,wt=r(e=>{let t=Ua,o={};for(let[i,n]of Object.entries(e))n&&t>0?(o[i]=true,t-=1):o[i]=false;return o},"enforceDialLimit"),Ka=r((e,t)=>{let{userStatus:o,environment:i,...n}=e,a=t?Object.entries(n).filter(([s])=>t.includes(s)):Object.entries(n);return{...Object.fromEntries(a),environment:i??false}},"sanitizeFloating"),yn=r((e,t,o)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(i).filter(([a])=>o.allowedDialKeys?.includes(a)):Object.entries(i);return{dialTools:wt(Object.fromEntries(n)),floatingTools:Ka({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},"mergeWithDefaults"),Va=r((e=[],t,o)=>{let i={},n={},a=new Set(t??[]),s=new Set(o??[]),u=!o||o.length===0;for(let c of e){let{id:p,slot:g="both"}=c;(g==="dial"||g==="both")&&(i[p]=u?true:s.has(p)),(g==="row"||g==="both")&&(n[p]=a.has(p))}return{dialTools:wt(i),floatingTools:{...n,environment:a.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},"generateDefaultSettings"),qa=r(({visible:e,onClose:t,onSettingsChange:o,initialSettings:i,availableApps:n=[],storage:a=Pe,zIndex:s})=>{let{defaultFloatingTools:u,defaultDialTools:c}=qt(),p=vt(()=>Va(n,u,c),[n,u,c]),g=vt(()=>Object.keys(p.dialTools),[p]),I=vt(()=>Object.keys(p.floatingTools).filter(l=>l!=="environment"),[p]),[f,k]=re(i||tt||p),[x,R]=re(Yt??"floating"),[B,O]=re(Yt!==null),[D,z]=re(new Set),[S,C]=re(false),[F,A]=re(false);Ie(()=>{let l=requestAnimationFrame(()=>A(true));return()=>cancelAnimationFrame(l)},[]);let M=an();Ie(()=>{r(async()=>{try{let l=await Pe.getItem(Jt.settings.activeTab());if(l&&["floating","settings","pro"].includes(l)){let h=l;Yt=h,R(E=>E===h?E:h)}}catch{}finally{O(true)}},"loadActiveTab")()},[]),Ie(()=>{B&&Pe.setItem(Jt.settings.activeTab(),x).catch(l=>{console.warn("[Buoy]","Failed to save settings active tab:",l)})},[x,B]);let ee=va()?.(),_=ee?.isPro??false,G=!_&&ee?.licenseKey?ee.error:null,oe=ee?.errorKind==="transport",[V,ae]=re(bn),[ne,Se]=re(false),[se,ze]=re(false),[j,Ye]=re(false),[ke,$e]=re([]),[Ae,le]=re(false),Y=_a(),we=xo.get("window").height,me=xo.get("window").width,Be=Math.floor(we*.33),je=Math.min(me-32,400),ye=bt(async()=>{try{let l=await a.getItem(et);if(l){let h=JSON.parse(l),E=yn(p,h,{allowedDialKeys:g,allowedFloatingKeys:I});tt=E,k(Q=>vn(Q,E)?Q:E);return}tt=p,k(h=>vn(h,p)?h:p)}catch(l){console.error("[Buoy]","Failed to load dev tools settings:",l),k(p)}},[p,g,I,a]);Ie(()=>{ye()},[ye]),Ie(()=>{ba().then(l=>{bn=l,ae(h=>h===l?h:l)})},[]),Ie(()=>{j&&(le(true),Pe.getAllKeys().then(l=>{$e(l.sort())}).catch(()=>{$e([])}).finally(()=>{le(false)}))},[j]);let De=r(async l=>{try{let h={...l,dialTools:wt(l.dialTools)};await a.setItem(et,JSON.stringify(h)),tt=h,k(h),o?.(h),St.emit(h)}catch(h){console.error("[Buoy]","Failed to save dev tools settings:",h)}},"saveSettings"),pe=r(l=>{let h={...f,floatingTools:{...f.floatingTools,[l]:!f.floatingTools[l]}};De(h)},"toggleFloatingTool"),be=r(l=>{let h={...f,globalSettings:{...f.globalSettings,[l]:!f.globalSettings?.[l]}};De(h)},"toggleGlobalSetting"),Re=r(async()=>{Se(true),ze(false);try{await Pe.clear(),ze(true),k(p),a!==Pe&&await a.setItem(et,JSON.stringify(p)),o?.(p),St.emit(p),setTimeout(()=>ze(false),2e3)}catch(l){console.error("[Buoy]","Failed to clear storage:",l)}finally{Se(false)}},"handleClearStorage"),d=bt(l=>{},[]),W=r(l=>{let h=n.find(E=>E.id===l);return h?.description?h.description:l==="environment"?"Environment badge.":""},"getToolDescription"),v=r(l=>l==="environment"?"Env Badge":n.find(h=>h.id===l)?.name??l.toUpperCase().replace(/_/g," "),"getToolLabel"),T=r(l=>{if(!F)return null;switch(l){case"query":return m(Da,{size:18});case"env":return m(mn,{size:18});case"sentry":return m(ma,{size:18,color:"#9945FF"});case"storage":return m(ka,{size:18,bgColor:y.color.surface});case"wifi":case"query-wifi-toggle":return m(ga,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return m(Aa,{size:18,bgColor:y.color.surface});case"network":return m(Ba,{size:18});case"environment":return m(mn,{size:18});case"debug-borders":return m(ya,{size:18,color:y.color.accent});case"highlight-updates":return m(ha,{size:18,color:y.color.accent});case"highlight-updates-modal":return m(Ra,{size:18});case"redux":return m(Ma,{size:18});case"image-overlay":return m(fa,{size:18});case"events":return m(Oa,{size:18});case"zustand":try{let{ZustandIcon:h}=To("@buoy-gg/zustand/web");return m(h,{size:18})}catch{return m(_t,{size:18,color:y.color.textSecondary})}case"jotai":try{let{JotaiIcon:h}=To("@buoy-gg/jotai/web");return m(h,{size:18})}catch{return m(_t,{size:18,color:y.color.textSecondary})}default:{let h=n.find(E=>E.id===l);return h?.icon!=null?Gt(h.icon,{slot:"row",size:18,color:h.color}):m(_t,{size:18,color:y.color.textSecondary})}}},"getToolIcon"),X=r((l,h,E,Q)=>{let xe=W(l);return N(ct,{activeOpacity:E?1:.7,onPress:()=>!E&&Q(),accessibilityLabel:v(l),accessibilityRole:"button",style:[b.toolRow,E&&b.rowDisabled],children:[m(H,{style:b.toolIconSlot,children:T(l)}),N(H,{style:b.rowInfo,children:[N(U,{style:b.rowLabel,children:[v(l),E?" \xB7 max 6":""]}),xe?m(U,{style:b.rowCaption,numberOfLines:1,children:xe}):null]}),m(un,{value:h,disabled:E,onValueChange:()=>Q()})]},l)},"renderToolRow"),K=r(l=>{z(h=>{let E=new Set(h);return E.has(l)?E.delete(l):E.add(l),E})},"toggleSettingExpanded"),J=r((l,h,E,Q,xe)=>{let Te=f.globalSettings?.[l]??false,Ne=D.has(l);return N(H,{children:[N(ct,{activeOpacity:.7,onPress:()=>K(l),accessibilityLabel:h,style:b.settingRow,children:[N(H,{style:b.rowInfo,children:[m(U,{style:b.rowLabel,children:h}),m(U,{style:b.rowCaption,numberOfLines:Ne?0:1,children:E})]}),m(un,{value:Te,onValueChange:()=>be(l)})]}),Ne&&N(H,{style:b.settingRowBody,children:[m(U,{style:b.settingRowBodyText,children:Q}),m(U,{style:b.settingRowBodyHint,children:xe})]})]},l)},"renderGlobalSettingRow"),q=r((l,h,E)=>N(H,{children:[m(Ia,{children:l}),h,E]}),"renderSection"),ie=V==="filesystem"?m(he,{label:"File System",tone:"accent"}):V==="asyncstorage"?m(he,{label:"Async Storage",tone:"warning"}):V==="localstorage"?m(he,{label:"Local Storage",tone:"accent"}):V==="memory"?m(he,{label:"Memory",tone:"danger"}):m(he,{label:"Loading\u2026",tone:"neutral"}),ge=r(()=>N(H,{style:b.container,children:[N(wo,{style:b.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:b.scrollContainer,children:[x==="floating"&&m(Ze,{children:q("Floating Tools",m(Le,{glass:true,children:m(Ut,{children:Object.entries(f.floatingTools).map(([l,h])=>X(l,h,false,()=>pe(l)))})}),m(dn,{children:"Tools switched on here appear in the floating bubble row."}))}),x==="settings"&&N(Ze,{children:[q("Background",m(Le,{glass:true,padded:true,children:m(Ta,{embedded:true})})),q("Storage",N(Le,{glass:true,children:[N(ct,{activeOpacity:.7,onPress:()=>Ye(!j),accessibilityLabel:"Storage Type",style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Storage Type"})}),ie,j?m(ln,{size:16,color:y.color.textTertiary}):m(sn,{size:16,color:y.color.textTertiary})]}),j&&N(Ze,{children:[N(H,{style:b.settingRowBody,children:[m(U,{style:b.settingRowBodyText,children:V==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":V==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":V==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":V==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),V==="asyncstorage"&&m(U,{style:[b.settingRowBodyText,b.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),V==="memory"&&m(U,{style:[b.settingRowBodyText,b.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),m(za,{}),N(H,{style:b.storageExpanded,children:[N(H,{style:b.storageExpandedHeader,children:[m(U,{style:b.storageExpandedTitle,children:"SAVED SETTINGS"}),m(U,{style:b.storageExpandedCount,children:Ae?"\u2026":`${ke.length} keys`})]}),Ae?m(U,{style:b.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?m(U,{style:b.storageKeyEmpty,children:"No settings saved yet"}):m(wo,{style:b.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(l=>m(H,{style:b.storageKeyItem,children:m(U,{style:b.storageKeyText,numberOfLines:1,children:l.replace("@react_buoy_","")})},l))})]}),m(H,{style:b.cardButtonWrap,children:m(Kt,{label:se?"Cleared":ne?"Clearing\u2026":"Clear All Settings",variant:se?"secondary":"destructive",size:"md",disabled:ne,onPress:Re,icon:se?m(cn,{size:15,color:y.color.accent}):m(wa,{size:15,color:ne?y.color.textTertiary:y.color.danger})})})]})]})),M&&M.state!=="idle"&&q("Desktop Sync",N(Le,{glass:true,children:[N(ct,{activeOpacity:.7,onPress:()=>K("desktopSync"),accessibilityLabel:"Buoy Desktop",style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Buoy Desktop"})}),M.state==="connected"?m(he,{label:"Connected",tone:"accent"}):M.state==="connecting"?m(he,{label:"Connecting\u2026",tone:"neutral"}):m(he,{label:"Retrying",tone:"warning"}),D.has("desktopSync")?m(ln,{size:16,color:y.color.textTertiary}):m(sn,{size:16,color:y.color.textTertiary})]}),D.has("desktopSync")&&N(H,{style:b.settingRowBody,children:[N(U,{style:b.settingRowBodyText,children:[M.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",m(U,{style:b.footnoteMono,children:M.targetURL??"(unknown URL)"}),M.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),M.state==="retrying"&&M.lastError&&N(U,{style:[b.settingRowBodyText,b.bodyWarning],children:["Last error: ",M.lastError]})]})]})),q("Modal Behavior",m(Le,{glass:true,children:N(Ut,{children:[J("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."),Wa(He.OS==="web")?J("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]})}))]}),x==="pro"&&N(Ze,{children:[q("License",N(Le,{glass:true,children:[N(H,{style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"License Status"})}),m(H,{testID:"buoy-settings-license-status",accessibilityLabel:_?"License: Active":"License: Free",children:_?m(he,{label:"Active",tone:"accent"}):m(he,{label:"Free",tone:"neutral"})})]}),ee?.tierSource==="session"?N(H,{style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Signed in with Buoy"})}),m(Kt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void Sa(),testID:"buoy-settings-signout"})]}):null]}),m(dn,{children:_?"You have full access to all Buoy DevTools features.":G?oe?`Couldn't reach the license server (${G}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${G}.`:"Upgrade to Pro to unlock all features and support development."})),!_&&N(Ze,{children:[q("Pro Features",m(Le,{glass:true,children:m(Ut,{children:["Advanced Settings","Priority Support"].map(l=>N(H,{style:b.featureRow,children:[m(cn,{size:16,color:y.color.accent}),m(U,{style:b.rowLabel,children:l})]},l))})})),m(Kt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),m(xa,{visible:S,onClose:()=>C(false)})]}),"renderContent");return m(Na,{visible:e,onClose:t,zIndex:s,variant:"night",header:{showToggleButton:false,customContent:m(H,{style:b.headerRow,children:m(Ca,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:x,onChange:l=>R(l)})})},initialMode:"bottomSheet",onModeChange:d,persistenceKey:Jt.settings.root(),enablePersistence:true,maxHeight:we-Y.top,initialHeight:Be,initialFloatingPosition:{x:(me-je)/2,y:Y.top+20},enableGlitchEffects:true,children:ge()})},"DevToolsSettingsModal"),Ga={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Ja=r((e,t)=>{let o=new Set(e??[]),i=new Set(t??[]),n={};for(let s of i)n[s]=true;let a={environment:o.has("environment")};for(let s of o)s!=="environment"&&(a[s]=true);return{dialTools:wt(n),floatingTools:a,globalSettings:{enableSharedModalDimensions:false}}},"createDefaultsFromConfig"),tt=null,Yt=null,bn=null,vn=r((e,t)=>JSON.stringify(e)===JSON.stringify(t),"sameSettings");St.addListener(e=>{e&&(tt=e)});var Sn=r(()=>{let{defaultFloatingTools:e,defaultDialTools:t}=qt(),o=vt(()=>!e&&!t?Ga:Ja(e,t),[e,t]),[i,n]=re(o),a=bt(async()=>{try{let u=await Pe.getItem(et);if(u){let c=JSON.parse(u),p=yn(o,c);n(p);return}n(o)}catch(u){console.error("[Buoy]","Failed to load dev tools settings:",u),n(o)}},[o]);Ie(()=>Ha(u=>{u.includes(et)&&a()}),[a]),Ie(()=>{a();let u=St.addListener(c=>{try{c&&n(c)}catch{}});return()=>{u()}},[a]);let s=bt(()=>{a()},[a]);return{settings:i,refreshSettings:s}},"useDevToolsSettings"),b=dt.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:y.gutter,paddingRight:y.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:y.gutter,paddingTop:8,paddingBottom:24,gap:y.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:y.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:y.rowPadH,paddingVertical:y.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:y.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:y.color.text,fontSize:y.font.row,fontWeight:"500"},rowCaption:{color:y.color.textTertiary,fontSize:y.font.label},settingRowBody:{paddingHorizontal:y.rowPadH,paddingBottom:y.rowPadV,gap:6},settingRowBodyText:{color:y.color.textSecondary,fontSize:y.font.caption,lineHeight:y.font.caption*1.45},settingRowBodyHint:{color:y.color.textTertiary,fontSize:y.font.caption,lineHeight:y.font.caption*1.45},bodyWarning:{color:y.color.warning},bodyDanger:{color:y.color.danger},cardButtonWrap:{paddingHorizontal:y.cardPad,paddingTop:10,paddingBottom:y.cardPad},storageExpanded:{paddingHorizontal:y.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:y.color.textSecondary,fontSize:y.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:y.color.textTertiary,fontSize:y.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:y.color.glassElevated,borderRadius:y.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:y.color.textSecondary,fontSize:y.font.micro,fontFamily:pn},storageKeyEmpty:{color:y.color.textTertiary,fontSize:y.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:pn,fontSize:y.font.label,color:y.color.textSecondary}});import{jsx as wn}from"react/jsx-runtime";var Ya=[];function Xt({visible:e,onClose:t,availableTools:o=Ya,defaultFloatingTools:i,defaultDialTools:n,storage:a=la,onSettingsChange:s}){let u=rn(()=>({getItem:r(async g=>a.getItem(g),"getItem"),setItem:r(async(g,I)=>a.setItem(g,I),"setItem")}),[a]),c=rn(()=>o.map(g=>({...g,name:g.name??g.id,icon:typeof g.icon=="function"?I=>g.icon(I.size):g.icon})),[o]),p=sa(g=>{s?.(g)},[s]);return wn(Vt,{defaultFloatingTools:i,defaultDialTools:n,children:wn(qa,{visible:e,onClose:t,zIndex:11e3,availableApps:c,storage:u,onSettingsChange:p})})}r(Xt,"SettingsModal");import{listenBuoyKeydown as Xa}from"@buoy-gg/shared-ui/web/floating";import{persistentStorage as xn,setExpandableWindowControls as Qa}from"@buoy-gg/shared-ui/web";import{createContext as Za,useCallback as Ce,useContext as es,useEffect as xt,useMemo as ts,useRef as ot,useState as Tn}from"react";var os=r((e,t,o)=>{if(t.singleton){let n=e.find(a=>a.id===t.id);if(n){let a=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:a,apps:[...e.filter(s=>s.instanceId!==n.instanceId),{...n,minimized:false}]}}}let i=o();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}},"resolveOpenAppsState");import{createContext as ns,useCallback as In,useContext as is,useEffect as Tt,useMemo as rs,useRef as Cn,useState as It}from"react";import{JsModal as as,ModalHeader as nt,HeaderSearchButton as ss,TickProvider as ls,ToolScreenHeaderContext as cs,devToolsStorageKeys as zn,buoyColors as kn,gameUIColors as Qt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as Ct}from"react/jsx-runtime";var it=r(()=>{},"noop"),ds={search:"",isSearchActive:false,clearSearch:it,close:it,minimize:it,showToast:it,setHeaderOverride:it},An=ns(null);function Zt(){return is(An)??ds}r(Zt,"useToolHost");function Bn(e,t){let{setHeaderOverride:o}=Zt();Tt(()=>(o(e),()=>o(null)),t)}r(Bn,"useToolHeader");var Dn=2200,us={success:Qt.success,error:Qt.error,info:Qt.info};function Rn({message:e,type:t,nonce:o}){let i=Cn(new Me.Value(0)).current;Tt(()=>{i.setValue(0),Me.sequence([Me.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Me.delay(Dn-450),Me.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,i]);let n=us[t];return Ct(Me.View,{pointerEvents:"none",style:[zt.toast,{opacity:i,borderColor:n+"60"}],children:[ce(H,{style:[zt.toastDot,{backgroundColor:n}]}),ce(U,{style:zt.toastText,numberOfLines:2,children:e})]})}r(Rn,"ToastView");function Mn({app:e,config:t,visible:o,zIndex:i,onClose:n,onMinimize:a,initialModalState:s,enableSharedModalDimensions:u,bodyProps:c}){let p=e.component,[g,I]=It(false),[f,k]=It(""),[x,R]=It(null),[B,O]=It(null),D=Cn(null),z=In(()=>{I(false),k("")},[]),S=In((V,ae="info")=>{D.current&&clearTimeout(D.current),O(ne=>({message:V,type:ae,nonce:(ne?.nonce??0)+1})),D.current=setTimeout(()=>O(null),Dn)},[]);Tt(()=>()=>{D.current&&clearTimeout(D.current)},[]);let C=rs(()=>({search:g?f:"",isSearchActive:g,clearSearch:z,close:n,minimize:r(()=>a(),"minimize"),showToast:S,setHeaderOverride:R,instanceId:e.instanceId}),[f,g,z,n,a,S,e.instanceId]),F=x?.title??t.title??e.title??e.id,A=x?.subtitle??t.subtitle,M=x?.onBack,ee=x?.actions??t.headerActions,_=x?.searchable??t.searchable;Tt(()=>{!_&&g&&z()},[_,g,z]);let G=u?zn.modal.root():zn.custom(e.id).modal(),oe=Ct(nt,{children:[M&&!g&&ce(nt.Navigation,{onBack:M}),g?ce(nt.Search,{value:f,onChangeText:k,onCancel:z,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ce(nt.Content,{title:F,subtitle:A}),Ct(nt.Actions,{children:[!g&&ee,_&&!g&&ce(ss,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return ce(An.Provider,{value:C,children:ce(as,{visible:o,onClose:n,onBack:M,onMinimize:a,initialModalState:s,zIndex:i,persistenceKey:G,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:oe,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Ct(H,{style:zt.bodyRoot,children:[ce(ls,{children:ce(cs.Provider,{value:R,children:ce(p,{...c})})}),B&&ce(Rn,{message:B.message,type:B.type,nonce:B.nonce})]})})})}r(Mn,"ToolModalShell");var zt=dt.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:kn.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:kn.text}});import{useEffect as ps,useRef as ms}from"react";import{capacitorPlatform as gs,capacitorPlugin as fs}from"@buoy-gg/license/web";function On(){return globalThis.__BUOY_HOLDS_BACK__===true}r(On,"isBuoyHoldingBackButton");var hs=99.5;function En(){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(En,"ionicHandlesBack");function Pn(e,t){let o=ms(t);o.current=t,ps(()=>{if(!e||gs()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let n;if(En()){let a=r(s=>{s.detail?.register?.(hs,()=>{o.current()})},"listener");document.addEventListener("ionBackButton",a),n=r(()=>document.removeEventListener("ionBackButton",a),"cleanup")}else{let a=fs("App");if(!a?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let s=false,u=null;Promise.resolve(a.addListener("backButton",()=>o.current())).then(c=>{s?c.remove():u=c}).catch(()=>{}),n=r(()=>{s=true,u&&u.remove()},"cleanup")}return()=>{n(),i.__BUOY_HOLDS_BACK__=false}},[e])}r(Pn,"useCapacitorBackButton");import{Fragment as ys,jsx as de}from"react/jsx-runtime";var Ln=Za(null),Fn="@react_buoy_open_apps",eo=44,bs=12,vs=100,Ss=16,ws=r(e=>({x:window.innerWidth-eo-Ss,y:window.innerHeight-vs-eo-e*(eo+bs)}),"dockIconPosition"),$n=r(({children:e})=>{let[t,o]=Tn([]),[i,n]=Tn(false),a=ot([]),s=ot(null),u=ot(false),c=ot(false),p=ot(false),g=Ce(S=>{let C="";return o(F=>{let{apps:A,instanceId:M}=os(F,S,()=>`${S.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=M,A}),C},[]),I=Ce(()=>{if(u.current||!c.current||!p.current)return;u.current=true;let S=s.current;if(!S||S.length===0){n(true);return}s.current=null,S.forEach(({id:C,minimized:F})=>{let A=a.current.find(M=>M.id===C);if(A&&A.component){let M=Gt(A.icon,{slot:"dial",size:20,color:A.color});g({id:A.id,title:A.name,component:A.component,props:A.props,modal:A.modal,launchMode:A.launchMode||"self-modal",singleton:A.singleton??true,icon:M,color:A.color,minimized:F})}}),n(true)},[g]);xt(()=>{let S=false;return r(async()=>{try{let C=await xn.getItem(Fn);if(S)return;if(C){let F=JSON.parse(C),A;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?A=F.map(M=>({id:M,minimized:false})):A=F.filter(M=>typeof M=="object"&&M!==null&&typeof M.id=="string"),A.length&&(s.current=A))}}catch{}S||(c.current=true,I())},"restoreOpenApps")(),()=>{S=true}},[I]),xt(()=>{if(!i)return;let S=t.map(C=>({id:C.id,minimized:C.minimized??false}));xn.setItem(Fn,JSON.stringify(S))},[t,i]);let f=Ce(S=>{a.current=S,p.current=true,I()},[I]),k=Ce(S=>{o(C=>C.length?S?C.filter(F=>F.instanceId!==S):C.slice(0,-1):C)},[]),x=Ce(()=>o([]),[]),R=Ce((S,C)=>{o(F=>F.map(A=>A.instanceId===S?{...A,minimized:true,restoreState:C}:A))},[]),B=Ce((S,C)=>{o(F=>F.map(A=>A.instanceId===S?{...A,minimized:false,restoreState:C??A.restoreState}:A))},[]),O=Ce(S=>t.find(C=>C.instanceId===S)?.minimized??false,[t]),D=t.some(S=>S.launchMode!=="toggle-only"&&!S.minimized);xt(()=>D?Xa(r(S=>{if(S.key!=="Escape"||S.defaultPrevented)return;let C=[...t].reverse().find(F=>F.launchMode!=="toggle-only"&&!F.minimized);C&&k(C.instanceId)},"handler")):void 0,[D,k,t]),Pn(t.length>0,()=>k());let z=ts(()=>({openApps:t,isAnyOpen:D,open:g,close:k,closeAll:x,registerApps:f,minimize:R,restore:B,isMinimized:O}),[t,D,g,k,x,f,R,B,O]);return de(Ln.Provider,{value:z,children:e})},"AppHostProvider"),rt=r(()=>{let e=es(Ln);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"),xs=9e3,Ts={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Is={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Cs=r(({app:e,zIndex:t,onClose:o,onMinimize:i,minimizeTargetPosition:n,enableSharedModalDimensions:a})=>{let s=e.component,u=!e.minimized,c={...e.props??{},...a?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(Mn,{app:e,config:e.modal,visible:u,zIndex:t,onClose:o,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:a,bodyProps:c})}):e.launchMode==="self-modal"?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...c,visible:u,onClose:o,onRequestClose:o,onMinimize:i,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?u?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...c,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Ts,zIndex:t,display:u?"flex":"none"},children:de("div",{style:Is,children:de(s,{...c,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},"AppRenderer"),jn=r(()=>{let{openApps:e,close:t,minimize:o}=rt(),{settings:i}=Sn();xt(()=>{Qa(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let n=e.filter(u=>u.launchMode!=="toggle-only");if(n.length===0)return null;let a=n.filter(u=>u.minimized).length,s=Br()??ws(a);return de(ys,{children:n.map((u,c)=>de(Cs,{app:u,zIndex:xs+c,onClose:()=>t(u.instanceId),onMinimize:p=>o(u.instanceId,p),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:s},u.instanceId))})},"AppOverlay");import{useCallback as zs,useEffect as to,useRef as ks,useState as Nn,useSyncExternalStore as Hn}from"react";import{persistentStorage as Wn,getToolAttention as oo,subscribeToolAttention as _n}from"@buoy-gg/shared-ui/web";import{jsx as ue,jsxs as kt}from"react/jsx-runtime";function Un(e){return Hn(_n,()=>oo(e),()=>oo(e))}r(Un,"useToolAttention");var Kn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},Vn={needsInput:3,failed:2,done:1},qn=new Map;function no(e){let t=null;for(let i of e?e.split("|"):[]){let n=oo(i);n&&(!t||Vn[n.kind]>Vn[t.kind])&&(t=n)}let o=qn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(qn.set(e,t),t)}r(no,"strongest");function Gn(e){let t=e.join("|");return Hn(_n,()=>no(t),()=>no(t))}r(Gn,"useStrongestAttention");var Jn=28,io=32,ro=6,Yn=8,Xn=24,Qn="@react_buoy_minimized_stack_expanded",As=80,Zn=2e3,Bs=6e3,Ds="#1A1A1A",at="#888888";function ao({down:e=false}){return ue("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:ue("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:at,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}r(ao,"ChevronGlyph");function ei({id:e,title:t,icon:o,index:i,onPress:n}){let a=Un(e),s=ks(null);return to(()=>{let u=true,c,p=r(()=>{s.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:As,easing:"linear"})},"runGlitch"),g=r(I=>{let f=I?500+Math.random()*1500+i*200:Zn+Math.random()*(Bs-Zn)+i*300;c=setTimeout(()=>{u&&(p(),g(false))},f)},"schedule");return g(true),()=>{u=false,clearTimeout(c)}},[i]),kt("button",{type:"button","aria-label":a?`${t} \u2014 ${a.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:io,height:io,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[ue("div",{ref:s,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),a?ue("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:Kn[a.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:a.kind==="needsInput"?"!":""}):null]})}r(ei,"GlitchToolButton");function ti({containerWidth:e=32}){let{openApps:t,restore:o}=rt(),i=t.filter(f=>f.minimized&&f.launchMode!=="toggle-only"),[n,a]=Nn(false),[s,u]=Nn(false),c=Gn(i.map(f=>f.id));to(()=>{let f=false;return r(async()=>{let k=await Wn.getItem(Qn);!f&&k==="true"&&a(true),f||u(true)},"load")(),()=>{f=true}},[]),to(()=>{s&&Wn.setItem(Qn,n?"true":"false")},[n,s]);let p=zs(f=>{o(f)},[o]);if(i.length===0)return null;let g=Yn+i.length*io+(i.length-1)*ro+ro+Xn+4,I={backgroundColor:Ds,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 kt("div",{style:{height:Jn,overflow:"visible",position:"relative"},children:[ue("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",...I},children:kt("div",{style:{height:g,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:Yn,gap:ro,boxSizing:"border-box"},children:[n&&[...i].reverse().map((f,k)=>ue(ei,{id:f.id,title:f.title||f.id,icon:f.icon??ue("span",{style:{color:"#fff",fontSize:13},children:(f.title||f.id).slice(0,1).toUpperCase()}),index:k,onPress:()=>p(f.instanceId)},f.instanceId)),ue("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>a(false),style:{width:"100%",height:Xn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:ue(ao,{down:true})})]})}),kt("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:Jn,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",...I},children:[ue(ao,{}),c?ue("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:Kn[c.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:c.kind==="needsInput"?"!":""}):null,i.length>1&&ue("span",{style:{fontSize:9,fontWeight:600,color:at,marginLeft:1},children:i.length})]})]})}r(ti,"MinimizedToolsStack");import{registerToolModules as Rs}from"@buoy-gg/shared-ui/web";import{createElement as Ms}from"react";function Ge(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ms(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}r(Ge,"createWebTool");import{createContext as Os,useContext as Es,useState as oi,useMemo as ni}from"react";import{jsx as Ps}from"react/jsx-runtime";var ii=Os(null);function so({children:e}){let[t,o]=oi(false),[i,n]=oi(false),a=ni(()=>t||i,[t,i]),s=ni(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:a,setDialOpen:o,setToolOpen:n}),[t,i,a]);return Ps(ii.Provider,{value:s,children:e})}r(so,"DevToolsVisibilityProvider");function At(){let e=Es(ii);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:r(()=>{},"setDialOpen"),setToolOpen:r(()=>{},"setToolOpen")}}r(At,"useDevToolsVisibility");import*as Ls from"@buoy-gg/license/web";import*as Fs from"@buoy-gg/shared-ui/web";import*as $s from"@buoy-gg/shared-ui/web/dataViewer";function lo(e){Rs({core:{useDevToolsVisibility:At},license:Ls,"shared-ui":Fs,"shared-ui/dataViewer":$s,...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),[Ge(n)])))}r(lo,"createWebTools");import{useEffect as Bt,useMemo as Dt,useRef as js}from"react";import{LicenseManager as ri,installCapacitorBridge as Ns,resolveDevBuild as ai,useLicense as Hs}from"@buoy-gg/license/web";import{registerToolAdapters as Ws}from"@buoy-gg/shared-ui/web";function co(e){return typeof e=="object"&&e!==null?e:void 0}r(co,"externalSyncOptions");function si({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:i}){if(o===false||!i)return false;if(e)return true;let n=co(o);return t&&n?.enableInRelease===true&&uo(n.socketURL,n)===null}r(si,"shouldMountExternalSync");var li="http://localhost:42831";function ci(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}r(ci,"isLoopbackHost");function uo(e,t){let o=e??li;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:"||ci(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(uo,"releaseTransportProblem");var _s={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function di(e,t,o){if(t)return e;let i=null;for(let[n,a]of Object.entries(_s)){if(o?.includes(n))continue;let s=e[n];if(!s?.actions)continue;let u={...s.actions};for(let c of a)c in u&&(u[c]=()=>{throw new Error(`${n}.${c} 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]={...s,actions:u}}return i??e}r(di,"applyReleaseActionPolicy");import{useEffect as Us,useMemo as Ks,useState as Vs}from"react";import{devToolsStorageKeys as qs,persistentStorage as Gs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as Js}from"@buoy-gg/license/web";var Ys=8;function ui(){let e="";for(;e.length<Ys;)e+=(Math.random()*16|0).toString(16);return e}r(ui,"generateInstallId");function pi(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}r(pi,"slugify");function mi({appName:e,hardwareName:t,platform:o,installId:i,deviceId:n}){let a=pi(e??"buoy")||"buoy",s=e??"Buoy Device",u=t?.trim()||o;return n?{deviceId:n,deviceName:`${s} (${u})`}:{deviceId:`${a}-${o}-${i}`,deviceName:`${s} (${u} \xB7 ${i.slice(-4)})`}}r(mi,"buildDeviceIdentity");function gi(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}r(gi,"sessionStore");function fi(){let e=globalThis;try{return e.localStorage??null}catch{return null}}r(fi,"localStore");async function hi({platform:e=He.OS,store:t,mint:o=ui}={}){let i=qs.sync.deviceId(),n=t===void 0?Js()?fi():e==="web"?gi():Gs:t;if(!n)return o();try{let a=await n.getItem(i);if(a&&a.length>0)return a;let s=o();return await n.setItem(i,s),s}catch{return o()}}r(hi,"loadInstallId");var po=null;function yi(){return po||(po=hi()),po}r(yi,"getInstallId");function bi(e,t){let o=e?.deviceId,i=e?.deviceName,n=t.loadId??yi,a=t.platform??He.OS,[s,u]=Vs(null);return Us(()=>{if(o)return;let c=false;return n().then(p=>{c||u(p)}),()=>{c=true}},[o,n]),Ks(()=>{if(!o&&!s)return null;let c=mi({appName:t.appName,hardwareName:t.hardwareName,platform:a,installId:s??"",deviceId:o});return i?{...c,deviceName:i}:c},[o,i,s,t.appName,t.hardwareName,a])}r(bi,"useDeviceIdentity");import{useEffect as Xs,useState as Qs}from"react";import{capacitorPlatform as Zs,capacitorPlugin as Rt,isCapacitorNative as el}from"@buoy-gg/license/web";function vi(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(vi,"hardwareFromUserAgent");function Si(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}r(Si,"isAndroidEmulatorUserAgent");function mo(){return typeof navigator>"u"?"":navigator.userAgent??""}r(mo,"userAgent");function Mt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}r(Mt,"firstPageTitle");var wi="@react_buoy_capacitor_app_name";function xi(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem(wi);if(o)return o;e&&t.setItem(wi,e)}catch{}return e}r(xi,"persistedAppName");function Ti(){let e=Zs();if(!e)return{platform:"web",appName:Mt(),hardwareName:"Browser",ready:true};let t=!!Rt("App");return{platform:e,appName:t?Mt():xi(Mt()),hardwareName:vi(mo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Rt("Device")}}r(Ti,"initialHostInfo");function Ii(){let[e,t]=Qs(Ti);return Xs(()=>{if(!el())return;let o=false,i=Rt("App"),n=Rt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([a,s])=>{if(o)return;let u=a?.name?.trim(),c=s?.name?.trim()||s?.model?.trim();t(p=>({...p,appName:u||p.appName,hardwareName:c||p.hardwareName,ready:true}))}),()=>{o=true}},[]),e}r(Ii,"useHostInfo");function go(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:mo(),serverUrl:typeof e=="string"?e:null}}r(go,"pageInfo");function fo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}r(fo,"schemeHost");function Ci(e,t){if(e==="ios"){let o=fo(t.serverUrl);return o?o===fo(t.origin):t.protocol==="capacitor:"}return zi.has(t.hostname)}r(Ci,"isBundledPage");var zi=new Set(["localhost","127.0.0.1","[::1]","::1"]);function ki(e,t,o,i=go()){if(o==="web"||!i)return e;let n;try{n=new URL(e)}catch{return e}let a=Ci(o,i);return!t&&a&&n.hostname===i.hostname&&(n.hostname="localhost"),o==="android"&&zi.has(n.hostname)&&Si(i.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}r(ki,"capacitorBrokerURL");function Ai(e,t,o=go()){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(Ai,"capacitorTransportProblem");import{getDevServerOrigin as tl,resolveReloadStrategy as ol,scheduleReloadApp as nl}from"@buoy-gg/shared-ui/web";var Bi=Date.now(),Di=tl(),il={platform:He.OS,isTV:He.isTV===true,isTVOS:He.isTVOS===true},Ri={version:3,getSnapshot:r(()=>{let e=ol("auto");return{startedAt:Bi,devServerOrigin:Di,device:il,reload:{available:e!==null,strategy:e}}},"getSnapshot"),subscribe:r(e=>()=>{},"subscribe"),actions:{ping:r(()=>({ok:true,startedAt:Bi,devServerOrigin:Di}),"ping"),reloadApp:r(e=>{let t=e??{},{strategy:o,delayMs:i}=nl({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:i}},"reloadApp")}};import{Fragment as rl,jsx as Fe,jsxs as al}from"react/jsx-runtime";var sl=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],ll=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Mi(e){let t=Dt(()=>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(Oi,{...e,modules:t,query:o}):Fe(ho,{...e,modules:t})}r(Mi,"BrowserToolRuntime");function Oi(e){let t=e.query.useReactQuerySyncAdapter();return Fe(ho,{...e,queryAdapter:t})}r(Oi,"QueryRuntime");function ho({modules:e,apps:t,requiredEnvVars:o,externalSync:i,headless:n,sentryGetClient:a,queryAdapter:s}){let{isPro:u,tier:c}=Hs(),p=Dt(()=>{let B={app:Ri};for(let[O,D]of Object.entries(e))for(let[z,S]of Object.entries(D))z.endsWith("SyncAdapter")&&S&&typeof S=="object"&&(B[O]=S);s&&(B.query=s),e.env?.createEnvSyncAdapter&&(B.env=e.env.createEnvSyncAdapter(o??[]));for(let O of t??[])O.sync&&(B[`custom:${O.id}`]=O.sync);return B},[e,t,o,s]),g=js(p);g.current=p,Bt(()=>Ws(()=>g.current),[]),Bt(()=>{let B=[],O=r(D=>{let z=D?.();typeof z=="function"&&B.push(z)},"start");return O(e.network?.startNetworkCapture),O(e.storage?.startBrowserStorageCapture),O(e.assets?.startBrowserAssetCapture),O(e.three?.startThreeCapture),ai(typeof We<"u"?We:process.env.NODE_ENV!=="production")&&O(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&O(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&O(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let D of B.reverse())D()}},[e]);let I=e["external-sync"],f=ai(typeof We<"u"?We:process.env.NODE_ENV!=="production"),k=si({isDevelopment:f,isLicensed:u,externalSync:i,isAvailable:!!I}),x=co(i);Ns({release:!f&&!!x?.enableInRelease}),!f&&x?.enableInRelease&&yo(uo(x.socketURL,x));let R=e.sentry?.SentryRoot;return al(rl,{children:[Object.entries(e).flatMap(([B,O])=>sl.map(D=>{let z=O[D];return z?Fe(z,{},`${B}:${D}`):null})),R&&Fe(R,{getClient:a}),Object.entries(e).flatMap(([B,O])=>ll.map(D=>{let z=O[D];return z&&(!n||D==="ScenariosOverlay"||D==="ImpersonateOverlay")?Fe(z,{},`${B}:${D}`):null})),k&&Fe(Pi,{module:I,tools:p,options:x,isPro:u,tier:c,dev:f})]})}r(ho,"ToolRuntime");var Ei=null;function yo(e){!e||e===Ei||(Ei=e,console.warn("[Buoy]",e))}r(yo,"warnOnce");function Pi({module:e,tools:t,options:o,isPro:i,tier:n,dev:a}){let s=Ii(),u=bi(o,{appName:s.appName,hardwareName:s.hardwareName,platform:s.platform}),c=Dt(()=>ki(o?.socketURL??(a?e.getDefaultSocketURL():li),!!o?.socketURL,s.platform),[o?.socketURL,a,e,s.platform]),{socket:p}=e.useExternalSyncSocket({deviceName:u?.deviceName??"Buoy Browser",socketURL:c,persistentDeviceId:s.ready?u?.deviceId??null:null,platform:s.platform,extraDeviceInfo:s.extraDeviceInfo,enableLogs:o?.enableLogs});Bt(()=>{let f=Ai(c,s.platform);if(!p||!f)return;let k=r(()=>yo(f),"onError");return p.on("connect_error",k),()=>{p.off("connect_error",k)}},[p,c,s.platform]),Bt(()=>{if(!p)return;let f=r(()=>{if(!p.connected||!ri.hasAccountAccess())return;let k=ri.getState();!i&&(k.isInitialized===false||k.isValidating===true)||p.emit("device-license",{isPro:i?"1":"0",tier:n})},"emit");return f(),p.on("connect",f),()=>{p.off("connect",f)}},[p,i,n]);let g=o?.releaseActions?.join(",")??"",I=Dt(()=>di(t,a,g?g.split(","):void 0),[t,a,g]);return e.useExternalSync({tools:I,socket:p,deviceId:s.ready?u?.deviceId??null:null,enableLogs:o?.enableLogs}),null}r(Pi,"BrowserExternalSync");import{useState as Li}from"react";import{BuoyPortal as cl}from"@buoy-gg/shared-ui/web/floating";import{useBuoySession as dl}from"@buoy-gg/license/web";import{Fragment as Fi,jsx as Je,jsxs as $i}from"react/jsx-runtime";var ji="#20C997";function Ni(){let{status:e,signIn:t,signOut:o}=dl(),[i,n]=Li(false),[a,s]=Li(null);if(typeof document>"u")return null;let u=r(()=>{s(null),n(true),t().catch(p=>s(p instanceof Error?p.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},"start"),c=e.state==="active";return Je(cl,{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:c||a?"12px 14px":0,borderRadius:16,background:c||a?"#0f1419":"transparent",color:"#e6edf3",boxShadow:c||a?"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:c?$i(Fi,{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:ul,"data-testid":"buoy-signout",children:"Sign out"})]}):$i(Fi,{children:[a?Je("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:a}):null,Je("button",{type:"button",onClick:u,disabled:i,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:ji,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(Ni,"BuoySignIn");var ul={marginTop:8,padding:0,border:"none",background:"none",color:ji,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as pl}from"react";import{AccountSetupButton as ml,BuoyNeedsPlanCard as gl,BuoySignInCard as fl,useSignInState as hl}from"@buoy-gg/shared-ui/web";import{jsx as st,jsxs as Hi}from"react/jsx-runtime";function bo({needsPlan:e=false}){let[t,o]=pl(false),i=hl();return Hi(H,{pointerEvents:"box-none",style:Wi.root,children:[st(ml,{expanded:t,onPress:()=>o(true)}),t?st(ir,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:Hi(H,{style:Wi.overlay,accessibilityViewIsModal:true,children:[st(nr,{style:dt.absoluteFill,onPress:()=>o(false),accessible:false}),e&&i==="active"?st(gl,{onClose:()=>o(false)}):st(fl,{onClose:()=>o(false)})]})}):null]})}r(bo,"BuoySignIn");var Wi=dt.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 vo(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}r(vo,"validateDialConfig");import{installedTools as yl,installedToolsFound as bl}from"@buoy-gg/core/web/installed-tools";import{Fragment as So,jsx as L,jsxs as lt}from"react/jsx-runtime";var _i={},Ui="@react_buoy_floating_menu_tooltip_shown",vl=Oe;function Ki({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),i=Math.max(1,e/16);return L("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,a)=>L("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},a))})}r(Ki,"MenuLauncherIcon");function Vi(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:i=false,children:n}=e,a=fe(()=>o&&vo(o),[o]);return L(Vt,{defaultFloatingTools:t,defaultDialTools:a,children:L(br,{disableHints:i,children:lt(so,{children:[L($n,{children:L(Xi,{...e})}),n]})})})}r(Vi,"AdmittedFloatingDevTools");var Sl=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function qi({modules:e=_i}){return L(So,{children:Object.entries(e).flatMap(([t,o])=>Sl.map(i=>{let n=o[i];return n?L(n,{},`${t}:${i}`):null}))})}r(qi,"StartupCapture");function Gi(){let{openApps:e,restore:t}=rt();return te(()=>Sr(o=>{let i=e.find(n=>n.id===o);return i?(t(i.instanceId),true):false}),[e,t]),null}r(Gi,"WebToolOpenerBridge");function Ji(){let e=gr();return vr((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}r(Ji,"defaultEnvironment");function Yi(e,t,o,i){let n=r(g=>Object.entries(e).find(([I])=>I.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===g)?.[1],"find"),a=[],s=n("env");t?.length&&s?.createEnvTool&&s.createEnvVarConfig&&a.push(Ge(s.createEnvTool({requiredEnvVars:s.createEnvVarConfig(t)})));let u=n("storage");o?.length&&u?.createStorageTool&&a.push(Ge(u.createStorageTool({requiredStorageKeys:o})));let c=n("ask-buoy"),p=i==="hosted"?c?.hostedAskBuoy?.():i;return p&&c?.createAskBuoyTool&&a.push(Ge(c.createAskBuoyTool(p))),a}r(Yi,"configOverrides");function Xi({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:i,apps:n,modules:a=_i,externalSync:s,requiredEnvVars:u,sentryGetClient:c,disableHints:p=false,headless:g=false,hidden:I=false,defaultFloatingTools:f,defaultDialTools:k,zustandStores:x,requiredStorageKeys:R,askBuoy:B}){let O=e??Ji(),D=fe(()=>k?vo(k):void 0,[k]),[z,S]=Ot(false),[C,F]=Ot(false),A=xr(false),M=rt(),ee=fe(()=>Yi(a,u,R,B),[a,u,R,B]),_=fe(()=>Et([...lo(a),...n??[],...ee]),[n,a,ee]),G=fe(()=>Object.entries(a).find(([d])=>d.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[a]);te(()=>{if(!x||typeof G?.watchStores!="function")return;let d=G.watchStores(x);return typeof d=="function"?d:void 0},[x,G]);let oe=At(),V=M.openApps.some(d=>!d.minimized);te(()=>{oe.setDialOpen(z)},[z,oe.setDialOpen]),te(()=>{oe.setToolOpen(V||C)},[V,C,oe.setToolOpen]);let{registerApps:ae}=M;te(()=>{ae(_.map(d=>{let W=d.icon;return{...d,icon:typeof W=="function"?({size:v})=>W(v):W}}))},[ae,_]);let ne=fe(()=>_.map(d=>({id:d.id,name:d.name,description:d.description,slot:d.slot})),[_]);Tr({availableTools:ne,storage:vl}),te(()=>{let d=false;return r(async()=>{let[W,v]=await Promise.all([Oe.getItem(pt.dial.isOpen()),Oe.getItem(pt.settings.modalOpen())]);d||(W==="true"&&S(true),v==="true"&&(S(true),F(true)),A.current=true)},"restore")(),()=>{d=true}},[]),te(()=>{A.current&&Oe.setItem(pt.dial.isOpen(),z?"true":"false")},[z]),te(()=>{A.current&&Oe.setItem(pt.settings.modalOpen(),C?"true":"false")},[C]);let Se=_e(d=>{if(nn(d.id),d.launchMode==="toggle-only"){d.onPress?.();return}if(d.component){let W=typeof d.icon=="function"?d.icon(20):d.icon;M.open({id:d.id,title:d.name||ut(d.id),component:d.component,props:d.props,modal:d.modal,launchMode:d.launchMode||"self-modal",singleton:d.singleton??true,icon:W,color:d.color||Io(d.id)})}else d.onPress?.()},[M]),se=fe(()=>mt(_,"dial").map(d=>{let W=d.color||Io(d.id),v;return typeof d.icon=="string"?v=d.icon:typeof d.icon=="function"?v=d.icon(32):v=null,{id:d.id,name:d.name||ut(d.id),icon:v,unavailable:!d.component&&!d.onPress,color:W,onPress:r(()=>{Se(d),S(false)},"onPress")}}),[_,Se]),ze=fe(()=>{if(!z)return se;let d=new Map(se.map(W=>[W.id,W]));return on(se.map(W=>W.id)).map(W=>d.get(W)).filter(W=>!!W)},[z,se]),{settings:j}=Sn(),Ye=fe(()=>mt(_,"row").filter(d=>(j.floatingTools[d.id]??false)===true&&(d.component||d.onPress)),[_,j.floatingTools]),ke=fe(()=>_.map(d=>({id:d.id,name:d.name||ut(d.id),description:d.description||Ir(d.id),slot:d.slot,icon:d.icon,color:d.color})),[_]),[$e,Ae]=Ot(false),le=M.openApps.some(d=>!d.minimized);te(()=>{if(p)return;let d=false,W=setTimeout(async()=>{let v=await Oe.getItem(Ui);!d&&!v&&Ae(true)},1e3);return()=>{d=true,clearTimeout(W)}},[p]);let Y=_e(()=>{Ae(false),Oe.setItem(Ui,"true")},[]),we=_e(()=>{Y(),S(true)},[Y]),me=_e(()=>{S(false),F(false)},[]),Be=_e(()=>{F(d=>!d)},[]),je=_e(()=>F(false),[]),ye=!!(o?.length&&i),De=j.floatingTools.environment!==false,pe=$e&&!z&&!le&&!I;te(()=>{if(!pe)return;let d=r(v=>{(!(v.target instanceof Element)||!v.target.closest("[data-buoy-root]"))&&Y()},"onPointerDown"),W=r(v=>{v.key==="Escape"&&Y()},"onKeyDown");return document.addEventListener("pointerdown",d,true),document.addEventListener("keydown",W),()=>{document.removeEventListener("pointerdown",d,true),document.removeEventListener("keydown",W)}},[pe,Y]);let be=M.openApps.some(d=>d.minimized&&d.launchMode!=="toggle-only"),Re=L(Mi,{modules:a,apps:n,requiredEnvVars:u,externalSync:s,headless:g,sentryGetClient:c});return g?Re:lt("div",{"data-buoy-root":"",style:{display:"contents"},children:[Re,L(Gi,{}),pe&&L("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),L("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:lt(ko,{enablePositionPersistence:!pe,pushToSide:z||le,suspendPointerEvents:z,centerOnboarding:pe,minimizedStack:be?L(ti,{}):void 0,hasMinimizedStack:be,children:[O&&De&&!ye&&L(Cr,{environment:O}),ye&&De&&L(zr,{currentEnvironment:O??"local",availableEnvironments:o,onSelect:i}),t?L(Ao,{userRole:t,onPress:we}):L("button",{"aria-label":"Open dev tools",onClick:we,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:L(Ki,{})}),Ye.map(d=>L("button",{"aria-label":d.name||ut(d.id),title:d.description,onClick:()=>Se(d),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof d.icon=="function"?d.icon(16):d.icon},d.id))]})}),pe&&L(Lt,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:Y}),z&&!I&&L(Nt,{icons:ze,onClose:me,centerLabel:"BUOY",onCenterPress:Be,settingsOpen:C,hintsDisabled:p}),C&&!I&&L(Xt,{visible:true,onClose:je,availableTools:ke,defaultFloatingTools:f,defaultDialTools:D,onSettingsChange:d=>{}}),!I&&lt(So,{children:[L(jn,{}),L(lr,{})]})]})}r(Xi,"FloatingDevToolsInner");function Qi(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;te(()=>{if(!o)return;let i=false,n=cr.SessionManager;if(!n)return;let a=r(s=>{i||!s||(n.configure({audience:`app:${s}`}),n.load().catch(()=>{}))},"apply");return t?a(t):hr().then(s=>a(s?.bundleId)).catch(()=>{}),()=>{i=true}},[o,t])}r(Qi,"useCapacitorSignInAudience");var Zi=false;function er(e){return e.modules?e:(!bl&&!Zi&&typeof console<"u"&&(Zi=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:yl})}r(er,"withInstalledTools");function tr(e){return L(sr,{children:L(or,{...er(e)})})}r(tr,"FloatingDevTools");function or(e){let{access:t,isPro:o,licenseKey:i}=ur();te(()=>{dr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||pr(e.licenseKey,i),a=mr(typeof We<"u"?We:process.env.NODE_ENV!=="production"),s=n&&t.status==="admitted";te(()=>{s&&wr()},[s]),te(()=>{a||t.status==="initializing"||(o&&s?rr():ar())},[a,o,s,t.status]);let u=fr();return Qi(u?e.signIn:void 0),!a&&!o?!e.signIn||e.headless?null:u?L(bo,{needsPlan:true}):L(Ni,{}):s?L(Vi,{...e}):lt(So,{children:[t.status==="initializing"&&L(qi,{modules:e.modules}),e.headless?null:e.signIn&&u?L(bo,{}):L(yr,{})]})}r(or,"FloatingDevToolsContent");export{kr as a,Co as b,Et as c,mt as d,zo as e,ko as f,Ar as g,Ao as h,Nt as i,Xt as j,Zt as k,Bn as l,On as m,$n as n,rt as o,jn as p,Ge as q,so as r,At as s,lo as t,Ri as u,tr as v};
package/lib/web/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{a as m,b as d,c,d as p,e as C,f as g,g as y,h as f,i as S,j as T,k as v,l as h,m as b,n as D,o as B,p as P,q as k,r as w,s as E,t as H,u as M,v as i}from"./chunks/chunk-NKUQECQ2.mjs";import{$ as A,A as F,Aa as L,B as R,Ba as q,C as x,Ca as I,D as U,Da as W,E as j,Ea as G,F as J,Fa as K,G as O,Ga as V,H as z,Ha as X,I as N,Ia as Q,J as Z,Ja as Y,K as _,Ka as $,L as aa,La as sa,M as ea,Ma as oa,N as ta,Na as ra,O as la,Oa as ia,P as na,Pa as ua,Q as ma,R as da,S as ca,T as pa,U as Ca,V as ga,W as ya,X as fa,Y as Sa,Z as Ta,_ as va,a as ha,aa as ba,b as Da,ba as Ba,c as Pa,ca as ka,d as wa,da as Ea,e as Ha,ea as Ma,f as Aa,fa as Fa,g as La,ga as Ra,h as qa,ha as xa,i as Ia,ia as Ua,j as Wa,ja,k as Ga,ka as Ja,l as Ka,la as Oa,m as Va,ma as za,n as Xa,na as Na,o as Qa,oa as Za,p as Ya,pa as _a,q as $a,qa as as,r as ss,ra as es,s as os,sa as ts,t as rs,ta as ls,u as is,ua as ns,v as us,va as ms,w as ds,wa as cs,x as ps,xa as Cs,y as gs,ya as ys,z as fs,za as Ss}from"./chunks/chunk-RBPDZUHO.mjs";import"./chunks/chunk-Z6I7ZD34.mjs";import{c as Ts}from"./chunks/chunk-D2FYORGY.mjs";import{a as vs}from"./chunks/chunk-LOPXJLVB.mjs";import{useSettings as hs,useFloatingTools as bs,getToolLabel as Ds,getToolDescription as Bs,getToolColor as Ps,settingsColors as ks,settingsStyles as ws,dialColors as Es,dialStyles as Hs}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as Ms}from"@buoy-gg/license/web";import{createRoot as As}from"react-dom/client";import{createElement as Fs}from"react";import{jsx as Ls}from"react/jsx-runtime";function n({queryClient:s,...e}={}){let o=Object.values(e.modules??{}).find(u=>u.QueryClientProvider)?.QueryClientProvider;if(s&&!o)throw new Error("Add the react-query tool to modules to use queryClient.");let a=document.createElement("div");a.dataset.buoyMount="",document.body.appendChild(a);let t=As(a),r=Ls(i,{...e});t.render(s?Fs(o,{client:s},r):r);let l=true;return()=>{l&&(l=false,t.unmount(),a.remove())}}vs(n,"mountBuoy");export{z as Activity,as as AlertCircle,N as AlertTriangle,D as AppHostProvider,P as AppOverlay,wa as Badge,es as BarChart3,is as BaseEventStore,ts as Bookmark,Z as Bug,Ia as Button,Va as Card,_ as Check,aa as CheckCircle,$ as CheckSquare,ea as ChevronDown,ta as ChevronLeft,la as ChevronRight,na as ChevronUp,ma as Clock,ls as Cloud,Qa as CollapsibleSection,da as Copy,Wa as CopyButton,rs as DataViewer,ca as Database,w as DevToolsVisibilityProvider,S as DialMenu,La as DiffViewer,y as Divider,ns as Download,ms as Edit3,$a as EmptyState,os as EventStepperFooter,pa as Eye,Ca as EyeOff,ga as FileJson,ya as FileText,fa as Filter,Sa as FlaskConical,i as FloatingDevTools,g as FloatingTools,cs as GitBranch,Ta as Globe,Cs as HardDrive,va as Hash,ys as HelpCircle,Ss as Home,L as Image,A as Info,Aa as InfoRow,O as JsModal,ba as Key,Ba as Layers,Ms as LicenseManager,q as Link,ka as Lock,I as Maximize2,W as Minus,G as Palette,Ea as Pause,K as Pin,Ma as Play,Fa as Plus,Ra as Power,Ga as PowerToggle,xa as RefreshCw,us as RelativeTime,V as Route,Ka as Row,Ua as Search,ss as SearchBar,Xa as SectionHeader,X as Server,ja as Settings,T as SettingsModal,Ja as Shield,Q as Smartphone,Y as Square,Ha as StatusDot,Ya as TabSelector,sa as Timer,Oa as Trash2,oa as Unlock,ra as Upload,za as User,f as UserStatus,ia as Users,Na as Wifi,Za as X,ua as XCircle,_a as Zap,M as appSyncAdapter,d as autoDiscoverWebPresets,c as autoDiscoverWithCustom,Ts as clearReleaseOptIn,J as copyToClipboard,k as createWebTool,H as createWebTools,m as defaultToolPresets,U as devToolsStorageKeys,Es as dialColors,Hs as dialStyles,ds as formatBytes,ps as formatDuration,gs as formatNumber,C as getEnabledTools,Ps as getToolColor,Bs as getToolDescription,Ds as getToolLabel,p as getToolsBySlot,b as isBuoyHoldingBackButton,Da as methodColor,n as mountBuoy,x as persistentStorage,F as safeStringify,ks as settingsColors,ws as settingsStyles,ha as statusColor,qa as toolTheme,fs as truncateMiddle,Pa as typeColor,B as useAppHost,E as useDevToolsVisibility,bs as useFloatingTools,R as usePersistedState,j as useSafeAreaInsets,hs as useSettings,h as useToolHeader,v as useToolHost};
1
+ "use client";import{a as m,b as d,c,d as p,e as C,f as g,g as y,h as f,i as S,j as T,k as v,l as h,m as b,n as D,o as B,p as P,q as k,r as w,s as E,t as H,u as M,v as i}from"./chunks/chunk-4A5JHNVM.mjs";import{$ as A,A as F,Aa as L,B as R,Ba as q,C as x,Ca as I,D as U,Da as W,E as j,Ea as G,F as J,Fa as K,G as O,Ga as V,H as z,Ha as X,I as N,Ia as Q,J as Z,Ja as Y,K as _,Ka as $,L as aa,La as sa,M as ea,Ma as oa,N as ta,Na as ra,O as la,Oa as ia,P as na,Pa as ua,Q as ma,R as da,S as ca,T as pa,U as Ca,V as ga,W as ya,X as fa,Y as Sa,Z as Ta,_ as va,a as ha,aa as ba,b as Da,ba as Ba,c as Pa,ca as ka,d as wa,da as Ea,e as Ha,ea as Ma,f as Aa,fa as Fa,g as La,ga as Ra,h as qa,ha as xa,i as Ia,ia as Ua,j as Wa,ja,k as Ga,ka as Ja,l as Ka,la as Oa,m as Va,ma as za,n as Xa,na as Na,o as Qa,oa as Za,p as Ya,pa as _a,q as $a,qa as as,r as ss,ra as es,s as os,sa as ts,t as rs,ta as ls,u as is,ua as ns,v as us,va as ms,w as ds,wa as cs,x as ps,xa as Cs,y as gs,ya as ys,z as fs,za as Ss}from"./chunks/chunk-RBPDZUHO.mjs";import"./chunks/chunk-Z6I7ZD34.mjs";import{c as Ts}from"./chunks/chunk-D2FYORGY.mjs";import{a as vs}from"./chunks/chunk-LOPXJLVB.mjs";import{useSettings as hs,useFloatingTools as bs,getToolLabel as Ds,getToolDescription as Bs,getToolColor as Ps,settingsColors as ks,settingsStyles as ws,dialColors as Es,dialStyles as Hs}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as Ms}from"@buoy-gg/license/web";import{createRoot as As}from"react-dom/client";import{createElement as Fs}from"react";import{jsx as Ls}from"react/jsx-runtime";function n({queryClient:s,...e}={}){let o=Object.values(e.modules??{}).find(u=>u.QueryClientProvider)?.QueryClientProvider;if(s&&!o)throw new Error("Add the react-query tool to modules to use queryClient.");let a=document.createElement("div");a.dataset.buoyMount="",document.body.appendChild(a);let t=As(a),r=Ls(i,{...e});t.render(s?Fs(o,{client:s},r):r);let l=true;return()=>{l&&(l=false,t.unmount(),a.remove())}}vs(n,"mountBuoy");export{z as Activity,as as AlertCircle,N as AlertTriangle,D as AppHostProvider,P as AppOverlay,wa as Badge,es as BarChart3,is as BaseEventStore,ts as Bookmark,Z as Bug,Ia as Button,Va as Card,_ as Check,aa as CheckCircle,$ as CheckSquare,ea as ChevronDown,ta as ChevronLeft,la as ChevronRight,na as ChevronUp,ma as Clock,ls as Cloud,Qa as CollapsibleSection,da as Copy,Wa as CopyButton,rs as DataViewer,ca as Database,w as DevToolsVisibilityProvider,S as DialMenu,La as DiffViewer,y as Divider,ns as Download,ms as Edit3,$a as EmptyState,os as EventStepperFooter,pa as Eye,Ca as EyeOff,ga as FileJson,ya as FileText,fa as Filter,Sa as FlaskConical,i as FloatingDevTools,g as FloatingTools,cs as GitBranch,Ta as Globe,Cs as HardDrive,va as Hash,ys as HelpCircle,Ss as Home,L as Image,A as Info,Aa as InfoRow,O as JsModal,ba as Key,Ba as Layers,Ms as LicenseManager,q as Link,ka as Lock,I as Maximize2,W as Minus,G as Palette,Ea as Pause,K as Pin,Ma as Play,Fa as Plus,Ra as Power,Ga as PowerToggle,xa as RefreshCw,us as RelativeTime,V as Route,Ka as Row,Ua as Search,ss as SearchBar,Xa as SectionHeader,X as Server,ja as Settings,T as SettingsModal,Ja as Shield,Q as Smartphone,Y as Square,Ha as StatusDot,Ya as TabSelector,sa as Timer,Oa as Trash2,oa as Unlock,ra as Upload,za as User,f as UserStatus,ia as Users,Na as Wifi,Za as X,ua as XCircle,_a as Zap,M as appSyncAdapter,d as autoDiscoverWebPresets,c as autoDiscoverWithCustom,Ts as clearReleaseOptIn,J as copyToClipboard,k as createWebTool,H as createWebTools,m as defaultToolPresets,U as devToolsStorageKeys,Es as dialColors,Hs as dialStyles,ds as formatBytes,ps as formatDuration,gs as formatNumber,C as getEnabledTools,Ps as getToolColor,Bs as getToolDescription,Ds as getToolLabel,p as getToolsBySlot,b as isBuoyHoldingBackButton,Da as methodColor,n as mountBuoy,x as persistentStorage,F as safeStringify,ks as settingsColors,ws as settingsStyles,ha as statusColor,qa as toolTheme,fs as truncateMiddle,Pa as typeColor,B as useAppHost,E as useDevToolsVisibility,bs as useFloatingTools,R as usePersistedState,j as useSafeAreaInsets,hs as useSettings,h as useToolHeader,v as useToolHost};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/core",
3
- "version": "7.0.66",
3
+ "version": "7.0.68",
4
4
  "description": "Floating developer menu and account setup for React Native. Add tool packages and configure Desktop or MCP connections separately.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -89,10 +89,10 @@
89
89
  ],
90
90
  "dependencies": {
91
91
  "react-devtools-core": "6.1.5",
92
- "@buoy-gg/floating-tools-core": "^7.0.66",
93
- "@buoy-gg/floating-tools-react": "^7.0.66",
94
- "@buoy-gg/license": "^7.0.66",
95
- "@buoy-gg/shared-ui": "^7.0.66"
92
+ "@buoy-gg/floating-tools-core": "^7.0.68",
93
+ "@buoy-gg/floating-tools-react": "^7.0.68",
94
+ "@buoy-gg/license": "^7.0.68",
95
+ "@buoy-gg/shared-ui": "^7.0.68"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "react": "*"