{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/3EkbYzZ7gnc4WWopOeiB/h68Hg1GVJa4oBbhz1MfW/NewItemLabel.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{cloneElement}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function NewItemLabel(props){var _props_layer,_props_style,_props_style1;const inRange=isWithinLastDays(props.date,props.days);if(!inRange){return /*#__PURE__*/_jsx(\"style\",{id:props.id,children:`\n                div:has(> #${props.id}) {\n                    display: none;\n                }\n            `});}let layer=(_props_layer=props.layer)===null||_props_layer===void 0?void 0:_props_layer[0];if(layer&&props.style&&(((_props_style=props.style)===null||_props_style===void 0?void 0:_props_style.width)||((_props_style1=props.style)===null||_props_style1===void 0?void 0:_props_style1.height))){layer=/*#__PURE__*/cloneElement(layer,{style:{...layer.props.style,...props.style}});}return /*#__PURE__*/_jsx(\"div\",{style:{display:\"contents\"},children:layer});}NewItemLabel.displayName=\"New Item Label\";addPropertyControls(NewItemLabel,{layer:{type:ControlType.ComponentInstance,description:\"Connect a layer outside of the breakpoint using the handle on the right side of the component.\"},date:{type:ControlType.Date},days:{type:ControlType.Number,defaultValue:7,min:0,step:1,displayStepper:true,description:\"Show layer if date is within this number of days\"}});function isWithinLastDays(dateString,days){const now=new Date;const date=new Date(dateString);// Calculate the difference in days between now and the given date\nconst diffInMs=now-date;const diffInDays=diffInMs/(1e3*60*60*24);// Return true if the difference is less than or equal to `days`\nreturn diffInDays<=days;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NewItemLabel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NewItemLabel.map"],
  "mappings": "gGAGkB,SAARA,EAA8BC,EAAM,CAAC,IAAIC,EAAaC,EAAaC,EAAoE,GAAG,CAA3CC,EAAiBJ,EAAM,KAAKA,EAAM,IAAI,EAAe,OAAoBK,EAAK,QAAQ,CAAC,GAAGL,EAAM,GAAG,SAAS;AAAA,6BACxLA,EAAM,EAAE;AAAA;AAAA;AAAA,aAGxB,CAAC,EAAG,IAAIM,GAAOL,EAAaD,EAAM,SAAS,MAAMC,IAAe,OAAO,OAAOA,EAAa,CAAC,EAAE,OAAGK,GAAON,EAAM,QAAU,GAAAE,EAAaF,EAAM,SAAS,MAAME,IAAe,SAAcA,EAAa,OAAU,GAAAC,EAAcH,EAAM,SAAS,MAAMG,IAAgB,SAAcA,EAAc,UAAUG,EAAmBC,EAAaD,EAAM,CAAC,MAAM,CAAC,GAAGA,EAAM,MAAM,MAAM,GAAGN,EAAM,KAAK,CAAC,CAAC,GAAuBK,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,UAAU,EAAE,SAASC,CAAK,CAAC,CAAE,CAACP,EAAa,YAAY,iBAAiBS,EAAoBT,EAAa,CAAC,MAAM,CAAC,KAAKU,EAAY,kBAAkB,YAAY,gGAAgG,EAAE,KAAK,CAAC,KAAKA,EAAY,IAAI,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,GAAK,YAAY,kDAAkD,CAAC,CAAC,EAAE,SAASL,EAAiBM,EAAWC,EAAK,CAAC,IAAMC,EAAI,IAAI,KAAWC,EAAK,IAAI,KAAKH,CAAU,EAEp8B,OADeE,EAAIC,IAAgC,IAAI,GAAG,GAAG,KAC1CF,CAAK",
  "names": ["NewItemLabel", "props", "_props_layer", "_props_style", "_props_style1", "isWithinLastDays", "p", "layer", "q", "addPropertyControls", "ControlType", "dateString", "days", "now", "date"]
}
