{"version":3,"file":"LocalTime.CXaHDc0j.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/xp5vp8jtNnsyB93912AB/u1knK222viBVixdwOsyr/LocalTime.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const format=timeZone=>{try{return new Intl.DateTimeFormat(\"en-GB\",{hour:\"2-digit\",minute:\"2-digit\",timeZone}).format(new Date);}catch{return new Intl.DateTimeFormat(\"en-GB\",{hour:\"2-digit\",minute:\"2-digit\"}).format(new Date);}};/**\n * Local Time\n *\n * Shows a city name and its current time, for example \"Edinburgh 09:41\".\n * Set the time zone to an IANA name such as Europe/London or America/New_York.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function LocalTime(props){const{city=\"Edinburgh\",timeZone=\"Europe/London\",font,color=\"#FFFFFF\"}=props;const[time,setTime]=useState(\"09:41\");useEffect(()=>{if(typeof window===\"undefined\")return;setTime(format(timeZone));const id=window.setInterval(()=>setTime(format(timeZone)),15e3);return()=>window.clearInterval(id);},[timeZone]);return /*#__PURE__*/_jsx(\"span\",{style:{...props.style,...font,color,whiteSpace:\"nowrap\",fontVariantNumeric:\"tabular-nums\",minWidth:\"max-content\"},children:city?`${city} ${time}`:time});}addPropertyControls(LocalTime,{city:{type:ControlType.String,title:\"City\",defaultValue:\"Edinburgh\"},timeZone:{type:ControlType.String,title:\"Time zone\",defaultValue:\"Europe/London\",description:\"IANA name, for example Europe/London or America/New_York.\"},font:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"13px\",lineHeight:\"1.35em\"}},color:{type:ControlType.Color,title:\"Colour\",defaultValue:\"#FFFFFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LocalTime\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\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