`;\n if(isStTest){\n FirstLastName.value = \'test testic\'\n }\n window.fetch(dataToken, {\n method: \'POST\',\n headers: {\n \'Accept\': \'application/json\',\n \'Content-Type\': \'application/json\'\n },\n body: JSON.stringify({\n "scalelead-name": FirstLastName.value,\n "scalelead-phone": pn,\n "scalelead-quantity": 1,\n "scalelead-uid": dataArticle,\n "scalelead-c7": curLanguage.toUpperCase(),\n "GenericData": genericData,\n ...ad\n })\n }).then(async (res) => {\n try {\n let tmp = JSON.parse(res.headers.get("status_json"));\n if (tmp.status === "error" && tmp.data === "LEAD_REJECTED") {\n switch (curLanguage) {\n case "pl":\n errP.innerHTML = "Zauważyliśmy, że już złożyłeś wniosek o ten produkt. Obecnie przetwarzamy Twoje żądanie i skontaktujemy się z Tobą w najkrótszym możliwym czasie.";\n return;\n case "si":\n errP.innerHTML = "Opazili smo, da ste že zaprosili za ta izdelek. Trenutno obdelujemo vašo zahtevo in vam bomo odgovorili v najkrajšem možnem času.";\n return;\n case "es":\n errP.innerHTML = "Hemos notado que ya ha solicitado este producto. Actualmente estamos procesando su solicitud y nos comunicaremos con usted lo antes posible.";\n return;\n default:\n errP.innerHTML = "Primijetili smo da ste već aplicirali za ovaj proizvod. Trenutno obrađujemo Vaš zahtjev i javit ćemo Vam se u najkraćem roku.";\n return;\n };\n return;\n };\n } catch {};\n try {\n let cStatus = await window.sctrk.convert({ integration_scalelead: res.headers.get("lead_id") });\n if (cStatus === "error") {\n try {\n await window.sctrk.convert({track_error: JSON_stringify(cStatus)});\n } catch {};\n Sentry.captureMessage("TRACK_FAILED_ERROR", {\n level: "error",\n extra: cStatus\n });\n };\n } catch (e) {\n try {\n await window.sctrk.convert({track_error: JSON_stringify(e, Object.getOwnPropertyNames(e))});\n } catch {};\n try {\n Sentry.captureException(e);\n } catch {};\n };\n let params = window.location.toString().split("?");\n if (params.length > 1) params = params[1]; else params = "";\n params += `${params ? "&" : ""}user_name=${FirstLastName.value}&user_phone=${pn}`;\n window.localStorage.setItem("form-completed", Date.now());\n window.location.href = `${dataThankYou}${params ? `?${params}` : ""}`;\n }).catch(() => {\n btn.style.display = null;\n switch (curLanguage) {\n case "pl":\n errP.innerHTML = "Proszę wprowadzić swoje dane";\n return;\n case "si":\n errP.innerHTML = "Prosimo vnesite svoje podatke";\n return;\n case "es":\n errP.innerHTML = "Por favor ingresa tu información";\n return;\n default:\n errP.innerHTML = "Molimo unesite Vaše podatke";\n return;\n };\n });\n };\n })()\n ')}.bind(items[i])();for(var items=document.querySelectorAll("#izm7su, #ipbymc, #ia787h, #izsmaf, #izr9zf, #i0mi3x, #iomway, #io2yo5, #i81qpl, #im3kpg, #ityct9, #i2ll7e, #iutlra, #itdbml, #i2kg0k, #iopa4g, #i16k1j, #ianu0h, #ii1j8z, #i3ipyv, #iwbnqi, #i65a5s, #icuirg, #i10a3i, #i6qv3a, #i71lue, #i5jnsh, #ik1l2g, #imhrf5, #i68dug, #i1tusi, #ioixcw, #imv2jn, #ihs0z8, #i0doj1h, #il457m9, #ijtss4v, #icbg7eu, #ivin5s4, #iifcs8i, #ikoz34q, #iucl9hj, #ijzel2r, #imezy5j, #ideplau, #ic1orng, #ij7k5ks"),i=0,len=items.length;i{\n if (!this) return;\n\n const commentName = this.getAttribute(\'commentname\');\n const commentText = this.getAttribute(\'commenttext\');\n const userImage = this.getAttribute(\'userimage\');\n const textImage = this.getAttribute(\'textimage\');\n const likes = this.getAttribute(\'likes\');\n const dislikes = this.getAttribute(\'dislikes\');\n const date = this.getAttribute(\'date\');\n const replyComments = this.getAttribute(\'replycomments\');\n const index = this.getAttribute(\'indexvalue\');\n\n const today = new Date();\n\n const yesterday = new Date();\n yesterday.setDate(yesterday.getDate() - 1);\n\n const dayBeforeYesterday = new Date();\n dayBeforeYesterday.setDate(dayBeforeYesterday.getDate() - 2);\n\n const options = { day: \'2-digit\', month: \'2-digit\', year: \'numeric\' };\n const formattedToday = today.toLocaleDateString(\'en-GB\', options);\n const formattedYesterday = yesterday.toLocaleDateString(\'en-GB\', options);\n const formattedDayBeforeYesterday = dayBeforeYesterday.toLocaleDateString(\'en-GB\', options);\n\n let preImage = this.querySelector(".scalecms-comment-fb-temp-1-body-image");\n if (textImage) {\n preImage.src = `${textImage}`\n } else {\n preImage.style.display = "none";\n }\n\n if (likes) {\n let likeImage = this.querySelector(".scalecms-comment-fb-temp-1-body-infoDiv-image");\n let likeBtn = this.querySelector(".scalecms-comment-fb-temp-1-body-infoDiv-likePara-likebtn");\n let replyBtn = this.querySelector(".scalecms-comment-fb-temp-1-body-infoDiv-likePara-replyBtn");\n\n likeImage.src = "https://backend.scale-cms.com:5000/staticContent/images/57770a38-4031-4b54-bec4-d621ae2d19f6-1725021527478.svg";\n\n let leaveCommentTarget = document.querySelector(".scalecms-leaveComment");\n replyBtn.addEventListener("click", () => {\n if (!leaveCommentTarget) return;\n leaveCommentTarget.scrollIntoView({ behavior: \'smooth\' });\n })\n\n likeBtn.addEventListener("click", () => {\n likeBtn.style.color = "#129BF7";\n likeImage.style.opacity = "1";\n })\n\n } else {\n let infoDiv = this.querySelector(".scalecms-comment-fb-temp-1-body-infoDiv");\n infoDiv.style.display = "none";\n }\n\n let dateValueText = \'\';\n\n if (index && index < 6) {\n dateValueText = formattedToday;\n } else if (index && index <= 14) {\n dateValueText = formattedYesterday;\n } else if (index && index > 14){\n dateValueText = formattedDayBeforeYesterday;\n }else{\n dateValueText = \'\';\n }\n\n if (date) {\n let datePara = this.querySelector(".scalecms-comment-fb-temp-1-body-date");\n datePara.textContent = dateValueText;\n } else {\n let datePara = this.querySelector(".scalecms-comment-fb-temp-1-body-date");\n datePara.textContent = \'\';\n }\n\n if (replyComments) {\n const parsedReplyComments = JSON.parse(replyComments);\n const replyContainer = this.querySelector(".reply-container");\n\n parsedReplyComments.forEach(reply => {\n // Create a new comment element\n let newReplyComment = document.createElement("div");\n newReplyComment.classList.add("scalecms-comment-fb-temp-1");\n newReplyComment.style.marginTop = "10px";\n\n // Create the div for the left section of the comment\n let leftSection = document.createElement("div");\n leftSection.classList.add("scalecms-comment-fb-temp-1-left");\n\n // Create and set attributes for image element in the left section\n let imageElement = document.createElement("img");\n imageElement.classList.add("scalecms-comment-fb-temp-1-image");\n imageElement.src = reply.attributes.UserImage;\n leftSection.appendChild(imageElement);\n\n newReplyComment.appendChild(leftSection);\n\n // Create the div for the body section of the comment\n let bodySection = document.createElement("div");\n bodySection.classList.add("scalecms-comment-fb-temp-1-body");\n\n // Create the div for the top section of the body\n let topSection = document.createElement("div");\n topSection.classList.add("scalecms-comment-fb-temp-1-body-top");\n\n // Create and set attributes for heading element in the top section\n let headingElement = document.createElement("div");\n headingElement.classList.add("scalecms-comment-fb-temp-1-body-heading");\n headingElement.textContent = reply.attributes.CommentName;\n topSection.appendChild(headingElement);\n\n // Create and set attributes for text element in the top section\n let textElement = document.createElement("div");\n textElement.classList.add("scalecms-comment-fb-temp-1-body-text");\n textElement.innerHTML = reply.attributes.CommentText.replace(/{{{([^}]+)}}}/g, (match, group) => {\n return `${group}`;\n });\n topSection.appendChild(textElement);\n\n // Create and set attributes for image element in the top section\n let imageElementTop = document.createElement("img");\n imageElementTop.classList.add("scalecms-comment-fb-temp-1-body-image");\n imageElementTop.src = reply.attributes.TextImage;\n topSection.appendChild(imageElementTop);\n\n bodySection.appendChild(topSection);\n\n // Create the div for the infoDiv in the body section\n let infoDiv = document.createElement("div");\n infoDiv.classList.add("scalecms-comment-fb-temp-1-body-infoDiv");\n\n // Create elements for likePara, replyBtn, image, likeParaAmount, and date in the infoDiv\n if (likes) {\n \n let likePara = document.createElement("div");\n likePara.classList.add("scalecms-comment-fb-temp-1-body-infoDiv-likePara", "scalecms-comment-fb-temp-1-body-infoDiv-likePara-likebtn");\n likePara.textContent = "Sviđa mi se";\n\n // Add event listener to increment Likes only once\n let likeIncremented = false;\n infoDiv.appendChild(likePara);\n\n let replyBtn = document.createElement("div");\n replyBtn.classList.add("scalecms-comment-fb-temp-1-body-infoDiv-likePara", "scalecms-comment-fb-temp-1-body-infoDiv-likePara-replyBtn");\n replyBtn.textContent = "Odgovori";\n\n let infoImage = document.createElement("img");\n infoImage.classList.add("scalecms-comment-fb-temp-1-body-infoDiv-image");\n infoImage.src = "https://backend.scale-cms.com:5000/staticContent/images/57770a38-4031-4b54-bec4-d621ae2d19f6-1725021527478.svg";\n\n likePara.addEventListener("click", () => {\n likeIncremented = true;\n likePara.style.color = "#129BF7";\n infoImage.style.opacity = "1";\n });\n\n // Add event listener to scroll to scalecms-leaveComment element\n replyBtn.addEventListener("click", () => {\n let leaveCommentTarget = document.querySelector(".scalecms-leaveComment");\n if (leaveCommentTarget) {\n leaveCommentTarget.scrollIntoView({ behavior: \'smooth\' });\n }\n });\n\n infoDiv.appendChild(replyBtn);\n }\n\n if (date) {\n let dateElement = document.createElement("div");\n dateElement.classList.add("scalecms-comment-fb-temp-1-body-date");\n dateElement.textContent = dateValueText;\n infoDiv.appendChild(dateElement);\n }\n\n if (likes) {\n // let infoImage = document.createElement("img");\n // infoImage.classList.add("scalecms-comment-fb-temp-1-body-infoDiv-image");\n // infoImage.src = "https://backend.scale-cms.com:5000/staticContent/images/57770a38-4031-4b54-bec4-d621ae2d19f6-1725021527478.svg";\n\n // Add event listener to increment Likes only once for infoImage\n // infoDiv.appendChild(infoImage);\n }\n\n bodySection.appendChild(infoDiv);\n newReplyComment.appendChild(bodySection);\n\n replyContainer.appendChild(newReplyComment);\n });\n }\n\n /// END OF REPLY COMMENTS SECTION\n\n\n const regex = /{{{([^}]+)}}}/g;\n const modifiedCommentText = commentText.replace(regex, (match, group) => {\n return `${group}`;\n });\n\n let headline = this.querySelector(".scalecms-comment-fb-temp-1-body-heading")\n let text = this.querySelector(".scalecms-comment-fb-temp-1-body-text")\n let image = this.querySelector(".scalecms-comment-fb-temp-1-image")\n\n headline.textContent = commentName;\n text.innerHTML = modifiedCommentText;\n image.src = userImage;\n\n let commentScrollToBtns = this.querySelectorAll(".scroll-to");\n let commentScrollTarget = document.querySelector(".scroll-target");\n if(!commentScrollTarget) commentScrollTarget = document.querySelector(".present__form");\n if (commentScrollToBtns.length) {\n for (let elem of commentScrollToBtns) {\n elem.addEventListener(\'click\', () => {\n commentScrollTarget.scrollIntoView({ behavior: \'smooth\' });\n });\n }\n }\n\n })()')}.bind(items[i])()