@argusoft/medplat-core 1.0.31 → 1.0.32

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 (199) hide show
  1. package/dist/{AccessRights-DUgY6ewy.js → AccessRights-DBjTQA1-.js} +421 -424
  2. package/dist/AccessRights-DBjTQA1-.js.map +1 -0
  3. package/dist/{AddFeatures-D1sU8RjY.js → AddFeatures-COj4ZTIM.js} +2 -2
  4. package/dist/{AddFeatures-D1sU8RjY.js.map → AddFeatures-COj4ZTIM.js.map} +1 -1
  5. package/dist/AddMenuConfiguration-Creeib5X.js +11223 -0
  6. package/dist/AddMenuConfiguration-Creeib5X.js.map +1 -0
  7. package/dist/AddMenuConfiguration.css +1 -1
  8. package/dist/{BrandsPage-DMw2vT0u-BVhvhc6J.js → BrandsPage-CdcAvaml-ZtVTX6vX.js} +45 -45
  9. package/dist/{BrandsPage-DMw2vT0u-BVhvhc6J.js.map → BrandsPage-CdcAvaml-ZtVTX6vX.js.map} +1 -1
  10. package/dist/{CategoriesPage-D3ihx9Gi-CT58g0ry.js → CategoriesPage-BprQEYJw-CclreTv1.js} +43 -43
  11. package/dist/{CategoriesPage-D3ihx9Gi-CT58g0ry.js.map → CategoriesPage-BprQEYJw-CclreTv1.js.map} +1 -1
  12. package/dist/{ChangePasswordModalCore-lQ9GamH1.js → ChangePasswordModalCore-DZGOkbRY.js} +3 -3
  13. package/dist/{ChangePasswordModalCore-lQ9GamH1.js.map → ChangePasswordModalCore-DZGOkbRY.js.map} +1 -1
  14. package/dist/{ConditionConfig-BQBmBHaM.js → ConditionConfig-Bpm6OoV5.js} +3 -3
  15. package/dist/{ConditionConfig-BQBmBHaM.js.map → ConditionConfig-Bpm6OoV5.js.map} +1 -1
  16. package/dist/{DashboardPage-asr2XDRu-uOOlX9Vq.js → DashboardPage-CTiGSx71-CsYohJ5e.js} +29 -29
  17. package/dist/{DashboardPage-asr2XDRu-uOOlX9Vq.js.map → DashboardPage-CTiGSx71-CsYohJ5e.js.map} +1 -1
  18. package/dist/EntityManagement-BGwJGl9k.js +62 -0
  19. package/dist/EntityManagement-BGwJGl9k.js.map +1 -0
  20. package/dist/{EventConfigurations-CUPEN5BV.js → EventConfigurations-B-z7xHh_.js} +3 -3
  21. package/dist/{EventConfigurations-CUPEN5BV.js.map → EventConfigurations-B-z7xHh_.js.map} +1 -1
  22. package/dist/{EventsExceptionModal-BX-ArkBE.js → EventsExceptionModal-DafomIv6.js} +2 -2
  23. package/dist/{EventsExceptionModal-BX-ArkBE.js.map → EventsExceptionModal-DafomIv6.js.map} +1 -1
  24. package/dist/{EventsUi-D6O9S7BK.js → EventsUi-Dl_yckSA.js} +37 -32
  25. package/dist/EventsUi-Dl_yckSA.js.map +1 -0
  26. package/dist/FacilityPicker-BXa2VF7i-Dab_Jwa5.js +112 -0
  27. package/dist/FacilityPicker-BXa2VF7i-Dab_Jwa5.js.map +1 -0
  28. package/dist/{FeatureMenu-CHsBbw3W.js → FeatureMenu-Kc73yPHH.js} +2 -2
  29. package/dist/{FeatureMenu-CHsBbw3W.js.map → FeatureMenu-Kc73yPHH.js.map} +1 -1
  30. package/dist/{FhirServerList-iXBPkRVF.js → FhirServerList-CrIHMAxz.js} +19 -19
  31. package/dist/{FhirServerList-iXBPkRVF.js.map → FhirServerList-CrIHMAxz.js.map} +1 -1
  32. package/dist/{FhirServerProfile-CUOwC6Wb.js → FhirServerProfile-D3aYcpwY.js} +8 -8
  33. package/dist/{FhirServerProfile-CUOwC6Wb.js.map → FhirServerProfile-D3aYcpwY.js.map} +1 -1
  34. package/dist/{FhirServerWizard-DZI8Olku.js → FhirServerWizard-Db6Hm4bQ.js} +15 -15
  35. package/dist/{FhirServerWizard-DZI8Olku.js.map → FhirServerWizard-Db6Hm4bQ.js.map} +1 -1
  36. package/dist/{ImmunizationConfigurationBase-aUtx0JEe.js → ImmunizationConfigurationBase-lKsJZMak.js} +1342 -1301
  37. package/dist/ImmunizationConfigurationBase-lKsJZMak.js.map +1 -0
  38. package/dist/InventoryPage-JadYMCzU-CzJQfQ2A.js +1017 -0
  39. package/dist/InventoryPage-JadYMCzU-CzJQfQ2A.js.map +1 -0
  40. package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js +1344 -0
  41. package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js.map +1 -0
  42. package/dist/{ManageDynamicFeature-BU0I45dd.js → ManageDynamicFeature-CuyYfx_P.js} +104 -97
  43. package/dist/ManageDynamicFeature-CuyYfx_P.js.map +1 -0
  44. package/dist/{ManageEventConfiguration-DqW3krT6.js → ManageEventConfiguration-DqPbn3Oi.js} +5 -5
  45. package/dist/{ManageEventConfiguration-DqW3krT6.js.map → ManageEventConfiguration-DqPbn3Oi.js.map} +1 -1
  46. package/dist/ManageRole-CyfpySt9.js +981 -0
  47. package/dist/ManageRole-CyfpySt9.js.map +1 -0
  48. package/dist/{ManageUser-DZltBina.js → ManageUser-Dm0l833u.js} +172 -172
  49. package/dist/{ManageUser-DZltBina.js.map → ManageUser-Dm0l833u.js.map} +1 -1
  50. package/dist/{MemberProfileCard-D5CgkTdJ-D2NgDJl3.js → MemberProfileCard-01d_jz3w-DYHtbgMX.js} +37 -37
  51. package/dist/{MemberProfileCard-D5CgkTdJ-D2NgDJl3.js.map → MemberProfileCard-01d_jz3w-DYHtbgMX.js.map} +1 -1
  52. package/dist/MobileAnalytics-C9oc2yAo.js +18399 -0
  53. package/dist/MobileAnalytics-C9oc2yAo.js.map +1 -0
  54. package/dist/MobileMenuManagement-BmzTPXy7.js +231 -0
  55. package/dist/MobileMenuManagement-BmzTPXy7.js.map +1 -0
  56. package/dist/{MobileTypeEventConfigModal-CMcj7Ozp.js → MobileTypeEventConfigModal-DodU3beR.js} +3 -3
  57. package/dist/{MobileTypeEventConfigModal-CMcj7Ozp.js.map → MobileTypeEventConfigModal-DodU3beR.js.map} +1 -1
  58. package/dist/{NewServerManagement-Cxe0dV0O.js → NewServerManagement-BdayO78D.js} +368 -352
  59. package/dist/NewServerManagement-BdayO78D.js.map +1 -0
  60. package/dist/OtherTypeEventConfigModal-D_9S50aI.js +1414 -0
  61. package/dist/OtherTypeEventConfigModal-D_9S50aI.js.map +1 -0
  62. package/dist/{PaymentCreatePage-DfvSZ-kB-CckogYoe.js → PaymentCreatePage-D6NZBUC3-DxXf2kvH.js} +56 -56
  63. package/dist/{PaymentCreatePage-DfvSZ-kB-CckogYoe.js.map → PaymentCreatePage-D6NZBUC3-DxXf2kvH.js.map} +1 -1
  64. package/dist/{PaymentsPage-DMNjYWAJ-ChO9IXmk.js → PaymentsPage-CHieGNrn-BnYCtqHd.js} +38 -38
  65. package/dist/{PaymentsPage-DMNjYWAJ-ChO9IXmk.js.map → PaymentsPage-CHieGNrn-BnYCtqHd.js.map} +1 -1
  66. package/dist/{PermissionsModal-CCYkcKlC.js → PermissionsModal-Dxbkkrqe.js} +18 -18
  67. package/dist/PermissionsModal-Dxbkkrqe.js.map +1 -0
  68. package/dist/{PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js → PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js} +2 -2
  69. package/dist/{PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js.map → PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js.map} +1 -1
  70. package/dist/PickupCreatePage-C7_67u_u-OId8-e2a.js +801 -0
  71. package/dist/PickupCreatePage-C7_67u_u-OId8-e2a.js.map +1 -0
  72. package/dist/{PickupsPage-D7zyioJB-bHKnARYw.js → PickupsPage-BWblMlic-CWkgeBw0.js} +122 -122
  73. package/dist/PickupsPage-BWblMlic-CWkgeBw0.js.map +1 -0
  74. package/dist/PmGuard-BvUUbU80-BpYNaDzl.js +641 -0
  75. package/dist/PmGuard-BvUUbU80-BpYNaDzl.js.map +1 -0
  76. package/dist/ProductEditPage-Dbq4vUAA-BoBmTPPL.js +1523 -0
  77. package/dist/ProductEditPage-Dbq4vUAA-BoBmTPPL.js.map +1 -0
  78. package/dist/{ProductsPage-DvNHIeZt-BoOOJJtk.js → ProductsPage-BI22nPb4-CQBjnc-n.js} +29 -29
  79. package/dist/{ProductsPage-DvNHIeZt-BoOOJJtk.js.map → ProductsPage-BI22nPb4-CQBjnc-n.js.map} +1 -1
  80. package/dist/PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js +724 -0
  81. package/dist/PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js.map +1 -0
  82. package/dist/{PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js → PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js} +446 -436
  83. package/dist/PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js.map +1 -0
  84. package/dist/{PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js → PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js} +55 -55
  85. package/dist/{PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js.map → PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js.map} +1 -1
  86. package/dist/{PurchasesPage-DgL5T6BY-DePUuE9l.js → PurchasesPage-Djl1AqD_-DXeYFMrX.js} +61 -61
  87. package/dist/{PurchasesPage-DgL5T6BY-DePUuE9l.js.map → PurchasesPage-Djl1AqD_-DXeYFMrX.js.map} +1 -1
  88. package/dist/{RoleManagement-s8iNx2Mu.js → RoleManagement-DVYufwy-.js} +3 -3
  89. package/dist/{RoleManagement-s8iNx2Mu.js.map → RoleManagement-DVYufwy-.js.map} +1 -1
  90. package/dist/Roles-BoNGJhtR.js +19 -0
  91. package/dist/Roles-BoNGJhtR.js.map +1 -0
  92. package/dist/{SaleCreatePage-CZnIOydv-DKBw-qp7.js → SaleCreatePage-DHBLmlBr-BlgjVsq6.js} +33 -33
  93. package/dist/{SaleCreatePage-CZnIOydv-DKBw-qp7.js.map → SaleCreatePage-DHBLmlBr-BlgjVsq6.js.map} +1 -1
  94. package/dist/{SalesPage-DPIRrC_O-M8rqnK7z.js → SalesPage-eF9Yr42z-BQ9FlXC3.js} +34 -34
  95. package/dist/SalesPage-eF9Yr42z-BQ9FlXC3.js.map +1 -0
  96. package/dist/SettingsPage-Cre-UE3r-9ntnLYsQ.js +741 -0
  97. package/dist/SettingsPage-Cre-UE3r-9ntnLYsQ.js.map +1 -0
  98. package/dist/{StorageUnitsPage-BDRkdCjW-UF64rf7q.js → StorageUnitsPage-CTEVuemZ-B4osG74N.js} +213 -190
  99. package/dist/StorageUnitsPage-CTEVuemZ-B4osG74N.js.map +1 -0
  100. package/dist/{SubMenu-BdMTYtC1.js → SubMenu-OO2zhKiu.js} +2 -2
  101. package/dist/{SubMenu-BdMTYtC1.js.map → SubMenu-OO2zhKiu.js.map} +1 -1
  102. package/dist/{TableDetails-BtafRxXb.js → TableDetails-Cc40dEUs.js} +272 -267
  103. package/dist/TableDetails-Cc40dEUs.js.map +1 -0
  104. package/dist/{TableList-Dpo6dO7S.js → TableList-B5tX4wII.js} +316 -312
  105. package/dist/TableList-B5tX4wII.js.map +1 -0
  106. package/dist/{TransactionsPage-CqWTMNU8-Df6eGFDW.js → TransactionsPage-Zuu7sjID-B-ACzvd1.js} +185 -170
  107. package/dist/TransactionsPage-Zuu7sjID-B-ACzvd1.js.map +1 -0
  108. package/dist/TransferCreatePage-DlT0nCDj-B2SdPgYB.js +635 -0
  109. package/dist/TransferCreatePage-DlT0nCDj-B2SdPgYB.js.map +1 -0
  110. package/dist/TransfersPage-DqaSvHda-G2tFa5Jq.js +600 -0
  111. package/dist/TransfersPage-DqaSvHda-G2tFa5Jq.js.map +1 -0
  112. package/dist/{TypeConfiguration-JbRCN6GR.js → TypeConfiguration-EaFiOzRE.js} +3 -3
  113. package/dist/{TypeConfiguration-JbRCN6GR.js.map → TypeConfiguration-EaFiOzRE.js.map} +1 -1
  114. package/dist/UserList-Cf5B-o_1.js +1904 -0
  115. package/dist/UserList-Cf5B-o_1.js.map +1 -0
  116. package/dist/Users-MC7txo1V.js +43 -0
  117. package/dist/{Users-CsJ08Kjm.js.map → Users-MC7txo1V.js.map} +1 -1
  118. package/dist/VaccineEducation-T_UE57Ef.js +231 -0
  119. package/dist/VaccineEducation-T_UE57Ef.js.map +1 -0
  120. package/dist/VaccineEducation.css +1 -0
  121. package/dist/VaccineEducationConfigurator-CWc20_rv.js +50948 -0
  122. package/dist/VaccineEducationConfigurator-CWc20_rv.js.map +1 -0
  123. package/dist/VaccineEducationConfigurator.css +4 -0
  124. package/dist/VaccineEducationList-Ok7_5EFb.js +334 -0
  125. package/dist/VaccineEducationList-Ok7_5EFb.js.map +1 -0
  126. package/dist/VialsPage-LoDaUqVv-DmMXbK8j.js +457 -0
  127. package/dist/VialsPage-LoDaUqVv-DmMXbK8j.js.map +1 -0
  128. package/dist/{constants-DpXnLsAB-D6lN5cjK.js → constants-BTpJFQe_-CYPZIqQF.js} +160 -61
  129. package/dist/constants-BTpJFQe_-CYPZIqQF.js.map +1 -0
  130. package/dist/dashboardLayoutUtils--xUnoKPa.js +615 -0
  131. package/dist/dashboardLayoutUtils--xUnoKPa.js.map +1 -0
  132. package/dist/index-mfoqII2U.js +524 -0
  133. package/dist/index-mfoqII2U.js.map +1 -0
  134. package/dist/{index-D9YNFPn9.js → index-o8Pyt1Bt.js} +445 -439
  135. package/dist/index-o8Pyt1Bt.js.map +1 -0
  136. package/dist/index.css +1 -1
  137. package/dist/index.js +1 -1
  138. package/dist/{index.lib-ETRQOzvE.js → index.lib-BySa9-Z-.js} +302 -260
  139. package/dist/index.lib-BySa9-Z-.js.map +1 -0
  140. package/dist/listValueStore-5d4vNGQM-WclZ5nBG.js +43 -0
  141. package/dist/listValueStore-5d4vNGQM-WclZ5nBG.js.map +1 -0
  142. package/package.json +5 -1
  143. package/dist/AccessRights-DUgY6ewy.js.map +0 -1
  144. package/dist/AddMenuConfiguration-c6ZKiN0i.js +0 -8898
  145. package/dist/AddMenuConfiguration-c6ZKiN0i.js.map +0 -1
  146. package/dist/EntityManagement-CPQL6qBj.js +0 -50
  147. package/dist/EntityManagement-CPQL6qBj.js.map +0 -1
  148. package/dist/EventsUi-D6O9S7BK.js.map +0 -1
  149. package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js +0 -79
  150. package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js.map +0 -1
  151. package/dist/ImmunizationConfigurationBase-aUtx0JEe.js.map +0 -1
  152. package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js +0 -665
  153. package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js.map +0 -1
  154. package/dist/ManageDynamicFeature-BU0I45dd.js.map +0 -1
  155. package/dist/ManageRole-CNZBRKGU.js +0 -776
  156. package/dist/ManageRole-CNZBRKGU.js.map +0 -1
  157. package/dist/MobileAnalytics-BLOionG_.js +0 -17301
  158. package/dist/MobileAnalytics-BLOionG_.js.map +0 -1
  159. package/dist/MobileMenuManagement-68Wijb0X.js +0 -220
  160. package/dist/MobileMenuManagement-68Wijb0X.js.map +0 -1
  161. package/dist/NewServerManagement-Cxe0dV0O.js.map +0 -1
  162. package/dist/OtherTypeEventConfigModal-stNmuSv_.js +0 -1812
  163. package/dist/OtherTypeEventConfigModal-stNmuSv_.js.map +0 -1
  164. package/dist/PermissionsModal-CCYkcKlC.js.map +0 -1
  165. package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js +0 -783
  166. package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js.map +0 -1
  167. package/dist/PickupsPage-D7zyioJB-bHKnARYw.js.map +0 -1
  168. package/dist/PmGuard-BZE-y4In-D_pUm5MP.js +0 -599
  169. package/dist/PmGuard-BZE-y4In-D_pUm5MP.js.map +0 -1
  170. package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js +0 -1305
  171. package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js.map +0 -1
  172. package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js +0 -675
  173. package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js.map +0 -1
  174. package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js.map +0 -1
  175. package/dist/Roles-BIyiic67.js +0 -14
  176. package/dist/Roles-BIyiic67.js.map +0 -1
  177. package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js.map +0 -1
  178. package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js +0 -676
  179. package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js.map +0 -1
  180. package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js.map +0 -1
  181. package/dist/TableDetails-BtafRxXb.js.map +0 -1
  182. package/dist/TableList-Dpo6dO7S.js.map +0 -1
  183. package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js.map +0 -1
  184. package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js +0 -315
  185. package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js.map +0 -1
  186. package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js +0 -476
  187. package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js.map +0 -1
  188. package/dist/UserList-L41Xw0Q6.js +0 -1129
  189. package/dist/UserList-L41Xw0Q6.js.map +0 -1
  190. package/dist/Users-CsJ08Kjm.js +0 -40
  191. package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js +0 -321
  192. package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js.map +0 -1
  193. package/dist/constants-DpXnLsAB-D6lN5cjK.js.map +0 -1
  194. package/dist/dashboardLayoutUtils-CJivzaU1.js +0 -408
  195. package/dist/dashboardLayoutUtils-CJivzaU1.js.map +0 -1
  196. package/dist/index-D9YNFPn9.js.map +0 -1
  197. package/dist/index.lib-ETRQOzvE.js.map +0 -1
  198. package/dist/listValueStore-BFQtDYIR-Bj0yX145.js +0 -36
  199. package/dist/listValueStore-BFQtDYIR-Bj0yX145.js.map +0 -1
@@ -0,0 +1,741 @@
1
+ import { K as E, a as z, aj as te, ak as le, al as ie, am as se, an as me, ao as ue, ap as de, $ as ce } from "./ImmunizationConfigurationBase-lKsJZMak.js";
2
+ import { Q as he, Z as pe, $ as be, e as ye, Y as fe } from "./PmGuard-BvUUbU80-BpYNaDzl.js";
3
+ import { useState as b, useMemo as ge } from "react";
4
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
5
+ import { Box as y, Alert as F, Card as $, CardContent as O, Grid as P, Stack as q, Autocomplete as ae, TextField as re, Button as X, Typography as c } from "@mui/material";
6
+ import { alpha as C } from "@mui/material/styles";
7
+ import { findCountry as Ce } from "@/common/constants/countries";
8
+ import xe from "@mui/icons-material/RefreshRounded";
9
+ import we from "@/views/custom-components/CustomSwitch";
10
+ import ve from "@mui/icons-material/PaymentsRounded";
11
+ import Se from "@mui/icons-material/SaveRounded";
12
+ import Ie from "@/views/custom-components/CountrySelect";
13
+ import ke from "@mui/icons-material/PhoneIphoneRounded";
14
+ import ee from "@/views/custom-components/PostgresEditor";
15
+ function Pe() {
16
+ return {
17
+ memberQuery: "",
18
+ memberQuerySqlite: "",
19
+ memberIdColumn: "",
20
+ memberIdentifierColumn: "",
21
+ memberFamilyIdColumn: "",
22
+ memberNameColumn: "",
23
+ memberDobColumn: "",
24
+ countryCode: "IN",
25
+ managePurchaseAmounts: !0,
26
+ manageSales: !0,
27
+ allowPersonalPurchase: !0,
28
+ allowFacilityPurchase: !0,
29
+ requirePurchaseConfirmation: !1,
30
+ autoGenerateLotNumber: !1,
31
+ allowGroupSessions: !1,
32
+ allowManualAdjustment: !1,
33
+ documentModule: ""
34
+ };
35
+ }
36
+ function oe(n) {
37
+ return {
38
+ memberIdColumn: (n == null ? void 0 : n.memberIdColumn) ?? "",
39
+ memberIdentifierColumn: (n == null ? void 0 : n.memberIdentifierColumn) ?? "",
40
+ memberFamilyIdColumn: (n == null ? void 0 : n.memberFamilyIdColumn) ?? "",
41
+ memberNameColumn: (n == null ? void 0 : n.memberNameColumn) ?? "",
42
+ memberDobColumn: (n == null ? void 0 : n.memberDobColumn) ?? "",
43
+ countryCode: (n == null ? void 0 : n.countryCode) ?? "IN",
44
+ managePurchaseAmounts: (n == null ? void 0 : n.managePurchaseAmounts) !== !1,
45
+ manageSales: (n == null ? void 0 : n.manageSales) !== !1,
46
+ allowPersonalPurchase: (n == null ? void 0 : n.allowPersonalPurchase) !== !1,
47
+ allowFacilityPurchase: (n == null ? void 0 : n.allowFacilityPurchase) !== !1,
48
+ requirePurchaseConfirmation: (n == null ? void 0 : n.requirePurchaseConfirmation) === !0,
49
+ autoGenerateLotNumber: (n == null ? void 0 : n.autoGenerateLotNumber) === !0,
50
+ allowGroupSessions: (n == null ? void 0 : n.allowGroupSessions) === !0,
51
+ allowManualAdjustment: (n == null ? void 0 : n.allowManualAdjustment) === !0,
52
+ documentModule: (n == null ? void 0 : n.documentModule) ?? ""
53
+ };
54
+ }
55
+ function ze() {
56
+ let n = he().has("update.manage.productManagement.settings"), [a, d] = b(Pe()), [f, h] = b(!0), [x, u] = b(!1), [p, r] = b(""), [M, Q] = b([]), [w, N] = b(null), [K, D] = b(""), [H, T] = b(!1), [G, L] = b(!1), [U, Y] = b(0);
57
+ async function R() {
58
+ var e, l;
59
+ h(!0), r("");
60
+ try {
61
+ let [t, g, Z, V] = await Promise.all([
62
+ le(),
63
+ ie().catch(() => []),
64
+ se().catch(() => ""),
65
+ me().catch(() => "")
66
+ ]);
67
+ d({
68
+ ...oe(t),
69
+ memberQuery: Z ?? "",
70
+ memberQuerySqlite: V ?? ""
71
+ }), Q(g), N(null), D(""), L(!1), Y((J) => J + 1);
72
+ } catch (t) {
73
+ r(((l = (e = t == null ? void 0 : t.response) == null ? void 0 : e.data) == null ? void 0 : l.message) ?? (t == null ? void 0 : t.message) ?? "Failed to load settings");
74
+ } finally {
75
+ h(!1);
76
+ }
77
+ }
78
+ pe("view.manage.productManagement.settings", () => {
79
+ R();
80
+ }, []);
81
+ function s(e, l) {
82
+ d((t) => ({
83
+ ...t,
84
+ [e]: l
85
+ }));
86
+ }
87
+ async function v() {
88
+ var e, l;
89
+ T(!0), D("");
90
+ try {
91
+ N(await te(a.memberQuery)), L(!1);
92
+ } catch (t) {
93
+ D(((l = (e = t == null ? void 0 : t.response) == null ? void 0 : e.data) == null ? void 0 : l.message) ?? (t == null ? void 0 : t.message) ?? "Could not read the lookup.");
94
+ } finally {
95
+ T(!1);
96
+ }
97
+ }
98
+ let _ = [
99
+ "memberIdColumn",
100
+ "memberIdentifierColumn",
101
+ "memberFamilyIdColumn",
102
+ "memberNameColumn",
103
+ "memberDobColumn"
104
+ ], A = (w ?? []).map((e) => e.name), W = w === null ? [] : _.map((e) => a[e]).filter((e) => e && !A.includes(e)), I = a.countryCode ? "" : "Country is required.", j = !I && W.length === 0 && !G, m = Ce(a.countryCode), B = ge(() => {
105
+ let e = M ?? [];
106
+ return !a.documentModule || e.includes(a.documentModule) ? e : [a.documentModule, ...e];
107
+ }, [M, a.documentModule]);
108
+ async function k() {
109
+ var e, l;
110
+ if (j) {
111
+ u(!0), r("");
112
+ try {
113
+ let t = await ue({
114
+ memberQuery: a.memberQuery || null,
115
+ memberQuerySqlite: a.memberQuerySqlite || null,
116
+ memberIdColumn: a.memberIdColumn || null,
117
+ memberIdentifierColumn: a.memberIdentifierColumn || null,
118
+ memberFamilyIdColumn: a.memberFamilyIdColumn || null,
119
+ memberNameColumn: a.memberNameColumn || null,
120
+ memberDobColumn: a.memberDobColumn || null,
121
+ countryCode: a.countryCode,
122
+ managePurchaseAmounts: a.manageSales ? !0 : !!a.managePurchaseAmounts,
123
+ manageSales: !!a.manageSales,
124
+ allowPersonalPurchase: !!a.allowPersonalPurchase,
125
+ allowFacilityPurchase: !!a.allowFacilityPurchase,
126
+ requirePurchaseConfirmation: !!a.requirePurchaseConfirmation,
127
+ autoGenerateLotNumber: a.requirePurchaseConfirmation ? !1 : !!a.autoGenerateLotNumber,
128
+ allowGroupSessions: !!a.allowGroupSessions,
129
+ allowManualAdjustment: !!a.allowManualAdjustment,
130
+ documentModule: a.documentModule || null
131
+ });
132
+ d((g) => ({
133
+ ...oe(t),
134
+ memberQuery: g.memberQuery,
135
+ memberQuerySqlite: g.memberQuerySqlite
136
+ })), de(t), ce(!0).catch(() => {
137
+ }), z({
138
+ message: "Settings saved.",
139
+ type: "success"
140
+ });
141
+ } catch (t) {
142
+ let g = ((l = (e = t == null ? void 0 : t.response) == null ? void 0 : e.data) == null ? void 0 : l.message) ?? (t == null ? void 0 : t.message) ?? "Failed to save settings";
143
+ r(g), z({
144
+ message: g,
145
+ type: "error"
146
+ });
147
+ } finally {
148
+ u(!1);
149
+ }
150
+ }
151
+ }
152
+ return /* @__PURE__ */ i(y, { children: [/* @__PURE__ */ o(be, {}), /* @__PURE__ */ o(ye, {
153
+ perm: "view.manage.productManagement.settings",
154
+ children: /* @__PURE__ */ i(fe, {
155
+ title: "Settings",
156
+ subtitle: "Set up the module for your deployment. Choose your country, link to your database, and enable the features you need.",
157
+ chips: ["Configuration"],
158
+ actions: /* @__PURE__ */ i(q, {
159
+ direction: "row",
160
+ spacing: 1,
161
+ children: [/* @__PURE__ */ o(X, {
162
+ variant: "outlined",
163
+ startIcon: /* @__PURE__ */ o(xe, {}),
164
+ onClick: () => void R(),
165
+ children: "Refresh"
166
+ }), /* @__PURE__ */ o(X, {
167
+ variant: "contained",
168
+ startIcon: /* @__PURE__ */ o(Se, {}),
169
+ disabled: !j || x || f || !n,
170
+ onClick: () => void k(),
171
+ children: x ? "Saving…" : "Save"
172
+ })]
173
+ }),
174
+ children: [
175
+ p ? /* @__PURE__ */ o(F, {
176
+ severity: "error",
177
+ sx: { mb: 2 },
178
+ children: p
179
+ }) : null,
180
+ /* @__PURE__ */ o($, {
181
+ sx: {
182
+ borderRadius: 1.5,
183
+ mb: 2,
184
+ border: "1px solid",
185
+ borderColor: "divider",
186
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
187
+ },
188
+ children: /* @__PURE__ */ i(O, {
189
+ sx: { p: 2.5 },
190
+ children: [/* @__PURE__ */ o(E, {
191
+ eyebrow: "Locale",
192
+ title: "Implementation country",
193
+ hint: "The country controls currency display and phone number formats.",
194
+ sx: { mb: 2 }
195
+ }), /* @__PURE__ */ i(P, {
196
+ container: !0,
197
+ spacing: 2,
198
+ children: [/* @__PURE__ */ o(P, {
199
+ item: !0,
200
+ xs: 12,
201
+ md: 6,
202
+ children: /* @__PURE__ */ o(Ie, {
203
+ required: !0,
204
+ disableClearable: !0,
205
+ value: a.countryCode,
206
+ onChange: (e) => s("countryCode", e),
207
+ error: !!I,
208
+ helperText: I || "Type to search by name, code, currency, or dial code."
209
+ })
210
+ }), /* @__PURE__ */ o(P, {
211
+ item: !0,
212
+ xs: 12,
213
+ md: 6,
214
+ children: /* @__PURE__ */ i(q, {
215
+ direction: "row",
216
+ spacing: 1.5,
217
+ sx: { height: "100%" },
218
+ children: [/* @__PURE__ */ o(ne, {
219
+ icon: /* @__PURE__ */ o(ve, { fontSize: "small" }),
220
+ label: "Currency",
221
+ primary: `${(m == null ? void 0 : m.currencySymbol) ?? "—"} 1,234.50`,
222
+ secondary: (m == null ? void 0 : m.currencyCode) ?? "—"
223
+ }), /* @__PURE__ */ o(ne, {
224
+ icon: /* @__PURE__ */ o(ke, { fontSize: "small" }),
225
+ label: "Phone",
226
+ primary: (m == null ? void 0 : m.phoneCode) ?? "—",
227
+ secondary: m ? `${m.phoneMin}${m.phoneMin === m.phoneMax ? "" : `–${m.phoneMax}`} digits` : "—"
228
+ })]
229
+ })
230
+ })]
231
+ })]
232
+ })
233
+ }),
234
+ /* @__PURE__ */ o($, {
235
+ sx: {
236
+ borderRadius: 1.5,
237
+ mb: 2,
238
+ border: "1px solid",
239
+ borderColor: "divider",
240
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
241
+ },
242
+ children: /* @__PURE__ */ i(O, {
243
+ sx: { p: 2.5 },
244
+ children: [/* @__PURE__ */ o(E, {
245
+ eyebrow: "Scope",
246
+ title: "Features",
247
+ hint: "Turn on only the features you need.",
248
+ sx: { mb: 2 }
249
+ }), /* @__PURE__ */ i(q, {
250
+ spacing: 1.5,
251
+ children: [
252
+ /* @__PURE__ */ o(S, {
253
+ label: "Manage sales and payments",
254
+ hint: "Turn off to hide sales and payment features.",
255
+ value: a.manageSales,
256
+ onChange: (e) => s("manageSales", e)
257
+ }),
258
+ /* @__PURE__ */ o(S, {
259
+ label: "Manage purchase amounts",
260
+ hint: "Turn off if you only track stock, not money.",
261
+ value: a.manageSales ? !0 : a.managePurchaseAmounts,
262
+ onChange: (e) => s("managePurchaseAmounts", e),
263
+ disabled: a.manageSales,
264
+ lockNote: "Required while sales and payments are on — sales need purchase costs to compute margins."
265
+ }),
266
+ /* @__PURE__ */ o(S, {
267
+ label: "Allow personal purchases",
268
+ hint: "Let stock be bought into someone's own personal inventory.",
269
+ value: a.allowPersonalPurchase,
270
+ onChange: (e) => {
271
+ if (!e && !a.allowFacilityPurchase) {
272
+ z({
273
+ message: "Keep at least one of personal or facility purchases on.",
274
+ type: "warning"
275
+ });
276
+ return;
277
+ }
278
+ s("allowPersonalPurchase", e);
279
+ }
280
+ }),
281
+ /* @__PURE__ */ o(S, {
282
+ label: "Allow facility purchases",
283
+ hint: "Let stock be bought into a facility's inventory.",
284
+ value: a.allowFacilityPurchase,
285
+ onChange: (e) => {
286
+ if (!e && !a.allowPersonalPurchase) {
287
+ z({
288
+ message: "Keep at least one of personal or facility purchases on.",
289
+ type: "warning"
290
+ });
291
+ return;
292
+ }
293
+ s("allowFacilityPurchase", e);
294
+ }
295
+ }),
296
+ /* @__PURE__ */ o(S, {
297
+ label: "Require purchase confirmation",
298
+ hint: "Turn on to require a manager to approve purchases before stock is added.",
299
+ value: a.requirePurchaseConfirmation,
300
+ onChange: (e) => d((l) => ({
301
+ ...l,
302
+ requirePurchaseConfirmation: e,
303
+ autoGenerateLotNumber: e ? !1 : l.autoGenerateLotNumber
304
+ }))
305
+ }),
306
+ a.requirePurchaseConfirmation ? null : /* @__PURE__ */ o(S, {
307
+ label: "Generate lot numbers automatically",
308
+ hint: "Turn on to give every purchase line a generated lot number instead of typing one.",
309
+ value: a.autoGenerateLotNumber,
310
+ onChange: (e) => s("autoGenerateLotNumber", e)
311
+ }),
312
+ /* @__PURE__ */ o(S, {
313
+ label: "Allow group sessions",
314
+ hint: "Let outreach sessions be shared with colleagues who administer from one pooled stock. When off, every session is for a single user.",
315
+ value: a.allowGroupSessions,
316
+ onChange: (e) => s("allowGroupSessions", e)
317
+ }),
318
+ /* @__PURE__ */ o(S, {
319
+ label: "Allow manual stock adjustment",
320
+ hint: "Let staff correct stock figures by hand, raising a batch quantity or correcting what is left in an open vial. Every correction is recorded in the ledger with a reason. Staff also need the adjustment permission.",
321
+ value: a.allowManualAdjustment,
322
+ onChange: (e) => s("allowManualAdjustment", e)
323
+ })
324
+ ]
325
+ })]
326
+ })
327
+ }),
328
+ /* @__PURE__ */ o($, {
329
+ sx: {
330
+ borderRadius: 1.5,
331
+ mb: 2,
332
+ border: "1px solid",
333
+ borderColor: "divider",
334
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
335
+ },
336
+ children: /* @__PURE__ */ i(O, {
337
+ sx: { p: 2.5 },
338
+ children: [/* @__PURE__ */ o(E, {
339
+ eyebrow: "Storage",
340
+ title: "Documents",
341
+ hint: "Where uploaded product images are stored.",
342
+ sx: { mb: 2 }
343
+ }), /* @__PURE__ */ o(P, {
344
+ container: !0,
345
+ spacing: 2,
346
+ children: /* @__PURE__ */ o(P, {
347
+ item: !0,
348
+ xs: 12,
349
+ md: 6,
350
+ children: /* @__PURE__ */ o(ae, {
351
+ size: "small",
352
+ options: B,
353
+ value: a.documentModule || null,
354
+ onChange: (e, l) => s("documentModule", l ?? ""),
355
+ renderInput: (e) => /* @__PURE__ */ o(re, {
356
+ ...e,
357
+ label: "Document module",
358
+ placeholder: "Type to search…",
359
+ helperText: M.length === 0 ? "No document modules found — the default module is used." : "Product-image uploads are stored under this module."
360
+ })
361
+ })
362
+ })
363
+ })]
364
+ })
365
+ }),
366
+ /* @__PURE__ */ o($, {
367
+ sx: {
368
+ borderRadius: 1.5,
369
+ border: "1px solid",
370
+ borderColor: "divider",
371
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
372
+ },
373
+ children: /* @__PURE__ */ i(O, {
374
+ sx: { p: 2.5 },
375
+ children: [/* @__PURE__ */ o(E, {
376
+ eyebrow: "Identity mappings",
377
+ title: "Subjects",
378
+ hint: "Connect customer data from your system. This links real people to the app.",
379
+ sx: { mb: 2 }
380
+ }), /* @__PURE__ */ o(q, {
381
+ spacing: 3,
382
+ children: /* @__PURE__ */ o(qe, {
383
+ canWrite: n,
384
+ editorNonce: U,
385
+ query: a.memberQuery,
386
+ onQueryChange: (e) => {
387
+ s("memberQuery", e), L(!0), N(null);
388
+ },
389
+ sqliteQuery: a.memberQuerySqlite,
390
+ onSqliteQueryChange: (e) => s("memberQuerySqlite", e),
391
+ onValidate: () => void v(),
392
+ validating: H,
393
+ queryError: K,
394
+ queryColumns: w,
395
+ queryDirty: G,
396
+ missingAliases: W,
397
+ idColumnValue: a.memberIdColumn,
398
+ onIdColumnChange: (e) => s("memberIdColumn", e),
399
+ identifierColumnValue: a.memberIdentifierColumn,
400
+ onIdentifierColumnChange: (e) => s("memberIdentifierColumn", e),
401
+ familyIdColumnValue: a.memberFamilyIdColumn,
402
+ onFamilyIdColumnChange: (e) => s("memberFamilyIdColumn", e),
403
+ nameColumnValue: a.memberNameColumn,
404
+ onNameColumnChange: (e) => s("memberNameColumn", e),
405
+ dobColumnValue: a.memberDobColumn,
406
+ onDobColumnChange: (e) => s("memberDobColumn", e)
407
+ })
408
+ })]
409
+ })
410
+ })
411
+ ]
412
+ })
413
+ })] });
414
+ }
415
+ function S({ label: n, hint: a, value: d, onChange: f, disabled: h = !1, lockNote: x = "" }) {
416
+ let u = !!d, p = !h;
417
+ return /* @__PURE__ */ i(y, {
418
+ role: "button",
419
+ tabIndex: p ? 0 : -1,
420
+ "aria-disabled": h || void 0,
421
+ onClick: p ? () => f(!u) : void 0,
422
+ onKeyDown: p ? (r) => {
423
+ (r.key === " " || r.key === "Enter") && (r.preventDefault(), f(!u));
424
+ } : void 0,
425
+ sx: (r) => ({
426
+ display: "flex",
427
+ alignItems: "center",
428
+ gap: 2,
429
+ p: 2,
430
+ borderRadius: 1.5,
431
+ cursor: p ? "pointer" : "not-allowed",
432
+ opacity: p ? 1 : 0.75,
433
+ border: "1px solid",
434
+ borderColor: u ? C(r.palette.primary.main, 0.35) : "divider",
435
+ bgcolor: u ? C(r.palette.primary.main, 0.04) : "transparent",
436
+ transition: "all 180ms ease",
437
+ "&:hover": p ? {
438
+ borderColor: u ? r.palette.primary.main : C(r.palette.primary.main, 0.35),
439
+ bgcolor: u ? C(r.palette.primary.main, 0.06) : C(r.palette.primary.main, 0.02)
440
+ } : void 0
441
+ }),
442
+ children: [/* @__PURE__ */ i(y, {
443
+ sx: {
444
+ flexGrow: 1,
445
+ minWidth: 0
446
+ },
447
+ children: [/* @__PURE__ */ i(q, {
448
+ direction: "row",
449
+ alignItems: "center",
450
+ spacing: 1,
451
+ children: [
452
+ /* @__PURE__ */ o(c, {
453
+ variant: "subtitle1",
454
+ sx: {
455
+ fontWeight: 800,
456
+ lineHeight: 1.2
457
+ },
458
+ children: n
459
+ }),
460
+ /* @__PURE__ */ o(y, {
461
+ sx: (r) => ({
462
+ px: 0.9,
463
+ py: 0.15,
464
+ borderRadius: 999,
465
+ fontSize: "0.65rem",
466
+ fontWeight: 800,
467
+ letterSpacing: 0.6,
468
+ textTransform: "uppercase",
469
+ color: u ? r.palette.success.dark : r.palette.text.disabled,
470
+ bgcolor: u ? C(r.palette.success.main, 0.12) : C(r.palette.text.disabled, 0.1)
471
+ }),
472
+ children: u ? "Enabled" : "Disabled"
473
+ }),
474
+ h && x ? /* @__PURE__ */ o(y, {
475
+ sx: (r) => ({
476
+ px: 0.9,
477
+ py: 0.15,
478
+ borderRadius: 999,
479
+ fontSize: "0.65rem",
480
+ fontWeight: 800,
481
+ letterSpacing: 0.6,
482
+ textTransform: "uppercase",
483
+ color: r.palette.warning.dark,
484
+ bgcolor: C(r.palette.warning.main, 0.14)
485
+ }),
486
+ children: "Locked"
487
+ }) : null
488
+ ]
489
+ }), /* @__PURE__ */ o(c, {
490
+ variant: "caption",
491
+ color: "text.secondary",
492
+ sx: {
493
+ display: "block",
494
+ mt: 0.5
495
+ },
496
+ children: h && x ? x : a
497
+ })]
498
+ }), /* @__PURE__ */ o(we, {
499
+ checked: u,
500
+ disabled: h,
501
+ onClick: (r) => r.stopPropagation(),
502
+ onChange: (r) => f(r.target.checked)
503
+ })]
504
+ });
505
+ }
506
+ function ne({ icon: n, label: a, primary: d, secondary: f }) {
507
+ return /* @__PURE__ */ i(y, {
508
+ sx: (h) => ({
509
+ flex: 1,
510
+ minWidth: 0,
511
+ p: 1.25,
512
+ borderRadius: 1.5,
513
+ border: "1px solid",
514
+ borderColor: "divider",
515
+ bgcolor: C(h.palette.primary.main, 0.03),
516
+ display: "flex",
517
+ flexDirection: "column",
518
+ justifyContent: "center"
519
+ }),
520
+ children: [
521
+ /* @__PURE__ */ i(q, {
522
+ direction: "row",
523
+ alignItems: "center",
524
+ spacing: 0.75,
525
+ sx: {
526
+ color: "text.secondary",
527
+ mb: 0.25
528
+ },
529
+ children: [n, /* @__PURE__ */ o(c, {
530
+ variant: "caption",
531
+ sx: {
532
+ fontWeight: 800,
533
+ letterSpacing: 0.6,
534
+ textTransform: "uppercase"
535
+ },
536
+ children: a
537
+ })]
538
+ }),
539
+ /* @__PURE__ */ o(c, {
540
+ sx: {
541
+ fontWeight: 800,
542
+ fontSize: "1.1rem",
543
+ fontVariantNumeric: "tabular-nums",
544
+ lineHeight: 1.2
545
+ },
546
+ noWrap: !0,
547
+ children: d
548
+ }),
549
+ /* @__PURE__ */ o(c, {
550
+ variant: "caption",
551
+ color: "text.secondary",
552
+ noWrap: !0,
553
+ children: f
554
+ })
555
+ ]
556
+ });
557
+ }
558
+ function qe({ canWrite: n, editorNonce: a, query: d, onQueryChange: f, sqliteQuery: h, onSqliteQueryChange: x, onValidate: u, validating: p, queryError: r, queryColumns: M, queryDirty: Q, missingAliases: w, idColumnValue: N, onIdColumnChange: K, identifierColumnValue: D, onIdentifierColumnChange: H, familyIdColumnValue: T, onFamilyIdColumnChange: G, nameColumnValue: L, onNameColumnChange: U, dobColumnValue: Y, onDobColumnChange: R }) {
559
+ let s = Array.isArray(M), v = M ?? [], _ = Object.fromEntries(v.map((e) => [e.name, e.type])), A = v.filter((e) => e.usable).map((e) => e.name), W = v.filter((e) => e.usable && e.kind === "UUID").map((e) => e.name), I = v.filter((e) => !e.usable).length, j = (e, l) => l && !e.includes(l) ? [l, ...e] : e, m = (e) => s ? e : "Load fields to choose.", B = (e, l) => /* @__PURE__ */ i(y, {
560
+ component: "li",
561
+ ...e,
562
+ sx: {
563
+ display: "flex",
564
+ justifyContent: "space-between",
565
+ gap: 2
566
+ },
567
+ children: [/* @__PURE__ */ o("span", { children: l }), /* @__PURE__ */ o(c, {
568
+ variant: "caption",
569
+ color: "text.secondary",
570
+ children: _[l] ?? ""
571
+ })]
572
+ }), k = (e, l, t, g, Z) => /* @__PURE__ */ o(P, {
573
+ item: !0,
574
+ xs: 12,
575
+ md: 6,
576
+ children: /* @__PURE__ */ o(ae, {
577
+ size: "small",
578
+ options: j(g, l),
579
+ value: l || null,
580
+ onChange: (V, J) => t(J ?? ""),
581
+ disabled: !n || !s,
582
+ renderOption: B,
583
+ renderInput: (V) => /* @__PURE__ */ o(re, {
584
+ ...V,
585
+ label: e,
586
+ placeholder: "Type to search…",
587
+ helperText: m(Z)
588
+ })
589
+ })
590
+ });
591
+ return /* @__PURE__ */ i(y, { children: [
592
+ /* @__PURE__ */ o(c, {
593
+ variant: "subtitle2",
594
+ sx: { fontWeight: 800 },
595
+ children: "Members"
596
+ }),
597
+ /* @__PURE__ */ o(c, {
598
+ variant: "caption",
599
+ color: "text.secondary",
600
+ sx: {
601
+ display: "block",
602
+ mb: 1.5
603
+ },
604
+ children: "Patients and customers who can be sold to, charged dues, and administered vaccines. Write a lookup that returns one row per member, give each field you need a short name using AS, then choose which of those names to use below."
605
+ }),
606
+ /* @__PURE__ */ o(c, {
607
+ variant: "caption",
608
+ sx: {
609
+ display: "block",
610
+ fontWeight: 800,
611
+ mb: 0.5
612
+ },
613
+ children: "Lookup for the website"
614
+ }),
615
+ /* @__PURE__ */ o(y, {
616
+ sx: {
617
+ border: "1px solid",
618
+ borderColor: "divider",
619
+ borderRadius: 1.5,
620
+ overflow: "hidden",
621
+ mb: 1
622
+ },
623
+ children: /* @__PURE__ */ o(ee, {
624
+ height: "28vh",
625
+ defaultValue: d,
626
+ onChange: f,
627
+ mode: n ? "EDIT_MODE" : "READ_ONLY",
628
+ autoFocus: !1
629
+ }, a)
630
+ }),
631
+ /* @__PURE__ */ i(q, {
632
+ direction: "row",
633
+ spacing: 1,
634
+ alignItems: "center",
635
+ sx: { mb: 1.5 },
636
+ children: [
637
+ /* @__PURE__ */ o(X, {
638
+ size: "small",
639
+ variant: "outlined",
640
+ onClick: u,
641
+ disabled: !n || p || !(d != null && d.trim()),
642
+ children: p ? "Loading…" : "Load fields"
643
+ }),
644
+ Q ? /* @__PURE__ */ o(c, {
645
+ variant: "caption",
646
+ color: "text.secondary",
647
+ children: "Load fields to check the lookup before saving."
648
+ }) : null,
649
+ s && !Q ? /* @__PURE__ */ i(c, {
650
+ variant: "caption",
651
+ color: "text.secondary",
652
+ children: [
653
+ v.length,
654
+ " ",
655
+ v.length === 1 ? "field" : "fields",
656
+ " found",
657
+ I > 0 ? `, ${I} without a name` : "",
658
+ "."
659
+ ]
660
+ }) : null
661
+ ]
662
+ }),
663
+ r ? /* @__PURE__ */ o(F, {
664
+ severity: "error",
665
+ sx: { mb: 1.5 },
666
+ children: r
667
+ }) : null,
668
+ w.length > 0 ? /* @__PURE__ */ i(F, {
669
+ severity: "warning",
670
+ sx: { mb: 1.5 },
671
+ children: [
672
+ w.length === 1 ? "This field is" : "These fields are",
673
+ " no longer in the results: ",
674
+ w.join(", "),
675
+ ". Pick ",
676
+ w.length === 1 ? "another one" : "new ones",
677
+ " before saving."
678
+ ]
679
+ }) : null,
680
+ I > 0 ? /* @__PURE__ */ o(F, {
681
+ severity: "info",
682
+ sx: { mb: 1.5 },
683
+ children: "Some results have no name and cannot be mapped. Give each one a short name in the lookup using AS."
684
+ }) : null,
685
+ /* @__PURE__ */ i(P, {
686
+ container: !0,
687
+ spacing: 2,
688
+ children: [
689
+ k("Member id field", N, K, W, "Holds the member id. It must be a uuid; cast it in the lookup if needed."),
690
+ k("Unique identifier field", D, H, A, "Shown on the profile card, for example a national id."),
691
+ k("Family id field", T, G, A, "Groups members by household."),
692
+ k("Name field", L, U, A, "Display name. Also used by the recent sales and payments tables."),
693
+ k("Date of birth field", Y, R, A, "Age is worked out from this. A field that is not a date shows no age.")
694
+ ]
695
+ }),
696
+ /* @__PURE__ */ o(c, {
697
+ variant: "caption",
698
+ sx: {
699
+ display: "block",
700
+ fontWeight: 800,
701
+ mt: 3,
702
+ mb: 0.5
703
+ },
704
+ children: "Lookup for the mobile app"
705
+ }),
706
+ /* @__PURE__ */ o(c, {
707
+ variant: "caption",
708
+ color: "text.secondary",
709
+ sx: {
710
+ display: "block",
711
+ mb: 1.5
712
+ },
713
+ children: "The mobile app keeps its own copy of the data on the phone and cannot run the lookup above. Write the same lookup here in SQLite, against the tables on the phone, and give the fields the same short names you chose above so the mapping fits both."
714
+ }),
715
+ /* @__PURE__ */ o(y, {
716
+ sx: {
717
+ border: "1px solid",
718
+ borderColor: "divider",
719
+ borderRadius: 1.5,
720
+ overflow: "hidden",
721
+ mb: 1
722
+ },
723
+ children: /* @__PURE__ */ o(ee, {
724
+ height: "24vh",
725
+ defaultValue: h,
726
+ onChange: x,
727
+ mode: n ? "EDIT_MODE" : "READ_ONLY",
728
+ autoFocus: !1
729
+ }, `sqlite-${a}`)
730
+ }),
731
+ /* @__PURE__ */ o(F, {
732
+ severity: "info",
733
+ sx: { mb: 1.5 },
734
+ children: "This lookup is only checked for being read only. It runs on the phone, so the field names it suggests as you type come from the server and will not match. Leave it empty if there is no mobile app."
735
+ })
736
+ ] });
737
+ }
738
+ export {
739
+ ze as default
740
+ };
741
+ //# sourceMappingURL=SettingsPage-Cre-UE3r-9ntnLYsQ.js.map