PageSourceSearch

https://5element.by/local/templates/html/assets/components-templat…/r-feedback/script.min.js?17902545904952

js 5element.by collected 2026-09-24 17:53:50 UTC 4,952 bytes, 1 lines download raw bytes

1(function(){"use strict";(()=>{function a(a,b,c){return 1==b%10&&11!=b%100?a+c[0]:2<=b%10&&4>=b%10&&(10>b%100||20<=b%100)?a+c[1]:a+c[2]}function b(b){const c=new Date,d=new Date(b),e=Math.ceil((c.getTime()-d.getTime())/1e3);for(const{unit:c,limit:d,many:f,few:g}of j){const b=Math.floor(e/d);if(0<b)return d<=60?`${b} ${a(f,b,["\u0443","\u044B",""])} назад`:`${b} ${a("",b,[c,g,f])} назад`}return"0 \u0441\u0435\u043A\u0443\u043D\u0434 \u043D\u0430\u0437\u0430\u0434"}function c(a){const c=a.querySelectorAll(".f-user__date");c?.length&&c.forEach(a=>{const c=a?.dataset?.value;c&&(a.innerText?a.innerText.includes("\u0414\u043E\u043F\u043E\u043B\u043D\u0435\u043D")&&(a.innerText+=` ${b(c)}`):a.innerText=b(c))})}function d(a,b){if(a.videos.length||a.images.length){let c;c=b.target.className.includes("r-slider__video")?a.videos.findIndex(a=>a.video===b?.target?.dataset?.video):a.images.findIndex(a=>a.src===b?.target?.dataset?.original)+a.videos.length,window.dispatchEvent(new CustomEvent("show-modal-slider",{detail:{sliderItems:a,activeItemIndex:c}}
1))}}function e(a="\u0414\u0430\u043D\u043D\u044B\u0435 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u044B"){window.dispatchEvent(new CustomEvent("show-modal-notification",{detail:{confirmButtonTitle:"\u041E\u041A",description:a}}))}function f(){const a=document.getElementsByTagName("global-state");return a[0]?._vnode.props.params?.csrf}async function g(a,b){if(a&&b){const c=f();if(!c?.token)return;const d=await fetch(`/api/v1/user/reviews/${a}/comments`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json",[c.header]:c.token},body:JSON.stringify({comment:b})});if(d?.ok){e();const b=document.querySelector(`.r-feedback__edit[data-review-id="${a}"]`);b?.remove()}else e("\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0438 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u044F \u043A \u043E\u0442\u0437\u044B\u0432\u0443")}}function h(a){const b=a.target.closest(".r-feedback__edit"),c=b?.dataset?.reviewId;c&&window.dispatchEvent(new CustomEvent("show-modal-text",{detail:{confirmButtonTitle:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C",textareaLabel:"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439",title:"\u0414\u043E\u043F\u043E\u043B\u043De\u043D\u0438\u0435 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u044F",action:g.bind(this,c)}}))}async function i(a){const b=a.target.closest(".r-feedback__del"),c=b?.dataset?.reviewId;if(c){const b=`/api/v1/user/reviews/${a?.target?.dataset?.reviewId}`,d=f();if(!d?.token)return;const g=await fetch(b,{method:"DELETE",cache:"no-cache",headers:{"Content-Type":"application/json",[d.header]:d.token}});if(g?.ok){const a=document.querySelector(`.r-feedback[data-review-id="${c}"]`);a?.remove(),e()}else e("\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0438 \u043E\u0442\u0437\u044B\u0432\u0430")}}const j=[{unit:"\u0433\u043E\u0434",limit:31536000,many:"\u043B\u0435\u0442",few:"\u0433\u043E\u0434\u0430"},{unit:"\u043C\u0435\u0441\u044F\u0446",limit:2592000,many:"\u043C\u0435\u0441\u044F\u0446\u0435\u0432",few:"\u043C\u0435\u0441\u044F\u0446\u0430"},{unit:"\u0434\u0435\u043D\u044C",limit:86400,many:"\u0434\u043D\u0435\u0439",few:"\u0434\u043D\u044F"},{unit:"\u0447\u0430\u0441",limit:3600,many:"\u0447\u0430\u0441\u043E\u0432",few:"\u0447\u0430\u0441\u0430"},{unit:"\u043C\u0438\u043D\u0443\u0442\u0430",limit:60,many:"\u043C\u0438\u043D\u0443\u0442",few:"\u043C\u0438\u043D\u0443\u0442\u044B"},{unit:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",limit:1,many:"\u0441\u0435\u043A\u0443\u043D\u0434",few:"\u0441\u0435\u043A\u0443\u043D\u0434\u044B"}];document.addEventListener("click",a=>{a.target.closest(".r-feedback__edit")?(a.preventDefault(),h(a)):a.target.closest(".r-feedback__del")&&(a.preventDefault(),i(a))}),window.addEventListener("tab-faq-end",function(){const a=document.querySelector(".prod-tab-faq");a&&c(a)}),window.addEventListener("tab-reviews-end",function(){const a=document.querySelector(".prod-tab-feedback");a&&c(a)}),window.addEventListener("tab-reviews-end",function(){const a=document.querySelectorAll(".r-feedback__slider");a?.length&&a.forEach(a=>{const b=a.querySelectorAll(".r-slider__image"),c={images:[],videos:[]};b?.length&&b.forEach(a=>{a?.dataset?.video?c.videos.push({video:a?.dataset?.video}):a?.dataset?.original&&c.images.push({src:a?.dataset?.original,alt:a.alt})}),a.addEventListener("click",d.bind(this,c))})}),function(){const a=!!+document.getElementById("userButtons")?.getAttribute("data-can-add-review");if(a)return;const b=document.querySelectorAll(".js-m-feedback[data-target=\"reviews\"]"),c=document.querySelectorAll(".reviews-disabled-info");b.forEach(a=>a.classList.add("disabled")),c.forEach(a=>a.classList.add("show"))}()})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.