functiont(t){returnfunction(t){if(Array.isArray(t))returnn(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||a(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functione(t,e){varn="undefined"!=typeofSymbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeoft.length){n&&(t=n);vari=0,r=function(){};return{s:r,n:function(){returni>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throwt},f:r}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}vars,o=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){vart=n.next();returno=t.done,t},e:function(t){l=!0,s=t},f:function(){try{o||null==n.return||n.return()}finally{if(l)throws}}}}functiona(t,e){if(t){if("string"==typeoft)returnn(t,e);vara=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(t,e):void0}}functionn(t,e){(null==e||e>t.length)&&(e=t.length);for(vara=0,n=newArray(e);a<e;a++)n[a]=t[a];returnn}functioni(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionr(t,e){for(vara=0;a<e.length;a++){varn=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}functions(t,e,a){returne&&r(t.prototype,e),a&&r(t,a),t}varo,l=function(t){returndocument.querySelector(t)},c=function(t){vare=document.createElement("template");returne.innerHTML=t.trim(),e.content.firstChild},d=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},u=function(t){t.classList.contains("is-hidden")?t.classList.remove("is-hidden"):t.classList.add("is-hidden")},h=function(t){returnt.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},p=function(){functiont(e){i(this,t),this.element=e}returns(t,[{key:"attach",value:function(t){this.element.addEventListener("click",(function(e){e.target&&e.target.classList.contains("paginator__button")&&t(+e.target.dataset.page)}))}},{key:"update",value:function(t,e,a){d(this.element);varn=Math.floor(t/e);if(0!==n){vari=a-2<0?0:a-2,r=a+2>n?n:a+2,s=Math.abs(0-a)>2,o=Math.abs(n-a)>2,l=0===a?"disabled":"";this.element.appendChild(c('<button class="paginator__button previous" '.concat(l,' data-page="').concat(a-1,'">Previous</button>'))),s&&(this.element.appendChild(c('<button class="paginator__button" data-page="'.concat(0,'">').concat(0,"</button>"))),this.element.appendChild(c('<span class="ellipsis">…</span>')));for(varu=i;u<=r;u++){varh=u===a?"paginator__button--selected":"";this.element.appendChild(c('<button class="paginator__button '.concat(h,'" data-page="').concat(u,'">').concat(u,"</button>")))}o&&(this.element.appendChild(c('<span class="ellipsis">…</span>')),this.element.appendChild(c('<button class="paginator__button" data-page="'.concat(n,'">').concat(n,"</button>"))));varp=a===n?"disabled":"";this.element.appendChild(c('<button class="paginator__button next" '.concat(p,' data-page="').concat(a+1,'">Next</button>')))}}}]),t}(),f=function(){functiona(t,e){i(this,a),this.element=t,this.container=t.parentElement,this.options=e,this.ajaxCallback=e.ajaxCallback,this.data=[],this.unfilteredData=[],this.totalRecords=-1,this.perPage=20,this.currentPage=0,this.paginator=newp(this.container.querySelector(".paginator")),this.filterCallback=e.filterCallback,this.sortField=null,this.sortDir=!0}returns(a,[{key:"attach",value:function(){vart=this;this.filterField=this.container.querySelector("input.search"),this.filterField&&this.filterCallback&&(this.filterField.addEventListener("keyup",(function(e){e.target&&t._updateFilter(e.target.value)})),this.options.preFilter&&(t