import{generate as p}from"@ant-design/colors";import m from"../_util/canUseDom.mjs";import{updateCSS as f}from"../vc-util/Dom/dynamicCSS.mjs";import{TinyColor as s}from"../node_modules/.pnpm/@ctrl_tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/index.mjs";const g=`-ant-${Date.now()}-${Math.random()}`;function C(n,t){const o={},a=(i,c)=>{let l=i.clone();return l=c?.(l)||l,l.toRgbString()},e=(i,c)=>{const l=new s(i),r=p(l.toRgbString());o[`${c}-color`]=a(l),o[`${c}-color-disabled`]=r[1],o[`${c}-color-hover`]=r[4],o[`${c}-color-active`]=r[6],o[`${c}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),o[`${c}-color-deprecated-bg`]=r[0],o[`${c}-color-deprecated-border`]=r[2]};if(t.primaryColor){e(t.primaryColor,"primary");const i=new s(t.primaryColor),c=p(i.toRgbString());c.forEach((r,d)=>{o[`primary-${d+1}`]=r}),o["primary-color-deprecated-l-35"]=a(i,r=>r.lighten(35)),o["primary-color-deprecated-l-20"]=a(i,r=>r.lighten(20)),o["primary-color-deprecated-t-20"]=a(i,r=>r.tint(20)),o["primary-color-deprecated-t-50"]=a(i,r=>r.tint(50)),o["primary-color-deprecated-f-12"]=a(i,r=>r.setAlpha(r.getAlpha()*.12));const l=new s(c[0]);o["primary-color-active-deprecated-f-30"]=a(l,r=>r.setAlpha(r.getAlpha()*.3)),o["primary-color-active-deprecated-d-02"]=a(l,r=>r.darken(2))}return t.successColor&&e(t.successColor,"success"),t.warningColor&&e(t.warningColor,"warning"),t.errorColor&&e(t.errorColor,"error"),t.infoColor&&e(t.infoColor,"info"),`
  :root {
    ${Object.keys(o).map(i=>`--${n}-${i}: ${o[i]};`).join(`
`)}
  }
  `.trim()}function w(n,t){const o=C(n,t);m()&&f(o,`${g}-dynamic-theme`)}export{C as getStyle,w as registerTheme};
