{"version":3,"file":"LocalTime.bCXo7_XA.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/BpMeEBaoXG1KHC5OaOFL/thiFbPgzFuwCKYup4Idb/LocalTime.js"],"sourcesContent":["/** @framerDisableUnlink */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const timeZones={\"New York (EST)\":\"America/New_York\",\"Los Angeles (PST)\":\"America/Los_Angeles\",\"Kolkata (IST)\":\"Asia/Kolkata\",\"Tokyo (JST)\":\"Asia/Tokyo\",\"Sydney (AEST)\":\"Australia/Sydney\",\"Berlin (CET)\":\"Europe/Berlin\",\"Dubai (GST)\":\"Asia/Dubai\",\"Beijing (CST)\":\"Asia/Shanghai\",\"Toronto (EST)\":\"America/Toronto\",\"S\\xe3o Paulo (BRT)\":\"America/Sao_Paulo\",\"Cairo (EET)\":\"Africa/Cairo\",\"Johannesburg (SAST)\":\"Africa/Johannesburg\",\"Singapore (SGT)\":\"Asia/Singapore\",\"Hong Kong (HKT)\":\"Asia/Hong_Kong\",\"Seoul (KST)\":\"Asia/Seoul\",\"Paris (CET)\":\"Europe/Paris\",\"Madrid (CET)\":\"Europe/Madrid\",\"Amsterdam (CET)\":\"Europe/Amsterdam\",\"London (GMT)\":\"Europe/London\",\"Stockholm (CET)\":\"Europe/Stockholm\",\"Copenhagen (CET)\":\"Europe/Copenhagen\",\"Oslo (CET)\":\"Europe/Oslo\",\"Rome (CET)\":\"Europe/Rome\",\"Lisbon (WET)\":\"Europe/Lisbon\",\"Dublin (GMT)\":\"Europe/Dublin\",\"Chicago (CST)\":\"America/Chicago\",\"Mexico City (CST)\":\"America/Mexico_City\",\"Vancouver (PST)\":\"America/Vancouver\",\"Bogot\\xe1 (COT)\":\"America/Bogota\",\"Lima (PET)\":\"America/Lima\",\"Santiago (CLT)\":\"America/Santiago\",\"Reykjavik (GMT)\":\"Atlantic/Reykjavik\",\"Casablanca (WET)\":\"Africa/Casablanca\"};export default function LocalTimeZone({selectedTimeZone=\"Kolkata (IST)\",showSeconds=true,font={fontFamily:\"Inter\",fontSize:24,fontWeight:\"500\",letterSpacing:\"0px\",lineHeight:\"24px\",textAlign:\"left\"},textColor=\"#66BB6A\"}){const[time,setTime]=useState(new Date);const[hasError,setHasError]=useState(false);const[errorMessage,setErrorMessage]=useState(\"\");// Update time every second\nuseEffect(()=>{const timer=setInterval(()=>{setTime(new Date);},1e3);return()=>clearInterval(timer);},[]);// Validate selected time zone\nuseEffect(()=>{if(!timeZones[selectedTimeZone]){console.warn(\"Invalid time zone selected:\",selectedTimeZone);setHasError(true);setErrorMessage(\"Invalid Time Zone\");}else{setHasError(false);setErrorMessage(\"\");}},[selectedTimeZone]);// Configure time display options (no TypeScript annotation)\nconst options={timeZone:timeZones[selectedTimeZone],hour:\"2-digit\",minute:\"2-digit\",hour12:true};if(showSeconds){options.second=\"2-digit\";}// Format the time with error handling\nlet timeString=\"\";try{timeString=time.toLocaleTimeString(\"en-US\",options);}catch(e){console.error(\"Error formatting time:\",e);setHasError(true);setErrorMessage(\"Error Displaying Time\");timeString=\"Error\"// Fallback string\n;}// Apply styles to the component\nconst style={color:textColor,borderRadius:\"5px\",display:\"inline-block\",...font};// Render error message if applicable\nif(hasError){return /*#__PURE__*/_jsxs(\"div\",{style:style,children:[/*#__PURE__*/_jsx(\"strong\",{children:\"Error:\"}),\" \",errorMessage]});}// Render the time\nreturn /*#__PURE__*/_jsx(\"div\",{style:style,children:timeString});}// Property controls for Framer\naddPropertyControls(LocalTimeZone,{selectedTimeZone:{type:ControlType.Enum,title:\"Time Zone\",defaultValue:\"Kolkata (IST)\",options:Object.keys(timeZones),optionTitles:Object.keys(timeZones),description:\"Choose a time zone to display its current time.\"},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:true,description:\"Toggle to include seconds in the time display.\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#66BB6A\",description:\"Set the color of the time text.\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",description:\"More components at [DesignKits](https://design-kits.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LocalTimeZone\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LocalTime.map"],"mappings":"+KAA6xC,SAAwB,EAAc,CAAC,mBAAiB,gBAAgB,cAAY,GAAK,OAAK,CAAC,WAAW,QAAQ,SAAS,GAAG,WAAW,MAAM,cAAc,MAAM,WAAW,OAAO,UAAU,OAAO,CAAC,YAAU,WAAW,CAAC,GAAK,CAAC,EAAK,GAASA,EAAS,IAAI,KAAK,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,GAAG,CAC7nD,MAAc,CAAC,IAAM,EAAM,gBAAgB,CAAC,EAAQ,IAAI,KAAK,EAAG,IAAI,CAAC,UAAU,cAAc,EAAM,EAAG,EAAE,CAAC,CACzG,MAAc,CAAK,EAAU,IAA6I,EAAY,GAAM,CAAC,EAAgB,GAAG,GAAhK,QAAQ,KAAK,8BAA8B,EAAiB,CAAC,EAAY,GAAK,CAAC,EAAgB,oBAAoB,GAAiD,CAAC,EAAiB,CAAC,CACvO,IAAM,EAAQ,CAAC,SAAS,EAAU,GAAkB,KAAK,UAAU,OAAO,UAAU,OAAO,GAAK,CAAI,IAAa,EAAQ,OAAO,WAChI,IAAI,EAAW,GAAG,GAAG,CAAC,EAAW,EAAK,mBAAmB,QAAQ,EAAQ,OAAQ,EAAE,CAAC,QAAQ,MAAM,yBAAyB,EAAE,CAAC,EAAY,GAAK,CAAC,EAAgB,wBAAwB,CAAC,EAAW,QAEpM,IAAM,EAAM,CAAC,MAAM,EAAU,aAAa,MAAM,QAAQ,eAAe,GAAG,EAAK,CAE/E,OADG,EAA8B,EAAM,MAAM,CAAO,QAAM,SAAS,CAAc,EAAK,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