{"version":3,"file":"Time_Date.DUeCPenu.mjs","names":["React.useState","React.useRef","React.useMemo","__esmMin","_e","de","pe","c","init_jsx_runtime","init_npm_react_18_3_1","ce","addPropertyControls","init_framer_DxfB3JJo","ControlType","localeOptions","containerStyles","init_default_utils_js__0_45","fontStack","Time","props","rerenderOutputKey","setRerenderOutputKey","timerRef","text","locale","localeType","customLocale","formatOptions","outputType","showWeekday","monthFormat","showYear","showHours","showMinutes","showSeconds","timeFormat","timer","font","init_Time_Date","key"],"sources":["https:/framerusercontent.com/modules/nWprPVPdN2H0K6czWhM6/kSh7rKM8FBLIzrB49pQm/Time_Date.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{localeOptions,containerStyles,fontStack}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";/**\n * TIME\n *\n * @framerIntrinsicWidth 140\n * @framerIntrinsicHeight 20\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */ export function Time(props){const{outputType,fontFamily,fontSize,fontWeight,localeType,customLocale,timeFormat,showYear,showWeekday,showHours,showMinutes,showSeconds,monthFormat,color,font,alignment}=props;const[rerenderOutputKey,setRerenderOutputKey]=React.useState(`${Math.random()}`);const timerRef=React.useRef();const text=React.useMemo(()=>{const locale=localeType===\"custom\"?[customLocale]:[];let formatOptions;switch(outputType){case\"date\":formatOptions={weekday:showWeekday?\"long\":undefined,day:\"numeric\",month:monthFormat,year:showYear?\"numeric\":undefined};break;case\"time\":formatOptions={hour:showHours?\"numeric\":undefined,minute:showMinutes?\"numeric\":undefined,second:showSeconds&&showMinutes?\"numeric\":undefined,hour12:timeFormat===\"12h\"};break;default:console.error(`Unsupported outputType: ${outputType}`);break;}return new Intl.DateTimeFormat(locale,formatOptions).format(new Date);},[outputType,localeType,customLocale,timeFormat,showYear,showWeekday,showHours,showMinutes,showSeconds,monthFormat,rerenderOutputKey,]);React.useEffect(()=>{if(outputType===\"time\"){const timer=setInterval(()=>setRerenderOutputKey(`${Math.random()}`),(60-new Date().getSeconds())*1e3);timerRef.current=timer;return()=>{if(timer){return clearInterval(timer);}};}},[timerRef.current,outputType]);return /*#__PURE__*/ _jsx(\"div\",{style:{...containerStyles,color,fontFamily:fontStack,fontWeight:500,fontSize:16,...font},children:/*#__PURE__*/ _jsx(\"span\",{style:{width:\"100%\"},children:text})});}Time.defaultProps={height:20,width:140,outputType:\"time\",localeType:\"auto\",customLocale:\"en-US\",color:\"#999\",timeFormat:\"24h\",showYear:true,showWeekday:true,showHours:true,showMinutes:true,showSeconds:false,monthFormat:\"long\",alignment:\"center\"};Time.displayName=\"Time & Date\";addPropertyControls(Time,{outputType:{title:\"Type\",type:ControlType.Enum,displaySegmentedControl:true,options:[\"date\",\"time\"],optionTitles:[\"Date\",\"Time\"],defaultValue:Time.defaultProps.outputType},showWeekday:{title:\"Weekday\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:Time.defaultProps.showWeekday,hidden:props=>props.outputType!==\"date\"},monthFormat:{title:\"Month\",type:ControlType.Enum,options:[\"short\",\"long\",\"numeric\"],optionTitles:[\"Short\",\"Long\",\"Numeric\"],defaultValue:Time.defaultProps.monthFormat,hidden:props=>props.outputType!==\"date\"},showYear:{title:\"Year\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:Time.defaultProps.showYear,hidden:props=>props.outputType!==\"date\"},timeFormat:{title:\"Format\",type:ControlType.Enum,options:[\"12h\",\"24h\"],optionTitles:[\"12h\",\"24h\"],displaySegmentedControl:true,defaultValue:Time.defaultProps.timeFormat,hidden:props=>props.outputType!==\"time\"},showHours:{title:\"Hours\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:Time.defaultProps.showHours,hidden:props=>props.outputType!==\"time\"},showMinutes:{title:\"Minutes\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:Time.defaultProps.showMinutes,hidden:props=>props.outputType!==\"time\"},showSeconds:{title:\"Seconds\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:Time.defaultProps.showSeconds,hidden:props=>props.outputType!==\"time\"||!props.showMinutes},localeType:{title:\"Locale\",type:ControlType.Enum,displaySegmentedControl:true,options:[\"custom\",\"auto\"],optionTitles:[\"Custom\",\"Auto\"],defaultValue:Time.defaultProps.localeType},customLocale:{title:\" \",type:ControlType.Enum,options:Object.keys(localeOptions).sort(),optionTitles:Object.keys(localeOptions).sort().map(key=>localeOptions[key]),hidden:props=>props.localeType!==\"custom\",defaultValue:\"en\"},font:{// @ts-expect-error – Internal\ntype:ControlType.Font,controls:\"extended\"},color:{type:ControlType.Color,defaultValue:Time.defaultProps.color}});\nexport const __FramerMetadata__ = {\"exports\":{\"Time\":{\"type\":\"reactComponent\",\"name\":\"Time\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"140\",\"framerIntrinsicHeight\":\"20\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Time_Date.map"],"mappings":"A,8QAQI,SAAgBkB,EAAK,EAAM,CAAC,GAAK,CAAC,aAAW,aAAW,WAAS,aAAW,aAAW,eAAa,aAAW,WAAS,cAAY,YAAU,cAAY,cAAY,cAAY,QAAM,OAAK,aAAWC,EAAW,CAACC,EAAkBC,GAAsBrB,EAAe,GAAG,KAAK,OAAO,GAAG,EAAQsB,EAASrB,EAAa,EAAQsB,EAAKrB,MAAkB,CAAC,IAAMsB,EAAOC,IAAa,SAAS,CAACC,CAAY,EAAE,CAAC,EAAMC,EAAc,OAAOC,EAAP,CAAmB,IAAI,OAAO,EAAc,CAAC,QAAQC,EAAY,OAAO,IAAA,GAAU,IAAI,UAAU,MAAMC,EAAY,KAAKC,EAAS,UAAU,IAAA,EAAS,EAAE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