kwikid-forms 0.6.43 → 0.6.44

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 (59) hide show
  1. package/bundles/kwikid-forms.umd.js +1010 -829
  2. package/bundles/kwikid-forms.umd.js.map +1 -1
  3. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.component.js +22 -32
  4. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.definitions.js +2 -1
  5. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.helper.js +2 -4
  6. package/esm2015/lib/builder/builder-form-editor/builder.form-editor.constants.js +5 -5
  7. package/esm2015/lib/builder/builder-form-editor/builder.form-editor.service.js +6 -5
  8. package/esm2015/lib/builder/builder-form-list/builder-forms-list.component.js +4 -6
  9. package/esm2015/lib/builder/builder.component.js +43 -53
  10. package/esm2015/lib/builder/builder.helper.js +11 -13
  11. package/esm2015/lib/renderer/config-converter/config-converter.constants.js +22 -7
  12. package/esm2015/lib/renderer/config-converter/config-converter.helper.js +9 -10
  13. package/esm2015/lib/renderer/config-converter/config-converter.js +57 -37
  14. package/esm2015/lib/renderer/form-view/definitions/form-view.actions.definition.js +1 -1
  15. package/esm2015/lib/renderer/form-view/definitions/form-view.apis.definition.js +1 -1
  16. package/esm2015/lib/renderer/form-view/definitions/form-view.commons.definition.js +2 -1
  17. package/esm2015/lib/renderer/form-view/definitions/form-view.fields.definition.js +2 -1
  18. package/esm2015/lib/renderer/form-view/definitions/form-view.logs.definition.js +2 -1
  19. package/esm2015/lib/renderer/form-view/form-view.api.service.js +25 -24
  20. package/esm2015/lib/renderer/form-view/form-view.component.js +451 -287
  21. package/esm2015/lib/renderer/form-view/form-view.constants.js +17 -0
  22. package/esm2015/lib/renderer/form-view/form-view.module.js +15 -3
  23. package/esm2015/lib/renderer/form-view/form-view.service.js +6 -7
  24. package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +44 -58
  25. package/esm2015/lib/renderer/form-view/helpers/form-view.camera.helper.js +16 -20
  26. package/esm2015/lib/renderer/form-view/helpers/form-view.defaults.helper.js +36 -97
  27. package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +95 -92
  28. package/esm2015/lib/renderer/form-view/helpers/form-view.form-validations.helper.js +23 -22
  29. package/esm2015/lib/renderer/form-view/helpers/form-view.tasks.helper.js +5 -5
  30. package/esm2015/lib/renderer/form-view/pipes/filter-image-url-or-base64-from-object.pipe.js +34 -0
  31. package/esm2015/lib/renderer/form-view/pipes/filter-video-url-or-base64-from-object.pipe.js +30 -0
  32. package/esm2015/lib/renderer/forms-list/forms-list.component.js +31 -39
  33. package/esm2015/lib/renderer/forms-list/forms-list.definitions.js +2 -1
  34. package/esm2015/lib/renderer/renderer.actions.definitions.js +1 -1
  35. package/esm2015/lib/renderer/renderer.component.js +87 -113
  36. package/esm2015/lib/renderer/renderer.definitions.js +2 -1
  37. package/esm2015/lib/renderer/renderer.helper.js +2 -4
  38. package/fesm2015/kwikid-forms.js +1054 -917
  39. package/fesm2015/kwikid-forms.js.map +1 -1
  40. package/lib/builder/builder-form-editor/builder-form-editor.component.d.ts +4 -5
  41. package/lib/builder/builder-form-editor/builder.form-editor.service.d.ts +0 -1
  42. package/lib/builder/builder-form-list/builder-forms-list.component.d.ts +3 -5
  43. package/lib/renderer/config-converter/config-converter.constants.d.ts +21 -6
  44. package/lib/renderer/config-converter/config-converter.helper.d.ts +1 -0
  45. package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +45 -25
  46. package/lib/renderer/form-view/form-view.api.service.d.ts +0 -1
  47. package/lib/renderer/form-view/form-view.component.d.ts +13 -13
  48. package/lib/renderer/form-view/form-view.constants.d.ts +16 -0
  49. package/lib/renderer/form-view/form-view.module.d.ts +10 -8
  50. package/lib/renderer/form-view/form-view.service.d.ts +1 -2
  51. package/lib/renderer/form-view/helpers/form-view.camera.helper.d.ts +5 -7
  52. package/lib/renderer/form-view/helpers/form-view.defaults.helper.d.ts +4 -6
  53. package/lib/renderer/form-view/helpers/form-view.fields.helper.d.ts +1 -1
  54. package/lib/renderer/form-view/helpers/form-view.form-validations.helper.d.ts +1 -2
  55. package/lib/renderer/form-view/helpers/form-view.tasks.helper.d.ts +1 -1
  56. package/lib/renderer/form-view/pipes/filter-image-url-or-base64-from-object.pipe.d.ts +7 -0
  57. package/lib/renderer/form-view/pipes/filter-video-url-or-base64-from-object.pipe.d.ts +7 -0
  58. package/lib/renderer/forms-list/forms-list.component.d.ts +1 -2
  59. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __awaiter } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
3
  import { EventEmitter, Component, Input, Output, ChangeDetectionStrategy, Pipe, Inject, ViewChild, ViewChildren, HostListener, NgModule } from '@angular/core';
4
- import { checkObjectKeyExists, setValueToObjectPath, isEmptyValue, getObjectDeepCopy, logMethod, isNotEmptyValue, setMissingKeyValue, isObject, mergeObjects, checkObjectPathExists, getObjectValueFromPath, getObjectFromLocalStorage, encryptWithAES, decryptWithAES, Rule, Condition, Action, Source, PATTERNS, hasWhitespacesOnly, RuleEngine, mergeObjectsDeep, ESourceKey, replaceString, isUndefined, isNull, isEmptyString } from 'kwikid-toolkit';
4
+ import { checkObjectKeyExists, setValueToObjectPath, isEmptyValue, getObjectDeepCopy, logMethod, isNotEmptyValue, setMissingKeyValue, isObject, mergeObjects, checkObjectPathExists, getObjectValueFromPath, getObjectFromLocalStorage, encryptWithAES, decryptWithAES, Rule, Condition, Action, Source, hasWhitespacesOnly, PATTERNS, RuleEngine, mergeObjectsDeep, ESourceKey, replaceString, isUndefined, isNull, isEmptyString } from 'kwikid-toolkit';
5
5
  import * as i3 from 'kwikui';
6
6
  import { KwikUIModule, KwikUIPipeModule, KwikUIInputEmailModule } from 'kwikui';
7
7
  import * as i3$1 from '@angular/forms';
@@ -32,19 +32,19 @@ function convertFormListConfig(formsList) {
32
32
  if (checkObjectKeyExists(form, "formContent")) {
33
33
  if (checkObjectKeyExists(form.formContent, "url")) {
34
34
  form = setValueToObjectPath(form, "props.url", form.formContent.url);
35
- delete form["formContent"]["url"];
35
+ delete form.formContent.url;
36
36
  }
37
37
  if (checkObjectKeyExists(form.formContent, "path")) {
38
38
  form = setValueToObjectPath(form, "props.path", form.formContent.path);
39
- delete form["formContent"]["path"];
39
+ delete form.formContent.path;
40
40
  }
41
41
  }
42
42
  if (isEmptyValue(form.formContent)) {
43
- delete form["formContent"];
43
+ delete form.formContent;
44
44
  }
45
45
  if (checkObjectKeyExists(form, "title")) {
46
46
  form = setValueToObjectPath(form, "props.title", form.title);
47
- delete form["title"];
47
+ delete form.title;
48
48
  }
49
49
  if (!checkObjectKeyExists(form, "hidden")) {
50
50
  form.hidden = false;
@@ -70,18 +70,16 @@ function convertFormListConfig(formsList) {
70
70
  htmlContent: form.htmlContent
71
71
  };
72
72
  }
73
- delete form["htmlContent"];
73
+ delete form.htmlContent;
74
74
  }
75
- else {
76
- if (!checkObjectKeyExists(form, "props")) {
77
- form.props = {
78
- htmlContent: ""
79
- };
80
- }
75
+ else if (!checkObjectKeyExists(form, "props")) {
76
+ form.props = {
77
+ htmlContent: ""
78
+ };
81
79
  }
82
80
  if (checkObjectKeyExists(form, "title")) {
83
81
  form = setValueToObjectPath(form, "props.title", form.title);
84
- delete form["title"];
82
+ delete form.title;
85
83
  }
86
84
  if (!checkObjectKeyExists(form, "hidden")) {
87
85
  form.hidden = false;
@@ -116,10 +114,9 @@ class KwikIDBuilderFormsListComponent {
116
114
  title: new FormControl("", Validators.required)
117
115
  });
118
116
  }
119
- setSelectedForm(selected_form) {
120
- this.selectedForm = selected_form;
117
+ setSelectedForm(selectedForm) {
118
+ this.selectedForm = selectedForm;
121
119
  }
122
- ngOnInit() { }
123
120
  ngOnChanges(changes) {
124
121
  const verifyChange = (key) => {
125
122
  return checkObjectKeyExists(changes, key) && !changes[key].firstChange;
@@ -140,7 +137,6 @@ class KwikIDBuilderFormsListComponent {
140
137
  handleOnClickAddForm() {
141
138
  if (this.addForm.invalid) {
142
139
  alert("Please fill all the fields");
143
- return;
144
140
  }
145
141
  else {
146
142
  if (isEmptyValue(this.activeFormConfig)) {
@@ -182,7 +178,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
182
178
  templateUrl: "./builder-forms-list.component.html",
183
179
  styleUrls: ["../shared.scss", "./builder-forms-list.component.scss"]
184
180
  }]
185
- }], ctorParameters: function () { return []; }, propDecorators: { activeFormConfig: [{
181
+ }], propDecorators: { activeFormConfig: [{
186
182
  type: Input
187
183
  }], formsList: [{
188
184
  type: Input
@@ -221,6 +217,7 @@ var EFieldType;
221
217
  EFieldType["RECORD"] = "record";
222
218
  EFieldType["STAR_RATING"] = "star-rating";
223
219
  EFieldType["LIVE_LOCATION"] = "live-location";
220
+ EFieldType["DATA_HOLDER"] = "data-holder";
224
221
  EFieldType["CURRENCY"] = "currency";
225
222
  })(EFieldType || (EFieldType = {}));
226
223
 
@@ -369,14 +366,31 @@ const FIELD_PROPERTIES = {
369
366
  uploadFileToServer: true
370
367
  },
371
368
  capture: {
372
- containerStyles: "",
373
369
  buttonText: "Camera",
370
+ containerStyles: "",
374
371
  icon: "tuiIconCameraLarge",
375
- showMediaFiles: true,
376
- uploadFileToServer: false,
377
372
  isCroppedImage: false,
378
373
  isMaskedImage: false,
379
- watermarkDataSources: [],
374
+ showMediaFiles: true,
375
+ uploadFileToServer: false,
376
+ features: {
377
+ ocr: {
378
+ isEnabled: false,
379
+ documentType: "",
380
+ documentSide: "",
381
+ isOcrFromServer: false
382
+ },
383
+ facematch: {
384
+ isEnabled: false,
385
+ isFacematchFromServer: false,
386
+ sources: []
387
+ },
388
+ watermark: {
389
+ isEnabled: false,
390
+ isWatermarkFromServer: false,
391
+ sources: []
392
+ }
393
+ },
380
394
  cameraConfig: {
381
395
  header: {
382
396
  title: "Camera",
@@ -391,8 +405,6 @@ const FIELD_PROPERTIES = {
391
405
  },
392
406
  others: {
393
407
  isFrontCamera: false,
394
- isWatermark: false,
395
- isWatermarkForImageUpload: false,
396
408
  flipHorizontal: false,
397
409
  mask: {
398
410
  shape: ""
@@ -471,16 +483,10 @@ const FIELD_PROPERTIES = {
471
483
  };
472
484
 
473
485
  const getFormFieldByKey = (fields, key) => {
474
- const field = fields.find((field) => {
475
- if (field.key === key) {
476
- return field;
477
- }
478
- });
479
- return field;
486
+ return fields.find((field) => field.key === key);
480
487
  };
481
488
  const getFormFieldIndexByKey = (fields, key) => {
482
- let fieldIndex;
483
- fieldIndex = fields.findIndex((_) => {
489
+ const fieldIndex = fields.findIndex((_) => {
484
490
  return key === _.key;
485
491
  });
486
492
  return fieldIndex;
@@ -506,17 +512,17 @@ const appendFormFieldMessage = (field, message) => {
506
512
  fieldMessage.message === message.message);
507
513
  });
508
514
  };
509
- field["messages"] = [];
515
+ field.messages = [];
510
516
  if (checkObjectKeyExists(field, "messages")) {
511
- if (!hasDuplicateMessage(field["messages"], message)) {
512
- field["messages"].push({
517
+ if (!hasDuplicateMessage(field.messages, message)) {
518
+ field.messages.push({
513
519
  type: message.type,
514
520
  message: message.message
515
521
  });
516
522
  }
517
523
  }
518
524
  else {
519
- field["messages"] = [{ type: message.type, message: message.message }];
525
+ field.messages = [{ type: message.type, message: message.message }];
520
526
  }
521
527
  return field;
522
528
  };
@@ -543,21 +549,21 @@ const filterDuplicatesFiles = (array) => {
543
549
  };
544
550
  const removeFormFieldMessage = (field, message) => {
545
551
  if (isNotEmptyValue(field === null || field === void 0 ? void 0 : field.messages)) {
546
- field["messages"] = field["messages"].filter(function (fieldMessage) {
552
+ field.messages = field.messages.filter((fieldMessage) => {
547
553
  return fieldMessage.type !== message.type;
548
554
  });
549
555
  }
550
556
  else {
551
- field["messages"] = [];
557
+ field.messages = [];
552
558
  }
553
559
  return field;
554
560
  };
555
561
  const setApiTimerMessage = (field, timer = {}) => {
556
562
  if (checkObjectKeyExists(field, "api")) {
557
- field["api"]["timer"] = timer;
563
+ field.api.timer = timer;
558
564
  }
559
565
  else {
560
- setMissingKeyValue(field, "api", { timer: timer });
566
+ setMissingKeyValue(field, "api", { timer });
561
567
  }
562
568
  return field;
563
569
  };
@@ -614,7 +620,7 @@ function showFormFieldError(fields, errors, key, error) {
614
620
  fields[fieldIndex] = setErrorMessages(fields[fieldIndex], errors);
615
621
  }
616
622
  else {
617
- fields[fieldIndex]["messages"] = [];
623
+ fields[fieldIndex].messages = [];
618
624
  }
619
625
  fields[fieldIndex] = highlightFormFieldError(fields[fieldIndex], error);
620
626
  return fields;
@@ -629,37 +635,35 @@ const convertFormFieldTypeDateToKwikUIFormat = (date) => {
629
635
  };
630
636
  const convertFormFieldTypeTimeToKwikUIFormat = (time) => {
631
637
  const timeParts = time.split(/[.:]/);
632
- let hours = 0, minutes = 0, seconds = 0, milliseconds = 0;
638
+ let hours = 0;
639
+ let minutes = 0;
640
+ let seconds = 0;
641
+ let milliseconds = 0;
633
642
  if (timeParts.length >= 2) {
634
- hours = parseInt(timeParts[0]);
635
- minutes = parseInt(timeParts[1]);
643
+ hours = parseInt(timeParts[0], 10);
644
+ minutes = parseInt(timeParts[1], 10);
636
645
  if (timeParts.length >= 3) {
637
- seconds = parseInt(timeParts[2]);
646
+ seconds = parseInt(timeParts[2], 10);
638
647
  if (timeParts.length === 4) {
639
- milliseconds = parseInt(timeParts[3]);
648
+ milliseconds = parseInt(timeParts[3], 10);
640
649
  }
641
650
  }
642
651
  }
643
- let tuiTime = new TuiTime(hours, minutes, seconds, milliseconds);
652
+ const tuiTime = new TuiTime(hours, minutes, seconds, milliseconds);
644
653
  return tuiTime;
645
654
  };
646
655
  const convertFormFieldTypeDateToStandardFormat = (date) => {
647
- let formattedDate;
648
- let year = date.year;
649
- let month = date.month;
650
- let day = date.day;
651
- formattedDate = `${day.toString().padStart(2, "0")}-${(month + 1)
656
+ const { day, month, year } = date;
657
+ const formattedDate = `${day.toString().padStart(2, "0")}-${(month + 1)
652
658
  .toString()
653
659
  .padStart(2, "0")}-${year}`;
654
660
  return formattedDate;
655
661
  };
656
662
  const convertFormFieldTypeTimeToStandardFormat = (time) => {
657
- let formattedDate;
658
- let hour = time.hours;
659
- let minutes = time.minutes;
660
- let seconds = time.seconds;
661
- let milliseconds = time.ms;
662
- formattedDate = `${hour.toString().padStart(2, "0")}:${minutes
663
+ const hour = time.hours;
664
+ const { seconds, minutes } = time;
665
+ const milliseconds = time.ms;
666
+ const formattedDate = `${hour.toString().padStart(2, "0")}:${minutes
663
667
  .toString()
664
668
  .padStart(2, "0")}${seconds > 0 ? `:${seconds.toString().padStart(2, "0")}` : ""}${seconds > 0 && milliseconds > 0
665
669
  ? `:${milliseconds.toString().padStart(2, "0")}`
@@ -685,23 +689,23 @@ const convertFormFieldValueToStandardFormat = (field, value) => {
685
689
  break;
686
690
  case EFieldType.SELECT:
687
691
  if (Array.isArray(field.options)) {
688
- field.options.find((item) => {
689
- if (isObject(item)) {
690
- if (item.title == value) {
691
- convertedValue = item.value;
692
- }
693
- }
692
+ const foundItem = field.options.find((item) => {
693
+ return isObject(item) && item.title === value;
694
694
  });
695
+ if (foundItem) {
696
+ convertedValue = foundItem.value;
697
+ }
695
698
  }
696
699
  break;
697
- case EFieldType.PHONE:
698
- let phoneField = field;
700
+ case EFieldType.PHONE: {
701
+ const phoneField = field;
699
702
  if (phoneField.properties.removeCountryCodeFromValue) {
700
703
  convertedValue = value
701
704
  .toString()
702
705
  .replace(phoneField.properties.countryCode, "");
703
706
  }
704
707
  break;
708
+ }
705
709
  case EFieldType.CAPTURE:
706
710
  if (Array.isArray(value) && isNotEmptyValue(value[0])) {
707
711
  convertedValue = value[0];
@@ -729,6 +733,40 @@ const convertFormFieldValueToStandardFormat = (field, value) => {
729
733
  }
730
734
  return convertedValue;
731
735
  };
736
+ const convertFormFieldEmptyValueToKwikUIFormat = (field) => {
737
+ const fieldType = field.type;
738
+ let value;
739
+ switch (fieldType) {
740
+ case EFieldType.CHECKBOX:
741
+ value = false;
742
+ break;
743
+ case EFieldType.NUMBER:
744
+ value = null;
745
+ break;
746
+ case EFieldType.DATE:
747
+ value = null;
748
+ break;
749
+ case EFieldType.FILE:
750
+ value = [];
751
+ break;
752
+ case EFieldType.CAPTURE:
753
+ value = [];
754
+ break;
755
+ case EFieldType.RECORD:
756
+ value = [];
757
+ break;
758
+ case EFieldType.SELECT:
759
+ value = null;
760
+ break;
761
+ case EFieldType.DROPDOWN_WITH_SEARCH:
762
+ value = null;
763
+ break;
764
+ default:
765
+ value = "";
766
+ break;
767
+ }
768
+ return value;
769
+ };
732
770
  const convertFormFieldValueToKwikUIFormat = (field, value) => {
733
771
  let convertedValue = value;
734
772
  if (isNotEmptyValue(value)) {
@@ -744,13 +782,12 @@ const convertFormFieldValueToKwikUIFormat = (field, value) => {
744
782
  break;
745
783
  case EFieldType.SELECT:
746
784
  if (Array.isArray(field.options)) {
747
- field.options.find((item) => {
748
- if (isObject(item)) {
749
- if (item.value == value) {
750
- convertedValue = item.title;
751
- }
752
- }
785
+ const foundItem = field.options.find((item) => {
786
+ return isObject(item) && item.value === value;
753
787
  });
788
+ if (foundItem) {
789
+ convertedValue = foundItem.title;
790
+ }
754
791
  }
755
792
  break;
756
793
  case EFieldType.DATE:
@@ -763,25 +800,37 @@ const convertFormFieldValueToKwikUIFormat = (field, value) => {
763
800
  convertedValue = value;
764
801
  break;
765
802
  case EFieldType.CAPTURE:
766
- if (typeof value === "string") {
803
+ if (Array.isArray(value)) {
804
+ convertedValue = value.filter((item) => {
805
+ return (typeof item === "string" ||
806
+ (isObject(item) && checkObjectKeyExists(item, "image")));
807
+ });
808
+ }
809
+ else if (typeof value === "string") {
767
810
  convertedValue = [value];
768
811
  }
769
- else if (!Array.isArray(value)) {
770
- convertedValue = [];
812
+ else if (isObject(value) && checkObjectKeyExists(value, "image")) {
813
+ convertedValue = [value];
771
814
  }
772
815
  else {
773
- convertedValue = value;
816
+ convertedValue = [];
774
817
  }
775
818
  break;
776
819
  case EFieldType.RECORD:
777
- if (typeof value === "string") {
820
+ if (Array.isArray(value)) {
821
+ convertedValue = value.filter((item) => {
822
+ return (typeof item === "string" ||
823
+ (isObject(item) && checkObjectKeyExists(item, "video")));
824
+ });
825
+ }
826
+ else if (typeof value === "string") {
778
827
  convertedValue = [value];
779
828
  }
780
- else if (!Array.isArray(value)) {
781
- convertedValue = [];
829
+ else if (isObject(value) && checkObjectKeyExists(value, "video")) {
830
+ convertedValue = [value];
782
831
  }
783
832
  else {
784
- convertedValue = value;
833
+ convertedValue = [];
785
834
  }
786
835
  break;
787
836
  default:
@@ -793,40 +842,6 @@ const convertFormFieldValueToKwikUIFormat = (field, value) => {
793
842
  }
794
843
  return convertedValue;
795
844
  };
796
- const convertFormFieldEmptyValueToKwikUIFormat = (field) => {
797
- const fieldType = field.type;
798
- let value;
799
- switch (fieldType) {
800
- case EFieldType.CHECKBOX:
801
- value = false;
802
- break;
803
- case EFieldType.NUMBER:
804
- value = null;
805
- break;
806
- case EFieldType.DATE:
807
- value = null;
808
- break;
809
- case EFieldType.FILE:
810
- value = [];
811
- break;
812
- case EFieldType.CAPTURE:
813
- value = [];
814
- break;
815
- case EFieldType.RECORD:
816
- value = [];
817
- break;
818
- case EFieldType.SELECT:
819
- value = null;
820
- break;
821
- case EFieldType.DROPDOWN_WITH_SEARCH:
822
- value = null;
823
- break;
824
- default:
825
- value = "";
826
- break;
827
- }
828
- return value;
829
- };
830
845
 
831
846
  const getFormFields = (formConfig) => {
832
847
  let fields = [];
@@ -851,6 +866,9 @@ const setFieldKeyValue = (field, key, value) => {
851
866
  const setFieldKeyHidden = (field) => {
852
867
  return setMissingFieldKeyValue(field, "hidden", false);
853
868
  };
869
+ const setFieldKeyDisabled = (field) => {
870
+ return setMissingFieldKeyValue(field, "disabled", true);
871
+ };
854
872
  const setFieldAsFormElement = (field, value) => {
855
873
  return setFieldKeyValue(field, "isFormElement", value);
856
874
  };
@@ -860,11 +878,9 @@ const getMinDate = (field) => {
860
878
  * This is to handler old version of config.
861
879
  * Please don't add "min" at field level, add it insider field.properties only.
862
880
  */
863
- return convertFormFieldTypeDateToKwikUIFormat(field["min"]);
864
- }
865
- else {
866
- return {};
881
+ return convertFormFieldTypeDateToKwikUIFormat(field.min);
867
882
  }
883
+ return {};
868
884
  };
869
885
  const getMaxDate = (field) => {
870
886
  if (checkObjectKeyExists(field, "max")) {
@@ -872,11 +888,9 @@ const getMaxDate = (field) => {
872
888
  * This is to handler old version of config.
873
889
  * Please don't add "max" at field level, add it insider field.properties only.
874
890
  */
875
- return convertFormFieldTypeDateToKwikUIFormat(field["max"]);
876
- }
877
- else {
878
- return {};
891
+ return convertFormFieldTypeDateToKwikUIFormat(field.max);
879
892
  }
893
+ return {};
880
894
  };
881
895
  const updateLanguage = (object, language) => {
882
896
  if (isObject(object)) {
@@ -884,7 +898,7 @@ const updateLanguage = (object, language) => {
884
898
  object = object[language];
885
899
  }
886
900
  else {
887
- object = object["en"];
901
+ object = object.en;
888
902
  }
889
903
  }
890
904
  return object;
@@ -1085,20 +1099,18 @@ class Converter {
1085
1099
  if (typeof x === "string" || typeof x === "number") {
1086
1100
  return { label: x, disabled: false, description: "" };
1087
1101
  }
1088
- else {
1089
- if (checkObjectKeyExists(x, "label") &&
1090
- checkObjectKeyExists(x, "disabled") &&
1091
- checkObjectKeyExists(x, "description")) {
1092
- return x;
1093
- }
1094
- if (!checkObjectKeyExists(x, "disabled")) {
1095
- x = Object.assign(Object.assign({}, x), { disabled: false });
1096
- }
1097
- if (!checkObjectKeyExists(x, "description")) {
1098
- x = Object.assign(Object.assign({}, x), { description: false });
1099
- }
1102
+ if (checkObjectKeyExists(x, "label") &&
1103
+ checkObjectKeyExists(x, "disabled") &&
1104
+ checkObjectKeyExists(x, "description")) {
1100
1105
  return x;
1101
1106
  }
1107
+ if (!checkObjectKeyExists(x, "disabled")) {
1108
+ x = Object.assign(Object.assign({}, x), { disabled: false });
1109
+ }
1110
+ if (!checkObjectKeyExists(x, "description")) {
1111
+ x = Object.assign(Object.assign({}, x), { description: false });
1112
+ }
1113
+ return x;
1102
1114
  });
1103
1115
  return field;
1104
1116
  };
@@ -1185,6 +1197,13 @@ class Converter {
1185
1197
  }
1186
1198
  return field;
1187
1199
  };
1200
+ const formatFieldTypeDataHolder = (field) => {
1201
+ field = setFieldKeyHidden(field);
1202
+ field = setFieldKeyDisabled(field);
1203
+ field = setFieldAsFormElement(field, true);
1204
+ field = updateFormFieldProperties(field);
1205
+ return field;
1206
+ };
1188
1207
  const formatFieldTypeOtp = (field) => {
1189
1208
  var _a, _b;
1190
1209
  field = setFieldKeyHidden(field);
@@ -1209,9 +1228,18 @@ class Converter {
1209
1228
  return field;
1210
1229
  };
1211
1230
  const formatFieldTypeCapture = (field) => {
1231
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1212
1232
  field = setFieldKeyHidden(field);
1213
1233
  field = setFieldAsFormElement(field, true);
1214
1234
  field = updateFormFieldProperties(field);
1235
+ field.properties = getObjectDeepCopy(Object.assign(Object.assign({}, field.properties), { features: Object.assign(Object.assign({}, field.properties.features), { watermark: {
1236
+ isEnabled: (_d = (_c = (_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.cameraConfig) === null || _b === void 0 ? void 0 : _b.others) === null || _c === void 0 ? void 0 : _c.isWatermark) !== null && _d !== void 0 ? _d : field.properties.features.watermark.isWatermark,
1237
+ isWatermarkFromServer: (_h = (_g = (_f = (_e = field === null || field === void 0 ? void 0 : field.properties) === null || _e === void 0 ? void 0 : _e.cameraConfig) === null || _f === void 0 ? void 0 : _f.others) === null || _g === void 0 ? void 0 : _g.isWatermarkForServer) !== null && _h !== void 0 ? _h : field.properties.features.watermark.isWatermarkFromServer,
1238
+ sources: (_k = (_j = field === null || field === void 0 ? void 0 : field.properties) === null || _j === void 0 ? void 0 : _j.watermarkDataSources) !== null && _k !== void 0 ? _k : field.properties.features.watermark.sources
1239
+ } }) }));
1240
+ delete field.properties.watermarkDataSources;
1241
+ delete field.properties.cameraConfig.others.isWatermark;
1242
+ delete field.properties.cameraConfig.others.isWatermarkForImageUpload;
1215
1243
  return field;
1216
1244
  };
1217
1245
  const formatFieldTypeRecord = (field) => {
@@ -1288,11 +1316,11 @@ class Converter {
1288
1316
  case EFieldType.LIVE_LOCATION:
1289
1317
  field = formatFieldTypeLiveLocation(field);
1290
1318
  break;
1319
+ case EFieldType.DATA_HOLDER:
1320
+ field = formatFieldTypeDataHolder(field);
1321
+ break;
1291
1322
  case EFieldType.API:
1292
1323
  field = formatFieldTypeApi(field);
1293
- case EFieldType.LIVE_LOCATION:
1294
- field = formatFieldTypeLiveLocation(field);
1295
- break;
1296
1324
  break;
1297
1325
  case EFieldType.OTP:
1298
1326
  field = formatFieldTypeOtp(field);
@@ -1327,7 +1355,7 @@ class Converter {
1327
1355
  ? field.validators
1328
1356
  : {};
1329
1357
  field = setMissingFieldKeyValue(field, "validators", {});
1330
- field = setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field["validators"]), { min: checkObjectKeyExists(validators, "min")
1358
+ field = setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field.validators), { min: checkObjectKeyExists(validators, "min")
1331
1359
  ? isNotEmptyValue(validators.min)
1332
1360
  ? Number(validators.min)
1333
1361
  : null
@@ -1379,6 +1407,10 @@ class Converter {
1379
1407
  delete field.validators.min;
1380
1408
  delete field.validators.max;
1381
1409
  break;
1410
+ case EFieldType.DATA_HOLDER:
1411
+ delete field.validators.min;
1412
+ delete field.validators.max;
1413
+ break;
1382
1414
  case EFieldType.CHECKBOX:
1383
1415
  delete field.validators.min;
1384
1416
  delete field.validators.max;
@@ -1438,18 +1470,18 @@ class Converter {
1438
1470
  if (checkObjectKeyExists(field, "defaultValue")) {
1439
1471
  return field;
1440
1472
  }
1441
- else if (checkObjectPathExists(field, "default.value.sources")) {
1473
+ if (checkObjectPathExists(field, "default.value.sources")) {
1442
1474
  return field;
1443
1475
  }
1444
- else if (checkObjectPathExists(field, "default.value.rules") &&
1476
+ if (checkObjectPathExists(field, "default.value.rules") &&
1445
1477
  checkObjectPathExists(field, "default.value.actions")) {
1446
1478
  return field;
1447
1479
  }
1448
- else if (checkObjectPathExists(field, "default.value.value") &&
1480
+ if (checkObjectPathExists(field, "default.value.value") &&
1449
1481
  isNotEmptyValue(field.default.value.value)) {
1450
1482
  return field;
1451
1483
  }
1452
- else if (!checkObjectPathExists(field, "default.value.sources")) {
1484
+ if (!checkObjectPathExists(field, "default.value.sources")) {
1453
1485
  const defaultValue = {
1454
1486
  value: "",
1455
1487
  triggers: ["ON_INIT"],
@@ -1478,8 +1510,8 @@ class Converter {
1478
1510
  field = setValueToObjectPath(field, "default.value", defaultValue);
1479
1511
  return field;
1480
1512
  }
1481
- delete field["defaultVal"];
1482
- delete field["defaultValue"];
1513
+ delete field.defaultVal;
1514
+ delete field.defaultValue;
1483
1515
  }
1484
1516
  return field;
1485
1517
  };
@@ -1507,21 +1539,21 @@ class Converter {
1507
1539
  };
1508
1540
  const setFormFields = (formConfig, fields) => {
1509
1541
  if (checkObjectKeyExists(formConfig, "multiForm")) {
1510
- formConfig.multiForm["fields"] = fields;
1542
+ formConfig.multiForm.fields = fields;
1511
1543
  }
1512
1544
  else {
1513
- formConfig["fields"] = fields;
1545
+ formConfig.fields = fields;
1514
1546
  }
1515
1547
  return formConfig;
1516
1548
  };
1517
1549
  const setFormFieldGroups = (formConfig, groups) => {
1518
- formConfig["fieldGroups"] = groups;
1550
+ formConfig.fieldGroups = groups;
1519
1551
  return formConfig;
1520
1552
  };
1521
1553
  const updateFieldGroupKey = (field) => {
1522
1554
  if (checkObjectKeyExists(field, "groupKey") &&
1523
1555
  !Array.isArray(field.groupKey)) {
1524
- field["groupKey"] = [field.groupKey];
1556
+ field.groupKey = [field.groupKey];
1525
1557
  }
1526
1558
  return field;
1527
1559
  };
@@ -1543,26 +1575,28 @@ class Converter {
1543
1575
  field.label = updateLanguage(field.label, language);
1544
1576
  }
1545
1577
  if (checkObjectPathExists(field, "properties.placeholder")) {
1546
- field.properties["placeholder"] = updateLanguage(field.properties["placeholder"], language);
1578
+ field.properties.placeholder = updateLanguage(field.properties.placeholder, language);
1547
1579
  }
1548
1580
  if (checkObjectPathExists(field, "properties.label")) {
1549
- field.properties["label"] = updateLanguage(field.properties["label"], language);
1581
+ field.properties.label = updateLanguage(field.properties.label, language);
1550
1582
  }
1551
1583
  const updateApiStatus = (fieldApiStatus) => {
1552
1584
  for (const status in fieldApiStatus) {
1553
- fieldApiStatus[status] = updateLanguage(fieldApiStatus[status], language);
1585
+ if (isNotEmptyValue(status)) {
1586
+ fieldApiStatus[status] = updateLanguage(fieldApiStatus[status], language);
1587
+ }
1554
1588
  }
1555
1589
  return fieldApiStatus;
1556
1590
  };
1557
1591
  switch (field.type) {
1558
1592
  case EFieldType.HTML:
1559
- field["html"] = updateLanguage(field["html"], language);
1593
+ field.html = updateLanguage(field.html, language);
1560
1594
  break;
1561
1595
  case EFieldType.CAPTURE:
1562
- field.properties["cameraConfig"].header.title = updateLanguage(field.properties["cameraConfig"].header.title, language);
1596
+ field.properties.cameraConfig.header.title = updateLanguage(field.properties.cameraConfig.header.title, language);
1563
1597
  break;
1564
1598
  case EFieldType.RECORD:
1565
- field.properties["cameraConfig"].header.title = updateLanguage(field.properties["cameraConfig"].header.title, language);
1599
+ field.properties.cameraConfig.header.title = updateLanguage(field.properties.cameraConfig.header.title, language);
1566
1600
  break;
1567
1601
  case EFieldType.SELECT:
1568
1602
  field.options = field.options.map((option) => {
@@ -1604,17 +1638,17 @@ class Converter {
1604
1638
  });
1605
1639
  break;
1606
1640
  case EFieldType.API_CALL:
1607
- field["api"]["status"]["labels"] = updateApiStatus(field["api"]["status"]["labels"]);
1641
+ field.api.status.labels = updateApiStatus(field.api.status.labels);
1608
1642
  break;
1609
1643
  case EFieldType.LIVE_LOCATION:
1610
- field["api"]["status"]["labels"] = updateApiStatus(field["api"]["status"]["labels"]);
1644
+ field.api.status.labels = updateApiStatus(field.api.status.labels);
1611
1645
  break;
1612
1646
  default:
1613
1647
  break;
1614
1648
  }
1615
1649
  return field;
1616
1650
  };
1617
- let fields = getFormFields(formConfig);
1651
+ const fields = getFormFields(formConfig);
1618
1652
  let fieldGroups = {};
1619
1653
  for (let field of fields) {
1620
1654
  field = updateFieldLanguage(field, getLanguage());
@@ -1645,6 +1679,7 @@ __decorate([
1645
1679
  logMethod
1646
1680
  ], Converter.prototype, "convertFormConfig", null);
1647
1681
 
1682
+ /* eslint-disable no-unused-vars */
1648
1683
  var EFormEditorType;
1649
1684
  (function (EFormEditorType) {
1650
1685
  EFormEditorType["FIELDS"] = "FIELDS";
@@ -1653,9 +1688,7 @@ var EFormEditorType;
1653
1688
 
1654
1689
  const removeField = (fields, fieldKey) => {
1655
1690
  fields = fields.filter((row) => {
1656
- if (row.key !== fieldKey) {
1657
- return row;
1658
- }
1691
+ return row.key !== fieldKey;
1659
1692
  });
1660
1693
  return fields;
1661
1694
  };
@@ -1887,16 +1920,16 @@ const FIELD_CONFIG = {
1887
1920
  number: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "number", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.number) }),
1888
1921
  date: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "date", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.date) }),
1889
1922
  phone: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "phone", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.phone) }),
1890
- radio: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["radio"]), options: [] }),
1923
+ radio: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.radio), options: [] }),
1891
1924
  "radio-list": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio-list", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["radio-list"]), options: [] }),
1892
- select: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "select", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["select"]), options: [] }),
1925
+ select: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "select", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.select), options: [] }),
1893
1926
  slider: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "slider", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.slider) }),
1894
1927
  otp: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "otp", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.otp) }),
1895
- api: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["api"]) }),
1928
+ api: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.api) }),
1896
1929
  "api-call": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api-call", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["api-call"]) }),
1897
1930
  "aadhaar-number": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "aadhaar-number", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["aadhaar-number"]) }),
1898
1931
  "input-aadhaar": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "input-aadhaar", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["input-aadhaar"]) }),
1899
- image: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["image"]) }),
1932
+ image: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.image) }),
1900
1933
  "preview-image": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "preview-image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["preview-image"]) }),
1901
1934
  html: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "html", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.html), html: {
1902
1935
  before: "",
@@ -1937,11 +1970,12 @@ const NOFIELD_CONFIG = {
1937
1970
  };
1938
1971
 
1939
1972
  class KwikIDFormBuilderFormEditorService {
1940
- constructor() { }
1941
1973
  createNestedFormGroup(object) {
1942
1974
  const formGroup = {};
1943
- for (let index in object) {
1944
- formGroup[index] = new FormControl(object[index]);
1975
+ for (const index in object) {
1976
+ if (isNotEmptyValue(index)) {
1977
+ formGroup[index] = new FormControl(object[index]);
1978
+ }
1945
1979
  }
1946
1980
  return new FormGroup(formGroup);
1947
1981
  }
@@ -2008,7 +2042,7 @@ class KwikIDBuilderFormEditorComponent {
2008
2042
  ];
2009
2043
  this.activeEditorType = EFormEditorType.FIELDS;
2010
2044
  this.activeFormConfig_Fields = [];
2011
- this.activeFormConfig_NoFields = {};
2045
+ this.activeFormConfigNoFields = {};
2012
2046
  this.showConfigPreview = false;
2013
2047
  // Forms
2014
2048
  this.formGroup = new FormGroup({});
@@ -2040,7 +2074,6 @@ class KwikIDBuilderFormEditorComponent {
2040
2074
  /**
2041
2075
  * Angular Lifecycle Methods
2042
2076
  */
2043
- ngOnInit() { }
2044
2077
  ngOnChanges(changes) {
2045
2078
  const verifyChange = (key) => {
2046
2079
  return checkObjectKeyExists(changes, key) && !changes[key].firstChange;
@@ -2055,8 +2088,8 @@ class KwikIDBuilderFormEditorComponent {
2055
2088
  initFormEditor(activeFormConfig) {
2056
2089
  this.toggleLoader(true);
2057
2090
  this.activeFormConfig_Fields = getObjectDeepCopy(activeFormConfig.fields);
2058
- this.activeFormConfig_NoFields = getObjectDeepCopy(activeFormConfig);
2059
- delete this.activeFormConfig_NoFields.fields;
2091
+ this.activeFormConfigNoFields = getObjectDeepCopy(activeFormConfig);
2092
+ delete this.activeFormConfigNoFields.fields;
2060
2093
  this.rows = this.activeFormConfig_Fields.map((field) => {
2061
2094
  var _a;
2062
2095
  return {
@@ -2106,21 +2139,21 @@ class KwikIDBuilderFormEditorComponent {
2106
2139
  */
2107
2140
  handleOnClickEditValidators(e) {
2108
2141
  const fieldConfig = this.formGroup.getRawValue()[e.index];
2109
- const fieldConfigValidators = fieldConfig["validators"];
2142
+ const fieldConfigValidators = fieldConfig.validators;
2110
2143
  this.activeFieldConfigValidatorsConfig = mergeObjects(FIELD_VALIDATORS_CONFIG, fieldConfigValidators);
2111
2144
  this.showFieldConfigValidatorsConfigEditor = true;
2112
2145
  this.activeFieldConfigEditing = fieldConfig;
2113
2146
  }
2114
2147
  handleOnClickEditProperties(e) {
2115
2148
  const fieldConfig = this.formGroup.getRawValue()[e.index];
2116
- const fieldConfigProperties = fieldConfig["properties"];
2149
+ const fieldConfigProperties = fieldConfig.properties;
2117
2150
  this.activeFieldConfigPropertiesConfig = mergeObjects(FIELD_PROPERTIES_CONFIG[e.type], fieldConfigProperties);
2118
2151
  this.showFieldConfigPropertiesConfigEditor = true;
2119
2152
  this.activeFieldConfigEditing = fieldConfig;
2120
2153
  }
2121
2154
  handleOnClickEditOptions(e) {
2122
2155
  const fieldConfig = this.formGroup.getRawValue()[e.index];
2123
- const fieldConfigOptions = fieldConfig["options"];
2156
+ const fieldConfigOptions = fieldConfig.options;
2124
2157
  this.activeFieldConfigOptionsConfig = mergeObjects([], fieldConfigOptions);
2125
2158
  this.showFieldConfigOptionsConfigEditor = true;
2126
2159
  this.activeFieldConfigEditing = fieldConfig;
@@ -2218,8 +2251,8 @@ class KwikIDBuilderFormEditorComponent {
2218
2251
  /**
2219
2252
  * Non Fields Editor Related Methods
2220
2253
  */
2221
- handleOnClickSaveActiveFormConfig_NoFields(e) {
2222
- this.activeFormConfig_NoFields = JSON.parse(e);
2254
+ handleOnClickSaveActiveFormConfigNoFields(e) {
2255
+ this.activeFormConfigNoFields = JSON.parse(e);
2223
2256
  }
2224
2257
  /**
2225
2258
  * Other Component Methods
@@ -2252,12 +2285,12 @@ class KwikIDBuilderFormEditorComponent {
2252
2285
  }
2253
2286
  convertToMinifiedJson() {
2254
2287
  const fields = [];
2255
- for (let field of Object.values(getObjectDeepCopy(this.formGroup.getRawValue()))) {
2256
- fields.push(setValueToObjectPath(findModifiedKeys(FIELD_CONFIG[field["type"]], field, ""), "type", field["type"]));
2288
+ for (const field of Object.values(getObjectDeepCopy(this.formGroup.getRawValue()))) {
2289
+ fields.push(setValueToObjectPath(findModifiedKeys(FIELD_CONFIG[field.type], field, ""), "type", field.type));
2257
2290
  }
2258
- const activeFormConfig_NoFields_Minified = findModifiedKeys(NOFIELD_CONFIG, getObjectDeepCopy(this.activeFormConfig_NoFields), "");
2259
- this.activeFormConfig = mergeObjects({}, activeFormConfig_NoFields_Minified, {
2260
- fields: fields
2291
+ const activeFormConfigNoFieldsMinified = findModifiedKeys(NOFIELD_CONFIG, getObjectDeepCopy(this.activeFormConfigNoFields), "");
2292
+ this.activeFormConfig = mergeObjects({}, activeFormConfigNoFieldsMinified, {
2293
+ fields
2261
2294
  });
2262
2295
  }
2263
2296
  convertToCompleteJson() {
@@ -2277,10 +2310,8 @@ class KwikIDBuilderFormEditorComponent {
2277
2310
  const finalPath = `${path}['${fieldType}'].${key}`;
2278
2311
  return getObjectValueFromPath(OPTIONS, finalPath);
2279
2312
  }
2280
- else {
2281
- const finalPath = path !== "" ? `${path}.${key}` : key;
2282
- return getObjectValueFromPath(OPTIONS, finalPath);
2283
- }
2313
+ const finalPath = path !== "" ? `${path}.${key}` : key;
2314
+ return getObjectValueFromPath(OPTIONS, finalPath);
2284
2315
  }
2285
2316
  isOptions(index, value, key, path) {
2286
2317
  if (path.includes("properties")) {
@@ -2288,10 +2319,8 @@ class KwikIDBuilderFormEditorComponent {
2288
2319
  const finalPath = `${path}['${fieldType}'].${key}`;
2289
2320
  return Array.isArray(getObjectValueFromPath(OPTIONS, finalPath));
2290
2321
  }
2291
- else {
2292
- const finalPath = path !== "" ? `${path}.${key}` : key;
2293
- return Array.isArray(getObjectValueFromPath(OPTIONS, finalPath));
2294
- }
2322
+ const finalPath = path !== "" ? `${path}.${key}` : key;
2323
+ return Array.isArray(getObjectValueFromPath(OPTIONS, finalPath));
2295
2324
  }
2296
2325
  isBoolean(value) {
2297
2326
  return typeof value === "boolean";
@@ -2314,13 +2343,11 @@ class KwikIDBuilderFormEditorComponent {
2314
2343
  if (typeof item === "string") {
2315
2344
  return `${String(index)}_${item}_${new Date().getTime()}`;
2316
2345
  }
2317
- else {
2318
- return `${String(index)}_${key}_${value}_${new Date().getTime()}`;
2319
- }
2346
+ return `${String(index)}_${key}_${value}_${new Date().getTime()}`;
2320
2347
  }
2321
2348
  }
2322
2349
  /** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDBuilderFormEditorComponent, deps: [{ token: i3.KwikUILoaderService }, { token: KwikIDFormBuilderFormEditorService }], target: i0.ɵɵFactoryTarget.Component });
2323
- /** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: { activeFormConfig: "activeFormConfig" }, outputs: { onClickSaveActiveFormConfig: "onClickSaveActiveFormConfig" }, usesOnChanges: true, ngImport: i0, template: "<!-- Component Loader -->\n<kwikui-loader></kwikui-loader>\n\n<!-- Component Main View -->\n<div class=\"container\">\n <ng-container *ngIf=\"activeFormConfig; else noFormSelectedTemplate\">\n <header>\n <div>\n &nbsp;Editing Config of Form: <b>{{ activeFormConfig.props.title }}</b>\n </div>\n <div class=\"header-form-editor-btns\">\n <button (click)=\"handleOnClickPreview()\">preview</button>\n <div>Editor&nbsp;Type:</div>\n <select (change)=\"handleOnClickChangeActiveEditor($event.target.value)\">\n <option\n *ngFor=\"let option of editorTypeOptions\"\n [value]=\"option.key\"\n [selected]=\"option.key === activeEditorType\"\n >\n {{ option.label }}\n </option>\n </select>\n </div>\n </header>\n <main>\n <div\n class=\"form-config-fields\"\n *ngIf=\"activeEditorType == 'FIELDS'; else nonFieldsEditorTemplate\"\n >\n <ng-container *ngIf=\"rows.length <= 0\">\n <div class=\"no-fields disclaimer\">\n <div><p>Please add field to get started</p></div>\n <div class=\"icon\"><h1>&plus;</h1></div>\n <button (click)=\"handleOnClickAddField()\">add field</button>\n </div>\n </ng-container>\n <table>\n <thead>\n <tr>\n <th *ngFor=\"let column of columns\">\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let row of rows; let i = index; trackBy: trackByFn\"\n >\n <tr>\n <ng-container *ngFor=\"let column of columns; let j = index\">\n <td>\n <div [class]=\"column\">\n <ng-container\n *ngIf=\"\n column !== 'delete' &&\n column !== 'validators' &&\n column !== 'properties' &&\n column !== 'type' &&\n column !== 'disabled' &&\n column !== 'options'\n \"\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n fieldValue: row[column],\n fieldKey: column,\n parentPath: ''\n }\"\n ></ng-container>\n <ng-container *ngIf=\"column === 'type'\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'disabled'\">\n <ng-container\n [ngTemplateOutlet]=\"booleanFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'delete'\">\n <button\n (click)=\"\n handleOnClickDeleteField({\n index: i,\n key: row['key']\n })\n \"\n [disabled]=\"rows.length === 1\"\n >\n delete\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'validators'\">\n <button\n (click)=\"\n handleOnClickEditValidators({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'properties'\">\n <button\n (click)=\"\n handleOnClickEditProperties({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'radio' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'select' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"add-field-btn-container\"> </div>\n </div>\n <ng-template #nonFieldsEditorTemplate>\n <div class=\"form-config-no-fields\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnClickSaveActiveFormConfig_NoFields(\n $event.target.innerHTML\n )\n \"\n >\n {{ activeFormConfig_NoFields | json }}\n </div>\n </div>\n </ng-template>\n </main>\n <footer>\n <button\n *ngIf=\"rows.length > 0\"\n (click)=\"handleOnClickAddField()\"\n >\n add field\n </button>\n <button\n (click)=\"handleOnClickSaveActiveFormConfig()\"\n [class.secondary]=\"!savedConfig\"\n >\n {{ savedConfig ? \"saved\" : \"unsaved\" }}\n </button>\n </footer>\n </ng-container>\n <ng-template #noFormSelectedTemplate>\n <div class=\"no-form-selected disclaimer\">\n <div class=\"icon\"><h1>&#10150;</h1></div>\n <div><p>Please select a form to edit it's fields</p></div>\n </div>\n </ng-template>\n</div>\n\n<!-- Component Dialog -->\n<div\n class=\"modal\"\n [class.error]=\"dialogError === true\"\n *ngIf=\"\n dialogOpen ||\n showFieldConfigValidatorsConfigEditor ||\n showFieldConfigPropertiesConfigEditor ||\n showFieldConfigOptionsConfigEditor\n \"\n [@panelInOut]\n>\n <div class=\"modal-box\">\n <div\n class=\"modal-content\"\n *ngIf=\"dialogOpen\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Config Preview\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"convertToMinifiedJson()\">minify</button>\n <button (click)=\"convertToCompleteJson()\">full</button>\n <button (click)=\"downloadJSON()\">download</button>\n <button (click)=\"copyToClipboard()\">copy</button>\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div class=\"json-editor\">\n <code>{{ activeFormConfig | json }}</code>\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigValidatorsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Validator Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigValidatorsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigValidatorsConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigPropertiesConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Properties Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigPropertiesConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigPropertiesConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigOptionsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Options Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigOptionsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigOptionsConfig | json }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- END -->\n\n<!-- Template for rendering different field types -->\n<!-- General Field Template -->\n<ng-template\n #getFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container\n [ngTemplateOutlet]=\"\n isObject(value) ? objectFieldTemplate : notObjectFieldTemplate\n \"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: value,\n fieldKey: key,\n parentPath: path\n }\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Object Type Field Template -->\n<ng-template\n #objectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <ng-container *ngFor=\"let item of value | keyvalue\">\n <ng-container\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: item.value,\n fieldKey: item.key,\n parentPath: path === '' ? key : path + '.' + key\n }\"\n >\n </ng-container>\n </ng-container>\n</ng-template>\n\n<!-- Non Object Type Field Template -->\n<ng-template\n #notObjectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container *ngIf=\"isOptions(index, value, key, path)\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n key: key,\n value: value,\n path: path,\n options: memoizedGetOptions(index, value, key, path)\n }\"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isString(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n textFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isNumber(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n numberFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Options Field Template -->\n<ng-template\n #optionFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n let-options=\"options\"\n>\n <div class=\"field-container options\">\n <select\n (change)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n >\n <option\n *ngFor=\"let option of options\"\n [value]=\"option\"\n [selected]=\"option === value\"\n >{{ option }}</option\n >\n </select>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Boolean Field Template -->\n<ng-template\n #booleanFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container checkbox\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n (change)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.checked }, path })\"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Text Field Template -->\n<ng-template\n #textFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container text\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"text\"\n [value]=\"value\"\n (blur)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Number Field Template -->\n<ng-template\n #numberFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container number\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"number\"\n [value]=\"value\"\n (blur)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n />\n </div>\n</ng-template>\n<!-- END -->\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%;overflow:auto}.container{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;height:100%;border:1px solid #ccc}.container header{padding:.5rem;display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;border-bottom:1px solid #ccc}.container header .header-form-editor-btns{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.container header .header-form-editor-btns>*:not(:last-child){margin-right:1rem}.container main{padding:.5rem;flex-grow:1;overflow:auto;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;white-space:nowrap;position:relative}.container main>*:not(:last-child){margin-right:1rem}.container main .no-fields{position:absolute;top:0;left:0;background:white}.container main .form-config-no-fields{overflow:auto;width:100%}.container main .form-config-fields{overflow:auto;width:100%}.container main .form-config-fields .add-field-btn-container{width:100%;text-align:center}.container main .validators,.container main .properties{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}.container main .validators>*:not(:last-child),.container main .properties>*:not(:last-child){margin-bottom:.5rem}.container main .input-checkbox-container{display:flex;flex-direction:row}.container footer{padding:.5rem;display:flex;flex-direction:row;justify-content:flex-end;align-items:stretch;border-top:1px solid lightgray}.container footer>*:not(:last-child){margin-right:1rem}.modal{position:absolute;top:0;background-color:#0000004d;width:100%;height:100%;display:flex;justify-content:center;align-items:center;left:0;flex-direction:row}.modal.error{background-color:#ff00004d}.modal-box{width:75%;height:75%;margin:auto;background-color:#fff;border-radius:1rem;box-shadow:#64646f33 0 7px 29px}.modal-content{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;width:100%;height:100%}.modal-heading{padding:.5rem 1rem;width:100%;display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid lightgray;align-items:center}.modal-title{font-weight:bold;font-size:1rem}.modal-actions{display:flex;flex-direction:row;cursor:pointer}.modal-actions>*:not(:last-child){margin-right:1rem}.modal-body{overflow:auto;flex:1}.modal-body .json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}.json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}table{width:100%;border-collapse:collapse;margin-bottom:20px}table th,table td{padding:8px;text-align:left;border:1px solid #ccc;vertical-align:top}table th{background-color:#f2f2f2}table tr:nth-child(even){background-color:#f9f9f9}table tr:hover{background-color:#eaeaea}\n"], components: [{ type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "json": i3$2.JsonPipe, "keyvalue": i3$2.KeyValuePipe }, animations: [
2350
+ /** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: { activeFormConfig: "activeFormConfig" }, outputs: { onClickSaveActiveFormConfig: "onClickSaveActiveFormConfig" }, usesOnChanges: true, ngImport: i0, template: "<!-- Component Loader -->\n<kwikui-loader></kwikui-loader>\n\n<!-- Component Main View -->\n<div class=\"container\">\n <ng-container *ngIf=\"activeFormConfig; else noFormSelectedTemplate\">\n <header>\n <div>\n &nbsp;Editing Config of Form: <b>{{ activeFormConfig.props.title }}</b>\n </div>\n <div class=\"header-form-editor-btns\">\n <button (click)=\"handleOnClickPreview()\">preview</button>\n <div>Editor&nbsp;Type:</div>\n <select (change)=\"handleOnClickChangeActiveEditor($event.target.value)\">\n <option\n *ngFor=\"let option of editorTypeOptions\"\n [value]=\"option.key\"\n [selected]=\"option.key === activeEditorType\"\n >\n {{ option.label }}\n </option>\n </select>\n </div>\n </header>\n <main>\n <div\n class=\"form-config-fields\"\n *ngIf=\"activeEditorType == 'FIELDS'; else nonFieldsEditorTemplate\"\n >\n <ng-container *ngIf=\"rows.length <= 0\">\n <div class=\"no-fields disclaimer\">\n <div><p>Please add field to get started</p></div>\n <div class=\"icon\"><h1>&plus;</h1></div>\n <button (click)=\"handleOnClickAddField()\">add field</button>\n </div>\n </ng-container>\n <table>\n <thead>\n <tr>\n <th *ngFor=\"let column of columns\">\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let row of rows; let i = index; trackBy: trackByFn\"\n >\n <tr>\n <ng-container *ngFor=\"let column of columns; let j = index\">\n <td>\n <div [class]=\"column\">\n <ng-container\n *ngIf=\"\n column !== 'delete' &&\n column !== 'validators' &&\n column !== 'properties' &&\n column !== 'type' &&\n column !== 'disabled' &&\n column !== 'options'\n \"\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n fieldValue: row[column],\n fieldKey: column,\n parentPath: ''\n }\"\n ></ng-container>\n <ng-container *ngIf=\"column === 'type'\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'disabled'\">\n <ng-container\n [ngTemplateOutlet]=\"booleanFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'delete'\">\n <button\n (click)=\"\n handleOnClickDeleteField({\n index: i,\n key: row['key']\n })\n \"\n [disabled]=\"rows.length === 1\"\n >\n delete\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'validators'\">\n <button\n (click)=\"\n handleOnClickEditValidators({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'properties'\">\n <button\n (click)=\"\n handleOnClickEditProperties({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'radio' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'select' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"add-field-btn-container\"> </div>\n </div>\n <ng-template #nonFieldsEditorTemplate>\n <div class=\"form-config-no-fields\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnClickSaveActiveFormConfigNoFields($event.target.innerHTML)\n \"\n >\n {{ activeFormConfigNoFields | json }}\n </div>\n </div>\n </ng-template>\n </main>\n <footer>\n <button\n *ngIf=\"rows.length > 0\"\n (click)=\"handleOnClickAddField()\"\n >\n add field\n </button>\n <button\n (click)=\"handleOnClickSaveActiveFormConfig()\"\n [class.secondary]=\"!savedConfig\"\n >\n {{ savedConfig ? \"saved\" : \"unsaved\" }}\n </button>\n </footer>\n </ng-container>\n <ng-template #noFormSelectedTemplate>\n <div class=\"no-form-selected disclaimer\">\n <div class=\"icon\"><h1>&#10150;</h1></div>\n <div><p>Please select a form to edit it's fields</p></div>\n </div>\n </ng-template>\n</div>\n\n<!-- Component Dialog -->\n<div\n class=\"modal\"\n [class.error]=\"dialogError === true\"\n *ngIf=\"\n dialogOpen ||\n showFieldConfigValidatorsConfigEditor ||\n showFieldConfigPropertiesConfigEditor ||\n showFieldConfigOptionsConfigEditor\n \"\n [@panelInOut]\n>\n <div class=\"modal-box\">\n <div\n class=\"modal-content\"\n *ngIf=\"dialogOpen\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Config Preview\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"convertToMinifiedJson()\">minify</button>\n <button (click)=\"convertToCompleteJson()\">full</button>\n <button (click)=\"downloadJSON()\">download</button>\n <button (click)=\"copyToClipboard()\">copy</button>\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div class=\"json-editor\">\n <code>{{ activeFormConfig | json }}</code>\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigValidatorsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Validator Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigValidatorsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigValidatorsConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigPropertiesConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Properties Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigPropertiesConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigPropertiesConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigOptionsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Options Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigOptionsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigOptionsConfig | json }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- END -->\n\n<!-- Template for rendering different field types -->\n<!-- General Field Template -->\n<ng-template\n #getFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container\n [ngTemplateOutlet]=\"\n isObject(value) ? objectFieldTemplate : notObjectFieldTemplate\n \"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: value,\n fieldKey: key,\n parentPath: path\n }\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Object Type Field Template -->\n<ng-template\n #objectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <ng-container *ngFor=\"let item of value | keyvalue\">\n <ng-container\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: item.value,\n fieldKey: item.key,\n parentPath: path === '' ? key : path + '.' + key\n }\"\n >\n </ng-container>\n </ng-container>\n</ng-template>\n\n<!-- Non Object Type Field Template -->\n<ng-template\n #notObjectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container *ngIf=\"isOptions(index, value, key, path)\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n key: key,\n value: value,\n path: path,\n options: memoizedGetOptions(index, value, key, path)\n }\"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isString(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n textFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isNumber(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n numberFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Options Field Template -->\n<ng-template\n #optionFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n let-options=\"options\"\n>\n <div class=\"field-container options\">\n <select\n (change)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n >\n <option\n *ngFor=\"let option of options\"\n [value]=\"option\"\n [selected]=\"option === value\"\n >{{ option }}</option\n >\n </select>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Boolean Field Template -->\n<ng-template\n #booleanFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container checkbox\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n (change)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.checked },\n path\n })\n \"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Text Field Template -->\n<ng-template\n #textFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container text\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"text\"\n [value]=\"value\"\n (blur)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Number Field Template -->\n<ng-template\n #numberFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container number\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"number\"\n [value]=\"value\"\n (blur)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n />\n </div>\n</ng-template>\n<!-- END -->\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%;overflow:auto}.container{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;height:100%;border:1px solid #ccc}.container header{padding:.5rem;display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;border-bottom:1px solid #ccc}.container header .header-form-editor-btns{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.container header .header-form-editor-btns>*:not(:last-child){margin-right:1rem}.container main{padding:.5rem;flex-grow:1;overflow:auto;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;white-space:nowrap;position:relative}.container main>*:not(:last-child){margin-right:1rem}.container main .no-fields{position:absolute;top:0;left:0;background:white}.container main .form-config-no-fields{overflow:auto;width:100%}.container main .form-config-fields{overflow:auto;width:100%}.container main .form-config-fields .add-field-btn-container{width:100%;text-align:center}.container main .validators,.container main .properties{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}.container main .validators>*:not(:last-child),.container main .properties>*:not(:last-child){margin-bottom:.5rem}.container main .input-checkbox-container{display:flex;flex-direction:row}.container footer{padding:.5rem;display:flex;flex-direction:row;justify-content:flex-end;align-items:stretch;border-top:1px solid lightgray}.container footer>*:not(:last-child){margin-right:1rem}.modal{position:absolute;top:0;background-color:#0000004d;width:100%;height:100%;display:flex;justify-content:center;align-items:center;left:0;flex-direction:row}.modal.error{background-color:#ff00004d}.modal-box{width:75%;height:75%;margin:auto;background-color:#fff;border-radius:1rem;box-shadow:#64646f33 0 7px 29px}.modal-content{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;width:100%;height:100%}.modal-heading{padding:.5rem 1rem;width:100%;display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid lightgray;align-items:center}.modal-title{font-weight:bold;font-size:1rem}.modal-actions{display:flex;flex-direction:row;cursor:pointer}.modal-actions>*:not(:last-child){margin-right:1rem}.modal-body{overflow:auto;flex:1}.modal-body .json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}.json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}table{width:100%;border-collapse:collapse;margin-bottom:20px}table th,table td{padding:8px;text-align:left;border:1px solid #ccc;vertical-align:top}table th{background-color:#f2f2f2}table tr:nth-child(even){background-color:#f9f9f9}table tr:hover{background-color:#eaeaea}\n"], components: [{ type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "json": i3$2.JsonPipe, "keyvalue": i3$2.KeyValuePipe }, animations: [
2324
2351
  trigger("panelInOut", [
2325
2352
  transition(":enter", [
2326
2353
  style({ transform: "translateY(100%)" }),
@@ -2331,9 +2358,6 @@ class KwikIDBuilderFormEditorComponent {
2331
2358
  ])
2332
2359
  ])
2333
2360
  ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2334
- __decorate([
2335
- logMethod
2336
- ], KwikIDBuilderFormEditorComponent.prototype, "ngOnInit", null);
2337
2361
  __decorate([
2338
2362
  logMethod
2339
2363
  ], KwikIDBuilderFormEditorComponent.prototype, "ngOnChanges", null);
@@ -2375,7 +2399,7 @@ __decorate([
2375
2399
  ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickDeleteField", null);
2376
2400
  __decorate([
2377
2401
  logMethod
2378
- ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickSaveActiveFormConfig_NoFields", null);
2402
+ ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickSaveActiveFormConfigNoFields", null);
2379
2403
  __decorate([
2380
2404
  logMethod
2381
2405
  ], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickPreview", null);
@@ -2420,7 +2444,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
2420
2444
  type: Input
2421
2445
  }], onClickSaveActiveFormConfig: [{
2422
2446
  type: Output
2423
- }], ngOnInit: [], ngOnChanges: [], initFormEditor: [], handleOnClickChangeActiveEditor: [], handleOnClickSaveActiveFormConfig: [], handleOnClickAddField: [], handleOnClickEditValidators: [], handleOnClickEditProperties: [], handleOnClickEditOptions: [], handleOnInput: [], handleOnInputFieldConfigValidatorsConfig: [], handleOnInputFieldConfigPropertiesConfig: [], handleOnInputFieldConfigOptionsConfig: [], handleOnClickDeleteField: [], handleOnClickSaveActiveFormConfig_NoFields: [], handleOnClickPreview: [], toggleLoader: [], closeJSONPopup: [], copyToClipboard: [], convertToMinifiedJson: [], convertToCompleteJson: [], downloadJSON: [] } });
2447
+ }], ngOnChanges: [], initFormEditor: [], handleOnClickChangeActiveEditor: [], handleOnClickSaveActiveFormConfig: [], handleOnClickAddField: [], handleOnClickEditValidators: [], handleOnClickEditProperties: [], handleOnClickEditOptions: [], handleOnInput: [], handleOnInputFieldConfigValidatorsConfig: [], handleOnInputFieldConfigPropertiesConfig: [], handleOnInputFieldConfigOptionsConfig: [], handleOnClickDeleteField: [], handleOnClickSaveActiveFormConfigNoFields: [], handleOnClickPreview: [], toggleLoader: [], closeJSONPopup: [], copyToClipboard: [], convertToMinifiedJson: [], convertToCompleteJson: [], downloadJSON: [] } });
2424
2448
 
2425
2449
  class KwikIDFormsBuilderComponent {
2426
2450
  constructor(loaderService) {
@@ -2460,66 +2484,56 @@ class KwikIDFormsBuilderComponent {
2460
2484
  return __awaiter(this, void 0, void 0, function* () {
2461
2485
  this.toggleLoader(true);
2462
2486
  const activeFormConfig = this.formsList.find((form) => {
2463
- if (form.key === selectedFormKey) {
2464
- return form;
2465
- }
2487
+ return form.key === selectedFormKey;
2466
2488
  });
2467
- let formConfig = undefined;
2489
+ let formConfig;
2468
2490
  if (getObjectFromLocalStorage(activeFormConfig.key)) {
2469
2491
  formConfig = getObjectFromLocalStorage(activeFormConfig.key);
2470
2492
  }
2471
- else {
2472
- if (checkObjectKeyExists(activeFormConfig, "props")) {
2473
- if (checkObjectKeyExists(activeFormConfig["props"], "url")) {
2474
- const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig["props"].url);
2475
- formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
2476
- }
2477
- else if (checkObjectKeyExists(activeFormConfig["props"], "path") &&
2478
- checkObjectKeyExists(this.userConfig, "backend") &&
2479
- checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
2480
- const url = `${(_b = (_a = this.userConfig) === null || _a === void 0 ? void 0 : _a.backend) === null || _b === void 0 ? void 0 : _b.CONFIG_BASE_URL}${activeFormConfig["props"].path}`;
2481
- const formConfigFromPath = yield this.fetchFormConfig(url);
2482
- formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
2483
- }
2484
- else {
2485
- if (checkObjectKeyExists(activeFormConfig, "fields")) {
2486
- formConfig = activeFormConfig;
2487
- }
2488
- else {
2489
- console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
2490
- }
2491
- }
2493
+ else if (checkObjectKeyExists(activeFormConfig, "props")) {
2494
+ if (checkObjectKeyExists(activeFormConfig.props, "url")) {
2495
+ const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.props.url);
2496
+ formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
2492
2497
  }
2493
- else if (checkObjectKeyExists(activeFormConfig, "formContent")) {
2494
- if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
2495
- const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.formContent.url);
2496
- formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
2497
- }
2498
- else if (checkObjectKeyExists(activeFormConfig.formContent, "path") &&
2499
- checkObjectKeyExists(this.userConfig, "backend") &&
2500
- checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
2501
- const url = `${(_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL}${activeFormConfig["props"].path}`;
2502
- const formConfigFromPath = yield this.fetchFormConfig(url);
2503
- formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
2504
- }
2505
- else {
2506
- if (checkObjectKeyExists(activeFormConfig, "fields")) {
2507
- formConfig = activeFormConfig;
2508
- }
2509
- else {
2510
- console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
2511
- }
2512
- }
2498
+ else if (checkObjectKeyExists(activeFormConfig.props, "path") &&
2499
+ checkObjectKeyExists(this.userConfig, "backend") &&
2500
+ checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
2501
+ const url = `${(_b = (_a = this.userConfig) === null || _a === void 0 ? void 0 : _a.backend) === null || _b === void 0 ? void 0 : _b.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
2502
+ const formConfigFromPath = yield this.fetchFormConfig(url);
2503
+ formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
2504
+ }
2505
+ else if (checkObjectKeyExists(activeFormConfig, "fields")) {
2506
+ formConfig = activeFormConfig;
2513
2507
  }
2514
2508
  else {
2515
- if (checkObjectKeyExists(activeFormConfig, "fields")) {
2516
- formConfig = activeFormConfig;
2517
- }
2518
- else {
2519
- console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
2520
- }
2509
+ console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
2521
2510
  }
2522
2511
  }
2512
+ else if (checkObjectKeyExists(activeFormConfig, "formContent")) {
2513
+ if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
2514
+ const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.formContent.url);
2515
+ formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
2516
+ }
2517
+ else if (checkObjectKeyExists(activeFormConfig.formContent, "path") &&
2518
+ checkObjectKeyExists(this.userConfig, "backend") &&
2519
+ checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
2520
+ const url = `${(_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
2521
+ const formConfigFromPath = yield this.fetchFormConfig(url);
2522
+ formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
2523
+ }
2524
+ else if (checkObjectKeyExists(activeFormConfig, "fields")) {
2525
+ formConfig = activeFormConfig;
2526
+ }
2527
+ else {
2528
+ console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
2529
+ }
2530
+ }
2531
+ else if (checkObjectKeyExists(activeFormConfig, "fields")) {
2532
+ formConfig = activeFormConfig;
2533
+ }
2534
+ else {
2535
+ console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
2536
+ }
2523
2537
  this.activeFormConfig = Object.assign(Object.assign({}, activeFormConfig), formConfig);
2524
2538
  this.toggleLoader(false);
2525
2539
  });
@@ -2549,7 +2563,7 @@ class KwikIDFormsBuilderComponent {
2549
2563
  }
2550
2564
  }
2551
2565
  /** @nocollapse */ KwikIDFormsBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormsBuilderComponent, deps: [{ token: i3.KwikUILoaderService }], target: i0.ɵɵFactoryTarget.Component });
2552
- /** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", inputs: { userConfig: "userConfig" }, ngImport: i0, template: "<div class=\"container\">\n <kwikid-builder-forms-list\n [activeFormConfig]=\"this.activeFormConfig\"\n [formsList]=\"this.formsList\"\n (getFormsList)=\"this.handleGetFormsList($event)\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n ></kwikid-builder-forms-list>\n <kwikid-builder-form-editor\n [activeFormConfig]=\"activeFormConfig\"\n (onClickSaveActiveFormConfig)=\"\n this.handleOnClickSaveActiveFormConfig($event)\n \"\n ></kwikid-builder-form-editor>\n</div>\n\n<kwikui-loader\n></kwikui-loader>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%}.container{width:100%;height:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:stretch;padding:1rem}.container>*:not(:last-child){margin-right:1rem}\n"], components: [{ type: KwikIDBuilderFormsListComponent, selector: "kwikid-builder-forms-list", inputs: ["activeFormConfig", "formsList"], outputs: ["onClickSetActiveForm", "getFormsList"] }, { type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: ["activeFormConfig"], outputs: ["onClickSaveActiveFormConfig"] }, { type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }] });
2566
+ /** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", inputs: { userConfig: "userConfig" }, ngImport: i0, template: "<div class=\"container\">\n <kwikid-builder-forms-list\n [activeFormConfig]=\"this.activeFormConfig\"\n [formsList]=\"this.formsList\"\n (getFormsList)=\"this.handleGetFormsList($event)\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n ></kwikid-builder-forms-list>\n <kwikid-builder-form-editor\n [activeFormConfig]=\"activeFormConfig\"\n (onClickSaveActiveFormConfig)=\"\n this.handleOnClickSaveActiveFormConfig($event)\n \"\n ></kwikid-builder-form-editor>\n</div>\n\n<kwikui-loader></kwikui-loader>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%}.container{width:100%;height:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:stretch;padding:1rem}.container>*:not(:last-child){margin-right:1rem}\n"], components: [{ type: KwikIDBuilderFormsListComponent, selector: "kwikid-builder-forms-list", inputs: ["activeFormConfig", "formsList"], outputs: ["onClickSetActiveForm", "getFormsList"] }, { type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: ["activeFormConfig"], outputs: ["onClickSaveActiveFormConfig"] }, { type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }] });
2553
2567
  __decorate([
2554
2568
  logMethod
2555
2569
  ], KwikIDFormsBuilderComponent.prototype, "fetchFormConfig", null);
@@ -2576,6 +2590,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
2576
2590
  type: Input
2577
2591
  }], fetchFormConfig: [], handleGetFormsList: [], handleOnClickSetActiveForm: [], handleOnClickSaveActiveFormConfig: [], toggleLoader: [] } });
2578
2592
 
2593
+ /* eslint-disable no-unused-vars */
2579
2594
  var EFormsListStatus;
2580
2595
  (function (EFormsListStatus) {
2581
2596
  EFormsListStatus["COMPLETED"] = "completed";
@@ -2659,6 +2674,7 @@ var EApiRequestUrlType;
2659
2674
  EApiRequestUrlType["CALCULATED"] = "CALCULATED";
2660
2675
  })(EApiRequestUrlType || (EApiRequestUrlType = {}));
2661
2676
 
2677
+ /* eslint-disable no-unused-vars */
2662
2678
  var EMessageType;
2663
2679
  (function (EMessageType) {
2664
2680
  EMessageType["DEFAULT"] = "default";
@@ -2672,6 +2688,7 @@ var EFormViewGoBackMode;
2672
2688
  EFormViewGoBackMode["TABBED"] = "TABBED";
2673
2689
  })(EFormViewGoBackMode || (EFormViewGoBackMode = {}));
2674
2690
 
2691
+ /* eslint-disable no-unused-vars */
2675
2692
  var ELogEventType$1;
2676
2693
  (function (ELogEventType) {
2677
2694
  ELogEventType["FORM__ACTION_EXECUTE"] = "FORM__ACTION_EXECUTE";
@@ -2751,24 +2768,23 @@ class KwikIDFormViewApiService {
2751
2768
  .join("");
2752
2769
  return outputString;
2753
2770
  }
2754
- else {
2755
- return undefined;
2756
- }
2771
+ return undefined;
2757
2772
  }
2758
2773
  // Function to preprocess header data
2759
2774
  preProcessHeader(headerData, isVerifySignature) {
2760
2775
  if (!headerData)
2761
2776
  headerData = {};
2762
2777
  if (!headerData.headers)
2763
- headerData["headers"] = {};
2778
+ headerData.headers = {};
2764
2779
  // Generate a unique identifier if signature verification is required
2765
2780
  if (isVerifySignature) {
2766
- headerData["headers"]["xrid"] = v4();
2781
+ headerData.headers.xrid = v4();
2767
2782
  }
2768
2783
  // Retrieve session ID from local storage and add it to headers
2769
- let session_id = localStorage.getItem("session_id");
2770
- if (session_id)
2771
- headerData["headers"]["ses"] = session_id;
2784
+ const sessionId = localStorage.getItem("session_id");
2785
+ if (sessionId) {
2786
+ headerData.headers.ses = sessionId;
2787
+ }
2772
2788
  return headerData;
2773
2789
  }
2774
2790
  // Function to verify the signature
@@ -2778,30 +2794,30 @@ class KwikIDFormViewApiService {
2778
2794
  if (!isVerifySignature) {
2779
2795
  resolve(true);
2780
2796
  }
2781
- // Check if data is invalid
2782
2797
  else if (!data) {
2798
+ // Check if data is invalid
2783
2799
  resolve(true);
2784
2800
  }
2785
- // Check if the signature is missing in headers when authentication is not skipped
2786
2801
  else if (isVerifySignature && header && !(header === null || header === void 0 ? void 0 : header.sig)) {
2802
+ // Check if the signature is missing in headers when authentication is not skipped
2787
2803
  reject(false);
2788
2804
  }
2789
- // Verify the signature when public key and header with signature are present and authentication is not skipped
2790
2805
  else if (isVerifySignature && header && (header === null || header === void 0 ? void 0 : header.sig)) {
2806
+ // Verify the signature when public key and header with signature are present and authentication is not skipped
2791
2807
  // Extract the signature and decode it
2792
2808
  let signature = header.sig.split(".")[0];
2793
- let rawSignature = atob(signature);
2809
+ const rawSignature = atob(signature);
2794
2810
  // Split the decoded signature to get the parts
2795
2811
  signature = rawSignature.split(".")[0];
2796
- let exp = rawSignature.split(".")[1] + "000"; // Expiration time in milliseconds
2797
- let iat = rawSignature.split(".")[2] + "000"; // Issued at time in milliseconds
2812
+ const exp = `${rawSignature.split(".")[1]}000`; // Expiration time in milliseconds
2813
+ const iat = `${rawSignature.split(".")[2]}000`; // Issued at time in milliseconds
2798
2814
  // Check if the signature is valid
2799
2815
  if (signature) {
2800
2816
  // Check if the current time is before the expiration time
2801
2817
  const dateValue = new Date().valueOf();
2802
- let dateCheck = dateValue < parseInt(exp);
2818
+ const dateCheck = dateValue < parseInt(exp, 10);
2803
2819
  // Check if the signature matches the data
2804
- let res = signature === data;
2820
+ const res = signature === data;
2805
2821
  // Resolve the promise if the signature is valid and the date check passes
2806
2822
  if (res && dateCheck) {
2807
2823
  resolve(res);
@@ -2830,7 +2846,7 @@ class KwikIDFormViewApiService {
2830
2846
  preProcessedHeader = this.preProcessHeader(headerData, isVerifySignature);
2831
2847
  }
2832
2848
  else {
2833
- preProcessedHeader["observe"] = "response";
2849
+ preProcessedHeader.observe = "response";
2834
2850
  }
2835
2851
  // Encrypt body if required
2836
2852
  if (isEncrypt) {
@@ -2838,7 +2854,7 @@ class KwikIDFormViewApiService {
2838
2854
  }
2839
2855
  return new Observable((subscriber) => {
2840
2856
  axios.post(url, body, headerData).then((res) => __awaiter(this, void 0, void 0, function* () {
2841
- let data = res["data"];
2857
+ let { data } = res;
2842
2858
  // Decrypt response if required
2843
2859
  if (data && isDecrypt) {
2844
2860
  const encryptedResponse = data;
@@ -2884,11 +2900,11 @@ class KwikIDFormViewApiService {
2884
2900
  preProcessedHeader = this.preProcessHeader(headerData, isVerifySignature);
2885
2901
  }
2886
2902
  else {
2887
- preProcessedHeader["observe"] = "response";
2903
+ preProcessedHeader.observe = "response";
2888
2904
  }
2889
2905
  return new Observable((subscriber) => {
2890
2906
  axios.get(url, preProcessedHeader).then((res) => __awaiter(this, void 0, void 0, function* () {
2891
- let data = res["data"];
2907
+ let { data } = res;
2892
2908
  // Decrypt response if required
2893
2909
  if (isDecrypt) {
2894
2910
  const encryptedResponse = data;
@@ -2929,15 +2945,15 @@ class KwikIDFormViewApiService {
2929
2945
  // Function to execute API call based on method type
2930
2946
  executeApiCall(url, method, body, headers, isEncrypt, isDecrypt, isVerifySignature) {
2931
2947
  return new Promise((resolve) => {
2932
- if (method == "GET") {
2933
- this.get(url, { headers: headers }, isDecrypt, isVerifySignature).subscribe((res) => {
2948
+ if (method === "GET") {
2949
+ this.get(url, { headers }, isDecrypt, isVerifySignature).subscribe((res) => {
2934
2950
  resolve(res);
2935
2951
  }, (err) => {
2936
2952
  resolve(err);
2937
2953
  });
2938
2954
  }
2939
2955
  else {
2940
- this.post(url, body, { headers: headers }, isEncrypt, isDecrypt, isVerifySignature).subscribe((res) => {
2956
+ this.post(url, body, { headers }, isEncrypt, isDecrypt, isVerifySignature).subscribe((res) => {
2941
2957
  resolve(res);
2942
2958
  }, (err) => {
2943
2959
  resolve(err);
@@ -2962,16 +2978,35 @@ __decorate([
2962
2978
  logMethod
2963
2979
  ], KwikIDFormViewApiService.prototype, "get", null);
2964
2980
 
2981
+ const FORM_VIEW_TIMERS = {
2982
+ WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK: 10,
2983
+ WAIT_FOR_FILE_METADATA_DEEPCOPY: 300,
2984
+ WAIT_FOR_KWIKID_CAMERA_TO_LOAD: 500,
2985
+ WAIT_FOR_KWIKID_CAMERA_MEDIA_TO_BE_SET: 500,
2986
+ LOCATION_PERMISSION_ERROR_TOGGLE: 3000,
2987
+ LOCATION_PERMISSION_RESET_BUTTON_STATUS: 500,
2988
+ INVALID_FIELDS_SAVE_FORM_ERROR_TOGGLE: 3000,
2989
+ TIMER_300: 300,
2990
+ TIMER_500: 500,
2991
+ TIMER_1000: 1000,
2992
+ TIMER_3000: 3000,
2993
+ WAIT_FOR_API_MOCK_DATA: 1000,
2994
+ API_MOCK_SUCCESS_STATUS_CODE: 200,
2995
+ API_MOCK_ERROR_STATUS_CODE: 200
2996
+ };
2997
+
2965
2998
  class Defaults {
2966
- constructor(field, formFields, allFormsData, formData, previousFormData, extraData, takeAction) {
2999
+ constructor(field, object, takeAction) {
2967
3000
  this._field = field;
2968
- this._formFields = formFields;
2969
- this._allFormsData = allFormsData;
2970
- this._formData = formData;
2971
- this._previousFormData = previousFormData;
2972
- this._extraData = extraData;
3001
+ this._object = object;
2973
3002
  this._takeAction = takeAction;
2974
3003
  }
3004
+ get object() {
3005
+ return this._object;
3006
+ }
3007
+ set object(value) {
3008
+ this._object = value;
3009
+ }
2975
3010
  getFormFieldValue() {
2976
3011
  return __awaiter(this, void 0, void 0, function* () {
2977
3012
  let defaultValue;
@@ -2984,28 +3019,12 @@ class Defaults {
2984
3019
  }
2985
3020
  else if (!checkObjectKeyExists(this._field.default.value, "sources")) {
2986
3021
  const engine = this._field.default.value;
2987
- const triggers = engine.triggers;
2988
- const rules = engine.rules;
2989
- const actions = engine.actions;
2990
- const rulesMapping = new Rule(rules, {
2991
- FIELD_CONFIG: this._field,
2992
- FORM_FIELDS: this._formFields,
2993
- FORM_DATA: this._formData,
2994
- PREVIOUS_FORM_DATA: this._previousFormData,
2995
- ALL_FORMS_DATA: this._allFormsData,
2996
- EXTRA_DATA: this._extraData
2997
- }).mapping();
2998
- for (let action of actions) {
3022
+ const { triggers, rules, actions } = engine;
3023
+ const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3024
+ for (const action of actions) {
2999
3025
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3000
3026
  if (conditionEvaluation) {
3001
- const actions = new Action(action, rulesMapping, {
3002
- FIELD_CONFIG: this._field,
3003
- FORM_FIELDS: this._formFields,
3004
- FORM_DATA: this._formData,
3005
- PREVIOUS_FORM_DATA: this._previousFormData,
3006
- ALL_FORMS_DATA: this._allFormsData,
3007
- EXTRA_DATA: this._extraData
3008
- }, this._takeAction);
3027
+ const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3009
3028
  yield actions.execute();
3010
3029
  }
3011
3030
  }
@@ -3015,47 +3034,26 @@ class Defaults {
3015
3034
  }
3016
3035
  }
3017
3036
  else {
3018
- const sources = this._field.default.value.sources;
3037
+ const { sources } = this._field.default.value;
3019
3038
  let sourceIndex = 0;
3020
- for (let source of sources) {
3021
- const sources = new Source({
3022
- FIELD_CONFIG: this._field,
3023
- FORM_FIELDS: this._formFields,
3024
- FORM_DATA: this._formData,
3025
- PREVIOUS_FORM_DATA: this._previousFormData,
3026
- ALL_FORMS_DATA: this._allFormsData,
3027
- EXTRA_DATA: this._extraData
3028
- });
3039
+ for (const source of sources) {
3040
+ const sources = new Source(Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }));
3029
3041
  const value = sources.getValueFromSource(source);
3030
3042
  // Set the Value of current source.
3031
3043
  this._field = setValueToObjectPath(this._field, `default.value.sources.[${sourceIndex}].value`, value);
3032
- const validation = source.validation;
3033
- const triggers = validation.triggers;
3034
- const rules = validation.rules;
3035
- const actions = validation.actions;
3036
- const rulesMapping = new Rule(rules, {
3037
- FIELD_CONFIG: this._field,
3038
- FORM_FIELDS: this._formFields,
3039
- FORM_DATA: this._formData,
3040
- PREVIOUS_FORM_DATA: this._previousFormData,
3041
- ALL_FORMS_DATA: this._allFormsData,
3042
- EXTRA_DATA: this._extraData
3043
- }).mapping();
3044
- for (let action of actions) {
3044
+ const { validation } = source;
3045
+ const { triggers } = validation;
3046
+ const { rules } = validation;
3047
+ const { actions } = validation;
3048
+ const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3049
+ for (const action of actions) {
3045
3050
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3046
3051
  if (conditionEvaluation) {
3047
- const actions = new Action(action, rulesMapping, {
3048
- FIELD_CONFIG: this._field,
3049
- FORM_FIELDS: this._formFields,
3050
- FORM_DATA: this._formData,
3051
- PREVIOUS_FORM_DATA: this._previousFormData,
3052
- ALL_FORMS_DATA: this._allFormsData,
3053
- EXTRA_DATA: this._extraData
3054
- }, this._takeAction);
3052
+ const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3055
3053
  yield actions.execute();
3056
3054
  }
3057
3055
  }
3058
- sourceIndex++;
3056
+ sourceIndex += 1;
3059
3057
  }
3060
3058
  defaultValue = this._field.default.value.value;
3061
3059
  if (isEmptyValue(defaultValue)) {
@@ -3068,27 +3066,13 @@ class Defaults {
3068
3066
  getFormFieldApiValue() {
3069
3067
  return __awaiter(this, void 0, void 0, function* () {
3070
3068
  const apiConfig = this._field.default.api;
3071
- const rules = apiConfig.rules;
3072
- const actions = apiConfig.actions;
3073
- const rulesMapping = new Rule(rules, {
3074
- FIELD_CONFIG: this._field,
3075
- FORM_FIELDS: this._formFields,
3076
- FORM_DATA: this._formData,
3077
- PREVIOUS_FORM_DATA: this._previousFormData,
3078
- ALL_FORMS_DATA: this._allFormsData,
3079
- EXTRA_DATA: this._extraData
3080
- }).mapping();
3081
- for (let action of actions) {
3069
+ const { rules } = apiConfig;
3070
+ const { actions } = apiConfig;
3071
+ const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3072
+ for (const action of actions) {
3082
3073
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3083
3074
  if (conditionEvaluation) {
3084
- const actions = new Action(action, rulesMapping, {
3085
- FIELD_CONFIG: this._field,
3086
- FORM_FIELDS: this._formFields,
3087
- FORM_DATA: this._formData,
3088
- PREVIOUS_FORM_DATA: this._previousFormData,
3089
- ALL_FORMS_DATA: this._allFormsData,
3090
- EXTRA_DATA: this._extraData
3091
- }, this._takeAction);
3075
+ const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3092
3076
  yield actions.execute();
3093
3077
  }
3094
3078
  }
@@ -3097,27 +3081,13 @@ class Defaults {
3097
3081
  getFormFieldOptions() {
3098
3082
  return __awaiter(this, void 0, void 0, function* () {
3099
3083
  const optionsConfig = this._field.default.options;
3100
- const rules = optionsConfig.rules;
3101
- const actions = optionsConfig.actions;
3102
- const rulesMapping = new Rule(rules, {
3103
- FIELD_CONFIG: this._field,
3104
- FORM_FIELDS: this._formFields,
3105
- FORM_DATA: this._formData,
3106
- PREVIOUS_FORM_DATA: this._previousFormData,
3107
- ALL_FORMS_DATA: this._allFormsData,
3108
- EXTRA_DATA: this._extraData
3109
- }).mapping();
3110
- for (let action of actions) {
3084
+ const { rules } = optionsConfig;
3085
+ const { actions } = optionsConfig;
3086
+ const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
3087
+ for (const action of actions) {
3111
3088
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3112
3089
  if (conditionEvaluation) {
3113
- const actions = new Action(action, rulesMapping, {
3114
- FIELD_CONFIG: this._field,
3115
- FORM_FIELDS: this._formFields,
3116
- FORM_DATA: this._formData,
3117
- PREVIOUS_FORM_DATA: this._previousFormData,
3118
- ALL_FORMS_DATA: this._allFormsData,
3119
- EXTRA_DATA: this._extraData
3120
- }, this._takeAction);
3090
+ const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
3121
3091
  yield actions.execute();
3122
3092
  }
3123
3093
  }
@@ -3134,10 +3104,18 @@ __decorate([
3134
3104
  logMethod
3135
3105
  ], Defaults.prototype, "getFormFieldOptions", null);
3136
3106
 
3107
+ function NoWhitespacesValidator() {
3108
+ return (control) => {
3109
+ const { value } = control;
3110
+ if (!value || typeof value !== "string") {
3111
+ return null;
3112
+ }
3113
+ return hasWhitespacesOnly(value) ? { onlyWhitespaces: true } : null;
3114
+ };
3115
+ }
3137
3116
  class FormValidation {
3138
- constructor() { }
3139
3117
  getFormFieldValidators(field) {
3140
- let validators = [];
3118
+ const validators = [];
3141
3119
  if (checkObjectKeyExists(field, "validators") &&
3142
3120
  checkObjectKeyExists(field.validators, "min") &&
3143
3121
  isNotEmptyValue(field.validators.min)) {
@@ -3184,23 +3162,25 @@ class FormValidation {
3184
3162
  return validators;
3185
3163
  }
3186
3164
  getFormFieldsValidationErrors(formGroup) {
3187
- let errors = [];
3165
+ const errors = [];
3188
3166
  for (const key in formGroup.controls) {
3189
- const controlErrors = formGroup.controls[key].errors;
3190
- if (controlErrors !== null && controlErrors !== undefined) {
3191
- Object.keys(controlErrors).forEach((keyError) => {
3192
- errors.push({
3193
- name: keyError,
3194
- value: controlErrors[keyError]
3167
+ if (isNotEmptyValue(key)) {
3168
+ const controlErrors = formGroup.controls[key].errors;
3169
+ if (controlErrors !== null && controlErrors !== undefined) {
3170
+ Object.keys(controlErrors).forEach((keyError) => {
3171
+ errors.push({
3172
+ name: keyError,
3173
+ value: controlErrors[keyError]
3174
+ });
3195
3175
  });
3196
- });
3176
+ }
3197
3177
  }
3198
3178
  }
3199
3179
  return errors;
3200
3180
  }
3201
3181
  getFormFieldsInvalidControls(formToInvestigate) {
3202
- var controls = [];
3203
- let recursiveFunc = (form) => {
3182
+ const controls = [];
3183
+ const recursiveFunc = (form) => {
3204
3184
  Object.keys(form.controls).forEach((field) => {
3205
3185
  const control = form.get(field);
3206
3186
  if (control.invalid) {
@@ -3236,25 +3216,15 @@ __decorate([
3236
3216
  __decorate([
3237
3217
  logMethod
3238
3218
  ], FormValidation.prototype, "getFormFieldsInvalidControls", null);
3239
- function NoWhitespacesValidator() {
3240
- return (control) => {
3241
- const value = control.value;
3242
- if (!value || typeof value !== "string") {
3243
- return null;
3244
- }
3245
- return hasWhitespacesOnly(value) ? { onlyWhitespaces: true } : null;
3246
- };
3247
- }
3248
3219
 
3249
3220
  class KwikIDFormViewService {
3250
- constructor() { }
3251
3221
  // 'init' stage of the form
3252
- createFormGroup(fields, formData, previousFormData, allFormsData, extraData, takeAction) {
3222
+ createFormGroup(fields, object, takeAction) {
3253
3223
  return __awaiter(this, void 0, void 0, function* () {
3254
- let formGroup = new FormGroup({});
3255
- for (let field of fields) {
3224
+ const formGroup = new FormGroup({});
3225
+ for (const field of fields) {
3256
3226
  if (field.isFormElement) {
3257
- const defaults = new Defaults(field, fields, allFormsData, formData, previousFormData, extraData, takeAction);
3227
+ const defaults = new Defaults(field, Object.assign(Object.assign({}, object), { FORM_FIELDS: fields }), takeAction);
3258
3228
  let value = "";
3259
3229
  if (checkObjectKeyExists(field, "default")) {
3260
3230
  if (checkObjectKeyExists(field.default, "value")) {
@@ -3275,7 +3245,7 @@ class KwikIDFormViewService {
3275
3245
  }
3276
3246
  value = convertFormFieldValueToKwikUIFormat(field, value);
3277
3247
  const validators = new FormValidation().getFormFieldValidators(field);
3278
- formGroup.addControl(field.key, new FormControl({ value: value, disabled: field.disabled }, { validators: validators }));
3248
+ formGroup.addControl(field.key, new FormControl({ value, disabled: field.disabled }, { validators }));
3279
3249
  }
3280
3250
  }
3281
3251
  return formGroup;
@@ -3301,7 +3271,7 @@ class Apis {
3301
3271
  }
3302
3272
  setUrl() {
3303
3273
  return __awaiter(this, void 0, void 0, function* () {
3304
- if (this._request.url.hasOwnProperty("type") &&
3274
+ if (checkObjectKeyExists(this._request.url, "type") &&
3305
3275
  this._request.url.type === EApiRequestUrlType.CALCULATED) {
3306
3276
  const source = new Source(this._object);
3307
3277
  const url = yield source.getValueFromSource(this._request.url.props.value.source);
@@ -3318,41 +3288,41 @@ class Apis {
3318
3288
  return __awaiter(this, void 0, void 0, function* () {
3319
3289
  if (checkObjectKeyExists(this._request, "body")) {
3320
3290
  if (checkObjectKeyExists(this._request.body, "params")) {
3321
- let params = this._request.body.params;
3291
+ const { params } = this._request.body;
3322
3292
  let paramIndex = 0;
3323
- for (let param of params) {
3324
- let sources = param.sources;
3293
+ for (const param of params) {
3294
+ const { sources } = param;
3325
3295
  let sourceIndex = 0;
3326
- for (let source of sources) {
3296
+ for (const source of sources) {
3327
3297
  const sources = new Source(this._object);
3328
3298
  const value = sources.getValueFromSource(source);
3329
3299
  // Set the Value of current source.
3330
3300
  this._object.API_CONFIG = setValueToObjectPath(this._object.API_CONFIG, `request.body.params[${paramIndex}].sources[${sourceIndex}].value`, value);
3331
- const validation = source.validation;
3301
+ const { validation } = source;
3332
3302
  const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
3333
3303
  const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
3334
3304
  const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
3335
3305
  const rulesMapping = new Rule(rules, this._object).mapping();
3336
- for (let action of actions) {
3306
+ for (const action of actions) {
3337
3307
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3338
3308
  if (conditionEvaluation) {
3339
3309
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
3340
3310
  yield actions.execute();
3341
3311
  }
3342
3312
  }
3343
- sourceIndex++;
3313
+ sourceIndex += 1;
3344
3314
  }
3345
- paramIndex++;
3315
+ paramIndex += 1;
3346
3316
  }
3347
3317
  return this._object.API_CONFIG;
3348
3318
  }
3349
- else if (checkObjectKeyExists(this._request.body, "rules") &&
3319
+ if (checkObjectKeyExists(this._request.body, "rules") &&
3350
3320
  checkObjectKeyExists(this._request.body, "actions")) {
3351
3321
  const triggers = (_f = (_e = this._request.body) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
3352
3322
  const rules = (_h = (_g = this._request.body) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
3353
3323
  const actions = (_k = (_j = this._request.body) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
3354
3324
  const rulesMapping = new Rule(rules, this._object).mapping();
3355
- for (let action of actions) {
3325
+ for (const action of actions) {
3356
3326
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3357
3327
  if (conditionEvaluation) {
3358
3328
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3361,13 +3331,9 @@ class Apis {
3361
3331
  }
3362
3332
  return this._object.API_CONFIG;
3363
3333
  }
3364
- else {
3365
- return this._object.API_CONFIG;
3366
- }
3367
- }
3368
- else {
3369
3334
  return this._object.API_CONFIG;
3370
3335
  }
3336
+ return this._object.API_CONFIG;
3371
3337
  });
3372
3338
  }
3373
3339
  validateRequestBody() {
@@ -3375,13 +3341,13 @@ class Apis {
3375
3341
  return __awaiter(this, void 0, void 0, function* () {
3376
3342
  if (checkObjectKeyExists(this._request, "body")) {
3377
3343
  if (checkObjectKeyExists(this._request.body, "validation")) {
3378
- const body = this._request.body;
3379
- const validation = body.validation;
3344
+ const { body } = this._request;
3345
+ const { validation } = body;
3380
3346
  const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
3381
3347
  const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
3382
3348
  const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
3383
3349
  const rulesMapping = new Rule(rules, this._object).mapping();
3384
- for (let action of actions) {
3350
+ for (const action of actions) {
3385
3351
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
3386
3352
  if (conditionSuccess) {
3387
3353
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3390,13 +3356,13 @@ class Apis {
3390
3356
  }
3391
3357
  return this._object.API_CONFIG;
3392
3358
  }
3393
- else if (checkObjectPathExists(this._request.body, "rules") &&
3359
+ if (checkObjectPathExists(this._request.body, "rules") &&
3394
3360
  checkObjectPathExists(this._request.body, "actions")) {
3395
3361
  const triggers = (_f = (_e = this._request.body) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
3396
3362
  const rules = (_h = (_g = this._request.body) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
3397
3363
  const actions = (_k = (_j = this._request.body) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
3398
3364
  const rulesMapping = new Rule(rules, this._object).mapping();
3399
- for (let action of actions) {
3365
+ for (const action of actions) {
3400
3366
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
3401
3367
  if (conditionSuccess) {
3402
3368
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3405,15 +3371,11 @@ class Apis {
3405
3371
  }
3406
3372
  return this._object.API_CONFIG;
3407
3373
  }
3408
- else {
3409
- this._object = setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
3410
- return this._object.API_CONFIG;
3411
- }
3412
- }
3413
- else {
3414
3374
  this._object = setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
3415
3375
  return this._object.API_CONFIG;
3416
3376
  }
3377
+ this._object = setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
3378
+ return this._object.API_CONFIG;
3417
3379
  });
3418
3380
  }
3419
3381
  setRequestHeaders() {
@@ -3421,41 +3383,41 @@ class Apis {
3421
3383
  return __awaiter(this, void 0, void 0, function* () {
3422
3384
  if (checkObjectKeyExists(this._request, "headers")) {
3423
3385
  if (checkObjectKeyExists(this._request.headers, "params")) {
3424
- let params = this._request.headers.params;
3386
+ const { params } = this._request.headers;
3425
3387
  let paramIndex = 0;
3426
- for (let param of params) {
3427
- let sources = param.sources;
3388
+ for (const param of params) {
3389
+ const { sources } = param;
3428
3390
  let sourceIndex = 0;
3429
- for (let source of sources) {
3391
+ for (const source of sources) {
3430
3392
  const sources = new Source(this._object);
3431
3393
  const value = sources.getValueFromSource(source);
3432
3394
  // Set the Value of current source.
3433
3395
  this._object.API_CONFIG = setValueToObjectPath(this._object.API_CONFIG, `request.headers.params[${paramIndex}].sources[${sourceIndex}].value`, value);
3434
- const validation = source.validation;
3396
+ const { validation } = source;
3435
3397
  const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
3436
3398
  const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
3437
3399
  const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
3438
3400
  const rulesMapping = new Rule(rules, this._object).mapping();
3439
- for (let action of actions) {
3401
+ for (const action of actions) {
3440
3402
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3441
3403
  if (conditionEvaluation) {
3442
3404
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
3443
3405
  yield actions.execute();
3444
3406
  }
3445
3407
  }
3446
- sourceIndex++;
3408
+ sourceIndex += 1;
3447
3409
  }
3448
- paramIndex++;
3410
+ paramIndex += 1;
3449
3411
  }
3450
3412
  return this._object.API_CONFIG;
3451
3413
  }
3452
- else if (checkObjectKeyExists(this._request.headers, "rules") &&
3414
+ if (checkObjectKeyExists(this._request.headers, "rules") &&
3453
3415
  checkObjectKeyExists(this._request.headers, "actions")) {
3454
3416
  const triggers = (_f = (_e = this._request.headers) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
3455
3417
  const rules = (_h = (_g = this._request.headers) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
3456
3418
  const actions = (_k = (_j = this._request.headers) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
3457
3419
  const rulesMapping = new Rule(rules, this._object).mapping();
3458
- for (let action of actions) {
3420
+ for (const action of actions) {
3459
3421
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3460
3422
  if (conditionEvaluation) {
3461
3423
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3464,27 +3426,23 @@ class Apis {
3464
3426
  }
3465
3427
  return this._object.API_CONFIG;
3466
3428
  }
3467
- else {
3468
- return this._object.API_CONFIG;
3469
- }
3470
- }
3471
- else {
3472
3429
  return this._object.API_CONFIG;
3473
3430
  }
3431
+ return this._object.API_CONFIG;
3474
3432
  });
3475
3433
  }
3476
3434
  validateRequestHeaders() {
3477
3435
  var _a, _b, _c, _d, _e, _f, _g, _h;
3478
3436
  return __awaiter(this, void 0, void 0, function* () {
3479
- const headers = this._request.headers;
3437
+ const { headers } = this._request;
3480
3438
  if (checkObjectKeyExists(this._request, "headers")) {
3481
3439
  if (checkObjectKeyExists(this._request.headers, "validation")) {
3482
- const validation = headers.validation;
3440
+ const { validation } = headers;
3483
3441
  const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
3484
3442
  const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
3485
3443
  const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
3486
3444
  const rulesMapping = new Rule(rules, this._object).mapping();
3487
- for (let action of actions) {
3445
+ for (const action of actions) {
3488
3446
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
3489
3447
  if (conditionSuccess) {
3490
3448
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3493,13 +3451,13 @@ class Apis {
3493
3451
  }
3494
3452
  return this._object.API_CONFIG;
3495
3453
  }
3496
- else if (checkObjectPathExists(this._request.headers, "rules") &&
3454
+ if (checkObjectPathExists(this._request.headers, "rules") &&
3497
3455
  checkObjectPathExists(this._request.headers, "actions")) {
3498
3456
  const triggers = (_e = headers === null || headers === void 0 ? void 0 : headers.triggers) !== null && _e !== void 0 ? _e : [];
3499
3457
  const rules = (_f = headers === null || headers === void 0 ? void 0 : headers.rules) !== null && _f !== void 0 ? _f : [];
3500
3458
  const actions = (_h = (_g = headers) === null || _g === void 0 ? void 0 : _g.actions) !== null && _h !== void 0 ? _h : [];
3501
3459
  const rulesMapping = new Rule(rules, this._object).mapping();
3502
- for (let action of actions) {
3460
+ for (const action of actions) {
3503
3461
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
3504
3462
  if (conditionSuccess) {
3505
3463
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3508,27 +3466,23 @@ class Apis {
3508
3466
  }
3509
3467
  return this._object.API_CONFIG;
3510
3468
  }
3511
- else {
3512
- this._object = setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
3513
- return this._object.API_CONFIG;
3514
- }
3515
- }
3516
- else {
3517
3469
  this._object = setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
3518
3470
  return this._object.API_CONFIG;
3519
3471
  }
3472
+ this._object = setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
3473
+ return this._object.API_CONFIG;
3520
3474
  });
3521
3475
  }
3522
3476
  validateResponse() {
3523
3477
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
3524
3478
  return __awaiter(this, void 0, void 0, function* () {
3525
3479
  if (checkObjectKeyExists(this._response, "validation")) {
3526
- const validation = this._response.validation;
3480
+ const { validation } = this._response;
3527
3481
  const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
3528
3482
  const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
3529
3483
  const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
3530
3484
  const rulesMapping = new Rule(rules, this._object).mapping();
3531
- for (let action of actions) {
3485
+ for (const action of actions) {
3532
3486
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
3533
3487
  if (conditionSuccess) {
3534
3488
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3542,7 +3496,7 @@ class Apis {
3542
3496
  const rules = (_h = (_g = this._response) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
3543
3497
  const actions = (_k = (_j = this._response) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
3544
3498
  const rulesMapping = new Rule(rules, this._object).mapping();
3545
- for (let action of actions) {
3499
+ for (const action of actions) {
3546
3500
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
3547
3501
  if (conditionSuccess) {
3548
3502
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3560,7 +3514,7 @@ class Apis {
3560
3514
  const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
3561
3515
  const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
3562
3516
  const rulesMapping = new Rule(rules, this._object).mapping();
3563
- for (let action of actions) {
3517
+ for (const action of actions) {
3564
3518
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
3565
3519
  if (conditionSuccess) {
3566
3520
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3593,33 +3547,29 @@ __decorate([
3593
3547
  ], Apis.prototype, "callNextApi", null);
3594
3548
 
3595
3549
  class CameraHelper {
3596
- constructor(field, formFields, allFormsData, formData, previousFormData, extraData) {
3597
- this.cameraData = {};
3550
+ constructor(field, object) {
3551
+ this.activeCameraData = {};
3598
3552
  this._field = field;
3599
- this._formFields = formFields;
3600
- this._allFormsData = allFormsData;
3601
- this._formData = formData;
3602
- this._previousFormData = previousFormData;
3603
- this._extraData = extraData;
3553
+ this._object = object;
3554
+ }
3555
+ get object() {
3556
+ return this._object;
3557
+ }
3558
+ set object(value) {
3559
+ this._object = value;
3604
3560
  }
3605
3561
  getCameraWatermarkData() {
3562
+ var _a, _b;
3606
3563
  return __awaiter(this, void 0, void 0, function* () {
3607
- const sources = this._field.properties["watermarkDataSources"];
3608
- for (let source of sources) {
3609
- const sources = new Source({
3610
- FIELD_CONFIG: this._field,
3611
- FORM_FIELDS: this._formFields,
3612
- FORM_DATA: this._formData,
3613
- PREVIOUS_FORM_DATA: this._previousFormData,
3614
- ALL_FORMS_DATA: this._allFormsData,
3615
- EXTRA_DATA: this._extraData
3616
- });
3564
+ const sources = (_b = (_a = this._field.properties.features) === null || _a === void 0 ? void 0 : _a.watermark) === null || _b === void 0 ? void 0 : _b.sources;
3565
+ for (const source of sources) {
3566
+ const sources = new Source(Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }));
3617
3567
  const value = yield sources.getValueFromSource(source);
3618
3568
  if (checkObjectKeyExists(source, "id")) {
3619
- this.cameraData[source.id] = value;
3569
+ this.activeCameraData[source.id] = value;
3620
3570
  }
3621
3571
  }
3622
- return this.cameraData;
3572
+ return this.activeCameraData;
3623
3573
  });
3624
3574
  }
3625
3575
  }
@@ -3653,11 +3603,9 @@ class Tasks {
3653
3603
  }
3654
3604
  execute() {
3655
3605
  return __awaiter(this, void 0, void 0, function* () {
3656
- const triggers = this._task.triggers;
3657
- const rules = this._task.rules;
3658
- const actions = this._task.actions;
3606
+ const { triggers, rules, actions } = this._task;
3659
3607
  const rulesMapping = new Rule(rules, this._object).mapping();
3660
- for (let action of actions) {
3608
+ for (const action of actions) {
3661
3609
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
3662
3610
  if (conditionEvaluation) {
3663
3611
  const actions = new Action(action, rulesMapping, this._object, this._takeAction);
@@ -3688,6 +3636,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
3688
3636
  }]
3689
3637
  }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
3690
3638
 
3639
+ class FilterImageUrlOrBase64FromObjectPipe {
3640
+ transform(mediaFiles) {
3641
+ if (isEmptyValue(mediaFiles)) {
3642
+ return [];
3643
+ }
3644
+ return mediaFiles
3645
+ .map((item) => {
3646
+ if (isObject(item) && checkObjectKeyExists(item, "image")) {
3647
+ return item.image;
3648
+ }
3649
+ if (isNotEmptyValue(item)) {
3650
+ return item;
3651
+ }
3652
+ return null; // Use null to filter out unwanted items
3653
+ })
3654
+ .filter((item) => isNotEmptyValue(item));
3655
+ }
3656
+ }
3657
+ /** @nocollapse */ FilterImageUrlOrBase64FromObjectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterImageUrlOrBase64FromObjectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3658
+ /** @nocollapse */ FilterImageUrlOrBase64FromObjectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterImageUrlOrBase64FromObjectPipe, name: "filterImageUrlOrBase64FromObject" });
3659
+ __decorate([
3660
+ logMethod
3661
+ ], FilterImageUrlOrBase64FromObjectPipe.prototype, "transform", null);
3662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterImageUrlOrBase64FromObjectPipe, decorators: [{
3663
+ type: Pipe,
3664
+ args: [{
3665
+ name: "filterImageUrlOrBase64FromObject"
3666
+ }]
3667
+ }], propDecorators: { transform: [] } });
3668
+
3669
+ class FilterVideoUrlOrBase64FromObjectPipe {
3670
+ transform(mediaFiles) {
3671
+ if (isEmptyValue(mediaFiles)) {
3672
+ return [];
3673
+ }
3674
+ return mediaFiles
3675
+ .map((item) => {
3676
+ if (isObject(item) && checkObjectKeyExists(item, "video")) {
3677
+ return item.video;
3678
+ }
3679
+ if (isNotEmptyValue(item)) {
3680
+ return item;
3681
+ }
3682
+ return null; // Use null to filter out unwanted items
3683
+ })
3684
+ .filter((item) => isNotEmptyValue(item));
3685
+ }
3686
+ }
3687
+ /** @nocollapse */ FilterVideoUrlOrBase64FromObjectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterVideoUrlOrBase64FromObjectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3688
+ /** @nocollapse */ FilterVideoUrlOrBase64FromObjectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterVideoUrlOrBase64FromObjectPipe, name: "filterVideoUrlOrBase64FromObject" });
3689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterVideoUrlOrBase64FromObjectPipe, decorators: [{
3690
+ type: Pipe,
3691
+ args: [{
3692
+ name: "filterVideoUrlOrBase64FromObject"
3693
+ }]
3694
+ }] });
3695
+
3691
3696
  class TimerPipe {
3692
3697
  transform(value) {
3693
3698
  const minutes = Math.floor(value / 60);
@@ -3734,18 +3739,19 @@ class KwikIDFormViewComponent {
3734
3739
  this.fieldGroups = {};
3735
3740
  this.formFields = [];
3736
3741
  this.previousFormData = {};
3742
+ this.cameraData = {};
3737
3743
  this.isShowCamera = false;
3738
3744
  this.isShowCameraFullscreen = false;
3739
- this.cameraFieldKey = "";
3740
- this.cameraData = undefined;
3741
- this.cameraType = undefined;
3742
- this.cameraImage = "";
3743
- this.cameraVideo = "";
3744
- this.cameraConfig = undefined;
3745
- this.cameraRecordingTime = 0;
3746
- this.cameraRecordingTimerSubcription = undefined;
3747
- this.cameraRecordingState = "NONE";
3748
- this.cameraRecordingStateSubcription = undefined;
3745
+ this.activeCameraFieldKey = "";
3746
+ this.activeCameraData = {};
3747
+ this.activeCameraType = undefined;
3748
+ this.activeCameraImage = "";
3749
+ this.activeCameraVideo = "";
3750
+ this.activeCameraConfig = undefined;
3751
+ this.activeCameraRecordingTime = 0;
3752
+ this.activeCameraRecordingTimerSubcription = undefined;
3753
+ this.activeCameraRecordingState = "NONE";
3754
+ this.activeCameraRecordingStateSubcription = undefined;
3749
3755
  this.previewProperties = {
3750
3756
  html: {
3751
3757
  before: "",
@@ -3792,30 +3798,30 @@ class KwikIDFormViewComponent {
3792
3798
  resetCamera() {
3793
3799
  this.isShowCamera = false;
3794
3800
  this.isShowCameraFullscreen = false;
3795
- this.cameraFieldKey = "";
3796
- this.cameraData = undefined;
3797
- this.cameraType = undefined;
3798
- this.cameraImage = "";
3799
- this.cameraVideo = "";
3800
- this.cameraConfig = undefined;
3801
- this.cameraRecordingTime = 0;
3802
- this.cameraRecordingState = "NONE";
3801
+ this.activeCameraFieldKey = "";
3802
+ this.activeCameraData = undefined;
3803
+ this.activeCameraType = undefined;
3804
+ this.activeCameraImage = "";
3805
+ this.activeCameraVideo = "";
3806
+ this.activeCameraConfig = undefined;
3807
+ this.activeCameraRecordingTime = 0;
3808
+ this.activeCameraRecordingState = "NONE";
3803
3809
  }
3804
3810
  ngOnInit() {
3805
3811
  (() => __awaiter(this, void 0, void 0, function* () {
3806
3812
  const res = yield this.initFormConfig(this.formConfig);
3807
3813
  if (res) {
3808
3814
  this.loading = false;
3809
- this.cameraRecordingTimerSubcription = this.cameraRecordService
3815
+ this.activeCameraRecordingTimerSubcription = this.cameraRecordService
3810
3816
  .getTimerUpdate()
3811
3817
  .subscribe((time) => {
3812
- this.cameraRecordingTime = time;
3818
+ this.activeCameraRecordingTime = time;
3813
3819
  this.ref.detectChanges();
3814
3820
  });
3815
- this.cameraRecordingStateSubcription = this.cameraRecordService
3821
+ this.activeCameraRecordingStateSubcription = this.cameraRecordService
3816
3822
  .getRecordingState()
3817
3823
  .subscribe((state) => {
3818
- this.cameraRecordingState = state;
3824
+ this.activeCameraRecordingState = state;
3819
3825
  this.ref.detectChanges();
3820
3826
  });
3821
3827
  }
@@ -3838,7 +3844,7 @@ class KwikIDFormViewComponent {
3838
3844
  if (verifyChange("formData")) {
3839
3845
  if (checkObjectKeyExists(changes.formData.currentValue, "data") &&
3840
3846
  checkObjectKeyExists(changes.formData.currentValue, "extendedData")) {
3841
- this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue["data"]);
3847
+ this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue.data);
3842
3848
  }
3843
3849
  else {
3844
3850
  this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue);
@@ -3848,9 +3854,9 @@ class KwikIDFormViewComponent {
3848
3854
  if (isNotEmptyValue(changes.popupFormCallback.currentValue)) {
3849
3855
  const popupFormData = checkObjectKeyExists(changes.popupFormCallback.currentValue.popupFormData, "data") &&
3850
3856
  checkObjectKeyExists(changes.popupFormCallback.currentValue.popupFormData, "extendedData")
3851
- ? changes.popupFormCallback.currentValue.popupFormData["data"]
3857
+ ? changes.popupFormCallback.currentValue.popupFormData.data
3852
3858
  : changes.popupFormCallback.currentValue.popupFormData;
3853
- const popupFormConfig = changes.popupFormCallback.currentValue.popupFormConfig;
3859
+ const { popupFormConfig } = changes.popupFormCallback.currentValue;
3854
3860
  this.popupFormData = mergeObjects(this.popupFormData, {
3855
3861
  [popupFormConfig.key]: popupFormData
3856
3862
  });
@@ -3870,7 +3876,7 @@ class KwikIDFormViewComponent {
3870
3876
  }
3871
3877
  if (verifyChange("apiCallResponse")) {
3872
3878
  this.apiCallResponse = changes.apiCallResponse.currentValue;
3873
- let field = getFormFieldByKey(this.formFields, this.apiCallResponse.key);
3879
+ const field = getFormFieldByKey(this.formFields, this.apiCallResponse.key);
3874
3880
  const response = (_a = this.apiCallResponse) === null || _a === void 0 ? void 0 : _a.response;
3875
3881
  switch (field.type) {
3876
3882
  case EFieldType.FILE:
@@ -3880,7 +3886,7 @@ class KwikIDFormViewComponent {
3880
3886
  api_key: this.apiCallResponse.key,
3881
3887
  field_key: this.apiCallResponse.key,
3882
3888
  response_type: "FILE_UPLOAD_API_SUCCESS",
3883
- response: response
3889
+ response
3884
3890
  });
3885
3891
  this.updateFiles(updatedFile, "NORMAL", this.apiCallResponse.key);
3886
3892
  }
@@ -3899,14 +3905,20 @@ class KwikIDFormViewComponent {
3899
3905
  if (response) {
3900
3906
  this.resetCamera();
3901
3907
  const image = response === null || response === void 0 ? void 0 : response.image_url;
3902
- this.formData[field.key] = getObjectDeepCopy([image]);
3903
- this.mediaFiles[field.key] = getObjectDeepCopy([image]);
3904
- this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([image]), {
3908
+ const imageOcr = response === null || response === void 0 ? void 0 : response.image_ocr;
3909
+ const imageFacematch = response === null || response === void 0 ? void 0 : response.image_facematch;
3910
+ const imageWatermark = response === null || response === void 0 ? void 0 : response.image_watermark;
3911
+ const imageData = imageOcr || imageFacematch || imageWatermark
3912
+ ? Object.assign(Object.assign(Object.assign({ image }, (imageOcr && { ocr: imageOcr })), (imageFacematch && { facematch: imageFacematch })), (imageWatermark && { watermark: imageWatermark })) : image;
3913
+ this.formData[field.key] = getObjectDeepCopy([imageData]);
3914
+ this.cameraData[field.key] = getObjectDeepCopy(imageData);
3915
+ this.mediaFiles[field.key] = getObjectDeepCopy([imageData]);
3916
+ this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([imageData]), {
3905
3917
  emitEvent: false,
3906
3918
  onlySelf: false
3907
3919
  });
3908
3920
  this.formGroup.patchValue({
3909
- [field.key]: getObjectDeepCopy([image])
3921
+ [field.key]: getObjectDeepCopy([imageData])
3910
3922
  }, { emitEvent: false });
3911
3923
  this.formGroup.controls[field.key].updateValueAndValidity({
3912
3924
  emitEvent: false
@@ -3922,6 +3934,7 @@ class KwikIDFormViewComponent {
3922
3934
  FIELD_CONFIG: field,
3923
3935
  FORM_FIELDS: this.formFields,
3924
3936
  FORM_DATA: this.formData,
3937
+ CAMERA_DATA: this.cameraData,
3925
3938
  TASK_DATA: this.taskData,
3926
3939
  PREVIOUS_FORM_DATA: this.previousFormData,
3927
3940
  ALL_FORMS_DATA: this.allFormsData,
@@ -3942,7 +3955,7 @@ class KwikIDFormViewComponent {
3942
3955
  api_key: this.apiCallResponse.key,
3943
3956
  field_key: this.apiCallResponse.key,
3944
3957
  response_type: "IMAGE_UPLOAD_API_SUCCESS",
3945
- response: response
3958
+ response
3946
3959
  });
3947
3960
  }
3948
3961
  else {
@@ -3960,6 +3973,7 @@ class KwikIDFormViewComponent {
3960
3973
  this.resetCamera();
3961
3974
  const video = response === null || response === void 0 ? void 0 : response.video_url;
3962
3975
  this.formData[field.key] = getObjectDeepCopy([video]);
3976
+ this.cameraData[field.key] = getObjectDeepCopy(video);
3963
3977
  this.mediaFiles[field.key] = getObjectDeepCopy([video]);
3964
3978
  this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([video]), {
3965
3979
  emitEvent: false,
@@ -3982,6 +3996,7 @@ class KwikIDFormViewComponent {
3982
3996
  FIELD_CONFIG: field,
3983
3997
  FORM_FIELDS: this.formFields,
3984
3998
  FORM_DATA: this.formData,
3999
+ CAMERA_DATA: this.cameraData,
3985
4000
  TASK_DATA: this.taskData,
3986
4001
  PREVIOUS_FORM_DATA: this.previousFormData,
3987
4002
  ALL_FORMS_DATA: this.allFormsData,
@@ -4002,7 +4017,7 @@ class KwikIDFormViewComponent {
4002
4017
  api_key: this.apiCallResponse.key,
4003
4018
  field_key: this.apiCallResponse.key,
4004
4019
  response_type: "VIDEO_UPLOAD_API_SUCCESS",
4005
- response: response
4020
+ response
4006
4021
  });
4007
4022
  }
4008
4023
  else {
@@ -4018,7 +4033,6 @@ class KwikIDFormViewComponent {
4018
4033
  case EFieldType.LIVE_LOCATION:
4019
4034
  if (response) {
4020
4035
  this.formData[field.key] = getObjectDeepCopy(response);
4021
- this.mediaFiles[field.key] = getObjectDeepCopy(response);
4022
4036
  this.formGroup.controls[field.key].patchValue(getObjectDeepCopy(response), {
4023
4037
  emitEvent: false,
4024
4038
  onlySelf: false
@@ -4039,6 +4053,7 @@ class KwikIDFormViewComponent {
4039
4053
  API_RESPONSE: response,
4040
4054
  FORM_FIELDS: this.formFields,
4041
4055
  FORM_DATA: this.formData,
4056
+ CAMERA_DATA: this.cameraData,
4042
4057
  TASK_DATA: this.taskData,
4043
4058
  PREVIOUS_FORM_DATA: this.previousFormData,
4044
4059
  ALL_FORMS_DATA: this.allFormsData,
@@ -4055,6 +4070,7 @@ class KwikIDFormViewComponent {
4055
4070
  FIELD_CONFIG: field,
4056
4071
  FORM_FIELDS: this.formFields,
4057
4072
  FORM_DATA: this.formData,
4073
+ CAMERA_DATA: this.cameraData,
4058
4074
  TASK_DATA: this.taskData,
4059
4075
  PREVIOUS_FORM_DATA: this.previousFormData,
4060
4076
  ALL_FORMS_DATA: this.allFormsData,
@@ -4076,7 +4092,7 @@ class KwikIDFormViewComponent {
4076
4092
  api_key: this.apiCallResponse.key,
4077
4093
  field_key: this.apiCallResponse.key,
4078
4094
  response_type: "REVERSE_LAT_LONG_API_SUCCESS",
4079
- response: response
4095
+ response
4080
4096
  });
4081
4097
  }
4082
4098
  else {
@@ -4091,6 +4107,7 @@ class KwikIDFormViewComponent {
4091
4107
  API_RESPONSE: {},
4092
4108
  FORM_FIELDS: this.formFields,
4093
4109
  FORM_DATA: this.formData,
4110
+ CAMERA_DATA: this.cameraData,
4094
4111
  TASK_DATA: this.taskData,
4095
4112
  PREVIOUS_FORM_DATA: this.previousFormData,
4096
4113
  ALL_FORMS_DATA: this.allFormsData,
@@ -4114,15 +4131,15 @@ class KwikIDFormViewComponent {
4114
4131
  let field = getFormFieldByKey(this.formFields, (_d = this.buttonClickResponse) === null || _d === void 0 ? void 0 : _d.key);
4115
4132
  if (checkObjectKeyExists(this.buttonClickResponse, "default")) {
4116
4133
  field.default = getObjectDeepCopy(this.buttonClickResponse.default);
4117
- delete this.buttonClickResponse["default"];
4134
+ delete this.buttonClickResponse.default;
4118
4135
  }
4119
4136
  if (checkObjectKeyExists(this.buttonClickResponse, "messages")) {
4120
4137
  field.messages = getObjectDeepCopy(this.buttonClickResponse.messages);
4121
- delete this.buttonClickResponse["messages"];
4138
+ delete this.buttonClickResponse.messages;
4122
4139
  }
4123
4140
  if (checkObjectKeyExists(this.buttonClickResponse, "validation")) {
4124
4141
  field.validation = getObjectDeepCopy(this.buttonClickResponse.validation);
4125
- delete this.buttonClickResponse["validation"];
4142
+ delete this.buttonClickResponse.validation;
4126
4143
  }
4127
4144
  field = getObjectDeepCopy(mergeObjects(field, this.buttonClickResponse));
4128
4145
  if (checkObjectKeyExists(field, "validation")) {
@@ -4132,6 +4149,7 @@ class KwikIDFormViewComponent {
4132
4149
  FIELD_CONFIG: field,
4133
4150
  FORM_FIELDS: this.formFields,
4134
4151
  FORM_DATA: this.formData,
4152
+ CAMERA_DATA: this.cameraData,
4135
4153
  TASK_DATA: this.taskData,
4136
4154
  PREVIOUS_FORM_DATA: this.previousFormData,
4137
4155
  ALL_FORMS_DATA: this.allFormsData,
@@ -4155,11 +4173,11 @@ class KwikIDFormViewComponent {
4155
4173
  }
4156
4174
  }
4157
4175
  ngOnDestroy() {
4158
- if (this.cameraRecordingTimerSubcription) {
4159
- this.cameraRecordingTimerSubcription.unsubscribe();
4176
+ if (this.activeCameraRecordingTimerSubcription) {
4177
+ this.activeCameraRecordingTimerSubcription.unsubscribe();
4160
4178
  }
4161
- if (this.cameraRecordingStateSubcription) {
4162
- this.cameraRecordingStateSubcription.unsubscribe();
4179
+ if (this.activeCameraRecordingStateSubcription) {
4180
+ this.activeCameraRecordingStateSubcription.unsubscribe();
4163
4181
  }
4164
4182
  }
4165
4183
  triggerLogs(eventType, logs) {
@@ -4185,11 +4203,12 @@ class KwikIDFormViewComponent {
4185
4203
  if (checkObjectKeyExists(this.formConfig, "tasks") &&
4186
4204
  checkObjectKeyExists(this.formConfig.tasks, "pre")) {
4187
4205
  this.triggerLogs(ELogEventType$1.FORM__TASK_PRE, {});
4188
- for (let preTask of this.formConfig.tasks.pre) {
4206
+ for (const preTask of this.formConfig.tasks.pre) {
4189
4207
  const task = new Tasks(preTask, {
4190
4208
  FORM_CONFIG: this.formConfig,
4191
4209
  FORM_FIELDS: this.formFields,
4192
4210
  FORM_DATA: this.formData,
4211
+ CAMERA_DATA: this.cameraData,
4193
4212
  TASK_DATA: this.taskData,
4194
4213
  PREVIOUS_FORM_DATA: this.previousFormData,
4195
4214
  ALL_FORMS_DATA: this.allFormsData,
@@ -4210,7 +4229,7 @@ class KwikIDFormViewComponent {
4210
4229
  clearInterval(intervalId);
4211
4230
  resolve();
4212
4231
  }
4213
- }, 10);
4232
+ }, FORM_VIEW_TIMERS.WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK);
4214
4233
  });
4215
4234
  if (this.stopTaskExecution) {
4216
4235
  break;
@@ -4221,16 +4240,24 @@ class KwikIDFormViewComponent {
4221
4240
  if (this.stopTaskExecution) {
4222
4241
  return false;
4223
4242
  }
4224
- this.formGroup = yield this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.extraData, this.takeAction.bind(this));
4243
+ this.formGroup = yield this.formViewService.createFormGroup(this.formFields, {
4244
+ FORM_CONFIG: this.formConfig,
4245
+ FORM_DATA: this.formData,
4246
+ CAMERA_DATA: this.cameraData,
4247
+ TASK_DATA: this.taskData,
4248
+ PREVIOUS_FORM_DATA: this.previousFormData,
4249
+ ALL_FORMS_DATA: this.allFormsData,
4250
+ EXTRA_DATA: this.extraData
4251
+ }, this.takeAction.bind(this));
4225
4252
  /**
4226
4253
  * For some reason if their a field of type 'IMAGE' then
4227
4254
  * formData is adding a 'undefined' key with last image's value from the array.
4228
4255
  * Below piece of code is to remove that redundent value from formData.
4229
4256
  */
4230
4257
  if (checkObjectKeyExists(this.formData, "undefined")) {
4231
- delete this.formData["undefined"];
4258
+ delete this.formData.undefined;
4232
4259
  }
4233
- for (let field of this.formFields) {
4260
+ for (const field of this.formFields) {
4234
4261
  if (field.isFormElement) {
4235
4262
  this.previousFormData = Object.assign(Object.assign({}, this.previousFormData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
4236
4263
  this.formData = Object.assign(Object.assign({}, this.formData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
@@ -4239,10 +4266,12 @@ class KwikIDFormViewComponent {
4239
4266
  }
4240
4267
  if (field.type === EFieldType.CAPTURE) {
4241
4268
  this.resetCamera();
4269
+ this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
4242
4270
  this.mediaFiles[field.key] = this.formGroup.controls[field.key].value;
4243
4271
  }
4244
4272
  if (field.type === EFieldType.RECORD) {
4245
4273
  this.resetCamera();
4274
+ this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
4246
4275
  this.mediaFiles[field.key] = this.formGroup.controls[field.key].value;
4247
4276
  }
4248
4277
  this.formGroup.controls[field.key].valueChanges
@@ -4255,16 +4284,18 @@ class KwikIDFormViewComponent {
4255
4284
  }
4256
4285
  if (field.type === EFieldType.CAPTURE) {
4257
4286
  this.resetCamera();
4287
+ this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, currentValue) });
4258
4288
  this.mediaFiles[field.key] = currentValue;
4259
4289
  }
4260
4290
  if (field.type === EFieldType.RECORD) {
4261
4291
  this.resetCamera();
4292
+ this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, currentValue) });
4262
4293
  this.mediaFiles[field.key] = currentValue;
4263
4294
  }
4264
4295
  });
4265
4296
  }
4266
4297
  }
4267
- for (let field of this.formFields) {
4298
+ for (const field of this.formFields) {
4268
4299
  if (field.isFormElement) {
4269
4300
  if (checkObjectKeyExists(field, "validation")) {
4270
4301
  if (field.validation.triggers.includes("ON_INIT")) {
@@ -4272,6 +4303,7 @@ class KwikIDFormViewComponent {
4272
4303
  FIELD_CONFIG: field,
4273
4304
  FORM_FIELDS: this.formFields,
4274
4305
  FORM_DATA: this.formData,
4306
+ CAMERA_DATA: this.cameraData,
4275
4307
  TASK_DATA: this.taskData,
4276
4308
  PREVIOUS_FORM_DATA: this.previousFormData,
4277
4309
  ALL_FORMS_DATA: this.allFormsData,
@@ -4308,7 +4340,7 @@ class KwikIDFormViewComponent {
4308
4340
  const formData = this.allFormsData[this.formConfig.key];
4309
4341
  if (checkObjectKeyExists(formData, "data") &&
4310
4342
  checkObjectKeyExists(formData, "extendedData")) {
4311
- this.formData = Object.assign(Object.assign({}, this.formData), formData["data"]);
4343
+ this.formData = Object.assign(Object.assign({}, this.formData), formData.data);
4312
4344
  }
4313
4345
  else {
4314
4346
  this.formData = Object.assign(Object.assign({}, this.formData), formData);
@@ -4324,18 +4356,20 @@ class KwikIDFormViewComponent {
4324
4356
  const rulesMapping = new Rule(childFieldGroupConfig.rules, {
4325
4357
  FIELD_CONFIG: parentField,
4326
4358
  FORM_DATA: this.formData,
4359
+ CAMERA_DATA: this.cameraData,
4327
4360
  TASK_DATA: this.taskData,
4328
4361
  PREVIOUS_FORM_DATA: this.previousFormData,
4329
4362
  ALL_FORMS_DATA: this.allFormsData,
4330
4363
  EXTRA_DATA: this.extraData
4331
4364
  }).mapping();
4332
- for (let action of childFieldGroupConfig.actions) {
4365
+ for (const action of childFieldGroupConfig.actions) {
4333
4366
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
4334
4367
  if (conditionSuccess) {
4335
4368
  const actions = new Action(action, rulesMapping, {
4336
4369
  FIELD_CONFIG: parentField,
4337
4370
  FORM_FIELDS: this.formFields,
4338
4371
  FORM_DATA: this.formData,
4372
+ CAMERA_DATA: this.cameraData,
4339
4373
  TASK_DATA: this.taskData,
4340
4374
  PREVIOUS_FORM_DATA: this.previousFormData,
4341
4375
  ALL_FORMS_DATA: this.allFormsData,
@@ -4362,18 +4396,20 @@ class KwikIDFormViewComponent {
4362
4396
  const rulesMapping = new Rule(connectedFieldConfig.rules, {
4363
4397
  FIELD_CONFIG: connectedField,
4364
4398
  FORM_DATA: this.formData,
4399
+ CAMERA_DATA: this.cameraData,
4365
4400
  TASK_DATA: this.taskData,
4366
4401
  PREVIOUS_FORM_DATA: this.previousFormData,
4367
4402
  ALL_FORMS_DATA: this.allFormsData,
4368
4403
  EXTRA_DATA: this.extraData
4369
4404
  }).mapping();
4370
- for (let action of connectedFieldConfig.actions) {
4405
+ for (const action of connectedFieldConfig.actions) {
4371
4406
  const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
4372
4407
  if (conditionSuccess) {
4373
4408
  const actions = new Action(action, rulesMapping, {
4374
4409
  FORM_FIELDS: this.formFields,
4375
4410
  FIELD_CONFIG: connectedField,
4376
4411
  FORM_DATA: this.formData,
4412
+ CAMERA_DATA: this.cameraData,
4377
4413
  TASK_DATA: this.taskData,
4378
4414
  PREVIOUS_FORM_DATA: this.previousFormData,
4379
4415
  ALL_FORMS_DATA: this.allFormsData,
@@ -4388,7 +4424,7 @@ class KwikIDFormViewComponent {
4388
4424
  }
4389
4425
  handleConnectedElementFields(currentField, connectedFieldConfig, eventType, nested) {
4390
4426
  return __awaiter(this, void 0, void 0, function* () {
4391
- let connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
4427
+ let connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig.key);
4392
4428
  if (checkObjectKeyExists(connectedFieldConfig, "triggers")) {
4393
4429
  if (connectedFieldConfig.triggers.includes(eventType)) {
4394
4430
  connectedField = yield this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField);
@@ -4408,14 +4444,14 @@ class KwikIDFormViewComponent {
4408
4444
  if (currentField !== undefined) {
4409
4445
  if (checkObjectKeyExists(currentField, "connectedElements")) {
4410
4446
  if (checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) {
4411
- let connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
4412
- for (let connectedFieldGroupConfig of connectedFieldGroups) {
4447
+ const { connectedFieldGroups } = currentField.connectedElements;
4448
+ for (const connectedFieldGroupConfig of connectedFieldGroups) {
4413
4449
  yield this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType);
4414
4450
  }
4415
4451
  }
4416
4452
  if (checkObjectKeyExists(currentField.connectedElements, "connectedFields")) {
4417
- let connectedFields = currentField.connectedElements.connectedFields;
4418
- for (let connectedFieldConfig of connectedFields) {
4453
+ const { connectedFields } = currentField.connectedElements;
4454
+ for (const connectedFieldConfig of connectedFields) {
4419
4455
  currentField = yield this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType);
4420
4456
  }
4421
4457
  }
@@ -4429,7 +4465,7 @@ class KwikIDFormViewComponent {
4429
4465
  handleRemovedFile(e) {
4430
4466
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
4431
4467
  this.showApiLoader();
4432
- if (this.formGroup["controls"][e.key].enabled) {
4468
+ if (this.formGroup.controls[e.key].enabled) {
4433
4469
  this.files[e.key] = e.files;
4434
4470
  this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
4435
4471
  this.formGroup.patchValue({
@@ -4444,7 +4480,7 @@ class KwikIDFormViewComponent {
4444
4480
  key: field === null || field === void 0 ? void 0 : field.key,
4445
4481
  type: field === null || field === void 0 ? void 0 : field.type,
4446
4482
  payload: {
4447
- field: field,
4483
+ field,
4448
4484
  event: e
4449
4485
  }
4450
4486
  });
@@ -4454,7 +4490,7 @@ class KwikIDFormViewComponent {
4454
4490
  return __awaiter(this, void 0, void 0, function* () {
4455
4491
  this.showApiLoader();
4456
4492
  const field = getFormFieldByKey(this.formFields, e.key);
4457
- let values = Array.isArray(e.value) ? e.value : [e.value];
4493
+ const values = Array.isArray(e.value) ? e.value : [e.value];
4458
4494
  if (checkObjectKeyExists(field, "properties") &&
4459
4495
  checkObjectKeyExists(field.properties, "uploadFileToServer") &&
4460
4496
  field.properties.uploadFileToServer) {
@@ -4476,7 +4512,7 @@ class KwikIDFormViewComponent {
4476
4512
  lastModified: value.lastModified,
4477
4513
  webkitRelativePath: value.webkitRelativePath
4478
4514
  });
4479
- }, 300); // 1000 ms = 1 sec
4515
+ }, FORM_VIEW_TIMERS.WAIT_FOR_FILE_METADATA_DEEPCOPY); // 1000 ms = 1 sec
4480
4516
  }));
4481
4517
  this.updateFiles(updatedFile, "NORMAL", e.key);
4482
4518
  }
@@ -4487,20 +4523,49 @@ class KwikIDFormViewComponent {
4487
4523
  /** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
4488
4524
  handleOnClickGetRemovedMediaFile(e) {
4489
4525
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
4490
- this.showApiLoader();
4491
- if (this.formGroup["controls"][e.key].enabled) {
4526
+ if (this.formGroup.controls[e.key].enabled) {
4527
+ this.showApiLoader();
4528
+ const field = getFormFieldByKey(this.formFields, e.key);
4492
4529
  this.resetCamera();
4493
4530
  this.mediaFiles[e.key] = e.mediaFiles;
4494
4531
  this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
4532
+ this.cameraData[e.key] = convertFormFieldValueToStandardFormat(field, this.formData[e.key]);
4495
4533
  this.formGroup.patchValue({
4496
4534
  [e.key]: this.formData[e.key]
4497
4535
  }, { emitEvent: false });
4498
4536
  this.triggerLogs(ELogEventType$1.FORM__FIELD_MEDIA_FILE_REMOVE, Object.assign(Object.assign(Object.assign({ field_key: e.key }, ((_b = (_a = e.file) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : { file_name: (_c = e.file) === null || _c === void 0 ? void 0 : _c.name })), ((_e = (_d = e.file) === null || _d === void 0 ? void 0 : _d.size) !== null && _e !== void 0 ? _e : { file_size: (_f = e.file) === null || _f === void 0 ? void 0 : _f.size })), ((_h = (_g = e.file) === null || _g === void 0 ? void 0 : _g.type) !== null && _h !== void 0 ? _h : { file_type: (_j = e.file) === null || _j === void 0 ? void 0 : _j.type })));
4537
+ this.getUnsavedDataState.emit(true);
4538
+ if (field.isFormElement &&
4539
+ checkObjectKeyExists(field, "validation") &&
4540
+ field.validation.triggers.includes("ON_CHANGE")) {
4541
+ const ruleEngine = new RuleEngine({
4542
+ FIELD_CONFIG: field,
4543
+ FORM_FIELDS: this.formFields,
4544
+ FORM_DATA: this.formData,
4545
+ CAMERA_DATA: this.cameraData,
4546
+ TASK_DATA: this.taskData,
4547
+ PREVIOUS_FORM_DATA: this.previousFormData,
4548
+ ALL_FORMS_DATA: this.allFormsData,
4549
+ EXTRA_DATA: this.extraData
4550
+ }, this.takeAction.bind(this));
4551
+ (() => __awaiter(this, void 0, void 0, function* () {
4552
+ yield ruleEngine.run(field.validation);
4553
+ }))();
4554
+ }
4555
+ if (field.isFormElement &&
4556
+ checkObjectKeyExists(field, "connectedElements")) {
4557
+ this.handleConnectedElements({
4558
+ key: field.key,
4559
+ value: this.formGroup.controls[field.key].value
4560
+ }, "ON_CHANGE");
4561
+ }
4562
+ setTimeout(() => {
4563
+ this.hideApiLoader();
4564
+ }, 500);
4499
4565
  }
4500
- this.hideApiLoader();
4501
4566
  }
4502
4567
  handleOnClickInputCamera(e, field) {
4503
- var _a, _b, _c, _d, _e, _f;
4568
+ var _a, _b, _c, _d, _e, _f, _g;
4504
4569
  return __awaiter(this, void 0, void 0, function* () {
4505
4570
  this.loaderService.show({
4506
4571
  loaderText: "Loading Camera...",
@@ -4508,32 +4573,39 @@ class KwikIDFormViewComponent {
4508
4573
  });
4509
4574
  const fieldKey = field.key;
4510
4575
  const fieldcameraConfig = (_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.cameraConfig) !== null && _b !== void 0 ? _b : {};
4511
- this.cameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
4512
- this.cameraFieldKey = fieldKey;
4576
+ this.activeCameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
4577
+ this.activeCameraFieldKey = fieldKey;
4513
4578
  this.triggerLogs(ELogEventType$1.FORM__FIELD_CAMERA_BUTTON_CLICK, {
4514
4579
  field_key: field.key,
4515
4580
  field_type: field.type,
4516
- camera_type: this.cameraType
4581
+ camera_type: this.activeCameraType
4517
4582
  });
4518
- switch (this.cameraType) {
4583
+ switch (this.activeCameraType) {
4519
4584
  case "CAPTURE":
4520
- this.cameraConfig = mergeObjectsDeep([
4585
+ this.activeCameraConfig = mergeObjectsDeep([
4521
4586
  FIELD_PROPERTIES.capture.cameraConfig,
4522
4587
  fieldcameraConfig
4523
4588
  ]);
4524
- if (((_d = (_c = this.cameraConfig) === null || _c === void 0 ? void 0 : _c.others) === null || _d === void 0 ? void 0 : _d.isWatermark) ||
4525
- ((_f = (_e = this.cameraConfig) === null || _e === void 0 ? void 0 : _e.others) === null || _f === void 0 ? void 0 : _f.isWatermarkForImageUpload)) {
4526
- const cameraHelper = new CameraHelper(field, this.formFields, this.allFormsData, this.formData, this.previousFormData, this.extraData);
4527
- this.cameraData = {
4589
+ this.activeCameraData = {};
4590
+ if (((_e = (_d = (_c = this.activeCameraConfig) === null || _c === void 0 ? void 0 : _c.features) === null || _d === void 0 ? void 0 : _d.watermark) === null || _e === void 0 ? void 0 : _e.isEnabled) &&
4591
+ !((_g = (_f = this.activeCameraConfig.features) === null || _f === void 0 ? void 0 : _f.watermark) === null || _g === void 0 ? void 0 : _g.isWatermarkForServer)) {
4592
+ const cameraHelper = new CameraHelper(field, {
4593
+ FORM_FIELDS: this.formFields,
4594
+ FIELD_CONFIG: field,
4595
+ FORM_DATA: this.formData,
4596
+ CAMERA_DATA: this.cameraData,
4597
+ TASK_DATA: this.taskData,
4598
+ PREVIOUS_FORM_DATA: this.previousFormData,
4599
+ ALL_FORMS_DATA: this.allFormsData,
4600
+ EXTRA_DATA: this.extraData
4601
+ });
4602
+ this.activeCameraData = {
4528
4603
  watermark: yield cameraHelper.getCameraWatermarkData()
4529
4604
  };
4530
4605
  }
4531
- else {
4532
- this.cameraData = undefined;
4533
- }
4534
4606
  break;
4535
4607
  case "RECORD":
4536
- this.cameraConfig = mergeObjectsDeep([
4608
+ this.activeCameraConfig = mergeObjectsDeep([
4537
4609
  FIELD_PROPERTIES.record.cameraConfig,
4538
4610
  fieldcameraConfig
4539
4611
  ]);
@@ -4553,22 +4625,35 @@ class KwikIDFormViewComponent {
4553
4625
  /** CameraType = CAPTURE */
4554
4626
  setCameraMedia(media) {
4555
4627
  return __awaiter(this, void 0, void 0, function* () {
4556
- const field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
4628
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4557
4629
  if (checkObjectKeyExists(field, "properties") &&
4558
4630
  checkObjectKeyExists(field.properties, "uploadFileToServer") &&
4559
4631
  field.properties.uploadFileToServer) {
4560
4632
  yield this.uploadFile(field, media);
4561
4633
  }
4562
4634
  else {
4635
+ const activeCameraData = this.activeCameraData;
4563
4636
  this.resetCamera();
4564
- this.formData[field.key] = getObjectDeepCopy([media]);
4565
- this.mediaFiles[field.key] = getObjectDeepCopy([media]);
4566
- this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([media]), {
4637
+ let updatedMedia = {};
4638
+ switch (field.type) {
4639
+ case EFieldType.CAPTURE:
4640
+ updatedMedia = Object.assign(Object.assign({}, (isNotEmptyValue(activeCameraData) ? activeCameraData : {})), { image: media });
4641
+ break;
4642
+ case EFieldType.RECORD:
4643
+ updatedMedia = Object.assign(Object.assign({}, (isNotEmptyValue(activeCameraData) ? activeCameraData : {})), { video: media });
4644
+ break;
4645
+ default:
4646
+ break;
4647
+ }
4648
+ this.formData[field.key] = getObjectDeepCopy([updatedMedia]);
4649
+ this.cameraData[field.key] = getObjectDeepCopy(updatedMedia);
4650
+ this.mediaFiles[field.key] = getObjectDeepCopy([updatedMedia]);
4651
+ this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([updatedMedia]), {
4567
4652
  emitEvent: false,
4568
4653
  onlySelf: false
4569
4654
  });
4570
4655
  this.formGroup.patchValue({
4571
- [field.key]: getObjectDeepCopy([media])
4656
+ [field.key]: getObjectDeepCopy([updatedMedia])
4572
4657
  }, { emitEvent: false });
4573
4658
  this.formGroup.controls[field.key].updateValueAndValidity({
4574
4659
  emitEvent: false
@@ -4584,6 +4669,7 @@ class KwikIDFormViewComponent {
4584
4669
  FIELD_CONFIG: field,
4585
4670
  FORM_FIELDS: this.formFields,
4586
4671
  FORM_DATA: this.formData,
4672
+ CAMERA_DATA: this.cameraData,
4587
4673
  TASK_DATA: this.taskData,
4588
4674
  PREVIOUS_FORM_DATA: this.previousFormData,
4589
4675
  ALL_FORMS_DATA: this.allFormsData,
@@ -4608,11 +4694,11 @@ class KwikIDFormViewComponent {
4608
4694
  });
4609
4695
  }
4610
4696
  /** Camera Common Methods */
4611
- handleGetCameraMedia(e, cameraType) {
4612
- switch (cameraType) {
4697
+ handleGetCameraMedia(e, activeCameraType) {
4698
+ switch (activeCameraType) {
4613
4699
  case "CAPTURE":
4614
4700
  this.showApiLoader();
4615
- this.cameraImage = "";
4701
+ this.activeCameraImage = "";
4616
4702
  setTimeout(() => {
4617
4703
  var _a, _b, _c, _d, _e, _f, _g;
4618
4704
  /**
@@ -4623,76 +4709,97 @@ class KwikIDFormViewComponent {
4623
4709
  *
4624
4710
  * If no masked or cropped image is available then directly set Original Image
4625
4711
  */
4626
- const field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
4712
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4627
4713
  const image = ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.isMaskedImage)
4628
4714
  ? (_b = e === null || e === void 0 ? void 0 : e.maskedImage) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.originalImage
4629
4715
  : ((_c = field.properties) === null || _c === void 0 ? void 0 : _c.isCroppedImage)
4630
4716
  ? (_d = e === null || e === void 0 ? void 0 : e.croppedImage) !== null && _d !== void 0 ? _d : e === null || e === void 0 ? void 0 : e.originalImage
4631
4717
  : e === null || e === void 0 ? void 0 : e.originalImage;
4632
- const isShowImagePreview = (_g = (_f = (_e = this.cameraConfig) === null || _e === void 0 ? void 0 : _e.others) === null || _f === void 0 ? void 0 : _f.preview) === null || _g === void 0 ? void 0 : _g.show;
4718
+ const isShowImagePreview = (_g = (_f = (_e = this.activeCameraConfig) === null || _e === void 0 ? void 0 : _e.others) === null || _f === void 0 ? void 0 : _f.preview) === null || _g === void 0 ? void 0 : _g.show;
4633
4719
  if (isShowImagePreview) {
4634
- this.cameraImage = image;
4720
+ this.activeCameraImage = image;
4635
4721
  }
4636
4722
  else {
4637
4723
  this.setCameraMedia(image);
4638
4724
  }
4639
4725
  this.hideApiLoader();
4640
- }, 500); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
4726
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
4641
4727
  break;
4642
4728
  case "RECORD":
4643
4729
  this.showApiLoader();
4644
- this.cameraVideo = "";
4730
+ this.activeCameraVideo = "";
4645
4731
  setTimeout(() => {
4646
4732
  var _a, _b, _c;
4647
4733
  /**
4648
4734
  * Priority of Image to Set for Config Based
4649
4735
  * 1. Original
4650
4736
  */
4651
- const field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
4737
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4652
4738
  const video = e === null || e === void 0 ? void 0 : e.originalVideo;
4653
- const isShowVideoPreview = (_c = (_b = (_a = this.cameraConfig) === null || _a === void 0 ? void 0 : _a.others) === null || _b === void 0 ? void 0 : _b.preview) === null || _c === void 0 ? void 0 : _c.show;
4739
+ const isShowVideoPreview = (_c = (_b = (_a = this.activeCameraConfig) === null || _a === void 0 ? void 0 : _a.others) === null || _b === void 0 ? void 0 : _b.preview) === null || _c === void 0 ? void 0 : _c.show;
4654
4740
  if (isShowVideoPreview) {
4655
- this.cameraVideo = video;
4741
+ this.activeCameraVideo = video;
4656
4742
  }
4657
4743
  else {
4658
4744
  this.setCameraMedia(video);
4659
4745
  }
4660
4746
  this.hideApiLoader();
4661
- }, 500); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
4747
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
4662
4748
  break;
4663
4749
  default:
4664
4750
  break;
4665
4751
  }
4666
4752
  }
4667
- handleOnClickSaveCameraMedia(e, cameraType) {
4753
+ handleOnClickSaveCameraMedia(e, activeCameraType) {
4668
4754
  this.showApiLoader();
4669
- const field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
4755
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4670
4756
  this.triggerLogs(ELogEventType$1.FORM__CAMERA_SAVE_BUTTON_CLICK, {
4671
4757
  field_key: field.key,
4672
4758
  field_type: field.type,
4673
- camera_type: cameraType
4759
+ camera_type: activeCameraType
4674
4760
  });
4675
- switch (cameraType) {
4761
+ switch (activeCameraType) {
4676
4762
  case "CAPTURE":
4677
- this.cameraImage = "";
4763
+ this.activeCameraImage = "";
4678
4764
  setTimeout(() => {
4679
- const image = e === null || e === void 0 ? void 0 : e.originalImage;
4765
+ var _a, _b, _c, _d;
4766
+ /**
4767
+ * Priority of Image to Set for Config Based
4768
+ * 1. Masked
4769
+ * 2. Cropped
4770
+ * 3. Original
4771
+ *
4772
+ * If no masked or cropped image is available then directly set Original Image
4773
+ */
4774
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4775
+ const image = ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.isMaskedImage)
4776
+ ? (_b = e === null || e === void 0 ? void 0 : e.maskedImage) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.originalImage
4777
+ : ((_c = field.properties) === null || _c === void 0 ? void 0 : _c.isCroppedImage)
4778
+ ? (_d = e === null || e === void 0 ? void 0 : e.croppedImage) !== null && _d !== void 0 ? _d : e === null || e === void 0 ? void 0 : e.originalImage
4779
+ : e === null || e === void 0 ? void 0 : e.originalImage;
4680
4780
  this.setCameraMedia(image);
4681
4781
  this.hideApiLoader();
4682
- }, 500);
4782
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
4683
4783
  break;
4684
4784
  case "RECORD":
4685
- this.cameraVideo = "";
4785
+ this.activeCameraVideo = "";
4686
4786
  setTimeout(() => {
4787
+ /**
4788
+ * Priority of Image to Set for Config Based
4789
+ * 1. Original
4790
+ */
4791
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4687
4792
  const video = e === null || e === void 0 ? void 0 : e.originalVideo;
4688
4793
  this.setCameraMedia(video);
4689
4794
  this.hideApiLoader();
4690
- }, 500);
4795
+ }, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
4796
+ break;
4797
+ default:
4691
4798
  break;
4692
4799
  }
4693
4800
  }
4694
4801
  handleOnClickCameraBack(e) {
4695
- const field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
4802
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4696
4803
  this.triggerLogs(ELogEventType$1.FORM__CAMERA_BACK_BUTTON_CLICK, {
4697
4804
  field_key: field.key,
4698
4805
  field_type: field.type
@@ -4700,7 +4807,7 @@ class KwikIDFormViewComponent {
4700
4807
  this.resetCamera();
4701
4808
  }
4702
4809
  handleOnClickCameraClose(e) {
4703
- const field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
4810
+ const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
4704
4811
  this.triggerLogs(ELogEventType$1.FORM__CAMERA_CLOSE_BUTTON_CLICK, {
4705
4812
  field_key: field.key,
4706
4813
  field_type: field.type
@@ -4712,7 +4819,7 @@ class KwikIDFormViewComponent {
4712
4819
  */
4713
4820
  updateFiles(file, state, key) {
4714
4821
  var _a;
4715
- const fileWithState = mergeObjects(file, { state: state });
4822
+ const fileWithState = mergeObjects(file, { state });
4716
4823
  const field = getFormFieldByKey(this.formFields, key);
4717
4824
  if ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.multiple) {
4718
4825
  // If field.properties?.multiple is true, it means multiple files are allowed for this field.
@@ -4749,6 +4856,7 @@ class KwikIDFormViewComponent {
4749
4856
  FIELD_CONFIG: field,
4750
4857
  FORM_FIELDS: this.formFields,
4751
4858
  FORM_DATA: this.formData,
4859
+ CAMERA_DATA: this.cameraData,
4752
4860
  TASK_DATA: this.taskData,
4753
4861
  PREVIOUS_FORM_DATA: this.previousFormData,
4754
4862
  ALL_FORMS_DATA: this.allFormsData,
@@ -4770,6 +4878,7 @@ class KwikIDFormViewComponent {
4770
4878
  * This is a api upload mocking method. Set's to loading at first at point when API is called and then changes the status to random status after 2 seconds of delay showing a mocked response from API.
4771
4879
  */
4772
4880
  uploadFile(field, file) {
4881
+ var _a, _b, _c, _d, _e, _f;
4773
4882
  return __awaiter(this, void 0, void 0, function* () {
4774
4883
  switch (field.type) {
4775
4884
  case EFieldType.FILE:
@@ -4791,7 +4900,7 @@ class KwikIDFormViewComponent {
4791
4900
  key: field.key,
4792
4901
  type: field.type,
4793
4902
  payload: {
4794
- file: file,
4903
+ file,
4795
4904
  metadata: {
4796
4905
  name: file.name,
4797
4906
  type: file.type,
@@ -4806,28 +4915,91 @@ class KwikIDFormViewComponent {
4806
4915
  this.updateFiles(file, "ERROR", field.key);
4807
4916
  }
4808
4917
  break;
4809
- case EFieldType.CAPTURE:
4918
+ case EFieldType.CAPTURE: {
4810
4919
  // Actual API Call
4920
+ let ocrPayload = {};
4921
+ if (isNotEmptyValue((_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.ocr)) {
4922
+ ocrPayload = field.properties.features.ocr;
4923
+ }
4924
+ const facematchPayload = {};
4925
+ if (isNotEmptyValue((_d = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.features) === null || _d === void 0 ? void 0 : _d.facematch)) {
4926
+ facematchPayload.isEnabled =
4927
+ field.properties.features.facematch.isEnabled;
4928
+ facematchPayload.isFacematchFromServer =
4929
+ field.properties.features.facematch.isFacematchFromServer;
4930
+ facematchPayload.images = [];
4931
+ const facematchSources = field.properties.features.facematch.sources;
4932
+ for (const facematchSourceConfig of facematchSources) {
4933
+ const source = new Source({
4934
+ FIELD_CONFIG: field,
4935
+ FORM_FIELDS: this.formFields,
4936
+ FORM_DATA: this.formData,
4937
+ CAMERA_DATA: this.cameraData,
4938
+ TASK_DATA: this.taskData,
4939
+ PREVIOUS_FORM_DATA: this.previousFormData,
4940
+ ALL_FORMS_DATA: this.allFormsData,
4941
+ EXTRA_DATA: this.extraData
4942
+ });
4943
+ const sourceValue = yield source.getValueFromSource(facematchSourceConfig);
4944
+ const facematchSource = {
4945
+ key: facematchSourceConfig.id,
4946
+ value: sourceValue
4947
+ };
4948
+ facematchPayload.images.push(facematchSource);
4949
+ }
4950
+ }
4951
+ const watermarkPayload = {};
4952
+ if (isNotEmptyValue((_f = (_e = field === null || field === void 0 ? void 0 : field.properties) === null || _e === void 0 ? void 0 : _e.features) === null || _f === void 0 ? void 0 : _f.watermark)) {
4953
+ watermarkPayload.isEnabled =
4954
+ field.properties.features.watermark.isEnabled;
4955
+ watermarkPayload.isWatermarkFromServer =
4956
+ field.properties.features.watermark.isWatermarkFromServer;
4957
+ watermarkPayload.data = [];
4958
+ const watermarkSources = field.properties.features.watermark.sources;
4959
+ watermarkPayload.config = field.properties.features.watermark.sources;
4960
+ for (const watermarkSourceConfig of watermarkSources) {
4961
+ const source = new Source({
4962
+ FIELD_CONFIG: field,
4963
+ FORM_FIELDS: this.formFields,
4964
+ FORM_DATA: this.formData,
4965
+ CAMERA_DATA: this.cameraData,
4966
+ TASK_DATA: this.taskData,
4967
+ PREVIOUS_FORM_DATA: this.previousFormData,
4968
+ ALL_FORMS_DATA: this.allFormsData,
4969
+ EXTRA_DATA: this.extraData
4970
+ });
4971
+ const sourceValue = yield source.getValueFromSource(watermarkSourceConfig);
4972
+ const watermarkSource = {
4973
+ key: watermarkSourceConfig.id,
4974
+ value: sourceValue
4975
+ };
4976
+ watermarkPayload.data.push(watermarkSource);
4977
+ }
4978
+ }
4979
+ const imageUploadPayload = Object.assign(Object.assign(Object.assign({ image: file }, ((ocrPayload === null || ocrPayload === void 0 ? void 0 : ocrPayload.isEnabled) && {
4980
+ ocr: ocrPayload
4981
+ })), ((facematchPayload === null || facematchPayload === void 0 ? void 0 : facematchPayload.isEnabled) && {
4982
+ facematch: facematchPayload
4983
+ })), ((watermarkPayload === null || watermarkPayload === void 0 ? void 0 : watermarkPayload.isEnabled) && {
4984
+ watermark: watermarkPayload
4985
+ }));
4811
4986
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_IMAGE, {
4812
4987
  field_key: field.key,
4813
4988
  field_type: field.type,
4814
- request: {
4815
- image: file
4816
- }
4989
+ request: imageUploadPayload
4817
4990
  });
4818
4991
  try {
4819
4992
  this.onClickApiCall.emit({
4820
4993
  key: field.key,
4821
4994
  type: field.type,
4822
- payload: {
4823
- image: file
4824
- }
4995
+ payload: imageUploadPayload
4825
4996
  });
4826
4997
  }
4827
4998
  catch (err) {
4828
4999
  console.log("Failed to upload image to server!");
4829
5000
  }
4830
5001
  break;
5002
+ }
4831
5003
  case EFieldType.RECORD:
4832
5004
  // Actual API Call
4833
5005
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_VIDEO, {
@@ -4850,12 +5022,14 @@ class KwikIDFormViewComponent {
4850
5022
  console.log("Failed to upload video to server!");
4851
5023
  }
4852
5024
  break;
5025
+ default:
5026
+ break;
4853
5027
  }
4854
5028
  });
4855
5029
  }
4856
5030
  handleOnClickFormFieldButton(field) {
4857
- let formData = this.formGroup.getRawValue();
4858
- for (let field of this.formFields) {
5031
+ const formData = this.formGroup.getRawValue();
5032
+ for (const field of this.formFields) {
4859
5033
  if (field.isFormElement) {
4860
5034
  if (field.hidden) {
4861
5035
  delete formData[field.key];
@@ -4873,7 +5047,7 @@ class KwikIDFormViewComponent {
4873
5047
  label: field.label,
4874
5048
  value: isEmptyValue(formData[field.key]) ? "" : formData[field.key],
4875
5049
  type: field.type,
4876
- index: index
5050
+ index
4877
5051
  }
4878
5052
  };
4879
5053
  result[field.key] = fieldData[field.key];
@@ -4897,8 +5071,8 @@ class KwikIDFormViewComponent {
4897
5071
  return field.key === _.key;
4898
5072
  });
4899
5073
  // set button status to default
4900
- field["api"]["status"]["value"] = EApiStatusType.LOADING;
4901
- field["showLoader"] = true;
5074
+ field.api.status.value = EApiStatusType.LOADING;
5075
+ field.showLoader = true;
4902
5076
  this.formFields[fieldIndex] = field;
4903
5077
  this.showApiLoader();
4904
5078
  this.fieldShowApiLoader(field.key);
@@ -4910,7 +5084,7 @@ class KwikIDFormViewComponent {
4910
5084
  this.togglePermissionErrorNotification(true);
4911
5085
  setTimeout(() => {
4912
5086
  this.togglePermissionErrorNotification(false);
4913
- }, 3000);
5087
+ }, FORM_VIEW_TIMERS.LOCATION_PERMISSION_ERROR_TOGGLE);
4914
5088
  }
4915
5089
  else {
4916
5090
  this.triggerLogs(ELogEventType$1.FORM__LIVE_LOCATION_PERMISSION_SUCCESS, {
@@ -4920,12 +5094,12 @@ class KwikIDFormViewComponent {
4920
5094
  }
4921
5095
  setTimeout(() => {
4922
5096
  // set button status to default
4923
- field["api"]["status"]["value"] = EApiStatusType.DEFAULT;
4924
- field["showLoader"] = false;
5097
+ field.api.status.value = EApiStatusType.DEFAULT;
5098
+ field.showLoader = false;
4925
5099
  this.formFields[fieldIndex] = field;
4926
5100
  this.hideApiLoader();
4927
5101
  this.fieldHideApiLoader(field.key);
4928
- }, 500);
5102
+ }, FORM_VIEW_TIMERS.LOCATION_PERMISSION_RESET_BUTTON_STATUS);
4929
5103
  }
4930
5104
  handleOnClickLiveLocation(e) {
4931
5105
  return __awaiter(this, void 0, void 0, function* () {
@@ -4935,8 +5109,8 @@ class KwikIDFormViewComponent {
4935
5109
  field_type: field.type
4936
5110
  });
4937
5111
  // set button status to loading
4938
- field["api"]["status"]["value"] = EApiStatusType.LOADING;
4939
- field["showLoader"] = true;
5112
+ field.api.status.value = EApiStatusType.LOADING;
5113
+ field.showLoader = true;
4940
5114
  this.showApiLoader();
4941
5115
  this.formGroup.patchValue({
4942
5116
  [e.key]: e.value
@@ -4956,11 +5130,11 @@ class KwikIDFormViewComponent {
4956
5130
  yield new Promise((resolve) => {
4957
5131
  setTimeout(() => {
4958
5132
  resolve(true);
4959
- }, 300); // 1000 ms = 1 sec
5133
+ }, FORM_VIEW_TIMERS.TIMER_300); // 1000 ms = 1 sec
4960
5134
  });
4961
5135
  // set button status to success
4962
- field["api"]["status"]["value"] = EApiStatusType.SUCCESS;
4963
- field["showLoader"] = false;
5136
+ field.api.status.value = EApiStatusType.SUCCESS;
5137
+ field.showLoader = false;
4964
5138
  if (field.isFormElement &&
4965
5139
  checkObjectKeyExists(field, "validation") &&
4966
5140
  field.validation.triggers.includes("ON_CHANGE")) {
@@ -4968,6 +5142,7 @@ class KwikIDFormViewComponent {
4968
5142
  FIELD_CONFIG: field,
4969
5143
  FORM_FIELDS: this.formFields,
4970
5144
  FORM_DATA: this.formData,
5145
+ CAMERA_DATA: this.cameraData,
4971
5146
  TASK_DATA: this.taskData,
4972
5147
  PREVIOUS_FORM_DATA: this.previousFormData,
4973
5148
  ALL_FORMS_DATA: this.allFormsData,
@@ -5003,6 +5178,7 @@ class KwikIDFormViewComponent {
5003
5178
  FIELD_CONFIG: field,
5004
5179
  FORM_FIELDS: this.formFields,
5005
5180
  FORM_DATA: this.formData,
5181
+ CAMERA_DATA: this.cameraData,
5006
5182
  TASK_DATA: this.taskData,
5007
5183
  PREVIOUS_FORM_DATA: this.previousFormData,
5008
5184
  ALL_FORMS_DATA: this.allFormsData,
@@ -5020,41 +5196,6 @@ class KwikIDFormViewComponent {
5020
5196
  }, "ON_CHANGE");
5021
5197
  }
5022
5198
  }
5023
- handleOnClickResetFormFields2(e, field) {
5024
- var _a;
5025
- return __awaiter(this, void 0, void 0, function* () {
5026
- this.triggerLogs(ELogEventType$1.FORM__FIELD_RESET_BUTTON_CLICK, {
5027
- field_key: field.key
5028
- });
5029
- const resetFormFields = () => __awaiter(this, void 0, void 0, function* () {
5030
- for (let f of field.reset.fields) {
5031
- for (let action of f.actions) {
5032
- const resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
5033
- const actions = new Action(action, {}, {
5034
- FIELD_CONFIG: resetField,
5035
- FORM_FIELDS: this.formFields,
5036
- FORM_DATA: this.formData,
5037
- TASK_DATA: this.taskData,
5038
- PREVIOUS_FORM_DATA: this.previousFormData,
5039
- ALL_FORMS_DATA: this.allFormsData,
5040
- EXTRA_DATA: this.extraData
5041
- }, this.takeAction.bind(this));
5042
- yield actions.execute();
5043
- }
5044
- }
5045
- });
5046
- const BYPASS_RESET_CONFIRM = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.bypassResetConfirmation;
5047
- if (!BYPASS_RESET_CONFIRM) {
5048
- const CONFIRM_RESET = window.confirm("This action will reset all the fields. Do you still want to continue?");
5049
- if (CONFIRM_RESET) {
5050
- resetFormFields();
5051
- }
5052
- }
5053
- else {
5054
- resetFormFields();
5055
- }
5056
- });
5057
- }
5058
5199
  handleOnClickResetFormFields(e, field) {
5059
5200
  var _a;
5060
5201
  return __awaiter(this, void 0, void 0, function* () {
@@ -5063,13 +5204,14 @@ class KwikIDFormViewComponent {
5063
5204
  });
5064
5205
  const resetFormFields = () => __awaiter(this, void 0, void 0, function* () {
5065
5206
  if (checkObjectPathExists(field, "reset.fields")) {
5066
- for (let f of field.reset.fields) {
5067
- for (let action of f.actions) {
5207
+ for (const f of field.reset.fields) {
5208
+ for (const action of f.actions) {
5068
5209
  const resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
5069
5210
  const actions = new Action(action, {}, {
5070
5211
  FIELD_CONFIG: resetField,
5071
5212
  FORM_FIELDS: this.formFields,
5072
5213
  FORM_DATA: this.formData,
5214
+ CAMERA_DATA: this.cameraData,
5073
5215
  TASK_DATA: this.taskData,
5074
5216
  PREVIOUS_FORM_DATA: this.previousFormData,
5075
5217
  ALL_FORMS_DATA: this.allFormsData,
@@ -5080,14 +5222,15 @@ class KwikIDFormViewComponent {
5080
5222
  }
5081
5223
  }
5082
5224
  if (checkObjectPathExists(field, "reset.fieldGroups")) {
5083
- for (let fg of field.reset.fieldGroups) {
5084
- for (let action of fg.actions) {
5085
- for (let fieldKey of this.fieldGroups[fg.groupKey]) {
5225
+ for (const fg of field.reset.fieldGroups) {
5226
+ for (const action of fg.actions) {
5227
+ for (const fieldKey of this.fieldGroups[fg.groupKey]) {
5086
5228
  const resetField = getFormFieldByKey(this.formFields, fieldKey);
5087
5229
  const actions = new Action(action, {}, {
5088
5230
  FIELD_CONFIG: resetField,
5089
5231
  FORM_FIELDS: this.formFields,
5090
5232
  FORM_DATA: this.formData,
5233
+ CAMERA_DATA: this.cameraData,
5091
5234
  TASK_DATA: this.taskData,
5092
5235
  PREVIOUS_FORM_DATA: this.previousFormData,
5093
5236
  ALL_FORMS_DATA: this.allFormsData,
@@ -5118,6 +5261,7 @@ class KwikIDFormViewComponent {
5118
5261
  API_CONFIG: api,
5119
5262
  FORM_FIELDS: this.formFields,
5120
5263
  FORM_DATA: this.formData,
5264
+ CAMERA_DATA: this.cameraData,
5121
5265
  TASK_DATA: this.taskData,
5122
5266
  PREVIOUS_FORM_DATA: this.previousFormData,
5123
5267
  ALL_FORMS_DATA: this.allFormsData,
@@ -5136,6 +5280,7 @@ class KwikIDFormViewComponent {
5136
5280
  API_RESPONSE: api.response,
5137
5281
  FORM_FIELDS: this.formFields,
5138
5282
  FORM_DATA: this.formData,
5283
+ CAMERA_DATA: this.cameraData,
5139
5284
  TASK_DATA: this.taskData,
5140
5285
  PREVIOUS_FORM_DATA: this.previousFormData,
5141
5286
  ALL_FORMS_DATA: this.allFormsData,
@@ -5145,11 +5290,11 @@ class KwikIDFormViewComponent {
5145
5290
  }
5146
5291
  else {
5147
5292
  setTimeout(() => {
5148
- field["api"]["status"]["value"] = EApiStatusType.FAILED;
5149
- field["showLoader"] = false;
5150
- }, 500);
5293
+ field.api.status.value = EApiStatusType.FAILED;
5294
+ field.showLoader = false;
5295
+ }, FORM_VIEW_TIMERS.TIMER_500);
5151
5296
  }
5152
- return { field: field, api: api };
5297
+ return { field, api };
5153
5298
  });
5154
5299
  }
5155
5300
  handleApiCall(api) {
@@ -5159,6 +5304,7 @@ class KwikIDFormViewComponent {
5159
5304
  API_CONFIG: api,
5160
5305
  FORM_FIELDS: this.formFields,
5161
5306
  FORM_DATA: this.formData,
5307
+ CAMERA_DATA: this.cameraData,
5162
5308
  TASK_DATA: this.taskData,
5163
5309
  PREVIOUS_FORM_DATA: this.previousFormData,
5164
5310
  ALL_FORMS_DATA: this.allFormsData,
@@ -5169,6 +5315,7 @@ class KwikIDFormViewComponent {
5169
5315
  API_CONFIG: api,
5170
5316
  FORM_FIELDS: this.formFields,
5171
5317
  FORM_DATA: this.formData,
5318
+ CAMERA_DATA: this.cameraData,
5172
5319
  TASK_DATA: this.taskData,
5173
5320
  PREVIOUS_FORM_DATA: this.previousFormData,
5174
5321
  ALL_FORMS_DATA: this.allFormsData,
@@ -5177,7 +5324,7 @@ class KwikIDFormViewComponent {
5177
5324
  if (this.isValidRequestHeadersAndBody(api)) {
5178
5325
  api = yield apis.validateResponse();
5179
5326
  }
5180
- return { api: api };
5327
+ return { api };
5181
5328
  });
5182
5329
  }
5183
5330
  executeApiCall(api, object) {
@@ -5192,14 +5339,15 @@ class KwikIDFormViewComponent {
5192
5339
  let apiCallResponse = {};
5193
5340
  let apiCallResponseStatusCode;
5194
5341
  if (this.isValidRequestHeadersAndBody(api)) {
5195
- if (api.request.url.hasOwnProperty("type") &&
5342
+ if (checkObjectKeyExists(api.request.url, "type") &&
5196
5343
  api.request.url.type === EApiRequestUrlType.MOCK) {
5197
5344
  apiCallResponse = yield new Promise((resolve) => {
5198
5345
  setTimeout(() => {
5199
5346
  resolve(api.request.url.props.mockedData);
5200
- }, 1000); // 1000 ms = 1 sec
5347
+ }, FORM_VIEW_TIMERS.WAIT_FOR_API_MOCK_DATA); // 1000 ms = 1 sec
5201
5348
  });
5202
- apiCallResponseStatusCode = (_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : 200; // Default Status Code for Mocked APIs
5349
+ apiCallResponseStatusCode =
5350
+ (_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : FORM_VIEW_TIMERS.API_MOCK_SUCCESS_STATUS_CODE; // Default Status Code for Mocked APIs
5203
5351
  }
5204
5352
  else {
5205
5353
  const url = api.request.url.value;
@@ -5226,12 +5374,13 @@ class KwikIDFormViewComponent {
5226
5374
  catch (_13) {
5227
5375
  // Handle any errors
5228
5376
  apiCallResponse = {};
5229
- apiCallResponseStatusCode = 500; // Internal Server Error
5377
+ apiCallResponseStatusCode =
5378
+ FORM_VIEW_TIMERS.API_MOCK_ERROR_STATUS_CODE; // Internal Server Error
5230
5379
  }
5231
5380
  }
5232
5381
  else {
5233
5382
  // Extract the request body from the API configuration
5234
- let body = (_p = (_o = (_m = api === null || api === void 0 ? void 0 : api.request) === null || _m === void 0 ? void 0 : _m.body) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : {};
5383
+ const body = (_p = (_o = (_m = api === null || api === void 0 ? void 0 : api.request) === null || _m === void 0 ? void 0 : _m.body) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : {};
5235
5384
  // Check if the request body needs to be encrypted
5236
5385
  const isEncryptRequestBody = (_s = (_r = (_q = api === null || api === void 0 ? void 0 : api.request) === null || _q === void 0 ? void 0 : _q.body) === null || _r === void 0 ? void 0 : _r.isSecure) !== null && _s !== void 0 ? _s : false;
5237
5386
  // Check if the response needs to be decrypted
@@ -5251,7 +5400,8 @@ class KwikIDFormViewComponent {
5251
5400
  catch (_14) {
5252
5401
  // Handle any errors
5253
5402
  apiCallResponse = {};
5254
- apiCallResponseStatusCode = 500; // Internal Server Error
5403
+ apiCallResponseStatusCode =
5404
+ FORM_VIEW_TIMERS.API_MOCK_ERROR_STATUS_CODE; // Internal Server Error
5255
5405
  }
5256
5406
  }
5257
5407
  }
@@ -5286,29 +5436,29 @@ class KwikIDFormViewComponent {
5286
5436
  fullscreen: true,
5287
5437
  loaderText: "Please wait"
5288
5438
  });
5289
- this.viewFormsButton["disabled"] = true;
5290
- this.viewFormsButton["showLoader"] = true;
5291
- this.saveFormButton["disabled"] = true;
5292
- this.saveFormButton["showLoader"] = true;
5439
+ this.viewFormsButton.disabled = true;
5440
+ this.viewFormsButton.showLoader = true;
5441
+ this.saveFormButton.disabled = true;
5442
+ this.saveFormButton.showLoader = true;
5293
5443
  }
5294
5444
  hideApiLoader() {
5295
5445
  this.loaderService.hide();
5296
- this.viewFormsButton["disabled"] = false;
5297
- this.viewFormsButton["showLoader"] = false;
5298
- this.saveFormButton["disabled"] = false;
5299
- this.saveFormButton["showLoader"] = false;
5446
+ this.viewFormsButton.disabled = false;
5447
+ this.viewFormsButton.showLoader = false;
5448
+ this.saveFormButton.disabled = false;
5449
+ this.saveFormButton.showLoader = false;
5300
5450
  }
5301
5451
  handleOnClickApiCall(e) {
5302
5452
  return __awaiter(this, void 0, void 0, function* () {
5303
- let field = getFormFieldByKey(this.formFields, e.key);
5453
+ const field = getFormFieldByKey(this.formFields, e.key);
5304
5454
  if (field.type === EFieldType.API) {
5305
5455
  this.triggerLogs(ELogEventType$1.FORM__API_BUTTON_CLICK, {
5306
5456
  field_key: field.key,
5307
5457
  field_type: field.type
5308
5458
  });
5309
5459
  // set button status to loading
5310
- field["api"]["status"]["value"] = EApiStatusType.LOADING;
5311
- field["showLoader"] = true;
5460
+ field.api.status.value = EApiStatusType.LOADING;
5461
+ field.showLoader = true;
5312
5462
  this.showApiLoader();
5313
5463
  // Determine API Call time
5314
5464
  if (checkObjectKeyExists(field.api, "request")) {
@@ -5320,6 +5470,7 @@ class KwikIDFormViewComponent {
5320
5470
  API_CONFIG: {},
5321
5471
  FORM_FIELDS: this.formFields,
5322
5472
  FORM_DATA: this.formData,
5473
+ CAMERA_DATA: this.cameraData,
5323
5474
  TASK_DATA: this.taskData,
5324
5475
  PREVIOUS_FORM_DATA: this.previousFormData,
5325
5476
  ALL_FORMS_DATA: this.allFormsData,
@@ -5344,14 +5495,14 @@ class KwikIDFormViewComponent {
5344
5495
  if (this.formConfig.status === EFormsListStatus.COMPLETED) {
5345
5496
  this.onClickGoBack.emit({
5346
5497
  clicked: true,
5347
- mode: mode
5498
+ mode
5348
5499
  });
5349
5500
  }
5350
5501
  else if (this.formConfig.properties.header.backButton.bypassConfirmation ||
5351
5502
  window.confirm("Your data will be lost if you leave this page! Continue?")) {
5352
5503
  this.onClickGoBack.emit({
5353
5504
  clicked: true,
5354
- mode: mode
5505
+ mode
5355
5506
  });
5356
5507
  }
5357
5508
  }
@@ -5379,7 +5530,7 @@ class KwikIDFormViewComponent {
5379
5530
  }
5380
5531
  const controls = new FormValidation().getFormFieldsInvalidControls(this.formGroup);
5381
5532
  let firstFieldWithError = "";
5382
- for (let control of controls) {
5533
+ for (const control of controls) {
5383
5534
  if (control.invalid) {
5384
5535
  const field = getFormFieldByKey(this.formFields, control.key);
5385
5536
  this.triggerLogs(ELogEventType$1.FORM__FIELD_ERROR_SHOW, {
@@ -5401,7 +5552,7 @@ class KwikIDFormViewComponent {
5401
5552
  // }, 3000);
5402
5553
  return;
5403
5554
  }
5404
- for (let field of this.formFields) {
5555
+ for (const field of this.formFields) {
5405
5556
  if (field.isFormElement &&
5406
5557
  !field.hidden &&
5407
5558
  checkObjectKeyExists(field, "validation") &&
@@ -5410,6 +5561,7 @@ class KwikIDFormViewComponent {
5410
5561
  FIELD_CONFIG: field,
5411
5562
  FORM_FIELDS: this.formFields,
5412
5563
  FORM_DATA: this.formData,
5564
+ CAMERA_DATA: this.cameraData,
5413
5565
  TASK_DATA: this.taskData,
5414
5566
  PREVIOUS_FORM_DATA: this.previousFormData,
5415
5567
  ALL_FORMS_DATA: this.allFormsData,
@@ -5420,13 +5572,13 @@ class KwikIDFormViewComponent {
5420
5572
  this.toggleErrorNotification(true);
5421
5573
  setTimeout(() => {
5422
5574
  this.toggleErrorNotification(false);
5423
- }, 3000);
5575
+ }, FORM_VIEW_TIMERS.INVALID_FIELDS_SAVE_FORM_ERROR_TOGGLE);
5424
5576
  return;
5425
5577
  }
5426
5578
  }
5427
5579
  }
5428
- let formData = this.formGroup.getRawValue();
5429
- for (let field of this.formFields) {
5580
+ const formData = this.formGroup.getRawValue();
5581
+ for (const field of this.formFields) {
5430
5582
  if (field.isFormElement) {
5431
5583
  if (field.hidden) {
5432
5584
  delete formData[field.key];
@@ -5444,7 +5596,7 @@ class KwikIDFormViewComponent {
5444
5596
  label: field.label,
5445
5597
  value: isEmptyValue(formData[field.key]) ? "" : formData[field.key],
5446
5598
  type: field.type,
5447
- index: index
5599
+ index
5448
5600
  }
5449
5601
  };
5450
5602
  result[field.key] = fieldData[field.key];
@@ -5455,6 +5607,7 @@ class KwikIDFormViewComponent {
5455
5607
  if (isEmptyValue(formData[key])) {
5456
5608
  formData[key] = "";
5457
5609
  }
5610
+ return null;
5458
5611
  });
5459
5612
  /**
5460
5613
  * POST Tasks
@@ -5466,11 +5619,12 @@ class KwikIDFormViewComponent {
5466
5619
  if (checkObjectKeyExists(this.formConfig, "tasks") &&
5467
5620
  checkObjectKeyExists(this.formConfig.tasks, "post")) {
5468
5621
  this.triggerLogs(ELogEventType$1.FORM__TASK_POST, {});
5469
- for (let postTask of this.formConfig.tasks.post) {
5622
+ for (const postTask of this.formConfig.tasks.post) {
5470
5623
  const task = new Tasks(postTask, {
5471
5624
  FORM_CONFIG: this.formConfig,
5472
5625
  FORM_FIELDS: this.formFields,
5473
5626
  FORM_DATA: this.formData,
5627
+ CAMERA_DATA: this.cameraData,
5474
5628
  TASK_DATA: this.taskData,
5475
5629
  PREVIOUS_FORM_DATA: this.previousFormData,
5476
5630
  ALL_FORMS_DATA: this.allFormsData,
@@ -5491,7 +5645,7 @@ class KwikIDFormViewComponent {
5491
5645
  clearInterval(intervalId);
5492
5646
  resolve();
5493
5647
  }
5494
- }, 10);
5648
+ }, FORM_VIEW_TIMERS.WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK);
5495
5649
  });
5496
5650
  if (this.stopTaskExecution) {
5497
5651
  break;
@@ -5540,11 +5694,11 @@ class KwikIDFormViewComponent {
5540
5694
  }
5541
5695
  // Component Helpers
5542
5696
  fieldHide(fieldKey) {
5543
- let field = getFormFieldByKey(this.formFields, fieldKey);
5544
- let fieldIndex = this.formFields.findIndex((_) => {
5697
+ const field = getFormFieldByKey(this.formFields, fieldKey);
5698
+ const fieldIndex = this.formFields.findIndex((_) => {
5545
5699
  return field.key === _.key;
5546
5700
  });
5547
- this.formFields[fieldIndex]["hidden"] = true;
5701
+ this.formFields[fieldIndex].hidden = true;
5548
5702
  this.formGroup.updateValueAndValidity();
5549
5703
  this.triggerLogs(ELogEventType$1.FORM__FIELD_HIDE, {
5550
5704
  field_key: fieldKey,
@@ -5552,16 +5706,16 @@ class KwikIDFormViewComponent {
5552
5706
  });
5553
5707
  }
5554
5708
  fieldGroupHide(fieldGroup) {
5555
- for (let fieldKey of this.fieldGroups[fieldGroup]) {
5709
+ for (const fieldKey of this.fieldGroups[fieldGroup]) {
5556
5710
  this.fieldHide(fieldKey);
5557
5711
  }
5558
5712
  }
5559
5713
  fieldShow(fieldKey) {
5560
- let field = getFormFieldByKey(this.formFields, fieldKey);
5561
- let fieldIndex = this.formFields.findIndex((_) => {
5714
+ const field = getFormFieldByKey(this.formFields, fieldKey);
5715
+ const fieldIndex = this.formFields.findIndex((_) => {
5562
5716
  return field.key === _.key;
5563
5717
  });
5564
- this.formFields[fieldIndex]["hidden"] = false;
5718
+ this.formFields[fieldIndex].hidden = false;
5565
5719
  this.formGroup.updateValueAndValidity();
5566
5720
  this.triggerLogs(ELogEventType$1.FORM__FIELD_SHOW, {
5567
5721
  field_key: fieldKey,
@@ -5569,27 +5723,26 @@ class KwikIDFormViewComponent {
5569
5723
  });
5570
5724
  }
5571
5725
  fieldGroupShow(fieldGroup) {
5572
- for (let fieldKey of this.fieldGroups[fieldGroup]) {
5726
+ for (const fieldKey of this.fieldGroups[fieldGroup]) {
5573
5727
  this.fieldShow(fieldKey);
5574
5728
  }
5575
5729
  }
5576
5730
  fieldDisable(fieldKey) {
5577
- let field = getFormFieldByKey(this.formFields, fieldKey);
5578
- let fieldIndex = this.formFields.findIndex((_) => {
5731
+ const field = getFormFieldByKey(this.formFields, fieldKey);
5732
+ const fieldIndex = this.formFields.findIndex((_) => {
5579
5733
  return field.key === _.key;
5580
5734
  });
5581
5735
  if (field.isFormElement) {
5582
- this.formFields[fieldIndex]["disabled"] = true;
5736
+ this.formFields[fieldIndex].disabled = true;
5583
5737
  if (isNotEmptyValue(this.formGroup.controls)) {
5584
5738
  this.formGroup.controls[field.key].disable({
5585
5739
  emitEvent: false
5586
5740
  });
5587
5741
  }
5588
5742
  this.formGroup.updateValueAndValidity();
5589
- console.log("YES DISABLING THE FIELD");
5590
5743
  }
5591
5744
  else if (field.type === EFieldType.BUTTON) {
5592
- this.formFields[fieldIndex]["disabled"] = true;
5745
+ this.formFields[fieldIndex].disabled = true;
5593
5746
  }
5594
5747
  this.triggerLogs(ELogEventType$1.FORM__FIELD_DISABLE, {
5595
5748
  field_key: fieldKey,
@@ -5597,17 +5750,17 @@ class KwikIDFormViewComponent {
5597
5750
  });
5598
5751
  }
5599
5752
  fieldGroupDisable(fieldGroup) {
5600
- for (let fieldKey of this.fieldGroups[fieldGroup]) {
5753
+ for (const fieldKey of this.fieldGroups[fieldGroup]) {
5601
5754
  this.fieldDisable(fieldKey);
5602
5755
  }
5603
5756
  }
5604
5757
  fieldEnable(fieldKey) {
5605
- let field = getFormFieldByKey(this.formFields, fieldKey);
5606
- let fieldIndex = this.formFields.findIndex((_) => {
5758
+ const field = getFormFieldByKey(this.formFields, fieldKey);
5759
+ const fieldIndex = this.formFields.findIndex((_) => {
5607
5760
  return field.key === _.key;
5608
5761
  });
5609
5762
  if (field.isFormElement) {
5610
- this.formFields[fieldIndex]["disabled"] = false;
5763
+ this.formFields[fieldIndex].disabled = false;
5611
5764
  if (isNotEmptyValue(this.formGroup.controls)) {
5612
5765
  this.formGroup.controls[field.key].enable({
5613
5766
  emitEvent: false
@@ -5616,7 +5769,7 @@ class KwikIDFormViewComponent {
5616
5769
  this.formGroup.updateValueAndValidity();
5617
5770
  }
5618
5771
  else if (field.type === EFieldType.BUTTON) {
5619
- this.formFields[fieldIndex]["disabled"] = false;
5772
+ this.formFields[fieldIndex].disabled = false;
5620
5773
  }
5621
5774
  this.triggerLogs(ELogEventType$1.FORM__FIELD_ENABLE, {
5622
5775
  field_key: fieldKey,
@@ -5624,14 +5777,14 @@ class KwikIDFormViewComponent {
5624
5777
  });
5625
5778
  }
5626
5779
  fieldGroupEnable(fieldGroup) {
5627
- for (let fieldKey of this.fieldGroups[fieldGroup]) {
5780
+ for (const fieldKey of this.fieldGroups[fieldGroup]) {
5628
5781
  this.fieldEnable(fieldKey);
5629
5782
  }
5630
5783
  }
5631
5784
  fieldReset(fieldKey) {
5632
5785
  // Find the field and its index in the formFields array
5633
5786
  let field = getFormFieldByKey(this.formFields, fieldKey);
5634
- let fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
5787
+ const fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
5635
5788
  // Reset the value of the field in the formGroup
5636
5789
  const resetValue = convertFormFieldEmptyValueToKwikUIFormat(field);
5637
5790
  this.formData[fieldKey] = resetValue;
@@ -5660,23 +5813,24 @@ class KwikIDFormViewComponent {
5660
5813
  });
5661
5814
  // Reset the value of the field in the formFields array
5662
5815
  switch (field.type) {
5663
- case EFieldType.API:
5816
+ case EFieldType.API: {
5664
5817
  const fieldApiCall = field;
5665
5818
  fieldApiCall.api.status.value = EApiStatusType.DEFAULT;
5666
5819
  this.formFields[fieldIndex] = fieldApiCall;
5667
5820
  break;
5668
- case EFieldType.LIVE_LOCATION:
5821
+ }
5822
+ case EFieldType.LIVE_LOCATION: {
5669
5823
  const fieldLiveLocation = field;
5670
5824
  fieldLiveLocation.api.status.value = EApiStatusType.DEFAULT;
5671
5825
  this.formFields[fieldIndex] = fieldLiveLocation;
5672
5826
  break;
5673
- default:
5674
- console.log("BAIJU BEFORE", getObjectDeepCopy(field), getObjectDeepCopy(this.formFields));
5827
+ }
5828
+ default: {
5675
5829
  field.focus = false;
5676
5830
  field.invalid = false;
5677
5831
  this.formFields[fieldIndex] = field;
5678
- console.log("BAIJU AFTER", getObjectDeepCopy(field), getObjectDeepCopy(this.formFields));
5679
5832
  break;
5833
+ }
5680
5834
  }
5681
5835
  this.triggerLogs(ELogEventType$1.FORM__FIELD_RESET, {
5682
5836
  field_key: fieldKey,
@@ -5684,55 +5838,61 @@ class KwikIDFormViewComponent {
5684
5838
  });
5685
5839
  }
5686
5840
  fieldGroupReset(fieldGroup) {
5687
- for (let fieldKey of this.fieldGroups[fieldGroup]) {
5841
+ for (const fieldKey of this.fieldGroups[fieldGroup]) {
5688
5842
  this.fieldReset(fieldKey);
5689
5843
  }
5690
5844
  }
5691
5845
  fieldHideApiLoader(fieldKey) {
5692
- let field = getFormFieldByKey(this.formFields, fieldKey);
5693
- let fieldIndex = this.formFields.findIndex((_) => {
5846
+ const field = getFormFieldByKey(this.formFields, fieldKey);
5847
+ const fieldIndex = this.formFields.findIndex((_) => {
5694
5848
  return field.key === _.key;
5695
5849
  });
5696
5850
  // Reset the value of the field in the formFields array
5697
5851
  switch (field.type) {
5698
- case EFieldType.API:
5852
+ case EFieldType.API: {
5699
5853
  const fieldApiCall = field;
5700
5854
  fieldApiCall.disabled = false;
5701
5855
  this.formFields[fieldIndex] = fieldApiCall;
5702
5856
  break;
5703
- case EFieldType.LIVE_LOCATION:
5857
+ }
5858
+ case EFieldType.LIVE_LOCATION: {
5704
5859
  const fieldLiveLocation = field;
5705
5860
  fieldLiveLocation.disabled = false;
5706
5861
  this.formFields[fieldIndex] = fieldLiveLocation;
5707
5862
  break;
5708
- default:
5863
+ }
5864
+ default: {
5709
5865
  break;
5866
+ }
5710
5867
  }
5711
5868
  }
5712
5869
  fieldShowApiLoader(fieldKey) {
5713
- let field = getFormFieldByKey(this.formFields, fieldKey);
5714
- let fieldIndex = this.formFields.findIndex((_) => {
5870
+ const field = getFormFieldByKey(this.formFields, fieldKey);
5871
+ const fieldIndex = this.formFields.findIndex((_) => {
5715
5872
  return field.key === _.key;
5716
5873
  });
5717
5874
  // Reset the value of the field in the formFields array
5718
5875
  switch (field.type) {
5719
- case EFieldType.API:
5876
+ case EFieldType.API: {
5720
5877
  const fieldApiCall = field;
5721
5878
  fieldApiCall.disabled = true;
5722
5879
  this.formFields[fieldIndex] = fieldApiCall;
5723
5880
  break;
5724
- case EFieldType.LIVE_LOCATION:
5881
+ }
5882
+ case EFieldType.LIVE_LOCATION: {
5725
5883
  const fieldLiveLocation = field;
5726
5884
  fieldLiveLocation.disabled = true;
5727
5885
  this.formFields[fieldIndex] = fieldLiveLocation;
5728
5886
  break;
5729
- default:
5887
+ }
5888
+ default: {
5730
5889
  break;
5890
+ }
5731
5891
  }
5732
5892
  }
5733
5893
  setHtml(fieldKey, message) {
5734
5894
  let field = getFormFieldByKey(this.formFields, fieldKey);
5735
- let fieldIndex = this.formFields.findIndex((_) => {
5895
+ const fieldIndex = this.formFields.findIndex((_) => {
5736
5896
  return field.key === _.key;
5737
5897
  });
5738
5898
  field = appendHtmlMessage(field, message);
@@ -5740,7 +5900,7 @@ class KwikIDFormViewComponent {
5740
5900
  }
5741
5901
  fieldErrorShow(fieldKey, message) {
5742
5902
  let field = getFormFieldByKey(this.formFields, fieldKey);
5743
- let fieldIndex = this.formFields.findIndex((_) => {
5903
+ const fieldIndex = this.formFields.findIndex((_) => {
5744
5904
  return field.key === _.key;
5745
5905
  });
5746
5906
  field = highlightFormFieldError(field, true);
@@ -5754,7 +5914,7 @@ class KwikIDFormViewComponent {
5754
5914
  }
5755
5915
  fieldErrorHide(fieldKey, message) {
5756
5916
  let field = getFormFieldByKey(this.formFields, fieldKey);
5757
- let fieldIndex = this.formFields.findIndex((_) => {
5917
+ const fieldIndex = this.formFields.findIndex((_) => {
5758
5918
  return field.key === _.key;
5759
5919
  });
5760
5920
  field = highlightFormFieldError(field, false);
@@ -5768,7 +5928,7 @@ class KwikIDFormViewComponent {
5768
5928
  }
5769
5929
  fieldMessageShow(fieldKey, message) {
5770
5930
  let field = getFormFieldByKey(this.formFields, fieldKey);
5771
- let fieldIndex = this.formFields.findIndex((_) => {
5931
+ const fieldIndex = this.formFields.findIndex((_) => {
5772
5932
  return field.key === _.key;
5773
5933
  });
5774
5934
  field = appendFormFieldMessage(field, message);
@@ -5781,7 +5941,7 @@ class KwikIDFormViewComponent {
5781
5941
  }
5782
5942
  fieldMessageHide(fieldKey, message) {
5783
5943
  let field = getFormFieldByKey(this.formFields, fieldKey);
5784
- let fieldIndex = this.formFields.findIndex((_) => {
5944
+ const fieldIndex = this.formFields.findIndex((_) => {
5785
5945
  return field.key === _.key;
5786
5946
  });
5787
5947
  field = removeFormFieldMessage(field, message);
@@ -5795,7 +5955,7 @@ class KwikIDFormViewComponent {
5795
5955
  fieldApiTimerMessageShow(fieldKey, timer) {
5796
5956
  return __awaiter(this, void 0, void 0, function* () {
5797
5957
  let field = getFormFieldByKey(this.formFields, fieldKey);
5798
- let fieldIndex = this.formFields.findIndex((_) => {
5958
+ const fieldIndex = this.formFields.findIndex((_) => {
5799
5959
  return field.key === _.key;
5800
5960
  });
5801
5961
  field = setApiTimerMessage(field, timer);
@@ -5811,7 +5971,7 @@ class KwikIDFormViewComponent {
5811
5971
  fieldApiTimerMessageHide(fieldKey) {
5812
5972
  return __awaiter(this, void 0, void 0, function* () {
5813
5973
  let field = getFormFieldByKey(this.formFields, fieldKey);
5814
- let fieldIndex = this.formFields.findIndex((_) => {
5974
+ const fieldIndex = this.formFields.findIndex((_) => {
5815
5975
  return field.key === _.key;
5816
5976
  });
5817
5977
  field = setApiTimerMessage(field, undefined);
@@ -5822,6 +5982,7 @@ class KwikIDFormViewComponent {
5822
5982
  FIELD_CONFIG: field,
5823
5983
  FORM_FIELDS: this.formFields,
5824
5984
  FORM_DATA: this.formData,
5985
+ CAMERA_DATA: this.cameraData,
5825
5986
  TASK_DATA: this.taskData,
5826
5987
  PREVIOUS_FORM_DATA: this.previousFormData,
5827
5988
  ALL_FORMS_DATA: this.allFormsData,
@@ -5991,7 +6152,7 @@ class KwikIDFormViewComponent {
5991
6152
  let sourceValue = yield source.getValueFromSource(action.props.value.source);
5992
6153
  if (checkObjectKeyExists(action.props, "options")) {
5993
6154
  if (checkObjectKeyExists(action.props.options, "appendToPath")) {
5994
- let appendToPath = yield source.getValueFromSource(action.props.options.appendToPath.source);
6155
+ const appendToPath = yield source.getValueFromSource(action.props.options.appendToPath.source);
5995
6156
  if (isNotEmptyValue(appendToPath)) {
5996
6157
  const appendToPathStr = replaceString(appendToPath.match(`${action.props.options.appendToPath.filterSourceValue}`)[0], "[^a-zA-Z0-9_]", "_");
5997
6158
  const optionsPath = `${action.props.options.path}${appendToPathStr}`;
@@ -6033,10 +6194,11 @@ class KwikIDFormViewComponent {
6033
6194
  return __awaiter(this, void 0, void 0, function* () {
6034
6195
  const entrypointApiKey = action.props.apiKey;
6035
6196
  let field = getFormFieldByKey(this.formFields, action.props.fieldKey);
6036
- const endpoints = field.api.endpoints;
6037
- const nextApiIndex = endpoints.findIndex((api) => api.apiKey == entrypointApiKey);
6197
+ const { endpoints } = field.api;
6198
+ const nextApiIndex = endpoints.findIndex((api) => api.apiKey === entrypointApiKey);
6038
6199
  const apiConfig = endpoints[nextApiIndex];
6039
6200
  const response = yield this.handleFieldApiCall(field, apiConfig);
6201
+ // eslint-disable-next-line prefer-destructuring
6040
6202
  field = response.field;
6041
6203
  field.api.endpoints[nextApiIndex] = response.api;
6042
6204
  });
@@ -6045,7 +6207,7 @@ class KwikIDFormViewComponent {
6045
6207
  return __awaiter(this, void 0, void 0, function* () {
6046
6208
  const field = getFormFieldByKey(this.formFields, action.props.fieldKey);
6047
6209
  let multipleApiCallResponses = {};
6048
- field.api.endpoints.map((api) => {
6210
+ field.api.endpoints.forEach((api) => {
6049
6211
  if (checkObjectKeyExists(api.response, "value"))
6050
6212
  multipleApiCallResponses = setValueToObjectPath(multipleApiCallResponses, `${api.apiKey}`, api.response.value);
6051
6213
  });
@@ -6067,11 +6229,11 @@ class KwikIDFormViewComponent {
6067
6229
  taskMultipleApiCalls(action, object) {
6068
6230
  return __awaiter(this, void 0, void 0, function* () {
6069
6231
  this.showApiLoader();
6070
- let multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
6232
+ const multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
6071
6233
  if (checkObjectKeyExists(action.props, "apiKey")) {
6072
6234
  const entrypointApiKey = action.props.apiKey;
6073
- const endpoints = multipleApiConfig.endpoints;
6074
- const nextApiIndex = endpoints.findIndex((api) => api.apiKey == entrypointApiKey);
6235
+ const { endpoints } = multipleApiConfig;
6236
+ const nextApiIndex = endpoints.findIndex((api) => api.apiKey === entrypointApiKey);
6075
6237
  const apiConfig = endpoints[nextApiIndex];
6076
6238
  const response = yield this.handleApiCall(apiConfig);
6077
6239
  multipleApiConfig.endpoints[nextApiIndex] = response.api;
@@ -6084,6 +6246,7 @@ class KwikIDFormViewComponent {
6084
6246
  API_CONFIG: multipleApiConfig,
6085
6247
  FORM_FIELDS: this.formFields,
6086
6248
  FORM_DATA: this.formData,
6249
+ CAMERA_DATA: this.cameraData,
6087
6250
  TASK_DATA: this.taskData,
6088
6251
  PREVIOUS_FORM_DATA: this.previousFormData,
6089
6252
  ALL_FORMS_DATA: this.allFormsData,
@@ -6097,7 +6260,7 @@ class KwikIDFormViewComponent {
6097
6260
  return __awaiter(this, void 0, void 0, function* () {
6098
6261
  const multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
6099
6262
  let multipleApiCallResponses = {};
6100
- multipleApiConfig.endpoints.map((api) => {
6263
+ multipleApiConfig.endpoints.forEach((api) => {
6101
6264
  if (checkObjectKeyExists(api.response, "value"))
6102
6265
  multipleApiCallResponses = setValueToObjectPath(multipleApiCallResponses, `${api.apiKey}`, api.response.value);
6103
6266
  });
@@ -6136,11 +6299,12 @@ class KwikIDFormViewComponent {
6136
6299
  if (checkObjectKeyExists(action.props.url, "url")) {
6137
6300
  let timeout = 2000;
6138
6301
  if (checkObjectKeyExists(action.props.url, "timeout") &&
6139
- typeof action.props.url.timeout == "number") {
6302
+ typeof action.props.url.timeout === "number") {
6303
+ // eslint-disable-next-line prefer-destructuring
6140
6304
  timeout = action.props.url.timeout;
6141
6305
  }
6142
6306
  this.triggerLogs(ELogEventType$1.FORM__REDIRECT_URL, {
6143
- timeout: timeout,
6307
+ timeout,
6144
6308
  redirect_url: action.props.url
6145
6309
  });
6146
6310
  setTimeout(() => {
@@ -6165,12 +6329,14 @@ class KwikIDFormViewComponent {
6165
6329
  throw new Error(`formGroup or formData is 'undefined'.`);
6166
6330
  }
6167
6331
  else {
6168
- let formDataInKwikUIFormat = {};
6169
- for (let fieldKey in formData) {
6170
- const field = getFormFieldByKey(this.formFields, fieldKey);
6171
- if (!isUndefined(field) && !isNull(field)) {
6172
- formDataInKwikUIFormat[fieldKey] =
6173
- convertFormFieldValueToKwikUIFormat(field, formData[fieldKey]);
6332
+ const formDataInKwikUIFormat = {};
6333
+ for (const fieldKey in formData) {
6334
+ if (isNotEmptyValue(fieldKey)) {
6335
+ const field = getFormFieldByKey(this.formFields, fieldKey);
6336
+ if (!isUndefined(field) && !isNull(field)) {
6337
+ formDataInKwikUIFormat[fieldKey] =
6338
+ convertFormFieldValueToKwikUIFormat(field, formData[fieldKey]);
6339
+ }
6174
6340
  }
6175
6341
  }
6176
6342
  this.formGroup.patchValue(formDataInKwikUIFormat, { emitEvent: false });
@@ -6268,7 +6434,7 @@ class KwikIDFormViewComponent {
6268
6434
  showErrorPreview(previewProperties) {
6269
6435
  this.showPreview({
6270
6436
  html: {
6271
- after: `<div style=\"padding-bottom:0.25rem;padding-top: 0.25rem;position: absolute;margin-top: calc(50vh);font-size: 1.4rem;background: white;padding: 2rem;border-radius: 1rem;box-shadow: 0px 0px 10px -3px black;overflow: auto;height: fit-content;max-height: 90vh; width: 70vw; margin-left: calc(15vw); line-height: 2rem;\">Error: ${previewProperties.message.message}</div>`
6437
+ after: `<div style="padding-bottom:0.25rem;padding-top: 0.25rem;position: absolute;margin-top: calc(50vh);font-size: 1.4rem;background: white;padding: 2rem;border-radius: 1rem;box-shadow: 0px 0px 10px -3px black;overflow: auto;height: fit-content;max-height: 90vh; width: 70vw; margin-left: calc(15vw); line-height: 2rem;">Error: ${previewProperties.message.message}</div>`
6272
6438
  },
6273
6439
  type: "popup"
6274
6440
  });
@@ -6277,8 +6443,8 @@ class KwikIDFormViewComponent {
6277
6443
  const popupFormConfig = this.formConfig.popupForms[popupFormKey];
6278
6444
  this.onActionShowPopupForm.emit({
6279
6445
  activeFormData: mergeObjects(this.formData, this.taskData),
6280
- popupFormConfig: popupFormConfig,
6281
- popupType: popupType
6446
+ popupFormConfig,
6447
+ popupType
6282
6448
  });
6283
6449
  }
6284
6450
  alertShow(type, message) {
@@ -6382,10 +6548,10 @@ class KwikIDFormViewComponent {
6382
6548
  break;
6383
6549
  case EActionKey.FIELD_ERROR_SHOW:
6384
6550
  if (checkObjectKeyExists(action.props.message, "source")) {
6385
- const fieldErrorShow_Source = new Source(object);
6386
- let fieldErrorShowSourceValue = yield fieldErrorShow_Source.getValueFromSource(action.props.message.source);
6387
- if (typeof fieldErrorShowSourceValue == "string" ||
6388
- typeof fieldErrorShowSourceValue == "number") {
6551
+ const fieldErrorShowSource = new Source(object);
6552
+ let fieldErrorShowSourceValue = yield fieldErrorShowSource.getValueFromSource(action.props.message.source);
6553
+ if (typeof fieldErrorShowSourceValue === "string" ||
6554
+ typeof fieldErrorShowSourceValue === "number") {
6389
6555
  fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
6390
6556
  }
6391
6557
  else {
@@ -6398,10 +6564,10 @@ class KwikIDFormViewComponent {
6398
6564
  break;
6399
6565
  case EActionKey.FIELD_ERROR_HIDE:
6400
6566
  if (checkObjectKeyExists(action.props.message, "source")) {
6401
- const fieldErrorHide_Source = new Source(object);
6402
- let fieldErrorHideSourceValue = yield fieldErrorHide_Source.getValueFromSource(action.props.message.source);
6403
- if (typeof fieldErrorHideSourceValue == "string" ||
6404
- typeof fieldErrorHideSourceValue == "number") {
6567
+ const fieldErrorHideSource = new Source(object);
6568
+ let fieldErrorHideSourceValue = yield fieldErrorHideSource.getValueFromSource(action.props.message.source);
6569
+ if (typeof fieldErrorHideSourceValue === "string" ||
6570
+ typeof fieldErrorHideSourceValue === "number") {
6405
6571
  fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
6406
6572
  }
6407
6573
  else {
@@ -6473,23 +6639,24 @@ class KwikIDFormViewComponent {
6473
6639
  break;
6474
6640
  case EActionKey.REDIRECT_TO_URL:
6475
6641
  if (checkObjectKeyExists(action.props.url, "source")) {
6476
- const redirectToUrl_Source = new Source(object);
6477
- let redirectToUrlSourceValue = yield redirectToUrl_Source.getValueFromSource(action.props.url.source);
6642
+ const redirectToUrlSource = new Source(object);
6643
+ let redirectToUrlSourceValue = yield redirectToUrlSource.getValueFromSource(action.props.url.source);
6478
6644
  if (isEmptyString(redirectToUrlSourceValue)) {
6479
6645
  redirectToUrlSourceValue = "";
6480
6646
  }
6481
6647
  action = setValueToObjectPath(action, "props.url.url", redirectToUrlSourceValue);
6482
6648
  }
6483
6649
  this.redirectToUrl(action);
6650
+ break;
6484
6651
  case EActionKey.PREVIEW_DIALOG_SHOW:
6485
6652
  this.showPreview(action.props);
6486
6653
  break;
6487
6654
  case EActionKey.PREVIEW_ERROR_SHOW:
6488
6655
  if (checkObjectKeyExists(action.props.message, "source")) {
6489
- const previewErrorShow_Source = new Source(object);
6490
- let previewErrorShowSourceValue = yield previewErrorShow_Source.getValueFromSource(action.props.message.source);
6491
- if (typeof previewErrorShowSourceValue == "string" ||
6492
- typeof previewErrorShowSourceValue == "number") {
6656
+ const previewErrorShowSource = new Source(object);
6657
+ let previewErrorShowSourceValue = yield previewErrorShowSource.getValueFromSource(action.props.message.source);
6658
+ if (typeof previewErrorShowSourceValue === "string" ||
6659
+ typeof previewErrorShowSourceValue === "number") {
6493
6660
  previewErrorShowSourceValue = String(previewErrorShowSourceValue);
6494
6661
  }
6495
6662
  else {
@@ -6539,10 +6706,10 @@ class KwikIDFormViewComponent {
6539
6706
  break;
6540
6707
  case EActionKey.SET_HTML:
6541
6708
  if (checkObjectKeyExists(action.props.message, "source")) {
6542
- const fieldHtmlMessage_Source = new Source(object);
6543
- let fieldHtmlMessageSourceValue = yield fieldHtmlMessage_Source.getValueFromSource(action.props.message.source);
6544
- if (typeof fieldHtmlMessageSourceValue == "string" ||
6545
- typeof fieldHtmlMessageSourceValue == "number") {
6709
+ const fieldHtmlMessageSource = new Source(object);
6710
+ let fieldHtmlMessageSourceValue = yield fieldHtmlMessageSource.getValueFromSource(action.props.message.source);
6711
+ if (typeof fieldHtmlMessageSourceValue === "string" ||
6712
+ typeof fieldHtmlMessageSourceValue === "number") {
6546
6713
  fieldHtmlMessageSourceValue = String(fieldHtmlMessageSourceValue);
6547
6714
  }
6548
6715
  else {
@@ -6560,7 +6727,7 @@ class KwikIDFormViewComponent {
6560
6727
  }
6561
6728
  }
6562
6729
  /** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: KwikIDFormViewService }, { token: KwikIDFormViewApiService }, { token: TuiPushService }, { token: TuiAlertService }, { token: TuiPreviewDialogService }, { token: TuiDialogService }, { token: i3.KwikUILoaderService }, { token: i4.KwikIDCameraRecordService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
6563
- /** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { allFormsData: "allFormsData", extraData: "extraData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", popupFormCallback: "popupFormCallback", userConfig: "userConfig", stepConfig: "stepConfig" }, outputs: { getLogs: "getLogs", getUnsavedDataState: "getUnsavedDataState", onActionShowPopupForm: "onActionShowPopupForm", onClickApiCall: "onClickApiCall", onClickViewFile: "onClickViewFile", onClickFormFieldButton: "onClickFormFieldButton", onClickGoBack: "onClickGoBack", onClickSaveForm: "onClickSaveForm", onClickViewForms: "onClickViewForms" }, providers: [KwikIDFormViewService, KwikIDFormViewApiService], viewQueries: [{ propertyName: "formFieldContainerRef", first: true, predicate: ["formFieldContainerRef"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "formFieldsRef", predicate: ["formFieldsRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div\n id=\"uf-form-fields-header-container\"\n *ngIf=\"\n !formConfig.properties?.header?.title?.hidden ||\n !formConfig.properties?.header?.logo?.hidden ||\n !formConfig.properties?.header?.steps?.hidden ||\n !formConfig.properties?.header?.backButton?.hidden\n \"\n >\n <img\n id=\"uf-header-logo\"\n *ngIf=\"!formConfig.properties?.header?.logo?.hidden && isMobileView\"\n [src]=\"formConfig.properties?.header?.logo?.src\"\n [alt]=\"formConfig.properties?.header?.logo?.alt\"\n [style]=\"\n formConfig.properties?.header?.logo?.styles ?? '' | styleSanitizer\n \"\n />\n <div id=\"uf-form-fields-header-main\">\n <div id=\"uf-form-fields-header-left\">\n <kwikui-button\n *ngIf=\"\n !formConfig.properties?.header.backButton.hidden && isMobileView\n \"\n [disabled]=\"backButton.disabled\"\n [showLoader]=\"backButton.showLoader\"\n appearance=\"mono\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n (onClick)=\"\n handleOnClickGoBack(\n $event,\n formConfig.properties?.header.backButton.mode\n )\n \"\n ></kwikui-button>\n </div>\n <div id=\"uf-form-fields-header-right\">\n <div\n id=\"uf-form-fields-title\"\n *ngIf=\"!formConfig.properties?.header.title.hidden\"\n >{{ formConfig.properties?.header.title.label }}</div\n >\n <div\n id=\"uf-form-fields-steps\"\n *ngIf=\"!formConfig.properties?.header.steps.hidden\"\n >\n Step {{ formConfig.sequenceNo }} of {{ formConfig.formsListLength }}\n </div>\n </div>\n </div>\n <hr\n *ngIf=\"\n !formConfig.properties?.header.title.hidden ||\n !formConfig.properties?.header.steps.hidden ||\n !formConfig.properties?.header.backButton.hidden\n \"\n />\n </div>\n <form\n #formFieldContainerRef\n class=\"kwikid-form show\"\n [style]=\"formConfig.properties?.main?.styles ?? '' | styleSanitizer\"\n [formGroup]=\"formGroup\"\n >\n <ng-container\n *ngFor=\"\n let field of formFields;\n let i = index;\n trackBy: getUniqueIdentifier\n \"\n >\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | kwikuiSafeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n #formFieldsRef\n class=\"title\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n [label]=\"field?.properties?.resetButtonLabel ?? 'Reset'\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button\n [appearance]=\"field?.properties?.appearance ?? 'primary'\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [icon]=\"field?.properties?.icon\"\n [iconRight]=\"field?.properties?.iconRight\"\n [id]=\"field?.key\"\n [label]=\"field?.label\"\n [shape]=\"field?.properties?.shape\"\n [showLoader]=\"field?.properties?.loading ?? false\"\n [size]=\"field?.properties?.size\"\n [styles]=\"field?.properties?.styles\"\n [type]=\"'button'\"\n (onClick)=\"handleOnClickFormFieldButton(field)\"\n ></kwikui-button>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Currency -->\n <ng-container *ngSwitchCase=\"'currency'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-currency\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [currencyType]=\"field?.properties?.currencyType\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n [value]=\"formGroup.controls[field.key].value\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-currency>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-email\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [domains]=\"field?.properties?.domains\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-email>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Password -->\n <ng-container *ngSwitchCase=\"'password'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-password\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [hintContent]=\"field?.properties?.hintContent\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-password>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Textarea -->\n <ng-container *ngSwitchCase=\"'textarea'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-textarea\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-textarea>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n [variant]=\"field?.properties?.variant ?? 'block'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [maxCalculatedFromToday]=\"\n field?.properties?.maxCalculatedFromToday\n \"\n [min]=\"field?.properties?.min\"\n [minCalculatedFromToday]=\"\n field?.properties?.minCalculatedFromToday\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Time -->\n <ng-container *ngSwitchCase=\"'time'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-time\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.properties?.items\"\n [label]=\"field?.label\"\n [mode]=\"field?.properties?.mode\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-time>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-input-radio\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-radio>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'select'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-select\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [searchable]=\"field?.properties?.searchable\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-select>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Slider -->\n <ng-container *ngSwitchCase=\"'slider'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-slider\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [quantum]=\"field?.properties?.quantum\"\n [size]=\"field?.properties?.size\"\n [steps]=\"field?.properties?.steps\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-slider>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [apiTimer]=\"field?.api?.timer\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n [size]=\"field?.properties?.size\"\n [styles]=\"\n field?.properties?.styles\n ? field?.properties?.styles\n : 'width: fit-content'\n \"\n (onClick)=\"handleOnClickApiCall($event)\"\n (onApiTimerStop)=\"handleOnApiTimerStop($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Live Location -->\n <ng-container *ngSwitchCase=\"'live-location'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-live-location\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [liveLocationStatus]=\"field?.api?.status?.value\"\n [shape]=\"field?.properties?.shape\"\n [isShowLatLongCaptureTimestamp]=\"\n field?.properties?.isShowLatLongCaptureTimestamp\n \"\n [showLoader]=\"field?.disabled\"\n [size]=\"field?.properties?.size\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickLiveLocation($event)\"\n (onLocationPermission)=\"handleOnLocationPermission($event)\"\n ></kwikui-button-live-location>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [mode]=\"field?.properties?.mode\"\n [otpLength]=\"field?.properties?.otpLength\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Preview Image -->\n <ng-container *ngSwitchCase=\"'image'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-image\n [altText]=\"field?.properties?.altText\"\n [class]=\"field?.properties?.class\"\n [html]=\"field?.properties?.html\"\n [id]=\"field.key\"\n [imageSrc]=\"formGroup.controls[field.key].value ?? ''\"\n [imageType]=\"field?.properties?.imageType\"\n [loadingType]=\"field?.properties?.loadingType\"\n [styles]=\"field?.properties?.styles\"\n ></kwikui-image>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- File Upload -->\n <ng-container *ngSwitchCase=\"'file'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto\"\n >\n <kwikui-input-files\n [accept]=\"field?.properties?.accept\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [files]=\"files[field.key]\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field?.key\"\n [label]=\"field?.properties?.label\"\n [link]=\"field?.properties?.link\"\n [maxFileSize]=\"field?.properties?.maxFileSize\"\n [multiple]=\"field?.properties?.multiple\"\n [setFileTypesToForm]=\"['NORMAL']\"\n [styles]=\"field?.properties?.styles\"\n [validators]=\"field?.validators\"\n [showViewButton]=\"field?.properties?.showViewButton\"\n (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\n (getViewButtonClick)=\"handleViewButtonClick($event, field)\"\n ></kwikui-input-files>\n </label>\n <ng-template #labelTemplate>\n <p\n style=\"padding: 0px 0.25rem; margin-bottom: 0.25rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Capture -->\n <ng-container *ngSwitchCase=\"'capture'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"mediaFiles[field.key]\"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'capture'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Record -->\n <ng-container *ngSwitchCase=\"'record'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"mediaFiles[field.key]\"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'record'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-star-rating\n [color]=\"field?.properties?.color\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [iconMarked]=\"field?.properties?.iconMarked\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-star-rating>\n </label>\n <ng-template #labelTemplate>\n <p>\n <b\n >{{ field?.properties?.placeholder }}\n <span *ngIf=\"field.validators?.required\">*</span></b\n >\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div\n class=\"kwikid-form-buttons\"\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden ||\n !formConfig.properties.footer.saveButton.hidden\n \"\n >\n <kwikui-button\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden && isMobileView\n \"\n [appearance]=\"'secondary'\"\n [disabled]=\"viewFormsButton.disabled\"\n [label]=\"formConfig.properties.footer.viewFormsButton.label\"\n [showLoader]=\"viewFormsButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"!formConfig.properties.footer.saveButton.hidden\"\n [disabled]=\"saveFormButton.disabled\"\n [label]=\"formConfig.properties.footer.saveButton.label\"\n [showLoader]=\"saveFormButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n *ngFor=\"let item of [].constructor(7); let i = index\"\n class=\"large-wrapper tui-skeleton tui-skeleton_rounded\"\n >\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<tui-push\n id=\"permission-error-notification\"\n *tuiPush=\"showPermissionErrorNotification\"\n heading=\"Please provide required permissions!\"\n type=\"Error\"\n (close)=\"togglePermissionErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n\n <button\n tuiIconButton\n tuiPreviewAction\n icon=\"tuiIconCloseLarge\"\n title=\"Close\"\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n</ng-template>\n\n<ng-template\n #dialog\n let-dialog\n>\n <div class=\"preview-container\">\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<div\n id=\"kwikid-camera-container\"\n *ngIf=\"isShowCamera\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"cameraType\"\n [data]=\"cameraData\"\n [image]=\"cameraImage\"\n [video]=\"cameraVideo\"\n [config]=\"cameraConfig\"\n (getImage)=\"handleGetCameraMedia($event, 'CAPTURE')\"\n (getVideo)=\"handleGetCameraMedia($event, 'RECORD')\"\n (onClickBack)=\"handleOnClickCameraBack($event)\"\n (onClickClose)=\"handleOnClickCameraClose($event)\"\n (onClickSave)=\"handleOnClickSaveCameraMedia($event, cameraType)\"\n >\n <ng-container\n *ngIf=\"cameraType === 'CAPTURE'\"\n slot=\"capture-header\"\n >\n <div class=\"capture-header-container\">\n <div class=\"capture-header-left\"> </div>\n <div class=\"capture-header-center\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"capture-header-right\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen ? 'tuiIconMinimize2' : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"cameraType === 'RECORD'\"\n slot=\"record-header\"\n >\n <div class=\"record-header-container\">\n <div class=\"record-header-row row-1\">\n <div class=\"record-header-left\">\n <kwikui-button\n *ngIf=\"\n cameraConfig?.header?.isBack && cameraRecordingState == 'NONE'\n \"\n appearance=\"whiteblock\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-center\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-right\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen\n ? 'tuiIconMinimize2'\n : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n </div>\n </div>\n <div class=\"record-header-row row-2\">\n <div\n id=\"blinking-dot-container\"\n [class.recording]=\"cameraRecordingState == 'RECORDING'\"\n [class.paused]=\"cameraRecordingState == 'PAUSED'\"\n [class.recorded]=\"\n cameraRecordingState == 'NONE' ||\n cameraRecordingState === 'RECORDED'\n \"\n >\n <div\n *ngIf=\"cameraRecordingState == 'RECORDING'\"\n class=\"dot recording blink\"\n >\n </div>\n <div\n *ngIf=\"cameraRecordingState === 'PAUSED'\"\n class=\"dot paused\"\n >\n </div>\n <div\n *ngIf=\"\n cameraRecordingState == 'NONE' ||\n cameraRecordingState === 'RECORDED'\n \"\n class=\"dot recorded\"\n >\n </div>\n <div>\n &nbsp;{{ cameraRecordingTime | formatTimer }}\n <ng-container\n *ngIf=\"cameraConfig?.others?.maxRecordingTimeInSeconds\"\n >\n /\n {{\n cameraConfig?.others?.maxRecordingTimeInSeconds\n | formatTimer\n }}\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </kwikid-camera>\n </div>\n</div>\n", styles: [".kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;scroll-behavior:smooth}.kwikid-form.show>*:not(:last-child){margin-bottom:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.kwikid-form-buttons>*:not(:last-child){margin-right:1rem}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;padding:1rem 1rem 0}#uf-form-fields-header-container>*:not(:last-child){margin-bottom:.5rem}#uf-form-fields-header-container #uf-header-logo{width:-moz-fit-content;width:fit-content;height:50px}#uf-form-fields-header-container #uf-form-fields-header-main{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;width:100%}#uf-form-fields-header-container #uf-form-fields-header-main>*:not(:last-child){margin-right:.25rem}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right>*{margin-bottom:.5rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1rem}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.title>*:not(:last-child){margin-right:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;padding:1rem}.kwikid-form-container-loading>* :not(:last-child){margin-bottom:1rem}#field-error-notification,#permission-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top,#permission-error-notification .t-top{color:#fff!important}#field-error-notification .t-close,#permission-error-notification .t-close{color:#fff!important}.preview-container{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;align-content:center;height:calc(100vh - 3rem)}@media only screen and (min-width: 768px){.preview-container{height:calc(100vh - 10rem);width:calc(100vw - 10rem)}}.preview-container>*:not(:last-child){margin-bottom:1rem}.preview-container .preview-html{flex-grow:1}.preview-container .preview-iframe-content{height:100%;flex-grow:1}.preview-container .preview-iframe-content .preview-iframe{width:100%;height:100%}.preview-container .preview-unavailable{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#fff;font-size:1.2rem;top:50%;left:50%;width:100%;height:100vh}.preview-container .preview-unavailable>*:not(:last-child){margin-bottom:1rem}#kwikid-camera-container{width:100%;height:100%;position:fixed;top:50%;left:50%;background-color:#0000008f;transform:translate(-50%,-50%);z-index:100}#kwikid-camera-container #kwikid-camera-wrapper{width:min(80%);height:max(85%);box-shadow:#0000008f 0 22px 70px 4px;overflow:hidden;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:1rem;background-color:#000;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container{display:flex;width:100%;max-width:100%;padding:0}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-left{flex:1;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container{display:flex;width:100%;max-width:100%;padding:0;color:#fff;flex-direction:column;justify-content:flex-start;align-items:stretch}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-left{flex:1;display:flex;justify-content:flex-start;grid-gap:1rem;gap:1rem;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2{display:flex;flex-direction:row;justify-content:center;align-items:center}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;grid-gap:.25rem;gap:.25rem;padding:.35rem .6rem;width:-moz-fit-content;width:fit-content;border-radius:2rem;background-color:#f5f5f5}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recording{color:red;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.paused{color:#525252;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recorded{color:#000;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot{display:inline-block;width:.75rem;height:.75rem;border-radius:100%}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recording{background-color:red;box-shadow:0 0 5px -1px red}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.paused{background-color:#525252;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recorded{background-color:#000;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.blink{animation:blinker 1s cubic-bezier(.5,0,1,1) infinite alternate}@keyframes blinker{0%{opacity:1}to{opacity:0}}#kwikid-camera-container #kwikid-camera-wrapper.fullscreen{width:100%;height:100%;border-radius:0;transition:5s linear ease}@media only screen and (max-width: 600px){#kwikid-camera-container #kwikid-camera-wrapper{width:100%;height:100%;border-radius:0;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper #kwikid-camera-header-enlarge-button{display:none}}\n", "::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i3.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i3.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i3.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputCurrencyComponent, selector: "kwikui-input-currency", inputs: ["currencyType", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators", "value"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputEmailComponent, selector: "kwikui-input-email", inputs: ["case", "disabled", "domains", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["decimal", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "precision", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxCalculatedFromToday", "min", "minCalculatedFromToday", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputTimeComponent, selector: "kwikui-input-time", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "items", "invalid", "label", "mode", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["countryCode", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "phoneMaskAfterCountryCode", "placeholder", "postfix", "prefix", "properties", "removeCountryCodeFromValue", "size", "validators"], outputs: ["getKeyValue"] }, { type: i5.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i3.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSliderComponent, selector: "kwikui-input-slider", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "prefix", "properties", "quantum", "size", "steps", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiTimer", "apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick", "onApiTimerStop"] }, { type: i3.KwikUIButtonLiveLocationComponent, selector: "kwikui-button-live-location", inputs: ["liveLocationStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles", "isShowLatLongCaptureTimestamp"], outputs: ["onClick", "onLocationPermission"] }, { type: i3.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "mode", "otpLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i3.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators", "variant", "showViewButton"], outputs: ["getKeyValue", "getRemovedFile", "getViewButtonClick"] }, { type: i4.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i3.KwikUIStarRatingComponent, selector: "kwikui-star-rating", inputs: ["color", "disabled", "focus", "formControl", "formControlName", "icon", "iconMarked", "id", "invalid", "label", "max", "min", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i6.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { type: i5.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i7.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i7.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i5.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image", "video"], outputs: ["getImage", "onClickSave", "getVideo"] }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i6.TuiPushDirective, selector: "tui-push" }, { type: i7.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i3.KwikUISafeHtmlPipe, "kwikuiSafeUrl": i3.KwikUISafeUrlPipe, "formatTimer": TimerPipe } });
6730
+ /** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { allFormsData: "allFormsData", extraData: "extraData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", popupFormCallback: "popupFormCallback", userConfig: "userConfig", stepConfig: "stepConfig" }, outputs: { getLogs: "getLogs", getUnsavedDataState: "getUnsavedDataState", onActionShowPopupForm: "onActionShowPopupForm", onClickApiCall: "onClickApiCall", onClickViewFile: "onClickViewFile", onClickFormFieldButton: "onClickFormFieldButton", onClickGoBack: "onClickGoBack", onClickSaveForm: "onClickSaveForm", onClickViewForms: "onClickViewForms" }, providers: [KwikIDFormViewService, KwikIDFormViewApiService], viewQueries: [{ propertyName: "formFieldContainerRef", first: true, predicate: ["formFieldContainerRef"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "formFieldsRef", predicate: ["formFieldsRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div\n id=\"uf-form-fields-header-container\"\n *ngIf=\"\n !formConfig.properties?.header?.title?.hidden ||\n !formConfig.properties?.header?.logo?.hidden ||\n !formConfig.properties?.header?.steps?.hidden ||\n !formConfig.properties?.header?.backButton?.hidden\n \"\n >\n <img\n id=\"uf-header-logo\"\n *ngIf=\"!formConfig.properties?.header?.logo?.hidden && isMobileView\"\n [src]=\"formConfig.properties?.header?.logo?.src\"\n [alt]=\"formConfig.properties?.header?.logo?.alt\"\n [style]=\"\n formConfig.properties?.header?.logo?.styles ?? '' | styleSanitizer\n \"\n />\n <div id=\"uf-form-fields-header-main\">\n <div id=\"uf-form-fields-header-left\">\n <kwikui-button\n *ngIf=\"\n !formConfig.properties?.header.backButton.hidden && isMobileView\n \"\n [disabled]=\"backButton.disabled\"\n [showLoader]=\"backButton.showLoader\"\n appearance=\"mono\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n (onClick)=\"\n handleOnClickGoBack(\n $event,\n formConfig.properties?.header.backButton.mode\n )\n \"\n ></kwikui-button>\n </div>\n <div id=\"uf-form-fields-header-right\">\n <div\n id=\"uf-form-fields-title\"\n *ngIf=\"!formConfig.properties?.header.title.hidden\"\n >{{ formConfig.properties?.header.title.label }}</div\n >\n <div\n id=\"uf-form-fields-steps\"\n *ngIf=\"!formConfig.properties?.header.steps.hidden\"\n >\n Step {{ formConfig.sequenceNo }} of {{ formConfig.formsListLength }}\n </div>\n </div>\n </div>\n <hr\n *ngIf=\"\n !formConfig.properties?.header.title.hidden ||\n !formConfig.properties?.header.steps.hidden ||\n !formConfig.properties?.header.backButton.hidden\n \"\n />\n </div>\n <form\n #formFieldContainerRef\n class=\"kwikid-form show\"\n [style]=\"formConfig.properties?.main?.styles ?? '' | styleSanitizer\"\n [formGroup]=\"formGroup\"\n >\n <ng-container\n *ngFor=\"\n let field of formFields;\n let i = index;\n trackBy: getUniqueIdentifier\n \"\n >\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | kwikuiSafeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n #formFieldsRef\n class=\"title\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n [label]=\"field?.properties?.resetButtonLabel ?? 'Reset'\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button\n [appearance]=\"field?.properties?.appearance ?? 'primary'\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [icon]=\"field?.properties?.icon\"\n [iconRight]=\"field?.properties?.iconRight\"\n [id]=\"field?.key\"\n [label]=\"field?.label\"\n [shape]=\"field?.properties?.shape\"\n [showLoader]=\"field?.properties?.loading ?? false\"\n [size]=\"field?.properties?.size\"\n [styles]=\"field?.properties?.styles\"\n [type]=\"'button'\"\n (onClick)=\"handleOnClickFormFieldButton(field)\"\n ></kwikui-button>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Currency -->\n <ng-container *ngSwitchCase=\"'currency'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-currency\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [currencyType]=\"field?.properties?.currencyType\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n [value]=\"formGroup.controls[field.key].value\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-currency>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-email\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [domains]=\"field?.properties?.domains\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-email>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Password -->\n <ng-container *ngSwitchCase=\"'password'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-password\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [hintContent]=\"field?.properties?.hintContent\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-password>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Textarea -->\n <ng-container *ngSwitchCase=\"'textarea'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-textarea\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-textarea>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n [variant]=\"field?.properties?.variant ?? 'block'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [maxCalculatedFromToday]=\"\n field?.properties?.maxCalculatedFromToday\n \"\n [min]=\"field?.properties?.min\"\n [minCalculatedFromToday]=\"\n field?.properties?.minCalculatedFromToday\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Time -->\n <ng-container *ngSwitchCase=\"'time'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-time\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.properties?.items\"\n [label]=\"field?.label\"\n [mode]=\"field?.properties?.mode\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-time>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-input-radio\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-radio>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'select'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-select\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [searchable]=\"field?.properties?.searchable\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-select>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Slider -->\n <ng-container *ngSwitchCase=\"'slider'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-slider\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [quantum]=\"field?.properties?.quantum\"\n [size]=\"field?.properties?.size\"\n [steps]=\"field?.properties?.steps\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-slider>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [apiTimer]=\"field?.api?.timer\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n [size]=\"field?.properties?.size\"\n [styles]=\"\n field?.properties?.styles\n ? field?.properties?.styles\n : 'width: fit-content'\n \"\n (onClick)=\"handleOnClickApiCall($event)\"\n (onApiTimerStop)=\"handleOnApiTimerStop($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Live Location -->\n <ng-container *ngSwitchCase=\"'live-location'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-live-location\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [liveLocationStatus]=\"field?.api?.status?.value\"\n [shape]=\"field?.properties?.shape\"\n [isShowLatLongCaptureTimestamp]=\"\n field?.properties?.isShowLatLongCaptureTimestamp\n \"\n [showLoader]=\"field?.disabled\"\n [size]=\"field?.properties?.size\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickLiveLocation($event)\"\n (onLocationPermission)=\"handleOnLocationPermission($event)\"\n ></kwikui-button-live-location>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [mode]=\"field?.properties?.mode\"\n [otpLength]=\"field?.properties?.otpLength\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Preview Image -->\n <ng-container *ngSwitchCase=\"'image'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-image\n [altText]=\"field?.properties?.altText\"\n [class]=\"field?.properties?.class\"\n [html]=\"field?.properties?.html\"\n [id]=\"field.key\"\n [imageSrc]=\"formGroup.controls[field.key].value ?? ''\"\n [imageType]=\"field?.properties?.imageType\"\n [loadingType]=\"field?.properties?.loadingType\"\n [styles]=\"field?.properties?.styles\"\n ></kwikui-image>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- File Upload -->\n <ng-container *ngSwitchCase=\"'file'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto\"\n >\n <kwikui-input-files\n [accept]=\"field?.properties?.accept\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [files]=\"files[field.key]\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field?.key\"\n [label]=\"field?.properties?.label\"\n [link]=\"field?.properties?.link\"\n [maxFileSize]=\"field?.properties?.maxFileSize\"\n [multiple]=\"field?.properties?.multiple\"\n [setFileTypesToForm]=\"['NORMAL']\"\n [styles]=\"field?.properties?.styles\"\n [validators]=\"field?.validators\"\n [showViewButton]=\"field?.properties?.showViewButton\"\n (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\n (getViewButtonClick)=\"handleViewButtonClick($event, field)\"\n ></kwikui-input-files>\n </label>\n <ng-template #labelTemplate>\n <p\n style=\"padding: 0px 0.25rem; margin-bottom: 0.25rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Capture -->\n <ng-container *ngSwitchCase=\"'capture'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"\n mediaFiles[field.key] | filterImageUrlOrBase64FromObject\n \"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'capture'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Record -->\n <ng-container *ngSwitchCase=\"'record'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"\n mediaFiles[field.key] | filterVideoUrlOrBase64FromObject\n \"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'record'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-star-rating\n [color]=\"field?.properties?.color\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [iconMarked]=\"field?.properties?.iconMarked\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-star-rating>\n </label>\n <ng-template #labelTemplate>\n <p>\n <b\n >{{ field?.properties?.placeholder }}\n <span *ngIf=\"field.validators?.required\">*</span></b\n >\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div\n class=\"kwikid-form-buttons\"\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden ||\n !formConfig.properties.footer.saveButton.hidden\n \"\n >\n <kwikui-button\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden && isMobileView\n \"\n [appearance]=\"'secondary'\"\n [disabled]=\"viewFormsButton.disabled\"\n [label]=\"formConfig.properties.footer.viewFormsButton.label\"\n [showLoader]=\"viewFormsButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"!formConfig.properties.footer.saveButton.hidden\"\n [disabled]=\"saveFormButton.disabled\"\n [label]=\"formConfig.properties.footer.saveButton.label\"\n [showLoader]=\"saveFormButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n *ngFor=\"let item of [].constructor(7); let i = index\"\n class=\"large-wrapper tui-skeleton tui-skeleton_rounded\"\n >\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<tui-push\n id=\"permission-error-notification\"\n *tuiPush=\"showPermissionErrorNotification\"\n heading=\"Please provide required permissions!\"\n type=\"Error\"\n (close)=\"togglePermissionErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n\n <button\n tuiIconButton\n tuiPreviewAction\n icon=\"tuiIconCloseLarge\"\n title=\"Close\"\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n</ng-template>\n\n<ng-template\n #dialog\n let-dialog\n>\n <div class=\"preview-container\">\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<div\n id=\"kwikid-camera-container\"\n *ngIf=\"isShowCamera\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"activeCameraType\"\n [data]=\"activeCameraData\"\n [image]=\"activeCameraImage\"\n [video]=\"activeCameraVideo\"\n [config]=\"activeCameraConfig\"\n (getImage)=\"handleGetCameraMedia($event, 'CAPTURE')\"\n (getVideo)=\"handleGetCameraMedia($event, 'RECORD')\"\n (onClickBack)=\"handleOnClickCameraBack($event)\"\n (onClickClose)=\"handleOnClickCameraClose($event)\"\n (onClickSave)=\"handleOnClickSaveCameraMedia($event, activeCameraType)\"\n >\n <ng-container\n *ngIf=\"activeCameraType === 'CAPTURE'\"\n slot=\"capture-header\"\n >\n <div class=\"capture-header-container\">\n <div class=\"capture-header-left\"> </div>\n <div class=\"capture-header-center\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"activeCameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"capture-header-right\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen ? 'tuiIconMinimize2' : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"activeCameraConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"activeCameraType === 'RECORD'\"\n slot=\"record-header\"\n >\n <div class=\"record-header-container\">\n <div class=\"record-header-row row-1\">\n <div class=\"record-header-left\">\n <kwikui-button\n *ngIf=\"\n activeCameraConfig?.header?.isBack &&\n activeCameraRecordingState == 'NONE'\n \"\n appearance=\"whiteblock\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-center\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"activeCameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-right\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen\n ? 'tuiIconMinimize2'\n : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n </div>\n </div>\n <div class=\"record-header-row row-2\">\n <div\n id=\"blinking-dot-container\"\n [class.recording]=\"activeCameraRecordingState == 'RECORDING'\"\n [class.paused]=\"activeCameraRecordingState == 'PAUSED'\"\n [class.recorded]=\"\n activeCameraRecordingState == 'NONE' ||\n activeCameraRecordingState === 'RECORDED'\n \"\n >\n <div\n *ngIf=\"activeCameraRecordingState == 'RECORDING'\"\n class=\"dot recording blink\"\n >\n </div>\n <div\n *ngIf=\"activeCameraRecordingState === 'PAUSED'\"\n class=\"dot paused\"\n >\n </div>\n <div\n *ngIf=\"\n activeCameraRecordingState == 'NONE' ||\n activeCameraRecordingState === 'RECORDED'\n \"\n class=\"dot recorded\"\n >\n </div>\n <div>\n &nbsp;{{ activeCameraRecordingTime | formatTimer }}\n <ng-container\n *ngIf=\"activeCameraConfig?.others?.maxRecordingTimeInSeconds\"\n >\n /\n {{\n activeCameraConfig?.others?.maxRecordingTimeInSeconds\n | formatTimer\n }}\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </kwikid-camera>\n </div>\n</div>\n", styles: [".kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;scroll-behavior:smooth}.kwikid-form.show>*:not(:last-child){margin-bottom:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.kwikid-form-buttons>*:not(:last-child){margin-right:1rem}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;padding:1rem 1rem 0}#uf-form-fields-header-container>*:not(:last-child){margin-bottom:.5rem}#uf-form-fields-header-container #uf-header-logo{width:-moz-fit-content;width:fit-content;height:50px}#uf-form-fields-header-container #uf-form-fields-header-main{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;width:100%}#uf-form-fields-header-container #uf-form-fields-header-main>*:not(:last-child){margin-right:.25rem}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right>*{margin-bottom:.5rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1rem}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.title>*:not(:last-child){margin-right:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;padding:1rem}.kwikid-form-container-loading>* :not(:last-child){margin-bottom:1rem}#field-error-notification,#permission-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top,#permission-error-notification .t-top{color:#fff!important}#field-error-notification .t-close,#permission-error-notification .t-close{color:#fff!important}.preview-container{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;align-content:center;height:calc(100vh - 3rem)}@media only screen and (min-width: 768px){.preview-container{height:calc(100vh - 10rem);width:calc(100vw - 10rem)}}.preview-container>*:not(:last-child){margin-bottom:1rem}.preview-container .preview-html{flex-grow:1}.preview-container .preview-iframe-content{height:100%;flex-grow:1}.preview-container .preview-iframe-content .preview-iframe{width:100%;height:100%}.preview-container .preview-unavailable{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#fff;font-size:1.2rem;top:50%;left:50%;width:100%;height:100vh}.preview-container .preview-unavailable>*:not(:last-child){margin-bottom:1rem}#kwikid-camera-container{width:100%;height:100%;position:fixed;top:50%;left:50%;background-color:#0000008f;transform:translate(-50%,-50%);z-index:100}#kwikid-camera-container #kwikid-camera-wrapper{width:min(80%);height:max(85%);box-shadow:#0000008f 0 22px 70px 4px;overflow:hidden;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:1rem;background-color:#000;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container{display:flex;width:100%;max-width:100%;padding:0}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-left{flex:1;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container{display:flex;width:100%;max-width:100%;padding:0;color:#fff;flex-direction:column;justify-content:flex-start;align-items:stretch}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-left{flex:1;display:flex;justify-content:flex-start;grid-gap:1rem;gap:1rem;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2{display:flex;flex-direction:row;justify-content:center;align-items:center}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;grid-gap:.25rem;gap:.25rem;padding:.35rem .6rem;width:-moz-fit-content;width:fit-content;border-radius:2rem;background-color:#f5f5f5}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recording{color:red;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.paused{color:#525252;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recorded{color:#000;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot{display:inline-block;width:.75rem;height:.75rem;border-radius:100%}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recording{background-color:red;box-shadow:0 0 5px -1px red}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.paused{background-color:#525252;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recorded{background-color:#000;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.blink{animation:blinker 1s cubic-bezier(.5,0,1,1) infinite alternate}@keyframes blinker{0%{opacity:1}to{opacity:0}}#kwikid-camera-container #kwikid-camera-wrapper.fullscreen{width:100%;height:100%;border-radius:0;transition:5s linear ease}@media only screen and (max-width: 600px){#kwikid-camera-container #kwikid-camera-wrapper{width:100%;height:100%;border-radius:0;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper #kwikid-camera-header-enlarge-button{display:none}}\n", "::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i3.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i3.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i3.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputCurrencyComponent, selector: "kwikui-input-currency", inputs: ["currencyType", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators", "value"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputEmailComponent, selector: "kwikui-input-email", inputs: ["case", "disabled", "domains", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["decimal", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "precision", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxCalculatedFromToday", "min", "minCalculatedFromToday", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputTimeComponent, selector: "kwikui-input-time", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "items", "invalid", "label", "mode", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["countryCode", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "phoneMaskAfterCountryCode", "placeholder", "postfix", "prefix", "properties", "removeCountryCodeFromValue", "size", "validators"], outputs: ["getKeyValue"] }, { type: i5.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i3.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSliderComponent, selector: "kwikui-input-slider", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "prefix", "properties", "quantum", "size", "steps", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiTimer", "apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick", "onApiTimerStop"] }, { type: i3.KwikUIButtonLiveLocationComponent, selector: "kwikui-button-live-location", inputs: ["liveLocationStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles", "isShowLatLongCaptureTimestamp"], outputs: ["onClick", "onLocationPermission"] }, { type: i3.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "mode", "otpLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i3.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators", "variant", "showViewButton"], outputs: ["getKeyValue", "getRemovedFile", "getViewButtonClick"] }, { type: i4.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i3.KwikUIStarRatingComponent, selector: "kwikui-star-rating", inputs: ["color", "disabled", "focus", "formControl", "formControlName", "icon", "iconMarked", "id", "invalid", "label", "max", "min", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i6.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { type: i5.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i7.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i7.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i5.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image", "video"], outputs: ["getImage", "onClickSave", "getVideo"] }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i6.TuiPushDirective, selector: "tui-push" }, { type: i7.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i3.KwikUISafeHtmlPipe, "filterImageUrlOrBase64FromObject": FilterImageUrlOrBase64FromObjectPipe, "filterVideoUrlOrBase64FromObject": FilterVideoUrlOrBase64FromObjectPipe, "kwikuiSafeUrl": i3.KwikUISafeUrlPipe, "formatTimer": TimerPipe } });
6564
6731
  __decorate([
6565
6732
  logMethod
6566
6733
  ], KwikIDFormViewComponent.prototype, "resetCamera", null);
@@ -6651,9 +6818,6 @@ __decorate([
6651
6818
  __decorate([
6652
6819
  logMethod
6653
6820
  ], KwikIDFormViewComponent.prototype, "handleGetKeyValue", null);
6654
- __decorate([
6655
- logMethod
6656
- ], KwikIDFormViewComponent.prototype, "handleOnClickResetFormFields2", null);
6657
6821
  __decorate([
6658
6822
  logMethod
6659
6823
  ], KwikIDFormViewComponent.prototype, "handleOnClickResetFormFields", null);
@@ -6907,8 +7071,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
6907
7071
  type: Output
6908
7072
  }], onClickViewForms: [{
6909
7073
  type: Output
6910
- }], resetCamera: [], ngOnInit: [], ngOnChanges: [], ngOnDestroy: [], triggerLogs: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleViewButtonClick: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleOnLocationPermission: [], handleOnClickLiveLocation: [], handleGetKeyValue: [], handleOnClickResetFormFields2: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], handleOnApiTimerStop: [], handleOnScrollToField: [], toggleErrorNotification: [], togglePermissionErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldGroupReset: [], fieldHideApiLoader: [], fieldShowApiLoader: [], setHtml: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setValue: [], setFieldDefaultValue: [], setApiStatus: [], setApiHeaderValue: [], setApiHeaderValidity: [], setApiBodyValue: [], setApiBodyValidity: [], setFieldValidity: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
7074
+ }], resetCamera: [], ngOnInit: [], ngOnChanges: [], ngOnDestroy: [], triggerLogs: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleViewButtonClick: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleOnLocationPermission: [], handleOnClickLiveLocation: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], handleOnApiTimerStop: [], handleOnScrollToField: [], toggleErrorNotification: [], togglePermissionErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldGroupReset: [], fieldHideApiLoader: [], fieldShowApiLoader: [], setHtml: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setValue: [], setFieldDefaultValue: [], setApiStatus: [], setApiHeaderValue: [], setApiHeaderValidity: [], setApiBodyValue: [], setApiBodyValidity: [], setFieldValidity: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
6911
7075
 
7076
+ /* eslint-disable no-unused-vars */
6912
7077
  var EFormType;
6913
7078
  (function (EFormType) {
6914
7079
  EFormType["FORM"] = "FORM";
@@ -6961,8 +7126,8 @@ class KwikIDFormsListComponent {
6961
7126
  this.isAllFormsCompleted = true;
6962
7127
  this.loading = false;
6963
7128
  }
6964
- setSelectedForm(selected_form) {
6965
- this.selectedForm = selected_form;
7129
+ setSelectedForm(selectedForm) {
7130
+ this.selectedForm = selectedForm;
6966
7131
  }
6967
7132
  ngOnInit() {
6968
7133
  var _a, _b;
@@ -7025,14 +7190,12 @@ class KwikIDFormsListComponent {
7025
7190
  if (isNull(stepConfig) || isUndefined(stepConfig)) {
7026
7191
  stepConfig = setValueToObjectPath({}, "props", stepConfigProperties);
7027
7192
  }
7193
+ else if (checkObjectKeyExists(stepConfig, "props")) {
7194
+ stepConfigProperties = mergeObjects(stepConfigProperties, stepConfig.props);
7195
+ stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
7196
+ }
7028
7197
  else {
7029
- if (checkObjectKeyExists(stepConfig, "props")) {
7030
- stepConfigProperties = mergeObjects(stepConfigProperties, stepConfig.props);
7031
- stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
7032
- }
7033
- else {
7034
- stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
7035
- }
7198
+ stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
7036
7199
  }
7037
7200
  stepConfig.props.formListProperties.footer.submitFormButton.label =
7038
7201
  updateLanguage(stepConfig.props.formListProperties.footer.submitFormButton.label, getLanguage());
@@ -7041,47 +7204,38 @@ class KwikIDFormsListComponent {
7041
7204
  filterHiddenForms(formsList) {
7042
7205
  return formsList.filter((form) => {
7043
7206
  if (checkObjectKeyExists(form, "hidden")) {
7044
- if (!form.hidden) {
7045
- return form;
7046
- }
7207
+ return !form.hidden;
7047
7208
  }
7209
+ return false;
7048
7210
  });
7049
7211
  }
7050
7212
  setFormTitles(formsList) {
7051
- return formsList.filter((form) => {
7213
+ return formsList
7214
+ .map((form) => {
7052
7215
  if (form.type === EFormType.HTML) {
7053
- return form;
7216
+ return form; // No modification, just return
7054
7217
  }
7055
- else {
7056
- if (checkObjectPathExists(form, "props.title")) {
7057
- form.props.title = updateLanguage(form.props.title, getLanguage());
7058
- return form;
7059
- }
7218
+ if (checkObjectPathExists(form, "props.title")) {
7219
+ form.props.title = updateLanguage(form.props.title, getLanguage());
7060
7220
  }
7061
- });
7221
+ return form; // Return the form regardless of modification
7222
+ })
7223
+ .filter((form) => form.type === EFormType.HTML ||
7224
+ checkObjectPathExists(form, "props.title"));
7062
7225
  }
7063
7226
  findFormsListLength(formsList) {
7064
- const _formsList = formsList.filter((form) => {
7227
+ return formsList.filter((form) => {
7065
7228
  if (checkObjectKeyExists(form, "type")) {
7066
- if (form.type !== EFormType.HTML) {
7067
- if (checkObjectKeyExists(form, "hidden")) {
7068
- if (!form.hidden) {
7069
- return form;
7070
- }
7071
- }
7072
- }
7073
- }
7074
- else if (checkObjectKeyExists(form, "hidden")) {
7075
- if (!form.hidden) {
7076
- return form;
7077
- }
7229
+ return (form.type !== EFormType.HTML &&
7230
+ checkObjectKeyExists(form, "hidden") &&
7231
+ !form.hidden);
7078
7232
  }
7079
- });
7080
- return _formsList.length;
7233
+ return checkObjectKeyExists(form, "hidden") && !form.hidden;
7234
+ }).length;
7081
7235
  }
7082
7236
  checkIsAllFormsCompleted(formsList) {
7083
7237
  let isAllFormsCompleted = true;
7084
- for (let form of formsList) {
7238
+ for (const form of formsList) {
7085
7239
  if (checkObjectKeyExists(form, "type")) {
7086
7240
  if (form.type !== EFormType.HTML) {
7087
7241
  if (form.status !== "completed") {
@@ -7135,6 +7289,9 @@ __decorate([
7135
7289
  __decorate([
7136
7290
  logMethod
7137
7291
  ], KwikIDFormsListComponent.prototype, "filterHiddenForms", null);
7292
+ __decorate([
7293
+ logMethod
7294
+ ], KwikIDFormsListComponent.prototype, "setFormTitles", null);
7138
7295
  __decorate([
7139
7296
  logMethod
7140
7297
  ], KwikIDFormsListComponent.prototype, "findFormsListLength", null);
@@ -7154,7 +7311,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
7154
7311
  templateUrl: "./forms-list.component.html",
7155
7312
  styleUrls: ["./forms-list.component.scss", "../shared.scss"]
7156
7313
  }]
7157
- }], ctorParameters: function () { return []; }, propDecorators: { showFormFields: [{
7314
+ }], propDecorators: { showFormFields: [{
7158
7315
  type: Input
7159
7316
  }], userConfig: [{
7160
7317
  type: Input
@@ -7178,7 +7335,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
7178
7335
  type: Output
7179
7336
  }], onClickSubmitForms: [{
7180
7337
  type: Output
7181
- }], ngOnChanges: [], triggerLogs: [], formatStepConfig: [], filterHiddenForms: [], findFormsListLength: [], checkIsAllFormsCompleted: [], handleOnClickSetActiveForm: [], handleOnSubmitForms: [] } });
7338
+ }], ngOnChanges: [], triggerLogs: [], formatStepConfig: [], filterHiddenForms: [], setFormTitles: [], findFormsListLength: [], checkIsAllFormsCompleted: [], handleOnClickSetActiveForm: [], handleOnSubmitForms: [] } });
7182
7339
 
7183
7340
  var ERendererActionKey;
7184
7341
  (function (ERendererActionKey) {
@@ -7191,9 +7348,7 @@ var ERendererActionKey;
7191
7348
 
7192
7349
  const getFormConfigByKey = (forms, key) => {
7193
7350
  const form = forms.find((form) => {
7194
- if (form.key === key) {
7195
- return form;
7196
- }
7351
+ return form.key === key;
7197
7352
  });
7198
7353
  return form;
7199
7354
  };
@@ -7309,7 +7464,7 @@ class KwikIDFormsRendererComponent {
7309
7464
  }
7310
7465
  ngOnChanges(changes) {
7311
7466
  const verifyChange = (prop) => {
7312
- return changes.hasOwnProperty(prop) && !changes[prop].firstChange;
7467
+ return checkObjectKeyExists(changes, prop) && !changes[prop].firstChange;
7313
7468
  };
7314
7469
  if (verifyChange("userConfig")) {
7315
7470
  this.userConfig = changes.userConfig.currentValue;
@@ -7391,19 +7546,19 @@ class KwikIDFormsRendererComponent {
7391
7546
  if (checkObjectKeyExists(form, "formContent")) {
7392
7547
  if (checkObjectKeyExists(form.formContent, "url")) {
7393
7548
  form = setValueToObjectPath(form, "props.url", form.formContent.url);
7394
- delete form["formContent"]["url"];
7549
+ delete form.formContent.url;
7395
7550
  }
7396
7551
  if (checkObjectKeyExists(form.formContent, "path")) {
7397
7552
  form = setValueToObjectPath(form, "props.path", form.formContent.path);
7398
- delete form["formContent"]["path"];
7553
+ delete form.formContent.path;
7399
7554
  }
7400
7555
  }
7401
7556
  if (isEmptyValue(form.formContent)) {
7402
- delete form["formContent"];
7557
+ delete form.formContent;
7403
7558
  }
7404
7559
  if (checkObjectKeyExists(form, "title")) {
7405
7560
  form = setValueToObjectPath(form, "props.title", form.title);
7406
- delete form["title"];
7561
+ delete form.title;
7407
7562
  }
7408
7563
  if (!checkObjectKeyExists(form, "hidden")) {
7409
7564
  form.hidden = false;
@@ -7429,18 +7584,16 @@ class KwikIDFormsRendererComponent {
7429
7584
  htmlContent: form.htmlContent
7430
7585
  };
7431
7586
  }
7432
- delete form["htmlContent"];
7587
+ delete form.htmlContent;
7433
7588
  }
7434
- else {
7435
- if (!checkObjectKeyExists(form, "props")) {
7436
- form.props = {
7437
- htmlContent: ""
7438
- };
7439
- }
7589
+ else if (!checkObjectKeyExists(form, "props")) {
7590
+ form.props = {
7591
+ htmlContent: ""
7592
+ };
7440
7593
  }
7441
7594
  if (checkObjectKeyExists(form, "title")) {
7442
7595
  form = setValueToObjectPath(form, "props.title", form.title);
7443
- delete form["title"];
7596
+ delete form.title;
7444
7597
  }
7445
7598
  if (!checkObjectKeyExists(form, "hidden")) {
7446
7599
  form.hidden = false;
@@ -7471,21 +7624,22 @@ class KwikIDFormsRendererComponent {
7471
7624
  */
7472
7625
  assignSequenceNoToForm(formsList) {
7473
7626
  let sequenceNo = 1;
7474
- for (let form of formsList) {
7627
+ for (const form of formsList) {
7475
7628
  if (checkObjectKeyExists(form, "hidden")) {
7476
7629
  if (!form.hidden && form.type !== EFormType.HTML) {
7477
- form.sequenceNo = sequenceNo++;
7630
+ form.sequenceNo = sequenceNo;
7631
+ sequenceNo += 1;
7478
7632
  }
7479
7633
  else {
7480
- delete form["sequenceNo"];
7634
+ delete form.sequenceNo;
7481
7635
  }
7482
7636
  }
7483
7637
  }
7484
7638
  return formsList;
7485
7639
  }
7486
7640
  findCompletedFormsList(allFormsData) {
7487
- let formsListCompleted = [];
7488
- Object.keys(allFormsData).map((formKey) => {
7641
+ const formsListCompleted = [];
7642
+ Object.keys(allFormsData).forEach((formKey) => {
7489
7643
  formsListCompleted.push(formKey);
7490
7644
  });
7491
7645
  return formsListCompleted;
@@ -7544,7 +7698,7 @@ class KwikIDFormsRendererComponent {
7544
7698
  }
7545
7699
  filterAllFormsData(allFormsData, formsList) {
7546
7700
  let currentUserFormAllFormsData = {};
7547
- for (let form of formsList) {
7701
+ for (const form of formsList) {
7548
7702
  if (checkObjectKeyExists(form, "hidden") &&
7549
7703
  !form.hidden &&
7550
7704
  form.type !== EFormType.HTML) {
@@ -7570,31 +7724,28 @@ class KwikIDFormsRendererComponent {
7570
7724
  return allFormsCompleted;
7571
7725
  }
7572
7726
  findActiveFormConfig(formsList) {
7573
- const activeFormConfig = formsList.find((form) => {
7574
- if (checkObjectKeyExists(form, "hidden")) {
7575
- if (!form.hidden && form.type !== EFormType.HTML) {
7576
- return form.status === "editable" && !form.disabled;
7577
- }
7578
- }
7727
+ return formsList.find((form) => {
7728
+ return (checkObjectKeyExists(form, "hidden") &&
7729
+ !form.hidden &&
7730
+ form.type !== EFormType.HTML &&
7731
+ form.status === "editable" &&
7732
+ !form.disabled);
7579
7733
  });
7580
- return activeFormConfig;
7581
7734
  }
7582
7735
  updateFormsList() {
7583
7736
  return __awaiter(this, void 0, void 0, function* () {
7584
7737
  this.formsList = this.convertFormListConfig(this.formsList);
7585
- for (let form of this.formsList) {
7738
+ for (const form of this.formsList) {
7586
7739
  if (checkObjectKeyExists(form, "default") &&
7587
7740
  isNotEmptyValue(form.default)) {
7588
- const triggers = form.default.triggers;
7589
- const rules = form.default.rules;
7590
- const actions = form.default.actions;
7741
+ const { triggers, rules, actions } = form.default;
7591
7742
  const rulesMapping = new Rule(rules, {
7592
7743
  USER_CONFIG: this.userConfig,
7593
7744
  FORMS_LIST: this.formsList,
7594
7745
  ALL_FORMS_DATA: this.allFormsData,
7595
7746
  EXTRA_DATA: this.extraData
7596
7747
  }).mapping();
7597
- for (let action of actions) {
7748
+ for (const action of actions) {
7598
7749
  const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
7599
7750
  if (conditionEvaluation) {
7600
7751
  const actions = new Action(action, rulesMapping, {
@@ -7606,10 +7757,8 @@ class KwikIDFormsRendererComponent {
7606
7757
  }
7607
7758
  }
7608
7759
  }
7609
- else {
7610
- if (!checkObjectKeyExists(form, "hidden")) {
7611
- form.hidden = false;
7612
- }
7760
+ else if (!checkObjectKeyExists(form, "hidden")) {
7761
+ form.hidden = false;
7613
7762
  }
7614
7763
  }
7615
7764
  this.formsList = this.assignSequenceNoToForm(this.formsList);
@@ -7676,7 +7825,7 @@ class KwikIDFormsRendererComponent {
7676
7825
  case ERendererActionKey.FORM_SHOW:
7677
7826
  this.formShow(action.props.formKey);
7678
7827
  break;
7679
- case EActionKey.SET_VALUE:
7828
+ case EActionKey.SET_VALUE: {
7680
7829
  const sources = new Source({
7681
7830
  USER_CONFIG: this.userConfig,
7682
7831
  ALL_FORMS_DATA: this.formsData,
@@ -7688,29 +7837,22 @@ class KwikIDFormsRendererComponent {
7688
7837
  this.formsData = sources.object.ALL_FORMS_DATA;
7689
7838
  this.extraData = sources.object.EXTRA_DATA;
7690
7839
  break;
7840
+ }
7691
7841
  default:
7692
7842
  break;
7693
7843
  }
7694
7844
  });
7695
7845
  }
7696
7846
  findFormsListLength(formsList) {
7697
- const _formsList = formsList.filter((form) => {
7847
+ const updatedFormsList = formsList.filter((form) => {
7698
7848
  if (checkObjectKeyExists(form, "type")) {
7699
- if (form.type !== EFormType.HTML) {
7700
- if (checkObjectKeyExists(form, "hidden")) {
7701
- if (!form.hidden) {
7702
- return form;
7703
- }
7704
- }
7705
- }
7706
- }
7707
- else if (checkObjectKeyExists(form, "hidden")) {
7708
- if (!form.hidden) {
7709
- return form;
7710
- }
7849
+ return (form.type !== EFormType.HTML &&
7850
+ checkObjectKeyExists(form, "hidden") &&
7851
+ !form.hidden);
7711
7852
  }
7853
+ return checkObjectKeyExists(form, "hidden") && !form.hidden;
7712
7854
  });
7713
- return _formsList.length;
7855
+ return updatedFormsList.length;
7714
7856
  }
7715
7857
  /**
7716
7858
  * Library Event Listeners
@@ -7726,12 +7868,10 @@ class KwikIDFormsRendererComponent {
7726
7868
  this.toggleLoader(true);
7727
7869
  this.isUnsavedData = false;
7728
7870
  let activeFormConfig = this.formsList.find((form) => {
7729
- if (form.key === selectedForm) {
7730
- return form;
7731
- }
7871
+ return form.key === selectedForm;
7732
7872
  });
7733
7873
  activeFormConfig = new Converter().updateFormConfigProperties(activeFormConfig);
7734
- let formConfig = undefined;
7874
+ let formConfig;
7735
7875
  if (checkObjectKeyExists(activeFormConfig, "props")) {
7736
7876
  if (checkObjectKeyExists(activeFormConfig.props, "url")) {
7737
7877
  const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.props.url);
@@ -7744,34 +7884,8 @@ class KwikIDFormsRendererComponent {
7744
7884
  const formConfigFromPath = yield this.fetchFormConfig(url);
7745
7885
  formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
7746
7886
  }
7747
- else {
7748
- if (checkObjectKeyExists(activeFormConfig, "type") &&
7749
- activeFormConfig.type === EFormType.FORM) {
7750
- if (checkObjectKeyExists(activeFormConfig, "fields")) {
7751
- formConfig = activeFormConfig;
7752
- }
7753
- else {
7754
- console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
7755
- }
7756
- }
7757
- else {
7758
- console.error(`No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!`);
7759
- }
7760
- }
7761
- }
7762
- else {
7763
- if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
7764
- const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.formContent.url);
7765
- formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
7766
- }
7767
- else if (checkObjectKeyExists(activeFormConfig.formContent, "path") &&
7768
- checkObjectKeyExists(this.userConfig, "backend") &&
7769
- checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
7770
- const url = `${(_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
7771
- const formConfigFromPath = yield this.fetchFormConfig(url);
7772
- formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
7773
- }
7774
- else {
7887
+ else if (checkObjectKeyExists(activeFormConfig, "type") &&
7888
+ activeFormConfig.type === EFormType.FORM) {
7775
7889
  if (checkObjectKeyExists(activeFormConfig, "fields")) {
7776
7890
  formConfig = activeFormConfig;
7777
7891
  }
@@ -7779,6 +7893,26 @@ class KwikIDFormsRendererComponent {
7779
7893
  console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
7780
7894
  }
7781
7895
  }
7896
+ else {
7897
+ console.error(`No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!`);
7898
+ }
7899
+ }
7900
+ else if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
7901
+ const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.formContent.url);
7902
+ formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
7903
+ }
7904
+ else if (checkObjectKeyExists(activeFormConfig.formContent, "path") &&
7905
+ checkObjectKeyExists(this.userConfig, "backend") &&
7906
+ checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
7907
+ const url = `${(_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
7908
+ const formConfigFromPath = yield this.fetchFormConfig(url);
7909
+ formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
7910
+ }
7911
+ else if (checkObjectKeyExists(activeFormConfig, "fields")) {
7912
+ formConfig = activeFormConfig;
7913
+ }
7914
+ else {
7915
+ console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
7782
7916
  }
7783
7917
  formConfig = new Converter().updateFormConfigFromUserConfig(formConfig, this.userConfig);
7784
7918
  formConfig = new Converter().updateFormConfigMiscellaneous(formConfig, {
@@ -7847,8 +7981,8 @@ class KwikIDFormsRendererComponent {
7847
7981
  .subscribe({
7848
7982
  next: (data) => {
7849
7983
  this.popupFormCallback = {
7850
- popupFormData: data["data"],
7851
- popupFormConfig: data["formConfig"],
7984
+ popupFormData: data.data,
7985
+ popupFormConfig: data.formConfig,
7852
7986
  activeFormConfig: this.activeFormConfig
7853
7987
  };
7854
7988
  this.activePopupFormData = {};
@@ -7877,8 +8011,8 @@ class KwikIDFormsRendererComponent {
7877
8011
  .subscribe({
7878
8012
  next: (data) => {
7879
8013
  this.popupFormCallback = {
7880
- popupFormData: data["data"],
7881
- popupFormConfig: data["formConfig"],
8014
+ popupFormData: data.data,
8015
+ popupFormConfig: data.formConfig,
7882
8016
  activeFormConfig: this.activeFormConfig
7883
8017
  };
7884
8018
  this.activePopupFormData = {};
@@ -7917,9 +8051,9 @@ class KwikIDFormsRendererComponent {
7917
8051
  this.toggleLoader(true);
7918
8052
  this.getFormData.emit({
7919
8053
  [this.activeFormConfig.key]: {
7920
- formConfig: e["formConfig"],
7921
- data: e["data"],
7922
- extendedData: e["extendedData"]
8054
+ formConfig: e.formConfig,
8055
+ data: e.data,
8056
+ extendedData: e.extendedData
7923
8057
  }
7924
8058
  });
7925
8059
  break;
@@ -7961,34 +8095,26 @@ class KwikIDFormsRendererComponent {
7961
8095
  this.showFormSections = true;
7962
8096
  this.showForm = false;
7963
8097
  this.showFormFields = false;
7964
- return;
8098
+ }
8099
+ else if (this.checkIfFormsStatusCompleted(this.formsList, this.formsListCompleted)) {
8100
+ this.showFormSections = true;
8101
+ this.showForm = false;
8102
+ this.showFormFields = false;
7965
8103
  }
7966
8104
  else {
7967
- if (this.checkIfFormsStatusCompleted(this.formsList, this.formsListCompleted)) {
7968
- this.showFormSections = true;
7969
- this.showForm = false;
7970
- this.showFormFields = false;
7971
- return;
7972
- }
7973
- else {
7974
- const previousFormConfigDirect = this.formsList.find((form) => {
7975
- if (form.sequenceNo === this.activeFormConfig.sequenceNo - 1 &&
7976
- form.status !== EFormsListStatus.LOCKED) {
7977
- return form;
7978
- }
7979
- });
7980
- if (previousFormConfigDirect) {
7981
- this.handleOnClickSetActiveForm(previousFormConfigDirect.key, undefined);
7982
- }
8105
+ const previousFormConfigDirect = this.formsList.find((form) => {
8106
+ return (form.sequenceNo === this.activeFormConfig.sequenceNo - 1 &&
8107
+ form.status !== EFormsListStatus.LOCKED);
8108
+ });
8109
+ if (previousFormConfigDirect) {
8110
+ this.handleOnClickSetActiveForm(previousFormConfigDirect.key, undefined);
7983
8111
  }
7984
8112
  }
7985
8113
  break;
7986
- case EFormViewGoBackMode.TABBED:
8114
+ case EFormViewGoBackMode.TABBED: {
7987
8115
  const previousFormConfig = this.formsList.find((form) => {
7988
- if (form.sequenceNo < this.activeFormConfig.sequenceNo &&
7989
- form.status === EFormsListStatus.EDITABLE) {
7990
- return form;
7991
- }
8116
+ return (form.sequenceNo < this.activeFormConfig.sequenceNo &&
8117
+ form.status === EFormsListStatus.EDITABLE);
7992
8118
  });
7993
8119
  if (previousFormConfig) {
7994
8120
  this.handleOnClickSetActiveForm(previousFormConfig.key, undefined);
@@ -7999,6 +8125,7 @@ class KwikIDFormsRendererComponent {
7999
8125
  this.showFormFields = false;
8000
8126
  }
8001
8127
  break;
8128
+ }
8002
8129
  default:
8003
8130
  break;
8004
8131
  }
@@ -8012,7 +8139,7 @@ class KwikIDFormsRendererComponent {
8012
8139
  return __awaiter(this, void 0, void 0, function* () {
8013
8140
  const formsList = JSON.parse(JSON.stringify(this.formsList));
8014
8141
  let firstFormWithError = "";
8015
- for (let form of formsList) {
8142
+ for (const form of formsList) {
8016
8143
  if (!form.hidden &&
8017
8144
  form.type !== EFormType.HTML &&
8018
8145
  form.required &&
@@ -8328,7 +8455,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
8328
8455
  class KwikIDFormViewModule {
8329
8456
  }
8330
8457
  /** @nocollapse */ KwikIDFormViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8331
- /** @nocollapse */ KwikIDFormViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent, StyleSanitizerPipe, TimerPipe], imports: [CommonModule,
8458
+ /** @nocollapse */ KwikIDFormViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent,
8459
+ StyleSanitizerPipe,
8460
+ TimerPipe,
8461
+ FilterImageUrlOrBase64FromObjectPipe,
8462
+ FilterVideoUrlOrBase64FromObjectPipe], imports: [CommonModule,
8332
8463
  FormsModule,
8333
8464
  ReactiveFormsModule,
8334
8465
  TuiLabelModule,
@@ -8363,7 +8494,13 @@ class KwikIDFormViewModule {
8363
8494
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, decorators: [{
8364
8495
  type: NgModule,
8365
8496
  args: [{
8366
- declarations: [KwikIDFormViewComponent, StyleSanitizerPipe, TimerPipe],
8497
+ declarations: [
8498
+ KwikIDFormViewComponent,
8499
+ StyleSanitizerPipe,
8500
+ TimerPipe,
8501
+ FilterImageUrlOrBase64FromObjectPipe,
8502
+ FilterVideoUrlOrBase64FromObjectPipe
8503
+ ],
8367
8504
  imports: [
8368
8505
  CommonModule,
8369
8506
  FormsModule,