File: /home/assibfaf/public_html/static/js/testimonials.js
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e){if(document.querySelector(".Testimonials__page")){let t=document.querySelector('[data-tab-container="testimonials"]');const e=document.querySelector(".Testimonials__loader"),r=document.querySelector(".Testimonials__show-more-btn"),n=t.getAttribute("data-rating-type")||"rating",i=t.getAttribute("data-rating")||10,o=(t,e)=>fetch(`/api/testimonials?limit=${t}&paperRating=${e}`).then(t=>t.json()).catch(t=>new Error(t)),a=t=>{let e=(t,e)=>`<div class="Testimonial">\n <div class="Testimonial__stars">${((t,e)=>{let r=0,n="";for(r=1;r<=t;r++)n+='<div class="Testimonial__star"></div>';return n+="percentage"==e?`<strong class="Testimonial__paperRating">${t/10*100}%</strong>`:`<strong class="Testimonial__paperRating">${t}</strong>/10`,n})(t.paperRating,e)}</div>\n\t\t<strong class="Testimonial__title">${t.orderTopic}</strong>\n\t\t <p class="Testimonial__text">${t.body}</p>\n\t\t <div class="Testimonial__footer">\n\t\t\t<div class="Testimonial__footer-order">Order<strong>#${t.orderId}</strong></div>\n\t\t\t<div class="Testimonial__footer-pages">Pages<strong>${t.orderPages}</strong></div>\n\t\t\t<div class="Testimonial__footer-date">Date<strong>${(t=>{let e=new Date(t);return`${e.getDate()} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()]} ${e.getFullYear()}`})(t.createdAt)}</strong></div>\n\t\t\t<div class="Testimonial__footer-discipline">Discipline<strong>${t.orderDiscipline}</strong></div>\n\t\t </div></div>`;return t.map(t=>e(t,n)).join("")},s=(t,e)=>{let r=e.querySelector(".Testimonials__List");Array.prototype.slice.call((t=>{let e=document.createElement("div");return e.innerHTML=t,e.childNodes})(a(t))).forEach(t=>r.appendChild(t))};o(10,i).then(n=>{e.classList.remove("active"),r.classList.add("show"),s(n.data.testimonials,t)});window.getMore=n=>{let a=document.querySelectorAll(".Testimonial").length;e.classList.add("active"),r.setAttribute("disabled",!0),o(a+n,i).then(n=>{let i=n.data.testimonials.slice(a);e.classList.remove("active"),r.removeAttribute("disabled"),s(i,t)})}}}]);