"use strict";var e=require("@gem-sdk/core"),r=require("react");const t=(e,r)=>`--${e}${"desktop"===r?"":`-${r}`}`;exports.isColorDark=function(e){if(!e)return;e=e.replace(/^#/,"");let r=parseInt(e.slice(0,2),16),t=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return .2126*r+.7152*t+.0722*n<128},exports.makeStyleGapForLabel=(r,n)=>{let s={};return e.DEVICES.forEach(u=>{let c=t("mr",u),l=t("mb",u),o=e.getResponsiveValueByScreen(r,u);s="vertical"===o?{...s,[l]:n,[c]:"0px"}:{...s,[c]:n,[l]:"0px"}}),s},exports.useTransition=(e,t)=>{let n=r.useRef(null),s=r.useRef([]);r.useEffect(()=>{n.current=e},[e]),r.useEffect(()=>{null!==s.current&&n.current&&"function"==typeof n.current&&n.current(...s.current),s.current=t},t)};
