@hedia/recommendation-screen 2.1.75-alpha.0 → 2.2.0-alpha.0

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 (393) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.js +5 -0
  3. package/{lib/typescript → dist/src}/RecommendationScreen.d.ts +68 -82
  4. package/dist/src/RecommendationScreen.js +522 -0
  5. package/dist/src/assets/assets/activity/Cyclist.png +0 -0
  6. package/dist/src/assets/assets/activity/Other.png +0 -0
  7. package/dist/src/assets/assets/activity/Runner.png +0 -0
  8. package/dist/src/assets/assets/activity/Swimmer.png +0 -0
  9. package/dist/src/assets/assets/activity/Walk.png +0 -0
  10. package/dist/src/assets/assets/fonts/Poppins-Bold.ttf +0 -0
  11. package/dist/src/assets/assets/fonts/Poppins-SemiBold.ttf +0 -0
  12. package/dist/src/assets/assets/icons/Edit.tsx +22 -0
  13. package/dist/src/assets/assets/icons/X.tsx +14 -0
  14. package/dist/src/assets/assets/mood/happy.png +0 -0
  15. package/dist/src/assets/assets/mood/happy_active.png +0 -0
  16. package/dist/src/assets/assets/mood/neutral.png +0 -0
  17. package/dist/src/assets/assets/mood/neutral_active.png +0 -0
  18. package/dist/src/assets/assets/mood/sad.png +0 -0
  19. package/dist/src/assets/assets/mood/sad_active.png +0 -0
  20. package/dist/src/assets/assets/mood/semi_happy.png +0 -0
  21. package/dist/src/assets/assets/mood/semi_happy_active.png +0 -0
  22. package/dist/src/assets/assets/mood/semi_sad.png +0 -0
  23. package/dist/src/assets/assets/mood/semi_sad_active.png +0 -0
  24. package/dist/src/assets/icons/Edit.d.ts +4 -0
  25. package/dist/src/assets/icons/Edit.js +7 -0
  26. package/dist/src/assets/icons/X.d.ts +4 -0
  27. package/dist/src/assets/icons/X.js +6 -0
  28. package/dist/src/components/ForecastInfoBar.d.ts +109 -0
  29. package/dist/src/components/ForecastInfoBar.js +138 -0
  30. package/dist/src/components/Header.d.ts +8 -0
  31. package/dist/src/components/Header.js +54 -0
  32. package/dist/src/components/Icon.d.ts +20 -0
  33. package/dist/src/components/Icon.js +43 -0
  34. package/{lib/typescript → dist/src}/components/InfoBars.d.ts +28 -14
  35. package/dist/src/components/InfoBars.js +128 -0
  36. package/{lib/typescript → dist/src}/components/InvisibleNumberInput.d.ts +3 -9
  37. package/dist/src/components/InvisibleNumberInput.js +121 -0
  38. package/dist/src/components/LimitationMessage.d.ts +14 -0
  39. package/dist/src/components/LimitationMessage.js +30 -0
  40. package/{lib/typescript → dist/src}/components/LineSeparator.d.ts +1 -6
  41. package/dist/src/components/LineSeparator.js +18 -0
  42. package/{lib/typescript → dist/src}/components/RecentInsulin.d.ts +1 -3
  43. package/dist/src/components/RecentInsulin.js +73 -0
  44. package/{lib/typescript → dist/src}/components/RecommendationModal.d.ts +63 -63
  45. package/dist/src/components/RecommendationModal.js +226 -0
  46. package/{lib/typescript → dist/src}/components/RecommendedCarbs.d.ts +0 -3
  47. package/dist/src/components/RecommendedCarbs.js +251 -0
  48. package/{lib/typescript → dist/src}/components/RecommendedInsulin.d.ts +1 -2
  49. package/dist/src/components/RecommendedInsulin.js +180 -0
  50. package/{lib/typescript → dist/src}/components/Remeasure.d.ts +15 -6
  51. package/dist/src/components/Remeasure.js +130 -0
  52. package/{lib/typescript/components/TransferToLogbook.d.ts → dist/src/components/SaveButton.d.ts} +2 -3
  53. package/dist/src/components/SaveButton.js +71 -0
  54. package/dist/src/components/TwoOptionModal.d.ts +136 -0
  55. package/dist/src/components/TwoOptionModal.js +141 -0
  56. package/{lib/typescript → dist/src}/components/activity/Activity.d.ts +2 -3
  57. package/dist/src/components/activity/Activity.js +84 -0
  58. package/{lib/typescript → dist/src}/components/activity/ActivityIcon.d.ts +7 -8
  59. package/dist/src/components/activity/ActivityIcon.js +58 -0
  60. package/{lib/typescript → dist/src}/components/activity/ActivityIntensity.d.ts +1 -2
  61. package/dist/src/components/activity/ActivityIntensity.js +58 -0
  62. package/{lib/typescript → dist/src}/components/mood/Emotion.d.ts +1 -2
  63. package/dist/src/components/mood/Emotion.js +64 -0
  64. package/{lib/typescript → dist/src}/components/mood/MoodIcon.d.ts +5 -5
  65. package/dist/src/components/mood/MoodIcon.js +63 -0
  66. package/dist/src/components/text/TextBold.d.ts +8 -0
  67. package/dist/src/components/text/TextBold.js +12 -0
  68. package/dist/src/components/text/TextRegular.d.ts +8 -0
  69. package/dist/src/components/text/TextRegular.js +12 -0
  70. package/dist/src/locale/da/messages.js +1 -0
  71. package/dist/src/locale/da/messages.po +349 -0
  72. package/dist/src/locale/de/messages.js +1 -0
  73. package/dist/src/locale/de/messages.po +349 -0
  74. package/dist/src/locale/en/messages.js +1 -0
  75. package/dist/src/locale/en/messages.po +349 -0
  76. package/dist/src/locale/es/messages.js +1 -0
  77. package/dist/src/locale/es/messages.po +349 -0
  78. package/dist/src/locale/fr/messages.js +1 -0
  79. package/dist/src/locale/fr/messages.po +349 -0
  80. package/dist/src/locale/i18nUtils.d.ts +18 -0
  81. package/dist/src/locale/i18nUtils.js +39 -0
  82. package/dist/src/locale/it/messages.js +1 -0
  83. package/dist/src/locale/it/messages.po +349 -0
  84. package/{lib/typescript → dist/src}/types/enum.d.ts +15 -22
  85. package/dist/src/types/enum.js +145 -0
  86. package/{lib/typescript → dist/src}/types/types.d.ts +0 -1
  87. package/dist/src/types/types.js +1 -0
  88. package/{lib/typescript → dist/src}/utils/AttentionMessages.d.ts +0 -1
  89. package/dist/src/utils/AttentionMessages.js +118 -0
  90. package/{lib/typescript → dist/src}/utils/Constants.d.ts +3 -18
  91. package/{lib/module → dist/src}/utils/Constants.js +21 -79
  92. package/{lib/typescript → dist/src}/utils/RecommendationError.d.ts +0 -1
  93. package/dist/src/utils/RecommendationError.js +63 -0
  94. package/{lib/typescript → dist/src}/utils/RecommendationUtils.d.ts +0 -1
  95. package/{lib/module → dist/src}/utils/RecommendationUtils.js +88 -90
  96. package/{lib/typescript → dist/src}/utils/Translations.d.ts +0 -1
  97. package/{lib/module → dist/src}/utils/Translations.js +5 -7
  98. package/{lib/typescript → dist/src}/utils/Utils.d.ts +1 -2
  99. package/dist/src/utils/Utils.js +141 -0
  100. package/{lib/typescript → dist/src}/utils/Validations.d.ts +1 -2
  101. package/{lib/module → dist/src}/utils/Validations.js +128 -156
  102. package/package.json +96 -109
  103. package/lib/commonjs/RecommendationScreen.js +0 -778
  104. package/lib/commonjs/RecommendationScreen.js.map +0 -1
  105. package/lib/commonjs/assets/IconsSVG/Close.js +0 -20
  106. package/lib/commonjs/assets/IconsSVG/Close.js.map +0 -1
  107. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js +0 -28
  108. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js.map +0 -1
  109. package/lib/commonjs/assets/IconsSVG/Edit.js +0 -23
  110. package/lib/commonjs/assets/IconsSVG/Edit.js.map +0 -1
  111. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js +0 -43
  112. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js.map +0 -1
  113. package/lib/commonjs/assets/IconsSVG/activity/Running.js +0 -33
  114. package/lib/commonjs/assets/IconsSVG/activity/Running.js.map +0 -1
  115. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js +0 -33
  116. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js.map +0 -1
  117. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js +0 -48
  118. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js.map +0 -1
  119. package/lib/commonjs/assets/IconsSVG/activity/Walking.js +0 -38
  120. package/lib/commonjs/assets/IconsSVG/activity/Walking.js.map +0 -1
  121. package/lib/commonjs/assets/IconsSVG/mood/Happy.js +0 -34
  122. package/lib/commonjs/assets/IconsSVG/mood/Happy.js.map +0 -1
  123. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js +0 -34
  124. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js.map +0 -1
  125. package/lib/commonjs/assets/IconsSVG/mood/Sad.js +0 -34
  126. package/lib/commonjs/assets/IconsSVG/mood/Sad.js.map +0 -1
  127. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js +0 -34
  128. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
  129. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js +0 -34
  130. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js.map +0 -1
  131. package/lib/commonjs/components/ExitModal.js +0 -124
  132. package/lib/commonjs/components/ExitModal.js.map +0 -1
  133. package/lib/commonjs/components/InfoBars.js +0 -123
  134. package/lib/commonjs/components/InfoBars.js.map +0 -1
  135. package/lib/commonjs/components/InvisibleNumberInput.js +0 -150
  136. package/lib/commonjs/components/InvisibleNumberInput.js.map +0 -1
  137. package/lib/commonjs/components/LineSeparator.js +0 -27
  138. package/lib/commonjs/components/LineSeparator.js.map +0 -1
  139. package/lib/commonjs/components/RecentInsulin.js +0 -105
  140. package/lib/commonjs/components/RecentInsulin.js.map +0 -1
  141. package/lib/commonjs/components/RecommendationModal.js +0 -302
  142. package/lib/commonjs/components/RecommendationModal.js.map +0 -1
  143. package/lib/commonjs/components/RecommendedCarbs.js +0 -289
  144. package/lib/commonjs/components/RecommendedCarbs.js.map +0 -1
  145. package/lib/commonjs/components/RecommendedInsulin.js +0 -209
  146. package/lib/commonjs/components/RecommendedInsulin.js.map +0 -1
  147. package/lib/commonjs/components/Remeasure.js +0 -131
  148. package/lib/commonjs/components/Remeasure.js.map +0 -1
  149. package/lib/commonjs/components/Text.js +0 -25
  150. package/lib/commonjs/components/Text.js.map +0 -1
  151. package/lib/commonjs/components/TimeoutModal.js +0 -113
  152. package/lib/commonjs/components/TimeoutModal.js.map +0 -1
  153. package/lib/commonjs/components/TransferToLogbook.js +0 -83
  154. package/lib/commonjs/components/TransferToLogbook.js.map +0 -1
  155. package/lib/commonjs/components/activity/Activity.js +0 -112
  156. package/lib/commonjs/components/activity/Activity.js.map +0 -1
  157. package/lib/commonjs/components/activity/ActivityIcon.js +0 -86
  158. package/lib/commonjs/components/activity/ActivityIcon.js.map +0 -1
  159. package/lib/commonjs/components/activity/ActivityIntensity.js +0 -65
  160. package/lib/commonjs/components/activity/ActivityIntensity.js.map +0 -1
  161. package/lib/commonjs/components/mood/Emotion.js +0 -86
  162. package/lib/commonjs/components/mood/Emotion.js.map +0 -1
  163. package/lib/commonjs/components/mood/MoodIcon.js +0 -107
  164. package/lib/commonjs/components/mood/MoodIcon.js.map +0 -1
  165. package/lib/commonjs/components/styles/fonts.js +0 -160
  166. package/lib/commonjs/components/styles/fonts.js.map +0 -1
  167. package/lib/commonjs/index.js +0 -21
  168. package/lib/commonjs/index.js.map +0 -1
  169. package/lib/commonjs/locales/da/translations.json +0 -82
  170. package/lib/commonjs/locales/de/translations.json +0 -81
  171. package/lib/commonjs/locales/en/translations.json +0 -84
  172. package/lib/commonjs/locales/es/translations.json +0 -81
  173. package/lib/commonjs/locales/fr/translations.json +0 -81
  174. package/lib/commonjs/locales/it/translations.json +0 -81
  175. package/lib/commonjs/locales/translate.js +0 -63
  176. package/lib/commonjs/locales/translate.js.map +0 -1
  177. package/lib/commonjs/types/enum.js +0 -179
  178. package/lib/commonjs/types/enum.js.map +0 -1
  179. package/lib/commonjs/types/types.js +0 -6
  180. package/lib/commonjs/types/types.js.map +0 -1
  181. package/lib/commonjs/utils/AttentionMessages.js +0 -141
  182. package/lib/commonjs/utils/AttentionMessages.js.map +0 -1
  183. package/lib/commonjs/utils/Constants.js +0 -138
  184. package/lib/commonjs/utils/Constants.js.map +0 -1
  185. package/lib/commonjs/utils/RecommendationError.js +0 -116
  186. package/lib/commonjs/utils/RecommendationError.js.map +0 -1
  187. package/lib/commonjs/utils/RecommendationUtils.js +0 -212
  188. package/lib/commonjs/utils/RecommendationUtils.js.map +0 -1
  189. package/lib/commonjs/utils/Translations.js +0 -22
  190. package/lib/commonjs/utils/Translations.js.map +0 -1
  191. package/lib/commonjs/utils/Utils.js +0 -162
  192. package/lib/commonjs/utils/Utils.js.map +0 -1
  193. package/lib/commonjs/utils/Validations.js +0 -468
  194. package/lib/commonjs/utils/Validations.js.map +0 -1
  195. package/lib/module/RecommendationScreen.js +0 -768
  196. package/lib/module/RecommendationScreen.js.map +0 -1
  197. package/lib/module/assets/IconsSVG/Close.js +0 -11
  198. package/lib/module/assets/IconsSVG/Close.js.map +0 -1
  199. package/lib/module/assets/IconsSVG/CloseOutlined.js +0 -19
  200. package/lib/module/assets/IconsSVG/CloseOutlined.js.map +0 -1
  201. package/lib/module/assets/IconsSVG/Edit.js +0 -14
  202. package/lib/module/assets/IconsSVG/Edit.js.map +0 -1
  203. package/lib/module/assets/IconsSVG/activity/Cycling.js +0 -34
  204. package/lib/module/assets/IconsSVG/activity/Cycling.js.map +0 -1
  205. package/lib/module/assets/IconsSVG/activity/Running.js +0 -24
  206. package/lib/module/assets/IconsSVG/activity/Running.js.map +0 -1
  207. package/lib/module/assets/IconsSVG/activity/Stretching.js +0 -24
  208. package/lib/module/assets/IconsSVG/activity/Stretching.js.map +0 -1
  209. package/lib/module/assets/IconsSVG/activity/Swimming.js +0 -39
  210. package/lib/module/assets/IconsSVG/activity/Swimming.js.map +0 -1
  211. package/lib/module/assets/IconsSVG/activity/Walking.js +0 -29
  212. package/lib/module/assets/IconsSVG/activity/Walking.js.map +0 -1
  213. package/lib/module/assets/IconsSVG/mood/Happy.js +0 -25
  214. package/lib/module/assets/IconsSVG/mood/Happy.js.map +0 -1
  215. package/lib/module/assets/IconsSVG/mood/Neutral.js +0 -25
  216. package/lib/module/assets/IconsSVG/mood/Neutral.js.map +0 -1
  217. package/lib/module/assets/IconsSVG/mood/Sad.js +0 -25
  218. package/lib/module/assets/IconsSVG/mood/Sad.js.map +0 -1
  219. package/lib/module/assets/IconsSVG/mood/SemiHappy.js +0 -25
  220. package/lib/module/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
  221. package/lib/module/assets/IconsSVG/mood/SemiSad.js +0 -25
  222. package/lib/module/assets/IconsSVG/mood/SemiSad.js.map +0 -1
  223. package/lib/module/components/ExitModal.js +0 -114
  224. package/lib/module/components/ExitModal.js.map +0 -1
  225. package/lib/module/components/InfoBars.js +0 -114
  226. package/lib/module/components/InfoBars.js.map +0 -1
  227. package/lib/module/components/InvisibleNumberInput.js +0 -142
  228. package/lib/module/components/InvisibleNumberInput.js.map +0 -1
  229. package/lib/module/components/LineSeparator.js +0 -19
  230. package/lib/module/components/LineSeparator.js.map +0 -1
  231. package/lib/module/components/RecentInsulin.js +0 -97
  232. package/lib/module/components/RecentInsulin.js.map +0 -1
  233. package/lib/module/components/RecommendationModal.js +0 -291
  234. package/lib/module/components/RecommendationModal.js.map +0 -1
  235. package/lib/module/components/RecommendedCarbs.js +0 -281
  236. package/lib/module/components/RecommendedCarbs.js.map +0 -1
  237. package/lib/module/components/RecommendedInsulin.js +0 -201
  238. package/lib/module/components/RecommendedInsulin.js.map +0 -1
  239. package/lib/module/components/Remeasure.js +0 -123
  240. package/lib/module/components/Remeasure.js.map +0 -1
  241. package/lib/module/components/Text.js +0 -16
  242. package/lib/module/components/Text.js.map +0 -1
  243. package/lib/module/components/TimeoutModal.js +0 -103
  244. package/lib/module/components/TimeoutModal.js.map +0 -1
  245. package/lib/module/components/TransferToLogbook.js +0 -75
  246. package/lib/module/components/TransferToLogbook.js.map +0 -1
  247. package/lib/module/components/activity/Activity.js +0 -104
  248. package/lib/module/components/activity/Activity.js.map +0 -1
  249. package/lib/module/components/activity/ActivityIcon.js +0 -78
  250. package/lib/module/components/activity/ActivityIcon.js.map +0 -1
  251. package/lib/module/components/activity/ActivityIntensity.js +0 -57
  252. package/lib/module/components/activity/ActivityIntensity.js.map +0 -1
  253. package/lib/module/components/mood/Emotion.js +0 -78
  254. package/lib/module/components/mood/Emotion.js.map +0 -1
  255. package/lib/module/components/mood/MoodIcon.js +0 -97
  256. package/lib/module/components/mood/MoodIcon.js.map +0 -1
  257. package/lib/module/components/styles/fonts.js +0 -152
  258. package/lib/module/components/styles/fonts.js.map +0 -1
  259. package/lib/module/index.js +0 -5
  260. package/lib/module/index.js.map +0 -1
  261. package/lib/module/locales/da/translations.json +0 -82
  262. package/lib/module/locales/de/translations.json +0 -81
  263. package/lib/module/locales/en/translations.json +0 -84
  264. package/lib/module/locales/es/translations.json +0 -81
  265. package/lib/module/locales/fr/translations.json +0 -81
  266. package/lib/module/locales/it/translations.json +0 -81
  267. package/lib/module/locales/translate.js +0 -55
  268. package/lib/module/locales/translate.js.map +0 -1
  269. package/lib/module/types/enum.js +0 -170
  270. package/lib/module/types/enum.js.map +0 -1
  271. package/lib/module/types/types.js +0 -2
  272. package/lib/module/types/types.js.map +0 -1
  273. package/lib/module/utils/AttentionMessages.js +0 -131
  274. package/lib/module/utils/AttentionMessages.js.map +0 -1
  275. package/lib/module/utils/Constants.js.map +0 -1
  276. package/lib/module/utils/RecommendationError.js +0 -87
  277. package/lib/module/utils/RecommendationError.js.map +0 -1
  278. package/lib/module/utils/RecommendationUtils.js.map +0 -1
  279. package/lib/module/utils/Translations.js.map +0 -1
  280. package/lib/module/utils/Utils.js +0 -155
  281. package/lib/module/utils/Utils.js.map +0 -1
  282. package/lib/module/utils/Validations.js.map +0 -1
  283. package/lib/typescript/RecommendationScreen.d.ts.map +0 -1
  284. package/lib/typescript/assets/IconsSVG/Close.d.ts +0 -5
  285. package/lib/typescript/assets/IconsSVG/Close.d.ts.map +0 -1
  286. package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts +0 -5
  287. package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts.map +0 -1
  288. package/lib/typescript/assets/IconsSVG/Edit.d.ts +0 -5
  289. package/lib/typescript/assets/IconsSVG/Edit.d.ts.map +0 -1
  290. package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts +0 -5
  291. package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts.map +0 -1
  292. package/lib/typescript/assets/IconsSVG/activity/Running.d.ts +0 -5
  293. package/lib/typescript/assets/IconsSVG/activity/Running.d.ts.map +0 -1
  294. package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts +0 -5
  295. package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts.map +0 -1
  296. package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts +0 -5
  297. package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts.map +0 -1
  298. package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts +0 -5
  299. package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts.map +0 -1
  300. package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts +0 -5
  301. package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts.map +0 -1
  302. package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts +0 -5
  303. package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts.map +0 -1
  304. package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts +0 -5
  305. package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts.map +0 -1
  306. package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts +0 -5
  307. package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts.map +0 -1
  308. package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts +0 -5
  309. package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts.map +0 -1
  310. package/lib/typescript/components/ExitModal.d.ts +0 -26
  311. package/lib/typescript/components/ExitModal.d.ts.map +0 -1
  312. package/lib/typescript/components/InfoBars.d.ts.map +0 -1
  313. package/lib/typescript/components/InvisibleNumberInput.d.ts.map +0 -1
  314. package/lib/typescript/components/LineSeparator.d.ts.map +0 -1
  315. package/lib/typescript/components/RecentInsulin.d.ts.map +0 -1
  316. package/lib/typescript/components/RecommendationModal.d.ts.map +0 -1
  317. package/lib/typescript/components/RecommendedCarbs.d.ts.map +0 -1
  318. package/lib/typescript/components/RecommendedInsulin.d.ts.map +0 -1
  319. package/lib/typescript/components/Remeasure.d.ts.map +0 -1
  320. package/lib/typescript/components/Text.d.ts +0 -14
  321. package/lib/typescript/components/Text.d.ts.map +0 -1
  322. package/lib/typescript/components/TimeoutModal.d.ts +0 -25
  323. package/lib/typescript/components/TimeoutModal.d.ts.map +0 -1
  324. package/lib/typescript/components/TransferToLogbook.d.ts.map +0 -1
  325. package/lib/typescript/components/activity/Activity.d.ts.map +0 -1
  326. package/lib/typescript/components/activity/ActivityIcon.d.ts.map +0 -1
  327. package/lib/typescript/components/activity/ActivityIntensity.d.ts.map +0 -1
  328. package/lib/typescript/components/mood/Emotion.d.ts.map +0 -1
  329. package/lib/typescript/components/mood/MoodIcon.d.ts.map +0 -1
  330. package/lib/typescript/components/styles/fonts.d.ts +0 -151
  331. package/lib/typescript/components/styles/fonts.d.ts.map +0 -1
  332. package/lib/typescript/index.d.ts +0 -5
  333. package/lib/typescript/index.d.ts.map +0 -1
  334. package/lib/typescript/locales/translate.d.ts +0 -20
  335. package/lib/typescript/locales/translate.d.ts.map +0 -1
  336. package/lib/typescript/types/enum.d.ts.map +0 -1
  337. package/lib/typescript/types/types.d.ts.map +0 -1
  338. package/lib/typescript/utils/AttentionMessages.d.ts.map +0 -1
  339. package/lib/typescript/utils/Constants.d.ts.map +0 -1
  340. package/lib/typescript/utils/RecommendationError.d.ts.map +0 -1
  341. package/lib/typescript/utils/RecommendationUtils.d.ts.map +0 -1
  342. package/lib/typescript/utils/Translations.d.ts.map +0 -1
  343. package/lib/typescript/utils/Utils.d.ts.map +0 -1
  344. package/lib/typescript/utils/Validations.d.ts.map +0 -1
  345. package/src/RecommendationScreen.tsx +0 -854
  346. package/src/assets/IconsSVG/Close.tsx +0 -13
  347. package/src/assets/IconsSVG/CloseOutlined.tsx +0 -23
  348. package/src/assets/IconsSVG/Edit.tsx +0 -16
  349. package/src/assets/IconsSVG/activity/Cycling.tsx +0 -41
  350. package/src/assets/IconsSVG/activity/Running.tsx +0 -29
  351. package/src/assets/IconsSVG/activity/Stretching.tsx +0 -29
  352. package/src/assets/IconsSVG/activity/Swimming.tsx +0 -47
  353. package/src/assets/IconsSVG/activity/Walking.tsx +0 -35
  354. package/src/assets/IconsSVG/mood/Happy.tsx +0 -30
  355. package/src/assets/IconsSVG/mood/Neutral.tsx +0 -30
  356. package/src/assets/IconsSVG/mood/Sad.tsx +0 -30
  357. package/src/assets/IconsSVG/mood/SemiHappy.tsx +0 -30
  358. package/src/assets/IconsSVG/mood/SemiSad.tsx +0 -30
  359. package/src/components/ExitModal.tsx +0 -134
  360. package/src/components/InfoBars.tsx +0 -122
  361. package/src/components/InvisibleNumberInput.tsx +0 -170
  362. package/src/components/LineSeparator.tsx +0 -29
  363. package/src/components/RecentInsulin.tsx +0 -109
  364. package/src/components/RecommendationModal.tsx +0 -319
  365. package/src/components/RecommendedCarbs.tsx +0 -303
  366. package/src/components/RecommendedInsulin.tsx +0 -220
  367. package/src/components/Remeasure.tsx +0 -135
  368. package/src/components/Text.tsx +0 -27
  369. package/src/components/TimeoutModal.tsx +0 -121
  370. package/src/components/TransferToLogbook.tsx +0 -92
  371. package/src/components/activity/Activity.tsx +0 -107
  372. package/src/components/activity/ActivityIcon.tsx +0 -77
  373. package/src/components/activity/ActivityIntensity.tsx +0 -67
  374. package/src/components/mood/Emotion.tsx +0 -97
  375. package/src/components/mood/MoodIcon.tsx +0 -91
  376. package/src/components/styles/fonts.ts +0 -151
  377. package/src/index.ts +0 -5
  378. package/src/locales/da/translations.json +0 -82
  379. package/src/locales/de/translations.json +0 -81
  380. package/src/locales/en/translations.json +0 -84
  381. package/src/locales/es/translations.json +0 -81
  382. package/src/locales/fr/translations.json +0 -81
  383. package/src/locales/it/translations.json +0 -81
  384. package/src/locales/translate.ts +0 -62
  385. package/src/types/enum.ts +0 -164
  386. package/src/types/types.ts +0 -19
  387. package/src/utils/AttentionMessages.ts +0 -167
  388. package/src/utils/Constants.ts +0 -77
  389. package/src/utils/RecommendationError.ts +0 -182
  390. package/src/utils/RecommendationUtils.ts +0 -232
  391. package/src/utils/Translations.ts +0 -17
  392. package/src/utils/Utils.ts +0 -156
  393. package/src/utils/Validations.ts +0 -490
@@ -1,170 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-namespace */
2
- /** Namespace containing data required by component testing */
3
- export let Testing;
4
-
5
- /**
6
- * Indicator of which error has happened.
7
- * See the corresponding RecommendationError {@link RecommendationError} for details.
8
- */
9
- (function (_Testing) {
10
- let Id;
11
- (function (_Id) {
12
- let RecommendationScreenTestIds;
13
- (function (RecommendationScreenTestIds) {
14
- RecommendationScreenTestIds["RecommendationScrollView"] = "recommendation-screen-scroll-view";
15
- })(RecommendationScreenTestIds || (RecommendationScreenTestIds = {}));
16
- _Id.RecommendationScreenTestIds = RecommendationScreenTestIds;
17
- let ActivityTestIds;
18
- (function (ActivityTestIds) {
19
- ActivityTestIds["ActivityDuration"] = "activity-duration-minutes";
20
- ActivityTestIds["ActivityReduction"] = "activity-reduction-percentage";
21
- })(ActivityTestIds || (ActivityTestIds = {}));
22
- _Id.ActivityTestIds = ActivityTestIds;
23
- let RecentInsulinTestIds;
24
- (function (RecentInsulinTestIds) {
25
- RecentInsulinTestIds["No"] = "recent-insulin-no";
26
- RecentInsulinTestIds["Yes"] = "recent-insulin-yes";
27
- })(RecentInsulinTestIds || (RecentInsulinTestIds = {}));
28
- _Id.RecentInsulinTestIds = RecentInsulinTestIds;
29
- let RecommendedCarbsTestIds;
30
- (function (RecommendedCarbsTestIds) {
31
- RecommendedCarbsTestIds["RecommendedCarbs"] = "recommended-carbs";
32
- RecommendedCarbsTestIds["EditRecommendedCarbs"] = "edit-recommended-carbs";
33
- RecommendedCarbsTestIds["InvisibleCarbInput"] = "invisible-recommended-carbs-input";
34
- RecommendedCarbsTestIds["EnteredCarbs"] = "entered-carbs";
35
- RecommendedCarbsTestIds["RemoveRecommendation"] = "remove-carb-recommendation";
36
- RecommendedCarbsTestIds["TotalCarbs"] = "total-carbs";
37
- })(RecommendedCarbsTestIds || (RecommendedCarbsTestIds = {}));
38
- _Id.RecommendedCarbsTestIds = RecommendedCarbsTestIds;
39
- let RecommendedInsulinTestIds;
40
- (function (RecommendedInsulinTestIds) {
41
- RecommendedInsulinTestIds["EditRecommendedInsulinIcon"] = "edit-recommended-insulin-icon";
42
- RecommendedInsulinTestIds["EditRecommendedInsulin"] = "edit-recommended-insulin";
43
- RecommendedInsulinTestIds["InvisibleInsulinInput"] = "invisible-recommended-insulin-input";
44
- RecommendedInsulinTestIds["ShownInsulinText"] = "shown-insulin-text";
45
- })(RecommendedInsulinTestIds || (RecommendedInsulinTestIds = {}));
46
- _Id.RecommendedInsulinTestIds = RecommendedInsulinTestIds;
47
- let RecommendationModalTestIds;
48
- (function (RecommendationModalTestIds) {
49
- RecommendationModalTestIds["DeclineCarbs"] = "recommendation-modal-decline-carbs";
50
- RecommendationModalTestIds["AcceptCarbs"] = "recommendation-modal-accept-carbs";
51
- RecommendationModalTestIds["OkButton"] = "recommendation-modal-ok-button";
52
- RecommendationModalTestIds["LimitationOkButton"] = "limitation-message-ok-button";
53
- RecommendationModalTestIds["SuggestedCarbs"] = "recommendation-modal-suggested-carbs";
54
- })(RecommendationModalTestIds || (RecommendationModalTestIds = {}));
55
- _Id.RecommendationModalTestIds = RecommendationModalTestIds;
56
- let RemeasureTestIds;
57
- (function (RemeasureTestIds) {
58
- RemeasureTestIds["RemeasureSlider"] = "remeasure-slider";
59
- RemeasureTestIds["RemeasureHours"] = "remeasure-hours";
60
- })(RemeasureTestIds || (RemeasureTestIds = {}));
61
- _Id.RemeasureTestIds = RemeasureTestIds;
62
- let TransferToLogbookTestIds;
63
- (function (TransferToLogbookTestIds) {
64
- TransferToLogbookTestIds["TransferButton"] = "transfer-to-logbook-button";
65
- })(TransferToLogbookTestIds || (TransferToLogbookTestIds = {}));
66
- _Id.TransferToLogbookTestIds = TransferToLogbookTestIds;
67
- let ExitModalTestIds;
68
- (function (ExitModalTestIds) {
69
- ExitModalTestIds["ExitButton"] = "exit-two-option-modal";
70
- ExitModalTestIds["FirstOption"] = "first-option-button";
71
- ExitModalTestIds["SecondOption"] = "second-option-button";
72
- })(ExitModalTestIds || (ExitModalTestIds = {}));
73
- _Id.ExitModalTestIds = ExitModalTestIds;
74
- let TimeOutModalTestIds;
75
- (function (TimeOutModalTestIds) {
76
- TimeOutModalTestIds["ExitButton"] = "exit-two-option-modal";
77
- TimeOutModalTestIds["FirstOption"] = "first-option-button";
78
- TimeOutModalTestIds["SecondOption"] = "second-option-button";
79
- })(TimeOutModalTestIds || (TimeOutModalTestIds = {}));
80
- _Id.TimeOutModalTestIds = TimeOutModalTestIds;
81
- let InfoBarTestIds;
82
- (function (_InfoBarTestIds) {
83
- let Value;
84
- (function (Value) {
85
- Value["BloodKetone"] = "blood-ketone-value";
86
- Value["BloodGlucose"] = "blood-glucose-value";
87
- Value["ActiveInsulin"] = "active-insulin-value";
88
- })(Value || (Value = {}));
89
- _InfoBarTestIds.Value = Value;
90
- let Label;
91
- (function (Label) {
92
- Label["BloodKetone"] = "blood-ketone-label";
93
- Label["BloodGlucose"] = "blood-glucose-label";
94
- Label["ActiveInsulin"] = "active-insulin-label";
95
- })(Label || (Label = {}));
96
- _InfoBarTestIds.Label = Label;
97
- let Unit;
98
- (function (Unit) {
99
- Unit["BloodKetone"] = "blood-ketone-unit";
100
- Unit["BloodGlucose"] = "blood-glucose-unit";
101
- Unit["ActiveInsulin"] = "active-insulin-unit";
102
- })(Unit || (Unit = {}));
103
- _InfoBarTestIds.Unit = Unit;
104
- })(InfoBarTestIds || (InfoBarTestIds = _Id.InfoBarTestIds || (_Id.InfoBarTestIds = {})));
105
- })(Id || (Id = _Testing.Id || (_Testing.Id = {})));
106
- let Types;
107
- (function (_Types) {})(Types || (Types = _Testing.Types || (_Testing.Types = {})));
108
- })(Testing || (Testing = {}));
109
- export let RecommendationErrorEnum;
110
-
111
- /** Indicates the category of the user’s blood glucose level. */
112
- (function (RecommendationErrorEnum) {
113
- RecommendationErrorEnum[RecommendationErrorEnum["ActivityDuration"] = 0] = "ActivityDuration";
114
- RecommendationErrorEnum[RecommendationErrorEnum["ActivityTargetBGL"] = 1] = "ActivityTargetBGL";
115
- RecommendationErrorEnum[RecommendationErrorEnum["ActivitySettings"] = 2] = "ActivitySettings";
116
- RecommendationErrorEnum[RecommendationErrorEnum["ActivityDate"] = 3] = "ActivityDate";
117
- RecommendationErrorEnum[RecommendationErrorEnum["ActivityIntensity"] = 4] = "ActivityIntensity";
118
- RecommendationErrorEnum[RecommendationErrorEnum["ActivityType"] = 5] = "ActivityType";
119
- RecommendationErrorEnum[RecommendationErrorEnum["BolusInsulinDose"] = 6] = "BolusInsulinDose";
120
- RecommendationErrorEnum[RecommendationErrorEnum["BolusInsulinSecondsPassed"] = 7] = "BolusInsulinSecondsPassed";
121
- RecommendationErrorEnum[RecommendationErrorEnum["RecentBolus"] = 8] = "RecentBolus";
122
- RecommendationErrorEnum[RecommendationErrorEnum["CarbohydrateLimit"] = 9] = "CarbohydrateLimit";
123
- RecommendationErrorEnum[RecommendationErrorEnum["InsulinSensitivity"] = 10] = "InsulinSensitivity";
124
- RecommendationErrorEnum[RecommendationErrorEnum["InsulinToCarbsRatio"] = 11] = "InsulinToCarbsRatio";
125
- RecommendationErrorEnum[RecommendationErrorEnum["LatestLogbook6HoursBGL"] = 12] = "LatestLogbook6HoursBGL";
126
- RecommendationErrorEnum[RecommendationErrorEnum["CurrentBGL"] = 13] = "CurrentBGL";
127
- RecommendationErrorEnum[RecommendationErrorEnum["CurrentBKL"] = 14] = "CurrentBKL";
128
- RecommendationErrorEnum[RecommendationErrorEnum["TargetBGL"] = 15] = "TargetBGL";
129
- RecommendationErrorEnum[RecommendationErrorEnum["UserReminder"] = 16] = "UserReminder";
130
- RecommendationErrorEnum[RecommendationErrorEnum["Language"] = 17] = "Language";
131
- RecommendationErrorEnum[RecommendationErrorEnum["InjectionMethod"] = 18] = "InjectionMethod";
132
- RecommendationErrorEnum[RecommendationErrorEnum["BloodKetoneUnit"] = 19] = "BloodKetoneUnit";
133
- RecommendationErrorEnum[RecommendationErrorEnum["BloodGlucoseUnit"] = 20] = "BloodGlucoseUnit";
134
- RecommendationErrorEnum[RecommendationErrorEnum["BloodKetoneProps"] = 21] = "BloodKetoneProps";
135
- })(RecommendationErrorEnum || (RecommendationErrorEnum = {}));
136
- export let BgLevel;
137
-
138
- /** The possible initial recommendation times with values in hours. */
139
- (function (BgLevel) {
140
- BgLevel[BgLevel["SevereHypoglycemia"] = 0] = "SevereHypoglycemia";
141
- BgLevel[BgLevel["Hypoglycemia"] = 1] = "Hypoglycemia";
142
- BgLevel[BgLevel["MildHypoglycemia"] = 2] = "MildHypoglycemia";
143
- BgLevel[BgLevel["Normoglycemia"] = 3] = "Normoglycemia";
144
- BgLevel[BgLevel["NormoglycemiaUnder5MMOL"] = 4] = "NormoglycemiaUnder5MMOL";
145
- BgLevel[BgLevel["MildHyperglycemia"] = 5] = "MildHyperglycemia";
146
- BgLevel[BgLevel["Hyperglycemia"] = 6] = "Hyperglycemia";
147
- BgLevel[BgLevel["SevereHyperglycemia"] = 7] = "SevereHyperglycemia";
148
- BgLevel[BgLevel["UnsupportedBGLevel"] = 8] = "UnsupportedBGLevel";
149
- BgLevel[BgLevel["BGLevelNotProvided"] = 9] = "BGLevelNotProvided";
150
- })(BgLevel || (BgLevel = {}));
151
- export let RecommendationReminders;
152
- (function (RecommendationReminders) {
153
- RecommendationReminders[RecommendationReminders["ReminderOff"] = 0] = "ReminderOff";
154
- RecommendationReminders[RecommendationReminders["Reminder15Minutes"] = 0.25] = "Reminder15Minutes";
155
- RecommendationReminders[RecommendationReminders["Reminder60Minutes"] = 1] = "Reminder60Minutes";
156
- RecommendationReminders[RecommendationReminders["HediaReminderDefault"] = 1.5] = "HediaReminderDefault";
157
- })(RecommendationReminders || (RecommendationReminders = {}));
158
- export let ExitModalActions;
159
- (function (ExitModalActions) {
160
- ExitModalActions["CloseCalculation"] = "CloseCalculation";
161
- ExitModalActions["Transfer"] = "Transfer";
162
- ExitModalActions["Hide"] = "Hide";
163
- })(ExitModalActions || (ExitModalActions = {}));
164
- export let TimeoutModalActions;
165
- (function (TimeoutModalActions) {
166
- TimeoutModalActions["CloseCalculation"] = "CloseCalculation";
167
- TimeoutModalActions["RestartCalculation"] = "RestartCalculation";
168
- TimeoutModalActions["Transfer"] = "Transfer";
169
- })(TimeoutModalActions || (TimeoutModalActions = {}));
170
- //# sourceMappingURL=enum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Testing","_Testing","Id","_Id","RecommendationScreenTestIds","ActivityTestIds","RecentInsulinTestIds","RecommendedCarbsTestIds","RecommendedInsulinTestIds","RecommendationModalTestIds","RemeasureTestIds","TransferToLogbookTestIds","ExitModalTestIds","TimeOutModalTestIds","InfoBarTestIds","_InfoBarTestIds","Value","Label","Unit","Types","_Types","RecommendationErrorEnum","BgLevel","RecommendationReminders","ExitModalActions","TimeoutModalActions"],"sourceRoot":"../../../src","sources":["types/enum.ts"],"mappings":"AAAA;AACA;AACA,WAAAA,OAAA;;AAoGA;AACA;AACA;AACA;AAHA,WAAAC,QAAA;EAAA,IAAAC,EAAA;EAAA,WAAAC,GAAA;IAAA,IAjGcC,2BAA2B;IAAA,WAA3BA,2BAA2B;MAA3BA,2BAA2B;IAAA,GAA3BA,2BAA2B,KAA3BA,2BAA2B;IAAAD,GAAA,CAAAC,2BAAA,GAAAA,2BAAA;IAAA,IAI3BC,eAAe;IAAA,WAAfA,eAAe;MAAfA,eAAe;MAAfA,eAAe;IAAA,GAAfA,eAAe,KAAfA,eAAe;IAAAF,GAAA,CAAAE,eAAA,GAAAA,eAAA;IAAA,IAKfC,oBAAoB;IAAA,WAApBA,oBAAoB;MAApBA,oBAAoB;MAApBA,oBAAoB;IAAA,GAApBA,oBAAoB,KAApBA,oBAAoB;IAAAH,GAAA,CAAAG,oBAAA,GAAAA,oBAAA;IAAA,IAKpBC,uBAAuB;IAAA,WAAvBA,uBAAuB;MAAvBA,uBAAuB;MAAvBA,uBAAuB;MAAvBA,uBAAuB;MAAvBA,uBAAuB;MAAvBA,uBAAuB;MAAvBA,uBAAuB;IAAA,GAAvBA,uBAAuB,KAAvB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ourceRoot":"../../../src","sources":["types/types.ts"],"mappings":""}
@@ -1,131 +0,0 @@
1
- import moment from "moment";
2
- import { BolusCalculator } from "@hedia/types";
3
- import { t } from "../locales/translate";
4
-
5
- /** Provides methods for getting variants of attention messages */
6
- export const AttentionMessage = {
7
- /**
8
- * @return Concatenation of:
9
- * {@link Messages.VeryLowBGL} +
10
- * {@link Messages.Reminder15Minutes}
11
- */
12
- SevereHypoglycemia: () => `${Messages.VeryLowBGL()}${`\n`}${Messages.Reminder15Minutes()}`,
13
- /**
14
- * @return Concatenation of:
15
- * {@link Messages.LowBGL} +
16
- * {@link Messages.Reminder15Minutes}
17
- */
18
- Hypoglycemia: () => `${Messages.LowBGL()}${`\n`}${Messages.Reminder15Minutes()}`,
19
- /** @return The value of: {@link Messages.Reminder15Minutes} */
20
- MildHypoglycemia: () => Messages.Reminder15Minutes(),
21
- /** @return The value of: {@link Messages.PostponePhysicalActivityUnder5MMOL} */
22
- NormoglycemiaActivityUnder5MMOL: () => Messages.PostponePhysicalActivityUnder5MMOL(),
23
- /**
24
- * @return Concatenation of:
25
- * {@link Messages.HighBGL} +
26
- * {@link Messages.InsulinKetones} +
27
- * {@link Messages.Reminder15Minutes} +
28
- * {@link Messages.PostponePhysicalActivity}
29
- */
30
- HyperglycemiaActivity: () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`,
31
- /**
32
- * @return Concatenation of:
33
- * {@link Messages.HighBGL} +
34
- * {@link Messages.InsulinKetones}
35
- */
36
- SevereHyperglycemia: () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}`,
37
- /**
38
- * @return Concatenation of:
39
- * {@link Messages.HighBGL} +
40
- * {@link Messages.InsulinKetones} +
41
- * {@link Messages.Reminder15Minutes} +
42
- * {@link Messages.PostponePhysicalActivity}
43
- */
44
- SevereHyperglycemiaActivity: () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`,
45
- /** no message provided for this level */
46
- BGLevelNotProvided: null,
47
- /** no message provided for this level*/
48
- Hyperglycemia: null,
49
- /** no message provided for this level */
50
- MildHyperglycemia: null,
51
- /** no message provided for this level */
52
- Normoglycemia: null,
53
- /** no message provided for this level */
54
- NormoglycemiaUnder5MMOL: null,
55
- /** no message provided for this level */
56
- UnsupportedBGLevel: null
57
- };
58
-
59
- /**
60
- * @param message The message to append the {@link Messages.PostponePhysicalActivityUnder5MMOL} to
61
- * @returns The initial messaged concatenated with the {@link Messages.PostponePhysicalActivityUnder5MMOL}
62
- */
63
- export function addPostponeActivityMessageUnder5MMOL(message) {
64
- return `${message}${`\n`}${Messages.PostponePhysicalActivityUnder5MMOL()}`;
65
- }
66
- const SAFETY_INSULIN_LIMIT = BolusCalculator.Constants.SAFETY_INSULIN_LIMIT;
67
-
68
- /**
69
- * Calculate the limited insulin value based on the physical activity reduction value
70
- * @param reduction The reduction percentage an activity reduce the total insulin intake
71
- * @returns The limited insulin value.
72
- */
73
- export function getLimitedValue(reduction) {
74
- return SAFETY_INSULIN_LIMIT - SAFETY_INSULIN_LIMIT * reduction;
75
- }
76
-
77
- /** Provides methods for getting strings for composing attention messages and other important communications to the user. */
78
- export class Messages {
79
- /** Inform the user that their BGL is very low and what they should do about it. */
80
- static VeryLowBGL = () => t(`Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.`);
81
- /** Inform the user that their BGL is very low. */
82
- static LowBGL = () => t(`Your blood glucose level is very low.`);
83
- /** Inform the user that they will be reminded to remeasure their BGL soon. */
84
- static Reminder15Minutes = () => t(`You will be reminded to measure your blood glucose level in 15 min.`);
85
- /** Encourages the user to postpone exercise. Specifically when their BGL is high. */
86
- static PostponePhysicalActivity = () => t(`If it is possible, postpone your planned exercise.`);
87
- /** Encourages the user to postpone exercise. Specifically when their BGL is low. */
88
- static PostponePhysicalActivityUnder5MMOL = () => t(`Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.`);
89
- /** Inform about high BGL. */
90
- static HighBGL = () => t(`You have a high blood glucose level.`);
91
- /** Encourage user to measure ketones. */
92
- static InsulinKetones = () => t(`You should take rapid-acting insulin and measure ketones.`);
93
- /** Inform the user that their insulin recommendation was limited for safety. */
94
- static RecommendationWasLimited = () => t(`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.`, {
95
- SAFETY_INSULIN_LIMIT
96
- });
97
- /** Inform the user that their insulin recommendation was limited for safety in combination with an activity. */
98
- static RecommendationWasLimitedActivity = activityReduction => t(`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}.`, {
99
- 0: getLimitedValue(activityReduction),
100
- 1: `\n\n`,
101
- SAFETY_INSULIN_LIMIT,
102
- 2: (activityReduction * 100).toFixed(0),
103
- 3: getLimitedValue(activityReduction)
104
- });
105
- /** Inform the user that the insulin amount they entered is above HDA’s safety limit. */
106
- static InsulinInputWasLimited = activityReduction => activityReduction ? 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 {0}% to {1} units for this calculation.`, {
107
- SAFETY_INSULIN_LIMIT,
108
- 0: (activityReduction * 100).toFixed(0),
109
- 1: getLimitedValue(activityReduction)
110
- }) : t(`Hedia does not support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.`, {
111
- SAFETY_INSULIN_LIMIT
112
- });
113
- /** Title for the modal that informs the user that their calculation is too old. */
114
- static TimeoutPrompTitle = () => t(`More than 15 minutes has passed since this calculation was started.`);
115
- /**
116
- * Inform the user that their recommendation calculation is too old.
117
- * Variant to show when they didn’t see the actual insulin recommendation because they didn’t tell whether they injected insulin recently.
118
- */
119
- static TimeoutRecommendationNotVisible = () => t(`Please go through the calculation steps with new measurements to ensure a safe recommendation.`);
120
- /** Inform the user that their recommendation calculation is too old. */
121
- static TimeoutRecommendationVisible = date => {
122
- const day = moment(date).format(`LL`);
123
- const time = moment(date).format(`HH:mm`);
124
- return t(`Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?`, {
125
- day,
126
- time,
127
- 0: `\n`
128
- });
129
- };
130
- }
131
- //# sourceMappingURL=AttentionMessages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["moment","BolusCalculator","t","AttentionMessage","SevereHypoglycemia","Messages","VeryLowBGL","Reminder15Minutes","Hypoglycemia","LowBGL","MildHypoglycemia","NormoglycemiaActivityUnder5MMOL","PostponePhysicalActivityUnder5MMOL","HyperglycemiaActivity","HighBGL","InsulinKetones","PostponePhysicalActivity","SevereHyperglycemia","SevereHyperglycemiaActivity","BGLevelNotProvided","Hyperglycemia","MildHyperglycemia","Normoglycemia","NormoglycemiaUnder5MMOL","UnsupportedBGLevel","addPostponeActivityMessageUnder5MMOL","message","SAFETY_INSULIN_LIMIT","Constants","getLimitedValue","reduction","RecommendationWasLimited","RecommendationWasLimitedActivity","activityReduction","toFixed","InsulinInputWasLimited","TimeoutPrompTitle","TimeoutRecommendationNotVisible","TimeoutRecommendationVisible","date","day","format","time"],"sourceRoot":"../../../src","sources":["utils/AttentionMessages.ts"],"mappings":"AAAA,OAAOA,MAAM,MAAM,QAAQ;AAE3B,SAASC,eAAe,QAAQ,cAAc;AAE9C,SAASC,CAAC,QAAQ,sBAAsB;;AAExC;AACA,OAAO,MAAMC,gBAAgB,GAAG;EAC/B;AACD;AACA;AACA;AACA;EACCC,kBAAkB,EAAEA,CAAA,KAAe,GAAEC,QAAQ,CAACC,UAAU,CAAC,CAAE,GAAG,IAAI,GAAED,QAAQ,CAACE,iBAAiB,CAAC,CAAE,EAAC;EAElG;AACD;AACA;AACA;AACA;EACCC,YAAY,EAA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;EACF;EACA,OAAcE,sBAAsB,GAAIF,iBAAgC,IACvEA,iBAAiB,GACd/B,CAAC,CACA,kNAAiN,EAClN;IACCyB,oBAAoB;IACpB,CAAC,EAAE,CAACM,iBAAiB,GAAG,GAAG,EAAEC,OAAO,CAAC,CAAC,CAAC;IACvC,CAAC,EAAEL,eAAe,CAACI,iBAAiB;EACrC,CACA,CAAC,GACD/B,CAAC,CAAE,2FAA0F,EAAE;IAC/FyB;EACA,CAAC,CAAC;EACN;EACA,OAAcS,iBAAiB,GAAGA,CAAA,KACjClC,CAAC,CAAE,qEAAoE,CAAC;EACzE;AACD;AACA;AACA;EACC,OAAcmC,+BAA+B,GAAGA,CAAA,KAC/CnC,CAAC,CAAE,gGAA+F,CAAC;EACpG;EACA,OAAcoC,4BAA4B,GAAIC,IAAU,IAAa;IACpE,MAAMC,GAAG,GAAGxC,MAAM,CAACuC,IAAI,CAAC,CAACE,MAAM,CAAE,IAAG,CAAC;IACrC,MAAMC,IAAI,GAAG1C,MAAM,CAACuC,IAAI,CAAC,CAACE,MAAM,CAAE,OAAM,CAAC;IACzC,OAAOvC,CAAC,CACN,2GAA0G,EAC3G;MAAEsC,GAAG;MAAEE,IAAI;MAAE,CAAC,EAAG;IAAI,CACtB,CAAC;EACF,CAAC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["BolusCalculator","colors","blue","darkBlue","darkBlueX","semiDarkBlue","dustyBlue","dustyDarkBlue","fadeBlue","lightBlue","mistBlue","purple","deepPurple","teal","gradientMain","gradientPurple","white","black","transparentWhite","transparentBlack","transparentDarkBlue","transparentLightBlue","activityGreen","activityOrange","activityRed","SEVERE_HYPERGLYCEMIA_START_MMOL","FOUR_HOURS_SECONDS","ONE_HOUR_MINUTES","ACTIVITY_BUFFER_MINUTES","CARBOHYDRATES_LIMTS","min","max","INSULIN_DOSE_LIMITS","Constants","SAFETY_INSULIN_LIMIT","BOLUS_SECONDS_PASSED_LIMITS","ACTIVITY_DURATION_MINUTES_LIMITS","INSULIN_SENSITIVITY_MMOL_LIMITS","INSULIN_TO_CARBS_RATIO_LIMITS","CURRENT_BGL_MMOL_LIMITS","MMOLL_PER_MGDL_BGL","MGDL_PER_MMOLL_BGL","CURRENT_BKL_MMOL_LIMITS","MMOLL_PER_MGDL_BKL","MGDL_PER_MMOLL_BKL","TARGET_BGL_MMOL_LIMITS","ACTIVITY_TARGET_BGL_MMOL_LIMITS","REMINDER_HOURS_LIMITS","ACTIVITY_SETTINGS_INTERVAL_LIMITS"],"sourceRoot":"../../../src","sources":["utils/Constants.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,cAAc;AAI9C;AACA,OAAO,MAAMC,MAAM,GAAG;EACrBC,IAAI,EAAG,SAAQ;EACfC,QAAQ,EAAG,SAAQ;EACnBC,SAAS,EAAG,SAAQ;EACpBC,YAAY,EAAG,SAAQ;EACvBC,SAAS,EAAG,SAAQ;EACpBC,aAAa,EAAG,SAAQ;EACxBC,QAAQ,EAAG,SAAQ;EACnBC,SAAS,EAAG,SAAQ;EACpBC,QAAQ,EAAG,SAAQ;EACnBC,MAAM,EAAG,SAAQ;EACjBC,UAAU,EAAG,SAAQ;EACrBC,IAAI,EAAG,SAAQ;EACfC,YAAY,EAAE,CAAE,SAAQ,EAAG,SAAQ,CAAC;EACpCC,cAAc,EAAE,CAAE,SAAQ,EAAG,SAAQ,CAAC;EACtCC,KAAK,EAAG,SAAQ;EAChBC,KAAK,EAAG,SAAQ;EAChBC,gBAAgB,EAAG,WAAU;EAC7BC,gBAAgB,EAAG,WAAU;EAC7BC,mBAAmB,EAAG,WAAU;EAChCC,oBAAoB,EAAG,WAAU;EACjCC,aAAa,EAAG,SAAQ;EACxBC,cAAc,EAAG,SAAQ;EACzBC,WAAW,EAAG;AACf,CAAC;;AAED;AACA,OAAO,MAAMC,+BAA+B,GAAG,EAAE;;AAEjD;AACA,OAAO,MAAMC,kBAAkB,GAAG,KAAK;AACvC;AACA,OAAO,MAAMC,gBAAgB,GAAG,EAAE;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AG,EAAE;AAAK,CAAC;AAC/E;AACA,OAAO,MAAMgB,qBAAgC,GAAG;EAAEjB,GAAG,EAAE,CAAC;EAAEC,GAAG,EAAE;AAAE,CAAC;AAClE;AACA,OAAO,MAAMiB,iCAA4C,GAAG;EAAElB,GAAG,EAAE,CAAC;EAAEC,GAAG,EAAE;AAAE,CAAC"}
@@ -1,87 +0,0 @@
1
- import { BolusCalculator } from "@hedia/types";
2
- import { t } from "../locales/translate";
3
- import { RecommendationErrorEnum } from "../types/enum";
4
- const SAFETY_INSULIN_LIMIT = BolusCalculator.Constants.SAFETY_INSULIN_LIMIT;
5
-
6
- /**
7
- * Defines a set of human readable error messages.
8
- * Each of them is defined as a function that returns the required translatable error message.
9
- * The app should generally prevent the user from entering invalid values at the time of entry, so in almost all of these cases,
10
- * the use of any of these errors indicate that something might have gone really wrong, and the user will be prevented
11
- * from getting a recommendation until the problem is solved.
12
- */
13
- export class RecommendationError extends Error {
14
- constructor(message, type) {
15
- super(message);
16
- this.type = type;
17
- }
18
- }
19
-
20
- /** The given activity settings are corrupt. */
21
- export const ActivitySettingsError = () => new RecommendationError(t(`Error. Please verify that your activity settings are set up correctly.`), RecommendationErrorEnum.ActivitySettings);
22
-
23
- /** The duration of the given activity is invalid. */
24
- export const ActivityDurationError = () => new RecommendationError(t(`Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.`), RecommendationErrorEnum.ActivityDuration);
25
-
26
- /** The start date of the given activity is invalid. */
27
- export const ActivityDateError = () => new RecommendationError(t(`Hedia Calculator does not support activities that finished more than 4 hours ago.`), RecommendationErrorEnum.ActivityDate);
28
-
29
- /** The intensity of the given activity is invalid. */
30
- export const ActivityIntensityError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your activity intensity value`), RecommendationErrorEnum.ActivityIntensity);
31
-
32
- /** Type of the given activity is invalid. */
33
- export const ActivityTypeError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your activity type value`), RecommendationErrorEnum.ActivityType);
34
-
35
- /** The user’s activity target BGL setting is invalid. */
36
- export const ActivityTargetBGLError = () => new RecommendationError(t(`Error. Please verify that your activity target blood glucose value is correct.`), RecommendationErrorEnum.ActivityTargetBGL);
37
-
38
- /** More than 300 g carbohydrates entered. */
39
- export const CarbohydrateLimitError = () => new RecommendationError(t(`Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.`), RecommendationErrorEnum.CarbohydrateLimit);
40
-
41
- /** The user’s insulin sensitivity setting is outside of the valid range. */
42
- export const InsulinSensitivityError = () => new RecommendationError(t(`Error. Please verify that your insulin sensitivity value is correct.`), RecommendationErrorEnum.InsulinSensitivity);
43
-
44
- /** The user’s insulin-to-carbs ratio setting is outside of the valid range. */
45
- export const InsulinToCarbsRatioError = () => new RecommendationError(t(`Error. Please verify that your insulin to carb ratio value is correct.`), RecommendationErrorEnum.InsulinToCarbsRatio);
46
-
47
- /** The entered current blood glucose level is outside of the valid range. */
48
- export const CurrentBGLError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your current blood glucose level.`), RecommendationErrorEnum.CurrentBGL);
49
-
50
- /** The blood glucose level of the latest logbook entry from the last 6 hours is outside of the valid range. */
51
- export const LatestLogbook6HoursBGLError = () => new RecommendationError(t(`Error. Hedia Calculator does not support the blood glucose level of your latest logbook entry from the last 6 hours.`), RecommendationErrorEnum.LatestLogbook6HoursBGL);
52
-
53
- /** The entered current blood ketones concentration is outside of the valid range. */
54
- export const CurrentBKLError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your current blood ketone level.`), RecommendationErrorEnum.CurrentBKL);
55
-
56
- /** The user’s target BGL setting is outside of the valid range. */
57
- export const TargetBGLError = () => new RecommendationError(t(`Error. Please verify that your target blood glucose value is correct.`), RecommendationErrorEnum.TargetBGL);
58
-
59
- /** At least one of the recent (within the previous 4 hours) logbook entries has an insulin amount that exceeds the safety insulin threshold. */
60
- export const BolusInsulinDoseError = () => new RecommendationError(t(`Error. Hedia Calculator does not support an insulin dose greater than {SAFETY_INSULIN_LIMIT} units`, {
61
- SAFETY_INSULIN_LIMIT
62
- }), RecommendationErrorEnum.BolusInsulinDose);
63
-
64
- /** At least one entry from the list of recent logbook entries is older than 4 hours. */
65
- export const BolusInsulinSecondsPassedError = () => new RecommendationError(t(`Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours`), RecommendationErrorEnum.BolusInsulinSecondsPassed);
66
-
67
- /** The user’s recent boluses entries are not in the allowed format. */
68
- export const RecentBolusError = () => new RecommendationError(t(`Error. Hedia Calculator could not find your recent boluses`), RecommendationErrorEnum.RecentBolus);
69
-
70
- /** The user’s setting for initial reminder time is outside of the valid range. */
71
- export const UserReminderError = () => new RecommendationError(t(`Error. Please verify your notifications settings.`), RecommendationErrorEnum.UserReminder);
72
-
73
- /** The user’s insulin injection method setting is invalid. */
74
- export const InjectionMethodError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your injection method.`), RecommendationErrorEnum.InjectionMethod);
75
-
76
- /**The user’s language setting is not supported by the bolus calculator or it is in the wrong format */
77
- export const LanguageError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your current language.`), RecommendationErrorEnum.Language);
78
-
79
- /** The user’s blood ketones unit setting is invalid. */
80
- export const BloodKetoneUnitError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your current blood ketone unit.`), RecommendationErrorEnum.BloodKetoneUnit);
81
-
82
- /** The user’s blood glucose level measuring unit setting is invalid. */
83
- export const BloodGlucoseUnitError = () => new RecommendationError(t(`Error. Hedia Calculator does not support your current blood glucose unit.`), RecommendationErrorEnum.BloodGlucoseUnit);
84
-
85
- /** The user has provided a blood ketone level but the blood ketone measuring unit is not defined. */
86
- export const BloodKetonePropsError = () => new RecommendationError(t(`Error. Your blood ketone settings are invalid.`), RecommendationErrorEnum.BloodKetoneProps);
87
- //# sourceMappingURL=RecommendationError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BolusCalculator","t","RecommendationErrorEnum","SAFETY_INSULIN_LIMIT","Constants","RecommendationError","Error","constructor","message","type","ActivitySettingsError","ActivitySettings","ActivityDurationError","ActivityDuration","ActivityDateError","ActivityDate","ActivityIntensityError","ActivityIntensity","ActivityTypeError","ActivityType","ActivityTargetBGLError","ActivityTargetBGL","CarbohydrateLimitError","CarbohydrateLimit","InsulinSensitivityError","InsulinSensitivity","InsulinToCarbsRatioError","InsulinToCarbsRatio","CurrentBGLError","CurrentBGL","LatestLogbook6HoursBGLError","LatestLogbook6HoursBGL","CurrentBKLError","CurrentBKL","TargetBGLError","TargetBGL","BolusInsulinDoseError","BolusInsulinDose","BolusInsulinSecondsPassedError","BolusInsulinSecondsPassed","RecentBolusError","RecentBolus","UserReminderError","UserReminder","InjectionMethodError","InjectionMethod","LanguageError","Language","BloodKetoneUnitError","BloodKetoneUnit","BloodGlucoseUnitError","BloodGlucoseUnit","BloodKetonePropsError","BloodKetoneProps"],"sourceRoot":"../../../src","sources":["utils/RecommendationError.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,cAAc;AAE9C,SAASC,CAAC,QAAQ,sBAAsB;AACxC,SAASC,uBAAuB,QAAQ,eAAe;AAEvD,MAAMC,oBAAoB,GAAGH,eAAe,CAACI,SAAS,CAACD,oBAAoB;;AAE3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,mBAAmB,SAASC,KAAK,CAAC;EAG9CC,WAAWA,CAACC,OAAe,EAAEC,IAA6B,EAAE;IAC3D,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAGA,IAAI;EACjB;AACD;;AAEA;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KACpC,IAAIL,mBAAmB,CACtBJ,CAAC,CAAE,wEAAuE,CAAC,EAC3EC,uBAAuB,CAACS,gBACzB,CAAC;;AAEF;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KACpC,IAAIP,mBAAmB,CACtBJ,CAAC,CAAE,yFAAwF,CAAC,EAC5FC,uBAAuB,CAACW,gBACzB,CAAC;;AAEF;AACA,OA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AC,CAAE,0EAAyE,CAAC,EAC7EC,uBAAuB,CAAC+C,eACzB,CAAC;;AAEF;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KACpC,IAAI7C,mBAAmB,CACtBJ,CAAC,CAAE,2EAA0E,CAAC,EAC9EC,uBAAuB,CAACiD,gBACzB,CAAC;;AAEF;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KACpC,IAAI/C,mBAAmB,CACtBJ,CAAC,CAAE,gDAA+C,CAAC,EACnDC,uBAAuB,CAACmD,gBACzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["moment","BgLevel","RecommendationReminders","addPostponeActivityMessageUnder5MMOL","AttentionMessage","Messages","SEVERE_HYPERGLYCEMIA_START_MMOL","CurrentBGLError","Utils","getBGLevel","currentBGL","latestLogbookFrom6Hours","BGLevelNotProvided","SevereHypoglycemia","Hypoglycemia","MildHypoglycemia","NormoglycemiaUnder5MMOL","Normoglycemia","MildHyperglycemia","isSevereHyperglycemia","SevereHyperglycemia","Hyperglycemia","UnsupportedBGLevel","getReminder","bgLevel","carbohydrates","userReminder","activity","reminder","undefined","HediaReminderDefault","Reminder15Minutes","ReminderOff","isActivityWithin15Minutes","Reminder60Minutes","getAttentionMessage","key","getKeyFromValue","isAttentionMessageNull","isWithin15Minutes","NormoglycemiaActivityUnder5MMOL","HyperglycemiaActivity","SevereHyperglycemiaActivity","logbook","blood_glucose_millimolar","minutes","activityDuration","utc","activityDate","isBetween","subtract","add","getLimitationMessage","wasLimited","activityReduction","message","RecommendationWasLimitedActivity","RecommendationWasLimited"],"sourceRoot":"../../../src","sources":["utils/RecommendationUtils.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,QAAQ;AAI3B,SAASC,OAAO,EAAEC,uBAAuB,QAAQ,eAAe;AAChE,SAASC,oCAAoC,EAAEC,gBAAgB,EAAEC,QAAQ,QAAQ,qBAAqB;AACtG,SAASC,+BAA+B,QAAQ,aAA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,OAAO,SAAS2B,yBAAyBA,CAACN,QAAsD,EAAW;EAC1G,MAAMkB,OAAO,GAAGlB,QAAQ,EAAEmB,gBAAgB;EAC1C,OAAO9C,MAAM,CACX+C,GAAG,CAACpB,QAAQ,EAAEqB,YAAY,CAAC,CAC3BC,SAAS,CAACjD,MAAM,CAAC+C,GAAG,CAAC,CAAC,CAACG,QAAQ,CAACL,OAAO,EAAG,SAAQ,CAAC,EAAE7C,MAAM,CAAC+C,GAAG,CAAC,CAAC,CAACI,GAAG,CAAC,EAAE,EAAG,SAAQ,CAAC,CAAC;AACxF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,UAAmB,EAAEC,iBAAgC,EAAiB;EAC1G,MAAMC,OAAO,GAAGD,iBAAiB,GAC9BjD,QAAQ,CAACmD,gCAAgC,CAACF,iBAAiB,CAAC,GAC5DjD,QAAQ,CAACoD,wBAAwB,CAAC,CAAC;EACtC,OAAOJ,UAAU,GAAGE,OAAO,GAAG,IAAI;AACnC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["t","ActivityIntensityTranslations","light","moderate","hard"],"sourceRoot":"../../../src","sources":["utils/Translations.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAIA,SAASA,CAAC,QAAQ,sBAAsB;;AAExC;AACA;AACA;AACA,OAAO,MAAMC,6BAAqF,GAAG;EACpGC,KAAK,EAAEA,CAAA,KAAcF,CAAC,CAAE,OAAM,CAAC;EAC/BG,QAAQ,EAAEA,CAAA,KAAcH,CAAC,CAAE,UAAS,CAAC;EACrCI,IAAI,EAAEA,CAAA,KAAcJ,CAAC,CAAE,MAAK;AAC7B,CAAC"}
@@ -1,155 +0,0 @@
1
- import { BloodGlucoseUnit, BloodKetonesUnit, UserSettings } from "@hedia/types";
2
- import { MGDL_PER_MMOLL_BGL, MGDL_PER_MMOLL_BKL } from "./Constants";
3
- const InjectionMethod = UserSettings.Enums.InjectionMethod;
4
- const {
5
- PenHalf,
6
- PenWhole,
7
- Pump
8
- } = InjectionMethod;
9
-
10
- /** Helper functions used for displaying data to the user. */
11
- export class Utils {
12
- /**
13
- * Get the inverse of the precision to an insulin amount should be rounded based on the user’s injection method.
14
- *
15
- * Steps:
16
- * 1. Use a switch statement to return the appropriate number depending on the value of the method argument:
17
- * - If PenWhole, return 1.
18
- * - If PenHalf, return 2.
19
- * - If Pump, return 10.
20
- * - Otherwise throw an exception.
21
- * @param method The method by which the user injects insulin.
22
- * @returns The inverse of the precision to which an insulin amount should be rounded based on the user’s injection method.
23
- */
24
- static getRounding(method) {
25
- switch (method) {
26
- case PenWhole:
27
- return 1;
28
- case PenHalf:
29
- return 2;
30
- case Pump:
31
- return 10;
32
- default:
33
- throw Error(`Unsupported InjectionMethod: ${method}`);
34
- }
35
- }
36
-
37
- /**
38
- * Round an insulin amount to the precision that is dictated by the user’s injection method.
39
- *
40
- * Steps:
41
- * 1. Get the inverse rounding precision by calling getRounding() with injectMethod as argument.
42
- * 2. Return the rounded insulin amount calculated by the following operations:
43
- * - Multiply the insulin value prop by the inverse rounding precision.
44
- * - Round to the nearest whole number.
45
- * - Divide by the inverse rounding precision and return the result.
46
- * @param value The amount of insulin to be rounded.
47
- * @param injectMethod The method by which the user injects insulin.
48
- * @returns The rounded insulin amount.
49
- */
50
- static roundValue(value, injectMethod) {
51
- const rounding = Utils.getRounding(injectMethod);
52
- return Math.round(value * rounding) / rounding;
53
- }
54
-
55
- /**
56
- * Determine whether a numerical value is in the given closed interval.
57
- *
58
- * Steps:
59
- * 1. If value is null then return false. (Note that we only need to check explicitly for null comparing it
60
- * to a number returns true while comparing undefined to a number returns false).
61
- * 2. Evaluate whether value >= the interval argument’s min property && value <= the interval argument’s max property and return the result.
62
- * @param value The number that will be checked for membership of the interval.
63
- * @param interval The interval to compare the value to.
64
- * @returns Boolean value indicating whether the value is in the closed interval.
65
- */
66
- static isInRange(value, interval) {
67
- if (value === null) {
68
- return false;
69
- }
70
- return value >= interval.min && value <= interval.max;
71
- }
72
-
73
- /**
74
- * Convert a blood glucose level value from mmol/L to mg/dL.
75
- *
76
- * Steps:
77
- * 1. Return the result of rounding the product of multiplying value with MGDL_PER_MMOLL_BGL.
78
- * @param value The blood glucose level value in mmol/L to be converted.
79
- * @returns The blood glucose value in mg/dL that corresponds to the given value in mmol/L.
80
- */
81
- static convertBGLToMGDL(value) {
82
- return Math.round(value * MGDL_PER_MMOLL_BGL);
83
- }
84
-
85
- /**
86
- * Depending on the blood glucose unit passed, returns the value as a string or returns a stringified call to the convertBGLToMGDL method.
87
- *
88
- * Steps:
89
- * 1. Using a ternary operator on the unit argument return the passed value argument in case unit is a MMOL_L.
90
- * Otherwise, return a call to the convertBGLToMGDL method with the value passed as an argument.
91
- * @param value The blood glucose level value in mmol/L to be converted.
92
- * @param unit The blood glucose measurement unit.
93
- * @returns The blood glucose value that will be displayed to the user.
94
- */
95
- static displayedBGLValue(value, unit) {
96
- return unit === BloodGlucoseUnit.MMOL_L ? value.toFixed(1) : `${Utils.convertBGLToMGDL(value)}`;
97
- }
98
-
99
- /**
100
- * Convert a blood ketones concentration from mmol/L to mg/dL.
101
- * Steps:
102
- * 1. Return the result of rounding the product of multiplying value with MGDL_PER_MMOLL_BKL.
103
- * @param value The blood ketones concentration in mmol/L to be converted.
104
- * @returns The blood ketones concentration in mg/dL that corresponds to the given value in mmol/L.
105
- */
106
- static convertBKLToMGDL(value) {
107
- return Math.round(value * MGDL_PER_MMOLL_BKL);
108
- }
109
-
110
- /**
111
- * Depending on the blood ketone unit passed, returns the value as a string or returns a call to the convertBKLToMGDL method.
112
- *
113
- * Steps:
114
- * 1. Using a ternary operator on the unit argument return the passed value argument in case unit is a MMOL_L.
115
- * Otherwise, return a call to the convertBKLToMGDL method with the value passed as an argument.
116
- * @param value The blood ketone level value in mmol/L to be converted.
117
- * @param unit The blood ketone measurement unit.
118
- * @returns The blood ketone value that will be displayed to the user.
119
- */
120
- static displayedBKLValue(value, unit) {
121
- return unit === BloodKetonesUnit.MMOL_L ? value.toFixed(1) : `${Utils.convertBKLToMGDL(value)}`;
122
- }
123
-
124
- /**
125
- * Format a measurement unit for displaying to the user. More concrete, it is used to display the litre symbol with uppercase "L".
126
- *
127
- * Steps:
128
- * 1. Set unitWithoutLastLetter to be unit except for the last character.
129
- * 2. Set lastLetterUppercase to be the last letter of unit converted to uppercase.
130
- * 3. Return unitWithoutLastLetter concatenated with lastLetterUppercase.
131
- * @param unit The measurement unit to format.
132
- * @returns The measurement unit formatted for displaying to the user.
133
- */
134
- static formatUnit = unit => {
135
- const unitWithoutLastLetter = unit.substring(0, unit.length - 1);
136
- const lastLetterUppercase = unit.substring(unit.length - 1, unit.length).toUpperCase();
137
- return `${unitWithoutLastLetter}${lastLetterUppercase}`;
138
- };
139
-
140
- /**
141
- * Returns the key of key/value object when passing the key value as argument.
142
- *
143
- * Steps:
144
- * 1. Save all the values of the keys object into the values constant
145
- * 2. From the array of keys, return the one at the index of the first occurence of the value in the values constant
146
- * @param keys The keys of the T object.
147
- * @param value The value for the requested key.
148
- * @returns The key of the passed value.
149
- */
150
- static getKeyFromValue(keys, value) {
151
- const values = Object.values(keys);
152
- return Object.keys(keys)[values.indexOf(value)];
153
- }
154
- }
155
- //# sourceMappingURL=Utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BloodGlucoseUnit","BloodKetonesUnit","UserSettings","MGDL_PER_MMOLL_BGL","MGDL_PER_MMOLL_BKL","InjectionMethod","Enums","PenHalf","PenWhole","Pump","Utils","getRounding","method","Error","roundValue","value","injectMethod","rounding","Math","round","isInRange","interval","min","max","convertBGLToMGDL","displayedBGLValue","unit","MMOL_L","toFixed","convertBKLToMGDL","displayedBKLValue","formatUnit","unitWithoutLastLetter","substring","length","lastLetterUppercase","toUpperCase","getKeyFromValue","keys","values","Object","indexOf"],"sourceRoot":"../../../src","sources":["utils/Utils.ts"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,gBAAgB,EAAEC,YAAY,Q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