@acorex/modules 21.0.0-next.59 → 21.0.0-next.63

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 (49) hide show
  1. package/assessment-management/README.md +4 -4
  2. package/fesm2022/{acorex-modules-assessment-management-acorex-modules-assessment-management-o8aFazwA.mjs → acorex-modules-assessment-management-acorex-modules-assessment-management-DlhSQ0cB.mjs} +3608 -367
  3. package/fesm2022/acorex-modules-assessment-management-acorex-modules-assessment-management-DlhSQ0cB.mjs.map +1 -0
  4. package/fesm2022/{acorex-modules-assessment-management-assessment-case.entity-yrc_Yybq.mjs → acorex-modules-assessment-management-assessment-case.entity-B6C2PRZw.mjs} +43 -28
  5. package/fesm2022/acorex-modules-assessment-management-assessment-case.entity-B6C2PRZw.mjs.map +1 -0
  6. package/fesm2022/{acorex-modules-assessment-management-assessment-session-answers-view.util-BUQa_TSY.mjs → acorex-modules-assessment-management-assessment-session-answers-view.util-BRdwcIvw.mjs} +2 -2
  7. package/fesm2022/{acorex-modules-assessment-management-assessment-session-answers-view.util-BUQa_TSY.mjs.map → acorex-modules-assessment-management-assessment-session-answers-view.util-BRdwcIvw.mjs.map} +1 -1
  8. package/fesm2022/{acorex-modules-assessment-management-assessment-session.entity-Cwf30iuu.mjs → acorex-modules-assessment-management-assessment-session.entity-DquzZNaQ.mjs} +19 -3
  9. package/fesm2022/acorex-modules-assessment-management-assessment-session.entity-DquzZNaQ.mjs.map +1 -0
  10. package/fesm2022/{acorex-modules-assessment-management-fill-assessment-session.command-CJieLR5g.mjs → acorex-modules-assessment-management-fill-assessment-session.command-CRE8SxzC.mjs} +2 -2
  11. package/fesm2022/acorex-modules-assessment-management-fill-assessment-session.command-CRE8SxzC.mjs.map +1 -0
  12. package/fesm2022/{acorex-modules-assessment-management-preview-question.command-D0-FB1HH.mjs → acorex-modules-assessment-management-preview-question.command-Ce7yOnJY.mjs} +2 -2
  13. package/fesm2022/acorex-modules-assessment-management-preview-question.command-Ce7yOnJY.mjs.map +1 -0
  14. package/fesm2022/{acorex-modules-assessment-management-preview-questionnaire.command-wqPNgv7q.mjs → acorex-modules-assessment-management-preview-questionnaire.command-S-8MDeB7.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-assessment-management-preview-questionnaire.command-wqPNgv7q.mjs.map → acorex-modules-assessment-management-preview-questionnaire.command-S-8MDeB7.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-DYyUhSWd.mjs → acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-wdHMGBxi.mjs} +2 -2
  17. package/fesm2022/acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-wdHMGBxi.mjs.map +1 -0
  18. package/fesm2022/{acorex-modules-assessment-management-question-bank-item.entity-DUf2ceKY.mjs → acorex-modules-assessment-management-question-bank-item.entity-1Pm9O0kv.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-assessment-management-question-bank-item.entity-DUf2ceKY.mjs.map → acorex-modules-assessment-management-question-bank-item.entity-1Pm9O0kv.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-assessment-management-questionnaire-viewer-popup.component-Cy5ElBmU.mjs → acorex-modules-assessment-management-questionnaire-viewer-popup.component-Dwx0y7WY.mjs} +9 -121
  21. package/fesm2022/acorex-modules-assessment-management-questionnaire-viewer-popup.component-Dwx0y7WY.mjs.map +1 -0
  22. package/fesm2022/{acorex-modules-assessment-management-questionnaire.entity-RWSkzNbA.mjs → acorex-modules-assessment-management-questionnaire.entity-BI_jc4C6.mjs} +12 -36
  23. package/fesm2022/acorex-modules-assessment-management-questionnaire.entity-BI_jc4C6.mjs.map +1 -0
  24. package/fesm2022/{acorex-modules-assessment-management-view-case-last-session-answers.command-NTuDdoYk.mjs → acorex-modules-assessment-management-view-case-last-session-answers.command-Ds-QGMPy.mjs} +3 -3
  25. package/fesm2022/{acorex-modules-assessment-management-view-case-last-session-answers.command-NTuDdoYk.mjs.map → acorex-modules-assessment-management-view-case-last-session-answers.command-Ds-QGMPy.mjs.map} +1 -1
  26. package/fesm2022/{acorex-modules-assessment-management-view-session-answers.command-0btGV66_.mjs → acorex-modules-assessment-management-view-session-answers.command-COTVoRRG.mjs} +3 -3
  27. package/fesm2022/{acorex-modules-assessment-management-view-session-answers.command-0btGV66_.mjs.map → acorex-modules-assessment-management-view-session-answers.command-COTVoRRG.mjs.map} +1 -1
  28. package/fesm2022/acorex-modules-assessment-management-view-session-outcomes.command-2buH7ydV.mjs +239 -0
  29. package/fesm2022/acorex-modules-assessment-management-view-session-outcomes.command-2buH7ydV.mjs.map +1 -0
  30. package/fesm2022/acorex-modules-assessment-management.mjs +1 -1
  31. package/fesm2022/acorex-modules-common.mjs +1 -0
  32. package/fesm2022/acorex-modules-common.mjs.map +1 -1
  33. package/package.json +2 -2
  34. package/types/acorex-modules-assessment-management.d.ts +383 -271
  35. package/types/acorex-modules-common.d.ts +1 -0
  36. package/fesm2022/acorex-modules-assessment-management-acorex-modules-assessment-management-o8aFazwA.mjs.map +0 -1
  37. package/fesm2022/acorex-modules-assessment-management-assessment-case.entity-yrc_Yybq.mjs.map +0 -1
  38. package/fesm2022/acorex-modules-assessment-management-assessment-session.entity-Cwf30iuu.mjs.map +0 -1
  39. package/fesm2022/acorex-modules-assessment-management-fill-assessment-session.command-CJieLR5g.mjs.map +0 -1
  40. package/fesm2022/acorex-modules-assessment-management-index-D8KjfHAH.mjs +0 -1509
  41. package/fesm2022/acorex-modules-assessment-management-index-D8KjfHAH.mjs.map +0 -1
  42. package/fesm2022/acorex-modules-assessment-management-preview-question.command-D0-FB1HH.mjs.map +0 -1
  43. package/fesm2022/acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-DYyUhSWd.mjs.map +0 -1
  44. package/fesm2022/acorex-modules-assessment-management-questionnaire-calculation.entity-CYF0k42_.mjs +0 -236
  45. package/fesm2022/acorex-modules-assessment-management-questionnaire-calculation.entity-CYF0k42_.mjs.map +0 -1
  46. package/fesm2022/acorex-modules-assessment-management-questionnaire-viewer-popup.component-Cy5ElBmU.mjs.map +0 -1
  47. package/fesm2022/acorex-modules-assessment-management-questionnaire.entity-RWSkzNbA.mjs.map +0 -1
  48. package/fesm2022/acorex-modules-assessment-management-save-questionnaire-questions.command-koGmUbNE.mjs +0 -61
  49. package/fesm2022/acorex-modules-assessment-management-save-questionnaire-questions.command-koGmUbNE.mjs.map +0 -1
@@ -1,1509 +0,0 @@
1
- import { AXPBroadcastEventService } from '@acorex/platform/core';
2
- import { AXPEntityService, AXPEntityDefinitionRegistryService, AXPEntityEventsKeys } from '@acorex/platform/layout/entity';
3
- import { AXPPageLayoutBaseComponent, AXPPageLayoutBase } from '@acorex/platform/layout/views';
4
- import { AXPCommandService } from '@acorex/platform/runtime';
5
- import * as i0 from '@angular/core';
6
- import { inject, input, output, signal, viewChild, computed, effect, untracked, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
7
- import { R as RootConfig, A as AXMQuestionnaireViewerService, c as createDefaultSection, a as convertStateToValue, b as convertValueToState, g as getQuestionnaireItemRequiredBadgeMode, d as getQuestionnaireItemVisibilityBadgeMode, n as normalizeQuestionCommentConfig, m as mergeQuestionCommentConfig, e as normalizeQuestionHintFromEntityRow, f as mergeQuestionHintForViewer, p as parseQuestionHintPartialFromRecord, h as collectQuestionnaireItemNames, i as allocateNextQuestionItemName, j as normalizeQuestionHintMode, k as normalizeQuestionHintConfig, l as diffQuestionHintOverride, o as diffQuestionCommentOverride, s as stripHtmlToPlain, t as toDisplaySettings, q as toPrePostConfig } from './acorex-modules-assessment-management-acorex-modules-assessment-management-o8aFazwA.mjs';
8
- import { AXDataSource } from '@acorex/cdk/common';
9
- import { AXFullScreenDirective } from '@acorex/cdk/full-screen';
10
- import * as i1 from '@acorex/components/button';
11
- import { AXButtonModule } from '@acorex/components/button';
12
- import * as i2 from '@acorex/components/decorators';
13
- import { AXDecoratorModule } from '@acorex/components/decorators';
14
- import { AXDropdownModule } from '@acorex/components/dropdown';
15
- import { AXFormModule } from '@acorex/components/form';
16
- import { AXLabelModule } from '@acorex/components/label';
17
- import { AXSwitchModule } from '@acorex/components/switch';
18
- import { AXToastService } from '@acorex/components/toast';
19
- import * as i4 from '@acorex/core/translation';
20
- import { AXTranslationService, resolveMultiLanguageString, AXTranslationModule } from '@acorex/core/translation';
21
- import { AXPDataSelectorService, AXPPropertyViewerService, AXPStandardSectionItemsBuilderComponent } from '@acorex/platform/layout/components';
22
- import { AXPWidgetsCatalog, createBooleanProperty, AXPWidgetRegistryService } from '@acorex/platform/layout/widget-core';
23
- import * as i3 from '@angular/common';
24
- import { CommonModule } from '@angular/common';
25
- import { FormsModule } from '@angular/forms';
26
- import { QUESTIONNAIRE_QUESTIONS_SAVE_COMMAND } from './acorex-modules-assessment-management-save-questionnaire-questions.command-koGmUbNE.mjs';
27
- export { AXMSaveQuestionnaireQuestionsCommand } from './acorex-modules-assessment-management-save-questionnaire-questions.command-koGmUbNE.mjs';
28
- import { isEqual, isNil, cloneDeep } from 'lodash-es';
29
-
30
- /** Component key for the questionnaire Questions page tab. Register via AXP_PAGE_COMPONENT_PROVIDER. */
31
- const QUESTIONNAIRE_QUESTIONS_PAGE_COMPONENT_KEY = 'questionnaire-questions-page';
32
-
33
- //#region ---- Imports ----
34
- //#endregion
35
- //#region ---- Groups ----
36
- const GROUP_IDENTITY = {
37
- name: 'identity',
38
- title: '@assessment-management:questionnaires.components.questionnaire-builder.groups.identity.title',
39
- order: 0,
40
- };
41
- const GROUP_VALIDATION = {
42
- name: 'validation',
43
- title: '@assessment-management:questionnaires.components.questionnaire-builder.groups.validation.title',
44
- order: 1,
45
- };
46
- const GROUP_VISIBILITY = {
47
- name: 'visibility',
48
- title: '@assessment-management:questionnaires.components.questionnaire-builder.groups.visibility.title',
49
- order: 2,
50
- };
51
- const GROUP_HINT = {
52
- name: 'hint',
53
- title: '@assessment-management:questionnaires.components.questionnaire-builder.groups.hint.title',
54
- order: 3,
55
- };
56
- const GROUP_COMMENT = {
57
- name: 'comment',
58
- title: '@assessment-management:questionnaires.components.questionnaire-builder.groups.comment.title',
59
- order: 4,
60
- };
61
- //#endregion
62
- //#region ---- Shared options ----
63
- const HINT_MODE_OPTIONS = [
64
- {
65
- id: 'off',
66
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint-mode.options.off',
67
- },
68
- {
69
- id: 'info',
70
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint-mode.options.info',
71
- },
72
- {
73
- id: 'warning',
74
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint-mode.options.warning',
75
- },
76
- {
77
- id: 'danger',
78
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint-mode.options.danger',
79
- },
80
- {
81
- id: 'success',
82
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint-mode.options.success',
83
- },
84
- {
85
- id: 'neutral',
86
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint-mode.options.neutral',
87
- },
88
- ];
89
- //#endregion
90
- //#region ---- Properties by group ----
91
- const IDENTITY_PROPS = [
92
- {
93
- name: 'name',
94
- title: '@general:terms.common.name',
95
- group: GROUP_IDENTITY,
96
- order: 10,
97
- schema: {
98
- dataType: 'string',
99
- defaultValue: '',
100
- interface: {
101
- name: 'name',
102
- path: 'name',
103
- type: AXPWidgetsCatalog.text,
104
- options: {
105
- placeholder: '@general:terms.common.name',
106
- },
107
- },
108
- },
109
- visible: true,
110
- },
111
- {
112
- name: 'tags',
113
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.tags.title',
114
- group: GROUP_IDENTITY,
115
- order: 20,
116
- schema: {
117
- dataType: 'array',
118
- defaultValue: [],
119
- interface: {
120
- name: 'tags',
121
- path: 'tags',
122
- type: 'tag-editor',
123
- options: {
124
- placeholder: '@assessment-management:questionnaires.components.questionnaire-builder.fields.tags.placeholder',
125
- allowDuplicate: false,
126
- },
127
- },
128
- },
129
- visible: true,
130
- },
131
- ];
132
- const VALIDATION_PROPS = [
133
- {
134
- ...createBooleanProperty({
135
- name: 'isRequired',
136
- path: 'isRequired',
137
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.is-required.title',
138
- group: GROUP_VALIDATION,
139
- defaultValue: false,
140
- }),
141
- order: 10,
142
- },
143
- ];
144
- const VISIBILITY_PROPS = [
145
- {
146
- ...createBooleanProperty({
147
- name: 'isVisible',
148
- path: 'isVisible',
149
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.visible.title',
150
- group: GROUP_VISIBILITY,
151
- defaultValue: true,
152
- }),
153
- order: 10,
154
- },
155
- ];
156
- const HINT_PROPS = [
157
- {
158
- name: 'hintMode',
159
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint-mode.title',
160
- group: GROUP_HINT,
161
- order: 10,
162
- schema: {
163
- dataType: 'string',
164
- defaultValue: { id: 'off', title: HINT_MODE_OPTIONS[0].title },
165
- interface: {
166
- name: 'hintMode',
167
- path: 'hint.mode',
168
- type: AXPWidgetsCatalog.select,
169
- options: {
170
- valueField: 'id',
171
- textField: 'title',
172
- dataSource: [...HINT_MODE_OPTIONS],
173
- },
174
- },
175
- },
176
- visible: true,
177
- },
178
- {
179
- name: 'hintContent',
180
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.hint.title',
181
- group: GROUP_HINT,
182
- order: 20,
183
- schema: {
184
- dataType: 'string',
185
- defaultValue: '',
186
- interface: {
187
- name: 'hintContent',
188
- path: 'hint.content',
189
- type: AXPWidgetsCatalog.richText,
190
- options: {},
191
- },
192
- },
193
- visible: "{{ context.eval('hint.mode') && (context.eval('hint.mode').id || context.eval('hint.mode')) != 'off' }}",
194
- },
195
- ];
196
- const COMMENT_PROPS = [
197
- {
198
- ...createBooleanProperty({
199
- name: 'commentEnabled',
200
- path: 'comment.enabled',
201
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.comment-enabled.title',
202
- group: GROUP_COMMENT,
203
- defaultValue: false,
204
- }),
205
- order: 10,
206
- },
207
- {
208
- ...createBooleanProperty({
209
- name: 'commentRequired',
210
- path: 'comment.required',
211
- title: '@assessment-management:questionnaires.components.questionnaire-builder.fields.comment-required.title',
212
- group: GROUP_COMMENT,
213
- defaultValue: false,
214
- visible: "{{ context.eval('comment.enabled') === true }}",
215
- }),
216
- order: 20,
217
- },
218
- ];
219
- //#endregion
220
- //#region ---- Hint form context helper ----
221
- /**
222
- * Builds initial `hint` object for the question property viewer from the effective (merged) hint config.
223
- */
224
- function createQuestionHintFormContext(hint) {
225
- let content = '';
226
- if (hint.mode !== 'off') {
227
- const hc = hint.content;
228
- if (typeof hc === 'string') {
229
- content = hc;
230
- }
231
- else if (hc && typeof hc === 'object') {
232
- content = Object.values(hc)[0] ?? '';
233
- }
234
- }
235
- const modeId = hint.mode;
236
- const opt = HINT_MODE_OPTIONS.find((o) => o.id === modeId) ?? HINT_MODE_OPTIONS[0];
237
- return {
238
- content,
239
- mode: { id: opt.id, title: opt.title },
240
- };
241
- }
242
- //#endregion
243
- //#region ---- Tab definition ----
244
- /**
245
- * Property viewer tabs for editing a single questionnaire question row (metadata).
246
- */
247
- const QUESTIONNAIRE_QUESTION_EDIT_TABS = [
248
- {
249
- name: 'general',
250
- title: '@assessment-management:questionnaires.components.questionnaire-builder.tabs.general.title',
251
- groups: [
252
- {
253
- name: GROUP_IDENTITY.name,
254
- title: GROUP_IDENTITY.title,
255
- isCollapsed: false,
256
- props: IDENTITY_PROPS,
257
- },
258
- {
259
- name: GROUP_VALIDATION.name,
260
- title: GROUP_VALIDATION.title,
261
- isCollapsed: false,
262
- props: VALIDATION_PROPS,
263
- },
264
- {
265
- name: GROUP_VISIBILITY.name,
266
- title: GROUP_VISIBILITY.title,
267
- isCollapsed: false,
268
- props: VISIBILITY_PROPS,
269
- },
270
- {
271
- name: GROUP_HINT.name,
272
- title: GROUP_HINT.title,
273
- isCollapsed: false,
274
- props: HINT_PROPS,
275
- },
276
- {
277
- name: GROUP_COMMENT.name,
278
- title: GROUP_COMMENT.title,
279
- isCollapsed: false,
280
- props: COMMENT_PROPS,
281
- },
282
- ],
283
- },
284
- ];
285
- //#endregion
286
-
287
- //#region ---- Imports ----
288
- //#endregion
289
- //#region ---- Component ----
290
- /**
291
- * Reusable Questionnaire Builder Component
292
- * Can be used both in dialog and inline contexts
293
- */
294
- class AXMQuestionnaireBuilderComponent {
295
- //#endregion
296
- //#region ---- Question bank entity data ----
297
- questionBankData() {
298
- return this.entityService
299
- .withEntity(RootConfig.module.name, RootConfig.entities.questionBankItem.name)
300
- .data();
301
- }
302
- questionBankCategoryData() {
303
- return this.entityService
304
- .withEntity(RootConfig.module.name, `${RootConfig.entities.questionBankItem.name}Category`)
305
- .data();
306
- }
307
- //#endregion
308
- //#region ---- Lifecycle ----
309
- constructor() {
310
- //#region ---- Services & Dependencies ----
311
- this.dataSelectorService = inject(AXPDataSelectorService);
312
- this.entityService = inject(AXPEntityService);
313
- this.entityResolver = inject(AXPEntityDefinitionRegistryService);
314
- this.translationService = inject(AXTranslationService);
315
- this.propertyViewerService = inject(AXPPropertyViewerService);
316
- this.questionnaireViewerService = inject(AXMQuestionnaireViewerService);
317
- this.toastService = inject(AXToastService);
318
- this.widgetRegistry = inject(AXPWidgetRegistryService);
319
- this.commandService = inject(AXPCommandService);
320
- //#endregion
321
- //#region ---- Inputs & Outputs ----
322
- /**
323
- * Initial value (QuestionnaireBuilderValue)
324
- */
325
- this.value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
326
- /**
327
- * Readonly mode
328
- */
329
- this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
330
- /**
331
- * Pre/post config for preview (welcome, review, summary).
332
- * When provided, passed to the preview dialog.
333
- */
334
- this.prePostConfig = input(null, ...(ngDevMode ? [{ debugName: "prePostConfig" }] : /* istanbul ignore next */ []));
335
- /**
336
- * When false, the header (Add Section, Settings, Preview, Full Screen) is hidden.
337
- * Use when actions are provided by the host (e.g. page primary header actions).
338
- */
339
- this.showHeader = input(true, ...(ngDevMode ? [{ debugName: "showHeader" }] : /* istanbul ignore next */ []));
340
- /**
341
- * Display settings (view mode, progress bar, timer, etc.) when provided by the host (e.g. entity form).
342
- * Used for preview. When not provided, falls back to state/value or defaults.
343
- */
344
- this.displaySettingsInput = input(null, ...(ngDevMode ? [{ debugName: "displaySettingsInput" }] : /* istanbul ignore next */ []));
345
- /**
346
- * Persisted questionnaire id (e.g. from entity form) — enables questionnaire calculations in preview.
347
- */
348
- this.questionnaireEntityId = input(undefined, ...(ngDevMode ? [{ debugName: "questionnaireEntityId" }] : /* istanbul ignore next */ []));
349
- /**
350
- * Value change event
351
- */
352
- this.valueChange = output();
353
- //#endregion
354
- //#region ---- Class Properties ----
355
- // Designer state management - always start with at least one default section
356
- this.builderState = signal({
357
- sections: [createDefaultSection()],
358
- }, ...(ngDevMode ? [{ debugName: "builderState" }] : /* istanbul ignore next */ []));
359
- // Selected item tracking
360
- this.selectedItemName = signal(null, ...(ngDevMode ? [{ debugName: "selectedItemName" }] : /* istanbul ignore next */ []));
361
- this.selectedSectionName = signal(null, ...(ngDevMode ? [{ debugName: "selectedSectionName" }] : /* istanbul ignore next */ []));
362
- // Fullscreen directive reference
363
- this.fullscreenDirective = viewChild('fullscreen', ...(ngDevMode ? [{ debugName: "fullscreenDirective" }] : /* istanbul ignore next */ []));
364
- this.standardRef = viewChild(AXPStandardSectionItemsBuilderComponent, ...(ngDevMode ? [{ debugName: "standardRef" }] : /* istanbul ignore next */ []));
365
- //#endregion
366
- //#region ---- Computed Properties ----
367
- /** Value for {@link AXPStandardSectionItemsBuilderComponent} (sections only; drag/reorder handled there). */
368
- this.builderValue = computed(() => ({
369
- sections: this.builderState().sections.map((s) => ({
370
- id: s.name,
371
- name: s.name,
372
- order: s.order,
373
- title: s.title,
374
- description: s.description,
375
- tags: s.tags,
376
- isVisible: s.isVisible,
377
- items: s.items.map((it) => ({
378
- id: it.name,
379
- name: it.name,
380
- order: it.order,
381
- questionBankItemId: it.questionBankItemId,
382
- isRequired: it.isRequired,
383
- isVisible: it.isVisible,
384
- interfaceOverride: it.interfaceOverride,
385
- hint: it.hint,
386
- comment: it.comment,
387
- tags: it.tags,
388
- question: it.question,
389
- isNewlyAdded: it.isNewlyAdded,
390
- })),
391
- })),
392
- }), ...(ngDevMode ? [{ debugName: "builderValue" }] : /* istanbul ignore next */ []));
393
- this.isPreviewDisabled = computed(() => this.builderState().sections.length === 0 || this.builderState().sections.every((s) => s.items.length === 0), ...(ngDevMode ? [{ debugName: "isPreviewDisabled" }] : /* istanbul ignore next */ []));
394
- this.standardConfig = computed(() => ({
395
- showSectionTechnicalName: true,
396
- minSectionCount: 1,
397
- texts: {
398
- addSection: '@assessment-management:questionnaires.components.questionnaire-builder.actions.add-section.title',
399
- addItem: '@assessment-management:questionnaires.components.questionnaire-builder.actions.add-question.title',
400
- emptySectionsTitle: '@assessment-management:questionnaires.components.questionnaire-builder.empty-states.no-sections.title',
401
- emptySectionsDescription: '@assessment-management:questionnaires.components.questionnaire-builder.empty-states.no-sections.description',
402
- emptyItemsTitle: '@assessment-management:questionnaires.components.questionnaire-builder.empty-states.empty-section.title',
403
- emptyItemsDescription: '@assessment-management:questionnaires.components.questionnaire-builder.empty-states.empty-section.description',
404
- defaultSectionBadge: '@assessment-management:questionnaires.components.questionnaire-builder.default-section-badge',
405
- },
406
- mapItemToView: (item, section) => this.mapQuestionnaireItemToView(item, section),
407
- promptAddItems: (sid, v) => this.questionnairePromptAddItems(sid, v),
408
- promptEditItem: (item, sid, v) => this.questionnairePromptEditItem(item, sid, v),
409
- }), ...(ngDevMode ? [{ debugName: "standardConfig" }] : /* istanbul ignore next */ []));
410
- /**
411
- * Get current display settings from state or default
412
- */
413
- this.displaySettings = computed(() => {
414
- const fromInput = this.displaySettingsInput();
415
- if (fromInput != null) {
416
- return fromInput;
417
- }
418
- const state = this.builderState();
419
- if (state.displaySettings) {
420
- return state.displaySettings;
421
- }
422
- const currentValue = convertStateToValue(state, this.value() || undefined);
423
- return (currentValue.displaySettings || {
424
- viewMode: 'single-page',
425
- showProgressBar: true,
426
- showTimer: false,
427
- showQuestionNumbers: true,
428
- });
429
- }, ...(ngDevMode ? [{ debugName: "displaySettings" }] : /* istanbul ignore next */ []));
430
- // Track last emitted value to prevent circular updates
431
- let lastEmittedValue = null;
432
- // Sync value input to state (only when value changes externally)
433
- effect(() => {
434
- const val = this.value();
435
- if (val !== null && val !== undefined) {
436
- const currentState = untracked(() => this.builderState());
437
- const currentValue = convertStateToValue(currentState);
438
- const valStr = JSON.stringify(val);
439
- const currentStr = JSON.stringify(currentValue);
440
- const lastEmittedStr = lastEmittedValue ? JSON.stringify(lastEmittedValue) : null;
441
- if (valStr !== currentStr && valStr !== lastEmittedStr) {
442
- const newState = convertValueToState(val);
443
- untracked(() => {
444
- this.builderState.set(newState);
445
- this.loadQuestionDetailsForState(newState);
446
- });
447
- }
448
- }
449
- else if (val === null || val === undefined) {
450
- // If value is null/undefined, ensure we have at least one default section
451
- const currentState = untracked(() => this.builderState());
452
- if (currentState.sections.length === 0) {
453
- const defaultSection = createDefaultSection();
454
- defaultSection.order = 0;
455
- untracked(() => {
456
- this.builderState.set({ sections: [defaultSection] });
457
- });
458
- }
459
- }
460
- });
461
- // Sync state changes to output
462
- effect(() => {
463
- const state = this.builderState();
464
- const currentValue = this.value();
465
- const value = convertStateToValue(state, currentValue || undefined);
466
- untracked(() => {
467
- lastEmittedValue = value;
468
- this.valueChange.emit(value);
469
- });
470
- });
471
- }
472
- /**
473
- * Load question details for all items in the state
474
- */
475
- async loadQuestionDetailsForState(state) {
476
- const questionIds = new Set();
477
- // Collect all question bank item IDs
478
- state.sections.forEach((section) => {
479
- section.items.forEach((item) => {
480
- if (item.questionBankItemId && !item.question) {
481
- questionIds.add(item.questionBankItemId);
482
- }
483
- });
484
- });
485
- if (questionIds.size === 0)
486
- return;
487
- // Load all questions in parallel
488
- const questionPromises = Array.from(questionIds).map((id) => this.questionBankData()
489
- .byKey(id)
490
- .catch(() => null));
491
- const questions = await Promise.all(questionPromises);
492
- // Create a map of question ID to question data
493
- const questionMap = new Map();
494
- questions.forEach((q) => {
495
- if (q) {
496
- questionMap.set(q.id, q);
497
- }
498
- });
499
- // Update state with question details
500
- this.builderState.update((currentState) => ({
501
- ...currentState,
502
- sections: currentState.sections.map((section) => ({
503
- ...section,
504
- items: section.items.map((item) => {
505
- if (item.question)
506
- return item; // Already has question data
507
- const questionData = questionMap.get(item.questionBankItemId);
508
- if (questionData) {
509
- return {
510
- ...item,
511
- question: {
512
- id: questionData.id,
513
- title: questionData.title,
514
- question: questionData.question,
515
- note: questionData.note,
516
- difficulty: questionData.difficulty,
517
- interface: questionData.interface,
518
- },
519
- };
520
- }
521
- return item;
522
- }),
523
- })),
524
- }));
525
- }
526
- mapQuestionnaireItemToView(item, _section) {
527
- const q = item;
528
- const title = this.itemQuestionHeading(q);
529
- const note = this.itemQuestionNotePreview(q);
530
- const badges = [];
531
- const req = q.isRequired;
532
- const rawReq = typeof req === 'boolean' || typeof req === 'string' ? req : undefined;
533
- const requiredMode = getQuestionnaireItemRequiredBadgeMode(rawReq);
534
- if (requiredMode === 'required') {
535
- badges.push({
536
- text: '@assessment-management:questionnaires.components.questionnaire-builder.item-badge.required',
537
- variant: 'danger',
538
- });
539
- }
540
- else if (requiredMode === 'conditional') {
541
- badges.push({
542
- text: '@assessment-management:questionnaires.components.questionnaire-builder.item-badge.conditional-required',
543
- variant: 'warning',
544
- });
545
- }
546
- else {
547
- badges.push({
548
- text: '@assessment-management:questionnaires.components.questionnaire-builder.item-badge.optional',
549
- variant: 'success',
550
- });
551
- }
552
- const rawVis = q.isVisible;
553
- const visibilityMode = getQuestionnaireItemVisibilityBadgeMode(typeof rawVis === 'boolean' || typeof rawVis === 'string' ? rawVis : undefined);
554
- if (visibilityMode === 'hidden') {
555
- badges.push({
556
- text: '@assessment-management:questionnaires.components.questionnaire-builder.item-badge.visibility-hidden',
557
- variant: 'danger',
558
- });
559
- }
560
- else if (visibilityMode === 'conditional') {
561
- badges.push({
562
- text: '@assessment-management:questionnaires.components.questionnaire-builder.item-badge.visibility-conditional',
563
- variant: 'warning',
564
- });
565
- }
566
- else {
567
- badges.push({
568
- text: '@assessment-management:questionnaires.components.questionnaire-builder.item-badge.visibility-visible',
569
- variant: 'success',
570
- });
571
- }
572
- return {
573
- icon: this.getQuestionWidgetIcon(q),
574
- title,
575
- name: q.name,
576
- description: note || undefined,
577
- badges,
578
- };
579
- }
580
- /**
581
- * Standard section-items builder emits here. Uses direct `builderState.update` so the `valueChange`
582
- * effect runs in the same turn and hosts (e.g. questions page) can mark dirty.
583
- */
584
- onBuilderValueChange(next) {
585
- this.builderState.update((state) => {
586
- const updatedState = {
587
- ...state,
588
- sections: this.mergeSectionsFromStandardBuilder(next.sections, state.sections),
589
- };
590
- if (updatedState.sections.length === 0) {
591
- const defaultSection = createDefaultSection();
592
- defaultSection.order = 0;
593
- return { ...updatedState, sections: [defaultSection] };
594
- }
595
- return updatedState;
596
- });
597
- }
598
- mergeSectionsFromStandardBuilder(incoming, previous) {
599
- const prevByName = new Map(previous.map((s) => [s.name, s]));
600
- return incoming.map((sec) => {
601
- const axSec = sec;
602
- const incomingName = String(axSec['name'] ?? axSec['id'] ?? '').trim();
603
- const prevSec = prevByName.get(incomingName);
604
- if (!prevSec) {
605
- return this.normalizeIncomingSection(sec);
606
- }
607
- const prevItemByName = new Map(prevSec.items.map((i) => [i.name, i]));
608
- const merged = this.normalizeIncomingSection(sec);
609
- return {
610
- ...merged,
611
- isNewlyAdded: prevSec.isNewlyAdded ?? merged.isNewlyAdded,
612
- items: merged.items.map((it) => {
613
- const prev = prevItemByName.get(it.name);
614
- if (!prev) {
615
- return it;
616
- }
617
- return {
618
- ...prev,
619
- ...it,
620
- question: it.question ?? prev.question,
621
- };
622
- }),
623
- };
624
- });
625
- }
626
- /** Map platform section rows (id + name) into domain sections (name only). */
627
- normalizeIncomingSection(sec) {
628
- const ax = sec;
629
- const name = String(ax['name'] ?? ax['id'] ?? '').trim() || `section-${Date.now()}`;
630
- return {
631
- name,
632
- title: sec.title,
633
- description: sec.description,
634
- order: sec.order,
635
- tags: sec.tags,
636
- isVisible: sec.isVisible,
637
- isNewlyAdded: sec.isNewlyAdded,
638
- items: sec.items.map((it) => this.normalizeIncomingItem(it)),
639
- };
640
- }
641
- normalizeIncomingItem(it) {
642
- const name = String(it['name'] ?? it['id'] ?? '').trim() || `item-${Date.now()}`;
643
- const qbi = it.questionBankItemId;
644
- return {
645
- name,
646
- questionBankItemId: qbi,
647
- order: it.order,
648
- isRequired: it.isRequired,
649
- isVisible: it.isVisible,
650
- interfaceOverride: it.interfaceOverride,
651
- hint: it.hint,
652
- comment: it.comment,
653
- tags: it.tags,
654
- question: it.question,
655
- isNewlyAdded: it.isNewlyAdded,
656
- };
657
- }
658
- /** Edit dialog context: default visible; normalize legacy string booleans; expressions pass through (property viewer handles binding). */
659
- questionEditFormIsVisible(raw) {
660
- if (raw === undefined || raw === null) {
661
- return true;
662
- }
663
- if (typeof raw === 'boolean') {
664
- return raw;
665
- }
666
- if (raw.trim() === '') {
667
- return true;
668
- }
669
- const t = raw.trim().toLowerCase();
670
- if (t === 'true' || t === '1') {
671
- return true;
672
- }
673
- if (t === 'false' || t === '0') {
674
- return false;
675
- }
676
- return raw.trim();
677
- }
678
- questionEditFormIsRequired(item) {
679
- const r = item.isRequired;
680
- if (typeof r === 'string') {
681
- const t = r.trim();
682
- if (!t) {
683
- return false;
684
- }
685
- const tl = t.toLowerCase();
686
- if (tl === 'true' || tl === '1') {
687
- return true;
688
- }
689
- if (tl === 'false' || tl === '0') {
690
- return false;
691
- }
692
- return t;
693
- }
694
- return r ?? false;
695
- }
696
- /** Persist from property viewer: omit when default visible; `false` when hidden; trimmed non-empty string = expression. */
697
- persistQuestionIsVisibleFromForm(value) {
698
- if (value === undefined || value === null) {
699
- return undefined;
700
- }
701
- if (typeof value === 'boolean') {
702
- return value ? undefined : false;
703
- }
704
- if (typeof value === 'string') {
705
- const t = value.trim();
706
- return t || undefined;
707
- }
708
- return undefined;
709
- }
710
- persistQuestionIsRequiredFromForm(value) {
711
- if (value === undefined || value === null) {
712
- return false;
713
- }
714
- if (typeof value === 'boolean') {
715
- return value;
716
- }
717
- if (typeof value === 'string') {
718
- const t = value.trim();
719
- if (!t) {
720
- return false;
721
- }
722
- return t;
723
- }
724
- return false;
725
- }
726
- async questionnairePromptEditItem(item, sectionId, _value) {
727
- const qItem = item;
728
- const validationFailed = async (titleKey, descKey, fallTitle, fallDesc) => {
729
- const title = (await this.translationService.translateAsync(titleKey)) || fallTitle;
730
- const content = (await this.translationService.translateAsync(descKey)) || fallDesc;
731
- this.toastService.show({ color: 'warning', title, content });
732
- throw new Error('QuestionnaireEditQuestionValidation');
733
- };
734
- try {
735
- const bankRow = qItem.questionBankItemId
736
- ? await this.entityService
737
- .withEntity(RootConfig.module.name, RootConfig.entities.questionBankItem.name)
738
- .data()
739
- .byKey(qItem.questionBankItemId)
740
- .catch(() => null)
741
- : null;
742
- const bankComment = normalizeQuestionCommentConfig(bankRow?.comment);
743
- const mergedCommentForForm = mergeQuestionCommentConfig(bankComment, qItem.comment);
744
- const bankHint = normalizeQuestionHintFromEntityRow(bankRow ?? {});
745
- const mergedHintForForm = mergeQuestionHintForViewer(bankHint, parseQuestionHintPartialFromRecord(qItem));
746
- const result = await this.propertyViewerService
747
- .create()
748
- .dialog((d) => {
749
- d.setTitle('@assessment-management:questionnaires.components.questionnaire-builder.actions.edit-question.title')
750
- .setSize('md')
751
- .setCloseButton(true)
752
- .setMode('advanced')
753
- .setTabs(QUESTIONNAIRE_QUESTION_EDIT_TABS)
754
- .setContext({
755
- name: qItem.name,
756
- tags: qItem.tags ?? [],
757
- isRequired: this.questionEditFormIsRequired(qItem),
758
- isVisible: this.questionEditFormIsVisible(qItem.isVisible),
759
- hint: createQuestionHintFormContext(mergedHintForForm),
760
- comment: mergedCommentForForm,
761
- })
762
- .onAction(async (ref) => {
763
- const context = ref.context();
764
- const rawId = String(context.name ?? '').trim();
765
- if (!rawId) {
766
- await validationFailed('@assessment-management:questionnaires.components.questionnaire-builder.validation.question-id-required.title', '@assessment-management:questionnaires.components.questionnaire-builder.validation.question-id-required.description', 'Question ID required', 'Enter a unique question ID.');
767
- }
768
- if (!this.isValidQuestionnaireItemName(rawId)) {
769
- await validationFailed('@assessment-management:questionnaires.components.questionnaire-builder.validation.question-id-invalid.title', '@assessment-management:questionnaires.components.questionnaire-builder.validation.question-id-invalid.description', 'Invalid question ID', 'Use letters, numbers, underscores, and hyphens (1–128 characters).');
770
- }
771
- const isDuplicate = this.builderState().sections.some((s) => s.items.some((i) => (s.name !== sectionId || i.name !== qItem.name) && i.name === rawId));
772
- if (isDuplicate) {
773
- await validationFailed('@assessment-management:questionnaires.components.questionnaire-builder.validation.question-id-duplicate.title', '@assessment-management:questionnaires.components.questionnaire-builder.validation.question-id-duplicate.description', 'Duplicate question ID', 'Another question already uses this ID.');
774
- }
775
- });
776
- })
777
- .show();
778
- if (!result) {
779
- return null;
780
- }
781
- const formData = result.values;
782
- const rawIdOut = String(formData.name ?? '').trim();
783
- const tags = this.normalizeTagsFromForm(formData.tags);
784
- const hintPersist = this.persistQuestionHintFromForm(bankHint, formData.hint);
785
- const commentPersist = this.persistQuestionCommentFromForm(bankComment, formData.comment);
786
- const nextItem = {
787
- ...qItem,
788
- name: rawIdOut,
789
- id: rawIdOut,
790
- tags,
791
- isRequired: this.persistQuestionIsRequiredFromForm(formData.isRequired),
792
- isVisible: this.persistQuestionIsVisibleFromForm(formData.isVisible),
793
- };
794
- if (hintPersist != null) {
795
- nextItem.hint = hintPersist;
796
- }
797
- else {
798
- delete nextItem.hint;
799
- }
800
- if (commentPersist != null) {
801
- nextItem.comment = commentPersist;
802
- }
803
- else {
804
- delete nextItem.comment;
805
- }
806
- return nextItem;
807
- }
808
- catch (error) {
809
- if (error instanceof Error && error.message === 'QuestionnaireEditQuestionValidation') {
810
- return null;
811
- }
812
- console.error('Error editing question:', error);
813
- return null;
814
- }
815
- }
816
- //#endregion
817
- //#region ---- Section Management ----
818
- /** Toolbar / page command: delegates to {@link AXPStandardSectionItemsBuilderComponent#addSection}. */
819
- async addSection() {
820
- await this.standardRef()?.addSection();
821
- }
822
- //#endregion
823
- //#region ---- Item Management ----
824
- async questionnairePromptAddItems(sectionId, value) {
825
- const all = value.sections;
826
- const section = all.find((x) => x.name === sectionId);
827
- if (!section)
828
- return null;
829
- return (await this.selectQuestionsFromQuestionBankForSection(section, all));
830
- }
831
- /**
832
- * Open question bank selector and return new items (standard builder appends them).
833
- */
834
- async selectQuestionsFromQuestionBankForSection(section, allSections) {
835
- try {
836
- const dataSource = new AXDataSource({
837
- key: 'id',
838
- pageSize: 20,
839
- load: async (e) => {
840
- const questions = await this.questionBankData().query(e);
841
- return {
842
- items: questions.items,
843
- total: questions.total,
844
- };
845
- },
846
- });
847
- // Create category tree data source for filtering
848
- const categoryTreeDataSource = {
849
- loadRootNodes: async () => {
850
- const result = await this.questionBankCategoryData().query({
851
- skip: 0,
852
- take: 1000,
853
- filter: {
854
- field: 'parentId',
855
- operator: { type: 'isEmpty' },
856
- value: true,
857
- },
858
- });
859
- return result.items.map((item) => ({
860
- id: item.id,
861
- title: item.title || item.name,
862
- description: item.description || '',
863
- parentId: item.parentId,
864
- childrenCount: item.childrenCount || 0,
865
- }));
866
- },
867
- loadChildNodes: async (parentId) => {
868
- const result = await this.questionBankCategoryData().query({
869
- skip: 0,
870
- take: 1000,
871
- filter: {
872
- field: 'parentId',
873
- operator: { type: 'equal' },
874
- value: parentId,
875
- },
876
- });
877
- return result.items.map((item) => ({
878
- id: item.id,
879
- title: item.title || item.name,
880
- description: item.description || '',
881
- parentId: item.parentId,
882
- childrenCount: item.childrenCount || 0,
883
- }));
884
- },
885
- searchNodes: async (searchValue) => {
886
- const result = await this.questionBankCategoryData().query({
887
- skip: 0,
888
- take: 1000,
889
- filter: {
890
- filters: [
891
- {
892
- field: 'title',
893
- operator: { type: 'contains' },
894
- value: searchValue,
895
- },
896
- {
897
- field: 'name',
898
- operator: { type: 'contains' },
899
- value: searchValue,
900
- },
901
- ],
902
- logic: 'or',
903
- },
904
- });
905
- return result.items.map((item) => ({
906
- id: item.id,
907
- title: item.title || item.name,
908
- description: item.description || '',
909
- parentId: item.parentId,
910
- childrenCount: item.childrenCount || 0,
911
- }));
912
- },
913
- };
914
- const entity = await this.entityResolver.resolve(RootConfig.module.name, RootConfig.entities.questionBankItem.name);
915
- if (!entity) {
916
- throw new Error('Entity not found: ' + RootConfig.entities.questionBankItem.name);
917
- }
918
- const columns = entity.columns
919
- ?.filter((column) => entity.properties.some((property) => property.name === column.name))
920
- .map((column) => {
921
- const property = entity.properties.find((prop) => prop.name === column.name);
922
- return {
923
- name: column.name,
924
- title: property?.title ?? '',
925
- visible: column.options?.visible !== false,
926
- widget: {
927
- type: column.showAs?.type ?? property?.schema?.interface?.type ?? 'text-editor',
928
- options: column.showAs?.options ?? property?.schema?.interface?.options ?? {},
929
- },
930
- };
931
- }) || [];
932
- // Translate titles
933
- const selectQuestionsTitle = (await this.translationService.translateAsync('@assessment-management:questionnaires.components.questionnaire-builder.select-questions')) || 'Select Questions from Question Bank';
934
- const categoriesTitle = (await this.translationService.translateAsync('@assessment-management:questionnaires.components.questionnaire-builder.categories')) || 'Categories';
935
- const titleLabel = (await this.translationService.translateAsync('@general:terms.common.title')) || 'Title';
936
- const noteLabel = (await this.translationService.translateAsync('@assessment-management:question-bank.entities.question-bank-item.fields.note.title')) || 'Note';
937
- // Open data selector with category filter
938
- const result = await this.dataSelectorService.openWithCategoryFilter({
939
- title: selectQuestionsTitle,
940
- dataSource: dataSource,
941
- columns: columns,
942
- selectionMode: 'multiple',
943
- searchFields: [
944
- { name: 'title', title: titleLabel },
945
- { name: 'note', title: noteLabel },
946
- ],
947
- allowCreate: 'full',
948
- onCreate: (mode) => this.createQuestionBankItem(entity, mode),
949
- }, {
950
- title: categoriesTitle,
951
- dataSource: categoryTreeDataSource,
952
- filterField: 'categoryIds',
953
- filterOperator: 'contains',
954
- width: '350px',
955
- });
956
- if (result?.items && result.items.length > 0) {
957
- const questionPromises = result.items.map((item) => this.questionBankData()
958
- .byKey(item.id)
959
- .catch(() => null));
960
- const questions = await Promise.all(questionPromises);
961
- const used = collectQuestionnaireItemNames(allSections);
962
- const baseOrder = section.items.length;
963
- const newItems = result.items.map((item, index) => {
964
- const fullQuestion = questions[index];
965
- const qName = allocateNextQuestionItemName(used);
966
- used.add(qName);
967
- return {
968
- name: qName,
969
- questionBankItemId: item.id,
970
- order: baseOrder + index,
971
- isRequired: false,
972
- isVisible: undefined,
973
- isNewlyAdded: true,
974
- question: fullQuestion
975
- ? {
976
- id: fullQuestion.id,
977
- title: fullQuestion.title,
978
- question: fullQuestion.question,
979
- note: fullQuestion.note,
980
- difficulty: fullQuestion.difficulty,
981
- }
982
- : {
983
- id: item.id,
984
- title: item.title || 'Question',
985
- question: item.question,
986
- note: item.note,
987
- difficulty: item.difficulty,
988
- },
989
- };
990
- });
991
- return newItems;
992
- }
993
- return null;
994
- }
995
- catch (error) {
996
- console.error('Error loading questions:', error);
997
- return null;
998
- }
999
- }
1000
- /**
1001
- * Create a new question bank item via Entity:Create and return it for selection in the data selector.
1002
- */
1003
- async createQuestionBankItem(entity, _mode) {
1004
- const result = await this.commandService.execute('Entity:Create', {
1005
- __context__: {
1006
- entity: `${entity.module}.${entity.name}`,
1007
- entityInfo: {
1008
- name: entity.name,
1009
- module: entity.module,
1010
- title: entity.title,
1011
- parentKey: entity.parentKey,
1012
- },
1013
- data: {},
1014
- options: {},
1015
- },
1016
- });
1017
- if (result?.success && result?.data) {
1018
- const item = Array.isArray(result.data) ? result.data[0] : result.data;
1019
- return item;
1020
- }
1021
- return null;
1022
- }
1023
- /**
1024
- * Maps nested `hint` from the question property viewer to persisted questionnaire item `hint` partial (diff from bank).
1025
- */
1026
- persistQuestionHintFromForm(bank, hint) {
1027
- if (!hint) {
1028
- return undefined;
1029
- }
1030
- const modeRaw = hint.mode == null ? undefined : typeof hint.mode === 'string' ? hint.mode : hint.mode.id;
1031
- const mode = normalizeQuestionHintMode(modeRaw) ?? 'off';
1032
- const c = hint.content;
1033
- let content;
1034
- if (c == null) {
1035
- content = undefined;
1036
- }
1037
- else if (typeof c === 'string') {
1038
- const t = c.trim();
1039
- content = t || undefined;
1040
- }
1041
- else if (typeof c === 'object') {
1042
- content = c;
1043
- }
1044
- const edited = normalizeQuestionHintConfig({ mode, content });
1045
- return diffQuestionHintOverride(bank, edited);
1046
- }
1047
- /**
1048
- * Persists questionnaire item `comment` override: only fields that differ from the question bank default.
1049
- */
1050
- persistQuestionCommentFromForm(bank, form) {
1051
- if (!form) {
1052
- return undefined;
1053
- }
1054
- const edited = normalizeQuestionCommentConfig(form);
1055
- return diffQuestionCommentOverride(bank, edited);
1056
- }
1057
- /**
1058
- * Normalize tag-editor output to trimmed unique strings (supports string[] or { title }[] from tag service).
1059
- */
1060
- normalizeTagsFromForm(raw) {
1061
- if (raw == null || !Array.isArray(raw))
1062
- return undefined;
1063
- const seen = new Set();
1064
- const out = [];
1065
- for (const entry of raw) {
1066
- let t = '';
1067
- if (typeof entry === 'string')
1068
- t = entry.trim();
1069
- else if (entry && typeof entry === 'object' && 'title' in entry) {
1070
- t = String(entry.title).trim();
1071
- }
1072
- if (!t)
1073
- continue;
1074
- const key = t.toLowerCase();
1075
- if (seen.has(key))
1076
- continue;
1077
- seen.add(key);
1078
- out.push(t);
1079
- }
1080
- return out.length ? out : undefined;
1081
- }
1082
- /** Allowed characters for questionnaire item technical name (UUID-safe). */
1083
- isValidQuestionnaireItemName(name) {
1084
- return name.length >= 1 && name.length <= 128 && /^[a-zA-Z0-9_-]+$/.test(name);
1085
- }
1086
- /**
1087
- * Plain heading for builder cards: prefer rich `question`, else admin list `title`.
1088
- */
1089
- itemQuestionHeading(item) {
1090
- const q = item.question;
1091
- if (!q) {
1092
- return 'Question';
1093
- }
1094
- const locale = this.translationService.getActiveLang?.() ?? 'en-US';
1095
- const raw = q.question;
1096
- if (raw != null && raw !== '') {
1097
- const html = typeof raw === 'string' ? raw : resolveMultiLanguageString(raw, locale);
1098
- const plain = stripHtmlToPlain(html);
1099
- if (plain.trim()) {
1100
- return plain;
1101
- }
1102
- }
1103
- const titleResolved = resolveMultiLanguageString(q.title, locale);
1104
- return titleResolved.trim() || 'Question';
1105
- }
1106
- /** Plain preview line for optional note under the heading. */
1107
- itemQuestionNotePreview(item) {
1108
- const raw = item.question?.note;
1109
- if (raw == null || raw === '') {
1110
- return '';
1111
- }
1112
- const locale = this.translationService.getActiveLang?.() ?? 'en-US';
1113
- const html = typeof raw === 'string' ? raw : resolveMultiLanguageString(raw, locale);
1114
- return stripHtmlToPlain(html);
1115
- }
1116
- /**
1117
- * Resolve icon based on widget type, with safe fallback.
1118
- */
1119
- getQuestionWidgetIcon(item) {
1120
- const fallbackIcon = 'fa-light fa-question-circle';
1121
- const widgetType = item.interfaceOverride?.type ?? item.question?.interface?.type;
1122
- if (!widgetType) {
1123
- return fallbackIcon;
1124
- }
1125
- try {
1126
- return this.widgetRegistry.resolve(widgetType).icon ?? fallbackIcon;
1127
- }
1128
- catch {
1129
- return fallbackIcon;
1130
- }
1131
- }
1132
- //#endregion
1133
- //#region ---- Preview ----
1134
- /**
1135
- * Open preview dialog with questionnaire viewer
1136
- */
1137
- async handlePreview() {
1138
- if (this.isPreviewDisabled()) {
1139
- return;
1140
- }
1141
- try {
1142
- const currentValue = convertStateToValue(this.builderState(), this.value() || undefined);
1143
- // Always use the current displaySettings from the computed property to ensure preview uses latest settings
1144
- currentValue.displaySettings = this.displaySettings();
1145
- const previewTitle = (await this.translationService.translateAsync('@assessment-management:questionnaires.components.questionnaire-builder.actions.preview.title')) || 'Preview';
1146
- const result = await this.questionnaireViewerService.open({
1147
- title: previewTitle,
1148
- structure: currentValue,
1149
- prePostConfig: this.prePostConfig() ?? undefined,
1150
- questionnaireId: this.questionnaireEntityId(),
1151
- });
1152
- // Handle result if needed (answers, submitted status)
1153
- if (result) {
1154
- console.log('Questionnaire preview result:', result);
1155
- }
1156
- }
1157
- catch (error) {
1158
- console.error('Error opening preview:', error);
1159
- }
1160
- }
1161
- /**
1162
- * Toggle fullscreen mode using the directive
1163
- */
1164
- async handleFullscreen() {
1165
- const fullscreen = this.fullscreenDirective();
1166
- if (fullscreen) {
1167
- await fullscreen.toggle();
1168
- }
1169
- }
1170
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1171
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXMQuestionnaireBuilderComponent, isStandalone: true, selector: "axm-questionnaire-builder", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, prePostConfig: { classPropertyName: "prePostConfig", publicName: "prePostConfig", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, displaySettingsInput: { classPropertyName: "displaySettingsInput", publicName: "displaySettingsInput", isSignal: true, isRequired: false, transformFunction: null }, questionnaireEntityId: { classPropertyName: "questionnaireEntityId", publicName: "questionnaireEntityId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "fullscreenDirective", first: true, predicate: ["fullscreen"], descendants: true, isSignal: true }, { propertyName: "standardRef", first: true, predicate: AXPStandardSectionItemsBuilderComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"axm-questionnaire-builder\" axFullscreen #fullscreen=\"axFullscreen\">\n @if (showHeader()) {\n <div class=\"__header\">\n <div class=\"__header-left\"></div>\n <div class=\"__header-right\">\n @if (!readonly()) {\n <ax-button class=\"ax-sm\" [text]=\"\n ('@assessment-management:questionnaires.components.questionnaire-builder.actions.add-section.title'\n | translate\n | async) || 'Add Section'\n \" [color]=\"'primary'\" (onClick)=\"addSection()\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-layer-group\"></ax-icon>\n </ax-prefix>\n </ax-button>\n <ax-button class=\"ax-sm\" [title]=\"\n ('@assessment-management:questionnaires.components.questionnaire-builder.actions.preview.title'\n | translate\n | async) || 'Preview'\n \" [disabled]=\"isPreviewDisabled()\" (onClick)=\"handlePreview()\">\n <ax-icon icon=\"fa-light fa-eye\"></ax-icon>\n </ax-button>\n }\n <ax-button class=\"ax-sm\" [title]=\"\n ('@assessment-management:questionnaires.components.questionnaire-builder.actions.fullscreen.title'\n | translate\n | async) || 'Full Screen'\n \" (onClick)=\"handleFullscreen()\">\n <ax-icon icon=\"fa-light fa-expand\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n\n <axp-standard-section-items-builder #standardRef class=\"ax-block ax-min-h-[200px]\" [value]=\"builderValue()\"\n [config]=\"standardConfig()\" [readonly]=\"readonly()\" (valueChange)=\"onBuilderValueChange($event)\" />\n</div>", styles: [".axm-questionnaire-builder{display:flex;height:100%;width:100%;flex-direction:column}.axm-questionnaire-builder .__header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;border-bottom-width:1px;padding:.75rem}.axm-questionnaire-builder .__header .__header-left,.axm-questionnaire-builder .__header .__header-right{display:flex;gap:.5rem}.axm-questionnaire-builder .__content{flex:1 1 0%;overflow:auto;padding:.75rem}.axm-questionnaire-builder .__sections-container{display:flex;flex-direction:column;gap:1rem}.axm-questionnaire-builder .__section{border-radius:.375rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__section .__section-header{display:flex;align-items:center;gap:.75rem;border-bottom-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axm-questionnaire-builder .__section .__section-header .__section-drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1));cursor:grab}.axm-questionnaire-builder .__section .__section-header .__section-drag-handle:active{cursor:grabbing}.axm-questionnaire-builder .__section .__section-header .__section-drag-handle:hover{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__section .__section-header .__section-info{flex:1 1 0%}.axm-questionnaire-builder .__section .__section-header .__section-info .__section-title{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.axm-questionnaire-builder .__section .__section-header .__section-info .__section-description{font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__section .__section-header .__section-actions{display:flex;gap:.5rem}.axm-questionnaire-builder .__section .__items-container{padding:1rem}.axm-questionnaire-builder .__section .__items-container .__items-list{gap:.75rem;min-height:3rem;display:flex;flex-direction:column}.axm-questionnaire-builder .__item{display:flex;align-items:center;gap:.75rem;border-radius:.5rem;border-width:1px;padding:1rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));cursor:move;-webkit-user-select:none;user-select:none;transition:all .2s ease-in-out}.axm-questionnaire-builder .__item:hover{--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axm-questionnaire-builder .__item.__selected{--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-accent2-500),var(--tw-border-opacity, 1));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-accent2-lightest-surface));color:rgb(var(--ax-sys-color-on-accent2-lightest-surface));border-color:rgb(var(--ax-sys-color-border-accent2-lightest-surface))}.axm-questionnaire-builder .__item .__drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1));cursor:grab;transition:color .15s ease-in-out}.axm-questionnaire-builder .__item .__drag-handle:active{cursor:grabbing}.axm-questionnaire-builder .__item .__drag-handle:hover{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content{flex:1 1 0%}.axm-questionnaire-builder .__item .__item-content .__item-header{display:flex;align-items:flex-start;gap:1rem}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));flex-shrink:0;transition:all .2s ease-in-out}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon.__difficulty-easy{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon.__difficulty-medium{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon.__difficulty-hard{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info{min-width:0px;flex:1 1 0%}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info .__item-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.5rem;row-gap:.25rem;margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));line-height:1.4}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info .__item-title .__item-title-text{min-width:0px;flex:1 1 0%}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info .__item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1));line-height:1.5}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;gap:.5rem;flex-shrink:0}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta .__item-id{display:inline-flex;flex-shrink:0;align-items:center;border-radius:.25rem;padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.75rem;line-height:1rem;font-weight:600;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta .__item-badge{border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta .__item-badge.__required{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-actions{display:flex;gap:.5rem;flex-shrink:0}.axm-questionnaire-builder .__preview-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.axm-questionnaire-builder .__preview-container .__preview-sections>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.axm-questionnaire-builder .__preview-container .__preview-section{border-radius:.5rem;border-width:1px;padding:1rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-section-title{margin-bottom:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-section-description{margin-bottom:1rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item{display:flex;align-items:flex-start;gap:.75rem;border-radius:.375rem;border-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-icon{display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:.375rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-primary-500),var(--tw-text-opacity, 1));background-color:rgb(var(--ax-sys-color-primary-lightest-surface));color:rgb(var(--ax-sys-color-on-primary-lightest-surface));border-color:rgb(var(--ax-sys-color-border-primary-lightest-surface))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info{flex:1 1 0%}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info .__preview-item-title{margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info .__preview-item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info .__preview-item-badge{margin-top:.5rem;display:inline-block;border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item.cdk-drag-placeholder{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header{display:flex;align-items:center;gap:.75rem;border-bottom-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-info{flex:1 1 0%}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-info .__section-title{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-info .__section-description{font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-actions{display:flex;gap:.5rem}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__items-container{padding:1rem}.axm-questionnaire-builder .__item.cdk-drag-placeholder{position:relative;opacity:.6;border-width:2px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-lightest-surface),var(--tw-bg-opacity, 1));border-radius:.5rem;min-height:5.5rem;transition:all .2s ease-in-out;padding:1rem;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__drag-handle,.axm-questionnaire-builder .__item.cdk-drag-placeholder .__item-content,.axm-questionnaire-builder .__item.cdk-drag-placeholder .__item-actions{opacity:0}.axm-questionnaire-builder .__section.cdk-drag-placeholder{opacity:.5;border-width:2px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-lightest-surface),var(--tw-bg-opacity, 1));border-radius:.375rem;min-height:4rem;transition:all .2s ease-in-out}.axm-questionnaire-builder .__section.cdk-drag-placeholder>*{opacity:0}.axm-questionnaire-builder .cdk-drop-list-dragging .__item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.axm-questionnaire-builder .cdk-drop-list-dragging .__section:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.__item.cdk-drag-preview{border-radius:.5rem;border-width:1px;--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));display:flex;align-items:center;gap:.75rem;padding:1rem;opacity:.9;box-sizing:border-box}.__item.cdk-drag-preview .__drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content{flex:1 1 0%}.__item.cdk-drag-preview .__item-content .__item-header{display:flex;align-items:flex-start;gap:1rem}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));flex-shrink:0;transition:all .2s ease-in-out}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon.__difficulty-easy{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon.__difficulty-medium{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon.__difficulty-hard{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-info{min-width:0px;flex:1 1 0%}.__item.cdk-drag-preview .__item-content .__item-header .__item-info .__item-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.5rem;row-gap:.25rem;margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));line-height:1.4}.__item.cdk-drag-preview .__item-content .__item-header .__item-info .__item-title .__item-title-text{min-width:0px;flex:1 1 0%}.__item.cdk-drag-preview .__item-content .__item-header .__item-info .__item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1));line-height:1.5}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;gap:.5rem;flex-shrink:0}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta .__item-id{display:inline-flex;flex-shrink:0;align-items:center;border-radius:.25rem;padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.75rem;line-height:1rem;font-weight:600;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta .__item-badge{border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta .__item-badge.__required{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-actions{display:flex;gap:.5rem;flex-shrink:0}.__section.cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));opacity:.9;box-sizing:border-box;background-color:var(--ax-lightest-surface)}.__section.cdk-drag-preview .__section-header{display:flex;align-items:center;gap:.75rem;border-bottom-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.__section.cdk-drag-preview .__section-header .__section-drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1));cursor:grab}.__section.cdk-drag-preview .__section-header .__section-info{flex:1 1 0%}.__section.cdk-drag-preview .__section-header .__section-info .__section-title{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__section-header .__section-info .__section-description{font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__section-header .__section-actions{display:flex;gap:.5rem}.__section.cdk-drag-preview .__items-container{padding:1rem}.__section.cdk-drag-preview .__items-container .__items-list{gap:.75rem;display:flex;flex-direction:column}.__section.cdk-drag-preview .__item{display:flex;align-items:center;gap:.75rem;border-radius:.5rem;border-width:1px;padding:1rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.__section.cdk-drag-preview .__item .__drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content{flex:1 1 0%}.__section.cdk-drag-preview .__item .__item-content .__item-header{display:flex;align-items:flex-start;gap:1rem}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));flex-shrink:0}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon.__difficulty-easy{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon.__difficulty-medium{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon.__difficulty-hard{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info{min-width:0px;flex:1 1 0%}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info .__item-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.5rem;row-gap:.25rem;margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));line-height:1.4}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info .__item-title .__item-title-text{min-width:0px;flex:1 1 0%}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info .__item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1));line-height:1.5}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;gap:.5rem;flex-shrink:0}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta .__item-id{display:inline-flex;flex-shrink:0;align-items:center;border-radius:.25rem;padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.75rem;line-height:1rem;font-weight:600;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta .__item-badge{border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta .__item-badge.__required{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-actions{display:flex;gap:.5rem;flex-shrink:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "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.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { 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: AXDropdownModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXSwitchModule }, { kind: "ngmodule", type: AXLabelModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPStandardSectionItemsBuilderComponent, selector: "axp-standard-section-items-builder", inputs: ["value", "config", "readonly"], outputs: ["valueChange"] }, { kind: "directive", type: AXFullScreenDirective, selector: "[axFullscreen]", outputs: ["fullscreenChange"], exportAs: ["axFullscreen"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1172
- }
1173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireBuilderComponent, decorators: [{
1174
- type: Component,
1175
- args: [{ selector: 'axm-questionnaire-builder', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1176
- CommonModule,
1177
- FormsModule,
1178
- AXButtonModule,
1179
- AXDecoratorModule,
1180
- AXDropdownModule,
1181
- AXFormModule,
1182
- AXSwitchModule,
1183
- AXLabelModule,
1184
- AXTranslationModule,
1185
- AXPStandardSectionItemsBuilderComponent,
1186
- AXFullScreenDirective,
1187
- ], template: "<div class=\"axm-questionnaire-builder\" axFullscreen #fullscreen=\"axFullscreen\">\n @if (showHeader()) {\n <div class=\"__header\">\n <div class=\"__header-left\"></div>\n <div class=\"__header-right\">\n @if (!readonly()) {\n <ax-button class=\"ax-sm\" [text]=\"\n ('@assessment-management:questionnaires.components.questionnaire-builder.actions.add-section.title'\n | translate\n | async) || 'Add Section'\n \" [color]=\"'primary'\" (onClick)=\"addSection()\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-layer-group\"></ax-icon>\n </ax-prefix>\n </ax-button>\n <ax-button class=\"ax-sm\" [title]=\"\n ('@assessment-management:questionnaires.components.questionnaire-builder.actions.preview.title'\n | translate\n | async) || 'Preview'\n \" [disabled]=\"isPreviewDisabled()\" (onClick)=\"handlePreview()\">\n <ax-icon icon=\"fa-light fa-eye\"></ax-icon>\n </ax-button>\n }\n <ax-button class=\"ax-sm\" [title]=\"\n ('@assessment-management:questionnaires.components.questionnaire-builder.actions.fullscreen.title'\n | translate\n | async) || 'Full Screen'\n \" (onClick)=\"handleFullscreen()\">\n <ax-icon icon=\"fa-light fa-expand\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n\n <axp-standard-section-items-builder #standardRef class=\"ax-block ax-min-h-[200px]\" [value]=\"builderValue()\"\n [config]=\"standardConfig()\" [readonly]=\"readonly()\" (valueChange)=\"onBuilderValueChange($event)\" />\n</div>", styles: [".axm-questionnaire-builder{display:flex;height:100%;width:100%;flex-direction:column}.axm-questionnaire-builder .__header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;border-bottom-width:1px;padding:.75rem}.axm-questionnaire-builder .__header .__header-left,.axm-questionnaire-builder .__header .__header-right{display:flex;gap:.5rem}.axm-questionnaire-builder .__content{flex:1 1 0%;overflow:auto;padding:.75rem}.axm-questionnaire-builder .__sections-container{display:flex;flex-direction:column;gap:1rem}.axm-questionnaire-builder .__section{border-radius:.375rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__section .__section-header{display:flex;align-items:center;gap:.75rem;border-bottom-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axm-questionnaire-builder .__section .__section-header .__section-drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1));cursor:grab}.axm-questionnaire-builder .__section .__section-header .__section-drag-handle:active{cursor:grabbing}.axm-questionnaire-builder .__section .__section-header .__section-drag-handle:hover{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__section .__section-header .__section-info{flex:1 1 0%}.axm-questionnaire-builder .__section .__section-header .__section-info .__section-title{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.axm-questionnaire-builder .__section .__section-header .__section-info .__section-description{font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__section .__section-header .__section-actions{display:flex;gap:.5rem}.axm-questionnaire-builder .__section .__items-container{padding:1rem}.axm-questionnaire-builder .__section .__items-container .__items-list{gap:.75rem;min-height:3rem;display:flex;flex-direction:column}.axm-questionnaire-builder .__item{display:flex;align-items:center;gap:.75rem;border-radius:.5rem;border-width:1px;padding:1rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));cursor:move;-webkit-user-select:none;user-select:none;transition:all .2s ease-in-out}.axm-questionnaire-builder .__item:hover{--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axm-questionnaire-builder .__item.__selected{--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-accent2-500),var(--tw-border-opacity, 1));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-accent2-lightest-surface));color:rgb(var(--ax-sys-color-on-accent2-lightest-surface));border-color:rgb(var(--ax-sys-color-border-accent2-lightest-surface))}.axm-questionnaire-builder .__item .__drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1));cursor:grab;transition:color .15s ease-in-out}.axm-questionnaire-builder .__item .__drag-handle:active{cursor:grabbing}.axm-questionnaire-builder .__item .__drag-handle:hover{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content{flex:1 1 0%}.axm-questionnaire-builder .__item .__item-content .__item-header{display:flex;align-items:flex-start;gap:1rem}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));flex-shrink:0;transition:all .2s ease-in-out}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon.__difficulty-easy{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon.__difficulty-medium{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-icon.__difficulty-hard{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info{min-width:0px;flex:1 1 0%}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info .__item-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.5rem;row-gap:.25rem;margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));line-height:1.4}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info .__item-title .__item-title-text{min-width:0px;flex:1 1 0%}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-info .__item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1));line-height:1.5}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;gap:.5rem;flex-shrink:0}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta .__item-id{display:inline-flex;flex-shrink:0;align-items:center;border-radius:.25rem;padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.75rem;line-height:1rem;font-weight:600;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta .__item-badge{border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-content .__item-header .__item-meta .__item-badge.__required{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item .__item-actions{display:flex;gap:.5rem;flex-shrink:0}.axm-questionnaire-builder .__preview-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.axm-questionnaire-builder .__preview-container .__preview-sections>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.axm-questionnaire-builder .__preview-container .__preview-section{border-radius:.5rem;border-width:1px;padding:1rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-section-title{margin-bottom:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-section-description{margin-bottom:1rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item{display:flex;align-items:flex-start;gap:.75rem;border-radius:.375rem;border-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-icon{display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:.375rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-primary-500),var(--tw-text-opacity, 1));background-color:rgb(var(--ax-sys-color-primary-lightest-surface));color:rgb(var(--ax-sys-color-on-primary-lightest-surface));border-color:rgb(var(--ax-sys-color-border-primary-lightest-surface))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info{flex:1 1 0%}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info .__preview-item-title{margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info .__preview-item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__preview-container .__preview-section .__preview-items .__preview-item .__preview-item-info .__preview-item-badge{margin-top:.5rem;display:inline-block;border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item.cdk-drag-placeholder{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header{display:flex;align-items:center;gap:.75rem;border-bottom-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-info{flex:1 1 0%}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-info .__section-title{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-info .__section-description{font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__section-header .__section-actions{display:flex;gap:.5rem}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__items-container{padding:1rem}.axm-questionnaire-builder .__item.cdk-drag-placeholder{position:relative;opacity:.6;border-width:2px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-lightest-surface),var(--tw-bg-opacity, 1));border-radius:.5rem;min-height:5.5rem;transition:all .2s ease-in-out;padding:1rem;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.axm-questionnaire-builder .__item.cdk-drag-placeholder .__drag-handle,.axm-questionnaire-builder .__item.cdk-drag-placeholder .__item-content,.axm-questionnaire-builder .__item.cdk-drag-placeholder .__item-actions{opacity:0}.axm-questionnaire-builder .__section.cdk-drag-placeholder{opacity:.5;border-width:2px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-lightest-surface),var(--tw-bg-opacity, 1));border-radius:.375rem;min-height:4rem;transition:all .2s ease-in-out}.axm-questionnaire-builder .__section.cdk-drag-placeholder>*{opacity:0}.axm-questionnaire-builder .cdk-drop-list-dragging .__item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.axm-questionnaire-builder .cdk-drop-list-dragging .__section:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.__item.cdk-drag-preview{border-radius:.5rem;border-width:1px;--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));display:flex;align-items:center;gap:.75rem;padding:1rem;opacity:.9;box-sizing:border-box}.__item.cdk-drag-preview .__drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content{flex:1 1 0%}.__item.cdk-drag-preview .__item-content .__item-header{display:flex;align-items:flex-start;gap:1rem}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));flex-shrink:0;transition:all .2s ease-in-out}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon.__difficulty-easy{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon.__difficulty-medium{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-icon.__difficulty-hard{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-info{min-width:0px;flex:1 1 0%}.__item.cdk-drag-preview .__item-content .__item-header .__item-info .__item-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.5rem;row-gap:.25rem;margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));line-height:1.4}.__item.cdk-drag-preview .__item-content .__item-header .__item-info .__item-title .__item-title-text{min-width:0px;flex:1 1 0%}.__item.cdk-drag-preview .__item-content .__item-header .__item-info .__item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1));line-height:1.5}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;gap:.5rem;flex-shrink:0}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta .__item-id{display:inline-flex;flex-shrink:0;align-items:center;border-radius:.25rem;padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.75rem;line-height:1rem;font-weight:600;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta .__item-badge{border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-content .__item-header .__item-meta .__item-badge.__required{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.__item.cdk-drag-preview .__item-actions{display:flex;gap:.5rem;flex-shrink:0}.__section.cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));opacity:.9;box-sizing:border-box;background-color:var(--ax-lightest-surface)}.__section.cdk-drag-preview .__section-header{display:flex;align-items:center;gap:.75rem;border-bottom-width:1px;padding:.75rem;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.__section.cdk-drag-preview .__section-header .__section-drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1));cursor:grab}.__section.cdk-drag-preview .__section-header .__section-info{flex:1 1 0%}.__section.cdk-drag-preview .__section-header .__section-info .__section-title{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__section-header .__section-info .__section-description{font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__section-header .__section-actions{display:flex;gap:.5rem}.__section.cdk-drag-preview .__items-container{padding:1rem}.__section.cdk-drag-preview .__items-container .__items-list{gap:.75rem;display:flex;flex-direction:column}.__section.cdk-drag-preview .__item{display:flex;align-items:center;gap:.75rem;border-radius:.5rem;border-width:1px;padding:1rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.__section.cdk-drag-preview .__item .__drag-handle{display:flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content{flex:1 1 0%}.__section.cdk-drag-preview .__item .__item-content .__item-header{display:flex;align-items:flex-start;gap:1rem}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));flex-shrink:0}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon.__difficulty-easy{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon.__difficulty-medium{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-icon.__difficulty-hard{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info{min-width:0px;flex:1 1 0%}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info .__item-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.5rem;row-gap:.25rem;margin-bottom:.25rem;font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));line-height:1.4}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info .__item-title .__item-title-text{min-width:0px;flex:1 1 0%}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-info .__item-description{margin-top:.25rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1));line-height:1.5}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;gap:.5rem;flex-shrink:0}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta .__item-id{display:inline-flex;flex-shrink:0;align-items:center;border-radius:.25rem;padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.75rem;line-height:1rem;font-weight:600;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta .__item-badge{border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-content .__item-header .__item-meta .__item-badge.__required{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-800),var(--tw-text-opacity, 1))}.__section.cdk-drag-preview .__item .__item-actions{display:flex;gap:.5rem;flex-shrink:0}\n"] }]
1188
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], prePostConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "prePostConfig", required: false }] }], showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], displaySettingsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "displaySettingsInput", required: false }] }], questionnaireEntityId: [{ type: i0.Input, args: [{ isSignal: true, alias: "questionnaireEntityId", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], fullscreenDirective: [{ type: i0.ViewChild, args: ['fullscreen', { isSignal: true }] }], standardRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXPStandardSectionItemsBuilderComponent), { isSignal: true }] }] } });
1189
-
1190
- /** Local command handled in execute(); reverts questions to rootContext (no AXPCommand). */
1191
- const QUESTIONNAIRE_QUESTIONS_DISCARD_COMMAND = 'Questionnaire:Questions:Discard';
1192
- const QUESTIONNAIRE_QUESTIONS_ADD_SECTION_COMMAND = 'Questionnaire:Questions:AddSection';
1193
- const QUESTIONNAIRE_QUESTIONS_PREVIEW_COMMAND = 'Questionnaire:Questions:Preview';
1194
- //#region ---- Questionnaire Questions Page Component ----
1195
- /**
1196
- * Page component that renders the questions property using axm-questionnaire-builder.
1197
- * Extends AXPPageLayoutBaseComponent to provide a Save button that persists questions via Questionnaire:Questions:Save.
1198
- * Receives rootContext (entity data).
1199
- */
1200
- class AXMQuestionnaireQuestionsPageComponent extends AXPPageLayoutBaseComponent {
1201
- //#endregion
1202
- //#region ---- Lifecycle ----
1203
- constructor() {
1204
- super();
1205
- //#region ---- Inputs ----
1206
- this.rootContext = input(...(ngDevMode ? [undefined, { debugName: "rootContext" }] : /* istanbul ignore next */ []));
1207
- /** Optional page config (e.g. field, layout) set by the page-component-renderer. */
1208
- this.pageConfig = input(...(ngDevMode ? [undefined, { debugName: "pageConfig" }] : /* istanbul ignore next */ []));
1209
- //#endregion
1210
- //#region ---- Services & Dependencies ----
1211
- this.commandService = inject(AXPCommandService);
1212
- this.eventService = inject(AXPBroadcastEventService);
1213
- this.hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });
1214
- //#endregion
1215
- //#region ---- View References ----
1216
- this.builderRef = viewChild('builderRef', ...(ngDevMode ? [{ debugName: "builderRef" }] : /* istanbul ignore next */ []));
1217
- //#endregion
1218
- //#region ---- State Signals ----
1219
- /** Latest context (includes edited questions). Used for Save when rootContext is not updated by the parent. */
1220
- this.localContext = signal(null, ...(ngDevMode ? [{ debugName: "localContext" }] : /* istanbul ignore next */ []));
1221
- /** When true, the next valueChange from the builder is ignored (avoids undoing discard due to stale emit). */
1222
- this.ignoreNextValueChange = signal(false, ...(ngDevMode ? [{ debugName: "ignoreNextValueChange" }] : /* istanbul ignore next */ []));
1223
- /** Stable pre/post config so we don't pass a new object every CD (avoids infinite loop). */
1224
- this.prePostConfigStable = signal(null, ...(ngDevMode ? [{ debugName: "prePostConfigStable" }] : /* istanbul ignore next */ []));
1225
- /** Baseline snapshot of questions for dirty checks. */
1226
- this.baselineQuestions = signal(null, ...(ngDevMode ? [{ debugName: "baselineQuestions" }] : /* istanbul ignore next */ []));
1227
- /**
1228
- * When true, the next builder emission should realign the baseline to the builder's canonical shape.
1229
- * Root/API `questions` often differs from the normalized object emitted by the builder (defaults, ordering, derived fields), which would otherwise keep `isDirty` true on load and after discard/save.
1230
- */
1231
- this.questionsBaselinePendingReconcile = signal(false, ...(ngDevMode ? [{ debugName: "questionsBaselinePendingReconcile" }] : /* istanbul ignore next */ []));
1232
- this.isDirty = signal(false, ...(ngDevMode ? [{ debugName: "isDirty" }] : /* istanbul ignore next */ []));
1233
- //#endregion
1234
- //#region ---- Computed State ----
1235
- /** Current context: prefer local updates so edits are preserved. */
1236
- this.context = computed(() => {
1237
- const local = this.localContext();
1238
- if (local != null)
1239
- return local;
1240
- return this.rootContext() ?? {};
1241
- }, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
1242
- /** Questions value passed to the builder (from context). */
1243
- this.questionsValue = computed(() => {
1244
- const ctx = this.context();
1245
- const q = ctx['questions'];
1246
- return (q != null && typeof q === 'object' ? q : null);
1247
- }, ...(ngDevMode ? [{ debugName: "questionsValue" }] : /* istanbul ignore next */ []));
1248
- /** Pre/post config for preview; stable reference to avoid infinite change detection. */
1249
- this.prePostConfig = computed(() => this.prePostConfigStable(), ...(ngDevMode ? [{ debugName: "prePostConfig" }] : /* istanbul ignore next */ []));
1250
- /** Display settings from entity (for builder preview). */
1251
- this.entityDisplaySettings = computed(() => toDisplaySettings((this.rootContext() ?? undefined)) ?? null, ...(ngDevMode ? [{ debugName: "entityDisplaySettings" }] : /* istanbul ignore next */ []));
1252
- /** Questionnaire entity id for preview calculation evaluation. */
1253
- this.questionnaireEntityId = computed(() => {
1254
- const id = this.rootContext()?.['id'];
1255
- return typeof id === 'string' && id.length > 0 ? id : undefined;
1256
- }, ...(ngDevMode ? [{ debugName: "questionnaireEntityId" }] : /* istanbul ignore next */ []));
1257
- let previousRootId = undefined;
1258
- effect(() => {
1259
- const ctx = this.rootContext();
1260
- const currentId = ctx != null && typeof ctx === 'object' ? ctx['id'] : undefined;
1261
- if (currentId !== previousRootId) {
1262
- previousRootId = currentId;
1263
- this.localContext.set(null);
1264
- const rootQuestions = ctx?.['questions'];
1265
- this.baselineQuestions.set(this.cloneQuestions(rootQuestions));
1266
- this.isDirty.set(false);
1267
- this.questionsBaselinePendingReconcile.set(true);
1268
- }
1269
- });
1270
- let lastPrePostKey = '';
1271
- effect(() => {
1272
- const ctx = this.rootContext();
1273
- const next = toPrePostConfig(ctx ?? undefined);
1274
- const key = next ? JSON.stringify(next) : '';
1275
- if (key !== lastPrePostKey) {
1276
- lastPrePostKey = key;
1277
- this.prePostConfigStable.set(next);
1278
- }
1279
- });
1280
- }
1281
- //#endregion
1282
- //#region ---- Page Actions ----
1283
- async getPrimaryMenuItems() {
1284
- const addSectionTitle = (await this.translateService.translateAsync('@assessment-management:questionnaires.components.questionnaire-builder.actions.add-section.title')) || 'Add Section';
1285
- const previewTitle = (await this.translateService.translateAsync('@assessment-management:questionnaires.components.questionnaire-builder.actions.preview.title')) || 'Preview';
1286
- const discardTitle = (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';
1287
- const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';
1288
- const addSectionAction = {
1289
- title: addSectionTitle,
1290
- icon: 'fa-light fa-layer-group',
1291
- zone: 'header',
1292
- priority: 'primary',
1293
- color: 'primary',
1294
- command: {
1295
- name: QUESTIONNAIRE_QUESTIONS_ADD_SECTION_COMMAND,
1296
- options: {},
1297
- },
1298
- };
1299
- const previewAction = {
1300
- title: previewTitle,
1301
- icon: 'fa-light fa-eye',
1302
- zone: 'header',
1303
- priority: 'primary',
1304
- color: 'default',
1305
- command: {
1306
- name: QUESTIONNAIRE_QUESTIONS_PREVIEW_COMMAND,
1307
- options: {},
1308
- },
1309
- };
1310
- const discardAction = {
1311
- title: discardTitle,
1312
- icon: 'fa-light fa-rotate-left',
1313
- zone: 'footer',
1314
- priority: 'secondary',
1315
- color: 'default',
1316
- visible: this.isDirty(),
1317
- command: {
1318
- name: QUESTIONNAIRE_QUESTIONS_DISCARD_COMMAND,
1319
- options: {},
1320
- },
1321
- };
1322
- const saveAction = {
1323
- title: saveTitle,
1324
- icon: 'fa-light fa-floppy-disk',
1325
- zone: 'footer',
1326
- priority: 'primary',
1327
- color: 'primary',
1328
- visible: this.isDirty(),
1329
- command: {
1330
- name: QUESTIONNAIRE_QUESTIONS_SAVE_COMMAND,
1331
- options: {},
1332
- },
1333
- };
1334
- return [addSectionAction, previewAction, discardAction, saveAction];
1335
- }
1336
- //#endregion
1337
- //#region ---- Command Handling ----
1338
- execute(command) {
1339
- if (command.name === QUESTIONNAIRE_QUESTIONS_DISCARD_COMMAND) {
1340
- this.ignoreNextValueChange.set(true);
1341
- this.localContext.set(null);
1342
- this.isDirty.set(false);
1343
- this.questionsBaselinePendingReconcile.set(true);
1344
- this.recompute();
1345
- return;
1346
- }
1347
- if (command.name === QUESTIONNAIRE_QUESTIONS_ADD_SECTION_COMMAND) {
1348
- void this.builderRef()?.addSection();
1349
- return;
1350
- }
1351
- if (command.name === QUESTIONNAIRE_QUESTIONS_PREVIEW_COMMAND) {
1352
- this.builderRef()?.handlePreview();
1353
- return;
1354
- }
1355
- if (command.name !== QUESTIONNAIRE_QUESTIONS_SAVE_COMMAND) {
1356
- return;
1357
- }
1358
- // Return result for delegateExecute; cast needed to satisfy base signature
1359
- return this.handleSaveExecute();
1360
- }
1361
- async handleSaveExecute() {
1362
- const ctx = this.localContext() ?? this.rootContext() ?? {};
1363
- const id = typeof ctx['id'] === 'string' ? ctx['id'] : undefined;
1364
- const questions = ctx['questions'];
1365
- if (!id) {
1366
- return {
1367
- success: false,
1368
- message: {
1369
- text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),
1370
- },
1371
- };
1372
- }
1373
- const input = {
1374
- id,
1375
- questions: questions ?? { sections: [] },
1376
- };
1377
- const result = await this.commandService.execute(QUESTIONNAIRE_QUESTIONS_SAVE_COMMAND, input);
1378
- const execResult = (result ?? { success: false });
1379
- if (execResult.success) {
1380
- const savedQuestions = questions ?? { sections: [] };
1381
- this.baselineQuestions.set(this.cloneQuestions(savedQuestions));
1382
- this.localContext.set(null);
1383
- this.isDirty.set(false);
1384
- this.questionsBaselinePendingReconcile.set(true);
1385
- this.recompute();
1386
- this.eventService.publish(AXPEntityEventsKeys.REFRESH_LAYOUT, {
1387
- name: `${RootConfig.module.name}.${RootConfig.entities.questionnaire.name}`,
1388
- });
1389
- // Success toast is shown by details-view when execute() returns success
1390
- }
1391
- return execResult;
1392
- }
1393
- //#endregion
1394
- //#region ---- UI Handlers ----
1395
- /** Updates local context when the builder emits a new questions value. Skip if unchanged to avoid CD loop. */
1396
- onQuestionsChange(value) {
1397
- if (this.ignoreNextValueChange()) {
1398
- this.ignoreNextValueChange.set(false);
1399
- return;
1400
- }
1401
- const current = this.questionsValue();
1402
- if (this.areQuestionsEqual(current ?? undefined, value ?? undefined)) {
1403
- if (this.questionsBaselinePendingReconcile()) {
1404
- const aligned = current ?? value;
1405
- this.baselineQuestions.set(this.cloneQuestions(aligned ?? undefined));
1406
- this.questionsBaselinePendingReconcile.set(false);
1407
- this.isDirty.set(false);
1408
- }
1409
- return;
1410
- }
1411
- const base = this.localContext() ?? this.rootContext() ?? {};
1412
- if (this.questionsBaselinePendingReconcile() && this.localContext() == null) {
1413
- this.baselineQuestions.set(this.cloneQuestions(value));
1414
- this.isDirty.set(false);
1415
- this.questionsBaselinePendingReconcile.set(false);
1416
- this.localContext.set({ ...base, questions: value });
1417
- this.recompute();
1418
- return;
1419
- }
1420
- this.localContext.set({ ...base, questions: value });
1421
- const baseline = this.baselineQuestions();
1422
- const dirty = !this.areQuestionsEqual(baseline, value);
1423
- this.isDirty.set(dirty);
1424
- this.recompute();
1425
- }
1426
- //#endregion
1427
- //#region ---- Utility Methods ----
1428
- areQuestionsEqual(a, b) {
1429
- return isEqual(a, b);
1430
- }
1431
- cloneQuestions(value) {
1432
- if (isNil(value))
1433
- return value;
1434
- return cloneDeep(value);
1435
- }
1436
- recompute() {
1437
- super.recompute();
1438
- const maybeLayout = this.hostPageLayout;
1439
- maybeLayout.recompute?.();
1440
- }
1441
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireQuestionsPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1442
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.9", type: AXMQuestionnaireQuestionsPageComponent, isStandalone: true, selector: "axm-questionnaire-questions-page", inputs: { rootContext: { classPropertyName: "rootContext", publicName: "rootContext", isSignal: true, isRequired: false, transformFunction: null }, pageConfig: { classPropertyName: "pageConfig", publicName: "pageConfig", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
1443
- {
1444
- provide: AXPPageLayoutBase,
1445
- useExisting: AXMQuestionnaireQuestionsPageComponent,
1446
- },
1447
- ], viewQueries: [{ propertyName: "builderRef", first: true, predicate: ["builderRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
1448
- <axm-questionnaire-builder
1449
- #builderRef
1450
- [value]="questionsValue()"
1451
- [prePostConfig]="prePostConfig()"
1452
- [displaySettingsInput]="entityDisplaySettings()"
1453
- [questionnaireEntityId]="questionnaireEntityId()"
1454
- [showHeader]="false"
1455
- (valueChange)="onQuestionsChange($event)">
1456
- </axm-questionnaire-builder>
1457
- `, isInline: true, dependencies: [{ kind: "component", type: AXMQuestionnaireBuilderComponent, selector: "axm-questionnaire-builder", inputs: ["value", "readonly", "prePostConfig", "showHeader", "displaySettingsInput", "questionnaireEntityId"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1458
- }
1459
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireQuestionsPageComponent, decorators: [{
1460
- type: Component,
1461
- args: [{
1462
- selector: 'axm-questionnaire-questions-page',
1463
- standalone: true,
1464
- imports: [AXMQuestionnaireBuilderComponent],
1465
- template: `
1466
- <axm-questionnaire-builder
1467
- #builderRef
1468
- [value]="questionsValue()"
1469
- [prePostConfig]="prePostConfig()"
1470
- [displaySettingsInput]="entityDisplaySettings()"
1471
- [questionnaireEntityId]="questionnaireEntityId()"
1472
- [showHeader]="false"
1473
- (valueChange)="onQuestionsChange($event)">
1474
- </axm-questionnaire-builder>
1475
- `,
1476
- changeDetection: ChangeDetectionStrategy.OnPush,
1477
- providers: [
1478
- {
1479
- provide: AXPPageLayoutBase,
1480
- useExisting: AXMQuestionnaireQuestionsPageComponent,
1481
- },
1482
- ],
1483
- }]
1484
- }], ctorParameters: () => [], propDecorators: { rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }], builderRef: [{ type: i0.ViewChild, args: ['builderRef', { isSignal: true }] }] } });
1485
-
1486
- var questionnaireQuestionsPage_component = /*#__PURE__*/Object.freeze({
1487
- __proto__: null,
1488
- AXMQuestionnaireQuestionsPageComponent: AXMQuestionnaireQuestionsPageComponent
1489
- });
1490
-
1491
- //#region ---- Questionnaire Questions Page Component Provider ----
1492
- class AXMQuestionnaireQuestionsPageComponentProvider {
1493
- async components() {
1494
- return [
1495
- {
1496
- key: QUESTIONNAIRE_QUESTIONS_PAGE_COMPONENT_KEY,
1497
- loader: () => Promise.resolve().then(function () { return questionnaireQuestionsPage_component; }).then((m) => m.AXMQuestionnaireQuestionsPageComponent),
1498
- },
1499
- ];
1500
- }
1501
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireQuestionsPageComponentProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1502
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireQuestionsPageComponentProvider }); }
1503
- }
1504
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireQuestionsPageComponentProvider, decorators: [{
1505
- type: Injectable
1506
- }] });
1507
-
1508
- export { AXMQuestionnaireQuestionsPageComponent, AXMQuestionnaireQuestionsPageComponentProvider, QUESTIONNAIRE_QUESTIONS_PAGE_COMPONENT_KEY, QUESTIONNAIRE_QUESTIONS_SAVE_COMMAND };
1509
- //# sourceMappingURL=acorex-modules-assessment-management-index-D8KjfHAH.mjs.map