{"version":3,"file":"LessonCheckmark.C1shdhaB.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Oh2vncB6Tr7x0Eu9udqJ/EQEezs9WIyeYnvpkNCON/LessonCheckmark.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const normalizeUrl=url=>{if(!url)return\"\";return url.split(\"?\")[0].replace(/\\/$/,\"\").toLowerCase().trim();};export default function LessonCheckmark(props){const{embedUrl,activeColor,inactiveColor}=props;const[isCompleted,setIsCompleted]=useState(false);const cleanUrl=normalizeUrl(embedUrl);const storageKey=cleanUrl?`bunny_done_${cleanUrl}`:\"\";useEffect(()=>{if(!cleanUrl)return;if(localStorage.getItem(storageKey)===\"true\"){setIsCompleted(true);}else{setIsCompleted(false);}const handleVideoCompleted=e=>{if(e.detail?.cleanUrl===cleanUrl){setIsCompleted(true);}};window.addEventListener(\"bunnyVideoCompleted\",handleVideoCompleted);return()=>{window.removeEventListener(\"bunnyVideoCompleted\",handleVideoCompleted);};},[cleanUrl,storageKey]);if(!embedUrl){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"#666\",fontSize:\"10px\"},children:\"No URL\"});}return /*#__PURE__*/_jsx(\"div\",{style:{display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:\"18px\",height:\"18px\",borderRadius:\"50%\",backgroundColor:isCompleted?activeColor:\"transparent\",border:isCompleted?\"none\":`2px solid ${inactiveColor}`,color:\"#FFFFFF\",fontSize:\"11px\",fontWeight:\"bold\",fontFamily:\"sans-serif\",transition:\"all 0.2s ease\",flexShrink:0},children:isCompleted?\"✓\":\"\"});}addPropertyControls(LessonCheckmark,{embedUrl:{type:ControlType.String,title:\"Embed URL\",placeholder:\"https://iframe.mediadelivery.net/embed/...\"},activeColor:{type:ControlType.Color,title:\"Done Color\",defaultValue:\"#10B981\"},inactiveColor:{type:ControlType.Color,title:\"Circle Border\",defaultValue:\"#444444\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LessonCheckmark\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LessonCheckmark.map"],"mappings":"+LAAiP,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,cAAY,iBAAe,EAAW,CAAC,EAAY,GAAgBA,EAAS,EAAK,EAAQ,EAAS,EAAa,CAAQ,EAAQ,EAAW,EAAS,cAAc,IAAW,GAAwf,OAArf,MAAc,CAAC,GAAG,CAAC,EAAS,OAAU,aAAa,QAAQ,CAAU,IAAI,OAAQ,EAAe,EAAI,EAAQ,EAAe,EAAK,EAAG,IAAM,EAAqB,GAAG,CAAI,EAAE,QAAQ,WAAW,GAAU,EAAe,EAAI,CAAG,EAAsE,OAApE,EAAO,iBAAiB,sBAAsB,CAAoB,MAAY,CAAC,EAAO,oBAAoB,sBAAsB,CAAoB,CAAE,CAAE,EAAE,CAAC,EAAS,CAAU,CAAC,EAAM,EAAwH,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,cAAc,WAAW,SAAS,eAAe,SAAS,MAAM,OAAO,OAAO,OAAO,aAAa,MAAM,gBAAgB,EAAY,EAAY,cAAc,OAAO,EAAY,OAAO,aAAa,IAAgB,MAAM,UAAU,SAAS,OAAO,WAAW,OAAO,WAAW,aAAa,WAAW,gBAAgB,WAAW,CAAC,EAAE,SAAS,EAAY,IAAI,EAAE,CAAC,EAAzd,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,SAAS,MAAM,EAAE,SAAS,QAAQ,CAAC,CAAwZ,uBAA9zC,IAAsC,IAAoD,EAAO,EAAa,GAAU,EAAoB,EAAI,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,EAAjE,GAA6rC,EAAoB,EAAgB,CAAC,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,YAAY,4CAA4C,EAAE,YAAY,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,cAAc,CAAC,KAAK,EAAY,MAAM,MAAM,gBAAgB,aAAa,SAAS,CAAC,CAAC"}