1(function(){"use strict";class t{constructor({items:t,filterKeys:e,sourceSort:s,searchKeys:r,itemsPerPage:i,useLazyLoad:a=!1,currentSort:o=s}){this.sourceData=t,this.filterKeys=e,this.sourceSort=s,this.searchKeys=r,this.processedData=[...t],this.currentSort=o,this.activeFilters=e.reduce((t,e)=>(t[e]=[],t),{}),this.query="",this.useLazyLoad=a,this.itemsPerPage=i,this.page=1,this.updateFilterCounts(),this.isDefaultSort()||this.applySort()}applySearch(){if(!this.query)return;const t={};for(const e of this.searchKeys)t[e]=e.split(".");this.processedData=this.processedData.filter(e=>this.searchKeys.some(s=>this.matchesFilter(e,t[s],this.query)))}resetData(){this.processedData=[...this.sourceData]}isDefaultSort(){return this.currentSort.key===this.sourceSort.key&&this.currentSort.value===this.sourceSort.value}applySort(){const{key:t,value:e}=this.currentSort;if(!this.processedData.length)return null;let s,r=this.processedData[0][t],i=0;while(!r&&i<this.processedData.length-1)i++,r=this.processedData[i][t];if(!r)return null;s="number"===typeof r?"asc"===e?(t,e)=>t-e:(t,e)=>e-t:isNaN(Date.parse(r))?"asc"===e?(t,e)=>t.localeCompare(e):(t,e)=>e.localeCompare(t):"asc"===e?(t,e)=>Date.parse(t)>Date.parse(e)?1:-1:(t,e)=>Date.parse(e)>Date.parse(t)?1:-1,this.processedData.sort((e,r)=>{const i=e[t],a=r[t];return null==i&&null==a?0:null==i?1:null==a?-1:s(i,a)})}search(t){const e=this.query;this.query=t,t.includes(e)?(this.applySearch(),this.updateFilterCounts()):(this.resetData(),this.applyFilters(),this.applySearch(),this.updateFilterCounts(),this.isDefaultSort()||this.applySort())}matchesFilter(t,s,r){const i=new RegExp(r,"i"),a=e(t,s);return a.some(t=>i.test(t))}applyFilters(){Object.entries(this.activeFilters).forEach(this.applyFilter)}applyFilter(t,e){if(!e.length)return null;const s=t.split(".");this.processedData=this.processedData.filter(t=>e.some(e=>this.matchesFilter(t,s,e)))}updateFilterCounts(){if(this.filterCounts=[],!this.processedData.length)return null;for(const t of this.filterKeys){const s=t.split("."),r={};for(const t of this.processedData){const i=e(t,s);i.forEach(t=>r[t]=(r[t]||0)+1)}this.filterCounts.push({name:t,data:Object.entries(r).sort(([,t],[,e])=>e-t)})}}addFilter({key:t,value:e}){this.activeFilters[t]=this.activeFilters[t]||[],this.activeFilters[t].push(e),this.applyFilter(t,[e]),this.updateFilterCounts()}removeFilter({key:t,value:e}){const s=this.activeFilters[t].indexOf(e);this.activeFilters[t].splice(s,1),this.resetData(),this.applyFilters(),this.applySearch(),this.updateFilterCounts(),this.isDefaultSort()||this.applySort()}toggleFilter(t){const{key:e,value:s}=t;this.activeFilters[e].includes(s)?this.removeFilter(t):this.addFilter(t)}loadMore(){this.page+=1}setSort(t){this.currentSort=t,this.isDefaultSort()?(this.resetData(),this.applyFilters(),this.applySearch(),this.updateFilterCounts()):this.applySort()}setPage(t){this.page=t}clearFilters(){this.activeFilters=this.filterKeys.reduce((t,e)=>(t[e]=[],t),{}),this.resetData(),this.updateFilterCounts(),this.isDefaultSort()||this.applySort()}}function e(t,s){const[r,...i]=s;return Array.isArray(t)?r?t.reduce((t,s)=>{const a=e(s[r],i)[0];return a&&t.push(a),t},[]):t:r?t.hasOwnProperty(r)?e(t[r],i):[]:t?[t]:[]}let s=null;self.onmessage=function(e){try{for(const i of e.data){const{type:e,payload:r}=i;if("init"===e)s=new t(r);else{if(!s||"function"!==typeof s[e])throw new Error(`Invalid action type or DataManager not ready: ${e}`);s[e](r)}}if(!s)throw new Error("DataManager is not initialized before processing data.");const r=s.processedData.slice(s.useLazyLoad?0:s.itemsPerPage*(s.page-1),s.itemsPerPage*s.page);self.postMessage({type:"success",items:r,totalItems:s.processedData.length,activeFilters:s.activeFilters,filterCounts:s.filterCounts})}catch(r){self.postMessage({type:"error",message:r.message})}}})();
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.