{"version":3,"file":"article-read-time.bundle.js","mappings":"4FAmCA,MAAMA,EAnCN,WACE,MAAMC,EAAiBC,SAASC,eAAe,mBAE/C,IAAKF,EAAgB,OAAO,EAE5B,MACMG,EADOH,EAAeI,UACLC,MAAM,OAAOC,OAE9BC,EAAeC,KAAKC,KAAKN,EAAY,KACrCO,EAAeF,KAAKC,KAAKN,EAAY,KAErCQ,EAAiBX,EAAeY,iBAAiB,OAAON,OAAS,EACjEO,EAAiBb,EAAeY,iBAAiB,UAAUN,OAAS,EAE1E,OAAIK,EAAuBD,EACvBG,EAAuBH,EAAe,EAEnCH,CACT,CAiBiBO,GAEbf,EAAW,EAjBf,SAA4BA,GAC1B,MAAMgB,EAAkBd,SAASC,eAAe,aAE5Ca,IAAiBA,EAAgBX,UAAa,GAAEL,aACtD,CAcEiB,CAAmBjB,GAZrB,WACE,MAAMkB,EAAsBhB,SAASC,eAAe,aAEhDe,IACFA,EAAoBC,UAAUC,OAAO,2BACrCF,EAAoBb,UAAY,GAEpC,CAOEgB,E","sources":["webpack:///./src/features/article-read-time.js"],"sourcesContent":["function calculateReadTime() {\n const articleElement = document.getElementById('article-content');\n\n if (!articleElement) return 0;\n\n const text = articleElement.innerText;\n const wordCount = text.split(/\\s+/).length;\n\n const fastReadTime = Math.ceil(wordCount / 238);\n const slowReadTime = Math.ceil(wordCount / 183);\n\n const isImagePresent = articleElement.querySelectorAll('img').length > 0;\n const isCerosPresent = articleElement.querySelectorAll('iframe').length > 0;\n\n if (isImagePresent) return slowReadTime;\n if (isCerosPresent) return slowReadTime + 2;\n\n return fastReadTime;\n}\n\nfunction updateReadTimeText(readTime) {\n const readTimeElement = document.getElementById('read-time');\n\n if (readTimeElement) readTimeElement.innerText = `${readTime} min read`;\n}\n\nfunction removeReadTimeIcon() {\n const readTimeIconElement = document.getElementById('time-icon');\n\n if (readTimeIconElement) {\n readTimeIconElement.classList.remove('material-icons-outlined');\n readTimeIconElement.innerText = '';\n }\n}\n\nconst readTime = calculateReadTime();\n\nif (readTime > 2) {\n updateReadTimeText(readTime);\n} else {\n removeReadTimeIcon();\n}\n"],"names":["readTime","articleElement","document","getElementById","wordCount","innerText","split","length","fastReadTime","Math","ceil","slowReadTime","isImagePresent","querySelectorAll","isCerosPresent","calculateReadTime","readTimeElement","updateReadTimeText","readTimeIconElement","classList","remove","removeReadTimeIcon"],"sourceRoot":""}