1import{a as Ue}from"./chunk-36EOPR6Y.js";import{a as Te}from"./chunk-3BD3YH23.js";import{a as Fe}from"./chunk-6ZNIUTXD.js";import{a as k}from"./chunk-EA2NXPYY.js";import{Db as q,Eb as G,Sa as V,e as ue,f as z}from"./chunk-LS24A6DE.js";import"./chunk-HZQBPZ6S.js";import"./chunk-ATIKRMP4.js";import{B as ge,p as fe}from"./chunk-BNOJBRMD.js";import"./chunk-LHWEQBOF.js";import"./chunk-FZMOTBLQ.js";import"./chunk-SURXIWHQ.js";import"./chunk-PCNP43ZE.js";import"./chunk-5RGCCF7U.js";import"./chunk-X4KWURHK.js";import"./chunk-RPNPA6V7.js";import"./chunk-TSAGDD3L.js";import"./chunk-2KLHVVXY.js";import{a as T}from"./chunk-SCWNZYRH.js";import{G as j,Q as Ce}from"./chunk-PULBI4KM.js";import"./chunk-VCVYGOTU.js";import"./chunk-CU2PC3Q3.js";import{c as _e,d as ye,f as ve,g as Se,h as Ee,j as ke,l as De,o as xe,p as Re,v as Ae,w as Ie}from"./chunk-7RCWNHPV.js";import{b as U}from"./chunk-UVZTK3KN.js";import"./chunk-HCR3IRH2.js";import"./chunk-V4O2LDMY.js";import"./chunk-7APWGJ42.js";import"./chunk-5GQMBFD7.js";import"./chunk-FYGCEZKN.js";import{a as we}from"./chunk-YW6DWN4T.js";import{y as be}from"./chunk-KBN5CF3F.js";import{b as Y,f as me,m as Q,p as he,sa as H}from"./chunk-PT5IPMWH.js";import"./chunk-M6TI2MTM.js";import"./chunk-V2XY4QMO.js";import"./chunk-XFESIM43.js";import{a as g}from"./chunk-A5KRY6GU.js";import"./chunk-EN7UBUB7.js";import{p as F,q as l}from"./chunk-ICEETNFI.js";import"./chunk-4KBURNX4.js";import{d as f}from"./chunk-G44W6JOE.js";import"./chunk-B6STJHB2.js";import{j as I,k as pe}from"./chunk-PWUAYS4F.js";import"./chunk-YJKRYWMV.js";import"./chunk-ZDR3KJJS.js";import"./chunk-KTIPPCE2.js";import{o as B,t as W}from"./chunk-IVJ2I5VN.js";import{$b as m,Aa as te,Cb as R,E as d,Ec as o,Fc as E,Gb as A,Gc as ce,L as S,Pa as ie,Vc as w,Wc as b,Zb as p,aa as x,dc as h,ea as c,ec as s,f as J,fc as a,g as X,gb as ne,gc as L,hb as re,hc as y,ic as v,id as M,mb as r,nc as ae,rb as oe,rc as $,s as O,sa as N,tc as u,xb as C,xc as se,yc as le,za as ee,zc as de}from"./chunk-EN2B4KZW.js";import{a as K,b as Z}from"./chunk-4KIXNS7N.js";function Me(i,D){i&1&&(s(0,"div",1)(1,"div",13)(2,"h4"),o(3,"Calculating..."),a()()())}function Be(i,D){if(i&1&&(s(0,"table")(1,"tr")(2,"td",14)(3,"span"),o(4,"Pending Redemption Request:"),a()(),s(5,"td",15)(6,"span",16),o(7),w(8,"currency"),a()()()()),i&2){let e=u();r(7),E(b(8,1,e.withdrawalAmount))}}function We(i,D){if(i&1&&(s(0,"span",6),o(1),a()),i&2){let e=u();r(),ce(" ",e.requiredFieldError," ")}}var Ne=(()=>{class i extends U{get fullLegalName(){return this.validatingForm.get("fullLegalName")}constructor(e,t){super(),this._store=e,this._router=t,this.submit$=new oe,this.uiBlocker=!0,this.showPage=!1,this.withdrawalTypes=[Ue.PaperCheck],this.withdrawalFeesCheckUSD=f.withdrawals.feeCents.paperCheck/100,this.withdrawalThresholdCheckUSD=f.withdrawals.applyFeesForWithdrawalLessThanCents.paperCheck/100,this.requiredFieldError=f.inlineErrorMessages.requiredField,this.showSuccess$=this._store.pipe(l(V),d(n=>!!n),O(()=>{})),this.updateAccountInfoLink$=this._store.pipe(l(he),d(n=>!!n),O(n=>we.getTicketUrl(f.zendesk.ticketFormIds.updateAccountInfo,n))),this.billingAddressDetails={postalCode:"",billingCity:"",billingState:"",billingStreet1:"",billingStreet2:""},this.formattedUserAddress$=this._store.pipe(l(Q),O(n=>T.formatAddress(n)))}ngOnInit(){this._store.pipe(l(Q),d(t=>!!t),c(this.destroyed$)).subscribe(t=>{this.billingAddressDetails.billingStreet1=t.addressLine1,this.billingAddressDetails.billingStreet2=t.addressLine2,this.billingAddressDetails.billingCity=t.city,this.billingAddressDetails.billingState=t.stateOrProvince,this.billingAddressDetails.postalCode=t.postalCode}),this.showPage=!0,this.withdrawalAmount=this.loggedInUser?.temp_withdrawal_data?.amount_usd;let e=this.loggedInUser?.cash_out_accounts?.find(t=>t.type===Y.PAPER_CHECK);e&&(this.savedFormData=e),this.validatingForm=new Ee({fullLegalName:new ke(null,[ye.required])},{updateOn:"change"}),this.uiBlocker=!1,this.withdrawalAmount||this._router.navigate([g.REDEEM,g.START])}ngAfterViewInit(){this.savedFormData&&(this.fullLegalName.setValue(this.savedFormData.legal_name),this.fullLegalName.disable())}onSubmit(){this._store.pipe(l(be),S(1)).subscribe(e=>{if(this.validatingForm.valid&&this.withdrawalAmount||this.savedFormData&&this.withdrawalAmount){let t=Z(K({withdrawalType:Y.PAPER_CHECK,amount_usd:this.withdrawalAmount,amount:this.withdrawalAmount*e,legal_name:this.fullLegalName.value,address_line_1:this.billingAddressDetail
1s.billingStreet1},this.billingAddressDetails.billingStreet2&&{address_line_2:this.billingAddressDetails.billingStreet2}),{city:this.billingAddressDetails.billingCity,state_or_province:this.billingAddressDetails.billingState,postal_code:this.billingAddressDetails.postalCode,country:"US"});this.submit$.emit(t)}})}static{this.\u0275fac=function(t){return new(t||i)(C(F),C(I))}}static{this.\u0275cmp=R({type:i,selectors:[["app-check-redemption"]],inputs:{loggedInUser:"loggedInUser"},outputs:{submit$:"submit$"},features:[A],decls:20,vars:14,consts:[[1,"balance","d-flex","justify-content-between","my-4","border","rounded","p-2"],[1,"uiBlocker"],[1,"description","mb-3"],[3,"formGroup"],["for","fullLegalName",1,"font"],["name","fullLegalName","type","text","id","fullLegalName","formControlName","fullLegalName","mdbInput","","mdbValidate","",1,"form-input"],[1,"form-error-message"],[1,"mt-2","pl-2"],[1,"font-weight-bold","d-inline-block"],["target","_blank","rel","noopener noreferrer",1,"link-secondary",3,"href"],[3,"innerHTML"],[1,"text-center","mb-0","mt-4"],["appFormSubmissionButton","","aria-label","Submit Redemption",3,"click","defaultText","errorText","showSuccess$","disabled"],[1,"align-self-center","text-center"],[1,"left"],[1,"right"],[1,"font-weight-bold","money"]],template:function(t,n){t&1&&(s(0,"div",0),p(1,Me,4,0,"div",1),p(2,Be,9,3,"table"),a(),s(3,"div",2),o(4,` To complete your withdrawal request via paper check please enter your information below and click the "SUBMIT" button. 2`),a(),s(5,"form",3)(6,"label",4),o(7,"First & Last Name"),a(),L(8,"input",5),p(9,We,2,1,"span",6),s(10,"div",7)(11,"span",8),o(12,"Address -\xA0"),a(),s(13,"a",9),w(14,"async"),o(15,"Change Address"),a(),L(16,"address",10),w(17,"async"),a()(),s(18,"div",11)(19,"button",12),$("click",function(){return n.onSubmit()}),a()()),t&2&&(r(),m(n.uiBlocker?1:-1),r(),m(n.uiBlocker?-1:2),r(3),h("formGroup",n.validatingForm),r(4),m(!n.fullLegalName.value&&n.fullLegalName.invalid&&(n.fullLegalName.dirty||n.fullLegalName.touched)?9:-1),r(4),h("href",b(14,10,n.updateAccountInfoLink$),re),r(3),h("innerHTML",b(17,12,n.formattedUserAddress$),ne),r(3),h("defaultText","SUBMIT")("errorText","Error")("showSuccess$",n.showSuccess$)("disabled",n.validatingForm.invalid))},dependencies:[Ae,De,_e,ve,Se,Ie,xe,Re,Te,B,W],styles:[".md-outline[_ngcontent-%COMP%] input.form-input[_ngcontent-%COMP%], .md-outline[_ngcontent-%COMP%] input.form-input.validate-success.ng-valid.ng-dirty[_ngcontent-%COMP%]{border-color:var(--c-light-purple);box-shadow:inset 0 0 0 1px var(--c-light-purple);margin-bottom:12px}.text-success[_ngcontent-%COMP%]{color:var(--c-light-purple)}.description[_ngcontent-%COMP%]{color:var(--c-gray-2);text-align:center;font-size:14px}.button-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:100%}"],changeDetection:0})}}return i})();function He(i,D){if(i&1&&(y(0,"table")(1,"tr")(2,"td",2)(3,"span"),o(4,"Redemption Type:"),v()(),y(5,"td",3)(6,"span",4),o(7),v()()(),y(8,"tr")(9,"td",2)(10,"span"),o(11,"Pending Redemption Request:"),v()(),y(12,"td",3)(13,"span",4),o(14),w(15,"currency"),v()()()()),i&2){let e=u();r(7),E(e.withdrawalTypeString),r(7),E(b(15,2,e.amount))}}var $e=(()=>{class i extends U{constructor(e,t){super(),this._router=e,this._store=t,this.cdr=N(M),this.withdrawalFeesCheckUSD=f.withdrawals.feeCents.paperCheck/100,this.withdrawalThresholdCheckUSD=f.withdrawals.applyFeesForWithdrawalLessThanCents.paperCheck/100}ngAfterViewInit(){this._store.pipe(l(q),x(1),d(e=>!!e.errorCode),c(this.destroyed$)).subscribe(()=>{this._store.pipe(l(H),S(1)).subscribe(e=>this._store.dispatch(j({isLoggedIn:e})))}),this._store.pipe(l(G),x(1),d(e=>!!e.errorCode),c(this.destroyed$)).subscribe(e=>{this._store.dispatch(Ce({message:`Unhandled ${e.errorCode} - see console for details`,titleText:"Payment REST Failure"}))}),T.onNextEventLoop(()=>{this.cashOutData?(this.amount=Math.abs(this.cashOutData.amount_usd),this.withdrawalTypeString="Paper Check",this._store.dispatch(ge()),this._store.dispatch(fe()),this.cdr.markForCheck()):(this._store.dispatch(z()),this._router.navigate([g.REDEEM,g.BANK_ACH]))}),this.destroyed$.pipe(S(1)).subscribe(()=>this._store.dispatch(z()))}static{this.\u0275fac=function(t){return new(t||i)(C(I),C(F))}}static{this.\u0275cmp=R({type:i,selectors:[["app-check-success-redemption"]],inputs:{cashOutData:"cashOutData"},features:[A],decls:7,vars:1,consts:[[1,"font-weight-bold","text-underline"],[1,"balance","d-flex","justify-content-between","my-4","border","rounded","p-3"],[1,"left"],[1,"right"],[1,"font-weight-bold","money"]],template:function(t,n){t&1&&(y(0,"p"),o(1," Your redemption request has been received. Please note payouts via a paper check can take up to "),y(2,"span",0),o(3,"6 business days"),v(),o(4,` to be printed and mailed via standard first class mail. Please see the confirmation email that we just sent you for more information. 3`),v(),y(5,"div",1),p(6,He,16,4,"table"),v()),t&2&&(r(6),m(n.cashOutData?6:-1))},dependencies:[W],styles:[".show[_ngcontent-%COMP%]{display:block}.hidden[_ngcontent-%COMP%]{display:none}.text-underline[_ngcontent-%COMP%]{text-decoration:underline}"],changeDetection:0})}}return i})();var je=["customFooterButtonElement"];function Ve(i,D){if(i&1){let e=ae();s(0,"app-check-redemption",9),$("submit$",function(n){ee(e);let P=u(2);return te(P.onWithdrawal(n))}),a()}if(i&2){let e=u(2);h("loggedInUser",e.loggedInUser)}}function qe(i,D){if(i&1&&L(0,"app-check-success-redemption",6),i&2){let e=u(2);h("cashOutData",e.cashOutData)}}function Ge(i,D){if(i&1&&(s(0,"div",0)(1,"app-display-card",1)(2,"div",2)(3,"h3",3),o(4),a()(),s(5,"div",4),p(6,Ve,1,1,"app-check-redemption",5),w(7,"async"),p(8,qe,1,1,"app-check-success-redemption",6),w(9,"async"),a(),s(10,"div",7)(11,"a",8),o(12,"Return to Lobby"),a()()()()),i&2){let e=u();r(),h("showCardFooter",e.showCardFooter),r(3),E(e.withdrawalTitle),r(2),m(b(7,5,e.withdrawalStatus$)===e.eWithdrawalStatus.WITHDRAWAL?6:-1),r(2),m(b(9,7,e.withdrawalStatus$)===e.eWithdrawalStatus.SUCCESS?8:-1),r(3),h("routerLink",e.lobbyLink)}}var _=(function(i){return i.UNDEFINED="undefined",i.WITHDRAWAL="withdrawal",i.CONFIRM="confirm",i.SUCCESS="success",i})(_||{}),Nt=(()=>{class i extends U{constructor(e,t){super(),this._router=e,this._store=t,this.cdr=N(M),this.eWithdrawalStatus=_,this.thisUnsubscribe$=new J,this.lobbyLink=`/${g.LOBBY}`,this.uiBlocker=!0,this.withdrawalStatus$=new X(_.UNDEFINED),this.showCardFooter=!0,this.showPage=!1,this.withdrawalFeesCheckUSD=f.withdrawals.feeCents.paperCheck/100}ngOnInit(){this._store.pipe(l(q),x(1),d(e=>!!e.errorCode),c(this.destroyed$)).subscribe(()=>{this._store.pipe(l(H),S(1)).subscribe(e=>this._store.dispatch(j({isLoggedIn:e})))}),this._store.pipe(l(G),x(1),d(e=>!!e.errorCode),c(this.destroyed$)).subscribe(e=>{this.onPaymentRestError(e.errorCode)}),this._store.pipe(l(me),c(this.destroyed$)).subscribe(e=>this.onUserStateChange(e)),this.withdrawalTitle="Redeem Sweeps Coins",this.cashOutFee=this.withdrawalFeesCheckUSD,this.withdrawalStatus$.next(_.WITHDRAWAL),this._store.pipe(l(V),c(this.thisUnsubscribe$)).subscribe(e=>{e&&(this.withdrawalTitle="Successful Redemption",this.cdr.markForCheck(),T.onNextEventLoop(()=>{this.withdrawalStatus$.next(_.SUCCESS)}))})}ngOnDestroy(){this.thisUnsubscribe$.next(),this.thisUnsubscribe$.complete(),super.ngOnDestroy()}onWithdrawal(e){this.cashOutData=e,this.withdrawalStatus$.next(_.CONFIRM),this.onConfirm()}onConfirm(){this._store.dispatch(ue({cashOutData:this.cashOutData}))}onCancel(){this.withdrawalStatus$.next(_.WITHDRAWAL)}onUserStateChange(e){this.loggedInUser=e,this.loggedInUser&&this.withdrawalStatus$.value===_.UNDEFINED&&(this.withdrawalStatus$.next(_.WITHDRAWAL),this.showPage=!0),this.cdr.markForCheck()}onPaymentRestError(e){let t={text:"There has been an error submitting your withdrawal, please contact support.",showButton:!0};switch(e){case k.SUSPECT_FRAUD:t.text="FRAUD",t.showButton=!1;break;case k.PAYPAL_ACCOUNT_INACTIVE:t.text="We're sorry, but it appears that this PayPal account was previously used on this or a different account.";break;case k.ACH_ACCOUNT_INACTIVE:t.text="We're sorry, but it appears that this checking account was previously used on this or a different account.";break;case k.PAPER_CHECK_DETAILS_MISMATCH:t.text="We're sorry, but it appears the details provided don't match what was previously used.";break;case k.PAYPAL_EMAIL_ALREADY_IN_USE:t.text="We're sorry, but it appears that this PayPal account was previously used on this or a different account.";break;case k.ACH_ACCOUNT_ALREADY_IN_USE:t.text="We're sorry, but it appears that this checking account was previously used on this or a different account.";break;default:t.text="We're sorry, but it appears there has been an error processing your withdrawal.";break}this._router.navigate([g.REDEEM,g.REDEEM_ERROR],{state:{errorMessage:t}})}static{this.\u0275fac=function(t){return new(t||i)(C(I),C(F))}}static{this.\u0275cmp=R({type:i,selectors:[["app-check-redeem"]],viewQuery:function(t,n){if(t&1&&se(je,5,ie),t&2){let P;le(P=de())&&(n.customFooterButtonElement=P.first)}},features:[A],decls:1,vars:1,consts:[[1,"ghg-page-container","ghg-fill-height"],[3,"showCardFooter"],[1,"title"],[1,"text-center"],[1,"content"],[3,"loggedInUser"],[3,"cashOutData"],[1,"buttons"],[1,"link-secondary",3,"routerLink"],[3,"submit$","loggedInUser"]],template:function(t,n){t&1&&p(0,Ge,13,9,"div",0),t&2&&m(n.showPage?0:-1)},dependencies:[Fe,Ne,$e,pe,B],encapsulation:2,changeDetection:0})}}return i})();export{Nt as CheckRedemptionFlowComponent};
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.