{"version":3,"file":"ajf-core-forms.mjs","sources":["../../../projects/core/forms/src/as-validation-errors-string.ts","../../../projects/core/forms/src/as-field-instance.ts","../../../projects/core/forms/src/as-repeating-slide-instance.ts","../../../projects/core/forms/src/interface/fields/field-type.ts","../../../projects/core/forms/src/interface/nodes/node-type.ts","../../../projects/core/forms/src/utils/choices/init-choices-origin.ts","../../../projects/core/forms/src/utils/fields/fields-map.ts","../../../projects/core/forms/src/utils/fields/is-custom-field-with-choices.ts","../../../projects/core/forms/src/utils/fields/is-field-with-choices.ts","../../../projects/core/forms/src/utils/nodes/is-field.ts","../../../projects/core/forms/src/utils/nodes-instances/is-field-instance.ts","../../../projects/core/forms/src/utils/fields-instances/is-field-with-choices-instance.ts","../../../projects/core/forms/src/utils/fields/is-table-field.ts","../../../projects/core/forms/src/utils/fields-instances/is-table-field-instance.ts","../../../projects/core/forms/src/utils/nodes-instances/update-conditional-branches.ts","../../../projects/core/forms/src/utils/nodes-instances/update-editability.ts","../../../projects/core/forms/src/utils/nodes-instances/update-visibility.ts","../../../projects/core/forms/src/utils/fields-instances/update-formula.ts","../../../projects/core/forms/src/utils/fields-instances/update-next-slide-condition.ts","../../../projects/core/forms/src/utils/nodes-instances/node-instance-suffix.ts","../../../projects/core/forms/src/utils/nodes-instances/node-instance-complete-name.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation-conditions.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation-max-digits.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation-max-value.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation-min-digits.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation-min-value.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation-not-empty.ts","../../../projects/core/forms/src/utils/validation/evaluate-validation-group.ts","../../../projects/core/forms/src/utils/fields-instances/update-validation.ts","../../../projects/core/forms/src/utils/warning/evaluate-warning.ts","../../../projects/core/forms/src/utils/warning/evaluate-warning-conditions.ts","../../../projects/core/forms/src/utils/warning/evaluate-warning-group.ts","../../../projects/core/forms/src/utils/fields-instances/update-warning.ts","../../../projects/core/forms/src/utils/fields-instances/update-field-instance-state.ts","../../../projects/core/forms/src/utils/fields-instances/update-filtered-choices.ts","../../../projects/core/forms/src/utils/fields-instances/update-trigger-conditions.ts","../../../projects/core/forms/src/utils/nodes/create-node.ts","../../../projects/core/forms/src/utils/fields/create-field.ts","../../../projects/core/forms/src/utils/nodes/is-slides-node.ts","../../../projects/core/forms/src/utils/nodes/is-container-node.ts","../../../projects/core/forms/src/utils/nodes-instances/is-container-node-instance.ts","../../../projects/core/forms/src/utils/nodes-instances/flatten-nodes-instances.ts","../../../projects/core/forms/src/utils/nodes-instances/is-slides-instance.ts","../../../projects/core/forms/src/utils/nodes-instances/flatten-nodes-instances-tree.ts","../../../projects/core/forms/src/utils/nodes/is-node-group.ts","../../../projects/core/forms/src/utils/nodes-instances/is-node-group-instance.ts","../../../projects/core/forms/src/utils/nodes/is-repeating-container-node.ts","../../../projects/core/forms/src/utils/nodes-instances/is-repeating-container-node-instance.ts","../../../projects/core/forms/src/utils/nodes-instances/is-repeating-group-instance.ts","../../../projects/core/forms/src/utils/nodes/is-repeating-slide.ts","../../../projects/core/forms/src/utils/nodes-instances/is-repeating-slide-instance.ts","../../../projects/core/forms/src/utils/nodes/is-slide-node.ts","../../../projects/core/forms/src/utils/nodes-instances/is-slide-instance.ts","../../../projects/core/forms/src/utils/nodes-instances/create-node-instance.ts","../../../projects/core/forms/src/utils/fields-instances/create-field-instance.ts","../../../projects/core/forms/src/utils/fields-instances/create-field-with-choices-instance.ts","../../../projects/core/forms/src/utils/fields-instances/create-table-field-instance.ts","../../../projects/core/forms/src/utils/nodes-instances/create-node-group-instance.ts","../../../projects/core/forms/src/utils/slides-instances/create-slide-instance.ts","../../../projects/core/forms/src/utils/slides-instances/create-repeating-slide-instance.ts","../../../projects/core/forms/src/utils/validation/create-validation-group.ts","../../../projects/core/forms/src/utils/warning/create-warning-group.ts","../../../projects/core/forms/src/utils/nodes-instances/get-ancestor-repeating-nodes.ts","../../../projects/core/forms/src/utils/nodes-instances/get-ancestor-repeating-nodes-names.ts","../../../projects/core/forms/src/utils/nodes-instances/get-container-node.ts","../../../projects/core/forms/src/utils/nodes-instances/get-instance-condition.ts","../../../projects/core/forms/src/utils/nodes-instances/get-instance-conditions.ts","../../../projects/core/forms/src/utils/nodes-instances/get-instance-formula.ts","../../../projects/core/forms/src/utils/validation/create-validation.ts","../../../projects/core/forms/src/utils/nodes-instances/get-instance-validation.ts","../../../projects/core/forms/src/utils/nodes-instances/get-instance-validations.ts","../../../projects/core/forms/src/utils/warning/create-warning.ts","../../../projects/core/forms/src/utils/nodes-instances/get-instance-warning.ts","../../../projects/core/forms/src/utils/nodes-instances/get-instance-warnings.ts","../../../projects/core/forms/src/utils/nodes-instances/node-to-node-instance.ts","../../../projects/core/forms/src/utils/nodes/flatten-nodes.ts","../../../projects/core/forms/src/utils/nodes/ordered-nodes.ts","../../../projects/core/forms/src/utils/slides-instances/update-reps-num.ts","../../../projects/core/forms/src/utils/slides-instances/valid-slide.ts","../../../projects/core/forms/src/validation-service.ts","../../../projects/core/forms/src/form-renderer.ts","../../../projects/core/forms/src/base-field.ts","../../../projects/core/forms/src/audio-field.ts","../../../projects/core/forms/src/bool-to-int.ts","../../../projects/core/forms/src/date-value.ts","../../../projects/core/forms/src/date-value-string.ts","../../../projects/core/forms/src/errors.ts","../../../projects/core/forms/src/expand-input-with-choices.ts","../../../projects/core/forms/src/field-host.ts","../../../projects/core/forms/src/field.ts","../../../projects/core/forms/src/field-utils.ts","../../../projects/core/forms/src/field-icon.ts","../../../projects/core/forms/src/field-is-valid.ts","../../../projects/core/forms/src/field-service.ts","../../../projects/core/forms/src/field-warning-alert-result.ts","../../../projects/core/forms/src/field-with-choices.ts","../../../projects/core/forms/src/warning-alert-service.ts","../../../projects/core/forms/src/file-field.ts","../../../projects/core/forms/src/file-field.html","../../../projects/core/forms/src/form.ts","../../../projects/core/forms/src/utils/fields/is-multiple-choice-field.ts","../../../projects/core/forms/src/utils/fields/is-single-choice-field.ts","../../../projects/core/forms/src/utils/forms/build-form-string-identifier.ts","../../../projects/core/forms/src/form-string-identifier.ts","../../../projects/core/forms/src/get-table-cell-control.ts","../../../projects/core/forms/src/image-field.ts","../../../projects/core/forms/src/image-field.html","../../../projects/core/forms/src/increment.ts","../../../projects/core/forms/src/is-cell-editable.ts","../../../projects/core/forms/src/is-readonly-input-field.ts","../../../projects/core/forms/src/is-repeating-slide.ts","../../../projects/core/forms/src/node-complete-name.ts","../../../projects/core/forms/src/range.ts","../../../projects/core/forms/src/input-field.ts","../../../projects/core/forms/src/read-only-field.ts","../../../projects/core/forms/src/read-only-field.html","../../../projects/core/forms/src/read-only-date-field.ts","../../../projects/core/forms/src/read-only-date-field.html","../../../projects/core/forms/src/read-only-file-field.ts","../../../projects/core/forms/src/read-only-file-field.html","../../../projects/core/forms/src/read-only-geolocation-field.ts","../../../projects/core/forms/src/read-only-geolocation-field.html","../../../projects/core/forms/src/read-only-image-field.ts","../../../projects/core/forms/src/read-only-image-field.html","../../../projects/core/forms/src/read-only-select-field.ts","../../../projects/core/forms/src/read-only-select-field.html","../../../projects/core/forms/src/table-row-class.ts","../../../projects/core/forms/src/read-only-table-field.ts","../../../projects/core/forms/src/read-only-table-field.html","../../../projects/core/forms/src/video-url-field.ts","../../../projects/core/forms/src/read-only-video-url-field.ts","../../../projects/core/forms/src/read-only-video-url-field.html","../../../projects/core/forms/src/table-visible-columns.ts","../../../projects/core/forms/src/valid-slide.ts","../../../projects/core/forms/src/forms-module.ts","../../../projects/core/forms/src/search-alert-threshold.ts","../../../projects/core/forms/src/utils/attachments/create-attachments-origin.ts","../../../projects/core/forms/src/serializers/attachments-origin-serializer.ts","../../../projects/core/forms/src/utils/choices/create-choices-origin.ts","../../../projects/core/forms/src/serializers/choices-origin-serializer.ts","../../../projects/core/forms/src/utils/fields/create-field-with-choices.ts","../../../projects/core/forms/src/utils/nodes/create-container-node.ts","../../../projects/core/forms/src/utils/nodes/create-repeating-node.ts","../../../projects/core/forms/src/utils/nodes/create-node-group.ts","../../../projects/core/forms/src/utils/slides/create-repeating-slide.ts","../../../projects/core/forms/src/utils/slides/create-slide.ts","../../../projects/core/forms/src/serializers/validation-group-serializer.ts","../../../projects/core/forms/src/serializers/warning-group-serializer.ts","../../../projects/core/forms/src/serializers/node-serializer.ts","../../../projects/core/forms/src/serializers/form-serializer.ts","../../../projects/core/forms/src/table-field.ts","../../../projects/core/forms/src/random-ajf-context-generator.ts","../../../projects/core/forms/src/form-to-pdf/utils.ts","../../../projects/core/forms/src/form-to-pdf/form-to-pdf.ts","../../../projects/core/forms/src/form-to-pdf/form-to-doc.ts","../../../projects/core/forms/src/interface/attachments/attachment.ts","../../../projects/core/forms/src/interface/attachments/attachments-fixed-origin.ts","../../../projects/core/forms/src/interface/attachments/attachments-origin.ts","../../../projects/core/forms/src/interface/attachments/attachments-type.ts","../../../projects/core/forms/src/interface/choices/base-choices-origin.ts","../../../projects/core/forms/src/interface/choices/choice.ts","../../../projects/core/forms/src/interface/choices/choices-fixed-origin.ts","../../../projects/core/forms/src/interface/choices/choices-function.ts","../../../projects/core/forms/src/interface/choices/choices-function-origin.ts","../../../projects/core/forms/src/interface/choices/choices-observable-array-origin.ts","../../../projects/core/forms/src/interface/choices/choices-observable-origin.ts","../../../projects/core/forms/src/interface/choices/choices-origin.ts","../../../projects/core/forms/src/interface/choices/choices-origin-type.ts","../../../projects/core/forms/src/interface/choices/choices-promise-origin.ts","../../../projects/core/forms/src/interface/choices/choices-type.ts","../../../projects/core/forms/src/interface/fields/base-field.ts","../../../projects/core/forms/src/interface/fields/boolean-field.ts","../../../projects/core/forms/src/interface/fields/date-range-field.ts","../../../projects/core/forms/src/interface/fields/date-input-field.ts","../../../projects/core/forms/src/interface/fields/empty-field.ts","../../../projects/core/forms/src/interface/fields/field.ts","../../../projects/core/forms/src/interface/fields/field-components-map.ts","../../../projects/core/forms/src/interface/fields/field-size.ts","../../../projects/core/forms/src/interface/fields/field-with-choices.ts","../../../projects/core/forms/src/interface/fields/file-field.ts","../../../projects/core/forms/src/interface/fields/formula-field.ts","../../../projects/core/forms/src/interface/fields/multiple-choice-field.ts","../../../projects/core/forms/src/interface/fields/number-field.ts","../../../projects/core/forms/src/interface/fields/range-field.ts","../../../projects/core/forms/src/interface/fields/single-choice-field.ts","../../../projects/core/forms/src/interface/fields/string-field.ts","../../../projects/core/forms/src/interface/fields/table-field.ts","../../../projects/core/forms/src/interface/fields/text-field.ts","../../../projects/core/forms/src/interface/fields/time-field.ts","../../../projects/core/forms/src/interface/fields-instances/date-field-instance.ts","../../../projects/core/forms/src/interface/fields-instances/date-input-field-instance.ts","../../../projects/core/forms/src/interface/fields-instances/empty-field-instance.ts","../../../projects/core/forms/src/interface/fields-instances/field-instance.ts","../../../projects/core/forms/src/interface/fields-instances/field-state.ts","../../../projects/core/forms/src/interface/fields-instances/field-with-choices-instance.ts","../../../projects/core/forms/src/interface/fields-instances/formula-field-instance.ts","../../../projects/core/forms/src/interface/fields-instances/range-field-instance.ts","../../../projects/core/forms/src/interface/fields-instances/table-field-instance.ts","../../../projects/core/forms/src/interface/forms/form.ts","../../../projects/core/forms/src/interface/forms/form-string-identifier.ts","../../../projects/core/forms/src/interface/nodes/base-node.ts","../../../projects/core/forms/src/interface/nodes/container-node.ts","../../../projects/core/forms/src/interface/nodes/node-group.ts","../../../projects/core/forms/src/interface/nodes/node-link.ts","../../../projects/core/forms/src/interface/nodes/repeating-container-node.ts","../../../projects/core/forms/src/interface/nodes/repeating-node.ts","../../../projects/core/forms/src/interface/nodes-instances/base-node-instance.ts","../../../projects/core/forms/src/interface/nodes-instances/base-repeating-container-node-instance.ts","../../../projects/core/forms/src/interface/nodes-instances/container-node-instance.ts","../../../projects/core/forms/src/interface/nodes-instances/node-group-instance.ts","../../../projects/core/forms/src/interface/nodes-instances/node-instance.ts","../../../projects/core/forms/src/interface/nodes-instances/repeating-container-node-instance.ts","../../../projects/core/forms/src/interface/nodes-instances/repeating-node-instance.ts","../../../projects/core/forms/src/interface/operations/nodes-instances-operation.ts","../../../projects/core/forms/src/interface/operations/nodes-operation.ts","../../../projects/core/forms/src/interface/operations/renderer-update-map-operation.ts","../../../projects/core/forms/src/interface/renderer-maps/update-map.ts","../../../projects/core/forms/src/interface/slides/repeating-slide.ts","../../../projects/core/forms/src/interface/slides/slide.ts","../../../projects/core/forms/src/interface/slides-instances/base-slide-instance.ts","../../../projects/core/forms/src/interface/slides-instances/repeating-slide-instance.ts","../../../projects/core/forms/src/interface/validation/validation.ts","../../../projects/core/forms/src/interface/validation/validation-group.ts","../../../projects/core/forms/src/interface/validation/validation-results.ts","../../../projects/core/forms/src/interface/warning/warning.ts","../../../projects/core/forms/src/interface/warning/warning-group.ts","../../../projects/core/forms/src/interface/warning/warning-result.ts","../../../projects/core/forms/src/utils/choices/create-choices-fixed-origin.ts","../../../projects/core/forms/src/utils/choices/create-choices-function-origin.ts","../../../projects/core/forms/src/utils/choices/create-choices-observable-array-origin.ts","../../../projects/core/forms/src/utils/choices/create-choices-observable-origin.ts","../../../projects/core/forms/src/utils/choices/create-choices-promise-origin.ts","../../../projects/core/forms/src/utils/choices/is-choices-origin.ts","../../../projects/core/forms/src/utils/choices/is-choices-fixed-origin.ts","../../../projects/core/forms/src/utils/fields/is-number-field.ts","../../../projects/core/forms/src/utils/fields/is-range-field.ts","../../../projects/core/forms/src/utils/fields/is-empty-field.ts","../../../projects/core/forms/src/utils/forms/create-form.ts","../../../projects/core/forms/src/utils/validation/max-digits-validation.ts","../../../projects/core/forms/src/utils/validation/max-validation.ts","../../../projects/core/forms/src/utils/validation/min-digits-validation.ts","../../../projects/core/forms/src/utils/validation/min-validation.ts","../../../projects/core/forms/src/utils/validation/not-empty-validation.ts","../../../projects/core/forms/src/utils/warning/not-empty-warning.ts","../../../projects/core/forms/src/public_api.ts","../../../projects/core/forms/src/ajf-core-forms.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfFieldInstance} from './interface/fields-instances/field-instance';\nimport {AjfNodeInstance} from './interface/nodes-instances/node-instance';\n\n/**\n * It casts an AjfNodeInstance as a string of all validation errors of an AjfFieldInstance.\n */\n@Pipe({name: 'ajfAsFieldInstanceErrors', pure: false})\nexport class AjfAsFieldInstanceErrorsPipe implements PipeTransform {\n  transform(instance: AjfNodeInstance): string | null {\n    const fieldInstance = instance as AjfFieldInstance;\n    if (fieldInstance.valid || !fieldInstance.validationResults) return null;\n    const errors = fieldInstance.validationResults.filter(res => !res.result);\n    return errors.map(vr => vr.error).join(', ');\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfFieldInstance} from './interface/fields-instances/field-instance';\nimport {AjfNodeInstance} from './interface/nodes-instances/node-instance';\n\n/**\n * It casts an AjfNodeInstance as AjfFieldInstance.\n */\n@Pipe({name: 'ajfAsFieldInstance'})\nexport class AjfAsFieldInstancePipe implements PipeTransform {\n  transform(instance: AjfNodeInstance): AjfFieldInstance {\n    return instance as AjfFieldInstance;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfRepeatingSlideInstance} from './interface/slides-instances/repeating-slide-instance';\nimport {AjfSlideInstance} from './interface/slides-instances/slide-instance';\n\n/**\n * It casts an AjfSlideInstance as AjfRepeatingSlideInstance.\n */\n@Pipe({name: 'ajfAsRepeatingSlideInstance'})\nexport class AjfAsRepeatingSlideInstancePipe implements PipeTransform {\n  transform(instance: AjfSlideInstance): AjfRepeatingSlideInstance {\n    return instance as unknown as AjfRepeatingSlideInstance;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/**\n * The available ajf field types.\n */\n// tslint:disable-next-line:prefer-const-enum\nexport enum AjfFieldType {\n  String,\n  Text,\n  Number,\n  Boolean,\n  SingleChoice,\n  MultipleChoice,\n  Formula,\n  Empty,\n  DateRange,\n  DateInput,\n  Time,\n  Table,\n  Geolocation,\n  Barcode,\n  File,\n  Image,\n  VideoUrl,\n  Range,\n  Signature,\n  Audio,\n  LENGTH,\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/**\n * An enum containing all the available NodeTypes\n */\n// tslint:disable-next-line:prefer-const-enum\nexport enum AjfNodeType {\n  AjfField,\n  AjfFieldNodeLink,\n  AjfNodeGroup,\n  AjfSlide,\n  AjfRepeatingSlide,\n  LENGTH,\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {firstValueFrom} from 'rxjs';\nimport {toArray} from 'rxjs/operators';\n\nimport {AjfChoicesOrigin} from '../../interface/choices/choices-origin';\n/**\n * Called by form-rederer\n * take as param an AjfChoicesOrigin&lt;any&gt; and return an Promise&lt;void&gt; for handling async\n * event\n */\nexport async function initChoicesOrigin(origin: AjfChoicesOrigin<any>): Promise<void> {\n  /** fixed don't use async evente the promise is resolved */\n  if (origin.type === 'fixed') {\n    return;\n  }\n  /** apply function and than return resolve promise */\n  if (origin.type === 'function') {\n    origin.choices = origin.generator();\n    return;\n  }\n  /** modify origin.choices with result of resolved promise */\n  if (origin.type === 'promise') {\n    return origin.generator.then(choices => (origin.choices = choices)).then();\n  }\n  /** modify origin.choices with result of subscribed observable */\n  if (origin.type === 'observable') {\n    if (origin.generator != null) {\n      origin.choices = [];\n      return firstValueFrom(origin.generator.pipe(toArray()))\n        .then(choices => (origin.choices = choices))\n        .then();\n    }\n  }\n  /** modify origin.choices with result of subscribed observable */\n  if (origin.type === 'observableArray') {\n    if (origin.generator != null) {\n      origin.choices = [];\n      return firstValueFrom(origin.generator)\n        .then(choices => (origin.choices = choices))\n        .then();\n    }\n  }\n  return;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldComponentsMap} from '../../interface/fields/field-components-map';\n/**\n * The componentsMap is a dictionary key value\n * Represents the association between an AjfFieldType and the\n * components used to render it.\n */\nexport const componentsMap: AjfFieldComponentsMap = {};\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {componentsMap} from './fields-map';\n/**\n * It is true if\n *  the field is a custom field (field.fieldType &gt; 100) and\n *  the field is not already present in the component map (componentsMap[field.fieldType] != null)\n * and the field is a fieldWithChoice (componentsMap[field.fieldType].isFieldWithChoice === true)\n */\nexport function isCustomFieldWithChoices(field: AjfField): boolean {\n  return (\n    field.fieldType > 100 &&\n    componentsMap[field.fieldType] != null &&\n    componentsMap[field.fieldType].isFieldWithChoice === true\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfFieldWithChoices} from '../../interface/fields/field-with-choices';\nimport {AjfFieldType} from '../../interface/fields/field-type';\n\n/**\n * It is true if the field type is a SingleChoice or MultipleChoice.\n */\nexport function isFieldWithChoices<T = any>(field: AjfField): field is AjfFieldWithChoices<T> {\n  return (\n    field.fieldType === AjfFieldType.SingleChoice || field.fieldType === AjfFieldType.MultipleChoice\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\n/**\n * It is true if node is an AjfField.\n */\nexport function isField(node: AjfNode): node is AjfField {\n  return node != null && node.nodeType === AjfNodeType.AjfField;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {isField} from '../nodes/is-field';\n\n/**\n * It is true if the nodeInstance is relative to a AjfField.\n */\nexport function isFieldInstance(nodeInstance: AjfNodeInstance): nodeInstance is AjfFieldInstance {\n  return nodeInstance != null && nodeInstance.node != null && isField(nodeInstance.node);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldWithChoicesInstance} from '../../interface/fields-instances/field-with-choices-instance';\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {isCustomFieldWithChoices} from '../fields/is-custom-field-with-choices';\nimport {isFieldWithChoices} from '../fields/is-field-with-choices';\nimport {isFieldInstance} from '../nodes-instances/is-field-instance';\n\n/**\n * It is true if the nodeInstance is a fieldInstance and\n * if the node of instance is a field with choices.\n */\nexport function isFieldWithChoicesInstance(\n  instance: AjfNodeInstance,\n): instance is AjfFieldWithChoicesInstance<any> {\n  return (\n    instance != null &&\n    isFieldInstance(instance) &&\n    (isCustomFieldWithChoices(instance.node) || isFieldWithChoices(instance.node))\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfTableField} from '../../interface/fields/table-field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\n\n/**\n * It is true if the field type is Table.\n */\nexport function isTableField(field: AjfField): field is AjfTableField {\n  return field.fieldType === AjfFieldType.Table;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfTableFieldInstance} from '../../interface/fields-instances/table-field-instance';\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {isTableField} from '../fields/is-table-field';\nimport {isFieldInstance} from '../nodes-instances/is-field-instance';\n\n/**\n * It is true if the instance is a fieldInstance and\n * if the node of instance is a Table field.\n */\nexport function isTableFieldInstance(instance: AjfNodeInstance): instance is AjfTableFieldInstance {\n  return instance != null && isFieldInstance(instance) && isTableField(instance.node);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\n\n/**\n * It updates instance.verifiedBranch with the idx of the last branch verified.\n * If instance.verifiedBranch value changes return true\n */\nexport function updateConditionalBranches(instance: AjfNodeInstance, context: AjfContext): boolean {\n  const conditionalBranches = instance.conditionalBranches;\n\n  if (conditionalBranches != null) {\n    const oldBranch = instance.verifiedBranch;\n    let idx = 0;\n    let found = false;\n    while (idx < conditionalBranches.length && !found) {\n      let verified: boolean = evaluateExpression(conditionalBranches[idx].condition, context);\n      if (verified) {\n        found = true;\n        if (idx !== instance.verifiedBranch) {\n          instance.verifiedBranch = idx;\n        }\n      }\n      idx++;\n    }\n\n    if (oldBranch !== instance.verifiedBranch) {\n      return true;\n    }\n  }\n\n  return false;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, AjfContext, evaluateExpression} from '@ajf/core/models';\nimport {AjfSlideInstance} from '../../interface/slides-instances/slide-instance';\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\n\n/**\n *\n * @param instance AjfNodeInstance: Slide instance or Field instance\n * @param context\n * @returns If instance.editable changes return true.\n */\nexport function updateEditability(\n  instance: AjfSlideInstance | AjfFieldInstance,\n  context: AjfContext,\n): boolean {\n  if (instance.editable == null) {\n    instance.editable = true;\n    return true;\n  }\n  if (instance.readonly != null) {\n    const readOnly: AjfCondition = instance.readonly;\n    const oldEditability: boolean = instance.editable;\n    let newEditability: boolean = !evaluateExpression(readOnly.condition, context);\n    if (newEditability !== instance.editable) {\n      instance.editable = newEditability;\n    }\n    return oldEditability !== newEditability;\n  }\n  return false;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\n\n/**\n * It updates instance.visible with the result of evaluating instance.visibility.condition.\n * If instance.visibility is null instance.visible is false and it returns false.\n * If instance.visible changes return true.\n */\nexport function updateVisibility(\n  instance: AjfNodeInstance,\n  context: AjfContext,\n  branchVisibility = true,\n): boolean {\n  if (instance.visibility == null) {\n    instance.visible = false;\n    return false;\n  }\n  const visibility: AjfCondition = instance.visibility;\n\n  const oldVisibility: boolean = instance.visible;\n  let newVisibility: boolean =\n    branchVisibility && evaluateExpression(visibility.condition, context);\n  if (newVisibility !== instance.visible) {\n    instance.visible = newVisibility;\n  }\n\n  return oldVisibility !== newVisibility;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\n\n/**\n * Update the relative instance value and the context, only if it's visible.\n * if it's a formula field evaluate expression.\n * Flag changed to true if value is changed\n * @param instance\n * @param context\n * @param updateDefault if true, if it has a default value and current value is null,\n * initialize field with the evaluated default value. It doesn't currently know the visibility\n * of the container node, so it only re-set the default value when the node becomes\n * visible again with updateVisibilityMapEntry.\n * @returns The updated instance value and the changed flag\n */\nexport function updateFormula(\n  instance: AjfFieldInstance,\n  context: AjfContext,\n  updateDefault?: boolean,\n): {changed: boolean; value: any} {\n  const formula = instance.formula;\n  const editable = instance.node.editable;\n  let newValue: any = null;\n  let changed = false;\n  if (instance.visible) {\n    if (formula != null && (!editable || (editable && instance.value == null))) {\n      newValue = evaluateExpression(formula.formula, context);\n      if (Number.isNaN(newValue)) {\n        newValue = null;\n      }\n      changed = true;\n    } else if (updateDefault && instance.node.defaultValue != null && instance.value == null) {\n      changed = true;\n      if (instance.node.defaultValue.formula != null) {\n        newValue = evaluateExpression(instance.node.defaultValue.formula, context);\n        if (Number.isNaN(newValue)) {\n          newValue = null;\n        }\n      } else {\n        newValue = instance.node.defaultValue;\n      }\n    }\n    if (changed && newValue !== instance.value) {\n      instance.value = newValue;\n      context['$value'] = instance.value;\n      return {changed: true, value: newValue};\n    }\n  }\n  return {changed: false, value: instance.value};\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\n\n/**\n * If nextSlideCondition of instance is defined return the evaluateExpression of nextSlideCondition\n * else return false.\n */\nexport function updateNextSlideCondition(instance: AjfFieldInstance, context: AjfContext): boolean {\n  if (instance.nextSlideCondition != null) {\n    return evaluateExpression(instance.nextSlideCondition.condition, context);\n  }\n  return false;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseNodeInstance} from '../../interface/nodes-instances/base-node-instance';\n\n// TODO: add details\n/**\n * It creates the node instance suffix.\n */\nexport function nodeInstanceSuffix(instance: AjfBaseNodeInstance): string {\n  if (instance.prefix == null || instance.prefix.length == 0) {\n    return '';\n  }\n  return `__${instance.prefix.join('__')}`;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseNodeInstance} from '../../interface/nodes-instances/base-node-instance';\nimport {nodeInstanceSuffix} from './node-instance-suffix';\n\n// TODO: add details\n/**\n * It creates the complete name of the instance.\n */\nexport function nodeInstanceCompleteName(instance: AjfBaseNodeInstance): string {\n  return instance != null && instance.node != null\n    ? `${instance.node.name}${nodeInstanceSuffix(instance)}`\n    : '';\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\n\n/**\n * It evaluates validation and returns an AjfValidationResult.\n */\nexport function evaluateValidation(\n  validation: AjfValidation,\n  context?: AjfContext,\n): AjfValidationResult {\n  return {\n    result: evaluateExpression(validation.condition, context),\n    error: validation.errorMessage,\n    clientValidation: validation.clientValidation,\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\n\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\nimport {evaluateValidation} from './evaluate-validation';\n\n/**\n * It applies evaluateValidation to every validation condition and return it.\n */\nexport function evaluateValidationConditions(\n  validation: AjfValidationGroup,\n  context?: AjfContext,\n): AjfValidationResult[] {\n  let res: AjfValidationResult[] = [];\n  (validation.conditions || []).forEach(cond => {\n    res.push(evaluateValidation(cond, context));\n  });\n  return res;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\nimport {evaluateValidation} from './evaluate-validation';\n\n/**\n * Basic validation function that cheecks the maximum digit's length.\n * maxDigits is the associated AjfCondition\n */\nexport function evaluateValidationMaxDigits(\n  validation: AjfValidationGroup,\n  value: any,\n): AjfValidationResult | null {\n  if (validation.maxDigits == null) {\n    return null;\n  }\n  if (typeof validation.maxDigits === 'number') {\n    return {\n      result: String(value).length <= validation.maxDigits,\n      error: `Digits count must be <= ${validation.maxDigits}`,\n      clientValidation: false,\n    };\n  }\n  return evaluateValidation(validation.maxDigits, {'$value': value});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\nimport {evaluateValidation} from './evaluate-validation';\n\n/**\n * Basic validation function that cheecks the maximum value of the digit\n * maxValue is the associated AjfCondition\n */\nexport function evaluateValidationMaxValue(\n  validation: AjfValidationGroup,\n  value: any,\n): AjfValidationResult | null {\n  if (validation.maxValue == null) {\n    return null;\n  }\n  if (typeof validation.maxValue === 'number') {\n    return {\n      result: value <= validation.maxValue,\n      error: `Value must be <= ${validation.maxValue}`,\n      clientValidation: false,\n    };\n  }\n  return evaluateValidation(validation.maxValue, {'$value': value});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\nimport {evaluateValidation} from './evaluate-validation';\n\n/**\n * Basic validation function that cheecks the minimum digit's length.\n * minDigits is the associated AjfCondition\n */\nexport function evaluateValidationMinDigits(\n  validation: AjfValidationGroup,\n  value: any,\n): AjfValidationResult | null {\n  if (validation.minDigits == null) {\n    return null;\n  }\n  if (typeof validation.minDigits === 'number') {\n    return {\n      result: String(value).length >= validation.minDigits,\n      error: `Digits count must be >= ${validation.minDigits}`,\n      clientValidation: false,\n    };\n  }\n  return evaluateValidation(validation.minDigits, {'$value': value});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\nimport {evaluateValidation} from './evaluate-validation';\n\n/**\n * Basic validation function that cheecks the minimum value of the digit\n * minValue is the associated AjfCondition\n */\nexport function evaluateValidationMinValue(\n  validation: AjfValidationGroup,\n  value: any,\n): AjfValidationResult | null {\n  if (validation.minValue == null) {\n    return null;\n  }\n  if (typeof validation.minValue === 'number') {\n    return {\n      result: value >= validation.minValue,\n      error: `Value must be >= ${validation.minValue}`,\n      clientValidation: false,\n    };\n  }\n  return evaluateValidation(validation.minValue, {'$value': value});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {notEmpty} from '@ajf/core/models';\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\nimport {evaluateValidation} from './evaluate-validation';\n\n/**\n * Basic validation function that cheecks the value is not null\n * notEmpty is the associated AjfCondition\n */\nexport function evaluateValidationNotEmpty(\n  validation: AjfValidationGroup,\n  value: any,\n): AjfValidationResult | null {\n  const ne = validation.notEmpty as AjfValidation | boolean | undefined;\n  if (ne == null || ne === false) {\n    return null;\n  }\n  if (ne === true) {\n    return {\n      result: notEmpty(value),\n      error: validation.notEmptyMessage || 'Value must not be empty',\n      clientValidation: false,\n    };\n  }\n  return evaluateValidation(ne, {'$value': value});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\nimport {deepCopy} from '@ajf/core/utils';\n\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\n\nimport {evaluateValidationConditions} from './evaluate-validation-conditions';\nimport {evaluateValidationMaxDigits} from './evaluate-validation-max-digits';\nimport {evaluateValidationMaxValue} from './evaluate-validation-max-value';\nimport {evaluateValidationMinDigits} from './evaluate-validation-min-digits';\nimport {evaluateValidationMinValue} from './evaluate-validation-min-value';\nimport {evaluateValidationNotEmpty} from './evaluate-validation-not-empty';\n\n/**\n * It evaluate AjfValidationGroup and returns an AjfValidationResult[].\n */\nexport function evaluateValidationGroup(\n  validation: AjfValidationGroup,\n  value: any,\n  context?: AjfContext,\n): AjfValidationResult[] {\n  let res: AjfValidationResult[] = [];\n  let ctx = deepCopy(context ?? {});\n  ctx['$value'] = value;\n  res = evaluateValidationConditions(validation, ctx);\n  if (validation.maxValue) {\n    const maxValue = evaluateValidationMaxValue(validation, value);\n    if (maxValue != null) {\n      res.push(maxValue);\n    }\n  }\n  if (validation.minValue) {\n    const minValue = evaluateValidationMinValue(validation, value);\n    if (minValue != null) {\n      res.push(minValue);\n    }\n  }\n  if (validation.notEmpty) {\n    const notEmpty = evaluateValidationNotEmpty(validation, value);\n    if (notEmpty != null) {\n      res.push(notEmpty);\n    }\n  }\n  if (validation.maxDigits) {\n    const maxDigits = evaluateValidationMaxDigits(validation, value);\n    if (maxDigits != null) {\n      res.push(maxDigits);\n    }\n  }\n  if (validation.minDigits) {\n    const minDigits = evaluateValidationMinDigits(validation, value);\n    if (minDigits != null) {\n      res.push(minDigits);\n    }\n  }\n  return res;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\nimport {AjfValidationResult} from '../../interface/validation/validation-results';\nimport {nodeInstanceCompleteName} from '../nodes-instances/node-instance-complete-name';\nimport {evaluateValidationGroup} from '../validation/evaluate-validation-group';\n/**\n * it updates the instance.valid attribute.\n * If validation is not defined the instance.valid is true.\n * If valdiation.forceValue is true update context.\n * Updates instance.valid with the re-evaluation of validationResults in AND.\n */\nexport function updateValidation(\n  instance: AjfFieldInstance,\n  context: AjfContext,\n  supplementaryInformations?: any,\n): void {\n  const validation = instance.validation;\n  if (validation == null) {\n    instance.valid = true;\n    return;\n  }\n  // TODO what is this??\n  if (supplementaryInformations) {\n    Object.keys(supplementaryInformations).forEach(key => {\n      context[`__supplementary__${key}__`] = supplementaryInformations[key];\n    });\n  }\n\n  const completeName = nodeInstanceCompleteName(instance);\n\n  if (context[completeName] != null && validation && validation.forceValue) {\n    instance.value = evaluateExpression(validation.forceValue.condition, context);\n    context[completeName] = instance.value;\n    context['$value'] = instance.value;\n  }\n\n  instance.validationResults = evaluateValidationGroup(validation, context[completeName], context);\n  instance.valid = instance.validationResults.reduce(\n    (prev: boolean, x: AjfValidationResult) => prev && x.result,\n    true,\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfWarning} from '../../interface/warning/warning';\nimport {AjfWarningResult} from '../../interface/warning/warning-result';\n\nexport function evaluateWarning(\n  warning: AjfWarning,\n  context?: AjfContext,\n): AjfWarningResult {\n  return {\n    result: evaluateExpression(warning.condition, context),\n    warning: warning.warningMessage,\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\n\nimport {AjfWarningGroup} from '../../interface/warning/warning-group';\nimport {AjfWarningResult} from '../../interface/warning/warning-result';\nimport {evaluateWarning} from './evaluate-warning';\n\nexport function evaluateWarningConditions(\n  warning: AjfWarningGroup,\n  context?: AjfContext,\n): AjfWarningResult[] {\n  return warning.conditions.map(cond => evaluateWarning(cond, context));\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\n\nimport {AjfWarningGroup} from '../../interface/warning/warning-group';\nimport {AjfWarningResult} from '../../interface/warning/warning-result';\nimport {evaluateWarningConditions} from './evaluate-warning-conditions';\n\nexport function evaluateWarningGroup(\n  warning: AjfWarningGroup,\n  context?: AjfContext,\n): AjfWarningResult[] {\n  return evaluateWarningConditions(warning, context);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\n\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\nimport {nodeInstanceCompleteName} from '../nodes-instances/node-instance-complete-name';\nimport {evaluateWarningGroup} from '../warning/evaluate-warning-group';\n\n/**\n * It Updates instance warining results.\n * If instance.warning in null return.\n * If nodeInstanceCompleteName is in context and warning is defined re-evaluate warning group\n */\nexport function updateWarning(instance: AjfFieldInstance, context: AjfContext): void {\n  const warning = instance.warning;\n  if (warning == null) {\n    return;\n  }\n\n  const completeName = nodeInstanceCompleteName(instance);\n\n  if (context[completeName] != null && warning) {\n    instance.warningResults = evaluateWarningGroup(warning, context);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\n\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\nimport {updateConditionalBranches} from '../nodes-instances/update-conditional-branches';\nimport {updateEditability} from '../nodes-instances/update-editability';\nimport {updateVisibility} from '../nodes-instances/update-visibility';\nimport {updateFormula} from './update-formula';\nimport {updateNextSlideCondition} from './update-next-slide-condition';\nimport {updateValidation} from './update-validation';\nimport {updateWarning} from './update-warning';\n\n/**\n * It grab all the field instance update functions.\n */\nexport function updateFieldInstanceState(\n  instance: AjfFieldInstance,\n  context: AjfContext,\n  branchVisibility = true,\n): void {\n  updateEditability(instance, context);\n  updateVisibility(instance, context, branchVisibility);\n  updateConditionalBranches(instance, context);\n  updateFormula(instance, context);\n  updateValidation(instance, context);\n  updateWarning(instance, context);\n  updateNextSlideCondition(instance, context);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, createFunction} from '@ajf/core/models';\n\nimport {AjfFieldWithChoicesInstance} from '../../interface/fields-instances/field-with-choices-instance';\n\nexport function updateFilteredChoices(\n  instance: AjfFieldWithChoicesInstance<any>,\n  context: AjfContext,\n): void {\n  if (instance.choicesFilter != null) {\n    const func = createFunction(instance.choicesFilter!.formula);\n    instance.filteredChoices = instance.node.choicesOrigin.choices.filter(c => {\n      context['$choice'] = c;\n      context['$choiceValue'] = c.value;\n      return func(context);\n    });\n  } else {\n    instance.filteredChoices = instance.node.choicesOrigin.choices;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfFieldWithChoicesInstance} from '../../interface/fields-instances/field-with-choices-instance';\nimport {nodeInstanceCompleteName} from '../nodes-instances/node-instance-complete-name';\n\n/**\n * It is true if at least one of the triggherate coditions is true\n */\nexport function updateTriggerConditions(\n  instance: AjfFieldWithChoicesInstance<any>,\n  context: AjfContext,\n): boolean {\n  if (instance.triggerConditions == null) {\n    return false;\n  }\n  const completeName = nodeInstanceCompleteName(instance);\n  if (instance.firstTriggerConditionDone[completeName]) {\n    return false;\n  }\n  let found = false;\n  const conditionsNum = instance.triggerConditions.length;\n  for (let i = 0; i < conditionsNum; i++) {\n    if (evaluateExpression(instance.triggerConditions[i].condition, context)) {\n      found = true;\n      break;\n    }\n  }\n  instance.firstTriggerConditionDone[completeName] = found;\n  return found;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {alwaysCondition} from '@ajf/core/models';\n\nimport {AjfNode} from '../../interface/nodes/node';\n\nexport type AjfNodeCreate = Pick<AjfNode, 'nodeType' | 'id' | 'parent' | 'name'> & Partial<AjfNode>;\n/**\n * It creates an AjfNode by schema.\n * If conditionalBranches is not defined assign {condition: 'true'}.\n * If parentNode is not defined assign 0.\n * If label is not defined assign ''.\n * If visibility is not defined assign {condition: 'true'}.\n */\nexport function createNode(node: AjfNodeCreate): AjfNode {\n  const conditionalBranches =\n    node.conditionalBranches != null && node.conditionalBranches.length > 0\n      ? node.conditionalBranches\n      : [alwaysCondition()];\n  return {\n    ...node,\n    parentNode: node.parentNode != null ? node.parentNode : 0,\n    label: node.label || '',\n    visibility: node.visibility || alwaysCondition(),\n    conditionalBranches,\n  } as AjfNode;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from '../../interface/fields/base-field';\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfNodeCreate, createNode} from '../nodes/create-node';\n\nexport type AjfFieldCreate = Omit<AjfNodeCreate, 'nodeType'> &\n  Pick<AjfBaseField, 'fieldType'> &\n  Partial<AjfBaseField>;\n/**\n * It creates an AjfField.\n * If size is not defined apply 'normal'.\n * If defaultValue is not defined apply null.\n * If editable is not defined return true if field type is'nt formula or table\n */\nexport function createField<T extends AjfField = AjfField>(field: AjfFieldCreate): T {\n  const node = createNode({...field, nodeType: AjfNodeType.AjfField});\n  const editable =\n    field.editable != null\n      ? field.editable\n      : field.fieldType !== AjfFieldType.Formula && field.fieldType !== AjfFieldType.Table;\n  return {\n    ...node,\n    ...field,\n    nodeType: AjfNodeType.AjfField,\n    editable,\n    defaultValue: field.defaultValue != null ? field.defaultValue : null,\n    size: field.size || 'normal',\n  } as T;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfRepeatingSlide} from '../../interface/slides/repeating-slide';\nimport {AjfSlide} from '../../interface/slides/slide';\n\n/**\n * It is true if node is AjfRepeatingSlide or AjfSlide.\n */\nexport function isSlidesNode(node: AjfNode): node is AjfRepeatingSlide | AjfSlide {\n  return (\n    node != null &&\n    (node.nodeType === AjfNodeType.AjfRepeatingSlide || node.nodeType === AjfNodeType.AjfSlide)\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfContainerNode} from '../../interface/nodes/container-node';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {isSlidesNode} from './is-slides-node';\n/**\n * It is true if node is AjfNodeGroup or slides nodes.\n */\nexport function isContainerNode(node: AjfNode): node is AjfContainerNode {\n  return node != null && (node.nodeType === AjfNodeType.AjfNodeGroup || isSlidesNode(node));\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContainerNodeInstance} from '../../interface/nodes-instances/container-node-instance';\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {isContainerNode} from '../nodes/is-container-node';\n/**\n * It is true if nodeInstance is realtive to an AjfNodeGroup or slides nodes.\n */\nexport function isContainerNodeInstance(\n  nodeInstance: AjfNodeInstance,\n): nodeInstance is AjfContainerNodeInstance {\n  return nodeInstance != null && nodeInstance.node != null && isContainerNode(nodeInstance.node);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContainerNodeInstance} from '../../interface/nodes-instances/container-node-instance';\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\n\nimport {isContainerNodeInstance} from './is-container-node-instance';\nimport {isFieldInstance} from './is-field-instance';\n\n/**\n * It creates a one dimensional array of AjfNodeInstance.\n * If the node is a containerNode(has the nodes attribute)\n * recursively  concat their nodes.\n * If includeGroups is true the result also contains the containerNodeInstance.\n */\nexport function flattenNodesInstances(\n  nodes: AjfNodeInstance[],\n  includeGroups = false,\n): AjfNodeInstance[] {\n  let flatNodes: AjfNodeInstance[] = [];\n  nodes.forEach((nodeInstance: AjfNodeInstance) => {\n    if (isFieldInstance(nodeInstance)) {\n      flatNodes.push(nodeInstance);\n    }\n    if (isContainerNodeInstance(nodeInstance)) {\n      if (includeGroups) {\n        flatNodes.push(nodeInstance);\n      }\n      flatNodes = flatNodes.concat(\n        flattenNodesInstances((nodeInstance as AjfContainerNodeInstance).nodes, includeGroups),\n      );\n    }\n  });\n  return flatNodes;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfRepeatingSlideInstance} from '../../interface/slides-instances/repeating-slide-instance';\nimport {AjfSlideInstance} from '../../interface/slides-instances/slide-instance';\nimport {isSlidesNode} from '../nodes/is-slides-node';\n\n/**\n * It is true if nodeInstance is relative to AjfRepeatingSlide node or AjfSlide node.\n */\nexport function isSlidesInstance(\n  nodeInstance: AjfNodeInstance,\n): nodeInstance is AjfRepeatingSlideInstance | AjfSlideInstance {\n  return nodeInstance != null && nodeInstance.node != null && isSlidesNode(nodeInstance.node);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfSlideInstance} from '../../interface/slides-instances/slide-instance';\nimport {flattenNodesInstances} from './flatten-nodes-instances';\nimport {isSlidesInstance} from './is-slides-instance';\n\n/**\n * It creates a one dimensional array of AjfSlideInstance.\n * If the node is a slides node recursively  concat their nodes.\n */\nexport function flattenNodesInstancesTree(nodes: AjfNodeInstance[]): AjfSlideInstance[] {\n  let flatTree: AjfSlideInstance[] = [];\n  nodes.forEach((nodeInstance: AjfNodeInstance) => {\n    if (isSlidesInstance(nodeInstance)) {\n      flatTree.push(nodeInstance as AjfSlideInstance);\n      nodeInstance.flatNodes = flattenNodesInstances(nodeInstance.nodes);\n    }\n  });\n  return flatTree;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\n/**\n * It is true if node is an AjfNodeGroup.\n */\nexport function isNodeGroup(node: AjfNode): boolean {\n  return node != null && node.nodeType === AjfNodeType.AjfNodeGroup;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfNodeGroupInstance} from '../../interface/nodes-instances/node-group-instance';\nimport {isNodeGroup} from '../nodes/is-node-group';\n\n/**\n * It is true if nodeInstance is relative to a AjfNodeGroup.\n */\nexport function isNodeGroupInstance(\n  nodeInstance: AjfNodeInstance,\n): nodeInstance is AjfNodeGroupInstance {\n  return nodeInstance != null && nodeInstance.node != null && isNodeGroup(nodeInstance.node);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfRepeatingContainerNode} from '../../interface/nodes/repeating-container-node';\n\n/**\n * It is true if node is AjfNodeGroup or AjfRepeatingSlide.\n */\nexport function isRepeatingContainerNode(node: AjfNode): node is AjfRepeatingContainerNode {\n  return (\n    node != null &&\n    (node.nodeType === AjfNodeType.AjfNodeGroup || node.nodeType === AjfNodeType.AjfRepeatingSlide)\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfRepeatingContainerNodeInstance} from '../../interface/nodes-instances/repeating-container-node-instance';\nimport {isRepeatingContainerNode} from '../nodes/is-repeating-container-node';\n\n/**\n * It is true if nodeInstance is a repeating container node instance.\n */\nexport function isRepeatingContainerNodeInstance(\n  nodeInstance: AjfNodeInstance,\n): nodeInstance is AjfRepeatingContainerNodeInstance {\n  return (\n    nodeInstance != null && nodeInstance.node != null && isRepeatingContainerNode(nodeInstance.node)\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfNodeGroupInstance} from '../../interface/nodes-instances/node-group-instance';\nimport {AjfRepeatingSlideInstance} from '../../interface/slides-instances/repeating-slide-instance';\n\n/**\n * It is true if nodeInstance is a repeating group instance\n */\nexport function isRepeatingGroupInstance(\n  nodeInstance: AjfNodeInstance,\n): nodeInstance is AjfNodeGroupInstance | AjfRepeatingSlideInstance {\n  return (\n    nodeInstance != null &&\n    nodeInstance.node != null &&\n    (nodeInstance.node.nodeType === AjfNodeType.AjfNodeGroup ||\n      nodeInstance.node.nodeType === AjfNodeType.AjfRepeatingSlide)\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfRepeatingSlide} from '../../interface/slides/repeating-slide';\n\n/**\n * It is true if node is AjfRepeatingSlide.\n */\nexport function isRepeatingSlide(node: AjfNode): node is AjfRepeatingSlide {\n  return node != null && node.nodeType === AjfNodeType.AjfRepeatingSlide;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfRepeatingSlideInstance} from '../../interface/slides-instances/repeating-slide-instance';\nimport {isSlidesInstance} from '../nodes-instances/is-slides-instance';\nimport {isRepeatingSlide} from '../nodes/is-repeating-slide';\n\n/**\n * It is true if instance is a slide instance\n * and the relative node is AjfRepeatingSlide.\n */\nexport function isRepeatingSlideInstance(\n  instance: AjfNodeInstance,\n): instance is AjfRepeatingSlideInstance {\n  return (\n    instance != null &&\n    instance.node != null &&\n    isSlidesInstance(instance) &&\n    isRepeatingSlide(instance.node)\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfSlide} from '../../interface/slides/slide';\n\n/**\n * It is true if node is AjfSlide.\n */\nexport function isSlideNode(node: AjfNode): node is AjfSlide {\n  return node != null && node.nodeType === AjfNodeType.AjfSlide;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfSlideInstance} from '../../interface/slides-instances/slide-instance';\nimport {isSlideNode} from '../nodes/is-slide-node';\n\n/**\n * It is true if nodeInstance is relative to an AjfSlide node.\n */\nexport function isSlideInstance(nodeInstance: AjfNodeInstance): nodeInstance is AjfSlideInstance {\n  return nodeInstance != null && nodeInstance.node != null && isSlideNode(nodeInstance.node);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {EventEmitter} from '@angular/core';\nimport {AjfBaseNodeInstance} from '../../interface/nodes-instances/base-node-instance';\n\nexport type AjfNodeInstanceCreate = Pick<AjfBaseNodeInstance, 'node'> &\n  Partial<AjfBaseNodeInstance>;\n\n/**\n * It creates an AjfNodeInstance.\n * If instance.prefix is defined copy it else assign empty array.\n * If instance.visible is not defined assign true.\n * Assign empty array to conditionalBranches.\n * Assign new eventEmitter to updatedEvt.\n */\nexport function createNodeInstance(instance: AjfNodeInstanceCreate): AjfBaseNodeInstance {\n  return {\n    node: instance.node,\n    prefix: instance.prefix ? [...instance.prefix] : [],\n    visible: instance.visible != null ? instance.visible : true,\n    conditionalBranches: [],\n    updatedEvt: new EventEmitter<void>(),\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\nimport {EventEmitter} from '@angular/core';\n\nimport {AjfFieldInstance} from '../../interface/fields-instances/field-instance';\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeInstanceCreate, createNodeInstance} from '../nodes-instances/create-node-instance';\nimport {nodeInstanceCompleteName} from '../nodes-instances/node-instance-complete-name';\n\nexport type AjfFieldInstanceCreate = AjfNodeInstanceCreate & Partial<AjfFieldInstance>;\n\n/**\n * Create a field instance and init the value of the field by cascade conditions.\n *\n * First check if the value is in the context by node name.\n * Second check if the value is in the context by complete name.\n * Third check if the field has a default value (only if field is visible and its container is visible).\n * Else value is null.\n *\n * If instance validationResultsis is not defined assign empty array.\n * If instance warningResults is not defined assign empty array.\n * Init valid with false.\n */\nexport function createFieldInstance(\n  instance: AjfFieldInstanceCreate,\n  context: AjfContext,\n  containerNode?: AjfNode | null,\n): AjfFieldInstance {\n  const nodeInstance = createNodeInstance(instance);\n  let value: any = null;\n  if (nodeInstance.node != null && context != null) {\n    const completeName = nodeInstanceCompleteName(nodeInstance);\n    if (context[nodeInstance.node.name] != null) {\n      value = context[nodeInstance.node.name];\n    } else if (context[completeName] != null) {\n      value = context[completeName];\n    } else if (instance.node.defaultValue != null) {\n      let visibility = nodeInstance.node.visibility\n        ? evaluateExpression(nodeInstance.node.visibility.condition, context)\n        : nodeInstance.visible;\n\n      if (visibility && containerNode && containerNode.visibility) {\n        visibility = evaluateExpression(containerNode.visibility.condition, context);\n      }\n      if (visibility) {\n        if (instance.node.defaultValue.formula != null) {\n          context[completeName] = evaluateExpression(instance.node.defaultValue.formula, context);\n        } else {\n          context[completeName] = instance.node.defaultValue;\n        }\n      }\n      value = context[completeName];\n    }\n  }\n\n  let isFieldEditable = instance.editable;\n  if (isFieldEditable == null) {\n    isFieldEditable = instance.node.editable != null ? instance.node.editable : true;\n  }\n  return {\n    ...nodeInstance,\n    editable: isFieldEditable,\n    node: instance.node,\n    value,\n    valid: false,\n    validationResults: instance.validationResults || [],\n    warningResults: instance.warningResults || [],\n    warningTrigger: new EventEmitter<void>(),\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\nimport {EventEmitter} from '@angular/core';\n\nimport {AjfFieldWithChoicesInstance} from '../../interface/fields-instances/field-with-choices-instance';\nimport {AjfFieldInstanceCreate, createFieldInstance} from './create-field-instance';\n\nexport type AjfFieldWithChoicesInstanceCreate<T> = AjfFieldInstanceCreate &\n  Partial<AjfFieldWithChoicesInstance<T>>;\n/**\n * Create a field with choices instance.\n * Extends simple field instance with\n * filteredChoices,firstTriggerConditionDone and selectionTrigger\n */\nexport function createFieldWithChoicesInstance<T>(\n  instance: AjfFieldWithChoicesInstanceCreate<T>,\n  context: AjfContext,\n): AjfFieldWithChoicesInstance<T> {\n  const fieldInstance = createFieldInstance(instance, context);\n  return {\n    ...fieldInstance,\n    node: instance.node,\n    filteredChoices: [...instance.node.choices],\n    firstTriggerConditionDone: {},\n    selectionTrigger: new EventEmitter<void>(),\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\nimport {deepCopy} from '@ajf/core/utils';\n\nimport {AjfTableFieldInstance} from '../../interface/fields-instances/table-field-instance';\nimport {AjfTableField} from '../../interface/fields/table-field';\n\nimport {AjfFieldInstanceCreate, createFieldInstance} from './create-field-instance';\n\nexport type AjfTableFieldInstanceCreate = AjfFieldInstanceCreate & Partial<AjfTableFieldInstance>;\n/**\n * to mantain retrocompatibility with old string type convert string to AjfTableCell\n * check  node.rows: (string|AjfTableCell)[][];\n * if elem of map is string convert in to AjfTableCell object\n */\nfunction normalizeRows(node: AjfTableField): void {\n  node.rows.forEach((row, rowIdx) => {\n    row.forEach((elem, elemIdx) => {\n      if (typeof elem === 'string') {\n        node.rows[rowIdx][elemIdx] = {formula: elem, editable: node.editable};\n      }\n    });\n  });\n}\n\n/**\n * Create an Table Fieldinstance.\n * Extends simple field instance with context,hideEmptyRows and controls.\n * If hideEmptyRows is not defined in instance set with false.\n * Assign empty array to controls\n */\nexport function createTableFieldInstance(\n  instance: AjfTableFieldInstanceCreate,\n  context: AjfContext,\n): AjfTableFieldInstance {\n  instance = deepCopy(instance);\n  normalizeRows(instance.node as AjfTableField);\n  const fieldInstance = createFieldInstance(instance, context);\n  return {\n    ...fieldInstance,\n    node: instance.node,\n    context,\n    hideEmptyRows: instance.hideEmptyRows || false,\n    controls: [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeGroupInstance} from '../../interface/nodes-instances/node-group-instance';\nimport {AjfNodeInstanceCreate, createNodeInstance} from './create-node-instance';\n\nexport type AjfNodeGroupInstanceCreate = AjfNodeInstanceCreate & Partial<AjfNodeGroupInstance>;\n/**\n * It creates an AjfNodeGroupInstance.\n * It extends nodeInstance with (formulaReps,reps,nodes and flatNodes).\n * Init reps with 0.\n * Init nodes and flatNodes with empty array\n */\nexport function createNodeGroupInstance(\n  instance: AjfNodeGroupInstanceCreate,\n): AjfNodeGroupInstance {\n  const nodeInstance = createNodeInstance(instance);\n  return {\n    ...nodeInstance,\n    node: instance.node,\n    formulaReps: instance.formulaReps,\n    reps: 0,\n    nodes: [],\n    flatNodes: [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {neverCondition} from '@ajf/core/models';\nimport {AjfSlideInstance} from '../../interface/slides-instances/slide-instance';\nimport {createNodeInstance} from '../nodes-instances/create-node-instance';\nimport {AjfBaseSlideInstanceCreate} from './base';\n\nexport type AjfSlideInstanceCreate = AjfBaseSlideInstanceCreate & Partial<AjfSlideInstance>;\n\n/**\n * It creates AjfSlideInstance.\n * Init nodes,slideNodes and flatNodes with empty array.\n * Init valid with false.\n * Init position with 0.\n */\nexport function createSlideInstance(instance: AjfSlideInstanceCreate): AjfSlideInstance {\n  const nodeInstance = createNodeInstance(instance);\n  return {\n    ...nodeInstance,\n    node: instance.node,\n    nodes: [],\n    slideNodes: [],\n    flatNodes: [],\n    valid: false,\n    position: 0,\n    editable: instance.editable || true,\n    readonly: instance.node.readonly || neverCondition(),\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfRepeatingSlideInstance} from '../../interface/slides-instances/repeating-slide-instance';\nimport {AjfSlideInstanceCreate, createSlideInstance} from './create-slide-instance';\n\nexport type AjfRepeatingSlideInstanceCreate = Omit<AjfSlideInstanceCreate, 'node'> &\n  Pick<AjfRepeatingSlideInstance, 'node'> &\n  Partial<AjfRepeatingSlideInstance>;\n\n/**\n * It creates AjfRepeatingSlideInstance.\n * Init slideNodes, nodes and flatNodes with empty array,\n * Init reps as with 0.\n */\nexport function createRepeatingSlideInstance(\n  instance: AjfRepeatingSlideInstanceCreate,\n): AjfRepeatingSlideInstance {\n  const {node, ...slideInstanceCreate} = instance;\n  const {nodeType, ...slideNode} = node;\n  const slideInstance = createSlideInstance({\n    ...slideInstanceCreate,\n    node: {nodeType: AjfNodeType.AjfSlide, ...slideNode},\n  });\n  return {\n    ...slideInstance,\n    node: instance.node,\n    slideNodes: [],\n    formulaReps: instance.formulaReps,\n    disableRemoval: instance.disableRemoval,\n    reps: 0,\n    nodes: [],\n    flatNodes: [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidationGroup} from '../../interface/validation/validation-group';\n\n/**\n *  Create a AjfValidationGroup, apply conditions defaults when it missing\n */\nexport function createValidationGroup(group: Partial<AjfValidationGroup>): AjfValidationGroup {\n  return {...group, conditions: group.conditions || []};\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfWarningGroup} from '../../interface/warning/warning-group';\n\n/**\n *  Create an AjfWarningGroup, apply conditions defaults when it missing\n */\nexport function createWarningGroup(group: Partial<AjfWarningGroup>): AjfWarningGroup {\n  return {...group, conditions: group.conditions || []};\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfNode} from '../../interface/nodes/node';\nimport {isRepeatingContainerNode} from '../nodes/is-repeating-container-node';\n\n/**\n * It returns all ancestor repeatingContainerNodes of the node.\n */\nexport function getAncestorRepeatingNodes(\n  allNodes: (AjfNode | AjfNodeInstance)[],\n  node: AjfNode,\n): AjfNode[] {\n  let nodeGroups: AjfNode[] = [];\n  let curParent: number | null = node.parent;\n  while (curParent != null) {\n    const curNode = allNodes\n      .map((n: AjfNode | AjfNodeInstance) => (n as AjfNodeInstance).node || (n as AjfNode))\n      .find(n => n.id == curParent);\n    if (curNode) {\n      if (isRepeatingContainerNode(curNode)) {\n        nodeGroups.push(curNode);\n      }\n    }\n    curParent = curNode != null ? curNode.parent : null;\n  }\n  return nodeGroups;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeGroup} from '../../interface/nodes/node-group';\nimport {isField} from '../nodes/is-field';\n\nimport {getAncestorRepeatingNodes} from './get-ancestor-repeating-nodes';\n\n/**\n * Returns all childs node.name of the node's ancestor (includes itself).\n * It is a key-value dictionary, key is the name of the node and\n * value is the position inside ancestorRepeatingNodes.\n */\nexport function getAncestorRepeatingNodesNames(\n  allNodes: (AjfNode | AjfNodeInstance)[],\n  node: AjfNode,\n): {[prop: string]: number} {\n  let names: {[prop: string]: number} = {};\n  const nodeGroups = getAncestorRepeatingNodes(allNodes, node) as AjfNodeGroup[];\n  nodeGroups.forEach((n, idx) =>\n    (n.nodes || []).forEach(sn => {\n      if (isField(sn)) {\n        names[sn.name] = idx;\n      }\n    }),\n  );\n  return names;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfNode} from '../../interface/nodes/node';\nimport {isContainerNode} from '../nodes/is-container-node';\n\n/**\n * It returns the container node of the node.\n */\nexport function getContainerNode(\n  allNodes: (AjfNode | AjfNodeInstance)[],\n  node: AjfNode,\n): AjfNode | null {\n  let parentNode: AjfNode | null = null;\n  let curParent: number | null = node.parent;\n  while (curParent != null && parentNode == null) {\n    const curNode = allNodes\n      .map((n: AjfNode | AjfNodeInstance) => (n as AjfNodeInstance).node || (n as AjfNode))\n      .find(n => n.id == curParent);\n    if (curNode) {\n      if (isContainerNode(curNode)) {\n        parentNode = curNode;\n      }\n    }\n    curParent = curNode != null ? curNode.parent : null;\n  }\n  return parentNode;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, renameArguments} from '@ajf/core/models';\n\nexport function getInstanceCondition(\n  condition: AjfCondition,\n  ancestorsNames: {[prop: string]: number},\n  prefix: number[],\n): AjfCondition {\n  const oldCondition = condition.condition;\n  let newCondition = renameArguments(oldCondition, ancestorsNames, prefix);\n  if (newCondition === oldCondition) {\n    return condition;\n  }\n  return {condition: newCondition};\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition} from '@ajf/core/models';\n\nimport {getInstanceCondition} from './get-instance-condition';\n\nexport function getInstanceConditions(\n  conditions: AjfCondition[],\n  ancestorsNames: {[prop: string]: number},\n  prefix: number[],\n): AjfCondition[] {\n  let changed = false;\n  const newConditions = conditions.map(condition => {\n    const newCondition = getInstanceCondition(condition, ancestorsNames, prefix);\n    if (newCondition !== condition) {\n      changed = true;\n    }\n    return newCondition;\n  });\n  return changed ? newConditions : conditions;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFormula, renameArguments} from '@ajf/core/models';\n\nexport function getInstanceFormula(\n  formula: AjfFormula,\n  ancestorsNames: {[prop: string]: number},\n  prefix: number[],\n): AjfFormula {\n  const oldFormula = formula.formula;\n  let newFormula = renameArguments(oldFormula, ancestorsNames, prefix);\n  if (newFormula === oldFormula) {\n    return formula;\n  }\n  return {formula: newFormula};\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidation} from '../../interface/validation/validation';\n/**\n *  Create a AjfValidation, apply clientValidation and errorMessage defaults when it missing\n */\nexport function createValidation(\n  validation: Pick<AjfValidation, 'condition'> & Partial<AjfValidation>,\n): AjfValidation {\n  return {\n    ...validation,\n    clientValidation: validation.clientValidation || false,\n    errorMessage: validation.errorMessage || 'Undefined Error',\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {renameArguments} from '@ajf/core/models';\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {createValidation} from '../validation/create-validation';\n\nexport function getInstanceValidation(\n  validation: AjfValidation,\n  ancestorsNames: {[prop: string]: number},\n  prefix: number[],\n): AjfValidation {\n  const oldValidation = validation.condition;\n  let newValidation = renameArguments(oldValidation, ancestorsNames, prefix);\n  if (newValidation === oldValidation) {\n    return validation;\n  }\n  return createValidation({...validation, condition: newValidation});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {getInstanceValidation} from './get-instance-validation';\n\nexport function getInstanceValidations(\n  validations: AjfValidation[],\n  ancestorsNames: {[prop: string]: number},\n  prefix: number[],\n): AjfValidation[] {\n  let changed = false;\n  const newValidations = (validations || []).map(validation => {\n    const newValidation = getInstanceValidation(validation, ancestorsNames, prefix);\n    if (newValidation !== validation) {\n      changed = true;\n    }\n    return newValidation;\n  });\n  return changed ? newValidations : validations;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfWarning} from '../../interface/warning/warning';\n\nexport function createWarning(\n  warning: Pick<AjfWarning, 'condition'> & Partial<AjfWarning>,\n): AjfWarning {\n  return {...warning, warningMessage: warning.warningMessage || 'Undefined Warning'};\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {renameArguments} from '@ajf/core/models';\n\nimport {AjfWarning} from '../../interface/warning/warning';\nimport {createWarning} from '../warning/create-warning';\n\nexport function getInstanceWarning(\n  warning: AjfWarning,\n  ancestorsNames: {[prop: string]: number},\n  prefix: number[],\n): AjfWarning {\n  const oldWarning = warning.condition;\n  let newWarning = renameArguments(oldWarning, ancestorsNames, prefix);\n  if (newWarning === oldWarning) {\n    return warning;\n  }\n  return createWarning({condition: newWarning});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfWarning} from '../../interface/warning/warning';\nimport {getInstanceWarning} from './get-instance-warning';\n\nexport function getInstanceWarnings(\n  warnings: AjfWarning[],\n  ancestorsNames: {[prop: string]: number},\n  prefix: number[],\n): AjfWarning[] {\n  let changed = false;\n  const newWarnings = warnings.map(warning => {\n    const newWarning = getInstanceWarning(warning, ancestorsNames, prefix);\n    if (newWarning !== warning) {\n      changed = true;\n    }\n    return newWarning;\n  });\n  return changed ? newWarnings : warnings;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {\n  AjfContext,\n  alwaysCondition,\n  createCondition,\n  createFormula,\n  renameArguments,\n} from '@ajf/core/models';\n\nimport {AjfFileSizeLimit} from '@ajf/core/file-input';\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\nimport {AjfNodeInstance} from '../../interface/nodes-instances/node-instance';\nimport {AjfRepeatingContainerNodeInstance} from '../../interface/nodes-instances/repeating-container-node-instance';\nimport {AjfNode} from '../../interface/nodes/node';\nimport {AjfNodeGroup} from '../../interface/nodes/node-group';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfRepeatingSlide} from '../../interface/slides/repeating-slide';\nimport {AjfSlide} from '../../interface/slides/slide';\nimport {createFieldInstance} from '../fields-instances/create-field-instance';\nimport {createFieldWithChoicesInstance} from '../fields-instances/create-field-with-choices-instance';\nimport {createTableFieldInstance} from '../fields-instances/create-table-field-instance';\nimport {isFieldWithChoicesInstance} from '../fields-instances/is-field-with-choices-instance';\nimport {componentsMap} from '../fields/fields-map';\nimport {createNodeGroupInstance} from '../nodes-instances/create-node-group-instance';\nimport {createRepeatingSlideInstance} from '../slides-instances/create-repeating-slide-instance';\nimport {createSlideInstance} from '../slides-instances/create-slide-instance';\nimport {createValidationGroup} from '../validation/create-validation-group';\nimport {createWarningGroup} from '../warning/create-warning-group';\n\nimport {getAncestorRepeatingNodesNames} from './get-ancestor-repeating-nodes-names';\nimport {getContainerNode} from './get-container-node';\nimport {getInstanceCondition} from './get-instance-condition';\nimport {getInstanceConditions} from './get-instance-conditions';\nimport {getInstanceFormula} from './get-instance-formula';\nimport {getInstanceValidations} from './get-instance-validations';\nimport {getInstanceWarnings} from './get-instance-warnings';\nimport {isFieldInstance} from './is-field-instance';\nimport {isNodeGroupInstance} from './is-node-group-instance';\nimport {isRepeatingSlideInstance} from './is-repeating-slide-instance';\nimport {isSlideInstance} from './is-slide-instance';\n\n/**\n * It creates a nodeInstance relative to a node.\n * To create the instance it calls relative create builder by nodeType.\n * If the prefix is ​​defined all formulas and conditions are calculated based on it.\n */\nexport function nodeToNodeInstance(\n  allNodes: AjfNode[] | AjfNodeInstance[],\n  node: AjfNode,\n  prefix: number[],\n  context: AjfContext,\n): AjfNodeInstance | null {\n  let instance: AjfNodeInstance | null = null;\n  const nodeType = node.nodeType;\n  switch (nodeType) {\n    case AjfNodeType.AjfField:\n      const field = node as AjfField;\n      if (field.fieldType > 100) {\n        if (\n          componentsMap[field.fieldType] != null &&\n          componentsMap[field.fieldType].createInstance != null\n        ) {\n          instance = componentsMap[field.fieldType].createInstance!({node: field, prefix}, context);\n        } else {\n          instance = createFieldInstance({node: field, prefix}, context);\n        }\n      } else {\n        const containerNode = getContainerNode(allNodes, node);\n        switch (field.fieldType) {\n          case AjfFieldType.SingleChoice:\n          case AjfFieldType.MultipleChoice:\n            instance = createFieldWithChoicesInstance({node: field, prefix}, context);\n            break;\n          case AjfFieldType.Table:\n            instance = createTableFieldInstance({node: field, prefix}, context);\n            break;\n          case AjfFieldType.File:\n            // Set the default size limit condition for file input fields.\n            // Added in validation conditions only if no size limit condition is found.\n            const limitSizeCondition = field.validation?.conditions.find(\n              cond => cond.condition.indexOf('.size <') || cond.condition.indexOf('.size<'),\n            );\n            if (!field.validation) {\n              field.validation = {conditions: []};\n            }\n            if (!field.validation.conditions) {\n              field.validation.conditions = [];\n            }\n            if (!limitSizeCondition) {\n              field.validation.conditions.push({\n                'condition': `${field.name} == null || ${field.name}.size < ${AjfFileSizeLimit}`,\n                'clientValidation': true,\n                'errorMessage': `The file exceeds the ${(AjfFileSizeLimit / 1024 ** 2).toFixed(\n                  0,\n                )} MB limit`,\n              });\n            }\n            instance = createFieldInstance({node: field, prefix}, context, containerNode);\n            break;\n          default:\n            instance = createFieldInstance({node: field, prefix}, context, containerNode);\n            break;\n        }\n      }\n      break;\n    case AjfNodeType.AjfNodeGroup:\n      instance = createNodeGroupInstance({node: node as AjfNodeGroup, prefix});\n      break;\n    case AjfNodeType.AjfRepeatingSlide:\n      instance = createRepeatingSlideInstance({node: node as AjfRepeatingSlide, prefix});\n      break;\n    case AjfNodeType.AjfSlide:\n      instance = createSlideInstance({node: node as AjfSlide, prefix});\n      break;\n  }\n  if (instance != null) {\n    const hasPrefix = prefix != null && prefix.length > 0;\n    if (hasPrefix) {\n      const ancestorsNames = getAncestorRepeatingNodesNames(allNodes, node);\n\n      if (node.visibility != null) {\n        const oldVisibility = node.visibility.condition;\n        const newVisibility = renameArguments(oldVisibility, ancestorsNames, prefix);\n        instance.visibility =\n          newVisibility !== oldVisibility\n            ? createCondition({condition: newVisibility})\n            : node.visibility;\n      }\n\n      const conditionalBranches =\n        instance.node.conditionalBranches != null && instance.node.conditionalBranches.length > 0\n          ? instance.node.conditionalBranches\n          : [alwaysCondition()];\n      instance.conditionalBranches = getInstanceConditions(\n        conditionalBranches,\n        ancestorsNames,\n        prefix,\n      );\n\n      if (isNodeGroupInstance(instance) || isRepeatingSlideInstance(instance)) {\n        const formulaReps = instance.node.formulaReps;\n        if (formulaReps != null) {\n          const oldFormula = formulaReps.formula;\n          let newFormula = renameArguments(oldFormula, ancestorsNames, prefix);\n          instance.formulaReps =\n            newFormula !== oldFormula ? createFormula({formula: newFormula}) : formulaReps;\n        }\n      } else if (isFieldInstance(instance)) {\n        instance.readonly = instance.node.readonly;\n\n        if (instance.node.formula) {\n          instance.formula = getInstanceFormula(instance.node.formula, ancestorsNames, prefix);\n        }\n\n        if (instance.node.validation != null) {\n          const newConditions = getInstanceValidations(\n            instance.node.validation.conditions,\n            ancestorsNames,\n            prefix,\n          );\n          if (newConditions !== instance.node.validation.conditions) {\n            instance.validation = createValidationGroup(instance.node.validation);\n            instance.validation.conditions = newConditions;\n          } else {\n            instance.validation = instance.node.validation;\n          }\n        }\n\n        if (instance.node.warning != null) {\n          const newWarnings = getInstanceWarnings(\n            instance.node.warning.conditions,\n            ancestorsNames,\n            prefix,\n          );\n          if (newWarnings !== instance.node.warning.conditions) {\n            instance.warning = createWarningGroup(instance.node.warning);\n            instance.warning.conditions = newWarnings;\n          } else {\n            instance.warning = instance.node.warning;\n          }\n        }\n\n        if (instance.node.nextSlideCondition != null) {\n          instance.nextSlideCondition = getInstanceCondition(\n            instance.node.nextSlideCondition,\n            ancestorsNames,\n            prefix,\n          );\n        }\n\n        if (isFieldWithChoicesInstance(instance)) {\n          if (instance.node.choicesFilter != null) {\n            instance.choicesFilter = getInstanceFormula(\n              instance.node.choicesFilter,\n              ancestorsNames,\n              prefix,\n            );\n          }\n          if (instance.node.triggerConditions != null) {\n            instance.triggerConditions = getInstanceConditions(\n              instance.node.triggerConditions,\n              ancestorsNames,\n              prefix,\n            );\n          }\n        }\n      }\n    } else {\n      instance.visibility = instance.node.visibility;\n      if (isSlideInstance(instance) || isFieldInstance(instance)) {\n        instance.readonly = instance.node.readonly;\n      }\n      const conditionalBranches =\n        instance.node.conditionalBranches != null && instance.node.conditionalBranches.length > 0\n          ? instance.node.conditionalBranches\n          : [alwaysCondition()];\n      instance.conditionalBranches = conditionalBranches;\n      if (isNodeGroupInstance(instance) || isRepeatingSlideInstance(instance)) {\n        const rgInstance = instance as AjfRepeatingContainerNodeInstance;\n        rgInstance.formulaReps = rgInstance.node.formulaReps;\n      } else if (isFieldInstance(instance)) {\n        instance.validation = instance.node.validation;\n        instance.warning = instance.node.warning;\n        instance.nextSlideCondition = instance.node.nextSlideCondition;\n        if (isFieldWithChoicesInstance(instance)) {\n          instance.choicesFilter = instance.node.choicesFilter;\n          instance.triggerConditions = instance.node.triggerConditions;\n        }\n        instance.formula = instance.node.formula;\n      }\n    }\n  }\n  return instance;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\nimport {isContainerNode} from './is-container-node';\n/**\n * It creates an one dimensional array of AjfNode.\n * If the node is a containerNode(has the nodes attribute)\n * recursively  concat their nodes.\n */\nexport function flattenNodes(nodes: AjfNode[]): AjfNode[] {\n  let flatNodes: AjfNode[] = [];\n  nodes.forEach((node: AjfNode) => {\n    flatNodes.push(node);\n    if (isContainerNode(node)) {\n      flatNodes = flatNodes.concat(flattenNodes(node.nodes));\n    }\n  });\n  return flatNodes;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../../interface/nodes/node';\n\n/**\n * It is return a new orderered nodes.\n * The newNodes are ordered recursively by parentNode.\n * The sorting begins by parent\n */\nexport function orderedNodes(nodes: AjfNode[], parent: number | null): AjfNode[] {\n  let newNodes: AjfNode[] = [];\n  nodes\n    .filter((n: AjfNode) =>\n      parent != null ? n.parent == parent : n.parent == null || n.parent === 0,\n    )\n    .sort((n1: AjfNode, n2: AjfNode) => n1.parentNode - n2.parentNode)\n    .forEach((n: AjfNode) => {\n      newNodes.push(n);\n      newNodes = newNodes.concat(orderedNodes(nodes, n.id));\n    });\n  return newNodes;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\n\nimport {AjfRepeatingNodeInstance} from '../../interface/nodes-instances/repeating-node-instance';\nimport {nodeInstanceCompleteName} from '../nodes-instances/node-instance-complete-name';\n\n/**\n * It upodates AjfRepeatingNodeInstance reps and it returns oldReps.\n */\nexport function updateRepsNum(instance: AjfRepeatingNodeInstance, context?: AjfContext): number {\n  const oldReps: number = instance.reps || 0;\n  context = context || {};\n  if (instance.node.formulaReps == null) {\n    const ctxReps = context[nodeInstanceCompleteName(instance)];\n    if (ctxReps != null) {\n      instance.reps = ctxReps;\n    } else if (oldReps == 0) {\n      instance.reps = 1;\n    }\n  } else {\n    let newReps = evaluateExpression(instance.node.formulaReps.formula, context);\n    if (newReps !== oldReps) {\n      instance.reps = newReps;\n    }\n  }\n  instance.canAdd = instance.node.maxReps === 0 || instance.reps < instance.node.maxReps;\n  instance.canRemove = instance.node.minReps === 0 || instance.reps > instance.node.minReps;\n  return oldReps;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseSlideInstance} from '../../interface/slides-instances/base-slide-instance';\n\n/**\n * It checks if the idx slide of\n *\n * @export\n * @param slide\n * @param idx\n * @return boolean\n */\nexport function validSlide(slide: AjfBaseSlideInstance, idx: number): boolean {\n  if (idx >= slide.slideNodes.length) {\n    return true;\n  }\n  return slide.slideNodes[idx]\n    .map(n => {\n      if (n.visible && Object.keys(n).indexOf('valid') > -1) {\n        return (<any>n).valid;\n      }\n      return true;\n    })\n    .reduce((v1, v2) => v1 && v2, true);\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfExpressionUtils} from '@ajf/core/models';\nimport {Injectable} from '@angular/core';\n\n@Injectable()\nexport class AjfValidationService {\n  addFunctionHandler(name: string, fn: any): void {\n    if (AjfExpressionUtils.utils[name] === undefined) {\n      AjfExpressionUtils.utils[name] = {fn};\n    }\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, AjfContext, evaluateExpression, getArgumentNames} from '@ajf/core/models';\nimport {TranslocoService} from '@ajf/core/transloco';\nimport {deepCopy} from '@ajf/core/utils';\nimport {EventEmitter, Injectable, Optional} from '@angular/core';\nimport {AbstractControl, UntypedFormControl, UntypedFormGroup} from '@angular/forms';\nimport {format} from 'date-fns';\nimport {\n  BehaviorSubject,\n  from,\n  Observable,\n  of as obsOf,\n  Subject,\n  Subscriber,\n  Subscription,\n  timer,\n} from 'rxjs';\nimport {\n  filter,\n  map,\n  pairwise,\n  scan,\n  share,\n  startWith,\n  switchMap,\n  tap,\n  withLatestFrom,\n} from 'rxjs/operators';\n\nimport {AjfChoice} from './interface/choices/choice';\nimport {AjfFieldInstance} from './interface/fields-instances/field-instance';\nimport {AjfFieldType} from './interface/fields/field-type';\nimport {AjfForm} from './interface/forms/form';\nimport {AjfTableFormControl} from './interface/forms/table-form-control';\nimport {AjfNodeGroupInstance} from './interface/nodes-instances/node-group-instance';\nimport {AjfNodeInstance} from './interface/nodes-instances/node-instance';\nimport {AjfRepeatingContainerNodeInstance} from './interface/nodes-instances/repeating-container-node-instance';\nimport {AjfNode} from './interface/nodes/node';\nimport {AjfNodeGroup} from './interface/nodes/node-group';\nimport {AjfNodeType} from './interface/nodes/node-type';\nimport {AjfNodesInstancesOperation} from './interface/operations/nodes-instances-operation';\nimport {AjfRendererUpdateMapOperation} from './interface/operations/renderer-update-map-operation';\nimport {AjfRendererUpdateMap} from './interface/renderer-maps/update-map';\nimport {AjfBaseSlideInstance} from './interface/slides-instances/base-slide-instance';\nimport {AjfRepeatingSlideInstance} from './interface/slides-instances/repeating-slide-instance';\nimport {AjfSlideInstance} from './interface/slides-instances/slide-instance';\nimport {initChoicesOrigin} from './utils/choices/init-choices-origin';\nimport {isFieldWithChoicesInstance} from './utils/fields-instances/is-field-with-choices-instance';\nimport {isTableFieldInstance} from './utils/fields-instances/is-table-field-instance';\nimport {updateFieldInstanceState} from './utils/fields-instances/update-field-instance-state';\nimport {updateFilteredChoices} from './utils/fields-instances/update-filtered-choices';\nimport {updateFormula} from './utils/fields-instances/update-formula';\nimport {updateNextSlideCondition} from './utils/fields-instances/update-next-slide-condition';\nimport {updateTriggerConditions} from './utils/fields-instances/update-trigger-conditions';\nimport {updateValidation} from './utils/fields-instances/update-validation';\nimport {updateWarning} from './utils/fields-instances/update-warning';\nimport {createField} from './utils/fields/create-field';\nimport {flattenNodesInstances} from './utils/nodes-instances/flatten-nodes-instances';\nimport {flattenNodesInstancesTree} from './utils/nodes-instances/flatten-nodes-instances-tree';\nimport {isFieldInstance} from './utils/nodes-instances/is-field-instance';\nimport {isNodeGroupInstance} from './utils/nodes-instances/is-node-group-instance';\nimport {isRepeatingContainerNodeInstance} from './utils/nodes-instances/is-repeating-container-node-instance';\nimport {isRepeatingGroupInstance} from './utils/nodes-instances/is-repeating-group-instance';\nimport {isRepeatingSlideInstance} from './utils/nodes-instances/is-repeating-slide-instance';\nimport {isSlideInstance} from './utils/nodes-instances/is-slide-instance';\nimport {isSlidesInstance} from './utils/nodes-instances/is-slides-instance';\nimport {nodeInstanceCompleteName} from './utils/nodes-instances/node-instance-complete-name';\nimport {nodeInstanceSuffix} from './utils/nodes-instances/node-instance-suffix';\nimport {nodeToNodeInstance} from './utils/nodes-instances/node-to-node-instance';\nimport {updateConditionalBranches} from './utils/nodes-instances/update-conditional-branches';\nimport {updateEditability} from './utils/nodes-instances/update-editability';\nimport {updateVisibility} from './utils/nodes-instances/update-visibility';\nimport {flattenNodes} from './utils/nodes/flatten-nodes';\nimport {isContainerNode} from './utils/nodes/is-container-node';\nimport {orderedNodes} from './utils/nodes/ordered-nodes';\nimport {updateRepsNum} from './utils/slides-instances/update-reps-num';\nimport {validSlide} from './utils/slides-instances/valid-slide';\nimport {AjfValidationService} from './validation-service';\nimport {isContainerNodeInstance} from './utils/nodes-instances/is-container-node-instance';\n\nexport const enum AjfFormInitStatus {\n  Initializing,\n  Complete,\n}\n\n/**\n * Update Slide Validity according to the validity of its field nodes\n * @param slide\n */\nconst updateSlideValidity = (slide: AjfRepeatingSlideInstance | AjfSlideInstance) => {\n  const subNodesNum = slide.flatNodes.length;\n  let valid = true;\n  for (let i = 0; i < subNodesNum; i++) {\n    const subNode = slide.flatNodes[i];\n    if (subNode.visible && isFieldInstance(subNode) && !subNode.valid) {\n      valid = false;\n      break;\n    }\n  }\n  if (slide.valid !== valid) {\n    slide.valid = valid;\n  }\n};\n\n@Injectable()\nexport class AjfFormRendererService {\n  private _editabilityNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _editabilityNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _visibilityNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _visibilityNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _repetitionNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _repetitionNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _conditionalBranchNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _conditionalBranchNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _formulaNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _formulaNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _validationNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _validationNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _warningNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _warningNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _filteredChoicesNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _filteredChoicesNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _triggerConditionsNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _triggerConditionsNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _nextSlideConditionsNodesMap!: Observable<AjfRendererUpdateMap>;\n  private _nextSlideConditionsNodesMapUpdates: Subject<AjfRendererUpdateMapOperation> =\n    new Subject<AjfRendererUpdateMapOperation>();\n\n  private _formInitEvent: EventEmitter<AjfFormInitStatus> = new EventEmitter<AjfFormInitStatus>();\n  readonly formInitEvent: Observable<AjfFormInitStatus> = this\n    ._formInitEvent as Observable<AjfFormInitStatus>;\n\n  private _formGroup: BehaviorSubject<UntypedFormGroup | null> =\n    new BehaviorSubject<UntypedFormGroup | null>(null);\n  readonly formGroup: Observable<UntypedFormGroup | null> = this\n    ._formGroup as Observable<UntypedFormGroup | null>;\n\n  private _form: BehaviorSubject<{\n    form: AjfForm | null;\n    context?: AjfContext;\n  } | null> = new BehaviorSubject<{\n    form: AjfForm | null;\n    context?: AjfContext;\n  } | null>(null);\n  private _nodes!: Observable<AjfNodeInstance[]>;\n  private _flatNodes!: Observable<AjfNodeInstance[]>;\n\n  private _flatNodesTree!: Observable<AjfSlideInstance[]>;\n  private _nodesUpdates: Subject<AjfNodesInstancesOperation> =\n    new Subject<AjfNodesInstancesOperation>();\n  private _errorPositions!: Observable<number[]>;\n  private _errors!: Observable<number>;\n\n  private _formGroupSubscription: Subscription = Subscription.EMPTY;\n  private _valueChanged: Subject<void> = new Subject<void>();\n\n  private _nodesMaps!: Observable<AjfRendererUpdateMap>[];\n\n  private _nextSlideTrigger: EventEmitter<AjfNodeInstance> = new EventEmitter<AjfNodeInstance>();\n  readonly nextSlideTrigger: Observable<AjfNodeInstance> = this\n    ._nextSlideTrigger as Observable<AjfNodeInstance>;\n\n  private _slidesNum: BehaviorSubject<number> = new BehaviorSubject<number>(0);\n  readonly slidesNum: Observable<number> = this._slidesNum as Observable<number>;\n\n  get nodesTree(): Observable<AjfSlideInstance[]> {\n    return this._flatNodesTree;\n  }\n  get errorPositions(): Observable<number[]> {\n    return this._errorPositions;\n  }\n  get errors(): Observable<number> {\n    return this._errors;\n  }\n  get currentSupplementaryInformations(): any {\n    const form = this._form.getValue();\n    return form != null && form.form != null ? form.form.supplementaryInformations : null;\n  }\n\n  get nodesVisibility(): Observable<{name: string; type: 'slide' | 'field'; visible: boolean}[]> {\n    return this._nodes.pipe(\n      map(nodes => {\n        return this._mapNodesVisibility(nodes);\n      }),\n    );\n  }\n\n  constructor(_: AjfValidationService, @Optional() private _ts: TranslocoService | null = null) {\n    // Initialize all streams for the form\n    this._initUpdateMapStreams();\n    this._initNodesStreams();\n    this._initErrorsStreams();\n    this._initFormStreams();\n    this._updateFormValueAndValidity();\n  }\n\n  private _translateChoices(choices: AjfChoice<any>[]): void {\n    if (this._ts == null) {\n      return;\n    }\n    for (const choice of choices) {\n      if (choice.translatedLabel == null) {\n        choice.translatedLabel = this._ts.translate(choice.label);\n      }\n    }\n  }\n\n  /**\n   * It's called by the app to set a new Ajf Form with its context\n   * @param form the Ajf Form schema\n   * @param context the initial context\n   */\n  setForm(form: AjfForm | null, context: AjfContext = {}) {\n    this._initUpdateMapStreams();\n    if (\n      form != null &&\n      Object.keys(context).length === 0 &&\n      Object.keys(form.initContext || {}).length > 0\n    ) {\n      context = form.initContext || {};\n    }\n    const currentForm = this._form.getValue();\n    if (\n      (currentForm == null && form != null) ||\n      (currentForm != null && form !== currentForm.form)\n    ) {\n      if (form != null) {\n        for (const origin of form.choicesOrigins) {\n          this._translateChoices(origin.choices);\n        }\n      }\n      this._form.next({form: form, context: context});\n    }\n  }\n\n  /**\n   * Replace date values in this format \"2023-03-28T22:00:00.000Z\" with \"yyyy-MM-dd\" format\n   * @param ctx\n   */\n  private _fixDates(ctx: any): void {\n    if (ctx) {\n      Object.keys(ctx).forEach(k => {\n        const v = ctx[k];\n        if (typeof v === 'string' && /^\\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\dZ$/.test(v)) {\n          const d = format(new Date(v), 'yyyy-MM-dd');\n          ctx[k] = d;\n        }\n      });\n    }\n  }\n\n  getFormValue(): any {\n    const formGroup = this._formGroup.getValue();\n    if (formGroup == null) {\n      return {};\n    }\n    let res = deepCopy(formGroup.value);\n    this._fixDates(res);\n    return res;\n  }\n\n  /**\n   * Set nodesUpdates value (it's a function) for the flatNodes stream\n   * @param group\n   * @returns\n   */\n  addGroup(group: AjfNodeGroupInstance | AjfRepeatingSlideInstance): Observable<boolean> {\n    return new Observable<boolean>((subscriber: Subscriber<boolean>) => {\n      if (group.formulaReps != null) {\n        subscriber.next(false);\n        subscriber.complete();\n        return;\n      }\n      const maxReps = group.node.maxReps;\n      if (maxReps > 0 && group.reps + 1 > maxReps) {\n        subscriber.next(false);\n        subscriber.complete();\n        return;\n      }\n      const oldReps = group.reps;\n      group.reps = group.reps + 1;\n      group.canAdd = group.node.maxReps === 0 || group.reps < group.node.maxReps;\n      group.canRemove = group.node.minReps === 0 || group.reps > group.node.minReps;\n      this._nodesUpdates.next((nodes: AjfNodeInstance[]): AjfNodeInstance[] => {\n        const flatNodes = flattenNodesInstances(nodes, true);\n        this._adjustReps(flatNodes, group, oldReps, this.getFormValue());\n        subscriber.next(true);\n        subscriber.complete();\n        return nodes;\n      });\n    });\n  }\n\n  removeGroup(\n    group: AjfNodeGroupInstance | AjfRepeatingSlideInstance,\n    idx?: number,\n  ): Observable<boolean> {\n    return new Observable<boolean>((subscriber: Subscriber<boolean>) => {\n      if (group.formulaReps != null) {\n        subscriber.next(false);\n        subscriber.complete();\n        return;\n      }\n      const minReps = group.node.minReps;\n      if (group.reps - 1 < minReps) {\n        subscriber.next(false);\n        subscriber.complete();\n        return;\n      }\n      const oldReps = group.reps;\n      group.reps = group.reps - 1;\n      group.canAdd = group.node.maxReps === 0 || group.reps < group.node.maxReps;\n      group.canRemove = group.node.minReps === 0 || group.reps > group.node.minReps;\n      this._nodesUpdates.next((nodes: AjfNodeInstance[]): AjfNodeInstance[] => {\n        this._adjustReps(nodes, group, oldReps, this.getFormValue(), idx);\n        subscriber.next(true);\n        subscriber.complete();\n        return nodes;\n      });\n    });\n  }\n\n  getControl(field: AjfFieldInstance | undefined): Observable<AbstractControl | null> {\n    return this.formGroup.pipe(\n      map(f => {\n        if (field == null) {\n          return null;\n        }\n        const fieldName = nodeInstanceCompleteName(field);\n        return f != null && f.contains(fieldName) ? f.controls[fieldName] : null;\n      }),\n    );\n  }\n\n  /**\n   * Recursively extrapolates nodeInstances visibility and returns an array\n   * @param nodes The nodes\n   * @param parentVisible If false, children nodes will also be not visible\n   * @returns An array with all nodes visibility\n   */\n  private _mapNodesVisibility(\n    nodes: AjfNodeInstance[],\n    parentVisible: boolean = true,\n  ): {name: string; type: 'slide' | 'field'; visible: boolean}[] {\n    if (!nodes || !nodes.length) return [];\n    const nodesVisibility: {name: string; type: 'slide' | 'field'; visible: boolean}[] = [];\n    for (let node of nodes) {\n      const name = node.node.name;\n      const visible = parentVisible ? node.visible : false;\n      if ('nodes' in node && node.nodes && node.nodes.length) {\n        nodesVisibility.push({name, type: 'slide', visible});\n        nodesVisibility.push(...this._mapNodesVisibility(node.nodes, visible));\n      } else {\n        nodesVisibility.push({name, type: 'field', visible});\n      }\n    }\n    return nodesVisibility;\n  }\n\n  /**\n   * Init the errors stream. Start on valueChanged\n   */\n  private _initErrorsStreams(): void {\n    this._errorPositions = this._valueChanged.pipe(\n      withLatestFrom(this._nodes, this._form),\n      filter(\n        ([_, __, form]) =>\n          form != null &&\n          (\n            form as {\n              form: AjfForm | null;\n              context?: AjfContext;\n            }\n          ).form != null,\n      ),\n      map(([_, nodes, formDef]) => {\n        const form = (\n          formDef as {\n            form: AjfForm | null;\n            context?: AjfContext;\n          }\n        ).form as AjfForm;\n        let currentPosition = 0;\n        const errors: number[] = [];\n        nodes.forEach(node => {\n          if (isRepeatingSlideInstance(node)) {\n            for (let i = 0; i < node.reps; i++) {\n              if (node.visible) {\n                currentPosition++;\n                if (i == 0) {\n                  node.position = currentPosition;\n                }\n                if (!validSlide(node, i)) {\n                  errors.push(currentPosition);\n                }\n              }\n            }\n          } else if (isSlideInstance(node)) {\n            if (node.visible) {\n              currentPosition++;\n              node.position = currentPosition;\n              if (!node.valid) {\n                errors.push(currentPosition);\n              }\n            }\n          }\n        });\n        form.valid = errors.length == 0;\n        this._slidesNum.next(currentPosition);\n        return errors;\n      }),\n      share(),\n    );\n    this._errors = this._errorPositions.pipe(\n      map(e => (e != null ? e.length : 0)),\n      startWith(0),\n      share(),\n    );\n  }\n\n  /**\n   * Init all the update map stream for the form nodes\n   * (maps for editability, visibility, repetition, formula, validation, filteredChoices...)\n   * Each map contains all the fields that are to be re-rendered when editing another field,\n   * grouped by the fields on which they depend\n   */\n  private _initUpdateMapStreams(): void {\n    const startValue = (): AjfRendererUpdateMap => ({});\n    this._editabilityNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._editabilityNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._visibilityNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._visibilityNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._repetitionNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._repetitionNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._conditionalBranchNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._conditionalBranchNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._formulaNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._formulaNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._validationNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._validationNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._warningNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._warningNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._filteredChoicesNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._filteredChoicesNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._triggerConditionsNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._triggerConditionsNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n    this._nextSlideConditionsNodesMap = (<Observable<AjfRendererUpdateMapOperation>>(\n      this._nextSlideConditionsNodesMapUpdates\n    )).pipe(\n      scan((rmap: AjfRendererUpdateMap, op: AjfRendererUpdateMapOperation) => {\n        return op(rmap);\n      }, {}),\n      startWith(startValue()),\n      share(),\n    );\n\n    this._nodesMaps = [\n      this._editabilityNodesMap,\n      this._visibilityNodesMap,\n      this._repetitionNodesMap,\n      this._conditionalBranchNodesMap,\n      this._formulaNodesMap,\n      this._validationNodesMap,\n      this._warningNodesMap,\n      this._nextSlideConditionsNodesMap,\n      this._filteredChoicesNodesMap,\n      this._triggerConditionsNodesMap,\n    ];\n  }\n\n  /**\n   * Init two streams for new Ajf Form. Start on setForm.\n   * On subscribe call next() for the behavior subject\n   * and set the new value for formGroup (start the delta) and for nodesUpdates (start the flatNodes)\n   */\n  private _initFormStreams(): void {\n    const formObs = this._form;\n    formObs\n      .pipe(\n        map(_form => {\n          return this._initFormGroupStreams(new UntypedFormGroup({}));\n        }),\n      )\n      .subscribe(this._formGroup);\n    formObs\n      .pipe(\n        switchMap(form => {\n          if (form == null || form.form == null) {\n            return obsOf(form);\n          }\n          const choicesOrigins = form.form.choicesOrigins || [];\n          if (choicesOrigins.length === 0) {\n            return obsOf(form);\n          }\n          return from(Promise.all(choicesOrigins.map(co => initChoicesOrigin(co)))).pipe(\n            map(() => form),\n          );\n        }),\n        map(formDef => {\n          return (_nodesInstances: AjfNodeInstance[]): AjfNodeInstance[] => {\n            let nodes: AjfNodeInstance[];\n            if (\n              formDef != null &&\n              (\n                formDef as {\n                  form: AjfForm | null;\n                  context?: AjfContext;\n                }\n              ).form != null\n            ) {\n              const form = formDef as {\n                form: AjfForm;\n                context: AjfContext;\n              };\n              const baseNodes = form.form.nodes;\n              nodes = this._orderedNodesInstancesTree(\n                flattenNodes(baseNodes),\n                baseNodes,\n                undefined,\n                [],\n                form.context || {},\n              );\n            } else {\n              nodes = [];\n            }\n            // Set the position for each slide\n            let currentPosition = 0;\n            nodes.forEach(node => {\n              if (isRepeatingSlideInstance(node)) {\n                for (let i = 0; i < node.reps; i++) {\n                  if (node.visible) {\n                    currentPosition++;\n                    if (i == 0) {\n                      node.position = currentPosition;\n                    }\n                  }\n                }\n              } else if (isSlideInstance(node)) {\n                if (node.visible) {\n                  currentPosition++;\n                  node.position = currentPosition;\n                }\n              }\n            });\n            return nodes;\n          };\n        }),\n      )\n      .subscribe(this._nodesUpdates);\n  }\n\n  /**\n   * Initialize node instance (visibility, editability...)\n   * and add this into the formgroup.\n   * If it's a container node, call recursively _orderedNodesInstancesTree\n   * @param allNodes all the flatten nodes\n   * @param node the node to be initialised\n   * @param prefix the prefix\n   * @param context the form context\n   * @param branchVisibility the branch visibility\n   * @returns\n   */\n  private _initNodeInstance(\n    allNodes: AjfNode[] | AjfNodeInstance[],\n    node: AjfNode,\n    prefix: number[],\n    context: AjfContext,\n    branchVisibility = true,\n  ): AjfNodeInstance | null {\n    let instance = nodeToNodeInstance(allNodes, node, prefix, context);\n    if (instance == null) {\n      return null;\n    }\n    if (isRepeatingGroupInstance(instance)) {\n      this._explodeRepeatingNode(allNodes, instance, context);\n    } else if (isSlideInstance(instance)) {\n      instance.nodes = this._orderedNodesInstancesTree(\n        allNodes,\n        instance.node.nodes,\n        instance.node.id,\n        prefix,\n        context,\n      );\n    }\n    if (isSlideInstance(instance) || isFieldInstance(instance)) {\n      updateEditability(instance, context);\n    }\n    updateVisibility(instance, context, branchVisibility);\n    updateConditionalBranches(instance, context);\n    if (isFieldInstance(instance)) {\n      if (isFieldWithChoicesInstance(instance)) {\n        updateFilteredChoices(instance, context);\n      } else {\n        if (isTableFieldInstance(instance)) {\n          const {node} = instance;\n          instance.context = context[nodeInstanceCompleteName(instance)] || context;\n          const formGroup = this._formGroup.getValue();\n          let controlsWithLabels: [string, (string | AjfTableFormControl)[]][] = [];\n          controlsWithLabels.push([node.label, node.columnLabels]);\n          if (formGroup != null) {\n            const rowsNum = node.rows.length;\n            for (let rowIdx = 0; rowIdx < rowsNum; rowIdx++) {\n              const row = node.rows[rowIdx];\n              let r: AjfTableFormControl[] = [];\n              const cellNum = row.length;\n              for (let idx = 0; idx < cellNum; idx++) {\n                let cell = row[idx];\n                if (typeof cell === 'string') {\n                  cell = {formula: cell};\n                }\n                /*\n                every control is registered with the cell position\n                inside the form control matrix\n                with this mask `${tNode.name}__${rowIdx}__${idx}`\n                */\n                const name = `${node.name}__${rowIdx}__${idx}`;\n                const type = (node.columnTypes && node.columnTypes[idx]) || 'number';\n                const tableFormControl: AjfTableFormControl = {\n                  control: new UntypedFormControl(),\n                  show: false,\n                  type,\n                };\n                const value =\n                  instance.context[cell.formula] && type === 'number'\n                    ? +instance.context[cell.formula]\n                    : instance.context[cell.formula];\n                tableFormControl.control.setValue(value);\n                formGroup.registerControl(name, tableFormControl.control);\n                r.push(tableFormControl);\n                /* create a object that respect the instance interface\n                with the minimum defined properties to allow to run addToNodeFormula map*/\n                const fakeInstance = {\n                  formula: {formula: cell.formula},\n                  node: {name, nodeType: 0, editable: false},\n                  visible: true,\n                  prefix: [],\n                  conditionalBranches: [],\n                  updatedEvt: new EventEmitter<void>(),\n                } as unknown as AjfNodeInstance;\n                this._addToNodesFormulaMap(fakeInstance, cell.formula);\n              }\n              controlsWithLabels.push([node.rowLabels[rowIdx], r]);\n            }\n            instance.controls = controlsWithLabels;\n          }\n        } else {\n          instance.value = context[nodeInstanceCompleteName(instance)];\n        }\n      }\n      updateFieldInstanceState(instance, context);\n    }\n    this._addNodeInstance(instance);\n    return instance;\n  }\n\n  /**\n   * Adjust rep slide when add or remove one's\n   * @param allNodes All nodes of the form\n   * @param instance All the existing instance reps\n   * @param oldReps The number of initial reps\n   * @param context The form context\n   * @param idxToRemove The index of the slide to be removed (optional, default to last)\n   * @returns\n   */\n  private _adjustReps(\n    allNodes: AjfNode[] | AjfNodeInstance[],\n    instance: AjfRepeatingContainerNodeInstance,\n    oldReps: number,\n    context: AjfContext,\n    idxToRemove?: number,\n  ): {added: AjfNodeInstance[] | null; removed: AjfNodeInstance[] | null} {\n    const newReps = instance.reps;\n    const result: {\n      added: AjfNodeInstance[] | null;\n      removed: AjfNodeInstance[] | null;\n    } = {\n      added: null,\n      removed: null,\n    };\n    if (oldReps < newReps) {\n      const newNodes: AjfNodeInstance[] = [];\n      if (instance.nodes == null) {\n        instance.nodes = [];\n      }\n      if (instance.node.nodeType === AjfNodeType.AjfNodeGroup) {\n        const node = createField({\n          id: 999,\n          name: '',\n          parent: -1,\n          fieldType: AjfFieldType.Empty,\n          label: instance.node.label,\n        });\n        const newInstance = this._initNodeInstance(\n          allNodes,\n          node,\n          instance.prefix.slice(0),\n          context,\n        );\n        if (newInstance != null) {\n          instance.nodes.push(newInstance);\n        }\n      }\n      for (let i = oldReps; i < newReps; i++) {\n        const prefix = instance.prefix.slice(0);\n        const group = instance.node;\n        prefix.push(i);\n        const orderedListNodes = orderedNodes(group.nodes, instance.node.id);\n        orderedListNodes.forEach(n => {\n          const newInstance = this._initNodeInstance(allNodes, n, prefix, context);\n          if (newInstance != null) {\n            newNodes.push(newInstance);\n            instance.nodes.push(newInstance);\n          }\n        });\n        this._addNodeInstance(instance);\n      }\n      result.added = newNodes;\n    } else if (oldReps > newReps) {\n      let nodesNum = instance.nodes.length / oldReps;\n      if (instance.node.nodeType === AjfNodeType.AjfNodeGroup) {\n        nodesNum++;\n      }\n\n      result.removed = instance.nodes.splice(newReps * nodesNum, nodesNum);\n      const idxSlideToRemove = idxToRemove ?? newReps;\n      result.removed.forEach(n => {\n        this._removeNodeInstance(n, idxSlideToRemove);\n      });\n    }\n    if (oldReps != newReps && instance.formulaReps == null) {\n      const fg = this._formGroup.getValue();\n      const completeName = nodeInstanceCompleteName(instance);\n      if (fg != null && fg.contains(completeName)) {\n        fg.controls[completeName].setValue(instance.reps);\n      }\n    }\n    instance.flatNodes = flattenNodesInstances(instance.nodes);\n    if (isRepeatingSlideInstance(instance)) {\n      const slideNodes: AjfNodeInstance[][] = [];\n      const nodesPerSlide = instance.nodes != null ? instance.nodes.length / instance.reps : 0;\n      for (let i = 0; i < instance.reps; i++) {\n        const startNode = i * nodesPerSlide;\n        slideNodes.push(instance.nodes.slice(startNode, startNode + nodesPerSlide));\n      }\n      instance.slideNodes = slideNodes;\n    }\n    return result;\n  }\n\n  private _updateFormValueAndValidity(): void {\n    this._nodesUpdates\n      .pipe(\n        withLatestFrom(this._formGroup),\n        filter(([_, fg]) => fg !== null),\n      )\n      .subscribe(([_, fg]) => {\n        const form = fg as UntypedFormGroup;\n        form.updateValueAndValidity();\n      });\n  }\n\n  private _explodeRepeatingNode(\n    allNodes: AjfNode[] | AjfNodeInstance[],\n    instance: AjfNodeGroupInstance | AjfRepeatingSlideInstance,\n    context: AjfContext,\n  ) {\n    const oldReps = updateRepsNum(instance, context);\n    if (oldReps !== instance.reps) {\n      this._adjustReps(allNodes, instance, oldReps, context);\n    }\n  }\n\n  /**\n   * Init and return all form nodes instances.\n   * Add the nodes into the formgroup with _initNodeInstance.\n   * Start the valueChanges for the formgroup.\n   * @param allNodes all flatten nodes di base nodes\n   * @param nodes base nodes\n   * @param parent start with undefined\n   * @param prefix\n   * @param context the form data context\n   * @returns\n   */\n  private _orderedNodesInstancesTree(\n    allNodes: AjfNode[] | AjfNodeInstance[],\n    nodes: AjfNode[],\n    parent: number | null = null,\n    prefix: number[] = [],\n    context: AjfContext,\n  ): AjfNodeInstance[] {\n    let nodesInstances: AjfNodeInstance[] = [];\n    const curSuffix = prefix.length > 0 ? '__' + prefix.join('__') : '';\n    orderedNodes(nodes, parent).forEach((node: AjfNode) => {\n      const parentNodeInstance = nodesInstances.find(\n        ni => ni.node.id == node.parent && nodeInstanceSuffix(ni) == curSuffix,\n      );\n      const branchVisibility =\n        parentNodeInstance != null\n          ? parentNodeInstance.verifiedBranch != null &&\n            parentNodeInstance.verifiedBranch == node.parentNode\n          : true;\n      const nni = this._initNodeInstance(allNodes, node, prefix, context, branchVisibility);\n      if (nni != null) {\n        nodesInstances.push(nni);\n      }\n    });\n    return nodesInstances;\n  }\n\n  private _formValueDelta(oldValue: any, newValue: any): string[] {\n    const allKeys = [] as string[];\n    [...Object.keys(oldValue), ...Object.keys(newValue)].forEach(key => {\n      if (key !== '$value' && allKeys.indexOf(key) === -1) {\n        allKeys.push(key);\n      }\n    });\n    return allKeys.filter(k => oldValue[k] !== newValue[k]);\n  }\n\n  /**\n   * Init the formGroup valueChanges stream, that re-render the form on valueChanges\n   * @param formGroup an initial empty Form Group\n   * @returns The new FormGroup\n   */\n  private _initFormGroupStreams(formGroup: UntypedFormGroup): UntypedFormGroup {\n    this._formGroupSubscription.unsubscribe();\n    let init = true;\n    let initForm = true;\n    this._formInitEvent.emit(AjfFormInitStatus.Initializing);\n    this._formGroupSubscription = formGroup.valueChanges\n      .pipe(\n        startWith({}),\n        pairwise(),\n        withLatestFrom(\n          this._nodesMaps[0],\n          this._nodesMaps[1],\n          this._nodesMaps[2],\n          this._nodesMaps[3],\n          this._nodesMaps[4],\n          this._nodesMaps[5],\n          this._nodesMaps[6],\n          this._nodesMaps[7],\n          this._nodesMaps[8],\n          this._nodesMaps[9],\n          this._flatNodes,\n        ),\n      )\n      .subscribe(v => {\n        const oldFormValue = (init && {}) || v[0][0];\n        init = false;\n        let newFormValue = v[0][1];\n        const editability = v[1];\n        const visibilityMap = v[2];\n        const repetitionMap = v[3];\n        const conditionalBranchesMap = v[4];\n        const formulaMap = v[5];\n        const validationMap = v[6];\n        const warningMap = v[7];\n        const nextSlideConditionsMap = v[8];\n        const filteredChoicesMap = v[9];\n        const triggerConditionsMap = v[10];\n        const nodes = v[11];\n\n        // takes the names of the fields that have changed\n        const delta = this._formValueDelta(oldFormValue, newFormValue);\n        const deltaLen = delta.length;\n        let updatedNodes: AjfNodeInstance[] = [];\n\n        /*\n          for each field update all properties map\n          with the rule \"if fieldname is in map update it\" and\n          push on updateNodes the node instance that wrap field\n        */\n        delta.forEach(fieldName => {\n          updatedNodes = updatedNodes.concat(\n            nodes.filter(n => nodeInstanceCompleteName(n) === fieldName),\n          );\n          if (editability[fieldName] != null) {\n            editability[fieldName].forEach(nodeInstance => {\n              if (isSlideInstance(nodeInstance) || isFieldInstance(nodeInstance)) {\n                updateEditabilityMapEntry(nodeInstance, this._formGroup, newFormValue);\n                if (updatedNodes.indexOf(nodeInstance) === -1) {\n                  updatedNodes.push(nodeInstance);\n                }\n              }\n            });\n          }\n          if (visibilityMap[fieldName] != null) {\n            visibilityMap[fieldName].forEach(nodeInstance => {\n              updateVisibilityMapEntry(nodeInstance, this._formGroup, newFormValue);\n              newFormValue =\n                this._formGroup && this._formGroup.getValue() != null\n                  ? this._formGroup.getValue()?.value\n                  : newFormValue;\n              if (updatedNodes.indexOf(nodeInstance) === -1) {\n                updatedNodes.push(nodeInstance);\n              }\n            });\n          }\n\n          if (repetitionMap[fieldName] != null) {\n            repetitionMap[fieldName].forEach(nodeInstance => {\n              updateRepetitionMapEntry(nodeInstance, newFormValue, nodes, this._adjustReps);\n              if (updatedNodes.indexOf(nodeInstance) === -1) {\n                updatedNodes.push(nodeInstance);\n              }\n            });\n          }\n\n          if (conditionalBranchesMap[fieldName] != null) {\n            conditionalBranchesMap[fieldName].forEach(nodeInstance => {\n              updateConditionalBranchesMapEntry(\n                nodeInstance,\n                newFormValue,\n                nodes,\n                this._showSubtree,\n                this._hideSubtree,\n              );\n              if (updatedNodes.indexOf(nodeInstance) === -1) {\n                updatedNodes.push(nodeInstance);\n              }\n            });\n          }\n\n          if (formulaMap[fieldName] != null) {\n            formulaMap[fieldName].forEach(nodeInstance => {\n              updateFormulaMapEntry(nodeInstance, newFormValue, this._formGroup);\n              newFormValue =\n                this._formGroup && this._formGroup.getValue() != null\n                  ? this._formGroup.getValue()?.value\n                  : newFormValue;\n              if (updatedNodes.indexOf(nodeInstance) === -1) {\n                updatedNodes.push(nodeInstance);\n              }\n            });\n          }\n\n          if (validationMap[fieldName] != null) {\n            validationMap[fieldName].forEach(nodeInstance => {\n              updateValidationMapEntry(\n                nodeInstance,\n                newFormValue,\n                this.currentSupplementaryInformations,\n              );\n              if (updatedNodes.indexOf(nodeInstance) === -1) {\n                updatedNodes.push(nodeInstance);\n              }\n            });\n          }\n\n          if (warningMap[fieldName] != null) {\n            warningMap[fieldName].forEach(nodeInstance => {\n              updateWarningMapEntry(nodeInstance, newFormValue);\n              if (updatedNodes.indexOf(nodeInstance) === -1) {\n                updatedNodes.push(nodeInstance);\n              }\n            });\n          }\n\n          if (deltaLen == 1 && nextSlideConditionsMap[fieldName] != null) {\n            if (\n              nextSlideConditionsMap[fieldName].filter(nodeInstance => {\n                if (isFieldInstance(nodeInstance)) {\n                  return updateNextSlideCondition(nodeInstance, newFormValue);\n                }\n                return false;\n              }).length == 1\n            ) {\n              this._nextSlideTrigger.emit();\n            }\n          }\n\n          if (filteredChoicesMap[fieldName] != null) {\n            filteredChoicesMap[fieldName].forEach(nodeInstance => {\n              updateFilteredChoicesMapEntry(nodeInstance, newFormValue);\n              if (updatedNodes.indexOf(nodeInstance) === -1) {\n                updatedNodes.push(nodeInstance);\n              }\n            });\n          }\n\n          if (deltaLen == 1 && triggerConditionsMap[fieldName] != null) {\n            const res = triggerConditionsMap[fieldName].filter(nodeInstance => {\n              if (!isFieldWithChoicesInstance(nodeInstance)) {\n                return false;\n              }\n              return updateTriggerConditions(nodeInstance, newFormValue);\n            });\n            if (res.length == 1 && isFieldWithChoicesInstance(res[0])) {\n              res[0].selectionTrigger.emit();\n            }\n          }\n        });\n        updatedNodes.forEach(n => {\n          const nodeIdx = nodes.indexOf(n);\n          let idx = nodeIdx - 1;\n          // Find and update the validity for the node's slide\n          while (idx >= 0) {\n            const curNode = nodes[idx];\n            if (isSlidesInstance(curNode)) {\n              updateSlideValidity(curNode);\n              curNode.updatedEvt.emit();\n            }\n            idx--;\n          }\n          // Mark for check the AjfFormField\n          n.updatedEvt.emit();\n        });\n        if (initForm) {\n          initForm = false;\n          this._formInitEvent.emit(AjfFormInitStatus.Complete);\n        }\n        this._valueChanged.next();\n      });\n    return formGroup;\n  }\n\n  private _showSubtree(\n    context: AjfContext,\n    nodes: AjfNodeInstance[],\n    node: AjfNodeInstance,\n    branch?: number,\n  ) {\n    this._updateSubtreeVisibility(context, nodes, node, true, branch);\n  }\n\n  private _hideSubtree(\n    context: AjfContext,\n    nodes: AjfNodeInstance[],\n    node: AjfNodeInstance,\n    branch?: number,\n  ) {\n    this._updateSubtreeVisibility(context, nodes, node, false, branch);\n  }\n\n  private _updateSubtreeVisibility(\n    context: AjfContext,\n    nodes: AjfNodeInstance[],\n    node: AjfNodeInstance,\n    visible: boolean,\n    branch?: number,\n  ) {\n    let subNodes: AjfNodeInstance[];\n    const nodeSuffix = nodeInstanceSuffix(node);\n    if (branch != null) {\n      subNodes = nodes.filter(n => {\n        const suffix = nodeInstanceSuffix(n);\n        return suffix == nodeSuffix && n.node.parent == node.node.id && n.node.parentNode == branch;\n      });\n    } else {\n      subNodes = nodes.filter(n => {\n        const suffix = nodeInstanceSuffix(n);\n        return suffix == nodeSuffix && n.node.parent == node.node.id;\n      });\n    }\n    const isContainer = isContainerNode(node.node);\n    subNodes.forEach(n => {\n      if (\n        !isContainer ||\n        (isContainer && (<AjfNodeGroup>node.node).nodes.find(cn => cn.id == n.node.id) == null)\n      ) {\n        updateVisibility(n, context, visible);\n        if (isFieldInstance(n)) {\n          updateFormula(n, context);\n        }\n        this._updateSubtreeVisibility(context, nodes, n, visible);\n      }\n    });\n  }\n\n  /**\n   * Init stream for the form flat nodes.\n   * Stream starts when _initFormStreams set the _nodesUpdates\n   */\n  private _initNodesStreams(): void {\n    this._nodes = this._nodesUpdates.pipe(\n      scan((nodes: AjfNodeInstance[], op: AjfNodesInstancesOperation) => {\n        return op(nodes);\n      }, []),\n      share(),\n    );\n    this._flatNodesTree = this._nodes.pipe(\n      map(nodes => flattenNodesInstancesTree(nodes)),\n      share(),\n    );\n    this._flatNodes = this._flatNodesTree.pipe(\n      map(slides => {\n        let nodes: AjfNodeInstance[] = [];\n        slides.forEach(s => {\n          nodes.push(s);\n          nodes = nodes.concat(s.flatNodes);\n          updateSlideValidity(s);\n        });\n        return nodes;\n      }),\n      tap(_ => {\n        const formGroup = this._formGroup.getValue();\n        const initializedField = '$nodesInitialised';\n        if (formGroup != null && !formGroup.contains(initializedField)) {\n          const control = new UntypedFormControl();\n          control.setValue(true);\n          formGroup.registerControl(initializedField, control);\n        }\n      }),\n      share(),\n    );\n  }\n\n  /**\n   * Removes a repeated node instance from the form.\n   *\n   * This method removes the node instance at the specified repetition index.\n   * If the removed instance is not the last one, it shifts all subsequent\n   * instances up by one position to keep the sequence contiguous, and then\n   * clears the final (now duplicated) instance.\n   *\n   * It also updates all internal tracking maps (visibility, validation, formulas,\n   * warnings, conditions, etc.) to remove references to the deleted node.\n   *\n   * @param nodeInstance The node instance to remove (always corresponds to the last repetition index).\n   * @param idxToRemove The index of the repeated instance to delete.\n   * @returns The removed node instance.\n   */\n  private _removeNodeInstance(nodeInstance: AjfNodeInstance, idxToRemove: number): AjfNodeInstance {\n    const nodeName = nodeInstanceCompleteName(nodeInstance);\n    const fg = this._formGroup.getValue();\n    if (fg != null) {\n      const curValue = fg.value;\n\n      const maxIdx = nodeInstance.prefix ? nodeInstance.prefix[0] : 30;\n      let newFormValue = {...curValue};\n      const baseNodeName = nodeInstance.node.name;\n      for (let i = idxToRemove; i < maxIdx; i++) {\n        const currInstanceCompleteName = `${baseNodeName}__${i}`;\n        const nextInstanceCompleteName = `${baseNodeName}__${i + 1}`;\n        newFormValue[currInstanceCompleteName] = newFormValue[nextInstanceCompleteName];\n      }\n\n      newFormValue = {...newFormValue, [nodeName]: undefined};\n      fg.patchValue(newFormValue);\n    }\n    this._removeNodesVisibilityMapIndex(nodeName);\n    this._removeNodesRepetitionMapIndex(nodeName);\n    this._removeNodesConditionalBranchMapIndex(nodeName);\n    this._removeNodesFormulaMapIndex(nodeName);\n    this._removeNodesValidationMapIndex(nodeName);\n    this._removeNodesWarningMapIndex(nodeName);\n    this._removeNodesNextSlideConditionsMapIndex(nodeName);\n    this._removeNodesFilteredChoicesMapIndex(nodeName);\n    this._removeNodesTriggerConditionsMapIndex(nodeName);\n    if (isSlidesInstance(nodeInstance)) {\n      this._removeNodesEditabilityMapIndex(nodeName);\n      return this._removeSlideInstance(nodeInstance);\n    } else if (isRepeatingContainerNodeInstance(nodeInstance)) {\n      this._removeNodeGroupInstance(nodeInstance);\n    } else if (isFieldInstance(nodeInstance)) {\n      this._removeFieldInstance(nodeInstance);\n    }\n\n    return nodeInstance;\n  }\n\n  private _removeSlideInstance(slideInstance: AjfBaseSlideInstance): AjfBaseSlideInstance {\n    const slide = slideInstance.node;\n    if (slide.visibility != null) {\n      this._removeFromNodesVisibilityMap(slideInstance, slide.visibility.condition);\n    }\n    slideInstance.conditionalBranches.forEach((conditionalBranch: AjfCondition) => {\n      this._removeFromNodesConditionalBranchMap(slideInstance, conditionalBranch.condition);\n    });\n    return slideInstance;\n  }\n\n  private _removeNodeGroupInstance(\n    nodeGroupInstance: AjfRepeatingContainerNodeInstance,\n  ): AjfRepeatingContainerNodeInstance {\n    const nodeGroup = nodeGroupInstance.node;\n    if (nodeGroup.visibility != null) {\n      this._removeFromNodesVisibilityMap(nodeGroupInstance, nodeGroup.visibility.condition);\n    }\n    if (nodeGroupInstance.formulaReps != null && nodeGroup.formulaReps != null) {\n      this._removeFromNodesRepetitionMap(nodeGroupInstance, nodeGroup.formulaReps.formula);\n    }\n    return nodeGroupInstance;\n  }\n\n  private _removeFieldInstance(fieldInstance: AjfFieldInstance): AjfFieldInstance {\n    const formGroup = this._formGroup.getValue();\n    const fieldInstanceName = nodeInstanceCompleteName(fieldInstance);\n    if (formGroup != null && formGroup.contains(fieldInstanceName)) {\n      formGroup.removeControl(fieldInstanceName);\n    }\n    if (fieldInstance.validation != null) {\n      this._validationNodesMapUpdates.next((vmap: AjfRendererUpdateMap): AjfRendererUpdateMap => {\n        if (vmap[fieldInstanceName] == null) {\n          delete vmap[fieldInstanceName];\n        }\n        return vmap;\n      });\n    }\n\n    if (fieldInstance.readonly != null) {\n      this._removeFromNodesEditabilityMap(fieldInstance, fieldInstance.readonly.condition);\n    }\n\n    if (fieldInstance.visibility != null) {\n      this._removeFromNodesVisibilityMap(fieldInstance, fieldInstance.visibility.condition);\n    }\n\n    fieldInstance.conditionalBranches.forEach((conditionalBranch: AjfCondition) => {\n      this._removeFromNodesConditionalBranchMap(fieldInstance, conditionalBranch.condition);\n    });\n\n    if (fieldInstance.formula) {\n      this._removeFromNodesFormulaMap(fieldInstance, fieldInstance.formula.formula);\n    }\n\n    // TODO: check this, probably is never verified\n    if (isRepeatingContainerNodeInstance(fieldInstance)) {\n      if (fieldInstance.formulaReps != null) {\n        this._removeFromNodesRepetitionMap(fieldInstance, fieldInstance.formulaReps.formula);\n      }\n    }\n\n    if (fieldInstance.validation != null && fieldInstance.validation.conditions != null) {\n      fieldInstance.validation.conditions.forEach(condition => {\n        this._removeFromNodesValidationMap(fieldInstance, condition.condition);\n      });\n    }\n\n    if (fieldInstance.warning != null) {\n      fieldInstance.warning.conditions.forEach(condition => {\n        this._removeFromNodesWarningMap(fieldInstance, condition.condition);\n      });\n    }\n\n    if (fieldInstance.nextSlideCondition != null) {\n      this._removeFromNodesNextSlideConditionsMap(\n        fieldInstance,\n        fieldInstance.nextSlideCondition.condition,\n      );\n    }\n\n    if (isFieldWithChoicesInstance(fieldInstance)) {\n      if (fieldInstance.choicesFilter != null) {\n        this._removeFromNodesFilteredChoicesMap(fieldInstance, fieldInstance.choicesFilter.formula);\n        if (fieldInstance.triggerConditions != null) {\n          fieldInstance.triggerConditions.forEach(condition => {\n            this._removeFromNodesTriggerConditionsMap(fieldInstance, condition.condition);\n          });\n        }\n      }\n    }\n\n    return fieldInstance;\n  }\n\n  private _addNodeInstance(nodeInstance: AjfNodeInstance): AjfNodeInstance {\n    if (isRepeatingContainerNodeInstance(nodeInstance)) {\n      return this._addNodeGroupInstance(nodeInstance);\n    } else if (isSlideInstance(nodeInstance)) {\n      return this._addSlideInstance(nodeInstance);\n    } else if (isFieldInstance(nodeInstance)) {\n      return this._addFieldInstance(nodeInstance);\n    }\n\n    return nodeInstance;\n  }\n\n  /**\n   * Add field instance as control in formGroup\n   * Add field instance in all update maps (NodesEditabilityMap, NodesVisibilityMap, ...)\n   * @param fieldInstance\n   * @returns\n   */\n  private _addFieldInstance(fieldInstance: AjfFieldInstance): AjfFieldInstance {\n    const formGroup = this._formGroup.getValue();\n    const fieldInstanceName = nodeInstanceCompleteName(fieldInstance);\n    if (formGroup != null && !formGroup.contains(fieldInstanceName)) {\n      const control = new UntypedFormControl();\n      control.setValue(fieldInstance.value);\n      formGroup.registerControl(fieldInstanceName, control);\n    }\n    if (fieldInstance.validation != null) {\n      this._validationNodesMapUpdates.next((vmap: AjfRendererUpdateMap): AjfRendererUpdateMap => {\n        if (vmap[fieldInstanceName] == null) {\n          vmap[fieldInstanceName] = [];\n        }\n        if (vmap[fieldInstanceName].indexOf(fieldInstance) == -1) {\n          vmap[fieldInstanceName].push(fieldInstance);\n        }\n        return vmap;\n      });\n    } else {\n      fieldInstance.valid = true;\n    }\n\n    if (fieldInstance.readonly != null) {\n      this._addToNodesEditabilityMap(fieldInstance, fieldInstance.readonly.condition);\n    }\n\n    if (fieldInstance.visibility != null) {\n      this._addToNodesVisibilityMap(fieldInstance, fieldInstance.visibility.condition);\n    }\n\n    fieldInstance.conditionalBranches.forEach((conditionalBranch: AjfCondition) => {\n      this._addToNodesConditionalBranchMap(fieldInstance, conditionalBranch.condition);\n    });\n\n    if (fieldInstance.formula) {\n      this._addToNodesFormulaMap(fieldInstance, fieldInstance.formula.formula);\n    }\n\n    if (isNodeGroupInstance(fieldInstance)) {\n      if (fieldInstance.formulaReps != null) {\n        this._addToNodesRepetitionMap(fieldInstance, fieldInstance.formulaReps.formula);\n      }\n    }\n\n    if (fieldInstance.validation != null && fieldInstance.validation.conditions != null) {\n      fieldInstance.validation.conditions.forEach(condition => {\n        this._addToNodesValidationMap(fieldInstance, condition.condition);\n      });\n    }\n\n    if (fieldInstance.warning != null) {\n      fieldInstance.warning.conditions.forEach(condition => {\n        this._addToNodesWarningMap(fieldInstance, condition.condition);\n      });\n    }\n\n    if (fieldInstance.nextSlideCondition != null) {\n      this._addToNodesNextSlideConditionsMap(\n        fieldInstance,\n        fieldInstance.nextSlideCondition.condition,\n      );\n    }\n\n    if (isFieldWithChoicesInstance(fieldInstance)) {\n      if (fieldInstance.choicesFilter != null) {\n        this._addToNodesFilteredChoicesMap(fieldInstance, fieldInstance.choicesFilter.formula);\n      }\n      if (fieldInstance.triggerConditions != null) {\n        fieldInstance.triggerConditions.forEach((condition: AjfCondition) => {\n          this._addToNodesTriggerConditionsMap(fieldInstance, condition.condition);\n        });\n      }\n    }\n\n    return fieldInstance;\n  }\n\n  /**\n   * Add slide instance in all update maps (NodesEditabilityMap, NodesVisibilityMap, NodesConditionalBranchMap)\n   * @param slideInstance\n   * @returns\n   */\n  private _addSlideInstance(slideInstance: AjfSlideInstance): AjfSlideInstance {\n    const slide = slideInstance.node;\n    if (slide.readonly != null) {\n      this._addToNodesEditabilityMap(slideInstance, slide.readonly.condition);\n    }\n    if (slide.visibility != null) {\n      this._addToNodesVisibilityMap(slideInstance, slide.visibility.condition);\n    }\n    slideInstance.conditionalBranches.forEach((conditionalBranch: AjfCondition) => {\n      this._addToNodesConditionalBranchMap(slideInstance, conditionalBranch.condition);\n    });\n    return slideInstance;\n  }\n\n  /**\n   * Add repeating slide instance in all update maps\n   * @param nodeGroupInstance\n   * @returns\n   */\n  private _addNodeGroupInstance(\n    nodeGroupInstance: AjfRepeatingContainerNodeInstance,\n  ): AjfRepeatingContainerNodeInstance {\n    const nodeGroup = nodeGroupInstance.node;\n    if (nodeGroup.visibility != null) {\n      this._addToNodesVisibilityMap(nodeGroupInstance, nodeGroup.visibility.condition);\n    }\n    nodeGroupInstance.conditionalBranches.forEach((conditionalBranch: AjfCondition) => {\n      this._addToNodesConditionalBranchMap(nodeGroupInstance, conditionalBranch.condition);\n    });\n    if (nodeGroupInstance.formulaReps != null) {\n      if (nodeGroup.formulaReps != null) {\n        this._addToNodesRepetitionMap(nodeGroupInstance, nodeGroup.formulaReps.formula);\n      }\n    } else {\n      let formGroup = this._formGroup.getValue();\n      let nodeGroupInstanceName = nodeInstanceCompleteName(nodeGroupInstance);\n      if (formGroup != null && !formGroup.contains(nodeGroupInstanceName)) {\n        const control = new UntypedFormControl();\n        control.setValue(nodeGroupInstance.reps);\n        formGroup.registerControl(nodeGroupInstanceName, control);\n      }\n    }\n    return nodeGroupInstance;\n  }\n  private _removeNodesEditabilityMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._editabilityNodesMapUpdates, index);\n  }\n  private _removeNodesVisibilityMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._visibilityNodesMapUpdates, index);\n  }\n\n  private _removeNodesRepetitionMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._repetitionNodesMapUpdates, index);\n  }\n\n  private _removeNodesConditionalBranchMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._conditionalBranchNodesMapUpdates, index);\n  }\n\n  private _removeNodesFormulaMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._formulaNodesMapUpdates, index);\n  }\n\n  private _removeNodesValidationMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._validationNodesMapUpdates, index);\n  }\n\n  private _removeNodesWarningMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._warningNodesMapUpdates, index);\n  }\n\n  private _removeNodesFilteredChoicesMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._filteredChoicesNodesMapUpdates, index);\n  }\n\n  private _removeNodesTriggerConditionsMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._triggerConditionsNodesMapUpdates, index);\n  }\n\n  private _removeNodesNextSlideConditionsMapIndex(index: string): void {\n    this._removeNodesMapIndex(this._nextSlideConditionsNodesMapUpdates, index);\n  }\n\n  private _removeNodesMapIndex(nodesMap: Subject<AjfRendererUpdateMapOperation>, index: string) {\n    nodesMap.next((vmap: AjfRendererUpdateMap): AjfRendererUpdateMap => {\n      if (Object.keys(vmap).indexOf(index) > -1) {\n        delete vmap[index];\n      }\n      return vmap;\n    });\n  }\n\n  private _removeFromNodesEditabilityMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._removeFromNodesMap(this._editabilityNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesVisibilityMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._removeFromNodesMap(this._visibilityNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesRepetitionMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._removeFromNodesMap(this._repetitionNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesConditionalBranchMap(\n    nodeInstance: AjfNodeInstance,\n    formula: string,\n  ): void {\n    this._removeFromNodesMap(this._conditionalBranchNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesFormulaMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._removeFromNodesMap(this._formulaNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesValidationMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._removeFromNodesMap(this._validationNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesWarningMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._removeFromNodesMap(this._warningNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesFilteredChoicesMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._removeFromNodesMap(this._filteredChoicesNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesTriggerConditionsMap(\n    nodeInstance: AjfNodeInstance,\n    formula: string,\n  ): void {\n    this._removeFromNodesMap(this._filteredChoicesNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesNextSlideConditionsMap(\n    nodeInstance: AjfNodeInstance,\n    formula: string,\n  ): void {\n    this._removeFromNodesMap(this._nextSlideConditionsNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _removeFromNodesMap(\n    nodesMap: Subject<AjfRendererUpdateMapOperation>,\n    nodeInstance: AjfNodeInstance,\n    formula: string,\n  ): void {\n    const names = getArgumentNames(formula);\n    names.delete('$value');\n    if (names.size > 0) {\n      nodesMap.next((vmap: AjfRendererUpdateMap): AjfRendererUpdateMap => {\n        for (const name of names) {\n          if (vmap[name] != null) {\n            const idx = vmap[name].indexOf(nodeInstance);\n            if (idx > -1) {\n              vmap[name].splice(idx, 1);\n              if (vmap[name].length == 0) {\n                delete vmap[name];\n              }\n            }\n          }\n        }\n        return vmap;\n      });\n    }\n  }\n\n  private _addToNodesEditabilityMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._editabilityNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesVisibilityMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._visibilityNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesRepetitionMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._repetitionNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesConditionalBranchMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._conditionalBranchNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesFormulaMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._formulaNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesValidationMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._validationNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesWarningMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._warningNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesFilteredChoicesMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._filteredChoicesNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesTriggerConditionsMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._triggerConditionsNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesNextSlideConditionsMap(nodeInstance: AjfNodeInstance, formula: string): void {\n    this._addToNodesMap(this._nextSlideConditionsNodesMapUpdates, nodeInstance, formula);\n  }\n\n  private _addToNodesMap(\n    nodesMap: Subject<AjfRendererUpdateMapOperation>,\n    nodeInstance: AjfNodeInstance,\n    formula: string,\n  ): void {\n    const names = getArgumentNames(formula);\n    names.delete('$value');\n    if (names.size > 0) {\n      nodesMap.next((vmap: AjfRendererUpdateMap): AjfRendererUpdateMap => {\n        for (const name of names) {\n          if (vmap[name] == null) {\n            vmap[name] = [];\n          }\n          if (vmap[name].indexOf(nodeInstance) === -1) {\n            vmap[name].push(nodeInstance);\n          }\n        }\n        return vmap;\n      });\n    }\n  }\n}\n\n/**\n * Update editability for a slide or a field if editability is changed.\n * @param nodeInstance\n * @param formGroup\n * @param newFormValue\n */\nconst updateEditabilityMapEntry = (\n  nodeInstance: AjfSlideInstance | AjfFieldInstance,\n  formGroup: BehaviorSubject<UntypedFormGroup | null>,\n  newFormValue: any,\n) => {\n  updateEditability(nodeInstance, newFormValue);\n};\n\n/**\n * Update visibility for a slide or a field if visibility is changed.\n * Set value to null for non-visible field\n * Re-set default value for fields or for child fields for a container node\n * @param nodeInstance\n * @param formGroup\n * @param newFormValue\n */\nconst updateVisibilityMapEntry = (\n  nodeInstance: AjfNodeInstance,\n  formGroup: BehaviorSubject<UntypedFormGroup | null>,\n  newFormValue: any,\n) => {\n  const completeName = nodeInstanceCompleteName(nodeInstance);\n  const visibilityChanged = updateVisibility(nodeInstance, newFormValue);\n  const isField = isFieldInstance(nodeInstance);\n  if (visibilityChanged && !nodeInstance.visible) {\n    const fg = formGroup.getValue();\n    if (fg != null) {\n      const s = timer(200).subscribe(() => {\n        if (s && !s.closed) {\n          s.unsubscribe();\n        }\n        if (fg.controls != null && fg.controls[completeName] != null) {\n          fg.controls[completeName].setValue(null);\n        }\n      });\n    }\n    if (isField) {\n      nodeInstance.value = null;\n    }\n  } else if (visibilityChanged && nodeInstance.visible) {\n    const fg = formGroup.getValue();\n    if (isField) {\n      const res = updateFormula(nodeInstance, newFormValue, true);\n      if (fg != null && res.changed && fg.controls != null && fg.controls[completeName] != null) {\n        fg.controls[completeName].setValue(res.value);\n      }\n    } else if (isContainerNodeInstance(nodeInstance)) {\n      nodeInstance.nodes?.forEach(n => {\n        if (isFieldInstance(n)) {\n          if (\n            n.node.defaultValue != null &&\n            fg != null &&\n            fg.controls != null &&\n            fg.controls[n.node.name] != null\n          ) {\n            let subFieldVisibility: boolean = n.visible ? n.visible : false;\n            if (subFieldVisibility) {\n              let subFieldDefaultValue = null;\n              if (n.node.defaultValue.formula != null) {\n                subFieldDefaultValue = evaluateExpression(\n                  n.node.defaultValue.formula,\n                  newFormValue,\n                );\n              } else {\n                subFieldDefaultValue = n.node.defaultValue;\n              }\n              fg.controls[n.node.name].setValue(subFieldDefaultValue);\n            }\n          }\n        }\n      });\n      if (isRepeatingContainerNodeInstance(nodeInstance)) {\n        const s2 = timer(200).subscribe(() => {\n          if (s2 && !s2.closed) {\n            s2.unsubscribe();\n          }\n          if (\n            fg != null &&\n            fg.controls != null &&\n            fg.controls[completeName] != null &&\n            isRepeatingContainerNodeInstance(nodeInstance)\n          ) {\n            fg.controls[completeName].setValue(nodeInstance.reps);\n          }\n        });\n      }\n    }\n  }\n};\n\nconst updateRepetitionMapEntry = (\n  nodeInstance: AjfNodeInstance,\n  newFormValue: any,\n  nodes: AjfNodeInstance[],\n  cb: (\n    allNodes: AjfNode[] | AjfNodeInstance[],\n    instance: AjfRepeatingContainerNodeInstance,\n    oldReps: number,\n    context: AjfContext,\n  ) => {added: AjfNodeInstance[] | null; removed: AjfNodeInstance[] | null},\n) => {\n  if (isRepeatingContainerNodeInstance(nodeInstance)) {\n    const oldReps = updateRepsNum(nodeInstance, newFormValue);\n    if (oldReps !== nodeInstance.reps) {\n      cb(nodes, nodeInstance, oldReps, newFormValue);\n    }\n  }\n};\n\nconst updateConditionalBranchesMapEntry = (\n  nodeInstance: AjfNodeInstance,\n  newFormValue: any,\n  nodes: AjfNodeInstance[],\n  showCb: (\n    context: AjfContext,\n    nodes: AjfNodeInstance[],\n    node: AjfNodeInstance,\n    branch?: number,\n  ) => void,\n  hideCb: (\n    context: AjfContext,\n    nodes: AjfNodeInstance[],\n    node: AjfNodeInstance,\n    branch?: number,\n  ) => void,\n) => {\n  // const branchChanged =\n  // nodeInstance.updateConditionalBranches(newFormValue);\n  updateConditionalBranches(nodeInstance, newFormValue);\n  // if (branchChanged) {\n  const verifiedBranch = nodeInstance.verifiedBranch;\n  nodeInstance.conditionalBranches.forEach((_condition, idx) => {\n    if (idx == verifiedBranch) {\n      showCb(newFormValue, nodes, nodeInstance, idx);\n    } else {\n      hideCb(newFormValue, nodes, nodeInstance, idx);\n    }\n  });\n  // }\n};\n\nconst updateFormulaMapEntry = (\n  nodeInstance: AjfNodeInstance,\n  newFormValue: any,\n  formGroup: BehaviorSubject<UntypedFormGroup | null>,\n) => {\n  if (isFieldInstance(nodeInstance)) {\n    const res = updateFormula(nodeInstance, newFormValue);\n    const fg = formGroup.getValue();\n    if (fg != null && res.changed) {\n      updateValidation(nodeInstance, newFormValue);\n      fg.controls[nodeInstanceCompleteName(nodeInstance)].setValue(res.value);\n    }\n  }\n};\n\nconst updateValidationMapEntry = (nodeInstance: AjfNodeInstance, newFormValue: any, supp: any) => {\n  if (isFieldInstance(nodeInstance)) {\n    newFormValue.$value = newFormValue[nodeInstanceCompleteName(nodeInstance)];\n    updateValidation(nodeInstance, newFormValue, supp);\n  }\n};\n\nconst updateWarningMapEntry = (nodeInstance: AjfNodeInstance, newFormValue: any) => {\n  if (isFieldInstance(nodeInstance)) {\n    updateWarning(nodeInstance, newFormValue);\n    if (\n      nodeInstance.warningResults != null &&\n      nodeInstance.warningResults.filter(warning => warning.result).length > 0\n    ) {\n      nodeInstance.warningTrigger.emit();\n    }\n  }\n};\n\nconst updateFilteredChoicesMapEntry = (nodeInstance: AjfNodeInstance, newFormValue: any) => {\n  if (isFieldWithChoicesInstance(nodeInstance)) {\n    updateFilteredChoices(nodeInstance, newFormValue);\n  }\n};\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {ChangeDetectorRef, Directive, isDevMode, OnDestroy, OnInit} from '@angular/core';\nimport {UntypedFormControl} from '@angular/forms';\nimport {defer, Observable, Subscription} from 'rxjs';\nimport {filter, map, withLatestFrom} from 'rxjs/operators';\n\nimport {AjfFieldWarningAlertResult} from './field-warning-alert-result';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfFieldInstance} from './interface/fields-instances/field-instance';\nimport {AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * It rappresents the base field component, the first overlay of ajfFieldInstance.\n * It keeps a reference to the relative control of the form.\n * It manages the component update in conjunction with the instance update.\n * It manages the warningTrigger of the instance by displaying a confirmation\n * popup when an alert event is triggered.\n * @export\n * @abstract\n * @class AjfBaseFieldComponent\n * @template T\n */\n@Directive()\nexport abstract class AjfBaseFieldComponent<T extends AjfFieldInstance = AjfFieldInstance>\n  implements OnDestroy, OnInit\n{\n  private _instance: T | undefined;\n  get instance(): T | undefined {\n    return this._instance;\n  }\n  set instance(instance: T | undefined) {\n    if (instance !== this._instance) {\n      this._instance = instance;\n      this._setUpInstanceUpdate();\n      this._onInstanceChange();\n    }\n  }\n\n  private _control: Observable<UntypedFormControl | null>;\n  get control(): Observable<UntypedFormControl | null> {\n    return this._control;\n  }\n\n  private _warningTriggerSub: Subscription = Subscription.EMPTY;\n  private _instanceUpdateSub: Subscription = Subscription.EMPTY;\n\n  constructor(\n    protected _changeDetectorRef: ChangeDetectorRef,\n    private _service: AjfFormRendererService,\n    private _warningAlertService: AjfWarningAlertService,\n  ) {\n    this._control = defer(() =>\n      this._service\n        .getControl(this.instance)\n        .pipe(map(ctrl => (ctrl || new UntypedFormControl()) as UntypedFormControl)),\n    ) as Observable<UntypedFormControl | null>;\n  }\n\n  ngOnInit(): void {\n    if (this.instance != null) {\n      this._warningTriggerSub = this.instance.warningTrigger\n        .pipe(\n          withLatestFrom(this.control),\n          filter(([_, ctrl]) => ctrl != null),\n        )\n        .subscribe(([_, ctrl]) => {\n          if (this.instance == null || this.instance.warningResults == null) {\n            return;\n          }\n          const control = ctrl as UntypedFormControl;\n          const s = this._warningAlertService\n            .showWarningAlertPrompt(\n              this.instance.warningResults.filter(w => w.result).map(w => w.warning),\n            )\n            .subscribe({\n              next: (r: AjfFieldWarningAlertResult) => {\n                if (r.result) {\n                  control!.setValue(null);\n                }\n              },\n              error: (_e: any) => {\n                if (s) {\n                  s.unsubscribe();\n                }\n              },\n              complete: () => {\n                if (s) {\n                  s.unsubscribe();\n                }\n              },\n            });\n        });\n    }\n  }\n\n  ngOnDestroy(): void {\n    this._warningTriggerSub.unsubscribe();\n    this._instanceUpdateSub.unsubscribe();\n  }\n  // TODO: why?\n  protected _onInstanceChange(): void {}\n\n  private _setUpInstanceUpdate(): void {\n    this._instanceUpdateSub.unsubscribe();\n    if (this._instance != null) {\n      this._instanceUpdateSub = this._instance.updatedEvt.subscribe(() => {\n        if (this._changeDetectorRef) {\n          try {\n            this._changeDetectorRef.detectChanges();\n          } catch (e) {\n            if (isDevMode()) {\n              console.log(e);\n            }\n          }\n        }\n      });\n    } else {\n      this._instanceUpdateSub = Subscription.EMPTY;\n    }\n    this._changeDetectorRef.detectChanges();\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseFieldComponent} from './base-field';\n\n/**\n * @export\n * @abstract\n * @class AjfAudioFieldComponent\n */\nexport abstract class AjfAudioFieldComponent extends AjfBaseFieldComponent {}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * It casts a boolean as number.\n */\n@Pipe({name: 'ajfBoolToInt'})\nexport class AjfBoolToIntPipe implements PipeTransform {\n  transform(value: boolean): number {\n    return value ? 1 : 0;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * It returns a Date.\n * if date is 'today' it return a now Date.\n */\n@Pipe({name: 'ajfDateValue'})\nexport class AjfDateValuePipe implements PipeTransform {\n  transform(date: Date | 'today' | undefined): Date | null {\n    if (date == null) {\n      return null;\n    }\n    return date === 'today' ? new Date() : (date as Date);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Injectable, Pipe, PipeTransform} from '@angular/core';\nimport {format} from 'date-fns';\n\n/**\n * It formats Date with 'yyyy-MM-dd'\n * @param date the date to format\n * @return the format date\n */\n@Injectable()\n@Pipe({name: 'ajfDateValueString'})\nexport class AjfDateValueStringPipe implements PipeTransform {\n  transform(date: Date | 'today' | undefined): string | undefined {\n    if (date == null) {\n      return undefined;\n    }\n    const dateObj = date === 'today' ? new Date() : date;\n    return format(dateObj, 'yyyy-MM-dd');\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfError} from '@ajf/core/models';\n\n/**\n * This class will define an Ajf invalid field definition error\n */\nexport class AjfInvalidFieldDefinitionError extends AjfError {\n  override get name(): string {\n    return 'AjfInvalidFieldDefinitionError';\n  }\n\n  constructor(message?: string) {\n    super(message);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfFieldWithChoicesInstance} from './interface/fields-instances/field-with-choices-instance';\n\n/**\n * It returns true if AjfFieldWithChoices is forceExpanded and filteredChoices length is\n * less than equal threshold.\n */\n@Pipe({name: 'ajfExpandFieldWithChoices'})\nexport class AjfExpandFieldWithChoicesPipe implements PipeTransform {\n  transform(instance: AjfFieldWithChoicesInstance<any>, threshold: number): boolean {\n    return (\n      !instance.node.forceNarrow &&\n      (instance.node.forceExpanded ||\n        (instance.filteredChoices && instance.filteredChoices.length <= threshold))\n    );\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Directive, ViewContainerRef} from '@angular/core';\n\n/**\n * It Applies a viewContainerRef to a component selector.\n */\n// eslint-disable-next-line\n@Directive({selector: '[ajf-field-host]'})\nexport class AjfFieldHost {\n  constructor(readonly viewContainerRef: ViewContainerRef) {}\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n  AfterViewInit,\n  ChangeDetectorRef,\n  Directive,\n  Input,\n  OnDestroy,\n  OnInit,\n  ViewChild,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFieldHost} from './field-host';\nimport {AjfFieldInstance} from './interface/fields-instances/field-instance';\nimport {AjfFieldComponentsMap} from './interface/fields/field-components-map';\nimport {AjfFieldType} from './interface/fields/field-type';\n\n/**\n * It is a base wrapper of every ajfField.\n * It manages what type of component to load(editable component or readonly component)\n * by input instance.\n *\n * @export\n * @abstract\n * @class AjfFormField\n */\n@Directive()\nexport abstract class AjfFormField implements AfterViewInit, OnDestroy, OnInit {\n  @ViewChild(AjfFieldHost) fieldHost!: AjfFieldHost;\n\n  private _instance: AjfFieldInstance | undefined;\n  get instance(): AjfFieldInstance | undefined {\n    return this._instance;\n  }\n  @Input()\n  set instance(instance: AjfFieldInstance | undefined) {\n    if (this._instance !== instance) {\n      this._instance = instance;\n      if (this._instance != null && this._instance.node && !this._instance.node.editable) {\n        this._readonly = true;\n      }\n      if (this._init) {\n        this._loadComponent();\n      }\n    }\n  }\n\n  /**\n   * if true mean that component need to be a readonly component\n   *\n   * @private\n   */\n  private _readonly: boolean = false;\n  get readonly(): boolean {\n    return this._readonly;\n  }\n  @Input()\n  set readonly(readonly: boolean) {\n    this._readonly = coerceBooleanProperty(readonly);\n    if (!this._readonly && this._instance != null && !this._instance.editable) {\n      this._readonly = true;\n    }\n    if (this._init) {\n      this._loadComponent();\n    }\n  }\n\n  private _componentInstance: AjfBaseFieldComponent<AjfFieldInstance> | undefined;\n  private _init: boolean = false;\n\n  protected abstract componentsMap: AjfFieldComponentsMap;\n  private _updatedSub = Subscription.EMPTY;\n\n  constructor(private _cdr: ChangeDetectorRef) {}\n\n  ngAfterViewInit(): void {\n    this._loadComponent();\n  }\n\n  ngOnDestroy(): void {\n    this._updatedSub.unsubscribe();\n  }\n\n  ngOnInit(): void {\n    this._init = true;\n    this._loadComponent();\n  }\n\n  /**\n   * It builds a new AjfField component by fieldType and binds it to the fieldHost.\n   *\n   * @private\n   * @return {*}\n   */\n  private _loadComponent(): void {\n    this._updatedSub.unsubscribe();\n    this._updatedSub = Subscription.EMPTY;\n    if (this._instance == null || this.fieldHost == null) {\n      return;\n    }\n\n    const vcr = this.fieldHost.viewContainerRef;\n    vcr.clear();\n    const componentDef = this.componentsMap[this._instance.node.fieldType];\n    if (componentDef == null) {\n      return;\n    }\n    const component =\n      this._readonly && componentDef.readOnlyComponent\n        ? componentDef.readOnlyComponent\n        : componentDef.component;\n    try {\n      const componentRef = vcr.createComponent(component);\n      this._componentInstance = componentRef.instance;\n      this._componentInstance.instance = this._instance;\n      const componentInstance = this._componentInstance as any;\n\n      if (componentDef.inputs) {\n        Object.keys(componentDef.inputs).forEach(key => {\n          if (key in componentInstance) {\n            componentInstance[key] = componentDef.inputs![key];\n          }\n        });\n      }\n      this._instance.updatedEvt.subscribe(() => {\n        this._cdr.markForCheck();\n        if (\n          this._instance &&\n          this._instance.node.fieldType !== AjfFieldType.Formula &&\n          this._instance.editable != null &&\n          this.readonly !== !this._instance.editable\n        ) {\n          this.readonly = !this._instance.editable;\n        }\n      });\n    } catch (e) {\n      console.log(e);\n    }\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldType} from './interface/fields/field-type';\n\n/**\n *\n * @return a string that indetified the icon relative to type\n * ex. ajf-icon-field-string, ajf-icon-field-number, ajf-icon-field-text ecc.\n */\nexport function fieldIconName(type: AjfFieldType): string {\n  return `ajf-icon-field-${\n    typeof AjfFieldType[type] === 'string' ? AjfFieldType[type].toLowerCase() : type\n  }`;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {fieldIconName} from './field-utils';\nimport {AjfField} from './interface/fields/field';\nimport {AjfFieldType} from './interface/fields/field-type';\n\n/**\n *\n *\n * @param Field.\n *\n * @return An icon class name relative to the AjfType.\n */\n@Pipe({name: 'ajfFieldIcon'})\nexport class AjfFieldIconPipe implements PipeTransform {\n  transform(field: AjfField | AjfFieldType): string {\n    return fieldIconName(typeof field === 'number' ? field : field.fieldType);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfValidationResult} from './interface/validation/validation-results';\n\n/**\n * It returns true if all validationResults are true.\n *\n */\n@Pipe({name: 'ajfFieldIsValid'})\nexport class AjfFieldIsValidPipe implements PipeTransform {\n  transform(validationResults?: AjfValidationResult[]): boolean {\n    return validationResults != null && validationResults.filter(f => !f.result).length === 0;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\nimport {Type} from '@angular/core';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFieldInstance} from './interface/fields-instances/field-instance';\nimport {AjfFieldComponentsMap} from './interface/fields/field-components-map';\nimport {AjfFieldInstanceCreate} from './utils/fields-instances/create-field-instance';\nimport {componentsMap} from './utils/fields/fields-map';\n\nexport abstract class AjfFieldService {\n  readonly componentsMap: AjfFieldComponentsMap = componentsMap;\n\n  /**\n   * It allows to register custom fields inside an Ajf form.\n   * @param fieldType is the field type of the custom field. Values from 0 to 100 are reserved to\n   *     Ajf.\n   * @param component It is the custom component that implement an AjfBaseFieldComponent.\n   * @param readOnlyComponent It is the readonly custom component that implement an\n   *     AjfBaseFieldComponent.\n   * @createInstance The signature and return type of the method used for create Instance.\n   * @isFieldWithChoice If true, the field has choices.\n   */\n  registerCustomField(field: {\n    fieldType: number;\n    component: Type<AjfBaseFieldComponent>;\n    readOnlyComponent?: Type<AjfBaseFieldComponent>;\n    createInstance?: (instance: AjfFieldInstanceCreate, context: AjfContext) => AjfFieldInstance;\n    isFieldWithChoice?: boolean;\n  }): void {\n    const {fieldType, component} = field;\n    if (fieldType < 100) {\n      throw new Error('Invalid custom field type, it must be greater than 100');\n    }\n    if (component == null) {\n      throw new Error('Invalid custom field component');\n    }\n    this.componentsMap[fieldType] = field;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/**\n * It is used in AjfBaseFieldComponent, is a partial of AjfWarningResult.\n * It rappresents the result of warning condition.\n *\n * @export\n * @interface AjfFieldWarningAlertResult\n */\n// TODO why not use AjfWarningResult?\nexport interface AjfFieldWarningAlertResult {\n  result: boolean;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {ChangeDetectorRef} from '@angular/core';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfFieldWithChoicesInstance} from './interface/fields-instances/field-with-choices-instance';\nimport {AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * It rappresents the base componet for every ajf fields with choiches.\n *\n * @export\n * @abstract\n * @class AjfFieldWithChoicesComponent\n * @template T\n */\nexport abstract class AjfFieldWithChoicesComponent<T> extends AjfBaseFieldComponent<\n  AjfFieldWithChoicesInstance<T>\n> {\n  private _searchThreshold: number = 6;\n\n  /**\n   * It represents the threshold below which the choices are displayed\n   * in expanded mode.\n   *\n   * @readonly\n   */\n  get searchThreshold(): number {\n    return this._searchThreshold;\n  }\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    warningAlertService: AjfWarningAlertService,\n    searchThreshold: number,\n  ) {\n    super(cdr, service, warningAlertService);\n    if (searchThreshold != null) {\n      this._searchThreshold = searchThreshold;\n    }\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {AjfFieldWarningAlertResult} from './field-warning-alert-result';\n\nexport interface AjfWarningAlertService {\n  showWarningAlertPrompt(warnings: string[]): Observable<AjfFieldWarningAlertResult>;\n}\n\nexport const AJF_WARNING_ALERT_SERVICE = new InjectionToken<AjfWarningAlertService>(\n  'ajf-warning-alert-service',\n);\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * It allows the loading of files inside an AjfForm through an AjfFileInput.\n *\n * @export\n * @class AjfFileFieldComponent\n */\n@Component({\n  selector: 'ajf-file-field',\n  templateUrl: 'file-field.html',\n  styleUrls: ['file-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfFileFieldComponent extends AjfBaseFieldComponent {\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n  ) {\n    super(cdr, service, was);\n  }\n}\n","<ajf-file-input *ngIf=\"control|async as ctrl\" [formControl]=\"ctrl!\"></ajf-file-input>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfPageSlider, AjfPageSliderOrientation} from '@ajf/core/page-slider';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n  AfterViewChecked,\n  AfterViewInit,\n  ChangeDetectorRef,\n  Directive,\n  EventEmitter,\n  Input,\n  OnDestroy,\n  Output,\n  QueryList,\n  ViewChild,\n  ViewChildren,\n} from '@angular/core';\nimport {UntypedFormGroup} from '@angular/forms';\nimport {Observable, Subscription} from 'rxjs';\nimport {delayWhen, map, startWith, withLatestFrom} from 'rxjs/operators';\n\nimport {AjfFormField} from './field';\nimport {AjfFormInitStatus, AjfFormRendererService} from './form-renderer';\n\nimport {AjfFieldType} from './interface/fields/field-type';\nimport {AjfForm} from './interface/forms/form';\nimport {AjfNodeGroupInstance} from './interface/nodes-instances/node-group-instance';\nimport {AjfNodeInstance} from './interface/nodes-instances/node-instance';\nimport {AjfRepeatingSlideInstance} from './interface/slides-instances/repeating-slide-instance';\nimport {AjfSlideInstance} from './interface/slides-instances/slide-instance';\nimport {isRepeatingSlideInstance} from './utils/nodes-instances/is-repeating-slide-instance';\nimport {nodeInstanceCompleteName} from './utils/nodes-instances/node-instance-complete-name';\n\nexport interface AjfFormActionEvent {\n  source: AjfFormRenderer;\n  value: Object;\n  action: string;\n}\n\n@Directive()\nexport abstract class AjfFormRenderer implements AfterViewChecked, AfterViewInit, OnDestroy {\n  /**\n   * formGroup is an Observable FormGroup type\n   */\n  readonly formGroup: Observable<UntypedFormGroup | null>;\n\n  /**\n   * slides is an observable AjfSlide array type\n   */\n  readonly slides: Observable<AjfSlideInstance[]>;\n\n  readonly slidesNum: Observable<number>;\n  readonly errors: Observable<number>;\n  readonly formIsInit: Observable<boolean>;\n\n  /**\n   * The available ajf field types.\n   */\n  readonly ajfFieldTypes = AjfFieldType;\n\n  @Input() title: string = '';\n\n  private _orientationChange: EventEmitter<AjfPageSliderOrientation> =\n    new EventEmitter<AjfPageSliderOrientation>();\n  @Output()\n  readonly orientationChange: Observable<AjfPageSliderOrientation> = this\n    ._orientationChange as Observable<AjfPageSliderOrientation>;\n\n  private _saveDisabled: boolean = false;\n  get saveDisabled(): boolean {\n    return this._saveDisabled;\n  }\n  @Input()\n  set saveDisabled(saveDisabled: boolean) {\n    this._saveDisabled = coerceBooleanProperty(saveDisabled);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _hasStartMessage = false;\n  get hasStartMessage(): boolean {\n    return this._hasStartMessage;\n  }\n  @Input()\n  set hasStartMessage(hasStartMessage: boolean) {\n    this._hasStartMessage = coerceBooleanProperty(hasStartMessage);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _hasEndMessage = false;\n  get hasEndMessage(): boolean {\n    return this._hasEndMessage;\n  }\n  @Input()\n  set hasEndMessage(hasEndMessage: boolean) {\n    this._hasEndMessage = coerceBooleanProperty(hasEndMessage);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _hideTopToolbar = false;\n  get hideTopToolbar(): boolean {\n    return this._hideTopToolbar;\n  }\n  @Input()\n  set hideTopToolbar(hideTopToolbar: boolean) {\n    this._hideTopToolbar = coerceBooleanProperty(hideTopToolbar);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _hideBottomToolbar = false;\n  get hideBottompToolbar(): boolean {\n    return this._hideBottomToolbar;\n  }\n  @Input()\n  set hideBottomToolbar(hideBottomToolbar: boolean) {\n    this._hideBottomToolbar = coerceBooleanProperty(hideBottomToolbar);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _hideNavigationButtons = false;\n  get hideNavigationButtons(): boolean {\n    return this._hideNavigationButtons;\n  }\n  @Input()\n  set hideNavigationButtons(hideNavigationButtons: boolean) {\n    this._hideNavigationButtons = coerceBooleanProperty(hideNavigationButtons);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _fixedOrientation = false;\n  get fixedOrientation(): boolean {\n    return this._fixedOrientation;\n  }\n  @Input()\n  set fixedOrientation(fixedOrientation: boolean) {\n    this._fixedOrientation = coerceBooleanProperty(fixedOrientation);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _readonly = false;\n  get readonly(): boolean {\n    return this._readonly;\n  }\n  @Input()\n  set readonly(readonly: boolean) {\n    this._readonly = coerceBooleanProperty(readonly);\n    this._changeDetectorRef.markForCheck();\n  }\n\n  private _orientation: AjfPageSliderOrientation = 'horizontal';\n  get orientation(): AjfPageSliderOrientation {\n    return this._orientation;\n  }\n  @Input()\n  set orientation(orientation: AjfPageSliderOrientation) {\n    if (orientation !== 'horizontal' && orientation !== 'vertical') {\n      return;\n    }\n    if (orientation !== this._orientation) {\n      this._orientation = orientation;\n      this._changeDetectorRef.markForCheck();\n      this._orientationChange.emit(this._orientation);\n    }\n  }\n\n  @ViewChild('formSlider', {static: false}) formSlider!: AjfPageSlider;\n  @ViewChildren(AjfFormField) fields!: QueryList<AjfFormField>;\n\n  private _errorMoveEvent: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n  /**\n   * Is a private subject structure that contains next and prev\n   */\n  private _errorPositions: Observable<number[]>;\n\n  /**\n   * is a private AjfForm\n   */\n  private _form: AjfForm | undefined;\n\n  private _init = false;\n\n  private _nextSlideSubscription: Subscription = Subscription.EMPTY;\n  private _errorMoveSubscription: Subscription = Subscription.EMPTY;\n\n  private _formAction: EventEmitter<AjfFormActionEvent> = new EventEmitter<AjfFormActionEvent>();\n  @Output()\n  readonly formAction: Observable<AjfFormActionEvent> = this\n    ._formAction as Observable<AjfFormActionEvent>;\n\n  @Input()\n  set form(form: AjfForm) {\n    this._form = form;\n\n    if (this._init) {\n      this._rendererService.setForm(this._form);\n    }\n  }\n\n  /**\n   * this constructor will init current formula by ajfBuilderService\n   */\n  constructor(\n    private _rendererService: AjfFormRendererService,\n    protected _changeDetectorRef: ChangeDetectorRef,\n  ) {\n    this.formGroup = _rendererService.formGroup;\n    this.slides = _rendererService.nodesTree;\n    this._errorPositions = _rendererService.errorPositions;\n    this.errors = _rendererService.errors;\n    this.slidesNum = _rendererService.slidesNum;\n    this.formIsInit = _rendererService.formInitEvent.pipe(\n      map(e => e === AjfFormInitStatus.Complete),\n    );\n  }\n\n  /**\n   * this method will scroll to next error received by subscribe\n   */\n  goToNextError(): void {\n    this._errorMoveEvent.emit(true);\n  }\n  /**\n   * this method will scroll to prev error received by subscribe\n   */\n  goToPrevError(): void {\n    this._errorMoveEvent.emit(false);\n  }\n\n  /**\n   * this method will add group\n   */\n  addGroup(nodeGroup: AjfNodeGroupInstance | AjfSlideInstance | AjfRepeatingSlideInstance): void {\n    let s = this._rendererService\n      .addGroup(nodeGroup as AjfNodeGroupInstance)\n      .pipe(delayWhen(() => this.formSlider.pageScrollFinish))\n      .subscribe({\n        next: r => {\n          if (r && this.formSlider != null) {\n            this.formSlider.slide({dir: 'down'});\n          }\n        },\n        error: _e => {\n          if (s) {\n            s.unsubscribe();\n          }\n        },\n        complete: () => {\n          if (s) {\n            s.unsubscribe();\n          }\n        },\n      });\n  }\n\n  /**\n   * this method will remove group\n   */\n  removeGroup(\n    nodeGroup: AjfNodeGroupInstance | AjfSlideInstance | AjfRepeatingSlideInstance,\n    idx?: number\n  ): void {\n    let s = this._rendererService\n      .removeGroup(nodeGroup as AjfNodeGroupInstance, idx)\n      .pipe(delayWhen(() => this.formSlider.pageScrollFinish))\n      .subscribe({\n        next: r => {\n          if (r && this.formSlider != null) {\n            this.formSlider.slide({dir: 'up'});\n          }\n        },\n        error: _e => {\n          if (s) {\n            s.unsubscribe();\n          }\n        },\n        complete: () => {\n          if (s) {\n            s.unsubscribe();\n          }\n        },\n      });\n  }\n\n  onSave(_evt: any): void {\n    this._formAction.emit({\n      source: this,\n      action: 'save',\n      value: this._rendererService.getFormValue(),\n    });\n  }\n\n  onFormAction(_evt: any, action: string) {\n    this._formAction.emit({\n      source: this,\n      value: this._rendererService.getFormValue(),\n      action: action,\n    });\n  }\n\n  /**\n   * this method will set current form in rederer service when init form\n   */\n  ngAfterViewInit(): void {\n    if (this._form != null) {\n      this._rendererService.setForm(this._form);\n      this._changeDetectorRef.detectChanges();\n    }\n  }\n\n  ngAfterViewChecked(): void {\n    if (!this._init && this.formSlider != null) {\n      this._init = true;\n\n      this._errorMoveSubscription = (<Observable<boolean>>this._errorMoveEvent)\n        .pipe(withLatestFrom(this._errorPositions))\n        .subscribe(([move, errs]) => {\n          const currentPosition = this.formSlider.currentPage - +this.hasStartMessage + 1;\n          if (errs == null) {\n            return;\n          }\n          const errors = errs as number[];\n\n          let found = false;\n          let prevIdx = -1;\n          let nextIdx = -1;\n          let idx = 0;\n          let errorsLen = errors.length;\n          while (!found && idx < errorsLen) {\n            if (errors[idx] == currentPosition) {\n              found = true;\n              prevIdx = idx > 0 ? idx - 1 : errorsLen - 1;\n              nextIdx = idx < errorsLen - 1 ? idx + 1 : 0;\n            } else if (errors[idx] > currentPosition) {\n              found = true;\n              prevIdx = idx > 0 ? idx - 1 : errorsLen - 1;\n              nextIdx = idx;\n            }\n            idx++;\n          }\n          if (!found) {\n            prevIdx = errorsLen - 1;\n            nextIdx = 0;\n          }\n\n          this.formSlider.slide({\n            to: move ? errors[nextIdx] - 1 : errors[prevIdx] - 1,\n          });\n          this._changeDetectorRef.detectChanges();\n        });\n    }\n  }\n\n  ngOnDestroy(): void {\n    this._nextSlideSubscription.unsubscribe();\n    this._errorMoveSubscription.unsubscribe();\n    this._orientationChange.complete();\n    this._errorMoveEvent.complete();\n    this._formAction.complete();\n  }\n\n  scrollToSlide(slide: AjfSlideInstance): void {\n    let scrollToPos = slide.position - 1;\n    if (isRepeatingSlideInstance(slide)) {\n      scrollToPos = scrollToPos - 1 + (slide as AjfRepeatingSlideInstance).reps;\n    }\n    this.formSlider.slide({to: scrollToPos});\n  }\n\n  /**\n   * Return a repeating slide repetition index (eg. 2/5)\n   * @param slide The repeating slide\n   * @param currentPage The formslider current page number\n   * @returns The rep slide index string\n   */\n  getRepeatingSlideRepIndex(\n    slide: AjfSlideInstance,\n    currentPage: number,\n  ): Observable<string | null> {\n    return this.formSlider.pageScrollFinish.pipe(\n      startWith(null),\n      map(() => {\n        if (isRepeatingSlideInstance(slide)) {\n          const repSlide = slide as AjfRepeatingSlideInstance;\n          const repsTotal = repSlide.reps;\n          let currentRep = repsTotal;\n          if (currentPage + 1 >= slide.position && currentPage + 1 < slide.position + repsTotal) {\n            currentRep = currentPage + 2 - slide.position;\n          }\n          return `(${currentRep}/${repsTotal})`;\n        }\n        return null;\n      }),\n    );\n  }\n\n  /**\n   * True if the slide toggle should be checked\n   * @param slide The repeating slide\n   * @param currentPage The formslider current page number\n   * @returns The checked state\n   */\n  isSlideToggleChecked(slide: AjfSlideInstance, currentPage: number): boolean {\n    let isChecked = slide.position === currentPage + 1;\n    if (isRepeatingSlideInstance(slide)) {\n      const repSlide = slide as AjfRepeatingSlideInstance;\n      isChecked =\n        currentPage + 1 >= repSlide.position && repSlide.position + repSlide.reps > currentPage + 1;\n    }\n\n    return isChecked;\n  }\n\n  orientationChangeHandler(orientation: AjfPageSliderOrientation): void {\n    this.orientation = orientation;\n  }\n\n  trackNodeById(_: number, node: AjfNodeInstance): string {\n    return nodeInstanceCompleteName(node);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfMultipleChoiceField} from '../../interface/fields/multiple-choice-field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\n\n/**\n * It is true if the field type is a MultipleChoice.\n */\nexport function isMultipleChoiceField<T = any>(\n  field: AjfField,\n): field is AjfMultipleChoiceField<T> {\n  return field.fieldType === AjfFieldType.MultipleChoice;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfSingleChoiceField} from '../../interface/fields/single-choice-field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\n\n/**\n * It is true if the field type is a SingleChoice.\n */\nexport function isSingleChoiceField<T = any>(field: AjfField): field is AjfSingleChoiceField<T> {\n  return field.fieldType === AjfFieldType.SingleChoice;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {\n  AjfContext,\n  buildStringIdentifier,\n  buildStringIdentifierOpts,\n  BuildStringIdentifierOpts,\n} from '@ajf/core/common';\n\nimport {AjfFieldWithChoices} from '../../interface/fields/field-with-choices';\nimport {AjfForm} from '../../interface/forms/form';\nimport {isFieldWithChoices} from '../fields/is-field-with-choices';\nimport {isMultipleChoiceField} from '../fields/is-multiple-choice-field';\nimport {isSingleChoiceField} from '../fields/is-single-choice-field';\nimport {flattenNodes} from '../nodes/flatten-nodes';\nimport {isField} from '../nodes/is-field';\n\n/**\n * It builds a string that contains information preview about the form and its context.\n */\nexport const buildFormStringIdentifier = (\n  form: AjfForm,\n  context: AjfContext,\n  opts?: BuildStringIdentifierOpts,\n): string => {\n  if (form == null) {\n    return '';\n  }\n  const stringIdentifier = form.stringIdentifier || [];\n  if (stringIdentifier.length === 0) {\n    return '';\n  }\n  const fields = flattenNodes(form.nodes).filter(\n    n => isField(n) && isFieldWithChoices(n),\n  ) as AjfFieldWithChoices<unknown>[];\n  if (fields.length > 0) {\n    context = {...context};\n    fields.forEach(field => {\n      const value = context[field.name];\n      if (value == null) {\n        return;\n      }\n      if (isSingleChoiceField(field)) {\n        const choice = field.choicesOrigin.choices.find(c => c.value === value);\n        if (choice == null) {\n          return;\n        }\n        context[field.name] = choice.label;\n      } else if (isMultipleChoiceField(field) && Array.isArray(value) && value.length > 0) {\n        const strings = buildStringIdentifierOpts(opts);\n        const choices = field.choicesOrigin.choices.filter(c => value.indexOf(c.value) > -1);\n        context[field.name] = choices.map(c => c.label).join(strings.valuesDivider);\n      }\n    });\n  }\n  return buildStringIdentifier(stringIdentifier, context, opts);\n};\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, BuildStringIdentifierOpts} from '@ajf/core/common';\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfForm} from './interface/forms/form';\nimport {buildFormStringIdentifier} from './utils/forms/build-form-string-identifier';\n\n/**\n * it returns a form string identifier.\n *\n * @export\n * @class AjfFormStringIdentifierPipe\n */\n@Pipe({name: 'ajfFormStringIdentifier'})\nexport class AjfFormStringIdentifierPipe implements PipeTransform {\n  transform(form: AjfForm, context: AjfContext, opts?: BuildStringIdentifierOpts): string {\n    return buildFormStringIdentifier(form, context, opts);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfTableFormControl} from './interface/forms/table-form-control';\n\n/**\n * It filters the type of ctrl.\n * return null or a valid AjfTableFormControl.\n *\n * @export\n * @class AjfGetTableCellControlPipe\n */\n@Pipe({name: 'ajfGetTableCellControl'})\nexport class AjfGetTableCellControlPipe implements PipeTransform {\n  transform(ctrl: null | string | AjfTableFormControl): AjfTableFormControl | null {\n    if (ctrl == null || typeof ctrl === 'string') {\n      return null;\n    }\n    return ctrl as AjfTableFormControl;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFile} from '@ajf/core/file-input';\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\nimport {UntypedFormControl} from '@angular/forms';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\nimport {Observable} from 'rxjs';\nimport {filter, map, shareReplay, startWith, switchMap} from 'rxjs/operators';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * It allows the loading of image url inside an AjfForm.\n *\n * @export\n * @class AjfImageFieldComponent\n */\n@Component({\n  selector: 'ajf-image-field',\n  templateUrl: 'image-field.html',\n  styleUrls: ['image-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfImageFieldComponent extends AjfBaseFieldComponent {\n  readonly imageUrl: Observable<SafeResourceUrl | null>;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n    domSanitizer: DomSanitizer,\n  ) {\n    super(cdr, service, was);\n    const fileStream = this.control.pipe(\n      filter(control => control != null),\n      switchMap(control => {\n        control = control as UntypedFormControl;\n        return control.valueChanges.pipe(startWith(control.value)) as Observable<AjfFile>;\n      }),\n      filter(value => value != null),\n      shareReplay(1),\n    );\n    this.imageUrl = fileStream.pipe(\n      map(file => {\n        if (file.content && file.content.length) {\n          return domSanitizer.bypassSecurityTrustResourceUrl(file.content);\n        } else if (file.url && file.url.length) {\n          return domSanitizer.bypassSecurityTrustResourceUrl(file.url);\n        }\n        return null;\n      }),\n    );\n  }\n}\n","<ajf-file-input *ngIf=\"control|async as ctrl\" accept=\"image/*\" [formControl]=\"ctrl!\">\n  <div ajfFilePreview class=\"ajf-image-preview\">\n    <img [src]=\"imageUrl|async\">\n  </div>\n</ajf-file-input>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * It increments the value parameter by increment offset parameter.\n *\n * @export\n * @class AjfIncrementPipe\n */\n@Pipe({name: 'ajfIncrement'})\nexport class AjfIncrementPipe implements PipeTransform {\n  transform(value: number, increment: number = 1): number {\n    return value + increment;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfTableCell} from './interface/fields/table-field';\n\n/**\n * it checks if the cell parameter is an editable AjfTableCell.\n *\n * @export\n * @class AjfIsCellEditablePipe\n */\n@Pipe({name: 'ajfIsCellEditable'})\nexport class AjfIsCellEditablePipe implements PipeTransform {\n  transform(cell: string | AjfTableCell): boolean {\n    if (cell == null || typeof cell === 'string') {\n      return false;\n    }\n    return cell.editable === true;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfFieldType} from './interface/fields/field-type';\nimport {AjfNodeInstance} from './interface/nodes-instances/node-instance';\nimport {isFieldInstance} from './utils/nodes-instances/is-field-instance';\n\n/**\n * It checks if the AjfNodeInstance parameter is an Formula AjfField.\n *\n * @export\n * @class AjfIsReadonlyInputFieldPipe\n */\n@Pipe({name: 'ajfIsReadonlyInputField'})\nexport class AjfIsReadonlyInputFieldPipe implements PipeTransform {\n  transform(instance: AjfNodeInstance): boolean {\n    return isFieldInstance(instance) && instance.node.fieldType === AjfFieldType.Formula;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {AjfNodeInstance} from './interface/nodes-instances/node-instance';\nimport {isRepeatingSlideInstance} from './utils/nodes-instances/is-repeating-slide-instance';\n\n/**\n * It checks if the AjfNodeInstance parameter is an isRepeatingSlideInstance.\n *\n * @export\n * @class AjfIsRepeatingSlideInstancePipe\n */\n@Pipe({name: 'ajfIsRepeatingSlideInstance'})\nexport class AjfIsRepeatingSlideInstancePipe implements PipeTransform {\n  transform(instance: AjfNodeInstance): boolean {\n    return isRepeatingSlideInstance(instance);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {AjfNodeInstance} from './interface/nodes-instances/node-instance';\nimport {nodeInstanceCompleteName} from './utils/nodes-instances/node-instance-complete-name';\n\n/**\n * It returns a completeName of AjfNodeInstance paramenter.\n *\n * @export\n * @class AjfNodeCompleteNamePipe\n */\n@Pipe({name: 'ajfNodeCompleteName'})\nexport class AjfNodeCompleteNamePipe implements PipeTransform {\n  transform(instance: AjfNodeInstance): string {\n    return instance ? nodeInstanceCompleteName(instance) : '';\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * It returns a array of numbers.\n * The numbers are incremental by step.\n *\n * @export\n * @class AjfRangePipe\n */\n@Pipe({name: 'ajfRange'})\nexport class AjfRangePipe implements PipeTransform {\n  transform(size: number = 0, start: number = 1, step: number = 1): number[] {\n    const range: number[] = [];\n    for (let length = 0; length < size; ++length) {\n      range.push(start);\n      start += step;\n    }\n    return range;\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseFieldComponent} from './base-field';\n\n/**\n * It is an AjfBaseFieldComponent where the type can be only text or number.\n * Type is text by default.\n *\n * @export\n * @abstract\n * @class AjfInputFieldComponent\n */\nexport abstract class AjfInputFieldComponent extends AjfBaseFieldComponent {\n  type: 'text' | 'number' = 'text';\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\n\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfInputFieldComponent as CoreComponent} from './input-field';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * this component show the control value inherited from AjfBaseFieldComponent.\n *\n * @export\n * @class AjfReadOnlyFieldComponent\n */\n@Component({\n  selector: 'ajf-read-only-field',\n  templateUrl: 'read-only-field.html',\n  styleUrls: ['read-only-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlyFieldComponent extends CoreComponent {\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n  ) {\n    super(cdr, service, was);\n  }\n}\n","<span *ngIf=\"control|async as ctrl\">{{ctrl.value}}</span>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\nimport {parse, toDate} from 'date-fns';\nimport {Observable} from 'rxjs';\nimport {filter, map} from 'rxjs/operators';\nimport {AjfInputFieldComponent as CoreComponent} from './input-field';\n\nimport {AjfFormRendererService} from './form-renderer';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\nimport {TranslocoService} from '@ajf/core/transloco';\nimport {DatePipe} from '@angular/common';\n\n/**\n * this component show the control value inherited from AjfBaseFieldComponent.\n *\n * @export\n * @class AjfReadOnlyDateFieldComponent\n */\n@Component({\n  selector: 'ajf-read-date-only-field',\n  templateUrl: 'read-only-date-field.html',\n  styleUrls: ['read-only-date-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlyDateFieldComponent extends CoreComponent {\n  readonly date: Observable<string>;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    private _ts: TranslocoService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n  ) {\n    super(cdr, service, was);\n\n    this.date = this.control.pipe(\n      filter(control => control != null),\n      map(ctrl => {\n        if (ctrl) {\n          this.formatDateField(ctrl.value);\n        }\n        return '';\n      }),\n    );\n  }\n\n  formatDateField(val: any): string {\n    if (val == null) {\n      return '';\n    }\n    let dt = null;\n    if (typeof val === 'string') {\n      dt = parse(val, 'yyyy-MM-dd', new Date());\n    } else {\n      dt = toDate(val);\n    }\n    if (!isNaN(dt.valueOf())) {\n      const datePipe = new DatePipe(this._getCurrentLocale());\n      return datePipe.transform(dt, 'shortDate') as string;\n    }\n    return '';\n  }\n\n  private _getCurrentLocale(): string {\n    const lang = this._ts.getActiveLang();\n    switch (lang) {\n      case 'ESP':\n        return 'es';\n      case 'FRA':\n        return 'fr';\n      case 'ITA':\n        return 'it';\n      case 'PRT':\n        return 'pt';\n      default:\n        return 'en';\n    }\n  }\n}\n","<ng-container *ngIf=\"control|async as ctrl\">\n\n  <span *ngIf=\"date|async as dateVal; else dateCtrl\">{{dateVal}}</span>\n  <ng-template #dateCtrl>\n    {{formatDateField(ctrl.value)}}\n  </ng-template>\n</ng-container>","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFile, fileIcon} from '@ajf/core/file-input';\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\nimport {UntypedFormControl} from '@angular/forms';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\nimport {Observable} from 'rxjs';\nimport {filter, map, shareReplay, startWith, switchMap} from 'rxjs/operators';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * This component allows you to download the file contained in the control of\n * the form inherited from AjfBaseFieldComponent.\n *\n * @export\n * @class AjfReadOnlyFileFieldComponent\n */\n@Component({\n  selector: 'ajf-read-only-file-field',\n  templateUrl: 'read-only-file-field.html',\n  styleUrls: ['read-only-file-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlyFileFieldComponent extends AjfBaseFieldComponent {\n  readonly fileIcon: SafeResourceUrl;\n  readonly fileUrl: Observable<SafeResourceUrl | null>;\n  readonly fileName: Observable<string>;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n    domSanitizer: DomSanitizer,\n  ) {\n    super(cdr, service, was);\n    this.fileIcon = domSanitizer.bypassSecurityTrustResourceUrl(fileIcon);\n    const fileStream = this.control.pipe(\n      filter(control => control != null),\n      switchMap(control => {\n        control = control as UntypedFormControl;\n        return control.valueChanges.pipe(startWith(control.value)) as Observable<AjfFile>;\n      }),\n      filter(value => value != null),\n      shareReplay(1),\n    );\n    this.fileUrl = fileStream.pipe(\n      map(file => {\n        if (file.content && file.content.length) {\n          return domSanitizer.bypassSecurityTrustResourceUrl(file.content);\n        } else if (file.url && file.url.length && !file.deleteUrl) {\n          return domSanitizer.bypassSecurityTrustResourceUrl(file.url);\n        }\n        return null;\n      }),\n    );\n    this.fileName = fileStream.pipe(map(file => file.name));\n  }\n}\n","<a *ngIf=\"fileUrl|async as fu ; else noFile\" [href]=\"fu\" [download]=\"fileName|async\" target=\"_blank\">\n  <img [src]=\"fileIcon\"> {{ fileName|async }}\n</a>\n<ng-template #noFile>\n  <div class=\"ajf-no-file-placeholder\"></div>\n</ng-template>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {filter, map} from 'rxjs/operators';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * This component allows you to show the geolocation info: latitude and longitude\n * the form inherited from AjfBaseFieldComponent.\n *\n * @export\n * @class AjfReadOnlyGeolocationFieldComponent\n */\n@Component({\n  selector: 'ajf-read-only-geolocation-field',\n  templateUrl: 'read-only-geolocation-field.html',\n  styleUrls: ['read-only-geolocation-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlyGeolocationFieldComponent extends AjfBaseFieldComponent {\n  readonly latitude: Observable<string>;\n  readonly longitude: Observable<string>;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n  ) {\n    super(cdr, service, was);\n\n    const coordinates = this.control.pipe(\n      filter(control => control != null),\n      map(ctrl => {\n        let coords: string[] = [];\n        if (ctrl) {\n          const values = ctrl.value as string;\n          if (values && values.length) {\n            coords = values.split(',');\n          }\n        }\n        return coords;\n      }),\n    );\n\n    this.latitude = coordinates.pipe(map(coords => (coords && coords.length > 0 ? coords[0] : '')));\n\n    this.longitude = coordinates.pipe(\n      map(coords => (coords && coords.length > 1 ? coords[1] : '')),\n    );\n  }\n}\n","<ng-container *ngIf=\"control|async as ctrl\">\n  <div class=\"flex-container\">\n    <div class=\"flex-child\">\n      {{'Latitude'|transloco}}: {{latitude|async}}\n    </div>\n    <div class=\"flex-child\">\n      {{'Longitude'|transloco}}: {{longitude|async}}\n    </div>\n  </div>\n</ng-container>","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFile} from '@ajf/core/file-input';\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\nimport {UntypedFormControl} from '@angular/forms';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\nimport {Observable} from 'rxjs';\nimport {filter, map, shareReplay, startWith, switchMap} from 'rxjs/operators';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * This component allows you to show the image related to url contained in the control of\n * the form inherited from AjfBaseFieldComponent.\n *\n * @export\n * @class AjfReadOnlyImageFieldComponent\n */\n@Component({\n  selector: 'ajf-read-only-image-field',\n  templateUrl: 'read-only-image-field.html',\n  styleUrls: ['read-only-image-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlyImageFieldComponent extends AjfBaseFieldComponent {\n  readonly imageUrl: Observable<SafeResourceUrl | null>;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n    domSanitizer: DomSanitizer,\n  ) {\n    super(cdr, service, was);\n    const fileStream = this.control.pipe(\n      filter(control => control != null),\n      switchMap(control => {\n        control = control as UntypedFormControl;\n        return control.valueChanges.pipe(startWith(control.value)) as Observable<AjfFile>;\n      }),\n      filter(value => value != null),\n      shareReplay(1),\n    );\n    this.imageUrl = fileStream.pipe(\n      map(file => {\n        if (file.content && file.content.length) {\n          return domSanitizer.bypassSecurityTrustResourceUrl(file.content);\n        } else if (file.url && file.url.length) {\n          return domSanitizer.bypassSecurityTrustResourceUrl(file.url);\n        }\n        return null;\n      }),\n    );\n  }\n}\n","<img *ngIf=\"imageUrl|async as iu ; else noImage\" [src]=\"imageUrl|async\">\n<ng-template #noImage>\n  <div class=\"ajf-no-image-placeholder\"></div>\n</ng-template>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {filter, map} from 'rxjs/operators';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfFieldWithChoicesInstance} from './interface/fields-instances/field-with-choices-instance';\nimport {AjfFieldType} from './interface/fields/field-type';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * This component allows you to show the values of AjfFieldWithChoicesInstance\n * contained in the control of the form inherited from AjfBaseFieldComponent.\n *\n * @export\n * @class AjfReadOnlySelectFieldComponent\n */\n@Component({\n  templateUrl: 'read-only-select-field.html',\n  styleUrls: ['read-only-select-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlySelectFieldComponent extends AjfBaseFieldComponent<\n  AjfFieldWithChoicesInstance<String | number>\n> {\n  readonly multiple: Observable<boolean>;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n  ) {\n    super(cdr, service, was);\n\n    this.multiple = this.control.pipe(\n      filter(control => control != null),\n      map(\n        () => this.instance != null && this.instance.node.fieldType === AjfFieldType.MultipleChoice,\n      ),\n    );\n  }\n}\n","<ng-container *ngIf=\"control|async as ctrl\">\n    <ng-container *ngFor=\"let choice of instance!.filteredChoices; let idx = index\">\n        <ng-container *ngIf=\"multiple|async; else singleChoice\">\n            <span *ngIf=\"ctrl.value && ctrl.value?.indexOf(choice.value) > -1\">\n                {{choice.label|transloco}}{{ctrl.value[ctrl.value.length - 1] !== choice.value ? ', ': ''}}\n            </span>\n        </ng-container>\n        <ng-template #singleChoice>\n            <span *ngIf=\"ctrl.value === choice.value\">{{choice.label|transloco}}</span>\n        </ng-template>\n    </ng-container>\n</ng-container>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * It returns a string that indetifies if the value is even or odd.\n *\n * @export\n * @class AjfTableRowClass\n */\n@Pipe({name: 'ajfTableRowClass'})\nexport class AjfTableRowClass implements PipeTransform {\n  transform(value: number): string {\n    if (value === 0) {\n      return 'ajf-header-row';\n    }\n    return value % 2 == 0 ? 'ajf-row-even' : 'ajf-row-odd';\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfTableFieldInstance} from './interface/fields-instances/table-field-instance';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * This component allows you to shows the values contained in the controls of\n * the form inherited from AjfBaseFieldComponent with AjfTableFieldInstance.\n *\n * @export\n * @class AjfReadOnlyTableFieldComponent\n */\n@Component({\n  templateUrl: 'read-only-table-field.html',\n  styleUrls: ['read-only-table-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlyTableFieldComponent extends AjfBaseFieldComponent<AjfTableFieldInstance> {\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n  ) {\n    super(cdr, service, was);\n  }\n}\n","<table *ngIf=\"instance\" class=\"ajf-table-field\">\n  <ng-container *ngIf=\"instance.node as node\">\n    <ng-container *ngFor=\"let columns of instance.controls; let row = index\">\n      <tr [ngClass]=\"row | ajfTableRowClass\">\n        <td>\n          <ng-container *ngIf=\"columns && columns.length > 0 && columns[0]\">\n            {{ columns[0] | ajfTranslateIfString | ajfFormatIfNumber: '.0-2' }}\n          </ng-container>\n        </td>\n        <ng-container *ngIf=\"columns && columns.length > 1 && columns[1]\">\n          <td *ngFor=\"let c of columns[1]; let column = index\">\n            <ng-container *ngIf=\"row === 0; else controlCell\">\n              {{ c | ajfTranslateIfString | ajfFormatIfNumber: '.0-2' }}\n            </ng-container>\n            <ng-template #controlCell>\n              <ng-container *ngIf=\"c|ajfGetTableCellControl as contr\">\n                <ng-container *ngIf=\"contr\">\n                  <span>{{ contr.control!.value | ajfTranslateIfString | ajfFormatIfNumber:\n                    '.0-2'\n                    }}</span>\n                </ng-container>\n              </ng-container>\n            </ng-template>\n          </td>\n        </ng-container>\n      </tr>\n    </ng-container>\n  </ng-container>\n</table>","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {HttpClient} from '@angular/common/http';\nimport {ChangeDetectorRef, Directive, Inject} from '@angular/core';\nimport {UntypedFormControl} from '@angular/forms';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\nimport {Observable, of as obsOf} from 'rxjs';\nimport {catchError, filter, map, startWith, switchMap} from 'rxjs/operators';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\nexport type AjfVideoProvider = 'youtube' | 'vimeo';\n\ninterface VideoInfo {\n  provider: AjfVideoProvider;\n  id: string;\n}\n\n/**\n * It allows the loading of video(youtube or vimeo) url inside an AjfForm.\n *\n * @export\n * @class AjfVideoUrlFieldComponent\n */\n@Directive()\nexport class AjfVideoUrlFieldComponent extends AjfBaseFieldComponent {\n  readonly validUrl: Observable<boolean>;\n  readonly videoThumbnail: Observable<SafeResourceUrl>;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n    domSanitizer: DomSanitizer,\n    httpClient: HttpClient,\n  ) {\n    super(cdr, service, was);\n\n    const video = this.control.pipe(\n      filter(control => control != null),\n      switchMap(control => {\n        control = control as UntypedFormControl;\n        return control.valueChanges.pipe(startWith(control.value));\n      }),\n      filter(value => value != null),\n      map(value => getVideoProviderAndId(value as string)),\n    );\n    this.validUrl = video.pipe(map(v => v != null));\n    this.videoThumbnail = video.pipe(\n      filter(info => info != null),\n      switchMap(info => videoPreviewUrl(httpClient, info as VideoInfo)),\n      filter(url => url != null),\n      map(url => domSanitizer.bypassSecurityTrustResourceUrl(url as string)),\n    );\n  }\n}\n\n/**\n * it returns a url of thumbnail related to video or null.\n *\n * @param httpClient\n * @param video\n * @return {*}\n */\nfunction videoPreviewUrl(httpClient: HttpClient, video: VideoInfo): Observable<string | null> {\n  if (video.provider === 'youtube') {\n    return obsOf(`https://img.youtube.com/vi/${video.id}/default.jpg`);\n  }\n  if (video.provider === 'vimeo') {\n    return httpClient\n      .get<{thumbnail_url: string}>(\n        `https://vimeo.com/api/oembed.json?url=https://vimeo.com/${video.id}`,\n      )\n      .pipe(\n        map(response => response.thumbnail_url),\n        catchError(() => obsOf(null)),\n      ) as Observable<string | null>;\n  }\n  return obsOf('');\n}\n\n/**\n * It checks the url param, if url is an youtube o vimeo domain return\n * an videoInfo else null\n *\n * @param url\n * @return {*}\n */\nfunction getVideoProviderAndId(url: string): VideoInfo | null {\n  let provider: AjfVideoProvider | null = null;\n  let id: string | null = null;\n  if (/youtube|youtu\\.be|y2u\\.be|i.ytimg\\./.test(url)) {\n    provider = 'youtube';\n    id = getYouTubeVideoId(url);\n  } else if (/vimeo/.test(url)) {\n    provider = 'vimeo';\n    id = getVimeoVideoId(url);\n  }\n  if (provider == null || id == null) {\n    return null;\n  }\n  return {provider, id};\n}\n\n/**\n * it gets the id of vimeo video url.\n *\n * @param url\n * @return {*}\n */\nfunction getVimeoVideoId(url: string): string | null {\n  if (url.includes('#')) {\n    url = url.split('#')[0];\n  }\n  if (url.includes('?') && !url.includes('clip_id=')) {\n    url = url.split('?')[0];\n  }\n\n  let id: string | null = null;\n  let arr: string[];\n\n  const vimeoPipe = [\n    'https?://vimeo.com/[0-9]+$',\n    'https?://player.vimeo.com/video/[0-9]+$',\n    'https?://vimeo.com/channels',\n    'groups',\n    'album',\n  ].join('|');\n\n  const vimeoRegex = new RegExp(vimeoPipe, 'gim');\n\n  if (vimeoRegex.test(url)) {\n    arr = url.split('/');\n    if (arr && arr.length) {\n      id = arr.pop() as string;\n    }\n  } else if (/clip_id=/gim.test(url)) {\n    arr = url.split('clip_id=');\n    if (arr && arr.length) {\n      id = arr[1].split('&')[0];\n    }\n  }\n\n  return id;\n}\n\n/**\n * it gets the id of youtube video url.\n *\n * @param url\n * @return {*}\n */\nfunction getYouTubeVideoId(url: string): string | null {\n  const shortcode = /youtube:\\/\\/|https?:\\/\\/youtu\\.be\\/|http:\\/\\/y2u\\.be\\//g;\n  if (shortcode.test(url)) {\n    const shortcodeId = url.split(shortcode)[1];\n    return stripParameters(shortcodeId);\n  }\n  // /v/ or /vi/\n  const inlinev = /\\/v\\/|\\/vi\\//g;\n\n  if (inlinev.test(url)) {\n    const inlineId = url.split(inlinev)[1];\n    return stripParameters(inlineId);\n  }\n\n  // v= or vi=\n  const parameterV = /v=|vi=/g;\n\n  if (parameterV.test(url)) {\n    const arr = url.split(parameterV);\n    return arr[1].split('&')[0];\n  }\n\n  // v= or vi=\n  const parameterWebp = /\\/an_webp\\//g;\n\n  if (parameterWebp.test(url)) {\n    const webp = url.split(parameterWebp)[1];\n    return stripParameters(webp);\n  }\n\n  // embed\n  const embedReg = /\\/embed\\//g;\n\n  if (embedReg.test(url)) {\n    const embedId = url.split(embedReg)[1];\n    return stripParameters(embedId);\n  }\n\n  // ignore /user/username pattern\n  const usernameReg = /\\/user\\/([a-zA-Z0-9]*)$/g;\n\n  if (usernameReg.test(url)) {\n    return null;\n  }\n\n  // user\n  const userReg = /\\/user\\/(?!.*videos)/g;\n\n  if (userReg.test(url)) {\n    const elements = url.split('/');\n    return stripParameters(elements.pop() as string);\n  }\n\n  // attribution_link\n  const attrReg = /\\/attribution_link\\?.*v%3D([^%&]*)(%26|&|$)/;\n\n  if (attrReg.test(url)) {\n    return (url.match(attrReg) as string[])[1];\n  }\n\n  return null;\n}\n\nfunction stripParameters(url: string): string {\n  // Split parameters or split folder separator\n  if (url.includes('?')) {\n    return url.split('?')[0];\n  } else if (url.includes('/')) {\n    return url.split('/')[0];\n  }\n  return url;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {HttpClient} from '@angular/common/http';\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  Inject,\n  ViewEncapsulation,\n} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\n\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfVideoUrlFieldComponent} from './video-url-field';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * This component allows you to show the video related to url contained in the control of\n * the form inherited from AjfBaseFieldComponent.\n *\n * @export\n * @class AjfReadOnlyVideoUrlFieldComponent\n */\n@Component({\n  selector: 'ajf-read-only-video-url-field',\n  templateUrl: 'read-only-video-url-field.html',\n  styleUrls: ['read-only-video-url-field.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n})\nexport class AjfReadOnlyVideoUrlFieldComponent extends AjfVideoUrlFieldComponent {\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n    domSanitizer: DomSanitizer,\n    httpClient: HttpClient,\n  ) {\n    super(cdr, service, was, domSanitizer, httpClient);\n  }\n}\n","<div *ngIf=\"control|async as ctrl\" class=\"ajf-video-thumbnail\">\n  <ng-container *ngIf=\"validUrl|async\">\n    <a target=\"_blank\" [href]=\"ctrl.value\">\n      <img *ngIf=\"videoThumbnail|async as thumb\" [src]=\"thumb\" class=\"\" alt=\"\">\n    </a>\n  </ng-container>\n</div>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {AjfTableFieldInstance} from './interface/fields-instances/table-field-instance';\nimport {AjfTableFormControl} from './interface/forms/table-form-control';\n\n/**\n * It returns all visible columns of form table.\n *\n * @export\n * @class AjfTableVisibleColumnsPipe\n */\n// TODO helpful? currently not used\n@Pipe({name: 'ajfTableVisibleColumns'})\nexport class AjfTableVisibleColumnsPipe implements PipeTransform {\n  transform(instance: AjfTableFieldInstance): (string | number | AjfTableFormControl)[][] {\n    if (!instance.node.editable) {\n      const val = instance.value || [];\n      return instance.hideEmptyRows\n        ? val\n            .filter(col =>\n              col[1].reduce((prev: boolean, cur) => {\n                return prev || (cur != null && cur !== '' && cur !== 0 && cur !== '0');\n              }, false),\n            )\n            .map(v => [v[0], ...v[1]])\n        : val.map(v => [v[0], ...v[1]]);\n    }\n    return ((instance.controls as [string, (string | AjfTableFormControl)[]][]) || []).map(v => [\n      v[0],\n      ...v[1],\n    ]);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\nimport {AjfBaseSlideInstance} from './interface/slides-instances/base-slide-instance';\nimport {validSlide} from './utils/slides-instances/valid-slide';\n\n/**\n * It checks if idx is a valid index for slide parameter.\n *\n * @export\n * @class AjfValidSlidePipe\n */\n@Pipe({name: 'ajfValidSlide', pure: false})\nexport class AjfValidSlidePipe implements PipeTransform {\n  transform(slide: AjfBaseSlideInstance, idx: number): boolean {\n    if (idx == null || typeof idx !== 'number') {\n      return false;\n    }\n    return validSlide(slide, idx);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCommonModule} from '@ajf/core/common';\nimport {AjfFileInputModule} from '@ajf/core/file-input';\nimport {AjfTranslocoModule} from '@ajf/core/transloco';\nimport {CommonModule} from '@angular/common';\nimport {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\nimport {ReactiveFormsModule} from '@angular/forms';\n\nimport {AjfAsFieldInstancePipe} from './as-field-instance';\nimport {AjfAsRepeatingSlideInstancePipe} from './as-repeating-slide-instance';\nimport {AjfBoolToIntPipe} from './bool-to-int';\nimport {AjfDateValuePipe} from './date-value';\nimport {AjfDateValueStringPipe} from './date-value-string';\nimport {AjfExpandFieldWithChoicesPipe} from './expand-input-with-choices';\nimport {AjfFieldHost} from './field-host';\nimport {AjfFieldIconPipe} from './field-icon';\nimport {AjfFieldIsValidPipe} from './field-is-valid';\nimport {AjfFileFieldComponent} from './file-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfFormStringIdentifierPipe} from './form-string-identifier';\nimport {AjfGetTableCellControlPipe} from './get-table-cell-control';\nimport {AjfImageFieldComponent} from './image-field';\nimport {AjfIncrementPipe} from './increment';\nimport {AjfIsCellEditablePipe} from './is-cell-editable';\nimport {AjfIsReadonlyInputFieldPipe} from './is-readonly-input-field';\nimport {AjfIsRepeatingSlideInstancePipe} from './is-repeating-slide';\nimport {AjfNodeCompleteNamePipe} from './node-complete-name';\nimport {AjfRangePipe} from './range';\nimport {AjfReadOnlyFieldComponent} from './read-only-field';\nimport {AjfReadOnlyDateFieldComponent} from './read-only-date-field';\nimport {AjfReadOnlyFileFieldComponent} from './read-only-file-field';\nimport {AjfReadOnlyGeolocationFieldComponent} from './read-only-geolocation-field';\nimport {AjfReadOnlyImageFieldComponent} from './read-only-image-field';\nimport {AjfReadOnlySelectFieldComponent} from './read-only-select-field';\nimport {AjfReadOnlyTableFieldComponent} from './read-only-table-field';\nimport {AjfReadOnlyVideoUrlFieldComponent} from './read-only-video-url-field';\nimport {AjfTableRowClass} from './table-row-class';\nimport {AjfTableVisibleColumnsPipe} from './table-visible-columns';\nimport {AjfValidSlidePipe} from './valid-slide';\nimport {AjfValidationService} from './validation-service';\nimport {AjfAsFieldInstanceErrorsPipe} from './as-validation-errors-string';\n\n@NgModule({\n  declarations: [\n    AjfAsFieldInstancePipe,\n    AjfAsFieldInstanceErrorsPipe,\n    AjfAsRepeatingSlideInstancePipe,\n    AjfBoolToIntPipe,\n    AjfDateValuePipe,\n    AjfDateValueStringPipe,\n    AjfExpandFieldWithChoicesPipe,\n    AjfFieldHost,\n    AjfFieldIconPipe,\n    AjfFieldIsValidPipe,\n    AjfFileFieldComponent,\n    AjfFormStringIdentifierPipe,\n    AjfGetTableCellControlPipe,\n    AjfImageFieldComponent,\n    AjfIncrementPipe,\n    AjfIsCellEditablePipe,\n    AjfIsReadonlyInputFieldPipe,\n    AjfIsRepeatingSlideInstancePipe,\n    AjfNodeCompleteNamePipe,\n    AjfRangePipe,\n    AjfReadOnlyFieldComponent,\n    AjfReadOnlyDateFieldComponent,\n    AjfReadOnlyFileFieldComponent,\n    AjfReadOnlyGeolocationFieldComponent,\n    AjfReadOnlyImageFieldComponent,\n    AjfReadOnlySelectFieldComponent,\n    AjfReadOnlyTableFieldComponent,\n    AjfReadOnlyVideoUrlFieldComponent,\n    AjfTableRowClass,\n    AjfTableVisibleColumnsPipe,\n    AjfValidSlidePipe,\n  ],\n  exports: [\n    AjfAsFieldInstancePipe,\n    AjfAsFieldInstanceErrorsPipe,\n    AjfAsRepeatingSlideInstancePipe,\n    AjfBoolToIntPipe,\n    AjfDateValuePipe,\n    AjfDateValueStringPipe,\n    AjfExpandFieldWithChoicesPipe,\n    AjfFieldHost,\n    AjfFieldIconPipe,\n    AjfFieldIsValidPipe,\n    AjfFileFieldComponent,\n    AjfFormStringIdentifierPipe,\n    AjfGetTableCellControlPipe,\n    AjfImageFieldComponent,\n    AjfIncrementPipe,\n    AjfIsCellEditablePipe,\n    AjfIsReadonlyInputFieldPipe,\n    AjfIsRepeatingSlideInstancePipe,\n    AjfNodeCompleteNamePipe,\n    AjfRangePipe,\n    AjfReadOnlyFieldComponent,\n    AjfReadOnlyDateFieldComponent,\n    AjfReadOnlyFileFieldComponent,\n    AjfReadOnlyGeolocationFieldComponent,\n    AjfReadOnlyImageFieldComponent,\n    AjfReadOnlySelectFieldComponent,\n    AjfReadOnlyTableFieldComponent,\n    AjfReadOnlyVideoUrlFieldComponent,\n    AjfTableRowClass,\n    AjfTableVisibleColumnsPipe,\n    AjfValidSlidePipe,\n  ],\n  imports: [\n    AjfCommonModule,\n    AjfFileInputModule,\n    CommonModule,\n    ReactiveFormsModule,\n    AjfTranslocoModule,\n  ],\n  providers: [\n    AjfDateValueStringPipe,\n    AjfFormRendererService,\n    AjfValidationService,\n    provideHttpClient(withInterceptorsFromDi()),\n  ],\n})\nexport class AjfFormsModule {}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {InjectionToken} from '@angular/core';\n\nexport const AJF_SEARCH_ALERT_THRESHOLD = new InjectionToken<number>('AJF_SEARCH_ALERT_THRESHOLD');\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfAttachmentsOrigin} from '../../interface/attachments/attachments-origin';\n\nexport type AjfAttachmentsOriginCreate<T> = Pick<AjfAttachmentsOrigin<T>, 'name'> &\n  Partial<AjfAttachmentsOrigin<T>>;\n/**\n *  Create a attachmentsOrigin&lt;T&gt;, apply attachments defaults when it missing\n */\nexport function createAttachmentsOrigin<T>(\n  origin: AjfAttachmentsOriginCreate<T>,\n): AjfAttachmentsOrigin<T> {\n  return {\n    ...origin,\n    attachments: origin.attachments || [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfAttachmentsOrigin} from '../interface/attachments/attachments-origin';\nimport {\n  AjfAttachmentsOriginCreate,\n  createAttachmentsOrigin,\n} from '../utils/attachments/create-attachments-origin';\n\n/**\n *  Create an AjfAttachmentsOrigin by json schema, throw error if name isn't defined\n */\nexport class AjfAttachmentsOriginSerializer {\n  static fromJson(origin: Partial<AjfAttachmentsOrigin<any>>): AjfAttachmentsOrigin<any> {\n    if (origin.name == null) {\n      throw new Error('Malformed attachments origin');\n    }\n    return createAttachmentsOrigin(origin as AjfAttachmentsOriginCreate<any>);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesOrigin} from '../../interface/choices/choices-origin';\n\nexport type AjfChoicesOriginCreate<T> = Pick<AjfChoicesOrigin<any>, 'type' | 'name'> &\n  Partial<AjfChoicesOrigin<T>>;\n/**\n *  Create a AjfChoicesOrigin&lt;T&gt;, apply label and choices defaults when it missing\n */\nexport function createChoicesOrigin<T>(origin: AjfChoicesOriginCreate<T>): AjfChoicesOrigin<T> {\n  return {\n    ...origin,\n    type: origin.type, // TODO why?\n    label: origin.label || '',\n    choices: origin.choices || [],\n  } as AjfChoicesOrigin<T>;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesOrigin} from '../interface/choices/choices-origin';\nimport {AjfChoicesOriginCreate, createChoicesOrigin} from '../utils/choices/create-choices-origin';\n/**\n *  Create an AjfChoicesOrigin by json schema, apply a default value for type and name\n */\nexport class AjfChoicesOriginSerializer {\n  static fromJson<T = any>(origin: Partial<AjfChoicesOrigin<T>>): AjfChoicesOrigin<T> {\n    return createChoicesOrigin<T>({\n      ...origin,\n      type: origin.type || 'fixed',\n      name: origin.name || '',\n    } as AjfChoicesOriginCreate<T>);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldWithChoices} from '../../interface/fields/field-with-choices';\nimport {AjfFieldCreate, createField} from './create-field';\n\nexport type AjfFieldWithChoicesCreate<T> = AjfFieldCreate &\n  Pick<AjfFieldWithChoices<T>, 'fieldType' | 'choicesOrigin'> &\n  Partial<AjfFieldWithChoices<T>>;\n/**\n * Create an AjfFieldWithChoice.\n * If choices is not defined apply empty array.\n * If forceExpanded is not defined apply false.\n * If forceNarrow is not defined apply false.\n */\nexport function createFieldWithChoices<T>(\n  field: AjfFieldWithChoicesCreate<T>,\n): AjfFieldWithChoices<T> {\n  const node = createField({...field});\n  return {\n    ...node,\n    ...field,\n    choices: field.choices || [],\n    forceExpanded: field.forceExpanded || false,\n    forceNarrow: field.forceNarrow || false,\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContainerNode} from '../../interface/nodes/container-node';\nimport {AjfNodeCreate, createNode} from './create-node';\n\nexport type AjfContainerNodeCreate = AjfNodeCreate & Partial<AjfContainerNode>;\n/**\n * It creates an AjfContainerNode by schema.\n * Extends AjfNode with nodes.\n * if nodes is not defined assign empty array\n */\nexport function createContainerNode(containerNode: AjfContainerNodeCreate): AjfContainerNode {\n  const node = createNode(containerNode);\n  return {\n    ...node,\n    nodes: containerNode.nodes || [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfRepeatingNode} from '../../interface/nodes/repeating-node';\nimport {AjfNodeCreate, createNode} from './create-node';\n\nexport type AjfRepeatingNodeCreate = AjfNodeCreate & Partial<AjfRepeatingNode>;\n/**\n * It creates an AjfRepeatingNode.\n * It extends AjfNode with formulaReps, minReps, maxReps by schema.\n * If minReps is not defined assign 1.\n * If maxReps is not defined assign 0.\n */\nexport function createRepeatingNode(repeatingNode: AjfRepeatingNodeCreate): AjfRepeatingNode {\n  const node = createNode(repeatingNode);\n  return {\n    ...repeatingNode,\n    ...node,\n    minReps: repeatingNode.minReps != null ? repeatingNode.minReps : 1,\n    maxReps: repeatingNode.maxReps != null ? repeatingNode.maxReps : 0,\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeGroup} from '../../interface/nodes/node-group';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfContainerNodeCreate, createContainerNode} from './create-container-node';\nimport {AjfRepeatingNodeCreate, createRepeatingNode} from './create-repeating-node';\n\nexport type AjfNodeGroupCreate = AjfContainerNodeCreate & AjfRepeatingNodeCreate;\n\n/**\n * It creates a AjfNodeGroup\n * set nodeType to AjfNodeType.AjfNodeGroup = 2.\n * Extends an AjfNode with the merging of containerNode  attributes(nodes)\n * with repeatingNode attributes(formulaReps, minReps, maxReps)\n */\nexport function createNodeGroup(nodeGroup: AjfNodeGroupCreate): AjfNodeGroup {\n  return {\n    ...createContainerNode(nodeGroup),\n    ...createRepeatingNode(nodeGroup),\n    nodeType: AjfNodeType.AjfNodeGroup,\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfRepeatingSlide} from '../../interface/slides/repeating-slide';\nimport {AjfContainerNodeCreate, createContainerNode} from '../nodes/create-container-node';\nimport {AjfRepeatingNodeCreate, createRepeatingNode} from '../nodes/create-repeating-node';\n\nexport type AjfRepeatingSlideCreate = AjfContainerNodeCreate & AjfRepeatingNodeCreate;\n/**\n * It creates a AjfRepeatingSlide as the composition of createContainerNode and\n * createRepeatingNode and set AjfRepeatingSlide as nodeType\n */\nexport function createRepeatingSlide(nodeGroup: AjfRepeatingSlideCreate): AjfRepeatingSlide {\n  return {\n    ...createContainerNode(nodeGroup),\n    ...createRepeatingNode(nodeGroup),\n    nodeType: AjfNodeType.AjfRepeatingSlide,\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {neverCondition} from '@ajf/core/models';\nimport {AjfNodeType} from '../../interface/nodes/node-type';\nimport {AjfSlide} from '../../interface/slides/slide';\nimport {AjfContainerNodeCreate, createContainerNode} from '../nodes/create-container-node';\n\nexport type AjfSlideCreate = AjfContainerNodeCreate;\n\n/**\n * It creates AjfSlide.\n */\nexport function createSlide(nodeGroup: AjfSlideCreate): AjfSlide {\n  return {\n    ...createContainerNode(nodeGroup),\n    nodeType: AjfNodeType.AjfSlide,\n    readonly: nodeGroup.readonly || neverCondition(),\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidationGroup} from '../interface/validation/validation-group';\nimport {createValidationGroup} from '../utils/validation/create-validation-group';\n\n/**\n *  Create an AjfValidationGroup by json schema\n */\nexport class AjfValidationGroupSerializer {\n  static fromJson(group: Partial<AjfValidationGroup>): AjfValidationGroup {\n    return createValidationGroup(group);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfWarningGroup} from '../interface/warning/warning-group';\nimport {createWarningGroup} from '../utils/warning/create-warning-group';\n\n/**\n *  Create an AjfWarningGroup by json schema\n */\nexport class AjfWarningGroupSerializer {\n  static fromJson(group: Partial<AjfWarningGroup>): AjfWarningGroup {\n    return createWarningGroup(group);\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfConditionSerializer, AjfFormulaSerializer} from '@ajf/core/models';\n\nimport {AjfAttachmentsOrigin} from '../interface/attachments/attachments-origin';\nimport {AjfChoicesOrigin} from '../interface/choices/choices-origin';\nimport {AjfField} from '../interface/fields/field';\nimport {AjfFieldType} from '../interface/fields/field-type';\nimport {AjfFieldWithChoices} from '../interface/fields/field-with-choices';\nimport {AjfFormulaField} from '../interface/fields/formula-field';\nimport {AjfContainerNode} from '../interface/nodes/container-node';\nimport {AjfNode} from '../interface/nodes/node';\nimport {AjfNodeGroup} from '../interface/nodes/node-group';\nimport {AjfFieldNodeLink} from '../interface/nodes/node-link';\nimport {AjfNodeType} from '../interface/nodes/node-type';\nimport {AjfRepeatingNode} from '../interface/nodes/repeating-node';\nimport {AjfRepeatingSlide} from '../interface/slides/repeating-slide';\nimport {AjfSlide} from '../interface/slides/slide';\nimport {AjfFieldCreate, createField} from '../utils/fields/create-field';\nimport {createFieldWithChoices} from '../utils/fields/create-field-with-choices';\nimport {componentsMap} from '../utils/fields/fields-map';\nimport {createContainerNode} from '../utils/nodes/create-container-node';\nimport {AjfNodeCreate, createNode} from '../utils/nodes/create-node';\nimport {createNodeGroup} from '../utils/nodes/create-node-group';\nimport {createRepeatingNode} from '../utils/nodes/create-repeating-node';\nimport {createRepeatingSlide} from '../utils/slides/create-repeating-slide';\nimport {createSlide} from '../utils/slides/create-slide';\n\nimport {AjfValidationGroupSerializer} from './validation-group-serializer';\nimport {AjfWarningGroupSerializer} from './warning-group-serializer';\n\n/**\n * Create an AjfNode by json schema,\n * apply a default value for name\n * throw new error if id,parent or nodeType attribute missed\n */\nexport class AjfNodeSerializer {\n  static fromJson(\n    json: Partial<AjfNode>,\n    choicesOrigins?: AjfChoicesOrigin<any>[],\n    attachmentsOrigins?: AjfAttachmentsOrigin<any>[],\n  ): AjfNode {\n    const err = 'Malformed node';\n    const obj = {...json};\n    obj.name = obj.name ?? '';\n    if (obj.id == null || obj.parent == null || obj.nodeType == null) {\n      throw new Error(err);\n    }\n    if (obj.visibility) {\n      obj.visibility = AjfConditionSerializer.fromJson(obj.visibility);\n    }\n    obj.conditionalBranches = (obj.conditionalBranches || []).map(c =>\n      AjfConditionSerializer.fromJson(c),\n    );\n    // call serializer by nodeType and cast obj with the right interface\n    switch (obj.nodeType) {\n      case AjfNodeType.AjfField:\n        return AjfNodeSerializer._fieldFromJson(\n          obj as AjfNodeCreate & Partial<AjfField>,\n          choicesOrigins,\n          attachmentsOrigins,\n        );\n      case AjfNodeType.AjfFieldNodeLink:\n        return AjfNodeSerializer._fieldNodeLinkFromJson(\n          obj as AjfNodeCreate & Partial<AjfFieldNodeLink>,\n        );\n      case AjfNodeType.AjfNodeGroup:\n        return AjfNodeSerializer._nodeGroupFromJson(\n          obj as AjfNodeCreate & Partial<AjfNodeGroup>,\n          choicesOrigins,\n          attachmentsOrigins,\n        );\n      case AjfNodeType.AjfRepeatingSlide:\n        return AjfNodeSerializer._repeatingSlideFromJson(\n          obj as AjfNodeCreate & Partial<AjfRepeatingSlide>,\n          choicesOrigins,\n          attachmentsOrigins,\n        );\n      case AjfNodeType.AjfSlide:\n        const slideObj = obj as AjfNodeCreate & Partial<AjfSlide>;\n        if (slideObj.readonly) {\n          slideObj.readonly = AjfConditionSerializer.fromJson(slideObj.readonly);\n        }\n        return AjfNodeSerializer._slideFromJson(\n          slideObj as AjfNodeCreate & Partial<AjfSlide>,\n          choicesOrigins,\n          attachmentsOrigins,\n        );\n    }\n    throw new Error(err);\n  }\n\n  private static _containerNodeFromJson(\n    json: AjfNodeCreate & Partial<AjfContainerNode>,\n    choicesOrigins?: AjfChoicesOrigin<any>[],\n    attachmentsOrigins?: AjfAttachmentsOrigin<any>[],\n  ): AjfContainerNode {\n    json.nodes = (json.nodes || []).map(n =>\n      AjfNodeSerializer.fromJson(n, choicesOrigins, attachmentsOrigins),\n    );\n    return createContainerNode(json);\n  }\n\n  private static _fieldFromJson(\n    json: AjfNodeCreate & Partial<AjfField> & Partial<{attachmentsOriginRef: string}>,\n    choicesOrigins?: AjfChoicesOrigin<any>[],\n    attachmentsOrigins?: AjfAttachmentsOrigin<any>[],\n  ): AjfField {\n    if (json.fieldType == null) {\n      throw new Error('Malformed field');\n    }\n    const obj = json as AjfFieldCreate;\n    if (obj.validation) {\n      obj.validation = AjfValidationGroupSerializer.fromJson(obj.validation);\n    }\n    if (obj.warning) {\n      obj.warning = AjfWarningGroupSerializer.fromJson(obj.warning);\n    }\n    if (json.attachmentsOriginRef) {\n      obj.attachmentOrigin = (attachmentsOrigins || []).find(\n        a => a.name === json.attachmentsOriginRef,\n      );\n    }\n    if (obj.nextSlideCondition) {\n      obj.nextSlideCondition = AjfConditionSerializer.fromJson(obj.nextSlideCondition);\n    }\n    const isCustomFieldWithChoice =\n      obj.fieldType > 100 &&\n      componentsMap[obj.fieldType] != null &&\n      componentsMap[obj.fieldType].isFieldWithChoice === true;\n    if (isCustomFieldWithChoice) {\n      return AjfNodeSerializer._fieldWithChoicesFromJson(\n        json as AjfFieldCreate & Partial<AjfFieldWithChoices<any>>,\n        choicesOrigins,\n      );\n    }\n\n    switch (obj.fieldType) {\n      case AjfFieldType.Formula:\n        return AjfNodeSerializer._formulaFieldFromJson(\n          json as AjfFieldCreate & Partial<AjfFormulaField>,\n        );\n      case AjfFieldType.MultipleChoice:\n      case AjfFieldType.SingleChoice:\n        return AjfNodeSerializer._fieldWithChoicesFromJson(\n          json as AjfFieldCreate & Partial<AjfFieldWithChoices<any>>,\n          choicesOrigins,\n        );\n    }\n    return createField(obj);\n  }\n\n  private static _fieldNodeLinkFromJson(\n    json: AjfNodeCreate & Partial<AjfFieldNodeLink>,\n  ): AjfFieldNodeLink {\n    return {...createNode(json), nodeType: AjfNodeType.AjfFieldNodeLink};\n  }\n\n  private static _fieldWithChoicesFromJson(\n    json: AjfFieldCreate & Partial<AjfFieldWithChoices<any>> & Partial<{choicesOriginRef: string}>,\n    choicesOrigins?: AjfChoicesOrigin<any>[],\n  ): AjfFieldWithChoices<any> {\n    const err = 'Malformed field with choices';\n    if (json.choicesOriginRef == null) {\n      throw new Error(err);\n    }\n    const choicesOrigin = (choicesOrigins || []).find(c => c.name === json.choicesOriginRef);\n    if (choicesOrigin == null) {\n      throw new Error(err);\n    }\n    if (json.choicesFilter) {\n      json.choicesFilter = AjfFormulaSerializer.fromJson(json.choicesFilter);\n    }\n    if (json.triggerConditions) {\n      json.triggerConditions = json.triggerConditions.map(t => AjfConditionSerializer.fromJson(t));\n    }\n    return createFieldWithChoices<any>({...json, choicesOrigin});\n  }\n\n  private static _formulaFieldFromJson(\n    json: AjfFieldCreate & Partial<AjfFormulaField>,\n  ): AjfFormulaField {\n    if (json.formula) {\n      json.formula = AjfFormulaSerializer.fromJson(json.formula);\n    }\n    return {\n      ...createField(json),\n      fieldType: AjfFieldType.Formula,\n    };\n  }\n\n  private static _nodeGroupFromJson(\n    json: AjfNodeCreate & Partial<AjfNodeGroup>,\n    choicesOrigins?: AjfChoicesOrigin<any>[],\n    attachmentsOrigins?: AjfAttachmentsOrigin<any>[],\n  ): AjfNodeGroup {\n    return createNodeGroup({\n      ...AjfNodeSerializer._containerNodeFromJson(json, choicesOrigins, attachmentsOrigins),\n      ...AjfNodeSerializer._repeatingNodeFromJson(json),\n    });\n  }\n\n  private static _repeatingNodeFromJson(\n    json: AjfNodeCreate & Partial<AjfRepeatingNode>,\n  ): AjfRepeatingNode {\n    if (json.formulaReps) {\n      json.formulaReps = AjfFormulaSerializer.fromJson(json.formulaReps);\n    }\n    return createRepeatingNode(json);\n  }\n\n  private static _repeatingSlideFromJson(\n    json: AjfNodeCreate & Partial<AjfRepeatingSlide>,\n    choicesOrigins?: AjfChoicesOrigin<any>[],\n    attachmentsOrigins?: AjfAttachmentsOrigin<any>[],\n  ): AjfRepeatingSlide {\n    return createRepeatingSlide({\n      ...AjfNodeSerializer._containerNodeFromJson(json, choicesOrigins, attachmentsOrigins),\n      ...AjfNodeSerializer._repeatingNodeFromJson(json),\n    });\n  }\n\n  private static _slideFromJson(\n    json: AjfNodeCreate & Partial<AjfSlide>,\n    choicesOrigins?: AjfChoicesOrigin<any>[],\n    attachmentsOrigins?: AjfAttachmentsOrigin<any>[],\n  ): AjfSlide {\n    return createSlide(\n      AjfNodeSerializer._containerNodeFromJson(json, choicesOrigins, attachmentsOrigins),\n    );\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\nimport {deepCopy} from '@ajf/core/utils';\nimport {AjfForm} from '../interface/forms/form';\nimport {AjfRepeatingSlide} from '../interface/slides/repeating-slide';\nimport {AjfSlide} from '../interface/slides/slide';\nimport {AjfAttachmentsOriginSerializer} from './attachments-origin-serializer';\nimport {AjfChoicesOriginSerializer} from './choices-origin-serializer';\nimport {AjfNodeSerializer} from './node-serializer';\n\n/**\n *  Create an AjfForm by json schema, apply a default value for stringIdentifier and initContext\n */\nexport class AjfFormSerializer {\n  static fromJson(form: Partial<AjfForm>, context?: AjfContext): AjfForm {\n    /**\n     * create choicesOrigins by serializer\n     */\n    const choicesOrigins = (form.choicesOrigins || []).map(c =>\n      AjfChoicesOriginSerializer.fromJson(c),\n    );\n    /**\n     * create attachmentsOrigins by serializer\n     */\n    const attachmentsOrigins = (form.attachmentsOrigins || []).map(a =>\n      AjfAttachmentsOriginSerializer.fromJson(a),\n    );\n    /**\n     * create nodes by serializer\n     */\n    const nodes = (form.nodes || []).map(n =>\n      AjfNodeSerializer.fromJson(n, choicesOrigins, attachmentsOrigins),\n    ) as (AjfRepeatingSlide | AjfSlide)[];\n    return {\n      ...form,\n      choicesOrigins,\n      attachmentsOrigins,\n      nodes,\n      stringIdentifier: form.stringIdentifier || [],\n      initContext: deepCopy(context || {}),\n    };\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {ChangeDetectorRef, Directive, Inject, OnDestroy} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {AjfBaseFieldComponent} from './base-field';\nimport {AjfFormRendererService} from './form-renderer';\nimport {AjfTableFieldInstance} from './interface/fields-instances/table-field-instance';\nimport {AJF_WARNING_ALERT_SERVICE, AjfWarningAlertService} from './warning-alert-service';\n\n/**\n * This component manages the table field data.\n * It exposes methods for managing the display of controllers.\n *\n *\n * @export\n * @abstract\n * @class AjfTableFieldComponent\n */\n@Directive()\nexport abstract class AjfTableFieldComponent\n  extends AjfBaseFieldComponent<AjfTableFieldInstance>\n  implements OnDestroy\n{\n  private _instanceChangeSub = Subscription.EMPTY;\n\n  constructor(\n    cdr: ChangeDetectorRef,\n    service: AjfFormRendererService,\n    @Inject(AJF_WARNING_ALERT_SERVICE) was: AjfWarningAlertService,\n  ) {\n    super(cdr, service, was);\n  }\n\n  /**\n   *  set the current cell show to false and set the next cell show to true.\n   *\n   * @param ev\n   * @param row\n   * @param column\n   * @return {*}\n   */\n  goToNextCell(ev: Event, row: number, column: number): void {\n    if (\n      this.instance == null ||\n      this.instance.controls.length < row ||\n      (this.instance.controls.length >= row && this.instance.controls[row].length < 1) ||\n      this.instance.controls[row][1].length < column\n    ) {\n      return;\n    }\n    const rowLength = this.instance.controls[row][1].length;\n    const currentCell = this.instance.controls[row][1][column];\n    if (column + 1 >= rowLength) {\n      column = 0;\n      if (row + 1 >= this.instance.controls.length) {\n        row = 1;\n      } else {\n        row += 1;\n      }\n    } else {\n      column += 1;\n    }\n    if (typeof currentCell !== 'string') {\n      currentCell.show = false;\n    }\n    this._showCell(row, column);\n    ev.preventDefault();\n    ev.stopPropagation();\n  }\n\n  /**\n   * It resets all control.show to false and sets the control.show\n   * (identified by row and column) to true.\n   *\n   * @param row\n   * @param column\n   */\n  goToCell(row: number, column: number): void {\n    this._resetControls();\n    this._showCell(row, column);\n  }\n\n  override ngOnDestroy(): void {\n    super.ngOnDestroy();\n    this._instanceChangeSub.unsubscribe();\n  }\n\n  protected override _onInstanceChange(): void {\n    this._instanceChangeSub.unsubscribe();\n    if (this.instance == null) {\n      this._instanceChangeSub = Subscription.EMPTY;\n      return;\n    }\n    let sub: Subscription;\n    this.instance.controls.forEach(ctrlss => {\n      if (typeof ctrlss === 'string') {\n        return;\n      }\n      if (Array.isArray(ctrlss)) {\n        ctrlss.forEach(ctrls => {\n          if (typeof ctrls === 'string') {\n            return;\n          }\n          if (Array.isArray(ctrls)) {\n            ctrls.forEach(ctrl => {\n              if (typeof ctrl === 'string') {\n                return;\n              }\n              const curSub = ctrl.control.valueChanges.subscribe(() =>\n                this._changeDetectorRef.markForCheck(),\n              );\n              if (typeof sub === 'undefined') {\n                sub = curSub;\n              } else {\n                sub.add(curSub);\n              }\n            });\n          }\n        });\n      }\n    });\n  }\n\n  /**\n   * it sets all controls show to false.\n   *\n   * @private\n   */\n  private _resetControls(): void {\n    if (this.instance == null) {\n      return;\n    }\n    this.instance.controls.forEach(row =>\n      row[1].forEach(cell => {\n        if (typeof cell !== 'string') {\n          cell.show = false;\n        }\n      }),\n    );\n  }\n\n  /**\n   * It sets the control.show (identified by row and column) to true.\n   *\n   * @private\n   * @param row\n   * @param column\n   * @return {*}\n   */\n  private _showCell(row: number, column: number): void {\n    if (\n      this.instance == null ||\n      row >= this.instance.controls.length ||\n      column >= this.instance.controls[row][1].length\n    ) {\n      return;\n    }\n    const nextCell = this.instance.controls[row][1][column];\n    if (typeof nextCell !== 'string') {\n      nextCell.show = true;\n    }\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/common';\nimport {evaluateExpression} from '@ajf/core/models';\nimport {deepCopy} from '@ajf/core/utils';\nimport {AjfField} from './interface/fields/field';\nimport {AjfFieldType} from './interface/fields/field-type';\nimport {AjfContainerNode} from './interface/nodes/container-node';\nimport {AjfNode} from './interface/nodes/node';\nimport {AjfFormSerializer} from './serializers/form-serializer';\nimport {AjfFormCreate} from './utils/forms/create-form';\nimport {isField} from './utils/nodes/is-field';\nimport {isRepeatingSlide} from './utils/nodes/is-repeating-slide';\n\nfunction generateRandomInstanceFields(fields: AjfField[]): AjfField[] {\n  const fieldReps: AjfField[] = [];\n  fields.forEach(f => {\n    for (let i = 0; i < 5; i++) {\n      const newReps = deepCopy(f);\n      newReps.name = `${newReps.name}__${i}`;\n      fieldReps.push(newReps);\n    }\n  });\n  return fieldReps;\n}\n\nfunction flattenFields(slides: AjfNode[]): AjfField[] {\n  let flatFields: AjfField[] = [];\n  slides.forEach(slide => {\n    if (isField(slide)) {\n      flatFields.push(slide);\n    } else if (isRepeatingSlide(slide)) {\n      const childs = generateRandomInstanceFields(slide.nodes as AjfField[]);\n      flatFields = flatFields.concat(flattenFields(childs));\n    } else {\n      flatFields = flatFields.concat([...((slide as AjfContainerNode).nodes as AjfField[])]);\n    }\n  });\n  return flatFields;\n}\n\nexport function generateRandomCtx(formSchema: AjfFormCreate): AjfContext[] {\n  const contexts: AjfContext[] = [];\n  const allFields: AjfField[] = flattenFields(formSchema.nodes!);\n  const n = Math.floor(Math.random() * 100) + 1;\n  for (let i = 0; i < n; i++) {\n    const ctx: AjfContext = {};\n    allFields.forEach(field => {\n      switch (field.fieldType) {\n        case AjfFieldType.Formula:\n          const formula = field.formula?.formula;\n          if (formula == null) {\n            ctx[field.name] = NaN;\n            break;\n          }\n          ctx[field.name] = evaluateExpression(formula, ctx);\n          break;\n        case AjfFieldType.Number:\n          ctx[field.name] = Math.floor(Math.random() * 1000) + 1;\n          break;\n        case AjfFieldType.Boolean:\n          ctx[field.name] = Math.random() < 0.5;\n          break;\n        case AjfFieldType.SingleChoice:\n          const singleChoices = field.choicesOrigin.choices.map(c => c.value);\n          ctx[field.name] = singleChoices[Math.floor(Math.random() * singleChoices.length)];\n          break;\n        case AjfFieldType.MultipleChoice:\n          const multipleChoices = field.choicesOrigin.choices.map(c => c.value);\n          ctx[field.name] = [multipleChoices[Math.floor(Math.random() * 35)]];\n          break;\n        case AjfFieldType.Range:\n          const end = field.end ?? 10;\n          const start = field.start ?? 1;\n          const value = Math.floor(start + Math.random() * (end + 1 - start));\n          ctx[field.name] = value;\n          break;\n        default:\n          ctx[field.name] = 0;\n      }\n    });\n    contexts.push(ctx);\n  }\n  return contexts;\n}\n\nexport function buildformDatas(formSchemas: {[name: string]: AjfFormCreate}): {\n  [name: string]: AjfContext[];\n} {\n  const forms: {[name: string]: AjfContext[]} = {};\n  Object.keys(formSchemas).forEach(nameSchema => {\n    forms[nameSchema] = generateRandomCtx(AjfFormSerializer.fromJson(formSchemas[nameSchema]));\n  });\n  return forms;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFile} from '@ajf/core/file-input';\nimport {AjfContext} from '@ajf/core/models';\n\nimport {AjfChoice} from '../interface/choices/choice';\nimport {AjfFieldType} from '../interface/fields/field-type';\nimport {AjfForm} from '../interface/forms/form';\nimport {AjfRepeatingSlide} from '../interface/slides/repeating-slide';\nimport {AjfSlide} from '../interface/slides/slide';\nimport {isField} from '../utils/nodes/is-field';\nimport {isRepeatingSlide} from '../utils/nodes/is-repeating-slide';\nimport {isSlideNode} from '../utils/nodes/is-slide-node';\n\n// ChoicesMap maps a choicesOriginRef to the list the choices.\nexport interface ChoicesMap {\n  [name: string]: AjfChoice<any>[];\n}\n\n// ImageMap maps image urls to dataurls, like:\n// 'http://whatever.com/image.png': 'data:image/png;base64,...'\nexport interface ImageMap {\n  [url: string]: string;\n}\n\n// loadFormImages downloads the images referenced by the form's signature fields\n// (via their AjfFile.url) and returns a map from url to dataurl, analogous to\n// loadReportImages for reports.\nexport function loadFormImages(form: AjfForm, context?: AjfContext): Promise<ImageMap> {\n  if (context == null) {\n    return Promise.resolve({});\n  }\n  const promises: Promise<ImageMap>[] = [];\n  for (const slide of form.nodes) {\n    if (isSlideNode(slide)) {\n      promises.push(loadSlideImages(slide, context));\n    } else if (isRepeatingSlide(slide)) {\n      promises.push(loadRepeatingSlideImages(slide, context));\n    }\n  }\n  return Promise.all(promises).then(mergeImageMaps);\n}\n\nfunction loadRepeatingSlideImages(slide: AjfRepeatingSlide, context: AjfContext): Promise<ImageMap> {\n  let repeats = 3; // default, if no formData\n  const maxRepeats = 20;\n  if (slide.name != null) {\n    const r = context[slide.name];\n    if (typeof r === 'number') {\n      repeats = Math.min(r, maxRepeats);\n    }\n  }\n  const promises: Promise<ImageMap>[] = [];\n  for (let r = 0; r < repeats; r++) {\n    promises.push(loadSlideImages(slide, context, r));\n  }\n  return Promise.all(promises).then(mergeImageMaps);\n}\n\nfunction loadSlideImages(\n  slide: AjfSlide | AjfRepeatingSlide,\n  context: AjfContext,\n  rep?: number,\n): Promise<ImageMap> {\n  const promises: Promise<ImageMap>[] = [];\n  for (const field of slide.nodes) {\n    if (isField(field) && field.fieldType === AjfFieldType.Signature) {\n      let name = field.name + (rep != null ? '__' + rep : '');\n      promises.push(loadSignatureImage(context[name]));\n    }\n  }\n  return Promise.all(promises).then(mergeImageMaps);\n}\n\nfunction loadSignatureImage(value: unknown): Promise<ImageMap> {\n  if (value == null || typeof value !== 'object') {\n    return Promise.resolve({});\n  }\n  const file = value as AjfFile;\n  if (typeof file.content === 'string' && file.content.startsWith('data:image')) {\n    // the image is already embedded, nothing to download.\n    return Promise.resolve({});\n  }\n  if (typeof file.url !== 'string' || file.url === '') {\n    return Promise.resolve({});\n  }\n  const url = file.url;\n  return new Promise<ImageMap>(resolve => {\n    const req = new XMLHttpRequest();\n    req.onerror = () => resolve({}); // ignore 404's\n    req.onload = () => {\n      const r = new FileReader();\n      r.onerror = () => resolve({});\n      r.onloadend = () => {\n        const result = r.result as string;\n        if (result.startsWith('data:image')) {\n          resolve({[url]: result});\n        } else {\n          resolve({});\n        }\n      };\n      r.readAsDataURL(req.response);\n    };\n    req.open('GET', url);\n    req.responseType = 'blob';\n    req.send();\n  });\n}\n\nfunction mergeImageMaps(maps: ImageMap[]): ImageMap {\n  let map: ImageMap = {};\n  for (const m of maps) {\n    map = {...map, ...m};\n  }\n  return map;\n}\n\nexport function stripHTML(s: string): string {\n  return s.replace(/<\\/?[^>]+(>|$)/g, '');\n}\n\n// Given a context, lookupStringFunction returns a function that allows to retrieve\n// the field values from the context. The values are returned as print-friendly strings.\n// rep is the index of the repeating slide, if the field belongs to one.\n// emptyValue is returned when the field has no value (defaults to '').\nexport function lookupStringFunction(\n  context?: AjfContext,\n  rep?: number,\n  emptyValue = '',\n): (name: string) => string {\n  if (context == null) {\n    return (_: string) => emptyValue;\n  }\n  return (name: string) => {\n    if (name == null) {\n      return emptyValue;\n    }\n    if (rep != null) {\n      name = name + '__' + rep;\n    }\n    const val = context[name];\n    if (val == null) {\n      return emptyValue;\n    }\n    if (val === true) {\n      return 'yes';\n    }\n    if (val === false) {\n      return 'no';\n    }\n    return String(val);\n  };\n}\n\n// Analogous to lookupStringFunction, but for multiple-choice questions,\n// returning an array of values.\nexport function lookupArrayFunction(context?: AjfContext, rep?: number): (name: string) => string[] {\n  if (context == null) {\n    return (_: string) => [];\n  }\n  return (name: string) => {\n    if (name == null) {\n      return [];\n    }\n    if (rep != null) {\n      name = name + '__' + rep;\n    }\n    const val = context[name];\n    if (Array.isArray(val)) {\n      return val;\n    }\n    return [];\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\nimport {\n  createPdf,\n  Content,\n  PageOrientation,\n  TCreatedPdf,\n  TDocumentDefinitions,\n} from '@ajf/core/pdfmake';\n\nimport {AjfChoice} from '../interface/choices/choice';\nimport {AjfEmptyField} from '../interface/fields/empty-field';\nimport {AjfField} from '../interface/fields/field';\nimport {AjfFieldType} from '../interface/fields/field-type';\nimport {AjfTableField} from '../interface/fields/table-field';\nimport {AjfForm} from '../interface/forms/form';\nimport {AjfNodeType} from '../interface/nodes/node-type';\nimport {AjfRepeatingSlide} from '../interface/slides/repeating-slide';\nimport {AjfSlide} from '../interface/slides/slide';\nimport {isField} from '../utils/nodes/is-field';\nimport {isRepeatingSlide} from '../utils/nodes/is-repeating-slide';\nimport {isSlideNode} from '../utils/nodes/is-slide-node';\n\nimport {ChoicesMap, ImageMap, loadFormImages, lookupArrayFunction, lookupStringFunction, stripHTML} from './utils';\n\nexport function openFormPdf(\n  form: AjfForm,\n  translate?: (_: string) => string,\n  orientation?: PageOrientation,\n  header?: Content[],\n  context?: AjfContext,\n): void {\n  createFormPdf(form, translate, orientation, header, context).then(pdf => {\n    pdf.open();\n  });\n}\n\nexport function createFormPdf(\n  form: AjfForm,\n  translate?: (_: string) => string,\n  orientation?: PageOrientation,\n  header?: Content[],\n  context?: AjfContext,\n): Promise<TCreatedPdf> {\n  return new Promise<TCreatedPdf>(resolve => {\n    const t = translate ? translate : (s: string) => s;\n    loadFormImages(form, context).then(images => {\n      const pdfDef = formToPdf(form, t, orientation, header, context, images);\n      resolve(createPdf(pdfDef));\n    });\n  });\n}\n\n// Given an AjfForm, returns its pdfmake pdf document definition.\nfunction formToPdf(\n  form: AjfForm,\n  translate: (s: string) => string,\n  orientation: PageOrientation | undefined,\n  header: Content[] | undefined,\n  context: AjfContext | undefined,\n  images: ImageMap,\n): TDocumentDefinitions {\n  const choicesMap: ChoicesMap = {};\n  for (const o of form.choicesOrigins) {\n    choicesMap[o.name] = o.choices;\n  }\n\n  const content = header ? [...header] : [];\n  for (const slide of form.nodes) {\n    if (isSlideNode(slide)) {\n      content.push(...slideToPdf(slide, choicesMap, translate, context, images));\n    } else if (isRepeatingSlide(slide)) {\n      content.push(...repeatingSlideToPdf(slide, choicesMap, translate, context, images));\n    }\n  }\n  return {content, pageOrientation: orientation};\n}\n\nfunction slideToPdf(\n  slide: AjfSlide | AjfRepeatingSlide,\n  choicesMap: ChoicesMap,\n  translate: (s: string) => string,\n  context: AjfContext | undefined,\n  images: ImageMap,\n  rep?: number,\n): Content[] {\n  let label = translate(slide.label);\n  if (rep != null) {\n    label = `${label} (${translate('repeat')} ${rep + 1})`;\n  }\n  const content: Content[] = [{text: label, fontSize: 18, bold: true, margin: [0, 15, 0, 10]}];\n  for (const field of slide.nodes) {\n    if (isField(field)) {\n      content.push(...fieldToPdf(field, choicesMap, translate, context, images, rep));\n    }\n  }\n  return content;\n}\n\nfunction repeatingSlideToPdf(\n  slide: AjfRepeatingSlide,\n  choicesMap: ChoicesMap,\n  translate: (s: string) => string,\n  context: AjfContext | undefined,\n  images: ImageMap,\n): Content[] {\n  let repeats = 3; // default, if no formData\n  const maxRepeats = 20;\n  if (context != null && slide.name != null) {\n    const r = context[slide.name];\n    if (typeof r === 'number') {\n      repeats = Math.min(r, maxRepeats);\n    }\n  }\n\n  const content = [];\n  for (let r = 0; r < repeats; r++) {\n    content.push(...slideToPdf(slide, choicesMap, translate, context, images, r));\n  }\n  return content;\n}\n\nfunction borderlessCell(text: string, bold?: boolean): Content {\n  return {table: {body: [[{text, bold, border: [false, false, false, false]}]]}};\n}\n\nfunction fieldToPdf(\n  field: AjfField | AjfEmptyField,\n  choicesMap: ChoicesMap,\n  translate: (s: string) => string,\n  context: AjfContext | undefined,\n  images: ImageMap,\n  rep?: number,\n): Content[] {\n  if (field.nodeType !== AjfNodeType.AjfField) {\n    throw new Error('not a field');\n  }\n\n  const visible =\n    context == null /* form not compiled, show all fields */ ||\n    field.visibility == null ||\n    evaluateExpression(field.visibility.condition, context);\n  if (!visible) {\n    return [];\n  }\n\n  const lookupString = lookupStringFunction(context, rep, ' ');\n\n  switch (field.fieldType) {\n    case AjfFieldType.String:\n    case AjfFieldType.Text:\n      return [\n        borderlessCell(translate(field.label)),\n        {table: {widths: ['*'], body: [[lookupString(field.name)]]}, margin: [5, 0, 0, 5]},\n      ];\n    case AjfFieldType.Formula:\n      let value = lookupString(field.name);\n      if (value === ' ') {\n        // If the value of the field is not in the context, recompute the formula.\n        const formula = field.formula || {formula: ''};\n        value = String(evaluateExpression(formula.formula, context));\n      }\n      return [\n        borderlessCell(translate(field.label)),\n        {table: {widths: ['*'], body: [[value]]}, margin: [5, 0, 0, 5]},\n      ];\n    case AjfFieldType.Number:\n    case AjfFieldType.Boolean:\n    case AjfFieldType.DateInput:\n    case AjfFieldType.Time:\n    case AjfFieldType.Range:\n      let val = lookupString(field.name);\n      // for boolean fields in compiled forms, a null value is printed as 'no':\n      if (field.fieldType === AjfFieldType.Boolean && context != null && val === ' ') {\n        val = 'no';\n      }\n      return [{\n        table: {\n          widths: ['*', '*'],\n          body: [[{text: translate(field.label), border: [false, false, false, false]}, val]],\n        },\n      }];\n    case AjfFieldType.SingleChoice:\n    case AjfFieldType.MultipleChoice:\n      const choices = choicesMap[(field as any).choicesOriginRef];\n      if (context == null) {\n        // empty form\n        return choiceToPdf(field, choices, translate);\n      }\n      // compiled form, only print choices that are selected\n      const selectedValues =\n        field.fieldType === AjfFieldType.SingleChoice\n          ? [lookupString(field.name)]\n          : lookupArrayFunction(context, rep)(field.name);\n      const nonNullChoice = (c: AjfChoice<any> | undefined): c is AjfChoice<any> => c != null;\n      let selectedChoices = selectedValues\n        .map(v => choices.find(c => c.value === v))\n        .filter(nonNullChoice);\n      if (selectedChoices.length === 0) {\n        selectedChoices = selectedValues.map(v => ({\n          label: v,\n          value: v,\n        }));\n      }\n      return choiceToPdf(field, selectedChoices, translate, context);\n    case AjfFieldType.Empty:\n      const text = stripHTML(translate(field.HTML));\n      return [borderlessCell(text, true)];\n    case AjfFieldType.Table:\n      return tableToPdf(field, lookupString, translate);\n    case AjfFieldType.Signature:\n      let content: Content = ' \\n ';\n      const image = context != null && context[field.name];\n      let dataUrl = typeof image === 'object' && image.content;\n      if (typeof dataUrl !== 'string' || !dataUrl.startsWith('data:image')) {\n        const url = typeof image === 'object' && image.url;\n        dataUrl = typeof url === 'string' ? images[url] : undefined;\n      }\n      if (typeof dataUrl === 'string' && dataUrl.startsWith('data:image')) {\n        content = {image: dataUrl, width: 240};\n      }\n      return [{\n        table: {\n          widths: ['*', '*'],\n          body: [[{text: translate(field.label), border: [false, false, false, false]}, content]],\n        },\n      }];\n    default:\n      // yet unsupported field type\n      return [];\n  }\n}\n\nfunction choiceToPdf(\n  field: AjfField,\n  choices: AjfChoice<any>[],\n  translate: (s: string) => string,\n  context?: AjfContext,\n): Content[] {\n  let choiceLabels: string[];\n  if (choices == null || choices.length === 0) {\n    choiceLabels = [' '];\n  } else {\n    choiceLabels = choices.map(c => c.label);\n  }\n  const body = [];\n  for (const c of choiceLabels) {\n    body.push([translate(c)]);\n  }\n  let question = translate(field.label);\n  // If the form is empty (to be compiled),\n  // help the user distinguish between single- and multiple-choice questions:\n  if (context == null && field.fieldType === AjfFieldType.SingleChoice) {\n    question += ` (${translate('single choice')})`;\n  }\n  if (context == null && field.fieldType === AjfFieldType.MultipleChoice) {\n    question += ` (${translate('multiple choice')})`;\n  }\n  return [\n    {\n      columns: [\n        borderlessCell(question),\n        {\n          table: {widths: ['*'], body},\n        },\n      ],\n      margin: [0, 0, 0, 5],\n    },\n  ];\n}\n\nfunction tableToPdf(\n  table: AjfTableField,\n  lookupString: (s: string) => string,\n  translate: (s: string) => string,\n): Content[] {\n  const body: string[][] = [['', ...table.columnLabels.map(translate)]];\n  for (let i = 0; i < table.rows.length; i++) {\n    const row = [...table.rows[i]];\n    for (let j = 0; j < row.length; j++) {\n      const cell = row[j];\n      if (typeof cell !== 'string') {\n        row[j] = cell.formula;\n      }\n    }\n    const valsRow = (row as string[]).map(lookupString).map(translate);\n    body.push([translate(table.rowLabels[i]), ...valsRow]);\n  }\n  return [\n    borderlessCell(translate(table.label)),\n    {table: {body, widths: Array(table.columnLabels.length + 1).fill('*')}, margin: [5, 0, 0, 5]},\n  ];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext, evaluateExpression} from '@ajf/core/models';\nimport {\n  BorderStyle,\n  Document,\n  HeadingLevel,\n  ITableCellBorders,\n  ImageRun,\n  Packer,\n  Paragraph,\n  Table,\n  TableCell,\n  TableRow,\n} from 'docx';\n\nimport {AjfChoice} from '../interface/choices/choice';\nimport {AjfEmptyField} from '../interface/fields/empty-field';\nimport {AjfField} from '../interface/fields/field';\nimport {AjfFieldType} from '../interface/fields/field-type';\nimport {AjfTableField} from '../interface/fields/table-field';\nimport {AjfForm} from '../interface/forms/form';\nimport {AjfNodeType} from '../interface/nodes/node-type';\nimport {AjfRepeatingSlide} from '../interface/slides/repeating-slide';\nimport {AjfSlide} from '../interface/slides/slide';\nimport {isField} from '../utils/nodes/is-field';\nimport {isRepeatingSlide} from '../utils/nodes/is-repeating-slide';\nimport {isSlideNode} from '../utils/nodes/is-slide-node';\n\nimport {ChoicesMap, ImageMap, loadFormImages, lookupArrayFunction, lookupStringFunction, stripHTML} from './utils';\n\nfunction downloadBlob(b: Blob) {\n  const url = URL.createObjectURL(b);\n  const a = document.createElement('a');\n  a.setAttribute('style', 'display: none');\n  a.href = url;\n  a.target = '_blank';\n  a.download = 'form.docx';\n  document.body.appendChild(a);\n  a.click();\n  a.remove();\n  URL.revokeObjectURL(url);\n}\n\ntype TranslateFunc = (text: string) => string;\n\nexport function downloadFormDoc(\n  form: AjfForm,\n  translate?: TranslateFunc, \n  header?: SectionChild[],\n  context?: AjfContext\n) {\n  createFormDoc(form, translate, header, context).then(blob => {\n    downloadBlob(blob);\n  });\n}\n\nexport function createFormDoc(\n  form: AjfForm,\n  translate?: TranslateFunc,\n  header?: SectionChild[],\n  context?: AjfContext\n): Promise<Blob> {\n  return new Promise<Blob>(resolve => {\n    const t = translate ? translate : (s: string) => s;\n    loadFormImages(form, context).then(images => {\n      const doc = formToDoc(form, t, header, context, images);\n      Packer.toBlob(doc).then(blob => resolve(blob));\n    });\n  });\n}\n\ntype SectionChild = Paragraph | Table;\n\nfunction formToDoc(\n  form: AjfForm,\n  translate: (s: string) => string,\n  header: SectionChild[] | undefined,\n  context: AjfContext | undefined,\n  images: ImageMap,\n): Document {\n  const choicesMap: ChoicesMap = {};\n  for (const o of form.choicesOrigins) {\n    choicesMap[o.name] = o.choices;\n  }\n\n  const children: SectionChild[] = header ? [...header] : [];\n  for (const slide of form.nodes) {\n    if (isSlideNode(slide)) {\n      children.push(...slideToDoc(slide, choicesMap, translate, context, images));\n    } else if (isRepeatingSlide(slide)) {\n      children.push(...repeatingSlideToDoc(slide, choicesMap, translate, context, images));\n    }\n  }\n  return new Document({sections: [{children}]});\n}\n\nfunction slideToDoc(\n  slide: AjfSlide | AjfRepeatingSlide,\n  choicesMap: ChoicesMap,\n  translate: (s: string) => string,\n  context: AjfContext | undefined,\n  images: ImageMap,\n  rep?: number,\n): SectionChild[] {\n  let label = translate(slide.label);\n  if (rep != null) {\n    label = `${label} (${translate('repeat')} ${rep + 1})`;\n  }\n  const children: SectionChild[] = [new Paragraph({text: label, heading: HeadingLevel.HEADING_2})];\n  for (const field of slide.nodes) {\n    if (isField(field)) {\n      children.push(...fieldToDoc(field, choicesMap, translate, context, images, rep));\n    }\n  }\n  return children;\n}\n\nfunction repeatingSlideToDoc(\n  slide: AjfRepeatingSlide,\n  choicesMap: ChoicesMap,\n  translate: (s: string) => string,\n  context: AjfContext | undefined,\n  images: ImageMap,\n): SectionChild[] {\n  let repeats = 3; // default, if no formData\n  const maxRepeats = 20;\n  if (context != null && slide.name != null) {\n    const r = context[slide.name];\n    if (typeof r === 'number') {\n      repeats = Math.min(r, maxRepeats);\n    }\n  }\n\n  const children = [];\n  for (let r = 0; r < repeats; r++) {\n    children.push(...slideToDoc(slide, choicesMap, translate, context, images, r));\n  }\n  return children;\n}\n\nfunction tableCell(text: string|Paragraph, borders?: ITableCellBorders): TableCell {\n  if (typeof text === 'string') {\n    text = new Paragraph(text);\n  }\n  return new TableCell({children: [text], borders});\n}\n\nconst tableWidth = 9000;\n\nfunction singleColTable(text: string) {\n  return new Table({\n    columnWidths: [tableWidth],\n    rows: [new TableRow({children: [tableCell(text)]})],\n  });\n}\n\nconst noBorder = {style: BorderStyle.NONE};\nconst noBorders = {top: noBorder, bottom: noBorder, left: noBorder, right: noBorder};\n\nfunction doubleColTable(l: string|Paragraph, r: string|Paragraph) {\n  return new Table({\n    columnWidths: [tableWidth/2, tableWidth/2],\n    rows: [new TableRow({children: [tableCell(l, noBorders), tableCell(r)]})],\n  });\n}\n\nconst marginAfterFields = new Paragraph('');\n\nfunction fieldToDoc(\n  field: AjfField | AjfEmptyField,\n  choicesMap: ChoicesMap,\n  translate: (s: string) => string,\n  context: AjfContext | undefined,\n  images: ImageMap,\n  rep?: number,\n): SectionChild[] {\n  if (field.nodeType !== AjfNodeType.AjfField) {\n    throw new Error('not a field');\n  }\n\n  const visible =\n    context == null /* form not compiled, show all fields */ ||\n    field.visibility == null ||\n    evaluateExpression(field.visibility.condition, context);\n  if (!visible) {\n    return [];\n  }\n\n  const lookupString = lookupStringFunction(context, rep);\n\n  switch (field.fieldType) {\n    case AjfFieldType.String:\n    case AjfFieldType.Text:\n      return [\n        new Paragraph(translate(field.label)),\n        singleColTable(lookupString(field.name)),\n        marginAfterFields,\n      ];\n    case AjfFieldType.Formula:\n      let value = lookupString(field.name);\n      if (value === '') {\n        // If the value of the field is not in the context, recompute the formula.\n        const formula = field.formula || {formula: ''};\n        value = String(evaluateExpression(formula.formula, context));\n      }\n      return [\n        new Paragraph(translate(field.label)),\n        singleColTable(value),\n        marginAfterFields,\n      ];\n    case AjfFieldType.Number:\n    case AjfFieldType.Boolean:\n    case AjfFieldType.DateInput:\n    case AjfFieldType.Time:\n    case AjfFieldType.Range:\n      let val = lookupString(field.name);\n      // for boolean fields in compiled forms, a null value is printed as 'no':\n      if (field.fieldType === AjfFieldType.Boolean && context != null && val === '') {\n        val = 'no';\n      }\n      return [doubleColTable(translate(field.label), val), marginAfterFields];\n    case AjfFieldType.SingleChoice:\n    case AjfFieldType.MultipleChoice:\n      const choices = choicesMap[(field as any).choicesOriginRef];\n      if (context == null) {\n        // empty form\n        return [...choiceToDoc(field, choices, translate), marginAfterFields];\n      }\n      // compiled form, only print choices that are selected\n      const selectedValues =\n        field.fieldType === AjfFieldType.SingleChoice\n          ? [lookupString(field.name)]\n          : lookupArrayFunction(context, rep)(field.name);\n      const nonNullChoice = (c: AjfChoice<any> | undefined): c is AjfChoice<any> => c != null;\n      let selectedChoices = selectedValues\n        .map(v => choices.find(c => c.value === v))\n        .filter(nonNullChoice);\n      if (selectedChoices.length === 0) {\n        selectedChoices = selectedValues.map(v => ({\n          label: v,\n          value: v,\n        }));\n      }\n      return [...choiceToDoc(field, selectedChoices, translate, context), marginAfterFields];\n    case AjfFieldType.Empty:\n      return [new Paragraph(stripHTML(translate(field.HTML))), marginAfterFields];\n    case AjfFieldType.Table:\n      return [...tableToPdf(field, lookupString, translate), marginAfterFields];\n    case AjfFieldType.Signature:\n      let par = new Paragraph('');\n      const image = context != null && context[field.name];\n      let dataUrl = typeof image === 'object' && image.content;\n      if (typeof dataUrl !== 'string' || !dataUrl.startsWith('data:image')) {\n        const url = typeof image === 'object' && image.url;\n        dataUrl = typeof url === 'string' ? images[url] : undefined;\n      }\n      if (typeof dataUrl === 'string' && dataUrl.startsWith('data:image')) {\n        const i = dataUrl.indexOf(',');\n        const base64 = dataUrl.slice(i + 1);\n        par = new Paragraph({children: [new ImageRun({\n          data: Uint8Array.from(atob(base64), c => c.charCodeAt(0)),\n          transformation: {width: 260, height: 130},\n        })]});\n      }\n      return [doubleColTable(translate(field.label), par), marginAfterFields];\n    default:\n      // yet unsupported field type\n      return [];\n  }\n}\n\nfunction choiceToDoc(\n  field: AjfField,\n  choices: AjfChoice<any>[],\n  translate: (s: string) => string,\n  context?: AjfContext,\n): SectionChild[] {\n  let question = translate(field.label);\n  // If the form is empty (to be compiled),\n  // help the user distinguish between single- and multiple-choice questions:\n  if (context == null && field.fieldType === AjfFieldType.SingleChoice) {\n    question += ` (${translate('single choice')})`;\n  }\n  if (context == null && field.fieldType === AjfFieldType.MultipleChoice) {\n    question += ` (${translate('multiple choice')})`;\n  }\n  let choiceLabels: string[];\n  if (choices == null || choices.length === 0) {\n    choiceLabels = [''];\n  } else {\n    choiceLabels = choices.map(c => c.label);\n  }\n  const rows = [new TableRow({children: [\n    new TableCell({\n      children: [new Paragraph(question)],\n      rowSpan: choiceLabels.length,\n      borders: noBorders\n    }),\n    tableCell(translate(choiceLabels[0])),\n  ]})];\n  for (let i = 1; i < choiceLabels.length; i++) {\n    rows.push(new TableRow({children: [tableCell(translate(choiceLabels[i]))]}));\n  }\n  return [new Table({columnWidths: [tableWidth/2, tableWidth/2], rows})];\n}\n\nfunction tableToPdf(\n  table: AjfTableField,\n  lookupString: (s: string) => string,\n  translate: (s: string) => string,\n): SectionChild[] {\n  const rows = [new TableRow({children: [\n    tableCell(''),\n    ...table.columnLabels.map(label => tableCell(translate(label))),\n  ]})];\n  for (let i = 0; i < table.rows.length; i++) {\n    const row = [...table.rows[i]];\n    for (let j = 0; j < row.length; j++) {\n      const cell = row[j];\n      if (typeof cell !== 'string') {\n        row[j] = cell.formula;\n      }\n    }\n    const valsRow = (row as string[]).map(lookupString).map(translate);\n    rows.push(new TableRow({children: [\n      tableCell(translate(table.rowLabels[i])),\n      ...valsRow.map(val => tableCell(val)),\n    ]}));\n  }\n  const cols = table.columnLabels.length + 1;\n  return [\n    new Paragraph(translate(table.label)),\n    new Table({columnWidths: Array(cols).fill(tableWidth / cols), rows}),\n  ];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport interface AjfAttachment<T> {\n  label: string;\n  value: T;\n  type: string;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfAttachmentsOrigin} from './attachments-origin';\n\nexport type AjfAttachmentsFixedOrigin<T> = AjfAttachmentsOrigin<T>;\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfAttachment} from './attachment';\n\nexport interface AjfAttachmentsOrigin<T> {\n  name: string;\n  attachments: AjfAttachment<T>[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport const enum AjfAttachmentsType {\n  Link,\n  Pdf,\n  LENGTH,\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoice} from './choice';\nimport {AjfChoicesOriginType} from './choices-origin-type';\n\nexport interface AjfBaseChoicesOrigin<T> {\n  type: AjfChoicesOriginType;\n  name: string;\n  label: string;\n  choices: AjfChoice<T>[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport interface AjfChoice<T> {\n  label: string;\n  value: T;\n  translatedLabel?: string;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseChoicesOrigin} from './base-choices-origin';\n\nexport interface AjfChoicesFixedOrigin<T> extends AjfBaseChoicesOrigin<T> {\n  type: 'fixed';\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoice} from './choice';\n\nexport type AjfChoicesFunction<T> = () => AjfChoice<T>[];\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseChoicesOrigin} from './base-choices-origin';\nimport {AjfChoicesFunction} from './choices-function';\n\nexport interface AjfChoicesFunctionOrigin<T> extends AjfBaseChoicesOrigin<T> {\n  type: 'function';\n  generator: AjfChoicesFunction<T>;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Observable} from 'rxjs';\n\nimport {AjfBaseChoicesOrigin} from './base-choices-origin';\nimport {AjfChoice} from './choice';\n\nexport interface AjfChoicesObservableArrayOrigin<T> extends AjfBaseChoicesOrigin<T> {\n  type: 'observableArray';\n  generator: Observable<AjfChoice<T>[]>;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Observable} from 'rxjs';\n\nimport {AjfBaseChoicesOrigin} from './base-choices-origin';\nimport {AjfChoice} from './choice';\n\nexport interface AjfChoicesObservableOrigin<T> extends AjfBaseChoicesOrigin<T> {\n  type: 'observable';\n  generator: Observable<AjfChoice<T>>;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesFixedOrigin} from './choices-fixed-origin';\nimport {AjfChoicesFunctionOrigin} from './choices-function-origin';\nimport {AjfChoicesObservableArrayOrigin} from './choices-observable-array-origin';\nimport {AjfChoicesObservableOrigin} from './choices-observable-origin';\nimport {AjfChoicesPromiseOrigin} from './choices-promise-origin';\n\nexport type AjfChoicesOrigin<T> =\n  | AjfChoicesFixedOrigin<T>\n  | AjfChoicesFunctionOrigin<T>\n  | AjfChoicesObservableArrayOrigin<T>\n  | AjfChoicesObservableOrigin<T>\n  | AjfChoicesPromiseOrigin<T>;\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport type AjfChoicesOriginType =\n  | 'fixed'\n  | 'function'\n  | 'observable'\n  | 'observableArray'\n  | 'promise';\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseChoicesOrigin} from './base-choices-origin';\nimport {AjfChoice} from './choice';\n\nexport interface AjfChoicesPromiseOrigin<T> extends AjfBaseChoicesOrigin<T> {\n  type: 'promise';\n  generator: Promise<AjfChoice<T>[]>;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport const enum AjfChoicesType {\n  String,\n  Number,\n  LENGTH,\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, AjfFormula} from '@ajf/core/models';\n\nimport {AjfAttachmentsOrigin} from '../attachments/attachments-origin';\nimport {AjfBaseNode} from '../nodes/base-node';\nimport {AjfNodeType} from '../nodes/node-type';\nimport {AjfValidationGroup} from '../validation/validation-group';\nimport {AjfWarningGroup} from '../warning/warning-group';\nimport {AjfFieldSize} from './field-size';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An ajf node of type Field. It is the building block for all the Fields in a Form.\n */\nexport interface AjfBaseField extends AjfBaseNode {\n  /**\n   * Type of the node.\n   */\n  nodeType: AjfNodeType.AjfField;\n\n  /**\n   * Type of the Field.\n   */\n  fieldType: AjfFieldType;\n\n  /**\n   * A brief description of the Field.\n   */\n  description?: string;\n\n  /**\n   * If set to true the Field input is editable\n   */\n  editable: boolean;\n\n  /**\n   * A formula used to derive the value of the field.\n   * If set, makes the field input read-only (not editable).\n   */\n  formula?: AjfFormula;\n\n  /**\n   * The default value of the Field. It could be a value or a formula.\n   * Is used only when the value is null.\n   */\n  defaultValue: any;\n\n  /**\n   * The size of the Field to be used when the Field is rendered\n   */\n  size: AjfFieldSize;\n\n  /**\n   * A set of conditions that defines if the Field value is valid.\n   */\n  validation?: AjfValidationGroup;\n\n  /**\n   * A set of conditions that defines if warning must be shown.\n   */\n  // @TODO(Marco, Peppe, Sara): Check if it is actually used and works as intended\n  warning?: AjfWarningGroup;\n\n  // @TODO(Marco, Peppe, Sara): Check if it is actually used and what it is\n  nextSlideCondition?: AjfCondition;\n\n  /**\n   * The origin of the attachments related to the field.\n   */\n  attachmentOrigin?: AjfAttachmentsOrigin<any>;\n\n  /**\n   * Any attachments (files uploaded on the form) related to the field.\n   */\n  attachments?: any[];\n  /*\n   * Hint text visualized in tooltip used\n   * to explain the mean of field\n   */\n  hint?: string;\n  /**\n   * Hint icon showed as anchor of hint\n   */\n  hintIcon?: string;\n\n  // @TODO(Marco, Peppe, Sara, Trik): Check if both are used and why attachments is of type 'any[]'\n  // and not 'AjfAttachment[]'.\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type Boolean\n */\nexport interface AjfBooleanField extends AjfBaseField {\n  fieldType: AjfFieldType.Boolean;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type DateRange.\n */\nexport interface AjfDateRangeField extends AjfBaseField {\n  fieldType: AjfFieldType.DateRange;\n\n  /**\n   * The min selectable date of the calendar.\n   */\n  minDate?: Date | 'today';\n\n  /**\n   * The max selectable date of the calendar.\n   */\n  maxDate?: Date | 'today';\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type DateInput\n */\nexport interface AjfDateInputField extends AjfBaseField {\n  fieldType: AjfFieldType.DateInput;\n\n  /**\n   * The min selectable date of the calendar.\n   */\n  minDate: Date | 'today';\n\n  /**\n   * The max selectable date of the calendar.\n   */\n  maxDate: Date | 'today';\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField that contains an HTML.\n */\nexport interface AjfEmptyField extends AjfBaseField {\n  fieldType: AjfFieldType.Empty;\n  HTML: string;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBarcodeField} from './barcode-field';\nimport {AjfBooleanField} from './boolean-field';\nimport {AjfDateRangeField} from './date-range-field';\nimport {AjfDateInputField} from './date-input-field';\nimport {AjfEmptyField} from './empty-field';\nimport {AjfFileField} from './file-field';\nimport {AjfFieldWithChoices} from './field-with-choices';\nimport {AjfFormulaField} from './formula-field';\nimport {AjfGeolocationField} from './geolocation-field';\nimport {AjfImageField} from './image-field';\nimport {AjfMultipleChoiceField} from './multiple-choice-field';\nimport {AjfNumberField} from './number-field';\nimport {AjfRangeField} from './range-field';\nimport {AjfSignatureField} from './signature-field';\nimport {AjfSingleChoiceField} from './single-choice-field';\nimport {AjfStringField} from './string-field';\nimport {AjfTableField} from './table-field';\nimport {AjfTextField} from './text-field';\nimport {AjfTimeField} from './time-field';\n\nimport {AjfAudioField} from './audio-field';\n\nexport type AjfField<T = any> =\n  | AjfAudioField\n  | AjfBarcodeField\n  | AjfBooleanField\n  | AjfDateRangeField\n  | AjfDateInputField\n  | AjfEmptyField\n  | AjfFieldWithChoices<T>\n  | AjfFileField\n  | AjfFormulaField\n  | AjfGeolocationField\n  | AjfImageField\n  | AjfMultipleChoiceField<T>\n  | AjfNumberField\n  | AjfRangeField\n  | AjfSignatureField\n  | AjfSingleChoiceField<T>\n  | AjfStringField\n  | AjfTableField\n  | AjfTextField\n  | AjfTimeField;\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\nimport {Type} from '@angular/core';\n\nimport {AjfBaseFieldComponent} from '../../base-field';\nimport {AjfFieldInstanceCreate} from '../../utils/fields-instances/create-field-instance';\nimport {AjfFieldInstance} from '../fields-instances/field-instance';\n\n/**\n * Represents the association between an AjfFieldType and the\n * components used to render it.\n */\nexport interface AjfFieldComponentsMap {\n  /**\n   * The field type.\n   */\n  [key: number]: {\n    /**\n     * The field component.\n     */\n    component: Type<AjfBaseFieldComponent>;\n\n    /**\n     * The readonly field component.\n     */\n    readOnlyComponent?: Type<AjfBaseFieldComponent>;\n\n    /**\n     * The Angular inputs of the components.\n     */\n    inputs?: {[key: string]: any};\n\n    /**\n     * The signature and return type of the method used for create Instance.\n     */\n    createInstance?: (instance: AjfFieldInstanceCreate, context: AjfContext) => AjfFieldInstance;\n\n    /**\n     * If true, the field has choices.\n     */\n    isFieldWithChoice?: boolean;\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/**\n * The size of the Field to be used when the Field is rendered\n */\nexport type AjfFieldSize = 'normal' | 'small' | 'smaller' | 'tiny' | 'mini';\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, AjfFormula} from '@ajf/core/models';\n\nimport {AjfChoice} from '../choices/choice';\nimport {AjfChoicesOrigin} from '../choices/choices-origin';\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type AjfFieldWithChoices.\n */\nexport interface AjfFieldWithChoices<T> extends AjfBaseField {\n  fieldType: AjfFieldType.MultipleChoice | AjfFieldType.SingleChoice;\n\n  /**\n   * The choices for the select element after choicesFilter\n   */\n  choices: AjfChoice<T>[];\n\n  /**\n   *  The source of the initial choices list, taken from the json schema\n   */\n  choicesOrigin: AjfChoicesOrigin<T>;\n\n  /**\n   * A formula to filter choices elements\n   */\n  choicesFilter?: AjfFormula;\n\n  /**\n   * Force the UI checkbox group display\n   */\n  forceExpanded: boolean;\n\n  /**\n   * Force the UI dropdown display\n   */\n  forceNarrow: boolean;\n\n  // TODO: Check again when we'll comment the Form Renderer or any code relative\n  // to the triggerConditions.\n  triggerConditions?: AjfCondition[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type File\n */\nexport interface AjfFileField extends AjfBaseField {\n  fieldType: AjfFieldType.File;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type Formula\n */\nexport interface AjfFormulaField extends AjfBaseField {\n  fieldType: AjfFieldType.Formula;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldType} from './field-type';\nimport {AjfFieldWithChoices} from './field-with-choices';\n\n/**\n * An AjfField of type MultipleChoice.\n */\nexport interface AjfMultipleChoiceField<T> extends AjfFieldWithChoices<T> {\n  fieldType: AjfFieldType.MultipleChoice;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type Number.\n */\nexport interface AjfNumberField extends AjfBaseField {\n  fieldType: AjfFieldType.Number;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\nexport interface AjfRangeField extends AjfBaseField {\n  fieldType: AjfFieldType.Range;\n  end?: number;\n  start?: number;\n  step?: number;\n  appearance?: 'rating' | string;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldType} from './field-type';\nimport {AjfFieldWithChoices} from './field-with-choices';\n\n/**\n * An AjfField of type SingleChoice.\n */\nexport interface AjfSingleChoiceField<T> extends AjfFieldWithChoices<T> {\n  fieldType: AjfFieldType.SingleChoice;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type String.\n */\nexport interface AjfStringField extends AjfBaseField {\n  fieldType: AjfFieldType.String;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {InputType} from '../forms/table-form-control';\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\nexport interface AjfTableCell {\n  /**\n   * If true the formula can be overridden by input value.\n   */\n  editable?: boolean;\n  /**\n   * The Formula associated with the cell.\n   */\n  formula: string;\n}\n\n/**\n * An AjfField of type Table.\n *\n *\n * Eg.\n * {\n *  id: 1,\n *  parent: 0,\n *  name: 'TableName',\n *  rows: [\n *     [\n *       'TableName__0__0',\n *       'TableName__0__1',\n *       {\n *         'formula': 'TableName__0__0 + TableName__0__1'\n *         'editable': false\n *       },\n *     ],\n *     ['TableName__1__0', 'TableName__1__1', 'TableName__1__2],\n *   ],\n *   label: '2.1 Table test',\n *   editable: true,\n *   nodeType: 0,\n *   fieldType: 11,\n *   rowLabels: [\n *     'TestRow',\n *     'OtherTestRow',\n *   ],\n *   columnLabels: ['Label 1', 'Label 2', 'Label 3']\n * }\n *\n */\nexport interface AjfTableField extends AjfBaseField {\n  columnTypes: InputType[];\n  fieldType: AjfFieldType.Table;\n  // deprecated string type is used to maintain backward compatibility\n  /**\n   * The string|number array represents all the values in the row cells.\n   * if string\n   *  Every element of this matrix need to satisfy this format: name =\n   * `${table.name}__${row.idx}__${column.idx}` This name is used also as the the control name in\n   * the form formGroup.registerControl(name, tableFormControl.control);\n   */\n  rows: (string | AjfTableCell)[][];\n\n  /**\n   * The string array represents all the column labels.\n   */\n  columnLabels: string[];\n\n  /**\n   * The string array represents all the row labels.\n   */\n  rowLabels: string[];\n\n  /**\n   * If true, empty rows are not showed\n   */\n  hideEmptyRows: boolean;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type Text.\n */\nexport interface AjfTextField extends AjfBaseField {\n  fieldType: AjfFieldType.Text;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseField} from './base-field';\nimport {AjfFieldType} from './field-type';\n\n/**\n * An AjfField of type Time\n */\nexport interface AjfTimeField extends AjfBaseField {\n  fieldType: AjfFieldType.Time;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfDateRangeField} from '../fields/date-range-field';\nimport {AjfFieldInstance} from './field-instance';\n\n/**\n * An AjfFieldInstance with a node of type AjfDateField.\n */\nexport interface AjfDateFieldInstance extends AjfFieldInstance {\n  node: AjfDateRangeField;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfDateInputField} from '../fields/date-input-field';\nimport {AjfFieldInstance} from './field-instance';\n\n/**\n * An AjfFieldInstance with a node of type AjfDateInputField.\n */\nexport interface AjfDateInputFieldInstance extends AjfFieldInstance {\n  node: AjfDateInputField;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfEmptyField} from '../fields/empty-field';\nimport {AjfFieldInstance} from './field-instance';\n\n/**\n * An AjfFieldInstance with a node of type AjfEmptyField.\n */\nexport interface AjfEmptyFieldInstance extends AjfFieldInstance {\n  node: AjfEmptyField;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, AjfFormula} from '@ajf/core/models';\nimport {EventEmitter} from '@angular/core';\n\nimport {AjfField} from '../fields/field';\nimport {AjfBaseNodeInstance} from '../nodes-instances/base-node-instance';\nimport {AjfValidationGroup} from '../validation/validation-group';\nimport {AjfValidationResult} from '../validation/validation-results';\nimport {AjfWarningGroup} from '../warning/warning-group';\nimport {AjfWarningResult} from '../warning/warning-result';\n\n/**\n * An AjfNodeInstance with a node of type AjfField.\n */\nexport interface AjfFieldInstance extends AjfBaseNodeInstance {\n  /**\n   * True if the field pass the validation\n   */\n  valid: boolean;\n\n  /**\n   * The AjfField blueprint\n   */\n  node: AjfField;\n\n  /**\n   * The value of the field\n   */\n  value: any;\n\n  /**\n   * A formula used to derive the value of the field.\n   */\n  formula?: AjfFormula;\n\n  /**\n   * A set of conditions that defines if the Field value is valid.\n   */\n  validation?: AjfValidationGroup;\n\n  /**\n   * A set of conditions that defines if warning must be shown.\n   */\n  warning?: AjfWarningGroup;\n\n  // @TODO(Marco, Peppe, Sara, Trik): See AjfField (Check if it is actually used and what it is)\n  nextSlideCondition?: AjfCondition;\n\n  /**\n   * The results of the evaluation of the validation group conditions\n   */\n  validationResults?: AjfValidationResult[];\n\n  /**\n   * The results of the evaluation of the warning group conditions\n   */\n  warningResults?: AjfWarningResult[];\n\n  /**\n   * Emitted when there are warningResults\n   */\n  warningTrigger: EventEmitter<void>;\n\n  /**\n   * The current node editability\n   */\n  editable: boolean;\n\n  /**\n   * AjfCondition for handling editability\n   */\n  readonly?: AjfCondition;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\n// TODO Check if and where it is actually used\nexport interface AjfFieldState {\n  visibility: boolean;\n  value: any;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition, AjfFormula} from '@ajf/core/models';\nimport {EventEmitter} from '@angular/core';\n\nimport {AjfChoice} from '../choices/choice';\nimport {AjfFieldWithChoices} from '../fields/field-with-choices';\n\nimport {AjfFieldInstance} from './field-instance';\n\n/**\n * An AjfFieldInstance with a node of type AjfFieldWithChoicesInstance.\n */\nexport interface AjfFieldWithChoicesInstance<T> extends AjfFieldInstance {\n  node: AjfFieldWithChoices<T>;\n\n  /**\n   * The filtered choices list, originally taken from json schema\n   */\n  filteredChoices: AjfChoice<any>[];\n\n  /**\n   * A formula to filter choices elements\n   */\n  choicesFilter?: AjfFormula;\n\n  // TODO: Check again when we'll comment the Form Renderer or any code relative\n  // to the triggerConditions.\n  triggerConditions?: AjfCondition[];\n  firstTriggerConditionDone: any;\n  selectionTrigger: EventEmitter<void>;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFormula} from '@ajf/core/models';\nimport {AjfFormulaField} from '../fields/formula-field';\nimport {AjfFieldInstance} from './field-instance';\n\n/**\n * An AjfFieldInstance with a node of type AjfFormulaField.\n */\nexport interface AjfFormulaFieldInstance extends AjfFieldInstance {\n  node: AjfFormulaField;\n\n  /**\n   * A formula used to derive the value of the formula field.\n   */\n  formula?: AjfFormula;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfRangeField} from '../fields/range-field';\nimport {AjfFieldInstance} from './field-instance';\n\nexport interface AjfRangeFieldInstance extends AjfFieldInstance {\n  node: AjfRangeField;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContext} from '@ajf/core/models';\n\nimport {AjfTableField} from '../fields/table-field';\nimport {AjfTableFormControl} from '../forms/table-form-control';\nimport {AjfFieldInstance} from './field-instance';\n\n/**\n * An AjfFieldInstance with a node of type AjfTableField.\n */\nexport interface AjfTableFieldInstance extends AjfFieldInstance {\n  node: AjfTableField;\n\n  /**\n   * If true, empty rows are not showed\n   */\n  hideEmptyRows: boolean;\n\n  /**\n   * List of values for the table (rows).\n   * The table is horizontally organized: the first cell of each row represents\n   * the 'Row Label' (like a horizontal 'column header').\n   * The string|number array represents all the values in the other row cells.\n   *\n   * Eg.\n   * {\n   *   id: 1,\n   *   parent: 0,\n   *   name: 'row', // table name\n   *   rows: [\n   *     ['row__0__0', 'row__0__1', 'row__0__2],\n   *     ['row__1__0', 'row__1__1', 'row__1__2],\n   *   ],\n   *   label: '2.1 Table test',\n   *   editable: true,\n   *   nodeType: 0,\n   *   fieldType: 11,\n   *   rowLabels: [\n   *     'TestRow',\n   *     'OtherTestRow',\n   *   ],\n   *   columnLabels: ['Label 1', 'Label 2', 'Label 3']\n   * }\n   *\n   * value: [\n   * ['TestRow', ['row__0__0', 'row__0__1', 'row__0__2]],\n   * ['OtherTestRow', ['row__1__0', 'row__1__1', 'row__1__2]],\n   * ]\n   */\n  value: [string, (string | number)[]][];\n\n  /**\n   * List of form control for the values\n   */\n  controls: [string, (string | AjfTableFormControl)[]][];\n\n  /**\n   * The table context\n   */\n  context: AjfContext;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfAttachmentsOrigin} from '../attachments/attachments-origin';\nimport {AjfChoicesOrigin} from '../choices/choices-origin';\nimport {AjfRepeatingSlide} from '../slides/repeating-slide';\nimport {AjfSlide} from '../slides/slide';\nimport {AjfFormStringIdentifier} from './form-string-identifier';\n\n/**\n * The main structure of a json schema representing a Form.\n */\nexport interface AjfForm {\n  /**\n   * The slides containing the Form nodes.\n   */\n  nodes: (AjfRepeatingSlide | AjfSlide)[];\n\n  /**\n   * The options for the single or multiple choices nodes.\n   */\n  choicesOrigins: AjfChoicesOrigin<any>[];\n\n  // @TODO(tutti): check\n  attachmentsOrigins: AjfAttachmentsOrigin<any>[];\n\n  /**\n   * An array of identifiers, each defined by a Label and a field value, used to show a brief\n   * summary of the form data.\n   */\n  stringIdentifier: AjfFormStringIdentifier[];\n\n  /**\n   * A context specifying the initial state and values of a form.\n   * It can be complemented and/or overwritten by the actual data.\n   */\n  initContext?: {[key: string]: string | string[] | number | number[]};\n\n  /**\n   * Any additional informations related to the Form.\n   */\n  supplementaryInformations?: any;\n\n  /**\n   * The validation state of the form, derived from the validation state of each\n   * of its fields.\n   */\n  valid?: boolean;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfStringIdentifier} from '@ajf/core/common';\n\nexport type AjfFormStringIdentifier = AjfStringIdentifier;\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition} from '@ajf/core/models';\nimport {AjfNodeType} from './node-type';\n\n/**\n * The base element of ajf forms (for example a slide or a field).\n * Can contain other nodes in a recursive nodes tree.\n */\nexport interface AjfBaseNode {\n  /**\n   * The node type\n   */\n  nodeType: AjfNodeType;\n\n  /**\n   * Node identification number\n   */\n  id: number;\n\n  /**\n   * Id of the parent node\n   */\n  parent: number;\n\n  /**\n   * The index of the condition in the conditionalBranches array of the parent node\n   * that determines if the current branch should be followed.\n   * (eg.\n   *    parentNode.id = 1\n   *    parentNode.conditionalBranches = ['x &gt; 1', 'x &lt;= 1', 'true'];\n   *    myCurrentNode.parent = 1\n   *    myCurrentNode.parentNode = 0;\n   *\n   * In this case, if the condition 'x &gt; 1' is met, the current branch will be followed ).\n   */\n  parentNode: number;\n\n  /**\n   * List of conditions that determines the branch to be followed\n   */\n  conditionalBranches: AjfCondition[];\n\n  /**\n   * The name of the field\n   */\n  name: string;\n\n  /**\n   * The label of the field\n   */\n  label: string;\n\n  /**\n   * AjfCondition for handling visibility\n   */\n  visibility?: AjfCondition;\n\n  /**\n   * AjfCondition for handling editability\n   */\n  readonly?: AjfCondition;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition} from '@ajf/core/models';\n\nimport {AjfBaseNode} from './base-node';\nimport {AjfNode} from './node';\n\n/**\n * An AjfNode that contains other AjfNodes.\n */\nexport interface AjfContainerNode extends AjfBaseNode {\n  /**\n   * The children nodes\n   */\n  nodes: AjfNode[];\n  // AjfCondition for handling field writable\n  readonly?: AjfCondition;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeType} from './node-type';\nimport {AjfRepeatingContainerNode} from './repeating-container-node';\n\n/**\n * Is a AjfRepeatingContainerNode of AjfNodeGroup\n */\nexport interface AjfNodeGroup extends AjfRepeatingContainerNode {\n  nodeType: AjfNodeType.AjfNodeGroup;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseNode} from './base-node';\nimport {AjfNodeType} from './node-type';\n\n/**\n * Used by the formBuilder.\n * Represents an empty slot in which to insert a new ajfNode.\n */\nexport interface AjfFieldNodeLink extends AjfBaseNode {\n  nodeType: AjfNodeType.AjfFieldNodeLink;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContainerNode} from './container-node';\nimport {AjfRepeatingNode} from './repeating-node';\n\n/**\n * Interface representing a Repeating Node Group.\n * Repeating node groups are used any time the user is required to fill\n * the same node group N times, where N is the value of the \"formulaReps\" property.\n * (eg. N = number of children, then fill data for each of N children).\n */\nexport type AjfRepeatingContainerNode = AjfContainerNode & AjfRepeatingNode;\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFormula} from '@ajf/core/models';\n\nimport {AjfBaseNode} from './base-node';\n\n/**\n * Interface that is extended to represent a Repeating Node.\n * Repeating nodes are used any time a node can or must be repeated\n * N times, where N is the value of the \"formulaReps\" property.\n */\nexport interface AjfRepeatingNode extends AjfBaseNode {\n  /**\n   * Is the number of node repetition\n   * Example: \"opd_treatment == 'Yes' && ($groupReps || 1) || 0\"\n   */\n  // TODO(peppedeka) WARNING: currently, formulaReps is NOT evaluated.\n  // If formulaReps is set to any value, no repetition is allowed.\n  // The number of possible repetitions is currently determined by maxReps (if set).\n  formulaReps?: AjfFormula;\n\n  /**\n   *  Max number of repetitions\n   */\n  maxReps: number;\n\n  /**\n   *  Min number of repetitions\n   */\n  minReps: number;\n\n  /**\n   * If true show all slides of repeating node in readonly mode.\n   * Except the last slide.\n   * In the last slide remove button is always disabled and add button is enabled\n   * only when the last slide is valid.\n   */\n  disableRemoval?: boolean;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition} from '@ajf/core/models';\nimport {EventEmitter} from '@angular/core';\n\nimport {AjfNode} from '../nodes/node';\n\n/**\n * The instance of an ajfNode.\n * A single ajfNode can have multiple instances with different values\n * differentiated by a suffix, when used in a repeating slide.\n * (eg.\n * country__0 = 'ITA', country__1 = 'ESP'\n * city__0__0 = 'Milano', city__0__1 = 'Roma', city__1__0 = 'Madrid'\n * )\n *\n * The AjfNodeInstance visibility is determined by the visibility of the current branch\n * and  the visibility condition of the node itself.\n * @see {@link updateVisibility}\n * @see {@link updateConditionalBranches}\n */\n// TODO Check if jsDoc @see and @link actually work and are displayed as intended\nexport interface AjfBaseNodeInstance {\n  /**\n   * The AjfNode blueprint from which this node instance is generated\n   */\n  node: AjfNode;\n\n  /**\n   * Array of prefixes that identifies the tree of all the ancestor nodes indexes\n   */\n  prefix: number[];\n\n  /**\n   * The current node visibility\n   */\n  visible: boolean;\n\n  /**\n   * List of conditions that determines the branch to be followed\n   */\n  conditionalBranches: AjfCondition[];\n\n  /**\n   * AjfCondition for handling visibility\n   */\n  visibility?: AjfCondition;\n\n  /**\n   * Identifies the index of the condition verified and is equal to the\n   * parentNode of branch that determines..?\n   */\n  // TODO ask Trik\n  verifiedBranch?: number;\n\n  /**\n   * Emitted when any property of the node instance has changed value\n   */\n  updatedEvt: EventEmitter<void>;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfRepeatingContainerNode} from '../nodes/repeating-container-node';\nimport {AjfContainerNodeInstance} from './container-node-instance';\nimport {AjfRepeatingNodeInstance} from './repeating-node-instance';\n\n/**\n * A node instance containing an AjfRepeatingContainerNode node.\n */\nexport interface AjfBaseRepeatingContainerNodeInstance\n  extends Omit<AjfContainerNodeInstance, 'node'>,\n    Omit<AjfRepeatingNodeInstance, 'node'> {\n  node: AjfRepeatingContainerNode;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseNodeInstance} from './base-node-instance';\nimport {AjfNodeInstance} from './node-instance';\n\n/**\n * An AjfNodeInstance that contains other AjfNodeInstances.\n */\nexport interface AjfContainerNodeInstance extends AjfBaseNodeInstance {\n  /**\n   * The children NodeInstances\n   */\n  nodes: AjfNodeInstance[];\n\n  /**\n   * A list of all the descendants NodeInstances, flattened in a single array\n   */\n  flatNodes: AjfNodeInstance[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeGroup} from '../nodes/node-group';\nimport {AjfBaseRepeatingContainerNodeInstance} from './base-repeating-container-node-instance';\n\n/**\n * A repeating container instance containing an AjfNodeGroup node.\n */\nexport interface AjfNodeGroupInstance extends AjfBaseRepeatingContainerNodeInstance {\n  node: AjfNodeGroup;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFieldInstance} from '../fields-instances/field-instance';\nimport {AjfRepeatingSlideInstance} from '../slides-instances/repeating-slide-instance';\nimport {AjfSlideInstance} from '../slides-instances/slide-instance';\nimport {AjfContainerNodeInstance} from './container-node-instance';\nimport {AjfRepeatingNodeInstance} from './repeating-node-instance';\n\nexport type AjfNodeInstance =\n  | AjfContainerNodeInstance\n  | AjfFieldInstance\n  | AjfRepeatingNodeInstance\n  | AjfRepeatingSlideInstance\n  | AjfSlideInstance;\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfRepeatingSlideInstance} from '../slides-instances/repeating-slide-instance';\nimport {AjfNodeGroupInstance} from './node-group-instance';\n\nexport type AjfRepeatingContainerNodeInstance = AjfNodeGroupInstance | AjfRepeatingSlideInstance;\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfFormula} from '@ajf/core/models';\nimport {AjfRepeatingNode} from '../../interface/nodes/repeating-node';\nimport {AjfBaseNodeInstance} from './base-node-instance';\n\n/**\n * A node instance containing an AjfRepeatingNode node.\n */\nexport interface AjfRepeatingNodeInstance extends AjfBaseNodeInstance {\n  /**\n   * The blueprint AjfRepeatingNode.\n   */\n  node: AjfRepeatingNode;\n\n  /**\n   * A formula that determines the number of repetitions calculated with the instance index.\n   */\n  formulaReps?: AjfFormula;\n\n  /**\n   * The numeric id of the current repetition.\n   */\n  reps: number;\n\n  /**\n   * True disable all slides eccept the last\n   */\n  disableRemoval?: boolean;\n\n  /**\n   * True if can add a new slide.\n   */\n  canAdd?: boolean;\n\n  /**\n   * True if can remove the current slide\n   */\n  canRemove?: boolean;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../nodes-instances/node-instance';\n\nexport interface AjfNodesInstancesOperation {\n  (nodes: AjfNodeInstance[]): AjfNodeInstance[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNode} from '../nodes/node';\n\nexport interface AjfNodesOperation {\n  (nodes: AjfNode[]): AjfNode[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfRendererUpdateMap} from '../renderer-maps/update-map';\n\nexport interface AjfRendererUpdateMapOperation {\n  (map: AjfRendererUpdateMap): AjfRendererUpdateMap;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeInstance} from '../nodes-instances/node-instance';\n\nexport interface AjfRendererUpdateMap {\n  [prop: string]: AjfNodeInstance[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfNodeType} from '../nodes/node-type';\nimport {AjfRepeatingContainerNode} from '../nodes/repeating-container-node';\n\n/**\n * An AjfRepeatingContainerNode of type AjfRepeatingSlide\n */\nexport interface AjfRepeatingSlide extends Omit<AjfRepeatingContainerNode, 'node'> {\n  nodeType: AjfNodeType.AjfRepeatingSlide;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContainerNode} from '../nodes/container-node';\nimport {AjfNodeType} from '../nodes/node-type';\n\n/**\n * An AjfContainerNode of type AjfSlide\n */\nexport interface AjfSlide extends AjfContainerNode {\n  nodeType: AjfNodeType.AjfSlide;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfContainerNodeInstance} from '../nodes-instances/container-node-instance';\nimport {AjfNodeInstance} from '../nodes-instances/node-instance';\n\n/**\n * An AjfContainerNodeInstance of type slide\n */\nexport interface AjfBaseSlideInstance extends AjfContainerNodeInstance {\n  /**\n   * The slide nodes.\n   * AjfSlideInstance use only the first element of the array.\n   * AjfRepeatingSlideInstance use one element for each repeating slide.\n   */\n  slideNodes: AjfNodeInstance[][];\n\n  /**\n   * False if at least one of the nodes is not valid\n   */\n  valid: boolean;\n\n  /**\n   * The current position of the slide\n   */\n  position: number;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfBaseRepeatingContainerNodeInstance} from '../nodes-instances/base-repeating-container-node-instance';\nimport {AjfRepeatingSlide} from '../slides/repeating-slide';\nimport {AjfBaseSlideInstance} from './base-slide-instance';\n\n/**\n * An AjfBaseSlideInstance with node of type AjfRepeatingSlide\n */\nexport interface AjfRepeatingSlideInstance\n  extends AjfBaseSlideInstance,\n    Omit<AjfBaseRepeatingContainerNodeInstance, 'node'> {\n  node: AjfRepeatingSlide;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition} from '@ajf/core/models';\n\n/**\n * An AjfCondition with the clientValidation option and a custom error message\n */\nexport interface AjfValidation extends AjfCondition {\n  /**\n   * True if client validation is enabled\n   */\n  clientValidation: boolean;\n\n  /**\n   * The error message to be used if the validation failed\n   */\n  errorMessage: string;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition} from '@ajf/core/models';\n\nimport {AjfValidation} from './validation';\n\n/**\n * A set of conditions\n */\nexport interface AjfValidationGroup {\n  forceValue?: AjfCondition;\n  maxValue?: AjfValidation;\n  minValue?: AjfValidation;\n  notEmpty?: AjfValidation;\n  notEmptyMessage?: string;\n  maxDigits?: AjfValidation;\n  minDigits?: AjfValidation;\n  conditions: AjfValidation[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/**\n * The result of the evaluation of a validation condition\n */\nexport interface AjfValidationResult {\n  /**\n   * True if the condition is valid\n   */\n  result: boolean;\n\n  /**\n   * The error message if the result is false\n   */\n  error: string;\n\n  /**\n   * The default value is false\n   */\n  // TODO() Check if it is actually used\n  clientValidation: boolean;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCondition} from '@ajf/core/models';\n\nexport interface AjfWarning extends AjfCondition {\n  warningMessage: string;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfWarning} from './warning';\n\nexport interface AjfWarningGroup {\n  notEmpty?: AjfWarning;\n  conditions: AjfWarning[];\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport interface AjfWarningResult {\n  result: boolean;\n  warning: string;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesFixedOrigin} from '../../interface/choices/choices-fixed-origin';\nimport {AjfChoicesOriginCreate, createChoicesOrigin} from './create-choices-origin';\n\nexport type AjfChoicesFixedOriginCreate<T> = Omit<AjfChoicesOriginCreate<T>, 'type'> &\n  Partial<AjfChoicesFixedOrigin<T>>;\n/**\n *  Create a AjfChoicesOrigin&lt;T&gt;, apply type attrinute as 'fixed'\n */\nexport function createChoicesFixedOrigin<T = string | number>(\n  origin: AjfChoicesFixedOriginCreate<T>,\n): AjfChoicesFixedOrigin<T> {\n  const type = 'fixed';\n  return {...createChoicesOrigin({...origin, type}), type};\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesFunctionOrigin} from '../../interface/choices/choices-function-origin';\nimport {AjfChoicesOriginCreate} from './create-choices-origin';\n\nexport type AjfChoicesFunctionOriginCreate<T> = Omit<AjfChoicesOriginCreate<T>, 'type'> &\n  Pick<AjfChoicesFunctionOrigin<T>, 'generator'> &\n  Partial<AjfChoicesFunctionOrigin<T>>;\n/**\n *  Create a AjfChoicesOrigin&lt;T&gt;, apply type attrinute as 'function'\n *  apply default value for label and choices\n */\nexport function createChoicesFunctionOrigin<T>(\n  origin: AjfChoicesFunctionOriginCreate<T>,\n): AjfChoicesFunctionOrigin<T> {\n  return {\n    ...origin,\n    type: 'function',\n    label: origin.label || '',\n    choices: origin.choices || [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesObservableArrayOrigin} from '../../interface/choices/choices-observable-array-origin';\nimport {AjfChoicesOriginCreate} from './create-choices-origin';\n\nexport type AjfChoicesObservableArrayOriginCreate<T> = Omit<AjfChoicesOriginCreate<T>, 'type'> &\n  Pick<AjfChoicesObservableArrayOrigin<T>, 'generator'> &\n  Partial<AjfChoicesObservableArrayOrigin<T>>;\n\n/**\n *  Create a AjfChoicesOrigin&lt;T&gt;, apply type attrinute as 'observableArray'\n *  apply default value for label and choices\n */\nexport function createChoicesObservableArrayOrigin<T>(\n  origin: AjfChoicesObservableArrayOriginCreate<T>,\n): AjfChoicesObservableArrayOrigin<T> {\n  return {\n    ...origin,\n    type: 'observableArray',\n    label: origin.label || '',\n    choices: origin.choices || [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesObservableOrigin} from '../../interface/choices/choices-observable-origin';\nimport {AjfChoicesOriginCreate} from './create-choices-origin';\n\nexport type AjfChoicesObservableOriginCreate<T> = Omit<AjfChoicesOriginCreate<T>, 'type'> &\n  Pick<AjfChoicesObservableOrigin<T>, 'generator'> &\n  Partial<AjfChoicesObservableOrigin<T>>;\n\n/**\n *  Create a AjfChoicesOrigin&lt;T&gt;, apply type attrinute as 'observable'\n *  apply default value for label and choices\n */\nexport function createChoicesObservableOrigin<T>(\n  origin: AjfChoicesObservableOriginCreate<T>,\n): AjfChoicesObservableOrigin<T> {\n  return {\n    ...origin,\n    type: 'observable',\n    label: origin.label || '',\n    choices: origin.choices || [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesPromiseOrigin} from '../../interface/choices/choices-promise-origin';\nimport {AjfChoicesOriginCreate} from './create-choices-origin';\n\nexport type AjfChoicesPromiseOriginCreate<T> = Omit<AjfChoicesOriginCreate<T>, 'type'> &\n  Pick<AjfChoicesPromiseOrigin<T>, 'generator'> &\n  Partial<AjfChoicesPromiseOrigin<T>>;\n/**\n *  Create a AjfChoicesOrigin&lt;T&gt;, apply type attrinute as 'promise'\n *  apply default value for label and choices\n */\nexport function createChoicesPromiseOrigin<T>(\n  origin: AjfChoicesPromiseOriginCreate<T>,\n): AjfChoicesPromiseOrigin<T> {\n  return {\n    ...origin,\n    type: 'promise',\n    label: origin.label || '',\n    choices: origin.choices || [],\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/**\n * isChoicesOrigin check if co parameter is defined and if correctly implements choicheOrigin\n * interface\n */\nexport function isChoicesOrigin(co: any): boolean {\n  return (\n    co != null &&\n    typeof co === 'object' &&\n    co.name != null &&\n    typeof co.name === 'string' &&\n    co.label != null &&\n    typeof co.label === 'string' &&\n    ['fixed', 'promise', 'observable', 'observableArray', 'function'].indexOf(co.type) > -1 &&\n    co.choices instanceof Array\n  );\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfChoicesOrigin} from '../../interface/choices/choices-origin';\nimport {isChoicesOrigin} from './is-choices-origin';\n\n/**\n * isChoicesFixedOrigin check if origin parameter is ChoicesOrigin and  type is 'fixed'\n */\nexport function isChoicesFixedOrigin(origin: AjfChoicesOrigin<any>): boolean {\n  return isChoicesOrigin(origin) && origin.type === 'fixed';\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfNumberField} from '../../interface/fields/number-field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\n\n/**\n * It is true if the field type is Number.\n */\nexport function isNumberField(field: AjfField): field is AjfNumberField {\n  return field.fieldType === AjfFieldType.Number;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfRangeField} from '../../interface/fields/range-field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\n\n/**\n * It is true if the field is a range field\n */\nexport function isRangeField(field: AjfField): field is AjfRangeField {\n  return field.fieldType === AjfFieldType.Range;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField} from '../../interface/fields/field';\nimport {AjfFieldType} from '../../interface/fields/field-type';\nimport {AjfEmptyField} from '../../interface/fields/empty-field';\n\n/**\n * It is true if the field is an empty field\n */\nexport function isEmptyField(field: AjfField): field is AjfEmptyField {\n  return field.fieldType === AjfFieldType.Empty;\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfForm} from '../../interface/forms/form';\n\nexport type AjfFormCreate = Partial<AjfForm>;\n\n/**\n * It creates an Ajf form.\n * Any missing mandatory attributes are initialized with the respective\n * empty object\n *\n * @export\n * @param [form={}]\n * @return {*}\n */\nexport function createForm(form: AjfFormCreate = {}): AjfForm {\n  return {\n    nodes: form.nodes || [],\n    choicesOrigins: form.choicesOrigins || [],\n    attachmentsOrigins: form.attachmentsOrigins || [],\n    initContext: form.initContext || {},\n    stringIdentifier: form.stringIdentifier || [],\n    supplementaryInformations: form.supplementaryInformations,\n  };\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {createValidation} from './create-validation';\n\n/**\n * It checks if the length of digits is less than or equal to maxValue and returns\n * an AjfValidation.\n */\nexport function maxDigitsValidation(maxValue: number): AjfValidation {\n  return createValidation({\n    condition: `$value ? $value.toString().length <= ${maxValue.toString()} : false`,\n    errorMessage: 'Digits count must be <= ' + maxValue.toString(),\n  });\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {createValidation} from './create-validation';\n\n/**\n * It checks if the value is less than or equal to maxValue and returns\n * an AjfValidation.\n */\nexport function maxValidation(maxValue: number): AjfValidation {\n  return createValidation({\n    condition: '$value <= ' + maxValue.toString(),\n    errorMessage: 'Value must be <= ' + maxValue.toString(),\n  });\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {createValidation} from './create-validation';\n\n/**\n * It checks if the length of digits is greater than or equal to minValue and returns\n * an AjfValidation.\n */\nexport function minDigitsValidation(minValue: number): AjfValidation {\n  return createValidation({\n    condition: `$value ? $value.toString().length >= ${minValue.toString()} : false`,\n    errorMessage: 'Digits count must be >= ' + minValue.toString(),\n  });\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {createValidation} from './create-validation';\n\n/**\n * It checks if the value is geater than or equal to minValue and returns\n * an AjfValidation.\n */\nexport function minValidation(minValue: number): AjfValidation {\n  return createValidation({\n    condition: '$value >= ' + minValue.toString(),\n    errorMessage: 'Value must be >= ' + minValue.toString(),\n  });\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfValidation} from '../../interface/validation/validation';\nimport {createValidation} from './create-validation';\n\n/**\n * It creates an AjfValidation with notEmpty condition.\n */\nexport function notEmptyValidation(): AjfValidation {\n  return createValidation({condition: `notEmpty($value)`, errorMessage: `Value must not be empty`});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfWarning} from '../../interface/warning/warning';\nimport {createWarning} from './create-warning';\n\nexport function notEmptyWarning(): AjfWarning {\n  return createWarning({condition: 'notEmpty($value)', warningMessage: 'Value must not be empty'});\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './as-validation-errors-string';\nexport * from './as-field-instance';\nexport * from './as-repeating-slide-instance';\nexport * from './audio-field';\nexport * from './base-field';\nexport * from './bool-to-int';\nexport * from './date-value';\nexport * from './date-value-string';\nexport * from './errors';\nexport * from './expand-input-with-choices';\nexport * from './field';\nexport * from './field-host';\nexport * from './field-icon';\nexport * from './field-is-valid';\nexport * from './field-service';\nexport * from './field-utils';\nexport * from './field-warning-alert-result';\nexport * from './field-with-choices';\nexport * from './file-field';\nexport * from './form';\nexport * from './form-renderer';\nexport * from './form-string-identifier';\nexport * from './forms-module';\nexport * from './get-table-cell-control';\nexport * from './increment';\nexport * from './input-field';\nexport * from './image-field';\nexport * from './is-cell-editable';\nexport * from './is-readonly-input-field';\nexport * from './is-repeating-slide';\nexport * from './node-complete-name';\nexport * from './range';\nexport * from './read-only-file-field';\nexport * from './read-only-date-field';\nexport * from './read-only-geolocation-field';\nexport * from './read-only-image-field';\nexport * from './read-only-select-field';\nexport * from './read-only-video-url-field';\nexport * from './search-alert-threshold';\nexport * from './serializers/attachments-origin-serializer';\nexport * from './serializers/choices-origin-serializer';\nexport * from './serializers/form-serializer';\nexport * from './serializers/node-serializer';\nexport * from './serializers/validation-group-serializer';\nexport * from './serializers/warning-group-serializer';\nexport * from './table-field';\nexport * from './table-row-class';\nexport * from './table-visible-columns';\nexport * from './valid-slide';\nexport * from './validation-service';\nexport * from './video-url-field';\nexport * from './warning-alert-service';\nexport * from './random-ajf-context-generator';\nexport * from './read-only-field';\nexport * from './read-only-table-field';\n\nexport * from './form-to-pdf/form-to-pdf';\nexport * from './form-to-pdf/form-to-doc';\n\nexport * from './interface/attachments/attachment';\nexport * from './interface/attachments/attachments-fixed-origin';\nexport * from './interface/attachments/attachments-origin';\nexport * from './interface/attachments/attachments-type';\nexport * from './interface/choices/base-choices-origin';\nexport * from './interface/choices/choice';\nexport * from './interface/choices/choices-fixed-origin';\nexport * from './interface/choices/choices-function';\nexport * from './interface/choices/choices-function-origin';\nexport * from './interface/choices/choices-observable-array-origin';\nexport * from './interface/choices/choices-observable-origin';\nexport * from './interface/choices/choices-origin';\nexport * from './interface/choices/choices-origin-type';\nexport * from './interface/choices/choices-promise-origin';\nexport * from './interface/choices/choices-type';\nexport * from './interface/fields/base-field';\nexport * from './interface/fields/boolean-field';\nexport * from './interface/fields/date-range-field';\nexport * from './interface/fields/date-input-field';\nexport * from './interface/fields/empty-field';\nexport * from './interface/fields/field';\nexport * from './interface/fields/field-components-map';\nexport * from './interface/fields/field-size';\nexport * from './interface/fields/field-type';\nexport * from './interface/fields/field-with-choices';\nexport * from './interface/fields/file-field';\nexport * from './interface/fields/formula-field';\nexport * from './interface/fields/multiple-choice-field';\nexport * from './interface/fields/number-field';\nexport * from './interface/fields/range-field';\nexport * from './interface/fields/single-choice-field';\nexport * from './interface/fields/string-field';\nexport * from './interface/fields/table-field';\nexport * from './interface/fields/text-field';\nexport * from './interface/fields/time-field';\nexport * from './interface/fields-instances/date-field-instance';\nexport * from './interface/fields-instances/date-input-field-instance';\nexport * from './interface/fields-instances/empty-field-instance';\nexport * from './interface/fields-instances/field-instance';\nexport * from './interface/fields-instances/field-state';\nexport * from './interface/fields-instances/field-with-choices-instance';\nexport * from './interface/fields-instances/formula-field-instance';\nexport * from './interface/fields-instances/range-field-instance';\nexport * from './interface/fields-instances/table-field-instance';\nexport * from './interface/forms/form';\nexport * from './interface/forms/form-string-identifier';\nexport * from './interface/nodes/base-node';\nexport * from './interface/nodes/container-node';\nexport * from './interface/nodes/node';\nexport * from './interface/nodes/node-group';\nexport * from './interface/nodes/node-link';\nexport * from './interface/nodes/node-type';\nexport * from './interface/nodes/repeating-container-node';\nexport * from './interface/nodes/repeating-node';\nexport * from './interface/nodes-instances/base-node-instance';\nexport * from './interface/nodes-instances/base-repeating-container-node-instance';\nexport * from './interface/nodes-instances/container-node-instance';\nexport * from './interface/nodes-instances/node-group-instance';\nexport * from './interface/nodes-instances/node-instance';\nexport * from './interface/nodes-instances/repeating-container-node-instance';\nexport * from './interface/nodes-instances/repeating-node-instance';\nexport * from './interface/operations/nodes-instances-operation';\nexport * from './interface/operations/nodes-operation';\nexport * from './interface/operations/renderer-update-map-operation';\nexport * from './interface/renderer-maps/update-map';\nexport * from './interface/slides/repeating-slide';\nexport * from './interface/slides/slide';\nexport * from './interface/slides-instances/base-slide-instance';\nexport * from './interface/slides-instances/repeating-slide-instance';\nexport * from './interface/slides-instances/slide-instance';\nexport * from './interface/validation/validation';\nexport * from './interface/validation/validation-group';\nexport * from './interface/validation/validation-results';\nexport * from './interface/warning/warning';\nexport * from './interface/warning/warning-group';\nexport * from './interface/warning/warning-result';\n\nexport * from './utils/choices/create-choices-fixed-origin';\nexport * from './utils/choices/create-choices-function-origin';\nexport * from './utils/choices/create-choices-observable-array-origin';\nexport * from './utils/choices/create-choices-observable-origin';\nexport * from './utils/choices/create-choices-origin';\nexport * from './utils/choices/create-choices-promise-origin';\nexport * from './utils/choices/init-choices-origin';\nexport * from './utils/choices/is-choices-fixed-origin';\nexport * from './utils/choices/is-choices-origin';\nexport * from './utils/fields/create-field';\nexport * from './utils/fields/is-custom-field-with-choices';\nexport * from './utils/fields/is-field-with-choices';\nexport * from './utils/fields/is-number-field';\nexport * from './utils/fields/is-range-field';\nexport * from './utils/fields/is-empty-field';\nexport * from './utils/fields/is-table-field';\nexport * from './utils/fields-instances/create-field-instance';\nexport * from './utils/fields-instances/create-field-with-choices-instance';\nexport * from './utils/forms/build-form-string-identifier';\nexport * from './utils/forms/create-form';\nexport * from './utils/nodes/create-container-node';\nexport * from './utils/nodes/create-node';\nexport * from './utils/nodes/flatten-nodes';\nexport * from './utils/nodes/is-container-node';\nexport * from './utils/nodes/is-field';\nexport * from './utils/nodes/is-repeating-container-node';\nexport * from './utils/nodes/is-slides-node';\nexport * from './utils/nodes-instances/create-node-instance';\nexport * from './utils/validation/create-validation';\nexport * from './utils/validation/create-validation-group';\nexport * from './utils/warning/create-warning';\nexport * from './utils/warning/create-warning-group';\nexport * from './utils/validation/max-digits-validation';\nexport * from './utils/validation/max-validation';\nexport * from './utils/validation/min-digits-validation';\nexport * from './utils/validation/min-validation';\nexport * from './utils/validation/not-empty-validation';\nexport * from './utils/warning/not-empty-warning';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["obsOf","i1.AjfValidationService","i2","i3","i1.AjfFormRendererService","i4","i5","CoreComponent","i4.AjfGetTableCellControlPipe","i5.AjfTableRowClass","tableToPdf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;AAoBG;AAOH;;AAEG;MAEU,4BAA4B,CAAA;AACvC,IAAA,SAAS,CAAC,QAAyB,EAAA;QACjC,MAAM,aAAa,GAAG,QAA4B;AAClD,QAAA,IAAI,aAAa,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,iBAAiB;AAAE,YAAA,OAAO,IAAI;AACxE,QAAA,MAAM,MAAM,GAAG,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;AACzE,QAAA,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;+GALnC,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAA5B,4BAA4B,EAAA,IAAA,EAAA,0BAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA,CAAA;;4FAA5B,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA,EAAC,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,KAAK,EAAC;;;AC9BrD;;;;;;;;;;;;;;;;;;;;AAoBG;AAOH;;AAEG;MAEU,sBAAsB,CAAA;AACjC,IAAA,SAAS,CAAC,QAAyB,EAAA;AACjC,QAAA,OAAO,QAA4B;;+GAF1B,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CA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