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BAMAA,yBAMAA,kBACEA,mBACEA,qBACEA,kCAAU2N,2BADZ3N,QAEAA,qBAAuDA,2DAC9CA,QACXA,QACFA,QACAA,yBA8BAA,yBAMAA,mBACEA,sBAEsDA,gCAAS2N,mBAAgB3N,2BAAcA,QAC/FA,QACFA,QACAA,yBASAA,2CASFA,QAEFA,QACFA,QACFA,4CAlK4DA,gDAShBA,wCAAyB,mCAAzBA,CAAyB,wCAAzBA,CAAyB,oBAavDA,yCAA0B,oCAA1BA,CAA0B,yCAA1BA,CAA0B,oBAIzBA,yHAgB8BA,kCAAiB,gCAAjBA,CAAiB,mBAM9CA,8CAKAA,8CAyBAA,wEAMAA,8CAQoEA,gDAMpEA,qCA8BAA,qCAQFA,mVAIAA,qCASAA,utDC1FDM,GAAb,+BCxDA,MAAMsN,GAAiB,CACvB,CAAEC,KAAM,GAAIC,UAAWxN,GAAgByN,YAAa,CAACC,MAAY5I,KAAM,CAAE1E,MAAO,UAChF,CAAEmN,KAAM,YAAaC,UAAWxN,GAAgByN,YAAa,CAACC,MAAY5I,KAAM,CAAEtC,KAAM,WAAYpC,MAAO,qBAcpG,IAAMuN,GAAb,MAAM,sDAAOA,4DATF,CACPC,KACAC,KACAC,KACAC,cAAsBT,IACtBU,KACAC,SAGSN,GAAb","names":["i0","ctx_r36","oxw","ctx_r37","customValidator","CustomValidator","NautaComponent","constructor","formBuilder","router","route","toastr","config","dataService","contactsService","promotionService","storageService","rewardsService","rechargeService","modalService","urlService","titleService","metaService","platformId","document","this","Subject","Utils","text$","debouncedText$","pipe","debounceTime","distinctUntilChanged","clicksWithClosedPopup$","clickPhone$","filter","phoneNumberTypehead","isPopupOpen","merge","focusPhone$","map","term","phoneContacts","v","account","slice","name","toLowerCase","includes","toLocaleLowerCase","splice","x","clickContactName$","contactNameTypeahead","focusContactName$","contacts","nautaAccount","clickNauta$","nautaAccountTypeahead","focusNauta$","$event","contactName","item","_elementRef","nativeElement","value","selectControl","FormControl","checkboxControl","cashbackSelectedControl","cashbackUsedControl","cashback","phoneNumberForm","Validators","phoneValidator","showHint","focusFirst","prices","eligibleCashback","availableRewards","availableCashback","_unsubscribeAll","currentUser","getCurrentUser","data","subscribe","result","openCashbackModal","ngOnInit","updateTag","content","description","keywords","property","title","environment","url","setTitle","loading","loading$","loadingChange","loadingChange$","changeUrl","footer","emit","rechargeNautaForm","group","message","nautaAccountaValidator","rechargeSubject","priceIdFromHome","priceId","get","markAsDirty","valueChanges","text_Length","length","messageLength","isNaN","setValue","setErrors","cashbackDisavailable","invalidCashbackRequired","pristine","markAsPristine","rewardsSumarySubject","takeUntil","discounts","d","offerType","status","claimed","user","price","find","p","id","selectedPrice","a","isExclusive","rechargePrice","discount","selectedPriceSubject","next","isPlatformBrowser","window","scrollTo","loadingInit","Promise","userLevel","resolve","reject","all","getContactsWithNauta","then","getRewards","catch","complete","getCashBack","getContacts","getIZCR","izcr","getPrice","selected","defaultPrice","onModalInfoCashback","reason","res","ngOnDestroy","rewardsEarned","success","sendRecharge","error","invalid","sendMessage","hasError","toString","modalRef","open","ModalDiscountConfirmationComponent","centered","componentInstance","sendRechargeNauta","isObject","guid","v4","serviceType","rechargeModel","accountsToRecharge","sendRechargeNow","sendSms","getRawValue","deliveryNumber","landingPage","eligibleExtraDiscount","applyReward","maxCashback","totalDiscount","fromHome","rechargeAmount","promotionAmountText","changeMessage","saveContact","navigate","onChangeSendMessage","reset","getCurrentPrice","getTotalAmountToPay","resultNautaAccount","ModalQuestionCashbackComponent","size","onInfoEligibleCashback","ModalEligibleCashbackComponent","windowClass","PLATFORM_ID","DOCUMENT","selectors","ContactsService","decls","ctx","routes","path","component","canActivate","AuthGuard","NautaModule","CommonModule","FormsModule","ReactiveFormsModule","RouterModule","NgbModule","SharedModule"],"sources":["webpack:///src/app/nauta/nauta.component.html","webpack:///src/app/nauta/nauta.component.ts","webpack:///src/app/nauta/nauta.module.ts"],"sourcesContent":["
\r\n
\r\n
\r\n \r\n

Recargas Nauta

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n La cuenta nauta es\r\n requerida\r\n
\r\n\r\n
\r\n La cuenta nauta\r\n no\r\n es\r\n válida\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n

Usted tiene ${{availableCashback.toFixed(2)}} USD de recompensas\r\n disponibles

\r\n
\r\n\r\n
\r\n
\r\n
    \r\n
  • \r\n
    \r\n

    Subtotal actual

    \r\n
    \r\n

    ${{getCurrentPrice().toFixed(2)}}\r\n

    \r\n
  • \r\n
  • \r\n
    \r\n

    Recompensas disponibles

    \r\n
    \r\n

    -${{availableCashback.toFixed(2)}}\r\n

    \r\n
  • \r\n
  • \r\n

    Total a pagar

    \r\n

    ${{ getTotalAmountToPay().toFixed(2) }}

    \r\n
  • \r\n
\r\n\r\n
\r\n
\r\n
0 && currentUser.userLevel == 1\" class=\"col-md-12 col-12 px-0 d-flex align-items-center mb-3\" (click)=\"onInfoEligibleCashback()\">\r\n \r\n

Recibe\r\n {{selectedPrice.eligibleCashback}}% de\r\n devolución(+{{ utils.truncateDecimal(eligibleCashback) }})

\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n El número es\r\n requerido\r\n
\r\n\r\n
\r\n El número\r\n no\r\n es\r\n válido\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n Caracteres restantes:\r\n {{messageLength}}\r\n
\r\n
\r\n Enviar recarga\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \"Cargando...\"\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \"Cargando...\"\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
","import {\r\n Component,\r\n OnInit,\r\n AfterViewInit,\r\n ViewChild,\r\n Inject,\r\n PLATFORM_ID,\r\n OnDestroy,\r\n} from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport { ToastrService } from 'ngx-toastr';\r\nimport { DataService } from '@app/services/data.service';\r\nimport { RechargeModel } from '@app/models/recharge.model';\r\nimport { UrlService } from '@app/services/url.service';\r\nimport { ContactsService } from '@app/services/contacts.service';\r\nimport { PriceModel, PriceModelDetails, PriceModelv2 } from '@app/models/price.model';\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n FormBuilder,\r\n Validators,\r\n} from '@angular/forms';\r\nimport {\r\n NgbTypeaheadConfig,\r\n NgbTypeaheadSelectItemEvent,\r\n NgbTypeahead,\r\n NgbModal,\r\n} from '@ng-bootstrap/ng-bootstrap';\r\nimport { CustomValidator } from '@app/helpers/validators';\r\nimport { v4 as uuidv4, v4 } from 'uuid';\r\nimport { Observable, Subject, merge } from 'rxjs';\r\nimport {\r\n debounceTime,\r\n distinctUntilChanged,\r\n map,\r\n filter,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\nimport { isObject } from 'util';\r\nimport { Account } from '@app/models/account';\r\nimport { isPlatformBrowser, DOCUMENT } from '@angular/common';\r\nimport { Meta, Title } from '@angular/platform-browser';\r\nimport { PromotionsService } from '@app/services/promotions.service';\r\nimport { BonusService } from '@app/services/bonus.service';\r\nimport { ModalDiscountConfirmationComponent } from '@app/shared/components/modal-discount-confirmation/modal-discount-confirmation.component';\r\nimport { RewardModel } from '@app/models/reward.model';\r\nimport { environment } from '@env/environment';\r\nimport { User } from '@app/models/user.model';\r\nimport { StorageService } from '@app/services/storage.service';\r\nimport { ModalQuestionCashbackComponent } from '@app/shared/components/modal-question-cashback/modal-question-cashback.component';\r\nimport { Utils } from '@app/helpers/utils';\r\nimport { ModalEligibleCashbackComponent } from '@app/shared/components/modal-eligible-cashback/modal-eligible-cashback.component';\r\nimport { RechargeService } from '../services/recharge.service';\r\nimport { HomeRechargeModel } from '@app/models/recharge/home-recharge.model';\r\n\r\nconst customValidator = CustomValidator;\r\nconst textLength = 160;\r\ndeclare var $: any;\r\n\r\n@Component({\r\n selector: 'app-nauta',\r\n templateUrl: './nauta.component.html',\r\n styleUrls: ['./nauta.component.css'],\r\n providers: [ContactsService],\r\n})\r\nexport class NautaComponent implements OnInit, OnDestroy {\r\n @ViewChild('instanceContact', { static: false })\r\n contactNameTypeahead: any;\r\n\r\n @ViewChild('instanceNautaAccount', { static: false })\r\n nautaAccountTypeahead: any;\r\n\r\n @ViewChild('instancePhoneNumber', { static: false })\r\n phoneNumberTypehead: NgbTypeahead;\r\n\r\n prices: PriceModelDetails[];\r\n contacts: any[];\r\n phoneContacts: any[];\r\n izcr: boolean;\r\n\r\n currentUser: User;\r\n\r\n phoneNumber: any;\r\n contactName: any;\r\n nautaAccount: any = {};\r\n\r\n availableRewards: number;\r\n availableCashback: number;\r\n applyReward: boolean;\r\n\r\n rechargeNautaForm: FormGroup;\r\n selectControl: FormControl;\r\n checkboxControl: FormControl;\r\n selectedPrice: PriceModelDetails;\r\n cashbackSelectedControl: FormControl;\r\n cashbackUsedControl: FormControl;\r\n submittedRechargeNauta = false;\r\n sendMessage = false;\r\n messageLength = 160;\r\n phoneNumberForm: FormControl;\r\n loading: Observable;\r\n loadingChange: Observable;\r\n loadingInit: boolean;\r\n cashback: number;\r\n eligibleCashback: number;\r\n\r\n focusPhone$ = new Subject();\r\n clickPhone$ = new Subject();\r\n\r\n focusContactName$ = new Subject();\r\n clickContactName$ = new Subject();\r\n\r\n focusNauta$ = new Subject();\r\n clickNauta$ = new Subject();\r\n\r\n utils = Utils;\r\n\r\n openCashbackModal: boolean;\r\n\r\n priceIdFromHome: number;\r\n\r\n title = 'Recarga NAUTA a Cuba 🥇 ¡Internet al instante! con Cubatel';\r\n description =\r\n 'Envía【Recargas NAUTA a Cuba desde el exterior】con Cubatel ✅ ¡Internet al instante! Recarga cuenta WiFi y Nauta Hogar (activa 330 días) para familiares y amigos';\r\n keywords =\r\n 'recarga nauta, recarga nauta a cuba, recarga cuenta nauta, recarga cuenta nauta hogar, recarga nauta desde el exterior';\r\n\r\n // Private\r\n private _unsubscribeAll: Subject;\r\n\r\n constructor(\r\n private formBuilder: FormBuilder,\r\n private router: Router,\r\n private route: ActivatedRoute,\r\n private toastr: ToastrService,\r\n private config: NgbTypeaheadConfig,\r\n private dataService: DataService,\r\n private contactsService: ContactsService,\r\n private promotionService: PromotionsService,\r\n private storageService: StorageService,\r\n private rewardsService: BonusService,\r\n private rechargeService: RechargeService,\r\n private modalService: NgbModal,\r\n private urlService: UrlService,\r\n private titleService: Title,\r\n private metaService: Meta,\r\n @Inject(PLATFORM_ID) private platformId,\r\n @Inject(DOCUMENT) private document: Document\r\n ) {\r\n this.selectControl = new FormControl();\r\n this.checkboxControl = new FormControl(false);\r\n this.cashbackSelectedControl = new FormControl(false);\r\n this.cashbackUsedControl = new FormControl(null, [\r\n customValidator.cashback,\r\n ]);\r\n this.phoneNumberForm = new FormControl('', [\r\n Validators.required,\r\n customValidator.phoneValidator,\r\n ]);\r\n config.showHint = false;\r\n config.focusFirst = true;\r\n this.prices = [];\r\n this.cashback = 0;\r\n this.contacts = [];\r\n this.eligibleCashback = 0;\r\n this.phoneContacts = [];\r\n this.availableRewards = 0;\r\n this.availableCashback = 0;\r\n\r\n this._unsubscribeAll = new Subject();\r\n this.currentUser = this.storageService.getCurrentUser();\r\n\r\n this.route.data.subscribe((result) => {\r\n if (result.name == 'cashback') {\r\n this.openCashbackModal = true;\r\n }\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.metaService.updateTag({\r\n name: 'description',\r\n content: this.description,\r\n });\r\n this.metaService.updateTag({ name: 'keywords', content: this.keywords });\r\n this.metaService.updateTag({ name: 'robots', content: 'noindex,nofollow' });\r\n this.metaService.updateTag({ property: 'og:title', content: this.title });\r\n this.metaService.updateTag({\r\n property: 'og:description',\r\n content: this.description,\r\n });\r\n this.metaService.updateTag({\r\n property: 'og:url',\r\n content: `${environment.host}${this.router.url}`,\r\n });\r\n\r\n this.titleService.setTitle(this.title);\r\n\r\n this.loading = this.contactsService.loading$;\r\n this.loadingChange = this.contactsService.loadingChange$;\r\n this.urlService.changeUrl(this.router.url);\r\n this.urlService.footer.emit();\r\n this.rechargeNautaForm = this.formBuilder.group({\r\n message: '',\r\n contactName: '',\r\n nautaAccount: [\r\n '',\r\n [Validators.required, customValidator.nautaAccountaValidator],\r\n ],\r\n });\r\n\r\n this.rechargeService.rechargeSubject.subscribe(\r\n (result: HomeRechargeModel) => {\r\n if (result.nautaAccount) {\r\n this.priceIdFromHome = result.priceId;\r\n this.rechargeNautaForm.get('nautaAccount').markAsDirty();\r\n this.nautaAccount.nautaAccount = result.nautaAccount;\r\n }\r\n }\r\n );\r\n\r\n this.rechargeNautaForm.get('message').valueChanges.subscribe(() => {\r\n const text_Length = this.rechargeNautaForm.get('message').value.length;\r\n this.messageLength = textLength - text_Length;\r\n });\r\n\r\n this.cashbackUsedControl.valueChanges.subscribe((result) => {\r\n if (isNaN(result) && result != '.') {\r\n this.cashbackUsedControl.setValue(\r\n (result as String).slice(0, result.length - 1)\r\n );\r\n }\r\n if (this.cashbackUsedControl.value > this.cashback) {\r\n this.cashbackUsedControl.setErrors({\r\n cashbackDisavailable: true,\r\n invalidCashbackRequired: false,\r\n });\r\n } else {\r\n if (\r\n this.cashbackUsedControl.value == '' &&\r\n !this.cashbackUsedControl.pristine\r\n ) {\r\n this.cashbackUsedControl.setErrors({\r\n invalidCashbackRequired: true,\r\n cashbackDisavailable: false,\r\n });\r\n } else {\r\n this.cashbackUsedControl.setErrors({\r\n cashbackDisavailable: false,\r\n invalidCashbackRequired: false,\r\n });\r\n }\r\n }\r\n });\r\n\r\n this.cashbackSelectedControl.valueChanges.subscribe((result) => {\r\n if (!result) {\r\n this.cashbackUsedControl.markAsPristine();\r\n this.cashbackUsedControl.setValue('');\r\n }\r\n });\r\n\r\n this.rewardsService.rewardsSumarySubject\r\n .pipe(\r\n takeUntil(this._unsubscribeAll),\r\n debounceTime(300),\r\n distinctUntilChanged()\r\n )\r\n .subscribe((result: RewardModel) => {\r\n this.availableRewards = result.discounts.filter(\r\n (d) => d.offerType == 1 && d.status == 1 && !d.claimed\r\n ).length;\r\n this.availableCashback = result.availableCashback;\r\n });\r\n\r\n this.storageService.currentUser.subscribe((user) => {\r\n this.currentUser = user;\r\n });\r\n\r\n this.selectControl.valueChanges.subscribe((result) => {\r\n const price = this.prices.find((p) => p.id == result);\r\n this.selectedPrice = price;\r\n this.eligibleCashback = !price.isExclusive\r\n ? ((price.rechargePrice + price.discount) * price.eligibleCashback) /\r\n 100\r\n : 0;\r\n this.dataService.selectedPriceSubject.next(price);\r\n });\r\n\r\n if (isPlatformBrowser(this.platformId)) {\r\n window.scrollTo(0, 0);\r\n this.loadingInit = true;\r\n if (this.currentUser) {\r\n const promise =\r\n this.currentUser.userLevel == 1\r\n ? new Promise((resolve, reject) => {\r\n Promise.all([\r\n this.contactsService\r\n .getContactsWithNauta()\r\n .then((result) => (this.contacts = result)),\r\n this.rewardsService\r\n .getRewards()\r\n .then((result: RewardModel) => {\r\n this.rewardsService.rewardsSumarySubject.next(result);\r\n })\r\n .catch(() => {\r\n this.rewardsService.rewardsSumarySubject.complete();\r\n }),\r\n this.promotionService.getCashBack().then((result) => {\r\n this.cashback = result.availableCashback;\r\n }),\r\n\r\n this.contactsService\r\n .getContacts()\r\n .then((result) => (this.phoneContacts = result)),\r\n\r\n this.contactsService\r\n .getIZCR()\r\n .then((result: boolean) => (this.izcr = result)),\r\n this.contactsService\r\n .getPrice(1)\r\n .then((result: PriceModelv2) => {\r\n this.prices = result.prices;\r\n if (this.prices.length > 0) {\r\n if (this.priceIdFromHome) {\r\n const selected = this.prices.find(\r\n (p) => p.id == this.priceIdFromHome\r\n );\r\n this.selectedPrice = selected;\r\n this.selectControl.setValue(this.priceIdFromHome);\r\n } else {\r\n const defaultPrice = this.prices.find(\r\n (p) => p.defaultPrice\r\n );\r\n if (defaultPrice) {\r\n this.selectedPrice = defaultPrice;\r\n this.selectControl.setValue(defaultPrice.id);\r\n } else {\r\n this.selectedPrice = this.prices[0];\r\n this.selectControl.setValue(this.prices[0].id);\r\n }\r\n }\r\n }\r\n })\r\n ]).then(\r\n () => {\r\n this.loadingInit = false;\r\n if (this.openCashbackModal) {\r\n this.onModalInfoCashback();\r\n }\r\n resolve();\r\n },\r\n (reason: any) => {\r\n this.loadingInit = false;\r\n if (this.openCashbackModal) {\r\n this.onModalInfoCashback();\r\n }\r\n reject(reason);\r\n }\r\n );\r\n })\r\n : new Promise((resolve, reject) => {\r\n Promise.all([\r\n this.contactsService\r\n .getContactsWithNauta()\r\n .then((result) => (this.contacts = result)),\r\n this.contactsService\r\n .getContacts()\r\n .then((result) => (this.phoneContacts = result)),\r\n\r\n this.contactsService\r\n .getIZCR()\r\n .then((result: boolean) => (this.izcr = result)),\r\n this.contactsService\r\n .getPrice(1)\r\n .then((result: PriceModelv2) => {\r\n this.prices = result.prices;\r\n if (this.prices.length > 0) {\r\n if (this.priceIdFromHome) {\r\n const selected = this.prices.find(\r\n (p) => p.id == this.priceIdFromHome\r\n );\r\n this.selectedPrice = selected;\r\n this.selectControl.setValue(this.priceIdFromHome);\r\n } else {\r\n const defaultPrice = this.prices.find(\r\n (p) => p.defaultPrice\r\n );\r\n\r\n if (defaultPrice) {\r\n this.selectedPrice = defaultPrice;\r\n this.selectControl.setValue(defaultPrice.id);\r\n } else {\r\n this.selectedPrice = this.prices[0];\r\n this.selectControl.setValue(this.prices[0].id);\r\n }\r\n }\r\n }\r\n }),\r\n ]).then(\r\n (res) => {\r\n this.loadingInit = false;\r\n if (this.openCashbackModal) {\r\n this.onModalInfoCashback();\r\n }\r\n resolve(res);\r\n },\r\n (reason: any) => {\r\n this.loadingInit = false;\r\n if (this.openCashbackModal) {\r\n this.onModalInfoCashback();\r\n }\r\n reject(reason);\r\n }\r\n );\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._unsubscribeAll.next();\r\n this._unsubscribeAll.complete();\r\n this.rewardsService.rewardsSumarySubject.next({\r\n availableCashback: 0,\r\n rewardsEarned: 0,\r\n cashback: [],\r\n discounts: [],\r\n success: false,\r\n });\r\n }\r\n\r\n sendRecharge() {\r\n if (this.rechargeNautaForm.pristine) {\r\n this.toastr.error('Por favor verifique la cuenta nauta a recargar.');\r\n return;\r\n }\r\n\r\n if (this.rechargeNautaForm.invalid) {\r\n return;\r\n }\r\n\r\n if (this.sendMessage) {\r\n if (this.phoneNumberForm.pristine) {\r\n this.toastr.error('Por favor verifique el número de teléfono.');\r\n return;\r\n }\r\n if (this.phoneNumberForm.invalid) {\r\n return;\r\n }\r\n }\r\n\r\n if (this.prices.length === 0) {\r\n this.toastr.error('Ha ocurrido un error al obtener los precios');\r\n return;\r\n }\r\n\r\n if (this.cashbackSelectedControl.value) {\r\n if (\r\n this.cashbackUsedControl.hasError('cashbackDisavailable') ||\r\n this.cashbackUsedControl.hasError('invalidCashbackRequired') ||\r\n this.cashbackUsedControl.pristine\r\n ) {\r\n return;\r\n }\r\n }\r\n\r\n const price = this.prices.find(\r\n (p) => p.id.toString() === this.selectControl.value.toString()\r\n );\r\n if (price.discount != 0) {\r\n const modalRef = this.modalService.open(\r\n ModalDiscountConfirmationComponent,\r\n { centered: true }\r\n );\r\n modalRef.componentInstance.availableRewards = this.availableRewards;\r\n modalRef.result.then((result) => {\r\n if (result) {\r\n this.sendRechargeNauta();\r\n }\r\n });\r\n } else {\r\n this.sendRechargeNauta();\r\n }\r\n }\r\n\r\n sendRechargeNauta() {\r\n const price = this.prices.find(\r\n (p) => p.id.toString() === this.selectControl.value.toString()\r\n );\r\n const contacts: Account[] = [\r\n {\r\n account: isObject(this.rechargeNautaForm.get('nautaAccount').value)\r\n ? this.rechargeNautaForm.get('nautaAccount').value.nautaAccount\r\n : this.rechargeNautaForm.get('nautaAccount').value,\r\n contactName: isObject(this.rechargeNautaForm.get('contactName').value)\r\n ? this.rechargeNautaForm.get('contactName').value.name\r\n : this.rechargeNautaForm.get('contactName').value,\r\n guid: v4(),\r\n serviceType: 1,\r\n priceId: price.id,\r\n },\r\n ];\r\n const rechargeModel: RechargeModel = {\r\n accountsToRecharge: contacts,\r\n sendRechargeNow: true,\r\n sendSms: this.checkboxControl.value,\r\n message: this.rechargeNautaForm.getRawValue().message,\r\n deliveryNumber: this.checkboxControl.value\r\n ? isObject(this.phoneNumberForm.value)\r\n ? this.phoneNumberForm.value.account.slice(3)\r\n : this.phoneNumberForm.value\r\n : '',\r\n landingPage: false,\r\n price: price,\r\n discount: price.discount,\r\n eligibleExtraDiscount: 0,\r\n isExclusive: price.isExclusive,\r\n cashback: this.applyReward\r\n ? price.rechargePrice * contacts.length - this.availableCashback < 0\r\n ? price.rechargePrice * contacts.length\r\n : this.availableCashback\r\n : 0,\r\n eligibleCashback: this.eligibleCashback,\r\n availableCashback: this.availableCashback,\r\n izcr: this.izcr,\r\n serviceType: 1,\r\n maxCashback:\r\n price.rechargePrice * contacts.length - this.availableCashback < 0\r\n ? price.rechargePrice * contacts.length\r\n : this.availableCashback,\r\n totalDiscount: price.discount,\r\n fromHome: false,\r\n rechargeAmount: price.rechargeAmount,\r\n promotionAmountText: price.promotionAmountText\r\n };\r\n\r\n this.dataService.changeMessage(rechargeModel);\r\n this.contactsService.saveContact({ contacts: contacts, serviceType: 1 });\r\n this.router.navigate(['/verificacion-pago']);\r\n }\r\n\r\n onChangeSendMessage($event) {\r\n this.sendMessage = !this.sendMessage;\r\n if (!this.sendMessage) {\r\n this.phoneNumberForm.reset();\r\n }\r\n }\r\n\r\n getCurrentPrice() {\r\n if (this.prices.length == 0) {\r\n return 0;\r\n }\r\n return this.prices.find((p) => p.id == this.selectControl.value)\r\n .rechargePrice;\r\n }\r\n\r\n getTotalAmountToPay() {\r\n const price = this.prices.find(\r\n (p) => p.id == this.selectControl.value\r\n ).rechargePrice;\r\n return price - this.availableCashback > 0\r\n ? price - this.availableCashback\r\n : 0;\r\n }\r\n\r\n searchPhoneNumber = (text$: Observable) => {\r\n const debouncedText$ = text$.pipe(\r\n debounceTime(200),\r\n distinctUntilChanged()\r\n );\r\n const clicksWithClosedPopup$ = this.clickPhone$.pipe(\r\n filter(() => this.phoneNumberTypehead.isPopupOpen())\r\n );\r\n const inputFocus$ = this.focusPhone$;\r\n return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(\r\n map((term) =>\r\n term === ''\r\n ? this.phoneContacts.filter((v) => v.account !== '')\r\n : this.phoneContacts\r\n .filter(\r\n (v) =>\r\n v.account !== '' &&\r\n (v.account.slice(3) + ' | ' + v.name)\r\n .toLowerCase()\r\n .includes(term.toLocaleLowerCase())\r\n )\r\n .splice(0, 5)\r\n )\r\n );\r\n }\r\n\r\n formatterPhoneNumber = (x: { account: string; name: string }) => {\r\n if (x.account) {\r\n return x.account.slice(3);\r\n }\r\n }\r\n\r\n searchContactName = (text$: Observable) => {\r\n const debouncedText$ = text$.pipe(\r\n debounceTime(200),\r\n distinctUntilChanged()\r\n );\r\n const clicksWithClosedPopup$ = this.clickContactName$.pipe(\r\n filter(() => this.contactNameTypeahead.isPopupOpen())\r\n );\r\n const inputFocus$ = this.focusContactName$;\r\n return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(\r\n map((term) =>\r\n term === ''\r\n ? this.contacts.filter((v) => v.nautaAccount !== '' && v.name !== '')\r\n : this.contacts\r\n .filter(\r\n (v) =>\r\n v.nautaAccount !== '' &&\r\n v.name !== '' &&\r\n (v.nautaAccount + ' | ' + v.name)\r\n .toLowerCase()\r\n .includes(term.toLocaleLowerCase())\r\n )\r\n .splice(0, 5)\r\n )\r\n );\r\n }\r\n\r\n formatterContactName = (x: { name: string; nautaAccount: string }) => {\r\n if (x.name || x.nautaAccount) {\r\n return x.name;\r\n }\r\n }\r\n\r\n searchNautaAccount = (text$: Observable) => {\r\n const debouncedText$ = text$.pipe(\r\n debounceTime(200),\r\n distinctUntilChanged()\r\n );\r\n const clicksWithClosedPopup$ = this.clickNauta$.pipe(\r\n filter(() => this.nautaAccountTypeahead.isPopupOpen())\r\n );\r\n\r\n const inputFocus$ = this.focusNauta$;\r\n return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(\r\n map((term) =>\r\n term === ''\r\n ? this.contacts.filter((v) => v.nautaAccount !== '')\r\n : this.contacts\r\n .filter(\r\n (v) =>\r\n v.nautaAccount !== '' &&\r\n (v.nautaAccount + ' | ' + v.name)\r\n .toLowerCase()\r\n .includes(term.toLocaleLowerCase())\r\n )\r\n .splice(0, 5)\r\n )\r\n );\r\n }\r\n\r\n formatterNautaAccount = (x: { name: string; nautaAccount: string }) => {\r\n if (x.name || x.nautaAccount) {\r\n return x.nautaAccount;\r\n }\r\n }\r\n\r\n resultNautaAccount($event: NgbTypeaheadSelectItemEvent) {\r\n this.nautaAccount = $event.item;\r\n this.nautaAccountTypeahead._elementRef.nativeElement.value =\r\n $event.item.nautaAccount;\r\n }\r\n\r\n resultContact = ($event: NgbTypeaheadSelectItemEvent) => {\r\n this.contactName = $event.item;\r\n this.contactNameTypeahead._elementRef.nativeElement.value =\r\n $event.item.name;\r\n }\r\n\r\n onModalInfoCashback() {\r\n const modalRef = this.modalService.open(ModalQuestionCashbackComponent, {\r\n size: 'lg',\r\n });\r\n modalRef.componentInstance.availableCashback = this.availableCashback;\r\n modalRef.result\r\n .then(() => {\r\n if (this.openCashbackModal) {\r\n this.router.navigate(['nauta']);\r\n }\r\n })\r\n .catch(() => {\r\n if (this.openCashbackModal) {\r\n this.router.navigate(['nauta']);\r\n }\r\n });\r\n }\r\n\r\n onInfoEligibleCashback() {\r\n const modalRef = this.modalService.open(ModalEligibleCashbackComponent, {\r\n centered: true,\r\n windowClass: 'phone-verification',\r\n size: 'sm',\r\n });\r\n modalRef.componentInstance.eligibleCashback =\r\n this.selectedPrice.eligibleCashback;\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Routes, RouterModule } from '@angular/router';\r\nimport { NautaComponent } from './nauta.component';\r\nimport { ReactiveFormsModule, FormsModule } from '@angular/forms';\r\nimport { NgbModule } from '@ng-bootstrap/ng-bootstrap';\r\nimport {AuthGuard} from '@app/guards/auth.guard';\r\nimport { SharedModule } from '@app/shared/shared.module';\r\n\r\nconst routes: Routes = [\r\n{ path: '', component: NautaComponent, canActivate: [AuthGuard], data: { route: 'nauta' } },\r\n{ path: 'reembolso', component: NautaComponent, canActivate: [AuthGuard], data: { name: 'cashback', route: 'nauta/reembolso' } },\r\n];\r\n\r\n@NgModule({\r\n declarations: [ NautaComponent],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n RouterModule.forChild(routes),\r\n NgbModule,\r\n SharedModule\r\n ]\r\n})\r\nexport class NautaModule { }\r\n"]}