{"version":3,"file":"ArticleReadTime.zkpiVdgB.mjs","names":[],"sources":["https:/framerusercontent.com/modules/k9SAta0OWkpLAE0f8pdr/rADEv6h7tCGB62KUEysX/ArticleReadTime.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import readingTime from\"reading-time\";function getTextContentArrayFromReactElement(element){if(!element){return[];}if(typeof element===\"string\"){return[element];}if(Array.isArray(element)){return element.flatMap(getTextContentArrayFromReactElement);}if(element.props&&element.props.children){const children=Array.isArray(element.props.children)?element.props.children:[element.props.children];return children.flatMap(getTextContentArrayFromReactElement);}return[];}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ArticleReadTime(props){let hasText=false;let strings=[];if(props.formatted){strings=getTextContentArrayFromReactElement(props.formattedText);hasText=!props.formattedText||strings.length==0?false:true;}else{strings.push(props.plainText);hasText=props.plainText!==\"\";}let timeData=readingTime(strings.join(\" \"),{wordsPerMinute:props.wpm});return /*#__PURE__*/_jsx(\"p\",{style:{color:props.fontColor,userSelect:props.textSelect?\"auto\":\"none\",margin:0,...props.font},children:hasText?`${props.prefix}\n            ${Math.max(Math.round(timeData.minutes),1)}\n            ${props.suffix}`:\"No text content connected.\"});}ArticleReadTime.displayName=\"Article Read Time\";addPropertyControls(ArticleReadTime,{formatted:{type:ControlType.Boolean,defaultValue:true},formattedText:{type:ControlType.RichText,title:\"Text\",hidden(props){return!props.formatted;}},plainText:{type:ControlType.String,displayTextArea:true,title:\"Text\",hidden(props){return props.formatted;}},wpm:{type:ControlType.Number,defaultValue:200,step:1,min:1,title:\"WPM\",description:\"Words per minute\"},fontColor:{type:ControlType.Color,defaultValue:\"#000\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.4}},prefix:{type:ControlType.String},suffix:{type:ControlType.String,defaultValue:\" min read\"},textSelect:{type:ControlType.Boolean,defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ArticleReadTime\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ArticleReadTime.map"],"mappings":"6SAAqI,SAAS,EAAoC,EAAQ,CAAC,IAAI,EAAS,MAAM,CAAE,EAAE,UAAU,GAAU,SAAU,MAAM,CAAC,CAAQ,EAAE,GAAG,MAAM,QAAQ,EAAQ,CAAE,MAAO,GAAQ,QAAQ,EAAoC,CAAE,GAAG,EAAQ,OAAO,EAAQ,MAAM,SAAS,CAAC,IAAM,EAAS,MAAM,QAAQ,EAAQ,MAAM,SAAS,CAAC,EAAQ,MAAM,SAAS,CAAC,EAAQ,MAAM,QAAS,EAAC,MAAO,GAAS,QAAQ,EAAoC,AAAE,OAAM,CAAE,CAAE,CAG7iB,SAAwB,EAAgB,EAAM,CAAC,IAAI,GAAQ,EAAU,EAAQ,CAAE,EAAC,AAAG,EAAM,WAAW,EAAQ,EAAoC,EAAM,cAAc,CAAC,KAAS,EAAM,eAAe,EAAQ,QAAQ,KAAmB,EAAQ,KAAK,EAAM,UAAU,CAAC,EAAQ,EAAM,YAAY,QAAQ,EAAS,EAAY,EAAQ,KAAK,IAAI,CAAC,CAAC,eAAe,EAAM,GAAI,EAAC,CAAC,MAAoB,GAAK,IAAI,CAAC,MAAM,CAAC,MAAM,EAAM,UAAU,WAAW,EAAM,WAAW,OAAO,OAAO,OAAO,EAAE,GAAG,EAAM,IAAK,EAAC,SAAS,KAAW,EAAM,OAAO;cAC5f,KAAK,IAAI,KAAK,MAAM,EAAS,QAAQ,CAAC,EAAE,CAAC;cACzC,EAAM,SAAS,4BAA6B,EAAC,AAAE,cAAgD,AAL7G,GAA2C,IAAoD,IAAsC,CAKxE,EAAgB,YAAY,oBAAoB,EAAoB,EAAgB,CAAC,UAAU,CAA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