form-aurora-stefanini 0.1.10 → 0.1.13

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 (53) hide show
  1. package/README.md +133 -133
  2. package/bundles/form-aurora-stefanini.umd.js +1078 -954
  3. package/bundles/form-aurora-stefanini.umd.js.map +1 -1
  4. package/bundles/form-aurora-stefanini.umd.min.js +2 -2
  5. package/bundles/form-aurora-stefanini.umd.min.js.map +1 -1
  6. package/esm2015/form-aurora-stefanini.js +4 -4
  7. package/esm2015/lib/Components/from-aurora/form-aurora.component.js +685 -685
  8. package/esm2015/lib/Models/company-parameters.js +7 -7
  9. package/esm2015/lib/Models/company.js +1 -1
  10. package/esm2015/lib/Models/fill.js +3 -3
  11. package/esm2015/lib/Models/state.js +1 -1
  12. package/esm2015/lib/Models/step.js +1 -1
  13. package/esm2015/lib/Models/stepMethod.js +3 -3
  14. package/esm2015/lib/form-aurora.module.js +22 -22
  15. package/esm2015/lib/services/TemplateService.js +85 -85
  16. package/esm2015/lib/services/data.service.js +90 -82
  17. package/esm2015/lib/utils/Offusqued.js +120 -0
  18. package/esm2015/lib/utils/regex.js +52 -52
  19. package/esm2015/public-api.js +10 -10
  20. package/esm5/form-aurora-stefanini.js +4 -4
  21. package/esm5/lib/Components/from-aurora/form-aurora.component.js +732 -732
  22. package/esm5/lib/Models/company-parameters.js +19 -19
  23. package/esm5/lib/Models/company.js +1 -1
  24. package/esm5/lib/Models/fill.js +7 -7
  25. package/esm5/lib/Models/state.js +1 -1
  26. package/esm5/lib/Models/step.js +1 -1
  27. package/esm5/lib/Models/stepMethod.js +7 -7
  28. package/esm5/lib/form-aurora.module.js +25 -25
  29. package/esm5/lib/services/TemplateService.js +97 -97
  30. package/esm5/lib/services/data.service.js +93 -85
  31. package/esm5/lib/utils/Offusqued.js +121 -0
  32. package/esm5/lib/utils/regex.js +52 -52
  33. package/esm5/public-api.js +10 -10
  34. package/fesm2015/form-aurora-stefanini.js +1013 -890
  35. package/fesm2015/form-aurora-stefanini.js.map +1 -1
  36. package/fesm5/form-aurora-stefanini.js +1082 -958
  37. package/fesm5/form-aurora-stefanini.js.map +1 -1
  38. package/form-aurora-stefanini.d.ts +4 -4
  39. package/form-aurora-stefanini.metadata.json +1 -1
  40. package/lib/Components/from-aurora/form-aurora.component.d.ts +108 -108
  41. package/lib/Models/company-parameters.d.ts +14 -14
  42. package/lib/Models/company.d.ts +22 -22
  43. package/lib/Models/fill.d.ts +6 -6
  44. package/lib/Models/state.d.ts +5 -5
  45. package/lib/Models/step.d.ts +14 -14
  46. package/lib/Models/stepMethod.d.ts +8 -8
  47. package/lib/form-aurora.module.d.ts +2 -2
  48. package/lib/services/TemplateService.d.ts +8 -8
  49. package/lib/services/data.service.d.ts +35 -35
  50. package/lib/utils/Offusqued.d.ts +7 -0
  51. package/lib/utils/regex.d.ts +51 -51
  52. package/package.json +1 -1
  53. package/public-api.d.ts +6 -6
@@ -7,978 +7,1102 @@ import * as moment_ from 'moment';
7
7
  import { CommonModule } from '@angular/common';
8
8
  import { RecaptchaModule, RecaptchaFormsModule } from 'ng-recaptcha';
9
9
 
10
- var regexType = {
11
- default: {
12
- exp: '^[a-zA-Z0-9ñÑáéíóúüÁÉÍÓÚÜ,.\\-_\\s]*$',
13
- message: 'Formato inválido, no use caracteres especiales'
14
- },
15
- word: {
16
- exp: '^[a-zA-Z0-9ñÑáéíóúüÁÉÍÓÚÜ,.\\-_]*$',
17
- message: 'Formato inválido, no use caracteres especiales ni espacios'
18
- },
19
- name: {
20
- exp: '^[a-zA-ZñÑáéíóúüÁÉÍÓÚÜ\\s]*$',
21
- message: 'Formato inválido, no use caracteres especiales ni números'
22
- },
23
- alphanumberWord: {
24
- exp: '^[a-zA-Z0-9]*$',
25
- message: 'Formato alfanúmerico inválido'
26
- },
27
- charWord: {
28
- exp: '^[a-zA-Z]*$',
29
- message: 'Formato de caracteres inválido'
30
- },
31
- anyWord: {
32
- exp: '^\\S*$',
33
- message: 'Formato inválido'
34
- },
35
- percent: {
36
- exp: '^100$|^[0-9]{1,2}$|^[0-9]{1,2}\\.[0-9]{1,2}$',
37
- message: 'Formato de porcentaje inválido, use el punto decimal (.)'
38
- },
39
- email: {
40
- exp: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
41
- message: 'Formato de e-mail inválido'
42
- },
43
- number: {
44
- exp: '^[0-9]*$',
45
- message: 'Formato de número inválido'
46
- },
47
- time24: {
48
- exp: '^([01]?[0-9]|2[0-3]):[0-5][0-9]$',
49
- message: 'Formato de hora militar inválido, use 23:45'
50
- },
51
- date: {
52
- exp: '^[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}$',
53
- message: 'Formato de fecha inválido',
54
- internal: 'dd/mm/yyyy'
55
- },
56
- password: {
57
- exp: '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$',
58
- message: 'La contraseña debe incluir una longitud mínima de 8 caracteres, una letra mayúscula, una letra minúscula, un número, un carácter especial (@#$%^&+=/.) y no debe tener espacios.'
59
- }
10
+ var regexType = {
11
+ default: {
12
+ exp: '^[a-zA-Z0-9ñÑáéíóúüÁÉÍÓÚÜ,.\\-_\\s]*$',
13
+ message: 'Formato inválido, no use caracteres especiales'
14
+ },
15
+ word: {
16
+ exp: '^[a-zA-Z0-9ñÑáéíóúüÁÉÍÓÚÜ,.\\-_]*$',
17
+ message: 'Formato inválido, no use caracteres especiales ni espacios'
18
+ },
19
+ name: {
20
+ exp: '^[a-zA-ZñÑáéíóúüÁÉÍÓÚÜ\\s]*$',
21
+ message: 'Formato inválido, no use caracteres especiales ni números'
22
+ },
23
+ alphanumberWord: {
24
+ exp: '^[a-zA-Z0-9]*$',
25
+ message: 'Formato alfanúmerico inválido'
26
+ },
27
+ charWord: {
28
+ exp: '^[a-zA-Z]*$',
29
+ message: 'Formato de caracteres inválido'
30
+ },
31
+ anyWord: {
32
+ exp: '^\\S*$',
33
+ message: 'Formato inválido'
34
+ },
35
+ percent: {
36
+ exp: '^100$|^[0-9]{1,2}$|^[0-9]{1,2}\\.[0-9]{1,2}$',
37
+ message: 'Formato de porcentaje inválido, use el punto decimal (.)'
38
+ },
39
+ email: {
40
+ exp: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
41
+ message: 'Formato de e-mail inválido'
42
+ },
43
+ number: {
44
+ exp: '^[0-9]*$',
45
+ message: 'Formato de número inválido'
46
+ },
47
+ time24: {
48
+ exp: '^([01]?[0-9]|2[0-3]):[0-5][0-9]$',
49
+ message: 'Formato de hora militar inválido, use 23:45'
50
+ },
51
+ date: {
52
+ exp: '^[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}$',
53
+ message: 'Formato de fecha inválido',
54
+ internal: 'dd/mm/yyyy'
55
+ },
56
+ password: {
57
+ exp: '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$',
58
+ message: 'La contraseña debe incluir una longitud mínima de 8 caracteres, una letra mayúscula, una letra minúscula, un número, un carácter especial (@#$%^&+=/.) y no debe tener espacios.'
59
+ }
60
60
  };
61
61
 
62
- var CommonDataService = /** @class */ (function () {
63
- function CommonDataService() {
64
- }
65
- CommonDataService_1 = CommonDataService;
66
- CommonDataService.prototype.getData = function () {
67
- if (localStorage.getItem("data") != null) {
68
- var data = new Map(JSON.parse(localStorage.getItem("data")));
69
- return data;
70
- }
71
- else {
72
- /** Error get cookie */
73
- }
74
- };
75
- CommonDataService.prototype.setData = function (data) {
76
- localStorage.setItem("data", JSON.stringify(Array.from(data.entries())));
77
- };
78
- CommonDataService.prototype.initData = function () {
79
- this.setData(new Map());
80
- };
81
- CommonDataService.prototype.putValue = function (key, value) {
82
- var data = this.getData();
83
- data = data.set(key, value);
84
- this.setData(data);
85
- };
86
- CommonDataService.prototype.addValue = function (keyPrimary, keySecond, value) {
87
- var data = this.getValue(keyPrimary);
88
- var dataReturn = this.getData();
89
- data[keySecond] = value;
90
- dataReturn = dataReturn.set(keyPrimary, data);
91
- this.setData(dataReturn);
92
- };
93
- CommonDataService.prototype.getValue = function (key) {
94
- return !this.getData() || !this.getData().has(key) ? undefined : this.getData().get(key);
95
- };
96
- CommonDataService.prototype.hasValue = function (key) {
97
- return this.getData() != undefined ? this.getData().has(key) : null;
98
- };
99
- CommonDataService.prototype.clearMap = function () {
100
- if (this.hasValue(CommonDataService_1.COMPANY_KEY)) {
101
- var company = this.getValue(CommonDataService_1.COMPANY_KEY);
102
- this.initData();
103
- this.putValue(CommonDataService_1.COMPANY_KEY, company);
104
- }
105
- else {
106
- this.initData();
107
- }
108
- };
109
- var CommonDataService_1;
110
- CommonDataService.COMPANY_KEY = "company";
111
- CommonDataService.DOC_NUMBER_KEY = "docNumber";
112
- CommonDataService.DOC_TYPE_KEY = "docType";
113
- CommonDataService.PHONE_KEY = "phone";
114
- CommonDataService.TYPE_ATTENTION_KEY = "typeAttention";
115
- CommonDataService.OFFICE_KEY = "office";
116
- CommonDataService.TYPE_TURN_KEY = "typeTurn";
117
- CommonDataService.SERVICE_KEY = "service";
118
- CommonDataService.TURN_KEY = "turn";
119
- CommonDataService.PROGRAMED_TURN_KEY = "programedTurn";
120
- CommonDataService.REQUEST_CALL = "requestCall";
121
- CommonDataService.FORM_DATA = "formdata";
122
- CommonDataService.TEMPLATE = "template";
123
- CommonDataService.TURN_RESCHEDULE = "turnReschedule";
124
- CommonDataService.USER_GENDER = "genderUser";
125
- CommonDataService.AUTO_REDIRECT = "autoRedirect";
126
- CommonDataService.SCHEDULE_GENERAL = "scheduleGeneral";
127
- CommonDataService.AGENDAMIENTO_TTP = "potencialCustomer";
128
- CommonDataService.SINGLE_PAGE_ONE = "singlePageOne";
129
- CommonDataService.AVAILABLE_SCHEDULE_GRAL = "availableScheduleGral";
130
- CommonDataService.PROFILE = "profile";
131
- CommonDataService.PAGE_NEXT = "pageNext";
132
- CommonDataService.STEPS = "steps";
133
- CommonDataService.TYPE_TURN_ID = "typeTurnId";
134
- CommonDataService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonDataService_Factory() { return new CommonDataService(); }, token: CommonDataService, providedIn: "root" });
135
- CommonDataService = CommonDataService_1 = __decorate([
136
- Injectable({
137
- providedIn: "root",
138
- })
139
- ], CommonDataService);
140
- return CommonDataService;
62
+ var Offusqued = /** @class */ (function () {
63
+ function Offusqued() {
64
+ this.dataMap = new Map();
65
+ this.dataMap.set('A', '2,');
66
+ this.dataMap.set('J', '29,');
67
+ this.dataMap.set('S', '67,');
68
+ this.dataMap.set('B', '3,');
69
+ this.dataMap.set('K', '31,');
70
+ this.dataMap.set('T', '71,');
71
+ this.dataMap.set('C', '5,');
72
+ this.dataMap.set('L', '37,');
73
+ this.dataMap.set('U', '73,');
74
+ this.dataMap.set('D', '7,');
75
+ this.dataMap.set('M', '41,');
76
+ this.dataMap.set('V', '79,');
77
+ this.dataMap.set('E', '11,');
78
+ this.dataMap.set('N', '43,');
79
+ this.dataMap.set('W', '83,');
80
+ this.dataMap.set('F', '13,');
81
+ this.dataMap.set('O', '47,');
82
+ this.dataMap.set('X', '89,');
83
+ this.dataMap.set('G', '17,');
84
+ this.dataMap.set('P', '53,');
85
+ this.dataMap.set('Y', '97,');
86
+ this.dataMap.set('H', '19,');
87
+ this.dataMap.set('Q', '59,');
88
+ this.dataMap.set('Z', '101,');
89
+ this.dataMap.set('I', '23,');
90
+ this.dataMap.set('R', '61,');
91
+ this.dataMap.set('a', '103,');
92
+ this.dataMap.set('j', '151,');
93
+ this.dataMap.set('s', '157,');
94
+ this.dataMap.set('b', '107,');
95
+ this.dataMap.set('k', '163,');
96
+ this.dataMap.set('t', '167,');
97
+ this.dataMap.set('c', '109,');
98
+ this.dataMap.set('l', '173,');
99
+ this.dataMap.set('u', '179,');
100
+ this.dataMap.set('d', '113,');
101
+ this.dataMap.set('m', '181,');
102
+ this.dataMap.set('v', '191,');
103
+ this.dataMap.set('e', '127,');
104
+ this.dataMap.set('n', '193,');
105
+ this.dataMap.set('w', '227,');
106
+ this.dataMap.set('f', '132,');
107
+ this.dataMap.set('o', '197,');
108
+ this.dataMap.set('x', '229,');
109
+ this.dataMap.set('g', '137,');
110
+ this.dataMap.set('p', '199,');
111
+ this.dataMap.set('y', '233,');
112
+ this.dataMap.set('h', '139,');
113
+ this.dataMap.set('q', '211,');
114
+ this.dataMap.set('z', '239,');
115
+ this.dataMap.set('i', '149,');
116
+ this.dataMap.set('r', '223,');
117
+ this.dataMap.set('0', 'Z,');
118
+ this.dataMap.set('1', 'Y,');
119
+ this.dataMap.set('2', 'X,');
120
+ this.dataMap.set('3', 'W,');
121
+ this.dataMap.set('4', 'V,');
122
+ this.dataMap.set('5', 'U,');
123
+ this.dataMap.set('6', 'T,');
124
+ this.dataMap.set('7', 'S,');
125
+ this.dataMap.set('8', 'R,');
126
+ this.dataMap.set('9', 'Q,');
127
+ this.dataMap.set(',', '&');
128
+ this.dataMap.set('{', '1000,');
129
+ this.dataMap.set('}', '0000,');
130
+ }
131
+ Offusqued.prototype.ofusquedData = function (data) {
132
+ var responce = '';
133
+ var ofusquedData = data.toString().split('');
134
+ // tslint:disable-next-line:prefer-for-of
135
+ for (var i = 0; i < ofusquedData.length; i++) {
136
+ var letter = ofusquedData[i].toString();
137
+ if (this.dataMap.has(letter)) {
138
+ responce += this.dataMap.get(letter).toString();
139
+ }
140
+ else {
141
+ responce += letter + ',';
142
+ }
143
+ }
144
+ return responce;
145
+ };
146
+ Offusqued.prototype.decodeOfusquedData = function (data) {
147
+ var respoce = '';
148
+ var arrayData = data.split(',');
149
+ // tslint:disable-next-line:prefer-for-of
150
+ for (var i = 0; i < arrayData.length; i++) {
151
+ respoce += this.readValueInMap(arrayData[i]);
152
+ }
153
+ // @ts-ignore
154
+ return respoce.replaceAll('&', ',');
155
+ };
156
+ Offusqued.prototype.readValueInMap = function (data) {
157
+ var respoce = '';
158
+ var status = true;
159
+ this.dataMap.forEach(function (value, key) {
160
+ if (data + ',' === value) {
161
+ respoce = key;
162
+ status = false;
163
+ }
164
+ });
165
+ if (status) {
166
+ respoce = data;
167
+ }
168
+ return respoce;
169
+ };
170
+ Offusqued.ngInjectableDef = ɵɵdefineInjectable({ factory: function Offusqued_Factory() { return new Offusqued(); }, token: Offusqued, providedIn: "root" });
171
+ Offusqued = __decorate([
172
+ Injectable({
173
+ providedIn: 'root',
174
+ })
175
+ ], Offusqued);
176
+ return Offusqued;
141
177
  }());
142
178
 
143
- var moment = moment_;
144
- /**
145
- * This Service handles how the date is represented in scripts i.e. ngModel.
146
- */
147
- var CustomAdapter = /** @class */ (function (_super) {
148
- __extends(CustomAdapter, _super);
149
- function CustomAdapter() {
150
- var _this = _super !== null && _super.apply(this, arguments) || this;
151
- _this.DELIMITER = '/';
152
- return _this;
153
- }
154
- CustomAdapter.prototype.fromModel = function (value) {
155
- if (value) {
156
- var date = value.split(this.DELIMITER);
157
- return {
158
- day: parseInt(date[0], 10),
159
- month: parseInt(date[1], 10),
160
- year: parseInt(date[2], 10)
161
- };
162
- }
163
- return null;
164
- };
165
- CustomAdapter.prototype.toModel = function (date) {
166
- return date ? (date.day < 10 ? 0 + date.day : date.day) + this.DELIMITER + (date.month < 10 ? 0 + date.month : date.month) + this.DELIMITER + date.year : '';
167
- };
168
- CustomAdapter = __decorate([
169
- Injectable()
170
- ], CustomAdapter);
171
- return CustomAdapter;
172
- }(NgbDateAdapter));
173
- /**
174
- * This Service handles how the date is rendered and parsed from keyboard i.e. in the bound input field.
175
- */
176
- var CustomDateParserFormatter = /** @class */ (function (_super) {
177
- __extends(CustomDateParserFormatter, _super);
178
- function CustomDateParserFormatter() {
179
- var _this = _super !== null && _super.apply(this, arguments) || this;
180
- _this.DELIMITER = '/';
181
- return _this;
182
- }
183
- CustomDateParserFormatter.prototype.parse = function (value) {
184
- if (value) {
185
- var date = value.split(this.DELIMITER);
186
- return {
187
- day: parseInt(date[0], 10),
188
- month: parseInt(date[1], 10),
189
- year: parseInt(date[2], 10)
190
- };
191
- }
192
- return null;
193
- };
194
- CustomDateParserFormatter.prototype.format = function (date) {
195
- return date ? (date.day < 10 ? '0' + date.day : date.day) + this.DELIMITER + (date.month < 10 ? '0' + date.month : date.month) + this.DELIMITER + date.year : '';
196
- };
197
- CustomDateParserFormatter = __decorate([
198
- Injectable()
199
- ], CustomDateParserFormatter);
200
- return CustomDateParserFormatter;
201
- }(NgbDateParserFormatter));
202
- var I18N_VALUES = {
203
- 'es': {
204
- weekdays: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
205
- months: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
206
- weekLabel: 'sem'
207
- }
208
- // other languages you would support
209
- };
210
- var I18n = /** @class */ (function () {
211
- function I18n() {
212
- this.language = 'es';
213
- }
214
- I18n = __decorate([
215
- Injectable()
216
- ], I18n);
217
- return I18n;
218
- }());
219
- // Define custom service providing the months and weekdays translations
220
- var CustomDatepickerI18n = /** @class */ (function (_super) {
221
- __extends(CustomDatepickerI18n, _super);
222
- function CustomDatepickerI18n(_i18n) {
223
- var _this = _super.call(this) || this;
224
- _this._i18n = _i18n;
225
- return _this;
226
- }
227
- CustomDatepickerI18n.prototype.getWeekdayLabel = function (weekday) {
228
- return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
229
- };
230
- CustomDatepickerI18n.prototype.getWeekLabel = function () {
231
- return I18N_VALUES[this._i18n.language].weekLabel;
232
- };
233
- CustomDatepickerI18n.prototype.getMonthShortName = function (month) {
234
- return I18N_VALUES[this._i18n.language].months[month - 1];
235
- };
236
- CustomDatepickerI18n.prototype.getMonthFullName = function (month) {
237
- return this.getMonthShortName(month);
238
- };
239
- CustomDatepickerI18n.prototype.getDayAriaLabel = function (date) {
240
- return date.day + "-" + date.month + "-" + date.year;
241
- };
242
- CustomDatepickerI18n.prototype.getWeekdayShortName = function (weekday) {
243
- return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
244
- };
245
- ;
246
- CustomDatepickerI18n.ctorParameters = function () { return [
247
- { type: I18n }
248
- ]; };
249
- CustomDatepickerI18n = __decorate([
250
- Injectable()
251
- ], CustomDatepickerI18n);
252
- return CustomDatepickerI18n;
253
- }(NgbDatepickerI18n));
254
- var FormAuroraComponent = /** @class */ (function () {
255
- function FormAuroraComponent(data, http) {
256
- this.data = data;
257
- this.http = http;
258
- this.response = new EventEmitter();
259
- this.summit = new EventEmitter();
260
- this.viewAuthData = new EventEmitter();
261
- this.tipodocNumDoc = false;
262
- this.countSubmit = 0;
263
- this.watchValid = false;
264
- this.watchRequired = false;
265
- this.captchaValid = false;
266
- this.today = moment(new Date());
267
- this.maxYear = this.today.year();
268
- this.minYear = this.today.year() - 82;
269
- this.minDate = this.minYear.toString() + '-' + this.today.month().toString().padStart(2, '0') + '-' + this.today.date().toString().padStart(2, '0'); // {year: this.minYear, month: this.today.month(), day: this.today.date()};
270
- this.maxDate = this.maxYear.toString() + '-' + (this.today.month() + 1).toString().padStart(2, '0') + '-' + this.today.date().toString().padStart(2, '0'); // {year: this.maxYear, month: this.today.month() + 1, day: this.today.date()};
271
- this.recharge = false;
272
- this.indicativo = "57";
273
- this.defaultDocType = "Cédula de ciudadanía";
274
- this.patternNotValidDcto = false;
275
- this.patternNotValidCel = false;
276
- this.range = new FormGroup({
277
- start: new FormControl(),
278
- end: new FormControl(),
279
- });
280
- }
281
- FormAuroraComponent.prototype.ngOnInit = function () {
282
- var _this = this;
283
- this.minDate = new Date(this.minDate).toISOString().split('T')[0];
284
- setTimeout(function () {
285
- _this.startComponent();
286
- }, 2000);
287
- };
288
- FormAuroraComponent.prototype.startComponent = function () {
289
- var e_1, _a;
290
- var _this = this;
291
- //ordena los campos
292
- if (this.dataForm != null && this.dataForm.formQuestions != undefined) {
293
- //Same row fields
294
- this.tipodocNumDoc = (this.dataForm.formQuestions.some(function (question) { return question.question.value === "tipoDoc"; }) && this.dataForm.formQuestions.some(function (question) { return question.question.value === "numeroDoc"; })) ? true : false;
295
- this.dataForm.formQuestions = this.dataForm.formQuestions.sort(function (a, b) {
296
- return a.order - b.order;
297
- });
298
- var existcaptcha = this.dataForm.formQuestions.filter(function (item) { return item.question.questionType.id == 6; });
299
- if (existcaptcha.length == 0) {
300
- this.captchaValid = true;
301
- }
302
- var _loop_1 = function (item) {
303
- if (item.question.maxlength == null || item.question.maxlength == undefined || item.question.maxlength == 0) {
304
- item.question.maxlength = 524288; //defaultvalue
305
- }
306
- if (item.question.minLength == null || item.question.minLength == undefined) {
307
- item.question.minLength = 0;
308
- }
309
- this_1.dataReloadForm.forEach(function (element) {
310
- _this.filldata = element;
311
- if ((item.question.questionType.id === 2 || item.question.questionType.id === 1 ||
312
- item.question.questionType.id === 3) && (_this.filldata.data !== null &&
313
- _this.filldata.data !== undefined) && item.question.id === _this.filldata.id) {
314
- item.question.registred = _this.filldata.data;
315
- }
316
- });
317
- if (item.question.registred == null || item.question.minLength == undefined) {
318
- item.question.registred = '';
319
- }
320
- };
321
- var this_1 = this;
322
- try {
323
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
324
- var item = _c.value;
325
- _loop_1(item);
326
- }
327
- }
328
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
329
- finally {
330
- try {
331
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
332
- }
333
- finally { if (e_1) throw e_1.error; }
334
- }
335
- }
336
- };
337
- FormAuroraComponent.prototype.resolvedCaptcha = function (captchaResponse) {
338
- this.captchaValid = true;
339
- if (!this.formDynamic.form.value.captcha) {
340
- this.formDynamic.controls.captcha.setValue(captchaResponse);
341
- this.formDynamic.form.value.captcha = captchaResponse;
342
- document.getElementById("btnIng").style.opacity = !this.formDynamic.valid ? "0.65" : "1";
343
- }
344
- };
345
- //Forms
346
- //Metodo para evitar el render de los items del for
347
- FormAuroraComponent.prototype.trackByIndex = function (index, obj) {
348
- return index;
349
- };
350
- FormAuroraComponent.prototype.onChangeValidPatter = function (event, question) {
351
- var _this = this;
352
- if (question.pattern != undefined) {
353
- var valid = true;
354
- var keyvalid = [8, 32, 37, 38, 39, 40, 46, 9];
355
- //diferente de Backpsace
356
- //se deja catch por error no controlable en otro tiempo de ejecucion
357
- try {
358
- if (!keyvalid.includes(event.keyCode)) {
359
- var regex = new RegExp(question.pattern);
360
- valid = regex.test(event.key);
361
- }
362
- }
363
- catch (error) { }
364
- return valid;
365
- }
366
- if (question.questionType !== undefined) {
367
- if (question.questionType.description === 'Number') {
368
- if (question.value === 'numeroDoc') {
369
- this.validateNumeroDocumento(this.formDynamic.controls["numeroDoc"].value.toString());
370
- }
371
- else if (question.value === 'celular') {
372
- this.validateCelular(this.formDynamic.controls["celular"].value.toString());
373
- }
374
- }
375
- }
376
- document.getElementById("char" + question.value).setAttribute("hidden", "true");
377
- //if temporal mientras se migran todos los tipos de campos al foreach
378
- if (question.questionType.id != 11 && question.questionType.id != 7) {
379
- if (this.validMinLength(this.formDynamic, question)) {
380
- document.getElementById(question.value).style.borderColor = "#FF0000";
381
- document.getElementById("ml" + question.value).removeAttribute("hidden");
382
- }
383
- else {
384
- document.getElementById(question.value).style.borderColor = "#E4E4E4";
385
- document.getElementById("ml" + question.value).setAttribute("hidden", "true");
386
- }
387
- if (this.validMaxLength(this.formDynamic, question)) {
388
- document.getElementById(question.value).style.borderColor = "#FF0000";
389
- document.getElementById("mxl" + question.value).removeAttribute("hidden");
390
- }
391
- else {
392
- document.getElementById(question.value).style.borderColor = "#E4E4E4";
393
- document.getElementById("mxl" + question.value).setAttribute("hidden", "true");
394
- }
395
- }
396
- this.dataForm.formQuestions.forEach(function (formQuestion) {
397
- switch (formQuestion.question.questionType.id) {
398
- //se valida campo de tipo calendario
399
- case 7:
400
- if (question.questionType.id == 7)
401
- _this.calendarRulesValidate(formQuestion);
402
- break;
403
- //se valida campo de tipo email
404
- case 11:
405
- if (question.questionType.id == 11)
406
- _this.emailRulesValidate(formQuestion);
407
- break;
408
- }
409
- });
410
- document.getElementById("btnIng").style.opacity = !this.formDynamic.valid ? "0.65" : "1";
411
- };
412
- FormAuroraComponent.prototype.validOnlyText = function (event) {
413
- var regex = /^[a-zA-Z\u00C0-\u017F]+$/g;
414
- if (event.charCode == 32) {
415
- return true;
416
- }
417
- var valid = regex.test(event.key);
418
- return valid;
419
- };
420
- FormAuroraComponent.prototype.validDate = function (event) {
421
- /*let pattern = /(?:0[1-9]|[12][0-9]|3[01])\/(?:0[1-9]|1[0-2])\/(?:19|20)[0-9]{2}/;
422
- const regex = new RegExp(pattern);
423
- valid = regex.test(event.key);
424
- */
425
- var matches = String(event.key).match(regexType.date.exp);
426
- var valid = true;
427
- if (matches === null)
428
- valid = false;
429
- // alert(valid);
430
- return valid;
431
- };
432
- FormAuroraComponent.prototype.onChangeValidDate = function (event) {
433
- //let pattern = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12][0-9]|3[01])\/(?:19|20)[0-9]{2}/;
434
- var dateN = /[0-9]|\//;
435
- var valid = true;
436
- var regex = new RegExp(dateN);
437
- valid = regex.test(event.key);
438
- return valid;
439
- };
440
- FormAuroraComponent.prototype.rediretoutside = function (event, question) {
441
- //se deja catch por error no controlable en otro tiempo de ejecucion
442
- try {
443
- event.preventDefault();
444
- window.open(question.value, "_blank");
445
- }
446
- catch (error) { }
447
- };
448
- /**
449
- * Dispatch submit event for validations exists
450
- * @param change
451
- */
452
- FormAuroraComponent.prototype.ngOnChanges = function (change) {
453
- this.countSubmit++;
454
- };
455
- //onSubmit(form: NgForm) {
456
- FormAuroraComponent.prototype.onSubmit = function () {
457
- var _this = this;
458
- var form = this.formDynamic;
459
- this.watchValid = true;
460
- this.watchRequired = true;
461
- if (form.valid) {
462
- if (!this.validRulesFields(form.controls["numeroDoc"].value.toString(), form.controls["celular"].value.toString(), form.controls["email"].value))
463
- return false;
464
- }
465
- if (this.validMinlenghtAllQuestions(form.value) && this.validMaxLengthAllQuestions(form.value) && form.valid) {
466
- if (this.dataForm.urlSend != "" && this.captchaValid) {
467
- this.http.post(this.dataForm.urlSend, form.value).subscribe(function (resp) { return _this.response.emit(resp); });
468
- }
469
- else if (form.valid && this.captchaValid) {
470
- this.summit.emit(form.value);
471
- }
472
- }
473
- };
474
- FormAuroraComponent.prototype.findParamBoolean = function (params, idParam) {
475
- var showDescriptionParam = params.find(function (x) { return x.id == idParam; });
476
- return showDescriptionParam != null && showDescriptionParam.value == "true";
477
- };
478
- FormAuroraComponent.prototype.validRulesFields = function (numeroDoc, numeroCel, email) {
479
- var _this = this;
480
- // Validaciones para celular en caso de indicativo en Colombia
481
- var cel = document.getElementById("charcelular");
482
- var doc = document.getElementById("charnumeroDoc");
483
- var valOk = true;
484
- if (this.indicativo == "+57" || this.indicativo == "57") {
485
- var stringOrdenado = this.orderString(numeroDoc);
486
- if (this.nameCompany.toUpperCase() !== 'CLARO') { //claro acepta nro consecutivos
487
- if (numeroDoc == stringOrdenado) {
488
- doc.style.borderColor = "#FF0000";
489
- doc.removeAttribute("hidden");
490
- doc.textContent = "El numero documento No debe contener caracteres consecutivos";
491
- valOk = false;
492
- //this.msgErrorCampo = "El numero documento No debe contener caracteres consecutivos";
493
- //return false;
494
- }
495
- }
496
- if (numeroCel.substring(0, 1) != "3") {
497
- cel.style.borderColor = "#FF0000";
498
- cel.removeAttribute("hidden");
499
- cel.textContent = "El primer carácter del celular debe ser 3";
500
- valOk = false;
501
- //this.msgErrorCampo = "El primer carácter del celular debe ser 3";
502
- //return false;
503
- }
504
- /*
505
- if (parseInt(numeroCel.substring(0, 3)) > 350) {
506
- cel.style.borderColor = "#FF0000";
507
- cel.removeAttribute("hidden");
508
- cel.textContent = "El prefijo del celular no debe ser mayor a 350";
509
- valOk = false;
510
- //this.msgErrorCampo = "El prefijo del celular no debe ser mayor a 350";
511
- //return false;
512
- }
513
- */
514
- //En caso de que el número se repita, ejemplo 33333333
515
- var listnumber = numeroDoc.substring(0, 1);
516
- for (var index = 1; index < numeroDoc.length; index++) {
517
- listnumber = listnumber + numeroDoc.substring(0, 1);
518
- }
519
- if (numeroDoc == listnumber) {
520
- doc.style.borderColor = "#FF0000";
521
- doc.removeAttribute("hidden");
522
- doc.textContent = "Caracteres numéricos no se pueden repetirse de manera continua ";
523
- valOk = false;
524
- //this.msgErrorCampo = "Caracteres numéricos no se pueden repetirse de manera continua ";
525
- //return false;
526
- }
527
- if (!this.validateNumeroDocumento(numeroDoc)) {
528
- return false;
529
- }
530
- if (!this.validateCelular(numeroCel)) {
531
- return false;
532
- }
533
- // En caso de que el número se repita, ejemplo 33333333
534
- var arrayPhoneRepeat = Array.from(String(numeroCel), Number);
535
- var arrayPhoneOutRepeat = __spread(new Set(arrayPhoneRepeat));
536
- if (arrayPhoneOutRepeat.length == 1) {
537
- cel.style.borderColor = "#FF0000";
538
- cel.removeAttribute("hidden");
539
- cel.textContent = "El número que ingresa no es valido";
540
- valOk = false;
541
- //this.msgErrorCampo = "El número que ingresa no es valido";
542
- //return false;
543
- }
544
- }
545
- else if (this.indicativo == "+593" || this.indicativo == "593") {
546
- if (numeroCel.substring(0, 1) != "9") {
547
- cel.style.borderColor = "#FF0000";
548
- cel.removeAttribute("hidden");
549
- cel.textContent = "El primer carácter del celular debe ser 9";
550
- valOk = false;
551
- //this.msgErrorCampo = "El primer carácter del celular debe ser 9";
552
- //return false;
553
- }
554
- }
555
- //se validan los campos por tipo de campo y no por value
556
- this.dataForm.formQuestions.forEach(function (formQuestion) {
557
- switch (formQuestion.question.questionType.id) {
558
- //se valida campo de tipo email
559
- case 11:
560
- valOk = _this.emailRulesValidate(formQuestion);
561
- break;
562
- }
563
- });
564
- return valOk;
565
- };
566
- FormAuroraComponent.prototype.orderString = function (value) {
567
- var arrayNumber = [];
568
- for (var index = 0; index < value.length; index++) {
569
- arrayNumber.push(parseInt(value.substring(index, index + 1)));
570
- }
571
- //ordena el array
572
- arrayNumber.sort(function (a, b) {
573
- return a - b;
574
- });
575
- var numberOrder = "";
576
- numberOrder = arrayNumber[0];
577
- for (var index = 1; index < arrayNumber.length; index++) {
578
- numberOrder = numberOrder + (arrayNumber[0] + index).toString();
579
- }
580
- return numberOrder;
581
- };
582
- FormAuroraComponent.prototype.validMinlenghtAllQuestions = function (form) {
583
- var e_2, _a;
584
- try {
585
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
586
- var item = _c.value;
587
- if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
588
- var minLength = parseInt(item.question.minLength);
589
- var formValueLength = parseInt(form[item.question.value].toString().length);
590
- if (minLength > 0 && formValueLength != minLength && formValueLength < minLength)
591
- return false;
592
- }
593
- }
594
- }
595
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
596
- finally {
597
- try {
598
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
599
- }
600
- finally { if (e_2) throw e_2.error; }
601
- }
602
- return true;
603
- };
604
- FormAuroraComponent.prototype.validMaxLengthAllQuestions = function (form) {
605
- var e_3, _a;
606
- try {
607
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
608
- var item = _c.value;
609
- if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
610
- var maxLength = parseInt(item.question.maxLength);
611
- var formValueLength = parseInt(form[item.question.value].toString().length);
612
- if (maxLength > 0 && formValueLength != maxLength && formValueLength > maxLength)
613
- return false;
614
- }
615
- }
616
- }
617
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
618
- finally {
619
- try {
620
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
621
- }
622
- finally { if (e_3) throw e_3.error; }
623
- }
624
- return true;
625
- };
626
- FormAuroraComponent.prototype.validRequired = function (form, question) {
627
- //se deja catch por error no controlable en otro tiempo de ejecucion
628
- try {
629
- if (question != undefined && question.value != undefined) {
630
- if (form.controls[question.value] != undefined &&
631
- form.controls[question.value].errors != null &&
632
- form.controls[question.value].errors.required) {
633
- return true;
634
- }
635
- }
636
- }
637
- catch (error) { }
638
- return false;
639
- };
640
- FormAuroraComponent.prototype.validMinLength = function (form, question) {
641
- //se deja catch por error no controlable en otro tiempo de ejecucion
642
- try {
643
- if (question != undefined && question.value != undefined) {
644
- if (question.minLength > form.controls[question.value].value.toLocaleString().length && question.minLength > 0) {
645
- return true;
646
- }
647
- }
648
- }
649
- catch (error) { }
650
- return false;
651
- };
652
- FormAuroraComponent.prototype.validMaxLength = function (form, question) {
653
- //se deja catch por error no controlable en otro tiempo de ejecucion
654
- try {
655
- if (question != undefined && question.value != undefined) {
656
- if (question.maxLength > 0) {
657
- if (question.maxLength + 1 <= form.controls[question.value].value.toString().replace(/\./g, '').length) {
658
- if (!this.formDynamic.controls[question.value].hasError('errorMaxLength')) {
659
- this.formDynamic.controls[question.value].setErrors({ 'errorMaxLength': true });
660
- }
661
- return true;
662
- }
663
- }
664
- }
665
- }
666
- catch (error) { }
667
- return false;
668
- };
669
- FormAuroraComponent.prototype.tycSelection = function (event) {
670
- this.viewAuthData.emit(event);
671
- };
672
- FormAuroraComponent.prototype.openLabelUrl = function (event, question) {
673
- event.preventDefault();
674
- var tyc = document.getElementById("check" + question.id);
675
- tyc.style.color = "#A3AD32";
676
- window.open(question.urllabel, "_blank");
677
- };
678
- FormAuroraComponent.prototype.cancellKeypress = function () {
679
- return false;
680
- };
681
- FormAuroraComponent.prototype.emailRulesValidate = function (formQuestion) {
682
- var valOk = true;
683
- try {
684
- var hasError = false;
685
- document.getElementById(formQuestion.question.id).setAttribute("hidden", "true");
686
- var eml = document.getElementById(formQuestion.question.id);
687
- var email = formQuestion.question.registred;
688
- if (!hasError) {
689
- if (formQuestion.question.required && (email == "" || email == undefined || email == null)) {
690
- eml.style.borderColor = "#FF0000";
691
- eml.textContent = "El correco eléctronico es requerido";
692
- eml.removeAttribute("hidden");
693
- valOk = false;
694
- hasError = true;
695
- }
696
- }
697
- if (!hasError) {
698
- if (this.validMinLength(undefined, formQuestion.question)) {
699
- eml.style.borderColor = "#FF0000";
700
- eml.textContent = "Debe ser mínimo de " + formQuestion.question.minLength + " caracteres";
701
- document.getElementById(formQuestion.question.id).removeAttribute("hidden");
702
- valOk = false;
703
- hasError = true;
704
- }
705
- }
706
- if (!hasError) {
707
- if (this.validMaxLength(undefined, formQuestion.question)) {
708
- eml.style.borderColor = "#FF0000";
709
- eml.textContent = "Debe ser maximo de " + formQuestion.question.maxLength + " caracteres";
710
- document.getElementById(formQuestion.question.id).removeAttribute("hidden");
711
- valOk = false;
712
- hasError = true;
713
- }
714
- }
715
- if (!hasError) {
716
- var matches = String(email).match(regexType.email.exp);
717
- if (matches == null) {
718
- eml.style.borderColor = "#FF0000";
719
- eml.textContent = "Tu email es invalido";
720
- eml.removeAttribute("hidden");
721
- valOk = false;
722
- hasError = true;
723
- }
724
- }
725
- }
726
- catch (error) {
727
- }
728
- return valOk;
729
- };
730
- FormAuroraComponent.prototype.calendarRulesValidate = function (formQuestion) {
731
- var hasError = false;
732
- try {
733
- document.getElementById(formQuestion.question.id).setAttribute("hidden", "true");
734
- var ecalendar = document.getElementById(formQuestion.question.id);
735
- //se valida que no sea null si es requerido
736
- var date = formQuestion.question.registred;
737
- if (formQuestion.question.required && (date == "" || date == undefined || date == null)) {
738
- ecalendar.style.borderColor = "#FF0000";
739
- ecalendar.textContent = "La fecha es requerida";
740
- ecalendar.removeAttribute("hidden");
741
- }
742
- }
743
- catch (error) {
744
- }
745
- };
746
- FormAuroraComponent.prototype.validateNotSpace = function (event) {
747
- if (event.charCode == 32) {
748
- return false;
749
- }
750
- else {
751
- return true;
752
- }
753
- };
754
- FormAuroraComponent.prototype.validateNumeroDocumento = function (numeroDoc) {
755
- if (!numeroDoc.match("^[0-9]*$")) {
756
- this.formDynamic.controls["numeroDoc"].setValidators([Validators.pattern('^[0-9]*$')]);
757
- this.formDynamic.controls["numeroDoc"].markAsDirty();
758
- this.formDynamic.controls["numeroDoc"].updateValueAndValidity();
759
- this.formDynamic.controls["numeroDoc"].markAsTouched();
760
- this.patternNotValidDcto = true;
761
- return false;
762
- }
763
- this.patternNotValidDcto = false;
764
- return true;
765
- };
766
- FormAuroraComponent.prototype.validateCelular = function (numeroCel) {
767
- if (!numeroCel.match("^[0-9]*$")) {
768
- this.formDynamic.controls["celular"].setValidators([Validators.pattern('^[0-9]*$')]);
769
- this.formDynamic.controls["celular"].markAsDirty();
770
- this.formDynamic.controls["celular"].updateValueAndValidity();
771
- this.formDynamic.controls["celular"].markAsTouched();
772
- this.patternNotValidCel = true;
773
- return false;
774
- }
775
- this.patternNotValidCel = false;
776
- return true;
777
- };
778
- FormAuroraComponent.prototype.onkeypress = function (event) {
779
- return (event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57;
780
- };
781
- FormAuroraComponent.prototype.onChangeStep = function (step, nextStep, value) {
782
- if (nextStep && nextStep.stepOrder != 1) {
783
- this.resetField(step);
784
- nextStep.viewData = [];
785
- nextStep.viewData = nextStep.stepData.filter(function (x) { return x.relationalIds.includes(Number(value)); });
786
- }
787
- };
788
- FormAuroraComponent.prototype.resetField = function (stepIn) {
789
- this.steps.forEach(function (step) {
790
- if (step.stepOrder > stepIn.stepOrder) {
791
- step.viewData = undefined;
792
- step.value = undefined;
793
- }
794
- });
795
- };
796
- FormAuroraComponent.ctorParameters = function () { return [
797
- { type: CommonDataService },
798
- { type: HttpClient }
799
- ]; };
800
- __decorate([
801
- Input()
802
- ], FormAuroraComponent.prototype, "dataClassCss", void 0);
803
- __decorate([
804
- Input()
805
- ], FormAuroraComponent.prototype, "dataForm", void 0);
806
- __decorate([
807
- Input()
808
- ], FormAuroraComponent.prototype, "clickSubmit", void 0);
809
- __decorate([
810
- Input()
811
- ], FormAuroraComponent.prototype, "dataReloadForm", void 0);
812
- __decorate([
813
- Input()
814
- ], FormAuroraComponent.prototype, "welcomeTitle", void 0);
815
- __decorate([
816
- Input()
817
- ], FormAuroraComponent.prototype, "welcomeDescription", void 0);
818
- __decorate([
819
- Input()
820
- ], FormAuroraComponent.prototype, "urlPdf", void 0);
821
- __decorate([
822
- Input()
823
- ], FormAuroraComponent.prototype, "nameCompany", void 0);
824
- __decorate([
825
- Input()
826
- ], FormAuroraComponent.prototype, "schedule", void 0);
827
- __decorate([
828
- Input()
829
- ], FormAuroraComponent.prototype, "isSimpleFlow", void 0);
830
- __decorate([
831
- Input()
832
- ], FormAuroraComponent.prototype, "steps", void 0);
833
- __decorate([
834
- ViewChild('formDynamic', { static: true })
835
- ], FormAuroraComponent.prototype, "formDynamic", void 0);
836
- __decorate([
837
- Output()
838
- ], FormAuroraComponent.prototype, "response", void 0);
839
- __decorate([
840
- Output()
841
- ], FormAuroraComponent.prototype, "summit", void 0);
842
- __decorate([
843
- Output()
844
- ], FormAuroraComponent.prototype, "viewAuthData", void 0);
845
- FormAuroraComponent = __decorate([
846
- Component({
847
- selector: 'lib-FormAurora',
848
- template: "<div class=\"card\">\r\n <span class=\"text-center mt-2 d-none d-sm-block\" *ngIf=\"!isSimpleFlow\">\r\n <img style=\"width: 115px; height:96px;\" [class]=\"dataClassCss.logo\" id=\"logo\">\r\n </span>\r\n <div class=\"text-center mt-2 d-none d-sm-block\" *ngIf=\"isSimpleFlow\" style=\"margin-top: 4%!important;\">\r\n </div>\r\n <div class=\"card-body pt-0\">\r\n <ng-container *ngIf=\"schedule\">\r\n <h4 class=\"card-title text-center mb-0\" [class]=\"dataClassCss.bienvenida2\" style=\"color: #EE7E0E;\">\r\n Horarios de atenci\u00F3n\r\n </h4>\r\n <small class=\"text-center d-block\">{{schedule}}</small>\r\n </ng-container>\r\n <form #formDynamic=\"ngForm\">\r\n <div *ngFor=\"let control of dataForm?.formQuestions; let index = index; trackBy: trackByIndex\">\r\n <div\r\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2)) || (index < dataForm.formQuestions.length && dataForm.formQuestions[index].question.questionType.id == 3 && dataForm.formQuestions[index + 1].question.questionType.id == 2); else switchTemp\">\r\n <div class=\"row\"\r\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2))\">\r\n <div class=\"col-lg-6 col-xs-12\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index - 1].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left;\">\r\n <span class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index -\r\n 1].question.label}}</span>\r\n </label>\r\n <div class=\"selectContainer\">\r\n <select [name]=\"dataForm.formQuestions[index - 1].question.value\"\r\n [required]=\"dataForm.formQuestions[index - 1].question.required\"\r\n [class]=\"dataClassCss.formcontrol\"\r\n id=\"{{dataForm.formQuestions[index - 1].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index - 1].question.registred\">\r\n <option value=\"\" selected disabled hidden>Selecciona</option>\r\n <ng-container\r\n *ngFor=\"let item of dataForm.formQuestions[index - 1].question.questionAnswers\">\r\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\r\n {{ item.answer.field }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n </div>\r\n <div style=\"margin-left: 15px;\"\r\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\r\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index-1].question.value\"\r\n hidden></span>\r\n </div>\r\n </div>\r\n <div class=\"col-lg-6 col-xs-12\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\"\r\n class=\"col-sm-12 p-sm-0 px-sm-1\" style=\"display: block; text-align: left;\">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" pattern=\"\\d*\" inputmode=\"numeric\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (keyup)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n onkeypress=\"onkeypress($event)\" onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\r\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\r\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n [class]=\"dataClassCss.formcontrol\" />\r\n\r\n </div>\r\n\r\n <div style=\"margin-left: 15px;\"\r\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\r\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\r\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\r\n Este campo es obligatorio</span>\r\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser m\u00EDnimo de\r\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser maximo de\r\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\r\n hidden></span>\r\n <span *ngIf=\"patternNotValidDcto === true\" class=\"error\">Formato no valido</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-template #switchTemp>\r\n <div [ngSwitch]=\"dataForm.formQuestions[index].question.questionType.id\">\r\n <div *ngSwitchCase=\"1\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; \">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n style=\"margin-top: -1rem !important;\" />\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"2\">\r\n\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left;\">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" pattern=\"\\d*\" inputmode=\"numeric\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n onkeypress=\"onkeypress($event)\" onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\r\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\r\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n [class]=\"dataClassCss.formcontrol\" />\r\n <span *ngIf=\"patternNotValidCel === true\" class=\"error\">Formato no valido</span>\r\n </div>\r\n\r\n </div>\r\n <div *ngSwitchCase=\"3\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left;\">\r\n <span\r\n class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <select [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [class]=\"dataClassCss.formcontrol\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index].question.registred\">\r\n <option value=\"\" selected disabled hidden>Selecciona</option>\r\n <ng-container\r\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\">\r\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\r\n {{ item.answer.field }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"4\">\r\n <select class=\"{{ dataClassCss.formcontrol }} select-checkbox\"\r\n style=\"overflow: hidden; border-style: hidden;\"\r\n [style.height.px]=\"dataForm.formQuestions[index].question.questionAnswers.length * 24\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\" ngModel multiple>\r\n <option (mousemove)=\"$event.preventDefault()\"\r\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\"\r\n [value]=\"item.answer.value\">\r\n {{ item.answer.field }}\r\n </option>\r\n </select>\r\n </div>\r\n <div *ngSwitchCase=\"5\">\r\n <a (click)=\"rediretoutside($event,dataForm.formQuestions[index].question)\" href=\"\">\r\n <span>{{ dataForm.formQuestions[index].question.label }}</span>\r\n </a>\r\n </div>\r\n <div *ngSwitchCase=\"6\">\r\n <div [class]=\"dataClassCss.cl12\" [id]=\"'reCaptcha'\">\r\n <div class=\"cnt-captcha\">\r\n <re-captcha (resolved)=\"resolvedCaptcha($event)\"\r\n siteKey=\"6Lf9DcQfAAAAAI6HCNB5OyKUpOPpfl5ocoBJcigZ\"></re-captcha>\r\n <input hidden type=\"text\" [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\r\n </div>\r\n <span class=\"error\" *ngIf=\"watchValid && !captchaValid\" style=\"margin-top: 0;\">\r\n Debe resolver la captcha para continuar\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"7\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; margin-bottom: 0 ;\">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input placeholder=\"dd/mm/aaaa\" style=\"margin-top: -0.4rem !important;\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [name]=\"dataForm.formQuestions[index].question.value\" type=\"date\" min=\"{{minDate}}\"\r\n max=\"{{maxDate}}\" [maxlength]=\"10\" (paste)=\"false\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.txtCalendar\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n (keydown)=\"cancellKeypress()\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\">\r\n\r\n <button class=\"btn\" id=\"{{dataForm.formQuestions[index].question.value}}\" type=\"button\"\r\n style=\"width: 46px;\r\n top: 12px;\r\n color: white;\r\n right: 15px;\r\n position: absolute;\r\n background: #D25D42;\r\n pointer-events: none;\">\r\n <i class=\"fa fa-calendar\"></i>\r\n </button>\r\n\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"8\">\r\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\r\n <input\r\n style=\"width: 4% !important; height: auto !important; display: inline !important;\"\r\n type=\"checkbox\" [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n [class]=\"dataClassCss.formcontrol\">\r\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\r\n id=\"txtPoliticas\" (click)=\"tycSelection($event)\">\r\n {{dataForm.formQuestions[index].question.label}}\r\n </a>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"9\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; \">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (keypress)=\"validOnlyText($event)\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n style=\"margin-top: -1rem !important;\" />\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"10\">\r\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\r\n <input\r\n style=\"width: 4% !important; height: auto !important; display: inline !important;\"\r\n type=\"checkbox\" [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\r\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\r\n id=\"check{{dataForm.formQuestions[index].question.id}}\"\r\n (click)=\"openLabelUrl($event,dataForm.formQuestions[index].question)\">\r\n {{dataForm.formQuestions[index].question.label}}\r\n </a>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"11\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; \">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (keypress)=\"validateNotSpace($event)\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n style=\"margin-top: -1rem !important;\" />\r\n </div>\r\n </div>\r\n <div *ngSwitchDefault>Tipo de control no detectado</div>\r\n <div style=\"margin-left: 15px;\"\r\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\r\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\r\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\r\n Este campo es obligatorio</span>\r\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser m\u00EDnimo de\r\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser maximo de\r\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\r\n hidden></span>\r\n <span class=\"error\" [id]=\"dataForm.formQuestions[index].question.id\" hidden></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <section *ngIf=\"isSimpleFlow\">\r\n <div *ngFor=\"let step of steps let index = index;\">\r\n <div [class]=\"dataClassCss.cl12\" *ngIf=\"step.viewData\">\r\n <label for=\"{{step.id}}\" class=\"col-sm-12\" style=\"display: block; text-align: left;\">\r\n <span class=\"h6 small bg-white text-muted\">{{step.step}}</span>\r\n </label>\r\n <select [name]=\"step.step\" [required]=\"true\" [class]=\"dataClassCss.formcontrol\"\r\n id=\"{{step.step}}\" style=\"margin-top: -1rem !important;\" [(ngModel)]=\"step.value\"\r\n (ngModelChange)=\"onChangeStep(step,steps[index+1],$event)\">\r\n <option value=\"\" selected disabled hidden>Selecciona</option>\r\n <ng-container *ngFor=\"let subitem of step.viewData\">\r\n <option [value]=\"subitem.id\">\r\n {{ subitem.description }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n </div>\r\n </section>\r\n <div class=\"mt-3 text-center\">\r\n <button type=\"button\" [class]=\"dataClassCss.btn\" (click)=\"onSubmit()\" [disabled]=\"!formDynamic.valid\"\r\n id=\"btnIng\">Ingresar</button>\r\n </div>\r\n </form>\r\n </div>\r\n</div>",
849
- providers: [
850
- { provide: NgbDateAdapter, useClass: CustomAdapter },
851
- { provide: NgbDateParserFormatter, useClass: CustomDateParserFormatter },
852
- { provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n },
853
- I18n
854
- ],
855
- styles: ["form{font-size:12px;overflow-y:scroll;overflow-x:hidden}form input,form select{border:1px solid #e4e4e4;height:40px;margin-bottom:5px}.selectContainer select{-webkit-appearance:none;-moz-appearance:none;appearance:none}.selectContainer::after{content:\"\\025be\";display:table-cell;text-align:center;padding-top:7px;width:30px;height:30px;position:absolute;top:14px;right:20px;pointer-events:none}form .error{color:red;font-size:12px;text-align:left;margin:-15px 0 15px;padding:0;width:90%}.error:after{content:\" \";display:block}.card{width:90%;margin:2% auto;border-radius:12px}@media (max-width:412px){.card{width:100%}.cnt-captcha{transform:scale(.77)}}@media (max-width:575.98px){.card{width:100%}.cnt-captcha{transform:scale(.77)}}@media (max-width:880.98px){.cnt-captcha{transform:scale(.82)}}input[type=date]::-webkit-calendar-picker-indicator{background:0 0;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:#f5f5f5}::-webkit-scrollbar-thumb{background:#e0e0e0}::-webkit-scrollbar-thumb:hover{background:#bdbdbd}"]
856
- })
857
- ], FormAuroraComponent);
858
- return FormAuroraComponent;
179
+ var CommonDataService = /** @class */ (function () {
180
+ function CommonDataService() {
181
+ }
182
+ CommonDataService_1 = CommonDataService;
183
+ CommonDataService.prototype.getData = function () {
184
+ var dataOffuscade = new Offusqued();
185
+ if (localStorage.getItem("data") != null) {
186
+ var data = new Map(JSON.parse(localStorage.getItem("data")));
187
+ return data;
188
+ }
189
+ else {
190
+ /** Error get cookie */
191
+ }
192
+ };
193
+ CommonDataService.prototype.setData = function (data) {
194
+ var dataOffuscade = new Offusqued();
195
+ var datatem = JSON.stringify(Array.from(data.entries()));
196
+ var inf = dataOffuscade.ofusquedData(datatem);
197
+ console.log('OFUSCADO');
198
+ console.log(inf);
199
+ localStorage.setItem('data', inf);
200
+ //localStorage.setItem('data', JSON.stringify(Array.from(data.entries())));
201
+ };
202
+ CommonDataService.prototype.initData = function () {
203
+ this.setData(new Map());
204
+ };
205
+ CommonDataService.prototype.putValue = function (key, value) {
206
+ var data = this.getData();
207
+ data = data.set(key, value);
208
+ this.setData(data);
209
+ };
210
+ CommonDataService.prototype.addValue = function (keyPrimary, keySecond, value) {
211
+ var data = this.getValue(keyPrimary);
212
+ var dataReturn = this.getData();
213
+ data[keySecond] = value;
214
+ dataReturn = dataReturn.set(keyPrimary, data);
215
+ this.setData(dataReturn);
216
+ };
217
+ CommonDataService.prototype.getValue = function (key) {
218
+ return !this.getData() || !this.getData().has(key) ? undefined : this.getData().get(key);
219
+ };
220
+ CommonDataService.prototype.hasValue = function (key) {
221
+ return this.getData() != undefined ? this.getData().has(key) : null;
222
+ };
223
+ CommonDataService.prototype.clearMap = function () {
224
+ if (this.hasValue(CommonDataService_1.COMPANY_KEY)) {
225
+ var company = this.getValue(CommonDataService_1.COMPANY_KEY);
226
+ this.initData();
227
+ this.putValue(CommonDataService_1.COMPANY_KEY, company);
228
+ }
229
+ else {
230
+ this.initData();
231
+ }
232
+ };
233
+ var CommonDataService_1;
234
+ CommonDataService.COMPANY_KEY = "company";
235
+ CommonDataService.DOC_NUMBER_KEY = "docNumber";
236
+ CommonDataService.DOC_TYPE_KEY = "docType";
237
+ CommonDataService.PHONE_KEY = "phone";
238
+ CommonDataService.TYPE_ATTENTION_KEY = "typeAttention";
239
+ CommonDataService.OFFICE_KEY = "office";
240
+ CommonDataService.TYPE_TURN_KEY = "typeTurn";
241
+ CommonDataService.SERVICE_KEY = "service";
242
+ CommonDataService.TURN_KEY = "turn";
243
+ CommonDataService.PROGRAMED_TURN_KEY = "programedTurn";
244
+ CommonDataService.REQUEST_CALL = "requestCall";
245
+ CommonDataService.FORM_DATA = "formdata";
246
+ CommonDataService.TEMPLATE = "template";
247
+ CommonDataService.TURN_RESCHEDULE = "turnReschedule";
248
+ CommonDataService.USER_GENDER = "genderUser";
249
+ CommonDataService.AUTO_REDIRECT = "autoRedirect";
250
+ CommonDataService.SCHEDULE_GENERAL = "scheduleGeneral";
251
+ CommonDataService.AGENDAMIENTO_TTP = "potencialCustomer";
252
+ CommonDataService.SINGLE_PAGE_ONE = "singlePageOne";
253
+ CommonDataService.AVAILABLE_SCHEDULE_GRAL = "availableScheduleGral";
254
+ CommonDataService.PROFILE = "profile";
255
+ CommonDataService.PAGE_NEXT = "pageNext";
256
+ CommonDataService.STEPS = "steps";
257
+ CommonDataService.TYPE_TURN_ID = "typeTurnId";
258
+ CommonDataService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonDataService_Factory() { return new CommonDataService(); }, token: CommonDataService, providedIn: "root" });
259
+ CommonDataService = CommonDataService_1 = __decorate([
260
+ Injectable({
261
+ providedIn: "root",
262
+ })
263
+ ], CommonDataService);
264
+ return CommonDataService;
859
265
  }());
860
266
 
861
- var CommonTemplateService = /** @class */ (function () {
862
- function CommonTemplateService(http) {
863
- this.http = http;
864
- }
865
- CommonTemplateService.prototype.getTemplate = function (idCompany, url) {
866
- return this.http.get(url + "/template/findByCompany/" + idCompany);
867
- };
868
- CommonTemplateService.prototype.reloadStylePage = function (currentDocument, templateCompany) {
869
- var e_1, _a;
870
- var objects = currentDocument.getElementsByClassName("template");
871
- // debugger
872
- for (var index = 0; index < objects.length; index++) {
873
- var item = objects[index];
874
- var itemClassName = typeof (item.className) == "object" ? item.className['baseVal'] : item.className;
875
- var indexStart = itemClassName.indexOf("template");
876
- // let keyString = itemClassName.substring(indexStart, itemClassName.length).split(' ')[1]
877
- var keysString = itemClassName.substring(indexStart, itemClassName.length).split(' ').filter(function (a) { return a.indexOf('tmp_') !== -1; });
878
- try {
879
- for (var keysString_1 = (e_1 = void 0, __values(keysString)), keysString_1_1 = keysString_1.next(); !keysString_1_1.done; keysString_1_1 = keysString_1.next()) {
880
- var keyString = keysString_1_1.value;
881
- if (templateCompany[keyString] != undefined) {
882
- if (keyString.includes("tmp_type_text_")) {
883
- if (keyString.includes('tmp_type_text_6')) {
884
- item['style'].setProperty('--' + keyString, templateCompany[keyString].color);
885
- }
886
- else {
887
- item["style"].color = templateCompany[keyString].color;
888
- if (itemClassName.includes("ratting-faces-v2")) {
889
- item["style"].backgroundColor = templateCompany[keyString].color;
890
- item["style"].borderColor = templateCompany[keyString].color;
891
- item["style"].color = "white";
892
- }
893
- }
894
- }
895
- if (keyString.includes("title1")) {
896
- /*item["style"].color = templateCompany[keyString].color*/
897
- item["style"].color = "#EE7E0E";
898
- }
899
- if (keyString.includes("tmp_type_svg_")) {
900
- item["style"].fill = templateCompany[keyString].fill;
901
- }
902
- if (keyString.includes("tmp_type_img_")) {
903
- if (item.nodeName == "IMG") {
904
- item["src"] = templateCompany[keyString].src;
905
- }
906
- else {
907
- item["style"].background = templateCompany[keyString].background;
908
- item["style"].backgroundSize = templateCompany[keyString].backgroundSize;
909
- }
910
- }
911
- if (keyString.includes("tmp_type_head_")) {
912
- item["style"].setProperty('--' + keyString, templateCompany[keyString].color);
913
- }
914
- if (keyString.includes("tmp_type_footer_")) {
915
- // debugger
916
- item["style"].setProperty('--' + keyString, templateCompany[keyString].color);
917
- }
918
- if (itemClassName.includes("tmp_type_cnt_")) {
919
- indexStart = itemClassName.indexOf("tmp_type_cnt_");
920
- keyString = itemClassName.substring(indexStart, itemClassName.length).split(' ')[0];
921
- if (!!templateCompany[keyString]) {
922
- item["style"].backgroundColor = templateCompany[keyString].backgroundColor;
923
- }
924
- }
925
- if (keyString.includes('tmp_type_font_')) {
926
- item['style'].setProperty('font-family', templateCompany[keyString]['font-family'], 'important');
927
- }
928
- }
929
- }
930
- }
931
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
932
- finally {
933
- try {
934
- if (keysString_1_1 && !keysString_1_1.done && (_a = keysString_1.return)) _a.call(keysString_1);
935
- }
936
- finally { if (e_1) throw e_1.error; }
937
- }
938
- }
939
- };
940
- CommonTemplateService.ctorParameters = function () { return [
941
- { type: HttpClient }
942
- ]; };
943
- CommonTemplateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonTemplateService_Factory() { return new CommonTemplateService(ɵɵinject(HttpClient)); }, token: CommonTemplateService, providedIn: "root" });
944
- CommonTemplateService = __decorate([
945
- Injectable({
946
- providedIn: "root",
947
- })
948
- ], CommonTemplateService);
949
- return CommonTemplateService;
267
+ var moment = moment_;
268
+ /**
269
+ * This Service handles how the date is represented in scripts i.e. ngModel.
270
+ */
271
+ var CustomAdapter = /** @class */ (function (_super) {
272
+ __extends(CustomAdapter, _super);
273
+ function CustomAdapter() {
274
+ var _this = _super !== null && _super.apply(this, arguments) || this;
275
+ _this.DELIMITER = '/';
276
+ return _this;
277
+ }
278
+ CustomAdapter.prototype.fromModel = function (value) {
279
+ if (value) {
280
+ var date = value.split(this.DELIMITER);
281
+ return {
282
+ day: parseInt(date[0], 10),
283
+ month: parseInt(date[1], 10),
284
+ year: parseInt(date[2], 10)
285
+ };
286
+ }
287
+ return null;
288
+ };
289
+ CustomAdapter.prototype.toModel = function (date) {
290
+ return date ? (date.day < 10 ? 0 + date.day : date.day) + this.DELIMITER + (date.month < 10 ? 0 + date.month : date.month) + this.DELIMITER + date.year : '';
291
+ };
292
+ CustomAdapter = __decorate([
293
+ Injectable()
294
+ ], CustomAdapter);
295
+ return CustomAdapter;
296
+ }(NgbDateAdapter));
297
+ /**
298
+ * This Service handles how the date is rendered and parsed from keyboard i.e. in the bound input field.
299
+ */
300
+ var CustomDateParserFormatter = /** @class */ (function (_super) {
301
+ __extends(CustomDateParserFormatter, _super);
302
+ function CustomDateParserFormatter() {
303
+ var _this = _super !== null && _super.apply(this, arguments) || this;
304
+ _this.DELIMITER = '/';
305
+ return _this;
306
+ }
307
+ CustomDateParserFormatter.prototype.parse = function (value) {
308
+ if (value) {
309
+ var date = value.split(this.DELIMITER);
310
+ return {
311
+ day: parseInt(date[0], 10),
312
+ month: parseInt(date[1], 10),
313
+ year: parseInt(date[2], 10)
314
+ };
315
+ }
316
+ return null;
317
+ };
318
+ CustomDateParserFormatter.prototype.format = function (date) {
319
+ return date ? (date.day < 10 ? '0' + date.day : date.day) + this.DELIMITER + (date.month < 10 ? '0' + date.month : date.month) + this.DELIMITER + date.year : '';
320
+ };
321
+ CustomDateParserFormatter = __decorate([
322
+ Injectable()
323
+ ], CustomDateParserFormatter);
324
+ return CustomDateParserFormatter;
325
+ }(NgbDateParserFormatter));
326
+ var I18N_VALUES = {
327
+ 'es': {
328
+ weekdays: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
329
+ months: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
330
+ weekLabel: 'sem'
331
+ }
332
+ // other languages you would support
333
+ };
334
+ var I18n = /** @class */ (function () {
335
+ function I18n() {
336
+ this.language = 'es';
337
+ }
338
+ I18n = __decorate([
339
+ Injectable()
340
+ ], I18n);
341
+ return I18n;
342
+ }());
343
+ // Define custom service providing the months and weekdays translations
344
+ var CustomDatepickerI18n = /** @class */ (function (_super) {
345
+ __extends(CustomDatepickerI18n, _super);
346
+ function CustomDatepickerI18n(_i18n) {
347
+ var _this = _super.call(this) || this;
348
+ _this._i18n = _i18n;
349
+ return _this;
350
+ }
351
+ CustomDatepickerI18n.prototype.getWeekdayLabel = function (weekday) {
352
+ return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
353
+ };
354
+ CustomDatepickerI18n.prototype.getWeekLabel = function () {
355
+ return I18N_VALUES[this._i18n.language].weekLabel;
356
+ };
357
+ CustomDatepickerI18n.prototype.getMonthShortName = function (month) {
358
+ return I18N_VALUES[this._i18n.language].months[month - 1];
359
+ };
360
+ CustomDatepickerI18n.prototype.getMonthFullName = function (month) {
361
+ return this.getMonthShortName(month);
362
+ };
363
+ CustomDatepickerI18n.prototype.getDayAriaLabel = function (date) {
364
+ return date.day + "-" + date.month + "-" + date.year;
365
+ };
366
+ CustomDatepickerI18n.prototype.getWeekdayShortName = function (weekday) {
367
+ return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
368
+ };
369
+ ;
370
+ CustomDatepickerI18n.ctorParameters = function () { return [
371
+ { type: I18n }
372
+ ]; };
373
+ CustomDatepickerI18n = __decorate([
374
+ Injectable()
375
+ ], CustomDatepickerI18n);
376
+ return CustomDatepickerI18n;
377
+ }(NgbDatepickerI18n));
378
+ var FormAuroraComponent = /** @class */ (function () {
379
+ function FormAuroraComponent(data, http) {
380
+ this.data = data;
381
+ this.http = http;
382
+ this.response = new EventEmitter();
383
+ this.summit = new EventEmitter();
384
+ this.viewAuthData = new EventEmitter();
385
+ this.tipodocNumDoc = false;
386
+ this.countSubmit = 0;
387
+ this.watchValid = false;
388
+ this.watchRequired = false;
389
+ this.captchaValid = false;
390
+ this.today = moment(new Date());
391
+ this.maxYear = this.today.year();
392
+ this.minYear = this.today.year() - 82;
393
+ this.minDate = this.minYear.toString() + '-' + this.today.month().toString().padStart(2, '0') + '-' + this.today.date().toString().padStart(2, '0'); // {year: this.minYear, month: this.today.month(), day: this.today.date()};
394
+ this.maxDate = this.maxYear.toString() + '-' + (this.today.month() + 1).toString().padStart(2, '0') + '-' + this.today.date().toString().padStart(2, '0'); // {year: this.maxYear, month: this.today.month() + 1, day: this.today.date()};
395
+ this.recharge = false;
396
+ this.indicativo = "57";
397
+ this.defaultDocType = "Cédula de ciudadanía";
398
+ this.patternNotValidDcto = false;
399
+ this.patternNotValidCel = false;
400
+ this.range = new FormGroup({
401
+ start: new FormControl(),
402
+ end: new FormControl(),
403
+ });
404
+ }
405
+ FormAuroraComponent.prototype.ngOnInit = function () {
406
+ var _this = this;
407
+ this.minDate = new Date(this.minDate).toISOString().split('T')[0];
408
+ setTimeout(function () {
409
+ _this.startComponent();
410
+ }, 2000);
411
+ };
412
+ FormAuroraComponent.prototype.startComponent = function () {
413
+ var e_1, _a;
414
+ var _this = this;
415
+ //ordena los campos
416
+ if (this.dataForm != null && this.dataForm.formQuestions != undefined) {
417
+ //Same row fields
418
+ this.tipodocNumDoc = (this.dataForm.formQuestions.some(function (question) { return question.question.value === "tipoDoc"; }) && this.dataForm.formQuestions.some(function (question) { return question.question.value === "numeroDoc"; })) ? true : false;
419
+ this.dataForm.formQuestions = this.dataForm.formQuestions.sort(function (a, b) {
420
+ return a.order - b.order;
421
+ });
422
+ var existcaptcha = this.dataForm.formQuestions.filter(function (item) { return item.question.questionType.id == 6; });
423
+ if (existcaptcha.length == 0) {
424
+ this.captchaValid = true;
425
+ }
426
+ var _loop_1 = function (item) {
427
+ if (item.question.maxlength == null || item.question.maxlength == undefined || item.question.maxlength == 0) {
428
+ item.question.maxlength = 524288; //defaultvalue
429
+ }
430
+ if (item.question.minLength == null || item.question.minLength == undefined) {
431
+ item.question.minLength = 0;
432
+ }
433
+ this_1.dataReloadForm.forEach(function (element) {
434
+ _this.filldata = element;
435
+ if ((item.question.questionType.id === 2 || item.question.questionType.id === 1 ||
436
+ item.question.questionType.id === 3) && (_this.filldata.data !== null &&
437
+ _this.filldata.data !== undefined) && item.question.id === _this.filldata.id) {
438
+ item.question.registred = _this.filldata.data;
439
+ }
440
+ });
441
+ if (item.question.registred == null || item.question.minLength == undefined) {
442
+ item.question.registred = '';
443
+ }
444
+ };
445
+ var this_1 = this;
446
+ try {
447
+ for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
448
+ var item = _c.value;
449
+ _loop_1(item);
450
+ }
451
+ }
452
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
453
+ finally {
454
+ try {
455
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
456
+ }
457
+ finally { if (e_1) throw e_1.error; }
458
+ }
459
+ }
460
+ };
461
+ FormAuroraComponent.prototype.resolvedCaptcha = function (captchaResponse) {
462
+ this.captchaValid = true;
463
+ if (!this.formDynamic.form.value.captcha) {
464
+ this.formDynamic.controls.captcha.setValue(captchaResponse);
465
+ this.formDynamic.form.value.captcha = captchaResponse;
466
+ document.getElementById("btnIng").style.opacity = !this.formDynamic.valid ? "0.65" : "1";
467
+ }
468
+ };
469
+ //Forms
470
+ //Metodo para evitar el render de los items del for
471
+ FormAuroraComponent.prototype.trackByIndex = function (index, obj) {
472
+ return index;
473
+ };
474
+ FormAuroraComponent.prototype.onChangeValidPatter = function (event, question) {
475
+ var _this = this;
476
+ if (question.pattern != undefined) {
477
+ var valid = true;
478
+ var keyvalid = [8, 32, 37, 38, 39, 40, 46, 9];
479
+ //diferente de Backpsace
480
+ //se deja catch por error no controlable en otro tiempo de ejecucion
481
+ try {
482
+ if (!keyvalid.includes(event.keyCode)) {
483
+ var regex = new RegExp(question.pattern);
484
+ valid = regex.test(event.key);
485
+ }
486
+ }
487
+ catch (error) { }
488
+ return valid;
489
+ }
490
+ if (question.questionType !== undefined) {
491
+ if (question.questionType.description === 'Number') {
492
+ if (question.value === 'numeroDoc') {
493
+ this.validateNumeroDocumento(this.formDynamic.controls["numeroDoc"].value.toString());
494
+ }
495
+ else if (question.value === 'celular') {
496
+ this.validateCelular(this.formDynamic.controls["celular"].value.toString());
497
+ }
498
+ }
499
+ }
500
+ document.getElementById("char" + question.value).setAttribute("hidden", "true");
501
+ //if temporal mientras se migran todos los tipos de campos al foreach
502
+ if (question.questionType.id != 11 && question.questionType.id != 7) {
503
+ if (this.validMinLength(this.formDynamic, question)) {
504
+ document.getElementById(question.value).style.borderColor = "#FF0000";
505
+ document.getElementById("ml" + question.value).removeAttribute("hidden");
506
+ }
507
+ else {
508
+ document.getElementById(question.value).style.borderColor = "#E4E4E4";
509
+ document.getElementById("ml" + question.value).setAttribute("hidden", "true");
510
+ }
511
+ if (this.validMaxLength(this.formDynamic, question)) {
512
+ document.getElementById(question.value).style.borderColor = "#FF0000";
513
+ document.getElementById("mxl" + question.value).removeAttribute("hidden");
514
+ }
515
+ else {
516
+ document.getElementById(question.value).style.borderColor = "#E4E4E4";
517
+ document.getElementById("mxl" + question.value).setAttribute("hidden", "true");
518
+ }
519
+ }
520
+ this.dataForm.formQuestions.forEach(function (formQuestion) {
521
+ switch (formQuestion.question.questionType.id) {
522
+ //se valida campo de tipo calendario
523
+ case 7:
524
+ if (question.questionType.id == 7)
525
+ _this.calendarRulesValidate(formQuestion);
526
+ break;
527
+ //se valida campo de tipo email
528
+ case 11:
529
+ if (question.questionType.id == 11)
530
+ _this.emailRulesValidate(formQuestion);
531
+ break;
532
+ }
533
+ });
534
+ document.getElementById("btnIng").style.opacity = !this.formDynamic.valid ? "0.65" : "1";
535
+ };
536
+ FormAuroraComponent.prototype.validOnlyText = function (event) {
537
+ var regex = /^[a-zA-Z\u00C0-\u017F]+$/g;
538
+ if (event.charCode == 32) {
539
+ return true;
540
+ }
541
+ var valid = regex.test(event.key);
542
+ return valid;
543
+ };
544
+ FormAuroraComponent.prototype.validDate = function (event) {
545
+ /*let pattern = /(?:0[1-9]|[12][0-9]|3[01])\/(?:0[1-9]|1[0-2])\/(?:19|20)[0-9]{2}/;
546
+ const regex = new RegExp(pattern);
547
+ valid = regex.test(event.key);
548
+ */
549
+ var matches = String(event.key).match(regexType.date.exp);
550
+ var valid = true;
551
+ if (matches === null)
552
+ valid = false;
553
+ // alert(valid);
554
+ return valid;
555
+ };
556
+ FormAuroraComponent.prototype.onChangeValidDate = function (event) {
557
+ //let pattern = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12][0-9]|3[01])\/(?:19|20)[0-9]{2}/;
558
+ var dateN = /[0-9]|\//;
559
+ var valid = true;
560
+ var regex = new RegExp(dateN);
561
+ valid = regex.test(event.key);
562
+ return valid;
563
+ };
564
+ FormAuroraComponent.prototype.rediretoutside = function (event, question) {
565
+ //se deja catch por error no controlable en otro tiempo de ejecucion
566
+ try {
567
+ event.preventDefault();
568
+ window.open(question.value, "_blank");
569
+ }
570
+ catch (error) { }
571
+ };
572
+ /**
573
+ * Dispatch submit event for validations exists
574
+ * @param change
575
+ */
576
+ FormAuroraComponent.prototype.ngOnChanges = function (change) {
577
+ this.countSubmit++;
578
+ };
579
+ //onSubmit(form: NgForm) {
580
+ FormAuroraComponent.prototype.onSubmit = function () {
581
+ var _this = this;
582
+ var form = this.formDynamic;
583
+ this.watchValid = true;
584
+ this.watchRequired = true;
585
+ if (form.valid) {
586
+ if (!this.validRulesFields(form.controls["numeroDoc"].value.toString(), form.controls["celular"].value.toString(), form.controls["email"].value))
587
+ return false;
588
+ }
589
+ if (this.validMinlenghtAllQuestions(form.value) && this.validMaxLengthAllQuestions(form.value) && form.valid) {
590
+ if (this.dataForm.urlSend != "" && this.captchaValid) {
591
+ this.http.post(this.dataForm.urlSend, form.value).subscribe(function (resp) { return _this.response.emit(resp); });
592
+ }
593
+ else if (form.valid && this.captchaValid) {
594
+ this.summit.emit(form.value);
595
+ }
596
+ }
597
+ };
598
+ FormAuroraComponent.prototype.findParamBoolean = function (params, idParam) {
599
+ var showDescriptionParam = params.find(function (x) { return x.id == idParam; });
600
+ return showDescriptionParam != null && showDescriptionParam.value == "true";
601
+ };
602
+ FormAuroraComponent.prototype.validRulesFields = function (numeroDoc, numeroCel, email) {
603
+ var _this = this;
604
+ // Validaciones para celular en caso de indicativo en Colombia
605
+ var cel = document.getElementById("charcelular");
606
+ var doc = document.getElementById("charnumeroDoc");
607
+ var valOk = true;
608
+ if (this.indicativo == "+57" || this.indicativo == "57") {
609
+ var stringOrdenado = this.orderString(numeroDoc);
610
+ if (this.nameCompany.toUpperCase() !== 'CLARO') { //claro acepta nro consecutivos
611
+ if (numeroDoc == stringOrdenado) {
612
+ doc.style.borderColor = "#FF0000";
613
+ doc.removeAttribute("hidden");
614
+ doc.textContent = "El numero documento No debe contener caracteres consecutivos";
615
+ valOk = false;
616
+ //this.msgErrorCampo = "El numero documento No debe contener caracteres consecutivos";
617
+ //return false;
618
+ }
619
+ }
620
+ if (numeroCel.substring(0, 1) != "3") {
621
+ cel.style.borderColor = "#FF0000";
622
+ cel.removeAttribute("hidden");
623
+ cel.textContent = "El primer carácter del celular debe ser 3";
624
+ valOk = false;
625
+ //this.msgErrorCampo = "El primer carácter del celular debe ser 3";
626
+ //return false;
627
+ }
628
+ /*
629
+ if (parseInt(numeroCel.substring(0, 3)) > 350) {
630
+ cel.style.borderColor = "#FF0000";
631
+ cel.removeAttribute("hidden");
632
+ cel.textContent = "El prefijo del celular no debe ser mayor a 350";
633
+ valOk = false;
634
+ //this.msgErrorCampo = "El prefijo del celular no debe ser mayor a 350";
635
+ //return false;
636
+ }
637
+ */
638
+ //En caso de que el número se repita, ejemplo 33333333
639
+ var listnumber = numeroDoc.substring(0, 1);
640
+ for (var index = 1; index < numeroDoc.length; index++) {
641
+ listnumber = listnumber + numeroDoc.substring(0, 1);
642
+ }
643
+ if (numeroDoc == listnumber) {
644
+ doc.style.borderColor = "#FF0000";
645
+ doc.removeAttribute("hidden");
646
+ doc.textContent = "Caracteres numéricos no se pueden repetirse de manera continua ";
647
+ valOk = false;
648
+ //this.msgErrorCampo = "Caracteres numéricos no se pueden repetirse de manera continua ";
649
+ //return false;
650
+ }
651
+ if (!this.validateNumeroDocumento(numeroDoc)) {
652
+ return false;
653
+ }
654
+ if (!this.validateCelular(numeroCel)) {
655
+ return false;
656
+ }
657
+ // En caso de que el número se repita, ejemplo 33333333
658
+ var arrayPhoneRepeat = Array.from(String(numeroCel), Number);
659
+ var arrayPhoneOutRepeat = __spread(new Set(arrayPhoneRepeat));
660
+ if (arrayPhoneOutRepeat.length == 1) {
661
+ cel.style.borderColor = "#FF0000";
662
+ cel.removeAttribute("hidden");
663
+ cel.textContent = "El número que ingresa no es valido";
664
+ valOk = false;
665
+ //this.msgErrorCampo = "El número que ingresa no es valido";
666
+ //return false;
667
+ }
668
+ }
669
+ else if (this.indicativo == "+593" || this.indicativo == "593") {
670
+ if (numeroCel.substring(0, 1) != "9") {
671
+ cel.style.borderColor = "#FF0000";
672
+ cel.removeAttribute("hidden");
673
+ cel.textContent = "El primer carácter del celular debe ser 9";
674
+ valOk = false;
675
+ //this.msgErrorCampo = "El primer carácter del celular debe ser 9";
676
+ //return false;
677
+ }
678
+ }
679
+ //se validan los campos por tipo de campo y no por value
680
+ this.dataForm.formQuestions.forEach(function (formQuestion) {
681
+ switch (formQuestion.question.questionType.id) {
682
+ //se valida campo de tipo email
683
+ case 11:
684
+ valOk = _this.emailRulesValidate(formQuestion);
685
+ break;
686
+ }
687
+ });
688
+ return valOk;
689
+ };
690
+ FormAuroraComponent.prototype.orderString = function (value) {
691
+ var arrayNumber = [];
692
+ for (var index = 0; index < value.length; index++) {
693
+ arrayNumber.push(parseInt(value.substring(index, index + 1)));
694
+ }
695
+ //ordena el array
696
+ arrayNumber.sort(function (a, b) {
697
+ return a - b;
698
+ });
699
+ var numberOrder = "";
700
+ numberOrder = arrayNumber[0];
701
+ for (var index = 1; index < arrayNumber.length; index++) {
702
+ numberOrder = numberOrder + (arrayNumber[0] + index).toString();
703
+ }
704
+ return numberOrder;
705
+ };
706
+ FormAuroraComponent.prototype.validMinlenghtAllQuestions = function (form) {
707
+ var e_2, _a;
708
+ try {
709
+ for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
710
+ var item = _c.value;
711
+ if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
712
+ var minLength = parseInt(item.question.minLength);
713
+ var formValueLength = parseInt(form[item.question.value].toString().length);
714
+ if (minLength > 0 && formValueLength != minLength && formValueLength < minLength)
715
+ return false;
716
+ }
717
+ }
718
+ }
719
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
720
+ finally {
721
+ try {
722
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
723
+ }
724
+ finally { if (e_2) throw e_2.error; }
725
+ }
726
+ return true;
727
+ };
728
+ FormAuroraComponent.prototype.validMaxLengthAllQuestions = function (form) {
729
+ var e_3, _a;
730
+ try {
731
+ for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
732
+ var item = _c.value;
733
+ if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
734
+ var maxLength = parseInt(item.question.maxLength);
735
+ var formValueLength = parseInt(form[item.question.value].toString().length);
736
+ if (maxLength > 0 && formValueLength != maxLength && formValueLength > maxLength)
737
+ return false;
738
+ }
739
+ }
740
+ }
741
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
742
+ finally {
743
+ try {
744
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
745
+ }
746
+ finally { if (e_3) throw e_3.error; }
747
+ }
748
+ return true;
749
+ };
750
+ FormAuroraComponent.prototype.validRequired = function (form, question) {
751
+ //se deja catch por error no controlable en otro tiempo de ejecucion
752
+ try {
753
+ if (question != undefined && question.value != undefined) {
754
+ if (form.controls[question.value] != undefined &&
755
+ form.controls[question.value].errors != null &&
756
+ form.controls[question.value].errors.required) {
757
+ return true;
758
+ }
759
+ }
760
+ }
761
+ catch (error) { }
762
+ return false;
763
+ };
764
+ FormAuroraComponent.prototype.validMinLength = function (form, question) {
765
+ //se deja catch por error no controlable en otro tiempo de ejecucion
766
+ try {
767
+ if (question != undefined && question.value != undefined) {
768
+ if (question.minLength > form.controls[question.value].value.toLocaleString().length && question.minLength > 0) {
769
+ return true;
770
+ }
771
+ }
772
+ }
773
+ catch (error) { }
774
+ return false;
775
+ };
776
+ FormAuroraComponent.prototype.validMaxLength = function (form, question) {
777
+ //se deja catch por error no controlable en otro tiempo de ejecucion
778
+ try {
779
+ if (question != undefined && question.value != undefined) {
780
+ if (question.maxLength > 0) {
781
+ if (question.maxLength + 1 <= form.controls[question.value].value.toString().replace(/\./g, '').length) {
782
+ if (!this.formDynamic.controls[question.value].hasError('errorMaxLength')) {
783
+ this.formDynamic.controls[question.value].setErrors({ 'errorMaxLength': true });
784
+ }
785
+ return true;
786
+ }
787
+ }
788
+ }
789
+ }
790
+ catch (error) { }
791
+ return false;
792
+ };
793
+ FormAuroraComponent.prototype.tycSelection = function (event) {
794
+ this.viewAuthData.emit(event);
795
+ };
796
+ FormAuroraComponent.prototype.openLabelUrl = function (event, question) {
797
+ event.preventDefault();
798
+ var tyc = document.getElementById("check" + question.id);
799
+ tyc.style.color = "#A3AD32";
800
+ window.open(question.urllabel, "_blank");
801
+ };
802
+ FormAuroraComponent.prototype.cancellKeypress = function () {
803
+ return false;
804
+ };
805
+ FormAuroraComponent.prototype.emailRulesValidate = function (formQuestion) {
806
+ var valOk = true;
807
+ try {
808
+ var hasError = false;
809
+ document.getElementById(formQuestion.question.id).setAttribute("hidden", "true");
810
+ var eml = document.getElementById(formQuestion.question.id);
811
+ var email = formQuestion.question.registred;
812
+ if (!hasError) {
813
+ if (formQuestion.question.required && (email == "" || email == undefined || email == null)) {
814
+ eml.style.borderColor = "#FF0000";
815
+ eml.textContent = "El correco eléctronico es requerido";
816
+ eml.removeAttribute("hidden");
817
+ valOk = false;
818
+ hasError = true;
819
+ }
820
+ }
821
+ if (!hasError) {
822
+ if (this.validMinLength(undefined, formQuestion.question)) {
823
+ eml.style.borderColor = "#FF0000";
824
+ eml.textContent = "Debe ser mínimo de " + formQuestion.question.minLength + " caracteres";
825
+ document.getElementById(formQuestion.question.id).removeAttribute("hidden");
826
+ valOk = false;
827
+ hasError = true;
828
+ }
829
+ }
830
+ if (!hasError) {
831
+ if (this.validMaxLength(undefined, formQuestion.question)) {
832
+ eml.style.borderColor = "#FF0000";
833
+ eml.textContent = "Debe ser maximo de " + formQuestion.question.maxLength + " caracteres";
834
+ document.getElementById(formQuestion.question.id).removeAttribute("hidden");
835
+ valOk = false;
836
+ hasError = true;
837
+ }
838
+ }
839
+ if (!hasError) {
840
+ var matches = String(email).match(regexType.email.exp);
841
+ if (matches == null) {
842
+ eml.style.borderColor = "#FF0000";
843
+ eml.textContent = "Tu email es invalido";
844
+ eml.removeAttribute("hidden");
845
+ valOk = false;
846
+ hasError = true;
847
+ }
848
+ }
849
+ }
850
+ catch (error) {
851
+ }
852
+ return valOk;
853
+ };
854
+ FormAuroraComponent.prototype.calendarRulesValidate = function (formQuestion) {
855
+ var hasError = false;
856
+ try {
857
+ document.getElementById(formQuestion.question.id).setAttribute("hidden", "true");
858
+ var ecalendar = document.getElementById(formQuestion.question.id);
859
+ //se valida que no sea null si es requerido
860
+ var date = formQuestion.question.registred;
861
+ if (formQuestion.question.required && (date == "" || date == undefined || date == null)) {
862
+ ecalendar.style.borderColor = "#FF0000";
863
+ ecalendar.textContent = "La fecha es requerida";
864
+ ecalendar.removeAttribute("hidden");
865
+ }
866
+ }
867
+ catch (error) {
868
+ }
869
+ };
870
+ FormAuroraComponent.prototype.validateNotSpace = function (event) {
871
+ if (event.charCode == 32) {
872
+ return false;
873
+ }
874
+ else {
875
+ return true;
876
+ }
877
+ };
878
+ FormAuroraComponent.prototype.validateNumeroDocumento = function (numeroDoc) {
879
+ if (!numeroDoc.match("^[0-9]*$")) {
880
+ this.formDynamic.controls["numeroDoc"].setValidators([Validators.pattern('^[0-9]*$')]);
881
+ this.formDynamic.controls["numeroDoc"].markAsDirty();
882
+ this.formDynamic.controls["numeroDoc"].updateValueAndValidity();
883
+ this.formDynamic.controls["numeroDoc"].markAsTouched();
884
+ this.patternNotValidDcto = true;
885
+ return false;
886
+ }
887
+ this.patternNotValidDcto = false;
888
+ return true;
889
+ };
890
+ FormAuroraComponent.prototype.validateCelular = function (numeroCel) {
891
+ if (!numeroCel.match("^[0-9]*$")) {
892
+ this.formDynamic.controls["celular"].setValidators([Validators.pattern('^[0-9]*$')]);
893
+ this.formDynamic.controls["celular"].markAsDirty();
894
+ this.formDynamic.controls["celular"].updateValueAndValidity();
895
+ this.formDynamic.controls["celular"].markAsTouched();
896
+ this.patternNotValidCel = true;
897
+ return false;
898
+ }
899
+ this.patternNotValidCel = false;
900
+ return true;
901
+ };
902
+ FormAuroraComponent.prototype.onkeypress = function (event) {
903
+ return (event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57;
904
+ };
905
+ FormAuroraComponent.prototype.onChangeStep = function (step, nextStep, value) {
906
+ if (nextStep && nextStep.stepOrder != 1) {
907
+ this.resetField(step);
908
+ nextStep.viewData = [];
909
+ nextStep.viewData = nextStep.stepData.filter(function (x) { return x.relationalIds.includes(Number(value)); });
910
+ }
911
+ };
912
+ FormAuroraComponent.prototype.resetField = function (stepIn) {
913
+ this.steps.forEach(function (step) {
914
+ if (step.stepOrder > stepIn.stepOrder) {
915
+ step.viewData = undefined;
916
+ step.value = undefined;
917
+ }
918
+ });
919
+ };
920
+ FormAuroraComponent.ctorParameters = function () { return [
921
+ { type: CommonDataService },
922
+ { type: HttpClient }
923
+ ]; };
924
+ __decorate([
925
+ Input()
926
+ ], FormAuroraComponent.prototype, "dataClassCss", void 0);
927
+ __decorate([
928
+ Input()
929
+ ], FormAuroraComponent.prototype, "dataForm", void 0);
930
+ __decorate([
931
+ Input()
932
+ ], FormAuroraComponent.prototype, "clickSubmit", void 0);
933
+ __decorate([
934
+ Input()
935
+ ], FormAuroraComponent.prototype, "dataReloadForm", void 0);
936
+ __decorate([
937
+ Input()
938
+ ], FormAuroraComponent.prototype, "welcomeTitle", void 0);
939
+ __decorate([
940
+ Input()
941
+ ], FormAuroraComponent.prototype, "welcomeDescription", void 0);
942
+ __decorate([
943
+ Input()
944
+ ], FormAuroraComponent.prototype, "urlPdf", void 0);
945
+ __decorate([
946
+ Input()
947
+ ], FormAuroraComponent.prototype, "nameCompany", void 0);
948
+ __decorate([
949
+ Input()
950
+ ], FormAuroraComponent.prototype, "schedule", void 0);
951
+ __decorate([
952
+ Input()
953
+ ], FormAuroraComponent.prototype, "isSimpleFlow", void 0);
954
+ __decorate([
955
+ Input()
956
+ ], FormAuroraComponent.prototype, "steps", void 0);
957
+ __decorate([
958
+ ViewChild('formDynamic', { static: true })
959
+ ], FormAuroraComponent.prototype, "formDynamic", void 0);
960
+ __decorate([
961
+ Output()
962
+ ], FormAuroraComponent.prototype, "response", void 0);
963
+ __decorate([
964
+ Output()
965
+ ], FormAuroraComponent.prototype, "summit", void 0);
966
+ __decorate([
967
+ Output()
968
+ ], FormAuroraComponent.prototype, "viewAuthData", void 0);
969
+ FormAuroraComponent = __decorate([
970
+ Component({
971
+ selector: 'lib-FormAurora',
972
+ template: "<div class=\"card\">\n <span class=\"text-center mt-2 d-none d-sm-block\" *ngIf=\"!isSimpleFlow\">\n <img style=\"width: 115px; height:96px;\" [class]=\"dataClassCss.logo\" id=\"logo\">\n </span>\n <div class=\"text-center mt-2 d-none d-sm-block\" *ngIf=\"isSimpleFlow\" style=\"margin-top: 4%!important;\">\n </div>\n <div class=\"card-body pt-0\">\n <ng-container *ngIf=\"schedule\">\n <h4 class=\"card-title text-center mb-0\" [class]=\"dataClassCss.bienvenida2\" style=\"color: #EE7E0E;\">\n Horarios de atenci\u00F3n\n </h4>\n <small class=\"text-center d-block\">{{schedule}}</small>\n </ng-container>\n <form #formDynamic=\"ngForm\">\n <div *ngFor=\"let control of dataForm?.formQuestions; let index = index; trackBy: trackByIndex\">\n <div\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2)) || (index < dataForm.formQuestions.length && dataForm.formQuestions[index].question.questionType.id == 3 && dataForm.formQuestions[index + 1].question.questionType.id == 2); else switchTemp\">\n <div class=\"row\"\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2))\">\n <div class=\"col-lg-6 col-xs-12\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index - 1].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index -\n 1].question.label}}</span>\n </label>\n <div class=\"selectContainer\">\n <select [name]=\"dataForm.formQuestions[index - 1].question.value\"\n [required]=\"dataForm.formQuestions[index - 1].question.required\"\n [class]=\"dataClassCss.formcontrol\"\n id=\"{{dataForm.formQuestions[index - 1].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index - 1].question.registred\">\n <option value=\"\" selected disabled hidden>Selecciona</option>\n <ng-container\n *ngFor=\"let item of dataForm.formQuestions[index - 1].question.questionAnswers\">\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </ng-container>\n </select>\n </div>\n </div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index-1].question.value\"\n hidden></span>\n </div>\n </div>\n <div class=\"col-lg-6 col-xs-12\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\"\n class=\"col-sm-12 p-sm-0 px-sm-1\" style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" pattern=\"\\d*\" inputmode=\"numeric\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keyup)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n onkeypress=\"onkeypress($event)\" onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\" />\n\n </div>\n\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\n Este campo es obligatorio</span>\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser m\u00EDnimo de\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser maximo de\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\n hidden></span>\n <span *ngIf=\"patternNotValidDcto === true\" class=\"error\">Formato no valido</span>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template #switchTemp>\n <div [ngSwitch]=\"dataForm.formQuestions[index].question.questionType.id\">\n <div *ngSwitchCase=\"1\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\" />\n </div>\n </div>\n <div *ngSwitchCase=\"2\">\n\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" pattern=\"\\d*\" inputmode=\"numeric\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n onkeypress=\"onkeypress($event)\" onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\" />\n <span *ngIf=\"patternNotValidCel === true\" class=\"error\">Formato no valido</span>\n </div>\n\n </div>\n <div *ngSwitchCase=\"3\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <select [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [class]=\"dataClassCss.formcontrol\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index].question.registred\">\n <option value=\"\" selected disabled hidden>Selecciona</option>\n <ng-container\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\">\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </ng-container>\n </select>\n </div>\n </div>\n <div *ngSwitchCase=\"4\">\n <select class=\"{{ dataClassCss.formcontrol }} select-checkbox\"\n style=\"overflow: hidden; border-style: hidden;\"\n [style.height.px]=\"dataForm.formQuestions[index].question.questionAnswers.length * 24\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\" ngModel multiple>\n <option (mousemove)=\"$event.preventDefault()\"\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\"\n [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </select>\n </div>\n <div *ngSwitchCase=\"5\">\n <a (click)=\"rediretoutside($event,dataForm.formQuestions[index].question)\" href=\"\">\n <span>{{ dataForm.formQuestions[index].question.label }}</span>\n </a>\n </div>\n <div *ngSwitchCase=\"6\">\n <div [class]=\"dataClassCss.cl12\" [id]=\"'reCaptcha'\">\n <div class=\"cnt-captcha\">\n <re-captcha (resolved)=\"resolvedCaptcha($event)\"\n siteKey=\"6Lf9DcQfAAAAAI6HCNB5OyKUpOPpfl5ocoBJcigZ\"></re-captcha>\n <input hidden type=\"text\" [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\n </div>\n <span class=\"error\" *ngIf=\"watchValid && !captchaValid\" style=\"margin-top: 0;\">\n Debe resolver la captcha para continuar\n </span>\n </div>\n </div>\n <div *ngSwitchCase=\"7\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; margin-bottom: 0 ;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input placeholder=\"dd/mm/aaaa\" style=\"margin-top: -0.4rem !important;\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [name]=\"dataForm.formQuestions[index].question.value\" type=\"date\" min=\"{{minDate}}\"\n max=\"{{maxDate}}\" [maxlength]=\"10\" (paste)=\"false\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.txtCalendar\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n (keydown)=\"cancellKeypress()\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\">\n\n <button class=\"btn\" id=\"{{dataForm.formQuestions[index].question.value}}\" type=\"button\"\n style=\"width: 46px;\n top: 12px;\n color: white;\n right: 15px;\n position: absolute;\n background: #D25D42;\n pointer-events: none;\">\n <i class=\"fa fa-calendar\"></i>\n </button>\n\n </div>\n </div>\n <div *ngSwitchCase=\"8\">\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\n <input\n style=\"width: 4% !important; height: auto !important; display: inline !important;\"\n type=\"checkbox\" [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\">\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\n id=\"txtPoliticas\" (click)=\"tycSelection($event)\">\n {{dataForm.formQuestions[index].question.label}}\n </a>\n </div>\n </div>\n <div *ngSwitchCase=\"9\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keypress)=\"validOnlyText($event)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\" />\n </div>\n </div>\n <div *ngSwitchCase=\"10\">\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\n <input\n style=\"width: 4% !important; height: auto !important; display: inline !important;\"\n type=\"checkbox\" [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\n id=\"check{{dataForm.formQuestions[index].question.id}}\"\n (click)=\"openLabelUrl($event,dataForm.formQuestions[index].question)\">\n {{dataForm.formQuestions[index].question.label}}\n </a>\n </div>\n </div>\n <div *ngSwitchCase=\"11\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keypress)=\"validateNotSpace($event)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\" />\n </div>\n </div>\n <div *ngSwitchDefault>Tipo de control no detectado</div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\n Este campo es obligatorio</span>\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser m\u00EDnimo de\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser maximo de\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\n hidden></span>\n <span class=\"error\" [id]=\"dataForm.formQuestions[index].question.id\" hidden></span>\n </div>\n </div>\n </ng-template>\n </div>\n <section *ngIf=\"isSimpleFlow\">\n <div *ngFor=\"let step of steps let index = index;\">\n <div [class]=\"dataClassCss.cl12\" *ngIf=\"step.viewData\">\n <label for=\"{{step.id}}\" class=\"col-sm-12\" style=\"display: block; text-align: left;\">\n <span class=\"h6 small bg-white text-muted\">{{step.step}}</span>\n </label>\n <select [name]=\"step.step\" [required]=\"true\" [class]=\"dataClassCss.formcontrol\"\n id=\"{{step.step}}\" style=\"margin-top: -1rem !important;\" [(ngModel)]=\"step.value\"\n (ngModelChange)=\"onChangeStep(step,steps[index+1],$event)\">\n <option value=\"\" selected disabled hidden>Selecciona</option>\n <ng-container *ngFor=\"let subitem of step.viewData\">\n <option [value]=\"subitem.id\">\n {{ subitem.description }}\n </option>\n </ng-container>\n </select>\n </div>\n </div>\n </section>\n <div class=\"mt-3 text-center\">\n <button type=\"button\" [class]=\"dataClassCss.btn\" (click)=\"onSubmit()\" [disabled]=\"!formDynamic.valid\"\n id=\"btnIng\">Ingresar</button>\n </div>\n </form>\n </div>\n</div>",
973
+ providers: [
974
+ { provide: NgbDateAdapter, useClass: CustomAdapter },
975
+ { provide: NgbDateParserFormatter, useClass: CustomDateParserFormatter },
976
+ { provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n },
977
+ I18n
978
+ ],
979
+ styles: ["form{font-size:12px;overflow-y:scroll;overflow-x:hidden}form input,form select{border:1px solid #e4e4e4;height:40px;margin-bottom:5px}.selectContainer select{-webkit-appearance:none;-moz-appearance:none;appearance:none}.selectContainer::after{content:\"\\025be\";display:table-cell;text-align:center;padding-top:7px;width:30px;height:30px;position:absolute;top:14px;right:20px;pointer-events:none}form .error{color:red;font-size:12px;text-align:left;margin:-15px 0 15px;padding:0;width:90%}.error:after{content:\" \";display:block}.card{width:90%;margin:2% auto;border-radius:12px}@media (max-width:412px){.card{width:100%}.cnt-captcha{transform:scale(.77)}}@media (max-width:575.98px){.card{width:100%}.cnt-captcha{transform:scale(.77)}}@media (max-width:880.98px){.cnt-captcha{transform:scale(.82)}}input[type=date]::-webkit-calendar-picker-indicator{background:0 0;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:#f5f5f5}::-webkit-scrollbar-thumb{background:#e0e0e0}::-webkit-scrollbar-thumb:hover{background:#bdbdbd}"]
980
+ })
981
+ ], FormAuroraComponent);
982
+ return FormAuroraComponent;
983
+ }());
984
+
985
+ var CommonTemplateService = /** @class */ (function () {
986
+ function CommonTemplateService(http) {
987
+ this.http = http;
988
+ }
989
+ CommonTemplateService.prototype.getTemplate = function (idCompany, url) {
990
+ return this.http.get(url + "/template/findByCompany/" + idCompany);
991
+ };
992
+ CommonTemplateService.prototype.reloadStylePage = function (currentDocument, templateCompany) {
993
+ var e_1, _a;
994
+ var objects = currentDocument.getElementsByClassName("template");
995
+ // debugger
996
+ for (var index = 0; index < objects.length; index++) {
997
+ var item = objects[index];
998
+ var itemClassName = typeof (item.className) == "object" ? item.className['baseVal'] : item.className;
999
+ var indexStart = itemClassName.indexOf("template");
1000
+ // let keyString = itemClassName.substring(indexStart, itemClassName.length).split(' ')[1]
1001
+ var keysString = itemClassName.substring(indexStart, itemClassName.length).split(' ').filter(function (a) { return a.indexOf('tmp_') !== -1; });
1002
+ try {
1003
+ for (var keysString_1 = (e_1 = void 0, __values(keysString)), keysString_1_1 = keysString_1.next(); !keysString_1_1.done; keysString_1_1 = keysString_1.next()) {
1004
+ var keyString = keysString_1_1.value;
1005
+ if (templateCompany[keyString] != undefined) {
1006
+ if (keyString.includes("tmp_type_text_")) {
1007
+ if (keyString.includes('tmp_type_text_6')) {
1008
+ item['style'].setProperty('--' + keyString, templateCompany[keyString].color);
1009
+ }
1010
+ else {
1011
+ item["style"].color = templateCompany[keyString].color;
1012
+ if (itemClassName.includes("ratting-faces-v2")) {
1013
+ item["style"].backgroundColor = templateCompany[keyString].color;
1014
+ item["style"].borderColor = templateCompany[keyString].color;
1015
+ item["style"].color = "white";
1016
+ }
1017
+ }
1018
+ }
1019
+ if (keyString.includes("title1")) {
1020
+ /*item["style"].color = templateCompany[keyString].color*/
1021
+ item["style"].color = "#EE7E0E";
1022
+ }
1023
+ if (keyString.includes("tmp_type_svg_")) {
1024
+ item["style"].fill = templateCompany[keyString].fill;
1025
+ }
1026
+ if (keyString.includes("tmp_type_img_")) {
1027
+ if (item.nodeName == "IMG") {
1028
+ item["src"] = templateCompany[keyString].src;
1029
+ }
1030
+ else {
1031
+ item["style"].background = templateCompany[keyString].background;
1032
+ item["style"].backgroundSize = templateCompany[keyString].backgroundSize;
1033
+ }
1034
+ }
1035
+ if (keyString.includes("tmp_type_head_")) {
1036
+ item["style"].setProperty('--' + keyString, templateCompany[keyString].color);
1037
+ }
1038
+ if (keyString.includes("tmp_type_footer_")) {
1039
+ // debugger
1040
+ item["style"].setProperty('--' + keyString, templateCompany[keyString].color);
1041
+ }
1042
+ if (itemClassName.includes("tmp_type_cnt_")) {
1043
+ indexStart = itemClassName.indexOf("tmp_type_cnt_");
1044
+ keyString = itemClassName.substring(indexStart, itemClassName.length).split(' ')[0];
1045
+ if (!!templateCompany[keyString]) {
1046
+ item["style"].backgroundColor = templateCompany[keyString].backgroundColor;
1047
+ }
1048
+ }
1049
+ if (keyString.includes('tmp_type_font_')) {
1050
+ item['style'].setProperty('font-family', templateCompany[keyString]['font-family'], 'important');
1051
+ }
1052
+ }
1053
+ }
1054
+ }
1055
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1056
+ finally {
1057
+ try {
1058
+ if (keysString_1_1 && !keysString_1_1.done && (_a = keysString_1.return)) _a.call(keysString_1);
1059
+ }
1060
+ finally { if (e_1) throw e_1.error; }
1061
+ }
1062
+ }
1063
+ };
1064
+ CommonTemplateService.ctorParameters = function () { return [
1065
+ { type: HttpClient }
1066
+ ]; };
1067
+ CommonTemplateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonTemplateService_Factory() { return new CommonTemplateService(ɵɵinject(HttpClient)); }, token: CommonTemplateService, providedIn: "root" });
1068
+ CommonTemplateService = __decorate([
1069
+ Injectable({
1070
+ providedIn: "root",
1071
+ })
1072
+ ], CommonTemplateService);
1073
+ return CommonTemplateService;
950
1074
  }());
951
1075
 
952
- var Fill = /** @class */ (function () {
953
- function Fill() {
954
- }
955
- return Fill;
1076
+ var Fill = /** @class */ (function () {
1077
+ function Fill() {
1078
+ }
1079
+ return Fill;
956
1080
  }());
957
1081
 
958
- var FormAuroraModule = /** @class */ (function () {
959
- function FormAuroraModule() {
960
- }
961
- FormAuroraModule = __decorate([
962
- NgModule({
963
- declarations: [FormAuroraComponent],
964
- imports: [
965
- CommonModule,
966
- FormsModule,
967
- RecaptchaModule,
968
- RecaptchaFormsModule
969
- ],
970
- exports: [FormAuroraComponent]
971
- })
972
- ], FormAuroraModule);
973
- return FormAuroraModule;
1082
+ var FormAuroraModule = /** @class */ (function () {
1083
+ function FormAuroraModule() {
1084
+ }
1085
+ FormAuroraModule = __decorate([
1086
+ NgModule({
1087
+ declarations: [FormAuroraComponent],
1088
+ imports: [
1089
+ CommonModule,
1090
+ FormsModule,
1091
+ RecaptchaModule,
1092
+ RecaptchaFormsModule
1093
+ ],
1094
+ exports: [FormAuroraComponent]
1095
+ })
1096
+ ], FormAuroraModule);
1097
+ return FormAuroraModule;
974
1098
  }());
975
1099
 
976
- /*
977
- * Public API Surface of form-aurora
1100
+ /*
1101
+ * Public API Surface of form-aurora
978
1102
  */
979
1103
 
980
- /**
981
- * Generated bundle index. Do not edit.
1104
+ /**
1105
+ * Generated bundle index. Do not edit.
982
1106
  */
983
1107
 
984
1108
  export { CommonDataService, CommonTemplateService, CustomAdapter, CustomDateParserFormatter, CustomDatepickerI18n, Fill, FormAuroraComponent, FormAuroraModule, I18n, regexType };