@hedia/recommendation-screen 2.2.0-alpha.36 → 2.2.0-alpha.38

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 (118) hide show
  1. package/dist/index.js +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/src/RecommendationScreen.d.ts +3 -7
  4. package/dist/src/RecommendationScreen.js +50 -53
  5. package/dist/src/RecommendationScreen.js.map +1 -0
  6. package/dist/src/components/Header.d.ts +5 -3
  7. package/dist/src/components/Header.js +61 -40
  8. package/dist/src/components/Header.js.map +1 -0
  9. package/dist/src/components/Icon.js +1 -2
  10. package/dist/src/components/Icon.js.map +1 -0
  11. package/dist/src/components/InfoBars.d.ts +3 -4
  12. package/dist/src/components/InfoBars.js +12 -14
  13. package/dist/src/components/InfoBars.js.map +1 -0
  14. package/dist/src/components/InvisibleNumberInput.js +3 -2
  15. package/dist/src/components/InvisibleNumberInput.js.map +1 -0
  16. package/dist/src/components/LimitationMessage.js +4 -4
  17. package/dist/src/components/LimitationMessage.js.map +1 -0
  18. package/dist/src/components/LineSeparator.js +1 -0
  19. package/dist/src/components/LineSeparator.js.map +1 -0
  20. package/dist/src/components/RecentInsulin.d.ts +1 -1
  21. package/dist/src/components/RecentInsulin.js +56 -36
  22. package/dist/src/components/RecentInsulin.js.map +1 -0
  23. package/dist/src/components/RecommendationModal.d.ts +2 -1
  24. package/dist/src/components/RecommendationModal.js +20 -25
  25. package/dist/src/components/RecommendationModal.js.map +1 -0
  26. package/dist/src/components/RecommendedCarbs.d.ts +2 -0
  27. package/dist/src/components/RecommendedCarbs.js +38 -38
  28. package/dist/src/components/RecommendedCarbs.js.map +1 -0
  29. package/dist/src/components/RecommendedInsulin.d.ts +1 -3
  30. package/dist/src/components/RecommendedInsulin.js +47 -60
  31. package/dist/src/components/RecommendedInsulin.js.map +1 -0
  32. package/dist/src/components/Remeasure.d.ts +5 -15
  33. package/dist/src/components/Remeasure.js +12 -30
  34. package/dist/src/components/Remeasure.js.map +1 -0
  35. package/dist/src/components/{SaveButton.d.ts → TransferToLogbook.d.ts} +1 -1
  36. package/dist/src/components/TransferToLogbook.js +92 -0
  37. package/dist/src/components/TransferToLogbook.js.map +1 -0
  38. package/dist/src/components/TwoOptionModal.d.ts +0 -1
  39. package/dist/src/components/TwoOptionModal.js +10 -10
  40. package/dist/src/components/TwoOptionModal.js.map +1 -0
  41. package/dist/src/components/activity/Activity.d.ts +1 -1
  42. package/dist/src/components/activity/Activity.js +5 -5
  43. package/dist/src/components/activity/Activity.js.map +1 -0
  44. package/dist/src/components/activity/ActivityIcon.d.ts +1 -1
  45. package/dist/src/components/activity/ActivityIcon.js +4 -4
  46. package/dist/src/components/activity/ActivityIcon.js.map +1 -0
  47. package/dist/src/components/activity/ActivityIntensity.d.ts +1 -1
  48. package/dist/src/components/activity/ActivityIntensity.js +2 -1
  49. package/dist/src/components/activity/ActivityIntensity.js.map +1 -0
  50. package/dist/src/components/mood/Emotion.d.ts +1 -1
  51. package/dist/src/components/mood/Emotion.js +5 -7
  52. package/dist/src/components/mood/Emotion.js.map +1 -0
  53. package/dist/src/components/mood/MoodIcon.d.ts +1 -1
  54. package/dist/src/components/mood/MoodIcon.js +5 -4
  55. package/dist/src/components/mood/MoodIcon.js.map +1 -0
  56. package/dist/src/components/text/TextBold.js +1 -0
  57. package/dist/src/components/text/TextBold.js.map +1 -0
  58. package/dist/src/components/text/TextRegular.js +1 -0
  59. package/dist/src/components/text/TextRegular.js.map +1 -0
  60. package/dist/src/locales/da/messages.json +80 -0
  61. package/dist/src/locales/de/messages.json +80 -0
  62. package/dist/src/locales/en/messages.json +83 -0
  63. package/dist/src/locales/es/messages.json +80 -0
  64. package/dist/src/locales/fr/messages.json +80 -0
  65. package/dist/src/locales/it/messages.json +80 -0
  66. package/dist/src/locales/translate.d.ts +4 -0
  67. package/dist/src/locales/translate.js +37 -0
  68. package/dist/src/locales/translate.js.map +1 -0
  69. package/dist/src/types/enum.d.ts +4 -9
  70. package/dist/src/types/enum.js +2 -5
  71. package/dist/src/types/enum.js.map +1 -0
  72. package/dist/src/types/types.js +1 -0
  73. package/dist/src/types/types.js.map +1 -0
  74. package/dist/src/utils/AttentionMessages.js +29 -24
  75. package/dist/src/utils/AttentionMessages.js.map +1 -0
  76. package/dist/src/utils/Constants.d.ts +8 -21
  77. package/dist/src/utils/Constants.js +7 -19
  78. package/dist/src/utils/Constants.js.map +1 -0
  79. package/dist/src/utils/RecommendationError.d.ts +0 -4
  80. package/dist/src/utils/RecommendationError.js +24 -28
  81. package/dist/src/utils/RecommendationError.js.map +1 -0
  82. package/dist/src/utils/RecommendationUtils.js +5 -2
  83. package/dist/src/utils/RecommendationUtils.js.map +1 -0
  84. package/dist/src/utils/Translations.js +5 -5
  85. package/dist/src/utils/Translations.js.map +1 -0
  86. package/dist/src/utils/Utils.d.ts +1 -1
  87. package/dist/src/utils/Utils.js +1 -0
  88. package/dist/src/utils/Utils.js.map +1 -0
  89. package/dist/src/utils/Validations.d.ts +1 -18
  90. package/dist/src/utils/Validations.js +5 -39
  91. package/dist/src/utils/Validations.js.map +1 -0
  92. package/dist/tsconfig.tsbuildinfo +1 -0
  93. package/package.json +86 -100
  94. package/dist/src/assets/fonts/Poppins-Bold.ttf +0 -0
  95. package/dist/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
  96. package/dist/src/assets/icons/Edit.d.ts +0 -4
  97. package/dist/src/assets/icons/Edit.js +0 -7
  98. package/dist/src/assets/icons/Edit.tsx +0 -22
  99. package/dist/src/assets/icons/X.d.ts +0 -4
  100. package/dist/src/assets/icons/X.js +0 -6
  101. package/dist/src/assets/icons/X.tsx +0 -14
  102. package/dist/src/components/ForecastInfoBar.d.ts +0 -105
  103. package/dist/src/components/ForecastInfoBar.js +0 -164
  104. package/dist/src/components/SaveButton.js +0 -71
  105. package/dist/src/locale/da/messages.js +0 -1
  106. package/dist/src/locale/da/messages.po +0 -369
  107. package/dist/src/locale/de/messages.js +0 -1
  108. package/dist/src/locale/de/messages.po +0 -369
  109. package/dist/src/locale/en/messages.js +0 -1
  110. package/dist/src/locale/en/messages.po +0 -369
  111. package/dist/src/locale/es/messages.js +0 -1
  112. package/dist/src/locale/es/messages.po +0 -369
  113. package/dist/src/locale/fr/messages.js +0 -1
  114. package/dist/src/locale/fr/messages.po +0 -369
  115. package/dist/src/locale/i18nUtils.d.ts +0 -18
  116. package/dist/src/locale/i18nUtils.js +0 -39
  117. package/dist/src/locale/it/messages.js +0 -1
  118. package/dist/src/locale/it/messages.po +0 -369
@@ -0,0 +1,80 @@
1
+ {
2
+ "Active Insulin": "Insulina attiva",
3
+ "Activity": "Attività fisica",
4
+ "Additional": "Ulteriori",
5
+ "Attention": "Attenzione",
6
+ "Based on the selected activity your insulin recommendation is reduced by:": "In base all'attività selezionata, la prescrizione per l'insulina è ridotta di:",
7
+ "Blood Glucose Level": "Indice glicemico",
8
+ "Blood Ketone Level": "Livello di chetoni nel sangue",
9
+ "Carbohydrates": "Carboidrati",
10
+ "Close calculation": "Chiudi calcolo",
11
+ "Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.": "Ricorda di non iniziare l'attività fisica prima che il livello di glucosio nel sangue non sia rientrato negli intervalli raccomandati prima dell'attività fisica.",
12
+ "Entered": "Inserito",
13
+ "Error. Hedia Calculator does not support an insulin dose greater than {SAFETY_INSULIN_LIMIT} units": "Errore. Hedia Calculator non supporta una dose di insulina superiore a {SAFETY_INSULIN_LIMIT} unità",
14
+ "Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours": "Errore. Hedia Calculator non supporta le raccomandazioni di insulina con boli più vecchi di 4 ore",
15
+ "Error. Hedia Calculator does not support your activity intensity value": "Errore. Hedia Calculator non supporta il valore dell'intensità dell'attività",
16
+ "Error. Hedia Calculator does not support your activity type value": "Errore. Hedia Calculator non supporta il valore del tipo di attività",
17
+ "Error. Hedia Calculator does not support your current blood glucose level.": "Errore. Hedia Calculator non supporta la tua glicemia attuale.",
18
+ "Error. Hedia Calculator does not support your current blood glucose unit.": "Errore. Hedia Calculator non supporta l'attuale unità misura di glucosio nel sangue.",
19
+ "Error. Hedia Calculator does not support your current blood ketone level.": "Errore. Hedia Calculator non supporta l'attuale livello di chetoni nel sangue.",
20
+ "Error. Hedia Calculator does not support your current blood ketone unit.": "Errore. Hedia Calculator non supporta l'attuale unità di misura di chetoni del sangue.",
21
+ "Error. Hedia Calculator does not support your current language.": "Errore. Hedia Calculator non supporta la lingua corrente.",
22
+ "Error. Hedia Calculator does not support your injection method.": "Errore. Hedia Calculator non supporta il metodo di iniezione.",
23
+ "Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.": "Errore. Hedia Calculator supporta solo attività della durata massima di 60 minuti.",
24
+ "Error. Please verify that your activity settings are set up correctly.": "Errore. Verificare che le impostazioni delle attività siano impostate correttamente.",
25
+ "Error. Please verify that your activity target blood glucose value is correct.": "Errore. Verificare che il indice glicemico desiderato durante l’attività sia corretto.",
26
+ "Error. Please verify that your insulin sensitivity value is correct.": "Errore. Verificare che il valore della sensibilità all'insulina sia corretto.",
27
+ "Error. Please verify that your insulin to carb ratio value is correct.": "Errore. Verificare che il valore del rapporto insulina/carboidrati sia corretto.",
28
+ "Error. Please verify that your target blood glucose value is correct.": "Errore. Verificare che il valore obiettivo della glicemia sia corretto.",
29
+ "Error. Please verify your notifications settings.": "Errore. Verificare le impostazioni di notifica.",
30
+ "Food": "Cibo",
31
+ "grams": "grammi",
32
+ "grams of carbohydrates": "grammi di carboidrati",
33
+ "Hard": "Intensa",
34
+ "Have you taken insulin within the last 4 hours?": "Hai assunto insulina nelle ultime 4 ore?",
35
+ "Hedia Calculator does not support activities that finished more than 4 hours ago.": "Hedia Calculator non supporta attività che siano terminate più di 4 ore fa.",
36
+ "Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.": "Hedia Calculator non supporta le prescrizioni di insulina con più di 300 grammi di carboidrati presenti.",
37
+ "Hedia does not support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.": "Hedia non supporta più di {SAFETY_INSULIN_LIMIT} unità di insulina per ogni calcolo.",
38
+ "Hedia doesn't support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {0}% to {1} units for this calculation.": "Hedia non supporta più di {SAFETY_INSULIN_LIMIT} unità di insulina per ogni calcolo, ma, a seguito dell'attività fisica che hai inserito, è stata ulteriormente ridotta del {0}% a {1} unità per questo calcolo.",
39
+ "hours": "ore",
40
+ "How are you feeling?": "Come ti senti?",
41
+ "If it is possible, postpone your planned exercise.": "Se possibile, posticipa l'allenamento pianificato.",
42
+ "Instead of taking insulin": "Invece di assumere insulina",
43
+ "INSULIN{0}RECOMMENDATION": "PRESCRIZIONE DI{0}INSULINA",
44
+ "Light": "Leggera",
45
+ "min": "min",
46
+ "Moderate": "Moderata",
47
+ "More than 15 minutes has passed since this calculation was started.": "Sono passati più di 15 minuti dall'inizio di questo calcolo.",
48
+ "NO": "NO",
49
+ "No": "No",
50
+ "No, return to dashboard": "No, torna al pannello di controllo",
51
+ "OFF": "SPENTO",
52
+ "OK": "OK",
53
+ "Please go through the calculation steps with new measurements to ensure a safe recommendation.": "Completa tutte le fasi del calcolo con nuove misurazioni per assicurare una prescrizione sicura.",
54
+ "Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?": "La prescrizione del {day} alle {time} non è stata trasferita nel tuo diario.{0} Hai usato la prescrizione?",
55
+ "Recommended": "Prescritta",
56
+ "Recommended amount of insulin": "Quantità prescritta di insulina",
57
+ "Remind me to remeasure in": "Ricordami di misurare nuovamente tra",
58
+ "Return to dashboard": "Torna al pannello di controllo",
59
+ "Save data before closing?": "Salvare i dati prima della chiusura?",
60
+ "Save to logbook": "Salva nel diario",
61
+ "Start new calculation": "Inizia il nuovo calcolo",
62
+ "Total": "Totale",
63
+ "Transfer to logbook": "Trasferisci al diario",
64
+ "Transferred to logbook": "Trasferito al diario",
65
+ "Units": "Unità",
66
+ "units": "unità",
67
+ "Untitled Activity": "Attività senza titolo",
68
+ "We recommend eating an additional:": "Consigliamo di ingerire una quantità supplementare:",
69
+ "Would you like to add this to your current calculation?": "Vuoi aggiungere questo al tuo calcolo corrente?",
70
+ "Yes": "Sì",
71
+ "Yes, save to logbook": "Sì, salva nel diario",
72
+ "You have a high blood glucose level.": "Hai un alto indice glicemico.",
73
+ "You should take rapid-acting insulin and measure ketones.": "Devi assumere insulina ad azione rapida e misurare i chetoni.",
74
+ "You will be reminded to measure your blood glucose level in 15 min.": "Ti verrà ricordato di misurare il indice glicemico tra 15 min.",
75
+ "Your blood glucose level is very low.": "Il indice glicemico è molto basso.",
76
+ "Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.": "Il indice glicemico è molto basso. Assumi glucagon o ingerisci carboidrati, se possibile. Rivolgiti a un medico.",
77
+ "Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.{1} Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {2}% to {3}.": "La tua prescrizione sarebbe stata superiore a {0} unità di insulina, ma è stata limitata per motivi di sicurezza.{1} Hedia non prescrive mai più di {SAFETY_INSULIN_LIMIT} unità di insulina per calcolo, ma a seguito dell'attività fisica che hai inserito, questa è stata ulteriormente ridotta del {2}% a {3}.",
78
+ "Your recommendation would have been higher than {SAFETY_INSULIN_LIMIT} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.": "La tua prescrizione sarebbe stata superiore a {SAFETY_INSULIN_LIMIT} unità di insulina, ma è stata limitata per motivi di sicurezza. Hedia non prescrive mai più di {SAFETY_INSULIN_LIMIT} unità di insulina per calcolo.",
79
+ "Your saved data will be used for future calculations.": "I dati salvati saranno utilizzati per calcoli futuri."
80
+ }
@@ -0,0 +1,4 @@
1
+ import "moment/min/locales";
2
+ import { Languages } from "@hedia/types";
3
+ export declare const changeLocale: (language: keyof typeof Languages) => void;
4
+ export declare const translate: (textKeys: string, values?: Record<string, unknown>) => string;
@@ -0,0 +1,37 @@
1
+ import "moment/min/locales";
2
+ import moment from "moment";
3
+ const localePath = `../locales`;
4
+ const languageMap = {
5
+ da: require(`${localePath}/da/messages.json`),
6
+ en: require(`${localePath}/en/messages.json`),
7
+ de: require(`${localePath}/de/messages.json`),
8
+ es: require(`${localePath}/es/messages.json`),
9
+ fr: require(`${localePath}/fr/messages.json`),
10
+ it: require(`${localePath}/it/messages.json`),
11
+ };
12
+ let toLocaleTexts;
13
+ export const changeLocale = (language) => {
14
+ moment.locale(language === `en` ? `en-gb` : language);
15
+ toLocaleTexts = languageMap[language];
16
+ };
17
+ export const translate = (textKeys, values) => {
18
+ const englishTexts = languageMap[`en`];
19
+ const englishText = englishTexts[textKeys];
20
+ const translatedText = toLocaleTexts?.[textKeys];
21
+ if (!englishText && !translatedText) {
22
+ console.warn(`No text/key with value ${textKeys} was found`);
23
+ return textKeys;
24
+ }
25
+ if (!values) {
26
+ return translatedText ?? englishText;
27
+ }
28
+ let translatedTextWithValues = translatedText;
29
+ let englishTextsWithValues = englishText;
30
+ const valuesKeys = Object.keys(values);
31
+ for (const k of valuesKeys) {
32
+ translatedTextWithValues = translatedTextWithValues?.replaceAll(`{${k}}`, `${values[k]}`);
33
+ englishTextsWithValues = englishTextsWithValues.replaceAll(`{${k}}`, `${values[k]}`);
34
+ }
35
+ return translatedTextWithValues ?? englishTextsWithValues;
36
+ };
37
+ //# sourceMappingURL=translate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.js","sourceRoot":"","sources":["../../../src/locales/translate.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC,MAAM,WAAW,GAA2D;IAC3E,EAAE,EAAE,OAAO,CAAC,GAAG,UAAU,mBAAmB,CAAC;IAC7C,EAAE,EAAE,OAAO,C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AAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC1F,sBAAsB,GAAG,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;KACrF;IACD,OAAO,wBAAwB,IAAI,sBAAsB,CAAC;AAC3D,CAAC,CAAC"}
@@ -57,20 +57,17 @@ export declare namespace Testing {
57
57
  enum Value {
58
58
  BloodKetone = "blood-ketone-value",
59
59
  BloodGlucose = "blood-glucose-value",
60
- ActiveInsulin = "active-insulin-value",
61
- ForecastedGlucose = "forecasted-glucose-value"
60
+ ActiveInsulin = "active-insulin-value"
62
61
  }
63
62
  enum Label {
64
63
  BloodKetone = "blood-ketone-label",
65
64
  BloodGlucose = "blood-glucose-label",
66
- ActiveInsulin = "active-insulin-label",
67
- ForecastedGlucose = "forecasted-glucose-label"
65
+ ActiveInsulin = "active-insulin-label"
68
66
  }
69
67
  enum Unit {
70
68
  BloodKetone = "blood-ketone-unit",
71
69
  BloodGlucose = "blood-glucose-unit",
72
- ActiveInsulin = "active-insulin-unit",
73
- ForecastedGlucose = "forecasted-glucose-unit"
70
+ ActiveInsulin = "active-insulin-unit"
74
71
  }
75
72
  }
76
73
  }
@@ -105,9 +102,7 @@ export declare enum RecommendationErrorEnum {
105
102
  InjectionMethod = 18,
106
103
  BloodKetoneUnit = 19,
107
104
  BloodGlucoseUnit = 20,
108
- BloodKetoneProps = 21,
109
- CGMOutsideRange = 22,
110
- ForecastOutsideRange = 23
105
+ BloodKetoneProps = 21
111
106
  }
112
107
  /** Indicates the category of the user’s blood glucose level. */
113
108
  export declare enum BgLevel {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-namespace */
1
2
  /** Namespace containing data required by component testing */
2
3
  export var Testing;
3
4
  (function (Testing) {
@@ -73,21 +74,18 @@ export var Testing;
73
74
  Value["BloodKetone"] = "blood-ketone-value";
74
75
  Value["BloodGlucose"] = "blood-glucose-value";
75
76
  Value["ActiveInsulin"] = "active-insulin-value";
76
- Value["ForecastedGlucose"] = "forecasted-glucose-value";
77
77
  })(Value = InfoBarTestIds.Value || (InfoBarTestIds.Value = {}));
78
78
  let Label;
79
79
  (function (Label) {
80
80
  Label["BloodKetone"] = "blood-ketone-label";
81
81
  Label["BloodGlucose"] = "blood-glucose-label";
82
82
  Label["ActiveInsulin"] = "active-insulin-label";
83
- Label["ForecastedGlucose"] = "forecasted-glucose-label";
84
83
  })(Label = InfoBarTestIds.Label || (InfoBarTestIds.Label = {}));
85
84
  let Unit;
86
85
  (function (Unit) {
87
86
  Unit["BloodKetone"] = "blood-ketone-unit";
88
87
  Unit["BloodGlucose"] = "blood-glucose-unit";
89
88
  Unit["ActiveInsulin"] = "active-insulin-unit";
90
- Unit["ForecastedGlucose"] = "forecasted-glucose-unit";
91
89
  })(Unit = InfoBarTestIds.Unit || (InfoBarTestIds.Unit = {}));
92
90
  })(InfoBarTestIds = Id.InfoBarTestIds || (Id.InfoBarTestIds = {}));
93
91
  })(Id = Testing.Id || (Testing.Id = {}));
@@ -120,8 +118,6 @@ export var RecommendationErrorEnum;
120
118
  RecommendationErrorEnum[RecommendationErrorEnum["BloodKetoneUnit"] = 19] = "BloodKetoneUnit";
121
119
  RecommendationErrorEnum[RecommendationErrorEnum["BloodGlucoseUnit"] = 20] = "BloodGlucoseUnit";
122
120
  RecommendationErrorEnum[RecommendationErrorEnum["BloodKetoneProps"] = 21] = "BloodKetoneProps";
123
- RecommendationErrorEnum[RecommendationErrorEnum["CGMOutsideRange"] = 22] = "CGMOutsideRange";
124
- RecommendationErrorEnum[RecommendationErrorEnum["ForecastOutsideRange"] = 23] = "ForecastOutsideRange";
125
121
  })(RecommendationErrorEnum || (RecommendationErrorEnum = {}));
126
122
  /** Indicates the category of the user’s blood glucose level. */
127
123
  export var BgLevel;
@@ -145,3 +141,4 @@ export var RecommendationReminders;
145
141
  RecommendationReminders[RecommendationReminders["Reminder60Minutes"] = 1] = "Reminder60Minutes";
146
142
  RecommendationReminders[RecommendationReminders["HediaReminderDefault"] = 1.5] = "HediaReminderDefault";
147
143
  })(RecommendationReminders || (RecommendationReminders = {}));
144
+ //# sourceMappingURL=enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/types/enum.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,8DAA8D;AAC9D,MAAM,KAAW,OAAO,CAqGvB;AArGD,WAAiB,OAAO;IACvB,uHAAuH;IACvH,IAAiB,EAAE,CAgFlB;IAhFD,WAAiB,EAAE;QAClB,IAAY,2BAEX;QAFD,WAAY,2BAA2B;YACtC,6FAA8D,CAAA;QAC/D,CAAC,EAFW,2BAA2B,GAA3B,8BAA2B,KAA3B,8BAA2B,QAEtC;QAED,IAAY,eAGX;QAHD,WAAY,eAAe;YAC1B,iEAA8C,CAAA;YAC9C,sEAAmD,CAAA;QACpD,CAAC,EAHW,eAAe,GAAf,kBAAe,KAAf,kBAAe,QAG1B;QAED,IAAY,aAGX;QAHD,WAAY,aAAa;YACxB,4DAA2C,CAAA;YAC3C,2CAA0B,CAAA;QAC3B,CAAC,EAHW,aAAa,GAAb,gBAAa,KAAb,gBAAa,QAGxB;QAED,IAAY,wBAEX;QAFD,WAAY,wBAAwB;YACnC,qEAAyC,CAAA;QAC1C,CAAC,EAFW,wBAAwB,GAAxB,2BAAwB,KAAxB,2BAAwB,QAEnC;QAED,IAAY,oBAGX;QAHD,WAAY,oBAAoB;YAC/B,gDAAwB,CAAA;YACxB,kDAA0B,CAAA;QAC3B,CAAC,EAHW,oBAAoB,GAApB,uBAAoB,KAApB,uBAAoB,QAG/B;QAED,IAAY,uBAOX;QAPD,WAAY,uBAAuB;YAClC,iEAAsC,CAAA;YACtC,0EAA+C,CAAA;YAC/C,mFAAwD,CAAA;YACxD,yDAA8B,CAAA;YAC9B,8EAAmD,CAAA;YACnD,qDAA0B,CAAA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KX;AALD,WAAY,uBAAuB;IAClC,mFAAe,CAAA;IACf,kGAAwB,CAAA;IACxB,+FAAqB,CAAA;IACrB,uGAA0B,CAAA;AAC3B,CAAC,EALW,uBAAuB,KAAvB,uBAAuB,QAKlC"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types/types.ts"],"names":[],"mappings":""}
@@ -1,7 +1,6 @@
1
- import { BolusCalculator } from "@hedia/types";
2
- import { t } from "@lingui/macro";
3
1
  import moment from "moment";
4
- import { i18n } from "../locale/i18nUtils";
2
+ import { BolusCalculator } from "@hedia/types";
3
+ import { translate } from "../locales/translate";
5
4
  /** Provides methods for getting variants of attention messages */
6
5
  export const AttentionMessage = {
7
6
  /**
@@ -74,45 +73,51 @@ export function getLimitedValue(reduction) {
74
73
  /** Provides methods for getting strings for composing attention messages and other important communications to the user. */
75
74
  export class Messages {
76
75
  /** Inform the user that their BGL is very low and what they should do about it. */
77
- static VeryLowBGL = () => i18n._(t `Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.`);
76
+ static VeryLowBGL = () => translate(`Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.`);
78
77
  /** Inform the user that their BGL is very low. */
79
- static LowBGL = () => i18n._(t `Your blood glucose level is very low.`);
78
+ static LowBGL = () => translate(`Your blood glucose level is very low.`);
80
79
  /** Inform the user that they will be reminded to remeasure their BGL soon. */
81
- static Reminder15Minutes = () => i18n._(t `You will be reminded to measure your blood glucose level in 15 min.`);
80
+ static Reminder15Minutes = () => translate(`You will be reminded to measure your blood glucose level in 15 min.`);
82
81
  /** Encourages the user to postpone exercise. Specifically when their BGL is high. */
83
- static PostponePhysicalActivity = () => i18n._(t `If it is possible, postpone your planned exercise.`);
82
+ static PostponePhysicalActivity = () => translate(`If it is possible, postpone your planned exercise.`);
84
83
  /** Encourages the user to postpone exercise. Specifically when their BGL is low. */
85
- static PostponePhysicalActivityUnder5MMOL = () => i18n._(t `Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.`);
84
+ static PostponePhysicalActivityUnder5MMOL = () => translate(`Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.`);
86
85
  /** Inform about high BGL. */
87
- static HighBGL = () => i18n._(t `You have a high blood glucose level.`);
86
+ static HighBGL = () => translate(`You have a high blood glucose level.`);
88
87
  /** Encourage user to measure ketones. */
89
- static InsulinKetones = () => i18n._(t `You should take rapid-acting insulin and measure ketones.`);
88
+ static InsulinKetones = () => translate(`You should take rapid-acting insulin and measure ketones.`);
90
89
  /** Inform the user that their insulin recommendation was limited for safety. */
91
- static RecommendationWasLimited = () => i18n._(t `Your recommendation would have been higher than ${SAFETY_INSULIN_LIMIT} units of insulin, but it has been limited for safety reasons.
92
- Hedia never recommends more than ${SAFETY_INSULIN_LIMIT} units of insulin per calculation.`);
90
+ static RecommendationWasLimited = () => translate(`Your recommendation would have been higher than {SAFETY_INSULIN_LIMIT} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.`, { SAFETY_INSULIN_LIMIT });
93
91
  /** Inform the user that their insulin recommendation was limited for safety in combination with an activity. */
94
- static RecommendationWasLimitedActivity = (activityReduction) => i18n._(t `Your recommendation would have been higher than ${getLimitedValue(activityReduction)}
95
- units of insulin, but it has been limited for safety reasons.${`\n\n`}
96
- Hedia never recommends more than ${SAFETY_INSULIN_LIMIT}
97
- units of insulin per calculation, but because of the physical activity
98
- you entered it has been further reduced by ${(activityReduction * 100).toFixed(0)}% to
99
- ${getLimitedValue(activityReduction)}.`);
92
+ static RecommendationWasLimitedActivity = (activityReduction) => translate(`Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.{1} Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {2}% to {3}.`, {
93
+ 0: getLimitedValue(activityReduction),
94
+ 1: `\n\n`,
95
+ SAFETY_INSULIN_LIMIT,
96
+ 2: (activityReduction * 100).toFixed(0),
97
+ 3: getLimitedValue(activityReduction),
98
+ });
100
99
  /** Inform the user that the insulin amount they entered is above HDA’s safety limit. */
101
100
  static InsulinInputWasLimited = (activityReduction) => activityReduction
102
- ? i18n._(t `Hedia doesn't support more than ${SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by
103
- ${(activityReduction * 100).toFixed(0)}% to ${getLimitedValue(activityReduction)} units for this calculation.`)
104
- : i18n._(t `Hedia does not support more than ${SAFETY_INSULIN_LIMIT} units of insulin per calculation.`);
101
+ ? translate(`Hedia doesn't support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {0}% to {1} units for this calculation.`, {
102
+ SAFETY_INSULIN_LIMIT,
103
+ 0: (activityReduction * 100).toFixed(0),
104
+ 1: getLimitedValue(activityReduction),
105
+ })
106
+ : translate(`Hedia does not support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.`, {
107
+ SAFETY_INSULIN_LIMIT,
108
+ });
105
109
  /** Title for the modal that informs the user that their calculation is too old. */
106
- static TimeoutPrompTitle = () => i18n._(t `More than 15 minutes has passed since this calculation was started.`);
110
+ static TimeoutPrompTitle = () => translate(`More than 15 minutes has passed since this calculation was started.`);
107
111
  /**
108
112
  * Inform the user that their recommendation calculation is too old.
109
113
  * Variant to show when they didn’t see the actual insulin recommendation because they didn’t tell whether they injected insulin recently.
110
114
  */
111
- static TimeoutRecommendationNotVisible = () => i18n._(t `Please go through the calculation steps with new measurements to ensure a safe recommendation.`);
115
+ static TimeoutRecommendationNotVisible = () => translate(`Please go through the calculation steps with new measurements to ensure a safe recommendation.`);
112
116
  /** Inform the user that their recommendation calculation is too old. */
113
117
  static TimeoutRecommendationVisible = (date) => {
114
118
  const day = moment(date).format(`LL`);
115
119
  const time = moment(date).format(`HH:mm`);
116
- return i18n._(t `Recommendation from ${day} at ${time} was not transfered to your logbook.${`\n`}Did you use the recommendation?`);
120
+ return translate(`Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?`, { day, time, 0: `\n` });
117
121
  };
118
122
  }
123
+ //# sourceMappingURL=AttentionMessages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttentionMessages.js","sourceRoot":"","sources":["../../../src/utils/AttentionMessages.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;;;;OAIG;IACH,kBAAkB,EAAE,GAAW,EAAE,CAAC,GAAG,QAAQ,CAAC,UAAU,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,iBAAiB,EAAE,EAAE;IAElG;;;;OAIG;IACH,YAAY,EAAE,GAAW,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,iBAAiB,EAAE,EAAE;IAExF,gEAAgE;IAChE,gBAAgB,EAAE,GAAW,EAAE,CAAC,QAAQ,CAAC,iBAAiB,EAAE;IAE5D,iFAAiF;IACjF,+BAA+B,EAAE,GAAW,EAAE,CAAC,QAAQ,CAAC,kCAAkC,EAAE;IAE5F;;;;;;OAMG;IACH,qBAAqB,EAAE,GAAW,EAAE,CACnC,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,cAAc,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,iBAAiB,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,wBAAwB,EAAE,EAAE;IAE9I;;;;OAIG;IACH,mBAAmB,EAAE,GAAW,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,IA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AC,qEAAqE,CAAC,CAAC;IAClF;;;OAGG;IACI,MAAM,CAAC,+BAA+B,GAAG,GAAW,EAAE,CAC5D,SAAS,CAAC,gGAAgG,CAAC,CAAC;IAC7G,yEAAyE;IAClE,MAAM,CAAC,4BAA4B,GAAG,CAAC,IAAU,EAAU,EAAE;QACnE,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,SAAS,CACf,2GAA2G,EAC3G,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CACtB,CAAC;IACH,CAAC,CAAC"}
@@ -1,19 +1,10 @@
1
1
  import { IInterval } from "../types/types";
2
- /** Reusable color definitions. */
3
- export declare const colors: {
4
- blue: string;
5
- darkBlue: string;
6
- dustyBlue: string;
7
- fadeBlue: string;
8
- lightBlue: string;
9
- mistBlue: string;
10
- purple: string;
11
- semiDarkBlue: string;
12
- teal: string;
13
- gradientMain: string[];
14
- gradientWithOpacity: string[];
15
- gradientPurple: string[];
16
- };
2
+ /** Reusable color definition. */
3
+ export declare const BACKGROUND_COLOUR_PURPLE = "rgba(27, 31, 72, 1)";
4
+ /** Reusable color definition. */
5
+ export declare const BORDER_COLOUR_GREY = "rgba(74, 91, 134, 1)";
6
+ /** Reusable color definition. */
7
+ export declare const BORDER_COLOUR_TEAL = "rgba(1, 255, 252, 0.8)";
17
8
  /** The threshold above which hyperglycemia is considered to be severe in mmol/L */
18
9
  export declare const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
19
10
  /** The number of seconds in four hours. */
@@ -37,13 +28,13 @@ export declare const INSULIN_TO_CARBS_RATIO_LIMITS: IInterval;
37
28
  /** The lower and upper limits of the entered blood glucose level value in mmol/L. */
38
29
  export declare const CURRENT_BGL_MMOL_LIMITS: IInterval;
39
30
  /** The conversion factor to multiply a blood glucose value with to go from mmol/L to mg/dL. */
40
- export declare const MMOLL_PER_MGDL_BGL: number;
31
+ export declare const MMOLL_PER_MGDL_BGL = 0.0555;
41
32
  /** The conversion factor to multiply a blood glucose value with to go from mg/dL to mmol/L. */
42
33
  export declare const MGDL_PER_MMOLL_BGL: number;
43
34
  /** The lower and upper limits of the entered blood ketones value in mmol/L. */
44
35
  export declare const CURRENT_BKL_MMOL_LIMITS: IInterval;
45
36
  /** The conversion factor to multiply a blood ketones value with to go from mmol/L to mg/dL. */
46
- export declare const MMOLL_PER_MGDL_BKL: number;
37
+ export declare const MMOLL_PER_MGDL_BKL = 0.096;
47
38
  /** The conversion factor to multiply a blood ketones value with to go from mg/dL to mmol/L. */
48
39
  export declare const MGDL_PER_MMOLL_BKL: number;
49
40
  /** The lower and upper limits for a valid BGL target in mmol/L. */
@@ -54,7 +45,3 @@ export declare const ACTIVITY_TARGET_BGL_MMOL_LIMITS: IInterval;
54
45
  export declare const REMINDER_HOURS_LIMITS: IInterval;
55
46
  /** The lower and upper limits for activity reduction. */
56
47
  export declare const ACTIVITY_SETTINGS_INTERVAL_LIMITS: IInterval;
57
- /** The lower and upper limits of the cgm reading value in mmol/L. */
58
- export declare const CGM_LIMITS: IInterval;
59
- /** The lower and upper limits of the forecast predicted value in mmol/L. */
60
- export declare const FORECAST_LIMITS: IInterval;
@@ -1,19 +1,10 @@
1
1
  import { BolusCalculator } from "@hedia/types";
2
- /** Reusable color definitions. */
3
- export const colors = {
4
- blue: `#578aff`,
5
- darkBlue: `#0F1231`,
6
- dustyBlue: `#C5D0E7`,
7
- fadeBlue: `#8388C8`,
8
- lightBlue: `#C8CCFA`,
9
- mistBlue: `#4A5B86`,
10
- purple: `#a200ff`,
11
- semiDarkBlue: `#1B1F48`,
12
- teal: `#01FFFC`,
13
- gradientMain: [`#8B38F5`, `#D593E5`],
14
- gradientWithOpacity: [`rgba(87, 138, 255, 0.3)`, `rgba(162, 0, 255, 0.3)`],
15
- gradientPurple: [`#a200ff`, `#578aff`],
16
- };
2
+ /** Reusable color definition. */
3
+ export const BACKGROUND_COLOUR_PURPLE = `rgba(27, 31, 72, 1)`;
4
+ /** Reusable color definition. */
5
+ export const BORDER_COLOUR_GREY = `rgba(74, 91, 134, 1)`;
6
+ /** Reusable color definition. */
7
+ export const BORDER_COLOUR_TEAL = `rgba(1, 255, 252, 0.8)`;
17
8
  /** The threshold above which hyperglycemia is considered to be severe in mmol/L */
18
9
  export const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
19
10
  /** The number of seconds in four hours. */
@@ -54,7 +45,4 @@ export const ACTIVITY_TARGET_BGL_MMOL_LIMITS = { min: 5, max: 13.9 };
54
45
  export const REMINDER_HOURS_LIMITS = { min: 0, max: 6 };
55
46
  /** The lower and upper limits for activity reduction. */
56
47
  export const ACTIVITY_SETTINGS_INTERVAL_LIMITS = { min: 0, max: 1 };
57
- /** The lower and upper limits of the cgm reading value in mmol/L. */
58
- export const CGM_LIMITS = { min: 2.2, max: 22.2 };
59
- /** The lower and upper limits of the forecast predicted value in mmol/L. */
60
- export const FORECAST_LIMITS = { min: 1.1, max: 25 };
48
+ //# sourceMappingURL=Constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/utils/Constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,iCAAiC;AACjC,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,iCAAiC;AACjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AACzD,iCAAiC;AACjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAE3D,mFAAmF;AACnF,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAElD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACxC,yCAAyC;AACzC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,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACxC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAW,CAAC,GAAG,kBAAkB,CAAC;AAEjE,mEAAmE;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAc,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AACvE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,+BAA+B,GAAc,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAChF,sFAAsF;AACtF,MAAM,CAAC,MAAM,qBAAqB,GAAc,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AACnE,yDAAyD;AACzD,MAAM,CAAC,MAAM,iCAAiC,GAAc,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC"}
@@ -54,7 +54,3 @@ export declare const BloodKetoneUnitError: () => RecommendationError;
54
54
  export declare const BloodGlucoseUnitError: () => RecommendationError;
55
55
  /** The user has provided a blood ketone level but the blood ketone measuring unit is not defined. */
56
56
  export declare const BloodKetonePropsError: () => RecommendationError;
57
- /** The user’s cgm reading value is outside of the valid range. */
58
- export declare const CGMOutsideRangeError: () => RecommendationError;
59
- /** The user’s forecasted value is outside of the valid range. */
60
- export declare const ForecastOutsideRangeError: () => RecommendationError;
@@ -1,6 +1,5 @@
1
1
  import { BolusCalculator } from "@hedia/types";
2
- import { t } from "@lingui/macro";
3
- import { i18n } from "../locale/i18nUtils";
2
+ import { translate } from "../locales/translate";
4
3
  import { RecommendationErrorEnum } from "../types/enum";
5
4
  const SAFETY_INSULIN_LIMIT = BolusCalculator.Constants.SAFETY_INSULIN_LIMIT;
6
5
  /**
@@ -18,50 +17,47 @@ export class RecommendationError extends Error {
18
17
  }
19
18
  }
20
19
  /** The given activity settings are corrupt. */
21
- export const ActivitySettingsError = () => new RecommendationError(i18n._(t `Error. Please verify that your activity settings are set up correctly.`), RecommendationErrorEnum.ActivitySettings);
20
+ export const ActivitySettingsError = () => new RecommendationError(translate(`Error. Please verify that your activity settings are set up correctly.`), RecommendationErrorEnum.ActivitySettings);
22
21
  /** The duration of the given activity is invalid. */
23
- export const ActivityDurationError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.`), RecommendationErrorEnum.ActivityDuration);
22
+ export const ActivityDurationError = () => new RecommendationError(translate(`Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.`), RecommendationErrorEnum.ActivityDuration);
24
23
  /** The start date of the given activity is invalid. */
25
- export const ActivityDateError = () => new RecommendationError(i18n._(t `Hedia Calculator does not support activities that finished more than 4 hours ago.`), RecommendationErrorEnum.ActivityDate);
24
+ export const ActivityDateError = () => new RecommendationError(translate(`Hedia Calculator does not support activities that finished more than 4 hours ago.`), RecommendationErrorEnum.ActivityDate);
26
25
  /** The intensity of the given activity is invalid. */
27
- export const ActivityIntensityError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your activity intensity value`), RecommendationErrorEnum.ActivityIntensity);
26
+ export const ActivityIntensityError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your activity intensity value`), RecommendationErrorEnum.ActivityIntensity);
28
27
  /** Type of the given activity is invalid. */
29
- export const ActivityTypeError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your activity type value`), RecommendationErrorEnum.ActivityType);
28
+ export const ActivityTypeError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your activity type value`), RecommendationErrorEnum.ActivityType);
30
29
  /** The user’s activity target BGL setting is invalid. */
31
- export const ActivityTargetBGLError = () => new RecommendationError(i18n._(t `Error. Please verify that your activity target blood glucose value is correct.`), RecommendationErrorEnum.ActivityTargetBGL);
30
+ export const ActivityTargetBGLError = () => new RecommendationError(translate(`Error. Please verify that your activity target blood glucose value is correct.`), RecommendationErrorEnum.ActivityTargetBGL);
32
31
  /** More than 300 g carbohydrates entered. */
33
- export const CarbohydrateLimitError = () => new RecommendationError(i18n._(t `Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.`), RecommendationErrorEnum.CarbohydrateLimit);
32
+ export const CarbohydrateLimitError = () => new RecommendationError(translate(`Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.`), RecommendationErrorEnum.CarbohydrateLimit);
34
33
  /** The user’s insulin sensitivity setting is outside of the valid range. */
35
- export const InsulinSensitivityError = () => new RecommendationError(i18n._(t `Error. Please verify that your insulin sensitivity value is correct.`), RecommendationErrorEnum.InsulinSensitivity);
34
+ export const InsulinSensitivityError = () => new RecommendationError(translate(`Error. Please verify that your insulin sensitivity value is correct.`), RecommendationErrorEnum.InsulinSensitivity);
36
35
  /** The user’s insulin-to-carbs ratio setting is outside of the valid range. */
37
- export const InsulinToCarbsRatioError = () => new RecommendationError(i18n._(t `Error. Please verify that your insulin to carb ratio value is correct.`), RecommendationErrorEnum.InsulinToCarbsRatio);
36
+ export const InsulinToCarbsRatioError = () => new RecommendationError(translate(`Error. Please verify that your insulin to carb ratio value is correct.`), RecommendationErrorEnum.InsulinToCarbsRatio);
38
37
  /** The entered current blood glucose level is outside of the valid range. */
39
- export const CurrentBGLError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your current blood glucose level.`), RecommendationErrorEnum.CurrentBGL);
38
+ export const CurrentBGLError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your current blood glucose level.`), RecommendationErrorEnum.CurrentBGL);
40
39
  /** The blood glucose level of the latest logbook entry from the last 6 hours is outside of the valid range. */
41
- export const LatestLogbook6HoursBGLError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support the blood glucose level of your latest logbook entry from the last 6 hours.`), RecommendationErrorEnum.LatestLogbook6HoursBGL);
40
+ export const LatestLogbook6HoursBGLError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support the blood glucose level of your latest logbook entry from the last 6 hours.`), RecommendationErrorEnum.LatestLogbook6HoursBGL);
42
41
  /** The entered current blood ketones concentration is outside of the valid range. */
43
- export const CurrentBKLError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your current blood ketone level.`), RecommendationErrorEnum.CurrentBKL);
42
+ export const CurrentBKLError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your current blood ketone level.`), RecommendationErrorEnum.CurrentBKL);
44
43
  /** The user’s target BGL setting is outside of the valid range. */
45
- export const TargetBGLError = () => new RecommendationError(i18n._(t `Error. Please verify that your target blood glucose value is correct.`), RecommendationErrorEnum.TargetBGL);
44
+ export const TargetBGLError = () => new RecommendationError(translate(`Error. Please verify that your target blood glucose value is correct.`), RecommendationErrorEnum.TargetBGL);
46
45
  /** At least one of the recent (within the previous 4 hours) logbook entries has an insulin amount that exceeds the safety insulin threshold. */
47
- export const BolusInsulinDoseError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support an insulin dose greater than ${SAFETY_INSULIN_LIMIT} units`), RecommendationErrorEnum.BolusInsulinDose);
46
+ export const BolusInsulinDoseError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support an insulin dose greater than {SAFETY_INSULIN_LIMIT} units`, { SAFETY_INSULIN_LIMIT }), RecommendationErrorEnum.BolusInsulinDose);
48
47
  /** At least one entry from the list of recent logbook entries is older than 4 hours. */
49
- export const BolusInsulinSecondsPassedError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours`), RecommendationErrorEnum.BolusInsulinSecondsPassed);
48
+ export const BolusInsulinSecondsPassedError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours`), RecommendationErrorEnum.BolusInsulinSecondsPassed);
50
49
  /** The user’s recent boluses entries are not in the allowed format. */
51
- export const RecentBolusError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator could not find your recent boluses`), RecommendationErrorEnum.RecentBolus);
50
+ export const RecentBolusError = () => new RecommendationError(translate(`Error. Hedia Calculator could not find your recent boluses`), RecommendationErrorEnum.RecentBolus);
52
51
  /** The user’s setting for initial reminder time is outside of the valid range. */
53
- export const UserReminderError = () => new RecommendationError(i18n._(t `Error. Please verify your notifications settings.`), RecommendationErrorEnum.UserReminder);
52
+ export const UserReminderError = () => new RecommendationError(translate(`Error. Please verify your notifications settings.`), RecommendationErrorEnum.UserReminder);
54
53
  /** The user’s insulin injection method setting is invalid. */
55
- export const InjectionMethodError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your injection method.`), RecommendationErrorEnum.InjectionMethod);
54
+ export const InjectionMethodError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your injection method.`), RecommendationErrorEnum.InjectionMethod);
56
55
  /**The user’s language setting is not supported by the bolus calculator or it is in the wrong format */
57
- export const LanguageError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your current language.`), RecommendationErrorEnum.Language);
56
+ export const LanguageError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your current language.`), RecommendationErrorEnum.Language);
58
57
  /** The user’s blood ketones unit setting is invalid. */
59
- export const BloodKetoneUnitError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your current blood ketone unit.`), RecommendationErrorEnum.BloodKetoneUnit);
58
+ export const BloodKetoneUnitError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your current blood ketone unit.`), RecommendationErrorEnum.BloodKetoneUnit);
60
59
  /** The user’s blood glucose level measuring unit setting is invalid. */
61
- export const BloodGlucoseUnitError = () => new RecommendationError(i18n._(t `Error. Hedia Calculator does not support your current blood glucose unit.`), RecommendationErrorEnum.BloodGlucoseUnit);
60
+ export const BloodGlucoseUnitError = () => new RecommendationError(translate(`Error. Hedia Calculator does not support your current blood glucose unit.`), RecommendationErrorEnum.BloodGlucoseUnit);
62
61
  /** The user has provided a blood ketone level but the blood ketone measuring unit is not defined. */
63
- export const BloodKetonePropsError = () => new RecommendationError(i18n._(t `Error. Your blood ketone settings are invalid.`), RecommendationErrorEnum.BloodKetoneProps);
64
- /** The user’s cgm reading value is outside of the valid range. */
65
- export const CGMOutsideRangeError = () => new RecommendationError(i18n._(t `Error. Your cgm reading value is outside range.`), RecommendationErrorEnum.CGMOutsideRange);
66
- /** The user’s forecasted value is outside of the valid range. */
67
- export const ForecastOutsideRangeError = () => new RecommendationError(i18n._(t `Error. Your forecasted value is outside range.`), RecommendationErrorEnum.ForecastOutsideRange);
62
+ export const BloodKetonePropsError = () => new RecommendationError(translate(`Error. Your blood ketone settings are invalid.`), RecommendationErrorEnum.BloodKetoneProps);
63
+ //# sourceMappingURL=RecommendationError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecommendationError.js","sourceRoot":"","sources":["../../../src/utils/RecommendationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,oBAAoB,GAAG,eAAe,CAAC,SAAS,CAAC,oBAAoB,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC7B,IAAI,CAA0B;IAE9C,YAAY,OAAe,EAAE,IAA6B;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAwB,EAAE,CAC9D,IAAI,mBAAmB,CACtB,SAAS,CAAC,wEAAwE,CAAC,EACnF,uBAAuB,CAAC,gBAAgB,CACxC,CAAC;AAEH,qDAAqD;AACrD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAwB,EAAE,CAC9D,IAAI,mBAAmB,CACtB,SAAS,CAAC,yFAAyF,CAAC,EACpG,uBAAuB,CAAC,gBAAgB,CACxC,CAAC;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GA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SAAS,CAAC,iEAAiE,CAAC,EAC5E,uBAAuB,CAAC,eAAe,CACvC,CAAC;AAEH,uGAAuG;AACvG,MAAM,CAAC,MAAM,aAAa,GAAG,GAAwB,EAAE,CACtD,IAAI,mBAAmB,CACtB,SAAS,CAAC,iEAAiE,CAAC,EAC5E,uBAAuB,CAAC,QAAQ,CAChC,CAAC;AAEH,wDAAwD;AACxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAwB,EAAE,CAC7D,IAAI,mBAAmB,CACtB,SAAS,CAAC,0EAA0E,CAAC,EACrF,uBAAuB,CAAC,eAAe,CACvC,CAAC;AAEH,wEAAwE;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAwB,EAAE,CAC9D,IAAI,mBAAmB,CACtB,SAAS,CAAC,2EAA2E,CAAC,EACtF,uBAAuB,CAAC,gBAAgB,CACxC,CAAC;AAEH,sGAAsG;AACtG,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAwB,EAAE,CAC9D,IAAI,mBAAmB,CACtB,SAAS,CAAC,gDAAgD,CAAC,EAC3D,uBAAuB,CAAC,gBAAgB,CACxC,CAAC"}
@@ -135,8 +135,10 @@ export function getAttentionMessage(bgLevel, activity) {
135
135
  case BgLevel.Hypoglycemia:
136
136
  case BgLevel.MildHypoglycemia:
137
137
  return isWithin15Minutes && !isAttentionMessageNull
138
- ? addPostponeActivityMessageUnder5MMOL(AttentionMessage[key]())
139
- : AttentionMessage[key]();
138
+ ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
139
+ addPostponeActivityMessageUnder5MMOL(AttentionMessage[key]())
140
+ : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
141
+ AttentionMessage[key]();
140
142
  case BgLevel.Hyperglycemia:
141
143
  return isWithin15Minutes ? AttentionMessage.HyperglycemiaActivity() : null;
142
144
  case BgLevel.SevereHyperglycemia:
@@ -197,3 +199,4 @@ export function getLimitationMessage(wasLimited, activityReduction) {
197
199
  : Messages.RecommendationWasLimited();
198
200
  return wasLimited ? message : null;
199
201
  }
202
+ //# sourceMappingURL=RecommendationUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecommendationUtils.js","sourceRoot":"","sources":["../../../src/utils/RecommendationUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,oCAAoC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CACzB,UAAyB,EACzB,uBAA2D;IAE3D,IAAI,UAAU,KAAK,IAAI,EAAE;QACxB,OAAO,OAAO,CAAC,kBAAkB,CAAC;KAClC;IACD,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,IAAI,CAAC,EAAE;QACzC,OAAO,OAAO,CAAC,kBAAkB,CAAC;KAClC;IACD,IAAI,UAAU,GAAG,CAAC,IAAI,UAAU,IAAI,GAAG,EAAE;QACxC,OAAO,OAAO,CAAC,YAAY,CAAC;KAC5B;IACD,IAAI,UAAU,GAAG,GAAG,IAAI,UAAU,IAAI,CAAC,EAAE;QACxC,OAAO,OAAO,CAAC,gBAAgB,CAAC;KAChC;IACD,IAAI,UAAU,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE;QACrC,OAAO,OAAO,CAAC,uBAAuB,CAAC;KACvC;IACD,IAAI,UAAU,IAAI,CAAC,IAAI,UAAU,IAAI,CAAC,EAAE;QACvC,OAAO,OAAO,CAAC,aAAa,CAAC;KAC7B;IACD,IAAI,UAAU,GAAG,CAAC,IAAI,UAA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AC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC;QAC3C;YACC,MAAM,eAAe,EAAE,CAAC;KACzB;AACF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA4C;IACjF,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE;QAC9C,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC;QAC7C,IAAI,wBAAwB,KAAK,IAAI,EAAE;YACtC,OAAO,wBAAwB,GAAG,+BAA+B,CAAC;SAClE;KACD;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAAsD;IAC/F,MAAM,OAAO,GAAG,QAAQ,EAAE,gBAAgB,CAAC;IAC3C,OAAO,MAAM;SACX,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC;SAC3B,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;AACzF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAmB,EAAE,iBAAgC;IACzF,MAAM,OAAO,GAAG,iBAAiB;QAChC,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC,iBAAiB,CAAC;QAC9D,CAAC,CAAC,QAAQ,CAAC,wBAAwB,EAAE,CAAC;IACvC,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACpC,CAAC"}
@@ -2,13 +2,13 @@
2
2
  * Used for storing Record type objects that contains translations about certain settings that needs to be presented to the user.
3
3
  * @module
4
4
  */
5
- import { t } from "@lingui/macro";
6
- import { i18n } from "../locale/i18nUtils";
5
+ import { translate } from "../locales/translate";
7
6
  /**
8
7
  * Object used for storing the translations of a physical activity intensity in order to be presented to the user
9
8
  */
10
9
  export const ActivityIntensityTranslations = {
11
- light: () => i18n._(t `Light`),
12
- moderate: () => i18n._(t `Moderate`),
13
- hard: () => i18n._(t `Hard`),
10
+ light: () => translate(`Light`),
11
+ moderate: () => translate(`Moderate`),
12
+ hard: () => translate(`Hard`),
14
13
  };
14
+ //# sourceMappingURL=Translations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Translations.js","sourceRoot":"","sources":["../../../src/utils/Translations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAA2D;IACpG,KAAK,EAAE,GAAW,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;IACvC,QAAQ,EAAE,GAAW,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC;IAC7C,IAAI,EAAE,GAAW,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;CACrC,CAAC"}
@@ -101,5 +101,5 @@ export declare class Utils {
101
101
  * @param value The value for the requested key.
102
102
  * @returns The key of the passed value.
103
103
  */
104
- static getKeyFromValue<T>(keys: T, value: T[keyof T]): keyof T;
104
+ static getKeyFromValue<T extends object>(keys: T, value: T[keyof T]): keyof T;
105
105
  }
@@ -139,3 +139,4 @@ export class Utils {
139
139
  return Object.keys(keys)[values.indexOf(value)];
140
140
  }
141
141
  }
142
+ //# sourceMappingURL=Utils.js.map