{"version":3,"file":"headerTextButton.7e92e958acf68d9e6a33.js","mappings":"8FAAA,IAAMA,EAAoB,WACtB,IAAIC,EAAmB,KACnBC,EAAc,KACdC,EAAgB,KAChBC,EAAe,KAEfC,EAAO,CACPC,cAAe,WACNH,EAAcI,UAAUC,SAAS,YAGlCL,EAAcI,UAAUE,OAAO,YAF/BN,EAAcI,UAAUG,IAAI,WAIpC,EACAC,KAAM,SAACC,GAEH,IADAX,EAAmBY,SAASC,eAAeF,IACrBL,UAAUC,SAAS,YAAzC,CAEAN,EAAcD,EAAiBc,cAAc,iBAC7CZ,EAAgBF,EAAiBc,cAAc,mBAC/CX,EAAeH,EAAiBc,cAAc,eAE9C,IACMC,EAAY,EADCC,WAAWC,iBAAiBhB,GAAaiB,YAGxDjB,EAAYkB,cAAgBJ,EAC5BZ,EAAaG,UAAUG,IAAI,WAE3BN,EAAaG,UAAUE,OAAO,UAC9BL,EAAaiB,iBAAiB,QAAShB,EAAKC,eAZtC,CAcd,GAEJ,OAAOD,CACX,CAlC0B,GAoC1BiB,OAAOtB,iBAAmBA,C","sources":["webpack://global-main/./Feature/Components/code/Views/Feature/Components/HeaderTextButton.js"],"sourcesContent":["const HeaderTextButton = (() => {\n let headerTextButton = null;\n let textContent = null;\n let textContainer = null;\n let toggleButton = null;\n\n let self = {\n toggleContent: () => {\n if (!textContainer.classList.contains(\"expanded\")) {\n textContainer.classList.add('expanded');\n } else {\n textContainer.classList.remove('expanded');\n }\n },\n init: (id) => {\n headerTextButton = document.getElementById(id);\n if (!headerTextButton.classList.contains(\"showmore\"))\n return;\n textContent = headerTextButton.querySelector('.text-content');\n textContainer = headerTextButton.querySelector('.text-container');\n toggleButton = headerTextButton.querySelector(\".toggle-btn\")\n\n const lineHeight = parseFloat(getComputedStyle(textContent).lineHeight);\n const maxHeight = 7 * lineHeight;\n\n if (textContent.scrollHeight <= maxHeight) {\n toggleButton.classList.add(\"d-none\");\n } else {\n toggleButton.classList.remove(\"d-none\");\n toggleButton.addEventListener(\"click\", self.toggleContent);\n }\n }\n }\n return self;\n})();\n\nwindow.HeaderTextButton = HeaderTextButton;"],"names":["HeaderTextButton","headerTextButton","textContent","textContainer","toggleButton","self","toggleContent","classList","contains","remove","add","init","id","document","getElementById","querySelector","maxHeight","parseFloat","getComputedStyle","lineHeight","scrollHeight","addEventListener","window"],"sourceRoot":""}