1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[96],{7318:(e,t,i)=>{i.r(t),i.d(t,{default:()=>l});var n=i(5913),s=i(8909);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}var l=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.sort=this.element.querySelector('[data-reviews-element="sort"]'),this.list=this.element.querySelector('[data-reviews-element="list"]'),this.wrapper=this.element.querySelector('[data-reviews-element="wrapper"]'),this.pagination=null,this.unpinnedReviews=this.element.querySelectorAll('[data-reviews-pinned="false"]'),this.count=this.element.querySelector('[data-reviews-element="count"]'),this.seeAllReviews=this.element.querySelector('[data-reviews-element="all-link"]'),this.reviewsConfig=window.rate_review,this.totalReviews=this.element.dataset.reviewsCount,this.currentPage="1",this.updateSort=this.updateSort.bind(this),this.goToPage=this.goToPage.bind(this),this.showAllReviews=this.showAllReviews.bind(this),this.bindEvents(),this.hideUnpinnedReviews()},t=[{key:"bindEvents",value:function(){this.sort.addEventListener("change",this.updateSort),this.bindPagination(),this.seeAllReviews&&this.seeAllReviews.addEventListener("click",this.showAllReviews)}},{key:"bindPagination",value:function(){var e=this;if(this.pagination=this.element.querySelector('[data-reviews-element="pagination"]'),this.pagination){var t=this.element.querySelectorAll("[data-page-index]");(0,n.F5)(t,"click",(function(t){var i=t.currentTarget;e.goToPage(i.dataset.pageIndex)}))}}},{key:"updateSort",value:function(){this.goToPage("1"),this.sort.id="reviews_sort_::".concat(this.sort.value)}},{key:"hideUnpinnedReviews",value:function(){(0,n.r2)(s.FY,null,this.unpinnedReviews)}},{key:"displayUnpinnedReviews",value:function(){(0,n.Y_)(s.FY,null,this.unpinnedReviews)}},{key:"goToPage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";this.wrapper.scrollIntoView();var i=this.reviewsConfig.numberPerPage*(parseInt(t,10)-1);this.currentPage=t;var n=new URLSearchParams({offset:i,limit:this.reviewsConfig.numberPerPage,sort:this.sort.value,total:this.totalReviews}).toString();fetch("".concat(this.reviewsConfig.url,"?").concat(n),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then((function(e){return e.text()})).then((function(t){e.list.innerHTML=t,e.bindPagination(),e.updateCount(i),e.seeAllReviews&&e.seeAllReviews.remove()})).catch((function(e){console.error(e)}))}},{key:"showAllReviews",value:function(){this.displayUnpinnedReviews(),this.pagination&&this.pagination.classList.remove(s.FY),this.seeAllReviews.remove(),this.updateCount(1)}},{key:"updateCount",value:function(e){this.count.innerText="".concat(Math.max(e,1)," - ").concat(Math.min(e+this.reviewsConfig.numberPerPage,this.totalReviews))}}],t&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}()}}]);
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.