@acorex-platform/module-assessment-management-client 0.0.56 → 0.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/fesm2022/{acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-juxXq2pM.mjs → acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-DxRFMK3k.mjs} +1472 -160
  2. package/fesm2022/acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-DxRFMK3k.mjs.map +1 -0
  3. package/fesm2022/{acorex-platform-module-assessment-management-client-assessment-voice.commands-CaElbuNh.mjs → acorex-platform-module-assessment-management-client-assessment-voice.commands-DGYCwZ7v.mjs} +2 -2
  4. package/fesm2022/{acorex-platform-module-assessment-management-client-assessment-voice.commands-CaElbuNh.mjs.map → acorex-platform-module-assessment-management-client-assessment-voice.commands-DGYCwZ7v.mjs.map} +1 -1
  5. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-questionnaire.mjs +1 -11
  6. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-questionnaire.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-template.mjs +1 -78
  8. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-template.mjs.map +1 -1
  9. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-DYpWu3Vx.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-DDCy1T4t.mjs} +6 -6
  10. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-DYpWu3Vx.mjs.map → acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-DDCy1T4t.mjs.map} +1 -1
  11. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-CUctZ-0K.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-DXJp2k3o.mjs} +2 -2
  12. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-CUctZ-0K.mjs.map → acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-DXJp2k3o.mjs.map} +1 -1
  13. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-C2JJw_JJ.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-Q7-5toSQ.mjs} +2 -2
  14. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-C2JJw_JJ.mjs.map → acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-Q7-5toSQ.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-D3y_rWUI.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-CPEpSSlP.mjs} +2 -2
  16. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-D3y_rWUI.mjs.map → acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-CPEpSSlP.mjs.map} +1 -1
  17. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-CVz5W0fF.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-DOG7yHv-.mjs} +3 -13
  18. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-DOG7yHv-.mjs.map +1 -0
  19. package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-template.entity-C01AW5NW.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-template.entity-BeYGYRb7.mjs} +3 -80
  20. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-template.entity-BeYGYRb7.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog.mjs +1 -1
  22. package/fesm2022/acorex-platform-module-assessment-management-client-contracts.mjs +33 -1
  23. package/fesm2022/acorex-platform-module-assessment-management-client-contracts.mjs.map +1 -1
  24. package/fesm2022/{acorex-platform-module-assessment-management-client-fill-assessment-session.command-CMIq-DDl.mjs → acorex-platform-module-assessment-management-client-fill-assessment-session.command-DY_9qPYh.mjs} +2 -2
  25. package/fesm2022/{acorex-platform-module-assessment-management-client-fill-assessment-session.command-CMIq-DDl.mjs.map → acorex-platform-module-assessment-management-client-fill-assessment-session.command-DY_9qPYh.mjs.map} +1 -1
  26. package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer-edit.component-BlGBTznW.mjs +112 -0
  27. package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer-edit.component-BlGBTznW.mjs.map +1 -0
  28. package/fesm2022/{acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-COZcUPEj.mjs → acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-CeLpGSGc.mjs} +4 -4
  29. package/fesm2022/{acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-COZcUPEj.mjs.map → acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-CeLpGSGc.mjs.map} +1 -1
  30. package/fesm2022/{acorex-platform-module-assessment-management-client-form-template-viewer.service-CvSRpoos.mjs → acorex-platform-module-assessment-management-client-form-template-viewer.service-DoO7ZQmw.mjs} +15 -11
  31. package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer.service-DoO7ZQmw.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-module-assessment-management-client-index-er5gI6QK.mjs +68 -0
  33. package/fesm2022/acorex-platform-module-assessment-management-client-index-er5gI6QK.mjs.map +1 -0
  34. package/fesm2022/{acorex-platform-module-assessment-management-client-open-form-template.command-CmR-xFHE.mjs → acorex-platform-module-assessment-management-client-open-form-template.command-Cz23Vkyv.mjs} +3 -3
  35. package/fesm2022/{acorex-platform-module-assessment-management-client-open-form-template.command-CmR-xFHE.mjs.map → acorex-platform-module-assessment-management-client-open-form-template.command-Cz23Vkyv.mjs.map} +1 -1
  36. package/fesm2022/{acorex-platform-module-assessment-management-client-preview-form-template.command-BEzE0620.mjs → acorex-platform-module-assessment-management-client-preview-form-template.command-DDQOvVpt.mjs} +2 -2
  37. package/fesm2022/{acorex-platform-module-assessment-management-client-preview-form-template.command-BEzE0620.mjs.map → acorex-platform-module-assessment-management-client-preview-form-template.command-DDQOvVpt.mjs.map} +1 -1
  38. package/fesm2022/{acorex-platform-module-assessment-management-client-preview-question.command-BGT8qB1_.mjs → acorex-platform-module-assessment-management-client-preview-question.command-D4YlqMUf.mjs} +2 -2
  39. package/fesm2022/{acorex-platform-module-assessment-management-client-preview-question.command-BGT8qB1_.mjs.map → acorex-platform-module-assessment-management-client-preview-question.command-D4YlqMUf.mjs.map} +1 -1
  40. package/fesm2022/{acorex-platform-module-assessment-management-client-preview-questionnaire.command-duK7Tjjp.mjs → acorex-platform-module-assessment-management-client-preview-questionnaire.command-BYh-3EP9.mjs} +2 -2
  41. package/fesm2022/{acorex-platform-module-assessment-management-client-preview-questionnaire.command-duK7Tjjp.mjs.map → acorex-platform-module-assessment-management-client-preview-questionnaire.command-BYh-3EP9.mjs.map} +1 -1
  42. package/fesm2022/{acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-B7_G_C5B.mjs → acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-DARYq7ZJ.mjs} +4 -4
  43. package/fesm2022/{acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-B7_G_C5B.mjs.map → acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-DARYq7ZJ.mjs.map} +1 -1
  44. package/fesm2022/acorex-platform-module-assessment-management-client-questionnaire-questions-editor-edit.component-DIktPLmP.mjs +69 -0
  45. package/fesm2022/acorex-platform-module-assessment-management-client-questionnaire-questions-editor-edit.component-DIktPLmP.mjs.map +1 -0
  46. package/fesm2022/acorex-platform-module-assessment-management-client-questionnaire-viewer-edit.component-BAoqjZ7K.mjs +78 -0
  47. package/fesm2022/acorex-platform-module-assessment-management-client-questionnaire-viewer-edit.component-BAoqjZ7K.mjs.map +1 -0
  48. package/fesm2022/{acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-daQL4OD_.mjs → acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-O-d2f3fv.mjs} +4 -4
  49. package/fesm2022/{acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-daQL4OD_.mjs.map → acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-O-d2f3fv.mjs.map} +1 -1
  50. package/fesm2022/acorex-platform-module-assessment-management-client-related-content-viewer-page-component.provider-D0Rkeywu.mjs +26 -0
  51. package/fesm2022/acorex-platform-module-assessment-management-client-related-content-viewer-page-component.provider-D0Rkeywu.mjs.map +1 -0
  52. package/fesm2022/acorex-platform-module-assessment-management-client-related-content-viewer-page.component-CI9AlM58.mjs +315 -0
  53. package/fesm2022/acorex-platform-module-assessment-management-client-related-content-viewer-page.component-CI9AlM58.mjs.map +1 -0
  54. package/fesm2022/{acorex-platform-module-assessment-management-client-review-assessment-session.command-CPeFh1m7.mjs → acorex-platform-module-assessment-management-client-review-assessment-session.command-CHeyD-AC.mjs} +2 -2
  55. package/fesm2022/{acorex-platform-module-assessment-management-client-review-assessment-session.command-CPeFh1m7.mjs.map → acorex-platform-module-assessment-management-client-review-assessment-session.command-CHeyD-AC.mjs.map} +1 -1
  56. package/fesm2022/acorex-platform-module-assessment-management-client-show-form-template-viewer-popup.command-DlpkbJCZ.mjs +117 -0
  57. package/fesm2022/acorex-platform-module-assessment-management-client-show-form-template-viewer-popup.command-DlpkbJCZ.mjs.map +1 -0
  58. package/fesm2022/acorex-platform-module-assessment-management-client-show-questionnaire-questions-popup.command-t67ngnrD.mjs +129 -0
  59. package/fesm2022/acorex-platform-module-assessment-management-client-show-questionnaire-questions-popup.command-t67ngnrD.mjs.map +1 -0
  60. package/fesm2022/acorex-platform-module-assessment-management-client-show-questionnaire-viewer-popup.command-DHgNcZ60.mjs +120 -0
  61. package/fesm2022/acorex-platform-module-assessment-management-client-show-questionnaire-viewer-popup.command-DHgNcZ60.mjs.map +1 -0
  62. package/fesm2022/{acorex-platform-module-assessment-management-client-template-picker.component-D_UCdFOH.mjs → acorex-platform-module-assessment-management-client-template-picker.component-DzboI7GV.mjs} +3 -3
  63. package/fesm2022/{acorex-platform-module-assessment-management-client-template-picker.component-D_UCdFOH.mjs.map → acorex-platform-module-assessment-management-client-template-picker.component-DzboI7GV.mjs.map} +1 -1
  64. package/fesm2022/{acorex-platform-module-assessment-management-client-template-widget-edit.component-DERabYdH.mjs → acorex-platform-module-assessment-management-client-template-widget-edit.component-3DZovs7s.mjs} +2 -2
  65. package/fesm2022/{acorex-platform-module-assessment-management-client-template-widget-edit.component-DERabYdH.mjs.map → acorex-platform-module-assessment-management-client-template-widget-edit.component-3DZovs7s.mjs.map} +1 -1
  66. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-cell-type-widget-edit.component-DRFfLOCE.mjs +90 -0
  67. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-cell-type-widget-edit.component-DRFfLOCE.mjs.map +1 -0
  68. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-grid.component-DENxbikr.mjs +77 -0
  69. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-grid.component-DENxbikr.mjs.map +1 -0
  70. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-schema-widget-edit.component-Bcvp2Dx5.mjs +236 -0
  71. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-schema-widget-edit.component-Bcvp2Dx5.mjs.map +1 -0
  72. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-widget-column.component-B3Lx7yuD.mjs +50 -0
  73. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-widget-column.component-B3Lx7yuD.mjs.map +1 -0
  74. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-widget-edit.component-CrvzEcSh.mjs +81 -0
  75. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-widget-edit.component-CrvzEcSh.mjs.map +1 -0
  76. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-widget-view.component-sSky9nAq.mjs +30 -0
  77. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet-widget-view.component-sSky9nAq.mjs.map +1 -0
  78. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet.util-T-kPrzoj.mjs +423 -0
  79. package/fesm2022/acorex-platform-module-assessment-management-client-test-sheet.util-T-kPrzoj.mjs.map +1 -0
  80. package/fesm2022/{acorex-platform-module-assessment-management-client-view-session-answers.command-DjJajIkL.mjs → acorex-platform-module-assessment-management-client-view-session-answers.command-CxZirYRJ.mjs} +2 -2
  81. package/fesm2022/{acorex-platform-module-assessment-management-client-view-session-answers.command-DjJajIkL.mjs.map → acorex-platform-module-assessment-management-client-view-session-answers.command-CxZirYRJ.mjs.map} +1 -1
  82. package/fesm2022/acorex-platform-module-assessment-management-client.mjs +1 -1
  83. package/i18n/en-AU/assessment-management.json +69 -0
  84. package/i18n/en-AU/form-template-management.json +8 -0
  85. package/i18n/en-US/assessment-management.json +69 -0
  86. package/i18n/en-US/form-template-management.json +8 -0
  87. package/i18n/fa-IR/assessment-management.json +69 -0
  88. package/i18n/fa-IR/form-template-management.json +8 -0
  89. package/package.json +3 -3
  90. package/types/acorex-platform-module-assessment-management-client-contracts.d.ts +23 -3
  91. package/types/acorex-platform-module-assessment-management-client.d.ts +10 -1
  92. package/fesm2022/acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-juxXq2pM.mjs.map +0 -1
  93. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-CVz5W0fF.mjs.map +0 -1
  94. package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-template.entity-C01AW5NW.mjs.map +0 -1
  95. package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer.service-CvSRpoos.mjs.map +0 -1
@@ -6,7 +6,7 @@ import { inject, Injectable } from '@angular/core';
6
6
  import { get, first, defaultTo, isString } from 'lodash';
7
7
  import { Router } from '@angular/router';
8
8
  import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
9
- import { a as AXMQuestionnaireViewerService } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-juxXq2pM.mjs';
9
+ import { h as AXMQuestionnaireViewerService } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-DxRFMK3k.mjs';
10
10
  import { RootConfig, toPrintSettings, toDisplaySettings, normalizeCompletionMode, toPrePostConfig } from '@acorex-platform/module-assessment-management-client/contracts';
11
11
 
12
12
  //#endregion
@@ -274,4 +274,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
274
274
  }] });
275
275
 
276
276
  export { FillAssessmentSessionCommand };
277
- //# sourceMappingURL=acorex-platform-module-assessment-management-client-fill-assessment-session.command-CMIq-DDl.mjs.map
277
+ //# sourceMappingURL=acorex-platform-module-assessment-management-client-fill-assessment-session.command-DY_9qPYh.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-assessment-management-client-fill-assessment-session.command-CMIq-DDl.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/questionnaire-viewer/commands/fill-assessment-session.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, type AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\n\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPDebugService } from '@acorex-platform/framework-client/core';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, first, get, isString } from 'lodash';\nimport { Router } from '@angular/router';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXMQuestionnaireViewerService } from '../questionnaire-viewer.service';\nimport type { AXMAssessmentManagementAssessmentCaseEntityModel } from '@acorex-platform/module-assessment-management-client/contracts';\nimport type { AXMAssessmentManagementAssessmentSessionEntityModel } from '@acorex-platform/module-assessment-management-client/contracts';\nimport type { AXMAssessmentManagementQuestionnaireEntityModel } from '@acorex-platform/module-assessment-management-client/contracts';\nimport {\n normalizeCompletionMode,\n toDisplaySettings,\n toPrePostConfig,\n toPrintSettings,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport {\n RootConfig,\n type QuestionnaireCompletionMode,\n type QuestionnaireBuilderValue,\n} from '@acorex-platform/module-assessment-management-client/contracts';\n\n//#endregion\n\n//#region ---- Command Input/Output Types ----\n\n/**\n * How to show the questionnaire viewer when filling an assessment session.\n */\nexport type FillAssessmentSessionShowAs = 'popup' | 'page' | 'standalone';\n\nexport type FillAssessmentSessionOutcome = 'Submitted' | 'Saved' | 'Cancelled';\n\n/**\n * Input for FillAssessmentSession command.\n */\nexport interface FillAssessmentSessionCommandInput {\n caseId: string;\n sessionId?: string;\n /** Popup viewer title; falls back to assessment case title when omitted. */\n title?: AXPMultiLanguageString;\n showAs?: FillAssessmentSessionShowAs;\n responderId?: string;\n role?: 'responder' | 'supervisor' | 'reviewer';\n /** Overrides questionnaire display.completionMode when set. */\n completionMode?: QuestionnaireCompletionMode;\n /** Question answer keys that must stay readonly (e.g. asset prefill on work-order checklists). */\n readonlyAnswerKeys?: string[];\n}\n\n//#endregion\n\n//#region ---- Fill Assessment Session Command ----\n\n/**\n * Opens questionnaire viewer for filling/editing assessment session with draft save and workflow outcomes.\n */\n@Injectable()\nexport class FillAssessmentSessionCommand implements AXPCommand<FillAssessmentSessionCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly sessionService = inject(AXPSessionService);\n private readonly router = inject(Router);\n private readonly entityService = inject(AXPEntityService);\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly translationService = inject(AXTranslationService);\n private readonly debug = inject(AXPDebugService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: FillAssessmentSessionCommandInput): AXPCommandExecuteResultPromise<void> {\n try {\n const assessmentCase = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentCase.name)\n .data<string, AXMAssessmentManagementAssessmentCaseEntityModel>()\n .byKey(input.caseId);\n if (!assessmentCase) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@assessment-management:commands.fill-assessment-session.errors.case-not-found',\n { params: { caseId: input.caseId } },\n ),\n },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const questionnaire = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.questionnaire.name)\n .data<string, AXMAssessmentManagementQuestionnaireEntityModel>()\n .byKey(assessmentCase.questionnaireId);\n if (!questionnaire) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@assessment-management:commands.fill-assessment-session.errors.questionnaire-not-found',\n { params: { questionnaireId: assessmentCase.questionnaireId } },\n ),\n },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const questions = questionnaire.questions ?? { sections: [] };\n const structure: QuestionnaireBuilderValue = {\n ...questions,\n sections: questions.sections ?? [],\n displaySettings: toDisplaySettings(questionnaire) ?? undefined,\n printSettings: toPrintSettings(questionnaire) ?? undefined,\n };\n if (!structure.sections.length) {\n return {\n success: false,\n message: { text: '@assessment-management:commands.fill-assessment-session.errors.no-questions' },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const currentUser = this.sessionService.user;\n const responderId = input.responderId || currentUser?.id;\n if (!responderId) {\n return {\n success: false,\n message: { text: '@assessment-management:commands.fill-assessment-session.errors.no-responder' },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const role = input.role || 'responder';\n const displaySettings = toDisplaySettings(questionnaire);\n const completionMode: QuestionnaireCompletionMode =\n input.completionMode ?? normalizeCompletionMode(displaySettings?.completionMode);\n\n let existingSession: AXMAssessmentManagementAssessmentSessionEntityModel | null = null;\n let sessionId = input.sessionId ?? null;\n let initialAnswers: Record<string, unknown> = {};\n\n if (sessionId) {\n existingSession = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .byKey(sessionId);\n if (existingSession) {\n initialAnswers = (existingSession.answers as Record<string, unknown>) || {};\n }\n }\n\n const sessionSubmitted = existingSession?.statusId === 'submitted';\n\n const showAs = input.showAs ?? 'popup';\n const appName = this.sessionService.application?.name ?? 'demo';\n const moduleRoute = (RootConfig.module as { route?: string }).route ?? 'assessment-management';\n\n if (showAs === 'page') {\n const path = `/${appName}/${moduleRoute}/questionnaire/fill/${input.caseId}`;\n const url = sessionId ? `${path}?sessionId=${encodeURIComponent(sessionId)}` : path;\n this.router.navigateByUrl(url);\n return { success: true, kind: 'object', data: undefined, metadata: { outcome: 'Cancelled' } };\n }\n\n if (showAs === 'standalone') {\n let sessionIdToOpen = sessionId;\n if (!sessionIdToOpen) {\n const now = new Date();\n sessionIdToOpen = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .create({\n caseId: input.caseId,\n responderId,\n role,\n answers: {},\n progressPercentage: 0,\n answeredQuestionsCount: 0,\n lastSavedAt: now,\n startedAt: now,\n statusId: 'not-started',\n } as Omit<AXMAssessmentManagementAssessmentSessionEntityModel, 'id'>);\n }\n if (sessionIdToOpen) {\n this.router.navigateByUrl(`/assessment/fill/${sessionIdToOpen}`);\n }\n return { success: true, kind: 'object', data: undefined, metadata: { outcome: 'Cancelled' } };\n }\n\n const viewerTitle = await this.resolveViewerTitle(input.title, assessmentCase.title);\n\n const viewerConfig = {\n readonly: sessionSubmitted,\n completionMode,\n validationStrategy: displaySettings?.validationStrategy,\n viewMode: displaySettings?.viewMode,\n showProgressBar: displaySettings?.showProgressBar,\n timer: { showTimer: displaySettings?.showTimer ?? false },\n showQuestionNumbers: displaySettings?.showQuestionNumbers,\n readonlyAnswerKeys: input.readonlyAnswerKeys,\n };\n\n const result = await this.questionnaireViewerService.open({\n title: viewerTitle,\n structure,\n prePostConfig: toPrePostConfig(questionnaire),\n config: viewerConfig,\n initialAnswers,\n questionnaireId: questionnaire.id,\n assessmentFillContext: sessionSubmitted\n ? undefined\n : {\n caseId: input.caseId,\n sessionId: sessionId ?? null,\n responderId,\n role,\n },\n });\n\n const outcome = await this.resolveFillOutcome(input.caseId, input.sessionId ?? sessionId, result);\n this.debug.trace(\n 'assessment-management',\n 'fill-assessment-session',\n 'Resolved fill workflow outcome',\n () => ({\n caseId: input.caseId,\n sessionId: input.sessionId ?? sessionId,\n popupResult: {\n saved: result?.saved === true,\n submitted: result?.submitted === true,\n hasPayload: result != null,\n },\n outcome,\n }),\n );\n return { success: true, kind: 'object', data: undefined, metadata: { outcome },\n };\n } catch (error: unknown) {\n const fallback = await this.translationService.translateAsync(\n '@general:messages.generic.error.description',\n );\n const message = error instanceof Error ? error.message : fallback;\n console.error('Error filling assessment session:', error);\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@assessment-management:commands.fill-assessment-session.errors.failed',\n { params: { message } },\n ),\n },\n metadata: { outcome: 'Cancelled' },\n };\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n /**\n * Resolves popup title: explicit input, then case title, then translated default.\n */\n private async resolveViewerTitle(\n inputTitle: AXPMultiLanguageString | undefined,\n caseTitle: string | undefined,\n ): Promise<string> {\n const explicit = this.normalizeTitle(inputTitle);\n if (explicit) {\n return explicit;\n }\n\n const fromCase = this.normalizeTitle(caseTitle);\n if (fromCase) {\n return fromCase;\n }\n\n const fillTitleKey = '@assessment-management:cases.actions.fill-assessment.title';\n const fillTitleBase = await this.translationService.translateAsync(fillTitleKey);\n return fillTitleBase || 'Fill Assessment';\n }\n\n /** Resolves a multi-language or plain string title for the active locale. */\n private normalizeTitle(value: AXPMultiLanguageString | string | undefined | null | false): string {\n if (value == null || value === false) {\n return '';\n }\n if (typeof value === 'string') {\n return value.trim();\n }\n const locale = this.translationService.getActiveLang();\n return resolveMultiLanguageString(value, locale).trim();\n }\n\n /**\n * Resolves workflow outcome from popup result, falling back to persisted session status only\n * when the popup is dismissed without an explicit close payload.\n * After submit the viewer may show a summary step; closing via X without \"Done\" still leaves\n * the session submitted and must advance the workflow. Save-as-draft always sends an explicit\n * payload ({ saved: true }); inferring Submitted from the DB when a payload exists can wrongly\n * advance the workflow if flags are missing or a stale submitted session is resolved.\n */\n private async resolveFillOutcome(\n caseId: string,\n sessionId: string | null | undefined,\n result: { submitted?: boolean; saved?: boolean } | null | undefined,\n ): Promise<FillAssessmentSessionOutcome> {\n if (result?.saved) {\n return 'Saved';\n }\n if (result?.submitted) {\n return 'Submitted';\n }\n\n if (result != null) {\n return 'Cancelled';\n }\n\n const sessionSubmitted = await this.isAssessmentSessionSubmitted(caseId, sessionId);\n if (sessionSubmitted) {\n return 'Submitted';\n }\n\n return 'Cancelled';\n }\n\n private async isAssessmentSessionSubmitted(\n caseId: string,\n sessionId: string | null | undefined,\n ): Promise<boolean> {\n const resolvedSessionId = this.resolveText(sessionId) || (await this.findLatestSessionIdForCase(caseId));\n if (!resolvedSessionId) {\n return false;\n }\n\n const session = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .byKey(resolvedSessionId);\n\n return get(session, 'statusId') === 'submitted';\n }\n\n private async findLatestSessionIdForCase(caseId: string): Promise<string> {\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .query({\n skip: 0,\n take: 1,\n sort: [{ field: 'lastSavedAt', direction: 'desc' }],\n filter: {\n logic: 'and',\n filters: [{ field: 'caseId', operator: { type: 'equal' }, value: caseId }],\n },\n } as never);\n\n const session = first(defaultTo(get(page, 'items'), []));\n return this.resolveText(get(session, 'id'));\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAwDA;AAEA;AAEA;;AAEG;MAEU,4BAA4B,CAAA;AADzC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC;AAgTjD,IAAA;;;IA1SC,MAAM,OAAO,CAAC,KAAwC,EAAA;AACpD,QAAA,IAAI;AACF,YAAA,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC;AAC/B,iBAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI;AAC1E,iBAAA,IAAI;AACJ,iBAAA,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;YACtB,IAAI,CAAC,cAAc,EAAE;gBACnB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,+EAA+E,EAC/E,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,E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AAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GArTW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA5B,4BAA4B,EAAA,CAAA,CAAA;;2FAA5B,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC;;;"}
1
+ {"version":3,"file":"acorex-platform-module-assessment-management-client-fill-assessment-session.command-DY_9qPYh.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/questionnaire-viewer/commands/fill-assessment-session.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, type AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\n\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPDebugService } from '@acorex-platform/framework-client/core';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, first, get, isString } from 'lodash';\nimport { Router } from '@angular/router';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXMQuestionnaireViewerService } from '../questionnaire-viewer.service';\nimport type { AXMAssessmentManagementAssessmentCaseEntityModel } from '@acorex-platform/module-assessment-management-client/contracts';\nimport type { AXMAssessmentManagementAssessmentSessionEntityModel } from '@acorex-platform/module-assessment-management-client/contracts';\nimport type { AXMAssessmentManagementQuestionnaireEntityModel } from '@acorex-platform/module-assessment-management-client/contracts';\nimport {\n normalizeCompletionMode,\n toDisplaySettings,\n toPrePostConfig,\n toPrintSettings,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport {\n RootConfig,\n type QuestionnaireCompletionMode,\n type QuestionnaireBuilderValue,\n} from '@acorex-platform/module-assessment-management-client/contracts';\n\n//#endregion\n\n//#region ---- Command Input/Output Types ----\n\n/**\n * How to show the questionnaire viewer when filling an assessment session.\n */\nexport type FillAssessmentSessionShowAs = 'popup' | 'page' | 'standalone';\n\nexport type FillAssessmentSessionOutcome = 'Submitted' | 'Saved' | 'Cancelled';\n\n/**\n * Input for FillAssessmentSession command.\n */\nexport interface FillAssessmentSessionCommandInput {\n caseId: string;\n sessionId?: string;\n /** Popup viewer title; falls back to assessment case title when omitted. */\n title?: AXPMultiLanguageString;\n showAs?: FillAssessmentSessionShowAs;\n responderId?: string;\n role?: 'responder' | 'supervisor' | 'reviewer';\n /** Overrides questionnaire display.completionMode when set. */\n completionMode?: QuestionnaireCompletionMode;\n /** Question answer keys that must stay readonly (e.g. asset prefill on work-order checklists). */\n readonlyAnswerKeys?: string[];\n}\n\n//#endregion\n\n//#region ---- Fill Assessment Session Command ----\n\n/**\n * Opens questionnaire viewer for filling/editing assessment session with draft save and workflow outcomes.\n */\n@Injectable()\nexport class FillAssessmentSessionCommand implements AXPCommand<FillAssessmentSessionCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly sessionService = inject(AXPSessionService);\n private readonly router = inject(Router);\n private readonly entityService = inject(AXPEntityService);\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly translationService = inject(AXTranslationService);\n private readonly debug = inject(AXPDebugService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: FillAssessmentSessionCommandInput): AXPCommandExecuteResultPromise<void> {\n try {\n const assessmentCase = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentCase.name)\n .data<string, AXMAssessmentManagementAssessmentCaseEntityModel>()\n .byKey(input.caseId);\n if (!assessmentCase) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@assessment-management:commands.fill-assessment-session.errors.case-not-found',\n { params: { caseId: input.caseId } },\n ),\n },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const questionnaire = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.questionnaire.name)\n .data<string, AXMAssessmentManagementQuestionnaireEntityModel>()\n .byKey(assessmentCase.questionnaireId);\n if (!questionnaire) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@assessment-management:commands.fill-assessment-session.errors.questionnaire-not-found',\n { params: { questionnaireId: assessmentCase.questionnaireId } },\n ),\n },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const questions = questionnaire.questions ?? { sections: [] };\n const structure: QuestionnaireBuilderValue = {\n ...questions,\n sections: questions.sections ?? [],\n displaySettings: toDisplaySettings(questionnaire) ?? undefined,\n printSettings: toPrintSettings(questionnaire) ?? undefined,\n };\n if (!structure.sections.length) {\n return {\n success: false,\n message: { text: '@assessment-management:commands.fill-assessment-session.errors.no-questions' },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const currentUser = this.sessionService.user;\n const responderId = input.responderId || currentUser?.id;\n if (!responderId) {\n return {\n success: false,\n message: { text: '@assessment-management:commands.fill-assessment-session.errors.no-responder' },\n metadata: { outcome: 'Cancelled' },\n };\n }\n\n const role = input.role || 'responder';\n const displaySettings = toDisplaySettings(questionnaire);\n const completionMode: QuestionnaireCompletionMode =\n input.completionMode ?? normalizeCompletionMode(displaySettings?.completionMode);\n\n let existingSession: AXMAssessmentManagementAssessmentSessionEntityModel | null = null;\n let sessionId = input.sessionId ?? null;\n let initialAnswers: Record<string, unknown> = {};\n\n if (sessionId) {\n existingSession = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .byKey(sessionId);\n if (existingSession) {\n initialAnswers = (existingSession.answers as Record<string, unknown>) || {};\n }\n }\n\n const sessionSubmitted = existingSession?.statusId === 'submitted';\n\n const showAs = input.showAs ?? 'popup';\n const appName = this.sessionService.application?.name ?? 'demo';\n const moduleRoute = (RootConfig.module as { route?: string }).route ?? 'assessment-management';\n\n if (showAs === 'page') {\n const path = `/${appName}/${moduleRoute}/questionnaire/fill/${input.caseId}`;\n const url = sessionId ? `${path}?sessionId=${encodeURIComponent(sessionId)}` : path;\n this.router.navigateByUrl(url);\n return { success: true, kind: 'object', data: undefined, metadata: { outcome: 'Cancelled' } };\n }\n\n if (showAs === 'standalone') {\n let sessionIdToOpen = sessionId;\n if (!sessionIdToOpen) {\n const now = new Date();\n sessionIdToOpen = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .create({\n caseId: input.caseId,\n responderId,\n role,\n answers: {},\n progressPercentage: 0,\n answeredQuestionsCount: 0,\n lastSavedAt: now,\n startedAt: now,\n statusId: 'not-started',\n } as Omit<AXMAssessmentManagementAssessmentSessionEntityModel, 'id'>);\n }\n if (sessionIdToOpen) {\n this.router.navigateByUrl(`/assessment/fill/${sessionIdToOpen}`);\n }\n return { success: true, kind: 'object', data: undefined, metadata: { outcome: 'Cancelled' } };\n }\n\n const viewerTitle = await this.resolveViewerTitle(input.title, assessmentCase.title);\n\n const viewerConfig = {\n readonly: sessionSubmitted,\n completionMode,\n validationStrategy: displaySettings?.validationStrategy,\n viewMode: displaySettings?.viewMode,\n showProgressBar: displaySettings?.showProgressBar,\n timer: { showTimer: displaySettings?.showTimer ?? false },\n showQuestionNumbers: displaySettings?.showQuestionNumbers,\n readonlyAnswerKeys: input.readonlyAnswerKeys,\n };\n\n const result = await this.questionnaireViewerService.open({\n title: viewerTitle,\n structure,\n prePostConfig: toPrePostConfig(questionnaire),\n config: viewerConfig,\n initialAnswers,\n questionnaireId: questionnaire.id,\n assessmentFillContext: sessionSubmitted\n ? undefined\n : {\n caseId: input.caseId,\n sessionId: sessionId ?? null,\n responderId,\n role,\n },\n });\n\n const outcome = await this.resolveFillOutcome(input.caseId, input.sessionId ?? sessionId, result);\n this.debug.trace(\n 'assessment-management',\n 'fill-assessment-session',\n 'Resolved fill workflow outcome',\n () => ({\n caseId: input.caseId,\n sessionId: input.sessionId ?? sessionId,\n popupResult: {\n saved: result?.saved === true,\n submitted: result?.submitted === true,\n hasPayload: result != null,\n },\n outcome,\n }),\n );\n return { success: true, kind: 'object', data: undefined, metadata: { outcome },\n };\n } catch (error: unknown) {\n const fallback = await this.translationService.translateAsync(\n '@general:messages.generic.error.description',\n );\n const message = error instanceof Error ? error.message : fallback;\n console.error('Error filling assessment session:', error);\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@assessment-management:commands.fill-assessment-session.errors.failed',\n { params: { message } },\n ),\n },\n metadata: { outcome: 'Cancelled' },\n };\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n /**\n * Resolves popup title: explicit input, then case title, then translated default.\n */\n private async resolveViewerTitle(\n inputTitle: AXPMultiLanguageString | undefined,\n caseTitle: string | undefined,\n ): Promise<string> {\n const explicit = this.normalizeTitle(inputTitle);\n if (explicit) {\n return explicit;\n }\n\n const fromCase = this.normalizeTitle(caseTitle);\n if (fromCase) {\n return fromCase;\n }\n\n const fillTitleKey = '@assessment-management:cases.actions.fill-assessment.title';\n const fillTitleBase = await this.translationService.translateAsync(fillTitleKey);\n return fillTitleBase || 'Fill Assessment';\n }\n\n /** Resolves a multi-language or plain string title for the active locale. */\n private normalizeTitle(value: AXPMultiLanguageString | string | undefined | null | false): string {\n if (value == null || value === false) {\n return '';\n }\n if (typeof value === 'string') {\n return value.trim();\n }\n const locale = this.translationService.getActiveLang();\n return resolveMultiLanguageString(value, locale).trim();\n }\n\n /**\n * Resolves workflow outcome from popup result, falling back to persisted session status only\n * when the popup is dismissed without an explicit close payload.\n * After submit the viewer may show a summary step; closing via X without \"Done\" still leaves\n * the session submitted and must advance the workflow. Save-as-draft always sends an explicit\n * payload ({ saved: true }); inferring Submitted from the DB when a payload exists can wrongly\n * advance the workflow if flags are missing or a stale submitted session is resolved.\n */\n private async resolveFillOutcome(\n caseId: string,\n sessionId: string | null | undefined,\n result: { submitted?: boolean; saved?: boolean } | null | undefined,\n ): Promise<FillAssessmentSessionOutcome> {\n if (result?.saved) {\n return 'Saved';\n }\n if (result?.submitted) {\n return 'Submitted';\n }\n\n if (result != null) {\n return 'Cancelled';\n }\n\n const sessionSubmitted = await this.isAssessmentSessionSubmitted(caseId, sessionId);\n if (sessionSubmitted) {\n return 'Submitted';\n }\n\n return 'Cancelled';\n }\n\n private async isAssessmentSessionSubmitted(\n caseId: string,\n sessionId: string | null | undefined,\n ): Promise<boolean> {\n const resolvedSessionId = this.resolveText(sessionId) || (await this.findLatestSessionIdForCase(caseId));\n if (!resolvedSessionId) {\n return false;\n }\n\n const session = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .byKey(resolvedSessionId);\n\n return get(session, 'statusId') === 'submitted';\n }\n\n private async findLatestSessionIdForCase(caseId: string): Promise<string> {\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assessmentSession.name)\n .data<string, AXMAssessmentManagementAssessmentSessionEntityModel>()\n .query({\n skip: 0,\n take: 1,\n sort: [{ field: 'lastSavedAt', direction: 'desc' }],\n filter: {\n logic: 'and',\n filters: [{ field: 'caseId', operator: { type: 'equal' }, value: caseId }],\n },\n } as never);\n\n const session = first(defaultTo(get(page, 'items'), []));\n return this.resolveText(get(session, 'id'));\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAwDA;AAEA;AAEA;;AAEG;MAEU,4BAA4B,CAAA;AADzC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,aAAa,GA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AAM,IAAI,CAAC;AACrB,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI;AAC7E,aAAA,IAAI;AACJ,aAAA,KAAK,CAAC;AACL,YAAA,IAAI,EAAE,CAAC;AACP,YAAA,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACnD,YAAA,MAAM,EAAE;AACN,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3E,aAAA;AACO,SAAA,CAAC;AAEb,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7C;AAEQ,IAAA,WAAW,CAAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GArTW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA5B,4BAA4B,EAAA,CAAA,CAAA;;2FAA5B,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC;;;"}
@@ -0,0 +1,112 @@
1
+ import { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';
2
+ import { AXPLayoutRendererComponent } from '@acorex-platform/framework-client/layout/builder';
3
+ import { AXPValueWidgetComponent, readLocalDataSourcesFromNode, AXP_LOCAL_DATA_SOURCE_STORE, createReadonlyLocalDataSourceStore } from '@acorex-platform/framework-client/layout/widget-core';
4
+ import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
5
+ import * as i0 from '@angular/core';
6
+ import { signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
7
+ import { isPlainObject, isEqual } from 'lodash-es';
8
+
9
+ //#region ----- Component -----
10
+ class AXMFormTemplateViewerEditComponent extends AXPValueWidgetComponent {
11
+ get layoutMode() {
12
+ return this.mode === 'view' ? 'view' : 'edit';
13
+ }
14
+ //#endregion
15
+ //#region ----- Lifecycle -----
16
+ constructor() {
17
+ super();
18
+ //#region ----- State Signals -----
19
+ this.documentNode = signal(null, /* @ts-ignore */
20
+ ...(ngDevMode ? [{ debugName: "documentNode" }] : /* istanbul ignore next */ []));
21
+ //#endregion
22
+ //#region ----- Computed Properties -----
23
+ /** Local data sources declared on the template document. */
24
+ this.sources = computed(() => readLocalDataSourcesFromNode(this.documentNode()), /* @ts-ignore */
25
+ ...(ngDevMode ? [{ debugName: "sources" }] : /* istanbul ignore next */ []));
26
+ this.renderNode = computed(() => toFormTemplateRenderNode(this.documentNode()), /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "renderNode" }] : /* istanbul ignore next */ []));
28
+ this.fillContext = computed(() => {
29
+ const value = this.getValue();
30
+ return isPlainObject(value) ? value : {};
31
+ }, /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "fillContext" }] : /* istanbul ignore next */ []));
33
+ effect(() => {
34
+ const next = parseFormTemplateDocument(this.options()['template']);
35
+ untracked(() => {
36
+ if (!isEqual(next, this.documentNode())) {
37
+ this.documentNode.set(next);
38
+ }
39
+ });
40
+ });
41
+ }
42
+ //#endregion
43
+ //#region ----- Event Handlers -----
44
+ handleContextChange(context) {
45
+ if (this.layoutMode === 'view' || !isPlainObject(context)) {
46
+ return;
47
+ }
48
+ if (isEqual(context, this.getValue())) {
49
+ return;
50
+ }
51
+ this.setValue(context);
52
+ }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFormTemplateViewerEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
54
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMFormTemplateViewerEditComponent, isStandalone: true, selector: "axm-form-template-viewer", providers: [
55
+ {
56
+ provide: AXP_LOCAL_DATA_SOURCE_STORE,
57
+ useFactory: (host) => createReadonlyLocalDataSourceStore(() => host.sources()),
58
+ deps: [AXMFormTemplateViewerEditComponent],
59
+ },
60
+ ], usesInheritance: true, ngImport: i0, template: "@if (renderNode(); as node) {\n <!-- ----- Related form template, answers stored on this record ----- -->\n <axp-layout-renderer\n [layout]=\"node\"\n [context]=\"fillContext()\"\n [mode]=\"layoutMode\"\n (contextChange)=\"handleContextChange($event)\"\n ></axp-layout-renderer>\n}\n<!-- ----- Empty state when the related record has no template ----- -->\n@else {\n <axp-state-message\n icon=\"fa-light fa-file-lines\"\n [title]=\"'@form-template-management:templates.viewer.empty.title'\"\n [description]=\"'@form-template-management:templates.viewer.empty.description'\"\n ></axp-state-message>\n}\n", dependencies: [{ kind: "component", type: AXPLayoutRendererComponent, selector: "axp-layout-renderer", inputs: ["layout", "context", "look", "mode"], outputs: ["contextChange", "contextInitiated", "validityChange"] }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "titleParams", "descriptionParams", "look"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
61
+ }
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFormTemplateViewerEditComponent, decorators: [{
63
+ type: Component,
64
+ args: [{ selector: 'axm-form-template-viewer', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXPLayoutRendererComponent, AXPStateMessageComponent], providers: [
65
+ {
66
+ provide: AXP_LOCAL_DATA_SOURCE_STORE,
67
+ useFactory: (host) => createReadonlyLocalDataSourceStore(() => host.sources()),
68
+ deps: [AXMFormTemplateViewerEditComponent],
69
+ },
70
+ ], template: "@if (renderNode(); as node) {\n <!-- ----- Related form template, answers stored on this record ----- -->\n <axp-layout-renderer\n [layout]=\"node\"\n [context]=\"fillContext()\"\n [mode]=\"layoutMode\"\n (contextChange)=\"handleContextChange($event)\"\n ></axp-layout-renderer>\n}\n<!-- ----- Empty state when the related record has no template ----- -->\n@else {\n <axp-state-message\n icon=\"fa-light fa-file-lines\"\n [title]=\"'@form-template-management:templates.viewer.empty.title'\"\n [description]=\"'@form-template-management:templates.viewer.empty.description'\"\n ></axp-state-message>\n}\n" }]
71
+ }], ctorParameters: () => [] });
72
+ //#endregion
73
+ //#region ----- Helpers -----
74
+ function parseFormTemplateDocument(value) {
75
+ let node = value;
76
+ if (typeof value === 'string') {
77
+ const trimmed = value.trim();
78
+ if (!trimmed) {
79
+ return null;
80
+ }
81
+ try {
82
+ node = JSON.parse(trimmed);
83
+ }
84
+ catch {
85
+ return null;
86
+ }
87
+ }
88
+ if (!node || typeof node !== 'object' || typeof node.type !== 'string') {
89
+ return null;
90
+ }
91
+ return node;
92
+ }
93
+ /** Document nodes have no renderer. Show their pages instead. */
94
+ function toFormTemplateRenderNode(source) {
95
+ if (!source?.type) {
96
+ return null;
97
+ }
98
+ if (source.type !== AXPWidgetsCatalog.document) {
99
+ return source;
100
+ }
101
+ const pages = (source.children ?? []).filter((child) => !!child?.type);
102
+ if (pages.length === 0) {
103
+ return null;
104
+ }
105
+ if (pages.length === 1) {
106
+ return pages[0];
107
+ }
108
+ return { type: AXPWidgetsCatalog.blockLayout, children: pages };
109
+ }
110
+
111
+ export { AXMFormTemplateViewerEditComponent };
112
+ //# sourceMappingURL=acorex-platform-module-assessment-management-client-form-template-viewer-edit.component-BlGBTznW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-assessment-management-client-form-template-viewer-edit.component-BlGBTznW.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/content-display/form-template-viewer/form-template-viewer-edit.component.ts","../../../../libs/modules/assessment-management/client/src/lib/features/content-display/form-template-viewer/form-template-viewer-edit.component.html"],"sourcesContent":["import { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';\nimport { AXPLayoutRendererComponent } from '@acorex-platform/framework-client/layout/builder';\nimport {\n AXP_LOCAL_DATA_SOURCE_STORE,\n AXPValueWidgetComponent,\n createReadonlyLocalDataSourceStore,\n readLocalDataSourcesFromNode,\n} from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPWidgetsCatalog, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\nimport { ChangeDetectionStrategy, Component, computed, effect, signal, untracked } from '@angular/core';\nimport { isEqual, isPlainObject } from 'lodash-es';\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-form-template-viewer',\n templateUrl: './form-template-viewer-edit.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXPLayoutRendererComponent, AXPStateMessageComponent],\n providers: [\n {\n provide: AXP_LOCAL_DATA_SOURCE_STORE,\n useFactory: (host: AXMFormTemplateViewerEditComponent) =>\n createReadonlyLocalDataSourceStore(() => host.sources()),\n deps: [AXMFormTemplateViewerEditComponent],\n },\n ],\n})\nexport class AXMFormTemplateViewerEditComponent extends AXPValueWidgetComponent<Record<string, unknown> | null> {\n //#region ----- State Signals -----\n\n private readonly documentNode = signal<AXPWidgetNode | null>(null);\n\n //#endregion\n\n //#region ----- Computed Properties -----\n\n /** Local data sources declared on the template document. */\n readonly sources = computed(() => readLocalDataSourcesFromNode(this.documentNode()));\n\n protected readonly renderNode = computed(() => toFormTemplateRenderNode(this.documentNode()));\n\n protected readonly fillContext = computed(() => {\n const value = this.getValue();\n return isPlainObject(value) ? value : {};\n });\n\n protected get layoutMode(): 'view' | 'edit' {\n return this.mode === 'view' ? 'view' : 'edit';\n }\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n constructor() {\n super();\n effect(() => {\n const next = parseFormTemplateDocument(this.options()['template']);\n untracked(() => {\n if (!isEqual(next, this.documentNode())) {\n this.documentNode.set(next);\n }\n });\n });\n }\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected handleContextChange(context: unknown): void {\n if (this.layoutMode === 'view' || !isPlainObject(context)) {\n return;\n }\n if (isEqual(context, this.getValue())) {\n return;\n }\n this.setValue(context as Record<string, unknown>);\n }\n\n //#endregion\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction parseFormTemplateDocument(value: unknown): AXPWidgetNode | null {\n let node: unknown = value;\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed) {\n return null;\n }\n try {\n node = JSON.parse(trimmed) as unknown;\n } catch {\n return null;\n }\n }\n if (!node || typeof node !== 'object' || typeof (node as AXPWidgetNode).type !== 'string') {\n return null;\n }\n return node as AXPWidgetNode;\n}\n\n/** Document nodes have no renderer. Show their pages instead. */\nfunction toFormTemplateRenderNode(source: AXPWidgetNode | null): AXPWidgetNode | null {\n if (!source?.type) {\n return null;\n }\n if (source.type !== AXPWidgetsCatalog.document) {\n return source;\n }\n const pages = (source.children ?? []).filter((child) => !!child?.type);\n if (pages.length === 0) {\n return null;\n }\n if (pages.length === 1) {\n return pages[0];\n }\n return { type: AXPWidgetsCatalog.blockLayout, children: pages };\n}\n\n//#endregion\n","@if (renderNode(); as node) {\n <!-- ----- Related form template, answers stored on this record ----- -->\n <axp-layout-renderer\n [layout]=\"node\"\n [context]=\"fillContext()\"\n [mode]=\"layoutMode\"\n (contextChange)=\"handleContextChange($event)\"\n ></axp-layout-renderer>\n}\n<!-- ----- Empty state when the related record has no template ----- -->\n@else {\n <axp-state-message\n icon=\"fa-light fa-file-lines\"\n [title]=\"'@form-template-management:templates.viewer.empty.title'\"\n [description]=\"'@form-template-management:templates.viewer.empty.description'\"\n ></axp-state-message>\n}\n"],"names":[],"m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,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC;AACtE,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AACtB,QAAA,OAAO,IAAI;IACb;AACA,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AACtB,QAAA,OAAO,KAAK,CAAC,CAAC,CAAC;IACjB;IACA,OAAO,EAAE,IAAI,EAAE,iBAAiB,CAAC,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;AACjE;;"}
@@ -5,7 +5,7 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
5
5
  import * as i1$1 from '@acorex/components/form';
6
6
  import { AXFormModule } from '@acorex/components/form';
7
7
  import { AXBasePageComponent } from '@acorex/components/page';
8
- import * as i4 from '@acorex/core/translation';
8
+ import * as i3$1 from '@acorex/core/translation';
9
9
  import { AXTranslationService, resolveMultiLanguageString, AXTranslationModule } from '@acorex/core/translation';
10
10
  import { DomSanitizer } from '@angular/platform-browser';
11
11
  import * as i1$2 from '@acorex-platform/framework-client/layout/widget-core';
@@ -15,7 +15,7 @@ import * as i3 from '@angular/common';
15
15
  import { CommonModule } from '@angular/common';
16
16
  import * as i0 from '@angular/core';
17
17
  import { inject, viewChild, signal, computed, effect, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
18
- import { a as AXMQuestionnaireViewerService, k as resolveSummaryPlaceholders, g as AXMPreQuestionnaireContentComponent, h as AXMPostQuestionnaireContentComponent } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-juxXq2pM.mjs';
18
+ import { h as AXMQuestionnaireViewerService, B as resolveSummaryPlaceholders, o as AXMPreQuestionnaireContentComponent, q as AXMPostQuestionnaireContentComponent } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-DxRFMK3k.mjs';
19
19
 
20
20
  //#region ----- Imports -----
21
21
  const EMPTY_OUTCOME_STRUCTURE = { sections: [] };
@@ -210,7 +210,7 @@ class AXMFormTemplateViewerPopupComponent extends AXBasePageComponent {
210
210
  useFactory: (host) => createReadonlyLocalDataSourceStore(() => host.sources()),
211
211
  deps: [AXMFormTemplateViewerPopupComponent],
212
212
  },
213
- ], viewQueries: [{ propertyName: "formRef", first: true, predicate: ["form"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"__content-area flex flex-1 min-h-0 flex-col\"\n [class.overflow-hidden]=\"flowStep() === 'form' || flowStep() === 'review'\"\n [class.overflow-y-auto]=\"flowStep() !== 'form' && flowStep() !== 'review'\"\n>\n <!-- ----- Welcome content before the form ----- -->\n @if (flowStep() === 'pre') {\n <axm-pre-questionnaire-content [content]=\"prePostConfig()?.pre?.content\"></axm-pre-questionnaire-content>\n }\n <!-- ----- Outcome results after submit ----- -->\n @else if (flowStep() === 'results') {\n <axm-post-questionnaire-content mode=\"results\" [placeholderValues]=\"submitResult()\"></axm-post-questionnaire-content>\n }\n <!-- ----- Summary content after submit ----- -->\n @else if (flowStep() === 'summary') {\n <div class=\"flex flex-col items-center justify-center p-8 min-h-[200px] text-on-surface\">\n <div class=\"max-w-2xl w-full prose text-on-surface\" [innerHTML]=\"summaryHtml()\"></div>\n </div>\n }\n <!-- ----- Form body, including readonly review ----- -->\n @else {\n <!-- ----- Review heading while the filled form is shown read-only ----- -->\n @if (flowStep() === 'review') {\n <div class=\"p-4 border-b border-surface\">\n <h2 class=\"text-lg font-semibold text-on-surface\">\n {{ '@form-template-management:templates.viewer.flow.review-title' | translate | async }}\n </h2>\n </div>\n }\n <div class=\"flex flex-1 min-h-0 flex-col overflow-y-auto overflow-x-hidden p-4\">\n <ax-form #form>\n <axp-widgets-container [context]=\"context\" (onContextChanged)=\"handleContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"currentPage()\" [mode]=\"widgetMode()\"></ng-container>\n </axp-widgets-container>\n </ax-form>\n </div>\n }\n</div>\n\n<ax-footer class=\"__popup-footer flex-shrink-0 border-t px-4 py-3\">\n <ax-suffix>\n <!-- ----- Welcome step ----- -->\n @if (flowStep() === 'pre') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.start' | translate | async\"\n (onClick)=\"handleStart()\"\n ></ax-button>\n }\n <!-- ----- Fill step ----- -->\n @else if (flowStep() === 'form') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <!-- ----- Review before submit when post review is enabled ----- -->\n @if (showReviewButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.review' | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleReviewClick()\"\n ></ax-button>\n }\n <!-- ----- Submit when review is off ----- -->\n @else if (showSubmitButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n }\n <!-- ----- Review step ----- -->\n @else if (flowStep() === 'review') {\n <ax-button\n look=\"outline\"\n [text]=\"'@form-template-management:templates.viewer.flow.edit' | translate | async\"\n (onClick)=\"handleEdit()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n <!-- ----- Outcome results step ----- -->\n @else if (flowStep() === 'results') {\n <!-- ----- Continue to the summary when it is enabled ----- -->\n @if (prePostConfig()?.post?.summaryEnabled) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.next.title' | translate | async\"\n (onClick)=\"handleResultsNext()\"\n ></ax-button>\n }\n <!-- ----- Close when there is no summary step ----- -->\n @else {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n }\n <!-- ----- Summary step ----- -->\n @else if (flowStep() === 'summary') {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n", styles: ["axm-form-template-viewer-popup{display:flex;height:100%;max-height:90vh;min-height:0px;width:100%;flex:1;flex-direction:column;overflow:hidden}@media(width>=64rem){axm-form-template-viewer-popup{max-height:75vh}}axm-form-template-viewer-popup .__content-area{min-height:0px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i1$1.AXFormComponent, selector: "ax-form", inputs: ["disabled", "readonly", "labelMode", "look", "messageStyle", "updateOn", "inUserInteractionActive"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "component", type: i1$2.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i1$2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged", "onLoad"], exportAs: ["widgetRenderer"] }, { kind: "component", type: AXMPreQuestionnaireContentComponent, selector: "axm-pre-questionnaire-content", inputs: ["content"] }, { kind: "component", type: AXMPostQuestionnaireContentComponent, selector: "axm-post-questionnaire-content", inputs: ["mode", "questionsWithAnswers", "reviewContext", "summaryContent", "placeholderValues", "locale", "showQuestionNumbers"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
213
+ ], viewQueries: [{ propertyName: "formRef", first: true, predicate: ["form"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"__content-area flex flex-1 min-h-0 flex-col\"\n [class.overflow-hidden]=\"flowStep() === 'form' || flowStep() === 'review'\"\n [class.overflow-y-auto]=\"flowStep() !== 'form' && flowStep() !== 'review'\"\n>\n <!-- ----- Welcome content before the form ----- -->\n @if (flowStep() === 'pre') {\n <axm-pre-questionnaire-content [content]=\"prePostConfig()?.pre?.content\"></axm-pre-questionnaire-content>\n }\n <!-- ----- Outcome results after submit ----- -->\n @else if (flowStep() === 'results') {\n <axm-post-questionnaire-content mode=\"results\" [placeholderValues]=\"submitResult()\"></axm-post-questionnaire-content>\n }\n <!-- ----- Summary content after submit ----- -->\n @else if (flowStep() === 'summary') {\n <div class=\"flex flex-col items-center justify-center p-8 min-h-[200px] text-on-surface\">\n <div class=\"max-w-2xl w-full prose text-on-surface\" [innerHTML]=\"summaryHtml()\"></div>\n </div>\n }\n <!-- ----- Form body, including readonly review ----- -->\n @else {\n <!-- ----- Review heading while the filled form is shown read-only ----- -->\n @if (flowStep() === 'review') {\n <div class=\"p-4 border-b border-surface\">\n <h2 class=\"text-lg font-semibold text-on-surface\">\n {{ '@form-template-management:templates.viewer.flow.review-title' | translate | async }}\n </h2>\n </div>\n }\n <div class=\"flex flex-1 min-h-0 flex-col overflow-y-auto overflow-x-hidden p-4\">\n <ax-form #form>\n <axp-widgets-container [context]=\"context\" (onContextChanged)=\"handleContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"currentPage()\" [mode]=\"widgetMode()\"></ng-container>\n </axp-widgets-container>\n </ax-form>\n </div>\n }\n</div>\n\n<ax-footer class=\"__popup-footer flex-shrink-0 border-t px-4 py-3\">\n <ax-suffix>\n <!-- ----- Welcome step ----- -->\n @if (flowStep() === 'pre') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.start' | translate | async\"\n (onClick)=\"handleStart()\"\n ></ax-button>\n }\n <!-- ----- Fill step ----- -->\n @else if (flowStep() === 'form') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <!-- ----- Review before submit when post review is enabled ----- -->\n @if (showReviewButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.review' | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleReviewClick()\"\n ></ax-button>\n }\n <!-- ----- Submit when review is off ----- -->\n @else if (showSubmitButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n }\n <!-- ----- Review step ----- -->\n @else if (flowStep() === 'review') {\n <ax-button\n look=\"outline\"\n [text]=\"'@form-template-management:templates.viewer.flow.edit' | translate | async\"\n (onClick)=\"handleEdit()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n <!-- ----- Outcome results step ----- -->\n @else if (flowStep() === 'results') {\n <!-- ----- Continue to the summary when it is enabled ----- -->\n @if (prePostConfig()?.post?.summaryEnabled) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.next.title' | translate | async\"\n (onClick)=\"handleResultsNext()\"\n ></ax-button>\n }\n <!-- ----- Close when there is no summary step ----- -->\n @else {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n }\n <!-- ----- Summary step ----- -->\n @else if (flowStep() === 'summary') {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n", styles: ["axm-form-template-viewer-popup{display:flex;height:100%;max-height:90vh;min-height:0px;width:100%;flex:1;flex-direction:column;overflow:hidden}@media(width>=64rem){axm-form-template-viewer-popup{max-height:75vh}}axm-form-template-viewer-popup .__content-area{min-height:0px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i1$1.AXFormComponent, selector: "ax-form", inputs: ["disabled", "readonly", "labelMode", "look", "messageStyle", "updateOn", "inUserInteractionActive"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "component", type: i1$2.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i1$2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged", "onLoad"], exportAs: ["widgetRenderer"] }, { kind: "component", type: AXMPreQuestionnaireContentComponent, selector: "axm-pre-questionnaire-content", inputs: ["content"] }, { kind: "component", type: AXMPostQuestionnaireContentComponent, selector: "axm-post-questionnaire-content", inputs: ["mode", "questionsWithAnswers", "reviewContext", "summaryContent", "placeholderValues", "locale", "showQuestionNumbers"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
214
214
  }
215
215
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFormTemplateViewerPopupComponent, decorators: [{
216
216
  type: Component,
@@ -235,4 +235,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
235
235
  }] } });
236
236
 
237
237
  export { AXMFormTemplateViewerPopupComponent };
238
- //# sourceMappingURL=acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-COZcUPEj.mjs.map
238
+ //# sourceMappingURL=acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-CeLpGSGc.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-COZcUPEj.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/pages/form-template-viewer-popup/form-template-viewer-popup.component.ts","../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/pages/form-template-viewer-popup/form-template-viewer-popup.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXFormComponent, AXFormModule } from '@acorex/components/form';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXTranslationModule, AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { DomSanitizer, type SafeHtml } from '@angular/platform-browser';\nimport {\n AXP_LOCAL_DATA_SOURCE_STORE,\n AXPWidgetCoreModule,\n createReadonlyLocalDataSourceStore,\n readLocalDataSourcesFromNode,\n} from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPContextChangeEvent, AXPWidgetsCatalog, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\nimport type {\n PrePostConfig,\n QuestionnaireBuilderValue,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n Input,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXMPreQuestionnaireContentComponent } from '../../../../questionnaire-viewer/components/pre-questionnaire-content';\nimport { AXMPostQuestionnaireContentComponent } from '../../../../questionnaire-viewer/components/post-questionnaire-content';\nimport { AXMQuestionnaireViewerService } from '../../../../questionnaire-viewer/questionnaire-viewer.service';\nimport {\n resolveSummaryPlaceholders,\n type SummaryPlaceholderValues,\n} from '../../../../questionnaire-viewer/utils/pre-post-content.utils';\nimport type { AXMFormTemplateViewerConfig, AXMFormTemplateViewerResult } from '../../form-template-viewer.types';\n\n//#endregion\n\n//#region ----- Types -----\n\ntype FormFlowStep = 'pre' | 'form' | 'review' | 'results' | 'summary';\n\nconst EMPTY_OUTCOME_STRUCTURE: QuestionnaireBuilderValue = { sections: [] };\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-form-template-viewer-popup',\n templateUrl: './form-template-viewer-popup.component.html',\n styleUrl: './form-template-viewer-popup.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n CommonModule,\n AXTranslationModule,\n AXButtonModule,\n AXDecoratorModule,\n AXFormModule,\n AXPWidgetCoreModule,\n AXMPreQuestionnaireContentComponent,\n AXMPostQuestionnaireContentComponent,\n ],\n providers: [\n {\n provide: AXP_LOCAL_DATA_SOURCE_STORE,\n useFactory: (host: AXMFormTemplateViewerPopupComponent) =>\n createReadonlyLocalDataSourceStore(() => host.sources()),\n deps: [AXMFormTemplateViewerPopupComponent],\n },\n ],\n})\nexport class AXMFormTemplateViewerPopupComponent extends AXBasePageComponent {\n //#region ----- Services & Dependencies -----\n\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly translationService = inject(AXTranslationService);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly formRef = viewChild<AXFormComponent>('form');\n\n //#endregion\n\n //#region ----- Inputs -----\n\n @Input() set config(value: AXMFormTemplateViewerConfig | undefined) {\n this._config.set(value);\n }\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly _config = signal<AXMFormTemplateViewerConfig | undefined>(undefined);\n protected readonly flowStep = signal<FormFlowStep>('form');\n protected readonly submitResult = signal<SummaryPlaceholderValues | null>(null);\n protected readonly isSubmitting = signal(false);\n protected readonly document = signal({ type: AXPWidgetsCatalog.document } as AXPWidgetNode);\n protected readonly currentPageIndex = signal(0);\n private readonly initialFlowApplied = signal(false);\n private readonly templateLoaded = signal(false);\n\n protected context: Record<string, unknown> = {};\n\n readonly sources = computed(() => readLocalDataSourcesFromNode(this.document()));\n\n protected readonly currentPage = computed(\n () => this.document().children?.[this.currentPageIndex()] ?? ({ type: AXPWidgetsCatalog.pageLayout } as AXPWidgetNode),\n );\n\n protected readonly prePostConfig = computed((): PrePostConfig | null => this._config()?.prePostConfig ?? null);\n\n protected readonly widgetMode = computed(() =>\n this._config()?.readOnly || this.flowStep() === 'review' ? 'view' : 'edit',\n );\n\n protected readonly showReviewButton = computed(\n () => this.flowStep() === 'form' && !this._config()?.readOnly && this.prePostConfig()?.post?.reviewEnabled === true,\n );\n\n protected readonly showSubmitButton = computed(\n () => this.flowStep() === 'form' && !this._config()?.readOnly && !this.showReviewButton(),\n );\n\n protected readonly isPreviewMode = computed(() => this._config()?.previewMode === true);\n\n protected readonly submitActionLabel = computed(() =>\n this.isPreviewMode()\n ? '@form-template-management:templates.viewer.preview.finish.title'\n : '@general:actions.submit.title',\n );\n\n /** Summary rich text with outcome placeholders. Empty author content stays blank. */\n protected readonly summaryHtml = computed((): SafeHtml | '' => {\n const content = this.prePostConfig()?.post?.summaryContent;\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n let resolved = resolveMultiLanguageString(content, locale);\n const values = this.submitResult();\n if (resolved && values) {\n resolved = resolveSummaryPlaceholders(resolved, values);\n }\n return resolved ? this.sanitizer.bypassSecurityTrustHtml(resolved) : '';\n });\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n constructor() {\n super();\n effect(() => {\n const cfg = this._config();\n if (!cfg) {\n return;\n }\n if (!this.templateLoaded()) {\n this.loadTemplate(cfg);\n this.templateLoaded.set(true);\n }\n if (!this.initialFlowApplied()) {\n this.flowStep.set(cfg.prePostConfig?.pre?.enabled === true ? 'pre' : 'form');\n this.initialFlowApplied.set(true);\n }\n });\n }\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected handleContextChanged(event: AXPContextChangeEvent): void {\n this.context = event.data ?? {};\n }\n\n protected handleCancel(): void {\n this.finish(true);\n }\n\n protected handleStart(): void {\n this.flowStep.set('form');\n }\n\n protected handleEdit(): void {\n this.flowStep.set('form');\n }\n\n protected async handleReviewClick(): Promise<void> {\n if (!(await this.validateForm())) {\n return;\n }\n this.flowStep.set('review');\n }\n\n protected async handleSubmitClick(): Promise<void> {\n if (this.flowStep() === 'form' && !(await this.validateForm())) {\n return;\n }\n await this.advanceAfterSubmit();\n }\n\n protected handleResultsNext(): void {\n if (this.prePostConfig()?.post?.summaryEnabled) {\n this.flowStep.set('summary');\n return;\n }\n this.finish(false);\n }\n\n protected handleDone(): void {\n this.finish(false);\n }\n\n //#endregion\n\n //#region ----- Template Loading -----\n\n private loadTemplate(config: AXMFormTemplateViewerConfig): void {\n let templateData: AXPWidgetNode;\n if (typeof config.template === 'string') {\n try {\n templateData = JSON.parse(config.template) as AXPWidgetNode;\n } catch (error) {\n console.error('Failed to parse form template JSON:', error);\n return;\n }\n } else {\n templateData = config.template;\n }\n this.document.set(templateData);\n if (config.context) {\n this.context = { ...config.context };\n }\n }\n\n //#endregion\n\n //#region ----- Submit Flow -----\n\n private async validateForm(): Promise<boolean> {\n const form = this.formRef();\n if (!form) {\n return false;\n }\n const formResult = await form.validate();\n return formResult.result === true;\n }\n\n private async advanceAfterSubmit(): Promise<void> {\n if (this.isSubmitting()) {\n return;\n }\n this.isSubmitting.set(true);\n try {\n const rules = this._config()?.outcomeRules ?? [];\n const post = this.prePostConfig()?.post;\n let placeholders: SummaryPlaceholderValues | null = null;\n if (rules.length > 0) {\n placeholders = await this.questionnaireViewerService.buildSummaryPlaceholderValues(\n EMPTY_OUTCOME_STRUCTURE,\n this.context,\n { outcomeRules: rules },\n );\n }\n this.submitResult.set(placeholders);\n if (post?.showOutcomeResults) {\n this.flowStep.set('results');\n return;\n }\n if (post?.summaryEnabled) {\n this.flowStep.set('summary');\n return;\n }\n this.finish(false);\n } finally {\n this.isSubmitting.set(false);\n }\n }\n\n private finish(cancelled: boolean): void {\n const result: AXMFormTemplateViewerResult = {\n context: this.context,\n cancelled,\n metadata: this._config()?.metadata,\n };\n this.close(result);\n }\n\n //#endregion\n}\n\n//#endregion\n","<div\n class=\"__content-area flex flex-1 min-h-0 flex-col\"\n [class.overflow-hidden]=\"flowStep() === 'form' || flowStep() === 'review'\"\n [class.overflow-y-auto]=\"flowStep() !== 'form' && flowStep() !== 'review'\"\n>\n <!-- ----- Welcome content before the form ----- -->\n @if (flowStep() === 'pre') {\n <axm-pre-questionnaire-content [content]=\"prePostConfig()?.pre?.content\"></axm-pre-questionnaire-content>\n }\n <!-- ----- Outcome results after submit ----- -->\n @else if (flowStep() === 'results') {\n <axm-post-questionnaire-content mode=\"results\" [placeholderValues]=\"submitResult()\"></axm-post-questionnaire-content>\n }\n <!-- ----- Summary content after submit ----- -->\n @else if (flowStep() === 'summary') {\n <div class=\"flex flex-col items-center justify-center p-8 min-h-[200px] text-on-surface\">\n <div class=\"max-w-2xl w-full prose text-on-surface\" [innerHTML]=\"summaryHtml()\"></div>\n </div>\n }\n <!-- ----- Form body, including readonly review ----- -->\n @else {\n <!-- ----- Review heading while the filled form is shown read-only ----- -->\n @if (flowStep() === 'review') {\n <div class=\"p-4 border-b border-surface\">\n <h2 class=\"text-lg font-semibold text-on-surface\">\n {{ '@form-template-management:templates.viewer.flow.review-title' | translate | async }}\n </h2>\n </div>\n }\n <div class=\"flex flex-1 min-h-0 flex-col overflow-y-auto overflow-x-hidden p-4\">\n <ax-form #form>\n <axp-widgets-container [context]=\"context\" (onContextChanged)=\"handleContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"currentPage()\" [mode]=\"widgetMode()\"></ng-container>\n </axp-widgets-container>\n </ax-form>\n </div>\n }\n</div>\n\n<ax-footer class=\"__popup-footer flex-shrink-0 border-t px-4 py-3\">\n <ax-suffix>\n <!-- ----- Welcome step ----- -->\n @if (flowStep() === 'pre') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.start' | translate | async\"\n (onClick)=\"handleStart()\"\n ></ax-button>\n }\n <!-- ----- Fill step ----- -->\n @else if (flowStep() === 'form') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <!-- ----- Review before submit when post review is enabled ----- -->\n @if (showReviewButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.review' | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleReviewClick()\"\n ></ax-button>\n }\n <!-- ----- Submit when review is off ----- -->\n @else if (showSubmitButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n }\n <!-- ----- Review step ----- -->\n @else if (flowStep() === 'review') {\n <ax-button\n look=\"outline\"\n [text]=\"'@form-template-management:templates.viewer.flow.edit' | translate | async\"\n (onClick)=\"handleEdit()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n <!-- ----- Outcome results step ----- -->\n @else if (flowStep() === 'results') {\n <!-- ----- Continue to the summary when it is enabled ----- -->\n @if (prePostConfig()?.post?.summaryEnabled) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.next.title' | translate | async\"\n (onClick)=\"handleResultsNext()\"\n ></ax-button>\n }\n <!-- ----- Close when there is no summary step ----- -->\n @else {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n }\n <!-- ----- Summary step ----- -->\n @else if (flowStep() === 'summary') {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n"],"names":["i3","i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AA8CA,MAAM,uBAAuB,GAA8B,EAAE,Q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AA,EAAA,MAAA,EAAA,CAAA,yVAAA,CAAA,EAAA;+FAQqD,MAAM,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA;sBAM3D;;;"}
1
+ {"version":3,"file":"acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-CeLpGSGc.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/pages/form-template-viewer-popup/form-template-viewer-popup.component.ts","../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/pages/form-template-viewer-popup/form-template-viewer-popup.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXFormComponent, AXFormModule } from '@acorex/components/form';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXTranslationModule, AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { DomSanitizer, type SafeHtml } from '@angular/platform-browser';\nimport {\n AXP_LOCAL_DATA_SOURCE_STORE,\n AXPWidgetCoreModule,\n createReadonlyLocalDataSourceStore,\n readLocalDataSourcesFromNode,\n} from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPContextChangeEvent, AXPWidgetsCatalog, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\nimport type {\n PrePostConfig,\n QuestionnaireBuilderValue,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n Input,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXMPreQuestionnaireContentComponent } from '../../../../questionnaire-viewer/components/pre-questionnaire-content';\nimport { AXMPostQuestionnaireContentComponent } from '../../../../questionnaire-viewer/components/post-questionnaire-content';\nimport { AXMQuestionnaireViewerService } from '../../../../questionnaire-viewer/questionnaire-viewer.service';\nimport {\n resolveSummaryPlaceholders,\n type SummaryPlaceholderValues,\n} from '../../../../questionnaire-viewer/utils/pre-post-content.utils';\nimport type { AXMFormTemplateViewerConfig, AXMFormTemplateViewerResult } from '../../form-template-viewer.types';\n\n//#endregion\n\n//#region ----- Types -----\n\ntype FormFlowStep = 'pre' | 'form' | 'review' | 'results' | 'summary';\n\nconst EMPTY_OUTCOME_STRUCTURE: QuestionnaireBuilderValue = { sections: [] };\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-form-template-viewer-popup',\n templateUrl: './form-template-viewer-popup.component.html',\n styleUrl: './form-template-viewer-popup.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n CommonModule,\n AXTranslationModule,\n AXButtonModule,\n AXDecoratorModule,\n AXFormModule,\n AXPWidgetCoreModule,\n AXMPreQuestionnaireContentComponent,\n AXMPostQuestionnaireContentComponent,\n ],\n providers: [\n {\n provide: AXP_LOCAL_DATA_SOURCE_STORE,\n useFactory: (host: AXMFormTemplateViewerPopupComponent) =>\n createReadonlyLocalDataSourceStore(() => host.sources()),\n deps: [AXMFormTemplateViewerPopupComponent],\n },\n ],\n})\nexport class AXMFormTemplateViewerPopupComponent extends AXBasePageComponent {\n //#region ----- Services & Dependencies -----\n\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly translationService = inject(AXTranslationService);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly formRef = viewChild<AXFormComponent>('form');\n\n //#endregion\n\n //#region ----- Inputs -----\n\n @Input() set config(value: AXMFormTemplateViewerConfig | undefined) {\n this._config.set(value);\n }\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly _config = signal<AXMFormTemplateViewerConfig | undefined>(undefined);\n protected readonly flowStep = signal<FormFlowStep>('form');\n protected readonly submitResult = signal<SummaryPlaceholderValues | null>(null);\n protected readonly isSubmitting = signal(false);\n protected readonly document = signal({ type: AXPWidgetsCatalog.document } as AXPWidgetNode);\n protected readonly currentPageIndex = signal(0);\n private readonly initialFlowApplied = signal(false);\n private readonly templateLoaded = signal(false);\n\n protected context: Record<string, unknown> = {};\n\n readonly sources = computed(() => readLocalDataSourcesFromNode(this.document()));\n\n protected readonly currentPage = computed(\n () => this.document().children?.[this.currentPageIndex()] ?? ({ type: AXPWidgetsCatalog.pageLayout } as AXPWidgetNode),\n );\n\n protected readonly prePostConfig = computed((): PrePostConfig | null => this._config()?.prePostConfig ?? null);\n\n protected readonly widgetMode = computed(() =>\n this._config()?.readOnly || this.flowStep() === 'review' ? 'view' : 'edit',\n );\n\n protected readonly showReviewButton = computed(\n () => this.flowStep() === 'form' && !this._config()?.readOnly && this.prePostConfig()?.post?.reviewEnabled === true,\n );\n\n protected readonly showSubmitButton = computed(\n () => this.flowStep() === 'form' && !this._config()?.readOnly && !this.showReviewButton(),\n );\n\n protected readonly isPreviewMode = computed(() => this._config()?.previewMode === true);\n\n protected readonly submitActionLabel = computed(() =>\n this.isPreviewMode()\n ? '@form-template-management:templates.viewer.preview.finish.title'\n : '@general:actions.submit.title',\n );\n\n /** Summary rich text with outcome placeholders. Empty author content stays blank. */\n protected readonly summaryHtml = computed((): SafeHtml | '' => {\n const content = this.prePostConfig()?.post?.summaryContent;\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n let resolved = resolveMultiLanguageString(content, locale);\n const values = this.submitResult();\n if (resolved && values) {\n resolved = resolveSummaryPlaceholders(resolved, values);\n }\n return resolved ? this.sanitizer.bypassSecurityTrustHtml(resolved) : '';\n });\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n constructor() {\n super();\n effect(() => {\n const cfg = this._config();\n if (!cfg) {\n return;\n }\n if (!this.templateLoaded()) {\n this.loadTemplate(cfg);\n this.templateLoaded.set(true);\n }\n if (!this.initialFlowApplied()) {\n this.flowStep.set(cfg.prePostConfig?.pre?.enabled === true ? 'pre' : 'form');\n this.initialFlowApplied.set(true);\n }\n });\n }\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected handleContextChanged(event: AXPContextChangeEvent): void {\n this.context = event.data ?? {};\n }\n\n protected handleCancel(): void {\n this.finish(true);\n }\n\n protected handleStart(): void {\n this.flowStep.set('form');\n }\n\n protected handleEdit(): void {\n this.flowStep.set('form');\n }\n\n protected async handleReviewClick(): Promise<void> {\n if (!(await this.validateForm())) {\n return;\n }\n this.flowStep.set('review');\n }\n\n protected async handleSubmitClick(): Promise<void> {\n if (this.flowStep() === 'form' && !(await this.validateForm())) {\n return;\n }\n await this.advanceAfterSubmit();\n }\n\n protected handleResultsNext(): void {\n if (this.prePostConfig()?.post?.summaryEnabled) {\n this.flowStep.set('summary');\n return;\n }\n this.finish(false);\n }\n\n protected handleDone(): void {\n this.finish(false);\n }\n\n //#endregion\n\n //#region ----- Template Loading -----\n\n private loadTemplate(config: AXMFormTemplateViewerConfig): void {\n let templateData: AXPWidgetNode;\n if (typeof config.template === 'string') {\n try {\n templateData = JSON.parse(config.template) as AXPWidgetNode;\n } catch (error) {\n console.error('Failed to parse form template JSON:', error);\n return;\n }\n } else {\n templateData = config.template;\n }\n this.document.set(templateData);\n if (config.context) {\n this.context = { ...config.context };\n }\n }\n\n //#endregion\n\n //#region ----- Submit Flow -----\n\n private async validateForm(): Promise<boolean> {\n const form = this.formRef();\n if (!form) {\n return false;\n }\n const formResult = await form.validate();\n return formResult.result === true;\n }\n\n private async advanceAfterSubmit(): Promise<void> {\n if (this.isSubmitting()) {\n return;\n }\n this.isSubmitting.set(true);\n try {\n const rules = this._config()?.outcomeRules ?? [];\n const post = this.prePostConfig()?.post;\n let placeholders: SummaryPlaceholderValues | null = null;\n if (rules.length > 0) {\n placeholders = await this.questionnaireViewerService.buildSummaryPlaceholderValues(\n EMPTY_OUTCOME_STRUCTURE,\n this.context,\n { outcomeRules: rules },\n );\n }\n this.submitResult.set(placeholders);\n if (post?.showOutcomeResults) {\n this.flowStep.set('results');\n return;\n }\n if (post?.summaryEnabled) {\n this.flowStep.set('summary');\n return;\n }\n this.finish(false);\n } finally {\n this.isSubmitting.set(false);\n }\n }\n\n private finish(cancelled: boolean): void {\n const result: AXMFormTemplateViewerResult = {\n context: this.context,\n cancelled,\n metadata: this._config()?.metadata,\n };\n this.close(result);\n }\n\n //#endregion\n}\n\n//#endregion\n","<div\n class=\"__content-area flex flex-1 min-h-0 flex-col\"\n [class.overflow-hidden]=\"flowStep() === 'form' || flowStep() === 'review'\"\n [class.overflow-y-auto]=\"flowStep() !== 'form' && flowStep() !== 'review'\"\n>\n <!-- ----- Welcome content before the form ----- -->\n @if (flowStep() === 'pre') {\n <axm-pre-questionnaire-content [content]=\"prePostConfig()?.pre?.content\"></axm-pre-questionnaire-content>\n }\n <!-- ----- Outcome results after submit ----- -->\n @else if (flowStep() === 'results') {\n <axm-post-questionnaire-content mode=\"results\" [placeholderValues]=\"submitResult()\"></axm-post-questionnaire-content>\n }\n <!-- ----- Summary content after submit ----- -->\n @else if (flowStep() === 'summary') {\n <div class=\"flex flex-col items-center justify-center p-8 min-h-[200px] text-on-surface\">\n <div class=\"max-w-2xl w-full prose text-on-surface\" [innerHTML]=\"summaryHtml()\"></div>\n </div>\n }\n <!-- ----- Form body, including readonly review ----- -->\n @else {\n <!-- ----- Review heading while the filled form is shown read-only ----- -->\n @if (flowStep() === 'review') {\n <div class=\"p-4 border-b border-surface\">\n <h2 class=\"text-lg font-semibold text-on-surface\">\n {{ '@form-template-management:templates.viewer.flow.review-title' | translate | async }}\n </h2>\n </div>\n }\n <div class=\"flex flex-1 min-h-0 flex-col overflow-y-auto overflow-x-hidden p-4\">\n <ax-form #form>\n <axp-widgets-container [context]=\"context\" (onContextChanged)=\"handleContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"currentPage()\" [mode]=\"widgetMode()\"></ng-container>\n </axp-widgets-container>\n </ax-form>\n </div>\n }\n</div>\n\n<ax-footer class=\"__popup-footer flex-shrink-0 border-t px-4 py-3\">\n <ax-suffix>\n <!-- ----- Welcome step ----- -->\n @if (flowStep() === 'pre') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.start' | translate | async\"\n (onClick)=\"handleStart()\"\n ></ax-button>\n }\n <!-- ----- Fill step ----- -->\n @else if (flowStep() === 'form') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <!-- ----- Review before submit when post review is enabled ----- -->\n @if (showReviewButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.review' | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleReviewClick()\"\n ></ax-button>\n }\n <!-- ----- Submit when review is off ----- -->\n @else if (showSubmitButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n }\n <!-- ----- Review step ----- -->\n @else if (flowStep() === 'review') {\n <ax-button\n look=\"outline\"\n [text]=\"'@form-template-management:templates.viewer.flow.edit' | translate | async\"\n (onClick)=\"handleEdit()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n <!-- ----- Outcome results step ----- -->\n @else if (flowStep() === 'results') {\n <!-- ----- Continue to the summary when it is enabled ----- -->\n @if (prePostConfig()?.post?.summaryEnabled) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.next.title' | translate | async\"\n (onClick)=\"handleResultsNext()\"\n ></ax-button>\n }\n <!-- ----- Close when there is no summary step ----- -->\n @else {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n }\n <!-- ----- Summary step ----- -->\n @else if (flowStep() === 'summary') {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n"],"names":["i3","i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AA8CA,MAAM,uBAAuB,GAA8B,EAAE,QAAQ,EAAE,EAAE,EAAE;AAE3E;AAEA;AA2BM,MAAO,mCAAoC,SAAQ,mBAAmB,CAAA;;;IAY1E,IAAa,MAAM,CAAC,KAA8C,EAAA;AAChE,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;IACzB;;;AA6DA,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAzEQ,QAAA,IAAA,CAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;QAChC,IAAA,CAAA,OAAO,GAAG,SAAS,CAAkB,MAAM;oFAAC;;;QAc1C,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0C,SAAS;oFAAC;QACpE,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAe,MAAM;qFAAC;QACvC,IAAA,CAAA,YAAY,GAAG,MAAM,CAAkC,IAAI;yFAAC;QAC5D,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,KAAK;yFAAC;QAC5B,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAmB;qFAAC;QACxE,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,CAAC;6FAAC;QAC9B,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,KAAK;+F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ACZ,mBAAmB;wBACnB,mCAAmC;wBACnC,oCAAoC;qBACrC,EAAA,SAAA,EACU;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,2BAA2B;AACpC,4BAAA,UAAU,EAAE,CAAC,IAAyC,KACpD,kCAAkC,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;AAC1D,4BAAA,IAAI,EAAE,CAAA,mCAAA,CAAqC;AAC5C,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,21JAAA,EAAA,MAAA,EAAA,CAAA,yVAAA,CAAA,EAAA;+FAQqD,MAAM,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA;sBAM3D;;;"}
@@ -1,12 +1,12 @@
1
1
  import { AXPopupService } from '@acorex/components/popup';
2
+ import { AXPDialogOpener, AXPDeviceService } from '@acorex-platform/framework-client/core';
2
3
  import { AXTranslationService } from '@acorex/core/translation';
3
- import { AXPDeviceService } from '@acorex-platform/framework-client/core';
4
4
  import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
5
5
  import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
6
6
  import { RootConfig, toPrePostConfig, flattenQuestionnaireOutcomeItems } from '@acorex-platform/module-assessment-management-client/contracts';
7
7
  import * as i0 from '@angular/core';
8
8
  import { inject, Injectable } from '@angular/core';
9
- import { f as formatQuestionnairePreviewDialogTitle } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-juxXq2pM.mjs';
9
+ import { g as formatQuestionnairePreviewDialogTitle } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-DxRFMK3k.mjs';
10
10
 
11
11
  //#region ----- Imports -----
12
12
  //#endregion
@@ -18,6 +18,7 @@ class AXMFormTemplateViewerService {
18
18
  constructor() {
19
19
  //#region ----- Services & Dependencies -----
20
20
  this.popupService = inject(AXPopupService);
21
+ this.dialogOpener = inject(AXPDialogOpener);
21
22
  this.entityService = inject(AXPEntityService);
22
23
  this.translationService = inject(AXTranslationService);
23
24
  this.deviceService = inject(AXPDeviceService);
@@ -56,7 +57,6 @@ class AXMFormTemplateViewerService {
56
57
  const popupTitle = input.previewMode
57
58
  ? formatQuestionnairePreviewDialogTitle((await this.translationService.translateAsync('@form-template-management:templates.entities.template.actions.preview.title')) || 'Preview', displayTitle)
58
59
  : displayTitle || fallbackTitle;
59
- const { AXMFormTemplateViewerPopupComponent } = await import('./acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-COZcUPEj.mjs');
60
60
  const config = {
61
61
  template: templateData,
62
62
  title,
@@ -67,13 +67,17 @@ class AXMFormTemplateViewerService {
67
67
  readOnly: input.readOnly === true,
68
68
  previewMode: input.previewMode === true,
69
69
  };
70
- const result = await this.popupService.open(AXMFormTemplateViewerPopupComponent, {
71
- title: popupTitle,
72
- size: this.deviceService.isSmall() ? 'full' : 'lg',
73
- closeButton: false,
74
- closeOnBackdropClick: false,
75
- draggable: false,
76
- data: { config },
70
+ const result = await this.dialogOpener.openPopup({
71
+ load: () => import('./acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-CeLpGSGc.mjs').then((module) => module.AXMFormTemplateViewerPopupComponent),
72
+ data: { id: input.id ?? '', previewMode: input.previewMode === true, readOnly: input.readOnly === true },
73
+ show: (component) => this.popupService.open(component, {
74
+ title: popupTitle,
75
+ size: this.deviceService.isSmall() ? 'full' : 'lg',
76
+ closeButton: false,
77
+ closeOnBackdropClick: false,
78
+ draggable: false,
79
+ data: { config },
80
+ }),
77
81
  });
78
82
  return (result?.data ?? {
79
83
  context: input.context ?? {},
@@ -90,4 +94,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
90
94
  }] });
91
95
 
92
96
  export { AXMFormTemplateViewerService as A };
93
- //# sourceMappingURL=acorex-platform-module-assessment-management-client-form-template-viewer.service-CvSRpoos.mjs.map
97
+ //# sourceMappingURL=acorex-platform-module-assessment-management-client-form-template-viewer.service-DoO7ZQmw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-assessment-management-client-form-template-viewer.service-DoO7ZQmw.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/form-template-viewer.service.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXPDialogOpener } from '@acorex-platform/framework-client/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPDeviceService } from '@acorex-platform/framework-client/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPWidgetsCatalog, type AXPMetaData } from '@acorex-platform/framework-shared/core';\nimport {\n flattenQuestionnaireOutcomeItems,\n RootConfig,\n toPrePostConfig,\n type AXMFormTemplateDetailDto,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\nimport { formatQuestionnairePreviewDialogTitle } from '../../questionnaire-viewer/utils/questionnaire-preview-title.util';\nimport type {\n AXMFormTemplateViewerConfig,\n AXMFormTemplateViewerOpenStatus,\n AXMFormTemplateViewerResult,\n} from './form-template-viewer.types';\n\n//#endregion\n\n//#region ----- Service -----\n\n/**\n * Opens a form template in the same pre → form → review → results → summary flow as questionnaires.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMFormTemplateViewerService {\n //#region ----- Services & Dependencies -----\n\n private readonly popupService = inject(AXPopupService);\n private readonly dialogOpener = inject(AXPDialogOpener);\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n private readonly deviceService = inject(AXPDeviceService);\n\n //#endregion\n\n //#region ----- Public Methods -----\n\n async open(input: {\n id?: string;\n template?: string;\n title?: string;\n metadata?: AXPMetaData;\n readOnly?: boolean;\n previewMode?: boolean;\n context?: Record<string, unknown>;\n }): Promise<AXMFormTemplateViewerResult | AXMFormTemplateViewerOpenStatus> {\n let templateData = input.template;\n let title: string | undefined;\n let prePostConfig = null as AXMFormTemplateViewerConfig['prePostConfig'];\n let outcomeRules: AXMFormTemplateViewerConfig['outcomeRules'] = [];\n\n if (input.id) {\n const item = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.template.name)\n .data<string, AXMFormTemplateDetailDto>()\n .byKey(input.id);\n if (!item) {\n return 'not-found';\n }\n templateData = item.template ?? '';\n title = item.title?.trim() || undefined;\n prePostConfig = toPrePostConfig({ pre: item.pre, post: item.post });\n outcomeRules = flattenQuestionnaireOutcomeItems(item.outcomes);\n }\n\n if (!templateData) {\n if (!input.id) {\n return 'missing';\n }\n templateData = JSON.stringify({\n type: AXPWidgetsCatalog.document,\n children: [{ type: AXPWidgetsCatalog.pageLayout }],\n });\n }\n\n const fallbackTitle =\n (await this.translationService.translateAsync('@form-template-management:templates.viewer.title')) || 'Form';\n const displayTitle = input.title?.trim() || title;\n const popupTitle = input.previewMode\n ? formatQuestionnairePreviewDialogTitle(\n (await this.translationService.translateAsync(\n '@form-template-management:templates.entities.template.actions.preview.title',\n )) || 'Preview',\n displayTitle,\n )\n : displayTitle || fallbackTitle;\n\n const config: AXMFormTemplateViewerConfig = {\n template: templateData,\n title,\n prePostConfig,\n outcomeRules,\n context: input.context ?? {},\n metadata: input.metadata,\n readOnly: input.readOnly === true,\n previewMode: input.previewMode === true,\n };\n\n const result = await this.dialogOpener.openPopup({\n load: () =>\n import('./pages/form-template-viewer-popup/form-template-viewer-popup.component').then(\n (module) => module.AXMFormTemplateViewerPopupComponent,\n ),\n data: { id: input.id ?? '', previewMode: input.previewMode === true, readOnly: input.readOnly === true },\n show: (component) =>\n this.popupService.open(component, {\n title: popupTitle,\n size: this.deviceService.isSmall() ? 'full' : 'lg',\n closeButton: false,\n closeOnBackdropClick: false,\n draggable: false,\n data: { config },\n }),\n });\n\n return (\n (result?.data as AXMFormTemplateViewerResult | undefined) ?? {\n context: input.context ?? {},\n cancelled: true,\n metadata: input.metadata,\n }\n );\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;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