@hmcts/ccd-case-ui-toolkit 7.2.27-multiple-followup → 7.2.28

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 (44) hide show
  1. package/esm2022/lib/app.config.mjs +1 -2
  2. package/esm2022/lib/shared/components/palette/palette.module.mjs +7 -2
  3. package/esm2022/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +50 -195
  4. package/esm2022/lib/shared/components/palette/query-management/components/query-details/query-details.component.mjs +8 -55
  5. package/esm2022/lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.mjs +59 -6
  6. package/esm2022/lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.mjs +39 -6
  7. package/esm2022/lib/shared/components/palette/query-management/constants/query-management.constants.mjs +7 -0
  8. package/esm2022/lib/shared/components/palette/query-management/models/case-queries-collection.model.mjs +1 -1
  9. package/esm2022/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.mjs +7 -43
  10. package/esm2022/lib/shared/components/palette/query-management/read-query-management-field.component.mjs +38 -82
  11. package/esm2022/lib/shared/components/palette/query-management/services/index.mjs +2 -1
  12. package/esm2022/lib/shared/components/palette/query-management/services/query-management.service.mjs +179 -0
  13. package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs +4 -12
  14. package/esm2022/lib/shared/services/draft/draft.service.mjs +2 -2
  15. package/esm2022/lib/shared/utils.mjs +1 -1
  16. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +567 -583
  17. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  18. package/lib/app.config.d.ts +0 -2
  19. package/lib/app.config.d.ts.map +1 -1
  20. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  21. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +15 -14
  22. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -1
  23. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts +3 -15
  24. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts.map +1 -1
  25. package/lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.d.ts +24 -3
  26. package/lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.d.ts.map +1 -1
  27. package/lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.d.ts +12 -3
  28. package/lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.d.ts.map +1 -1
  29. package/lib/shared/components/palette/query-management/constants/query-management.constants.d.ts +7 -0
  30. package/lib/shared/components/palette/query-management/constants/query-management.constants.d.ts.map +1 -0
  31. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts +0 -1
  32. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts.map +1 -1
  33. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts +0 -1
  34. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts.map +1 -1
  35. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts +3 -15
  36. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts.map +1 -1
  37. package/lib/shared/components/palette/query-management/services/index.d.ts +1 -0
  38. package/lib/shared/components/palette/query-management/services/index.d.ts.map +1 -1
  39. package/lib/shared/components/palette/query-management/services/query-management.service.d.ts +21 -0
  40. package/lib/shared/components/palette/query-management/services/query-management.service.d.ts.map +1 -0
  41. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +1 -1
  42. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
  43. package/lib/shared/utils.d.ts +1 -1
  44. package/package.json +1 -1
@@ -1326,7 +1326,6 @@ class CaseEditorConfig {
1326
1326
  icp_enabled;
1327
1327
  icp_jurisdictions;
1328
1328
  events_to_hide;
1329
- enable_service_specific_multi_followups;
1330
1329
  }
1331
1330
 
1332
1331
  class HttpError {
@@ -2231,7 +2230,7 @@ class DraftService {
2231
2230
  }));
2232
2231
  }
2233
2232
  updateDraft(ctid, draftId, eventData) {
2234
- const saveDraftEndpoint = this.appConfig.getCreateOrUpdateDraftsUrl(ctid) + draftId;
2233
+ const saveDraftEndpoint = `${this.appConfig.getCreateOrUpdateDraftsUrl(ctid)}/${draftId}`;
2235
2234
  const headers = new HttpHeaders()
2236
2235
  .set('experimental', 'true')
2237
2236
  .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_UPDATE)
@@ -20646,6 +20645,394 @@ class QualifyingQuestionService {
20646
20645
  type: Injectable
20647
20646
  }], null, null); })();
20648
20647
 
20648
+ var QueryCreateContext;
20649
+ (function (QueryCreateContext) {
20650
+ QueryCreateContext["NEW_QUERY_QUALIFYING_QUESTION_OPTIONS"] = "NewQueryQualifyingQuestionOptions";
20651
+ QueryCreateContext["NEW_QUERY_QUALIFYING_QUESTION_DETAIL"] = "NewQueryQualifyingQuestionDetail";
20652
+ QueryCreateContext["NEW_QUERY"] = "NewQuery";
20653
+ QueryCreateContext["RESPOND"] = "Respond";
20654
+ QueryCreateContext["FOLLOWUP"] = "Followup";
20655
+ })(QueryCreateContext || (QueryCreateContext = {}));
20656
+
20657
+ class QueryListItem {
20658
+ id;
20659
+ subject;
20660
+ name;
20661
+ body;
20662
+ attachments = [];
20663
+ isHearingRelated;
20664
+ hearingDate;
20665
+ createdOn;
20666
+ createdBy;
20667
+ parentId;
20668
+ isClosed;
20669
+ children = [];
20670
+ messageIndexInParent = null;
20671
+ get lastSubmittedMessage() {
20672
+ const getLastSubmittedMessage = (item) => {
20673
+ let lastSubmittedMessage = item;
20674
+ if (item.children && item.children.length > 1) {
20675
+ for (const child of item.children) {
20676
+ const childLastSubmittedMessage = getLastSubmittedMessage(child);
20677
+ if (childLastSubmittedMessage.createdOn > lastSubmittedMessage.createdOn) {
20678
+ lastSubmittedMessage = childLastSubmittedMessage;
20679
+ }
20680
+ }
20681
+ }
20682
+ return lastSubmittedMessage;
20683
+ };
20684
+ return getLastSubmittedMessage(this);
20685
+ }
20686
+ get lastSubmittedBy() {
20687
+ const childrenCount = this.children.length;
20688
+ if (childrenCount === 0) {
20689
+ return this.lastSubmittedMessage.name;
20690
+ }
20691
+ return this.children[childrenCount - 1].name;
20692
+ }
20693
+ get lastSubmittedDate() {
20694
+ const childrenCount = this.children.length;
20695
+ if (childrenCount <= 1) {
20696
+ return new Date(this.lastSubmittedMessage.createdOn);
20697
+ }
20698
+ let index;
20699
+ if (childrenCount > 1) {
20700
+ index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20701
+ }
20702
+ return new Date(this.children[index].createdOn);
20703
+ }
20704
+ get lastResponseBy() {
20705
+ return this.children?.length > 0 ? this.lastSubmittedMessage.name : '';
20706
+ }
20707
+ get lastResponseDate() {
20708
+ const childrenCount = this.children.length;
20709
+ if (childrenCount === 0) {
20710
+ return null;
20711
+ }
20712
+ let index;
20713
+ if (childrenCount === 1) {
20714
+ index = 0;
20715
+ }
20716
+ else {
20717
+ index = childrenCount % 2 === 1 ? childrenCount - 1 : childrenCount - 2;
20718
+ }
20719
+ return new Date(this.children[index].createdOn);
20720
+ }
20721
+ get responseStatus() {
20722
+ const isThreadClosed = (item) => {
20723
+ if (item.isClosed === 'Yes') {
20724
+ return true;
20725
+ }
20726
+ return item.children?.some(child => isThreadClosed(child)) || false;
20727
+ };
20728
+ if (isThreadClosed(this)) {
20729
+ return QueryItemResponseStatus.CLOSED;
20730
+ }
20731
+ if (this.messageIndexInParent !== null) {
20732
+ return this.messageIndexInParent % 2 === 0
20733
+ ? QueryItemResponseStatus.RESPONDED
20734
+ : QueryItemResponseStatus.AWAITING;
20735
+ }
20736
+ // Parent logic (children count)
20737
+ if (this.children && this.children.length > 0) {
20738
+ return this.children.length % 2 === 1
20739
+ ? QueryItemResponseStatus.RESPONDED
20740
+ : QueryItemResponseStatus.AWAITING;
20741
+ }
20742
+ // No children — still awaiting
20743
+ return QueryItemResponseStatus.AWAITING;
20744
+ }
20745
+ }
20746
+
20747
+ class QueryListData {
20748
+ partyName;
20749
+ roleOnCase;
20750
+ queries;
20751
+ constructor(caseQueriesCollection) {
20752
+ this.partyName = caseQueriesCollection.partyName;
20753
+ this.roleOnCase = caseQueriesCollection.roleOnCase;
20754
+ // get the parent messages (messages without parentId) and add the children to them
20755
+ const parentMessages = caseQueriesCollection.caseMessages.filter((message) => !message.value.parentId);
20756
+ this.queries = parentMessages.map((message) => this.buildQueryListItem(message, caseQueriesCollection.caseMessages));
20757
+ }
20758
+ buildQueryListItem(message, allMessages) {
20759
+ const childrenMessages = allMessages.filter((childMessage) => childMessage.value.parentId === message.value.id);
20760
+ const children = childrenMessages.map((childMessage, index) => {
20761
+ const childItem = this.buildQueryListItem(childMessage, allMessages);
20762
+ childItem.messageIndexInParent = index; // Assign index for status logic
20763
+ return childItem;
20764
+ });
20765
+ const queryListItem = new QueryListItem();
20766
+ Object.assign(queryListItem, {
20767
+ ...message.value,
20768
+ children
20769
+ });
20770
+ return queryListItem;
20771
+ }
20772
+ }
20773
+
20774
+ class QueryManagementUtils {
20775
+ static caseLevelCaseFieldId = 'CaseQueriesCollection';
20776
+ static FIELD_TYPE_COLLECTION = 'Collection';
20777
+ static FIELD_TYPE_COMPLEX = 'Complex';
20778
+ static DISPLAY_CONTEXT_READONLY = 'READONLY';
20779
+ static extractCaseQueriesFromCaseField(caseField) {
20780
+ const { field_type, value, display_context } = caseField;
20781
+ // Handle Complex type fields
20782
+ if (field_type.type === QueryManagementUtils.FIELD_TYPE_COMPLEX) {
20783
+ if (field_type.id === QueryManagementUtils.caseLevelCaseFieldId && display_context !== QueryManagementUtils.DISPLAY_CONTEXT_READONLY && QueryManagementUtils.isNonEmptyObject(value)) {
20784
+ return value;
20785
+ }
20786
+ return null;
20787
+ }
20788
+ }
20789
+ static documentToCollectionFormDocument(document) {
20790
+ return {
20791
+ id: null,
20792
+ value: {
20793
+ document_filename: document?.originalDocumentName,
20794
+ document_url: document?._links?.self?.href,
20795
+ document_binary_url: document?._links?.binary?.href
20796
+ }
20797
+ };
20798
+ }
20799
+ static getNewQueryData(formGroup, currentUserDetails) {
20800
+ const attachments = formGroup.get('attachments').value;
20801
+ const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
20802
+ const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
20803
+ const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
20804
+ const subject = formGroup.get('subject').value;
20805
+ const body = formGroup.get('body').value;
20806
+ const isHearingRelated = formGroup.get('isHearingRelated').value ? 'Yes' : 'No';
20807
+ const hearingDate = (isHearingRelated === 'Yes')
20808
+ ? this.formattedDate(formGroup.get('hearingDate').value)
20809
+ : null;
20810
+ return {
20811
+ id: v4(),
20812
+ subject,
20813
+ name: currentUserName,
20814
+ body,
20815
+ attachments: formDocument,
20816
+ isHearingRelated,
20817
+ hearingDate,
20818
+ createdOn: new Date(),
20819
+ createdBy: currentUserId
20820
+ };
20821
+ }
20822
+ static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
20823
+ const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
20824
+ const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
20825
+ const body = formGroup.get('body').value;
20826
+ const attachments = formGroup.get('attachments').value;
20827
+ const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
20828
+ const isClosed = formGroup.get('closeQuery').value ? 'Yes' : 'No';
20829
+ return {
20830
+ id: v4(),
20831
+ subject: queryItem.subject,
20832
+ name: currentUserName,
20833
+ body,
20834
+ attachments: formDocument,
20835
+ isHearingRelated: queryItem.isHearingRelated,
20836
+ hearingDate: queryItem.hearingDate,
20837
+ createdOn: new Date(),
20838
+ createdBy: currentUserId,
20839
+ parentId: queryItem.id,
20840
+ isClosed
20841
+ };
20842
+ }
20843
+ static isObject(elem) {
20844
+ return typeof elem === 'object' && elem !== null;
20845
+ }
20846
+ static isNonEmptyObject(elem) {
20847
+ return this.isObject(elem) && Object.keys(elem).length !== 0;
20848
+ }
20849
+ static formattedDate(date) {
20850
+ const formattedDate = moment(date).format('YYYY-MM-DD');
20851
+ return formattedDate;
20852
+ }
20853
+ static ɵfac = function QueryManagementUtils_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryManagementUtils)(); };
20854
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
20855
+ }
20856
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryManagementUtils, [{
20857
+ type: Injectable
20858
+ }], null, null); })();
20859
+
20860
+ const CASE_QUERIES_COLLECTION_ID = 'CaseQueriesCollection';
20861
+ const FIELD_TYPE_COMPLEX = 'Complex';
20862
+ const DISPLAY_CONTEXT_READONLY = 'READONLY';
20863
+ const QM_SELECT_FIRST_COLLECTION = 'selectFirstCollection';
20864
+ const QM_COLLECTION_PROMPT = 'promptQmCollection';
20865
+ const CIVIL_JURISDICTION = 'CIVIL';
20866
+
20867
+ class QueryManagementService {
20868
+ router;
20869
+ sessionStorageService;
20870
+ caseQueriesCollections;
20871
+ fieldId;
20872
+ constructor(router, sessionStorageService) {
20873
+ this.router = router;
20874
+ this.sessionStorageService = sessionStorageService;
20875
+ }
20876
+ generateCaseQueriesCollectionData(formGroup, queryCreateContext, queryItem, messageId // Get the message ID from route params (if present)
20877
+ ) {
20878
+ let currentUserDetails;
20879
+ try {
20880
+ currentUserDetails = JSON.parse(this.sessionStorageService.getItem(USER_DETAILS));
20881
+ }
20882
+ catch (e) {
20883
+ console.error('Could not parse USER_DETAILS from session storage:', e);
20884
+ currentUserDetails = {};
20885
+ }
20886
+ const caseMessage = queryCreateContext === QueryCreateContext.NEW_QUERY
20887
+ ? QueryManagementUtils.getNewQueryData(formGroup, currentUserDetails)
20888
+ : QueryManagementUtils.getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails);
20889
+ const isNewQuery = queryCreateContext === QueryCreateContext.NEW_QUERY; // Check if this is a new query
20890
+ // Check if the field ID has been set dynamically
20891
+ if (!this.fieldId) {
20892
+ console.error('Error: Field ID for CaseQueriesCollection not found. Cannot proceed with data generation.');
20893
+ this.router.navigate(['/', 'service-down']);
20894
+ throw new Error('Field ID for CaseQueriesCollection not found. Aborting query data generation.');
20895
+ }
20896
+ // Initialize new query data structure
20897
+ const newQueryData = {};
20898
+ if (this.caseQueriesCollections?.length) {
20899
+ let matchedCollection;
20900
+ // If it's not a new query, try to find the existing collection with the message ID
20901
+ if (!isNewQuery && messageId) {
20902
+ matchedCollection = this.caseQueriesCollections.find((collection) => collection.caseMessages.some((message) => message.value.id === messageId));
20903
+ }
20904
+ if (matchedCollection) {
20905
+ // Append the new case message to the matched collection's caseMessages
20906
+ matchedCollection.caseMessages.push({
20907
+ id: null,
20908
+ value: caseMessage
20909
+ });
20910
+ // Add the matched collection to newQueryData
20911
+ newQueryData[this.fieldId] = {
20912
+ ...matchedCollection, // Keep existing data intact
20913
+ caseMessages: [...matchedCollection.caseMessages] // Append the updated messages array
20914
+ };
20915
+ }
20916
+ else {
20917
+ // Use partyName from the first collection (assumption: all share the same party)
20918
+ const originalPartyName = this.caseQueriesCollections?.[0]?.partyName ?? currentUserDetails?.name;
20919
+ // If no collection matches, or it's a new query
20920
+ newQueryData[this.fieldId] = {
20921
+ partyName: originalPartyName,
20922
+ roleOnCase: '', // Not returned by CCD
20923
+ caseMessages: [
20924
+ {
20925
+ id: null,
20926
+ value: caseMessage
20927
+ }
20928
+ ]
20929
+ };
20930
+ // If caseQueriesCollections is not empty, append its data
20931
+ newQueryData[this.fieldId].caseMessages.push(...this.caseQueriesCollections.flatMap((collection) => collection.caseMessages));
20932
+ }
20933
+ }
20934
+ else {
20935
+ // If there are no existing collections, create a new one (e.g., for new queries)
20936
+ newQueryData[this.fieldId] = {
20937
+ partyName: currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`, // Not returned by CCD
20938
+ roleOnCase: '', // Not returned by CCD
20939
+ caseMessages: [
20940
+ {
20941
+ id: null,
20942
+ value: caseMessage
20943
+ }
20944
+ ]
20945
+ };
20946
+ }
20947
+ return newQueryData;
20948
+ }
20949
+ setCaseQueriesCollectionData(eventData, queryCreateContext, caseDetails, messageId) {
20950
+ const resolvedFieldId = this.resolveFieldId(eventData, queryCreateContext, caseDetails, messageId);
20951
+ if (!resolvedFieldId) {
20952
+ console.error('Failed to resolve fieldId for CaseQueriesCollection. Cannot proceed.');
20953
+ return;
20954
+ }
20955
+ this.fieldId = resolvedFieldId;
20956
+ this.caseQueriesCollections = eventData.case_fields.reduce((acc, field) => {
20957
+ if (field.id === this.fieldId) {
20958
+ const extracted = QueryManagementUtils.extractCaseQueriesFromCaseField(field);
20959
+ if (extracted && typeof extracted === 'object') {
20960
+ acc.push(extracted);
20961
+ }
20962
+ }
20963
+ return acc;
20964
+ }, []);
20965
+ }
20966
+ resolveFieldId(eventData, queryCreateContext, caseDetails, messageId) {
20967
+ // Step 1: Filter candidate fields (must be editable CaseQueriesCollection fields)
20968
+ const candidateFields = eventData?.case_fields?.filter((field) => field.field_type.id === CASE_QUERIES_COLLECTION_ID &&
20969
+ field.field_type.type === FIELD_TYPE_COMPLEX &&
20970
+ field.display_context !== DISPLAY_CONTEXT_READONLY);
20971
+ if (!candidateFields?.length) {
20972
+ console.warn('No editable CaseQueriesCollection fields found.');
20973
+ return null;
20974
+ }
20975
+ const numberOfCollections = candidateFields.length;
20976
+ const jurisdictionId = caseDetails?.case_type?.jurisdiction?.id ?? '';
20977
+ // Step 2: If messageId is present, try to locate the field containing that message
20978
+ if (messageId) {
20979
+ const fieldByMessage = candidateFields.find((field) => field?.value?.caseMessages?.some((msg) => msg?.value?.id === messageId));
20980
+ if (fieldByMessage) {
20981
+ return fieldByMessage.id; // Found the matching field by message ID
20982
+ }
20983
+ }
20984
+ // Step 3: Handle new queries
20985
+ if (queryCreateContext === QueryCreateContext.NEW_QUERY) {
20986
+ // If there's only one collection, use it
20987
+ if (numberOfCollections === 1) {
20988
+ return candidateFields[0].id;
20989
+ }
20990
+ // For multiple collections, use jurisdiction-based resolution strategy
20991
+ if (this.getCollectionSelectionMethod(jurisdictionId) === QM_SELECT_FIRST_COLLECTION) {
20992
+ // Choose the one with the lowest order from the first wizard page
20993
+ const firstOrdered = this.getCaseQueriesCollectionFieldOrderFromWizardPages(eventData);
20994
+ if (firstOrdered) {
20995
+ return firstOrdered.id;
20996
+ }
20997
+ }
20998
+ else {
20999
+ console.error(`Error: Multiple CaseQueriesCollections are not supported yet for the ${jurisdictionId} jurisdiction`);
21000
+ return null;
21001
+ }
21002
+ }
21003
+ // Step 4: Fallback — if none of the above succeeded
21004
+ console.warn('Could not determine fieldId for context:', queryCreateContext);
21005
+ return null;
21006
+ }
21007
+ getCaseQueriesCollectionFieldOrderFromWizardPages(eventData) {
21008
+ const candidateFields = eventData?.case_fields?.filter((field) => field.field_type.id === CASE_QUERIES_COLLECTION_ID &&
21009
+ field.field_type.type === FIELD_TYPE_COMPLEX &&
21010
+ field.display_context !== DISPLAY_CONTEXT_READONLY);
21011
+ if (!candidateFields?.length) {
21012
+ return undefined;
21013
+ }
21014
+ const firstPageFields = eventData?.wizard_pages?.[0]?.wizard_page_fields;
21015
+ if (!firstPageFields) {
21016
+ return undefined;
21017
+ }
21018
+ return candidateFields
21019
+ .map((field) => {
21020
+ const wizardField = firstPageFields.find((f) => f.case_field_id === field.id);
21021
+ return { field, order: wizardField?.order ?? Number.MAX_SAFE_INTEGER };
21022
+ })
21023
+ .sort((a, b) => a.order - b.order)[0]?.field;
21024
+ }
21025
+ getCollectionSelectionMethod(jurisdiction) {
21026
+ return jurisdiction.toUpperCase() === CIVIL_JURISDICTION ? QM_SELECT_FIRST_COLLECTION : QM_COLLECTION_PROMPT;
21027
+ }
21028
+ static ɵfac = function QueryManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryManagementService)(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService)); };
21029
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: QueryManagementService, factory: QueryManagementService.ɵfac, providedIn: 'root' });
21030
+ }
21031
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryManagementService, [{
21032
+ type: Injectable,
21033
+ args: [{ providedIn: 'root' }]
21034
+ }], () => [{ type: i1$1.Router }, { type: SessionStorageService }], null); })();
21035
+
20649
21036
  function QualifyingQuestionOptionsComponent_ng_container_0_ng_container_10_Template(rf, ctx) { if (rf & 1) {
20650
21037
  i0.ɵɵelementContainerStart(0);
20651
21038
  i0.ɵɵelementStart(1, "p", 8)(2, "span", 9);
@@ -20892,260 +21279,6 @@ class QueryCaseDetailsHeaderComponent {
20892
21279
  }] }); })();
20893
21280
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCaseDetailsHeaderComponent, { className: "QueryCaseDetailsHeaderComponent", filePath: "lib/shared/components/palette/query-management/components/query-case-details-header/query-case-details-header.component.ts", lineNumber: 10 }); })();
20894
21281
 
20895
- var QueryCreateContext;
20896
- (function (QueryCreateContext) {
20897
- QueryCreateContext["NEW_QUERY_QUALIFYING_QUESTION_OPTIONS"] = "NewQueryQualifyingQuestionOptions";
20898
- QueryCreateContext["NEW_QUERY_QUALIFYING_QUESTION_DETAIL"] = "NewQueryQualifyingQuestionDetail";
20899
- QueryCreateContext["NEW_QUERY"] = "NewQuery";
20900
- QueryCreateContext["RESPOND"] = "Respond";
20901
- QueryCreateContext["FOLLOWUP"] = "Followup";
20902
- })(QueryCreateContext || (QueryCreateContext = {}));
20903
-
20904
- class QueryListItem {
20905
- id;
20906
- subject;
20907
- name;
20908
- body;
20909
- attachments = [];
20910
- isHearingRelated;
20911
- hearingDate;
20912
- createdOn;
20913
- createdBy;
20914
- parentId;
20915
- isClosed;
20916
- messageType;
20917
- children = [];
20918
- messageIndexInParent = null;
20919
- get lastSubmittedMessage() {
20920
- const getLastSubmittedMessage = (item) => {
20921
- let lastSubmittedMessage = item;
20922
- if (item.children && item.children.length > 1) {
20923
- for (const child of item.children) {
20924
- const childLastSubmittedMessage = getLastSubmittedMessage(child);
20925
- if (childLastSubmittedMessage.createdOn > lastSubmittedMessage.createdOn) {
20926
- lastSubmittedMessage = childLastSubmittedMessage;
20927
- }
20928
- }
20929
- }
20930
- return lastSubmittedMessage;
20931
- };
20932
- return getLastSubmittedMessage(this);
20933
- }
20934
- get lastSubmittedBy() {
20935
- const childrenCount = this.children.length;
20936
- if (childrenCount === 0) {
20937
- return this.lastSubmittedMessage.name;
20938
- }
20939
- return this.children[childrenCount - 1].name;
20940
- }
20941
- get lastSubmittedDate() {
20942
- const childrenCount = this.children.length;
20943
- const lastChild = this.children[childrenCount - 1];
20944
- // 1. Check for legacy: <= 1 child with no messageType
20945
- const allChildrenLackMessageType = this.children.every((child) => !child.messageType);
20946
- if (childrenCount <= 1 && allChildrenLackMessageType) {
20947
- return new Date(this.lastSubmittedMessage.createdOn);
20948
- }
20949
- // 2. Check if any RESPOND exists
20950
- const hasRespond = this.children.some((child) => child.messageType === QueryCreateContext.RESPOND);
20951
- // 3. Check if all children are FOLLOWUPs and none are RESPONDs
20952
- const onlyFollowUps = this.children.every((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20953
- if (onlyFollowUps && !hasRespond) {
20954
- return new Date(lastChild.createdOn);
20955
- }
20956
- // 4. If RESPOND exists, get latest FOLLOWUP
20957
- // If no RESPOND, but there is at least one FOLLOWUP, return the last FOLLOWUP
20958
- const lastFollowUp = [...this.children]
20959
- .reverse()
20960
- .find((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20961
- if (lastFollowUp) {
20962
- return new Date(lastFollowUp.createdOn);
20963
- }
20964
- // 5. Legacy fallback: no messageType at all
20965
- if (allChildrenLackMessageType) {
20966
- const index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20967
- return new Date(this.children[index]?.createdOn);
20968
- }
20969
- // 6. Final fallback: return last child's date
20970
- return new Date(this.lastSubmittedMessage.createdOn);
20971
- }
20972
- get lastResponseBy() {
20973
- return this.children?.length > 0 ? this.lastSubmittedMessage.name : '';
20974
- }
20975
- get lastResponseDate() {
20976
- const childrenCount = this.children.length;
20977
- if (childrenCount === 0) {
20978
- return null;
20979
- }
20980
- const lastChild = this.children[childrenCount - 1];
20981
- if (lastChild?.messageType === QueryCreateContext.FOLLOWUP &&
20982
- !this.children.some((child) => child.messageType === QueryCreateContext.RESPOND)) {
20983
- return null;
20984
- }
20985
- let index;
20986
- if (childrenCount === 1) {
20987
- index = 0;
20988
- }
20989
- else {
20990
- index = childrenCount % 2 === 1 ? childrenCount - 1 : childrenCount - 2;
20991
- }
20992
- return new Date(this.children[index].createdOn);
20993
- }
20994
- get responseStatus() {
20995
- const isThreadClosed = (item) => {
20996
- if (item.isClosed === 'Yes') {
20997
- return true;
20998
- }
20999
- return item.children?.some((child) => isThreadClosed(child)) || false;
21000
- };
21001
- if (isThreadClosed(this)) {
21002
- return QueryItemResponseStatus.CLOSED;
21003
- }
21004
- const lastMessageType = this.children?.length
21005
- ? this.children[this.children.length - 1]?.messageType
21006
- : undefined;
21007
- if (lastMessageType && lastMessageType === QueryCreateContext.RESPOND) {
21008
- return QueryItemResponseStatus.RESPONDED;
21009
- }
21010
- else if (lastMessageType && lastMessageType === QueryCreateContext.FOLLOWUP) {
21011
- return QueryItemResponseStatus.AWAITING;
21012
- }
21013
- if (this.messageIndexInParent !== null) {
21014
- return this.messageIndexInParent % 2 === 0
21015
- ? QueryItemResponseStatus.RESPONDED
21016
- : QueryItemResponseStatus.AWAITING;
21017
- }
21018
- // Parent logic (children count)
21019
- if (this.children && this.children.length > 0) {
21020
- return this.children.length % 2 === 1
21021
- ? QueryItemResponseStatus.RESPONDED
21022
- : QueryItemResponseStatus.AWAITING;
21023
- }
21024
- // No children — still awaiting
21025
- return QueryItemResponseStatus.AWAITING;
21026
- }
21027
- }
21028
-
21029
- class QueryListData {
21030
- partyName;
21031
- roleOnCase;
21032
- queries;
21033
- constructor(caseQueriesCollection) {
21034
- this.partyName = caseQueriesCollection.partyName;
21035
- this.roleOnCase = caseQueriesCollection.roleOnCase;
21036
- // get the parent messages (messages without parentId) and add the children to them
21037
- const parentMessages = caseQueriesCollection.caseMessages.filter((message) => !message.value.parentId);
21038
- this.queries = parentMessages.map((message) => this.buildQueryListItem(message, caseQueriesCollection.caseMessages));
21039
- }
21040
- buildQueryListItem(message, allMessages) {
21041
- const childrenMessages = allMessages.filter((childMessage) => childMessage.value.parentId === message.value.id);
21042
- const children = childrenMessages.map((childMessage, index) => {
21043
- const childItem = this.buildQueryListItem(childMessage, allMessages);
21044
- childItem.messageIndexInParent = index; // Assign index for status logic
21045
- return childItem;
21046
- });
21047
- const queryListItem = new QueryListItem();
21048
- Object.assign(queryListItem, {
21049
- ...message.value,
21050
- children
21051
- });
21052
- return queryListItem;
21053
- }
21054
- }
21055
-
21056
- class QueryManagementUtils {
21057
- static caseLevelCaseFieldId = 'CaseQueriesCollection';
21058
- static FIELD_TYPE_COLLECTION = 'Collection';
21059
- static FIELD_TYPE_COMPLEX = 'Complex';
21060
- static DISPLAY_CONTEXT_READONLY = 'READONLY';
21061
- static extractCaseQueriesFromCaseField(caseField) {
21062
- const { field_type, value, display_context } = caseField;
21063
- // Handle Complex type fields
21064
- if (field_type.type === QueryManagementUtils.FIELD_TYPE_COMPLEX) {
21065
- if (field_type.id === QueryManagementUtils.caseLevelCaseFieldId && display_context !== QueryManagementUtils.DISPLAY_CONTEXT_READONLY && QueryManagementUtils.isNonEmptyObject(value)) {
21066
- return value;
21067
- }
21068
- return null;
21069
- }
21070
- }
21071
- static documentToCollectionFormDocument(document) {
21072
- return {
21073
- id: null,
21074
- value: {
21075
- document_filename: document?.originalDocumentName,
21076
- document_url: document?._links?.self?.href,
21077
- document_binary_url: document?._links?.binary?.href
21078
- }
21079
- };
21080
- }
21081
- static getNewQueryData(formGroup, currentUserDetails) {
21082
- const attachments = formGroup.get('attachments').value;
21083
- const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
21084
- const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
21085
- const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
21086
- const subject = formGroup.get('subject').value;
21087
- const body = formGroup.get('body').value;
21088
- const isHearingRelated = formGroup.get('isHearingRelated').value ? 'Yes' : 'No';
21089
- const hearingDate = (isHearingRelated === 'Yes')
21090
- ? this.formattedDate(formGroup.get('hearingDate').value)
21091
- : null;
21092
- return {
21093
- id: v4(),
21094
- subject,
21095
- name: currentUserName,
21096
- body,
21097
- attachments: formDocument,
21098
- isHearingRelated,
21099
- hearingDate,
21100
- createdOn: new Date(),
21101
- createdBy: currentUserId,
21102
- messageType: QueryCreateContext.FOLLOWUP // Default to value new queries will be FOLLOWUP
21103
- };
21104
- }
21105
- static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, messageTypeParam) {
21106
- const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
21107
- const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
21108
- const body = formGroup.get('body').value;
21109
- const attachments = formGroup.get('attachments').value;
21110
- const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
21111
- const isClosed = formGroup.get('closeQuery').value ? 'Yes' : 'No';
21112
- const messageType = messageTypeParam === QueryCreateContext.RESPOND
21113
- ? QueryCreateContext.RESPOND
21114
- : messageTypeParam === QueryCreateContext.FOLLOWUP
21115
- ? QueryCreateContext.FOLLOWUP
21116
- : undefined;
21117
- return {
21118
- id: v4(),
21119
- subject: queryItem.subject,
21120
- name: currentUserName,
21121
- body,
21122
- attachments: formDocument,
21123
- isHearingRelated: queryItem.isHearingRelated,
21124
- hearingDate: queryItem.hearingDate,
21125
- createdOn: new Date(),
21126
- createdBy: currentUserId,
21127
- parentId: queryItem.id,
21128
- isClosed,
21129
- messageType
21130
- };
21131
- }
21132
- static isObject(elem) {
21133
- return typeof elem === 'object' && elem !== null;
21134
- }
21135
- static isNonEmptyObject(elem) {
21136
- return this.isObject(elem) && Object.keys(elem).length !== 0;
21137
- }
21138
- static formattedDate(date) {
21139
- const formattedDate = moment(date).format('YYYY-MM-DD');
21140
- return formattedDate;
21141
- }
21142
- static ɵfac = function QueryManagementUtils_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryManagementUtils)(); };
21143
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
21144
- }
21145
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryManagementUtils, [{
21146
- type: Injectable
21147
- }], null, null); })();
21148
-
21149
21282
  function QueryCheckYourAnswersComponent_div_0_div_2_li_6_Template(rf, ctx) { if (rf & 1) {
21150
21283
  i0.ɵɵelementStart(0, "li")(1, "a", 28);
21151
21284
  i0.ɵɵtext(2);
@@ -21471,21 +21604,27 @@ class QueryCheckYourAnswersComponent {
21471
21604
  casesService;
21472
21605
  caseNotifier;
21473
21606
  workAllocationService;
21474
- sessionStorageService;
21475
21607
  qualifyingQuestionService;
21608
+ queryManagementService;
21609
+ errorNotifierService;
21610
+ alertService;
21476
21611
  RAISE_A_QUERY_EVENT_TRIGGER_ID = 'queryManagementRaiseQuery';
21477
21612
  RESPOND_TO_QUERY_EVENT_TRIGGER_ID = 'queryManagementRespondQuery';
21478
21613
  CASE_QUERIES_COLLECTION_ID = 'CaseQueriesCollection';
21614
+ static TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Continue';
21615
+ static TRIGGER_TEXT_START = 'Continue';
21479
21616
  FIELD_TYPE_COMPLEX = 'Complex';
21480
21617
  DISPLAY_CONTEXT_READONLY = 'READONLY';
21481
21618
  QM_SELECT_FIRST_COLLECTION = 'selectFirstCollection';
21482
21619
  QM_COLLECTION_PROMPT = 'promptQmCollection';
21483
21620
  CIVIL_JURISDICTION = 'CIVIL';
21621
+ triggerTextStart = QueryCheckYourAnswersComponent.TRIGGER_TEXT_START;
21622
+ triggerTextIgnoreWarnings = QueryCheckYourAnswersComponent.TRIGGER_TEXT_CONTINUE;
21484
21623
  formGroup;
21485
21624
  queryItem;
21486
21625
  queryCreateContext;
21487
21626
  eventData = null;
21488
- multipleFollowUpFeature;
21627
+ qmCaseQueriesCollectionData;
21489
21628
  backClicked = new EventEmitter();
21490
21629
  querySubmitted = new EventEmitter();
21491
21630
  callbackConfirmationMessage = new EventEmitter();
@@ -21504,20 +21643,24 @@ class QueryCheckYourAnswersComponent {
21504
21643
  filteredTasks = [];
21505
21644
  readyToSubmit;
21506
21645
  isSubmitting = false;
21646
+ messageId;
21507
21647
  callbackErrorsSubject = new Subject();
21508
21648
  error;
21509
- constructor(route, router, casesService, caseNotifier, workAllocationService, sessionStorageService, qualifyingQuestionService) {
21649
+ constructor(route, router, casesService, caseNotifier, workAllocationService, qualifyingQuestionService, queryManagementService, errorNotifierService, alertService) {
21510
21650
  this.route = route;
21511
21651
  this.router = router;
21512
21652
  this.casesService = casesService;
21513
21653
  this.caseNotifier = caseNotifier;
21514
21654
  this.workAllocationService = workAllocationService;
21515
- this.sessionStorageService = sessionStorageService;
21516
21655
  this.qualifyingQuestionService = qualifyingQuestionService;
21656
+ this.queryManagementService = queryManagementService;
21657
+ this.errorNotifierService = errorNotifierService;
21658
+ this.alertService = alertService;
21517
21659
  }
21518
21660
  ngOnInit() {
21519
21661
  this.queryId = this.route.snapshot.params.qid;
21520
21662
  this.tid = this.route.snapshot.queryParams?.tid;
21663
+ this.messageId = this.route.snapshot.params.dataid;
21521
21664
  this.caseNotifier.caseView.pipe(take(1)).subscribe((caseDetails) => {
21522
21665
  this.caseDetails = caseDetails;
21523
21666
  // Find the appropriate event trigger based on the queryCreateContext
@@ -21546,8 +21689,23 @@ class QueryCheckYourAnswersComponent {
21546
21689
  }
21547
21690
  },
21548
21691
  error: (error) => {
21549
- console.error('Error in searchTasksSubscription:', error);
21550
21692
  this.readyToSubmit = false;
21693
+ if (error.status !== 401 && error.status !== 403) {
21694
+ this.errorNotifierService.announceError(error);
21695
+ this.alertService.error({ phrase: error.message });
21696
+ console.error('Error occurred while fetching event data:', error);
21697
+ this.callbackErrorsSubject.next(error);
21698
+ }
21699
+ else {
21700
+ this.errorMessages = [
21701
+ {
21702
+ title: 'Error',
21703
+ description: 'Something unexpected happened. Please try again later.',
21704
+ fieldId: 'field-id'
21705
+ }
21706
+ ];
21707
+ }
21708
+ window.scrollTo({ left: 0, top: 0, behavior: 'smooth' });
21551
21709
  }
21552
21710
  });
21553
21711
  }
@@ -21558,6 +21716,7 @@ class QueryCheckYourAnswersComponent {
21558
21716
  ngOnDestroy() {
21559
21717
  this.createEventSubscription?.unsubscribe();
21560
21718
  this.searchTasksSubscription?.unsubscribe();
21719
+ this.callbackErrorsSubject?.unsubscribe();
21561
21720
  }
21562
21721
  goBack() {
21563
21722
  this.backClicked.emit(true);
@@ -21566,20 +21725,7 @@ class QueryCheckYourAnswersComponent {
21566
21725
  if (this.isSubmitting) {
21567
21726
  return;
21568
21727
  }
21569
- // Check if fieldId is null or undefined
21570
- if (!this.fieldId) {
21571
- console.error('Error: Field ID is missing. Cannot proceed with submission.');
21572
- this.errorMessages = [
21573
- {
21574
- title: 'Error',
21575
- description: 'This case is not configured for query management.',
21576
- fieldId: 'field-id'
21577
- }
21578
- ];
21579
- window.scrollTo({ left: 0, top: 0, behavior: 'smooth' });
21580
- return;
21581
- }
21582
- const data = this.generateCaseQueriesCollectionData();
21728
+ const data = this.qmCaseQueriesCollectionData;
21583
21729
  const createEvent$ = this.createEvent(data);
21584
21730
  this.isSubmitting = true;
21585
21731
  if (this.queryCreateContext === QueryCreateContext.RESPOND) {
@@ -21640,172 +21786,7 @@ class QueryCheckYourAnswersComponent {
21640
21786
  handleError(error) {
21641
21787
  console.error('Error in API calls:', error);
21642
21788
  this.isSubmitting = false;
21643
- if (this.isServiceErrorFound(error)) {
21644
- this.error = null;
21645
- this.callbackErrorsSubject.next(error);
21646
- }
21647
- else {
21648
- if (error && error.status !== 401 && error.status !== 403) {
21649
- this.error = error;
21650
- }
21651
- else {
21652
- this.router.navigate(['/', 'service-down']);
21653
- }
21654
- }
21655
- window.scrollTo({ left: 0, top: 0, behavior: 'smooth' });
21656
- }
21657
- generateCaseQueriesCollectionData() {
21658
- const currentUserDetails = JSON.parse(this.sessionStorageService.getItem(USER_DETAILS));
21659
- const caseMessage = this.queryCreateContext === QueryCreateContext.NEW_QUERY
21660
- ? QueryManagementUtils.getNewQueryData(this.formGroup, currentUserDetails)
21661
- : QueryManagementUtils.getRespondOrFollowupQueryData(this.formGroup, this.queryItem, currentUserDetails, this.queryCreateContext);
21662
- const messageId = this.route.snapshot.params.dataid; // Get the message ID from route params (if present)
21663
- const isNewQuery = this.queryCreateContext === QueryCreateContext.NEW_QUERY; // Check if this is a new query
21664
- // Check if the field ID has been set dynamically
21665
- if (!this.fieldId) {
21666
- console.error('Error: Field ID for CaseQueriesCollection not found. Cannot proceed with data generation.');
21667
- this.router.navigate(['/', 'service-down']);
21668
- }
21669
- // Initialize new query data structure
21670
- const newQueryData = {};
21671
- if (this.caseQueriesCollections?.length) {
21672
- let matchedCollection;
21673
- // If it's not a new query, try to find the existing collection with the message ID
21674
- if (!isNewQuery && messageId) {
21675
- matchedCollection = this.caseQueriesCollections.find((collection) => collection.caseMessages.some((message) => message.value.id === messageId));
21676
- }
21677
- if (matchedCollection) {
21678
- // Append the new case message to the matched collection's caseMessages
21679
- matchedCollection.caseMessages.push({
21680
- id: null,
21681
- value: caseMessage
21682
- });
21683
- // Add the matched collection to newQueryData
21684
- newQueryData[this.fieldId] = {
21685
- ...matchedCollection, // Keep existing data intact
21686
- caseMessages: [...matchedCollection.caseMessages] // Append the updated messages array
21687
- };
21688
- }
21689
- else {
21690
- // Use partyName from the first collection (assumption: all share the same party)
21691
- const originalPartyName = this.caseQueriesCollections[0].partyName;
21692
- // If no collection matches, or it's a new query
21693
- newQueryData[this.fieldId] = {
21694
- partyName: originalPartyName,
21695
- roleOnCase: '', // Not returned by CCD
21696
- caseMessages: [
21697
- {
21698
- id: null,
21699
- value: caseMessage
21700
- }
21701
- ]
21702
- };
21703
- // If caseQueriesCollections is not empty, append its data
21704
- newQueryData[this.fieldId].caseMessages.push(...this.caseQueriesCollections.flatMap((collection) => collection.caseMessages));
21705
- }
21706
- }
21707
- else {
21708
- // If there are no existing collections, create a new one (e.g., for new queries)
21709
- newQueryData[this.fieldId] = {
21710
- partyName: currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`, // Not returned by CCD
21711
- roleOnCase: '', // Not returned by CCD
21712
- caseMessages: [
21713
- {
21714
- id: null,
21715
- value: caseMessage
21716
- }
21717
- ]
21718
- };
21719
- }
21720
- return newQueryData;
21721
- }
21722
- setCaseQueriesCollectionData() {
21723
- if (this.eventData?.case_fields?.length) {
21724
- // Workaround for multiple qmCaseQueriesCollections that are not to be appearing in the eventData
21725
- // Counts number qmCaseQueriesCollections
21726
- const numberOfCaseQueriesCollections = this.eventData?.case_fields?.filter((caseField) => caseField.field_type.id === this.CASE_QUERIES_COLLECTION_ID &&
21727
- caseField.field_type.type === this.FIELD_TYPE_COMPLEX && caseField.display_context !== this.DISPLAY_CONTEXT_READONLY)?.length || 0;
21728
- this.caseQueriesCollections = this.eventData.case_fields.reduce((acc, caseField) => {
21729
- // Extract the ID based on conditions, updating this.fieldId dynamically
21730
- this.extractCaseQueryId(caseField, numberOfCaseQueriesCollections);
21731
- const extractedCaseQueriesFromCaseField = QueryManagementUtils.extractCaseQueriesFromCaseField(caseField);
21732
- if (extractedCaseQueriesFromCaseField && typeof extractedCaseQueriesFromCaseField === 'object') {
21733
- acc.push(extractedCaseQueriesFromCaseField);
21734
- }
21735
- return acc;
21736
- }, []);
21737
- }
21738
- }
21739
- extractCaseQueryId(data, count) {
21740
- const { id, value } = data;
21741
- const messageId = this.route.snapshot.params.dataid;
21742
- // Check if the field_type matches CaseQueriesCollection and type is Complex
21743
- if (data.field_type.id === this.CASE_QUERIES_COLLECTION_ID && data.field_type.type === this.FIELD_TYPE_COMPLEX) {
21744
- if (this.isNewQueryContext(data)) {
21745
- // If there is more than one qmCaseQueriesCollection, pick the one with the lowest order
21746
- if (count > 1) {
21747
- if (!this.handleMultipleCollections()) {
21748
- return;
21749
- }
21750
- }
21751
- else {
21752
- // Set the field ID dynamically based on the extracted data
21753
- this.fieldId = id; // Store the ID for use in generating newQueryData
21754
- }
21755
- }
21756
- // If messageId is present, find the corresponding case message
21757
- this.setMessageFieldId(messageId, value, id);
21758
- }
21759
- }
21760
- setMessageFieldId(messageId, value, id) {
21761
- if (messageId && value?.caseMessages) {
21762
- // If a matching message is found, set the fieldId to the corresponding id
21763
- const matchedMessage = value?.caseMessages?.find((message) => message.value.id === messageId);
21764
- if (matchedMessage) {
21765
- this.fieldId = id;
21766
- }
21767
- }
21768
- }
21769
- isNewQueryContext(data) {
21770
- return this.queryCreateContext === QueryCreateContext.NEW_QUERY && data.display_context !== this.DISPLAY_CONTEXT_READONLY;
21771
- }
21772
- handleMultipleCollections() {
21773
- const jurisdictionId = this.caseDetails?.case_type?.jurisdiction?.id;
21774
- if (!jurisdictionId) {
21775
- console.error('Jurisdiction ID is missing.');
21776
- return false;
21777
- }
21778
- if (this.getCollectionSelectionMethod(jurisdictionId) === this.QM_SELECT_FIRST_COLLECTION) {
21779
- // Pick the collection with the lowest order
21780
- this.fieldId = this.getCaseQueriesCollectionFieldOrderFromWizardPages()?.id;
21781
- }
21782
- else {
21783
- // Display Error, for now, until EXUI-2644 is implemented
21784
- console.error(`Error: Multiple CaseQueriesCollections are not supported yet for the ${jurisdictionId} jurisdiction`);
21785
- return false;
21786
- }
21787
- return true;
21788
- }
21789
- getCaseQueriesCollectionFieldOrderFromWizardPages() {
21790
- const candidateFields = this.eventData?.case_fields?.filter((field) => field.field_type.id === this.CASE_QUERIES_COLLECTION_ID &&
21791
- field.field_type.type === this.FIELD_TYPE_COMPLEX &&
21792
- field.display_context !== this.DISPLAY_CONTEXT_READONLY);
21793
- if (!candidateFields?.length) {
21794
- return undefined;
21795
- }
21796
- const firstPageFields = this.eventData?.wizard_pages?.[0]?.wizard_page_fields;
21797
- if (!firstPageFields) {
21798
- return undefined;
21799
- }
21800
- return candidateFields
21801
- .map((field) => {
21802
- const wizardField = firstPageFields.find((f) => f.case_field_id === field.id);
21803
- return { field, order: wizardField?.order ?? Number.MAX_SAFE_INTEGER };
21804
- })
21805
- .sort((a, b) => a.order - b.order)[0]?.field;
21806
- }
21807
- getCollectionSelectionMethod(jurisdiction) {
21808
- return jurisdiction.toUpperCase() === this.CIVIL_JURISDICTION ? this.QM_SELECT_FIRST_COLLECTION : this.QM_COLLECTION_PROMPT;
21789
+ this.router.navigate(['/', 'service-down']);
21809
21790
  }
21810
21791
  getDocumentAttachments() {
21811
21792
  const attachmentsValue = this.formGroup.get('attachments').value;
@@ -21817,8 +21798,14 @@ class QueryCheckYourAnswersComponent {
21817
21798
  isServiceErrorFound(error) {
21818
21799
  return !!(error?.callbackErrors?.length);
21819
21800
  }
21820
- static ɵfac = function QueryCheckYourAnswersComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryCheckYourAnswersComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(QualifyingQuestionService)); };
21821
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData", multipleFollowUpFeature: "multipleFollowUpFeature" }, outputs: { backClicked: "backClicked", querySubmitted: "querySubmitted", callbackConfirmationMessage: "callbackConfirmationMessage" }, decls: 1, vars: 1, consts: [["defaultCheckYourAnswersTitle", ""], ["isHearingRelatedFalse", ""], ["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-two-thirds-from-desktop"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "callbackErrorsSubject"], [4, "ngIf"], [1, "govuk-heading-l"], [4, "ngIf", "ngIfElse"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], ["class", "govuk-summary-list govuk-!-margin-bottom-0", 4, "ngIf"], [1, "govuk-summary-list", "govuk-!-margin-bottom-0"], [1, "govuk-summary-list__row"], [1, "govuk-summary-list__key"], [1, "govuk-summary-list__value"], [1, "govuk-summary-list__actions"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", "govuk-!-margin-right-3", 3, "click"], ["data-module", "govuk-button", "type", "submit", 1, "govuk-button", 3, "click"], [3, "eventCompletionParams"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0)", 1, "validation-error", 3, "id"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "event_error-summary-heading", 1, "heading-h3", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], ["class", "ccd-error-summary-li", 4, "ngFor", "ngForOf"], [1, "ccd-error-summary-li"], [1, "govuk-caption-l"], ["href", "javascript:void(0)", "class", "govuk-link", 3, "click", 4, "ngIf"], ["class", "govuk-summary-list__row", 4, "ngIf"], [1, "govuk-summary-list__value", "govuk-summary-list__value--documentAttached"], [3, "attachments", 4, "ngIf"], [3, "attachments"]], template: function QueryCheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
21801
+ setCaseQueriesCollectionData() {
21802
+ if (!this.eventData) {
21803
+ console.warn('Event data not available; skipping collection setup.');
21804
+ }
21805
+ this.queryManagementService.setCaseQueriesCollectionData(this.eventData, this.queryCreateContext, this.caseDetails, this.messageId);
21806
+ }
21807
+ static ɵfac = function QueryCheckYourAnswersComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryCheckYourAnswersComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(QualifyingQuestionService), i0.ɵɵdirectiveInject(QueryManagementService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(AlertService)); };
21808
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData", qmCaseQueriesCollectionData: "qmCaseQueriesCollectionData" }, outputs: { backClicked: "backClicked", querySubmitted: "querySubmitted", callbackConfirmationMessage: "callbackConfirmationMessage" }, decls: 1, vars: 1, consts: [["defaultCheckYourAnswersTitle", ""], ["isHearingRelatedFalse", ""], ["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-two-thirds-from-desktop"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "callbackErrorsSubject"], [4, "ngIf"], [1, "govuk-heading-l"], [4, "ngIf", "ngIfElse"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], ["class", "govuk-summary-list govuk-!-margin-bottom-0", 4, "ngIf"], [1, "govuk-summary-list", "govuk-!-margin-bottom-0"], [1, "govuk-summary-list__row"], [1, "govuk-summary-list__key"], [1, "govuk-summary-list__value"], [1, "govuk-summary-list__actions"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", "govuk-!-margin-right-3", 3, "click"], ["data-module", "govuk-button", "type", "submit", 1, "govuk-button", 3, "click"], [3, "eventCompletionParams"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0)", 1, "validation-error", 3, "id"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "event_error-summary-heading", 1, "heading-h3", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], ["class", "ccd-error-summary-li", 4, "ngFor", "ngForOf"], [1, "ccd-error-summary-li"], [1, "govuk-caption-l"], ["href", "javascript:void(0)", "class", "govuk-link", 3, "click", 4, "ngIf"], ["class", "govuk-summary-list__row", 4, "ngIf"], [1, "govuk-summary-list__value", "govuk-summary-list__value--documentAttached"], [3, "attachments", 4, "ngIf"], [3, "attachments"]], template: function QueryCheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
21822
21809
  i0.ɵɵtemplate(0, QueryCheckYourAnswersComponent_div_0_Template, 36, 25, "div", 2);
21823
21810
  } if (rf & 2) {
21824
21811
  i0.ɵɵproperty("ngIf", ctx.readyToSubmit);
@@ -21827,7 +21814,7 @@ class QueryCheckYourAnswersComponent {
21827
21814
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryCheckYourAnswersComponent, [{
21828
21815
  type: Component,
21829
21816
  args: [{ selector: 'ccd-query-check-your-answers', template: "<div class=\"govuk-grid-row\" *ngIf=\"readyToSubmit\">\n <div class=\"govuk-grid-column-two-thirds-from-desktop\">\n <!-- Error message summary -->\n <div *ngIf=\"errorMessages.length > 0\" class=\"govuk-error-summary\"\n aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\"\n data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{ 'There is a problem' | rpxTranslate }}\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <a [id]=\"'error-' + errorMessage.fieldId\" href=\"javascript:void(0)\"\n class=\"validation-error\">{{ errorMessage.description | rpxTranslate }}</a>\n </li>\n </ul>\n </div>\n </div>\n\n <div *ngIf=\"error && (error.details || error.message)\" class=\"error-summary\" role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h3 class=\"heading-h3 error-summary-heading\" id=\"event_error-summary-heading\">\n The event could not be created\n </h3>\n <p>{{error.message}}</p>\n <ul *ngIf=\"error.details?.field_errors\" class=\"error-summary-list\">\n <li *ngFor=\"let fieldError of error.details.field_errors\" class=\"ccd-error-summary-li\">{{fieldError.message}}</li>\n </ul>\n </div>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"callbackErrorsSubject\"></ccd-callback-errors>\n\n <ng-container *ngIf=\"queryCreateContext === queryCreateContextEnum.NEW_QUERY\">\n <div class=\"govuk-caption-l\">{{ 'Raise a query' | rpxTranslate }}</div>\n </ng-container>\n\n <h1 class=\"govuk-heading-l\">\n <ng-container *ngIf=\"queryCreateContext === queryCreateContextEnum.RESPOND; else defaultCheckYourAnswersTitle\">\n {{ 'Review query response details' | rpxTranslate }}\n </ng-container>\n\n <ng-template #defaultCheckYourAnswersTitle>\n {{ 'Review query details' | rpxTranslate }}\n </ng-template>\n </h1>\n <div class=\"govuk-!-margin-bottom-4\">\n <ccd-query-case-details-header [caseDetails]=\"caseDetails\"></ccd-query-case-details-header>\n </div>\n\n <dl *ngIf=\"queryCreateContext !== queryCreateContextEnum.FOLLOWUP\" class=\"govuk-summary-list govuk-!-margin-bottom-0\">\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Submitted query' : 'Query subject' | rpxTranslate }}\n </dt>\n <dd class=\"govuk-summary-list__value\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? queryItem.subject : formGroup.get('subject')?.value }}\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a *ngIf=\"queryCreateContext === queryCreateContextEnum.NEW_QUERY\" \n href=\"javascript:void(0)\" class=\"govuk-link\" (click)=\"goBack()\">\n {{ 'Change' | rpxTranslate }}\n </a>\n </dd>\n </div>\n </dl>\n\n <dl class=\"govuk-summary-list govuk-!-margin-bottom-0\">\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Response detail' : 'Query detail' | rpxTranslate }}\n </dt>\n <dd class=\"govuk-summary-list__value\">\n {{ formGroup.get('body')?.value }}\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a href=\"javascript:void(0)\" class=\"govuk-link\" (click)=\"goBack()\">\n {{ 'Change' | rpxTranslate }}\n </a>\n </dd>\n </div>\n </dl>\n\n <dl *ngIf=\"queryCreateContext === queryCreateContextEnum.NEW_QUERY\" class=\"govuk-summary-list govuk-!-margin-bottom-0\">\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </dt>\n <dd class=\"govuk-summary-list__value\">\n <ng-container *ngIf=\"formGroup.get('isHearingRelated')?.value === true; else isHearingRelatedFalse\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : 'Yes' }}\n </ng-container>\n <ng-template #isHearingRelatedFalse>\n {{ 'Is the query hearing related?' | rpxTranslate: null : 'No' }}\n </ng-template>\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a href=\"javascript:void(0)\" class=\"govuk-link\" (click)=\"goBack()\">\n {{ 'Change' | rpxTranslate }}\n </a>\n </dd>\n </div>\n\n <div *ngIf=\"formGroup.get('isHearingRelated')?.value\" class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n {{ queryCreateContext === queryCreateContextEnum.NEW_QUERY\n ? 'What is the date of the hearing?'\n : 'What is the date of the hearing your query is related to?' | rpxTranslate }}\n </dt>\n <dd class=\"govuk-summary-list__value\">\n {{ formGroup.get('hearingDate')?.value | date: 'dd MMM yyyy' }}\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a href=\"javascript:void(0)\" class=\"govuk-link\" (click)=\"goBack()\">\n {{ 'Change' | rpxTranslate }}\n </a>\n </dd>\n </div>\n </dl>\n <dl class=\"govuk-summary-list govuk-!-margin-bottom-0\" *ngIf=\"this.formGroup.get('attachments').value.length > 0\">\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n {{ queryCreateContext === queryCreateContextEnum.NEW_QUERY ? 'Upload a file to the query' : 'Document attached' | rpxTranslate }}\n </dt>\n <dd class=\"govuk-summary-list__value govuk-summary-list__value--documentAttached\">\n <ccd-query-attachments-read\n *ngIf=\"this.formGroup.get('attachments').value\"\n [attachments]=\"attachments\"\n >\n </ccd-query-attachments-read>\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a href=\"javascript:void(0)\" class=\"govuk-link\" (click)=\"goBack()\">\n {{ 'Change' | rpxTranslate }}\n </a>\n </dd>\n </div>\n </dl>\n\n <dl *ngIf=\"queryCreateContext === queryCreateContextEnum.RESPOND\" class=\"govuk-summary-list govuk-!-margin-bottom-0\">\n <div class=\"govuk-summary-list__row\">\n <dt class=\"govuk-summary-list__key\">\n {{ 'Closing the query' | rpxTranslate }}\n </dt>\n <dd class=\"govuk-summary-list__value\">\n {{ formGroup.get('closeQuery')?.value ? 'I want to close this query' : 'No answer' | rpxTranslate }}\n </dd>\n <dd class=\"govuk-summary-list__actions\">\n <a href=\"javascript:void(0)\" class=\"govuk-link\" (click)=\"goBack()\">\n {{ 'Change' | rpxTranslate }}\n </a>\n </dd>\n </div>\n </dl>\n\n <br>\n\n <div>\n <button class=\"govuk-button govuk-button--secondary govuk-!-margin-right-3\" data-module=\"govuk-button\"\n (click)=\"goBack()\">\n {{ 'Previous' | rpxTranslate }}\n </button>\n <button class=\"govuk-button\" data-module=\"govuk-button\" type=\"submit\" (click)=\"submit()\">\n {{ 'Submit' | rpxTranslate }}\n </button>\n </div>\n </div>\n\n <ccd-query-event-completion [eventCompletionParams]=\"eventCompletionParams\"> \n </ccd-query-event-completion>\n</div>\n", styles: [".govuk-summary-list__value--documentAttached{vertical-align:middle}\n"] }]
21830
- }], () => [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: CasesService }, { type: CaseNotifier }, { type: WorkAllocationService }, { type: SessionStorageService }, { type: QualifyingQuestionService }], { formGroup: [{
21817
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: CasesService }, { type: CaseNotifier }, { type: WorkAllocationService }, { type: QualifyingQuestionService }, { type: QueryManagementService }, { type: ErrorNotifierService }, { type: AlertService }], { formGroup: [{
21831
21818
  type: Input
21832
21819
  }], queryItem: [{
21833
21820
  type: Input
@@ -21835,7 +21822,7 @@ class QueryCheckYourAnswersComponent {
21835
21822
  type: Input
21836
21823
  }], eventData: [{
21837
21824
  type: Input
21838
- }], multipleFollowUpFeature: [{
21825
+ }], qmCaseQueriesCollectionData: [{
21839
21826
  type: Input
21840
21827
  }], backClicked: [{
21841
21828
  type: Output
@@ -21844,7 +21831,7 @@ class QueryCheckYourAnswersComponent {
21844
21831
  }], callbackConfirmationMessage: [{
21845
21832
  type: Output
21846
21833
  }] }); })();
21847
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCheckYourAnswersComponent, { className: "QueryCheckYourAnswersComponent", filePath: "lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.ts", lineNumber: 28 }); })();
21834
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCheckYourAnswersComponent, { className: "QueryCheckYourAnswersComponent", filePath: "lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.ts", lineNumber: 31 }); })();
21848
21835
 
21849
21836
  function QueryDetailsComponent_ng_container_0_p_1_Template(rf, ctx) { if (rf & 1) {
21850
21837
  const _r1 = i0.ɵɵgetCurrentView();
@@ -22056,12 +22043,10 @@ function QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_Tem
22056
22043
  i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_ng_container_1_Template, 23, 19, "ng-container", 15)(2, QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_ng_template_2_Template, 27, 22, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
22057
22044
  i0.ɵɵelementContainerEnd();
22058
22045
  } if (rf & 2) {
22059
- const child_r3 = ctx.$implicit;
22060
22046
  const i_r4 = ctx.index;
22061
22047
  const followUpMessage_r5 = i0.ɵɵreference(3);
22062
- const ctx_r1 = i0.ɵɵnextContext(3);
22063
22048
  i0.ɵɵadvance();
22064
- i0.ɵɵproperty("ngIf", i_r4 % 2 === 0 && !(child_r3 == null ? null : child_r3.messageType) || child_r3 && (child_r3 == null ? null : child_r3.messageType) === ctx_r1.respondToQuery)("ngIfElse", followUpMessage_r5);
22049
+ i0.ɵɵproperty("ngIf", i_r4 % 2 === 0)("ngIfElse", followUpMessage_r5);
22065
22050
  } }
22066
22051
  function QueryDetailsComponent_ng_container_0_ng_container_44_Template(rf, ctx) { if (rf & 1) {
22067
22052
  i0.ɵɵelementContainerStart(0);
@@ -22165,8 +22150,6 @@ class QueryDetailsComponent {
22165
22150
  sessionStorageService;
22166
22151
  route;
22167
22152
  router;
22168
- abstractConfig;
22169
- caseNotifier;
22170
22153
  query;
22171
22154
  caseId;
22172
22155
  queryResponseStatus;
@@ -22176,18 +22159,10 @@ class QueryDetailsComponent {
22176
22159
  static QUERY_ITEM_RESPOND = '3';
22177
22160
  static QUERY_ITEM_FOLLOW_UP = '4';
22178
22161
  queryItemId;
22179
- followUpQuery = QueryCreateContext.FOLLOWUP;
22180
- respondToQuery = QueryCreateContext.RESPOND;
22181
- enableServiceSpecificMultiFollowups;
22182
- currentJurisdictionId;
22183
- isMultipleFollowUpEnabled = false;
22184
- caseSubscription;
22185
- constructor(sessionStorageService, route, router, abstractConfig, caseNotifier) {
22162
+ constructor(sessionStorageService, route, router) {
22186
22163
  this.sessionStorageService = sessionStorageService;
22187
22164
  this.route = route;
22188
22165
  this.router = router;
22189
- this.abstractConfig = abstractConfig;
22190
- this.caseNotifier = caseNotifier;
22191
22166
  }
22192
22167
  onBack() {
22193
22168
  this.backClicked.emit(true);
@@ -22195,23 +22170,10 @@ class QueryDetailsComponent {
22195
22170
  isInternalUser() {
22196
22171
  return isInternalUser(this.sessionStorageService);
22197
22172
  }
22198
- ngOnInit() {
22199
- this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
22200
- this.caseSubscription = this.caseNotifier.caseView.subscribe((caseView) => {
22201
- if (caseView?.case_type?.jurisdiction?.id) {
22202
- this.currentJurisdictionId = caseView.case_type.jurisdiction.id;
22203
- this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
22204
- this.hasRespondedToQuery();
22205
- }
22206
- });
22207
- }
22208
22173
  ngOnChanges() {
22209
22174
  this.toggleLinkVisibility();
22210
22175
  this.hasRespondedToQuery();
22211
22176
  }
22212
- ngOnDestroy() {
22213
- this.caseSubscription?.unsubscribe();
22214
- }
22215
22177
  toggleLinkVisibility() {
22216
22178
  this.queryItemId = this.route.snapshot.params.qid;
22217
22179
  if (this.queryItemId === QueryDetailsComponent.QUERY_ITEM_RESPOND || this.queryItemId === QueryDetailsComponent.QUERY_ITEM_FOLLOW_UP) {
@@ -22224,24 +22186,6 @@ class QueryDetailsComponent {
22224
22186
  this.hasResponded.emit(true);
22225
22187
  return true;
22226
22188
  }
22227
- const lastChild = this.query?.children?.[this.query.children.length - 1];
22228
- const lastMessageType = this.query?.children?.length
22229
- ? this.query.children[this.query.children.length - 1]?.messageType
22230
- : this.query?.messageType;
22231
- const isFollowUp = lastMessageType === this.followUpQuery;
22232
- const isRespond = lastChild?.messageType === this.respondToQuery;
22233
- if (this.queryResponseStatus === QueryItemResponseStatus.CLOSED) {
22234
- this.hasResponded.emit(true);
22235
- return true;
22236
- }
22237
- if (isFollowUp && this.isMultipleFollowUpEnabled) {
22238
- this.hasResponded.emit(false);
22239
- return false;
22240
- }
22241
- if (isRespond) {
22242
- this.hasResponded.emit(false);
22243
- return false;
22244
- }
22245
22189
  if (this.isInternalUser()) {
22246
22190
  if (isAwaiting) {
22247
22191
  this.hasResponded.emit(false);
@@ -22257,7 +22201,7 @@ class QueryDetailsComponent {
22257
22201
  this.hasResponded.emit(false);
22258
22202
  return false;
22259
22203
  }
22260
- static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CaseNotifier)); };
22204
+ static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router)); };
22261
22205
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query", caseId: "caseId", queryResponseStatus: "queryResponseStatus" }, outputs: { backClicked: "backClicked", hasResponded: "hasResponded" }, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["followUpMessage", ""], [4, "ngIf"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__caption", "govuk-table__caption--l"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row govuk-table__row--isHearingRelated", 4, "ngIf"], ["class", "govuk-table__row", 4, "ngIf"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-table__row", "govuk-table__row--isHearingRelated"], [3, "attachments", 4, "ngIf"], [3, "attachments"], [4, "ngFor", "ngForOf"], [4, "ngIf", "ngIfElse"]], template: function QueryDetailsComponent_Template(rf, ctx) { if (rf & 1) {
22262
22206
  i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 45, 41, "ng-container", 1);
22263
22207
  } if (rf & 2) {
@@ -22266,8 +22210,8 @@ class QueryDetailsComponent {
22266
22210
  }
22267
22211
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
22268
22212
  type: Component,
22269
- args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <p *ngIf=\"showItem\">\n <br />\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated) }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated === 'Yes'\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"query.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"(i % 2 === 0 && !child?.messageType) || (child && child?.messageType === respondToQuery); else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n\n <tr *ngIf=\"isInternalUser()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <!-- <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div> -->\n <table class=\"govuk-table query-details-table\"\n [attr.aria-describedby]=\"'Follow-up of the response' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Follow up query' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm'}}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [".query-details-table .govuk-table__header{width:330px}\n"] }]
22270
- }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: CaseNotifier }], { query: [{
22213
+ args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <p *ngIf=\"showItem\">\n <br />\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated) }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated === 'Yes'\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"query.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"i % 2 === 0; else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n\n <tr *ngIf=\"isInternalUser()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <!-- <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div> -->\n <table class=\"govuk-table query-details-table\"\n [attr.aria-describedby]=\"'Follow-up of the response' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Follow up query' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm'}}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [".query-details-table .govuk-table__header{width:330px}\n"] }]
22214
+ }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }], { query: [{
22271
22215
  type: Input
22272
22216
  }], caseId: [{
22273
22217
  type: Input
@@ -22278,7 +22222,7 @@ class QueryDetailsComponent {
22278
22222
  }], hasResponded: [{
22279
22223
  type: Output
22280
22224
  }] }); })();
22281
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryDetailsComponent, { className: "QueryDetailsComponent", filePath: "lib/shared/components/palette/query-management/components/query-details/query-details.component.ts", lineNumber: 17 }); })();
22225
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryDetailsComponent, { className: "QueryDetailsComponent", filePath: "lib/shared/components/palette/query-management/components/query-details/query-details.component.ts", lineNumber: 14 }); })();
22282
22226
 
22283
22227
  class QueryEventCompletionComponent {
22284
22228
  eventCompletionParams;
@@ -22839,12 +22783,36 @@ function QueryWriteRaiseQueryComponent_div_11_Template(rf, ctx) { if (rf & 1) {
22839
22783
  i0.ɵɵproperty("ngIf", ctx_r0.formGroup.get("isHearingRelated").value);
22840
22784
  } }
22841
22785
  class QueryWriteRaiseQueryComponent {
22786
+ queryManagementService;
22787
+ route;
22842
22788
  formGroup;
22843
22789
  submitted;
22844
22790
  caseDetails;
22845
22791
  showForm;
22846
22792
  serviceMessage;
22793
+ queryCreateContext;
22794
+ eventData = null;
22795
+ queryItem;
22796
+ validate;
22797
+ triggerSubmission;
22798
+ queryDataCreated = new EventEmitter();
22847
22799
  raiseQueryErrorMessage = RaiseQueryErrorMessage;
22800
+ eventCompletionParams;
22801
+ messageId;
22802
+ constructor(queryManagementService, route) {
22803
+ this.queryManagementService = queryManagementService;
22804
+ this.route = route;
22805
+ }
22806
+ ngOnChanges() {
22807
+ this.messageId = this.route.snapshot.params.dataid;
22808
+ const isCollectionDataSet = this.setCaseQueriesCollectionData();
22809
+ if (isCollectionDataSet) {
22810
+ if (this.triggerSubmission) {
22811
+ const data = this.generateCaseQueriesCollectionData();
22812
+ this.queryDataCreated.emit(data);
22813
+ }
22814
+ }
22815
+ }
22848
22816
  onSubjectInput() {
22849
22817
  const control = this.formGroup.get('subject');
22850
22818
  const value = control?.value;
@@ -22862,8 +22830,19 @@ class QueryWriteRaiseQueryComponent {
22862
22830
  }
22863
22831
  return '';
22864
22832
  }
22865
- static ɵfac = function QueryWriteRaiseQueryComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryWriteRaiseQueryComponent)(); };
22866
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryWriteRaiseQueryComponent, selectors: [["ccd-query-write-raise-query"]], inputs: { formGroup: "formGroup", submitted: "submitted", caseDetails: "caseDetails", showForm: "showForm", serviceMessage: "serviceMessage" }, decls: 12, vars: 8, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-4"], [3, "caseDetails", 4, "ngIf"], ["class", "govuk-!-margin-bottom-4", 4, "ngIf"], [3, "caseDetails"], [1, "govuk-!-margin-bottom-4"], [3, "formGroup"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-visually-hidden"], [3, "content"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], ["for", "subject", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "subject-hint", 1, "govuk-hint"], ["id", "subject-error", "class", "govuk-error-message", 4, "ngIf"], ["type", "text", "id", "subject", "formControlName", "subject", "maxlength", "200", "aria-describedby", "subject-error", 1, "govuk-input", 3, "input"], ["for", "body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "body-hint", 1, "govuk-hint"], ["id", "body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "body", "name", "body", "rows", "5", "aria-describedby", "body-hint body-error", 1, "govuk-textarea", 3, "formControlName"], [1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "isHearingRelated-error", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--inline"], [1, "govuk-radios__item"], ["id", "isHearingRelated-yes", "name", "isHearingRelated", "type", "radio", "formControlName", "isHearingRelated", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "isHearingRelated-yes", 1, "govuk-label", "govuk-radios__label"], ["id", "isHearingRelated-no", "name", "isHearingRelated", "type", "radio", "formControlName", "isHearingRelated", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "isHearingRelated-no", 1, "govuk-label", "govuk-radios__label"], [4, "ngIf"], ["id", "subject-error", 1, "govuk-error-message"], ["id", "body-error", 1, "govuk-error-message"], ["id", "isHearingRelated-error", 1, "govuk-error-message"], [1, "govuk-radios__conditional", "govuk-!-margin-top-1", 3, "ngClass"], ["role", "group", 1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--s"], ["id", "hearingDate-error", "class", "govuk-error-message", 4, "ngIf"], ["formControlName", "hearingDate"], ["id", "hearingDate-error", 1, "govuk-error-message"]], template: function QueryWriteRaiseQueryComponent_Template(rf, ctx) { if (rf & 1) {
22833
+ setCaseQueriesCollectionData() {
22834
+ if (!this.eventData) {
22835
+ console.warn('Event data not available; skipping collection setup.');
22836
+ return false;
22837
+ }
22838
+ this.queryManagementService.setCaseQueriesCollectionData(this.eventData, this.queryCreateContext, this.caseDetails, this.messageId);
22839
+ return true;
22840
+ }
22841
+ generateCaseQueriesCollectionData() {
22842
+ return this.queryManagementService.generateCaseQueriesCollectionData(this.formGroup, this.queryCreateContext, this.queryItem, this.messageId);
22843
+ }
22844
+ static ɵfac = function QueryWriteRaiseQueryComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryWriteRaiseQueryComponent)(i0.ɵɵdirectiveInject(QueryManagementService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute)); };
22845
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryWriteRaiseQueryComponent, selectors: [["ccd-query-write-raise-query"]], inputs: { formGroup: "formGroup", submitted: "submitted", caseDetails: "caseDetails", showForm: "showForm", serviceMessage: "serviceMessage", queryCreateContext: "queryCreateContext", eventData: "eventData", queryItem: "queryItem", validate: "validate", triggerSubmission: "triggerSubmission" }, outputs: { queryDataCreated: "queryDataCreated" }, features: [i0.ɵɵNgOnChangesFeature], decls: 12, vars: 8, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-4"], [3, "caseDetails", 4, "ngIf"], ["class", "govuk-!-margin-bottom-4", 4, "ngIf"], [3, "caseDetails"], [1, "govuk-!-margin-bottom-4"], [3, "formGroup"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-visually-hidden"], [3, "content"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], ["for", "subject", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "subject-hint", 1, "govuk-hint"], ["id", "subject-error", "class", "govuk-error-message", 4, "ngIf"], ["type", "text", "id", "subject", "formControlName", "subject", "maxlength", "200", "aria-describedby", "subject-error", 1, "govuk-input", 3, "input"], ["for", "body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "body-hint", 1, "govuk-hint"], ["id", "body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "body", "name", "body", "rows", "5", "aria-describedby", "body-hint body-error", 1, "govuk-textarea", 3, "formControlName"], [1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "isHearingRelated-error", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--inline"], [1, "govuk-radios__item"], ["id", "isHearingRelated-yes", "name", "isHearingRelated", "type", "radio", "formControlName", "isHearingRelated", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "isHearingRelated-yes", 1, "govuk-label", "govuk-radios__label"], ["id", "isHearingRelated-no", "name", "isHearingRelated", "type", "radio", "formControlName", "isHearingRelated", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "isHearingRelated-no", 1, "govuk-label", "govuk-radios__label"], [4, "ngIf"], ["id", "subject-error", 1, "govuk-error-message"], ["id", "body-error", 1, "govuk-error-message"], ["id", "isHearingRelated-error", 1, "govuk-error-message"], [1, "govuk-radios__conditional", "govuk-!-margin-top-1", 3, "ngClass"], ["role", "group", 1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--s"], ["id", "hearingDate-error", "class", "govuk-error-message", 4, "ngIf"], ["formControlName", "hearingDate"], ["id", "hearingDate-error", 1, "govuk-error-message"]], template: function QueryWriteRaiseQueryComponent_Template(rf, ctx) { if (rf & 1) {
22867
22846
  i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "div", 1);
22868
22847
  i0.ɵɵtext(3);
22869
22848
  i0.ɵɵpipe(4, "rpxTranslate");
@@ -22892,7 +22871,7 @@ class QueryWriteRaiseQueryComponent {
22892
22871
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryWriteRaiseQueryComponent, [{
22893
22872
  type: Component,
22894
22873
  args: [{ selector: 'ccd-query-write-raise-query', template: "<div>\n <div class=\"govuk-!-margin-bottom-6\">\n <div class=\"govuk-caption-l\">{{ 'Raise a query' | rpxTranslate }}</div>\n <h1 class=\"govuk-heading-l govuk-!-margin-bottom-4\">{{ 'Enter query details' | rpxTranslate }}</h1>\n </div>\n\n <div>\n <ccd-query-case-details-header [caseDetails]=\"caseDetails\" *ngIf=\"caseDetails\"></ccd-query-case-details-header>\n </div>\n\n <hr>\n\n <div class=\"govuk-!-margin-bottom-4\" *ngIf=\"showForm\">\n <div [formGroup]=\"formGroup\">\n <div>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-visually-hidden\">Warning</span>\n <ccd-markdown\n [content]=\"serviceMessage | rpxTranslate\">\n </ccd-markdown>\n </strong>\n </div>\n <div class=\"govuk-form-group\" [ngClass]=\"{'govuk-form-group--error': submitted && formGroup.get('subject').hasError('required')}\">\n <div class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\" for=\"subject\">\n {{ 'Query subject' | rpxTranslate }}\n </label>\n </div>\n <div id=\"subject-hint\" class=\"govuk-hint\">\n {{ 'The subject should be a summary of your query' | rpxTranslate }}\n </div>\n <p id=\"subject-error\" class=\"govuk-error-message\"\n *ngIf=\"submitted && (formGroup.get('subject').hasError('required') || formGroup.get('subject').hasError('maxlength'))\">\n <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }}</span>\n {{ getSubjectErrorMessage() | rpxTranslate }}\n </p>\n\n <input type=\"text\"\n id=\"subject\"\n class=\"govuk-input\"\n formControlName=\"subject\"\n maxlength=\"200\"\n (input)=\"onSubjectInput()\"\n aria-describedby=\"subject-error\" />\n </div>\n\n <div class=\"govuk-form-group\"\n [ngClass]=\"{'govuk-form-group--error': submitted && formGroup.get('body').hasError('required')}\">\n <div class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\" for=\"body\">\n {{ 'Query detail' | rpxTranslate }}\n </label>\n </div>\n <div id=\"body-hint\" class=\"govuk-hint\">\n {{ 'Include as many details as possible so case workers can respond to your query' | rpxTranslate }}\n </div>\n <p id=\"body-error\" class=\"govuk-error-message\"\n *ngIf=\"submitted && formGroup.get('body').hasError('required')\">\n <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ raiseQueryErrorMessage.QUERY_BODY | rpxTranslate }}\n </p>\n <textarea [formControlName]=\"'body'\"\n id=\"body\" name=\"body\" rows=\"5\"\n aria-describedby=\"body-hint body-error\"\n class=\"govuk-textarea\"\n [class.govuk-textarea--error]=\"submitted && formGroup.get('body').hasError('required')\"\n >\n </textarea>\n </div>\n\n <div class=\"govuk-form-group\"\n [ngClass]=\"{'govuk-form-group--error': submitted && formGroup.get('isHearingRelated').hasError('required')}\">\n <fieldset class=\"govuk-fieldset\">\n <legend>\n <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </label>\n </legend>\n <p id=\"isHearingRelated-error\" class=\"govuk-error-message\"\n *ngIf=\"submitted && formGroup.get('isHearingRelated').hasError('required')\">\n <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ raiseQueryErrorMessage.QUERY_HEARING_RELATED | rpxTranslate }}\n </p>\n <div class=\"govuk-radios govuk-radios--inline\" data-module=\"govuk-radios\">\n <div class=\"govuk-radios__item\">\n <input class=\"govuk-radios__input\" id=\"isHearingRelated-yes\" name=\"isHearingRelated\"\n type=\"radio\"\n formControlName=\"isHearingRelated\"\n [checked]=\"formGroup.get('isHearingRelated').value === true\" [value]=\"true\"\n >\n <label class=\"govuk-label govuk-radios__label\" for=\"isHearingRelated-yes\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : 'Yes' }}\n </label>\n </div>\n <div class=\"govuk-radios__item\">\n <input class=\"govuk-radios__input\" id=\"isHearingRelated-no\" name=\"isHearingRelated\"\n type=\"radio\"\n formControlName=\"isHearingRelated\"\n [checked]=\"formGroup.get('isHearingRelated').value === false\" [value]=\"false\"\n >\n <label class=\"govuk-label govuk-radios__label\" for=\"isHearingRelated-no\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : 'No' }}\n </label>\n </div>\n </div>\n </fieldset>\n\n <ng-container *ngIf=\"formGroup.get('isHearingRelated').value\">\n <div class=\"govuk-radios__conditional govuk-!-margin-top-1\"\n [ngClass]=\"{'govuk-form-group--error': submitted &&\n formGroup.get('isHearingRelated').value === true &&\n formGroup.get('hearingDate').value === null}\">\n <fieldset class=\"govuk-fieldset\" role=\"group\">\n <legend>\n <label class=\"govuk-label govuk-label--s\">\n {{ 'What is the date of the hearing?' | rpxTranslate }}\n </label>\n </legend>\n <p id=\"hearingDate-error\" class=\"govuk-error-message\"\n *ngIf=\"submitted && formGroup.get('isHearingRelated').value === true && formGroup.get('hearingDate').value === null\">\n <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ raiseQueryErrorMessage.QUERY_HEARING_DATE | rpxTranslate }}\n </p>\n <ccd-query-write-date-input formControlName=\"hearingDate\"></ccd-query-write-date-input>\n </fieldset>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n" }]
22895
- }], null, { formGroup: [{
22874
+ }], () => [{ type: QueryManagementService }, { type: i1$1.ActivatedRoute }], { formGroup: [{
22896
22875
  type: Input
22897
22876
  }], submitted: [{
22898
22877
  type: Input
@@ -22902,8 +22881,20 @@ class QueryWriteRaiseQueryComponent {
22902
22881
  type: Input
22903
22882
  }], serviceMessage: [{
22904
22883
  type: Input
22884
+ }], queryCreateContext: [{
22885
+ type: Input
22886
+ }], eventData: [{
22887
+ type: Input
22888
+ }], queryItem: [{
22889
+ type: Input
22890
+ }], validate: [{
22891
+ type: Input
22892
+ }], triggerSubmission: [{
22893
+ type: Input
22894
+ }], queryDataCreated: [{
22895
+ type: Output
22905
22896
  }] }); })();
22906
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryWriteRaiseQueryComponent, { className: "QueryWriteRaiseQueryComponent", filePath: "lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.ts", lineNumber: 8 }); })();
22897
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryWriteRaiseQueryComponent, { className: "QueryWriteRaiseQueryComponent", filePath: "lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.ts", lineNumber: 19 }); })();
22907
22898
 
22908
22899
  function QueryWriteRespondToQueryComponent_ccd_query_case_details_header_9_Template(rf, ctx) { if (rf & 1) {
22909
22900
  i0.ɵɵelement(0, "ccd-query-case-details-header", 8);
@@ -22985,12 +22976,16 @@ function QueryWriteRespondToQueryComponent_ng_container_13_Template(rf, ctx) { i
22985
22976
  class QueryWriteRespondToQueryComponent {
22986
22977
  caseNotifier;
22987
22978
  route;
22979
+ queryManagementService;
22988
22980
  queryItem;
22989
22981
  formGroup;
22990
22982
  queryCreateContext;
22991
22983
  submitted = false;
22992
22984
  caseQueriesCollections;
22993
22985
  showForm;
22986
+ triggerSubmission;
22987
+ eventData = null;
22988
+ queryDataCreated = new EventEmitter();
22994
22989
  hasRespondedToQueryTask = new EventEmitter();
22995
22990
  queryCreateContextEnum = QueryCreateContext;
22996
22991
  raiseQueryErrorMessages = RaiseQueryErrorMessage;
@@ -23000,11 +22995,13 @@ class QueryWriteRespondToQueryComponent {
23000
22995
  queryResponseStatus;
23001
22996
  queryListData;
23002
22997
  hasRespondedToQuery = false;
22998
+ messageId;
23003
22999
  static QUERY_ITEM_RESPOND = '3';
23004
23000
  static QUERY_ITEM_FOLLOWUP = '4';
23005
- constructor(caseNotifier, route) {
23001
+ constructor(caseNotifier, route, queryManagementService) {
23006
23002
  this.caseNotifier = caseNotifier;
23007
23003
  this.route = route;
23004
+ this.queryManagementService = queryManagementService;
23008
23005
  }
23009
23006
  ngOnInit() {
23010
23007
  this.queryItemId = this.route.snapshot.params.qid;
@@ -23046,13 +23043,31 @@ class QueryWriteRespondToQueryComponent {
23046
23043
  : matchingMessage?.id;
23047
23044
  this.queryListData = queryWithChildren?.queries.find((query) => query?.id === targetId);
23048
23045
  this.queryResponseStatus = this.queryListData?.responseStatus;
23046
+ const isCollectionDataSet = this.setCaseQueriesCollectionData();
23047
+ if (isCollectionDataSet) {
23048
+ if (this.triggerSubmission) {
23049
+ const data = this.generateCaseQueriesCollectionData();
23050
+ this.queryDataCreated.emit(data);
23051
+ }
23052
+ }
23049
23053
  }
23050
23054
  hasResponded(value) {
23051
23055
  this.hasRespondedToQuery = value;
23052
23056
  this.hasRespondedToQueryTask.emit(value);
23053
23057
  }
23054
- static ɵfac = function QueryWriteRespondToQueryComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryWriteRespondToQueryComponent)(i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute)); };
23055
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryWriteRespondToQueryComponent, selectors: [["ccd-query-write-respond-to-query"]], inputs: { queryItem: "queryItem", formGroup: "formGroup", queryCreateContext: "queryCreateContext", submitted: "submitted", caseQueriesCollections: "caseQueriesCollections", showForm: "showForm" }, outputs: { hasRespondedToQueryTask: "hasRespondedToQueryTask" }, features: [i0.ɵɵNgOnChangesFeature], decls: 14, vars: 11, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-0"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails", 4, "ngIf"], [3, "hasResponded", "query", "queryResponseStatus"], ["class", "query-respond", 4, "ngIf"], [4, "ngIf"], [3, "caseDetails"], [1, "query-respond"], [1, "govuk-heading-m"], [3, "formGroup"], [1, "govuk-form-group", "body-textarea"], [1, "govuk-label-wrapper"], ["for", "body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "body", "name", "body", "rows", "5", "aria-describedby", "body-hint body-error", 1, "govuk-textarea", 3, "formControlName"], ["id", "body-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [3, "formGroup", 4, "ngIf"]], template: function QueryWriteRespondToQueryComponent_Template(rf, ctx) { if (rf & 1) {
23058
+ setCaseQueriesCollectionData() {
23059
+ if (!this.eventData) {
23060
+ console.warn('Event data not available; skipping collection setup.');
23061
+ return false;
23062
+ }
23063
+ this.queryManagementService.setCaseQueriesCollectionData(this.eventData, this.queryCreateContext, this.caseDetails, this.messageId);
23064
+ return true;
23065
+ }
23066
+ generateCaseQueriesCollectionData() {
23067
+ return this.queryManagementService.generateCaseQueriesCollectionData(this.formGroup, this.queryCreateContext, this.queryItem, this.messageId);
23068
+ }
23069
+ static ɵfac = function QueryWriteRespondToQueryComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryWriteRespondToQueryComponent)(i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(QueryManagementService)); };
23070
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryWriteRespondToQueryComponent, selectors: [["ccd-query-write-respond-to-query"]], inputs: { queryItem: "queryItem", formGroup: "formGroup", queryCreateContext: "queryCreateContext", submitted: "submitted", caseQueriesCollections: "caseQueriesCollections", showForm: "showForm", triggerSubmission: "triggerSubmission", eventData: "eventData" }, outputs: { queryDataCreated: "queryDataCreated", hasRespondedToQueryTask: "hasRespondedToQueryTask" }, features: [i0.ɵɵNgOnChangesFeature], decls: 14, vars: 11, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-0"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails", 4, "ngIf"], [3, "hasResponded", "query", "queryResponseStatus"], ["class", "query-respond", 4, "ngIf"], [4, "ngIf"], [3, "caseDetails"], [1, "query-respond"], [1, "govuk-heading-m"], [3, "formGroup"], [1, "govuk-form-group", "body-textarea"], [1, "govuk-label-wrapper"], ["for", "body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "body", "name", "body", "rows", "5", "aria-describedby", "body-hint body-error", 1, "govuk-textarea", 3, "formControlName"], ["id", "body-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [3, "formGroup", 4, "ngIf"]], template: function QueryWriteRespondToQueryComponent_Template(rf, ctx) { if (rf & 1) {
23056
23071
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 0)(2, "div", 1);
23057
23072
  i0.ɵɵtext(3);
23058
23073
  i0.ɵɵpipe(4, "rpxTranslate");
@@ -23086,7 +23101,7 @@ class QueryWriteRespondToQueryComponent {
23086
23101
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryWriteRespondToQueryComponent, [{
23087
23102
  type: Component,
23088
23103
  args: [{ selector: 'ccd-query-write-respond-to-query', template: "<div class=\"govuk-!-margin-bottom-6\">\n <div class=\"govuk-!-margin-bottom-6\">\n <div class=\"govuk-caption-l\">{{ 'Respond to a query' | rpxTranslate }}</div>\n <h1 class=\"govuk-heading-l govuk-!-margin-bottom-0\">{{ 'Query details' | rpxTranslate }}</h1>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <ccd-query-case-details-header [caseDetails]=\"caseDetails\" *ngIf=\"caseDetails\"></ccd-query-case-details-header>\n </div>\n\n <div>\n <ccd-query-details [query]=\"queryListData\"\n [queryResponseStatus]=\"queryResponseStatus\"\n (hasResponded)=\"hasResponded($event)\"></ccd-query-details>\n </div>\n</div>\n<div class=\"query-respond\" *ngIf=\"showForm\">\n <div *ngIf=\"!hasRespondedToQuery\">\n <h1 class=\"govuk-heading-m\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Respond to a query' : 'Ask a follow-up question' | rpxTranslate }}\n </h1>\n\n <div [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group body-textarea\"\n [class.govuk-form-group--error]=\"submitted && formGroup.get('body')?.hasError('required')\">\n <div class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\" for=\"body\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Response detail' : 'Query Body' | rpxTranslate }}\n </label>\n </div>\n <p id=\"body-error\" class=\"govuk-error-message\"\n *ngIf=\"submitted && formGroup.get('body')?.hasError('required')\">\n <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ queryCreateContext === queryCreateContextEnum.RESPOND ? raiseQueryErrorMessages.RESPOND_QUERY_BODY : raiseQueryErrorMessages.QUERY_BODY | rpxTranslate }}\n </p>\n <textarea [formControlName]=\"'body'\" class=\"govuk-textarea\"\n [class.govuk-textarea--error]=\"submitted && formGroup.get('body')?.hasError('required')\" id=\"body\"\n name=\"body\" rows=\"5\" aria-describedby=\"body-hint body-error\">\n </textarea>\n </div>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"queryCreateContext === queryCreateContextEnum.RESPOND\">\n <ccd-close-query *ngIf=\"!hasRespondedToQuery\"\n [formGroup]=\"formGroup\">\n </ccd-close-query>\n</ng-container>", styles: [".query-respond{width:100%;max-width:720px}\n"] }]
23089
- }], () => [{ type: CaseNotifier }, { type: i1$1.ActivatedRoute }], { queryItem: [{
23104
+ }], () => [{ type: CaseNotifier }, { type: i1$1.ActivatedRoute }, { type: QueryManagementService }], { queryItem: [{
23090
23105
  type: Input
23091
23106
  }], formGroup: [{
23092
23107
  type: Input
@@ -23098,10 +23113,16 @@ class QueryWriteRespondToQueryComponent {
23098
23113
  type: Input
23099
23114
  }], showForm: [{
23100
23115
  type: Input
23116
+ }], triggerSubmission: [{
23117
+ type: Input
23118
+ }], eventData: [{
23119
+ type: Input
23120
+ }], queryDataCreated: [{
23121
+ type: Output
23101
23122
  }], hasRespondedToQueryTask: [{
23102
23123
  type: Output
23103
23124
  }] }); })();
23104
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryWriteRespondToQueryComponent, { className: "QueryWriteRespondToQueryComponent", filePath: "lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.ts", lineNumber: 14 }); })();
23125
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryWriteRespondToQueryComponent, { className: "QueryWriteRespondToQueryComponent", filePath: "lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.ts", lineNumber: 18 }); })();
23105
23126
 
23106
23127
  function QueryConfirmationComponent_main_0_ng_container_3_Template(rf, ctx) { if (rf & 1) {
23107
23128
  i0.ɵɵelementContainerStart(0);
@@ -23277,7 +23298,7 @@ class CloseQueryComponent {
23277
23298
  const _c0$B = (a0, a1) => ["/query-management", "query", a0, "4", a1];
23278
23299
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
23279
23300
  const _r1 = i0.ɵɵgetCurrentView();
23280
- i0.ɵɵelementStart(0, "div", 6)(1, "ccd-query-list", 7);
23301
+ i0.ɵɵelementStart(0, "div", 5)(1, "ccd-query-list", 6);
23281
23302
  i0.ɵɵlistener("selectedQuery", function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template_ccd_query_list_selectedQuery_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.setQuery($event)); });
23282
23303
  i0.ɵɵelementEnd()();
23283
23304
  } if (rf & 2) {
@@ -23287,7 +23308,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_T
23287
23308
  } }
23288
23309
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23289
23310
  i0.ɵɵelementContainerStart(0);
23290
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 5);
23311
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 4);
23291
23312
  i0.ɵɵelementContainerEnd();
23292
23313
  } if (rf & 2) {
23293
23314
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -23296,7 +23317,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Templat
23296
23317
  } }
23297
23318
  function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23298
23319
  i0.ɵɵelementContainerStart(0);
23299
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 4);
23320
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 3);
23300
23321
  i0.ɵɵelementContainerEnd();
23301
23322
  } if (rf & 2) {
23302
23323
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23305,7 +23326,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if
23305
23326
  } }
23306
23327
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23307
23328
  i0.ɵɵelementContainerStart(0);
23308
- i0.ɵɵelementStart(1, "button", 10);
23329
+ i0.ɵɵelementStart(1, "button", 9);
23309
23330
  i0.ɵɵtext(2);
23310
23331
  i0.ɵɵpipe(3, "rpxTranslate");
23311
23332
  i0.ɵɵelementEnd();
@@ -23317,61 +23338,49 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_conta
23317
23338
  i0.ɵɵadvance();
23318
23339
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23319
23340
  } }
23320
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23321
- i0.ɵɵelementContainerStart(0);
23322
- i0.ɵɵelementStart(1, "button", 10);
23323
- i0.ɵɵtext(2);
23324
- i0.ɵɵpipe(3, "rpxTranslate");
23325
- i0.ɵɵelementEnd();
23326
- i0.ɵɵelementContainerEnd();
23327
- } if (rf & 2) {
23328
- const ctx_r1 = i0.ɵɵnextContext(4);
23329
- i0.ɵɵadvance();
23330
- i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(4, _c0$B, ctx_r1.caseId, ctx_r1.query.id));
23331
- i0.ɵɵadvance();
23332
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23333
- } }
23334
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23335
- i0.ɵɵelementStart(0, "div")(1, "p", 11);
23341
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23342
+ i0.ɵɵelementStart(0, "div")(1, "button", 9);
23336
23343
  i0.ɵɵtext(2);
23337
23344
  i0.ɵɵpipe(3, "rpxTranslate");
23338
23345
  i0.ɵɵelementEnd();
23339
- i0.ɵɵelementStart(4, "p");
23346
+ i0.ɵɵelementStart(4, "p", 10);
23340
23347
  i0.ɵɵtext(5);
23341
23348
  i0.ɵɵpipe(6, "rpxTranslate");
23349
+ i0.ɵɵelementEnd();
23350
+ i0.ɵɵelementStart(7, "p");
23351
+ i0.ɵɵtext(8);
23352
+ i0.ɵɵpipe(9, "rpxTranslate");
23342
23353
  i0.ɵɵelementEnd()();
23343
23354
  } if (rf & 2) {
23344
- i0.ɵɵadvance(2);
23345
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Your query is under review"));
23346
- i0.ɵɵadvance(3);
23347
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Our team will read your query and respond. Do not submit the same query more than once."));
23348
- } }
23349
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23350
- i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template, 4, 7, "ng-container", 3)(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template, 7, 6, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
23351
- } if (rf & 2) {
23352
- const queryIsInReview_r5 = i0.ɵɵreference(2);
23353
23355
  const ctx_r1 = i0.ɵɵnextContext(3);
23354
- i0.ɵɵproperty("ngIf", (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) > 0 && (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) % 2 === 1)("ngIfElse", queryIsInReview_r5);
23356
+ i0.ɵɵadvance();
23357
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(10, _c0$B, ctx_r1.caseId, ctx_r1.query.id));
23358
+ i0.ɵɵadvance();
23359
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 4, "Ask a follow-up question"), " ");
23360
+ i0.ɵɵadvance(3);
23361
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 6, "Your query is under review"));
23362
+ i0.ɵɵadvance(3);
23363
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 8, "Our team will read your query and respond. Do not submit the same query more than once."));
23355
23364
  } }
23356
23365
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23357
23366
  i0.ɵɵelementContainerStart(0);
23358
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template, 4, 7, "ng-container", 3)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template, 3, 2, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
23367
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template, 4, 7, "ng-container", 2)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template, 10, 13, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
23359
23368
  i0.ɵɵelementContainerEnd();
23360
23369
  } if (rf & 2) {
23361
- const sequentialQuery_r6 = i0.ɵɵreference(3);
23370
+ const queryIsInReview_r5 = i0.ɵɵreference(3);
23362
23371
  const ctx_r1 = i0.ɵɵnextContext(2);
23363
23372
  i0.ɵɵadvance();
23364
- i0.ɵɵproperty("ngIf", ctx_r1.messageType && ctx_r1.messageType === ctx_r1.followUpQuery && ctx_r1.isMultipleFollowUpEnabled || ctx_r1.messageType && ctx_r1.messageType === ctx_r1.respondToQuery)("ngIfElse", sequentialQuery_r6);
23373
+ i0.ɵɵproperty("ngIf", (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) > 0 && (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) % 2 === 1)("ngIfElse", queryIsInReview_r5);
23365
23374
  } }
23366
23375
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
23367
23376
  i0.ɵɵelementContainerStart(0);
23368
- i0.ɵɵelementStart(1, "div", 12)(2, "span", 13);
23377
+ i0.ɵɵelementStart(1, "div", 11)(2, "span", 12);
23369
23378
  i0.ɵɵtext(3, "!");
23370
23379
  i0.ɵɵelementEnd();
23371
- i0.ɵɵelementStart(4, "strong", 14)(5, "span", 15);
23380
+ i0.ɵɵelementStart(4, "strong", 13)(5, "span", 14);
23372
23381
  i0.ɵɵtext(6, "Warning");
23373
23382
  i0.ɵɵelementEnd();
23374
- i0.ɵɵelementStart(7, "p", 16);
23383
+ i0.ɵɵelementStart(7, "p", 15);
23375
23384
  i0.ɵɵtext(8);
23376
23385
  i0.ɵɵpipe(9, "rpxTranslate");
23377
23386
  i0.ɵɵelementEnd()()();
@@ -23382,15 +23391,15 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template
23382
23391
  } }
23383
23392
  function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23384
23393
  const _r4 = i0.ɵɵgetCurrentView();
23385
- i0.ɵɵelementStart(0, "ccd-query-details", 8);
23394
+ i0.ɵɵelementStart(0, "ccd-query-details", 7);
23386
23395
  i0.ɵɵlistener("backClicked", function ReadQueryManagementFieldComponent_ng_template_1_Template_ccd_query_details_backClicked_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.showQueryList = true); });
23387
23396
  i0.ɵɵelementEnd();
23388
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 9)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template, 10, 3, "ng-container", 9);
23397
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 8)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template, 10, 3, "ng-container", 8);
23389
23398
  } if (rf & 2) {
23390
23399
  const ctx_r1 = i0.ɵɵnextContext();
23391
23400
  i0.ɵɵproperty("query", ctx_r1.query)("caseId", ctx_r1.caseId);
23392
23401
  i0.ɵɵadvance();
23393
- i0.ɵɵproperty("ngIf", !ctx_r1.isInternalUser() && !ctx_r1.isQueryClosed);
23402
+ i0.ɵɵproperty("ngIf", !ctx_r1.isInternalUser() && !ctx_r1.isQueryClosed && (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) > 0);
23394
23403
  i0.ɵɵadvance();
23395
23404
  i0.ɵɵproperty("ngIf", !ctx_r1.isInternalUser() && ctx_r1.isQueryClosed);
23396
23405
  } }
@@ -23398,36 +23407,19 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23398
23407
  route;
23399
23408
  sessionStorageService;
23400
23409
  caseNotifier;
23401
- abstractConfig;
23402
23410
  caseQueriesCollections;
23403
23411
  query;
23404
23412
  showQueryList = true;
23405
23413
  caseId;
23406
- messageType;
23407
- followUpQuery = QueryCreateContext.FOLLOWUP;
23408
- respondToQuery = QueryCreateContext.RESPOND;
23409
23414
  isQueryClosed = false;
23410
- value;
23411
- isMultipleFollowUpEnabled = false;
23412
- currentJurisdictionId;
23413
- enableServiceSpecificMultiFollowups = [];
23414
- caseSubscription;
23415
- constructor(route, sessionStorageService, caseNotifier, abstractConfig) {
23415
+ constructor(route, sessionStorageService, caseNotifier) {
23416
23416
  super();
23417
23417
  this.route = route;
23418
23418
  this.sessionStorageService = sessionStorageService;
23419
23419
  this.caseNotifier = caseNotifier;
23420
- this.abstractConfig = abstractConfig;
23421
23420
  }
23422
23421
  ngOnInit() {
23423
23422
  this.caseId = this.route.snapshot.params.cid;
23424
- this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
23425
- this.caseSubscription = this.caseNotifier.caseView.subscribe((caseDetails) => {
23426
- if (caseDetails?.case_type?.jurisdiction?.id) {
23427
- this.currentJurisdictionId = caseDetails.case_type.jurisdiction.id;
23428
- this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
23429
- }
23430
- });
23431
23423
  if (this.context === PaletteContext.DEFAULT) {
23432
23424
  // EUI-8303 Using mock data until CCD is ready with the API and data contract
23433
23425
  // this.caseQueriesCollections = caseMessagesMockData;
@@ -23453,13 +23445,9 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23453
23445
  // QueryManagementUtils.extractCaseQueriesFromCaseField();
23454
23446
  }
23455
23447
  }
23456
- ngOnDestroy() {
23457
- this.caseSubscription?.unsubscribe();
23458
- }
23459
23448
  setQuery(query) {
23460
23449
  this.showQueryList = false;
23461
23450
  this.query = query;
23462
- this.messageType = this.getMessageType(query);
23463
23451
  this.isQueryClosed = this.query?.children?.some((queryItem) => queryItem?.isClosed === 'Yes');
23464
23452
  }
23465
23453
  backToQueryListPage() {
@@ -23469,27 +23457,19 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23469
23457
  isInternalUser() {
23470
23458
  return isInternalUser(this.sessionStorageService);
23471
23459
  }
23472
- getMessageType(query) {
23473
- if (!query) {
23474
- return undefined;
23475
- }
23476
- return query.children?.length
23477
- ? query.children[query.children.length - 1]?.messageType
23478
- : query?.messageType;
23479
- }
23480
- static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
23481
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["singleQueryDetails", ""], ["sequentialQuery", ""], ["queryIsInReview", ""], [4, "ngIf", "ngIfElse"], [4, "ngFor", "ngForOf"], ["class", "govuk-!-margin-top-8 govuk-!-margin-bottom-8", 4, "ngIf"], [1, "govuk-!-margin-top-8", "govuk-!-margin-bottom-8"], [3, "selectedQuery", "caseQueriesCollection"], [3, "backClicked", "query", "caseId"], [4, "ngIf"], ["id", "ask-follow-up-question", "data-module", "govuk-button", 1, "govuk-button", 3, "routerLink"], [1, "govuk-!-font-weight-bold"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-visually-hidden"], [1, "qm-service-message", "govuk-!-font-weight-bold"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
23482
- i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 3)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 3, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
23460
+ static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
23461
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["singleQueryDetails", ""], ["queryIsInReview", ""], [4, "ngIf", "ngIfElse"], [4, "ngFor", "ngForOf"], ["class", "govuk-!-margin-top-8 govuk-!-margin-bottom-8", 4, "ngIf"], [1, "govuk-!-margin-top-8", "govuk-!-margin-bottom-8"], [3, "selectedQuery", "caseQueriesCollection"], [3, "backClicked", "query", "caseId"], [4, "ngIf"], ["id", "ask-follow-up-question", "data-module", "govuk-button", 1, "govuk-button", 3, "routerLink"], [1, "govuk-!-font-weight-bold"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-visually-hidden"], [1, "qm-service-message", "govuk-!-font-weight-bold"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
23462
+ i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 2)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 3, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
23483
23463
  } if (rf & 2) {
23484
- const singleQueryDetails_r7 = i0.ɵɵreference(2);
23485
- i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r7);
23464
+ const singleQueryDetails_r6 = i0.ɵɵreference(2);
23465
+ i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r6);
23486
23466
  } }, encapsulation: 2 });
23487
23467
  }
23488
23468
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
23489
23469
  type: Component,
23490
- args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isInternalUser() && !isQueryClosed\">\n <ng-container *ngIf=\"(messageType && messageType === followUpQuery && isMultipleFollowUpEnabled) || (messageType && messageType === respondToQuery); else sequentialQuery\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n <ng-template #sequentialQuery>\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-template>\n\n </ng-container>\n <ng-container *ngIf=\"!isInternalUser() && isQueryClosed\">\n <div class=\"govuk-warning-text\">\n <span aria-hidden=\"true\" class=\"govuk-warning-text__icon\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-visually-hidden\">Warning</span>\n <p class=\"qm-service-message govuk-!-font-weight-bold\">{{ 'This query has been closed by court staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23491
- }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
23492
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 18 }); })();
23470
+ args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isInternalUser() && !isQueryClosed && query?.children?.length > 0\">\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!isInternalUser() && isQueryClosed\">\n <div class=\"govuk-warning-text\">\n <span aria-hidden=\"true\" class=\"govuk-warning-text__icon\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-visually-hidden\">Warning</span>\n <p class=\"qm-service-message govuk-!-font-weight-bold\">{{ 'This query has been closed by court staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23471
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
23472
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 15 }); })();
23493
23473
 
23494
23474
  class ReadTextAreaFieldComponent extends AbstractFieldReadComponent {
23495
23475
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadTextAreaFieldComponent_BaseFactory; return function ReadTextAreaFieldComponent_Factory(__ngFactoryType__) { return (ɵReadTextAreaFieldComponent_BaseFactory || (ɵReadTextAreaFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadTextAreaFieldComponent)))(__ngFactoryType__ || ReadTextAreaFieldComponent); }; })();
@@ -30746,6 +30726,8 @@ class PaletteModule {
30746
30726
  CommonDataService,
30747
30727
  LinkedCasesService,
30748
30728
  QualifyingQuestionService,
30729
+ QueryManagementUtils,
30730
+ QueryManagementService,
30749
30731
  { provide: MAT_LEGACY_DATE_LOCALE, useValue: 'en-GB' }
30750
30732
  ], imports: [CommonModule,
30751
30733
  RouterModule,
@@ -30863,6 +30845,8 @@ class PaletteModule {
30863
30845
  CommonDataService,
30864
30846
  LinkedCasesService,
30865
30847
  QualifyingQuestionService,
30848
+ QueryManagementUtils,
30849
+ QueryManagementService,
30866
30850
  { provide: MAT_LEGACY_DATE_LOCALE, useValue: 'en-GB' }
30867
30851
  ],
30868
30852
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
@@ -40269,5 +40253,5 @@ class TestRouteSnapshotBuilder {
40269
40253
  * Generated bundle index. Do not edit.
40270
40254
  */
40271
40255
 
40272
- export { AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, AbstractFieldWriteJourneyComponent, AbstractJourneyComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewFolderToggleComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, CloseQueryComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipageComponentStateService, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionService, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryConfirmationComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadCookieService, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
40256
+ export { AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, AbstractFieldWriteJourneyComponent, AbstractJourneyComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewFolderToggleComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, CloseQueryComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipageComponentStateService, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionService, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryConfirmationComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryManagementService, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadCookieService, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
40273
40257
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.mjs.map