function e(e,r){return"string"==typeof r&&/^\s*\|/.test(r)?"string"==typeof e?e+r:r.replace(/^\s*\|\s*/,""):r||null}function r(e,r){const s=Object.create(null);for(const[t,c]of Object.entries(e))if(c){s[t]={};for(const e of Object.keys(c))r.includes(e)&&(s[t][e]=c[e])}return s}function s(s,t){const c={...s};for(const[o,n]of Object.entries(t))switch(o){case"generic":c[o]=Boolean(n);break;case"cssWideKeywords":c[o]=s[o]?[...s[o],...n]:n||[];break;case"units":c[o]={...s[o]};for(const[e,r]of Object.entries(n))c[o][e]=Array.isArray(r)?r:[];break;case"atrules":c[o]={...s[o]};for(const[r,s]of Object.entries(n)){const t=c[o][r]||{},n=c[o][r]={prelude:t.prelude||null,descriptors:{...t.descriptors}};if(s){n.prelude=s.prelude?e(n.prelude,s.prelude):n.prelude||null;for(const[r,t]of Object.entries(s.descriptors||{}))n.descriptors[r]=t?e(n.descriptors[r],t):null;Object.keys(n.descriptors).length||(n.descriptors=null)}}break;case"types":case"properties":c[o]={...s[o]};for(const[r,s]of Object.entries(n))c[o][r]=e(c[o][r],s);break;case"scope":case"features":c[o]={...s[o]};for(const[e,r]of Object.entries(n))c[o][e]={...c[o][e],...r};break;case"parseContext":c[o]={...s[o],...n};break;case"atrule":case"pseudo":c[o]={...s[o],...r(n,["parse"])};break;case"node":c[o]={...s[o],...r(n,["name","structure","parse","generate","walkContext"])}}return c}export{s as default};