1import{a as _e}from"./chunk-57QJHKXP.js";import{d as f,e as re,f as oe,g as ne,h as ae,i as ie,j as le,k as ce,l as ue,m as de,n as pe,o as se,p as me,q as fe,r as ge,u as be}from"./chunk-THS3DTHQ.js";import"./chunk-VX37S2CQ.js";import{a as ee}from"./chunk-PRGVVGWP.js";import"./chunk-5O4XP6ZR.js";import"./chunk-PX5XVEVT.js";import{i as te}from"./chunk-LP7YJ2W7.js";import{a as Z}from"./chunk-FI3OAXRX.js";import"./chunk-N4W4DLTI.js";import{Ba as g,Bb as I,Eb as v,Fb as k,Gb as U,Hc as V,Ia as G,Ja as O,Lb as m,Nc as Q,O as w,Oa as u,Pa as a,Qa as i,Qb as W,Qe as K,Ra as p,S as c,Uc as q,V as S,Va as y,Vc as z,W as x,Wa as P,Ya as B,_a as F,_b as A,ab as s,ca as D,da as h,gf as X,ib as N,ic as $,jb as E,la as n,mb as H,ob as d,oc as j,pb as b,qb as _,qc as L,ud as J,va as T,vf as Y}from"./chunk-AWCVWGGQ.js";import{a as R,b as M}from"./chunk-C6Q5SG76.js";var C=class e{config=c(V);languageService=c(z);preTableFormModel=D({search:"",rowHeight:"density4",fullWidth:!1});preTableForm=J(this.preTableFormModel);dataResource=j(()=>({url:`${this.config.apiRoot}/products/groups/generic`,params:{loadProducts:!0},headers:this.languageService.currentLanguageHeaders()}));static \u0275fac=function(t){return new(t||e)};static \u0275prov=w({token:e,factory:e.\u0275fac,providedIn:"root"})};var Pe=e=>({NUMBER:e});function ve(e,r){if(e&1&&(a(0,"th",13),d(1),i()),e&2){let t,o=s(2);u("sort",o.sort()),n(),_(" ",(t=o.umbData())==null?null:t.byProductGroupProductGroupName," ")}}function Re(e,r){if(e&1&&(a(0,"td",14),d(1),i()),e&2){let t=r.$implicit;n(),b(t.label)}}function Me(e,r){if(e&1&&(a(0,"th",15),d(1),i()),e&2){let t,o=s(2);u("sort",o.sort()),n(),_(" ",(t=o.umbData())==null?null:t.byProductGroupProductsInGroup," ")}}function we(e,r){if(e&1){let t=B();a(0,"td",14)(1,"div",16),F("click",function(){let l=S(t).$implicit,he=s(2);return x(he.redirectToProducts(l.id))}),a(2,"a"),d(3),v(4,"appCompute"),i(),p(5,"i",17),i()()}if(e&2){let t,o=r.$implicit,l=s(2);n(3),b(U(4,1,(t=l.umbData())==null?null:t.byProductGroupNbProducts,I(4,Pe,o.nbProducts)))}}function Se(e,r){e&1&&p(0,"tr",18)}function xe(e,r){e&1&&p(0,"tr",19)}function De(e,r){e&1&&(a(0,"tr",20)(1,"td",21),d(2),v(3,"translate"),i()()),e&2&&(n(2),_(" ",k(3,1,"noData")," "))}function Te(e,r){if(e&1&&(a(0,"div",3)(1,"table",4),y(2,5),g(3,ve,2,2,"th",6)(4,Re,2,1,"td",7),P(),y(5,8),g(6,Me,2,2,"th",9)(7,we,6,6,"td",7),P(),g(8,Se,1,0,"tr",10)(9,xe,1,0,"tr",11)(10,De,4,3,"tr",12),i()()),e&2){let t=s();H("full-width",t.fullWidth()),u("ngClass",t.density()),n(),u("dataSource",t.dataSource),n(7),u("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",!0),n(),u("matRowDefColumns",t.displayedColumns)}}function Ge(e,r){e&1&&(a(0,"div"),d(1,"Error loading product groups"),i())}function Oe(e,r){e&1&&p(0,"app-loader")}var Ce=class e{_service=c(C);serviceByProduct=c(_e);router=c(Q);umbracoService=c(K);umbData;preTableForm=this._service.preTableForm;density=this.preTableForm.rowHeight().value;fullWidth=m(()=>
1this.preTableForm.fullWidth?.().value()===!0);search=this.preTableForm.search().value;searchTerms=m(()=>X(this.search()??""));displayedColumns=["label","nbProducts"];sort=W(f);dataSource=new ge;dataResource=this._service.dataResource;allRows=m(()=>{let r=this.dataResource.value();return r?r.map(t=>M(R({},t),{nbProducts:t.products.length})):[]});constructor(){this.umbData=q(this.umbracoService.getPage$(["resources/product-groups"])),h(()=>{this.dataSource.data=this.filteredRows()}),h(()=>{let r=this.sort();r&&(this.dataSource.sort=r)})}filteredRows=m(()=>{let r=this.searchTerms();return this.allRows().filter(t=>{if(r.length)for(let o of r){let l=t.label??"";if(!Y(l,o))return!1}return!0})});redirectToProducts(r){this.serviceByProduct.groupId.set(r),this.router.navigateByUrl("/resources/product-groups/by-product")}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=T({type:e,selectors:[["app-resources-by-product-group"]],viewQuery:function(t,o){t&1&&N(o.sort,f,5),t&2&&E()},decls:9,vars:3,consts:[[1,"content"],[3,"form"],[1,"table-wrapper","scrollbar-thin",3,"full-width","ngClass"],[1,"table-wrapper","scrollbar-thin",3,"ngClass"],["mat-table","","matSort","",3,"dataSource"],["matColumnDef","label"],["mat-header-cell","","appTableSortable","label",3,"sort",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nbProducts"],["mat-header-cell","","appTableSortable","nbProducts",3,"sort",4,"matHeaderCellDef"],["class","bot-header","mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],["mat-header-cell","","appTableSortable","label",3,"sort"],["mat-cell",""],["mat-header-cell","","appTableSortable","nbProducts",3,"sort"],[1,"redirect",3,"click"],[1,"fa-solid","fa-magnifying-glass"],["mat-header-row","",1,"bot-header"],["mat-row",""],[1,"mat-row"],[1,"mat-cell"]],template:function(t,o){if(t&1&&(a(0,"section")(1,"div",0)(2,"h2"),d(3),i(),a(4,"div"),p(5,"app-pre-chart-form",1),G(6,Te,11,7,"div",2)(7,Ge,2,0,"div")(8,Oe,1,0,"app-loader"),i()()()),t&2){let l;n(3),b((l=o.umbData())==null?null:l.byProductGroupTitle),n(2),u("form",o.preTableForm),n(),O(o.dataResource.hasValue()?6:o.dataResource.error()?7:o.dataResource.isLoading()?8:-1)}},dependencies:[$,A,ee,re,f,fe,oe,ae,ue,ie,ne,de,le,ce,pe,se,me,be,te,Z,L],styles:["table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-bottom:10px;padding-top:10px}","[_nghost-%COMP%]{--cell-fixed-width-group: 180px}.table-wrapper[_ngcontent-%COMP%]{max-height:80vh;overflow-y:auto}table[_ngcontent-%COMP%] .group[_ngcontent-%COMP%]{width:var(--cell-fixed-width-group);min-width:var(--cell-fixed-width-group);max-width:var(--cell-fixed-width-group)}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .redirect[_ngcontent-%COMP%]{color:var(--accent);cursor:pointer;width:fit-content}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .redirect[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:underline}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .redirect[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;font-weight:700;margin-left:10px}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .redirect[_ngcontent-%COMP%]:hover{color:var(--primary-darker)}"],changeDetection:0})};export{Ce as ResourcesByProductGroupComponent};
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.