{"version":3,"file":"Countdown.Clkvb2sc.mjs","names":["timeLeft"],"sources":["https:/framerusercontent.com/modules/HnLLXCUjRavoXVdLDugY/dDCAHcYLbiXI3PgceGTM/XOGxNtvsA.js","https:/framerusercontent.com/modules/A7zoVxroBRnMpcXEgkV9/PF3FaAHhXUDTvck0w2O3/Countdown.js"],"sourcesContent":["// Generated by Framer (06534cb)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"GF;Geist-500\",\"GF;Geist-700\"]);export const fonts=[{explicitInter:true,fonts:[{family:\"Geist\",source:\"google\",style:\"normal\",url:\"https://fonts.gstatic.com/s/geist/v1/gyBhhwUxId8gMGYQMKR3pzfaWI_RruM4mJPby1QNtA.woff2\",weight:\"500\"},{family:\"Geist\",source:\"google\",style:\"normal\",url:\"https://fonts.gstatic.com/s/geist/v1/gyBhhwUxId8gMGYQMKR3pzfaWI_Re-Q4mJPby1QNtA.woff2\",weight:\"700\"}]}];export const css=['.framer-JG0RN .framer-styles-preset-ly49yt:not(.rich-text-wrapper), .framer-JG0RN .framer-styles-preset-ly49yt.rich-text-wrapper p { --framer-font-family: \"Geist\", \"Geist Placeholder\", sans-serif; --framer-font-family-bold: \"Geist\", \"Geist Placeholder\", sans-serif; --framer-font-open-type-features: normal; --framer-font-size: 14px; --framer-font-style: normal; --framer-font-style-bold: normal; --framer-font-variation-axes: normal; --framer-font-weight: 500; --framer-font-weight-bold: 700; --framer-letter-spacing: -0.03em; --framer-line-height: 1.2em; --framer-paragraph-spacing: 20px; --framer-text-alignment: start; --framer-text-color: var(--token-6c9f0706-c7df-4374-b4b0-8bf4d4d75293, #ffffff); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }'];export const className=\"framer-JG0RN\";\nexport const __FramerMetadata__ = {\"exports\":{\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// © Framer University. All rights reserved.\n// Distribution without written consent is prohibited.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function Countdown({fontSize,fontFamily,fontColor,fontWeight,spacerSize,displayDays,displayHours,displayMinutes,displaySeconds,endDate,endTime,endMessage}){const[timeLeft,setTimeLeft]=useState(calculateTimeLeft());useEffect(()=>{const timer=setTimeout(()=>{setTimeLeft(calculateTimeLeft());},1e3);return()=>clearTimeout(timer);});function calculateTimeLeft(){const difference=+new Date(`${endDate}T${endTime}`)-+new Date;let timeLeft={};if(difference>0){const time={d:Math.floor(difference/(1e3*60*60*24)),h:Math.floor(difference/(1e3*60*60)%24),m:Math.floor(difference/(1e3*60)%60),s:Math.floor(difference/1e3%60)};timeLeft={days:displayDays?time.d:null,hours:displayHours?time.h:null,minutes:displayMinutes?time.m:null,seconds:displaySeconds?time.s:null};}return timeLeft;}const timerComponents=[];Object.keys(timeLeft).forEach((interval,index,arr)=>{if(timeLeft[interval]!==null){timerComponents.push(/*#__PURE__*/_jsxs(\"span\",{style:{display:\"flex\",alignItems:\"center\",flexDirection:\"column\"},children:[timeLeft[interval],/*#__PURE__*/_jsx(\"span\",{style:{fontSize:`${fontSize/1.8}px`},children:interval.toLowerCase()})]},interval));// Add spacer except after the last element\nif(index<arr.length-1){timerComponents.push(/*#__PURE__*/_jsx(\"span\",{style:{margin:`0 ${spacerSize}px`,fontSize,fontFamily,color:fontColor,fontWeight},children:\"|\"},`spacer-${interval}`));}}});return /*#__PURE__*/_jsx(\"div\",{style:{fontSize,fontFamily,color:fontColor,fontWeight,display:\"flex\",alignItems:\"center\"},children:timerComponents.length?timerComponents:/*#__PURE__*/_jsx(\"span\",{children:endMessage})});}addPropertyControls(Countdown,{fontSize:{type:ControlType.Number,unit:\"px\",defaultValue:30},fontFamily:{type:ControlType.String,defaultValue:\"Inter\"},fontColor:{type:ControlType.Color,defaultValue:\"black\"},fontWeight:{type:ControlType.Enum,defaultValue:400,options:[\"normal\",\"bold\",\"bolder\",\"lighter\",100,200,300,400,500,600,700,800,900]},spacerSize:{type:ControlType.Number,unit:\"px\",defaultValue:10},displayDays:{type:ControlType.Boolean,defaultValue:true},displayHours:{type:ControlType.Boolean,defaultValue:true},displayMinutes:{type:ControlType.Boolean,defaultValue:true},displaySeconds:{type:ControlType.Boolean,defaultValue:true},endDate:{type:ControlType.String,defaultValue:\"2023-04-25\",description:\"YYYY-MM-DD\"},endTime:{type:ControlType.String,defaultValue:\"00:00:00\",description:\"HH:MM:SS\"},endMessage:{type:ControlType.String,defaultValue:\"Time's up!\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Countdown\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Countdown.map"],"mappings":"mTACoyC,AAApyC,GAA8B,GAAU,UAAU,CAAC,eAAe,cAAe,EAAC,CAAc,EAAM,CAAC,CAAC,eAAc,EAAK,MAAM,CAAC,CAAC,OAAO,QAAQ,OAAO,SAAS,MAAM,SAAS,IAAI,wFAAwF,OAAO,KAAM,EAAC,CAAC,OAAO,QAAQ,OAAO,SAAS,MAAM,SAAS,IAAI,wFAAwF,OAAO,KAAO,CAAA,CAAE,CAAA,EAAc,EAAI,CAAC,40BAA60B,EAAc,EAAU,iBCC3pC,SAAwB,EAAU,CAAC,WAAS,aAAW,YAAU,aAAW,aAAW,cAAY,eAAa,iBAAe,iBAAe,UAAQ,UAAQ,aAAW,CAAC,CAAC,GAAK,CAAC,EAAS,EAAY,CAAC,EAAS,GAAmB,CAAC,CAAC,EAAU,IAAI,CAAC,IAAM,EAAM,WAAW,IAAI,CAAC,EAAY,GAAmB,CAAC,AAAE,EAAC,IAAI,CAAC,MAAM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