1"use strict";(self.webpackChunkyumapos_web_client_mobile=self.webpackChunkyumapos_web_client_mobile||[]).push([[3862],{13862(Ot,K,a){a.d(K,{EXTERNAL_ORDER_PAY_ROUTES:()=>xt});var u=a(77339),m=a(59640),G=a(47084),y=a(63792),N=a(69501);const D=(t=0)=>(i,r)=>N.w.isValidUuid(r[t].path);var w=a(28673),l=a(85802),F=a(37702),b=a(52906),E=a(13810),Z=a(74474),q=a(75330),e=a(35547);function ee(t,i){if(1&t){const r=e.RV6();e.j41(0,"yp-redirect-to-payment-processor",1),e.bIt("cancelPayment",function(){l.eBV(r);const n=e.XpG();return l.Njj(n.goAwayFromPage())}),e.k0s()}if(2&t){const r=e.XpG();e.Y8G("processPaymentParams",r.processPaymentParams)}}let te=(()=>{class t extends Z.A{constructor(){super(...arguments),this.router=(0,l.WQX)(F.Ix),this.activatedRoute=(0,l.WQX)(F.nX)}goAwayFromPage(){this.activatedRoute.paramMap.pipe((0,b.$)()).subscribe(r=>{const o=r.get(y.G.externalOrderPay.children.param.orderId.children.redirect.children.param.partialPaymentId.name);(0,E.iY)(o),this.router.navigate(["../../",y.G.externalOrderPay.children.param.orderId.children.savePayment.path,o],{relativeTo:this.activatedRoute})})}static{this.\u0275fac=(()=>{let r;return function(n){return(r||(r=e.xGo(t)))(n||t)}})()}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-external-order-pay-redirect"]],features:[e.Vt3],decls:1,vars:1,consts:[[3,"processPaymentParams"],[3,"cancelPayment","processPaymentParams"]],template:function(o,n){1&o&&e.nVh(0,ee,1,1,"yp-redirect-to-payment-processor",0),2&o&&e.vxM(n.processPaymentParams?0:-1)},dependencies:[q.j],encapsulation:2,changeDetection:0})}}return t})();var V=a(49769),A=a(68018),ne=a(89208),R=a(17705),re=a(32271),oe=a(12560);const ae=[[["","projected-404-error",""]]],se=["[projected-404-error]"];function ie(t,i){}function le(t,i){1&t&&e.nrm(0,"router-outlet")}function de(t,i){if(1&t&&(e.j41(0,"div",0),e.nrm(1,"yp-error",1),e.k0s()),2&t){const r=i.$implicit;e.R7$(),e.Y8G("serverResponseError",r)}}function me(t,i){if(1&t&&e.Z7z(0,de,2,1,"div",0,e.fX1),2&t){e.XpG
1();const r=e.r8f(0);e.Dyx(r.errors)}}function pe(t,i){1&t&&(e.j41(0,"yp-page-not-found"),e.SdG(1),e.k0s())}var P=function(t){return t[t.showLoading=0]="showLoading",t[t.showRouterOutlet=1]="showRouterOutlet",t[t.showCommonError=2]="showCommonError",t[t.show404Error=3]="show404Error",t}(P||{});let ce=(()=>{class t{constructor(){this.dataFromServer=R.hFB.required(),this.responseErrorCodes404=(0,R.hFB)(),this.RenderType=P,this.dataFromServerInfo=(0,re.EW)(()=>{let r,o;const n=this.dataFromServer();if(void 0===n)r=P.show404Error;else switch(n.status){case 0:r=void 0!==n.data?P.showRouterOutlet:P.showLoading;break;case 1:r=P.showRouterOutlet;break;case 2:const s=this.responseErrorCodes404();n.errors.some(p=>Array.isArray(s)?s.includes(p.responseErrorCode):p.responseErrorCode===s)?r=P.show404Error:(r=P.showCommonError,o=n.errors)}return{renderType:r,errors:o??[]}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-data-from-server"]],inputs:{dataFromServer:[1,"dataFromServer"],responseErrorCodes404:[1,"responseErrorCodes404"]},ngContentSelectors:se,decls:5,vars:2,consts:[[1,"my-2","mx-3"],[3,"serverResponseError"]],template:function(o,n){if(1&o&&(e.NAR(ae),e.SS7(0),e.nVh(1,ie,0,0)(2,le,1,0,"router-outlet")(3,me,2,0)(4,pe,2,0,"yp-page-not-found")),2&o){let s;const d=e.bH3(n.dataFromServerInfo());e.R7$(),e.vxM((s=d.renderType)===n.RenderType.showLoading?1:s===n.RenderType.showRouterOutlet?2:s===n.RenderType.showCommonError?3:s===n.RenderType.show404Error?4:-1)}},dependencies:[F.n3,G.PageNotFoundComponent,oe.A],encapsulation:2,changeDetection:0})}}return t})();var X=a(34721),_=a(67101);const c={loadExternalOrderDetails:(0,m.VP)("[External Order] Load Order Details",(0,m.xk)()),loadExternalOrderDetailsSuccess:(0,m.VP)("[External Order] Load Order Details Success",(0,m.xk)()),loadExternalOrderDetailsFailure:(0,m.VP)("[External Order] Load Order Details Failure",(0,m.xk)()),payExternalOrder:(0,m.VP)("[External Order] Pay Order",(0,m.xk)()),savePayment:(0,m.VP)("[External Order] Save Payment",(0,m.xk)()),savePaymentSuccess:(0,m.VP)("[External Order] Save Payment Success",(0,m.xk)()),savePaymentFailure:(0,m.VP)("[External Order] Save Payment Failure")},j=(0,m.VG)({name:"externalOrderPay",reducer:(0,m.vy)({externalOrderDetailsData:void 0},(0,m.on)(c.loadExternalOrderDetails,(t,i)=>({...t,externalOrderDetailsData:(0,_.am)(t.externalOrderDetailsData)})),(0,m.on)(c.loadExternalOrderDetailsSuccess,(t,i)=>({...t,externalOrderDetailsData:(0,_.xl)({orderDetails:i.orderDetails,store:i.store})})),(0,m.on)(c.loadExternalOrderDetailsFailure,(t,i)=>({...t,externalOrderDetailsData:(0,_.Y4)(t.externalOrderDetailsData,i.errors)})))}),{selectExternalOrderDetailsData:C}=j;let ue=(()=>{class t{constructor(){this.ResponseErrorCode=ne.D;const r=(0,l.WQX)(m.il);this.externalOrderDetailsData$=r.select(C)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-external-order-pay-wrapper"]],decls:6,vars:9,consts:[[3,"dataFromServer","responseErrorCodes404"],["projected-404-error",""]],template:function(o,n){1&o&&(e.j41(0,"yp-data-from-server",0),e.nI1(1,"async"),e.nI1(2,"ypNotNull"),e.qex(3,1),e.EFF(4),e.nI1(5,"translate"),e.bVm(),e.k0s()),2&o&&(e.Y8G("dataFromServer",e.bMT(2,5,e.bMT(1,3,n.externalOrderDetailsData$)))("responseErrorCodes404",n.ResponseErrorCode.orderNotFound),e.R7$(4),e.JRh(e.bMT(5,7,"TABLE_ORDER.NOT_FOUND.ORDER")))},dependencies:[ce,V.Jj,A.D9,X.T],encapsulation:2,changeDetection:0})}}return t})();var f=a(89417),he=a(36665),fe=a(26920),ve=a(99213),Y=a(39204),v=a(96354),M=a(84572),Te=a(44668),Pe=a(99172),Ie=a(15307),U=a(80607),W=a(73405),Ce=a(37626),Ee=a(23070),xe=a(63639),g=a(28934),x=a(64683),Oe=a(42707),Se=a(54653),Fe=a(72627),Re=a(30987),ge=a(66076),Q=a(7843),De=a(38347),be=a(66566);const Ae=["paymentTypeLabel"],_e=t=>({value:t});function Me(t,i){1&t&&(e.j41(0,"h6",2),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"TABLE_ORDER.ONLINE_PAYMENT_NOT_AVAILABLE")," "))}function $e(t,i){if(1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t){e.XpG
1(2);const r=e.r8f(9);e.SpI(" ",e.i5U(1,1,"COMMON.NUMBER_SYMBOL_WITH_VALUE",e.eq3(4,_e,r.orderNumber))," ")}}function Le(t,i){1&t&&e.nrm(0,"hr")}function Ge(t,i){if(1&t&&(e.nVh(0,Le,1,0,"hr"),e.nrm(1,"yp-selected-cart-item-details",18)),2&t){const r=i.$implicit;e.vxM(0!==i.$index?0:-1),e.R7$(),e.Y8G("orderItemViewInfo",r)}}function Ne(t,i){if(1&t&&(e.j41(0,"mat-radio-button",23),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const r=i.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",e.bMT(2,2,"PAYMENT_OPTION."+r.paymentOptionType)," ")}}function Ve(t,i){1&t&&(e.j41(0,"mat-error",24),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"CHECKOUT.PAYMENT_TYPE.REQUIRED")))}function Xe(t,i){if(1&t&&(e.j41(0,"div",20)(1,"label",21,1),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"mat-radio-group",22),e.Z7z(6,Ne,3,4,"mat-radio-button",23,e.fX1),e.k0s(),e.nVh(8,Ve,3,3,"mat-error",24),e.k0s()),2&t){const r=e.XpG(3),o=e.r8f(6);e.R7$(3),e.SpI(" ",e.bMT(4,3,"CHECKOUT.PAYMENT_TYPE.LABEL")," "),e.R7$(2),e.Y8G("formControl",r.orderToPayForm.controls.paymentInfo),e.R7$(),e.Dyx(o),e.R7$(2),e.vxM(r.orderToPayForm.controls.paymentInfo.invalid&&(r.orderToPayForm.controls.paymentInfo.touched||r.orderToPayForm.controls.paymentInfo.dirty)?8:-1)}}function je(t,i){if(1&t&&(e.j41(0,"div",20)(1,"label",20),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"yp-tips",25),e.k0s()),2&t){const r=e.XpG(3),o=e.r8f(3),n=e.r8f(12);e.R7$(2),e.JRh(e.bMT(3,4,"CHECKOUT.TIPS.LABEL")),e.R7$(2),e.Y8G("baseAmountForTipsInCents",n)("tipPercentValues",o.storeTipSetting.tipPercentValues)("formControl",r.orderToPayForm.controls.tipsInCents)}}function Ye(t,i){if(1&t&&(e.j41(0,"div",10)(1,"div",14)(2,"form",19),e.nVh(3,Xe,9,5,"div",20),e.nVh(4,je,5,6,"div",20),e.k0s()()()),2&t){const r=e.XpG(2),o=e.r8f(3),n=e.r8f(6);e.R7$(2),e.Y8G("formGroup",r.orderToPayForm),e.R7$(),e.vxM(n.length>1?3:-1),e.R7$(),e.vxM(o.storeTipSetting?4:-1)}}function Ue(t,i){if(1&t&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"ypCurrency"),e.k0s()),2&t){const r=e.XpG(3),o=e.r8f(9);e.AVh("fw-bolder",!r.orderToPayForm.controls.tipsInCents.value),e.R7$(),e.Lme(" ",e.bMT(2,4,"SHOPPING_CART.TOTAL"),": ",e.bMT(3,6,o.amountInCents)," ")}}function We(t,i){if(1&t&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"ypCurrency"),e.k0s()),2&t){const r=e.XpG(3),o=e.r8f(9);e.AVh("fw-bolder",!r.orderToPayForm.controls.tipsInCents.value),e.R7$(),e.Lme(" ",e.bMT(2,4,"TABLE_ORDER.AMOUNT_TO_PAY"),": ",e.bMT(3,6,o.amountInCents-o.orderPaidAmountInCents)," ")}}function Qe(t,i){if(1&t&&(e.j41(0,"div",28),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"ypCurrency"),e.k0s()),2&t){const r=e.XpG(3),o=e.r8f(9);e.R7$(),e.Lme(" ",e.bMT(2,2,"TABLE_ORDER.DETAILS.YOU_PAY"),": ",e.bMT(3,4,o.amountInCents-o.orderPaidAmountInCents+r.orderToPayForm.controls.tipsInCents.value)," ")}}function Be(t,i){if(1&t&&(e.EFF(0),e.nI1(1,"ypCurrency")),2&t){e.XpG
1(3);const r=e.r8f(15);e.SpI(" ",e.bMT(1,1,r)," ")}}function He(t,i){if(1&t){const r=e.RV6();e.j41(0,"div",17)(1,"div",26),e.nVh(2,Ue,4,8,"div",27)(3,We,4,8,"div",27),e.nVh(4,Qe,4,6,"div",28),e.j41(5,"button",29),e.bIt("click",function(){l.eBV(r);const n=e.XpG(2),s=e.sdS(21);return l.Njj(n.showOrderAmountDetails(s))}),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.j41(8,"div",30)(9,"button",31),e.bIt("click",function(){l.eBV(r);const n=e.XpG(2);return l.Njj(n.payOrder())}),e.EFF(10),e.nI1(11,"translate"),e.nVh(12,Be,2,3),e.k0s()()()}if(2&t){const r=e.XpG(2),o=e.r8f(9),n=e.r8f(15);e.R7$(2),e.vxM(0===o.orderPaidAmountInCents?2:3),e.R7$(2),e.vxM(r.orderToPayForm.controls.tipsInCents.value?4:-1),e.R7$(2),e.SpI(" ",e.bMT(7,6,"CHECKOUT.DETAILS.MORE_DETAILS.LABEL")," "),e.R7$(3),e.Y8G("disabled",!n),e.R7$(),e.SpI(" ",e.bMT(11,8,"TABLE_ORDER.DETAILS.PAY")," "),e.R7$(2),e.vxM(r.orderToPayForm.valid&&n>0?12:-1)}}function ze(t,i){if(1&t&&(e.j41(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7),e.nrm(5,"yp-image",8),e.k0s()()(),e.j41(6,"div",9)(7,"div",10),e.nrm(8,"div",11),e.j41(9,"div",12)(10,"h2"),e.EFF(11),e.nI1(12,"translate"),e.nV
1h(13,$e,2,6),e.k0s(),e.j41(14,"div",13),e.EFF(15),e.nI1(16,"translate"),e.k0s()(),e.j41(17,"div",14),e.nrm(18,"hr"),e.j41(19,"div",15),e.nrm(20,"mat-icon",16),e.nI1(21,"ypIconOrderStatus"),e.EFF(22),e.nI1(23,"translate"),e.k0s(),e.nrm(24,"hr"),e.Z7z(25,Ge,2,2,null,null,e.fX1),e.k0s()(),e.nVh(27,Ye,5,3,"div",10),e.k0s()(),e.nVh(28,He,13,10,"div",17),e.k0s()),2&t){const r=e.XpG(),o=e.r8f(0),n=e.r8f(3),s=e.r8f(6),d=e.r8f(9),p=e.r8f(12);e.R7$(5),e.Y8G("image",o.squareLogo)("imageSize",r.ImageSize.sm)("imageAspectRatio",r.AspectRatio.aspectRatio1x1)("imageFileFormat",r.ImageFileFormat.png),e.R7$(6),e.SpI(" ",e.bMT(12,11,"TABLE_ORDER.DETAILS.TITLE")," "),e.R7$(2),e.vxM(d.orderNumber?13:-1),e.R7$(2),e.SpI(" ",e.bMT(16,13,"ORDER_TYPES.ORDER_TYPE_"+d.orderType)," "),e.R7$(5),e.Y8G("svgIcon",e.bMT(21,15,d.status)),e.R7$(2),e.SpI(" ",e.bMT(23,17,"ORDER_STATUSES.ORDER_STATUS_"+d.status)," "),e.R7$(3),e.Dyx(d.orderItemsInfo),e.R7$(2),e.vxM(p>0&&(n.storeTipSetting||s.length>1)?27:-1),e.R7$(),e.vxM(p>0?28:-1)}}function ke(t,i){if(1&t&&e.nrm(0,"yp-base-order-price-details",32),2&t){e.XpG();const r=e.r8f(3),o=e.r8f(9);e.Y8G("baseOrderDetails",o)("showTips",void 0!==r.storeTipSetting)("showLeftToPayAmount",!1)}}let Je=(()=>{class t{constructor(){this.ImageSize=xe.h,this.ImageFileFormat=Ee.F,this.AspectRatio=Ce.g,this.tenant=(0,l.WQX)(Ie.$),this.paymentTypeLabelElementRef=(0,R.ebz)("paymentTypeLabel",{read:e.aKT}),this.orderToPayForm=new f.gE({paymentInfo:new f.MJ(null,f.k0.required),tipsInCents:new f.MJ(null)}),this.store=(0,l.WQX)(m.il),this.matBottomSheet=(0,l.WQX)(he.VK);const r=(0,l.WQX)(g.z,{self:!0}),o=this.store.select(C).pipe((0,v.T)(n=>n?.data),(0,x.eU)());this.customerWebSettings$=this.store.select(be.gd).pipe((0,x.eU)()),this.orderDetails$=o.pipe((0,v.T)(n=>n.orderDetails)),this.store$=o.pipe((0,v.T)(n=>n.store)),this.availablePaymentOptions$=(0,M.z)([this.orderDetails$,this.store$]).pipe((0,v.T)(([n,s])=>{const d=[],p=s.orderTypes.find(T=>T.orderType===n.orderType);if(p)for(const T of p.paymentTypes)switch(T){case W.d.mobile:d.push({paymentOptionType:U.Y.cardOnline});break;case W.d.sbp:d.push({paymentOptionType:U.Y.sbp})}else console.warn("[YP]",`Online payment is not available for this order, because order type ${n.orderType} is not available for current store anymore.`);return d}),(0,Te.t)({refCount:!0,bufferSize:1})),this.amountLeftToPayInCents$=this.orderDetails$.pipe((0,v.T)(n=>{let s=0;return n.amountInCents-n.orderPaidAmountInCents>0&&(s+=n.amountInCents-n.orderPaidAmountInCents),s})),this.amountToPayWithTipsInCents$=(0,M.z)([this.amountLeftToPayInCents$,this.orderToPayForm.controls.tipsInCents.valueChanges.pipe((0,Pe.Z)(null))]).pipe((0,v.T)(([n,s])=>{let d=n;return s&&(d+=s),d})),r.sink=this.availablePaymentOptions$.subscribe(n=>{if(this.orderToPayForm.controls.paymentInfo.value){const s=this.orderToPayForm.controls.paymentInfo.value,d=n.find(p=>(0,Oe.eG)(p,s));d?this.orderToPayForm.controls.paymentInfo.setValue(d,{emitEvent:!1}):this.orderToPayForm.controls.paymentInfo.setValue(null,{emitEvent:!0})}else 1===n.length&&this.orderToPayForm.controls.paymentInfo.setValue(n[0],{emitEvent:!0})})}payOrder(){if(this.orderToPayForm.invalid)this.orderToPayForm.markAllAsTouched(),this.orderToPayForm.controls.paymentInfo.invalid&&this.paymentTypeLabelElementRef()?.nativeElement.scrollIntoView({block:"start",behavior:"smooth"});else{let r;null!==this.orderToPayForm.controls.tipsInCents.value&&(r=this.orderToPayForm.controls.tipsInCents.value),(0,E.HO)(this.orderToPayForm.controls.paymentInfo.value),this.store.dispatch(c.payExternalOrder({paymentInfo:this.orderToPayForm.controls.paymentInfo.value,tipsAmountInCents:r}))}}showOrderAmountDetails(r){this.matBottomSheet.open(r,{autoFocus:"first-tabbable"})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-external-order-pay"]],viewQuery:function(o,n){1&o&&e.wEZ(n.paymentTypeLabelElementRef,Ae,5,e.aKT),2&o&&e.NyB()},features:[e.Jv_([g.z])],decls:22,vars:31,consts:[["templateOrderAmountDetails",""],["paymentTypeLabel",""],[1,"my-5","mx-3","text-center"],[1,"h-100","d-flex","flex-column"],[1,"flex-grow-1"],[1,"mt-5","d-flex","justify-content-center"],[1,"half-crossed-logo-container"],[1,"half-crossed-logo-wrapper"],[3,"image","imageSize","imageAspectRatio","imageFileFormat"],[1,"cards-container"],[1,"yp-card"],[1,"half-crossed-logo-spacer"],[1,"d-flex","justify-content-between","gap-2","yp-card-title"],[1,"fs-4","fw-normal"],[1,"yp-card-content"],[1,"yp-card-row"],[1,"yp-card-row-icon",3,"svgIcon"],[1,"p-3"],[3,"orderItemViewInfo"],["novalidate","",3,"formGroup"],[1,"mb-2"],["id","external-order-details-payment-type-radio-group-label"],["aria-labelledby","external-order-details-payment-type-radio-group-label",1,"d-flex","flex-column",3,"formControl"],[3,"value"],[1,"ps-3","fs-3"],[3,"baseAmountForTipsInCents","tipPercentValues","formControl"],[1,"mb-4"],[3,"fw-bolder"],[1,"fw-bolder"],["type","button",1,"yp-btn","yp-btn-sm","yp-btn-link","p-0",3,"click"],[1,"yp-bottom-buttons-wrapper"],["type","button",1,"yp-btn","yp-btn-lg","yp-btn-primary",3,"click","disabled"],[3,"baseOrderDetails","showTips","showLeftToPayAmount"]],template:function(o,n){if(1&o&&(e.SS7(0),e.nI1(1,"async"),e.nI1(2,"ypNotNull"),e.SS7(3),e.nI1(4,"async"),e.nI1(5,"ypNotNull"),e.SS7(6),e.nI1(7,"async"),e.nI1(8,"ypNotNull"),e.SS7(9),e.nI1(10,"async"),e.nI1(11,"ypNotNull"),e.SS7(12),e.nI1(13,"async"),e.nI1(14,"ypNotNull"),e.SS7(15),e.nI1(16,"async"),e.nI1(17,"ypNotNull"),e.nV
1h(18,Me,3,3,"h6",2)(19,ze,29,19,"div",3),e.DNE(20,ke,1,3,"ng-template",null,0,e.C5r)),2&o){e.bH3(e.bMT(2,3,e.bMT(1,1,n.customerWebSettings$))),e.R7$(3),e.bH3(e.bMT(5,8,e.bMT(4,6,n.store$))),e.R7$(3);const s=e.bH3(e.bMT(8,13,e.bMT(7,11,n.availablePaymentOptions$)));e.R7$(3),e.bH3(e.bMT(11,18,e.bMT(10,16,n.orderDetails$))),e.R7$(3),e.bH3(e.bMT(14,23,e.bMT(13,21,n.amountLeftToPayInCents$))),e.R7$(3),e.bH3(e.bMT(17,28,e.bMT(16,26,n.amountToPayWithTipsInCents$))),e.R7$(3),e.vxM(0===s.length?18:19)}},dependencies:[f.X1,f.qT,f.BC,f.cb,f.l_,f.j4,Y._g,Y.VT,fe.TL,ge.G,Se.G,Fe.h,Re.Y,ve.An,V.Jj,Q.o,A.D9,X.T,De.K],styles:["[_nghost-%COMP%]{--bs-border-style: dotted}mat-error[_ngcontent-%COMP%]{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}"],changeDetection:0})}}return t})();var Ke=a(60177),we=a(9183),Ze=a(93049),qe=a(65873),et=a(6716),tt=a(99627),B=a(30995);const nt=t=>({paymentAmount:t}),rt=()=>["../../"];function ot(t,i){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,"SHOPPING_CART.PAYMENT_IN_PROCESS")," ")}function at(t,i){if(1&t&&(e.EFF(0),e.nI1(1,"ypCurrency"),e.nI1(2,"translate")),2&t){const r=e.XpG();e.SpI(" ",e.i5U(2,3,"TABLE_ORDER.PAYMENT_RESULT.SUCCESS",e.eq3(6,nt,e.bMT(1,1,r.paymentResult.paymentAmountInCents)))," ")}}function st(t,i){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,"TABLE_ORDER.PAYMENT_RESULT.FAILURE")," ")}function it(t,i){1&t&&e.nrm(0,"mat-spinner",4)}function lt(t,i){1&t&&e.nrm(0,"yp-checkmark-animation")}function dt(t,i){1&t&&(e.j41(0,"div",5)(1,"button",7),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t&&(e.R7$(),e.Y8G("routerLink",e.lJ4(4,rt)),e.R7$(),e.SpI(" ",e.bMT(3,2,"COMMON.OK")," "))}function mt(t,i){if(1&t&&e.DNE(0,dt,4,5,"div",6),2&t){const r=e.XpG();e.Y8G("ypProjectedFooter",r.AppLayoutFooterIndex.firstLevel)}}let pt=(()=>{class t{constructor(){this.AppLayoutFooterIndex=et.J,this.activatedRoute=(0,l.WQX)(F.nX),this.spinnerService=(0,l.WQX)(qe.D),(0,E.De)(!(0,Ke.Vy)((0,l.WQX)(e.Agw)));const r=(0,l.WQX)(m.il),o=(0,l.WQX)(u.En),n=(0,l.WQX)(R.gRc),s=(0,l.WQX)(g.z,{self:!0});(0,M.z)([this.activatedRoute.queryParamMap,this.activatedRoute.paramMap]).pipe((0,b.$)()).subscribe(([d,p])=>{s.sink=o.pipe((0,u.gp)(c.savePaymentSuccess,c.savePaymentFailure)).subscribe(I=>{this.spinnerService.decrementCustomSpinnersCount(),this.paymentResult=I.type===c.savePaymentSuccess.type?{isPaymentSuccess:!0,paymentAmountInCents:I.paymentAmountInCents}:{isPaymentSuccess:!1},n.markForCheck()});const T=d.get("yTransactionId")??void 0,h=p.get(y.G.externalOrderPay.children.param.orderId.children.savePayment.children.param.partialPaymentId.name)??void 0;(0,E.iY)(h),r.dispatch(c.savePayment({partialPaymentId:h,transactionId:T})),this.spinnerService.incrementCustomSpinnersCount()})}ngOnDestroy(){void 0===this.paymentResult&&this.spinnerService.decrementCustomSpinnersCount()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-external-order-save-payment"]],features:[e.Jv_([g.z])],decls:10,vars:4,consts:[[3,"footerUnderflowEnabled"],[1,"m-4"],[1,"text-center","mb-5"],[1,"text-center","pt-5"],[1,"d-inline-block"],[1,"yp-bottom-buttons-wrapper"],["class","yp-bottom-buttons-wrapper",4,"ypProjectedFooter"],["type","button",1,"yp-btn","yp-btn-lg","yp-btn-primary",3,"routerLink"]],template:function(o,n){1&o&&(e.j41(0,"yp-fixed-header-footer",0)(1,"div",1)(2,"h1",2),e.nVh(3,ot,2,3)(4,at,3,8)(5,st,2,3),e.k0s(),e.j41(6,"div",3),e.nVh(7,it,1,0,"mat-spinner",4)(8,lt,1,0,"yp-checkmark-animation"),e.k0s()(),e.nVh(9,mt,1,1,"div",5),e.k0s()),2&o&&(e.Y8G("footerUnderflowEnabled",!0),e.R7$(3),e.vxM(void 0===n.paymentResult?3:n.paymentResult.isPaymentSuccess?4:5),e.R7$(4),e.vxM(void 0===n.paymentResult?7:n.paymentResult.isPaymentSuccess?8:-1),e.R7$(2),e.vxM(n.paymentResult?9:-1))},dependencies:[f.X1,tt.o,B.cU,we.LG,B.J0,Ze.Wk,Q.o,A.D9],encapsulation:2,changeDetection:0})}}return t})();var H=a(10467),ct=a(54843);const yt=function(){var t=(0,H.A)(function*(i,r){const o=(0,l.WQX)(m.il),n=i.paramMap.get(y.G.externalOrderPay.children.param.orderId.name)??void 0;void 0!==n&&(o.dispatch(c.loadExternalOrderDetails({orderId:n})),yield(0,ct._)(o.select(C).pipe((0,b.$)(s=>!!s&&0!==s.status))))});return function(r,o){return t.apply(this,arguments)}}();var $=a(46822),O=a(25558),ut=a(99437),ht=a(7673),ft=a(22806),z=a(86884),vt=a(72684),Tt=a(80394),S=a(72771),Pt=a(49655),It=a(55665),L=a(90197),Ct=a(53103);let Et=(()=>{class t{constructor(){var r=this;this.document=(0,l.WQX)(l.qQL),this.store=(0,l.WQX)(m.il),this.actions=(0,l.WQX)(u.En),this.ordersHttpService=(0,l.WQX)(vt.f),this.storesHttpService=(0,l.WQX)(Tt.I),this.paymentService=(0,l.WQX)(S.W),this.loadExternalOrderDetails$=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(c.loadExternalOrderDetails),(0,O.n)(o=>this.ordersHttpService.getOrderDetails(o.orderId,z.Q.mainScreenArea).pipe((0,O.n)(n=>this.storesHttpService.getStoreById(n.storeId,z.Q.mainScreenArea).pipe((0,v.T)(s=>c.loadExternalOrderDetailsSuccess({orderDetails:n,store:s})))),(0,ut.W)(n=>(0,ht.of)(c.loadExternalOrderDetailsFailure({errors:(0,Pt.HH)(n)}))))))),this.payExternalOrder$=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(c.payExternalOrder),(0,$.YQ)(()=>[this.store.select(C).pipe((0,v.T)(o=>o?.data),(0,x.eU)())]),(0,O.n)(([o,{store:n,orderDetails:s}])=>{(0,E.iY)(n.paymentProcessorType);let d=0;s.amountInCents>s.orderPaidAmountInCents&&(d=s.amountInCents-s.orderPaidAmountInCents);const p=N.w.generateUuid(),T=this.paymentService.processPayment({paymentProcessorType:n.paymentProcessorType,orderId:s.orderId,storeId:s.storeId,storeName:n.storeName,amountToPayInCents:d,expectedAmountToPayInCents:void 0,tipsInCents:o.tipsAmountInCents,orderPaymentInfo:o.paymentInfo,partialPaymentId:p,itemsToPay:void 0,processPaymentPath:{commands:["/",y.G.externalOrderPay.path,s.orderId,y.G.externalOrderPay.children.param.orderId.children.redirect.path,p]},processPaymentCallbackUrl:It.Q.getDocumentLocationOrigin(this.document)+"/"+y.G.externalOrderPay.path+"/"+s.orderId+"/"+y.G.externalOrderPay.children.param.orderId.children.savePayment.path+"/"+p});return(0,ft.H)(T).pipe((0,O.n)(h=>{const I=[];if(void 0!==h&&h.paymentStatus!==S.d.thirdPartyRedirect){const k=["/",y.G.externalOrderPay.path,s.orderId],J=[...k,y.G.externalOrderPay.children.param.orderId.children.savePayment.path,p];if(h.paymentStatus===S.d.success)I.push(L.X.navigateTo(J,{queryParams:{yTransactionId:h.transactionId}}));else if(h.paymentStatus===S.d.cancel)h.changePaymentTypeRequested&&I.push(L.X.navigateTo(k));else{if(h.paymentStatus===S.d.amountToPayIsNotExpected)throw new Error("Unexpected payment result status in payExternalOrder$: amount to pay is not expected. Implementation missing.");I.push(h.showErrors?.length?Ct.m.showDialogErrors(h.showErrors):L.X.navigateTo(J))}}return I}))}))),this.savePayment$=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(c.savePayment),(0,$.YQ)(()=>[this.store.select(C).pipe((0,v.T)(o=>o?.data),(0,x.eU)())]),(0,O.n)(function(){var o=(0,H.A)(function*([n,{store:s,orderDetails:d}]){let p;const T=yield r.paymentService.savePayment(d.orderId,s.storeId,n.transactionId,n.partialPaymentId);return p=T?c.savePaymentSuccess({paymentAmountInCents:T.paymentAmountInCents??d.orderPaidAmountInCents+d.tipsPaidAmountInCents}):c.savePaymentFailure(),p});return function(n){return o.apply(this,arguments)}}()))),this.reloadOrderDetails$=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(c.savePaymentSuccess,c.savePaymentFailure),(0,$.YQ)(()=>[this.store.select(C).pipe((0,v.T)(o=>o?.data),(0,x.eU)())]),(0,v.T)(([o,{orderDetails:n}])=>c.loadExternalOrderDetails({orderId:n.orderId}))))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=l.jDH({token:t,factory:t.\u0275fac})}}return t})();const xt=[{path:":"+y.G.externalOrderPay.children.param.orderId.name,component:ue,canMatch:[D()],resolve:[yt],providers:[(0,m.vQ)(j),(0,u.SI)(Et)],children:[{path:"",component:Je},{path:y.G.externalOrderPay.children.param.orderId.children.redirect.path+"/:"+y.G.externalOrderPay.children.param.orderId.children.redirect.children.param.partialPaymentId.name,component:te,canMatch:[D(1)]},{path:y.G.externalOrderPay.children.param.orderId.children.savePayment.path+"/:"+y.G.externalOrderPay.children.param.orderId.children.savePayment.children.param.partialPaymentId.name,component:pt,canMatch:[D(1)]}]},{path:"**",component:G.PageNotFoundComponent,resolve:[w.p],data:y.G.pageNotFound.metaData}
1]}}]);
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.