\n"):e,setAttributes(e,t){for(var n in t)e.setAttribute(n,t[n])},inputToggle(e){if(e.target.classList.contains("input-toggle")){let t=e.target.parentElement.lastElementChild;!0===e.target.checked?(t.style.height=t.scrollHeight+"px",t.classList.remove("hidden")):(t.firstChild.value="",t.style.height=null,t.classList.add("hidden"))}},addInput({parent:e,elm:t,placeholder:n,type:l,name:i,max:r}){r=r||6;let s=document.createElement("div");s.setAttribute("class","new-input");let o=document.createElement("input");o.setAttribute("type",l),o.setAttribute("placeholder",n),o.setAttribute("name",i);let a=document.createElement("button");a.setAttribute("class","remove"),a.setAttribute("type","button"),s.appendChild(o),s.appendChild(a),t.appendChild(s),t.childNodes.length>=r&&(t.nextElementSibling.disabled=!0,t.nextElementSibling.style.cssText="opacity:.3;cursor:not-allowed"),e.style.height=e.scrollHeight+"px"},removeInput({elm:e,target:t,max:n}){if(n=n||6,"remove"===t.className){--n;let i=t.parentElement.parentNode;var l=t.parentElement.getBoundingClientRect().height;t.parentElement.remove(),e.style.height=e.getBoundingClientRect().height-l+"px",i.childNodes.length<=n&&(i.nextElementSibling.disabled=!1,i.nextElementSibling.style.cssText="opacity:1;cursor:pointer;")}}};!function(e){const t=e.getElementById("output-code"),n=e.querySelectorAll(".sosmed"),l=e.querySelector(".error-box");e.getElementById("submit").addEventListener("click",function(){const i=[],r=e.querySelectorAll(".toggle-sosmed:checked");let s="";return Array.from(n).forEach(function(e){let t=e.querySelector(".toggle-sosmed"),n=e.querySelector(".input-wrap > input"),l=e.querySelector(".rel"),r=e.querySelector(".target"),o=e.querySelector(".checkbox span");if(o=o.innerHTML.toLowerCase(),l=l.checked?' rel="nofollow"':"",r=r.checked?' target="_blank"':"",t.checked){if(!helperFn.checkURL(n.value))return n.classList.add("error"),void i.push("Error");n.classList.remove("error"),s+='\n'}}),0===r.length?(l.innerHTML=messages.checkBoxSosmed,void(t.value="")):0