1import{a as mi}from"./chunk-U37ZII7T.js";import{b as di,d as pi}from"./chunk-LLCDT2AR.js";import{$a as K,$b as tt,$c as Ft,Ae as me,B as ge,Cf as ai,D as fe,Da as Ie,Db as Mt,Df as si,Ea as we,Eb as z,Ee as Zt,Ef as li,Fd as jt,Ff as ci,G as St,Ga as I,Gb as Tt,Gd as We,Ha as P,Hd as Yt,He as ei,Hg as Ii,Ia as p,Id as Ut,Ie as ti,If as ui,Ig as wi,Jd as Kt,K as S,Kf as gi,L as E,Lc as De,Le as X,Ma as Re,Mc as he,Me as Ye,Na as Me,Nc as re,Oa as Te,Oc as ae,Od as Ht,Oe as J,Of as fi,Pc as Dt,Qa as Pt,Rc as ee,Re as ii,Rg as Ri,Sc as Le,Se as ni,Tc as Ne,Ua as g,Uc as Lt,Va as w,Vc as Nt,Vf as hi,Wa as L,Wb as oe,Wc as se,Wf as _i,Xa as et,Xc as Fe,Xg as B,Yb as bt,Yc as Ve,Zb as F,Zc as le,_a as U,_c as ce,ab as H,ad as Vt,af as oi,ba as l,bb as It,bh as Hi,ca as Ze,cb as be,ch as He,dd as kt,dg as Ue,e as Je,eb as Ae,ed as it,eg as vi,fb as N,fd as Wt,fg as ot,g as Pe,gd as $,gh as Mi,ha as u,hd as q,he as Be,hf as k,hg as Ci,hh as Ti,i as Ct,ib as D,ie as Q,if as te,ja as A,jb as ne,k as yt,ka as Et,ke as nt,kg as rt,lb as wt,lf as ri,mg as yi,nb as W,nc as At,nd as Bt,ne as zt,ng as xi,oc as Oe,oe as $t,of as Ki,og as Si,p as ue,pc as Ot,pe as qt,pg as Ei,r as xt,ra as h,re as Ge,rg as Ke,rh as bi,sa as _,se as Qt,ta as M,td as ke,te as Xt,ua as T,ue as Jt,ug as Pi,va as b,wa as f,we as V,xa as s,xe as G,ya as a,yd as Gt,ye as je,za as m,zb as Rt,ze as de}from"./chunk-NHVDVYS6.js";import{g as vt}from"./chunk-27WATYC3.js";var _e=class{constructor(){this.VenueBuildingBlockId=null,this.TicketTypeId=null,this.PassePartoutIds=null,this.EventIds=null}};function $i(t,r){if(t&1){let e=I();s(0,"div")(1,"app-button",4),P("click",function(){let i=S(e).$implicit,o=p();return E(o.dialogRef.close(i.PassePartoutId))}),a()()}if(t&2){let e=r.$implicit;l(),f("text",e.PassePartoutName)}}var Ai=(()=>{let r=class r{constructor(n,i){this.passedData=n,this.dialogRef=i}ngOnInit(){this.purchaseRights=this.passedData.primaryPurchaseRights}};r.\u0275fac=function(i){return new(i||r)(u(Xt),u(Qt))},r.\u0275cmp=A({type:r,selectors:[["app-select-primary-purchaseright-dialog"]],inputs:{purchaseRights:"purchaseRights"},standalone:!1,decls:7,vars:0,consts:[[1,"form-content"],["translationKey","VIEWS.RENEWALS.DIALOGS.SELECT-PRIMARY-PURCHASERIGHT-DIALOG.TITLE"],[1,"form-group","pad-top"],["translationKey","VIEWS.RENEWALS.DIALOGS.SELECT-PRIMARY-PURCHASERIGHT-DIALOG.MESSAGE"],["type","primary",1,"full-width-button2",3,"click","text"]],template:function(i,o){i&1&&(s(0,"div",0)(1,"h3"),m(2,"app-format-translation",1),a(),s(3,"div",2),m(4,"app-format-translation",3),a(),T(5,$i,2,1,"div",null,M),a()),i&2&&(l(5),b(o.purchaseRights))},dependencies:[G,V],encapsulation:2});let t=r;return t})();var ie=vt(Hi());var en=["extraTickets"],tn=t=>({"grid-template-columns":t}),mt=t=>[t,"EUR","symbol","1.2-2","nl"],nn=t=>({parentContactFullName:t});function on(t,r){t&1&&(s(0,"div",5),m(1,"app-format-translation",9),a())}function rn(t,r){t&1&&m(0,"div")}function an(t,r){t&1&&(s(0,"div",12),m(1,"app-format-translation",13),a())}function sn(t,r){t&1&&(s(0,"div",12),m(1,"app-format-translation",14),a())}function ln(t,r){if(t&1&&(s(0,"div",20)(1,"span",28)(2,"span"),m(3,"app-format-translation",29),g(4,":"),a(),s(5,"span",27),g(6),a()()()),t&2){let e=p().$implicit;l(6),w(e.RowNumber)}}function cn(t,r){if(t&1&&(s(0,"div",20)(1,"span",30)(2,"span"),m(3,"app-format-translation",31),g(4,":"),a(),s(5,"span",27),g(6),a()()()),t&2){let e=p().$implicit;l(6),w(e.SeatNumber)}}function dn(t,r){if(t&1&&(s(0,"div",21)(1,"span",32),g(2),a()()),t&2){let e=p().$implicit;l(2),w(e.PassePartoutName)}}function mn(t,r){if(t&1&&(s(0,"option",34),g(1),a()),t&2){let e=r.$implicit,n=p(2).$implicit;f("value",e.PassePartoutId)("selected",e.PassePartoutId==n.PassePartoutId),l(),L(" ",e.PassePartoutName," ")}}function pn(t,r){if(t&1){let e=I();s(0,"select",33),P("change",function(i){S(e);let o=p().$implicit,c=p(5);return E(c.onProlongationOptionChange(i.target.value,o))}),T(1,mn,2,3,"option",34,M),a()}if(t&2){let e=p().$implicit,n=p(5);f("value",e.PassePartoutId),l(),b(n.reservationPurchaseRights[e.ReservationLineId])}}function un(t,r){if(t&1){let e=I();s(0,"div",17)(1,"div",18)(2,"mat-slide-toggle",19),P("change",function(i){let o=S(e).$implicit,c=p(5
1);return E(c.itemSelectChange(i,o))}),a()(),h(3,ln,7,1,"div",20),h(4,cn,7,1,"div",20)(5,dn,3,1,"div",21),s(6,"span",22),g(7),a(),s(8,"div",23),h(9,pn,3,1,"select",24),a(),s(10,"div",25)(11,"span"),m(12,"app-format-translation",26),g(13,":"),a(),s(14,"span",27),g(15),D(16,"currency"),a()()()}if(t&2){let e=r.$implicit,n=p(5);l(2),f("disableRipple",!0)("checked",e.Selected),l(),_(e.RowNumber!==null?3:-1),l(),_(e.SeatNumber!==null?4:5),l(3),w(e.CustomerName),l(2),_(n.reservationPurchaseRights[e.ReservationLineId]!=null&&n.reservationPurchaseRights[e.ReservationLineId].length>1?9:-1),l(6),w(W(16,7,N(13,mt,e.PriceExVat+e.VAT)))}}function gn(t,r){if(t&1&&(s(0,"div")(1,"div",12)(2,"span"),m(3,"app-format-translation",15),g(4),a()(),s(5,"div",16),T(6,un,17,15,"div",17,M),a()()),t&2){let e=r.$implicit,n=p(4);l(4),L(": ",e.section),l(),f("ngStyle",N(2,tn,n.getGridTemplateColumns(e.reservations[0]))),l(),b(e.reservations)}}function fn(t,r){if(t&1&&(s(0,"div",10),h(1,an,2,0,"div",12)(2,sn,2,0,"div",12),T(3,gn,8,4,"div",null,M),a()),t&2){let e=r.$implicit;l(),_(e.OwnedByLoggedInUser===!0&&e.rowData.length>0?1:e.OwnedByLoggedInUser===!1&&e.rowData.length>0?2:-1),l(2),b(e.rowData)}}function hn(t,r){t&1&&(s(0,"div",12),m(1,"app-format-translation",13),a())}function _n(t,r){t&1&&(s(0,"div",12),m(1,"app-format-translation",14),a())}function vn(t,r){if(t&1&&(s(0,"option",34),g(1),a()),t&2){let e=r.$implicit,n=p(3).$implicit;f("value",e.PassePartoutId)("selected",e.PassePartoutId==n.PassePartoutId),l(),L(" ",e.PassePartoutName," ")}}function Cn(t,r){if(t&1){let e=I();s(0,"select",33),P("change",function(i){S(e);let o=p(2).$implicit,c=p(5);return E(c.onProlongationOptionChange(i.target.value,o))}),T(1,vn,2,3,"option",34,M),a()}if(t&2){let e=p(2).$implicit,n=p(5);f("value",e.PassePartoutId),l(),b(n.reservationPurchaseRights[e.ReservationLineId])}}function yn(t,r){if(t&1&&(s(0,"div",41)(1,"span",32),g(2),a()()),t&2){let e=p(2).$implicit;l(2),w(e.PassePartoutName)}}function xn(t,r){if(t&1&&(s(0,"div",36)(1,"div",38)(2,"div",20)(3,"span",28)(4,"span"),m(5,"app-format-translation",29),g(6,":"),a(),s(7,"span",27),g(8),a()()(),s(9,"div",20)(10,"span",30)(11,"span"),m(12,"app-format-translation",31),g(13,":"),a(),s(14,"span",27),g(15),a()()()(),s(16,"div",39),h(17,Cn,3,1,"select",24),a(),s(18,"div",40)(19,"span"),m(20,"app-format-translation",26),g(21,":"),a(),s(22,"span",27),g(23),D(24,"currency"),a()(),h(25,yn,3,1,"div",41),s(26,"span",42),g(27),a()()),t&2){let e=p().$implicit,n=p(5);l(8),w(e.RowNumber),l(7),w(e.SeatNumber),l(2),_(n.reservationPurchaseRights[e.ReservationLineId]!=null&&n.reservationPurchaseRights[e.ReservationLineId].length>1?17:-1),l(6),w(W(24,6,N(12,mt,e.PriceExVat+e.VAT))),l(2),_(e.SeatNumber===null?25:-1),l(2),w(e.CustomerName)}}function Sn(t,r){if(t&1&&(s(0,"option",34),g(1),a()),t&2){let e=r.$implicit,n=p(3).$implicit;f("value",e.PassePartoutId)("selected",e.PassePartoutId==n.PassePartoutId),l(),L(" ",e.PassePartoutName," ")}}function En(t,r){if(t&1){let e=I();s(0,"select",33),P("change",function(i){S(e);let o=p(2).$implicit,c=p(5);return E(c.onProlongationOptionChange(i.target.value,o))}),T(1,Sn,2,3,"option",34,M),a()}if(t&2){let e=p(2).$implicit,n=p(5);f("value",e.PassePartoutId),l(),b(n.reservationPurchaseRights[e.ReservationLineId])}}function Pn(t,r){if(t&1&&(s(0,"div",37)(1,"div",43)(2,"span",32),g(3),a(),s(4,"div",25)(5,"span",44),g(6),a(),s(7,"div",23),h(8,En,3,1,"select",24),a(),s(9,"span",45),m(10,"app-format-translation",26),g(11),D(12,"currency"),a()()()()),t&2){let e=p().$implicit,n=p(5);l(3),w(e.PassePartoutName),l(3),w(e.CustomerName),l(2),_(n.reservationPurchaseRights[e.ReservationLineId]!=null&&n.reservationPurchaseRights[e.ReservationLineId].length>1?8:-1),l(3),L(": ",W(12,4,N(10,mt,e.PriceExVat+e.VAT)))}}function In(t,r){if(t&1){let e=I();s(0,"div",35)(1,"div",18)(2,"mat-slide-toggle",19),P("change",function(i){let o=S(e).$implicit,c=p(5);return E(c.itemSelectChange(i,o))}),a()(),h(3,xn,28,14,"div",36),h(4,Pn,13,12,"div",37),a()}if(t&2){let e=r.$implicit;l(2),f("disableRipple",!0)("checked",e.Selected),l(),_(e.RowNumber!==null&&e.SeatNumber!==null?3:-1),l(),_(e.RowNumber==null&&e.SeatNumber==null?4:-1)}}function wn(t,r){if(t&1&&(s(0,"div")(1,"div",12)(2,"span"),m(3,"app-format-translation",15),g(4),a()(),T(5,In,5,4,"div",35,M),a()),t&2){let e=r.$implicit;l(4),L(": ",e.section),l(),b(e.reservations)}}function Rn(t,r){if(t&1&&(s(0,"div",11),h(1,hn,2,0,"div",12)(2,_n,2,0,"div",12),T(3,wn,7,1,"div",null,M),a()),t&2){let e=r.$implicit;l(),_(e.OwnedByLoggedInUser===!0&&e.rowData.length>0?1:e.OwnedByLoggedInUser===!1&&e.rowData.length>0?2:-1),l(2),b(e.rowData)}}function Mn(t,r){if(t&1&&(T(0,fn,5,1,"div",10,M),T(2,Rn,5,1,"div",11,M)),t&2){let e=p(2);b(e.reservationGroups),l(2),b(e.reservationGroups)}}function Tn(t,r){if(t&1){let e=I();s(0,"div",57),P("click",function(){S(e);let i=p(3);return E(i.displayPendingReservationDialog())}),m(1,"i",58)(2,"app-format-translation",59),a()}}function bn(t,r){if(t&1&&(s(0,"div",6)(1,"div",46)(2,"div",47)(3,"div",48),m(4,"img",49),s(5,"span",50),g(6,"= "),m(7,"app-format-translation",51),a()(),s(8,"div",52),m(9,"img",53),s(10,"span",54),g(11,"= "),m(12,"app-format-translation",55),a()(),h(13,Tn,3,0,"div",56),a()()()),t&2){let e=p(2);l(13),_(e.showDisplayPendingReservationDialogElement?13:-1)}}function An(t,r){if(t&1&&(s(0,"div",7),m(1,"app-format-translation",60),a()),t&2){let e=p(2);l(),f("params",N(1,nn,e.parentCustomer.ParentContactFullName))}}function On(t,r){t&1&&(s(0,"div",63),m(1,"app-format-translation",71),a())}function Dn(t,r){t&1&&(s(0,"div",64),m(1,"app-format-translation",72),a())}function Ln(t,r){if(t&1){let e=I();s(0,"div",61),h(1,On,2,0,"div",63)(2,Dn,2,0,"div",64),s(3,"div",65)(4,"button",66),P("click",function(){S(e);let i=p(3);return E(i.updateUnplaced("down"))}),m(5,"i",67),a(),s(6,"input",68,0),P("change",function(i){S(e);let o=p(3);return E(o.checkAmount(i.target.value))}),H("ngModelChange",function(i){S(e);let o=p(3);return K(o.extraTicketsSelected,i)||(o.extraTicketsSelected=i),E(i)}),a(),s(8,"button",69),P("click",function(){S(e);let i=p(3);return E(i.updateUnplaced("up"))}),m(9,"i",70),a()()()}if(t&2){let e=p(3);l(),_(e.hasRenewals()==!0?1:2),l(5),U("ngModel",e.extraTicketsSelected),f("max",e.primaryPurchaseRight==null?null:e.primaryPurchaseRight.AmountSelectable)}}function Nn(t,r){if(t&1){let e=I();s(0,"app-button",76),P("click",function(){S(e);let i=p(4);return E(i.submitSelection())}),a()}if(t&2){let e=p(4);f("showLoader",e.savingAction==="select")("disabled",e.selectSeatsDisabled())("text","VIEWS.RENEWALS.MY.SELECT-SEATS")}}function Fn(t,r){if(t&1){let e=I();s(0,"app-button",77),P("click",function(){S(e);let i=p(4);return E(i.submitFinalize())}),a()}if(t&2){let e=p(4);f("showLoader",e.savingAction==="finalize")("disabled",e.submitDisabled())("text","VIEWS.RENEWALS.MY.FINALIZE-RESERVATION")}}function Vn(t,r){if(t&1&&(s(0,"div",62)(1,"div",73),h(2,Nn,1,3,"app-button",74),h(3,Fn,1,3,"app-button",75),a()()),t&2){let e=p(3);l(2),_(e.showSelectSeatsButton()?2:-1),l(),_(e.hasRenewals()?3:-1)}}function kn(t,r){if(t&1&&(s(0,"div",8),h(1,Ln,10,3,"div",61),h(2,Vn,4,2,"div",62),a()),t&2){let e=p(2);l(),_(e.showAmountSelector()&&((e.primaryPurchaseRight==null?null:e.primaryPurchaseRight.AmountSelectable)??0)>0?1:-1),l(),_(e.hasRenewals()||e.extraTicketNumbers.length>0?2:-1)}}function Wn(t,r){if(t&1&&(s(0,"div",4),Ie(1),h(2,on,2,0,"div",5),h(3,rn,1,0,"div")(4,Mn,4,0),h(5,bn,14,1,"div",6)(6,An,2,3,"div",7),h(7,kn,3,2,"div",8),we(),a()),t&2){let e=p();
1l(2),_(e.reservationLinesHaveBeenRemoved?2:-1),l(),_(!e.reservationGroups||!(e.reservationGroups.length>0)?3:4),l(2),_(e.hasRenewals()?5:e.currentUserIsManagedBy?6:-1),l(2),_(e.reservationGroups!==null&&e.reservationGroups.length>0||e.extraTicketNumbers.length>0?7:-1)}}var $e=class{},qe=class{},xe=(()=>{let r=class r{constructor(n,i,o,c,d,v,y,R,C,x,O,Z,Y,pe,Qe,Xe,Ee,ji,Yi,Ui){this.route=n,this.router=i,this.prolongationService=o,this.customerService=c,this.dialog=d,this.pendingOrderService=v,this.contextService=y,this.logger=R,this.toaster=C,this.orderState=x,this.pendingReservationService=O,this.renewalService=Z,this.orderStateService=Y,this.appLoader=pe,this.layoutService=Qe,this.confirmService=Xe,this.shoppingCartService=Ee,this.saleFlowHelper=ji,this.initiativeService=Yi,this.authService=Ui,this.reservationGroups=null,this.message=null,this.showDisplayPendingReservationDialogElement=!1,this.prolongationData=null,this.loading=!1,this.currentUserIsManagedBy=!1,this.parentCustomer=null,this.savingAction=null,this.extraTicketNumbers=[],this.extraTicketsSelected=0,this.primaryPurchaseRight=null,this.pageReadyForRendering=!1,this.reservationLinesHaveBeenRemoved=!1,this.purchaseRightList=[],this.reservationPurchaseRights=[],this.layoutService.updateLayout(new $("VIEWS.RENEWALS.MY.TITLE",!0,"VIEWS.RENEWALS.MY.HELPTITLE","VIEWS.RENEWALS.MY.HELPTEXT")),this.route.params.subscribe(_t=>{_t.message&&(this.message=_t.message)})}ngOnInit(){this.authService.isLoggedIn().subscribe(n=>{if(!n){this.router.navigate(["/account/login"]);return}let i=this.appLoader.open("MyRenewals@OnInit");if(this.saleFlowHelper.readSteps().salesPeriodId===null){this.router.navigate(["/"]);return}this.orderState.redirectOnPendingOrderOrDoAction(()=>{this.loadPageData(i),this.pageReadyForRendering=!0},()=>{this.appLoader.close(i),this.confirmService.confirm({message:"ERROR.PENDING-ORDER.COMBINED-ORDER",okonly:!0})})})}displaySelectPrimaryPurchaseRightDialog(n){this.dialog.open(Ai,{disableClose:!0,maxWidth:"370px",data:{title:"DIALOG.ADDFAMILY.TITLE",primaryPurchaseRights:n}}).afterClosed().subscribe(c=>{let d=this.renewalService.GetPrimaryPurchaseRightId();!d||d!==c?(this.logger.log("id will be: ",c),this.renewalService.SetPrimaryPurchaseRightId(c),this.clearPendingReservationSelections(),this.prolongationData&&this.removeRemainingPrimaryReservations(this.prolongationData)):(this.logger.log("id is already the selected id"),this.loadPrimaryPurchaseRight(),this.prolongationData&&this.removeRemainingPrimaryReservations(this.prolongationData)),this.processNewProlongationData(),this.reselectEarlierSelection(),this.logger.log("new prolongationdata: ",this.prolongationData)})}getRepresentativePurchaseRightsByPassePartout(n){let i=new Map;for(let c of n){if(c.PassePartoutId==null)continue;let d=i.get(c.PassePartoutId);d?d.push(c):i.set(c.PassePartoutId,[c])}let o=[];return i.forEach(c=>{o.push(c.find(d=>d.IsPrimary)??c.find(d=>d.IsAlternative)??c[0])}),o}removeUnusableReservations(n){let i=[];if(n.PurchaseRights!=null){let d=this.getRepresentativePurchaseRightsByPassePartout(n.PurchaseRights);this.purchaseRightList=d.filter(v=>v.PassePartoutId!=null&&(v.IsPrimary||v.IsAlternative));for(let v of d){let y=ie.asEnumerable(n.Reservations??[]).Where(R=>R.PassePartoutId===v.PassePartoutId).ToArray();if((v.AmountSelectable??0)<0){let R=Math.abs(v.AmountSelectable??0);if(R<=y.length){y.splice(y.length-R,R);for(let C of y)i.push(C)}}else for(let R of y)i.push(R)}}let c=(n.Reservations!=null?n.Reservations.length:0)!==i.length;n.Reservations!==void 0&&(n.Reservations=i),this.showPurchaseRightForprolongation(i),this.reservationLinesHaveBeenRemoved=c}showPurchaseRightForprolongation(n){n.forEach(i=>{i.ReservationLineId!=null&&(this.reservationPurchaseRights[i.ReservationLineId]=this.purchaseRightList.filter(o=>(i.PassePartoutProlongationOptions||[]).includes(o.PassePartoutId)||o.PassePartoutId===i.PassePartoutId))})}removeRemainingPrimaryReservations(n){if(!this.primaryPurchaseRight)return;let i=[],o=this.getRepresentativePurchaseRightsByPassePartout(n.PurchaseRights||[]);for(let c of o){let d=ie.asEnumerable(n.Reservations??[]).Where(v=>v.PassePartoutId===c.PassePartoutId).ToArray();if(c.IsPrimary){if(c.PassePartoutId===this.primaryPurchaseRight.PassePartoutId)for(let v of d)i.push(v)}else for(let v of d)i.push(v)}this.prolongationData&&(this.prolongationData.Reservations=i)}tryLoadPrimaryPurchaseRight(){let n=this.renewalService.GetPrimaryPurchaseRights(),i=n?ie.asEnumerable(n).Where(o=>
1o.AmountRemaining>0).ToArray():[];if(i&&i.length>1){this.displaySelectPrimaryPurchaseRightDialog(i);return}i&&i.length===1?this.renewalService.SetPrimaryPurchaseRightId(i[0].PassePartoutId):this.renewalService.SetPrimaryPurchaseRightId(0),this.loadPrimaryPurchaseRight(),this.processNewProlongationData(),this.reselectEarlierSelection()}loadPrimaryPurchaseRight(){this.primaryPurchaseRight=this.renewalService.GetPrimaryPurchaseRight(),this.updatePurchaseRightDropdown()}loadPageData(n){this.extraTicketNumbers=[],this.loading=!0,this.customerService.getManagedBy().subscribe(i=>{this.handleGetManagedByResponse(i,n)})}handleGetManagedByResponse(n,i){if(n){this.parentCustomer=n,this.currentUserIsManagedBy=!0,this.loading=!1,this.appLoader.close(i);return}let o=this.shoppingCartService.getPendingOrderDetails();if(o!=null){this.pendingOrderService.getExpiration(o.Id).subscribe(c=>{this.handleGetExpirationResponse(c,o,i)});return}this.pendingOrderService.getCurrentActive().subscribe(c=>{this.handleGetCurrentActiveResponse(c,i)})}handleGetCurrentActiveResponse(n,i){if(n===null)this.loadMyRenewals();else{this.shoppingCartService.setPendingOrderDetails(n);let o=this.shoppingCartService.getPendingOrderDetails();this.shoppingCartService.startOrUpdateTimer(o?.Id),this.loadMyRenewals()}this.logger.log("active pending order from server: ",n),this.appLoader.close(i)}handleGetExpirationResponse(n,i,o){n===0?this.contextService.clearOrderContext():this.shoppingCartService.startOrUpdateTimer(i.Id),this.loadMyRenewals(),this.appLoader.close(o)}ngAfterViewInit(){if(this.message===null)return;let n=null;this.message==="reservationexpired"&&(n="MSG.RESERVATION-EXPIRED"),n!==null&&this.toaster.warn(n)}hasRenewals(){return this.reservationGroups!==null&&this.reservationGroups.length>0?this.reservationGroups.some(n=>n.rowData.length>0):!1}loadMyRenewals(){let n=this.appLoader.open("MyRenewals@loadMyRenewals"),i=this.saleFlowHelper.readSteps(),o=sessionStorage.getItem("ai"),c;o!=null?c=this.prolongationService.getBySalesPeriodAndInitiative(i.salesPeriodId,o):c=this.prolongationService.getBySalesPeriod(i.salesPeriodId),c.subscribe(d=>{this.logger.log("got prolongationdata: ",d),this.renewalService.UpdateProlongationData(d),this.removeUnusableReservations(d),this.prolongationData=d,this.tryLoadPrimaryPurchaseRight(),this.loading=!1,this.appLoader.close(n)})}reselectEarlierSelection(){let n=this.orderStateService.getPendingReservation();if(n==null||n.Lines==null){this.showDisplayPendingReservationDialogElement=!1;return}for(let i of this.prolongationData?.Reservations||[]){let o=n.Lines.filter(c=>i.ReservationLineId===c.ReservationLineId);i.Selected=o.length>0}this.showDisplayPendingReservationDialogElement=!0}processNewProlongationData(){this.prolongationData?.Reservations?.forEach(x=>{x.Selected=!0,x.TotalPrice=(x.PriceExVat??0)+(x.VAT??0)});let i=(this.prolongationData?.Reservations??[]).filter(x=>x.OwnedByLoggedInUser===!0).sort((x,O)=>{let Z=x.ReservationLineId??0,Y=O.ReservationLineId??0;return Z<Y?-1:0});this.reservationGroups=[];let o=ie.asEnumerable(i).GroupBy(x=>x.ParentSectionShortName).ToArray(),c=[];for(let x of o){let O=new qe;O.reservations=x,O.section=x.key??"Unknown",c.push(O)}let d=new $e;d.rowData=c,d.OwnedByLoggedInUser=!0,this.reservationGroups.push(d);let v=(this.prolongationData?.Reservations??[]).filter(x=>x.OwnedByLoggedInUser===!1),y=ie.asEnumerable(v).GroupBy(x=>x.ParentSectionShortName).ToArray(),R=[];for(let x of y){let O=new qe;O.reservations=x,O.section=x.key??"Unknown",R.push(O)}let C=new $e;C.rowData=R,C.OwnedByLoggedInUser=!1,this.reservationGroups.push(C),this.setDefaultValue()}displayPendingReservationDialog(){this.confirmService.confirm({title:"VIEWS.RENEWALS.DIALOGS.CANCEL-PENDING-RESERVATION-DIALOG.TITLE",message:"VIEWS.RENEWALS.DIALOGS.CANCEL-PENDING-RESERVATION-DIALOG.MESSAGE"}).subscribe(n=>{n&&this.clearPendingReservationSelections()})}clearPendingReservationSelections(){this.loadPrimaryPurchaseRight(),this.processNewProlongationData(),this.reselectEarlierSelection()}itemSelectChange(n,i){let o=n.source;i.Selected=o.checked,this.updatePurchaseRightDropdown()}updatePurchaseRightDropdown(){this.logger.log("updatePurchaseRightDropdown");let n=this.orderStateService.getPendingReservation();if(!this.primaryPurchaseRight){this.setDefaultValue();return}if(n&&n.Lines){let i=ie.asEnumerable(n.Lines).Count(o=>o.ReservationLineId===null);i>this.primaryPurchaseRight.AmountSelectable?this.extraTicketsSelected=this.primaryPurchaseRight.AmountSelectable:this.extraTicketsSelected=i}else this.extraTicketsSelected=0;this.primaryPurchaseRight.AmountSelectable!==null&&this.primaryPurchaseRight.AmountSelectable>0?this.extraTicketNumbers=Array(this.primaryPurchaseRight.AmountSelectable
1+1).fill(0).map((i,o)=>o):this.extraTicketNumbers=[],this.setDefaultValue()}updateUnplaced(n){n=="up"&&this.primaryPurchaseRight&&(this.primaryPurchaseRight.AmountSelectable??0)>this.extraTicketsSelected?this.extraTicketsSelected=this.extraTicketsSelected+1:n=="down"&&this.extraTicketsSelected>0&&(this.extraTicketsSelected=this.extraTicketsSelected-1)}checkAmount(n){this.primaryPurchaseRight&&n>(this.primaryPurchaseRight.AmountSelectable??0)&&(this.extraTicketsSelected=this.primaryPurchaseRight.AmountSelectable??0),n<0&&(this.extraTicketsSelected=0)}hasActiveToggle(){return(this.prolongationData?.Reservations??[]).some(n=>n.Selected===!0)}hasActiveSelectSeatsToggle(){return(this.prolongationData?.Reservations??[]).some(n=>n.Selected===!0&&n.PlaceSelectionAllowed===!0)}submitDisabled(){return this.savingAction!==null?!0:!this.hasActiveToggle()}showAmountSelector(){return this.prolongationData?.PurchaseRights?this.prolongationData.PurchaseRights.some(n=>(n.AmountSelectable??0)>0):!1}showSelectSeatsButton(){let n=this.extraTicketsSelected>0,i=this.prolongationData?.Reservations?.some(o=>o.PlaceSelectionAllowed===!0)??!1;return n||i}selectSeatsDisabled(){let n=this.extraTicketsSelected>0;return this.savingAction!==null||!this.hasActiveSelectSeatsToggle()&&!n}showFinalizeButton(){return!0}submitFinalize(){this.savingAction="finalize";let n=this.renewalService.GetPrimaryPurchaseRight();if(!n){this.savingAction=null,this.toaster.warn("ERROR.GENERAL");return}let i=new _e;i.PassePartoutIds=[n.PassePartoutId],this.renewalService.SetPurchaseRequestData(i);let o=this.orderStateService.getPendingReservation(),c=this.saleFlowHelper.readSteps().salesPeriodId,d=(this.prolongationData?.Reservations??[]).filter(y=>y.Selected===!0),v={PendingReservationId:o?.PendingReservationId,Lines:d,NumberOfAdditionalPurchases:0,SalesPeriodId:c};this.pendingReservationService.createOrUpdate(v).pipe(fe(y=>this.orderStateService.setPendingReservationOld(y)),ge(y=>this.finalizeReservationAndNavigate(y.PendingReservationId,c)),ue(()=>(this.savingAction=null,this.toaster.warn("ERROR.GENERAL"),Je))).subscribe()}finalizeReservationAndNavigate(n,i){let o={PendingReservationId:n,SalesPeriodId:i};return this.prolongationService.put(o).pipe(ge(()=>this.pendingOrderService.getCurrentActive()),fe(c=>{this.shoppingCartService.setPendingOrderDetails(c),this.savingAction=null,this.router.navigate(["/renewals/orderoverview"])}),ue(()=>(this.savingAction=null,this.toaster.warn("ERROR.GENERAL"),Je)))}submitSelection(){this.savingAction="select";let i=this.orderStateService.getPendingReservation()?.PendingReservationId,o=this.saleFlowHelper.readSteps().salesPeriodId,c=(this.prolongationData?.Reservations??[]).filter(function(C){if(C.Selected===!0)return C}),d=null;this.extraTickets?.nativeElement?.value!=null&&this.extraTickets.nativeElement.value!==""&&(d=this.extraTickets.nativeElement.value);let v=new _e,y=this.renewalService.GetPrimaryPurchaseRight();y||this.logger.log("ERROR: No primary purchase right found!"),v.PassePartoutIds=[y.PassePartoutId],this.renewalService.SetPurchaseRequestData(v);let R={PendingReservationId:i,Lines:c,NumberOfAdditionalPurchases:d,SalesPeriodId:o};this.pendingReservationService.createOrUpdate(R).subscribe({next:C=>{this.orderStateService.setPendingReservationOld(C),this.savingAction=null,(C.Lines??[]).length===0?this.finalizeReservationAndNavigate(C.PendingReservationId,o).subscribe():C.ValidSelection===!1?this.confirmService.confirm({okonly:!0,title:"",message:"VIEWS.PENDINGRESERVATION.SELECTION-VALIDATION-ERROR"}).subscribe():C.IsParkingOnly?this.router.navigate(["/seat-selection/parking"]):this.router.navigate(["/seat-selection/venue"])},error:()=>{this.savingAction=null,this.toaster.warn("ERROR.GENERAL")}})}setDefaultValue(){this.hasRenewals()==!0?this.extraTicketsSelected=0:(this.extraTicketsSelected==0||this.extraTicketsSelected==null)&&(this.extraTicketsSelected=1)}onProlongationOptionChange(n,i){i.PassePartoutId=+n,this.prolongationService.putLinePassePartout(i.CustomerPassePartoutId,i.PassePartoutId).subscribe(o=>{this.loadMyRenewals()})}getGridTemplateColumns(n){return n.RowNumber!==null&&n.SeatNumber!==null?"auto auto auto 1fr auto max-content":"auto auto 1fr auto max-content"}};r.\u0275fac=function(i){return new(i||r)(u(oe),u(F),u(Kt),u(ke),u(Jt),u(We),u(Q),u(Be),u(Ri),u(te),u(Ut),u(He),u(te),u(Ge),u(q),u(je),u(de),u(oi),u(Gt),u(me))}
vendor: 4,671 bytes, line 1
1,r.\u0275cmp=A({type:r,selectors:[["app-my-renewals"]],viewQuery:function(i,o){if(i&1&&Re(en,5),i&2){let c;Me(c=Te())&&(o.extraTickets=c.first)}},standalone:!1,decls:4,vars:1,consts:[["extraTickets",""],["fxLayout","column","fxLayout.lt-lg","column",2,"height","100%"],["backLink","/"],[1,"content"],[1,"my-renewals"],[1,"alert","alert-danger"],[1,"my-renewals-legend"],[1,"py-4"],[1,"my-renewals-footer","gap-3","d-flex","flex-column"],["translationKey","VIEWS.RENEWALS.MY.FILTERED-RESERVATIONS"],[1,"d-none","d-lg-flex","flex-column"],[1,"d-flex","d-lg-none","flex-column"],[1,"my-renewals-section-header"],["translationKey","VIEWS.RENEWALS.OWNED-BY-CUSTOMER"],["translationKey","VIEWS.RENEWALS.OWNED-BY-FRIEND-OR-FAMILY"],["translationKey","VIEWS.RENEWALS.MY.SECTION"],[1,"my-renewals-grid-container",3,"ngStyle"],[1,"my-renewals-item","pl-2","my-renewals-item-grid",2,"background-color","#f5f5f5"],[1,"toggle-container"],[3,"change","disableRipple","checked"],[1,"seat-container"],[1,"text-elipsis","d-flex","flex-row","flex-grow-1","justify-content-center","gap-3"],[1,"my-renewals-item-row","d-flex","flex-grow-1"],[1,"my-renewals-passepartout-selection","d-flex","flex-row","justify-content-start","align-items-center","gap-1"],[1,"form-control-sm",2,"width","100%",3,"value"],[1,"my-renewals-item-price","d-flex","flex-row","justify-content-start","align-items-center","gap-1"],["translationKey","VIEWS.RENEWALS.MY.PRICE"],[1,"bold"],[1,"my-renewals-item-row","d-flex","flex-row","justify-content-start","align-items-center","gap-1"],["translationKey","VIEWS.RENEWALS.MY.ROW"],[1,"my-renewals-item-chair","d-flex","flex-row","justify-content-start","align-items-center","gap-1"],["translationKey","VIEWS.RENEWALS.MY.SEAT"],[1,"my-renewals-item-chair"],[1,"form-control-sm",2,"width","100%",3,"change","value"],[3,"value","selected"],[1,"my-renewals-item","pl-2","d-flex","flex-row","justify-content-start","align-items-center","gap-3"],["fxFlex","","fxLayout","column","fxFill","",1,"gap-2","align-items-start","justify-content-start"],[1,"d-flex","flex-column","gap-2","justify-content-start","flex-grow-1"],[1,"d-flex","flex-row","gap-2","justify-content-start"],["fxFlex","",1,"my-renewals-passepartout-selection","justify-content-start","align-items-center","gap-1"],["fxFlex","",1,"my-renewals-item-price","justify-content-start","align-items-center","gap-1"],["fxFlex","",1,"text-elipsis","flex-grow-1","justify-content-center","gap-3"],["fxFlex","",1,"my-renewals-item-row","flex-grow-1"],[1,"d-flex","flex-column","gap-2","justify-content-start"],[1,"d-flex","flex-grow-1","flex-fill"],[1,"d-flex"],[1,"my-renewals-legend-container","d-flex","flex-row","gap-2","align-items-center"],[1,"d-flex","flex-column","flex-md-row","flex-grow-1","gap-4"],[1,"my-renewals-legend-on-image","d-flex","flex-row","gap-2","align-items-center"],["src","../../../../assets/img/ticket_switch_legend_on.png"],[1,"my-renewals-legend-on-text"],["translationKey","VIEWS.RENEWALS.MY.EXTEND"],[1,"my-renewals-legend-off-image","d-flex","flex-row","gap-2","align-items-center"],["src","../../../../assets/img/ticket_switch_legend_off.png"],[1,"my-renewals-legend-off-text"],["translationKey","VIEWS.RENEWALS.MY.CANCEL"],[1,"reset-pending-reservation","d-flex","flex-row","gap-1","align-items-center"],[1,"reset-pending-reservation","d-flex","flex-row","gap-1","align-items-center",3,"click"],["aria-hidden","true",1,"fa","fa-trash"],["translationKey","VIEWS.RENEWALS.MY.RESTORE-PLACEMENTS"],["translationKey","VIEWS.RENEWALS.MY.MANAGED-BY-USER",3,"params"],[1,"my-renewals-footer-add","d-flex","flex-column","flex-lg-row","align-items-start","align-items-lg-center","gap-3"],[1,"d-flex","flex-row-reverse"],[1,"d-flex","align-items-start"],[1,"d-flex","flex-fill","align-items-start"],[1,"inputwrapper","d-flex","flex-row","gap-2","flex-fill","justify-content-end"],["title","Decrease value","aria-label","Decrease value",1,"input-button",3,"click"],[1,"fa-solid","fa-minus"],["type","number","name","extraTickets","id","extraticketsinput","min","0",1,"form-control",3,"change","ngModelChange","ngModel","max"],["title","Increase value","aria-label","Increase value",1,"input-button",3,"click"],[1,"fa-solid","fa-plus"],["translationKey","VIEWS.RENEWALS.MY.BUY-MORE"],["translationKey","VIEWS.RENEWALS.MY.NO-RENEWALS"],[1,"button-bar","d-flex","flex-fill","gap-2"],["type","green","size","full",1,"my-renewals-footer-order-button","flex-fill",3,"showLoader","disabled","text"],["type","primary","size","full",1,"my-renewals-footer-order-button","flex-fill",3,"showLoader","disabled","text"],["type","green","size","full",1,"my-renewals-footer-order-button","flex-fill",3,"click","
1showLoader","disabled","text"],["type","primary","size","full",1,"my-renewals-footer-order-button","flex-fill",3,"click","showLoader","disabled","text"]],template:function(i,o){i&1&&(s(0,"div",1),m(1,"app-title-bar",2),s(2,"div",3),h(3,Wn,8,4,"div",4),a()()),i&2&&(l(3),_(o.pageReadyForRendering?3:-1))},dependencies:[Rt,le,ce,De,Lt,re,Vt,Ft,Le,G,k,V,ii,J,ti,X,$t,z],styles:['.reset-pending-reservation[_ngcontent-%COMP%]{color:#d8232a;cursor:pointer}.content[_ngcontent-%COMP%]{padding:0 24px}@media screen and (max-width:768px){.content[_ngcontent-%COMP%]{padding-left:16px;padding-right:16px}}.input-button[_ngcontent-%COMP%]{width:48px;height:48px;margin:0;background:transparent;color:#000;font-size:var(--font-size);border:none;background-color:var(--input-bg, #EEF2f6);min-height:48px;touch-action:manipulation;border-radius:100%;line-height:10px}.seat-container[_ngcontent-%COMP%]{padding:4px 8px;background-color:#fff;width:auto;border-radius:4px}.seat-container[_ngcontent-%COMP%] .bold[_ngcontent-%COMP%]{color:#010101;font-weight:700}.input-button[_ngcontent-%COMP%]:hover{background:#eee;line-height:20px}.input-button[_ngcontent-%COMP%]:active{background:#ddd}.input-button[_ngcontent-%COMP%]:focus{outline:none}#extraticketsinput[_ngcontent-%COMP%]{margin:0;width:80px;min-height:48px;border:none;padding:0 8px;text-align:center;font-size:16px;background-color:var(--input-bg, #EEF2f6);border-radius:4px}#extraticketsinput[_ngcontent-%COMP%]::-webkit-inner-spin-button, #extraticketsinput[_ngcontent-%COMP%]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#extraticketsinput[_ngcontent-%COMP%]:hover{border-color:#777}.my-renewals[_ngcontent-%COMP%]{font-family:var(--base-font, Arial);font-weight:700;font-size:unset}.my-renewals-friend[_ngcontent-%COMP%]{margin-top:8px}.my-renewals-friend[_ngcontent-%COMP%] .ng-invalid.ng-dirty[_ngcontent-%COMP%]{border:#ed1b23 1px solid}.my-renewals-top[_ngcontent-%COMP%]{margin-top:initial;height:40px;border-bottom:1px #eeeeee solid}.my-renewals-section-header[_ngcontent-%COMP%]{padding-top:20px;padding-bottom:4px}.my-renewals-section-header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{height:23px;width:53px;color:#000;font-family:HelveticaNeueCondBold;font-size:1.25rem;line-height:24px}.my-renewals-grid-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto auto 1fr auto max-content;gap:1px 12px;align-items:center}.my-renewals-item[_ngcontent-%COMP%]{background-color:#f5f5f5;color:gray;font-size:16px;min-height:55px;margin:1px 0;padding:16px 8px}.my-renewals-item-grid[_ngcontent-%COMP%]{display:contents}.my-renewals-item-section[_ngcontent-%COMP%]{background-color:#ff0}.my-renewals-item-row[_ngcontent-%COMP%]{padding-right:5px}.my-renewals-item-row[_ngcontent-%COMP%], .my-renewals-item-chair[_ngcontent-%COMP%]{display:inline-block}.my-renewals-item[_ngcontent-%COMP%] .mat-slide-toggle[_ngcontent-%COMP%]{padding-right:25px}.my-renewals-legend[_ngcontent-%COMP%]{color:#9b9b9b;padding-left:8px;padding-top:8px;padding-bottom:8px;border-bottom:1px solid #9b9b9b}.my-renewals-legend-on-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .my-renewals-legend-off-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:20px}.my-renewals-footer[_ngcontent-%COMP%]{left:0;right:0;bottom:0;background-color:#fff;z-index:2;padding:8px}.my-renewals-footer-spacer[_ngcontent-%COMP%]{height:130px}.my-renewals-footer-overview-spacer[_ngcontent-%COMP%]{margin:28px 20px 18px;border-top:#010101 1px solid;height:69px}.my-renewals-footer-order[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .my-renewals-footer-goto-pay[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#fff;font-size:18px;font-weight:700}.my-renewals-footer-order[_ngcontent-%COMP%]{margin:7px 14px 7px 16px;background-color:#7eb541;height:48px;display:flex;justify-content:center;align-items:center}.my-renewals-footer-order[_ngcontent-%COMP%] .fa-chevron-down[_ngcontent-%COMP%]{color:#fff;transform:rotate(-90deg) translateY(50px) translate(-1px);position:absolute}.my-renewals-footer-goto-pay-button[_ngcontent-%COMP%] .btn-primary[_ngcontent-%COMP%], .my-renewals-footer-order-button[_ngcontent-%COMP%] .btn-primary[_ngcontent-%COMP%]{background-color:#7eb541;border:none;border-radius:0}.my-renewals-footer-goto-pay-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .my-renewals-footer-order-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex}.my-renewals-footer-goto-pay-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:after, .my-renewals-footer-order-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:after{color:#fff;font-family:"Font Awesome 7 Pro";content:"\\f078";font-weight:900;transform:rotate(-90deg) translateY(15px)}.my-renewals-footer-goto-pay[_ngcontent-%COMP%]{margin:7px 14px 7px 16px;background-color:#7eb541;height:48px;display:flex;justify-content:center;align-items:center}.my-renewals-footer-goto-pay[_ngcontent-%COMP%]:after{color:#fff;font-family:"Font Awesome 7 Pro";content:"\\f078";font-weight:900;transform:rotate(-90deg) translateY(15px)}
1.button-bar[_ngcontent-%COMP%]{max-width:50%}@media screen and (max-width:768px){.button-bar[_ngcontent-%COMP%]{max-width:100%}}.inputwrapper[_ngcontent-%COMP%]{width:50%}@media screen and (max-width:768px){.inputwrapper[_ngcontent-%COMP%]{width:100%}}']});let t=r;return t})();var Gn=t=>[t,"EUR","symbol","1.2-2","nl"];function jn(t,r){if(t&1&&(s(0,"div",5)(1,"span",18),m(2,"app-format-translation",19),g(3,":\xA0"),s(4,"b"),g(5),a()()()),t&2){let e=p();l(5),w(e.overviewLine.RowNumber)}}function Yn(t,r){if(t&1&&(s(0,"div",6)(1,"span",20),m(2,"app-format-translation",21),g(3,":\xA0"),s(4,"b"),g(5),a()()()),t&2){let e=p();l(5),w(e.overviewLine.SeatNumber)}}function Un(t,r){t&1&&(s(0,"div",7)(1,"span"),m(2,"app-format-translation",22),a()())}function Kn(t,r){if(t&1&&(s(0,"span",6)(1,"span",23),m(2,"app-format-translation",24),g(3,":"),a(),s(4,"b"),g(5),D(6,"currency"),a()()),t&2){let e=p();l(5),w(W(6,1,N(7,Gn,e.overviewLine.Total)))}}function Hn(t,r){t&1&&(s(0,"span",6),m(1,"app-base-loader",25),a())}function zn(t,r){if(t&1&&(s(0,"option",16),g(1),a()),t&2){let e=r.$implicit;f("value",e.Id),l(),w(e.Name)}}var Fi=(()=>{let r=class r{get isValid(){return this.formG.controls[this.overviewLine.UniqueId].valid}constructor(n,i){this.router=n,this.contextService=i,this.validations=null,this.pendingOrderChanged=new Ze,this.onBusyChanged=new Ze,this.updating=!1}ngOnInit(){}seatChange(n,i){}uitkaartChange(n,i){}};r.\u0275fac=function(i){return new(i||r)(u(F),u(Q))},r.\u0275cmp=A({type:r,selectors:[["app-renewal-overview-line"]],inputs:{overviewLine:"overviewLine",formG:"formG",availableCustomers:"availableCustomers",validations:"validations"},outputs:{pendingOrderChanged:"pendingOrderChanged",onBusyChanged:"onBusyChanged"},standalone:!1,decls:25,vars:12,consts:[["t",""],[3,"formGroup"],["fxLayout","row","fxLayoutWrap","wrap",1,"my-renewals-item"],["fxFlex","80px","fxFlex.lt-sm","60px","fxFlexAlign","center"],[1,"section-box"],["fxFlex.lt-md","80px","fxFlex","100px","fxFlexAlign","center"],["fxFlex","","fxFlexAlign","center"],["fxFlex.lt-sm","","fxFlex","","fxFlexAlign","center"],["fxHide.lt-md","","fxFlex","135px","fxFlexAlign","center",1,"my-renewals-item-chair"],["fxFlex.lt-sm","80px","fxFlex","140px","fxFlexAlign","center",1,"my-renewals-item-price"],["fxLayout","row",1,"my-renewals-friend"],[1,"form-control",3,"change","formControlName"],["value",""],["translationKey","VIEWS.RENEWALS.OVERVIEW-LINE.DEFAULT-DROPDOWN-TEXT"],["value","new"],["translationKey","VIEWS.RENEWALS.OVERVIEW-LINE.CREATE-FRIEND-DROPDOWN-TEXT"],[3,"value"],[3,"controlName","messages","form"],[1,"my-renewals-item-row"],["translationKey","VIEWS.RENEWALS.OVERVIEW-LINE.ROW"],[1,"my-renewals-item-chair"],["translationKey","VIEWS.RENEWALS.OVERVIEW-LINE.SEAT"],["translationKey","DIALOG.RENEWALS.GENERIC.FREESEATCHOICE"],["fxHide.lt-sm",""],["translationKey","VIEWS.RENEWALS.OVERVIEW-LINE.PRICE"],["size","18px","borderWidth","4px"]],template:function(i,o){if(i&1){let c=I();s(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"b"),g(5),a()()(),h(6,jn,6,1,"div",5),h(7,Yn,6,1,"div",6)(8,Un,3,0,"div",7),s(9,"div",8)(10,"span"),g(11),a()(),s(12,"div",9),h(13,Kn,7,9,"span",6)(14,Hn,2,0,"span",6),a()(),s(15,"div",10)(16,"select",11,0),P("change",function(v){return S(c),E(o.seatChange(v.target,o.overviewLine.Id))}),s(18,"option",12),m(19,"app-format-translation",13),a(),s(20,"option",14),m(2
11,"app-format-translation",15),a(),T(22,zn,2,2,"option",16,M),a()(),m(24,"app-display-validation",17),a()}i&2&&(f("formGroup",o.formG),l(3),Pt("background-color",o.overviewLine.ParentSectionColor?o.overviewLine.ParentSectionColor:""),l(2),w(o.overviewLine.ParentSectionShortName),l(),_(o.overviewLine.RowNumber!==null?6:-1),l(),_(o.overviewLine.SeatNumber!==null?7:8),l(4),w(o.overviewLine.PriceVariationName),l(2),_(o.updating?14:13),l(3),f("formControlName",o.overviewLine.UniqueId),l(6),b(o.availableCustomers),l(2),f("controlName",o.overviewLine.UniqueId)("messages",o.validations)("form",o.formG))},dependencies:[le,ce,Ve,re,ae,Ue,qt,V,se,Fe,J,ei,X,zt,z],encapsulation:2});let t=r;return t})();function Qn(t,r){t&1&&(s(0,"div",1)(1,"span"),m(2,"app-format-translation",3),a()())}function Xn(t,r){if(t&1){let e=I();s(0,"div",6)(1,"app-renewal-overview-line",9),P("onBusyChanged",function(i){S(e);let o=p(3);return E(o.handleLineBusyChanged(i))}),a()()}if(t&2){let e=r.$implicit,n=p(3);l(),f("overviewLine",e)("availableCustomers",n.availableCustomers)("formG",n.form)("validations",n.pendingOrderLineValidations)}}function Jn(t,r){if(t&1){let e=I();s(0,"form",4),P("ngSubmit",function(){S(e);let i=p(2);return E(i.submit())}),s(1,"div",5),T(2,Xn,2,4,"div",6,M),a(),s(4,"div",7),m(5,"app-button",8),a()()}if(t&2){let e=p(2);f("formGroup",e.form),l(2),b(e.pendingOrderLines),l(3),f("text",e.gotoPayText)("showLoader",e.saving)("disabled",e.form.invalid||e.busyLineAmount>0)}}function Zn(t,r){if(t&1&&(m(0,"app-order-timer"),s(1,"div",0),h(2,Qn,3,0,"div",1),h(3,Jn,6,4,"form",2),a()),t&2){let e=p();l(2),_(e.seatWarning?2:-1),l(),_(e.pendingOrderData!==null?3:-1)}}var pt=(()=>{let r=class r{constructor(n,i,o,c,d,v,y){this.router=n,this.contextService=i,this.orderState=o,this.renewalService=c,this.layoutService=d,this.appLoader=v,this.confirmService=y,this.pendingOrderLines=[],this.gotoPayText="VIEWS.RENEWALS.OVERVIEW.CONTINUE",this.pendingOrderData=null,this.saving=!1,this.pendingOrderLineValidations=[],this.seatWarning=!1,this.busyLineAmount=0,this.pendingOrderLineInvalidAssignmentData=[],d.updateLayout(new $("VIEWS.RENEWALS.OVERVIEW.TITLE",!0,"VIEWS.RENEWALS.OVERVIEW-RENEWALS.HELPTITLE","VIEWS.RENEWALS.OVERVIEW-RENEWALS.HELPTEXT"))}ngOnInit(){}handleLineBusyChanged(n){n===!0?this.busyLineAmount++:this.busyLineAmount--}submit(){this.saving=!0,this.seatWarning=!1;let n=[],i=[];for(let o in this.form.controls){let c=this.form.get(o);c instanceof ee&&n.push(c)}if(this.seatWarning){this.saving=!1;return}}};r.\u0275fac=function(i){return new(i||r)(u(F),u(Q),u(te),u(He),u(q),u(Ge),u(je))}
1,r.\u0275cmp=A({type:r,selectors:[["app-overview-renewals"]],inputs:{pendingOrderLines:"pendingOrderLines"},standalone:!1,decls:3,vars:1,consts:[[1,"content"],["role","alert",1,"alert","alert-danger"],[3,"formGroup"],["translationKey","VIEWS.RENEWALS.OVERVIEW.SEAT-VALIDATION-ERROR"],[3,"ngSubmit","formGroup"],[1,"renewal-overview__renewals"],["fxLayout","column",1,"my-renewals-section-overview-column"],["fxLayout","row","fxLayoutAlign","flex-end",1,"my-renewals-footer","renewal-overview__footer"],["fxFlex","1 1 50%","fxFlex.lt-lg","1 1 100%","type","green","size","full",1,"my-renewals-footer-goto-pay-button",3,"text","showLoader","disabled"],[3,"onBusyChanged","overviewLine","availableCustomers","formG","validations"]],template:function(i,o){i&1&&(s(0,"div"),m(1,"app-title-bar"),h(2,Zn,4,2),a()),i&2&&(l(2),_(o.appLoader.isOpen()?-1:2))},dependencies:[Ne,ae,G,Ke,k,V,se,J,Ye,X,Fi],encapsulation:2});let t=r;return t})();var ut=(()=>{let r=class r{constructor(){}ngOnInit(){}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=A({type:r,selectors:[["app-order-overview"]],standalone:!1,decls:3,vars:0,template:function(i,o){i&1&&(s(0,"div"),m(1,"app-title-bar")(2,"app-shopping-cart"),a())},dependencies:[k,wi],styles:[".plus-minus-button-container[_ngcontent-%COMP%]{text-align:center}.plus-minus-text[_ngcontent-%COMP%]{font-weight:700;font-size:1.2em}.plus-minus-container[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:0;margin:0;width:40px;height:40px;max-height:40px;max-width:40px;border-radius:50%;background:#ed1c24}.plus-minus-container[_ngcontent-%COMP%] .btn-grey[_ngcontent-%COMP%]{background:#9b9b9b}.plus-minus-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:center;width:50px;margin:0 auto}.unplaced-price-row[_ngcontent-%COMP%]{padding:10px 0;border-bottom:1px solid #e8e8e8}.unplaced-header[_ngcontent-%COMP%]{margin-bottom:10px}.unplaced-bottom[_ngcontent-%COMP%]{margin-bottom:80px}.order-overview-purchaseright[_ngcontent-%COMP%]{margin:10px 0}.unselected[_ngcontent-%COMP%]{color:#c1c1c1}"]});let t=r;return t})();var eo=["profileForm"],gt=(()=>{let r=class r{constructor(n,i,o,c,d,v,y,R){this.route=n,this.router=i,this.accountService=o,this.contextService=c,this.pendingOrderLineService=d,this.shoppingCartService=v,this.customerService=y,this.authService=R}ngOnInit(){this.customerService.allowedFriendFamilyCoupling().subscribe(n=>{n?setTimeout(()=>{this.pendingOrderLineId=Number(this.route.snapshot.paramMap.get("pendingorderlineid"))},0):this.router.navigate(["/renewals/orderoverview"])})}profileSubmit(n){this.accountService.registerFriend(n.data).subscribe(i=>{this.authService.refreshManagedCustomerIds().subscribe(o=>{this.pendingOrderLineService.updatePendingOrderLineCustomer(this.pendingOrderLineId,i).subscribe(c=>{let d=this.shoppingCartService.getPendingOrderDetails();for(let v of d.OrderLines)v.Id===this.pendingOrderLineId&&(v.TicketCustomerId=i);this.shoppingCartService.setPendingOrderDetails(d),this.router.navigate(["/renewals/orderoverview"])})})},i=>{throw this.profileForm.notifyReady(),i})}};r.\u0275fac=function(i){return new(i||r)(u(oe),u(F),u(Bt),u(Q),u(Yt),u(de),u(ke),u(me))},r.\u0275cmp=A({type:r,selectors:[["app-add-friend"]],viewQuery:function(i,o){if(i&1&&Re(eo,7),i&2){let c;Me(c=Te())&&(o.profileForm=c.first)}},standalone:!1,decls:4,vars:1,consts:[["profileForm",""],[3,"onFormSubmit","userIsAddingFriend"]],template:function(i,o){if(i&1){let c=I();s(0,"div"),m(1,"app-title-bar"),s(2,"app-profile-form",1,0),P("onFormSubmit",function(v){return S(c),E(o.profileSubmit(v))}),a()()}i&2&&(l(2),f("userIsAddingFriend",!0))},dependencies:[k,Pi],encapsulation:2});let t=r;return t})();var ft=(()=>{let r=class r{constructor(n,i){this.layoutService=n,this.router=i,n.updateLayout(new $("VIEWS.RENEWALS.ADD-FRIEND.TITLE",!1))}ngOnInit(){}renewPassepartout(){this.router.navigate(["/renewals/my"])}};r.\u0275fac=function(i){return new(i||r)(u(q),u(F))},r.\u0275cmp=A({type:r,selectors:[["app-order-expired"]],standalone:!1,decls:5,vars:0,consts:[[1,"renewals__order-expired","content"],["translationKey","VIEWS.RENEWALS.ADD-FRIEND.SECTION"],["type","green","text","VIEW.DASHBOARD.RENEW-NOW",3,"click"]],template:function(i,o){i&1&&(m(0,"app-title-bar"),s(1,"div",0),m(2,"app-format-translation",1),s(3,"div")(4,"app-button",2),P("click",function(){return o.renewPassepartout()}),a()()())},dependencies:[G,k,V],encapsulation:2});let t=r;return t})();var ht=vt(Ki());var Vi=t=>[t,"EUR","symbol","1.2-2","nl"];function io(t,r){if(t&1&&(g(0),D(1,"translate"),D(2,"currency")),t&2){let e=p();et(" ",ne(1,2,"VIEWS.RENEWALS.PAYMENT-SELECTION.SURCHARGE"),": ",W(2,4,N(10,Vi,e.surcharge))," ")}}function no(t,r){t&1&&(g(0),D(1,"translate")),t&2&&L(" ",ne(1,1,"VIEWS.RENEWALS.PAYMENT-SELECTION.NO-SURCHARGE")," ")}function oo(t,r){if(t&1&&(g(0),D(1,"number")),t&2){let e=p();L(" (",e.percentage%1===0?e.percentage:wt(1,1,e.percentage,"1.1-2","nl"),"%) ")}}var ki=(()=>
1{let r=class r{constructor(){this.percentage=null,this.surcharge=null,this.orderAmount=null,this.amountToPay=null}ngOnInit(){this.amountToPay=this.orderAmount,this.surcharge!==null&&(this.amountToPay+=this.surcharge)}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=A({type:r,selectors:[["app-payment-surcharge"]],inputs:{percentage:"percentage",surcharge:"surcharge",orderAmount:"orderAmount",amountToPay:"amountToPay"},standalone:!1,decls:7,vars:14,consts:[[1,"cost-info"]],template:function(i,o){i&1&&(s(0,"div",0),h(1,io,3,12)(2,no,2,3),h(3,oo,2,5),g(4),D(5,"translate"),D(6,"currency"),a()),i&2&&(l(),_(o.surcharge!==null?1:2),l(2),_(o.percentage!==null?3:-1),l(),et(" - ",ne(5,4,"VIEWS.RENEWALS.PAYMENT-SELECTION.PAY")," ",W(6,6,N(12,Vi,o.amountToPay)),` 2`))},dependencies:[Mt,z,Oe],styles:[".cost-info[_ngcontent-%COMP%]{font-size:.9em;color:#888}"]});let t=r;return t})();var ao=t=>[t,"EUR","symbol","1.2-2","nl"],Wi=()=>({dateInputFormat:"DD-MM-YYYY"}),so=()=>[];function lo(t,r){t&1&&(s(0,"div",3),m(1,"app-format-translation",6),a())}function co(t,r){if(t&1){let e=I();s(0,"div",8)(1,"div",10)(2,"input",11),H("ngModelChange",function(i){S(e);let o=p(2);return K(o.selectedPaymentMethod,i)||(o.selectedPaymentMethod=i),E(i)}),a(),s(3,"label",12),m(4,"app-format-translation",13),a(),m(5,"app-payment-surcharge",14),a()()}if(t&2){let e=p(2);l(2),U("ngModel",e.selectedPaymentMethod),l(3),f("surcharge",null)("percentage",null)("orderAmount",e.paymentInfo.OrderTotalExPaymentSurcharge)}}function mo(t,r){if(t&1){let e=I();s(0,"div",9)(1,"mat-checkbox",15),H("ngModelChange",function(i){S(e);let o=p(2);return K(o.agreesWithRecurringTerms,i)||(o.agreesWithRecurringTerms=i),E(i)}),s(2,"span")(3,"p",16),m(4,"app-format-translation",17),a()()()()}if(t&2){let e=p(2);l(),f("disableRipple",!0),U("ngModel",e.agreesWithRecurringTerms)}}function po(t,r){if(t&1){let e=I();s(0,"div",8)(1,"div",18)(2,"input",19),H("ngModelChange",function(i){S(e);let o=p(2);return K(o.selectedPaymentMethod,i)||(o.selectedPaymentMethod=i),E(i)}),a(),s(3,"label",20),m(4,"app-format-translation",21),a(),m(5,"app-payment-surcharge",22),a()()}if(t&2){let e=p(2);l(2),U("ngModel",e.selectedPaymentMethod),l(3),f("surcharge",null)("percentage",null)("orderAmount",e.paymentInfo.OrderTotalExPaymentSurcharge)}}function uo(t,r){if(t&1&&(g(0," - "),m(1,"app-format-translation",43),g(2),D(3,"currency")),t&2){let e=p().$implicit;l(2),L(": ",W(3,1,N(7,ao,e.Surcharge))," ")}}function go(t,r){if(t&1&&(s(0,"option",40),g(1),m(2,"app-format-translation",42),h(3,uo,4,9),a()),t&2){let e=r.$implicit;f("value",e.Id),l(),L("",e.InstalmentCount," "),l(),f("translationKey",It("VIEWS.RENEWALS.DIRECTDEBIT."+(e.InstalmentCount===1?"INSTALMENT":"INSTALMENTS"))),l(),_(e.Surcharge&&e.Surcharge>0?3:-1)}}function fo(t,r){if(t&1&&(s(0,"div",31)(1,"label"),m(2,"app-format-translation",44),a(),m(3,"input",45)(4,"app-display-validation",46),a()),t&2){let e=p(3);l(3),f("bsConfig",Ae(3,Wi)),l(),f("form",e.directDebitForm)("messages",e.directDebitFormMessages)}}function ho(t,r){if(t&1&&(s(0,"div")(1,"label"),m(2,"app-format-translation",47),g(3),a(),m(4,"input",48)(5,"app-display-validation",49),a()),t&2){let e=r.$index,n=p(4);l(3),L(" ",e+1),l(),f("name",be("collectiondate",e+1))("formControlName",be("collectiondate",e+1))("bsConfig",Ae(10,Wi)),l(),f("controlName",be("collectiondate",e+1))("form",n.directDebitForm)("messages",n.directDebitFormMessages)}}function _o(t,r){if(t&1&&(s(0,"div",31),T(1,ho,6,11,"div",null,M),a()),t&2){let e=p(3);l(),b(Ae(0,so).constructor(e.instalments))}}function vo(t,r){if(t&1){let e=I();s(0,"div",8)(1,"div",18)(2,"input",23),H("ngModelChange",function(i){S(e);let o=p(2);return K(o.selectedPaymentMethod,i)||(o.selectedPaymentMethod=i),E(i)}),a(),s(3,"label",24),m(4,"app-format-translation",25),a(),s(5,"div",26),g(6),D(7,"translate"),a()()(),s(8,"div",27)(9,"form",28)(10,"div",29)(11,"h6"),m(12,"app-format-translation",30),a(),m(13,"br"),s(14,"div",31)(15,"label"),m(16,"app-format-translation",32),a(),m(17,"input",33)(18,"app-display-validation",34),a(),s(19,"div",31)(20,"label"),m(21,"app-format-translation",35),a(),m(22,"input",36)(23,"app-display-validation",37),a(),s(24,"div",31)(25,"label"),m(26,"app-format-translation",38),a(),s(27,"select",39),P("change",function(i){S(e);let o=p(2);return E(o.changePaymentMethod(i))}),T(28,go,4,5,"option",40,M),a(),m(30,"app-display-validation",41),a(),h(31,fo,5,4,"div",31)(32,_o,3,1,"div",31),a()()()}if(t&2){let e=p(2);l(2),U("ngModel",e.selectedPaymentMethod),l(4),w(ne(7,11,"VIEWS.RENEWALS.PAYMENT-SELECTION.SURCHARGE-BY-INSTALLMENTS")),l(2),f("collapse",e.selectedPaymentMethod!=="DirectDebit"),l(),f("formGroup",e.directDebitForm),l(9),f("form",e.directDebitForm)("messages",e.directDebitFormMessages),l(5),f("form",e.directDebitForm)("messages",e.directDebitFormMessages),l(5),b(e.paymentInfo.DirectDebitPaymentMethods),l(2),f("form",e.directDebitForm)("messages",e.directDebitFormMessages),l(),_(e.instalments===1?31:e.instalments>1?32:-1)}}function Co(t,r){if(t&1){let e=I();s(0,"div",8)(1,"div",18)(2,"input",50),H("ngModelChange",function(i){S(e);let o=p(2);return K(o.selectedPaymentMethod,i)||(o.selectedPaymentMethod=i),E(i)}),a(),s(3,"label",51),m(4,"app-format-translation",52),a(),m(5,"app-payment-surcharge",22),a()()}if(t&2){let e=p(2);l(2),U("ngModel",e.selectedPaymentMethod),l(3),f("surcharge",e.paymentInfo.IDEALIN3Payment.SurchargeTotal)("percentage",e.paymentInfo.IDEALIN3Payment.SurchargePercentage)("orderAmount",e.paymentInfo.OrderTotalExPaymentSurcharge)}}function yo(t,r){if(t&1&&(s(0,"div",3),m(1,"app-format-translation",7),a(),h(2,co,6,4,"div",8),h(3,mo,5,2,"div",9),h(4,po,6,4,"div",8),h(5,vo,33,13),h(6,Co,6,4,"div",8)),t&2){let e=p();l(2),_(e.paymentInfo&&e.paymentInfo.UpfrontPaymentAllowed?2:-1),l(),_(e.selectedPaymentMethod==="DirectPayment"&&e.paymentInfo.RecurrentPaymentAllowed?3:-1),l(),_(e.paymentInfo&&e.paymentInfo.PaymentByInvoiceAllowed?4:-1),l(),_(e.paymentInfo&&e.paymentInfo.DirectDebitAllowed?5:-1),l(),_(e.paymentInfo&&e.paymentInfo.IDEALIN3Payment!=null?6:-1)}}var Se=(()=>
2{let r=class r{constructor(n,i,o,c,d,v,y,R,C,x,O,Z,Y,pe,Qe,Xe){this.router=n,this.conversion=i,this.route=o,this.orderState=c,this.paymentService=d,this.shoppingCartService=v,this.pendingOrderService=y,this.ticketChangeService=R,this.layoutService=C,this.alertService=x,this.localeService=O,this.shopGuardHelperService=Z,this.logger=Y,this.gtmService=pe,this.authService=Qe,this.translate=Xe,this.directDebitFormMessages={},this.saving=!1,this.goNextText="VIEWS.RENEWALS.PAYMENT-SELECTION.FINISH-PAYMENT",this.instalments=0,this.message=null,this.isTicketChangeBasket=!1,this.agreesWithRecurringTerms=!1,this.layoutService.updateLayout(new $("VIEWS.RENEWALS.PAYMENT-SELECTION.TITLE",!0,"VIEWS.RENEWALS.PAYMENT-SELECTION.HELPTITLE","VIEWS.RENEWALS.PAYMENT-SELECTION.HELPTEXT")),this.route.params.subscribe(Ee=>{Ee.msg&&(this.message=Ee.msg)})}ngOnInit(){if(rt.invalidDate="Ongeldig",Ci("nl-custom",rt),this.localeService.use("nl-custom"),this.pendingOrder=this.shoppingCartService.getPendingOrderDetails(),this.pendingOrder||(this.pendingOrder=this.shoppingCartService.getPendingOrderDetails()),this.isTicketChangeBasket=nt(this.pendingOrder?.OrderLines),this.shoppingCartService.startOrUpdateTimer(this.pendingOrder.Id),!this.orderState.paymentRequired||this.pendingOrder===null){this.router.navigate(["/renewals/my"]);return}this.paymentInfo=this.orderState.getPaymentInfo(),this.paymentInfo.PaymentAllowed===!0&&(this.selectedPaymentMethod||(this.selectedPaymentMethod="DirectPayment")),this.paymentInfo.DirectDebitAllowed===!0&&(this.initDirectDebitForm(),this.selectedPaymentMethod||(this.selectedPaymentMethod="DirectPayment"),this.paymentInfo.DirectDebitAllowed===!0&&(this.initDirectDebitForm(),this.selectedPaymentMethod||(this.selectedPaymentMethod="DirectPayment")))}initDirectDebitForm(){this.directDebitFormMessages={iban:[{type:"validateIban",message:"FORM.VALIDATION.IBAN"}],name:[{type:"required",message:"FORM.VALIDATION.REQUIRED"}],paymentMethod:[{type:"required",message:"FORM.VALIDATION.REQUIRED"}]};let n=this.paymentInfo.DirectDebitPaymentMethods?.length>0?this.paymentInfo.DirectDebitPaymentMethods[0].Id:"";this.directDebitForm=new Dt({iban:new ee("",[vi.validateIban]),name:new ee("",[he.required]),paymentMethod:new ee({value:n,disabled:this.paymentInfo.DirectDebitPaymentMethods.length===1},[he.required])});for(let i=1;i<=12;i++){let o=`collectiondate${i}`;this.directDebitForm.addControl(o,new ee(null)),this.directDebitFormMessages[o]=[{type:"required",message:"FORM.VALIDATION.REQUIRED"},{type:"maxDate",message:"VIEWS.RENEWALS.PAYMENT-SELECTION.VALIDATION.MAX-DATE"},{type:"minDate",message:"VIEWS.RENEWALS.PAYMENT-SELECTION.VALIDATION.MIN-DATE"}]}this.setDirectDebitPaymentMethod(n)}ngAfterViewInit(){this.paymentInfo&&(this.paymentInfo.AwaitingPaymentCallback=!1,this.orderState.setPaymentInfo(this.paymentInfo)),this.message!==null&&(this.message==="canceled"?this.alertService.warn("VIEWS.RENEWALS.PAYMENT-SELECTION.ALERT.PAYMENT-CANCELED"):this.message==="failed"?this.alertService.error("VIEWS.RENEWALS.PAYMENT-SELECTION.ALERT.PAYMENT-FAILED"):this.message==="rejected"&&this.alertService.error("VIEWS.RENEWALS.PAYMENT-SELECTION.ALERT.PAYMENT-REJECTED"))}changePaymentMethod(n){this.setDirectDebitPaymentMethod(+n.target.value)}setDirectDebitPaymentMethod(n){let i=this.paymentInfo.DirectDebitPaymentMethods.find(c=>c.Id===n);this.instalments=i.InstalmentCount;let o=(0,ht.default)(new Date).add(1,"days");for(let c=1;c<=12;c++){let d=`collectiondate${c}`;if(i.Instalments.length<c){this.directDebitForm.controls[d].removeValidators([he.required]),this.directDebitForm.controls[d].setValue(null);continue}let v=i.Instalments[c-1],y=(0,ht.default)(v.Date);this.changeMinMaxDateErrorMessage(d,o,y),this.directDebitForm.controls[d].setValue(y.toDate());let R=[he.required,ot.minDate(o.subtract(1,"days")),ot.maxDate(y)];this.directDebitForm.controls[d].setValidators(R),v.IsFlexible?this.directDebitForm.controls[d].enable():this.directDebitForm.controls[d].disable(),o=y.add(1,"days")}}changeMinMaxDateErrorMessage(n,i,o){let c=this.directDebitFormMessages[n];if(c)for(let d of c)d.type==="maxDate"&&(d.params={maxDate:o.format("DD-MM-YYYY")}
2),d.type==="minDate"&&(d.params={minDate:i.format("DD-MM-YYYY")})}initiatePayment(){let n=!0,i=!1,o=!1,c=!1,d=null;if(this.saving=!0,this.selectedPaymentMethod&&this.selectedPaymentMethod=="PayByInvoice"&&(n=!1,i=!0),this.selectedPaymentMethod&&this.selectedPaymentMethod==="DirectDebit"){let C=this.directDebitForm.getRawValue(),x=C.paymentMethod??this.paymentInfo.DirectDebitPaymentMethods[0].Id;d={AccountName:C.name,IBAN:C.iban,PaymentMethod:x,EffectiveDates:[]};for(let O=1;O<=12;O++){let Z=`collectiondate${O}`,Y=C[Z];if(Y){let pe=this.conversion.fixDateTimezone(Y);d.EffectiveDates.push(pe)}}n=!1,i=!1,this.selectedPaymentMethod&&this.selectedPaymentMethod=="DirectPayment"&&this.agreesWithRecurringTerms&&(o=!0,n=!0)}this.selectedPaymentMethod&&this.selectedPaymentMethod==="IDEALIN3PaymentAllowed"&&(n=!1,i=!1,c=!0);let v="";try{v=window.ga&&window.ga.getAll?window.ga.getAll()[0].get("clientId"):""}catch{}let y={UpfrontPayment:n,PayByInvoice:i,PendingOrderId:this.pendingOrder.Id,DirectDebitInitiation:d,GASessionId:v,Recurrent:o,PayByIN3:c};(this.isTicketChangeBasket?this.sendGTMPaymentInfo():Pe(void 0)).pipe(ge(()=>this.paymentService.initiate(y))).subscribe(C=>{if(C.OK===!1){this.alertService.error("VIEWS.RENEWALS.PAYMENT-SELECTION.ALERT.INITIATE-PAYMENT-FAILED"),this.saving=!1;return}if(this.logger.log("pay result: ",C),this.isTicketChangeBasket&&C.PaymentReference&&C.ClientReference){this.orderState.setPaymentInfo(null),this.router.navigate(["/ticket-change/basket/confirmation",C.PaymentReference,C.ClientReference]),this.saving=!1;return}C.OrderId!==null?(this.orderState.setPaymentInfo(null),this.orderState.setDirectOrderId(C.OrderId),this.sendGTMPaymentInfo().subscribe(),this.router.navigate(["/renewals/confirmation"])):(this.paymentInfo.ClientReference=C.ClientReference,this.paymentInfo.AwaitingPaymentCallback=!0,this.orderState.setPaymentInfo(this.paymentInfo),this.pendingOrderService.getCurrentActive().subscribe(x=>{x!=null&&this.shoppingCartService.setPendingOrderDetails(x),this.isTicketChangeBasket||this.sendGTMPaymentInfo().subscribe(),C.RedirectUrl&&C.RedirectUrl!==null?(this.shopGuardHelperService.setSkipQueueLeave(!0),parent.window.location.href=C.RedirectUrl):this.isTicketChangeBasket&&C.PaymentReference&&C.ClientReference?this.router.navigate(["/ticket-change/basket/confirmation",C.PaymentReference,C.ClientReference]):this.router.navigate(["/renewals/confirmation"])})),this.saving=!1})}sendGTMPaymentInfo(){this.pendingOrder=this.shoppingCartService.getPendingOrderDetails();let n=nt(this.pendingOrder?.OrderLines)?this.ticketChangeService.getTicketChangeBasket(this.pendingOrder.Id):Pe(null);return yt({activeChannel:this.authService.getActiveSalesChannel().pipe(xt(1)),basketLines:n}).pipe(fe(({activeChannel:i,basketLines:o})=>{let c=o?Ii(o,i.Name):this.pendingOrder.OrderLines.map(d=>({item_id:d.ProductType,item_name:d.ProductType==2?"Delivery method":d.ProductType==3?"Payment method":d.CrossSellProductName??d.EventName??d.PassePartoutName??d.MembershipName??d.MatchDayPassName,product_id:d.CrossSellProductId?"CRO_"+d.CrossSellProductId:d.MembershipId?"MEM_"+d.MembershipId:d.MatchDayPassId?"MDP_"+d.MatchDayPassId:d.EventId?"EVT_"+d.EventId:d.PassePartoutId?"PPT_"+d.PassePartoutId:null,ticket_type:d.TicketTypeName,sector:d.ParentSectionShortName??d.SectorName,price:d.Total,price_variant:d.PriceVariationName?this.translate.instant(d.PriceVariationName):"",affiliation:i.Name,row:d.RowNumber,seat:d.SeatNumber}));this.gtmService.addPaymentInfo(this.pendingOrder.Summary.TotalInclVat,c)}),Ct(()=>{}),ue(()=>Pe(void 0)))}initiatePaymentDisabled(){return this.selectedPaymentMethod?this.selectedPaymentMethod==="DirectDebit"&&this.directDebitForm.invalid||this.paymentInfo.RecurrentPaymentAllowed&&!this.agreesWithRecurringTerms:!0}};r.\u0275fac=function(i){return new(i||r)(u(F),u(gi),u(oe),u(te),u(jt),u(de),u(We),u(Ht),u(q),u(hi),u(yi),u(Zt),u(Be),u(ri),u(me),u(At))},r.\u0275cmp=A({type:r,selectors:[["app-payment-selection"]],standalone:!1,decls:10,vars:5,consts:[[1,"payment-selection"],["title","VIEWS.PAYMENT-SELECTION.TITLE",3,"backLink"],[1,"content"],[1,"intro"],["fxLayout","row","fxLayoutAlign","flex-end",1,"order-overview__footer"],["fxFlex","1 1 50%","fxFlex.lt-lg","1 1 100%","type","green","size","full","data-testid","renew
2als-pay-order-button",1,"my-renewals-footer-order-button",3,"click","showLoader","disabled","text"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.NO-PAYMENT-ALLOWED"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.CHOOSE-PAYMENT-METHOD"],[1,"form-group","form-group-radio"],[1,"card","card-block","card-header","collapse","in","show"],[1,"form-check","form-check-first"],["id","directPaymentRadio","type","radio","name","paymentMethod","value","DirectPayment","data-testid","renewals-direct-payment-radio",1,"form-check-input",3,"ngModelChange","ngModel"],["for","directPaymentRadio",1,"form-check-label"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.DIRECT-PAYMENT"],["data-testid","renewals-pay-order-total",3,"surcharge","percentage","orderAmount"],[3,"ngModelChange","disableRipple","ngModel"],[1,"order-overview__tac-text"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.RECURRENT-PAYMENT.TERMS-AND-CONDITIONS"],[1,"form-check"],["id","invoicePaymentRadio","type","radio","name","paymentMethod","value","PayByInvoice",1,"form-check-input",3,"ngModelChange","ngModel"],["for","invoicePaymentRadio",1,"form-check-label"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.BY-INVOICE"],[3,"surcharge","percentage","orderAmount"],["id","directDebitRadio","type","radio","name","paymentMethod","value","DirectDebit",1,"form-check-input",3,"ngModelChange","ngModel"],["for","directDebitRadio"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.DIRECT-DEBIT"],[1,"cost-info"],["id","collapseBasic",1,"card","card-block","card-header","collapse",3,"collapse"],[1,"form",3,"formGroup"],[1,"content-pad"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.DIRECT-DEBIT-HEADER"],[1,"form-group"],["translationKey","FORM.FIELDS.IBAN"],["type","text","formControlName","iban",1,"form-control"],["controlName","iban",3,"form","messages"],["translationKey","FORM.FIELDS.NAME"],["type","text","formControlName","name",1,"form-control"],["controlName","name",3,"form","messages"],["translationKey","FORM.FIELDS.INSTALMENTOPTIONS"],["formControlName","paymentMethod",1,"form-control",3,"change"],[3,"value"],["controlName","paymentMethod",3,"form","messages"],[3,"translationKey"],["translationKey","VIEWS.RENEWALS.DIRECTDEBIT.SURCHARGE"],["translationKey","FORM.FIELDS.COLLECTIONDATE"],["type","text","name","collectiondate1","formControlName","collectiondate1","bsDatepicker","",1,"form-control",3,"bsConfig"],["controlName","collectiondate1",3,"form","messages"],["translationKey","FORM.FIELDS.COLLECTIONDATE.COUNT"],["type","text","bsDatepicker","",1,"form-control",3,"name","formControlName","bsConfig"],[3,"controlName","form","messages"],["id","IDEALIN3PaymentAllowed","type","radio","name","paymentMethod","value","IDEALIN3PaymentAllowed",1,"form-check-input",3,"ngModelChange","ngModel"],["for","IDEALIN3PaymentAllowed",1,"form-check-label"],["translationKey","VIEWS.RENEWALS.PAYMENT-SELECTION.IN3"]],template:function(i,o){i&1&&(s(0,"div",0),m(1,"app-title-bar",1),Ie(2),m(3,"app-order-timer")(4,"alert"),s(5,"div",2),h(6,lo,2,0,"div",3)(7,yo,7,5),s(8,"div",4)(9,"app-button",5),P("click",function(){return o.initiatePayment()}),a()()(),we(),a()),i&2&&(l(),f("backLink",o.isTicketChangeBasket?"/shopping-cart":"/renewals/orderoverview"),l(5),_(o.paymentInfo&&!o.paymentInfo.UpfrontPaymentAllowed&&!o.paymentInfo.DirectDebitAllowed&&!o.paymentInfo.PaymentByInvoiceAllowed&&!o.paymentInfo.RecurrentPaymentAllowed?6:7),l(3),f("showLoader",o.saving)("disabled",o.initiatePaymentDisabled())("text",o.goNextText))},dependencies:[Ne,le,ce,De,Ve,Nt,re,ae,Le,G,Ue,Ke,k,_i,V,se,Fe,li,J,Ye,X,xi,Si,Mi,ki,z,Oe],styles:[".form-check[_ngcontent-%COMP%]{padding:16px 40px;border-bottom:1px solid #d8d8d8}.form-check-first[_ngcontent-%COMP%]{border-top:1px solid #d8d8d8}.form-group[_ngcontent-%COMP%]{margin-bottom:0}.card[_ngcontent-%COMP%]{border-radius:0;border:none;border-left:1px solid rgba(0,0,0,.125);border-right:1px solid rgba(0,0,0,.125);border-bottom:1px solid rgba(0,0,0,.125)}label[_ngcontent-%COMP%]{margin:0}.cost-info[_ngcontent-%COMP%]{font-size:.9em;color:#888}"]});let t=r;return t})();var Bi=[{path:"my",component:xe,data:{title:"Dashboard"},canActivate:[B]},{path:"my/:message",component:xe,data:{title:"Dashboard"},canActivate:[B]},{path:"order-expired",component:ft},{path:"overview",component:pt,canActivate:[B],data:{}},{path:"orderoverview",component:ut,canActivate:[B],data:{}},{path:"pay",component:Se,data:{}},{path:"pay/:msg",component:Se},{path:"add-friend/:pendingorderlineid",component:gt,canActivate:[B],data:{}},{path:"",redirectTo:"my",pathMatch:"full"},{path:"**",redirectTo:"/system/404"}],Gi=[{path:"my",component:xe,data:{title:"Dashboard"},canActivate:[B]},{path:"my/:message",component:xe,data:{title:"Dashboard"},canActivate:[B]},{path:"order-expired",component:ft},{path:"overview",component:pt,canActivate:[B],data:{}},{path:"orderoverview",component:ut,canActivate:[B],data:{}},{path:"pay",component:Se,data:{}},{path:"pay/:msg",component:Se},{path:"add-friend/:pendingorderlineid",component:gt,canActivate:[B],data:{}},{path:"",redirectTo:"my",pathMatch:"full"},{path:"**",redirectTo:"/system/404"}];var ia=(()=>{let r=class r{};r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=Et({type:r}),r.\u0275inj=St({providers:[{provide:bt,useFactory:n=>n.IsBusinessShop?Gi:Bi,multi:!0,deps:[Wt]}],imports:[Tt,kt,bi,it,pi,ai,mi,si,ci,di,ni,fi,ui,it,tt.forChild([]),Ot,Ei.forRoot(),Ti.forRoot(),tt]});let t=r;return t})();export{ia as RenewalsModule};
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.