import{s as e}from"./chunk-Bj-mKKzh.js";import{D as t}from"./src-BOCweS1p.js";import{n}from"./jsx-runtime-CiQ1k8xo.js";import{lt as r}from"./vscode-api-DjORcpSo.js";import{a as i}from"./setting-storage-CwKZnsvR.js";var a=r(),o=e(n(),1);function s(){return i(t.theme)??`system`}function c(e){let t=(0,a.c)(4),n;t[0]===e?n=t[1]:(n=e===`system`?f:()=>e,t[0]=e,t[1]=n);let r;return t[2]===e?r=t[3]:(r=e===`system`?f:()=>e,t[2]=e,t[3]=r),(0,o.useSyncExternalStore)(e===`system`?d:u,n,r)}function l(e){return e===`system`?[`light`,`dark`]:[e]}function u(){return()=>{}}function d(e){let t=window.electronBridge?.subscribeToSystemThemeVariant;if(t!=null)return t(e);if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=()=>{e()};return typeof n.addEventListener==`function`?(n.addEventListener(`change`,r),()=>{n.removeEventListener(`change`,r)}):typeof n.addListener==`function`&&typeof n.removeListener==`function`?(n.addListener(r),()=>{n.removeListener(r)}):()=>{}}function f(){return window.electronBridge?.getSystemThemeVariant?.()??(typeof window>`u`||typeof window.matchMedia!=`function`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)}export{s as n,c as r,l as t};
//# sourceMappingURL=use-resolved-theme-variant-CQs5Gmyu.js.map