import{objectType as e}from"../_util/type.mjs";import t from"../_util/cssinjs/theme/createTheme.mjs";import n from"../_util/cssinjs/hooks/useCacheToken.mjs";import"../_util/cssinjs/hooks/useStyleRegister/index.mjs";import{PresetColors as r}from"./interface/presetColors.mjs";import i from"./themes/seed.mjs";import a from"./themes/default/index.mjs";import o from"./util/alias.mjs";import s from"./util/genComponentStyleHook.mjs";import c,{merge as l}from"./util/statistic.mjs";import{computed as u,defineComponent as d,inject as f,provide as p,shallowRef as m,triggerRef as h,unref as g,watch as _}from"vue";var v=t(a),y={token:i,hashed:!0},b=Symbol(`DesignTokenContext`),x=m(),S=e=>{p(b,e),_(e,()=>{x.value=g(e),h(x)},{immediate:!0,deep:!0})},C=d({props:{value:e()},setup(e,{slots:t}){return S(u(()=>e.value)),()=>t.default?.()}});function w(){let e=f(b,u(()=>x.value||y)),t=u(()=>`${e.value.hashed||``}`),r=u(()=>e.value.theme||v),a=n(r,u(()=>[i,e.value.token]),u(()=>({salt:t.value,override:{override:e.value.token,...e.value.components},formatToken:o})));return[r,u(()=>a.value[0]),u(()=>e.value.hashed?a.value[1]:``)]}export{C as DesignTokenProvider,r as PresetColors,y as defaultConfig,s as genComponentStyleHook,x as globalDesignTokenApi,l as mergeToken,c as statisticToken,S as useDesignTokenProvider,w as useToken};