{"version":3,"file":"RelativeToday.BHGU5kTH.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/9U0sLxPVu0tu6AP7Cr2Q/f6NcbgtOwqNHdmkLFI7p/RelativeToday.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";function getInclusiveToday(){const inclusiveToday=new Date;inclusiveToday.setUTCDate(inclusiveToday.getUTCDate()+1);return inclusiveToday.toISOString().split(\"T\")[0];}function useIsCzechPath(){const[isCzech,setIsCzech]=useState(false);useEffect(()=>{const updateLocale=()=>{setIsCzech(/^\\/cz(?:\\/|$)/i.test(window.location.pathname));};updateLocale();window.addEventListener(\"popstate\",updateLocale);return()=>window.removeEventListener(\"popstate\",updateLocale);},[]);return isCzech;}function useViewportWidth(){const[viewportWidth,setViewportWidth]=useState(null);useEffect(()=>{const updateWidth=()=>setViewportWidth(window.innerWidth);updateWidth();window.addEventListener(\"resize\",updateWidth);return()=>window.removeEventListener(\"resize\",updateWidth);},[]);return viewportWidth;}export function withTodaysDate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday()});};}export function withBlogListLocale(Component){return props=>{const isCzech=useIsCzechPath();const viewportWidth=useViewportWidth();let variant=props.variant;if(isCzech&&viewportWidth!==null){variant=viewportWidth<810?\"Mobile All\":viewportWidth<1200?\"Tablet All\":\"Blog List All\";}return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday(),variant:variant});};}export function withCategoryBlogLocale(Component){return props=>{const isCzech=useIsCzechPath();return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday(),variant:isCzech?\"CategoryBlogList All\":props.variant});};}export function withFeaturedBlogLocale(Component){return props=>{const isCzech=useIsCzechPath();const viewportWidth=useViewportWidth();let variant=props.variant;if(isCzech&&viewportWidth!==null){variant=viewportWidth<810?\"Phone All\":viewportWidth<1200?\"Tablet All\":\"Desktop All\";}return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday(),variant:variant});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withBlogListLocale\":{\"type\":\"reactHoc\",\"name\":\"withBlogListLocale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTodaysDate\":{\"type\":\"reactHoc\",\"name\":\"withTodaysDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFeaturedBlogLocale\":{\"type\":\"reactHoc\",\"name\":\"withFeaturedBlogLocale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCategoryBlogLocale\":{\"type\":\"reactHoc\",\"name\":\"withCategoryBlogLocale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RelativeToday.map"],"mappings":"uIAAiF,SAAS,GAAmB,CAAC,IAAM,EAAe,IAAI,KAA8D,OAAzD,EAAe,WAAW,EAAe,WAAW,EAAE,CAAC,EAAS,EAAe,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,EAAG,CAAC,SAAS,GAAgB,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAA2O,OAAzO,MAAc,CAAC,IAAM,MAAiB,CAAC,EAAW,iBAAiB,KAAK,EAAO,SAAS,QAAQ,CAAC,CAAE,EAAkE,OAAhE,EAAa,EAAE,EAAO,iBAAiB,WAAW,CAAY,MAAY,EAAO,oBAAoB,WAAW,CAAY,CAAE,EAAE,CAAC,CAAC,EAAS,CAAQ,CAAC,SAAS,GAAkB,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAS,IAAI,EAAwM,OAAtM,MAAc,CAAC,IAAM,MAAgB,EAAiB,EAAO,UAAU,EAA8D,OAA5D,EAAY,EAAE,EAAO,iBAAiB,SAAS,CAAW,MAAY,EAAO,oBAAoB,SAAS,CAAW,CAAE,EAAE,CAAC,CAAC,EAAS,CAAc,CAAsI,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAQ,EAAe,EAAQ,EAAc,EAAiB,EAAM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