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KACAC,KACAC,KACAC,IACAC,KACAC,cAAsBpH,GACtBqH,SAWSd,GAAb","names":["AuthGuard","constructor","router","storageService","platformId","this","canActivate","route","state","isPlatformBrowser","isAuthenticated","authorizeSubject","next","authorize","url","data","navigateByUrl","i0","PLATFORM_ID","factory","contact","id","Name","name","Message","message","Phone","phone","Recaptcha","recaptcha","customValidator","CustomValidator","routes","path","component","formBuilder","urlService","toastr","config","dataService","contactsService","messageService","titleService","metaService","Subject","text$","debouncedText$","pipe","debounceTime","distinctUntilChanged","clicksWithClosedPopup$","clickPhone$","filter","phoneNumberTypeahead","isPopupOpen","merge","focusPhone$","map","term","contacts","v","account","slice","toLowerCase","includes","toLocaleLowerCase","splice","x","clickContactName$","contactNameTypeahead","focusContactName$","$event","contactName","item","_elementRef","nativeElement","value","phoneNumber","showHint","focusFirst","messages","ngOnInit","updateTag","content","description","keywords","property","title","environment","setTitle","loading","loading$","loadingChange","loadingChange$","changeUrl","footer","emit","smsForm","group","Validators","phoneValidator","get","valueChanges","subscribe","text_Length","length","messageLength","getContacts","then","result","getIZCR","izcr","getMessages","ngOnDestroy","navigationSubscription","unsubscribe","sendSms","pristine","error","invalid","getRawValue","messageToSend","MessageModel","success","catch","status","getSms","changeGetSms","activeGuard","navigate","countSymbols","string","SmsComponent","selectors","ctx","SmsModule","provide","RECAPTCHA_SETTINGS","useValue","siteKey","ContactsService","MessageService","imports","CommonModule","FormsModule","ReactiveFormsModule","RecaptchaModule","RecaptchaFormsModule","RouterModule","NgbTypeaheadModule"],"sources":["webpack:///src/app/guards/auth.guard.ts","webpack:///src/app/models/message.model.ts","webpack:///src/app/sms/sms.component.html","webpack:///src/app/sms/sms.component.ts","webpack:///src/app/sms/sms.module.ts"],"sourcesContent":["/**\r\n * Created by Elaine Lopez on 4/19/2019.\r\n */\r\n\r\nimport { Injectable, Inject, PLATFORM_ID } from '@angular/core';\r\nimport { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\r\nimport { StorageService } from '@app/services/storage.service';\r\nimport { isPlatformBrowser } from '@angular/common';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthGuard implements CanActivate {\r\n constructor(private router: Router,\r\n private storageService: StorageService,\r\n @Inject(PLATFORM_ID) private platformId) { }\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (isPlatformBrowser(this.platformId)) {\r\n if (this.storageService.isAuthenticated()) {\r\n // logged in so return true\r\n return true;\r\n }\r\n // not logged in so redirect to home page\r\n this.storageService.authorizeSubject.next({ 'authorize': false, 'url': route.data.route });\r\n this.router.navigateByUrl(this.router.url);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n}\r\n","export class MessageModel {\r\n id: number;\r\n Name: string;\r\n Message: string;\r\n Phone: string;\r\n Recaptcha: string;\r\n\r\n constructor(contact?) {\r\n contact = contact;\r\n this.id = contact.id,\r\n this.Name = contact.name;\r\n this.Message = contact.message;\r\n this.Phone = contact.phone;\r\n this.Recaptcha = contact.recaptcha;\r\n }\r\n}","
\r\n
\r\n
\r\n \r\n

Mensajes de texto

\r\n
\r\n

\r\n # SMS Disponibles {{messages}}\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
\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
\r\n \r\n Caracteres restantes:\r\n {{messageLength}}\r\n
\r\n
\r\n El texto del mensaje es obligatorio\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n Por favor, valida el captcha para continuar con la solicitud\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 \"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 { Component, OnInit, ViewChild, OnDestroy, Inject, PLATFORM_ID } from '@angular/core';\r\nimport { UrlService } from '@app/services/url.service';\r\nimport { DataService } from '@app/services/data.service';\r\nimport { ToastrService } from 'ngx-toastr';\r\nimport { Router, NavigationEnd } from '@angular/router';\r\nimport { CustomValidator } from '@app/helpers/validators';\r\nimport { FormGroup, FormBuilder, Validators } from '@angular/forms';\r\nimport { ContactsService } from '@app/services/contacts.service';\r\nimport { NgbTypeaheadConfig, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap';\r\nimport { Observable, Subject, merge } from 'rxjs';\r\nimport { debounceTime, distinctUntilChanged, map, filter } from 'rxjs/operators';\r\nimport { MessageService } from '@app/services/message.service';\r\nimport { MessageModel } from '@app/models/message.model';\r\nimport { isPlatformBrowser } from '@angular/common';\r\nimport { Title, Meta } from '@angular/platform-browser';\r\nimport { toUnicode, ucs2 } from 'punycode';\r\nimport { environment } from '@env/environment.prod';\r\nconst regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\r\nconst customValidator = CustomValidator;\r\nconst textLength = 160;\r\n\r\n@Component({\r\n selector: 'app-sms',\r\n templateUrl: './sms.component.html',\r\n styleUrls: ['./sms.component.css'],\r\n})\r\nexport class SmsComponent implements OnInit, OnDestroy {\r\n\r\n @ViewChild('instanceContact', { static: false })\r\n contactNameTypeahead: any;\r\n\r\n @ViewChild('instancePhoneNumber', { static: false })\r\n phoneNumberTypeahead: any;\r\n\r\n contacts: any[];\r\n izcr: boolean;\r\n messages: number;\r\n\r\n phoneNumber: any;\r\n contactName: any;\r\n\r\n smsForm: FormGroup;\r\n submittedSmsError = false;\r\n submittedSms = false;\r\n messageLength = 160;\r\n\r\n navigationSubscription: any;\r\n loading: Observable;\r\n loadingChange: Observable;\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 title = 'Envía «【 SMS a Cuba 】» por solo 0.04 centavos con Cubatel 🥇';\r\n description = 'Envía «【 SMS a Cuba 】» por solo 0.04 centavos con Cubatel desde el exterior ✅ Mensajes al instante para familiares y amigos en Cuba ➤ ¡Pincha AQUÍ!';\r\n keywords='enviar sms a cuba, sms a cuba, sms to cuba, sms gratis a cuba sin registrarse, sms para cuba';\r\n url = this.router.url;\r\n\r\n constructor(\r\n private formBuilder: FormBuilder,\r\n private urlService: UrlService,\r\n private router: Router,\r\n private toastr: ToastrService,\r\n private config: NgbTypeaheadConfig,\r\n private dataService: DataService,\r\n private contactsService: ContactsService,\r\n private messageService: MessageService,\r\n private titleService: Title,\r\n private metaService: Meta,\r\n @Inject(PLATFORM_ID) private platformId,\r\n\r\n ) {\r\n\r\n config.showHint = false;\r\n config.focusFirst = true;\r\n this.contacts = [];\r\n this.messages = 0;\r\n }\r\n\r\n ngOnInit() {\r\n this.metaService.updateTag({ name: 'description', content: this.description });\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({ property: 'og:description', content: this.description });\r\n this.metaService.updateTag({ property: 'og:url', content: `${environment.host}${this.router.url}` });\r\n\r\n this.titleService.setTitle(this.title);\r\n\r\n this.loading = this.messageService.loading$;\r\n this.loadingChange = this.messageService.loadingChange$;\r\n this.urlService.changeUrl(this.router.url);\r\n this.urlService.footer.emit();\r\n this.smsForm = this.formBuilder.group({\r\n message: ['', Validators.required],\r\n contactName: '',\r\n phoneNumber: ['', [Validators.required, customValidator.phoneValidator]],\r\n recaptcha: [false, Validators.required]\r\n });\r\n\r\n this.smsForm.get('message').valueChanges\r\n .subscribe(() => {\r\n\r\n const text_Length = this.smsForm.get('message').value.length;\r\n this.messageLength = textLength - text_Length;\r\n });\r\n\r\n if (isPlatformBrowser(this.platformId)) {\r\n this.contactsService.getContacts()\r\n .then(result => this.contacts = result);\r\n\r\n this.contactsService.getIZCR()\r\n .then((result: boolean) => this.izcr = result);\r\n\r\n this.messageService.getMessages()\r\n .then((result: number) => this.messages = result);\r\n }\r\n\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this.navigationSubscription) {\r\n this.navigationSubscription.unsubscribe();\r\n }\r\n }\r\n\r\n sendSms() {\r\n\r\n if (this.smsForm.pristine) {\r\n this.toastr.error('Por favor verifique el número de teléfono.');\r\n return;\r\n }\r\n\r\n if (this.smsForm.invalid) {\r\n return;\r\n }\r\n\r\n const data = this.smsForm.getRawValue();\r\n const messageToSend = new MessageModel(data);\r\n messageToSend.Name = this.contactNameTypeahead._elementRef.nativeElement.value;\r\n messageToSend.Phone = this.phoneNumberTypeahead._elementRef.nativeElement.value;\r\n this.messageService.sendSms(messageToSend)\r\n .then(() => {\r\n this.messages--;\r\n this.toastr.success('Su mensaje ha sido enviando correctamente');\r\n })\r\n .catch(error => {\r\n if (error.status != 401) {\r\n this.toastr.error('Ha ocurrido un error, su mensaje no ha sido enviado');\r\n }\r\n });\r\n this.smsForm = this.formBuilder.group({\r\n message: ['', Validators.required],\r\n contactName: '',\r\n phoneNumber: ['', [Validators.required, customValidator.phoneValidator]],\r\n recaptcha: [null, Validators.required]\r\n });\r\n this.messageLength = 160;\r\n this.smsForm.get('message').valueChanges\r\n .subscribe(() => {\r\n const text_Length = this.smsForm.get('message').value.length;\r\n this.messageLength = textLength - text_Length;\r\n });\r\n }\r\n\r\n getSms() {\r\n this.dataService.changeGetSms({ izcr: this.izcr, activeGuard: true });\r\n this.router.navigate(['/verificacion-pago/sms']);\r\n }\r\n\r\n searchPhoneNumber = (text$: Observable) => {\r\n const debouncedText$ = text$.pipe(debounceTime(200),\r\n distinctUntilChanged());\r\n const clicksWithClosedPopup$ = this.clickPhone$.pipe(filter(() =>\r\n this.phoneNumberTypeahead.isPopupOpen()\r\n ));\r\n const inputFocus$ = this.focusPhone$;\r\n return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(\r\n map(term => term === '' ? this.contacts.filter(v => v.account !== '')\r\n : this.contacts.filter(v => v.account !== '' && (v.account.slice(3) + ' | ' + v.name).toLowerCase().includes(term.toLocaleLowerCase())).splice(0, 5))\r\n );\r\n }\r\n\r\n formatterPhoneNumber = (x: { account: string, name: string }) => {\r\n if (x.name || 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(debounceTime(200),\r\n distinctUntilChanged());\r\n const clicksWithClosedPopup$ = this.clickContactName$.pipe(filter(() =>\r\n this.contactNameTypeahead.isPopupOpen()\r\n ));\r\n const inputFocus$ = this.focusContactName$;\r\n return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(\r\n map(term => term === '' ? this.contacts.filter(v => v.name !== '' && v.account !== '')\r\n : this.contacts.filter(v => (v.name !== '' && v.account !== '') && (v.account.slice(3) + ' | ' + v.name).toLowerCase().includes(term.toLocaleLowerCase())).splice(0, 5))\r\n );\r\n }\r\n\r\n formatterContactName = (x: { name: string, account: string }) => {\r\n if (x.name || x.account) {\r\n return x.name;\r\n }\r\n }\r\n\r\n resultContact = ($event: NgbTypeaheadSelectItemEvent) => {\r\n this.contactName = $event.item;\r\n this.contactNameTypeahead._elementRef.nativeElement.value = $event.item.name;\r\n }\r\n\r\n resultPhone = ($event: NgbTypeaheadSelectItemEvent) => {\r\n this.phoneNumber = $event.item;\r\n this.phoneNumberTypeahead._elementRef.nativeElement.value = $event.item.account.slice(3);\r\n }\r\n\r\n countSymbols(string) {\r\n return [...string].length;\r\n }\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 { SmsComponent } from './sms.component';\r\nimport { BrowserModule } from '@angular/platform-browser';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';\r\nimport { RecaptchaModule, RecaptchaFormsModule, RECAPTCHA_SETTINGS, RecaptchaSettings } from 'ng-recaptcha';\r\nimport { AuthGuard } from '@app/guards/auth.guard';\r\nimport { MessageService } from '@app/services/message.service';\r\nimport { ContactsService } from '@app/services/contacts.service';\r\n\r\nconst routes: Routes = [\r\n { path: '', component: SmsComponent, canActivate: [AuthGuard], data: { route: 'sms' } },\r\n];\r\n\r\n@NgModule({\r\n declarations: [SmsComponent],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n RecaptchaModule,\r\n RecaptchaFormsModule,\r\n RouterModule.forChild(routes),\r\n NgbTypeaheadModule\r\n ],\r\n providers: [\r\n {\r\n provide: RECAPTCHA_SETTINGS,\r\n useValue: { siteKey: '6LeSMiUTAAAAAF5apPSCnD0IL-MNutpV2bHQJIdX' } as RecaptchaSettings,\r\n },\r\n ContactsService,\r\n MessageService\r\n ],\r\n})\r\nexport class SmsModule { }\r\n"]}