iptdevs-design-system 2.7.29 → 2.7.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/esm2020/lib/cod/cod-documents-section/cod-documents-section.component.mjs +16 -0
  2. package/esm2020/lib/cod/cod-form/cod-form.component.mjs +227 -0
  3. package/esm2020/lib/cod/cod.module.mjs +86 -0
  4. package/esm2020/lib/cod/logic/calculate-quotes.service.mjs +72 -0
  5. package/esm2020/lib/cod/logic/cod-form-controls.mjs +91 -0
  6. package/esm2020/lib/cod/logic/cod-form-steps.mjs +29 -0
  7. package/esm2020/lib/cod/logic/communicator.service.mjs +28 -0
  8. package/esm2020/lib/cod/logic/local-storage-cod.service.mjs +39 -0
  9. package/esm2020/lib/cod/steps/cod-form-step-five/cod-form-step-five.component.mjs +145 -0
  10. package/esm2020/lib/cod/steps/cod-form-step-four/cod-form-step-four.component.mjs +251 -0
  11. package/esm2020/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.mjs +200 -0
  12. package/esm2020/lib/cod/steps/cod-form-step-three/cod-form-step-three.component.mjs +175 -0
  13. package/esm2020/lib/cod/steps/cod-form-step-two/cod-form-step-two.component.mjs +255 -0
  14. package/esm2020/lib/core/core.module.mjs +6 -3
  15. package/esm2020/lib/core/services/copies.service.mjs +17 -0
  16. package/esm2020/lib/core/utils/copies.mjs +214 -0
  17. package/esm2020/lib/design-system.module.mjs +8 -4
  18. package/esm2020/public-api.mjs +19 -1
  19. package/fesm2015/iptdevs-design-system.mjs +1790 -51
  20. package/fesm2015/iptdevs-design-system.mjs.map +1 -1
  21. package/fesm2020/iptdevs-design-system.mjs +1790 -51
  22. package/fesm2020/iptdevs-design-system.mjs.map +1 -1
  23. package/lib/cod/cod-documents-section/cod-documents-section.component.d.ts +8 -0
  24. package/lib/cod/cod-form/cod-form.component.d.ts +37 -0
  25. package/lib/cod/cod.module.d.ts +20 -0
  26. package/lib/cod/logic/calculate-quotes.service.d.ts +14 -0
  27. package/lib/cod/logic/cod-form-controls.d.ts +16 -0
  28. package/lib/cod/logic/cod-form-steps.d.ts +15 -0
  29. package/lib/cod/logic/communicator.service.d.ts +13 -0
  30. package/lib/cod/logic/local-storage-cod.service.d.ts +8 -0
  31. package/lib/cod/steps/cod-form-step-five/cod-form-step-five.component.d.ts +31 -0
  32. package/lib/cod/steps/cod-form-step-four/cod-form-step-four.component.d.ts +47 -0
  33. package/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.d.ts +46 -0
  34. package/lib/cod/steps/cod-form-step-three/cod-form-step-three.component.d.ts +35 -0
  35. package/lib/cod/steps/cod-form-step-two/cod-form-step-two.component.d.ts +44 -0
  36. package/lib/core/services/copies.service.d.ts +7 -0
  37. package/lib/core/utils/copies.d.ts +1 -0
  38. package/lib/design-system.module.d.ts +2 -1
  39. package/package.json +1 -1
  40. package/public-api.d.ts +14 -0
@@ -4,6 +4,10 @@ import * as i3 from 'ng2-currency-mask';
4
4
  import { CurrencyMaskModule } from 'ng2-currency-mask';
5
5
  import * as i1 from '@angular/common';
6
6
  import { CommonModule, CurrencyPipe, TitleCasePipe } from '@angular/common';
7
+ import * as i11 from 'primeng/api';
8
+ import { MessageService } from 'primeng/api';
9
+ import * as i5$2 from 'primeng/tabview';
10
+ import { TabViewModule } from 'primeng/tabview';
7
11
  import * as i1$1 from '@angular/forms';
8
12
  import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
13
  import Swal from 'sweetalert2';
@@ -18,6 +22,14 @@ import * as i6 from '@angular/material/list';
18
22
  import { MatListModule } from '@angular/material/list';
19
23
  import { MatIconModule } from '@angular/material/icon';
20
24
  import { MatButtonModule } from '@angular/material/button';
25
+ import * as i7 from 'primeng/button';
26
+ import { ButtonModule } from 'primeng/button';
27
+ import * as moment from 'moment';
28
+ import { BehaviorSubject, map } from 'rxjs';
29
+ import * as i9 from 'primeng/table';
30
+ import { TableModule } from 'primeng/table';
31
+ import * as i5$1 from '@angular/material/checkbox';
32
+ import { MatCheckboxModule } from '@angular/material/checkbox';
21
33
  import * as i1$3 from '@angular/router';
22
34
 
23
35
  class AsideButtonComponent {
@@ -1829,6 +1841,444 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
1829
1841
  }]
1830
1842
  }] });
1831
1843
 
1844
+ class CodDocumentsSectionComponent {
1845
+ constructor() { }
1846
+ ngOnInit() {
1847
+ }
1848
+ }
1849
+ CodDocumentsSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodDocumentsSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1850
+ CodDocumentsSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodDocumentsSectionComponent, selector: "ipt-cod-documents-section", ngImport: i0, template: "<div class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\n\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">Documentos del COD</span>\n\n <div *ngFor=\"let item of [1,2,3,4,5]\" class=\"document_item flex align-items-center p-2 border-round\">\n <span>Documento de identidad</span>\n <div class=\"ml-auto\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\"></button>\n </div>\n </div>\n\n <hr>\n <button pButton pRipple type=\"button\" icon=\"pi pi-plus\" label=\"Agregar\" class=\"p-button-rounded p-button-sm ml-auto mt-2\"></button>\n\n</div>\n", styles: [".document_item{transition:.15s;gap:1rem;max-height:150px}.document_item:hover{cursor:pointer;box-shadow:#64646f33 0 7px 29px}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
1851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodDocumentsSectionComponent, decorators: [{
1852
+ type: Component,
1853
+ args: [{ selector: 'ipt-cod-documents-section', template: "<div class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\n\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">Documentos del COD</span>\n\n <div *ngFor=\"let item of [1,2,3,4,5]\" class=\"document_item flex align-items-center p-2 border-round\">\n <span>Documento de identidad</span>\n <div class=\"ml-auto\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\"></button>\n </div>\n </div>\n\n <hr>\n <button pButton pRipple type=\"button\" icon=\"pi pi-plus\" label=\"Agregar\" class=\"p-button-rounded p-button-sm ml-auto mt-2\"></button>\n\n</div>\n", styles: [".document_item{transition:.15s;gap:1rem;max-height:150px}.document_item:hover{cursor:pointer;box-shadow:#64646f33 0 7px 29px}\n"] }]
1854
+ }], ctorParameters: function () { return []; } });
1855
+
1856
+ class LocalStorageCODService {
1857
+ constructor() { }
1858
+ getCodFormData(step, control) {
1859
+ if (step === 1)
1860
+ return localStorage.getItem(`COD FORM - step1(${control})`);
1861
+ if (step === 2)
1862
+ return localStorage.getItem(`COD FORM - step2(${control})`);
1863
+ if (step === 3)
1864
+ return localStorage.getItem(`COD FORM - step3(${control})`);
1865
+ if (step === 4)
1866
+ return localStorage.getItem(`COD FORM - step4(${control})`);
1867
+ if (step === 5)
1868
+ return localStorage.getItem(`COD FORM - step5(${control})`);
1869
+ return null;
1870
+ }
1871
+ setCodFormData(step, control, value) {
1872
+ if (step === 1)
1873
+ localStorage.setItem(`COD FORM - step1(${control})`, value);
1874
+ if (step === 2)
1875
+ localStorage.setItem(`COD FORM - step2(${control})`, value);
1876
+ if (step === 3)
1877
+ localStorage.setItem(`COD FORM - step3(${control})`, value);
1878
+ if (step === 4)
1879
+ localStorage.setItem(`COD FORM - step4(${control})`, value);
1880
+ if (step === 5)
1881
+ localStorage.setItem(`COD FORM - step5(${control})`, value);
1882
+ }
1883
+ }
1884
+ LocalStorageCODService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: LocalStorageCODService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1885
+ LocalStorageCODService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: LocalStorageCODService, providedIn: 'root' });
1886
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: LocalStorageCODService, decorators: [{
1887
+ type: Injectable,
1888
+ args: [{
1889
+ providedIn: 'root'
1890
+ }]
1891
+ }], ctorParameters: function () { return []; } });
1892
+
1893
+ class CodFormControls {
1894
+ constructor() {
1895
+ this.controls = [
1896
+ [
1897
+ { name: 'academic_plan', required: true, description: 'Plan académico' },
1898
+ { name: 'course_type', required: true, description: 'Tipo de curso' },
1899
+ { name: 'agreement_by_category', required: true, description: 'Convenio' },
1900
+ { name: 'english_level', required: true, description: 'Nivel de inglés' },
1901
+ { name: 'availible_courses', required: false, description: 'Cursos disponibles' },
1902
+ ],
1903
+ [
1904
+ { name: 'student_address', required: true, description: 'Dirección del estudiante' },
1905
+ { name: 'birthdate', required: true, description: 'Fecha de nacimiento del estudiante' },
1906
+ { name: 'country', required: true, description: 'País' },
1907
+ { name: 'state', required: true, description: 'Departamento o estado' },
1908
+ { name: 'city', required: true, description: 'Ciudad de residencia' },
1909
+ { name: 'student_id_card_type', required: true, description: 'Tipo de documento del estudiante' },
1910
+ { name: 'student_id_card', required: true, description: 'Documento del estudiante' },
1911
+ { name: 'student_last_name', required: true, description: 'Apellidos del estudiante' },
1912
+ { name: 'student_name', required: true, description: 'Nombres del estudiante' },
1913
+ { name: 'student_email', required: true, description: 'Correo del estudiante' },
1914
+ { name: 'nickname', required: true, description: 'Alias o nickname' },
1915
+ { name: 'gender', required: true, description: 'Género' },
1916
+ { name: 'age', required: true, description: 'Edad' },
1917
+ { name: 'student_occupation', required: true, description: 'Ocupación del estudiante' },
1918
+ { name: 'stratum', required: true, description: 'Estrato del estudiante' },
1919
+ { name: 'grade', required: true, description: 'Grado del estudiante' },
1920
+ { name: 'civil_status', required: true, description: 'Estado civil del estudiante' },
1921
+ { name: 'student_phone_indicative', required: true, description: 'Indicativo del estudiante' },
1922
+ { name: 'student_phone_number', required: true, description: 'Teléfono del estudiante' },
1923
+ { name: 'password', required: true, description: 'Contraseña del estudiante' },
1924
+ { name: 're_password', required: true, description: 'Confirmación de contraseña' },
1925
+ ],
1926
+ [
1927
+ { name: 'parent_id_card_type', required: true, description: 'Tipo de documento del acudiente' },
1928
+ { name: 'parent_id_card', required: true, description: 'Documento del acudiente' },
1929
+ { name: 'parent_last_name', required: true, description: 'Apellidos del acudiente' },
1930
+ { name: 'parent_name', required: true, description: 'Nombres del acudiente' },
1931
+ { name: 'needAtendant', required: true, description: '¿Requiere acudiente?' },
1932
+ { name: 'parent_phone_indicative', required: true, description: 'Indicativo del acudiente' },
1933
+ { name: 'parent_occupation', required: true, description: 'Ocupación del acudiente' },
1934
+ { name: 'parent_address', required: true, description: 'Dirección del acudiente' },
1935
+ { name: 'parent_phone_number', required: true, description: 'Teléfono del acudiente' }
1936
+ ],
1937
+ [
1938
+ { name: 'payment_date', required: true, description: 'Fecha de pago' },
1939
+ { name: 'program_price', required: true, description: 'Valor total del programa' },
1940
+ { name: 'payment_method', required: true, description: 'Método de pago' },
1941
+ { name: 'quota_times', required: true, description: 'Cantidad de cuotas' },
1942
+ { name: 'total_price', required: true, description: 'Precio total de la matricula' },
1943
+ ],
1944
+ [
1945
+ { name: 'marketing_reasons', required: true, description: '¿Cómo se enteró del programa?' },
1946
+ { name: 'observation', required: false, description: 'Observación' },
1947
+ { name: 'study_reasons', required: true, description: 'Motivo' },
1948
+ { name: 'terms', required: true, description: 'Términos y condiciones' },
1949
+ { name: 'disability', required: false, description: 'Discapacidad' },
1950
+ { name: 'multiculturalism_1', required: false, description: 'Multiculturalismo' },
1951
+ { name: 'multiculturalism_2', required: false, description: 'Multiculturalismo' },
1952
+ { name: 'multiculturalism_3', required: false, description: 'Multiculturalismo' },
1953
+ { name: 'multiculturalism_4', required: false, description: 'Multiculturalismo' },
1954
+ { name: 'multiculturalism_5', required: false, description: 'Multiculturalismo' },
1955
+ { name: 'multiculturalism_6', required: false, description: 'Multiculturalismo' },
1956
+ { name: 'health_regimen', required: true, description: 'Régimen de salud' }
1957
+ ],
1958
+ ];
1959
+ this.$controls = new BehaviorSubject([]);
1960
+ }
1961
+ getControlValues() {
1962
+ return this.$controls.asObservable();
1963
+ }
1964
+ // Cambiar los valores de los controls, ejemplo: true y false del checkbox
1965
+ changeValue(step, controlName, newValue) {
1966
+ const controls = Object.assign({}, this.controls);
1967
+ let control = controls[step - 1].filter(element => element.name === controlName);
1968
+ control[0].required = newValue;
1969
+ this.$controls.next(controls);
1970
+ }
1971
+ }
1972
+ CodFormControls.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormControls, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1973
+ CodFormControls.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormControls, providedIn: 'root' });
1974
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormControls, decorators: [{
1975
+ type: Injectable,
1976
+ args: [{
1977
+ providedIn: 'root'
1978
+ }]
1979
+ }], ctorParameters: function () { return []; } });
1980
+
1981
+ class CommercialService extends IPTGeneralService {
1982
+ constructor(http) {
1983
+ super();
1984
+ this.http = http;
1985
+ this.SERVICE_URL = 'commercial/api/';
1986
+ this.SERVICE_URL = this.baseUrl() + this.SERVICE_URL;
1987
+ }
1988
+ createCOD(request) {
1989
+ let serviceUrl = this.SERVICE_URL + 'post/cod';
1990
+ this.generateRequestParams(request);
1991
+ return this.http.post(serviceUrl, this.httpOptions);
1992
+ }
1993
+ getStudentCodHistory(token, student_id_card) {
1994
+ let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/student';
1995
+ this.generateRequestParams({ token, student_id_card });
1996
+ return this.http.post(serviceUrl, this.httpOptions);
1997
+ }
1998
+ getCodHistoryAll(userToken) {
1999
+ let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/all';
2000
+ this.generateRequestParams(userToken);
2001
+ return this.http.post(serviceUrl, this.httpOptions);
2002
+ }
2003
+ getCodHistoryByCourse(request) {
2004
+ let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/course';
2005
+ this.generateRequestParams(request);
2006
+ return this.http.post(serviceUrl, this.httpOptions);
2007
+ }
2008
+ getDiscountCoupons(params) {
2009
+ let serviceUrl = this.SERVICE_URL + 'post/discount/coupon/search';
2010
+ this.generateRequestParams(params);
2011
+ return this.http.post(serviceUrl, this.httpOptions);
2012
+ }
2013
+ getCodPricesByAgreement(code) {
2014
+ let serviceUrl = this.SERVICE_URL + 'get/cod/prices/by/agreement/' + code;
2015
+ this.generateRequestParams(code);
2016
+ return this.http.get(serviceUrl, this.httpOptions);
2017
+ }
2018
+ }
2019
+ CommercialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2020
+ CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, providedIn: 'root' });
2021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, decorators: [{
2022
+ type: Injectable,
2023
+ args: [{ providedIn: 'root' }]
2024
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
2025
+
2026
+ class CodFormSteps {
2027
+ constructor() {
2028
+ this.localStorageCOD = new LocalStorageCODService();
2029
+ }
2030
+ readAndWriteLS(step, control) {
2031
+ if (this.localStorageCOD.getCodFormData(step, control)) {
2032
+ const value = this.localStorageCOD.getCodFormData(step, control);
2033
+ return { control, value };
2034
+ }
2035
+ else {
2036
+ return { control, value: '' };
2037
+ }
2038
+ }
2039
+ setDataInLocalStorage(step, control, value) {
2040
+ this.localStorageCOD.setCodFormData(step, control, value);
2041
+ }
2042
+ listenFormChanges(step, control, obs) {
2043
+ obs.subscribe(value => {
2044
+ this.setDataInLocalStorage(step, control, value);
2045
+ });
2046
+ }
2047
+ resetLocalStorage(controls) {
2048
+ controls.forEach(control => {
2049
+ localStorage.removeItem(control.name);
2050
+ });
2051
+ }
2052
+ }
2053
+
2054
+ const copies = {
2055
+ "es": {
2056
+ "modal_template": {
2057
+ "inputs": {
2058
+ "city": "Ingrese su ciudad de residencia",
2059
+ "country": "Ingresa tu pais de residencia",
2060
+ "comments": "Ingresa tus comentarios de registro ( Opcional )",
2061
+ "date_of_birth": "Ingresa tu fecha de nacimiento",
2062
+ "email": "Correo electronico",
2063
+ "id_card": "Documento de identidad",
2064
+ "last_name": "Apellidos",
2065
+ "name": "Nombres",
2066
+ "phone_number": "Numero de teléfono",
2067
+ "password": "Contraseña",
2068
+ "re_password": "Repetir contraseña",
2069
+ "role": "Seleccione el rol",
2070
+ "service_hour": "Horas de servicio",
2071
+ "id_card_type": "Ingresa tu tipo de documento",
2072
+ "phone_indicative": "Seleccione su indicativo",
2073
+ "state": "Seleccione su departamento",
2074
+ "file": "Seleccionar archivo",
2075
+ "contacted_contact": "Contactado...",
2076
+ "status_contact": "Status",
2077
+ "plan_contact": "Tipo Plan",
2078
+ "observations_contact": "Observaciones",
2079
+ },
2080
+ "validators": {
2081
+ "city": "Debe ingresar la ciudad de residencia",
2082
+ "country": "Debes ingresar el pais de residencia",
2083
+ "date_of_birth": "Debes ingrese la fecha de nacimiento",
2084
+ "email": "Recuerda usar correos con dominio @inglesparatodos.edu.co",
2085
+ "id_card": "Debes ingresar el número de documento.",
2086
+ "last_name": "Debes ingresar los apellidos del usuario.",
2087
+ "name": "Debes ingresar el nombre del usuario",
2088
+ "phone_number": "Debes ingresar un número de teléfono valido",
2089
+ "password": "Debe ser de minimo 7 digitos",
2090
+ "re_password": "Debe ser de minimo 7 digitos",
2091
+ "role": "Debe seleccionar un rol",
2092
+ "service_hour": "Debe ingresar las horas de servicio",
2093
+ "id_card_type": "Debes ingresar el tipo de documento",
2094
+ "phone_indicative": "Debes seleccionar un indicativo",
2095
+ "state": "Seleccione el departamento",
2096
+ "id_document": "Debe subir un archivo",
2097
+ "agreement_document": "Debe subir un archivo",
2098
+ "parent_id_document": "Debe subir un archivo",
2099
+ "comfanorte_document": "Debe subir un archivo",
2100
+ "contacted_contact": "Debe seleccionar forma de contactar cliente",
2101
+ "status_contact": "Debe seleccionar un estaus.",
2102
+ "plan_contact": "Debe seleccionar un plan",
2103
+ "observariones_contact": "Debe llenar el campo observaciones",
2104
+ }
2105
+ },
2106
+ "dashboard_template": {
2107
+ "inputs": {
2108
+ "agreement_by_category": "Convenio por categoria",
2109
+ "academic_level": "Ingrese el nivel academico ( Pregrado / Posgrado )",
2110
+ "academic_plan": 'Plan',
2111
+ "address": "ingrese su direccion",
2112
+ "agreement": "ingrese el convenio",
2113
+ "availible_courses": "Grupos disponibles",
2114
+ "birthdate": "Ingresa tu fecha de nacimiento",
2115
+ "city": "Ingrese su ciudad de residencia",
2116
+ "classroom": "Grupos Disponibles",
2117
+ "country": "Ingresa tu pais de residencia",
2118
+ "course_type": "Tipo de plan",
2119
+ "degree": "Nivel universitario",
2120
+ "comments": "Ingresa tus comentarios de registro ( Opcional )",
2121
+ "email": "Correo electronico",
2122
+ "email_ufps": "ingresa el correo electronico con dominio ufps.edu.co",
2123
+ "email_unipamplona": "Ingresa el correo con dominio unipamplona.edu.co",
2124
+ "financing_value": "Valor pagado",
2125
+ "financing_date": "Fecha de pago",
2126
+ "financing_responsable": "Recibido por",
2127
+ "financing_sales_check": "Numero de recibo",
2128
+ "financing_invoice_number": "Numero de recibo",
2129
+ "id_cod": "Numero de inscripcion",
2130
+ "id_card_type": "Ingresa tu tipo de documento",
2131
+ "id_card": "Documento de identidad",
2132
+ "id_financing": "Consecutivo",
2133
+ "id_payment": "Ingrese el número de recibo",
2134
+ "last_name": "Apellidos",
2135
+ "name": "Ingrese los nombres",
2136
+ "nickname": "Nickname",
2137
+ "needAtendant": "¿Requiere acudiente?",
2138
+ "marketing_reasons": "¿Cómo se entero del programa?",
2139
+ "level": "Seleccione el nivel",
2140
+ "observation": "Observaciones",
2141
+ "occupation": "Ocupacion",
2142
+ "password": "Contraseña",
2143
+ "phone_indicative": "Seleccione su indicativo",
2144
+ "phone_number": "Numero de teléfono",
2145
+ "paymentMethod": "Seleccione el metodo de pago",
2146
+ "payment_date": "Ingresa la fecha de pago",
2147
+ "program": "Ingrese el programa academico",
2148
+ "first_quota_price": "Ingrese el valor de la primera cuota",
2149
+ "quota_times": "Ingresar el numero de cuotas",
2150
+ "role": "Seleccione el rol",
2151
+ "re_password": "Repetir contraseña",
2152
+ "re_total_price": "Confirmar el valor total de la matricula",
2153
+ "service_hour": "Horas de servicio",
2154
+ "semester": "Semestre actual",
2155
+ "school_name": "Ingrese el nombre del colegio",
2156
+ "school_grade": "Grado escolar",
2157
+ "state": "Seleccione su departamento",
2158
+ "study_reasons": "Motivo",
2159
+ "total_price": "Ingrese el monto total de la matricula",
2160
+ "ufps_code": "Ingrese el codigo UFPS",
2161
+ "unipamplona_code": "Ingresa tu codigo UniPamplona",
2162
+ "type_coupon": "Ingrese el tipo de cupon"
2163
+ },
2164
+ "validators": {
2165
+ "academic_level": "Ingrese el nivel academico ( Pregrado / Posgrado )",
2166
+ "academic_plan": 'Plan',
2167
+ "address": "Debes ingresar su direccion",
2168
+ "agreement_by_category": "Convenio por categoria",
2169
+ "availible_courses": "Debes seleccionar el grupo",
2170
+ "birthdate": "Debes ingresar tu fecha de nacimiento",
2171
+ "city": "Debes ingresar la ciudad de residencia",
2172
+ "classroom": "Debe seleccionar los grupos disponibles",
2173
+ "country": "Debes ingresar el pais de residencia",
2174
+ "degree": "Debe seleccionar el nivel universitario",
2175
+ "email": "Recuerda usar correos con dominio @inglesparatodos.edu.co",
2176
+ "email_ufps": "ingresa el correo electronico con dominio ufps.edu.co",
2177
+ "email_unipamplona": "Ingresa el correo con dominio unipamplona.edu.co",
2178
+ "financing_value": "Debe ingresar el valor pagado de la cuota",
2179
+ "financing_date": "Debe ingresar la fecha de realizacion del pago",
2180
+ "financing_responsable": "Debe ingresar el nombre de quien recibe el pago",
2181
+ "financing_sales_check": "Debe ingresar el numero de recibo",
2182
+ "financing_invoice_number": "Debes ingresar el numero de recibo",
2183
+ "id_cod": "Ingrese el numero de inscripcion",
2184
+ "id_card_type": "Debes ingresar el tipo de documento",
2185
+ "id_card": "Debes ingresar el número de documento.",
2186
+ "id_payment": "Debe ingresar el número de recibo",
2187
+ "last_name": "Debes ingresar los apellidos del usuario.",
2188
+ "name": "Debes ingresar el nombre del usuario",
2189
+ "nickname": "Debes ingresar el nickname",
2190
+ "marketing_reasons": "¿Cómo se entero del programa?",
2191
+ "needAtendant": "Debes ingresar si requiere o no acudiente",
2192
+ "level": "Seleccione el nivel",
2193
+ "observation": "Observaciones",
2194
+ "occupation": "Debes ingresar la ocupacion",
2195
+ "password": "Debe ser de minimo 7 digitos",
2196
+ "paymentMethod": "Seleccione el metodo de pago",
2197
+ "payment_date": "Debe ingresa la fecha de pago",
2198
+ "phone_number": "Debes ingresar un número de teléfono valido",
2199
+ "phone_indicative": "Debes seleccionar un indicativo",
2200
+ "first_quota_price": "Debe ingresar el valor de la primera cuota",
2201
+ "quota_times": "Ingrese un número de cuotas válido",
2202
+ "program": "Debe ingresar el programa academico",
2203
+ "role": "Debe seleccionar un rol",
2204
+ "re_password": "Debe ser de minimo 7 digitos",
2205
+ "re_total_price": "Debe confirmar el valor total de la matricula",
2206
+ "semester": "Debe ingresar el semestre actual",
2207
+ "service_hour": "Debe ingresar las horas de servicio",
2208
+ "school_name": "Debe ingresar el nombre del colegio",
2209
+ "school_grade": "Debes ingresar el grado actual",
2210
+ "state": "Seleccione el departamento",
2211
+ "study_reasons": "Motivo",
2212
+ "total_price": "Debe ingresar el monto total de la matricula",
2213
+ "ufps_code": "Debe ingresar el codigo UFPS",
2214
+ "unipamplona_code": "Debes ingresar tu codigo UniPamplona"
2215
+ },
2216
+ },
2217
+ "attendant": {
2218
+ "inputs": {
2219
+ "address": "ingrese su direccion",
2220
+ "city": "Ingrese su ciudad de residencia",
2221
+ "country": "Ingresa tu pais de residencia",
2222
+ "id_card_type": "Ingresa tu tipo de documento",
2223
+ "id_card": "Documento de identidad",
2224
+ "last_name": "Apellidos",
2225
+ "name": "Ingrese los nombres",
2226
+ "phone_indicative": "Seleccione su indicativo",
2227
+ "phone_number": "Numero de teléfono",
2228
+ "state": "Seleccione su departamento",
2229
+ },
2230
+ "validators": {
2231
+ "address": "Debes ingresar su direccion",
2232
+ "city": "Debes ingresar la ciudad de residencia",
2233
+ "country": "Debes ingresar el pais de residencia",
2234
+ "id_card_type": "Debes ingresar el tipo de documento",
2235
+ "id_card": "Debes ingresar el número de documento.",
2236
+ "last_name": "Debes ingresar los apellidos del usuario.",
2237
+ "name": "Debes ingresar el nombre del usuario",
2238
+ "phone_number": "Debes ingresar un número de teléfono valido",
2239
+ "phone_indicative": "Debes seleccionar un indicativo",
2240
+ "state": "Seleccione el departamento",
2241
+ }
2242
+ },
2243
+ "menu": {
2244
+ "field1": "Home",
2245
+ "field2": "Groups",
2246
+ "field3": "Profile",
2247
+ "field5": "Score",
2248
+ "field4": "Search",
2249
+ "endField": "Cerrar Sesión"
2250
+ },
2251
+ "edit_profile": {
2252
+ "inputs": {
2253
+ "id_card": "Documento de identidad",
2254
+ "ufps_code": "Código de la universidad",
2255
+ "email": "Correo dominio @ufps.edu.co",
2256
+ "last_name": "Ingresa tus apellidos",
2257
+ "name": "Ingresa tus nombres",
2258
+ "phone": "Numero de teléfono",
2259
+ },
2260
+ },
2261
+ "en": {}
2262
+ }
2263
+ };
2264
+ function getCopies() {
2265
+ return copies;
2266
+ }
2267
+
2268
+ class CopiesService {
2269
+ constructor() {
2270
+ this.copies = getCopies();
2271
+ }
2272
+ }
2273
+ CopiesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CopiesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2274
+ CopiesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CopiesService, providedIn: 'root' });
2275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CopiesService, decorators: [{
2276
+ type: Injectable,
2277
+ args: [{
2278
+ providedIn: 'root'
2279
+ }]
2280
+ }], ctorParameters: function () { return []; } });
2281
+
1832
2282
  class CourseService extends IPTGeneralService {
1833
2283
  constructor(http) {
1834
2284
  super();
@@ -1895,6 +2345,1335 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
1895
2345
  }]
1896
2346
  }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
1897
2347
 
2348
+ class CommunicatorService {
2349
+ constructor() {
2350
+ this.$courseType = new BehaviorSubject('');
2351
+ this.$agreement = new BehaviorSubject('');
2352
+ }
2353
+ getSelectedCourseType() {
2354
+ return this.$courseType.asObservable();
2355
+ }
2356
+ setCurrentCourseType(value) {
2357
+ this.$courseType.next(value);
2358
+ }
2359
+ getSelectedAgreement() {
2360
+ return this.$agreement.asObservable();
2361
+ }
2362
+ setCurrentAgreement(value) {
2363
+ this.$agreement.next(value);
2364
+ }
2365
+ }
2366
+ CommunicatorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommunicatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2367
+ CommunicatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommunicatorService, providedIn: 'root' });
2368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommunicatorService, decorators: [{
2369
+ type: Injectable,
2370
+ args: [{ providedIn: 'root' }]
2371
+ }], ctorParameters: function () { return []; } });
2372
+
2373
+ class CodFormStepOneComponent extends CodFormSteps {
2374
+ constructor(fb, parameterService, copiesService, baseService, courseService, communicatorService) {
2375
+ super();
2376
+ this.fb = fb;
2377
+ this.parameterService = parameterService;
2378
+ this.copiesService = copiesService;
2379
+ this.baseService = baseService;
2380
+ this.courseService = courseService;
2381
+ this.communicatorService = communicatorService;
2382
+ this.changeStepEvent = new EventEmitter();
2383
+ this.availibleCourses = [];
2384
+ // Controls del formulario
2385
+ this.controls = new CodFormControls().controls[0];
2386
+ this.copies = this.copiesService.copies;
2387
+ }
2388
+ ngOnInit() {
2389
+ this.getParameters();
2390
+ this.initForm();
2391
+ this.startLocalStorageWork();
2392
+ this.setValuesByLocalStorage();
2393
+ this.codFormStepOne.controls['course_type'].valueChanges
2394
+ .subscribe(value => this.communicatorService.setCurrentCourseType(value));
2395
+ this.communicatorService.setCurrentAgreement(this.localStorageCOD.getCodFormData(1, 'agreement_by_category'));
2396
+ }
2397
+ /* Es necesario recorrer el array de controls de nuestro formulario para:
2398
+ ✅ Leer el Local Storage y setear los valores
2399
+ ✅ Subscribirse a los cambios del formulario para setear valores nuevos
2400
+
2401
+ Nota: la clase CodFormSteps() se encarga de toda la lógica de LS con los pasos del formulario del COD
2402
+ */
2403
+ startLocalStorageWork() {
2404
+ this.controls.forEach(control => {
2405
+ let localStorageValue = this.readAndWriteLS(1, control.name);
2406
+ this.codFormStepOne.controls[control.name].setValue(localStorageValue.value);
2407
+ this.listenFormChanges(1, control.name, this.codFormStepOne.controls[control.name].valueChanges);
2408
+ });
2409
+ }
2410
+ getParameters() {
2411
+ this.parameterService.getAllPlans().subscribe((response) => {
2412
+ this.plans = response.data;
2413
+ });
2414
+ this.parameterService.getLevels().subscribe((response) => {
2415
+ this.levels = response.data;
2416
+ });
2417
+ }
2418
+ initForm() {
2419
+ this.codFormStepOne = this.fb.group({
2420
+ academic_plan: ['', [Validators.required]],
2421
+ course_type: ['', [Validators.required]],
2422
+ agreement_by_category: ['', [Validators.required]],
2423
+ english_level: ['', [Validators.required]],
2424
+ availible_courses: ['', []],
2425
+ });
2426
+ }
2427
+ setValuesByLocalStorage() {
2428
+ const academicPlan = this.codFormStepOne.controls['academic_plan'].value || null;
2429
+ if (!academicPlan)
2430
+ return;
2431
+ this.selectAcademicPlan(academicPlan);
2432
+ const agreementByCategory = this.codFormStepOne.controls['agreement_by_category'].value || null;
2433
+ if (!agreementByCategory)
2434
+ return;
2435
+ this.getAvailibleCourses();
2436
+ const englishLevel = this.codFormStepOne.controls['english_level'].value || null;
2437
+ if (!englishLevel)
2438
+ return;
2439
+ this.getAvailibleCourses();
2440
+ }
2441
+ sendForm() {
2442
+ this.codFormStepOne.markAsTouched();
2443
+ if (this.codFormStepOne.invalid)
2444
+ return;
2445
+ // Movernos al paso 2
2446
+ this.changeStepEvent.emit(1);
2447
+ }
2448
+ resetForm() {
2449
+ this.resetLocalStorage(this.controls);
2450
+ this.codFormStepOne.reset();
2451
+ }
2452
+ // Eventos de los selects
2453
+ selectAcademicPlan(academic_plan) {
2454
+ if (academic_plan !== 'Plan') {
2455
+ this.codFormStepOne.controls['academic_plan'].setValue(academic_plan);
2456
+ this.getCourseType(academic_plan);
2457
+ this.getAgreementByPlan(academic_plan);
2458
+ }
2459
+ else {
2460
+ this.codFormStepOne.controls['academic_plan'].setValue(null);
2461
+ this.codFormStepOne.controls['course_type'].setValue(null);
2462
+ this.codFormStepOne.controls['agreement_by_category'].setValue(null);
2463
+ }
2464
+ }
2465
+ getCourseType(plan) {
2466
+ this.parameterService.getCoursesTypesByPlan(plan).subscribe((response) => {
2467
+ this.course_type = response.data;
2468
+ });
2469
+ }
2470
+ getAgreementByPlan(plan) {
2471
+ this.parameterService.getAgreementByCategory(plan).subscribe((response) => {
2472
+ this.agreements = response.data;
2473
+ });
2474
+ }
2475
+ selectCoursesTypesByPlan(coursesTypes) {
2476
+ if (coursesTypes !== 'Tipo de plan') {
2477
+ this.codFormStepOne.controls['course_type'].setValue(coursesTypes);
2478
+ this.getAvailibleCourses();
2479
+ }
2480
+ else {
2481
+ this.codFormStepOne.controls['course_type'].setValue(null);
2482
+ }
2483
+ }
2484
+ selectAgreementByCategory(agreementByCategories) {
2485
+ if (agreementByCategories !== 'Convenio por categoria') {
2486
+ this.codFormStepOne.controls['agreement_by_category'].setValue(agreementByCategories);
2487
+ this.communicatorService.setCurrentAgreement(agreementByCategories);
2488
+ this.getAvailibleCourses();
2489
+ }
2490
+ else {
2491
+ this.codFormStepOne.controls['agreement_by_category'].setValue(null);
2492
+ this.codFormStepOne.controls['school_name'].setValue(null);
2493
+ }
2494
+ }
2495
+ selectLevel(levels) {
2496
+ if (levels !== 'Nivel de inglés') {
2497
+ this.codFormStepOne.controls['english_level'].setValue(levels);
2498
+ this.getAvailibleCourses();
2499
+ }
2500
+ else {
2501
+ this.codFormStepOne.controls['english_level'].setValue(null);
2502
+ }
2503
+ }
2504
+ selectAvailibleCourses(availibleCourses) {
2505
+ if (availibleCourses !== 'Grupos disponibles') {
2506
+ this.codFormStepOne.controls['availible_courses'].setValue(availibleCourses);
2507
+ }
2508
+ else {
2509
+ this.codFormStepOne.controls['availible_courses'].setValue(null);
2510
+ this.codFormStepOne.controls['agreement_by_category'].setValue(null);
2511
+ this.codFormStepOne.controls['course_type'].setValue(null);
2512
+ this.codFormStepOne.controls['english_level'].setValue(null);
2513
+ }
2514
+ }
2515
+ validRequest() {
2516
+ return (this.codFormStepOne.controls['english_level'].value != '' &&
2517
+ this.codFormStepOne.controls['agreement_by_category'].value != '' &&
2518
+ this.codFormStepOne.controls['course_type'].value != '');
2519
+ }
2520
+ getAvailibleCourses() {
2521
+ this.availibleCourses = [];
2522
+ if (this.validRequest()) {
2523
+ let request_availibleCourses = {
2524
+ token: this.baseService.getUserToken(),
2525
+ english_level: this.codFormStepOne.controls['english_level'].value,
2526
+ agreement: this.codFormStepOne.controls['agreement_by_category'].value,
2527
+ course_type: this.codFormStepOne.controls['course_type'].value,
2528
+ };
2529
+ this.courseService
2530
+ .getAvailibleCourses(request_availibleCourses)
2531
+ .subscribe((response) => {
2532
+ if (response.data) {
2533
+ let courses = response.data;
2534
+ this.hasAvailableCourse = true;
2535
+ courses.forEach(course => {
2536
+ this.availibleCourses.push({
2537
+ code: course.code,
2538
+ name: `Curso ${course.modality === 1 ? 'Presencial' : 'Virtual'} ${course.course_type.name} (${course.english_level}) - Teacher ${course.teacher}, Fecha de inicio: ${course.to_start}`
2539
+ });
2540
+ });
2541
+ }
2542
+ else {
2543
+ this.hasAvailableCourse = false;
2544
+ this.codFormStepOne.controls['availible_courses'].setValue("");
2545
+ }
2546
+ });
2547
+ }
2548
+ }
2549
+ }
2550
+ CodFormStepOneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepOneComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }, { token: CopiesService }, { token: BaseService }, { token: CourseService }, { token: CommunicatorService }], target: i0.ɵɵFactoryTarget.Component });
2551
+ CodFormStepOneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepOneComponent, selector: "app-cod-form-step-one", outputs: { changeStepEvent: "changeStepEvent" }, usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"codFormStepOne\" class=\"grid\">\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['academic_plan'].value\"\r\n [selectCode]=\"codFormStepOne.controls['academic_plan'].value === null? 'Plan': codFormStepOne.controls['academic_plan'].value\"\r\n [defaultText]=\"'Plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAcademicPlan($event)\"\r\n [data]=\"plans\"\r\n [control]=\"codFormStepOne.controls['academic_plan']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['course_type'].value\"\r\n [selectCode]=\"codFormStepOne.controls['course_type'].value === null? 'Tipo de plan': codFormStepOne.controls['course_type'].value\"\r\n [defaultText]=\"'Tipo de plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectCoursesTypesByPlan($event)\"\r\n [data]=\"course_type\"\r\n [control]=\"codFormStepOne.controls['course_type']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['agreement_by_category'].value\"\r\n [selectCode]=\"codFormStepOne.controls['agreement_by_category'].value === null? 'Convenio por categoria': codFormStepOne.controls['agreement_by_category'].value\"\r\n [defaultText]=\"'Convenio por categoria'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAgreementByCategory($event)\"\r\n [data]=\"agreements\"\r\n [control]=\"codFormStepOne.controls['agreement_by_category']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['english_level'].value\"\r\n [selectCode]=\"codFormStepOne.controls['english_level'].value === null? 'Nivel de ingl\u00E9s': codFormStepOne.controls['english_level'].value\"\r\n [defaultText]=\"'Nivel de ingl\u00E9s'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectLevel($event)\"\r\n [data]=\"levels\"\r\n [control]=\"codFormStepOne.controls['english_level']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['availible_courses'].value\"\r\n [selectCode]=\"codFormStepOne.controls['availible_courses'].value === null? 'Grupos disponibles': codFormStepOne.controls['availible_courses'].value\"\r\n [defaultText]=\"'Grupos disponibles'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAvailibleCourses($event)\"\r\n [data]=\"availibleCourses\"\r\n [control]=\"codFormStepOne.controls['availible_courses']\"\r\n ></ipt-select>\r\n </div>\r\n <span *ngIf=\"!hasAvailableCourse\" class=\"mt-1 pl-2 text-red-500\">Todavia no hay cursos con estas caracter\u00EDsticas.</span>\r\n</form>\r\n\r\n<div class=\"flex mt-2 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepOne.invalid && codFormStepOne.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">Faltan campos por llenar.</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
2552
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepOneComponent, decorators: [{
2553
+ type: Component,
2554
+ args: [{ selector: 'app-cod-form-step-one', template: "<form [formGroup]=\"codFormStepOne\" class=\"grid\">\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['academic_plan'].value\"\r\n [selectCode]=\"codFormStepOne.controls['academic_plan'].value === null? 'Plan': codFormStepOne.controls['academic_plan'].value\"\r\n [defaultText]=\"'Plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAcademicPlan($event)\"\r\n [data]=\"plans\"\r\n [control]=\"codFormStepOne.controls['academic_plan']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['course_type'].value\"\r\n [selectCode]=\"codFormStepOne.controls['course_type'].value === null? 'Tipo de plan': codFormStepOne.controls['course_type'].value\"\r\n [defaultText]=\"'Tipo de plan'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectCoursesTypesByPlan($event)\"\r\n [data]=\"course_type\"\r\n [control]=\"codFormStepOne.controls['course_type']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['agreement_by_category'].value\"\r\n [selectCode]=\"codFormStepOne.controls['agreement_by_category'].value === null? 'Convenio por categoria': codFormStepOne.controls['agreement_by_category'].value\"\r\n [defaultText]=\"'Convenio por categoria'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAgreementByCategory($event)\"\r\n [data]=\"agreements\"\r\n [control]=\"codFormStepOne.controls['agreement_by_category']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['english_level'].value\"\r\n [selectCode]=\"codFormStepOne.controls['english_level'].value === null? 'Nivel de ingl\u00E9s': codFormStepOne.controls['english_level'].value\"\r\n [defaultText]=\"'Nivel de ingl\u00E9s'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectLevel($event)\"\r\n [data]=\"levels\"\r\n [control]=\"codFormStepOne.controls['english_level']\"\r\n ></ipt-select>\r\n </div>\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepOne.controls['availible_courses'].value\"\r\n [selectCode]=\"codFormStepOne.controls['availible_courses'].value === null? 'Grupos disponibles': codFormStepOne.controls['availible_courses'].value\"\r\n [defaultText]=\"'Grupos disponibles'\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectAvailibleCourses($event)\"\r\n [data]=\"availibleCourses\"\r\n [control]=\"codFormStepOne.controls['availible_courses']\"\r\n ></ipt-select>\r\n </div>\r\n <span *ngIf=\"!hasAvailableCourse\" class=\"mt-1 pl-2 text-red-500\">Todavia no hay cursos con estas caracter\u00EDsticas.</span>\r\n</form>\r\n\r\n<div class=\"flex mt-2 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepOne.invalid && codFormStepOne.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">Faltan campos por llenar.</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""] }]
2555
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }, { type: CopiesService }, { type: BaseService }, { type: CourseService }, { type: CommunicatorService }]; }, propDecorators: { changeStepEvent: [{
2556
+ type: Output
2557
+ }] } });
2558
+
2559
+ class CodFormStepTwoComponent extends CodFormSteps {
2560
+ constructor(fb, parameterService) {
2561
+ super();
2562
+ this.fb = fb;
2563
+ this.parameterService = parameterService;
2564
+ this.changeStepEvent = new EventEmitter();
2565
+ this.errorMessage = 'Faltan campos por llenar.';
2566
+ this.hasErrors = false;
2567
+ this.genders = [];
2568
+ // Controls del formulario
2569
+ this.controls = new CodFormControls().controls[1];
2570
+ }
2571
+ ngOnInit() {
2572
+ this.getParameters();
2573
+ this.initForm();
2574
+ this.startLocalStorageWork();
2575
+ this.validateErrors();
2576
+ if (this.initialData)
2577
+ this.setDataFromPreviusCod();
2578
+ this.selectCountry(this.localStorageCOD.getCodFormData(2, 'country'));
2579
+ }
2580
+ setDataFromPreviusCod() {
2581
+ this.codFormStepTwo.controls['student_name'].setValue(this.initialData.name);
2582
+ this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.last_name);
2583
+ this.codFormStepTwo.controls['student_id_card_type'].setValue(this.initialData.id_card_type);
2584
+ this.codFormStepTwo.controls['student_id_card'].setValue(this.initialData.id_card);
2585
+ this.codFormStepTwo.controls['student_phone_indicative'].setValue(this.initialData.phone_indicative);
2586
+ this.codFormStepTwo.controls['student_phone_number'].setValue(this.initialData.phone_number);
2587
+ this.codFormStepTwo.controls['birthdate'].setValue(this.initialData.birthdate);
2588
+ }
2589
+ validateErrors() {
2590
+ this.codFormStepTwo.valueChanges.subscribe(changes => {
2591
+ if (this.codFormStepTwo.controls['student_name'].hasError('minlength')) {
2592
+ this.errorMessage = 'Los nombres deben tener mínimo 3 caracteres';
2593
+ }
2594
+ else if (this.codFormStepTwo.controls['student_last_name'].hasError('minlength')) {
2595
+ this.errorMessage = 'Los apellidos deben tener mínimo 5 caracteres';
2596
+ }
2597
+ else if (this.codFormStepTwo.controls['password'].hasError('minlength')) {
2598
+ this.errorMessage = 'La contraseña debe tener mínimo 6 caracteres';
2599
+ }
2600
+ else if (this.codFormStepTwo.controls['password'].value !== this.codFormStepTwo.controls['re_password'].value) {
2601
+ this.errorMessage = 'Las contraseñas no coinciden';
2602
+ }
2603
+ else if (this.codFormStepTwo.controls['age'].errors) {
2604
+ this.errorMessage = 'Fecha de nacimiento no válida';
2605
+ }
2606
+ else {
2607
+ this.errorMessage = 'Faltan campos por llenar';
2608
+ }
2609
+ });
2610
+ }
2611
+ startLocalStorageWork() {
2612
+ this.controls.forEach(control => {
2613
+ let localStorageValue = this.readAndWriteLS(2, control.name);
2614
+ this.codFormStepTwo.controls[control.name].setValue(localStorageValue.value);
2615
+ this.listenFormChanges(2, control.name, this.codFormStepTwo.controls[control.name].valueChanges);
2616
+ });
2617
+ }
2618
+ initForm() {
2619
+ this.codFormStepTwo = this.fb.group({
2620
+ student_address: ['', [Validators.required], []],
2621
+ birthdate: ['', [Validators.required], []],
2622
+ country: ['', [Validators.required], []],
2623
+ state: ['', [Validators.required], []],
2624
+ city: ['', [Validators.required], []],
2625
+ student_id_card_type: ['', [Validators.required], []],
2626
+ student_id_card: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(20)]],
2627
+ student_last_name: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(32)]],
2628
+ student_name: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(32)]],
2629
+ student_email: ['', [Validators.required, Validators.email]],
2630
+ nickname: ['', [Validators.required]],
2631
+ gender: ['', [Validators.required]],
2632
+ age: ['', [Validators.required], []],
2633
+ student_occupation: ['', [Validators.required]],
2634
+ stratum: ['', [Validators.required]],
2635
+ grade: ['', [Validators.required]],
2636
+ civil_status: ['', [Validators.required]],
2637
+ student_phone_indicative: ['', [Validators.required], []],
2638
+ student_phone_number: ['', [Validators.required, Validators.minLength(10), Validators.maxLength(15)]],
2639
+ password: ['', [Validators.required, Validators.minLength(6)]],
2640
+ re_password: ['', [Validators.required, Validators.minLength(6)]],
2641
+ });
2642
+ // Calcular edad y setear valor
2643
+ this.codFormStepTwo.controls['birthdate'].valueChanges.subscribe({
2644
+ next: (change) => {
2645
+ let today = new Date();
2646
+ let birthday = new Date(change);
2647
+ let age = today.getFullYear() - birthday.getFullYear();
2648
+ let month = today.getMonth() - birthday.getMonth();
2649
+ if (month < 0 || (month === 0 && today.getDate() < birthday.getDate())) {
2650
+ age--;
2651
+ }
2652
+ if (age < 3) {
2653
+ this.errorMessage = 'Fecha de nacimiento no válida';
2654
+ this.codFormStepTwo.controls['birthdate'].setErrors({
2655
+ invalidAge: true
2656
+ });
2657
+ }
2658
+ else {
2659
+ this.codFormStepTwo.controls['birthdate'].setErrors(null);
2660
+ }
2661
+ this.codFormStepTwo.controls['age'].setValue(age);
2662
+ }
2663
+ });
2664
+ }
2665
+ getParameters() {
2666
+ this.parameterService.getCardTypes('col').subscribe((response) => {
2667
+ this.idTypes = response.data;
2668
+ });
2669
+ this.parameterService.getIndicatives().subscribe((response) => {
2670
+ this.indicatives = response.data;
2671
+ });
2672
+ this.parameterService.getCountries().subscribe((response) => {
2673
+ this.countries = response.data;
2674
+ });
2675
+ this.parameterService.getStratums().subscribe((response) => {
2676
+ this.stratums = response.data;
2677
+ });
2678
+ this.parameterService.getCivilStatus().subscribe((response) => {
2679
+ this.civilStatus = response.data;
2680
+ });
2681
+ this.parameterService.getGenders().pipe(map((response) => response.data))
2682
+ .subscribe((genders) => {
2683
+ genders.forEach(gender => {
2684
+ let genderItem = {
2685
+ code: gender.code,
2686
+ name: gender.name_spanish
2687
+ };
2688
+ this.genders.push(genderItem);
2689
+ });
2690
+ });
2691
+ }
2692
+ sendForm() {
2693
+ this.codFormStepTwo.markAllAsTouched();
2694
+ if (this.codFormStepTwo.invalid)
2695
+ return;
2696
+ // Movernos al paso 3
2697
+ this.changeStepEvent.emit(2);
2698
+ }
2699
+ getState(state) {
2700
+ this.getCity(state);
2701
+ }
2702
+ getCity(state) {
2703
+ this.parameterService.getCitiesByState(state).subscribe((response) => {
2704
+ this.cities = response.data;
2705
+ this.selectCity(this.localStorageCOD.getCodFormData(2, 'city'));
2706
+ });
2707
+ }
2708
+ // Eventos de los select
2709
+ selectCountry(country) {
2710
+ if (country !== 'País de residencia') {
2711
+ this.codFormStepTwo.controls['country'].setValue(country);
2712
+ let iso = '';
2713
+ if (country === '1')
2714
+ iso = 'null';
2715
+ if (country === '2')
2716
+ iso = 'col';
2717
+ if (country === '3')
2718
+ iso = 'ven';
2719
+ if (country === '4')
2720
+ iso = 'usa';
2721
+ this.parameterService.getStatesByCountry(iso).subscribe((response) => {
2722
+ this.states = response.data;
2723
+ this.selectState(this.localStorageCOD.getCodFormData(2, 'state'));
2724
+ });
2725
+ }
2726
+ else {
2727
+ this.codFormStepTwo.controls['country'].setValue(null);
2728
+ }
2729
+ this.countrySelected = country;
2730
+ }
2731
+ selectState(state) {
2732
+ if (state !== 'Departamento o estado') {
2733
+ this.codFormStepTwo.controls['state'].setValue(state);
2734
+ this.getState(state);
2735
+ }
2736
+ else {
2737
+ this.codFormStepTwo.controls['state'].setValue(null);
2738
+ this.codFormStepTwo.controls['city'].setValue(null);
2739
+ this.cities = [];
2740
+ }
2741
+ }
2742
+ selectCity(city) {
2743
+ if (city !== 'Ciudad de residencia') {
2744
+ this.codFormStepTwo.controls['city'].setValue(city);
2745
+ }
2746
+ else {
2747
+ this.codFormStepTwo.controls['city'].setValue(null);
2748
+ }
2749
+ }
2750
+ selectIdType(idType) {
2751
+ if (idType !== 'Tipo de documento') {
2752
+ this.codFormStepTwo.controls['student_id_card_type'].setValue(idType);
2753
+ }
2754
+ else {
2755
+ this.codFormStepTwo.controls['student_id_card_type'].setValue(null);
2756
+ }
2757
+ }
2758
+ selectIndicatives(indicative) {
2759
+ if (indicative !== 'Indicativo') {
2760
+ this.codFormStepTwo.controls['student_phone_indicative'].setValue(indicative);
2761
+ }
2762
+ else {
2763
+ this.codFormStepTwo.controls['student_phone_indicative'].setValue(null);
2764
+ }
2765
+ }
2766
+ selectGender(gender) {
2767
+ if (gender !== 'Género') {
2768
+ this.codFormStepTwo.controls['gender'].setValue(gender);
2769
+ }
2770
+ else {
2771
+ this.codFormStepTwo.controls['gender'].setValue(null);
2772
+ }
2773
+ }
2774
+ selectStratum(stratum) {
2775
+ if (stratum !== 'Estrato') {
2776
+ this.codFormStepTwo.controls['stratum'].setValue(stratum);
2777
+ }
2778
+ else {
2779
+ this.codFormStepTwo.controls['stratum'].setValue(null);
2780
+ }
2781
+ }
2782
+ selectCivilStatus(civil_status) {
2783
+ if (civil_status !== 'Estado civil') {
2784
+ this.codFormStepTwo.controls['civil_status'].setValue(civil_status);
2785
+ }
2786
+ else {
2787
+ this.codFormStepTwo.controls['civil_status'].setValue(null);
2788
+ }
2789
+ }
2790
+ }
2791
+ CodFormStepTwoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepTwoComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }], target: i0.ɵɵFactoryTarget.Component });
2792
+ CodFormStepTwoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepTwoComponent, selector: "app-cod-form-step-two", inputs: { initialData: "initialData" }, outputs: { changeStepEvent: "changeStepEvent" }, usesInheritance: true, ngImport: i0, template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepTwo\" class=\"grid\">\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepTwo.controls['student_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_id_card_type'].value\"\r\n [control]=\"codFormStepTwo.controls['student_id_card_type']\"\r\n [selectCode]=\"codFormStepTwo.controls['student_id_card_type'].value === null ? 'Tipo de documento' : codFormStepTwo.controls['student_id_card_type'].value\"\r\n [isRequired]=\"true\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdType($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['country'].value\"\r\n [control]=\"codFormStepTwo.controls['country']\"\r\n [selectCode]=\"codFormStepTwo.controls['country'].value === null ? 'Pa\u00EDs de residencia' : codFormStepTwo.controls['country'].value\"\r\n (eventSelect)=\"selectCountry($event)\"\r\n [data]=\"countries\"\r\n [defaultText]=\"'Pa\u00EDs de residencia'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['city'].value\"\r\n [control]=\"codFormStepTwo.controls['city']\"\r\n [selectCode]=\"codFormStepTwo.controls['city'].value === null ? 'Ciudad de residencia' : codFormStepTwo.controls['city'].value\"\r\n (eventSelect)=\"selectCity($event)\"\r\n [data]=\"cities\"\r\n [defaultText]=\"'Ciudad de residencia'\"\r\n ></ipt-select>\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepTwo.controls['birthdate']\"\r\n [placeHolder]=\"'Fecha de nacimiento'\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['gender'].value\"\r\n [control]=\"codFormStepTwo.controls['gender']\"\r\n [data]=\"genders\"\r\n (eventSelect)=\"selectGender($event)\"\r\n [defaultText]=\"'G\u00E9nero'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['stratum'].value\"\r\n [control]=\"codFormStepTwo.controls['stratum']\"\r\n [data]=\"stratums\"\r\n (eventSelect)=\"selectStratum($event)\"\r\n [defaultText]=\"'Estrato'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Grado'\"\r\n [control]=\"codFormStepTwo.controls['grade']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_phone_indicative'].value\"\r\n [control]=\"codFormStepTwo.controls['student_phone_indicative']\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicatives($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'email'\"\r\n [placeHolder]=\"'Correo electr\u00F3nico'\"\r\n [control]=\"codFormStepTwo.controls['student_email']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Repetir contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['re_password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepTwo.controls['student_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepTwo.controls['student_id_card']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['state'].value\"\r\n [control]=\"codFormStepTwo.controls['state']\"\r\n [selectCode]=\"codFormStepTwo.controls['state'].value === null ? 'Departamento o estado' : codFormStepTwo.controls['state'].value\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectState($event)\"\r\n [data]=\"states\"\r\n [defaultText]=\"'Departamento o estado'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_address']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'Edad'\"\r\n [control]=\"codFormStepTwo.controls['age']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nickname'\"\r\n [control]=\"codFormStepTwo.controls['nickname']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_occupation']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['civil_status'].value\"\r\n [control]=\"codFormStepTwo.controls['civil_status']\"\r\n [data]=\"civilStatus\"\r\n (eventSelect)=\"selectCivilStatus($event)\"\r\n [defaultText]=\"'Estado civil'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepTwo.controls['student_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\"></div>\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepTwo.invalid && codFormStepTwo.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""], components: [{ type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }, { type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
2793
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepTwoComponent, decorators: [{
2794
+ type: Component,
2795
+ args: [{ selector: 'app-cod-form-step-two', template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepTwo\" class=\"grid\">\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepTwo.controls['student_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_id_card_type'].value\"\r\n [control]=\"codFormStepTwo.controls['student_id_card_type']\"\r\n [selectCode]=\"codFormStepTwo.controls['student_id_card_type'].value === null ? 'Tipo de documento' : codFormStepTwo.controls['student_id_card_type'].value\"\r\n [isRequired]=\"true\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdType($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['country'].value\"\r\n [control]=\"codFormStepTwo.controls['country']\"\r\n [selectCode]=\"codFormStepTwo.controls['country'].value === null ? 'Pa\u00EDs de residencia' : codFormStepTwo.controls['country'].value\"\r\n (eventSelect)=\"selectCountry($event)\"\r\n [data]=\"countries\"\r\n [defaultText]=\"'Pa\u00EDs de residencia'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['city'].value\"\r\n [control]=\"codFormStepTwo.controls['city']\"\r\n [selectCode]=\"codFormStepTwo.controls['city'].value === null ? 'Ciudad de residencia' : codFormStepTwo.controls['city'].value\"\r\n (eventSelect)=\"selectCity($event)\"\r\n [data]=\"cities\"\r\n [defaultText]=\"'Ciudad de residencia'\"\r\n ></ipt-select>\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepTwo.controls['birthdate']\"\r\n [placeHolder]=\"'Fecha de nacimiento'\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['gender'].value\"\r\n [control]=\"codFormStepTwo.controls['gender']\"\r\n [data]=\"genders\"\r\n (eventSelect)=\"selectGender($event)\"\r\n [defaultText]=\"'G\u00E9nero'\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['stratum'].value\"\r\n [control]=\"codFormStepTwo.controls['stratum']\"\r\n [data]=\"stratums\"\r\n (eventSelect)=\"selectStratum($event)\"\r\n [defaultText]=\"'Estrato'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Grado'\"\r\n [control]=\"codFormStepTwo.controls['grade']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['student_phone_indicative'].value\"\r\n [control]=\"codFormStepTwo.controls['student_phone_indicative']\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicatives($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'email'\"\r\n [placeHolder]=\"'Correo electr\u00F3nico'\"\r\n [control]=\"codFormStepTwo.controls['student_email']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Repetir contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['re_password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepTwo.controls['student_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepTwo.controls['student_id_card']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['state'].value\"\r\n [control]=\"codFormStepTwo.controls['state']\"\r\n [selectCode]=\"codFormStepTwo.controls['state'].value === null ? 'Departamento o estado' : codFormStepTwo.controls['state'].value\"\r\n [isRequired]=\"true\"\r\n (eventSelect)=\"selectState($event)\"\r\n [data]=\"states\"\r\n [defaultText]=\"'Departamento o estado'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_address']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'Edad'\"\r\n [control]=\"codFormStepTwo.controls['age']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nickname'\"\r\n [control]=\"codFormStepTwo.controls['nickname']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepTwo.controls['student_occupation']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepTwo.controls['civil_status'].value\"\r\n [control]=\"codFormStepTwo.controls['civil_status']\"\r\n [data]=\"civilStatus\"\r\n (eventSelect)=\"selectCivilStatus($event)\"\r\n [defaultText]=\"'Estado civil'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepTwo.controls['student_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'password'\"\r\n [placeHolder]=\"'Contrase\u00F1a'\"\r\n [control]=\"codFormStepTwo.controls['password']\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\"></div>\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepTwo.invalid && codFormStepTwo.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""] }]
2796
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }]; }, propDecorators: { initialData: [{
2797
+ type: Input
2798
+ }], changeStepEvent: [{
2799
+ type: Output
2800
+ }] } });
2801
+
2802
+ class CodFormStepThreeComponent extends CodFormSteps {
2803
+ constructor(fb, parameterService, codFormControls) {
2804
+ super();
2805
+ this.fb = fb;
2806
+ this.parameterService = parameterService;
2807
+ this.codFormControls = codFormControls;
2808
+ this.changeStepEvent = new EventEmitter();
2809
+ this.globalControls = new CodFormControls();
2810
+ this.errorMessage = 'Faltan campos por llenar.';
2811
+ this.needAtendants = [
2812
+ { code: '1', name: 'Si requiere acudiente' },
2813
+ { code: '2', name: 'No requiere acudiente' },
2814
+ ];
2815
+ // Controls del formulario
2816
+ this.controls = new CodFormControls().controls[2];
2817
+ }
2818
+ ngOnInit() {
2819
+ this.getParameters();
2820
+ this.initForm();
2821
+ this.startLocalStorageWork();
2822
+ this.validateErrors();
2823
+ }
2824
+ validateErrors() {
2825
+ this.codFormStepThree.valueChanges.subscribe(changes => {
2826
+ if (this.codFormStepThree.controls['parent_name'].hasError('minlength')) {
2827
+ this.errorMessage = 'Los nombres deben tener mínimo 3 caracteres';
2828
+ }
2829
+ else if (this.codFormStepThree.controls['parent_last_name'].hasError('minlength')) {
2830
+ this.errorMessage = 'Los apellidos deben tener mínimo 5 caracteres';
2831
+ }
2832
+ else {
2833
+ this.errorMessage = 'Faltan campos por llenar';
2834
+ }
2835
+ });
2836
+ }
2837
+ startLocalStorageWork() {
2838
+ this.controls.forEach(control => {
2839
+ let localStorageValue = this.readAndWriteLS(3, control.name);
2840
+ this.codFormStepThree.controls[control.name].setValue(localStorageValue.value);
2841
+ this.listenFormChanges(3, control.name, this.codFormStepThree.controls[control.name].valueChanges);
2842
+ });
2843
+ }
2844
+ getParameters() {
2845
+ this.parameterService.getCardTypes('col').subscribe((response) => {
2846
+ this.idTypes = response.data;
2847
+ });
2848
+ this.parameterService.getIndicatives().subscribe((response) => {
2849
+ this.indicatives = response.data;
2850
+ });
2851
+ }
2852
+ initForm() {
2853
+ this.codFormStepThree = this.fb.group({
2854
+ parent_id_card_type: ['', [Validators.required]],
2855
+ parent_id_card: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(20),],],
2856
+ parent_last_name: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(32),],],
2857
+ parent_name: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(32)],],
2858
+ needAtendant: ['', [Validators.required], []],
2859
+ parent_phone_indicative: ['', [Validators.required], []],
2860
+ parent_occupation: ['', [Validators.required], []],
2861
+ parent_address: ['', [Validators.required], []],
2862
+ parent_phone_number: ['', [Validators.required, Validators.minLength(10), Validators.maxLength(15),],],
2863
+ });
2864
+ this.listenNeedAtendantField();
2865
+ }
2866
+ listenNeedAtendantField() {
2867
+ const control = this.codFormStepThree.get('needAtendant');
2868
+ control === null || control === void 0 ? void 0 : control.valueChanges.subscribe((change) => {
2869
+ if (change === '1') {
2870
+ // Poner validaciones
2871
+ this.codFormStepThree.controls['parent_id_card_type'].setValidators([Validators.required]);
2872
+ this.codFormStepThree.controls['parent_id_card'].setValidators([Validators.required, Validators.minLength(5), Validators.maxLength(20)]);
2873
+ this.codFormStepThree.controls['parent_last_name'].setValidators([Validators.required, Validators.minLength(5), Validators.maxLength(32)]);
2874
+ this.codFormStepThree.controls['parent_name'].setValidators([Validators.required, Validators.minLength(3), Validators.maxLength(32)]);
2875
+ this.codFormStepThree.controls['parent_phone_indicative'].setValidators([Validators.required]);
2876
+ this.codFormStepThree.controls['parent_occupation'].setValidators([Validators.required]);
2877
+ this.codFormStepThree.controls['parent_address'].setValidators([Validators.required]);
2878
+ this.codFormStepThree.controls['parent_phone_number'].setValidators([Validators.required, Validators.minLength(10), Validators.maxLength(15)]);
2879
+ // Actualizar para que se tomen los cambios
2880
+ this.updateValueAndValidity();
2881
+ // Actualizar los controls globales
2882
+ this.updateGlobalControls(change);
2883
+ }
2884
+ if (change === '2') {
2885
+ // Quitar las validaciones
2886
+ this.codFormStepThree.controls['parent_id_card_type'].clearValidators();
2887
+ this.codFormStepThree.controls['parent_id_card'].clearValidators();
2888
+ this.codFormStepThree.controls['parent_last_name'].clearValidators();
2889
+ this.codFormStepThree.controls['parent_name'].clearValidators();
2890
+ this.codFormStepThree.controls['parent_phone_indicative'].clearValidators();
2891
+ this.codFormStepThree.controls['parent_occupation'].clearValidators();
2892
+ this.codFormStepThree.controls['parent_address'].clearValidators();
2893
+ this.codFormStepThree.controls['parent_phone_number'].clearValidators();
2894
+ // Actualizar para que se tomen los cambios
2895
+ this.updateValueAndValidity();
2896
+ // Actualizar los controls globales
2897
+ this.updateGlobalControls(change);
2898
+ }
2899
+ });
2900
+ }
2901
+ updateGlobalControls(change) {
2902
+ let controls = this.controls.filter(control => control.name !== 'needAtendant');
2903
+ controls.forEach(control => {
2904
+ if (change === '1')
2905
+ this.codFormControls.changeValue(3, control.name, true);
2906
+ if (change === '2')
2907
+ this.codFormControls.changeValue(3, control.name, false);
2908
+ });
2909
+ }
2910
+ updateValueAndValidity() {
2911
+ this.codFormStepThree.controls['parent_id_card_type'].updateValueAndValidity();
2912
+ this.codFormStepThree.controls['parent_id_card'].updateValueAndValidity();
2913
+ this.codFormStepThree.controls['parent_last_name'].updateValueAndValidity();
2914
+ this.codFormStepThree.controls['parent_name'].updateValueAndValidity();
2915
+ this.codFormStepThree.controls['parent_phone_indicative'].updateValueAndValidity();
2916
+ this.codFormStepThree.controls['parent_occupation'].updateValueAndValidity();
2917
+ this.codFormStepThree.controls['parent_address'].updateValueAndValidity();
2918
+ this.codFormStepThree.controls['parent_phone_number'].updateValueAndValidity();
2919
+ }
2920
+ needAtendant() {
2921
+ return this.codFormStepThree.controls['needAtendant'].value == 1;
2922
+ }
2923
+ sendForm() {
2924
+ this.codFormStepThree.markAllAsTouched();
2925
+ if (this.codFormStepThree.controls['needAtendant'].value === '1' && this.codFormStepThree.invalid)
2926
+ return;
2927
+ // Movernos al paso 4
2928
+ this.changeStepEvent.emit(3);
2929
+ }
2930
+ // Eventos de los select
2931
+ selectNeedAtendant(needAtendant) {
2932
+ if (needAtendant !== 'Requiere acudiente') {
2933
+ this.codFormStepThree.controls['needAtendant'].setValue(needAtendant);
2934
+ }
2935
+ else {
2936
+ this.codFormStepThree.controls['needAtendant'].setValue(null);
2937
+ }
2938
+ }
2939
+ selectIdTypeParents(value) {
2940
+ if (value !== 'Tipo de documento') {
2941
+ this.codFormStepThree.controls['parent_id_card_type'].setValue(value);
2942
+ }
2943
+ else {
2944
+ this.codFormStepThree.controls['parent_id_card_type'].setValue(null);
2945
+ }
2946
+ }
2947
+ selectIndicativesParents(value) {
2948
+ if (value !== 'Indicativo') {
2949
+ this.codFormStepThree.controls['parent_phone_indicative'].setValue(value);
2950
+ }
2951
+ else {
2952
+ this.codFormStepThree.controls['parent_phone_indicative'].setValue(null);
2953
+ }
2954
+ }
2955
+ }
2956
+ CodFormStepThreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepThreeComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }, { token: CodFormControls }], target: i0.ɵɵFactoryTarget.Component });
2957
+ CodFormStepThreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepThreeComponent, selector: "app-cod-form-step-three", outputs: { changeStepEvent: "changeStepEvent" }, usesInheritance: true, ngImport: i0, template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepThree\"class=\"grid\">\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['needAtendant'].value\"\r\n [control]=\"codFormStepThree.controls['needAtendant']\"\r\n (eventSelect)=\"selectNeedAtendant($event)\"\r\n [data]=\"needAtendants\"\r\n [defaultText]=\"'Requiere acudiente'\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"needAtendant()\" class=\"grid col-12\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepThree.controls['parent_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_id_card_type'].value\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdTypeParents($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card_type']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_phone_indicative'].value\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicativesParents($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_indicative']\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepThree.controls['parent_occupation']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepThree.controls['parent_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n - Oficina'\"\r\n [control]=\"codFormStepThree.controls['parent_address']\"\r\n ></ipt-input>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepThree.invalid && codFormStepThree.touched) && needAtendant()\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }, { type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
2958
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepThreeComponent, decorators: [{
2959
+ type: Component,
2960
+ args: [{ selector: 'app-cod-form-step-three', template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepThree\"class=\"grid\">\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['needAtendant'].value\"\r\n [control]=\"codFormStepThree.controls['needAtendant']\"\r\n (eventSelect)=\"selectNeedAtendant($event)\"\r\n [data]=\"needAtendants\"\r\n [defaultText]=\"'Requiere acudiente'\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"needAtendant()\" class=\"grid col-12\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Nombres'\"\r\n [control]=\"codFormStepThree.controls['parent_name']\"\r\n ></ipt-input>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_id_card_type'].value\"\r\n [data]=\"idTypes\"\r\n (eventSelect)=\"selectIdTypeParents($event)\"\r\n [defaultText]=\"'Tipo de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card_type']\"\r\n ></ipt-select>\r\n <ipt-select\r\n [initialValue]=\"codFormStepThree.controls['parent_phone_indicative'].value\"\r\n [data]=\"indicatives\"\r\n (eventSelect)=\"selectIndicativesParents($event)\"\r\n [defaultText]=\"'Indicativo'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_indicative']\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Ocupaci\u00F3n'\"\r\n [control]=\"codFormStepThree.controls['parent_occupation']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Apellidos'\"\r\n [control]=\"codFormStepThree.controls['parent_last_name']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de documento'\"\r\n [control]=\"codFormStepThree.controls['parent_id_card']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'number'\"\r\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\r\n [control]=\"codFormStepThree.controls['parent_phone_number']\"\r\n ></ipt-input>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Direcci\u00F3n - Oficina'\"\r\n [control]=\"codFormStepThree.controls['parent_address']\"\r\n ></ipt-input>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepThree.invalid && codFormStepThree.touched) && needAtendant()\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n</div>\r\n", styles: [""] }]
2961
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }, { type: CodFormControls }]; }, propDecorators: { changeStepEvent: [{
2962
+ type: Output
2963
+ }] } });
2964
+
2965
+ class CalculateQuotesService {
2966
+ constructor() { }
2967
+ calculateQuotes(params) {
2968
+ let dataFinancing = [];
2969
+ let index = 1; // Indicador de cant. de cuotas
2970
+ let momentJs = moment(params.date).add('1', 'days');
2971
+ if (this.validateSunday(momentJs.toDate())) {
2972
+ Swal.fire({
2973
+ title: 'Fecha inválida',
2974
+ text: 'Debe seleccionar un día de la semana diferente al domingo',
2975
+ icon: 'error'
2976
+ });
2977
+ }
2978
+ else {
2979
+ let quota = [
2980
+ index,
2981
+ Intl.NumberFormat('en-US', {
2982
+ style: 'currency',
2983
+ currency: 'USD',
2984
+ minimumFractionDigits: 0
2985
+ }).format(Math.round(parseFloat(params.quotaValues.toString()))),
2986
+ momentJs.format('dddd') + ', ' + momentJs.format('MMMM DD YYYY')
2987
+ ];
2988
+ dataFinancing.push(quota);
2989
+ while (index < params.quotaTimes) {
2990
+ index = index + 1;
2991
+ const momentJs = moment(params.date).add(index - 1, 'M');
2992
+ if (this.validateSunday(momentJs.toDate())) {
2993
+ momentJs.add(1, 'days');
2994
+ Swal.fire({
2995
+ title: 'Querido asesor',
2996
+ text: 'Hemos ajustado las fechas para que no se asignen en Domingos',
2997
+ icon: 'info'
2998
+ });
2999
+ }
3000
+ let row = [
3001
+ index,
3002
+ Intl.NumberFormat('en-US', {
3003
+ style: 'currency',
3004
+ currency: 'USD',
3005
+ minimumFractionDigits: 0,
3006
+ }).format(Math.round(params.quotaValues)),
3007
+ momentJs.format('dddd') + ', ' + momentJs.format('MMMM DD YYYY'),
3008
+ ];
3009
+ dataFinancing.push(row);
3010
+ }
3011
+ }
3012
+ return dataFinancing;
3013
+ }
3014
+ validateSunday(date) {
3015
+ const momentJs = moment(date);
3016
+ if (momentJs.isoWeekday() === 7) {
3017
+ return true;
3018
+ }
3019
+ else {
3020
+ return false;
3021
+ }
3022
+ }
3023
+ }
3024
+ CalculateQuotesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3025
+ CalculateQuotesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, providedIn: 'root' });
3026
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, decorators: [{
3027
+ type: Injectable,
3028
+ args: [{
3029
+ providedIn: 'root'
3030
+ }]
3031
+ }], ctorParameters: function () { return []; } });
3032
+
3033
+ class CodFormStepFourComponent extends CodFormSteps {
3034
+ constructor(fb, calculateQuotesService, communicatorService, parameterService, codFormControls, commercialService) {
3035
+ super();
3036
+ this.fb = fb;
3037
+ this.calculateQuotesService = calculateQuotesService;
3038
+ this.communicatorService = communicatorService;
3039
+ this.parameterService = parameterService;
3040
+ this.codFormControls = codFormControls;
3041
+ this.commercialService = commercialService;
3042
+ this.changeStepEvent = new EventEmitter();
3043
+ this.financingData = new EventEmitter();
3044
+ this.isCalculateQuotesButtonClicked = false;
3045
+ this.errorMessage = 'Faltan campos por llenar.';
3046
+ this.paymentMethods = [
3047
+ { code: '1', name: 'Financiado' },
3048
+ { code: '2', name: 'Contado' },
3049
+ ];
3050
+ this.dataFinancing = [];
3051
+ this.isFinancing = false;
3052
+ this.isSemestral = false;
3053
+ this.codPrices = [];
3054
+ // Controls del formulario
3055
+ this.controls = new CodFormControls().controls[3];
3056
+ }
3057
+ ngOnInit() {
3058
+ this.initForm();
3059
+ this.startLocalStorageWork();
3060
+ this.validateErrors();
3061
+ this.getCodPricesByAgreement();
3062
+ this.getValuesOfStepOneComponent();
3063
+ }
3064
+ getValuesOfStepOneComponent() {
3065
+ // Tipo de curso seleccionado
3066
+ this.communicatorService.getSelectedCourseType().subscribe(value => {
3067
+ this.parameterService.getCoursesTypes().pipe(map((response) => {
3068
+ const courseTypes = response.data;
3069
+ return courseTypes.filter(({ name }) => name.includes('Semestral'));
3070
+ }))
3071
+ .subscribe((courseTypes) => {
3072
+ for (let i = 0; i < courseTypes.length; i++) {
3073
+ if (courseTypes[i].code.toString() === value) {
3074
+ this.isSemestral = true;
3075
+ break;
3076
+ }
3077
+ else {
3078
+ this.isSemestral = false;
3079
+ }
3080
+ }
3081
+ });
3082
+ });
3083
+ // Convenio seleccionado
3084
+ this.communicatorService.getSelectedAgreement().subscribe(value => {
3085
+ this.getCodPricesByAgreement(value);
3086
+ });
3087
+ }
3088
+ getCodPricesByAgreement(agreement) {
3089
+ let agreementSelected;
3090
+ if (agreement) {
3091
+ agreementSelected = agreement;
3092
+ }
3093
+ else {
3094
+ agreementSelected = this.localStorageCOD.getCodFormData(1, 'agreement_by_category');
3095
+ }
3096
+ this.commercialService.getCodPricesByAgreement(Number(agreementSelected)).subscribe({
3097
+ next: (response) => {
3098
+ if (response.data) {
3099
+ const codPrices = response.data;
3100
+ this.codPrices = codPrices;
3101
+ if (this.codFormStepFour.controls['payment_method'].value === '2') {
3102
+ const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
3103
+ this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
3104
+ }
3105
+ if (this.codFormStepFour.controls['payment_method'].value === '1') {
3106
+ const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
3107
+ this.codFormStepFour.controls['quota_times'].setValue(aux.code);
3108
+ this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
3109
+ }
3110
+ }
3111
+ },
3112
+ error: (err) => console.log(err)
3113
+ });
3114
+ }
3115
+ validateErrors() {
3116
+ this.codFormStepFour.valueChanges.subscribe(changes => {
3117
+ if (this.codFormStepFour.controls['quota_times'].hasError('min')) {
3118
+ this.errorMessage = 'La cantidad de cuotas mínimas debe ser 1';
3119
+ }
3120
+ else if (this.codFormStepFour.controls['quota_times'].hasError('max')) {
3121
+ this.errorMessage = 'La cantidad de cuotas no debe ser superior a 12';
3122
+ }
3123
+ else {
3124
+ this.errorMessage = 'Faltan campos por llenar';
3125
+ }
3126
+ });
3127
+ }
3128
+ initForm() {
3129
+ this.codFormStepFour = this.fb.group({
3130
+ program_price: [{ value: '', disabled: true }, [Validators.required]],
3131
+ payment_date: ['', [Validators.required]],
3132
+ payment_method: ['', [Validators.required]],
3133
+ quota_times: ['', [Validators.required]],
3134
+ total_price: [{ value: '', disabled: true }, [Validators.required]],
3135
+ });
3136
+ this.listenPaymentMethodField();
3137
+ }
3138
+ listenPaymentMethodField() {
3139
+ const control = this.codFormStepFour.get('payment_method');
3140
+ control === null || control === void 0 ? void 0 : control.valueChanges.subscribe((change) => {
3141
+ // Financiado
3142
+ if (change === '1') {
3143
+ // Poner validaciones
3144
+ this.codFormStepFour.controls['program_price'].setValidators([Validators.required]);
3145
+ this.codFormStepFour.controls['payment_date'].setValidators([Validators.required]);
3146
+ this.codFormStepFour.controls['quota_times'].setValidators([Validators.required]);
3147
+ this.codFormStepFour.controls['total_price'].setValidators([Validators.required]);
3148
+ // Actualizar para que se tomen los cambios
3149
+ this.updateValueAndValidity();
3150
+ // Actualizar los controls globales
3151
+ this.updateGlobalControls(change);
3152
+ }
3153
+ // de contado
3154
+ if (change === '2') {
3155
+ // Quitar las validaciones
3156
+ this.codFormStepFour.controls['program_price'].setValidators([Validators.required]);
3157
+ this.codFormStepFour.controls['payment_date'].setValidators([Validators.required]);
3158
+ this.codFormStepFour.controls['quota_times'].clearValidators();
3159
+ this.codFormStepFour.controls['total_price'].setValidators([Validators.required]);
3160
+ // Actualizar para que se tomen los cambios
3161
+ this.updateValueAndValidity();
3162
+ // Actualizar los controls globales
3163
+ this.updateGlobalControls(change);
3164
+ }
3165
+ });
3166
+ }
3167
+ updateGlobalControls(change) {
3168
+ let controls = this.controls.filter(control => control.name !== 'payment_method');
3169
+ controls.forEach(control => {
3170
+ if (change === '1')
3171
+ this.codFormControls.changeValue(4, control.name, true);
3172
+ if (change === '2') {
3173
+ if (control.name === 'quota_times')
3174
+ this.codFormControls.changeValue(4, control.name, false);
3175
+ }
3176
+ });
3177
+ }
3178
+ updateValueAndValidity() {
3179
+ this.codFormStepFour.controls['program_price'].updateValueAndValidity();
3180
+ this.codFormStepFour.controls['payment_date'].updateValueAndValidity();
3181
+ this.codFormStepFour.controls['quota_times'].updateValueAndValidity();
3182
+ this.codFormStepFour.controls['total_price'].updateValueAndValidity();
3183
+ }
3184
+ startLocalStorageWork() {
3185
+ this.controls.forEach(control => {
3186
+ let localStorageValue = this.readAndWriteLS(4, control.name);
3187
+ this.codFormStepFour.controls[control.name].setValue(localStorageValue.value);
3188
+ this.listenFormChanges(4, control.name, this.codFormStepFour.controls[control.name].valueChanges);
3189
+ });
3190
+ }
3191
+ showTable() {
3192
+ this.isCalculateQuotesButtonClicked = true;
3193
+ const total_price = this.codFormStepFour.controls['total_price'].value;
3194
+ if ((total_price === 'null') || this.codFormStepFour.invalid) {
3195
+ Swal.fire({
3196
+ title: 'Error',
3197
+ text: 'Debes ingresar el monto total de la matrícula y la cuota inicial',
3198
+ icon: 'error'
3199
+ });
3200
+ return;
3201
+ }
3202
+ // Calcular cuotas
3203
+ this.dataFinancing = [];
3204
+ const quotaValues = this.codPrices.filter(codPrice => codPrice.code === Number(this.codFormStepFour.controls['quota_times'].value))[0].quota_price;
3205
+ let params = {
3206
+ date: new Date(this.codFormStepFour.controls['payment_date'].value),
3207
+ quotaValues,
3208
+ quotaTimes: this.codPrices.filter(codPrice => codPrice.code === Number(this.codFormStepFour.controls['quota_times'].value))[0].fee_number,
3209
+ totalPrice: this.codFormStepFour.controls['total_price'].value
3210
+ };
3211
+ this.dataFinancing = this.calculateQuotesService.calculateQuotes(params);
3212
+ this.isFinancing = true;
3213
+ this.financingData.emit(this.dataFinancing);
3214
+ }
3215
+ calculateNewQuotes() {
3216
+ this.isCalculateQuotesButtonClicked = false;
3217
+ this.isFinancing = false;
3218
+ this.financingData.emit(null);
3219
+ }
3220
+ sendForm() {
3221
+ this.codFormStepFour.markAllAsTouched();
3222
+ if (this.codFormStepFour.invalid)
3223
+ return;
3224
+ // Movernos al paso 5
3225
+ this.changeStepEvent.emit(4);
3226
+ }
3227
+ isFinanced() {
3228
+ return this.codFormStepFour.controls['payment_method'].value == 1;
3229
+ }
3230
+ // Eventos del select
3231
+ selectPaymentMethod(paymentMethod) {
3232
+ if (paymentMethod !== '') {
3233
+ this.codFormStepFour.controls['payment_method'].setValue(paymentMethod);
3234
+ this.getCodPricesByAgreement();
3235
+ }
3236
+ else {
3237
+ this.codFormStepFour.controls['payment_method'].setValue(null);
3238
+ }
3239
+ }
3240
+ selectQuotas(quotas) {
3241
+ if (quotas !== 'Número de cuotas') {
3242
+ const codPrice = this.codPrices.filter(codPrice => codPrice.code === Number(quotas));
3243
+ this.codFormStepFour.controls['quota_times'].setValue(codPrice[0].code);
3244
+ this.codFormStepFour.controls['total_price'].setValue(codPrice[0].enrollment);
3245
+ this.codFormStepFour.controls['program_price'].setValue(codPrice[0].financed_price);
3246
+ }
3247
+ else {
3248
+ this.codFormStepFour.controls['quota_times'].setValue(null);
3249
+ this.codFormStepFour.controls['total_price'].setValue(null);
3250
+ this.codFormStepFour.controls['program_price'].setValue(null);
3251
+ }
3252
+ }
3253
+ }
3254
+ CodFormStepFourComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFourComponent, deps: [{ token: i1$1.FormBuilder }, { token: CalculateQuotesService }, { token: CommunicatorService }, { token: ParameterService }, { token: CodFormControls }, { token: CommercialService }], target: i0.ɵɵFactoryTarget.Component });
3255
+ CodFormStepFourComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepFourComponent, selector: "app-cod-form-step-four", outputs: { changeStepEvent: "changeStepEvent", financingData: "financingData" }, usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\r\n <strong>Nota: </strong>\r\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\r\n</div>\r\n\r\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\r\n\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\r\n [control]=\"codFormStepFour.controls['payment_method']\"\r\n (eventSelect)=\"selectPaymentMethod($event)\"\r\n [data]=\"paymentMethods\"\r\n [defaultText]=\"'M\u00E9todo de pago'\"\r\n ></ipt-select>\r\n <ipt-select *ngIf=\"isFinanced();\"\r\n [initialValue]=\"codFormStepFour.controls['quota_times'].value\"\r\n [control]=\"codFormStepFour.controls['quota_times']\"\r\n (eventSelect)=\"selectQuotas($event)\"\r\n [defaultText]=\"'N\u00FAmero de cuotas'\"\r\n [data]=\"codPrices\"\r\n [selectCode]=\"codFormStepFour.controls['quota_times'].value === null? 'N\u00FAmero de cuotas': codFormStepFour.controls['quota_times'].value\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"isFinanced();\" class=\"col-12\">\r\n <ipt-input *ngIf=\"isFinanced();\"\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\r\n [control]=\"codFormStepFour.controls['total_price']\"\r\n [withPipe]=\"true\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n [withPipe]=\"true\"\r\n [inputType]=\"'text'\"\r\n [control]=\"codFormStepFour.controls['program_price']\"\r\n [placeHolder]=\"'Valor total del programa'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepFour.controls['payment_date']\"\r\n [placeHolder]=\"'Fecha de pago'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <!-- Tabla de financiaci\u00F3n -->\r\n <div class=\"col-12\" *ngIf=\"isFinancing\">\r\n <p-table\r\n [value]=\"dataFinancing\"\r\n [tableStyle]=\"{'min-width': '100%'}\"\r\n [rowHover]=\"true\"\r\n >\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center\">\r\n C\u00E1lculo de cuotas\r\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" lab icon=\"pi pi-replay\"></button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th>#</th>\r\n <th>Valor</th>\r\n <th>Fecha</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-data>\r\n <tr>\r\n <td>{{ data[0] }}</td>\r\n <td>{{ data[1] }}</td>\r\n <td>{{ data[2] }}</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n <!-- ---------------------- -->\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <div class=\"flex ml-auto gap-2\">\r\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\r\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n </div>\r\n</div>\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }, { type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }, { type: i9.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i11.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
3256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFourComponent, decorators: [{
3257
+ type: Component,
3258
+ args: [{ selector: 'app-cod-form-step-four', template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\r\n <strong>Nota: </strong>\r\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\r\n</div>\r\n\r\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\r\n\r\n <div class=\"col-12\">\r\n <ipt-select\r\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\r\n [control]=\"codFormStepFour.controls['payment_method']\"\r\n (eventSelect)=\"selectPaymentMethod($event)\"\r\n [data]=\"paymentMethods\"\r\n [defaultText]=\"'M\u00E9todo de pago'\"\r\n ></ipt-select>\r\n <ipt-select *ngIf=\"isFinanced();\"\r\n [initialValue]=\"codFormStepFour.controls['quota_times'].value\"\r\n [control]=\"codFormStepFour.controls['quota_times']\"\r\n (eventSelect)=\"selectQuotas($event)\"\r\n [defaultText]=\"'N\u00FAmero de cuotas'\"\r\n [data]=\"codPrices\"\r\n [selectCode]=\"codFormStepFour.controls['quota_times'].value === null? 'N\u00FAmero de cuotas': codFormStepFour.controls['quota_times'].value\"\r\n ></ipt-select>\r\n </div>\r\n\r\n <div *ngIf=\"isFinanced();\" class=\"col-12\">\r\n <ipt-input *ngIf=\"isFinanced();\"\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\r\n [control]=\"codFormStepFour.controls['total_price']\"\r\n [withPipe]=\"true\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n [withPipe]=\"true\"\r\n [inputType]=\"'text'\"\r\n [control]=\"codFormStepFour.controls['program_price']\"\r\n [placeHolder]=\"'Valor total del programa'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <div class=\"col-12\">\r\n <ipt-input\r\n onfocus=\"(this.type='date')\"\r\n [inputType]=\"'date'\"\r\n [control]=\"codFormStepFour.controls['payment_date']\"\r\n [placeHolder]=\"'Fecha de pago'\"\r\n ></ipt-input>\r\n </div>\r\n\r\n <!-- Tabla de financiaci\u00F3n -->\r\n <div class=\"col-12\" *ngIf=\"isFinancing\">\r\n <p-table\r\n [value]=\"dataFinancing\"\r\n [tableStyle]=\"{'min-width': '100%'}\"\r\n [rowHover]=\"true\"\r\n >\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center\">\r\n C\u00E1lculo de cuotas\r\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" lab icon=\"pi pi-replay\"></button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th>#</th>\r\n <th>Valor</th>\r\n <th>Fecha</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-data>\r\n <tr>\r\n <td>{{ data[0] }}</td>\r\n <td>{{ data[1] }}</td>\r\n <td>{{ data[2] }}</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n <!-- ---------------------- -->\r\n\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <div class=\"flex ml-auto gap-2\">\r\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\r\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" class=\"ml-auto p-button-sm\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\r\n </div>\r\n</div>\r\n", styles: [""] }]
3259
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: CalculateQuotesService }, { type: CommunicatorService }, { type: ParameterService }, { type: CodFormControls }, { type: CommercialService }]; }, propDecorators: { changeStepEvent: [{
3260
+ type: Output
3261
+ }], financingData: [{
3262
+ type: Output
3263
+ }] } });
3264
+
3265
+ class CodFormStepFiveComponent extends CodFormSteps {
3266
+ constructor(fb, parameterService) {
3267
+ super();
3268
+ this.fb = fb;
3269
+ this.parameterService = parameterService;
3270
+ this.changeStepEvent = new EventEmitter();
3271
+ this.action = new EventEmitter();
3272
+ this.errorMessage = 'Faltan campos por llenar.';
3273
+ this.termsCheckboxStatus = false;
3274
+ // Controls del formulario
3275
+ this.controls = new CodFormControls().controls[4];
3276
+ }
3277
+ ngOnInit() {
3278
+ this.getParameters();
3279
+ this.initForm();
3280
+ this.startLocalStorageWork();
3281
+ this.codFormStepFive.controls['terms'].valueChanges.subscribe(changes => {
3282
+ this.termsCheckboxStatus = changes;
3283
+ if (!this.termsCheckboxStatus)
3284
+ this.errorMessage = 'Debe marcar la casilla de términos y condiciones.';
3285
+ });
3286
+ if (this.userRole === 30 || this.userRole === 31 || this.userRole === 32)
3287
+ this.sendFormMsg = 'Editar COD'; // Roles Administrativos
3288
+ if (this.userRole === 40 || this.userRole === 41 || this.userRole === 42)
3289
+ this.sendFormMsg = 'Crear COD'; // Roles comerciales
3290
+ }
3291
+ getParameters() {
3292
+ this.parameterService.getMarketingReasons().subscribe((response) => {
3293
+ this.marketingReasons = response.data;
3294
+ });
3295
+ this.parameterService.getStudyReasons().subscribe((response) => {
3296
+ this.studyReasons = response.data;
3297
+ });
3298
+ this.parameterService.getMulticulturalisms().subscribe((response) => {
3299
+ this.multiculturalities = response.data;
3300
+ });
3301
+ }
3302
+ initForm() {
3303
+ this.codFormStepFive = this.fb.group({
3304
+ marketing_reasons: ['', [Validators.required]],
3305
+ observation: [''],
3306
+ study_reasons: ['', [Validators.required]],
3307
+ terms: [false, [Validators.required]],
3308
+ disability: [''],
3309
+ multiculturalism_1: [false, []],
3310
+ multiculturalism_2: [false, []],
3311
+ multiculturalism_3: [false, []],
3312
+ multiculturalism_4: [false, []],
3313
+ multiculturalism_5: [false, []],
3314
+ multiculturalism_6: [false, []],
3315
+ multiculturalism_7: [false, []],
3316
+ health_regimen: ['', [Validators.required]],
3317
+ });
3318
+ this.codFormStepFive.controls['marketing_reasons'].valueChanges.subscribe(change => {
3319
+ if (change === '4') {
3320
+ this.errorMessage = 'Los datos de la persona que refirió al estudiante son requeridos en el campo "Observaciones".';
3321
+ Swal.fire({
3322
+ title: 'Información',
3323
+ text: 'Llene en el campo de observaciones los datos de la persona que lo refirió',
3324
+ icon: 'info'
3325
+ });
3326
+ this.codFormStepFive.controls['observation'].setValidators([Validators.required]);
3327
+ this.codFormStepFive.controls['observation'].updateValueAndValidity();
3328
+ }
3329
+ else {
3330
+ this.codFormStepFive.controls['observation'].clearValidators();
3331
+ this.codFormStepFive.controls['observation'].updateValueAndValidity();
3332
+ }
3333
+ });
3334
+ }
3335
+ startLocalStorageWork() {
3336
+ this.controls.forEach(control => {
3337
+ let localStorageValue = this.readAndWriteLS(5, control.name);
3338
+ // Solución al bug del checkbox
3339
+ if (localStorageValue.control === 'terms') {
3340
+ let nextValue = localStorageValue.value === 'true' ? true : false;
3341
+ this.codFormStepFive.controls['terms'].setValue(nextValue);
3342
+ this.termsCheckboxStatus = nextValue;
3343
+ }
3344
+ // -------------------------- //
3345
+ this.codFormStepFive.controls[control.name].setValue(localStorageValue.value);
3346
+ this.listenFormChanges(5, control.name, this.codFormStepFive.controls[control.name].valueChanges);
3347
+ });
3348
+ this.controls.filter(control => control.description === 'Multiculturalismo').forEach(control => {
3349
+ let localStorageValue = this.readAndWriteLS(5, control.name);
3350
+ let nextValue = localStorageValue.value === 'true' ? true : false;
3351
+ this.codFormStepFive.controls[control.name].setValue(nextValue);
3352
+ });
3353
+ }
3354
+ getCheckboxControl() {
3355
+ return this.codFormStepFive.controls['terms'];
3356
+ }
3357
+ sendForm() {
3358
+ this.codFormStepFive.markAllAsTouched();
3359
+ if (this.codFormStepFive.invalid || this.termsCheckboxStatus === false)
3360
+ return;
3361
+ if (this.userRole === 30 || this.userRole === 31 || this.userRole === 32)
3362
+ this.action.emit('update');
3363
+ if (this.userRole === 40 || this.userRole === 41 || this.userRole === 42)
3364
+ this.action.emit('create');
3365
+ }
3366
+ // Eventos del select
3367
+ selectMarketingReasons(marketingReasons) {
3368
+ if (marketingReasons !== '¿Cómo se enteró del programa?') {
3369
+ this.codFormStepFive.controls['marketing_reasons'].setValue(marketingReasons);
3370
+ }
3371
+ else {
3372
+ this.codFormStepFive.controls['marketing_reasons'].setValue(null);
3373
+ }
3374
+ }
3375
+ selectStudyReasons(studyReasons) {
3376
+ if (studyReasons !== 'Motivo') {
3377
+ this.codFormStepFive.controls['study_reasons'].setValue(studyReasons);
3378
+ }
3379
+ else {
3380
+ this.codFormStepFive.controls['study_reasons'].setValue(null);
3381
+ }
3382
+ }
3383
+ }
3384
+ CodFormStepFiveComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFiveComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }], target: i0.ɵɵFactoryTarget.Component });
3385
+ CodFormStepFiveComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormStepFiveComponent, selector: "app-cod-form-step-five", inputs: { userRole: "userRole" }, outputs: { changeStepEvent: "changeStepEvent", action: "action" }, usesInheritance: true, ngImport: i0, template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepFive\" class=\"grid\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['marketing_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['marketing_reasons'].value\"\r\n (eventSelect)=\"selectMarketingReasons($event)\"\r\n [data]=\"marketingReasons\"\r\n [defaultText]=\"'\u00BFC\u00F3mo se enter\u00F3 del programa?'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Discapacidad'\"\r\n [control]=\"codFormStepFive.controls['disability']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['study_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['study_reasons'].value\"\r\n (eventSelect)=\"selectStudyReasons($event)\"\r\n [data]=\"studyReasons\"\r\n [defaultText]=\"'Motivo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'R\u00E9gimen de salud'\"\r\n [control]=\"codFormStepFive.controls['health_regimen']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 mt-4\">\r\n <span class=\"p-float-label\">\r\n <textarea\r\n id=\"float-input\"\r\n rows=\"4\"\r\n cols=\"30\"\r\n pInputTextarea\r\n formControlName=\"observation\"\r\n ></textarea>\r\n <label for=\"float-input\">Observaciones</label>\r\n </span>\r\n <div class=\"flex flex-wrap justify-content-between gap-2\">\r\n <div *ngFor=\"let option of multiculturalities; index as i\" class=\"field-checkbox mt-4 flex align-items-center\">\r\n <mat-checkbox [formControlName]=\"'multiculturalism' + '_' + (i+1)\" class=\"example-margin\"></mat-checkbox>\r\n <label [for]=\"option.code\">{{ option.name }}</label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 p-4 font-bold\">\r\n <p>\r\n * El estudiante o titular se comprometen a cancelar las cuotas establecidas en este contrato, los\r\n primeros 5 (cinco) d\u00EDas del mes. En caso de querer retirarse, deber\u00E1 informar por escrito 30\r\n (treinta) d\u00EDas antes y cancelar lo correspondiente hasta la fecha definida de retiro, para poder\r\n obtener su paz y salvo.\r\n </p>\r\n <br><br>\r\n <div class=\"flex gap-2\">\r\n <mat-checkbox formControlName=\"terms\" class=\"example-margin\"></mat-checkbox>\r\n <!-- <p-checkbox [formControl]=\"getCheckboxControl()\"></p-checkbox> -->\r\n <!-- <ipt-checkbox [control]=\"codFormStepFive.controls['terms']\" [checkboxOption]=\"termsCheckboxStatus\"></ipt-checkbox> -->\r\n <p>\r\n DECLARO HABER LE\u00CDDO Y ACEPTO LOS T\u00C9RMINOS Y CONDICIONES DE LAS POL\u00CDTICAS ESTABLECIDAS EN LA\r\n INSTITUCI\u00D3N.\r\n </p>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepFive.invalid && codFormStepFive.touched) || (!termsCheckboxStatus && codFormStepFive.touched)\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-success p-button-sm\" (click)=\"sendForm()\" pButton [label]=\"sendFormMsg\" icon=\"pi pi-check\"></button>\r\n</div>\r\n\r\n", styles: [""], components: [{ type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }, { type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }, { type: i5$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
3386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormStepFiveComponent, decorators: [{
3387
+ type: Component,
3388
+ args: [{ selector: 'app-cod-form-step-five', template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepFive\" class=\"grid\">\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['marketing_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['marketing_reasons'].value\"\r\n (eventSelect)=\"selectMarketingReasons($event)\"\r\n [data]=\"marketingReasons\"\r\n [defaultText]=\"'\u00BFC\u00F3mo se enter\u00F3 del programa?'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'Discapacidad'\"\r\n [control]=\"codFormStepFive.controls['disability']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 md:col-6\">\r\n <ipt-select\r\n [control]=\"codFormStepFive.controls['study_reasons']\"\r\n [initialValue]=\"codFormStepFive.controls['study_reasons'].value\"\r\n (eventSelect)=\"selectStudyReasons($event)\"\r\n [data]=\"studyReasons\"\r\n [defaultText]=\"'Motivo'\"\r\n ></ipt-select>\r\n <ipt-input\r\n [inputType]=\"'text'\"\r\n [placeHolder]=\"'R\u00E9gimen de salud'\"\r\n [control]=\"codFormStepFive.controls['health_regimen']\"\r\n ></ipt-input>\r\n </div>\r\n <div class=\"col-12 mt-4\">\r\n <span class=\"p-float-label\">\r\n <textarea\r\n id=\"float-input\"\r\n rows=\"4\"\r\n cols=\"30\"\r\n pInputTextarea\r\n formControlName=\"observation\"\r\n ></textarea>\r\n <label for=\"float-input\">Observaciones</label>\r\n </span>\r\n <div class=\"flex flex-wrap justify-content-between gap-2\">\r\n <div *ngFor=\"let option of multiculturalities; index as i\" class=\"field-checkbox mt-4 flex align-items-center\">\r\n <mat-checkbox [formControlName]=\"'multiculturalism' + '_' + (i+1)\" class=\"example-margin\"></mat-checkbox>\r\n <label [for]=\"option.code\">{{ option.name }}</label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 p-4 font-bold\">\r\n <p>\r\n * El estudiante o titular se comprometen a cancelar las cuotas establecidas en este contrato, los\r\n primeros 5 (cinco) d\u00EDas del mes. En caso de querer retirarse, deber\u00E1 informar por escrito 30\r\n (treinta) d\u00EDas antes y cancelar lo correspondiente hasta la fecha definida de retiro, para poder\r\n obtener su paz y salvo.\r\n </p>\r\n <br><br>\r\n <div class=\"flex gap-2\">\r\n <mat-checkbox formControlName=\"terms\" class=\"example-margin\"></mat-checkbox>\r\n <!-- <p-checkbox [formControl]=\"getCheckboxControl()\"></p-checkbox> -->\r\n <!-- <ipt-checkbox [control]=\"codFormStepFive.controls['terms']\" [checkboxOption]=\"termsCheckboxStatus\"></ipt-checkbox> -->\r\n <p>\r\n DECLARO HABER LE\u00CDDO Y ACEPTO LOS T\u00C9RMINOS Y CONDICIONES DE LAS POL\u00CDTICAS ESTABLECIDAS EN LA\r\n INSTITUCI\u00D3N.\r\n </p>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n<div class=\"flex mt-3 align-items-center gap-3\">\r\n <span *ngIf=\"(codFormStepFive.invalid && codFormStepFive.touched) || (!termsCheckboxStatus && codFormStepFive.touched)\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\r\n <button type=\"submit\" class=\"ml-auto p-button-success p-button-sm\" (click)=\"sendForm()\" pButton [label]=\"sendFormMsg\" icon=\"pi pi-check\"></button>\r\n</div>\r\n\r\n", styles: [""] }]
3389
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }]; }, propDecorators: { userRole: [{
3390
+ type: Input
3391
+ }], changeStepEvent: [{
3392
+ type: Output
3393
+ }], action: [{
3394
+ type: Output
3395
+ }] } });
3396
+
3397
+ class CodFormComponent {
3398
+ constructor(baseService, localStorageCOD, codFormControls, commercialService) {
3399
+ this.baseService = baseService;
3400
+ this.localStorageCOD = localStorageCOD;
3401
+ this.codFormControls = codFormControls;
3402
+ this.commercialService = commercialService;
3403
+ this.allowedRoles = [
3404
+ 30, 31, 32, 40, 41, 42,
3405
+ ];
3406
+ this.currentStep = 0;
3407
+ this.formTitle = 'Formulario para creación del COD';
3408
+ this.formSteps = 5;
3409
+ this.isLoading = false;
3410
+ this.loaderMessage = '';
3411
+ this.userRole = this.baseService.getUserRole();
3412
+ }
3413
+ ngOnChanges(changes) {
3414
+ if (changes['codCode']) {
3415
+ this.formTitle = 'Formulario para verificar información del COD';
3416
+ this.getCodbyCode();
3417
+ }
3418
+ else {
3419
+ this.formTitle = 'Formulario para creación del COD';
3420
+ }
3421
+ }
3422
+ allowedRole() {
3423
+ return this.allowedRoles.includes(this.userRole);
3424
+ }
3425
+ getCodbyCode() {
3426
+ // TODO: Traer COD por código y pintarlo
3427
+ console.log(this.codCode);
3428
+ }
3429
+ saveFinancingData(data) {
3430
+ if (data) {
3431
+ const dates = [];
3432
+ data.forEach(p => {
3433
+ const date = p[2].split(',')[1];
3434
+ const formattedDate = new Date(date);
3435
+ const momentDate = moment(formattedDate).format().split('T')[0];
3436
+ dates.push(momentDate);
3437
+ });
3438
+ this.financingData = dates;
3439
+ }
3440
+ }
3441
+ getFormAction(action) {
3442
+ if (!this.financingData && this.localStorageCOD.getCodFormData(4, 'payment_method') === '1') {
3443
+ Swal.fire({
3444
+ title: 'Querido asesor',
3445
+ text: 'Debe hacer el cálculo de las cuotas en el paso 4',
3446
+ icon: 'error'
3447
+ });
3448
+ return;
3449
+ }
3450
+ const totalData = [];
3451
+ this.subscription = this.codFormControls.getControlValues().subscribe((controls) => {
3452
+ for (let i = 1; i <= this.formSteps; i++) {
3453
+ let controlsByStep = controls[i - 1];
3454
+ controlsByStep.forEach(control => {
3455
+ let value = this.localStorageCOD.getCodFormData(i, control.name);
3456
+ // Cambiar True/False del multiculturalismo 1/0
3457
+ if (value === 'false' && control.description === 'Multiculturalismo') {
3458
+ totalData.push({
3459
+ control: control.name,
3460
+ isRequired: control.required,
3461
+ value: '0',
3462
+ description: control.description
3463
+ });
3464
+ }
3465
+ else if (value === 'false' && control.description === 'Multiculturalismo') {
3466
+ totalData.push({
3467
+ control: control.name,
3468
+ isRequired: control.required,
3469
+ value: '1',
3470
+ description: control.description
3471
+ });
3472
+ }
3473
+ else {
3474
+ totalData.push({
3475
+ control: control.name,
3476
+ isRequired: control.required,
3477
+ value,
3478
+ description: control.description
3479
+ });
3480
+ }
3481
+ });
3482
+ }
3483
+ // Validar errores
3484
+ for (let i = 0; i < totalData.length; i++) {
3485
+ const element = totalData[i];
3486
+ if (!element.value && element.isRequired) {
3487
+ Swal.fire({
3488
+ title: 'Error',
3489
+ text: `Revisar el campo: "${element.description}"`,
3490
+ icon: 'error'
3491
+ });
3492
+ break;
3493
+ }
3494
+ }
3495
+ if (action === 'create')
3496
+ this.createCOD(totalData);
3497
+ if (action === 'update')
3498
+ this.updateCOD(totalData);
3499
+ });
3500
+ this.subscription.unsubscribe();
3501
+ }
3502
+ updateCOD(totalData) {
3503
+ console.log('actualizando COD...');
3504
+ }
3505
+ createCOD(totalData) {
3506
+ this.isLoading = true;
3507
+ this.loaderMessage = 'Creando COD, espere un momento';
3508
+ let request = this.getCreateCODRq(totalData);
3509
+ this.commercialService.createCOD(request).subscribe({
3510
+ next: (response) => {
3511
+ console.log(response);
3512
+ if (response.message.code === 1) {
3513
+ this.isLoading = false;
3514
+ this.loaderMessage = '';
3515
+ Swal.fire({
3516
+ title: 'Perfecto!',
3517
+ text: 'El COD ha sido creado exitosamente.',
3518
+ icon: 'success'
3519
+ });
3520
+ }
3521
+ },
3522
+ error: (err) => {
3523
+ console.log(err);
3524
+ this.isLoading = false;
3525
+ this.loaderMessage = '';
3526
+ Swal.fire({
3527
+ title: 'Error',
3528
+ text: err.error.text,
3529
+ icon: 'error'
3530
+ });
3531
+ }
3532
+ });
3533
+ }
3534
+ getCreateCODRq(data) {
3535
+ let request = {
3536
+ token: this.baseService.getUserToken(),
3537
+ academic_plan: data.filter(data => data.control === 'academic_plan')[0].value,
3538
+ course_type: data.filter(data => data.control === 'course_type')[0].value,
3539
+ agreement_by_category: data.filter(data => data.control === 'agreement_by_category')[0].value,
3540
+ english_level: data.filter(data => data.control === 'english_level')[0].value,
3541
+ availible_courses: data.filter(data => data.control === 'availible_courses')[0].value,
3542
+ student_address: data.filter(data => data.control === 'student_address')[0].value,
3543
+ birthdate: data.filter(data => data.control === 'birthdate')[0].value,
3544
+ country: data.filter(data => data.control === 'country')[0].value,
3545
+ state: data.filter(data => data.control === 'state')[0].value,
3546
+ city: data.filter(data => data.control === 'city')[0].value,
3547
+ student_id_card_type: data.filter(data => data.control === 'student_id_card_type')[0].value,
3548
+ student_id_card: data.filter(data => data.control === 'student_id_card')[0].value,
3549
+ student_last_name: data.filter(data => data.control === 'student_last_name')[0].value,
3550
+ student_name: data.filter(data => data.control === 'student_name')[0].value,
3551
+ student_email: data.filter(data => data.control === 'student_email')[0].value,
3552
+ nickname: data.filter(data => data.control === 'nickname')[0].value,
3553
+ gender: data.filter(data => data.control === 'gender')[0].value,
3554
+ age: data.filter(data => data.control === 'age')[0].value,
3555
+ student_occupation: data.filter(data => data.control === 'student_occupation')[0].value,
3556
+ stratum: data.filter(data => data.control === 'stratum')[0].value,
3557
+ grade: data.filter(data => data.control === 'grade')[0].value,
3558
+ civil_status: data.filter(data => data.control === 'civil_status')[0].value,
3559
+ student_phone_indicative: data.filter(data => data.control === 'student_phone_indicative')[0].value,
3560
+ student_phone_number: data.filter(data => data.control === 'student_phone_number')[0].value,
3561
+ password: data.filter(data => data.control === 'password')[0].value,
3562
+ re_password: data.filter(data => data.control === 're_password')[0].value,
3563
+ parent_id_card_type: data.filter(data => data.control === 'parent_id_card_type')[0].value,
3564
+ parent_id_card: data.filter(data => data.control === 'parent_id_card')[0].value,
3565
+ parent_last_name: data.filter(data => data.control === 'parent_last_name')[0].value,
3566
+ parent_name: data.filter(data => data.control === 'parent_name')[0].value,
3567
+ needAtendant: data.filter(data => data.control === 'needAtendant')[0].value,
3568
+ parent_phone_indicative: data.filter(data => data.control === 'parent_phone_indicative')[0].value,
3569
+ parent_occupation: data.filter(data => data.control === 'parent_occupation')[0].value,
3570
+ parent_address: data.filter(data => data.control === 'parent_address')[0].value,
3571
+ parent_phone_number: data.filter(data => data.control === 'parent_phone_number')[0].value,
3572
+ payment_date: data.filter(data => data.control === 'payment_date')[0].value,
3573
+ program_price: data.filter(data => data.control === 'program_price')[0].value,
3574
+ payment_method: data.filter(data => data.control === 'payment_method')[0].value,
3575
+ quota_times: data.filter(data => data.control === 'quota_times')[0].value,
3576
+ total_price: data.filter(data => data.control === 'total_price')[0].value,
3577
+ marketing_reasons: data.filter(data => data.control === 'marketing_reasons')[0].value,
3578
+ observation: data.filter(data => data.control === 'observation')[0].value,
3579
+ study_reasons: data.filter(data => data.control === 'study_reasons')[0].value,
3580
+ terms: data.filter(data => data.control === 'terms')[0].value,
3581
+ disability: data.filter(data => data.control === 'disability')[0].value,
3582
+ multiculturalism_1: data.filter(data => data.control === 'multiculturalism_1')[0].value,
3583
+ multiculturalism_2: data.filter(data => data.control === 'multiculturalism_2')[0].value,
3584
+ multiculturalism_3: data.filter(data => data.control === 'multiculturalism_3')[0].value,
3585
+ multiculturalism_4: data.filter(data => data.control === 'multiculturalism_4')[0].value,
3586
+ multiculturalism_5: data.filter(data => data.control === 'multiculturalism_5')[0].value,
3587
+ multiculturalism_6: data.filter(data => data.control === 'multiculturalism_6')[0].value,
3588
+ health_regimen: data.filter(data => data.control === 'health_regimen')[0].value,
3589
+ payment_dates: this.financingData
3590
+ };
3591
+ return request;
3592
+ }
3593
+ changeStep(step) {
3594
+ this.currentStep = step;
3595
+ }
3596
+ }
3597
+ CodFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormComponent, deps: [{ token: BaseService }, { token: LocalStorageCODService }, { token: CodFormControls }, { token: CommercialService }], target: i0.ɵɵFactoryTarget.Component });
3598
+ CodFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: CodFormComponent, selector: "ipt-cod-form", inputs: { dataFromPreviusCodData: "dataFromPreviusCodData", codCode: "codCode" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"allowedRole() ; else Unauthorized\" class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\r\n\r\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">{{ formTitle }}</span>\r\n\r\n <p-tabView [activeIndex]=\"currentStep\" (activeIndexChange)=\"currentStep = $event\" [scrollable]=\"true\">\r\n <p-tabPanel leftIcon=\"pi pi-star\" header=\"1. Planes y convenios\">\r\n <app-cod-form-step-one (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-one>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-id-card\" header=\"2. Datos del estudiante\">\r\n <app-cod-form-step-two [initialData]=\"dataFromPreviusCodData\" (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-two>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-user-edit\" header=\"3. Datos del acudiente\">\r\n <app-cod-form-step-three (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-three>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-money-bill\" header=\"4. Valores\">\r\n <app-cod-form-step-four (changeStepEvent)=\"changeStep($event)\" (financingData)=\"saveFinancingData($event)\" class=\"p-1\"></app-cod-form-step-four>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-eye\" header=\"5. Observaciones\">\r\n <app-cod-form-step-five [userRole]=\"userRole\" (changeStepEvent)=\"changeStep($event)\" (action)=\"getFormAction($event)\" class=\"p-1\"></app-cod-form-step-five>\r\n </p-tabPanel>\r\n </p-tabView>\r\n\r\n \r\n</div>\r\n\r\n<ng-template #Unauthorized>\r\n <span class=\"flex justify-content-center font-bold p-2 bg-yellow-200 border-round-lg w-full\">\r\n No tienes los permisos para acceder a esta funcionalidad, comun\u00EDcate con el desarrollador.\r\n </span>\r\n</ng-template>\r\n\r\n\r\n<ipt-loader *ngIf=\"isLoading\" [isDialog]=\"true\" [message]=\"loaderMessage\"></ipt-loader>", components: [{ type: i5$2.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i5$2.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: CodFormStepOneComponent, selector: "app-cod-form-step-one", outputs: ["changeStepEvent"] }, { type: CodFormStepTwoComponent, selector: "app-cod-form-step-two", inputs: ["initialData"], outputs: ["changeStepEvent"] }, { type: CodFormStepThreeComponent, selector: "app-cod-form-step-three", outputs: ["changeStepEvent"] }, { type: CodFormStepFourComponent, selector: "app-cod-form-step-four", outputs: ["changeStepEvent", "financingData"] }, { type: CodFormStepFiveComponent, selector: "app-cod-form-step-five", inputs: ["userRole"], outputs: ["changeStepEvent", "action"] }, { type: LoaderComponent, selector: "ipt-loader", inputs: ["message", "isDialog"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3599
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodFormComponent, decorators: [{
3600
+ type: Component,
3601
+ args: [{ selector: 'ipt-cod-form', template: "<div *ngIf=\"allowedRole() ; else Unauthorized\" class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\r\n\r\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">{{ formTitle }}</span>\r\n\r\n <p-tabView [activeIndex]=\"currentStep\" (activeIndexChange)=\"currentStep = $event\" [scrollable]=\"true\">\r\n <p-tabPanel leftIcon=\"pi pi-star\" header=\"1. Planes y convenios\">\r\n <app-cod-form-step-one (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-one>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-id-card\" header=\"2. Datos del estudiante\">\r\n <app-cod-form-step-two [initialData]=\"dataFromPreviusCodData\" (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-two>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-user-edit\" header=\"3. Datos del acudiente\">\r\n <app-cod-form-step-three (changeStepEvent)=\"changeStep($event)\" class=\"p-1\"></app-cod-form-step-three>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-money-bill\" header=\"4. Valores\">\r\n <app-cod-form-step-four (changeStepEvent)=\"changeStep($event)\" (financingData)=\"saveFinancingData($event)\" class=\"p-1\"></app-cod-form-step-four>\r\n </p-tabPanel>\r\n <p-tabPanel leftIcon=\"pi pi-eye\" header=\"5. Observaciones\">\r\n <app-cod-form-step-five [userRole]=\"userRole\" (changeStepEvent)=\"changeStep($event)\" (action)=\"getFormAction($event)\" class=\"p-1\"></app-cod-form-step-five>\r\n </p-tabPanel>\r\n </p-tabView>\r\n\r\n \r\n</div>\r\n\r\n<ng-template #Unauthorized>\r\n <span class=\"flex justify-content-center font-bold p-2 bg-yellow-200 border-round-lg w-full\">\r\n No tienes los permisos para acceder a esta funcionalidad, comun\u00EDcate con el desarrollador.\r\n </span>\r\n</ng-template>\r\n\r\n\r\n<ipt-loader *ngIf=\"isLoading\" [isDialog]=\"true\" [message]=\"loaderMessage\"></ipt-loader>", styles: [] }]
3602
+ }], ctorParameters: function () { return [{ type: BaseService }, { type: LocalStorageCODService }, { type: CodFormControls }, { type: CommercialService }]; }, propDecorators: { dataFromPreviusCodData: [{
3603
+ type: Input
3604
+ }], codCode: [{
3605
+ type: Input
3606
+ }] } });
3607
+
3608
+ class CodModule {
3609
+ }
3610
+ CodModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3611
+ CodModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, declarations: [CodFormComponent,
3612
+ CodDocumentsSectionComponent,
3613
+ CodFormStepOneComponent,
3614
+ CodFormStepTwoComponent,
3615
+ CodFormStepThreeComponent,
3616
+ CodFormStepFourComponent,
3617
+ CodFormStepFiveComponent], imports: [CommonModule,
3618
+ TabViewModule,
3619
+ ComponentsModule,
3620
+ MatCheckboxModule,
3621
+ ReactiveFormsModule,
3622
+ TableModule,
3623
+ ButtonModule], exports: [CodFormComponent,
3624
+ CodDocumentsSectionComponent,
3625
+ CodFormStepOneComponent,
3626
+ CodFormStepTwoComponent,
3627
+ CodFormStepThreeComponent,
3628
+ CodFormStepFourComponent,
3629
+ CodFormStepFiveComponent] });
3630
+ CodModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, providers: [
3631
+ MessageService
3632
+ ], imports: [[
3633
+ CommonModule,
3634
+ TabViewModule,
3635
+ ComponentsModule,
3636
+ MatCheckboxModule,
3637
+ ReactiveFormsModule,
3638
+ TableModule,
3639
+ ButtonModule
3640
+ ]] });
3641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CodModule, decorators: [{
3642
+ type: NgModule,
3643
+ args: [{
3644
+ imports: [
3645
+ CommonModule,
3646
+ TabViewModule,
3647
+ ComponentsModule,
3648
+ MatCheckboxModule,
3649
+ ReactiveFormsModule,
3650
+ TableModule,
3651
+ ButtonModule
3652
+ ],
3653
+ exports: [
3654
+ CodFormComponent,
3655
+ CodDocumentsSectionComponent,
3656
+ CodFormStepOneComponent,
3657
+ CodFormStepTwoComponent,
3658
+ CodFormStepThreeComponent,
3659
+ CodFormStepFourComponent,
3660
+ CodFormStepFiveComponent
3661
+ ],
3662
+ declarations: [
3663
+ CodFormComponent,
3664
+ CodDocumentsSectionComponent,
3665
+ CodFormStepOneComponent,
3666
+ CodFormStepTwoComponent,
3667
+ CodFormStepThreeComponent,
3668
+ CodFormStepFourComponent,
3669
+ CodFormStepFiveComponent
3670
+ ],
3671
+ providers: [
3672
+ MessageService
3673
+ ],
3674
+ }]
3675
+ }] });
3676
+
1898
3677
  class RedirectGuard {
1899
3678
  constructor(router) {
1900
3679
  this.router = router;
@@ -2271,51 +4050,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
2271
4050
  }]
2272
4051
  }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
2273
4052
 
2274
- class CommercialService extends IPTGeneralService {
2275
- constructor(http) {
2276
- super();
2277
- this.http = http;
2278
- this.SERVICE_URL = 'commercial/api/';
2279
- this.SERVICE_URL = this.baseUrl() + this.SERVICE_URL;
2280
- }
2281
- createCOD(request) {
2282
- let serviceUrl = this.SERVICE_URL + 'post/cod';
2283
- this.generateRequestParams(request);
2284
- return this.http.post(serviceUrl, this.httpOptions);
2285
- }
2286
- getStudentCodHistory(token, student_id_card) {
2287
- let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/student';
2288
- this.generateRequestParams({ token, student_id_card });
2289
- return this.http.post(serviceUrl, this.httpOptions);
2290
- }
2291
- getCodHistoryAll(userToken) {
2292
- let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/all';
2293
- this.generateRequestParams(userToken);
2294
- return this.http.post(serviceUrl, this.httpOptions);
2295
- }
2296
- getCodHistoryByCourse(request) {
2297
- let serviceUrl = this.SERVICE_URL + 'post/obtain/cod/history/by/course';
2298
- this.generateRequestParams(request);
2299
- return this.http.post(serviceUrl, this.httpOptions);
2300
- }
2301
- getDiscountCoupons(params) {
2302
- let serviceUrl = this.SERVICE_URL + 'post/discount/coupon/search';
2303
- this.generateRequestParams(params);
2304
- return this.http.post(serviceUrl, this.httpOptions);
2305
- }
2306
- getCodPricesByAgreement(code) {
2307
- let serviceUrl = this.SERVICE_URL + 'get/cod/prices/by/agreement/' + code;
2308
- this.generateRequestParams(code);
2309
- return this.http.get(serviceUrl, this.httpOptions);
2310
- }
2311
- }
2312
- CommercialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2313
- CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, providedIn: 'root' });
2314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CommercialService, decorators: [{
2315
- type: Injectable,
2316
- args: [{ providedIn: 'root' }]
2317
- }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
2318
-
2319
4053
  class AcademicService extends IPTGeneralService {
2320
4054
  constructor(http) {
2321
4055
  super();
@@ -2481,7 +4215,8 @@ CoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13
2481
4215
  AttendanceService,
2482
4216
  CalendarService,
2483
4217
  CertificateService,
2484
- UserEktService
4218
+ UserEktService,
4219
+ CopiesService
2485
4220
  ] });
2486
4221
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CoreModule, decorators: [{
2487
4222
  type: NgModule,
@@ -2504,7 +4239,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
2504
4239
  AttendanceService,
2505
4240
  CalendarService,
2506
4241
  CertificateService,
2507
- UserEktService
4242
+ UserEktService,
4243
+ CopiesService
2508
4244
  ]
2509
4245
  }]
2510
4246
  }] });
@@ -2516,14 +4252,16 @@ DesignSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", vers
2516
4252
  CoreModule,
2517
4253
  CurrencyMaskModule], exports: [ComponentsModule,
2518
4254
  CoreModule,
2519
- CurrencyMaskModule] });
4255
+ CurrencyMaskModule,
4256
+ CodModule] });
2520
4257
  DesignSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: DesignSystemModule, imports: [[
2521
4258
  ComponentsModule,
2522
4259
  CoreModule,
2523
4260
  CurrencyMaskModule
2524
4261
  ], ComponentsModule,
2525
4262
  CoreModule,
2526
- CurrencyMaskModule] });
4263
+ CurrencyMaskModule,
4264
+ CodModule] });
2527
4265
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: DesignSystemModule, decorators: [{
2528
4266
  type: NgModule,
2529
4267
  args: [{
@@ -2535,7 +4273,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
2535
4273
  exports: [
2536
4274
  ComponentsModule,
2537
4275
  CoreModule,
2538
- CurrencyMaskModule
4276
+ CurrencyMaskModule,
4277
+ CodModule
2539
4278
  ],
2540
4279
  }]
2541
4280
  }] });
@@ -2624,5 +4363,5 @@ class UserLoginRs {
2624
4363
  * Generated bundle index. Do not edit.
2625
4364
  */
2626
4365
 
2627
- export { AcademicService, ActivityService, AsideButtonComponent, AttendanceService, BaseService, BudgetService, ButtonComponent, CalendarService, CertificateService, CheckboxComponent, ClassroomService, CommercialService, ComponentsModule, CoreModule, CourseService, CreateUserFormComponent, DatalistComponent, DesignSystemModule, InputComponent, LevelButtonComponent, LevelTextComponent, LoaderComponent, LoginFormComponent, MarketingService, NotesService, ParameterService, RadioComponent, RedirectGuard, SelectComponent, Session, SidenavComponent, StorageService, StudentService, SwitchService, TestService, TextLinkComponent, UserEktService, UserLoginRs, UserRs, UserService, validateCoupunts };
4366
+ export { AcademicService, ActivityService, AsideButtonComponent, AttendanceService, BaseService, BudgetService, ButtonComponent, CalculateQuotesService, CalendarService, CertificateService, CheckboxComponent, ClassroomService, CodDocumentsSectionComponent, CodFormComponent, CodFormControls, CodFormStepFiveComponent, CodFormStepFourComponent, CodFormStepOneComponent, CodFormStepThreeComponent, CodFormStepTwoComponent, CodFormSteps, CodModule, CommercialService, CommunicatorService, ComponentsModule, CopiesService, CoreModule, CourseService, CreateUserFormComponent, DatalistComponent, DesignSystemModule, InputComponent, LevelButtonComponent, LevelTextComponent, LoaderComponent, LocalStorageCODService, LoginFormComponent, MarketingService, NotesService, ParameterService, RadioComponent, RedirectGuard, SelectComponent, Session, SidenavComponent, StorageService, StudentService, SwitchService, TestService, TextLinkComponent, UserEktService, UserLoginRs, UserRs, UserService, validateCoupunts };
2628
4367
  //# sourceMappingURL=iptdevs-design-system.mjs.map