{"version":3,"file":"Clock.D__ItGzy.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/BIHaw55VACfRKwSgwtj7/dxiuhdVIhwsLpxCWX1Sq/Clock.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Component made by Eleveight Supply, All rights reserved.\n/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function Clock(props){const{timezone,is24HourFormat,showSeconds,font,fontSize,textColor,textAlign,dateSettings,prefixSuffixSettings,style}=props;const{showDate,dateFormat,datePosition,monthFormat}=dateSettings;const{usePrefixSuffix,text:psText}=prefixSuffixSettings;const[currentDateTime,setCurrentDateTime]=useState(\"\");const[isValidTimezone,setIsValidTimezone]=useState(true);useEffect(()=>{function updateDateTime(){try{const now=new Date;const timeOptions={hour:\"2-digit\",minute:\"2-digit\",second:showSeconds?\"2-digit\":undefined,timeZone:timezone,hour12:!is24HourFormat};const dateOptions={timeZone:timezone,year:dateFormat.includes(\"Y\")?\"numeric\":undefined,month:dateFormat.includes(\"M\")?monthFormat===\"text\"?\"long\":\"2-digit\":undefined,day:dateFormat.includes(\"D\")?\"2-digit\":undefined};const timeFormatter=new Intl.DateTimeFormat(\"en-US\",timeOptions);const dateFormatter=new Intl.DateTimeFormat(\"en-US\",dateOptions);const timeString=timeFormatter.format(now);const dateString=showDate?dateFormatter.format(now):\"\";let combinedString=timeString;if(dateString){combinedString=datePosition===\"suffix\"?`${timeString} - ${dateString}`:`${dateString} - ${timeString}`;}if(usePrefixSuffix===\"prefix\"&&psText){combinedString=`${psText} ${combinedString}`;}else if(usePrefixSuffix===\"suffix\"&&psText){combinedString=`${combinedString} ${psText}`;}setCurrentDateTime(combinedString);setIsValidTimezone(true);}catch(error){console.error(\"Error with timezone: \",error);setIsValidTimezone(false);}}updateDateTime();const intervalId=setInterval(updateDateTime,1e3);return()=>clearInterval(intervalId);},[timezone,is24HourFormat,showSeconds,showDate,dateFormat,datePosition,monthFormat,usePrefixSuffix,psText]);const justifyContent=textAlign===\"center\"?\"center\":textAlign===\"right\"?\"flex-end\":\"flex-start\";const rootStyle={...style,display:\"flex\",justifyContent,alignItems:\"flex-start\",boxSizing:\"border-box\",/**\n         * Same behavior as the copyright component:\n         * - Fill respects Framer's injected width.\n         * - Fit Content falls back to max-content.\n         */width:style?.width??\"max-content\",maxWidth:\"100%\",minWidth:0};const textStyle={display:\"block\",boxSizing:\"border-box\",/**\n         * Keeps Fit Content measured as one line,\n         * but allows wrapping inside constrained Fill/fixed parents.\n         */width:\"max-content\",maxWidth:\"100%\",whiteSpace:\"normal\",overflowWrap:\"normal\",wordBreak:\"normal\",fontSize:`${fontSize}px`,fontFeatureSettings:\"'tnum'\",fontVariantNumeric:\"lining-nums\",color:textColor,textAlign,...font};return /*#__PURE__*/_jsx(\"div\",{style:rootStyle,children:/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:isValidTimezone?currentDateTime:\"Invalid timezone\"})});}Clock.defaultProps={timezone:\"America/New_York\",is24HourFormat:true,showSeconds:false,dateSettings:{showDate:false,dateFormat:\"DMY\",datePosition:\"prefix\",monthFormat:\"number\"},prefixSuffixSettings:{usePrefixSuffix:\"none\",text:\"\"},textColor:\"#999999\",fontSize:24,textAlign:\"left\",font:{family:\"Inter\"}};addPropertyControls(Clock,{timezone:{type:ControlType.String,title:\"Timezone\",defaultValue:\"America/New_York\",description:\"Use a timezone identifier ie: 'America/Los_Angeles' [Full list here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:\"Inter\",controls:\"extended\"},textColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#999999\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:24,min:1,max:200,step:1},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},is24HourFormat:{type:ControlType.Boolean,title:\"Format\",defaultValue:true,enabledTitle:\"24h\",disabledTitle:\"12h\"},showSeconds:{type:ControlType.Boolean,title:\"Seconds\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},prefixSuffixSettings:{type:ControlType.Object,title:\"Prefix/Suffix\",controls:{usePrefixSuffix:{type:ControlType.SegmentedEnum,title:\"Use\",options:[\"none\",\"prefix\",\"suffix\"],optionTitles:[\"None\",\"Pref.\",\"Suff.\"],defaultValue:\"none\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"\",description:\"Include your divider directly here, ie: - , :\"}}},dateSettings:{type:ControlType.Object,title:\"Date\",controls:{showDate:{type:ControlType.Boolean,title:\"Show Date\",defaultValue:false},dateFormat:{type:ControlType.Enum,title:\"Format\",options:[\"D\",\"M\",\"DM\",\"DMY\"],optionTitles:[\"Only Day\",\"Only Month\",\"Day and Month\",\"Day, Month and Year\"],defaultValue:\"DMY\",hidden:({showDate})=>!showDate},datePosition:{type:ControlType.SegmentedEnum,title:\"Position\",options:[\"prefix\",\"suffix\"],optionTitles:[\"Front\",\"End\"],defaultValue:\"prefix\",hidden:({showDate})=>!showDate},monthFormat:{type:ControlType.SegmentedEnum,title:\"Month Format\",options:[\"number\",\"text\"],optionTitles:[\"Numeric\",\"Text\"],defaultValue:\"number\",hidden:({showDate})=>!showDate}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Clock\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Clock.map"],"mappings":"iLAMG,SAAwB,EAAM,EAAM,CAAC,GAAK,CAAC,WAAS,iBAAe,cAAY,OAAK,WAAS,YAAU,YAAU,eAAa,uBAAqB,SA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