{"version":3,"file":"ArticleReadTime.BOCLTZiy.mjs","names":["mask","SVG","getProps","Icon","React.forwardRef","React.forwardRef","React"],"sources":["https:/framerusercontent.com/modules/kUdWB3WNWrJ5OJFzvbkt/uvEd8qo1MBBr8GtT5vlD/HaRsYXyM7.js","https:/framerusercontent.com/modules/qWXc86Mgrtt3h78sDulX/E7xZCIcnCQShwN5vHgtO/KWJFL9E3H.js","https:/framerusercontent.com/modules/nPkcej7uBXX23cYK7U6J/HhXteW4XVXRlHUbCsJEH/ArticleReadTime.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 14 0 L 0 0\" fill=\"transparent\" height=\"1px\" id=\"clgh_hWer\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(5 12)\" width=\"14px\"/><path d=\"M 7 14 L 0 7 L 7 0\" fill=\"transparent\" height=\"14px\" id=\"UFl1uCQr0\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(5 5)\" width=\"7px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,UO5clYVeQ:stroke??props.UO5clYVeQ??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,UO5clYVeQ,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-nHkCo\",className),layoutId:layoutId,ref:ref,style:{\"--43q7um\":UO5clYVeQ,...style}});});const css=[`.framer-nHkCo { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--43q7um); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"UO5clYVeQ\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Left\",\"color\":{\"type\":\"variable\",\"value\":\"43q7um\"},\"set\":{\"localId\":\"vectorSet/T8qKXkLfy\",\"id\":\"T8qKXkLfy\",\"moduleId\":\"fiHEoJwBMFnT6QLOcpPz\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-nHkCo\");Icon.displayName=\"Arrow Left\";export default Icon;addPropertyControls(Icon,{UO5clYVeQ:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"true\",\"framerIntrinsicWidth\":\"24\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerVariables\":\"{\\\"UO5clYVeQ\\\":\\\"stroke\\\"}\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Left\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"43q7um\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/T8qKXkLfy\\\",\\\"id\\\":\\\"T8qKXkLfy\\\",\\\"moduleId\\\":\\\"fiHEoJwBMFnT6QLOcpPz\\\"}}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 0 L 14 0\" fill=\"transparent\" height=\"1px\" id=\"lS0BCfang\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(5 12)\" width=\"14px\"/><path d=\"M 0 0 L 7 7 L 0 14\" fill=\"transparent\" height=\"14px\" id=\"qiUgiS3ny\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(12 5)\" width=\"7px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,UO5clYVeQ:stroke??props.UO5clYVeQ??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,UO5clYVeQ,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-1K87s\",className),layoutId:layoutId,ref:ref,style:{\"--43q7um\":UO5clYVeQ,...style}});});const css=[`.framer-1K87s { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--43q7um); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"UO5clYVeQ\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Right\",\"color\":{\"type\":\"variable\",\"value\":\"43q7um\"},\"set\":{\"localId\":\"vectorSet/T8qKXkLfy\",\"id\":\"T8qKXkLfy\",\"moduleId\":\"fiHEoJwBMFnT6QLOcpPz\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-1K87s\");Icon.displayName=\"Arrow Right\";export default Icon;addPropertyControls(Icon,{UO5clYVeQ:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerImmutableVariables\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Right\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"43q7um\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/T8qKXkLfy\\\",\\\"id\\\":\\\"T8qKXkLfy\\\",\\\"moduleId\\\":\\\"fiHEoJwBMFnT6QLOcpPz\\\"}}\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerVariables\":\"{\\\"UO5clYVeQ\\\":\\\"stroke\\\"}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"true\",\"framerIntrinsicWidth\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Article Read Time component as requested:\n// - Calculates article read time and word count\n// - Accepts plain or formatted text, switchable via toggle\n// - Adjustable WPM (words per minute)\n// - Controllable font and font color\n// - Prefix and suffix around the calculated figure\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const{useMemo}=React;/**\n * Article Read Time\n *\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 32\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ArticleReadTime(props){const{text,richText,formatted,wpm,prefix,suffix,textColor,font}=props;const wordCount=useMemo(()=>{let content=\"\";if(formatted&&richText){// Recursively extract all text from the rich text tree\nconst extractText=node=>{if(!node)return\"\";// If it's a string, return it\nif(typeof node===\"string\"){return node;}// If it's an array, process each item\nif(Array.isArray(node)){return node.map(extractText).join(\" \");}// If it's an object, check various properties\nif(typeof node===\"object\"){// Check for text property\nif(typeof node.text===\"string\"){return node.text;}// Check for children array\nif(node.children&&Array.isArray(node.children)){return node.children.map(extractText).join(\" \");}// Check for props.children (React element structure)\nif(node.props&&node.props.children){return extractText(node.props.children);}// Try to stringify if it's an object\nreturn Object.values(node).map(extractText).join(\" \");}return\"\";};content=extractText(richText);// Strip any remaining HTML tags\ncontent=content.replace(/<[^>]*>/g,\" \");}else if(text){content=text;}if(!content)return 0;// Normalize whitespace and count words\nconst words=content.replace(/\\s+/g,\" \").trim().split(\" \").filter(Boolean);return words.length;},[text,richText,formatted]);const minutes=useMemo(()=>{if(!wpm||wpm<=0||wordCount===0)return 0;const rawMinutes=wordCount/wpm;return Math.max(1,Math.round(rawMinutes));},[wordCount,wpm]);// Check if no content is provided\nconst hasContent=formatted?!!richText:!!text;if(!hasContent){return /*#__PURE__*/_jsx(\"p\",{style:{...props.style,color:textColor,margin:0,opacity:.5,...font},children:\"Connect text content.\"});}const readTimeText=`${prefix}${minutes}${suffix}`;return /*#__PURE__*/_jsx(\"p\",{style:{...props.style,color:textColor,margin:0,whiteSpace:\"nowrap\",...font},children:readTimeText});}addPropertyControls(ArticleReadTime,{formatted:{type:ControlType.Boolean,title:\"Formatted\",defaultValue:true},text:{type:ControlType.String,title:\"Text\",hidden(props){return props.formatted;}},richText:{type:ControlType.RichText,title:\"Text\",hidden(props){return!props.formatted;}},wpm:{type:ControlType.Number,title:\"WPM\",description:\"Words per minute\",defaultValue:80,min:20,max:300,step:10,displayStepper:true},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\",placeholder:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\" min read\",placeholder:\" e.g. ' min read'\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ArticleReadTime\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"160\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"32\"}},\"ArticleReadTimeProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ArticleReadTime.map"],"mappings":"kQAC0C,IAAsE,IAA4B,EAAqCA,EAAK,qrBAA6rBC,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAO,IAAI,CAAC,GAAG,EAAc,WAAa,KAAG,CAAC,EAAe,EAAK,MAAM,CAAC,GAAG,EAAS,KAAG,CAAC,CAAE,CAAC,EAAQC,GAAU,CAAC,SAAO,KAAG,SAAO,QAAM,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAQ,EAAM,WAAW,cAA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