{"version":3,"file":"BarAlert_1_2.CppCL4vK.mjs","names":[],"sources":["https:/framerusercontent.com/modules/t241LTBB7mLzAKfcbVye/rpodUKELOrekRgLiYrP4/BarAlert_1_2.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";// ── Datas fixas ──────────────────────────────\nconst START_DATE=\"23/08/2026\";const END_DATE=\"06/09/2026\";// ─────────────────────────────────────────────\nfunction parseBRDate(dateString){const[day,month,year]=dateString.split(\"/\");return new Date(Number(year),Number(month)-1,Number(day));}export default function DailyProgressBar(props){const{mode,backgroundColor,progressColor,radius,animate,maxPercentage,textColor,font,fontSize}=props;const today=new Date;const start=parseBRDate(START_DATE);const end=parseBRDate(END_DATE);const totalDuration=end.getTime()-start.getTime();const elapsed=today.getTime()-start.getTime();let calculatedProgress=0;if(today<=start)calculatedProgress=0;else if(today>=end)calculatedProgress=100;else calculatedProgress=elapsed/totalDuration*100;const progress=Math.min(calculatedProgress,maxPercentage);const roundedProgress=Math.round(progress);if(mode===\"Text\"){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:textColor,...font,fontSize:fontSize},children:[roundedProgress,\"%\"]});}return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,borderRadius:radius,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:`${progress}%`,height:\"100%\",backgroundColor:progressColor,borderRadius:radius,transition:animate?\"width 0.6s ease\":\"none\"}})});}addPropertyControls(DailyProgressBar,{mode:{type:ControlType.Enum,title:\"Mode\",options:[\"Bar\",\"Text\"],defaultValue:\"Bar\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#E5E5E5\",hidden:p=>p.mode!==\"Bar\"},progressColor:{type:ControlType.Color,title:\"Progress\",defaultValue:\"#6644EE\",hidden:p=>p.mode!==\"Bar\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:100,hidden:p=>p.mode!==\"Bar\"},animate:{type:ControlType.Boolean,title:\"Animate\",defaultValue:true,hidden:p=>p.mode!==\"Bar\"},maxPercentage:{type:ControlType.Number,title:\"Max %\",defaultValue:100,min:1,max:100,unit:\"%\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontFamily:\"Inter\",fontWeight:600,lineHeight:\"1.2em\"},hidden:p=>p.mode!==\"Text\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:24,min:8,max:200,hidden:p=>p.mode!==\"Text\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#111111\",hidden:p=>p.mode!==\"Text\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DailyProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BarAlert_1_2.map"],"mappings":"mKAEA,SAAS,EAAY,EAAW,CAAC,GAAK,CAAC,EAAI,EAAM,GAAM,EAAW,MAAM,GAAG,EAAE,OAAO,IAAI,KAAK,OAAO,CAAI,EAAE,OAAO,CAAK,EAAE,EAAE,OAAO,CAAG,CAAC,CAAE,CAAC,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,OAAK,kBAAgB,gBAAc,SAAO,UAAQ,gBAAc,YAAU,OAAK,YAAU,EAAY,EAAM,IAAI,KAAW,EAAM,EAAY,CAAU,EAAQ,EAAI,EAAY,CAAQ,EAAQ,EAAc,EAAI,QAAQ,EAAE,EAAM,QAAQ,EAAQ,EAAQ,EAAM,QAAQ,EAAE,EAAM,QAAQ,EAAM,EAAmB,EAAE,AAAoF,EAAjF,GAAO,EAAyB,EAAU,GAAO,EAAuB,IAA4B,EAAQ,EAAc,IAAI,IAAM,EAAS,KAAK,IAAI,EAAmB,CAAa,EAAQ,EAAgB,KAAK,MAAM,CAAQ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