1import{a as ce}from"./chunk-WSL5YNVE.js";import{a as ae}from"./chunk-ZL7WPGBI.js";import{a as ie,b as oe,c as se,e as re}from"./chunk-HTCLTJ5C.js";import{a as te,b as ne}from"./chunk-F3G5R5SN.js";import"./chunk-OWKN33XV.js";import"./chunk-GAX33WGZ.js";import"./chunk-DP5WGZUE.js";import{a as ee}from"./chunk-PPF4CICK.js";import"./chunk-W3NUKB7B.js";import"./chunk-KJJHSOFJ.js";import{d as Q,ja as W,la as X,ma as Y,pa as T,qa as U,ra as Z}from"./chunk-TPCL2XMH.js";import"./chunk-WRBQWUEI.js";import{n as J}from"./chunk-KSTBAVB4.js";import{Ab as r,Ac as y,Bb as o,Cb as P,Cd as K,D as C,Db as M,Dc as V,Eb as A,Ec as E,Fb as j,Lb as S,Nb as x,Ob as $,Pb as c,Ra as s,Z as k,_b as G,a as q,ac as a,bc as b,bd as z,cc as B,da as u,ea as _,eb as w,fd as H,pa as D,sb as d,sc as h,tc as L,ub as p,uc as g,wb as I,xb as O,ya as R,yb as F,zb as v}from"./chunk-P2OBJROK.js";import"./chunk-IZQOVDKO.js";import"./chunk-6IZLXKZM.js";function me(t,l){t&1&&j(0,"hr",5)}function ue(t,l){if(t&1){let e=S();M(0,"a",8),$("click",function(){u(e);let n=c().$implicit,m=c(2);return _(m.removeVoucher(n))}),a(1,"\xD7"),A()}}function _e(t,l){if(t&1&&(d(0,me,1,0,"hr",5),M(1,"div",6)(2,"span"),a(3),A(),d(4,ue,2,0,"a",7),A()),t&2){let e=l.$implicit,i=l.$index,n=c(2);p(i>0?0:-1),s(3),B(" ",e.name," "),s(),p(n.basket().isPaying?-1:4)}}function he(t,l){if(t&1&&(M(0,"ul",0)(1,"li",1)(2,"div",2)(3,"strong",3),a(4,"Vouchers"),A(),M(5,"div",4),O(6,_e,5,3,null,null,I),A()()()()),t&2){let e=c();s(6),F(e.vouchers())}}var de=(()=>{class t{constructor(){this.basket=E(void 0),this.vouchers=E(void 0),this.deleteVoucher=V()}removeVoucher(e){this.deleteVoucher.emit(e)}VoucherProduct(e){return e.name}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=w({type:t,selectors:[["nbm-voucher-display"]],inputs:{basket:[1,"basket"],vouchers:[1,"vouchers"]},outputs:{deleteVoucher:"deleteVoucher"},decls:1,vars:1,consts:[[1,"list-group","mb-3"],[1,"list-group-item"],[1,"d-flex","w-100","justify-content-between","align-items-center"],[1,"m-0"],[1,"ml-3","d-flex","flex-column"],[1,"bg-grey","my-2","w-100",2,"height","1px"],[1,"d-flex","align-items-center"],[1,"btn","btn-sm","btn-link","text-danger","ml-2"],[1,"btn","btn-sm","btn-link","text-danger","ml-2",3,"click"]],template:function(i,n){i&1&&d(0,he,8,0,"ul",0),i&2&&p(n.vouchers()&&n.vouchers().length>0?0:-1)},encapsulation:2})}}return t})();function Ce(t,l){if(t&1&&(r(0,"del"),a(1),h(2,"currency"),o(),P(3,"br")),t&2){let e=c().$implicit;s(),b(g(2,1,e.subtotalPreDiscount.price,"GBP"))}}function ge(t,l){t&1&&(r(0,"div",15),P(1,"i",16),a(2,"This is a pre-order item "),o())}function be(t,l){if(t&1&&(r(0,"li",5)(1,"div",11)(2,"span",12),a(3),o(),r(4,"small",14),d(5,Ce,4,4),a(6),h(7,"currency"),o()(),d(8,ge,3,0,"div",15),o()),t&2){let e=l.$implicit;s(3),b(e.name),s(2),p(e.hasDiscount?5:-1),s(),B(" ",g(7,4,e.subtotal.price,"GBP")," "),s(2),p(e.released?-1:8)}}function fe(t,l){if(t&1&&(r(0,"li",5)(1,"div",11),P(2,"nbm-user-address-display",17),o()()),t&2){let e=c();s(2),v("address",e.basket().billingAddress)("inline",!0)}}function ve(t,l){if(t&1&&(r(0,"div",3),a(1,"Shipping Address"),o(),r(2,"li",5)(3,"div",11),P(4,"nbm-user-address-display",17),o()()),t&2){let e=c();s(4),v("address",e.basket().shippingAddress)("inline",!0)}}function xe(t,l){if(t&1&&(r(0,"ul",9)(1,"li",5),P(2,"nbm-discount-form",18),o()()),t&2){let e=c();s(2),v("basket",e.basket())}}function Se(t,l){if(t&1&&(r(0,"li",5)(1,"div",11)(2,"span",12),a(3,"Items"),o(),r(4,"span"),a(5),h(6,"currency"),o()()(),r(7,"li",5)(8,"div",11)(9,"span",12),a(10,"Discount"),o(),r(11,"span"),a(12),h(13,"currency"),o()()()),t&2){let e=c();s(5),b(g(6,2,e.basket().subtotalPreDiscount.price,"GBP")),s(7),b(g(13,5,-e.basket().subtotalDiscount.price,"GBP"))}}function ye(t,l){if(t&1&&a(0),t&2){let e=c(2);B(" (",e.basket().shippingOption.name,") ")}}function ke(t,l){if(t&1&&(r(0,"span"),a(1),h(2,"currency"),o()),t&2){let e=c(3);s(),b(g(2,1,e.basket().shippingOption.price.price,"GBP"))}}function De(t,l){if(t&1&&(r(0,"span")(1,"del"),a(2),h(3,"currency"),o(),a(4),h(5,"currency"),o()),t&2){let e=c(3);s(2),b(g(3,2,e.basket().shippingOption.price.price,"GBP")),s(2),B(" ",g(5,5,e.basket().shippingTotal.price,"GBP"))}}function Pe(t,l){if(t&1&&(r(0,"div"),d(1,ke,3,4,"span"),d(2,De,6,8,"span"),o()),t&2){let e=c(2);s(),p(e.basket().hasShippingTotalDiscount?-1:1),s(),p(e.basket().hasShippingTotalDiscount?2:-1)}}function Be(t,l){t&1&&(r(0,"span")(1,"i"),a(2,"Calculated based on shipping address"),o()())}
1function Te(t,l){if(t&1&&(r(0,"li",5)(1,"div",11)(2,"span",12),a(3,"Shipping "),d(4,ye,1,1),o(),d(5,Pe,3,2,"div")(6,Be,3,0,"span"),o()()),t&2){let e=c();s(4),p(e.basket().shippingOption?4:-1),s(),p(e.basket().shippingOption?5:6)}}function we(t,l){t&1&&a(0," every month for a minimum of 12 months ")}function Ae(t,l){t&1&&a(0," annually ")}function Ee(t,l){if(t&1&&(r(0,"li",5)(1,"div",11)(2,"span",19),a(3),h(4,"dayjsDate"),d(5,we,1,0),d(6,Ae,1,0),o(),r(7,"span"),a(8),h(9,"currency"),o()()()),t&2){let e=c();s(3),B(" Recurring from ",L(4,4,e.basket().recurring.date)," "),s(2),p(e.basket().recurring.frequency==="Monthly"?5:-1),s(),p(e.basket().recurring.frequency==="Annual"?6:-1),s(2),b(g(9,6,e.basket().recurring.amount.price,"GBP"))}}function Me(t,l){t&1&&a(0," today ")}function Ve(t,l){if(t&1&&(r(0,"li",5)(1,"div",20)(2,"span",12),a(3,"Total "),d(4,Me,1,0),o(),r(5,"span"),a(6),h(7,"currency"),o()()(),r(8,"li",5)(9,"div",11)(10,"span",12),a(11,"Store Credit"),o(),r(12,"span"),a(13),h(14,"currency"),o()()(),r(15,"li",13)(16,"div",21)(17,"span",12),a(18,"Balance to Pay "),o(),r(19,"span"),a(20),h(21,"currency"),o()()()),t&2){let e=c();s(4),p(e.basket().recurring?4:-1),s(2),b(g(7,4,e.basket().total.price,"GBP")),s(7),b(g(14,7,-e.basket().storeCredit,"GBP")),s(7),b(g(21,10,e.basket().balanceToPay,"GBP"))}}function Ie(t,l){t&1&&a(0," today ")}function Oe(t,l){if(t&1&&(r(0,"li",13)(1,"div",21)(2,"span",12),a(3,"Total "),d(4,Ie,1,0),o(),r(5,"span"),a(6),h(7,"currency"),o()()()),t&2){let e=c();s(4),p(e.basket().recurring?4:-1),s(2),b(g(7,2,e.basket().total.price,"GBP"))}}var pe=(()=>{class t{constructor(){this.basket=E(void 0),this.vouchers=E(void 0),this.deleteDiscount=V(),this.deleteVoucher=V()}removeDiscount(e){this.deleteDiscount.emit(e)}removeVoucher(e){this.deleteVoucher.emit(e)}get anyCredit(){return this.basket().storeCredit!==0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=w({type:t,selectors:[["nbm-mini-basket"]],inputs:{basket:[1,"basket"],vouchers:[1,"vouchers"]},outputs:{deleteDiscount:"deleteDiscount",deleteVoucher:"deleteVoucher"},decls:34,vars:14,consts:[[1,"mb-3","mx-3","mt-3","mt-lg-0","rounded","border","border-dark"],[1,"h5","mb-3","bg-dark","p-3","text-white"],[1,"card","mb-3","mx-2"],[1,"h6","card-header"],[1,"list-group","list-group-flush"],[1,"list-group-item"],[1,"list-group"],[3,"deleteVoucher","basket","vouchers"],[3,"deleteDiscount","basket"],[1,"list-group","mb-3","mx-2"],[1,"card-header","h6"],[1,"d-flex","w-100","justify-content-between","align-items-center"],[1,"m-0"],[1,"list-group-item","p-0"],[1,"ms-2","text-end"],[1,"mt-2","h6","bg-info","text-white","rounded","ps-2","py-2"],[1,"icon-1x","icon-info-circle","me-3"],[3,"address","inline"],[3,"basket"],[1,"me-3"],[1,"d-flex","w-100","justify-content-between","align-items-center","fw-bold"],[1,"d-flex","w-100","justify-content-between","align-items-center","fw-bold","card-header"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1),a(2,"Order Summary"),o(),r(3,"div",2)(4,"div",3),a(5,"Items"),o(),r(6,"ul",4),O(7,be,9,7,"li",5,I),o()(),r(9,"div",2)(10,"div",3),a(11,"Billing Address"),o(),r(12,"ul",6),d(13,fe,3,2,"li",5),d(14,ve,5,2),o()(),r(15,"nbm-voucher-display",7),x("deleteVoucher",function(N){return n.removeVoucher(N)}),o(),r(16,"nbm-discount-display",8),x("deleteDiscount",function(N){return n.removeDiscount(N)}),o(),d(17,xe,3,1,"ul",9),r(18,"div",2)(19,"div",10),a(20,"Summary"),o(),r(21,"ul",4),d(22,Se,14,8),r(23,"li",5)(24,"div",11)(25,"span",12),a(26,"Subtotal"),o(),r(27,"span"),a(28),h(29,"currency"),o()()(),d(30,Te,7,2,"li",5),d(31,Ee,10,9,"li",5),d(32,Ve,22,13)(33,Oe,8,5,"li",13),o()()()),i&2&&(s(7),F(n.basket().items),s(6),p(n.basket().billingAddress?13:-1),s(),p(n.basket().requiresShipping&&n.basket().shippingAddress?14:-1),s(),v("basket",n.basket())("vouchers",n.vouchers()),s(),v("basket",n.basket()),s(),p(n.basket().isPaying?-1:17),s(5),p(n.basket().hasSubtotalDiscount?22:-1),s(6),b(g(29,11,n.basket().subtotal.price,"GBP")),s(2),p(n.basket().requiresShipping?30:-1),s(),p(n.basket().recurring?31:-1),s(),p(n.anyCredit?32:33))},dependencies:[ee,se,re,de,z,X],encapsulation:2})}}return t})();function Fe(t,l){if(t&1){let e=S();r(0,"button",15),x("click",function(){u(e);let n=c(2);return _(n.goToBillingAddress())}),a(1,"Edit"),o()}}function Ge(t,l){if(t&1){let e=S();r(0,"div",9)(1,"nbm-billing-address",16),x("billingAddressSet",function(n){u(e);let m=c(2);return _(m.onBillingAddressSet(n))}),o()()}if(t&2){let e=c(2);s(),v("address",e.basket().billingAddress)("processing",e.processingBilling())}}function Ne(t,l){if(t&1){let e=S();r(0,"button",15),x("click",function(){u(e);let n=c(3);return _(n.goToShippingAddress())}),a(1,"Edit"),o()}}function Ue(t,l){if(t&1){let e=S();r(0,"div",9)(1,"nbm-shipping-address",17),x("shippingAddressSet",function(n){u(e);let m=c(3);return _(m.onShippingAddressSet(n))}),o()()}if(t&2){let e,i=c(3);s(),v("billingExists",i.basket().billingAddress!==null)("billingCountry",(e=i.basket().billingAddress)==null?null:e.country)("shippingSameAsBilling",i.basket().shippingAddressSameAsBillingAddress)("address",i.basket().shippingAddress)("processing",i.processingShipping())}}function qe(t,l){if(t&1&&(r(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7),a(4,"Step 2. Shipping Address"),o(),d(5,Ne,2,0,"button",8),o()(),d(6,Ue,2,5,"div",9),o()),t&2){let e=c(2);s(),G("border-bottom",e.isShippingAddress()),s(4),p(e.isShippingBackwardStep()&&e.canGoToShippingAddress()?5:-1),s(),p(e.isShippingAddress()?6:-1)}}function Re(t,l){t&1&&(r(0,"div",7),a(1,"Step 3. Payment Details"),o())}function je(t,l){t&1&&(r(0,"div",11),a(1,"Step 2. Payment Details"),o())}function $e(t,l){if(t&1){let e=S();r(0,"div",12)(1,"nbm-payment-form",18),x("contactPreferencesSet",function(n){u(e);let m=c(2);return _(m.onContactPreferencesSet(n))})("selectPaymentMethod",function(n){u(e);let m=c(2);return _(m.onSelectPaymentMethod(n))})("registerSetupIntent",function(){u(e);let n=c(2);return _(n.onRegisterSetupIntent())})("resetTransaction",function(){u(e);let n=c(2);return _(n.onResetTransaction())})("completeOrder",function(){u(e);let n=c(2);return _(n.onCompleteOrder())})("completeInvoiceOrder",function(n){u(e);let m=c(2);return _(m.onCompleteInvoiceOrder(n))})("completeOfflineOrder",function(n){u(e);let m=c(2);return _(m.onCompleteOfflineOrder(n))})("placeStoreCreditNBPlusOrder",function(){u(e);let n=c(2);return _(n.onPlaceStoreCreditNBPlusOrder())})("sendInvoice",function(n){u(e);let m=c(2);return _(m.onSendInvoice(n))})("createStripeInvoiceForUserBasket",function(n){u(e);let m=c(2);return _(m.onCreateStripeInvoiceForUserBasket(n))})("createOfflinePaymentInvoice",function(n){u(e);let m=c(2);return _(m.onCreateOfflinePaymentInvoice(n))})("chooseAnotherMethod",function(){u(e);let n=c(2);return _(n.onChooseAnotherMethod())})("paymentSuccess",function(n){u(e);let m=c(2);return _(m.onPaymentSuccess(n))})("paymentFailure",function(n){u(e);let m=c(2);return _(m.onPaymentFailure(n))}),o()()}if(t&2){let e=c(2);s(),v("basket",e.basket())("redirectUrl",e.redirectUrl)("processing",e.processingPayment())}}function Le(t,l){if(t&1){let e=S();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",7),a(7,"Step 1. Billing Address"),o(),d(8,Fe,2,0,"button",8),o()(),d(9,Ge,2,2,"div",9),o(),d(10,qe,7,4,"div",4),r(11,"div",10)(12,"div",5)(13,"div",6),d(14,Re,2,0,"div",7)(1
15,je,2,0,"div",11),o()(),d(16,$e,2,3,"div",12),o()()(),r(17,"div",13)(18,"nbm-mini-basket",14),x("deleteDiscount",function(n){u(e);let m=c();return _(m.onDeleteDiscount(n))})("deleteVoucher",function(n){u(e);let m=c();return _(m.onDeleteVoucher(n))}),o()()()}if(t&2){let e=c();s(4),G("border-bottom",e.isBillingAddress()),s(4),p(e.isBillingBackwardStep()&&e.canGoToBillingAddress()?8:-1),s(),p(e.isBillingAddress()?9:-1),s(),p(e.basket().requiresShipping?10:-1),s(2),G("border-bottom",e.isPaymentDetails()),s(2),p(e.basket().requiresShipping?14:15),s(2),p(e.isPaymentDetails()?16:-1),s(2),v("basket",e.basket())("vouchers",e.vouchers())}}function ze(t,l){t&1&&P(0,"nbm-loading")}var f=(function(t){return t[t.BillingAddress=0]="BillingAddress",t[t.ShippingAddress=1]="ShippingAddress",t[t.PaymentDetails=2]="PaymentDetails",t})(f||{}),kt=(()=>{class t{constructor(){this.basketService=k(Z),this.vouchersService=k(ae),this.subscriptionManagementService=k(Y),this.router=k(J),this.toastService=k(Q),this.impersonationDataService=k(K),this.platformId=k(R),this.basket=D(null),this.vouchers=D([]),this.impersonatedUser=D(null),this.state=D(f.BillingAddress),this.processingBilling=D(!1),this.processingShipping=D(!1),this.processingPayment=D(!1),this.isBillingAddress=y(()=>this.state()===f.BillingAddress),this.isShippingAddress=y(()=>this.state()===f.ShippingAddress),this.isPaymentDetails=y(()=>this.state()===f.PaymentDetails),this.canGoToBillingAddress=y(()=>!this.isBillingAddress()&&!this.basket()?.isPaying),this.canGoToShippingAddress=y(()=>!this.isShippingAddress()&&!!this.basket()?.billingAddress&&!this.basket()?.isPaying),this.canGoToPaymentDetails=y(()=>!this.isPaymentDetails()&&!!this.basket()?.isInPaymentStage),this.isShippingBackwardStep=y(()=>this.state()===f.PaymentDetails),this.isBillingBackwardStep=y(()=>this.state()!==f.BillingAddress),this.subscriptions=new q}get redirectUrl(){return`${window.location.origin}/checkout/complete`}ngOnInit(){if(!H(this.platformId))return;let e=!1;this.subscriptions.add(this.basketService.getUserBasket().subscribe(i=>{this.basket.set(i),e||(e=!0,this.state.set(this.getInitialState(i)))})),this.subscriptions.add(this.vouchersService.getVouchersForUserBasket().subscribe(i=>{this.vouchers.set(i)})),this.subscriptions.add(this.impersonationDataService.getData().subscribe(i=>{this.impersonatedUser.set(i)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}getInitialState(e){switch(e.state){case T.RequiresShippingAddress:return f.ShippingAddress;case T.ReadyToPay:case T.TermsAndConditionsRequired:case T.ChoosePaymentMethod:case T.CanComplete:case T.Paying:return f.PaymentDetails;default:return f.BillingAddress}}goToBillingAddress(){this.canGoToBillingAddress()&&this.state.set(f.BillingAddress)}goToShippingAddress(){this.canGoToShippingAddress()&&this.state.set(f.ShippingAddress)}goToPaymentDetails(){this.canGoToPaymentDetails()&&this.state.set(f.PaymentDetails)}onBillingAddressSet(e){this.processingBilling.set(!0),this.basketService.setBillingAddress(e).subscribe(i=>{this.basket.set(i),i.requiresShipping&&this.canGoToShippingAddress()?this.goToShippingAddress():this.canGoToPaymentDetails()&&this.goToPaymentDetails(),this.processingBilling.set(!1)})}onShippingAddressSet(e){this.processingShipping.set(!0),this.basketService.setShippingAddress(e===!0,e===!0?null:e).subscribe(i=>{this.basket.set(i),this.canGoToPaymentDetails()&&this.goToPaymentDetails(),this.processingShipping.set(!1)})}onDeleteDiscount(e){this.basketService.removeDiscountCode(e.code).subscribe()}onDeleteVoucher(e){this.vouchersService.unredeemVoucher(e.id).subscribe()}onContactPreferencesSet(e){this.processingPayment.set(!0),this.basketService.acceptTermsAndConditions(e).pipe(C(1)).subscribe({next:()=>{this.processingPayment.set(!1)},error:()=>{this.toastService.showErrorMessage("An error occurred, if this continues, please contact support"),this.processingPayment.set(!1)}})}onPaymentSuccess(e){this.toOrderComplete(e)}onPlaceStoreCreditNBPlusOrder(){this.processingPayment.set(!0),this.basketService.placeStoreCreditNBPlusOrder().pipe(C(1)).subscribe(e=>{e?(this.toastService.showSuccessMessage("Invoice created and marked as paid successfully"),this.router.navigate(["/invoice-success"],{queryParams:{id:e.id}})):this.toastService.showErrorMessage("An error occurred while creating the invoice. If error persists, please contact IT"),this.processingPayment.set(!1)})}toOrderComplete(e){this.subscriptionManagementService.getSubscriptionStatusFromServer().subscribe(),this.router.navigate(["/order-complete"],{queryParams:{id:e}})}onPaymentFailure(e){this.toastService.showErrorMessage(e),this.basketService.cancellationReceived().pipe(C(1)).subscribe(()=>{this.processingPayment.set(!1)})}onSelectPaymentMethod(e){this.processingPayment.set(!0),this.basketService.selectPaymentMethod(e).pipe(C(1)).subscribe(()=>{this.processingPayment.set(!1)})}onRegisterSetupIntent(){this.processingPayment.set(!0),this.basketService.registerPayment().pipe(C(1)).subscribe(()=>{this.processingPayment.set(!1)})}
1onSendInvoice(e){this.processingPayment.set(!0),this.basketService.sendInvoiceToCustomer(e?.customFields).pipe(C(1)).subscribe(i=>{i?(this.toastService.showSuccessMessage("Invoice sent to customer successfully"),this.router.navigate(["/invoice-success"],{queryParams:{id:i.id,wasSentViaEmail:!0}})):this.toastService.showErrorMessage("An error occurred while sending the invoice. If error persists, please contact IT"),this.processingPayment.set(!1)})}onCreateOfflinePaymentInvoice(e){this.processingPayment.set(!0),this.basketService.createAndMarkStripeInvoiceAsPaidOffline(e.note,e.customFields).pipe(C(1)).subscribe(i=>{i?(this.toastService.showSuccessMessage("Invoice created and marked as paid successfully"),this.router.navigate(["/invoice-success"],{queryParams:{id:i.id}})):this.toastService.showErrorMessage("An error occurred while creating the invoice. If error persists, please contact IT"),this.processingPayment.set(!1)})}onCreateStripeInvoiceForUserBasket(e){this.processingPayment.set(!0),this.basketService.createStripeInvoiceForUserBasket(e?.customFields).pipe(C(1)).subscribe(i=>{i?(this.toastService.showSuccessMessage("Invoice created successfully"),this.router.navigate(["/invoice-success"],{queryParams:{id:i.id}})):this.toastService.showErrorMessage("An error occurred while creating the invoice. If error persists, please contact IT"),this.processingPayment.set(!1)})}onResetTransaction(){this.processingPayment.set(!0);let e;if(this.basket()?.paymentMethod===ne.Stripe)e=this.basketService.resetStripeTransaction();else{this.processingPayment.set(!1);return}e.pipe(C(1)).subscribe(()=>{this.processingPayment.set(!1);let i=this.basket();i&&(i.paymentMethod=null,this.basket.set(Object.assign(new U,i)))})}onCompleteOrder(){this.processingPayment.set(!0),this.basketService.completeOrder().pipe(C(1)).subscribe(e=>{e.success?this.toOrderComplete(e.message):(this.toastService.showErrorMessage(e.message),this.processingPayment.set(!1))})}onCompleteInvoiceOrder(e){this.processingPayment.set(!0),this.basketService.completeInvoiceOrder(e).pipe(C(1)).subscribe(i=>{i.success?this.toOrderComplete(i.message):(this.toastService.showErrorMessage(i.message),this.processingPayment.set(!1))})}onCompleteOfflineOrder(e){this.processingPayment.set(!0),this.basketService.completeOfflineOrder(e).pipe(C(1)).subscribe(i=>{i.success?this.toOrderComplete(i.message):(this.toastService.showErrorMessage(i.message),this.processingPayment.set(!1))})}onChooseAnotherMethod(){this.processingPayment.set(!0),this.basketService.chooseAnotherMethod().pipe(C(1)).subscribe(()=>{this.processingPayment.set(!1);let e=this.basket();e&&(e.paymentMethod=null,this.basket.set(Object.assign(new U,e)))})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=w({type:t,selectors:[["nbm-checkout-details"]],decls:3,vars:1,consts:[["title","Checkout"],[1,"row"],[1,"col-md-8"],[1,"accordion","mb-3"],[1,"card","border-bottom-0"],[1,"card-header","border-0"],[1,"d-flex","justify-content-between","align-items-center"],[1,"h4","m-0"],[1,"btn","btn-secondary","btn-sm"],[1,"card-body"],[1,"card"],[1,"h4"],[1,"card-body","p-0"],[1,"col-md-4"],[3,"deleteDiscount","deleteVoucher","basket","vouchers"],[1,"btn","btn-secondary","btn-sm",3,"click"],[3,"billingAddressSet","address","processing"],[3,"shippingAddressSet","billingExists","billingCountry","shippingSameAsBilling","address","processing"],[3,"contactPreferencesSet","selectPaymentMethod","registerSetupIntent","resetTransaction","completeOrder","completeInvoiceOrder","completeOfflineOrder","placeStoreCreditNBPlusOrder","sendInvoice","createStripeInvoiceForUserBasket","createOfflinePaymentInvoice","chooseAnotherMethod","paymentSuccess","paymentFailure","basket","redirectUrl","processing"]],template:function(i,n){i&1&&(r(0,"nbm-checkout-page",0),d(1,Le,19,11,"div",1)(2,ze,1,0,"nbm-loading"),o()),i&2&&(s(),p(n.basket()?1:2))},dependencies:[W,te,ie,oe,ce,pe],encapsulation:2})}}return t})();export{kt as CheckoutDetailsComponent};
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.