1 line
31 KiB
JavaScript
1 line
31 KiB
JavaScript
"use strict";(self.webpackChunkangular_material_template=self.webpackChunkangular_material_template||[]).push([[180],{6180:(de,$,r)=>{r.r($),r.d($,{SalesModule:()=>me});var p=r(1368),C=r(2992),T=r(3200),f=r(2864),O=r(2304),t=r(4496),I=r(4104),d=r(2276),k=r(1560),g=r(7816),c=r(2080),v=r(3892);function w(e,n){1&e&&(t.I0R(0,"div",4),t.wR5(1,"p-skeleton",5)(2,"p-skeleton",6)(3,"p-skeleton",7)(4,"p-skeleton",6),t.C$Y())}function L(e,n){if(1&e&&(t.I0R(0,"div",4)(1,"p")(2,"strong"),t.OEk(3),t.C$Y()(),t.I0R(4,"p")(5,"mat-icon"),t.OEk(6,"event"),t.C$Y(),t.OEk(7),t.wVc(8,"date"),t.C$Y(),t.I0R(9,"p")(10,"mat-icon"),t.OEk(11,"account_balance"),t.C$Y(),t.OEk(12),t.C$Y(),t.I0R(13,"p")(14,"mat-icon"),t.OEk(15,"location_on"),t.C$Y(),t.OEk(16),t.C$Y()()),2&e){const a=t.GaO();t.yG2(3),t.cNF(a.SaleInfo.title),t.yG2(4),t.CAO("",t.g7$(8,5,a.date,"dd/MM/yyyy")," - ",a.hour,""),t.yG2(5),t.cNF(a.SaleInfo.saleHouseName),t.yG2(4),t.cNF(a.SaleInfo.location)}}let x=(()=>{class e{constructor(a,i,o){this.apiSaleService=a,this.dialogRef=i,this.data=o,this.url="",this.hour="",this.SaleInfo={_id:"",idPlatform:"",platform:"",url:"",title:"",date:"",location:"",saleHouseName:"",status:""},this.date=new Date}ngOnInit(){this.url=this.data.url,console.log(this.url),this.apiSaleService.getSaleInfos(this.url).subscribe(a=>{console.log(a),this.SaleInfo=a,this.date=O(this.SaleInfo.date).tz("Europe/Paris").toDate(),this.hour=O(this.SaleInfo.date).tz("Europe/Paris").format("HH:mm")})}save(){this.apiSaleService.saveSale({_id:{$oid:""},idPlatform:this.SaleInfo.idPlatform,platform:this.SaleInfo.platform,url:this.SaleInfo.url,title:this.SaleInfo.title,date:this.SaleInfo.date,location:this.SaleInfo.location,saleHouseName:this.SaleInfo.saleHouseName,status:"ready"}).subscribe(i=>{this.dialogRef.close(!0)})}cancel(){this.dialogRef.close(!1)}static#t=this.\u0275fac=function(i){return new(i||e)(t.GI1(I.o),t.GI1(f.yI),t.GI1(f.sR))};static#e=this.\u0275cmp=t.In1({type:e,selectors:[["loading-sale-dialog-dialog"]],decls:16,vars:2,consts:[["fxLayout","column","fxLayoutGap","5px",4,"ngIf"],["fxLayout","row","fxLayoutGap","5px"],["mat-button","","color","warn",3,"click"],["mat-raised-button","","color","primary",3,"click"],["fxLayout","column","fxLayoutGap","5px"],["width","250px","height","20px"],["width","150px","height","20px"],["width","200px","height","20px"]],template:function(i,o){1&i&&(t.I0R(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title"),t.OEk(3,"Sale"),t.C$Y(),t.I0R(4,"mat-card-subtitle"),t.OEk(5,"Sale informations"),t.C$Y()(),t.I0R(6,"mat-card-content"),t.yuY(7,w,5,0,"div",0)(8,L,17,8,"div",0),t.C$Y()(),t.I0R(9,"mat-card")(10,"mat-card-content")(11,"div",1)(12,"button",2),t.qCj("click",function(){return o.cancel()}),t.OEk(13,"Cancel"),t.C$Y(),t.I0R(14,"button",3),t.qCj("click",function(){return o.save()}),t.OEk(15,"Save"),t.C$Y()()()()),2&i&&(t.yG2(7),t.E7m("ngIf",""==o.SaleInfo.title),t.yG2(),t.E7m("ngIf",""!=o.SaleInfo.title))},dependencies:[p.u_,d.sZ,d.cZ,k.qL,g.Gw,c.SM,c.WK,c.Uc,c.uK,c.gp,v.W,p.y],styles:[".example-card[_ngcontent-%COMP%]{margin-bottom:8px}"]})}return e})();var _=r(5908),Y=r(4440),P=r(4476),u=r(6504),b=r(9092),D=r(7536),S=r(1544),A=r(3576),s=r(8818),h=r(180),H=r(2096),M=r(8156);function U(e,n){if(1&e&&(t.OEk(0," Current Sales "),t.wR5(1,"span",21)),2&e){const a=t.GaO();t.yG2(),t._6D("matBadge",a.futureSales.length)}}function B(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Title "),t.C$Y())}function N(e,n){1&e&&(t.I0R(0,"div"),t.wR5(1,"mat-progress-bar",26),t.C$Y())}function F(e,n){if(1&e&&(t.I0R(0,"td",23)(1,"a",24),t.OEk(2),t.C$Y(),t.yuY(3,N,2,0,"div",25),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t._6D("href",a.url,t.K6U),t.yG2(),t.cNF(a.title),t.yG2(),t.E7m("ngIf","following"==a.status)}}function j(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Date "),t.C$Y())}function K(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.wVc(2,"date"),t.wVc(3,"date"),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.CAO(" ",t.g7$(2,2,a.date,"dd/MM/yyyy")," - ",t.g7$(3,5,a.date,"HH:mm")," ")}}function Q(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Sale House "),t.C$Y())}function V(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.saleHouseName," ")}}function J(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Plateforme "),t.C$Y())}function z(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.platform," ")}}function q(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Status "),t.C$Y())}function Z(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.status," ")}}function W(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Action "),t.C$Y())}function X(e,n){if(1&e){const a=t.KQA();t.I0R(0,"mat-option",29),t.qCj("click",function(){t.usT(a);const o=t.GaO().$implicit,l=t.GaO();return t.CGJ(l.prepareSale(o))}),t.I0R(1,"mat-icon"),t.OEk(2,"format_list_numbered"),t.C$Y(),t.OEk(3," Prepare"),t.C$Y()}}function tt(e,n){if(1&e){const a=t.KQA();t.I0R(0,"mat-option",29),t.qCj("click",function(){t.usT(a);const o=t.GaO().$implicit,l=t.GaO();return t.CGJ(l.followSale(o))}),t.I0R(1,"mat-icon"),t.OEk(2,"play_arrow"),t.C$Y(),t.OEk(3," Follow"),t.C$Y()}}function et(e,n){if(1&e){const a=t.KQA();t.I0R(0,"mat-option",29),t.qCj("click",function(){t.usT(a);const o=t.GaO().$implicit,l=t.GaO();return t.CGJ(l.stopFollowSale(o))}),t.I0R(1,"mat-icon"),t.OEk(2,"stop"),t.C$Y(),t.OEk(3," Stop Following"),t.C$Y()}}function at(e,n){if(1&e){const a=t.KQA();t.I0R(0,"mat-option",29),t.qCj("click",function(){t.usT(a);const o=t.GaO().$implicit,l=t.GaO();return t.CGJ(l.resetToReady(o._id))}),t.OEk(1,"Reset to Ready"),t.C$Y()}}function ot(e,n){if(1&e){const a=t.KQA();t.I0R(0,"td",23)(1,"mat-select",27),t.yuY(2,X,4,0,"mat-option",28)(3,tt,4,0,"mat-option",28)(4,et,4,0,"mat-option",28)(5,at,2,0,"mat-option",28),t.I0R(6,"mat-option",29),t.qCj("click",function(){const l=t.usT(a).$implicit,m=t.GaO();return t.CGJ(m.navigateToSaleDetail(l._id))}),t.I0R(7,"mat-icon"),t.OEk(8,"info"),t.C$Y(),t.OEk(9," Details"),t.C$Y(),t.I0R(10,"mat-option",29),t.qCj("click",function(){const l=t.usT(a).$implicit,m=t.GaO();return t.CGJ(m.postProcessing(l._id))}),t.I0R(11,"mat-icon"),t.OEk(12,"query_stats"),t.C$Y(),t.OEk(13," Post-processing"),t.C$Y(),t.I0R(14,"mat-option",29),t.qCj("click",function(){const l=t.usT(a).$implicit,m=t.GaO();return t.CGJ(m.deleteSale(l._id))}),t.I0R(15,"mat-icon"),t.OEk(16,"delete"),t.C$Y(),t.OEk(17," Delete"),t.C$Y()()()}if(2&e){const a=n.$implicit;t.yG2(2),t.E7m("ngIf","ready"==a.status),t.yG2(),t.E7m("ngIf","ready"==a.status||"endOnRequest"==a.status||"endOnError"==a.status),t.yG2(),t.E7m("ngIf","following"==a.status),t.yG2(),t.E7m("ngIf","following"==a.status)}}function nt(e,n){1&e&&t.wR5(0,"tr",30)}function it(e,n){1&e&&t.wR5(0,"tr",31)}function lt(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Title "),t.C$Y())}function st(e,n){if(1&e){const a=t.KQA();t.I0R(0,"td",23)(1,"a",29),t.qCj("click",function(){const l=t.usT(a).$implicit,m=t.GaO();return t.CGJ(m.navigateToSaleDetail(l._id))}),t.OEk(2),t.C$Y()()}if(2&e){const a=n.$implicit;t.yG2(2),t.cNF(a.title)}}function rt(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Date "),t.C$Y())}function mt(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.wVc(2,"date"),t.wVc(3,"date"),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.CAO(" ",t.g7$(2,2,a.date,"dd/MM/yyyy")," - ",t.g7$(3,5,a.date,"HH:mm")," ")}}function ct(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Sale House "),t.C$Y())}function dt(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.saleHouseName," ")}}function pt(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Plateforme "),t.C$Y())}function ut(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.platform," ")}}function ft(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Status "),t.C$Y())}function ht(e,n){if(1&e&&(t.I0R(0,"td",23),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.status," ")}}function Ct(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Post Processing "),t.C$Y())}function _t(e,n){if(1&e){const a=t.KQA();t.I0R(0,"td",23)(1,"button",32),t.qCj("click",function(){const l=t.usT(a).$implicit,m=t.GaO();return t.CGJ(m.postProcessing(l._id))}),t.I0R(2,"mat-icon"),t.OEk(3,"query_stats"),t.C$Y()()()}}function gt(e,n){1&e&&(t.I0R(0,"th",22),t.OEk(1," Delete "),t.C$Y())}function St(e,n){if(1&e){const a=t.KQA();t.I0R(0,"td",23)(1,"button",32),t.qCj("click",function(){const l=t.usT(a).$implicit,m=t.GaO();return t.CGJ(m.deleteSale(l._id))}),t.I0R(2,"mat-icon"),t.OEk(3,"delete"),t.C$Y()()()}}function yt(e,n){1&e&&t.wR5(0,"tr",30)}function Rt(e,n){1&e&&t.wR5(0,"tr",31)}let It=(()=>{class e{constructor(a,i,o,l,m){this.notificationService=a,this.router=i,this.dialog=o,this.apiSaleService=l,this.titleService=m,this.url="",this.displayedColumns=["title","date","house","plateform","status","action"],this.displayedColumnsOld=["title","date","house","plateform","status","postProcessing","delete"],this.futureSales=[],this.pastSales=[]}openLoadingSale(){this.dialog.open(x,{width:"300px",data:{url:this.url}}).afterClosed().subscribe(i=>{i&&(this.refreshSales(),this.url="",this.notificationService.openSnackBar("Sale Added"))})}refreshSales(){this.apiSaleService.getAllSale().subscribe(a=>{console.log(a);const i=_().startOf("day");this.futureSales=a.filter(o=>_(o.date).isAfter(i)).sort((o,l)=>_(o.date).isAfter(l.date)?1:-1),this.pastSales=a.filter(o=>_(o.date).isBefore(i)).sort((o,l)=>_(o.date).isAfter(l.date)?1:-1)})}trackByElementId(a,i){return i._id}ngOnInit(){this.titleService.setTitle("Jucundus - Sales"),this.refreshSales(),this.refreshSalesId=setInterval(()=>{this.refreshSales()},5e3)}ngOnDestroy(){this.refreshSalesId&&clearInterval(this.refreshSalesId)}prepareSale(a){this.apiSaleService.prepareSale(a).subscribe(i=>{console.log(i),this.refreshSales(),this.notificationService.openSnackBar("Prepare Sale")})}followSale(a){this.apiSaleService.followSale(a).subscribe(i=>{console.log(i),this.refreshSales(),this.notificationService.openSnackBar("Sale followed")})}stopFollowSale(a){a.status="askStop",this.apiSaleService.updateSale(a).subscribe(i=>{this.refreshSales(),this.notificationService.openSnackBar("Sale Stopping...")})}deleteSale(a){this.apiSaleService.deleteSale(a).subscribe(i=>{this.refreshSales(),this.notificationService.openSnackBar("Sale deleted")})}resetToReady(a){this.apiSaleService.resetSaleToReady(a)}navigateToSaleDetail(a){console.log(a),clearInterval(this.refreshSalesId),this.router.navigate(["/sales/detail",a])}postProcessing(a){this.apiSaleService.postProcessing(a).subscribe(i=>{this.notificationService.openSnackBar("Sale processing")})}static#t=this.\u0275fac=function(i){return new(i||e)(t.GI1(Y.g),t.GI1(C.E5),t.GI1(f.qW),t.GI1(I.o),t.GI1(P.OY))};static#e=this.\u0275cmp=t.In1({type:e,selectors:[["app-favorites-page"]],decls:70,vars:9,consts:[["fxLayout","row","fxLayoutAlign","center none",1,"container"],["fxFlex","95%"],["fxLayout","row","fxLayoutGap","5px"],["matInput","","placeholder","Ex. https://drouot.com/...","maxlength","255","st","",3,"ngModel","ngModelChange"],["mat-raised-button","","color","primary",3,"click"],[2,"margin-top","10px"],["mat-tab-label",""],["mat-table","",1,"mat-elevation-z8",3,"dataSource"],["matColumnDef","title"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","date"],["matColumnDef","house"],["matColumnDef","plateform"],["matColumnDef","status"],["matColumnDef","action"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefTrackBy"],["label","Old Sales"],["matColumnDef","postProcessing"],["matColumnDef","delete"],["matBadgeOverlap","false",2,"margin","5px",3,"matBadge"],["mat-header-cell",""],["mat-cell",""],["target","_blank",3,"href"],[4,"ngIf"],["mode","indeterminate"],["placeholder","Select action"],[3,"click",4,"ngIf"],[3,"click"],["mat-header-row",""],["mat-row",""],["mat-button","",3,"click"]],template:function(i,o){1&i&&(t.I0R(0,"div",0)(1,"div",1)(2,"mat-card")(3,"mat-card-header")(4,"mat-card-title"),t.OEk(5,"New Sale"),t.C$Y()(),t.I0R(6,"mat-card-content")(7,"div",2)(8,"mat-form-field")(9,"mat-label"),t.OEk(10,"Url"),t.C$Y(),t.I0R(11,"input",3),t.iHE("ngModelChange",function(m){return t.kNx(o.url,m)||(o.url=m),m}),t.C$Y()(),t.I0R(12,"button",4),t.qCj("click",function(){return o.openLoadingSale()}),t.OEk(13,"Add"),t.C$Y()()()(),t.I0R(14,"mat-card",5)(15,"mat-card-header")(16,"mat-card-title"),t.OEk(17,"Sales"),t.C$Y()(),t.I0R(18,"mat-card-content")(19,"mat-tab-group")(20,"mat-tab"),t.yuY(21,U,2,1,"ng-template",6),t.I0R(22,"div",2)(23,"table",7),t.SAx(24,8),t.yuY(25,B,2,0,"th",9)(26,F,4,3,"td",10),t.k70(),t.SAx(27,11),t.yuY(28,j,2,0,"th",9)(29,K,4,8,"td",10),t.k70(),t.SAx(30,12),t.yuY(31,Q,2,0,"th",9)(32,V,2,1,"td",10),t.k70(),t.SAx(33,13),t.yuY(34,J,2,0,"th",9)(35,z,2,1,"td",10),t.k70(),t.SAx(36,14),t.yuY(37,q,2,0,"th",9)(38,Z,2,1,"td",10),t.k70(),t.SAx(39,15),t.yuY(40,W,2,0,"th",9)(41,ot,18,4,"td",10),t.k70(),t.yuY(42,nt,1,0,"tr",16)(43,it,1,0,"tr",17),t.C$Y()()(),t.I0R(44,"mat-tab",18)(45,"div",2)(46,"table",7),t.SAx(47,8),t.yuY(48,lt,2,0,"th",9)(49,st,3,1,"td",10),t.k70(),t.SAx(50,11),t.yuY(51,rt,2,0,"th",9)(52,mt,4,8,"td",10),t.k70(),t.SAx(53,12),t.yuY(54,ct,2,0,"th",9)(55,dt,2,1,"td",10),t.k70(),t.SAx(56,13),t.yuY(57,pt,2,0,"th",9)(58,ut,2,1,"td",10),t.k70(),t.SAx(59,14),t.yuY(60,ft,2,0,"th",9)(61,ht,2,1,"td",10),t.k70(),t.SAx(62,19),t.yuY(63,Ct,2,0,"th",9)(64,_t,4,0,"td",10),t.k70(),t.SAx(65,20),t.yuY(66,gt,2,0,"th",9)(67,St,4,0,"td",10),t.k70(),t.yuY(68,yt,1,0,"tr",16)(69,Rt,1,0,"tr",17),t.C$Y()()()()()()()()),2&i&&(t.yG2(11),t.OKB("ngModel",o.url),t.yG2(12),t.E7m("dataSource",o.futureSales),t.yG2(19),t.E7m("matHeaderRowDef",o.displayedColumns),t.yG2(),t.E7m("matRowDefColumns",o.displayedColumns)("matRowDefTrackBy",o.trackByElementId),t.yG2(3),t.E7m("dataSource",o.pastSales),t.yG2(22),t.E7m("matHeaderRowDef",o.displayedColumnsOld),t.yG2(),t.E7m("matRowDefColumns",o.displayedColumnsOld)("matRowDefTrackBy",o.trackByElementId))},dependencies:[p.u_,u.ot,u.ue,u.Mj,u._G,d.sZ,d.cZ,d.qG,d.CA,k.qL,g.Gw,c.SM,c.WK,c.Uc,c.gp,b.wx,D.yi,S.Up,S.w5,A.I5,s.wL,s.ie,s.aG,s.Af,s.uc,s.gx,s.qC,s.cX,s.yC,s._I,h.i0,h.aJ,h._q,H.kX,M.S,p.y],styles:["mat-icon[_ngcontent-%COMP%]{color:#c80000}"]})}return e})();var y=r(2156),E=r(8059),G=r(8825),R=r(6664);function kt(e,n){1&e&&(t.I0R(0,"th",14),t.OEk(1,"Amount"),t.C$Y())}function Et(e,n){if(1&e&&(t.I0R(0,"td",15),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.amount," ")}}function $t(e,n){1&e&&(t.I0R(0,"th",14),t.OEk(1," Type "),t.C$Y())}function Ot(e,n){if(1&e&&(t.I0R(0,"td",15),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.auctioned_type," ")}}function Yt(e,n){1&e&&(t.I0R(0,"th",14),t.OEk(1," Time "),t.C$Y())}function Pt(e,n){if(1&e&&(t.I0R(0,"td",15),t.OEk(1),t.wVc(2,"date"),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",t.I7O(2,1,a.timestamp,"HH:mm:ss","Europe/Paris")," ")}}function Dt(e,n){1&e&&t.wR5(0,"tr",16)}function Gt(e,n){1&e&&t.wR5(0,"tr",17)}const Tt=()=>[5,10,15];let vt=(()=>{class e{constructor(a,i,o,l){this.apiLotService=a,this.dialogRef=i,this.sanitizer=o,this.data=l,this.displayedColumns=["amount","type","time"],this.bids=new s._c,this.id=l.id,this.Lot={_id:{$oid:""},idPlatform:"",platform:"",timestamp:"",lotNumber:"",RawData:{},sale_id:{$oid:""},Bids:[],title:"",description:"",auctioned:{timestamp:"",amount:0,auctioned_type:"",sold:!1}}}ngOnInit(){this.apiLotService.getLot(this.id).subscribe(a=>{this.Lot=a,this.bids=new s._c(a.Bids??[]),this.bids.paginator=this.paginator??null})}getSafeDescription(){return this.Lot&&this.Lot.description?this.sanitizer.bypassSecurityTrustHtml(this.Lot.description.replace(/\n/g,"<br>")):""}cancel(){this.dialogRef.close(!1)}static#t=this.\u0275fac=function(i){return new(i||e)(t.GI1(G.g),t.GI1(f.yI),t.GI1(P.mI),t.GI1(f.sR))};static#e=this.\u0275cmp=t.In1({type:e,selectors:[["lot-detail-dialog-dialog"]],viewQuery:function(i,o){if(1&i&&t.CC$(y.Qb,5),2&i){let l;t.wto(l=t.Gqi())&&(o.paginator=l.first)}},decls:47,vars:10,consts:[["fxLayout","row","fxLayoutGap","5px"],["matListItemTitle",""],["matListItemLine",""],["matListItemLine","",3,"innerHTML"],["mat-table","",1,"mat-elevation-z8",3,"dataSource"],["matColumnDef","amount"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","type"],["matColumnDef","time"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["mat-button","","color","warn",3,"click"],["mat-header-cell",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(i,o){1&i&&(t.I0R(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title"),t.OEk(3,"Lot"),t.C$Y(),t.I0R(4,"mat-card-subtitle"),t.OEk(5,"Lot informations"),t.C$Y()(),t.I0R(6,"mat-card-content")(7,"div",0)(8,"mat-list")(9,"mat-list-item")(10,"span",1),t.OEk(11,"#"),t.C$Y(),t.I0R(12,"span",2),t.OEk(13),t.C$Y()(),t.I0R(14,"mat-list-item")(15,"span",1),t.OEk(16,"Title"),t.C$Y(),t.I0R(17,"span",2),t.OEk(18),t.C$Y()(),t.I0R(19,"mat-list-item")(20,"span",1),t.OEk(21,"Description"),t.C$Y(),t.wR5(22,"span",3),t.C$Y(),t.I0R(23,"mat-list-item")(24,"span",1),t.OEk(25,"Estimate"),t.C$Y(),t.I0R(26,"span",2),t.OEk(27),t.C$Y()()()(),t.I0R(28,"div",0)(29,"table",4),t.SAx(30,5),t.yuY(31,kt,2,0,"th",6)(32,Et,2,1,"td",7),t.k70(),t.SAx(33,8),t.yuY(34,$t,2,0,"th",6)(35,Ot,2,1,"td",7),t.k70(),t.SAx(36,9),t.yuY(37,Yt,2,0,"th",6)(38,Pt,3,5,"td",7),t.k70(),t.yuY(39,Dt,1,0,"tr",10)(40,Gt,1,0,"tr",11),t.C$Y()(),t.wR5(41,"mat-paginator",12),t.C$Y()(),t.I0R(42,"mat-card")(43,"mat-card-content")(44,"div",0)(45,"button",13),t.qCj("click",function(){return o.cancel()}),t.OEk(46,"Close"),t.C$Y()()()()),2&i&&(t.yG2(13),t.cNF(o.Lot.lotNumber),t.yG2(5),t.cNF(o.Lot.title),t.yG2(4),t.E7m("innerHTML",o.getSafeDescription(),t.E3n),t.yG2(5),t.CAO("Low: ",o.Lot.EstimateLow," | High: ",o.Lot.EstimateHigh," "),t.yG2(2),t.E7m("dataSource",o.bids),t.yG2(10),t.E7m("matHeaderRowDef",o.displayedColumns),t.yG2(),t.E7m("matRowDefColumns",o.displayedColumns),t.yG2(),t.E7m("pageSizeOptions",t.q4q(9,Tt)))},dependencies:[d.sZ,d.cZ,g.Gw,R.oL,R.g9,R.U9,R.UV,c.SM,c.WK,c.Uc,c.uK,c.gp,s.wL,s.ie,s.aG,s.Af,s.uc,s.gx,s.qC,s.cX,s.yC,s._I,y.Qb,p.y],styles:[".example-card[_ngcontent-%COMP%]{margin-bottom:8px}"]})}return e})();var wt=r(2978);function Lt(e,n){1&e&&t.OEk(0," Lots ")}function xt(e,n){1&e&&(t.I0R(0,"th",36),t.OEk(1,"#"),t.C$Y())}function bt(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.lotNumber," ")}}function At(e,n){1&e&&(t.I0R(0,"th",38),t.OEk(1," Picture "),t.C$Y())}function Ht(e,n){if(1&e&&(t.I0R(0,"td",37),t.wR5(1,"img",39),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.E7m("src",a.picture,t.K6U)}}function Mt(e,n){1&e&&(t.I0R(0,"th",40),t.OEk(1," Title "),t.C$Y())}function Ut(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.title?a.title:"Lot "+a.lotNumber," ")}}function Bt(e,n){1&e&&(t.I0R(0,"th",41),t.OEk(1," Estimate Low "),t.C$Y())}function Nt(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.EstimateLow?a.EstimateLow:"-"," ")}}function Ft(e,n){1&e&&(t.I0R(0,"th",42),t.OEk(1," Estimate High "),t.C$Y())}function jt(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",a.EstimateHigh?a.EstimateHigh:"-"," ")}}function Kt(e,n){1&e&&(t.I0R(0,"th",43),t.OEk(1," Price "),t.C$Y())}const Qt=e=>({"bold-text":e});function Vt(e,n){if(1&e&&(t.I0R(0,"td",37)(1,"span",44),t.OEk(2),t.C$Y()()),2&e){const a=n.$implicit;t.yG2(),t.E7m("ngClass",t.S45(2,Qt,a.auctionedAmount>0)),t.yG2(),t.cNF(a.auctionedAmount>0?a.auctionedAmount:"-")}}function Jt(e,n){1&e&&(t.I0R(0,"th",45),t.OEk(1," nbrBids "),t.C$Y())}function zt(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",null==a.postProcessing?null:a.postProcessing.nbrBids," ")}}function qt(e,n){1&e&&(t.I0R(0,"th",46),t.OEk(1," Duration "),t.C$Y())}function Zt(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",null==a.postProcessing?null:a.postProcessing.duration," s ")}}function Wt(e,n){1&e&&(t.I0R(0,"th",47),t.OEk(1,"Above/Under Low"),t.C$Y())}function Xt(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",null==a.postProcessing?null:a.postProcessing.percentageAboveUnderLow," % ")}}function te(e,n){1&e&&(t.I0R(0,"th",48),t.OEk(1,"Above/Under High"),t.C$Y())}function ee(e,n){if(1&e&&(t.I0R(0,"td",37),t.OEk(1),t.C$Y()),2&e){const a=n.$implicit;t.yG2(),t.oRS(" ",null==a.postProcessing?null:a.postProcessing.percentageAboveUnderHigh," % ")}}function ae(e,n){1&e&&t.wR5(0,"tr",49)}function oe(e,n){if(1&e){const a=t.KQA();t.I0R(0,"tr",50),t.qCj("click",function(){const l=t.usT(a).$implicit,m=t.GaO();return t.CGJ(m.openDetailLot(l._id))}),t.C$Y()}}const ne=()=>[10,50,100],le=[{path:"",component:T.Y,children:[{path:"",component:It},{path:"detail/:id",component:(()=>{class e{constructor(a,i,o,l,m,ce){this.route=a,this.notificationService=i,this.router=o,this.dialog=l,this.apiSaleService=m,this.apiLotService=ce,this.id="",this.searchText="",this.originalLots=[],this.lotList=new s._c,this.displayedColumns=["lotNum","picture","title","estimateLow","estimateHigh","price","nbrBids","duration","percentageAboveUnderLow","percentageAboveUnderHigh"],this.Sale={_id:{$oid:""},idPlatform:"",platform:"",url:"",title:"",date:"",location:"",saleHouseName:"",status:"",postProcessing:{nbrLots:0,duration:0,bidsDuration:0,durationPerLots:"",totalAmount:0,averageAmount:"",medianAmount:"",minAmount:"",maxAmount:"",unsoldLots:0,unsoldPercentage:""}}}ngOnInit(){this.route.paramMap.subscribe(a=>{this.id=a.get("id"),this.getSale(),this.getLotList()})}ngAfterViewInit(){}getSale(){this.apiSaleService.getSale(this.id).subscribe(a=>{this.Sale=a})}refresh(){this.getLotList()}getLotList(){this.apiLotService.getLotsBySale(this.id).subscribe(a=>{a=a.map(o=>({...o,bidsLength:o.postProcessing?o.postProcessing.nbrBids:0}));let i="";a=(a=(a=(a=(a=a.map(o=>{switch(o.platform){case"drouot":return i="https://cdn.drouot.com/d/image/lot?size=phare&path="+o.RawData?.photos?.[0]?.path,{...o,picture:i??""};case"interencheres":return i=o.RawData?.medias?.[0]?.lg??"",{...o,picture:i};default:return{...o,picture:""}}})).map(o=>({...o,duration:o.postProcessing?o.postProcessing.duration:0}))).map(o=>({...o,percentageAboveUnderLow:o.postProcessing?o.postProcessing.percentageAboveUnderLow:0}))).map(o=>({...o,percentageAboveUnderHigh:o.postProcessing?o.postProcessing.percentageAboveUnderHigh:0}))).map(o=>({...o,auctionedAmount:o.auctioned?.amount?o.auctioned?.amount:0})),console.log(a),this.originalLots=a,this.lotList=new s._c(a),this.lotList.paginator=this.paginator??null,this.lotList.sort=this.sort??null})}getTimePerLot(a){const i=Math.floor(a%3600/60);let l="";return i>0&&(l+=i+"m "),l+=a%60+"s",l}parseToNumber(a){return parseFloat(a||"0")}convertSecondsToHHMM(a){const i=Math.floor(a/3600),o=Math.floor(a%3600/60);return`${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`}filterLots(){const a=this.originalLots.filter(i=>i.title?.toLowerCase().includes(this.searchText.toLowerCase())||i.description?.toLowerCase().includes(this.searchText.toLowerCase()));this.lotList.data=a}openDetailLot(a){this.dialog.open(vt,{width:"80%",data:{id:a}})}downloadExcelStatsFile(a){this.apiSaleService.getSaleStatXsl(a).subscribe(i=>{const o=window.URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download="SaleStats.xlsx",l.click()})}static#t=this.\u0275fac=function(i){return new(i||e)(t.GI1(C.gV),t.GI1(Y.g),t.GI1(C.E5),t.GI1(f.qW),t.GI1(I.o),t.GI1(G.g))};static#e=this.\u0275cmp=t.In1({type:e,selectors:[["app-favorites-page"]],viewQuery:function(i,o){if(1&i&&(t.CC$(y.Qb,5),t.CC$(E.E9,5)),2&i){let l;t.wto(l=t.Gqi())&&(o.paginator=l.first),t.wto(l=t.Gqi())&&(o.sort=l.first)}},decls:113,vars:52,consts:[["fxLayout","row","fxLayoutAlign","center none",1,"container"],["fxFlex","95%"],["fxLayout","row","fxLayoutGap","5px"],["fxLayout","row","fxLayoutGap","40px"],["fxLayout","column","fxLayoutGap","2px"],["fxLayout","row","fxLayoutGap","2px"],["mat-raised-button","","color","primary",3,"click"],[2,"margin-top","10px"],["mat-tab-label",""],["matInput","","placeholder","Search...","maxlength","255","st","",3,"ngModel","ngModelChange","input"],["mat-table","","matSort","",1,"mat-elevation-z8",3,"dataSource"],["matColumnDef","lotNum"],["mat-header-cell","","mat-sort-header","lotNumber",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","picture"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","title"],["mat-header-cell","","mat-sort-header","title",4,"matHeaderCellDef"],["matColumnDef","estimateLow"],["mat-header-cell","","mat-sort-header","EstimateLow",4,"matHeaderCellDef"],["matColumnDef","estimateHigh"],["mat-header-cell","","mat-sort-header","EstimateHigh",4,"matHeaderCellDef"],["matColumnDef","price"],["mat-header-cell","","mat-sort-header","auctionedAmount",4,"matHeaderCellDef"],["matColumnDef","nbrBids"],["mat-header-cell","","mat-sort-header","bidsLength",4,"matHeaderCellDef"],["matColumnDef","duration"],["mat-header-cell","","mat-sort-header","duration",4,"matHeaderCellDef"],["matColumnDef","percentageAboveUnderLow"],["mat-header-cell","","mat-sort-header","percentageAboveUnderLow",4,"matHeaderCellDef"],["matColumnDef","percentageAboveUnderHigh"],["mat-header-cell","","mat-sort-header","percentageAboveUnderHigh",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"click",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["label","Graphs"],["mat-header-cell","","mat-sort-header","lotNumber"],["mat-cell",""],["mat-header-cell",""],["alt","Picture",2,"height","60px",3,"src"],["mat-header-cell","","mat-sort-header","title"],["mat-header-cell","","mat-sort-header","EstimateLow"],["mat-header-cell","","mat-sort-header","EstimateHigh"],["mat-header-cell","","mat-sort-header","auctionedAmount"],[3,"ngClass"],["mat-header-cell","","mat-sort-header","bidsLength"],["mat-header-cell","","mat-sort-header","duration"],["mat-header-cell","","mat-sort-header","percentageAboveUnderLow"],["mat-header-cell","","mat-sort-header","percentageAboveUnderHigh"],["mat-header-row",""],["mat-row","",3,"click"]],template:function(i,o){if(1&i&&(t.I0R(0,"div",0)(1,"div",1)(2,"mat-card")(3,"mat-card-header")(4,"mat-card-title"),t.OEk(5,"Sale Detail"),t.C$Y()(),t.I0R(6,"mat-card-content")(7,"div",2)(8,"h2"),t.OEk(9),t.C$Y()(),t.I0R(10,"div",3)(11,"div",4)(12,"p")(13,"mat-icon"),t.OEk(14,"event"),t.C$Y(),t.OEk(15),t.wVc(16,"date"),t.wVc(17,"date"),t.C$Y(),t.I0R(18,"p")(19,"mat-icon"),t.OEk(20,"account_balance"),t.C$Y(),t.OEk(21),t.C$Y(),t.I0R(22,"p")(23,"mat-icon"),t.OEk(24,"location_on"),t.C$Y(),t.OEk(25),t.C$Y()(),t.I0R(26,"div",4)(27,"p")(28,"mat-icon"),t.OEk(29,"tag"),t.C$Y(),t.OEk(30),t.C$Y(),t.I0R(31,"p")(32,"mat-icon"),t.OEk(33,"hourglass_bottom"),t.C$Y(),t.OEk(34),t.C$Y(),t.I0R(35,"p")(36,"mat-icon"),t.OEk(37,"hourglass_bottom"),t.C$Y(),t.OEk(38),t.C$Y()(),t.I0R(39,"div",4)(40,"p"),t.OEk(41),t.wVc(42,"currency"),t.C$Y(),t.I0R(43,"p"),t.OEk(44),t.wVc(45,"currency"),t.C$Y(),t.I0R(46,"p"),t.OEk(47),t.wVc(48,"currency"),t.C$Y()(),t.I0R(49,"div",4)(50,"p"),t.OEk(51),t.wVc(52,"currency"),t.C$Y(),t.I0R(53,"p"),t.OEk(54),t.wVc(55,"currency"),t.C$Y(),t.I0R(56,"p"),t.OEk(57),t.C$Y()()(),t.I0R(58,"div",5)(59,"button",6),t.qCj("click",function(){return o.refresh()}),t.OEk(60,"Refresh"),t.C$Y(),t.I0R(61,"button",6),t.qCj("click",function(){return o.downloadExcelStatsFile(o.id)}),t.OEk(62,"Excel"),t.C$Y()()()(),t.I0R(63,"mat-card",7)(64,"mat-card-header")(65,"mat-card-title"),t.OEk(66,"Lots"),t.C$Y()(),t.I0R(67,"mat-card-content")(68,"mat-tab-group")(69,"mat-tab"),t.yuY(70,Lt,1,0,"ng-template",8),t.I0R(71,"div",2)(72,"mat-form-field")(73,"mat-label"),t.OEk(74,"Search"),t.C$Y(),t.I0R(75,"input",9),t.iHE("ngModelChange",function(m){return t.kNx(o.searchText,m)||(o.searchText=m),m}),t.qCj("input",function(){return o.filterLots()}),t.C$Y()()(),t.I0R(76,"div",2)(77,"table",10),t.SAx(78,11),t.yuY(79,xt,2,0,"th",12)(80,bt,2,1,"td",13),t.k70(),t.SAx(81,14),t.yuY(82,At,2,0,"th",15)(83,Ht,2,1,"td",13),t.k70(),t.SAx(84,16),t.yuY(85,Mt,2,0,"th",17)(86,Ut,2,1,"td",13),t.k70(),t.SAx(87,18),t.yuY(88,Bt,2,0,"th",19)(89,Nt,2,1,"td",13),t.k70(),t.SAx(90,20),t.yuY(91,Ft,2,0,"th",21)(92,jt,2,1,"td",13),t.k70(),t.SAx(93,22),t.yuY(94,Kt,2,0,"th",23)(95,Vt,3,4,"td",13),t.k70(),t.SAx(96,24),t.yuY(97,Jt,2,0,"th",25)(98,zt,2,1,"td",13),t.k70(),t.SAx(99,26),t.yuY(100,qt,2,0,"th",27)(101,Zt,2,1,"td",13),t.k70(),t.SAx(102,28),t.yuY(103,Wt,2,0,"th",29)(104,Xt,2,1,"td",13),t.k70(),t.SAx(105,30),t.yuY(106,te,2,0,"th",31)(107,ee,2,1,"td",13),t.k70(),t.yuY(108,ae,1,0,"tr",32)(109,oe,1,0,"tr",33),t.C$Y()(),t.wR5(110,"mat-paginator",34),t.C$Y(),t.I0R(111,"mat-tab",35),t.wR5(112,"div",2),t.C$Y()()()()()()),2&i){let l,m;t.yG2(9),t.cNF(o.Sale.title),t.yG2(6),t.CAO(" ",t.g7$(16,20,o.Sale.date,"dd/MM/yyyy")," - ",t.g7$(17,23,o.Sale.date,"HH:mm")," | "),t.yG2(6),t.oRS(" ",o.Sale.saleHouseName,""),t.yG2(4),t.oRS(" ",o.Sale.location,""),t.yG2(5),t.oRS("",null==o.Sale.postProcessing?null:o.Sale.postProcessing.nbrLots," Lots"),t.yG2(4),t.cNF(o.convertSecondsToHHMM(null!==(l=null==o.Sale.postProcessing?null:o.Sale.postProcessing.bidsDuration)&&void 0!==l?l:0)),t.yG2(4),t.oRS("/Lot ",o.getTimePerLot(o.parseToNumber(null!==(m=null==o.Sale.postProcessing?null:o.Sale.postProcessing.durationPerLots)&&void 0!==m?m:"0")),""),t.yG2(3),t.oRS("Total amount: ",t.wB1(42,26,null==o.Sale.postProcessing?null:o.Sale.postProcessing.totalAmount,"EUR","symbol","1.2-2"),""),t.yG2(3),t.oRS("Max amount: ",t.wB1(45,31,null==o.Sale.postProcessing?null:o.Sale.postProcessing.maxAmount,"EUR","symbol","1.2-2"),""),t.yG2(3),t.oRS("Min amount: ",t.wB1(48,36,null==o.Sale.postProcessing?null:o.Sale.postProcessing.minAmount,"EUR","symbol","1.2-2"),""),t.yG2(4),t.oRS("Average amount: ",t.wB1(52,41,null==o.Sale.postProcessing?null:o.Sale.postProcessing.averageAmount,"EUR","symbol","1.2-2"),""),t.yG2(3),t.oRS("Median amount: ",t.wB1(55,46,null==o.Sale.postProcessing?null:o.Sale.postProcessing.medianAmount,"EUR","symbol","1.2-2"),""),t.yG2(3),t.CAO("Unsold: ",null==o.Sale.postProcessing?null:o.Sale.postProcessing.unsoldLots," (",null==o.Sale.postProcessing?null:o.Sale.postProcessing.unsoldPercentage,"%)"),t.yG2(18),t.OKB("ngModel",o.searchText),t.yG2(2),t.E7m("dataSource",o.lotList),t.yG2(31),t.E7m("matHeaderRowDef",o.displayedColumns),t.yG2(),t.E7m("matRowDefColumns",o.displayedColumns),t.yG2(),t.E7m("pageSizeOptions",t.q4q(51,ne))}},dependencies:[p.QF,u.ot,u.ue,u.Mj,u._G,d.sZ,d.cZ,d.qG,d.CA,wt.K_,k.qL,g.Gw,c.SM,c.WK,c.Uc,c.gp,D.yi,S.Up,S.w5,s.wL,s.ie,s.aG,s.Af,s.uc,s.gx,s.qC,s.cX,s.yC,s._I,h.i0,h.aJ,h._q,y.Qb,E.E9,E.e6,p.cf,p.y],styles:[".mat-mdc-row[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row[_ngcontent-%COMP%]:hover .mat-mdc-cell[_ngcontent-%COMP%]{border-color:currentColor}"]})}return e})()}]}];let se=(()=>{class e{static#t=this.\u0275fac=function(i){return new(i||e)};static#e=this.\u0275mod=t.a4G({type:e});static#a=this.\u0275inj=t.s3X({imports:[C.qQ.forChild(le),C.qQ]})}return e})();var re=r(9588);let me=(()=>{class e{static#t=this.\u0275fac=function(i){return new(i||e)};static#e=this.\u0275mod=t.a4G({type:e});static#a=this.\u0275inj=t.s3X({imports:[p.MD,re.k,se]})}return e})()}}]); |