{"version":3,"file":"Timer.BcsAxvRY.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/1UN1Ru3QOtodVBk31FeN/cVZuke7wrBU24ryIH4KS/Timer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function PremiumResetTimer(props){const{resetHour,fontFamily,fontSize,textColor,boxColor,boxPadding,borderRadius,gap}=props;function getSecondsUntilReset(){const now=new Date;const estNow=new Date(now.toLocaleString(\"en-US\",{timeZone:\"America/New_York\"}));const resetTime=new Date(estNow);resetTime.setHours(resetHour,0,0,0);if(estNow>=resetTime){resetTime.setDate(resetTime.getDate()+1);}return Math.floor((resetTime-estNow)/1e3);}const[timeLeft,setTimeLeft]=useState(getSecondsUntilReset());useEffect(()=>{const interval=setInterval(()=>{setTimeLeft(prev=>{if(prev<=1){return getSecondsUntilReset();}return prev-1;});},1e3);return()=>clearInterval(interval);},[resetHour]);const hours=Math.floor(timeLeft/3600);const mins=Math.floor(timeLeft%3600/60);const secs=timeLeft%60;const format=num=>String(num).padStart(2,\"0\");const boxStyle={padding:boxPadding,borderRadius:borderRadius,background:boxColor,color:textColor,fontFamily:fontFamily,fontSize:fontSize,fontWeight:600,minWidth:fontSize*2,textAlign:\"center\",boxShadow:\"inset 0 2px 4px rgba(0,0,0,0.35), inset 0 -2px 4px rgba(255,255,255,0.15)\",backdropFilter:\"blur(4px)\"};const colonStyle={color:textColor,fontSize:fontSize,fontFamily:fontFamily,opacity:.8};return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:gap,background:\"transparent\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"div\",{style:boxStyle,children:format(hours)}),/*#__PURE__*/_jsx(\"div\",{style:colonStyle,children:\":\"}),/*#__PURE__*/_jsx(\"div\",{style:boxStyle,children:format(mins)}),/*#__PURE__*/_jsx(\"div\",{style:colonStyle,children:\":\"}),/*#__PURE__*/_jsx(\"div\",{style:boxStyle,children:format(secs)})]});}addPropertyControls(PremiumResetTimer,{resetHour:{type:ControlType.Number,title:\"Reset Hour (EST)\",defaultValue:0,min:0,max:23},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:\"Inter\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:32,min:12,max:120},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#ffffff\"},boxColor:{type:ControlType.Color,title:\"Box Color\",defaultValue:\"#2b2b2b\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:10,min:0,max:50},boxPadding:{type:ControlType.Number,title:\"Padding\",defaultValue:10,min:0,max:40},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:30}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PremiumResetTimer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Timer.map"],"mappings":"mLAAmJ,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,YAAU,aAAW,WAAS,YAAU,WAAS,aAAW,eAAa,OAAK,EAAM,SAAS,GAAsB,CAAC,IAAM,EAAI,IAAI,KAAW,EAAO,IAAI,KAAK,EAAI,eAAe,QAAQ,CAAC,SAAS,mBAAmB,CAAC,CAAC,CAAO,EAAU,IAAI,KAAK,EAAO,CAAqG,OAApG,EAAU,SAAS,EAAU,EAAE,EAAE,EAAE,CAAI,GAAQ,GAAW,EAAU,QAAQ,EAAU,SAAS,CAAC,EAAE,CAAS,KAAK,OAAO,EAAU,GAAQ,IAAI,CAAE,GAAK,CAAC,EAAS,GAAaA,EAAS,GAAsB,CAAC,CAAC,MAAc,CAAC,IAAM,EAAS,gBAAgB,CAAC,EAAY,GAAU,GAAM,EAAU,GAAsB,CAAS,EAAK,EAAI,EAAG,IAAI,CAAC,UAA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