import u from"../../../node_modules/.pnpm/@emotion_unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.mjs";const f=/url\([^)]+\)|var\([^)]+\)|(\d+(?:\.\d+)?|\.\d+)px/g;function d(s,i){const o=10**(i+1),c=Math.floor(s*o);return Math.round(c/10)*10/o}const h=(s={})=>{const{rootValue:i=16,precision:o=5,mediaQuery:c=!1}=s,p=(n,t)=>{if(!t)return n;const e=Number.parseFloat(t);return e<=1?n:`${d(e/i,o)}rem`};return{visit:n=>{const t={...n};return Object.entries(n).forEach(([e,r])=>{if(typeof r=="string"&&r.includes("px")){const l=r.replace(f,p);t[e]=l}!u[e]&&typeof r=="number"&&r!==0&&(t[e]=`${r}px`.replace(f,p));const a=e.trim();if(a.startsWith("@")&&a.includes("px")&&c){const l=e.replace(f,p);t[l]=t[e],delete t[e]}}),t}}};export{h as default};
