@medipass/utils 11.79.2-chore-environment-variables.0 → 11.79.2-chore-environment-variables.1

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 (96) hide show
  1. package/abn.js +87 -0
  2. package/billable-items-f8291b1e.js +27 -0
  3. package/build-validation-schema.js +1284 -0
  4. package/businesses-2633ab9b.js +53 -0
  5. package/chart.js +50 -0
  6. package/claim-payment-status-formatted.js +12 -0
  7. package/claim-payment-status-icons.js +10 -0
  8. package/claim-payment-status-text-classes.js +10 -0
  9. package/constants.js +443 -0
  10. package/countries.js +1011 -0
  11. package/datetime.js +36 -0
  12. package/document-types-formatted.js +13 -0
  13. package/document-types-icons.js +10 -0
  14. package/document-types-text-classes.js +10 -0
  15. package/documents/workflow-state-formatted-text-classes.js +12 -0
  16. package/documents/workflow-state-formatted.js +15 -0
  17. package/documents/workflow-state-icons.js +10 -0
  18. package/env.d.ts +0 -1
  19. package/env.js +40 -0
  20. package/form-applications/assign-values-to-sections.js +33 -0
  21. package/forms-e1c51a53.js +51 -0
  22. package/funders.js +110 -0
  23. package/get-env.js +189 -0
  24. package/get-select-options.js +66 -0
  25. package/get-staff-type-display-name.js +13 -0
  26. package/google-addresses.js +132 -0
  27. package/health-fund-accounts-88eac93c.js +20 -0
  28. package/health-fund-settings-e7a0f2ec.js +22 -0
  29. package/health-funds-7fea63a0.js +194 -0
  30. package/i18n/index.js +57 -0
  31. package/i18n/translations.js +36 -0
  32. package/index.js +58 -0
  33. package/intercom.js +110 -0
  34. package/members-8eb8d8d0.js +53 -0
  35. package/modalities-2dfbea63.js +19 -0
  36. package/package.json +2 -2
  37. package/parse-health-fund-card-fields.js +16 -0
  38. package/patients-dd3709c1.js +46 -0
  39. package/payment-methods-d36bc018.js +26 -0
  40. package/payment-options.js +63 -0
  41. package/practices-d6c480f1.js +87 -0
  42. package/products-0a392564.js +83 -0
  43. package/products.js +30 -0
  44. package/professional-categories-157d1767.js +19 -0
  45. package/redux-actions.js +172 -0
  46. package/redux-reducer.js +116 -0
  47. package/sanitise-url.js +19 -0
  48. package/scroll.js +14 -0
  49. package/sensitive-keys.js +9 -0
  50. package/sentry.js +110 -0
  51. package/service-items.js +208 -0
  52. package/services-f8480eba.js +127 -0
  53. package/specialties-25fbb171.js +20 -0
  54. package/staff-646053b7.js +161 -0
  55. package/status-icons.js +10 -0
  56. package/status-text-classes.js +10 -0
  57. package/subscriptions-aef302aa.js +160 -0
  58. package/test-framework/fixtures/accounts.js +34 -0
  59. package/test-framework/fixtures/billable-items.js +9 -0
  60. package/test-framework/fixtures/businesses.js +9 -0
  61. package/test-framework/fixtures/documents.js +118 -0
  62. package/test-framework/fixtures/form-application-templates.js +74 -0
  63. package/test-framework/fixtures/form-applications.js +39 -0
  64. package/test-framework/fixtures/forms.js +9 -0
  65. package/test-framework/fixtures/health-fund-accounts.js +9 -0
  66. package/test-framework/fixtures/health-fund-settings.js +9 -0
  67. package/test-framework/fixtures/health-funds.js +10 -0
  68. package/test-framework/fixtures/index.js +45 -0
  69. package/test-framework/fixtures/members.js +9 -0
  70. package/test-framework/fixtures/message-mappings.js +61 -0
  71. package/test-framework/fixtures/modalities.js +9 -0
  72. package/test-framework/fixtures/patients.js +9 -0
  73. package/test-framework/fixtures/payment-methods.js +9 -0
  74. package/test-framework/fixtures/practices.js +11 -0
  75. package/test-framework/fixtures/products.js +10 -0
  76. package/test-framework/fixtures/professional-categories.js +9 -0
  77. package/test-framework/fixtures/services.js +11 -0
  78. package/test-framework/fixtures/specialties.js +9 -0
  79. package/test-framework/fixtures/staff.js +12 -0
  80. package/test-framework/fixtures/subscriptions.js +13 -0
  81. package/test-framework/fixtures/transaction-reports.js +241 -0
  82. package/test-framework/fixtures/transactions.js +21 -0
  83. package/test-framework/fixtures/workflow-exceptions.js +32 -0
  84. package/test-framework/react.js +37 -0
  85. package/transaction-details-by-funder.js +80 -0
  86. package/transaction-status-formatted.js +13 -0
  87. package/transaction-status-helpers.js +72 -0
  88. package/transaction-status-icons.js +10 -0
  89. package/transaction-status-text-classes.js +10 -0
  90. package/transaction-status.js +35 -0
  91. package/transactions-de03f65c.js +1757 -0
  92. package/validate-form.js +421 -0
  93. package/validate.js +63 -0
  94. package/webpack-config.js +29 -0
  95. package/workflow-state-formatted-text-classes.js +12 -0
  96. package/workflow-state-formatted.js +13 -0
package/abn.js ADDED
@@ -0,0 +1,87 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ABN_LENGTH = 11;
6
+ var ACN_LENGTH = 9;
7
+ var normaliseAbn = function normaliseAbn(abn) {
8
+ var trimmedABN = abn == null ? void 0 : abn.replace(/\s/g, '');
9
+
10
+ // The input is an ABN, in which case the format should be 99 999 999 999
11
+ if (trimmedABN.length === ABN_LENGTH) {
12
+ return trimmedABN.substring(0, 2) + ' ' + trimmedABN.substring(2, 5) + ' ' + trimmedABN.substring(5, 8) + ' ' + trimmedABN.substring(8);
13
+ }
14
+
15
+ //The input is an ACN, in which case the format should be 999 999 999
16
+ if (trimmedABN.length === ACN_LENGTH) {
17
+ return trimmedABN.substring(0, 3) + ' ' + trimmedABN.substring(3, 6) + ' ' + trimmedABN.substring(6);
18
+ }
19
+ return abn;
20
+ };
21
+ var isValidAbn = function isValidAbn(abn) {
22
+ var VALID_ABN_LENGTH = 11;
23
+
24
+ // strip whitespace from value
25
+ abn = String(abn).replace(/\s+/g, '');
26
+ if (abn.length === VALID_ABN_LENGTH) {
27
+ var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19];
28
+ var abnArray = [];
29
+ for (var i = 0; i < abn.length; i++) {
30
+ abnArray[i] = abn.charAt(i);
31
+ }
32
+ // subtract 1 from the left-most digit
33
+ // @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
34
+ abnArray[0] -= 1;
35
+ // multiply each of the digits by its weighting factor
36
+ for (var _i = 0; _i < abnArray.length; _i++) {
37
+ // @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
38
+ abnArray[_i] *= weights[_i];
39
+ }
40
+ // sum all the digits
41
+ var abnSum = 0;
42
+ for (var _i2 = 0; _i2 < abnArray.length; _i2++) {
43
+ // @ts-expect-error TS(2322): Type 'string' is not assignable to type 'number'.
44
+ abnSum += abnArray[_i2];
45
+ }
46
+ return abnSum % 89 === 0;
47
+ } else {
48
+ return false;
49
+ }
50
+ };
51
+ var isValidAcn = function isValidAcn(acn) {
52
+ var VALID_ACN_LENGTH = 9;
53
+
54
+ // strip whitespace from value
55
+ acn = String(acn).replace(/\s+/g, '');
56
+ if (acn.length === VALID_ACN_LENGTH) {
57
+ var weights = [8, 7, 6, 5, 4, 3, 2, 1];
58
+ var acnArray = [];
59
+ for (var i = 0; i < acn.length; i++) {
60
+ acnArray[i] = parseInt(acn.charAt(i));
61
+ }
62
+ var acnSum = 0;
63
+
64
+ // sum the digits 1-8
65
+ for (var _i3 = 0; _i3 < weights.length; _i3++) {
66
+ acnSum = acnSum + acnArray[_i3] * weights[_i3];
67
+ }
68
+
69
+ // divide by 10 and take remainder
70
+ var remainder = acnSum % 10;
71
+
72
+ // complement the remainder to 10
73
+ var complement = 10 - remainder;
74
+
75
+ // if the complement equals 10, set it to 0
76
+ if (complement === 10) {
77
+ complement = 0;
78
+ }
79
+ return acnArray[8] === complement;
80
+ } else {
81
+ return false;
82
+ }
83
+ };
84
+
85
+ exports.isValidAbn = isValidAbn;
86
+ exports.isValidAcn = isValidAcn;
87
+ exports.normaliseAbn = normaliseAbn;
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var defaultBillableItem = {
4
+ _id: 'billableItemDefaultId',
5
+ organisationId: 'organisationDefaultId',
6
+ businessId: 'businessDefaultId',
7
+ practiceId: 'practiceDefaultId',
8
+ modalityId: 'modalityDefaultId',
9
+ staffId: 'staffPractitionerDefaultId',
10
+ itemCode: 'mockItemCode',
11
+ fullName: 'mockFullName',
12
+ displayName: 'mockDisplayName',
13
+ description: 'mockDescription',
14
+ price: 4000,
15
+ searchWords: ['mockitemcode', 'mockfullname', 'mockdisplayname'],
16
+ status: 'ACTIVE',
17
+ created: new Date('2015-01-01T00:00:00'),
18
+ modified: new Date('2015-01-02T00:00:00Z')
19
+ };
20
+
21
+ var billableItems = /*#__PURE__*/Object.freeze({
22
+ __proto__: null,
23
+ defaultBillableItem: defaultBillableItem
24
+ });
25
+
26
+ exports.billableItems = billableItems;
27
+ exports.defaultBillableItem = defaultBillableItem;