{"version":3,"file":"PromoTimer.8aRO2Ycg.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/7hRagBXID5w1D9Sc83yj/i7Bow4BuLH20AKbQt7IQ/PromoTimer.js"],"sourcesContent":["// Timer countdown component with promo code display\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Timer Countdown Component with Promo Code Display\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function PromoTimer(props){const{title,discountCode,timerLength,backgroundColor,titleColor,codeBackgroundColor,codeTextColor,timerBackgroundColor,timerTextColor,checkmarkColor,titleFont,codeFont,timerFont,mainPadding,sectionGap,elementGap,codePadding,timerPadding}=props;const[timeLeft,setTimeLeft]=useState(timerLength*60);useEffect(()=>{startTransition(()=>{setTimeLeft(timerLength*60);});},[timerLength]);useEffect(()=>{if(timeLeft<=0)return;const timer=setInterval(()=>{startTransition(()=>{setTimeLeft(prev=>Math.max(0,prev-1));});},1e3);return()=>clearInterval(timer);},[timeLeft]);const formatTime=seconds=>{const mins=Math.floor(seconds/60);const secs=seconds%60;return`${mins}:${secs.toString().padStart(2,\"0\")}`;};return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor,borderRadius:16,padding:mainPadding,display:\"flex\",flexDirection:\"column\",gap:sectionGap},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:elementGap},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:32,height:32,backgroundColor:\"#4A90E2\",borderRadius:8,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 20 20\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"10\",cy:\"10\",r:\"8\",stroke:\"#FFFFFF\",strokeWidth:\"1.5\",fill:\"none\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M10 6v4l3 2\",stroke:\"#FFFFFF\",strokeWidth:\"1.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})]})}),/*#__PURE__*/_jsx(\"span\",{style:{color:titleColor,...titleFont},children:title})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:elementGap,alignItems:\"center\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,backgroundColor:codeBackgroundColor,borderRadius:12,padding:codePadding,display:\"flex\",alignItems:\"center\",gap:elementGap},children:[/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 20 20\",fill:\"none\",style:{flexShrink:0},children:/*#__PURE__*/_jsx(\"path\",{d:\"M16.25 6.25L8.125 14.375L3.75 10\",stroke:checkmarkColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),/*#__PURE__*/_jsx(\"span\",{style:{color:codeTextColor,...codeFont},children:discountCode})]}),/*#__PURE__*/_jsx(\"div\",{style:{backgroundColor:timerBackgroundColor,borderRadius:12,padding:timerPadding,width:100,textAlign:\"center\"},children:/*#__PURE__*/_jsx(\"span\",{style:{color:timerTextColor,...timerFont},children:formatTime(timeLeft)})})]})]});}addPropertyControls(PromoTimer,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Your promo code applied!\"},discountCode:{type:ControlType.String,title:\"Discount Code\",defaultValue:\"BETTER_YOU_08_2025\"},timerLength:{type:ControlType.Number,title:\"Timer Length (minutes)\",defaultValue:8,min:0,max:60,step:1},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#E8E8F5\"},titleColor:{type:ControlType.Color,title:\"Title Color\",defaultValue:\"#333333\"},codeBackgroundColor:{type:ControlType.Color,title:\"Code Background\",defaultValue:\"#FFFFFF\"},codeTextColor:{type:ControlType.Color,title:\"Code Text Color\",defaultValue:\"#333333\"},timerBackgroundColor:{type:ControlType.Color,title:\"Timer Background\",defaultValue:\"#FFFFFF\"},timerTextColor:{type:ControlType.Color,title:\"Timer Text Color\",defaultValue:\"#4A90E2\"},checkmarkColor:{type:ControlType.Color,title:\"Checkmark Color\",defaultValue:\"#4A90E2\"},titleFont:{type:ControlType.Font,title:\"Title Font\",defaultValue:{fontSize:\"18px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},codeFont:{type:ControlType.Font,title:\"Code Font\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},timerFont:{type:ControlType.Font,title:\"Timer Font\",defaultValue:{fontSize:\"24px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},mainPadding:{type:ControlType.Number,title:\"Main Padding\",defaultValue:24,min:0,max:50,step:1,unit:\"px\"},sectionGap:{type:ControlType.Number,title:\"Section Gap\",defaultValue:16,min:0,max:40,step:1,unit:\"px\"},elementGap:{type:ControlType.Number,title:\"Element Gap\",defaultValue:12,min:0,max:30,step:1,unit:\"px\"},codePadding:{type:ControlType.Number,title:\"Code Padding\",defaultValue:16,min:0,max:30,step:1,unit:\"px\"},timerPadding:{type:ControlType.Number,title:\"Timer Padding\",defaultValue:16,min:0,max:30,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PromoTimer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceM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