1(self.webpackChunkloocalio=self.webpackChunkloocalio||[]).push([[1277],{94506:(t,e,n)=>{"use strict";n.d(e,{r:()=>l});var i=n(79765),o=n(46782),a=n(37716),c=n(46289),r=n(19657);const s=["*"];let l=(()=>{class t{constructor(t){this.platformService=t,this.platformWidth="xl",this.destroy$=new i.xQ}ngOnInit(){this.platformService.width$.pipe((0,o.R)(this.destroy$)).subscribe(t=>{this.platformWidth=t})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}isPlatformWidthDense(){return this.platformService.isWidth("lt-md",this.platformWidth)}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(c.m))},t.\u0275cmp=a.Xpm({type:t,selectors:[["loc-card-crud"]],hostVars:2,hostBindings:function(t,e){2&t&&a.ekj("loc-card-crud--dense",e.isPlatformWidthDense())},inputs:{platformWidth:"platformWidth"},ngContentSelectors:s,decls:2,vars:0,template:function(t,e){1&t&&(a.F$t(),a.TgZ(0,"loc-list"),a.Hsn(1),a.qZA())},directives:[r.n],styles:[".loc-card-crud--dense[_nghost-%COMP%] .loc-card-crud__container{max-width:100%;margin:0;border-radius:0;border:none;box-shadow:none} .loc-card-crud__container{max-width:700px;margin:16px} .loc-card-crud__container ion-card-content{padding:16px 0} .loc-card-crud__container ion-searchbar{--box-shadow:none;--border-radius:6px;padding:16px} .loc-card-crud__container ion-searchbar .searchbar-input-container{border:1px solid #0000001a;border-radius:6px;box-shadow:none} .loc-card-crud__header{--background:#00000005;--inner-padding-top:8px;--inner-padding-bottom:8px} .loc-card-crud__header ion-label h2{font-weight:500} .loc-card-crud__header ion-label p{opacity:.8;font-size:13px}"]}),t})()},19657:(t,e,n)=>{"use strict";n.d(e,{n:()=>a});var i=n(37716);const o=["*"];let a=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=i.Xpm({type:t,selectors:[["loc-list"]],ngContentSelectors:o,decls:1,vars:0,template:function(t,e){1&t&&(i.F$t(),i.Hsn(0))},styles:["[_nghost-%COMP%] mat-form-field:not(.mat-paginator-page-size-select){padding:0 16px;width:100%}[_nghost-%COMP%] mat-form-field:not(.mat-paginator-page-size-select) .mat-form-field-suffix{top:0!important}[_nghost-%COMP%] ion-item-divider{margin-bottom:20px;background-color:#00000008;text-transform:uppercase;font-size:13px;font-weight:500;letter-spacing:1px}[_nghost-%COMP%] ion-item-divider ion-button[slot=end]{margin-right:16px}[_nghost-%COMP%] ion-reorder[slot=start]{margin-right:20px}[_nghost-%COMP%] ion-list ion-item ion-label h3{font-weight:500}[_nghost-%COMP%] ion-list ion-item ion-label p{opacity:.8;font-size:13px}[_nghost-%COMP%] .loc-list__actions{margin-bottom:20px;margin-top:10px}[_nghost-%COMP%] .loc-list__block-button{margin-bottom:16px;padding-left:16px}[_nghost-%COMP%] .loc-list__right-inline-button{margin-left:-14px;margin-top:-31px}"]}),t})()},71277:(t,e,n)=>{"use strict";n.r(e),n.d(e,{InvoicesCrudPageModule:()=>E});var i=n(38583),o=n(3679),a=n(94490),c=n(63423),r=n(79765),s=n(46782),l=n(37716),d=n(46289),h=n(94506),p=n(35618),u=n(99692),g=n(11494),m=n(66682),f=n(54395),b=n(87519),_=n(93342),x=n(15257),v=n(43190),w=n(68939),C=n(5304),S=n(26215),Z=n(25917);class y{constructor(t,e,n){this.invoicesService=t,this.authService=e,this.usersService=n,this.invoicesSubject=new S.X([]),this.loadingSubject=new S.X(!1),this.loading$=this.loadingSubject.asObservable(),this.totalItemsCountSubject=new S.X(0),this.totalItemsCount$=this.totalItemsCountSubject.asObservable()}connect(t){return this.invoicesSubject.asObservable()}disconnect(t){this.invoicesSubject.complete(),this.loadingSubject.complete(),this.totalItemsCountSubject.complete()}loadInvoices(t){this.loadingSubject.next(!0),this.authService.getAuthUser().pipe((0,x.q)(1),(0,v.w)(e=>this.usersService.isAdmin(e)?this.invoicesService.getAllInvoices(t||null).pipe((0,w.x)(()=>this.loadingSubject.next(!1))):this.usersService.isSales(e)?this.invoicesService.getReferedInvoices(t||null).pipe((0,w.x)(()=>this.loadingSubject.next(!1))):this.usersService.isCustomer(e)?this.invoicesService.getMyAllInvoices(t||null).pipe((0,w.x)(()=>this.loadingSubject.next(!1))):void 0),(0,C.K)(()=>(0,Z.of)([])),(0,w.x)(()=>this.loadingSubject.next(!1))).subscribe(t=>{this.totalItemsCountSubject.next(t.total),this.invoicesSubject.next(t.data)})}}var O=n(53815),P=n(95038),M=n(83348),I=n(50384),A=n(35700),k=n(32789),D=n(92406);function j(t,e){1&t&&(l.TgZ(0,"th",16),l._uU(1,"Id"),l.qZA())}function q(t,e){if(1&t&&(l.TgZ(0,"td",17),l._uU(1),l.qZA()),2&t){const t=e.$implicit;l.xp6(1),l.Oqu(t.id)}}function T(t,e){1&t&&(l.TgZ(0,"th",16),l._uU(1,"Nazwa"),l.qZA())}function $(t,e){if(1&t&&(l.TgZ(0,"td",18),l._uU(1),l.qZA()),2&t){const t=e.$implicit;l.xp6(1),l.hij(" ",t.name," ")}}function U(t,e){1&t&&(l.TgZ(0,"th",19),l._uU(1," Data wystawienia "),l.qZA())}function Y(t,e){if(1&t&&(l.TgZ(0,"td",17),l._uU(1),l.qZA()),2&t){const t=e.$implicit;l.xp6(1),l.hij(" ",t.created_at," ")}}function z(t,e){1&t&&(l.TgZ(0,"th",20),l._uU(1,"Akcje"),l.qZA())}function W(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"td",21),l.TgZ(1,"div",22),l.TgZ(2,"ion-button",23),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().downloadInvoice(e.id)}),l._UZ(3,"ion-icon",24),l.qZA(),l.qZA(),l.qZA()}}function N(t,e){1&t&&l._UZ(0,"tr",25)}function Q(t,e){1&t&&l._UZ(0,"tr",26)}
1function R(t,e){1&t&&(l.TgZ(0,"div",27),l._UZ(1,"ion-spinner"),l.qZA())}const B=function(){return[5,10,20]};let H=(()=>{class t{constructor(t,e,n,i,o){this.invoicesService=t,this.alertsService=e,this.loadingService=n,this.authService=i,this.usersService=o,this.displayedColumns=["name","created_at","actions"],this.destroy$=new r.xQ}get searchInput(){return this._searchInput}set searchInput(t){t.ionChange.pipe((0,s.R)(this.destroy$),(0,f.b)(700),(0,b.x)(),(0,_.b)(()=>{this.paginator&&(this.paginator.pageIndex=0),this.fetchData()})).subscribe(),this._searchInput=t}ngOnInit(){this.dataSource=new y(this.invoicesService,this.authService,this.usersService)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.fetchData(),this.paginator._intl.itemsPerPageLabel="",this.sort.sortChange.subscribe(()=>this.paginator.pageIndex=0),(0,m.T)(this.sort.sortChange,this.paginator.page).pipe((0,_.b)(()=>this.fetchData())).subscribe()}fetchData(){this.sort&&this.paginator&&this.dataSource.loadInvoices({filter:this.searchInput?this.searchInput.value:"",sortOrder:this.sort.direction,sortField:this.sort.active,pageNumber:this.paginator.pageIndex,pageSize:this.paginator.pageSize})}downloadInvoice(t){this.loadingService.showLoadingAlert(),this.invoicesService.getInvoiceDownload(t).subscribe(t=>{this.loadingService.closeLoadingAlert(),this.invoiceUrl=t.url,window.open(this.invoiceUrl,"_blank")})}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(O.x),l.Y36(P.m),l.Y36(M.b),l.Y36(I.e),l.Y36(A.f))},t.\u0275cmp=l.Xpm({type:t,selectors:[["loc-invoices-table"]],viewQuery:function(t,e){if(1&t&&(l.Gf(u.NW,5),l.Gf(g.YE,5)),2&t){let t;l.iGM(t=l.CRH())&&(e.paginator=t.first),l.iGM(t=l.CRH())&&(e.sort=t.first)}},inputs:{searchInput:"searchInput"},decls:20,vars:13,consts:[[1,"table-container"],["mat-table","","matSort","","aria-label","Elements","matSortDisableClear","",1,"full-width-table",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name","xsticky",""],["mat-cell","","style","font-weight: 500 !important",4,"matCellDef"],["matColumnDef","created_at"],["style","min-width: 120px","mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["class","loc-table__actions-cell","mat-cell","",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","pxc-table__spinner",4,"ngIf"],[3,"length","pageSize","pageSizeOptions"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-cell","",2,"font-weight","500 !important"],["mat-header-cell","","mat-sort-header","",2,"min-width","120px"],["mat-header-cell",""],["mat-cell","",1,"loc-table__actions-cell"],[1,"loc-table__actions"],["fill","clear","color","dark",3,"click"],["pxcIcon","mdi@download","slot","icon-only"],["mat-header-row",""],["mat-row",""],[1,"pxc-table__spinner"]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"table",1),l.ynx(2,2),l.YNc(3,j,2,0,"th",3),l.YNc(4,q,2,1,"td",4),l.BQk(),l.ynx(5,5),l.YNc(6,T,2,0,"th",3),l.YNc(7,$,2,1,"td",6),l.BQk(),l.ynx(8,7),l.YNc(9,U,2,0,"th",8),l.YNc(10,Y,2,1,"td",4),l.BQk(),l.ynx(11,9),l.YNc(12,z,2,0,"th",10),l.YNc(13,W,4,0,"td",11),l.BQk(),l.YNc(14,N,1,0,"tr",12),l.YNc(15,Q,1,0,"tr",13),l.qZA(),l.qZA(),l.YNc(16,R,2,0,"div",14),l.ALo(17,"async"),l._UZ(18,"mat-paginator",15),l.ALo(19,"async")),2&t&&(l.xp6(1),l.Q6J("dataSource",e.dataSource),l.xp6(13),l.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",!0),l.xp6(1),l.Q6J("matRowDefColumns",e.displayedColumns),l.xp6(1),l.Q6J("ngIf",l.lcZ(17,8,e.dataSource.loading$)),l.xp6(2),l.Q6J("length",l.lcZ(19,10,e.dataSource.totalItemsCount$))("pageSize",10)("pageSizeOptions",l.DdM(12,B)))},directives:[k.BZ,g.YE,k.w1,k.fO,k.Dz,k.as,k.nj,i.O5,u.NW,k.ge,g.nU,k.ev,a.YG,a.gu,D.a,k.XQ,k.Gk,a.PQ],pipes:[i.Ov],styles:[".full-width-table[_ngcontent-%COMP%]{width:100%}.table-container[_ngcontent-%COMP%]{height:calc(100% - 56px);width:100%;max-width:100%;overflow:auto}th[_ngcontent-%COMP%]{padding:10px 10px 10px 20px!important;text-align:left!important}td[_ngcontent-%COMP%]{padding:20px!important}th[_ngcontent-%COMP%]{font-weight:600!important;color:#000c;background-color:#ececec!important}mat-paginator[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{box-shadow:inset 0 1px 0 #0000000d}mat-paginator[_ngcontent-%COMP%]{background-color:#00000005}.loc-badge[_ngcontent-%COMP%]{font-weight:400;text-transform:uppercase;letter-spacing:.3px}.loc-badge--active[_ngcontent-%COMP%]{background-color:green}.loc-badge--waiting[_ngcontent-%COMP%]{background-color:red}.loc-badge--gold[_ngcontent-%COMP%]{background-color:#c9ac07}.loc-badge--orange[_ngcontent-%COMP%]{background-color:#c77700}.loc-badge--primary[_ngcontent-%COMP%]{background-color:var(--ion-color-primary)}.loc-badge--gray[_ngcontent-%COMP%]{background-color:#494949}.loc-badge--custom[_ngcontent-%COMP%]{background-color:#8b4513}.loc-table__link-cell[_ngcontent-%COMP%]{cursor:pointer}tr[_ngcontent-%COMP%]:hover{background-color:#00000008}.loc-table__actions-cell[_ngcontent-%COMP%]{padding:0 10px 0 0!important}.loc-table__actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-direction:row;place-content:flex-start;align-items:center;box-sizing:border-box}.loc-table__actions[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%]{font-size:11px;
1--padding-start:8px;--padding-end:8px;--padding-bottom:15px;--padding-top:15px}"]}),t})();const J=[{path:"",component:(()=>{class t{constructor(t){this.platformService=t,this.platformWidth="xl",this.destroy$=new r.xQ}ngOnInit(){this.platformService.width$.pipe((0,s.R)(this.destroy$)).subscribe(t=>{this.platformWidth=t})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}isPlatformWidthDense(){return this.platformService.isWidth("lt-md",this.platformWidth)}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(d.m))},t.\u0275cmp=l.Xpm({type:t,selectors:[["loc-invoices-crud"]],hostVars:2,hostBindings:function(t,e){2&t&&l.ekj("loc-invoices-crud--dense",e.isPlatformWidthDense())},inputs:{platformWidth:"platformWidth"},decls:13,vars:1,consts:[["slot","start"],[1,"loc-card-crud__container"],["fxLayoutAlign","start center"],["placeholder","Szukaj"],["searchInput",""],[3,"searchInput"]],template:function(t,e){if(1&t&&(l.TgZ(0,"ion-header"),l.TgZ(1,"ion-toolbar"),l.TgZ(2,"ion-buttons",0),l._UZ(3,"ion-menu-button"),l.qZA(),l.TgZ(4,"ion-title"),l._uU(5,"Faktury"),l.qZA(),l.qZA(),l.qZA(),l.TgZ(6,"ion-content"),l.TgZ(7,"loc-card-crud"),l.TgZ(8,"ion-card",1),l.TgZ(9,"div",2),l._UZ(10,"ion-searchbar",3,4),l.qZA(),l._UZ(12,"loc-invoices-table",5),l.qZA(),l.qZA(),l.qZA()),2&t){const t=l.MAs(11);l.xp6(12),l.Q6J("searchInput",t)}},directives:[a.Gu,a.sr,a.Sm,a.fG,a.wd,a.W2,h.r,a.PM,p.Wh,a.VI,a.j9,H],styles:[".loc-card-crud__container[_ngcontent-%COMP%]{max-width:1500px}ion-searchbar[_ngcontent-%COMP%]{width:auto}"]}),t})()}];let X=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[c.Bz.forChild(J)],c.Bz]}),t})();var G=n(15566),L=n(21482),F=n(84419);let E=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,o.u5,a.Pc,X,k.p0,u.TU,g.JX,G.o9,c.Bz,L.i,F.p]]}),t})()}}]);
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.