{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/6PZjyZWIQtjzdJE0SfkA/ZYs8bZKx0vL0LOh8bf2c/Date_override_with_years.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";// Helper function to format a date input to an Icelandic date string\n// Returns the formatted string or null if formatting fails\nconst formatDateToIcelandic=dateInput=>{let d;// 1. Handle if dateInput is already a Date object\nif(dateInput instanceof Date){// Create a new Date object from the timestamp to avoid mutating the original and ensure it's a valid Date instance\nd=new Date(dateInput.getTime());}else if(typeof dateInput===\"string\"||typeof dateInput===\"number\"){// Attempt to parse the input using the Date constructor.\n// Note: new Date(string) can have browser/locale-dependent behavior for ambiguous formats (e.g., \"05/11/2024\").\n// ISO formats (\"YYYY-MM-DD\") or full month names (\"November 5, 2024\") are generally more reliable.\nd=new Date(dateInput);}else{// It's good practice to log a warning if you encounter an unexpected type,\n// though in a Framer override, console access might be different.\n// console.warn('formatDateToIcelandic: Unsupported input type. Expected Date, string, or number, got:', typeof dateInput, dateInput);\nreturn null// Indicate failure to format\n;}// 4. Validate the parsed/created date\n// isNaN(d.getTime()) is a reliable way to check if d is an \"Invalid Date\"\nif(!(d instanceof Date)||isNaN(d.getTime())){// console.warn('formatDateToIcelandic: Failed to create a valid date from input:', dateInput);\nreturn null// Indicate failure to format\n;}const icelandicMonths=[\"jan\\xfaar\",\"febr\\xfaar\",\"mars\",\"apr\\xedl\",\"ma\\xed\",\"j\\xfan\\xed\",\"j\\xfal\\xed\",\"\\xe1g\\xfast\",\"september\",\"okt\\xf3ber\",\"n\\xf3vember\",\"desember\"];const day=d.getDate();const monthIndex=d.getMonth();const year=d.getFullYear();// Double check monthIndex, though isNaN(d.getTime()) should have caught issues leading to bad month.\nif(monthIndex<0||monthIndex>=icelandicMonths.length){//  console.warn('formatDateToIcelandic: Invalid month index derived from date:', monthIndex, d);\nreturn null;}return`${day}. ${icelandicMonths[monthIndex]} ${year}`;};/**\n * Higher-Order Component that formats 'date' and 'text' props to an Icelandic date string.\n * If formatting fails for a prop, the original prop value is passed through.\n * This is intended for use as a Framer code override.\n * @param WrappedComponent The component to wrap.\n */export function withFormattedDate(WrappedComponent){const WithFormattedDateComponent=props=>{const{date,text,...rest}=props;// Attempt to format the 'date' prop\n// If 'date' is undefined, formatDateToIcelandic will not be called, resulting in formattedDateProp being null.\nconst formattedDateProp=date!==undefined?formatDateToIcelandic(date):null;// Attempt to format the 'text' prop\n// If 'text' is undefined, formatDateToIcelandic will not be called, resulting in formattedTextProp being null.\nconst formattedTextProp=text!==undefined?formatDateToIcelandic(text):null;// Prepare the new props for the WrappedComponent.\n// If formatting was successful (formattedDateProp/formattedTextProp is not null), use the formatted string.\n// Otherwise, fall back to the original 'date' or 'text' prop value.\nconst newProps={...rest,date:formattedDateProp!==null?formattedDateProp:date,text:formattedTextProp!==null?formattedTextProp:text}// Cast to P as we are reconstructing the props object\n;return /*#__PURE__*/_jsx(WrappedComponent,{...newProps});};// Assign a display name for better debugging if needed, though less critical in overrides\n// const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n// WithFormattedDateComponent.displayName = `WithFormattedDate(${wrappedComponentName})`;\nreturn WithFormattedDateComponent;}\nexport const __FramerMetadata__ = {\"exports\":{\"withFormattedDate\":{\"type\":\"reactHoc\",\"name\":\"withFormattedDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Date_override_with_years.map"],
  "mappings": "yCAEA,IAAMA,EAAsBC,GAAW,CAAC,IAAIC,EAC5C,GAAGD,aAAqB,KACxBC,EAAE,IAAI,KAAKD,EAAU,QAAQ,CAAC,UAAW,OAAOA,GAAY,UAAU,OAAOA,GAAY,SAGzFC,EAAE,IAAI,KAAKD,CAAS,MAGpB,QAAO,KAGP,GAAG,EAAEC,aAAa,OAAO,MAAMA,EAAE,QAAQ,CAAC,EAC1C,OAAO,KACL,IAAMC,EAAgB,CAAC,YAAY,aAAa,OAAO,WAAW,SAAS,aAAa,aAAa,cAAc,YAAY,aAAa,cAAc,UAAU,EAAQC,EAAIF,EAAE,QAAQ,EAAQG,EAAWH,EAAE,SAAS,EAAQI,EAAKJ,EAAE,YAAY,EACrP,OAAGG,EAAW,GAAGA,GAAYF,EAAgB,OACtC,KAAY,GAAGC,CAAG,KAAKD,EAAgBE,CAAU,CAAC,IAAIC,CAAI,EAAG,EAK1D,SAASC,EAAkBC,EAAiB,CAWtD,OAXwFC,GAAO,CAAC,GAAK,CAAC,KAAAC,EAAK,KAAAC,EAAK,GAAGC,CAAI,EAAEH,EAEnHI,EAAkBH,IAAO,OAAUV,EAAsBU,CAAI,EAAE,KAE/DI,EAAkBH,IAAO,OAAUX,EAAsBW,CAAI,EAAE,KAG/DI,EAAS,CAAC,GAAGH,EAAK,KAAKC,IAAoB,KAAKA,EAAkBH,EAAK,KAAKI,IAAoB,KAAKA,EAAkBH,CAAI,EAChI,OAAoBK,EAAKR,EAAiB,CAAC,GAAGO,CAAQ,CAAC,CAAE,CAGxB",
  "names": ["formatDateToIcelandic", "dateInput", "d", "icelandicMonths", "day", "monthIndex", "year", "withFormattedDate", "WrappedComponent", "props", "date", "text", "rest", "formattedDateProp", "formattedTextProp", "newProps", "p"]
}
