function popupQuickLoginRegister(){return $("#signUpModal").eavarModal(),!1}function GoToSearchPage(n,t){n=n.replace("<","").replace(">","").replace("*","").replace("%","").replace("&","").replace(":","").replace("\\","").replace("?","").replace("+","");n&&(window.location.href=t+n)}function GoToSearchTopic(n,t){n=n.replace("<","").replace(">","").replace("*","").replace("%","").replace("&","").replace(":","").replace("\\","").replace("?","").replace("+","");n&&(window.location.href=t+n+"/category-topic")}function formatPrice(n){return n?n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):""}function refreshCaptcha(n,t){var i=document.getElementById(n).closest(".js-captcha-box"),r;document.getElementById(n).setAttribute("disabled","disabled");r=new FormData;r.append("t",i.querySelector("#"+t).value);fetch("/defaultcaptcha/refresh/",{method:"POST",body:r,headers:{"x-requested-with":"XMLHttpRequest"}}).then(function(n){return n.text()}).then(function(t){var r=t.split(";")[0],u=t.split(";")[1],f=r.split('$(\'#CaptchaDeText\').attr("value", "')[1].replace('")',""),e=u.split('$(\'#CaptchaImage\').attr("src", "')[1].replace('")',""),o=i.querySelector("#CaptchaDeText"),s=i.querySelector("#CaptchaImage");o.setAttribute("value",f);s.setAttribute("src",e);document.getElementById(n).removeAttribute("disabled")})}function pickImageUrl(n,t,i){var r="."+n.split(".").pop();return n.replace(r,"")+"-"+t+"x"+i+r}function pickImageUrlWithHeight(n){var t="."+n.split(".").pop();return n.replace(t,"")+t}function validateNationalCode(t){return t.length===10?t=="1111111111"||t=="0000000000"||t=="2222222222"||t=="3333333333"||t=="4444444444"||t=="5555555555"||t=="6666666666"||t=="7777777777"||t=="8888888888"||t=="9999999999"?!1:(c=parseInt(t.charAt(9)),n=parseInt(t.charAt(0))*10+parseInt(t.charAt(1))*9+parseInt(t.charAt(2))*8+parseInt(t.charAt(3))*7+parseInt(t.charAt(4))*6+parseInt(t.charAt(5))*5+parseInt(t.charAt(6))*4+parseInt(t.charAt(7))*3+parseInt(t.charAt(8))*2,r=n-parseInt(n/11)*11,r==0&&r==c||r==1&&c==1||r>1&&c==11-r?!0:!1):!1}function validateEmail(n){return/^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/.test(n)}function validatePersianMobile(n){return/^(\+98|0)?9[\d]{2}[-.\s]?\d{3}[-.\s]?\d{4}\b/.test(n)}function validateEnglishAlphabet(n){return/^[a-zA-Z]{3,}$/.test(n)}function validatePersianAlphabet(n){return/^[\u0627-\u06CC\u0622\u0643\u0624\u064A\u0626\u0020\u200C]*$/.test(n)}function validateMobile(n){return/^09(0[1-3]|1[0-9]|3[0-9]|2[0-2]|9[0])-?[0-9]{3}-?[0-9]{4}$/.test(n)?!0:!1}function validateTelephone(n){return/0[0-9]{6,10}$/.test(n)?!0:!1}function validateNumber(n,t){try{return(n=parseFloat(n),t&&t.minValue!=undefined&&n<parseFloat(t.minValue))?!1:t&&t.maxValue!=undefined&&n>parseFloat(t.maxValue)?!1:!0}catch(i){return!1}}function validateSelectList(n,t){return n&&n.value&&typeof n.value=="function"?validateNumber(n.value(),t):!1}function convertFaToEnNumber(n){return n.replace(/[۰-۹]/g,function(n){return["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"].indexOf(n)})}function briefText(n,t,i){var r,u;if(n.length>=t)return r=n.substring(0,t),u=r.lastIndexOf(i),u===-1?r+" ...":r.substring(0,u)+" ..."}function getParameter(n,t){var r=t+"/",i;return n?(i=n.split(r),i.length>1)?i[1].split("/")[0]:"":""}function replaceNewLineWithBrTag(n){return n.replace(/(?:\r\n|\r|\n)/g,"<br/>")}function replaceBrTagWithNewLine(n){return n.replace(/<br\s*[\/]?>/gi,"\n")}function isNullOrWhiteSpace(n){return n.replace(/\s/g,"").length<1}function isEmailValidate(n){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}function getInteger(n){return Math.floor(n)}function toDigits(n){return n.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}function sortArrOfObjectsByParam(n,t,i){i==undefined&&(i=!0);i?n.sort(function(n,i){return n[t]>i[t]}):n.sort(function(n,i){return n[t]<i[t]})}function getPersianMonthName(n){n=parseInt(n);switch(n){case 1:return"فروردین";case 2:return"اردیبهشت";case 3:return"خرداد";case 4:return"تیر";case 5:return"مرداد";case 6:return"شهریور";case 7:return"مهر";case 8:return"آبان";case 9:return"آذر";case 10:return"دی";case 11:return"بهمن";case 12:return"اسفند";default:return""}}function truncateText(){document.querySelectorAll(".js-truncate-text").forEach(function(n){var t=n,u=t.getBoundingClientRect().height,f=window.innerWidth>992?Number(t.getAttribute("data-height")):Number(t.getAttribute("data-height-phone")),r;if(f&&u>f)for(r=t.textContent.trim().replace(/(\r\n|\n|\r)/gm,"").replace(/\s+/g," ").split(" "),i=0;i<r.length*4;i++)if(u=t.getBoundingClientRect().height,r.pop(),t.textContent=r.join(" "),u<f){r.pop();t.textContent=r.join(" ")+" ...";return}})}function convertReadTime(n,t,i){t==="1"?i.innerText=n.getMinutes()>=1?n.getMinutes()+" دقیقه ":n.getSeconds()+" ثانیه ":t==="2"?i.innerText=n.getMinutes()>=1?"زمان مطالعه: "+n.getMinutes()+" دقیقه ":"زمان مطالعه: "+n.getSeconds()+" ثانیه ":t==="3"&&(i.innerText=n.getMinutes()>=1?"مطالعه: "+n.getMinutes()+" دقیقه ":"مطالعه: "+n.getSeconds()+" ثانیه ")}function initSliderOnMobile(n,t,i){var r=Swiper;document.body.clientWidth<993?(i||(i=!0),r=new Swiper(n,{init:!0,slidesPerView:"auto",spaceBetween:t,loop:!0,loopedSlides:0,autoplay:!1,on:{slideChange:function(){lazyLoadPictures(document.querySelectorAll(".js-lazy-load"))}}})):i&&r.destroy&&r.destroy()}function setCookie(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5);u="expires="+r.toGMTString();document.cookie=n+"="+t+";"+u+";path=/"}function getCookie(n){for(var t,r=n+"=",f=decodeURIComponent(document.cookie),u=f.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""}function initRating(){document.querySelectorAll(".js-rating-demo").forEach(function(n){for(var i=n.querySelectorAll("i"),u=Number(n.getAttribute("data")),r,t=0;t<Math.floor(u);t++)i[t].classList="",i[t].classList.add("icon-star","text-yellow");r=t++;u%1>0&&(i[r].classList="",i[r].classList.add("icon-half-star","text-yellow"))})}Number.prototype.format=function(n,t){var i="\\d(?=(\\d{"+(t||3)+"})+"+(n>0?"\\.":"$")+")";return this.toFixed(Math.max(0,~~n)).replace(new RegExp(i,"g"),"$&,")}