{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/iZTvtEhOR1A44XtrRofS/2RCBUBCkyGCg1iEk6wf6/Time_to_Read.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{fontControls}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";import{useEffect,useState}from\"react\";export function WordCounter(props){const{font,fontColor,title,displayMode}=props;const[countWords,setCountWords]=useState(0);useEffect(()=>{if(typeof window===\"undefined\")return;// Check if running in a browser environment\nconst div=document.createElement(\"div\");div.innerHTML=typeof title===\"string\"?title:JSON.stringify(title);const text=div.textContent||div.innerText||\"\";setCountWords(text.trim().split(/\\s+/).length);},[title]);const wordsPerMinute=200// Average reading speed\n;const timeToRead=Math.ceil(countWords/wordsPerMinute);return /*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",padding:0},children:displayMode===\"words\"?`${countWords}`:`${timeToRead} min read`});}WordCounter.defaultProps={title:\"<p>Your rich text here</p>\",font:fontControls.defaultProps,fontColor:\"#000\",displayMode:\"words\"};addPropertyControls(WordCounter,{title:{title:\"Title\",//@ts-ignore\ntype:ControlType.RichText},font:{// @ts-expect-error \u2013\u00A0Internal\ntype:ControlType.Font,controls:\"extended\",title:\"Font\"},fontColor:{title:\"Font Color\",type:ControlType.Color,defaultValue:WordCounter.defaultProps.fontColor},displayMode:{title:\"Display Mode\",type:ControlType.SegmentedEnum,options:[\"words\",\"time\"],optionTitles:[\"Words\",\"Time to Read\"],defaultValue:WordCounter.defaultProps.displayMode,description:\"[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"WordCounter\":{\"type\":\"reactComponent\",\"name\":\"WordCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Time_to_Read.map"],
  "mappings": "qM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"p", "fontControls", "addPropertyControls", "ControlType"]
}
