import{makeStyle as e}from"@gem-sdk/core";let getDisplayStyle=e=>Object.keys(e??{}).filter(e=>["--d","--d-mobile","--d-tablet"].includes(e)).reduce((t,l)=>({...t,[l]:e?.[l]}),{}),pointerEventStyle=e=>Object.keys(e??{}).filter(e=>["--d","--d-mobile","--d-tablet"].includes(e)).reduce((t,l)=>({...t,[l.replace("--d","--pe")]:e?.[l]==="none"?"none":"auto"}),{}),getBorderStyle=e=>Object.keys(e??{}).filter(e=>["--bw","--bw-mobile","--bw-tablet","--bc","--bc-tablet","--bc-mobile","--b","--b-tablet","--b-mobile","--bs","--bs-tablet","--bs-mobile","--radius","--radius-tablet","--radius-mobile","--bblr","--bbrr","--btlr","--btrr","--bblr-tablet","--bbrr-tablet","--btlr-tablet","--btrr-tablet","--bblr-mobile","--bbrr-mobile","--btlr-mobile","--btrr-mobile"].includes(e)).reduce((t,l)=>({...t,[l]:e?.[l]}),{}),getWrapperDialogStyle=e=>Object.keys(e??{}).filter(e=>e.startsWith("--mt")||e.startsWith("--mb")||e.startsWith("--ml")||e.startsWith("--mr")).reduce((t,l)=>({...t,[l]:e?.[l]}),{}),getInnerStyle=e=>Object.keys(e??{}).filter(t=>!Object.keys(getWrapperDialogStyle(e)).includes(t)&&!Object.keys(getDisplayStyle(e)).includes(t)&&!Object.keys(getBorderStyle(e)).includes(t)).reduce((t,l)=>({...t,[l]:e?.[l]}),{}),createDialogKey=(e="",t="")=>({id:`dialog:${e}:${t}`,time:`dialog:${e}:${t}:time`}),isShowModal=(e,t=0)=>{let l=e?new Date(Number(e)):new Date,r=Date.now()-l.getTime(),i=Math.abs(r/24/60/60/1e3);return i>=t},isMobile=e=>!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e),getPropertyByDevice=(e,t)=>"tablet"===t?e?.tablet??e?.desktop:"mobile"===t?e?.mobile??e?.tablet??e?.desktop:e?.desktop,heightStyle=(t,l)=>({...t?.desktop?e({h:"100%"}):l?.desktop?e({h:l.desktop}):e({minh:"300px"}),"--h-tablet":getPropertyByDevice(t,"tablet")?"100%":getPropertyByDevice(l,"tablet")??"300px","--h-mobile":getPropertyByDevice(t,"mobile")?"100%":getPropertyByDevice(l,"mobile")??"300px","--maxh":getPropertyByDevice(t,"desktop")?"100%":"","--maxh-tablet":getPropertyByDevice(t,"tablet")?"100%":"","--maxh-mobile":getPropertyByDevice(t,"mobile")?"100%":""}),removeHeightPercentForContent=e=>({...e,"--h":e["--h"]?.includes("%")?"100%":e["--h"],"--h-tablet":e["--h-tablet"]?.includes("%")?"100%":e["--h-tablet"],"--h-mobile":e["--h-mobile"]?.includes("%")?"100%":e["--h-mobile"]}),parseNumber=e=>{let t=parseFloat(e?.toString()??"0");return isNaN(t)?0:t},getOverlayOpacity=e=>"number"!=typeof e||isNaN(e)?"string"==typeof e?parseFloat(e)+"%":"0%":e+"%";export{createDialogKey,getBorderStyle,getDisplayStyle,getInnerStyle,getOverlayOpacity,getPropertyByDevice,getWrapperDialogStyle,heightStyle,isMobile,isShowModal,parseNumber,pointerEventStyle,removeHeightPercentForContent};
