@hmcts/opal-frontend-common 0.0.20 → 0.0.22

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 (178) hide show
  1. package/components/abstract/abstract-sortable-table/index.d.ts +33 -2
  2. package/components/abstract/abstract-sortable-table-pagination/index.d.ts +16 -1
  3. package/components/abstract/abstract-table-filter/README.md +76 -0
  4. package/components/abstract/abstract-table-filter/index.d.ts +116 -0
  5. package/components/abstract/abstract-table-filter/interfaces/index.d.ts +17 -0
  6. package/components/abstract/abstract-table-filter/types/index.d.ts +3 -0
  7. package/components/custom/custom-account-information/custom-account-information-item/custom-account-information-item-label/index.d.ts +9 -0
  8. package/components/custom/custom-account-information/custom-account-information-item/custom-account-information-item-value/index.d.ts +9 -0
  9. package/components/custom/custom-account-information/custom-account-information-item/index.d.ts +10 -0
  10. package/components/custom/custom-account-information/index.d.ts +8 -0
  11. package/components/custom/custom-action-links/index.d.ts +12 -0
  12. package/components/custom/custom-page-header/index.d.ts +8 -0
  13. package/components/custom/custom-summary-metric-bar/custom-summary-metric-bar-item/custom-summary-metric-bar-item-label/index.d.ts +10 -0
  14. package/components/custom/custom-summary-metric-bar/custom-summary-metric-bar-item/custom-summary-metric-bar-item-value/index.d.ts +10 -0
  15. package/components/custom/custom-summary-metric-bar/custom-summary-metric-bar-item/index.d.ts +20 -0
  16. package/components/custom/custom-summary-metric-bar/index.d.ts +8 -0
  17. package/components/govuk/govuk-list/govuk-list-link/index.d.ts +12 -0
  18. package/components/govuk/govuk-list/index.d.ts +8 -0
  19. package/components/hod/hod-loading-spinner/index.d.ts +11 -0
  20. package/components/moj/moj-button-menu/index.d.ts +16 -10
  21. package/components/moj/moj-button-menu/moj-button-menu-item/index.d.ts +12 -0
  22. package/components/moj/moj-filter/index.d.ts +16 -0
  23. package/components/moj/moj-filter/moj-filter-panel/index.d.ts +8 -0
  24. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-header/README.md +43 -0
  25. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-header/index.d.ts +9 -0
  26. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/README.md +81 -0
  27. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/index.d.ts +18 -0
  28. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/moj-filter-panel-option-form-group-item/README.md +53 -0
  29. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/moj-filter-panel-option-form-group-item/index.d.ts +30 -0
  30. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/moj-filter-panel-option-form-group-keyword/README.md +59 -0
  31. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/moj-filter-panel-option-form-group-keyword/index.d.ts +22 -0
  32. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-selected/README.md +55 -0
  33. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-selected/index.d.ts +21 -0
  34. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-selected/moj-filter-panel-selected-tag/README.md +52 -0
  35. package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-selected/moj-filter-panel-selected-tag/index.d.ts +24 -0
  36. package/directives/govuk-button/index.d.ts +21 -0
  37. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map +1 -1
  38. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs.map +1 -1
  39. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs.map +1 -1
  40. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs.map +1 -1
  41. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs.map +1 -1
  42. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-parent-base.mjs.map +1 -1
  43. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs +23 -7
  44. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs.map +1 -1
  45. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +69 -9
  46. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs.map +1 -1
  47. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-tab-data.mjs.map +1 -1
  48. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-interfaces.mjs +4 -0
  49. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-interfaces.mjs.map +1 -0
  50. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-types.mjs +4 -0
  51. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-types.mjs.map +1 -0
  52. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs +184 -0
  53. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs.map +1 -0
  54. package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs.map +1 -1
  55. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs +22 -0
  56. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs.map +1 -0
  57. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs +22 -0
  58. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs.map +1 -0
  59. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs +28 -0
  60. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs.map +1 -0
  61. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs +18 -0
  62. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs.map +1 -0
  63. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs +38 -0
  64. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs.map +1 -0
  65. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs +18 -0
  66. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs.map +1 -0
  67. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs +28 -0
  68. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs.map +1 -0
  69. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs +28 -0
  70. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs.map +1 -0
  71. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs +43 -0
  72. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs.map +1 -0
  73. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs +18 -0
  74. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs.map +1 -0
  75. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs.map +1 -1
  76. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs.map +1 -1
  77. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs.map +1 -1
  78. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs.map +1 -1
  79. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs.map +1 -1
  80. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs.map +1 -1
  81. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs.map +1 -1
  82. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs.map +1 -1
  83. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs +31 -0
  84. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs.map +1 -0
  85. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs +18 -0
  86. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs.map +1 -0
  87. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs.map +1 -1
  88. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs.map +1 -1
  89. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs.map +1 -1
  90. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs.map +1 -1
  91. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs.map +1 -1
  92. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs.map +1 -1
  93. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs.map +1 -1
  94. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs.map +1 -1
  95. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs.map +1 -1
  96. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs.map +1 -1
  97. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs.map +1 -1
  98. package/fesm2022/hmcts-opal-frontend-common-components-govuk-helpers.mjs.map +1 -1
  99. package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs +30 -0
  100. package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs.map +1 -0
  101. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs.map +1 -1
  102. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs +29 -0
  103. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs.map +1 -0
  104. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +40 -22
  105. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs.map +1 -1
  106. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs.map +1 -1
  107. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs +22 -0
  108. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs.map +1 -0
  109. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs +44 -0
  110. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs.map +1 -0
  111. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs +48 -0
  112. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs.map +1 -0
  113. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs +34 -0
  114. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs.map +1 -0
  115. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs +41 -0
  116. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs.map +1 -0
  117. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs +43 -0
  118. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs.map +1 -0
  119. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs +18 -0
  120. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs.map +1 -0
  121. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs +31 -0
  122. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs.map +1 -0
  123. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs.map +1 -1
  124. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs.map +1 -1
  125. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs.map +1 -1
  126. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs.map +1 -1
  127. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs.map +1 -1
  128. package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs.map +1 -1
  129. package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs +61 -0
  130. package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs.map +1 -0
  131. package/fesm2022/hmcts-opal-frontend-common-guards-auth.mjs.map +1 -1
  132. package/fesm2022/hmcts-opal-frontend-common-guards-has-flow-state.mjs.map +1 -1
  133. package/fesm2022/hmcts-opal-frontend-common-guards-helpers.mjs.map +1 -1
  134. package/fesm2022/hmcts-opal-frontend-common-guards-route-permissions.mjs.map +1 -1
  135. package/fesm2022/hmcts-opal-frontend-common-guards-signed-in.mjs.map +1 -1
  136. package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error.mjs.map +1 -1
  137. package/fesm2022/hmcts-opal-frontend-common-pages-access-denied.component-hjYG8Hhi.mjs.map +1 -1
  138. package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-CMgQc0uF.mjs.map +1 -1
  139. package/fesm2022/hmcts-opal-frontend-common-pages-sign-in.component-UHSDf5ya.mjs.map +1 -1
  140. package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs.map +1 -1
  141. package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs.map +1 -1
  142. package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs.map +1 -1
  143. package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs.map +1 -1
  144. package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs.map +1 -1
  145. package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs.map +1 -1
  146. package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs.map +1 -1
  147. package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs.map +1 -1
  148. package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs.map +1 -1
  149. package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs.map +1 -1
  150. package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs.map +1 -1
  151. package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs.map +1 -1
  152. package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs.map +1 -1
  153. package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs.map +1 -1
  154. package/fesm2022/hmcts-opal-frontend-common-stores-global.mjs.map +1 -1
  155. package/fesm2022/hmcts-opal-frontend-common-validators-alphabetical-text.mjs.map +1 -1
  156. package/fesm2022/hmcts-opal-frontend-common-validators-amount.mjs.map +1 -1
  157. package/fesm2022/hmcts-opal-frontend-common-validators-date-after-year.mjs.map +1 -1
  158. package/fesm2022/hmcts-opal-frontend-common-validators-date-before.mjs.map +1 -1
  159. package/fesm2022/hmcts-opal-frontend-common-validators-date-of-birth.mjs.map +1 -1
  160. package/fesm2022/hmcts-opal-frontend-common-validators-driving-licence-number.mjs.map +1 -1
  161. package/fesm2022/hmcts-opal-frontend-common-validators-future-date.mjs.map +1 -1
  162. package/fesm2022/hmcts-opal-frontend-common-validators-invalid-value.mjs.map +1 -1
  163. package/fesm2022/hmcts-opal-frontend-common-validators-national-insurance-number.mjs.map +1 -1
  164. package/fesm2022/hmcts-opal-frontend-common-validators-numerical-only.mjs.map +1 -1
  165. package/fesm2022/hmcts-opal-frontend-common-validators-optional-max-length.mjs.map +1 -1
  166. package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-date.mjs.map +1 -1
  167. package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-email-address.mjs.map +1 -1
  168. package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-telephone.mjs.map +1 -1
  169. package/fesm2022/hmcts-opal-frontend-common-validators-over-eighteen.mjs.map +1 -1
  170. package/fesm2022/hmcts-opal-frontend-common-validators-past-date.mjs.map +1 -1
  171. package/fesm2022/hmcts-opal-frontend-common-validators-pattern-validator.mjs.map +1 -1
  172. package/fesm2022/hmcts-opal-frontend-common-validators-special-characters.mjs.map +1 -1
  173. package/fesm2022/hmcts-opal-frontend-common-validators-time-format.mjs.map +1 -1
  174. package/fesm2022/hmcts-opal-frontend-common-validators-two-decimal-places.mjs.map +1 -1
  175. package/fesm2022/hmcts-opal-frontend-common-validators-valid-value.mjs.map +1 -1
  176. package/package.json +134 -1
  177. package/styles/custom/_custom-section_break.scss +6 -0
  178. package/styles/styles.scss +102 -0
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-services-permissions-service.mjs","sources":["../../../projects/opal-frontend-common/services/permissions-service/permissions.service.ts","../../../projects/opal-frontend-common/services/permissions-service/hmcts-opal-frontend-common-services-permissions-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ISessionUserState,\n ISessionUserStatePermission,\n ISessionUserStateRole,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionsService {\n private storedUniquePermissionIds: number[] = [];\n\n /**\n * Retrieves the unique permission IDs associated with the user.\n * If the unique permission IDs have not been stored yet, it calculates them based on the user's roles and permissions.\n * @returns An array of unique permission IDs.\n */\n public getUniquePermissions(userState: ISessionUserState | null): number[] {\n const roles = userState ? userState['business_unit_user'] : null;\n\n if (!this.storedUniquePermissionIds.length && roles) {\n const permissionIds = roles.flatMap((role) => {\n return role.permissions.map(({ permission_id: permissionId }) => permissionId);\n });\n\n this.storedUniquePermissionIds = [...new Set(permissionIds)];\n }\n\n return this.storedUniquePermissionIds;\n }\n\n public hasPermissionAccess(permissionId: number, businessUnitId: number, roles: ISessionUserStateRole[]): boolean {\n if (roles?.length) {\n // First we need to find the matching role\n const role = roles?.find((role) => role.business_unit_id === businessUnitId);\n\n // Then we need to find the matching permission\n const hasPermission = !!role?.permissions.find(\n (permission: ISessionUserStatePermission) => permission.permission_id === permissionId,\n );\n\n return hasPermission;\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAUa,kBAAkB,CAAA;IACrB,yBAAyB,GAAa,EAAE;AAEhD;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,SAAmC,EAAA;AAC7D,QAAA,MAAM,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI;QAEhE,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,KAAK,EAAE;YACnD,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AAC3C,gBAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,YAAY,CAAC;AAChF,aAAC,CAAC;YAEF,IAAI,CAAC,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;;QAG9D,OAAO,IAAI,CAAC,yBAAyB;;AAGhC,IAAA,mBAAmB,CAAC,YAAoB,EAAE,cAAsB,EAAE,KAA8B,EAAA;AACrG,QAAA,IAAI,KAAK,EAAE,MAAM,EAAE;;AAEjB,YAAA,MAAM,IAAI,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,gBAAgB,KAAK,cAAc,CAAC;;YAG5E,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAC5C,CAAC,UAAuC,KAAK,UAAU,CAAC,aAAa,KAAK,YAAY,CACvF;AAED,YAAA,OAAO,aAAa;;;AAGtB,QAAA,OAAO,IAAI;;wGAnCF,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA;;4FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-services-permissions-service.mjs","sources":["../../../projects/opal-frontend-common/services/permissions-service/permissions.service.ts","../../../projects/opal-frontend-common/services/permissions-service/hmcts-opal-frontend-common-services-permissions-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ISessionUserState,\n ISessionUserStatePermission,\n ISessionUserStateRole,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionsService {\n private storedUniquePermissionIds: number[] = [];\n\n /**\n * Retrieves the unique permission IDs associated with the user.\n * If the unique permission IDs have not been stored yet, it calculates them based on the user's roles and permissions.\n * @returns An array of unique permission IDs.\n */\n public getUniquePermissions(userState: ISessionUserState | null): number[] {\n const roles = userState ? userState['business_unit_user'] : null;\n\n if (!this.storedUniquePermissionIds.length && roles) {\n const permissionIds = roles.flatMap((role) => {\n return role.permissions.map(({ permission_id: permissionId }) => permissionId);\n });\n\n this.storedUniquePermissionIds = [...new Set(permissionIds)];\n }\n\n return this.storedUniquePermissionIds;\n }\n\n public hasPermissionAccess(permissionId: number, businessUnitId: number, roles: ISessionUserStateRole[]): boolean {\n if (roles?.length) {\n // First we need to find the matching role\n const role = roles?.find((role) => role.business_unit_id === businessUnitId);\n\n // Then we need to find the matching permission\n const hasPermission = !!role?.permissions.find(\n (permission: ISessionUserStatePermission) => permission.permission_id === permissionId,\n );\n\n return hasPermission;\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAUa,kBAAkB,CAAA;IACrB,yBAAyB,GAAa,EAAE;AAEhD;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,SAAmC,EAAA;AAC7D,QAAA,MAAM,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI;QAEhE,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,KAAK,EAAE;YACnD,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AAC3C,gBAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,YAAY,CAAC;AAChF,YAAA,CAAC,CAAC;YAEF,IAAI,CAAC,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;QAC9D;QAEA,OAAO,IAAI,CAAC,yBAAyB;IACvC;AAEO,IAAA,mBAAmB,CAAC,YAAoB,EAAE,cAAsB,EAAE,KAA8B,EAAA;AACrG,QAAA,IAAI,KAAK,EAAE,MAAM,EAAE;;AAEjB,YAAA,MAAM,IAAI,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,gBAAgB,KAAK,cAAc,CAAC;;YAG5E,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAC5C,CAAC,UAAuC,KAAK,UAAU,CAAC,aAAa,KAAK,YAAY,CACvF;AAED,YAAA,OAAO,aAAa;QACtB;;AAEA,QAAA,OAAO,IAAI;IACb;wGApCW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA;;4FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACTD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-services-session-service.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/session.service.ts","../../../projects/opal-frontend-common/services/session-service/hmcts-opal-frontend-common-services-session-service.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable, retry, shareReplay, tap, timer } from 'rxjs';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SESSION_ENDPOINTS } from '@hmcts/opal-frontend-common/services/session-service/constants';\nimport {\n ISessionUserState,\n ISessionTokenExpiry,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SessionService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n private userStateCache$!: Observable<ISessionUserState>;\n private tokenExpiryCache$!: Observable<ISessionTokenExpiry>;\n\n private readonly MAX_RETRIES = 5;\n private readonly RETRY_DELAY_MS = 1000;\n\n /**\n * Retrieves the user state from the backend.\n * If the user state is not available or needs to be refreshed, it makes an HTTP request to fetch the user state.\n * The user state is then stored in the state service for future use.\n * The user state is cached using the `shareReplay` operator to avoid unnecessary HTTP requests.\n * @returns An observable that emits the user state.\n */\n public getUserState(): Observable<ISessionUserState> {\n // The backend can return an empty object so...\n // If we don't have a user state, then we need to refresh it...\n // And override the shareReplay cache...\n const refresh = !this.globalStore.userState()?.user_id;\n\n if (!this.userStateCache$ || refresh) {\n this.userStateCache$ = this.http\n .get<ISessionUserState>(SESSION_ENDPOINTS.userState)\n .pipe(shareReplay(1))\n .pipe(\n tap((userState) => {\n this.globalStore.setUserState(userState);\n }),\n );\n }\n\n return this.userStateCache$;\n }\n\n /**\n * Retrieves the token expiry information from the server.\n * If the token expiry information is already cached, it returns the cached value.\n * Otherwise, it makes an HTTP GET request to fetch the token expiry information,\n * retries the request up to a maximum number of times if it fails, and caches the result.\n *\n * @returns {Observable<ISessionTokenExpiry>} An observable that emits the token expiry information.\n */\n public getTokenExpiry(): Observable<ISessionTokenExpiry> {\n this.tokenExpiryCache$ ??= this.http.get<ISessionTokenExpiry>(SESSION_ENDPOINTS.expiry).pipe(\n retry({\n count: this.MAX_RETRIES,\n delay: () => timer(this.RETRY_DELAY_MS),\n }),\n tap((expiry) => {\n this.globalStore.setTokenExpiry(expiry);\n }),\n shareReplay(1),\n );\n return this.tokenExpiryCache$;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAaa,cAAc,CAAA;AACR,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,eAAe;AACf,IAAA,iBAAiB;IAER,WAAW,GAAG,CAAC;IACf,cAAc,GAAG,IAAI;AAEtC;;;;;;AAMG;IACI,YAAY,GAAA;;;;QAIjB,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,OAAO;AAEtD,QAAA,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,OAAO,EAAE;AACpC,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;AACzB,iBAAA,GAAG,CAAoB,iBAAiB,CAAC,SAAS;AAClD,iBAAA,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACnB,iBAAA,IAAI,CACH,GAAG,CAAC,CAAC,SAAS,KAAI;AAChB,gBAAA,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC;aACzC,CAAC,CACH;;QAGL,OAAO,IAAI,CAAC,eAAe;;AAG7B;;;;;;;AAOG;IACI,cAAc,GAAA;AACnB,QAAA,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAC1F,KAAK,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,KAAK,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;AACxC,SAAA,CAAC,EACF,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,YAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC;AACzC,SAAC,CAAC,EACF,WAAW,CAAC,CAAC,CAAC,CACf;QACD,OAAO,IAAI,CAAC,iBAAiB;;wGAvDpB,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;4FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-services-session-service.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/session.service.ts","../../../projects/opal-frontend-common/services/session-service/hmcts-opal-frontend-common-services-session-service.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable, retry, shareReplay, tap, timer } from 'rxjs';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SESSION_ENDPOINTS } from '@hmcts/opal-frontend-common/services/session-service/constants';\nimport {\n ISessionUserState,\n ISessionTokenExpiry,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SessionService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n private userStateCache$!: Observable<ISessionUserState>;\n private tokenExpiryCache$!: Observable<ISessionTokenExpiry>;\n\n private readonly MAX_RETRIES = 5;\n private readonly RETRY_DELAY_MS = 1000;\n\n /**\n * Retrieves the user state from the backend.\n * If the user state is not available or needs to be refreshed, it makes an HTTP request to fetch the user state.\n * The user state is then stored in the state service for future use.\n * The user state is cached using the `shareReplay` operator to avoid unnecessary HTTP requests.\n * @returns An observable that emits the user state.\n */\n public getUserState(): Observable<ISessionUserState> {\n // The backend can return an empty object so...\n // If we don't have a user state, then we need to refresh it...\n // And override the shareReplay cache...\n const refresh = !this.globalStore.userState()?.user_id;\n\n if (!this.userStateCache$ || refresh) {\n this.userStateCache$ = this.http\n .get<ISessionUserState>(SESSION_ENDPOINTS.userState)\n .pipe(shareReplay(1))\n .pipe(\n tap((userState) => {\n this.globalStore.setUserState(userState);\n }),\n );\n }\n\n return this.userStateCache$;\n }\n\n /**\n * Retrieves the token expiry information from the server.\n * If the token expiry information is already cached, it returns the cached value.\n * Otherwise, it makes an HTTP GET request to fetch the token expiry information,\n * retries the request up to a maximum number of times if it fails, and caches the result.\n *\n * @returns {Observable<ISessionTokenExpiry>} An observable that emits the token expiry information.\n */\n public getTokenExpiry(): Observable<ISessionTokenExpiry> {\n this.tokenExpiryCache$ ??= this.http.get<ISessionTokenExpiry>(SESSION_ENDPOINTS.expiry).pipe(\n retry({\n count: this.MAX_RETRIES,\n delay: () => timer(this.RETRY_DELAY_MS),\n }),\n tap((expiry) => {\n this.globalStore.setTokenExpiry(expiry);\n }),\n shareReplay(1),\n );\n return this.tokenExpiryCache$;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAaa,cAAc,CAAA;AACR,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,eAAe;AACf,IAAA,iBAAiB;IAER,WAAW,GAAG,CAAC;IACf,cAAc,GAAG,IAAI;AAEtC;;;;;;AAMG;IACI,YAAY,GAAA;;;;QAIjB,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,OAAO;AAEtD,QAAA,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,OAAO,EAAE;AACpC,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;AACzB,iBAAA,GAAG,CAAoB,iBAAiB,CAAC,SAAS;AAClD,iBAAA,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACnB,iBAAA,IAAI,CACH,GAAG,CAAC,CAAC,SAAS,KAAI;AAChB,gBAAA,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC;YAC1C,CAAC,CAAC,CACH;QACL;QAEA,OAAO,IAAI,CAAC,eAAe;IAC7B;AAEA;;;;;;;AAOG;IACI,cAAc,GAAA;AACnB,QAAA,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAC1F,KAAK,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,KAAK,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;AACxC,SAAA,CAAC,EACF,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,YAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC;AACzC,QAAA,CAAC,CAAC,EACF,WAAW,CAAC,CAAC,CAAC,CACf;QACD,OAAO,IAAI,CAAC,iBAAiB;IAC/B;wGAxDW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;4FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACZD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-services-sort-service.mjs","sources":["../../../projects/opal-frontend-common/services/sort-service/sort.service.ts","../../../projects/opal-frontend-common/services/sort-service/hmcts-opal-frontend-common-services-sort-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { sort } from 'fast-sort';\nimport {\n ISortServiceConfig,\n ISortServiceValues,\n ISortServiceArrayValues,\n} from '@hmcts/opal-frontend-common/services/sort-service/interfaces';\nimport { SortableValuesType } from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SortService {\n /**\n * Sorts an array of values in ascending order.\n *\n * @param array - The array of values to be sorted.\n * @returns The sorted array in ascending order.\n */\n public arraySortAsc(array: ISortServiceArrayValues): ISortServiceArrayValues {\n return sort(array).asc();\n }\n\n /**\n * Sorts an array of values in descending order.\n *\n * @param array - The array of values to be sorted.\n * @returns The sorted array in descending order.\n */\n public arraySortDesc(array: ISortServiceArrayValues): ISortServiceArrayValues {\n return sort(array).desc();\n }\n\n /**\n * Sorts an array of objects based on a specified key and sort type.\n *\n * @param array - The array of objects to be sorted. Each object should implement the `ISortServiceValues` interface.\n * @param config - The configuration object containing the key to sort by and the sort type (ascending or descending).\n * @returns The sorted array of objects.\n *\n * @remarks\n * - If the input array is not an array or the config key is not provided, the original array is returned.\n * - The `sortType` can be either 'ascending' or 'descending'.\n *\n * @example\n * ```typescript\n * const array = [\n * { name: 'Alice', age: 30 },\n * { name: 'Bob', age: 25 },\n * ];\n * const config = { key: 'age', sortType: 'ascending' };\n * const sortedArray = getObjects(array, config);\n * // sortedArray will be:\n * // [\n * // { name: 'Bob', age: 25 },\n * // { name: 'Alice', age: 30 },\n * // ]\n * ```\n */\n private sortObjectArray(\n array: ISortServiceValues<SortableValuesType>[] | null,\n config: ISortServiceConfig,\n ): ISortServiceValues<SortableValuesType>[] | null {\n if (!Array.isArray(array) || !config.key) {\n return array;\n }\n\n const { key, sortType } = config;\n\n if (sortType === 'ascending') {\n return sort(array).asc((obj) => obj[key]);\n } else {\n return sort(array).desc((obj) => obj[key]);\n }\n }\n\n /**\n * Sorts an array of objects in ascending order based on the specified key.\n *\n * @param array - The array of objects to be sorted.\n * @param key - The key of the object property to sort by.\n * @returns The sorted array of objects.\n */\n public sortObjectArrayAsc(\n array: ISortServiceValues<SortableValuesType>[] | null,\n key: string,\n ): ISortServiceValues<SortableValuesType>[] | null {\n return this.sortObjectArray(array, { key, sortType: 'ascending' });\n }\n\n /**\n * Sorts an array of objects in descending order based on the specified key.\n *\n * @param array - The array of objects to be sorted. Each object should implement the ISortServiceValues interface.\n * @param key - The key of the object property to sort by.\n * @returns The sorted array of objects in descending order.\n */\n public sortObjectArrayDesc(\n array: ISortServiceValues<SortableValuesType>[] | null,\n key: string,\n ): ISortServiceValues<SortableValuesType>[] | null {\n return this.sortObjectArray(array, { key, sortType: 'descending' });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAYa,WAAW,CAAA;AACtB;;;;;AAKG;AACI,IAAA,YAAY,CAAC,KAA8B,EAAA;AAChD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE;;AAG1B;;;;;AAKG;AACI,IAAA,aAAa,CAAC,KAA8B,EAAA;AACjD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;;AAG3B;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;IACK,eAAe,CACrB,KAAsD,EACtD,MAA0B,EAAA;AAE1B,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AACxC,YAAA,OAAO,KAAK;;AAGd,QAAA,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,MAAM;AAEhC,QAAA,IAAI,QAAQ,KAAK,WAAW,EAAE;AAC5B,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;;aACpC;AACL,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;;;AAI9C;;;;;;AAMG;IACI,kBAAkB,CACvB,KAAsD,EACtD,GAAW,EAAA;AAEX,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;;AAGpE;;;;;;AAMG;IACI,mBAAmB,CACxB,KAAsD,EACtD,GAAW,EAAA;AAEX,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;;wGAzF1D,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;4FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-services-sort-service.mjs","sources":["../../../projects/opal-frontend-common/services/sort-service/sort.service.ts","../../../projects/opal-frontend-common/services/sort-service/hmcts-opal-frontend-common-services-sort-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { sort } from 'fast-sort';\nimport {\n ISortServiceConfig,\n ISortServiceValues,\n ISortServiceArrayValues,\n} from '@hmcts/opal-frontend-common/services/sort-service/interfaces';\nimport { SortableValuesType } from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SortService {\n /**\n * Sorts an array of values in ascending order.\n *\n * @param array - The array of values to be sorted.\n * @returns The sorted array in ascending order.\n */\n public arraySortAsc(array: ISortServiceArrayValues): ISortServiceArrayValues {\n return sort(array).asc();\n }\n\n /**\n * Sorts an array of values in descending order.\n *\n * @param array - The array of values to be sorted.\n * @returns The sorted array in descending order.\n */\n public arraySortDesc(array: ISortServiceArrayValues): ISortServiceArrayValues {\n return sort(array).desc();\n }\n\n /**\n * Sorts an array of objects based on a specified key and sort type.\n *\n * @param array - The array of objects to be sorted. Each object should implement the `ISortServiceValues` interface.\n * @param config - The configuration object containing the key to sort by and the sort type (ascending or descending).\n * @returns The sorted array of objects.\n *\n * @remarks\n * - If the input array is not an array or the config key is not provided, the original array is returned.\n * - The `sortType` can be either 'ascending' or 'descending'.\n *\n * @example\n * ```typescript\n * const array = [\n * { name: 'Alice', age: 30 },\n * { name: 'Bob', age: 25 },\n * ];\n * const config = { key: 'age', sortType: 'ascending' };\n * const sortedArray = getObjects(array, config);\n * // sortedArray will be:\n * // [\n * // { name: 'Bob', age: 25 },\n * // { name: 'Alice', age: 30 },\n * // ]\n * ```\n */\n private sortObjectArray(\n array: ISortServiceValues<SortableValuesType>[] | null,\n config: ISortServiceConfig,\n ): ISortServiceValues<SortableValuesType>[] | null {\n if (!Array.isArray(array) || !config.key) {\n return array;\n }\n\n const { key, sortType } = config;\n\n if (sortType === 'ascending') {\n return sort(array).asc((obj) => obj[key]);\n } else {\n return sort(array).desc((obj) => obj[key]);\n }\n }\n\n /**\n * Sorts an array of objects in ascending order based on the specified key.\n *\n * @param array - The array of objects to be sorted.\n * @param key - The key of the object property to sort by.\n * @returns The sorted array of objects.\n */\n public sortObjectArrayAsc(\n array: ISortServiceValues<SortableValuesType>[] | null,\n key: string,\n ): ISortServiceValues<SortableValuesType>[] | null {\n return this.sortObjectArray(array, { key, sortType: 'ascending' });\n }\n\n /**\n * Sorts an array of objects in descending order based on the specified key.\n *\n * @param array - The array of objects to be sorted. Each object should implement the ISortServiceValues interface.\n * @param key - The key of the object property to sort by.\n * @returns The sorted array of objects in descending order.\n */\n public sortObjectArrayDesc(\n array: ISortServiceValues<SortableValuesType>[] | null,\n key: string,\n ): ISortServiceValues<SortableValuesType>[] | null {\n return this.sortObjectArray(array, { key, sortType: 'descending' });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAYa,WAAW,CAAA;AACtB;;;;;AAKG;AACI,IAAA,YAAY,CAAC,KAA8B,EAAA;AAChD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE;IAC1B;AAEA;;;;;AAKG;AACI,IAAA,aAAa,CAAC,KAA8B,EAAA;AACjD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;IAC3B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;IACK,eAAe,CACrB,KAAsD,EACtD,MAA0B,EAAA;AAE1B,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AACxC,YAAA,OAAO,KAAK;QACd;AAEA,QAAA,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,MAAM;AAEhC,QAAA,IAAI,QAAQ,KAAK,WAAW,EAAE;AAC5B,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3C;aAAO;AACL,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5C;IACF;AAEA;;;;;;AAMG;IACI,kBAAkB,CACvB,KAAsD,EACtD,GAAW,EAAA;AAEX,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IACpE;AAEA;;;;;;AAMG;IACI,mBAAmB,CACxB,KAAsD,EACtD,GAAW,EAAA;AAEX,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;IACrE;wGA1FW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;4FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-services-transfer-state-service.mjs","sources":["../../../projects/opal-frontend-common/services/transfer-state-service/transfer-state.service.ts","../../../projects/opal-frontend-common/services/transfer-state-service/hmcts-opal-frontend-common-services-transfer-state-service.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, Optional, PLATFORM_ID, TransferState, inject, makeStateKey } from '@angular/core';\nimport { ITransferStateServerState } from '@hmcts/opal-frontend-common/services/transfer-state-service/interfaces';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransferStateService {\n private readonly globalStore = inject(GlobalStore);\n private readonly storedServerTransferState!: ITransferStateServerState;\n\n constructor(\n @Inject(PLATFORM_ID) private readonly platformId: typeof PLATFORM_ID,\n @Optional()\n @Inject('serverTransferState')\n public readonly serverTransferState: ITransferStateServerState | null,\n private readonly transferState: TransferState,\n ) {\n const storeKeyTransferState = makeStateKey<ITransferStateServerState>('serverTransferState');\n\n if (isPlatformBrowser(this.platformId)) {\n // get user state from transfer state if browser side\n this.serverTransferState = this.transferState.get(storeKeyTransferState, null);\n\n if (this.serverTransferState) {\n this.storedServerTransferState = this.serverTransferState;\n }\n } else {\n // server side: store server transfer state\n this.transferState.set(storeKeyTransferState, this.serverTransferState);\n }\n }\n\n /**\n * Initializes the SSO (Single Sign-On) enabled state.\n * Sets the SSO enabled state based on the stored server transfer state.\n */\n public initializeSsoEnabled(): void {\n this.globalStore.setSsoEnabled(this.storedServerTransferState?.ssoEnabled);\n }\n\n /**\n * Initializes the LaunchDarkly configuration by assigning the stored server transfer state's\n * launchDarklyConfig value to the globalStore's launchDarklyConfig property.\n */\n public initializeLaunchDarklyConfig(): void {\n this.globalStore.setLaunchDarklyConfig(this.storedServerTransferState?.launchDarklyConfig);\n }\n\n /**\n * Initializes the Application Insights configuration by assigning the stored server transfer state's\n * appInsightsConfig value to the globalStore's appInsightsConfig property.\n */\n public initializeAppInsightsConfig(): void {\n this.globalStore.setAppInsightsConfig(this.storedServerTransferState?.appInsightsConfig);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,oBAAoB,CAAA;AAKS,IAAA,UAAA;AAGtB,IAAA,mBAAA;AACC,IAAA,aAAA;AARF,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,yBAAyB;AAE1C,IAAA,WAAA,CACwC,UAA8B,EAGpD,mBAAqD,EACpD,aAA4B,EAAA;QAJP,IAAA,CAAA,UAAU,GAAV,UAAU;QAGhC,IAAA,CAAA,mBAAmB,GAAnB,mBAAmB;QAClB,IAAA,CAAA,aAAa,GAAb,aAAa;AAE9B,QAAA,MAAM,qBAAqB,GAAG,YAAY,CAA4B,qBAAqB,CAAC;AAE5F,QAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;;AAEtC,YAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC;AAE9E,YAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC5B,gBAAA,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,mBAAmB;;;aAEtD;;YAEL,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC;;;AAI3E;;;AAGG;IACI,oBAAoB,GAAA;QACzB,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC;;AAG5E;;;AAGG;IACI,4BAA4B,GAAA;QACjC,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,yBAAyB,EAAE,kBAAkB,CAAC;;AAG5F;;;AAGG;IACI,2BAA2B,GAAA;QAChC,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,yBAAyB,EAAE,iBAAiB,CAAC;;wGA/C/E,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAKrB,WAAW,EAAA,EAAA,EAAA,KAAA,EAEX,qBAAqB,EAAA,QAAA,EAAA,IAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAPpB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFnB,MAAM,EAAA,CAAA;;4FAEP,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAMI,MAAM;2BAAC,WAAW;;0BAClB;;0BACA,MAAM;2BAAC,qBAAqB;;;ACfjC;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-services-transfer-state-service.mjs","sources":["../../../projects/opal-frontend-common/services/transfer-state-service/transfer-state.service.ts","../../../projects/opal-frontend-common/services/transfer-state-service/hmcts-opal-frontend-common-services-transfer-state-service.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, Optional, PLATFORM_ID, TransferState, inject, makeStateKey } from '@angular/core';\nimport { ITransferStateServerState } from '@hmcts/opal-frontend-common/services/transfer-state-service/interfaces';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransferStateService {\n private readonly globalStore = inject(GlobalStore);\n private readonly storedServerTransferState!: ITransferStateServerState;\n\n constructor(\n @Inject(PLATFORM_ID) private readonly platformId: typeof PLATFORM_ID,\n @Optional()\n @Inject('serverTransferState')\n public readonly serverTransferState: ITransferStateServerState | null,\n private readonly transferState: TransferState,\n ) {\n const storeKeyTransferState = makeStateKey<ITransferStateServerState>('serverTransferState');\n\n if (isPlatformBrowser(this.platformId)) {\n // get user state from transfer state if browser side\n this.serverTransferState = this.transferState.get(storeKeyTransferState, null);\n\n if (this.serverTransferState) {\n this.storedServerTransferState = this.serverTransferState;\n }\n } else {\n // server side: store server transfer state\n this.transferState.set(storeKeyTransferState, this.serverTransferState);\n }\n }\n\n /**\n * Initializes the SSO (Single Sign-On) enabled state.\n * Sets the SSO enabled state based on the stored server transfer state.\n */\n public initializeSsoEnabled(): void {\n this.globalStore.setSsoEnabled(this.storedServerTransferState?.ssoEnabled);\n }\n\n /**\n * Initializes the LaunchDarkly configuration by assigning the stored server transfer state's\n * launchDarklyConfig value to the globalStore's launchDarklyConfig property.\n */\n public initializeLaunchDarklyConfig(): void {\n this.globalStore.setLaunchDarklyConfig(this.storedServerTransferState?.launchDarklyConfig);\n }\n\n /**\n * Initializes the Application Insights configuration by assigning the stored server transfer state's\n * appInsightsConfig value to the globalStore's appInsightsConfig property.\n */\n public initializeAppInsightsConfig(): void {\n this.globalStore.setAppInsightsConfig(this.storedServerTransferState?.appInsightsConfig);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,oBAAoB,CAAA;AAKS,IAAA,UAAA;AAGtB,IAAA,mBAAA;AACC,IAAA,aAAA;AARF,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,yBAAyB;AAE1C,IAAA,WAAA,CACwC,UAA8B,EAGpD,mBAAqD,EACpD,aAA4B,EAAA;QAJP,IAAA,CAAA,UAAU,GAAV,UAAU;QAGhC,IAAA,CAAA,mBAAmB,GAAnB,mBAAmB;QAClB,IAAA,CAAA,aAAa,GAAb,aAAa;AAE9B,QAAA,MAAM,qBAAqB,GAAG,YAAY,CAA4B,qBAAqB,CAAC;AAE5F,QAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;;AAEtC,YAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC;AAE9E,YAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC5B,gBAAA,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,mBAAmB;YAC3D;QACF;aAAO;;YAEL,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC;QACzE;IACF;AAEA;;;AAGG;IACI,oBAAoB,GAAA;QACzB,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC;IAC5E;AAEA;;;AAGG;IACI,4BAA4B,GAAA;QACjC,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,yBAAyB,EAAE,kBAAkB,CAAC;IAC5F;AAEA;;;AAGG;IACI,2BAA2B,GAAA;QAChC,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,yBAAyB,EAAE,iBAAiB,CAAC;IAC1F;wGAhDW,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAKrB,WAAW,EAAA,EAAA,EAAA,KAAA,EAEX,qBAAqB,EAAA,QAAA,EAAA,IAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAPpB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFnB,MAAM,EAAA,CAAA;;4FAEP,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAMI,MAAM;2BAAC,WAAW;;0BAClB;;0BACA,MAAM;2BAAC,qBAAqB;;;ACfjC;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-services-transformation-service.mjs","sources":["../../../projects/opal-frontend-common/services/transformation-service/transformation.service.ts","../../../projects/opal-frontend-common/services/transformation-service/hmcts-opal-frontend-common-services-transformation-service.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ITransformItem } from '@hmcts/opal-frontend-common/services/transformation-service/interfaces';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransformationService {\n private readonly dateService = inject(DateService);\n\n /**\n * Applies a transformation to the given value based on the specified transformation configuration.\n *\n * @param value - The value to be transformed.\n * @param transformItem - The configuration for the transformation, including the type of transformation and any necessary format details.\n * @returns The transformed value, or the original value if no transformation is applied.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private applyTransformation(value: any, transformItem: ITransformItem): any {\n if (!value) {\n return value;\n }\n\n if (transformItem.transformType === 'date') {\n if (transformItem.dateInputFormat !== null && transformItem.dateOutputFormat !== null) {\n const parsedDate = this.dateService.getFromFormat(value, transformItem.dateInputFormat);\n if (this.dateService.isValidDate(parsedDate)) {\n return this.dateService.toFormat(parsedDate, transformItem.dateOutputFormat);\n }\n }\n return value;\n }\n\n return value;\n }\n\n /**\n * Transforms the values of an object based on a given transformation configuration.\n *\n * @param obj - The object whose values need to be transformed. It should be a non-null object.\n * @param toTransform - An array of transformation configurations, where each configuration specifies\n * the key to transform and the transformation details.\n * @returns The transformed object with values modified according to the transformation configuration.\n *\n * @remarks\n * - If the input `obj` is not an object or is null, it returns the input as is.\n * - The function recursively processes nested objects.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public transformObjectValues(obj: { [key: string]: any }, toTransform: ITransformItem[]): any {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n\n for (const [key, value] of Object.entries(obj)) {\n const transformItem = toTransform.find((item) => item.key === key);\n\n if (transformItem) {\n obj[key] = this.applyTransformation(value, transformItem);\n } else if (Array.isArray(value)) {\n obj[key] = value.map((item) =>\n typeof item === 'object' ? this.transformObjectValues(item, toTransform) : item,\n );\n } else if (typeof value === 'object') {\n obj[key] = this.transformObjectValues(value, toTransform); // Recursive call\n }\n }\n return obj;\n }\n\n /**\n * replaces the keys in the object provided\n * by replacing the current prefix with a new prefix.\n * Useful when mapping object keys to a different format or structure.\n * @param data - The data object containing key-value pairs.\n * @param currentPrefix - The prefix to be replaced in the keys.\n * @param replacementPrefix - The prefix to replace the current prefix with.\n * @returns A new object with the keys replaced.\n * @template T - The type of the form data object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public replaceKeys<T extends object>(data: T, currentPrefix: string, replacementPrefix: string): Record<string, any> {\n if (typeof data !== 'object' || data === null) {\n return {};\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const newKey = key.replace(currentPrefix, replacementPrefix);\n result[newKey] = value;\n }\n\n return result;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-services-transformation-service.mjs","sources":["../../../projects/opal-frontend-common/services/transformation-service/transformation.service.ts","../../../projects/opal-frontend-common/services/transformation-service/hmcts-opal-frontend-common-services-transformation-service.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ITransformItem } from '@hmcts/opal-frontend-common/services/transformation-service/interfaces';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransformationService {\n private readonly dateService = inject(DateService);\n\n /**\n * Applies a transformation to the given value based on the specified transformation configuration.\n *\n * @param value - The value to be transformed.\n * @param transformItem - The configuration for the transformation, including the type of transformation and any necessary format details.\n * @returns The transformed value, or the original value if no transformation is applied.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private applyTransformation(value: any, transformItem: ITransformItem): any {\n if (!value) {\n return value;\n }\n\n if (transformItem.transformType === 'date') {\n if (transformItem.dateInputFormat !== null && transformItem.dateOutputFormat !== null) {\n const parsedDate = this.dateService.getFromFormat(value, transformItem.dateInputFormat);\n if (this.dateService.isValidDate(parsedDate)) {\n return this.dateService.toFormat(parsedDate, transformItem.dateOutputFormat);\n }\n }\n return value;\n }\n\n return value;\n }\n\n /**\n * Transforms the values of an object based on a given transformation configuration.\n *\n * @param obj - The object whose values need to be transformed. It should be a non-null object.\n * @param toTransform - An array of transformation configurations, where each configuration specifies\n * the key to transform and the transformation details.\n * @returns The transformed object with values modified according to the transformation configuration.\n *\n * @remarks\n * - If the input `obj` is not an object or is null, it returns the input as is.\n * - The function recursively processes nested objects.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public transformObjectValues(obj: { [key: string]: any }, toTransform: ITransformItem[]): any {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n\n for (const [key, value] of Object.entries(obj)) {\n const transformItem = toTransform.find((item) => item.key === key);\n\n if (transformItem) {\n obj[key] = this.applyTransformation(value, transformItem);\n } else if (Array.isArray(value)) {\n obj[key] = value.map((item) =>\n typeof item === 'object' ? this.transformObjectValues(item, toTransform) : item,\n );\n } else if (typeof value === 'object') {\n obj[key] = this.transformObjectValues(value, toTransform); // Recursive call\n }\n }\n return obj;\n }\n\n /**\n * replaces the keys in the object provided\n * by replacing the current prefix with a new prefix.\n * Useful when mapping object keys to a different format or structure.\n * @param data - The data object containing key-value pairs.\n * @param currentPrefix - The prefix to be replaced in the keys.\n * @param replacementPrefix - The prefix to replace the current prefix with.\n * @returns A new object with the keys replaced.\n * @template T - The type of the form data object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public replaceKeys<T extends object>(data: T, currentPrefix: string, replacementPrefix: string): Record<string, any> {\n if (typeof data !== 'object' || data === null) {\n return {};\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const newKey = key.replace(currentPrefix, replacementPrefix);\n result[newKey] = value;\n }\n\n return result;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-services-utils-service.mjs","sources":["../../../projects/opal-frontend-common/services/utils-service/utils.service.ts","../../../projects/opal-frontend-common/services/utils-service/hmcts-opal-frontend-common-services-utils-service.ts"],"sourcesContent":["import { ViewportScroller } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UtilsService {\n private readonly viewportScroller = inject(ViewportScroller);\n\n /**\n * Converts the first letter of a string to uppercase.\n * @param str - The input string.\n * @returns The input string with the first letter capitalized.\n */\n public upperCaseFirstLetter(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n /**\n * Converts the entire string to uppercase.\n * @param str - The input string.\n * @returns The input string in uppercase.\n */\n public upperCaseAllLetters(str: string): string {\n return str.toUpperCase();\n }\n\n /**\n * Converts a number to a monetary string representation.\n * @param amount - The number to convert.\n * @returns The monetary string representation of the number.\n */\n public convertToMonetaryString(amount: number | string): string {\n if (typeof amount === 'string') {\n amount = parseFloat(amount);\n }\n return `£${amount.toFixed(2)}`;\n }\n\n /**\n * Formats a 6-digit number or string as a sort code.\n * @param value - The 6-digit value to format.\n * @returns The formatted sort code string (xx-xx-xx).\n */\n public formatSortCode(value: string | number): string {\n const sortCode = value.toString();\n return `${sortCode.slice(0, 2)}-${sortCode.slice(2, 4)}-${sortCode.slice(4, 6)}`;\n }\n\n /**\n * Filters out null or empty strings from an array of address lines.\n *\n * @param address - An array of address lines which may contain strings or null values.\n * @returns A new array containing only non-empty strings from the input array.\n */\n public formatAddress(address: (string | null)[]): string[] {\n return address.filter((line): line is string => !!line?.trim());\n }\n\n /**\n * Scrolls the viewport to the top of the page.\n * Utilizes the `viewportScroller` service to scroll to the position [0, 0].\n */\n public scrollToTop(): void {\n this.viewportScroller.scrollToPosition([0, 0]);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormValues(form: { [key: string]: any }): boolean {\n return Object.values(form).some((value) => {\n return Array.isArray(value) ? value.length > 0 : Boolean(value);\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormArrayValues(forms: { [key: string]: any }[]): boolean {\n return forms.every((form) => this.checkFormValues(form));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public getFormStatus(form: { [key: string]: any }, providedMessage: string, notProvidedMessage: string): string {\n return this.checkFormValues(form) ? providedMessage : notProvidedMessage;\n }\n\n public getArrayFormStatus(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n forms: { [key: string]: any }[],\n providedMessage: string,\n notProvidedMessage: string,\n ): string {\n return forms.every((form) => this.checkFormValues(form)) ? providedMessage : notProvidedMessage;\n }\n\n /**\n * Copies the provided string value to the clipboard.\n *\n * @param value - The string value to be copied to the clipboard.\n *\n * @remarks\n * This method uses the `navigator.clipboard.writeText` API to copy text to the clipboard.\n * Ensure that the browser supports the Clipboard API before using this method.\n */\n public copyToClipboard(value: string): Promise<void> {\n return navigator.clipboard.writeText(value);\n }\n\n /**\n * Recursively filters out properties from an object where the value is `null` or `undefined`.\n *\n * @param obj - The object to filter. Can include nested objects.\n * @returns A new object with only non-null and non-undefined values.\n *\n * @example\n * ```ts\n * const input = {\n * a: 1,\n * b: null,\n * c: undefined,\n * d: 'hello',\n * e: { x: null, y: 2 },\n * f: { z: undefined },\n * };\n * const result = filterNullOrUndefined(input);\n * console.log(result); // Output: { a: 1, d: 'hello', e: { y: 2 } }\n * ```\n */\n public filterNullOrUndefined(obj: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(obj)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .filter(([_, value]) => value !== null && value !== undefined)\n .map(([key, value]) => {\n if (typeof value === 'object' && !Array.isArray(value) && value !== null) {\n return [key, this.filterNullOrUndefined(value as Record<string, unknown>)];\n }\n return [key, value];\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-services-utils-service.mjs","sources":["../../../projects/opal-frontend-common/services/utils-service/utils.service.ts","../../../projects/opal-frontend-common/services/utils-service/hmcts-opal-frontend-common-services-utils-service.ts"],"sourcesContent":["import { ViewportScroller } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UtilsService {\n private readonly viewportScroller = inject(ViewportScroller);\n\n /**\n * Converts the first letter of a string to uppercase.\n * @param str - The input string.\n * @returns The input string with the first letter capitalized.\n */\n public upperCaseFirstLetter(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n /**\n * Converts the entire string to uppercase.\n * @param str - The input string.\n * @returns The input string in uppercase.\n */\n public upperCaseAllLetters(str: string): string {\n return str.toUpperCase();\n }\n\n /**\n * Converts a number to a monetary string representation.\n * @param amount - The number to convert.\n * @returns The monetary string representation of the number.\n */\n public convertToMonetaryString(amount: number | string): string {\n if (typeof amount === 'string') {\n amount = parseFloat(amount);\n }\n return `£${amount.toFixed(2)}`;\n }\n\n /**\n * Formats a 6-digit number or string as a sort code.\n * @param value - The 6-digit value to format.\n * @returns The formatted sort code string (xx-xx-xx).\n */\n public formatSortCode(value: string | number): string {\n const sortCode = value.toString();\n return `${sortCode.slice(0, 2)}-${sortCode.slice(2, 4)}-${sortCode.slice(4, 6)}`;\n }\n\n /**\n * Filters out null or empty strings from an array of address lines.\n *\n * @param address - An array of address lines which may contain strings or null values.\n * @returns A new array containing only non-empty strings from the input array.\n */\n public formatAddress(address: (string | null)[]): string[] {\n return address.filter((line): line is string => !!line?.trim());\n }\n\n /**\n * Scrolls the viewport to the top of the page.\n * Utilizes the `viewportScroller` service to scroll to the position [0, 0].\n */\n public scrollToTop(): void {\n this.viewportScroller.scrollToPosition([0, 0]);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormValues(form: { [key: string]: any }): boolean {\n return Object.values(form).some((value) => {\n return Array.isArray(value) ? value.length > 0 : Boolean(value);\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormArrayValues(forms: { [key: string]: any }[]): boolean {\n return forms.every((form) => this.checkFormValues(form));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public getFormStatus(form: { [key: string]: any }, providedMessage: string, notProvidedMessage: string): string {\n return this.checkFormValues(form) ? providedMessage : notProvidedMessage;\n }\n\n public getArrayFormStatus(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n forms: { [key: string]: any }[],\n providedMessage: string,\n notProvidedMessage: string,\n ): string {\n return forms.every((form) => this.checkFormValues(form)) ? providedMessage : notProvidedMessage;\n }\n\n /**\n * Copies the provided string value to the clipboard.\n *\n * @param value - The string value to be copied to the clipboard.\n *\n * @remarks\n * This method uses the `navigator.clipboard.writeText` API to copy text to the clipboard.\n * Ensure that the browser supports the Clipboard API before using this method.\n */\n public copyToClipboard(value: string): Promise<void> {\n return navigator.clipboard.writeText(value);\n }\n\n /**\n * Recursively filters out properties from an object where the value is `null` or `undefined`.\n *\n * @param obj - The object to filter. Can include nested objects.\n * @returns A new object with only non-null and non-undefined values.\n *\n * @example\n * ```ts\n * const input = {\n * a: 1,\n * b: null,\n * c: undefined,\n * d: 'hello',\n * e: { x: null, y: 2 },\n * f: { z: undefined },\n * };\n * const result = filterNullOrUndefined(input);\n * console.log(result); // Output: { a: 1, d: 'hello', e: { y: 2 } }\n * ```\n */\n public filterNullOrUndefined(obj: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(obj)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .filter(([_, value]) => value !== null && value !== undefined)\n .map(([key, value]) => {\n if (typeof value === 'object' && !Array.isArray(value) && value !== null) {\n return [key, this.filterNullOrUndefined(value as Record<string, unknown>)];\n }\n return [key, value];\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-stores-global.mjs","sources":["../../../projects/opal-frontend-common/stores/global/global.store.ts","../../../projects/opal-frontend-common/stores/global/hmcts-opal-frontend-common-stores-global.ts"],"sourcesContent":["import { patchState, signalStore, withMethods, withState } from '@ngrx/signals';\nimport { LDFlagSet } from 'launchdarkly-js-client-sdk';\nimport {\n ITransferStateLaunchDarklyConfig,\n ITransferStateAppInsightsConfig,\n} from '@hmcts/opal-frontend-common/services/transfer-state-service/interfaces';\nimport {\n ISessionTokenExpiry,\n ISessionUserState,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\nimport { IErrorState } from '@hmcts/opal-frontend-common/stores/global/interfaces';\n\nexport const GlobalStore = signalStore(\n { providedIn: 'root' },\n withState(() => ({\n authenticated: false,\n error: { error: false, message: '' },\n featureFlags: {} as LDFlagSet,\n userState: {} as ISessionUserState,\n ssoEnabled: false,\n launchDarklyConfig: {} as ITransferStateLaunchDarklyConfig,\n appInsightsConfig: {} as ITransferStateAppInsightsConfig,\n tokenExpiry: {} as ISessionTokenExpiry,\n })),\n withMethods((store) => ({\n setAuthenticated: (authenticated: boolean) => {\n patchState(store, { authenticated });\n },\n setError: (error: IErrorState) => {\n patchState(store, { error });\n },\n setFeatureFlags: (featureFlags: LDFlagSet) => {\n patchState(store, { featureFlags });\n },\n setUserState: (userState: ISessionUserState) => {\n patchState(store, { userState });\n },\n setSsoEnabled: (ssoEnabled: boolean) => {\n patchState(store, { ssoEnabled });\n },\n setLaunchDarklyConfig: (config: ITransferStateLaunchDarklyConfig) => {\n patchState(store, { launchDarklyConfig: config });\n },\n setAppInsightsConfig: (config: ITransferStateAppInsightsConfig) => {\n patchState(store, { appInsightsConfig: config });\n },\n setTokenExpiry: (tokenExpiry: ISessionTokenExpiry) => {\n patchState(store, { tokenExpiry });\n },\n })),\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAYO,MAAM,WAAW,GAAG,WAAW,CACpC,EAAE,UAAU,EAAE,MAAM,EAAE,EACtB,SAAS,CAAC,OAAO;AACf,IAAA,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;AACpC,IAAA,YAAY,EAAE,EAAe;AAC7B,IAAA,SAAS,EAAE,EAAuB;AAClC,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,kBAAkB,EAAE,EAAsC;AAC1D,IAAA,iBAAiB,EAAE,EAAqC;AACxD,IAAA,WAAW,EAAE,EAAyB;CACvC,CAAC,CAAC,EACH,WAAW,CAAC,CAAC,KAAK,MAAM;AACtB,IAAA,gBAAgB,EAAE,CAAC,aAAsB,KAAI;AAC3C,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,CAAC;KACrC;AACD,IAAA,QAAQ,EAAE,CAAC,KAAkB,KAAI;AAC/B,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC;KAC7B;AACD,IAAA,eAAe,EAAE,CAAC,YAAuB,KAAI;AAC3C,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC;KACpC;AACD,IAAA,YAAY,EAAE,CAAC,SAA4B,KAAI;AAC7C,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC;KACjC;AACD,IAAA,aAAa,EAAE,CAAC,UAAmB,KAAI;AACrC,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC;KAClC;AACD,IAAA,qBAAqB,EAAE,CAAC,MAAwC,KAAI;QAClE,UAAU,CAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC;KAClD;AACD,IAAA,oBAAoB,EAAE,CAAC,MAAuC,KAAI;QAChE,UAAU,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;KACjD;AACD,IAAA,cAAc,EAAE,CAAC,WAAgC,KAAI;AACnD,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC;KACnC;CACF,CAAC,CAAC;;ACjDL;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-stores-global.mjs","sources":["../../../projects/opal-frontend-common/stores/global/global.store.ts","../../../projects/opal-frontend-common/stores/global/hmcts-opal-frontend-common-stores-global.ts"],"sourcesContent":["import { patchState, signalStore, withMethods, withState } from '@ngrx/signals';\nimport { LDFlagSet } from 'launchdarkly-js-client-sdk';\nimport {\n ITransferStateLaunchDarklyConfig,\n ITransferStateAppInsightsConfig,\n} from '@hmcts/opal-frontend-common/services/transfer-state-service/interfaces';\nimport {\n ISessionTokenExpiry,\n ISessionUserState,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\nimport { IErrorState } from '@hmcts/opal-frontend-common/stores/global/interfaces';\n\nexport const GlobalStore = signalStore(\n { providedIn: 'root' },\n withState(() => ({\n authenticated: false,\n error: { error: false, message: '' },\n featureFlags: {} as LDFlagSet,\n userState: {} as ISessionUserState,\n ssoEnabled: false,\n launchDarklyConfig: {} as ITransferStateLaunchDarklyConfig,\n appInsightsConfig: {} as ITransferStateAppInsightsConfig,\n tokenExpiry: {} as ISessionTokenExpiry,\n })),\n withMethods((store) => ({\n setAuthenticated: (authenticated: boolean) => {\n patchState(store, { authenticated });\n },\n setError: (error: IErrorState) => {\n patchState(store, { error });\n },\n setFeatureFlags: (featureFlags: LDFlagSet) => {\n patchState(store, { featureFlags });\n },\n setUserState: (userState: ISessionUserState) => {\n patchState(store, { userState });\n },\n setSsoEnabled: (ssoEnabled: boolean) => {\n patchState(store, { ssoEnabled });\n },\n setLaunchDarklyConfig: (config: ITransferStateLaunchDarklyConfig) => {\n patchState(store, { launchDarklyConfig: config });\n },\n setAppInsightsConfig: (config: ITransferStateAppInsightsConfig) => {\n patchState(store, { appInsightsConfig: config });\n },\n setTokenExpiry: (tokenExpiry: ISessionTokenExpiry) => {\n patchState(store, { tokenExpiry });\n },\n })),\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAYO,MAAM,WAAW,GAAG,WAAW,CACpC,EAAE,UAAU,EAAE,MAAM,EAAE,EACtB,SAAS,CAAC,OAAO;AACf,IAAA,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;AACpC,IAAA,YAAY,EAAE,EAAe;AAC7B,IAAA,SAAS,EAAE,EAAuB;AAClC,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,kBAAkB,EAAE,EAAsC;AAC1D,IAAA,iBAAiB,EAAE,EAAqC;AACxD,IAAA,WAAW,EAAE,EAAyB;CACvC,CAAC,CAAC,EACH,WAAW,CAAC,CAAC,KAAK,MAAM;AACtB,IAAA,gBAAgB,EAAE,CAAC,aAAsB,KAAI;AAC3C,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,CAAC;IACtC,CAAC;AACD,IAAA,QAAQ,EAAE,CAAC,KAAkB,KAAI;AAC/B,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC;AACD,IAAA,eAAe,EAAE,CAAC,YAAuB,KAAI;AAC3C,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC;IACrC,CAAC;AACD,IAAA,YAAY,EAAE,CAAC,SAA4B,KAAI;AAC7C,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC;IAClC,CAAC;AACD,IAAA,aAAa,EAAE,CAAC,UAAmB,KAAI;AACrC,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC;IACnC,CAAC;AACD,IAAA,qBAAqB,EAAE,CAAC,MAAwC,KAAI;QAClE,UAAU,CAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IACnD,CAAC;AACD,IAAA,oBAAoB,EAAE,CAAC,MAAuC,KAAI;QAChE,UAAU,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;AACD,IAAA,cAAc,EAAE,CAAC,WAAgC,KAAI;AACnD,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC;IACpC,CAAC;CACF,CAAC,CAAC;;ACjDL;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-alphabetical-text.mjs","sources":["../../../projects/opal-frontend-common/validators/alphabetical-text/alphabetical-text.validator.ts","../../../projects/opal-frontend-common/validators/alphabetical-text/hmcts-opal-frontend-common-validators-alphabetical-text.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function alphabeticalTextValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !/^[a-zA-Z0-9'()*_., -]*$/.test(value)) {\n return { alphabeticalTextPattern: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,yBAAyB,GAAA;IACvC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACnD,OAAO,EAAE,uBAAuB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;AAEtD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACVA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-alphabetical-text.mjs","sources":["../../../projects/opal-frontend-common/validators/alphabetical-text/alphabetical-text.validator.ts","../../../projects/opal-frontend-common/validators/alphabetical-text/hmcts-opal-frontend-common-validators-alphabetical-text.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function alphabeticalTextValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !/^[a-zA-Z0-9'()*_., -]*$/.test(value)) {\n return { alphabeticalTextPattern: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,yBAAyB,GAAA;IACvC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACnD,OAAO,EAAE,uBAAuB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACtD;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACVA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-amount.mjs","sources":["../../../projects/opal-frontend-common/validators/amount/amount.validator.ts","../../../projects/opal-frontend-common/validators/amount/hmcts-opal-frontend-common-validators-amount.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function amountValidator(maxIntegers: number, maxDecimals: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n // Ensure the value is numerical, allowing only digits and optionally one decimal point\n if (isNaN(control.value)) {\n return { invalidAmountValue: true };\n }\n\n // Regex to match numbers with the specified integer and decimal places\n const regex = new RegExp(`^-?(0|[1-9]\\\\d{0,${maxIntegers - 1}})(\\\\.\\\\d{0,${maxDecimals}})?$`);\n\n return regex.test(control.value) ? null : { invalidAmount: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,eAAe,CAAC,WAAmB,EAAE,WAAmB,EAAA;IACtE,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;;;AAIb,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACxB,YAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE;;;AAIrC,QAAA,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,CAAA,iBAAA,EAAoB,WAAW,GAAG,CAAC,CAAA,YAAA,EAAe,WAAW,CAAA,IAAA,CAAM,CAAC;QAE7F,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE;AACnE,KAAC;AACH;;AClBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-amount.mjs","sources":["../../../projects/opal-frontend-common/validators/amount/amount.validator.ts","../../../projects/opal-frontend-common/validators/amount/hmcts-opal-frontend-common-validators-amount.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function amountValidator(maxIntegers: number, maxDecimals: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n // Ensure the value is numerical, allowing only digits and optionally one decimal point\n if (isNaN(control.value)) {\n return { invalidAmountValue: true };\n }\n\n // Regex to match numbers with the specified integer and decimal places\n const regex = new RegExp(`^-?(0|[1-9]\\\\d{0,${maxIntegers - 1}})(\\\\.\\\\d{0,${maxDecimals}})?$`);\n\n return regex.test(control.value) ? null : { invalidAmount: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,eAAe,CAAC,WAAmB,EAAE,WAAmB,EAAA;IACtE,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;QACb;;AAGA,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACxB,YAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE;QACrC;;AAGA,QAAA,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,CAAA,iBAAA,EAAoB,WAAW,GAAG,CAAC,CAAA,YAAA,EAAe,WAAW,CAAA,IAAA,CAAM,CAAC;QAE7F,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE;AACnE,IAAA,CAAC;AACH;;AClBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-date-after-year.mjs","sources":["../../../projects/opal-frontend-common/validators/date-after-year/date-after-year.validator.ts","../../../projects/opal-frontend-common/validators/date-after-year/hmcts-opal-frontend-common-validators-date-after-year.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateAfterYearValidator(year: number): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const yearInput = Number(control.value.split('/')[2]);\n\n if (yearInput <= year) {\n return { invalidYear: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,sBAAsB,CAAC,IAAY,EAAA;IACjD,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAErD,YAAA,IAAI,SAAS,IAAI,IAAI,EAAE;gBACrB,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;;;AAGpD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACbA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-date-after-year.mjs","sources":["../../../projects/opal-frontend-common/validators/date-after-year/date-after-year.validator.ts","../../../projects/opal-frontend-common/validators/date-after-year/hmcts-opal-frontend-common-validators-date-after-year.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateAfterYearValidator(year: number): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const yearInput = Number(control.value.split('/')[2]);\n\n if (yearInput <= year) {\n return { invalidYear: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,sBAAsB,CAAC,IAAY,EAAA;IACjD,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAErD,YAAA,IAAI,SAAS,IAAI,IAAI,EAAE;gBACrB,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;YAClD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACbA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-date-before.mjs","sources":["../../../projects/opal-frontend-common/validators/date-before/date-before.validator.ts","../../../projects/opal-frontend-common/validators/date-before/hmcts-opal-frontend-common-validators-date-before.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateBeforeValidator(targetDate: Date | null): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const inputValue = control.value;\n if (!inputValue || !targetDate) {\n return null;\n }\n\n const [day, month, year] = inputValue.split('/').map(Number);\n const inputDate = new Date(year, month - 1, day);\n\n if (inputDate < targetDate) {\n return { dateNotBefore: { value: inputValue } };\n }\n\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,UAAuB,EAAA;IACzD,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK;AAChC,QAAA,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,EAAE;AAC9B,YAAA,OAAO,IAAI;;AAGb,QAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;AAC5D,QAAA,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;AAEhD,QAAA,IAAI,SAAS,GAAG,UAAU,EAAE;YAC1B,OAAO,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;;AAGjD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;AClBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-date-before.mjs","sources":["../../../projects/opal-frontend-common/validators/date-before/date-before.validator.ts","../../../projects/opal-frontend-common/validators/date-before/hmcts-opal-frontend-common-validators-date-before.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateBeforeValidator(targetDate: Date | null): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const inputValue = control.value;\n if (!inputValue || !targetDate) {\n return null;\n }\n\n const [day, month, year] = inputValue.split('/').map(Number);\n const inputDate = new Date(year, month - 1, day);\n\n if (inputDate < targetDate) {\n return { dateNotBefore: { value: inputValue } };\n }\n\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,UAAuB,EAAA;IACzD,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK;AAChC,QAAA,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,EAAE;AAC9B,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;AAC5D,QAAA,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;AAEhD,QAAA,IAAI,SAAS,GAAG,UAAU,EAAE;YAC1B,OAAO,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;QACjD;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;AClBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-date-of-birth.mjs","sources":["../../../projects/opal-frontend-common/validators/date-of-birth/date-of-birth.validator.ts","../../../projects/opal-frontend-common/validators/date-of-birth/hmcts-opal-frontend-common-validators-date-of-birth.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateOfBirthValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n const [day, month, year] = value.split('/').map((part: string) => parseInt(part, 10));\n const date = new Date(year, month - 1, day);\n\n // Check if the date is in the past\n const today = new Date();\n // Set the time of today to the start of the day to avoid time comparison issues\n today.setHours(0, 0, 0, 0);\n\n if (date >= today) {\n return { invalidDateOfBirth: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,oBAAoB,GAAA;IAClC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;AACT,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,KAAK,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACrF,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;;AAG3C,YAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;;YAExB,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1B,YAAA,IAAI,IAAI,IAAI,KAAK,EAAE;gBACjB,OAAO,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;;AAGnD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACpBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-date-of-birth.mjs","sources":["../../../projects/opal-frontend-common/validators/date-of-birth/date-of-birth.validator.ts","../../../projects/opal-frontend-common/validators/date-of-birth/hmcts-opal-frontend-common-validators-date-of-birth.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateOfBirthValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n const [day, month, year] = value.split('/').map((part: string) => parseInt(part, 10));\n const date = new Date(year, month - 1, day);\n\n // Check if the date is in the past\n const today = new Date();\n // Set the time of today to the start of the day to avoid time comparison issues\n today.setHours(0, 0, 0, 0);\n\n if (date >= today) {\n return { invalidDateOfBirth: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,oBAAoB,GAAA;IAClC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;AACT,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,KAAK,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACrF,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;;AAG3C,YAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;;YAExB,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1B,YAAA,IAAI,IAAI,IAAI,KAAK,EAAE;gBACjB,OAAO,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACjD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACpBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-driving-licence-number.mjs","sources":["../../../projects/opal-frontend-common/validators/driving-licence-number/driving-licence-number.validator.ts","../../../projects/opal-frontend-common/validators/driving-licence-number/hmcts-opal-frontend-common-validators-driving-licence-number.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\n/**\n * Validator function to check if the input value is in a valid driving licence number.\n * @returns A validator function that checks if the input value is a valid driving licence number.\n * The valid format is: 5 letters, 6 digits, 2 letters, and 3 alphanumeric characters.\n * Example: ABCDE123456FGH123\n * If the value does not match this format, it returns an error object; otherwise, it returns null.\n */\nexport function drivingLicenceNumberValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !value.match(/^[A-Za-z]{5}\\d{6}[A-Za-z]{2}[A-Za-z0-9]{3}$/)) {\n return { invalidDrivingLicenceNumber: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;;;;AAMG;SACa,6BAA6B,GAAA;IAC3C,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,6CAA6C,CAAC,EAAE;YACxE,OAAO,EAAE,2BAA2B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;AAE1D,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-driving-licence-number.mjs","sources":["../../../projects/opal-frontend-common/validators/driving-licence-number/driving-licence-number.validator.ts","../../../projects/opal-frontend-common/validators/driving-licence-number/hmcts-opal-frontend-common-validators-driving-licence-number.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\n/**\n * Validator function to check if the input value is in a valid driving licence number.\n * @returns A validator function that checks if the input value is a valid driving licence number.\n * The valid format is: 5 letters, 6 digits, 2 letters, and 3 alphanumeric characters.\n * Example: ABCDE123456FGH123\n * If the value does not match this format, it returns an error object; otherwise, it returns null.\n */\nexport function drivingLicenceNumberValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !value.match(/^[A-Za-z]{5}\\d{6}[A-Za-z]{2}[A-Za-z0-9]{3}$/)) {\n return { invalidDrivingLicenceNumber: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;;;;AAMG;SACa,6BAA6B,GAAA;IAC3C,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,6CAA6C,CAAC,EAAE;YACxE,OAAO,EAAE,2BAA2B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAC1D;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACjBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-future-date.mjs","sources":["../../../projects/opal-frontend-common/validators/future-date/future-date.validator.ts","../../../projects/opal-frontend-common/validators/future-date/hmcts-opal-frontend-common-validators-future-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function futureDateValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const [day, month, year] = control.value.split('/');\n const date = new Date(Date.parse(`${month}/${day}/${year}`));\n\n // Check if the date is in the future\n const today = new Date();\n\n if (date >= today) {\n return { invalidFutureDate: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,mBAAmB,GAAA;IACjC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACnD,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,EAAG,KAAK,IAAI,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC,CAAC;;AAG5D,YAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AAExB,YAAA,IAAI,IAAI,IAAI,KAAK,EAAE;gBACjB,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;;;AAG1D,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-future-date.mjs","sources":["../../../projects/opal-frontend-common/validators/future-date/future-date.validator.ts","../../../projects/opal-frontend-common/validators/future-date/hmcts-opal-frontend-common-validators-future-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function futureDateValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const [day, month, year] = control.value.split('/');\n const date = new Date(Date.parse(`${month}/${day}/${year}`));\n\n // Check if the date is in the future\n const today = new Date();\n\n if (date >= today) {\n return { invalidFutureDate: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,mBAAmB,GAAA;IACjC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACnD,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,EAAG,KAAK,IAAI,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC,CAAC;;AAG5D,YAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AAExB,YAAA,IAAI,IAAI,IAAI,KAAK,EAAE;gBACjB,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;YACxD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACjBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-invalid-value.mjs","sources":["../../../projects/opal-frontend-common/validators/invalid-value/invalid-value.validator.ts","../../../projects/opal-frontend-common/validators/invalid-value/hmcts-opal-frontend-common-validators-invalid-value.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function invalidValueValidator(invalidValues: string[]): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n return invalidValues.some((value) => value === control.value) ? { valueInArray: true } : null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,qBAAqB,CAAC,aAAuB,EAAA;IAC3D,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;;QAGb,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI;AAC/F,KAAC;AACH;;ACVA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-invalid-value.mjs","sources":["../../../projects/opal-frontend-common/validators/invalid-value/invalid-value.validator.ts","../../../projects/opal-frontend-common/validators/invalid-value/hmcts-opal-frontend-common-validators-invalid-value.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function invalidValueValidator(invalidValues: string[]): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n return invalidValues.some((value) => value === control.value) ? { valueInArray: true } : null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,qBAAqB,CAAC,aAAuB,EAAA;IAC3D,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;QACb;QAEA,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI;AAC/F,IAAA,CAAC;AACH;;ACVA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-national-insurance-number.mjs","sources":["../../../projects/opal-frontend-common/validators/national-insurance-number/national-insurance-number.validator.ts","../../../projects/opal-frontend-common/validators/national-insurance-number/hmcts-opal-frontend-common-validators-national-insurance-number.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function nationalInsuranceNumberValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n // Remove all spaces and convert to uppercase for uniformity\n const cleanedValue = value.replace(/\\s+/g, '').toUpperCase();\n\n // Check if the cleaned value has exactly 9 characters and matches the National Insurance number format\n const ninoRegex = /^[A-Z]{2}\\d{6}[A-D]$/;\n if (cleanedValue.length !== 9 || !ninoRegex.test(cleanedValue)) {\n return { nationalInsuranceNumberPattern: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,gCAAgC,GAAA;IAC9C,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;;AAET,YAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;;YAG5D,MAAM,SAAS,GAAG,sBAAsB;AACxC,YAAA,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;gBAC9D,OAAO,EAAE,8BAA8B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;;AAG/D,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-national-insurance-number.mjs","sources":["../../../projects/opal-frontend-common/validators/national-insurance-number/national-insurance-number.validator.ts","../../../projects/opal-frontend-common/validators/national-insurance-number/hmcts-opal-frontend-common-validators-national-insurance-number.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function nationalInsuranceNumberValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n // Remove all spaces and convert to uppercase for uniformity\n const cleanedValue = value.replace(/\\s+/g, '').toUpperCase();\n\n // Check if the cleaned value has exactly 9 characters and matches the National Insurance number format\n const ninoRegex = /^[A-Z]{2}\\d{6}[A-D]$/;\n if (cleanedValue.length !== 9 || !ninoRegex.test(cleanedValue)) {\n return { nationalInsuranceNumberPattern: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,gCAAgC,GAAA;IAC9C,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;;AAET,YAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;;YAG5D,MAAM,SAAS,GAAG,sBAAsB;AACxC,YAAA,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;gBAC9D,OAAO,EAAE,8BAA8B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC7D;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACjBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-numerical-only.mjs","sources":["../../../projects/opal-frontend-common/validators/numerical-only/numerical-only.validator.ts","../../../projects/opal-frontend-common/validators/numerical-only/hmcts-opal-frontend-common-validators-numerical-only.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function numericalTextValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !/^\\d*$/.test(value)) {\n return { numericalTextPattern: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,sBAAsB,GAAA;IACpC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACjC,OAAO,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;AAEnD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACVA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-numerical-only.mjs","sources":["../../../projects/opal-frontend-common/validators/numerical-only/numerical-only.validator.ts","../../../projects/opal-frontend-common/validators/numerical-only/hmcts-opal-frontend-common-validators-numerical-only.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function numericalTextValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !/^\\d*$/.test(value)) {\n return { numericalTextPattern: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,sBAAsB,GAAA;IACpC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACjC,OAAO,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACnD;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACVA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-max-length.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-max-length/optional-max-length.validator.ts","../../../projects/opal-frontend-common/validators/optional-max-length/hmcts-opal-frontend-common-validators-optional-max-length.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl, Validators } from '@angular/forms';\n\nexport function optionalMaxLengthValidator(maxLength: number): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n return Validators.maxLength(maxLength)(control);\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEM,SAAU,0BAA0B,CAAC,SAAiB,EAAA;IAC1D,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,OAAO,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;;AAEjD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACTA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-max-length.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-max-length/optional-max-length.validator.ts","../../../projects/opal-frontend-common/validators/optional-max-length/hmcts-opal-frontend-common-validators-optional-max-length.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl, Validators } from '@angular/forms';\n\nexport function optionalMaxLengthValidator(maxLength: number): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n return Validators.maxLength(maxLength)(control);\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEM,SAAU,0BAA0B,CAAC,SAAiB,EAAA;IAC1D,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,OAAO,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;QACjD;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACTA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-date.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-date/optional-valid-date.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-date/hmcts-opal-frontend-common-validators-optional-valid-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalValidDateValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n // Check if the value matches the format dd/MM/yyyy\n const dateRegex = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/;\n const match = value.match(dateRegex);\n\n if (!match) {\n return { invalidDateFormat: { value: value } };\n }\n\n const [, day, month, year] = match;\n\n // Check if the date is valid\n const date = new Date(`${year}-${month}-${day}`);\n if (\n date.getDate() !== parseInt(day, 10) ||\n date.getMonth() + 1 !== parseInt(month, 10) ||\n date.getFullYear() !== parseInt(year, 10)\n ) {\n return { invalidDate: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,0BAA0B,GAAA;IACxC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;;YAET,MAAM,SAAS,GAAG,6BAA6B;YAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;YAEpC,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;YAGhD,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK;;AAGlC,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE,CAAC;YAChD,IACE,IAAI,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;gBACpC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC3C,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,EACzC;gBACA,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;;AAG5C,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;AC5BA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-date.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-date/optional-valid-date.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-date/hmcts-opal-frontend-common-validators-optional-valid-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalValidDateValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n // Check if the value matches the format dd/MM/yyyy\n const dateRegex = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/;\n const match = value.match(dateRegex);\n\n if (!match) {\n return { invalidDateFormat: { value: value } };\n }\n\n const [, day, month, year] = match;\n\n // Check if the date is valid\n const date = new Date(`${year}-${month}-${day}`);\n if (\n date.getDate() !== parseInt(day, 10) ||\n date.getMonth() + 1 !== parseInt(month, 10) ||\n date.getFullYear() !== parseInt(year, 10)\n ) {\n return { invalidDate: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,0BAA0B,GAAA;IACxC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;;YAET,MAAM,SAAS,GAAG,6BAA6B;YAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;YAEpC,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAChD;YAEA,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK;;AAGlC,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE,CAAC;YAChD,IACE,IAAI,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;gBACpC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC3C,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,EACzC;gBACA,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC1C;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;AC5BA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-email-address.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-email-address/optional-valid-email-address.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-email-address/hmcts-opal-frontend-common-validators-optional-valid-email-address.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalEmailAddressValidator(): ValidatorFn {\n const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const valid = emailPattern.test(control.value);\n return valid ? null : { emailPattern: { value: control.value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,6BAA6B,GAAA;IAC3C,MAAM,YAAY,GAAG,kDAAkD;IACvE,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AAC9C,YAAA,OAAO,KAAK,GAAG,IAAI,GAAG,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;;AAElE,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACXA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-email-address.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-email-address/optional-valid-email-address.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-email-address/hmcts-opal-frontend-common-validators-optional-valid-email-address.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalEmailAddressValidator(): ValidatorFn {\n const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const valid = emailPattern.test(control.value);\n return valid ? null : { emailPattern: { value: control.value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,6BAA6B,GAAA;IAC3C,MAAM,YAAY,GAAG,kDAAkD;IACvE,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AAC9C,YAAA,OAAO,KAAK,GAAG,IAAI,GAAG,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;QAClE;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACXA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-telephone.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-telephone/optional-valid-telephone.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-telephone/hmcts-opal-frontend-common-validators-optional-valid-telephone.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalPhoneNumberValidator(): ValidatorFn {\n const numericPattern = /^[\\d\\s]*$/;\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const valueWithoutSpaces = control.value.replace(/\\s+/g, '');\n const isValidPattern = numericPattern.test(control.value);\n const isValidLength = valueWithoutSpaces.length === 11;\n const valid = isValidPattern && isValidLength;\n return valid ? null : { phoneNumberPattern: { value: control.value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,4BAA4B,GAAA;IAC1C,MAAM,cAAc,GAAG,WAAW;IAClC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAC5D,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACzD,YAAA,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,KAAK,EAAE;AACtD,YAAA,MAAM,KAAK,GAAG,cAAc,IAAI,aAAa;AAC7C,YAAA,OAAO,KAAK,GAAG,IAAI,GAAG,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;;AAExE,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACdA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-telephone.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-telephone/optional-valid-telephone.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-telephone/hmcts-opal-frontend-common-validators-optional-valid-telephone.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalPhoneNumberValidator(): ValidatorFn {\n const numericPattern = /^[\\d\\s]*$/;\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const valueWithoutSpaces = control.value.replace(/\\s+/g, '');\n const isValidPattern = numericPattern.test(control.value);\n const isValidLength = valueWithoutSpaces.length === 11;\n const valid = isValidPattern && isValidLength;\n return valid ? null : { phoneNumberPattern: { value: control.value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,4BAA4B,GAAA;IAC1C,MAAM,cAAc,GAAG,WAAW;IAClC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAC5D,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACzD,YAAA,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,KAAK,EAAE;AACtD,YAAA,MAAM,KAAK,GAAG,cAAc,IAAI,aAAa;AAC7C,YAAA,OAAO,KAAK,GAAG,IAAI,GAAG,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;QACxE;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACdA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-over-eighteen.mjs","sources":["../../../projects/opal-frontend-common/validators/over-eighteen/over-eighteen.validator.ts","../../../projects/opal-frontend-common/validators/over-eighteen/hmcts-opal-frontend-common-validators-over-eighteen.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n/**\n * Validates whether a date, constructed from provided form controls for day, month and year\n * is at least 18 years in the past.\n *\n * @param dayControl - Name of the control for the day portion of the date\n * @param monthControl - Name of the control for the month portion of the date\n * @param yearControl - Name of the control for the year portion of the date\n * @param dateService - An instance of DateService\n * @returns Validator function that returns null if the date is valid and the age is 18 years older,\n * or an error object within { underEighteen: true } if under 18.\n */\nexport const overEighteenValidator = (\n dayControl: string,\n monthControl: string,\n yearControl: string,\n dateService: DateService,\n): ValidatorFn => {\n return (group: AbstractControl): ValidationErrors | null => {\n const day = group.get(dayControl);\n const month = group.get(monthControl);\n const year = group.get(yearControl);\n\n // Return if controls are not defined or values are not provided\n if (!day || !month || !year || !day.value || !month.value || !year.value) {\n return null;\n }\n\n // Format day and month to ensure two digits\n const formattedDay = day.value.toString().padStart(2, '0');\n const formattedMonth = month.value.toString().padStart(2, '0');\n const formattedYear = year.value.toString();\n\n // Create the date string in the format dd/MM/yyyy\n const dateValue = `${formattedDay}/${formattedMonth}/${formattedYear}`;\n const inputDate = dateService.getFromFormat(dateValue, 'dd/MM/yyyy');\n\n if (inputDate.isValid) {\n // Verify if the entered date is at least 18 years in the past\n const underEighteen = inputDate.diffNow('years').years > -18;\n\n if (underEighteen) {\n year.setErrors({ underEighteen: true });\n return { underEighteen: true };\n } else {\n year.setErrors(null);\n return null;\n }\n } else {\n return null;\n }\n };\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAGA;;;;;;;;;;AAUG;AACI,MAAM,qBAAqB,GAAG,CACnC,UAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,WAAwB,KACT;IACf,OAAO,CAAC,KAAsB,KAA6B;QACzD,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;QACjC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;;QAGnC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACxE,YAAA,OAAO,IAAI;;;AAIb,QAAA,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC1D,QAAA,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;QAC9D,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;;QAG3C,MAAM,SAAS,GAAG,CAAA,EAAG,YAAY,IAAI,cAAc,CAAA,CAAA,EAAI,aAAa,CAAA,CAAE;QACtE,MAAM,SAAS,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,CAAC;AAEpE,QAAA,IAAI,SAAS,CAAC,OAAO,EAAE;;AAErB,YAAA,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE;YAE5D,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACvC,gBAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE;;iBACzB;AACL,gBAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AACpB,gBAAA,OAAO,IAAI;;;aAER;AACL,YAAA,OAAO,IAAI;;AAEf,KAAC;AACH;;ACtDA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-over-eighteen.mjs","sources":["../../../projects/opal-frontend-common/validators/over-eighteen/over-eighteen.validator.ts","../../../projects/opal-frontend-common/validators/over-eighteen/hmcts-opal-frontend-common-validators-over-eighteen.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n/**\n * Validates whether a date, constructed from provided form controls for day, month and year\n * is at least 18 years in the past.\n *\n * @param dayControl - Name of the control for the day portion of the date\n * @param monthControl - Name of the control for the month portion of the date\n * @param yearControl - Name of the control for the year portion of the date\n * @param dateService - An instance of DateService\n * @returns Validator function that returns null if the date is valid and the age is 18 years older,\n * or an error object within { underEighteen: true } if under 18.\n */\nexport const overEighteenValidator = (\n dayControl: string,\n monthControl: string,\n yearControl: string,\n dateService: DateService,\n): ValidatorFn => {\n return (group: AbstractControl): ValidationErrors | null => {\n const day = group.get(dayControl);\n const month = group.get(monthControl);\n const year = group.get(yearControl);\n\n // Return if controls are not defined or values are not provided\n if (!day || !month || !year || !day.value || !month.value || !year.value) {\n return null;\n }\n\n // Format day and month to ensure two digits\n const formattedDay = day.value.toString().padStart(2, '0');\n const formattedMonth = month.value.toString().padStart(2, '0');\n const formattedYear = year.value.toString();\n\n // Create the date string in the format dd/MM/yyyy\n const dateValue = `${formattedDay}/${formattedMonth}/${formattedYear}`;\n const inputDate = dateService.getFromFormat(dateValue, 'dd/MM/yyyy');\n\n if (inputDate.isValid) {\n // Verify if the entered date is at least 18 years in the past\n const underEighteen = inputDate.diffNow('years').years > -18;\n\n if (underEighteen) {\n year.setErrors({ underEighteen: true });\n return { underEighteen: true };\n } else {\n year.setErrors(null);\n return null;\n }\n } else {\n return null;\n }\n };\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAGA;;;;;;;;;;AAUG;AACI,MAAM,qBAAqB,GAAG,CACnC,UAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,WAAwB,KACT;IACf,OAAO,CAAC,KAAsB,KAA6B;QACzD,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;QACjC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;;QAGnC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACxE,YAAA,OAAO,IAAI;QACb;;AAGA,QAAA,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC1D,QAAA,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;QAC9D,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;;QAG3C,MAAM,SAAS,GAAG,CAAA,EAAG,YAAY,IAAI,cAAc,CAAA,CAAA,EAAI,aAAa,CAAA,CAAE;QACtE,MAAM,SAAS,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,CAAC;AAEpE,QAAA,IAAI,SAAS,CAAC,OAAO,EAAE;;AAErB,YAAA,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE;YAE5D,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACvC,gBAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE;YAChC;iBAAO;AACL,gBAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AACpB,gBAAA,OAAO,IAAI;YACb;QACF;aAAO;AACL,YAAA,OAAO,IAAI;QACb;AACF,IAAA,CAAC;AACH;;ACtDA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-past-date.mjs","sources":["../../../projects/opal-frontend-common/validators/past-date/past-date.validator.ts","../../../projects/opal-frontend-common/validators/past-date/hmcts-opal-frontend-common-validators-past-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function pastDateValidator(): ValidatorFn {\n const today = new Date();\n today.setHours(0, 0, 0, 0); // Set time to start of the day to avoid time comparison issues\n\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const [day, month, year] = control.value.split('/');\n const date = new Date(Date.parse(`${month}/${day}/${year}`));\n\n // Check if the date is in the past\n if (date < today) {\n return { invalidPastDate: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,iBAAiB,GAAA;AAC/B,IAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AACxB,IAAA,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3B,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACnD,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,EAAG,KAAK,IAAI,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC,CAAC;;AAG5D,YAAA,IAAI,IAAI,GAAG,KAAK,EAAE;gBAChB,OAAO,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;;;AAGxD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;AClBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-past-date.mjs","sources":["../../../projects/opal-frontend-common/validators/past-date/past-date.validator.ts","../../../projects/opal-frontend-common/validators/past-date/hmcts-opal-frontend-common-validators-past-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function pastDateValidator(): ValidatorFn {\n const today = new Date();\n today.setHours(0, 0, 0, 0); // Set time to start of the day to avoid time comparison issues\n\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const [day, month, year] = control.value.split('/');\n const date = new Date(Date.parse(`${month}/${day}/${year}`));\n\n // Check if the date is in the past\n if (date < today) {\n return { invalidPastDate: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,iBAAiB,GAAA;AAC/B,IAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AACxB,IAAA,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3B,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACnD,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,EAAG,KAAK,IAAI,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC,CAAC;;AAG5D,YAAA,IAAI,IAAI,GAAG,KAAK,EAAE;gBAChB,OAAO,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;YACtD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;AClBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-pattern-validator.mjs","sources":["../../../projects/opal-frontend-common/validators/pattern-validator/pattern.validator.ts","../../../projects/opal-frontend-common/validators/pattern-validator/hmcts-opal-frontend-common-validators-pattern-validator.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * Returns a validator function that tests a form control's value against a given regular expression.\n * If the value does not match the pattern, it returns a validation error with the provided error key.\n * Returns null for empty or valid values.\n *\n * @param pattern - The regular expression to test the control's value against.\n * @param errorKey - The key to use in the returned validation error object (defaults to 'patternInvalid').\n * @returns A ValidatorFn that returns a validation error object or null.\n */\nexport function patternValidator(pattern: RegExp, errorKey: string = 'patternInvalid'): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) {\n return null;\n }\n\n return pattern.test(control.value)\n ? null\n : {\n [errorKey]: true,\n };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;;;;;;AAQG;SACa,gBAAgB,CAAC,OAAe,EAAE,WAAmB,gBAAgB,EAAA;IACnF,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAClB,YAAA,OAAO,IAAI;;AAGb,QAAA,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;AAC/B,cAAE;AACF,cAAE;gBACE,CAAC,QAAQ,GAAG,IAAI;aACjB;AACP,KAAC;AACH;;ACvBA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-pattern-validator.mjs","sources":["../../../projects/opal-frontend-common/validators/pattern-validator/pattern.validator.ts","../../../projects/opal-frontend-common/validators/pattern-validator/hmcts-opal-frontend-common-validators-pattern-validator.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * Returns a validator function that tests a form control's value against a given regular expression.\n * If the value does not match the pattern, it returns a validation error with the provided error key.\n * Returns null for empty or valid values.\n *\n * @param pattern - The regular expression to test the control's value against.\n * @param errorKey - The key to use in the returned validation error object (defaults to 'patternInvalid').\n * @returns A ValidatorFn that returns a validation error object or null.\n */\nexport function patternValidator(pattern: RegExp, errorKey: string = 'patternInvalid'): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) {\n return null;\n }\n\n return pattern.test(control.value)\n ? null\n : {\n [errorKey]: true,\n };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;;;;;;AAQG;SACa,gBAAgB,CAAC,OAAe,EAAE,WAAmB,gBAAgB,EAAA;IACnF,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAClB,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;AAC/B,cAAE;AACF,cAAE;gBACE,CAAC,QAAQ,GAAG,IAAI;aACjB;AACP,IAAA,CAAC;AACH;;ACvBA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-special-characters.mjs","sources":["../../../projects/opal-frontend-common/validators/special-characters/special-characters.validator.ts","../../../projects/opal-frontend-common/validators/special-characters/hmcts-opal-frontend-common-validators-special-characters.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function specialCharactersValidator(): ValidatorFn {\n const specialCharactersPattern = /\\*/;\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const hasSpecialCharacters = specialCharactersPattern.test(control.value);\n return hasSpecialCharacters ? { specialCharactersPattern: { value: control.value } } : null;\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,0BAA0B,GAAA;IACxC,MAAM,wBAAwB,GAAG,IAAI;IACrC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACzE,YAAA,OAAO,oBAAoB,GAAG,EAAE,wBAAwB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI;;AAE7F,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACXA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-special-characters.mjs","sources":["../../../projects/opal-frontend-common/validators/special-characters/special-characters.validator.ts","../../../projects/opal-frontend-common/validators/special-characters/hmcts-opal-frontend-common-validators-special-characters.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function specialCharactersValidator(): ValidatorFn {\n const specialCharactersPattern = /\\*/;\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const hasSpecialCharacters = specialCharactersPattern.test(control.value);\n return hasSpecialCharacters ? { specialCharactersPattern: { value: control.value } } : null;\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,0BAA0B,GAAA;IACxC,MAAM,wBAAwB,GAAG,IAAI;IACrC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACzE,YAAA,OAAO,oBAAoB,GAAG,EAAE,wBAAwB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI;QAC7F;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACXA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-time-format.mjs","sources":["../../../projects/opal-frontend-common/validators/time-format/time-format.validator.ts","../../../projects/opal-frontend-common/validators/time-format/hmcts-opal-frontend-common-validators-time-format.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\n/**\n * * Validator function to check if the input value is in a valid time format (HH:mm).\n * * @returns A validator function that returns an error object if the value is not in the valid time format, or null if it is valid.\n */\nexport function timeFormatValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !value.match(/^([01]\\d|2[0-3]):[0-5]\\d$/)) {\n return { invalidTimeFormat: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;AAGG;SACa,mBAAmB,GAAA;IACjC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,EAAE;YACtD,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;;AAEhD,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;ACdA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-time-format.mjs","sources":["../../../projects/opal-frontend-common/validators/time-format/time-format.validator.ts","../../../projects/opal-frontend-common/validators/time-format/hmcts-opal-frontend-common-validators-time-format.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\n/**\n * * Validator function to check if the input value is in a valid time format (HH:mm).\n * * @returns A validator function that returns an error object if the value is not in the valid time format, or null if it is valid.\n */\nexport function timeFormatValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value && !value.match(/^([01]\\d|2[0-3]):[0-5]\\d$/)) {\n return { invalidTimeFormat: { value: value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;AAGG;SACa,mBAAmB,GAAA;IACjC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,EAAE;YACtD,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAChD;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACdA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-two-decimal-places.mjs","sources":["../../../projects/opal-frontend-common/validators/two-decimal-places/two-decimal-places.validator.ts","../../../projects/opal-frontend-common/validators/two-decimal-places/hmcts-opal-frontend-common-validators-two-decimal-places.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function twoDecimalPlacesValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const value = control.value;\n\n if (!value) {\n return null; // No validation if empty\n }\n\n // Check if the value is a valid number with up to 2 decimal places\n const decimalRegex = /^\\d+(\\.\\d{0,2})?$/;\n\n return decimalRegex.test(value) ? null : { invalidDecimal: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,yBAAyB,GAAA;IACvC,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAE3B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;;;QAId,MAAM,YAAY,GAAG,mBAAmB;AAExC,QAAA,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE;AACnE,KAAC;AACH;;ACfA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-two-decimal-places.mjs","sources":["../../../projects/opal-frontend-common/validators/two-decimal-places/two-decimal-places.validator.ts","../../../projects/opal-frontend-common/validators/two-decimal-places/hmcts-opal-frontend-common-validators-two-decimal-places.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function twoDecimalPlacesValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const value = control.value;\n\n if (!value) {\n return null; // No validation if empty\n }\n\n // Check if the value is a valid number with up to 2 decimal places\n const decimalRegex = /^\\d+(\\.\\d{0,2})?$/;\n\n return decimalRegex.test(value) ? null : { invalidDecimal: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,yBAAyB,GAAA;IACvC,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAE3B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;QACd;;QAGA,MAAM,YAAY,GAAG,mBAAmB;AAExC,QAAA,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE;AACnE,IAAA,CAAC;AACH;;ACfA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-validators-valid-value.mjs","sources":["../../../projects/opal-frontend-common/validators/valid-value/valid-value.validator.ts","../../../projects/opal-frontend-common/validators/valid-value/hmcts-opal-frontend-common-validators-valid-value.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function validValueValidator(validValues: string[]): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n return validValues.some((value) => value === control.value) ? null : { valueNotInArray: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,WAAqB,EAAA;IACvD,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;;QAGb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE;AAChG,KAAC;AACH;;ACVA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-validators-valid-value.mjs","sources":["../../../projects/opal-frontend-common/validators/valid-value/valid-value.validator.ts","../../../projects/opal-frontend-common/validators/valid-value/hmcts-opal-frontend-common-validators-valid-value.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function validValueValidator(validValues: string[]): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n return validValues.some((value) => value === control.value) ? null : { valueNotInArray: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,WAAqB,EAAA;IACvD,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;QACb;QAEA,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE;AAChG,IAAA,CAAC;AACH;;ACVA;;AAEG;;;;"}