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