@feedmepos/mf-inventory-portal 1.8.0-dev.2 → 1.8.0-dev.20

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 (248) hide show
  1. package/dist/App-5GYyCfFq.js +1445 -0
  2. package/dist/{ApprovalView-RaXuWWSu.js → ApprovalView-DY1ayl1W.js} +26 -25
  3. package/dist/{BindingsDialog-DomvXijP.js → BindingsDialog-Dm7uKMfV.js} +2 -2
  4. package/dist/{BindingsPicker-DGnzxEs7.js → BindingsPicker-DhnMlj4x.js} +2 -2
  5. package/dist/{BindingsTable-DfG9kWrv.js → BindingsTable-Cxibcjka.js} +10 -10
  6. package/dist/BulkReceiveRequestPage-w4AA6BxB.js +2839 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CVekIoiN.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B3ESPbQp.js} +1 -1
  8. package/dist/{ClosingDraftView-C3n66bbh.js → ClosingDraftView-DMaONEZ7.js} +748 -746
  9. package/dist/ClosingHistoryView-BBYruOux.js +769 -0
  10. package/dist/{ClosingTemplateView-DwGloYxn.js → ClosingTemplateView-DcwgokRl.js} +22 -21
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-9eY_r8LF.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-a72IldDO.js} +1 -1
  12. package/dist/{DefaultView-JC_e4xgC.js → DefaultView-BVr_7JDn.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-BBCvI67S.js → DeliveryOrderPrintPreview-BXZFD3D5.js} +15 -15
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-H4FWc9ga.js → EmailDialog.vue_vue_type_script_setup_true_lang-Dne_9P3j.js} +10077 -9950
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CYkPbFSA.js +48 -0
  16. package/dist/FeatureCapabilityGate-DK_rTVyJ.js +82 -0
  17. package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-DIhV51l7.js +189 -0
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Q8Mptiv3.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B80EHMBT.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CE1_yyHe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C94IFGoH.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CGJi3f86.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-COZPDuAM.js} +2 -2
  21. package/dist/{FmMultiselectDialog-DCaRlBIy.js → FmMultiselectDialog-C1P22sj2.js} +2 -2
  22. package/dist/FmMultiselectDialog-Kb3IftHf.js +123 -0
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-ClaLVtpK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BqB71yfu.js} +105 -99
  24. package/dist/ImportView-EJ4u8NHM.js +1540 -0
  25. package/dist/{IngredientsView-DPj9lBTK.js → IngredientsView-Bxsgm4E7.js} +691 -689
  26. package/dist/{IntegrationExplorerView-CO2wpUR_.js → IntegrationExplorerView-owEaOVeG.js} +1537 -1620
  27. package/dist/IntegrationPlatformView-BuptPyjg.js +13385 -0
  28. package/dist/{IntegrationView-DIeZoey0.js → IntegrationView-DAcdY_d_.js} +2604 -2565
  29. package/dist/{InventoryBindingForm-Cj4_Chue.js → InventoryBindingForm-BvjY4zrn.js} +1 -1
  30. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-DhbF-jgN.js +472 -0
  31. package/dist/{InventoryBindingSummary-yzGzd7jJ.js → InventoryBindingSummary-DPqm94GX.js} +1 -1
  32. package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
  33. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DDsigNJ4.js +79 -0
  34. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
  35. package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js +79 -0
  36. package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
  37. package/dist/ProductionRunDetailPage-BaPCJUqT.js +2317 -0
  38. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BYyiiAWb.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CNRX3MYt.js} +3053 -3163
  39. package/dist/ProductionRunPage-B6Jsv9Hh.js +954 -0
  40. package/dist/{PublishView-CPK9NeVF.js → PublishView-DonUv6nP.js} +3 -3
  41. package/dist/{PurchaseOrderPrintPreview-DosqWQeN.js → PurchaseOrderPrintPreview-CK3Cqdwp.js} +17 -17
  42. package/dist/{ReceiveRequestView-BxSkpK2t.js → ReceiveRequestView-CMAnKxzm.js} +17 -16
  43. package/dist/RecipeView-Bx13Bckq.js +3272 -0
  44. package/dist/SettingsView-D1MiAkD8.js +1005 -0
  45. package/dist/StockView-CsxTjVEd.js +3003 -0
  46. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-GdGJCuc0.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BT73j9SA.js} +1 -1
  47. package/dist/{SupplierView-BKxKoi_0.js → SupplierView-CFACoZya.js} +304 -301
  48. package/dist/{SurchargeView-Db4cwhZv.js → SurchargeView-CShhZa3x.js} +7 -7
  49. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpkF77Ow.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-B2OdmdI_.js} +2 -2
  50. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
  51. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-x3N2Oypo.js +332 -0
  52. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BISmGBJE.js +4953 -0
  53. package/dist/TransferTemplateView-kx2IPqEv.js +2347 -0
  54. package/dist/{UnitCostHistoryView-CqcyjCCd.js → UnitCostHistoryView-DgPWsXaB.js} +4 -4
  55. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DO80_8SZ.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BtfJJgIP.js} +4 -4
  56. package/dist/{UnitView-BqdK1AM_.js → UnitView-aupXLRMk.js} +111 -106
  57. package/dist/{WarehouseView-COJM9IXM.js → WarehouseView-MTvbY4n4.js} +12 -11
  58. package/dist/{WastageTemplateView-DW3viTHN.js → WastageTemplateView-Bs9HL-LK.js} +19 -18
  59. package/dist/api/bill.d.ts +4 -2
  60. package/dist/api/bill.spec.d.ts +1 -0
  61. package/dist/api/closing.d.ts +1 -0
  62. package/dist/api/feature-flags.d.ts +4 -0
  63. package/dist/api/integration-sync-log.d.ts +0 -13
  64. package/dist/api/license.d.ts +0 -2
  65. package/dist/api/netsuite-explorer.d.ts +1 -0
  66. package/dist/api/stock.d.ts +1 -1
  67. package/dist/{app-yvK__CBL.js → app-D38sV2ls.js} +10177 -10126
  68. package/dist/app.d.ts +151 -164
  69. package/dist/app.js +1 -1
  70. package/dist/bulk-edit-simulation.helper-DgniL8FN.js +178 -0
  71. package/dist/{closing-template-DezidSM0.js → closing-template-D_NAj_mU.js} +4 -4
  72. package/dist/components/FeatureCapabilityBadge.vue.d.ts +4 -0
  73. package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
  74. package/dist/components/FeatureCapabilityGate.vue.d.ts +5 -0
  75. package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
  76. package/dist/components/FeaturePageGate.spec.d.ts +1 -0
  77. package/dist/components/FeaturePageGate.vue.d.ts +34 -0
  78. package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
  79. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  80. package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
  81. package/dist/components/FmUnitInputProps.d.ts +1 -0
  82. package/dist/components/FmUnitInputRules.d.ts +1 -1
  83. package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
  84. package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
  85. package/dist/{views/ingredient-group/IngredientGroupView.vue.d.ts → components/PremiumUpgradePage.vue.d.ts} +0 -1
  86. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  87. package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
  88. package/dist/composable/defineApi.d.ts +1 -1
  89. package/dist/{date2-2XjepIqc.js → date2-CvgxwuM1.js} +1 -1
  90. package/dist/{dayjs.min-CNp5DLBB.js → dayjs.min-BOKV8T5Q.js} +1 -1
  91. package/dist/{decimal-Z7oJdGk8.js → decimal-5xyg1WLu.js} +2 -2
  92. package/dist/{defineDeepModel-CMxJn_H2.js → defineDeepModel-BwB9XcMu.js} +5 -5
  93. package/dist/{duplicate-template-BetV5oy_.js → duplicate-template-DvIgjm4K.js} +1 -1
  94. package/dist/{feature-CkWaZ-5K.js → feature-CsPbMoeJ.js} +2088 -2853
  95. package/dist/feature-flags/core.d.ts +3 -2
  96. package/dist/feature-flags/portal-feature-catalog.d.ts +1 -6
  97. package/dist/feature-flags/portal-feature-catalog.spec.d.ts +1 -0
  98. package/dist/feature-flags/vue.d.ts +24 -1
  99. package/dist/feature-flags/vue.spec.d.ts +1 -0
  100. package/dist/{format-time-from-id-DatSI9uD.js → format-time-from-id-DD6Ik9EK.js} +1 -1
  101. package/dist/{format-unit-display-DM5We5cx.js → format-unit-display-DG564AN3.js} +209 -208
  102. package/dist/helper/country.spec.d.ts +1 -0
  103. package/dist/helper/menu-usage-module.d.ts +2 -1
  104. package/dist/helper/number.d.ts +5 -1
  105. package/dist/helper/rules.d.ts +1 -1
  106. package/dist/{id-to-date-Dxw2jKhy.js → id-to-date-DoN7OM21.js} +1 -1
  107. package/dist/{import-export.helper-BOmADwUw.js → import-export.helper-CevBRFTZ.js} +17 -17
  108. package/dist/{index-7fz5sGDO.js → index-BIh1oTQH.js} +3 -3
  109. package/dist/{index-CIH9NCvs.js → index-BP3Avix6.js} +1 -1
  110. package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
  111. package/dist/index-eGvSlWMU.js +1892 -0
  112. package/dist/{index-ClYgfwW7.js → index-mzXhLwrZ.js} +2234 -2163
  113. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
  114. package/dist/{lz-string-CCsc2X7t.js → lz-string-DMjWYCk6.js} +1 -1
  115. package/dist/menu-usage-module-Bq_KLsO4.js +74 -0
  116. package/dist/{netsuite-COumFXC2.js → netsuite-ZtoZBFBX.js} +254 -263
  117. package/dist/netsuite-explorer-h_vID_ao.js +79 -0
  118. package/dist/{predefined-templates-Bw9A9LNA.js → predefined-templates-CdurFRJ4.js} +1 -1
  119. package/dist/production-run-list-DR1WsaBR.js +61 -0
  120. package/dist/{purchase-order-template-BaZjdGq8.js → purchase-order-template-BVdCftEo.js} +1 -1
  121. package/dist/{recalculationUtils-t32wAurN.js → recalculationUtils-DBG8HGiJ.js} +1 -1
  122. package/dist/router/name.d.ts +2 -2
  123. package/dist/{row-action.enum-BDeudY4d.js → row-action.enum-CGyAg4dC.js} +1 -1
  124. package/dist/rules-DbFiOzUd.js +243 -0
  125. package/dist/{stock-B59sfN28.js → stock-BATH4SoA.js} +1 -1
  126. package/dist/stock-DXxsDPEO.js +78 -0
  127. package/dist/stores/feature.d.ts +40 -10
  128. package/dist/stores/feature.load-state.spec.d.ts +1 -0
  129. package/dist/stores/inventory.d.ts +0 -47
  130. package/dist/stores/inventory.no-location.spec.d.ts +1 -0
  131. package/dist/stores/supplier.d.ts +1 -1
  132. package/dist/stores/warehouse.d.ts +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/{supplier-DnbLJ_cS.js → supplier-CKXQmBZn.js} +2 -2
  135. package/dist/{surcharge-C1uE3uQa.js → surcharge-qupRJjjO.js} +1 -1
  136. package/dist/tsconfig.app.tsbuildinfo +1 -1
  137. package/dist/{uom-rules-DjfyrFHJ.js → uom-rules-ALtgjANX.js} +1 -1
  138. package/dist/{use-ingredient-select-dialog-7A7fWyEH.js → use-ingredient-select-dialog-C1sJpjfV.js} +2 -2
  139. package/dist/use-inventory-binding-dialog-tl7-epun.js +113 -0
  140. package/dist/{use-template-enabled-locations-C-Hqqgzt.js → use-template-enabled-locations-DWk2ndDC.js} +2 -2
  141. package/dist/{use-transfer-locations-CqsXvOI2.js → use-transfer-locations-CsdYY996.js} +14 -14
  142. package/dist/{useHrmPermission-BzwD3Ctc.js → useHrmPermission-BtuqUrwj.js} +1 -1
  143. package/dist/{useNavigationMenu-PrZg9HS7.js → useNavigationMenu-DKxKXykI.js} +111 -117
  144. package/dist/{useSseClient-FCyLWq8k.js → useSseClient-CRfpltKK.js} +1 -1
  145. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
  146. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1 -1
  147. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  148. package/dist/views/import/helper/submit-rows.d.ts +1 -1
  149. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
  150. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
  151. package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
  152. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
  153. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
  154. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +3 -1
  155. package/dist/views/{ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts → integration/IntegrationPlatformView.vue.d.ts} +11 -24
  156. package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
  157. package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
  158. package/dist/views/integration/helper/opening-balance.d.ts +22 -0
  159. package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
  160. package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
  161. package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → production-run/ProductionRunDetailPage.vue.d.ts} +2 -2
  162. package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
  163. package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
  164. package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +4 -4
  165. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +19 -9
  166. package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +4 -4
  167. package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +4 -4
  168. package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +14 -14
  169. package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +4 -4
  170. package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +4 -4
  171. package/dist/views/production-run/features/planning/ProductionRunPlanner.vue.d.ts +1 -1
  172. package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +6 -6
  173. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
  174. package/dist/views/production-run/shared/model/production-run-list.d.ts +1 -1
  175. package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
  176. package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
  177. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
  178. package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
  179. package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
  180. package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
  181. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
  182. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +9 -9
  183. package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
  184. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
  185. package/dist/views/receive-request/import/export.spec.d.ts +1 -0
  186. package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
  187. package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
  188. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +20 -20
  189. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
  190. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +2 -2
  191. package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
  192. package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
  193. package/dist/views/recipe/helper/import-recipe.d.ts +32 -2
  194. package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
  195. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  196. package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +2 -0
  197. package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
  198. package/dist/views/stock/components/StockRecordCard.vue.d.ts +19 -865
  199. package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
  200. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
  201. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
  202. package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
  203. package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
  204. package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
  205. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
  206. package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
  207. package/dist/views/unit/composables/use-unit-form.spec.d.ts +1 -0
  208. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  209. package/dist/vue-CVco8McV.js +290 -0
  210. package/dist/{vue-i18n-C34f-Tph.js → vue-i18n-C443zpcA.js} +450 -450
  211. package/dist/{xlsx.util-X4amwe_k.js → xlsx.util-5_47Kslf.js} +2 -2
  212. package/package.json +71 -66
  213. package/dist/App-DVHgBTHP.js +0 -1499
  214. package/dist/BulkReceiveRequestView-DxHWrfbi.js +0 -2656
  215. package/dist/ClosingHistoryView-kdpYGy1Y.js +0 -761
  216. package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-5Cc08Svt.js +0 -58
  217. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C1C8aDA6.js +0 -61
  218. package/dist/FmMultiselectDialog-yVPY5aBV.js +0 -77
  219. package/dist/ImportView-DQrVMzxN.js +0 -1302
  220. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-7lT5UZc8.js +0 -51
  221. package/dist/IngredientGroupView-BMUnEaY7.js +0 -1000
  222. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CaBOK7NC.js +0 -563
  223. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DzzTPdyF.js +0 -72
  224. package/dist/ProductionRunDetailView-Cw-ecaey.js +0 -2312
  225. package/dist/ProductionRunView-C11eseXQ.js +0 -930
  226. package/dist/RecipeView-oHDWsT0P.js +0 -3624
  227. package/dist/SettingsView-QlUNwFhM.js +0 -983
  228. package/dist/StockView-a8LbVZ_7.js +0 -2614
  229. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
  230. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CCCj4WVF.js +0 -299
  231. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CFNPXqt5.js +0 -4796
  232. package/dist/TransferTemplateView-CzwxOBMQ.js +0 -2326
  233. package/dist/menu-usage-module-BdjYEk3s.js +0 -57
  234. package/dist/number-gSLvxNqA.js +0 -138
  235. package/dist/portal-feature-catalog-yGIESKTc.js +0 -246
  236. package/dist/random-CSbEbElR.js +0 -10
  237. package/dist/rules-C1btu0Md.js +0 -98
  238. package/dist/stock-BF86TMW0.js +0 -75
  239. package/dist/use-inventory-binding-dialog-Cc1tjTfV.js +0 -152
  240. package/dist/usePromise-CbVUCxhj.js +0 -29
  241. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
  242. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
  243. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
  244. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
  245. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
  246. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
  247. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
  248. package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
@@ -1,1499 +0,0 @@
1
- import { ref as k, onUnmounted as mt, computed as R, defineComponent as ce, watch as Z, onMounted as Ve, resolveComponent as Y, createElementBlock as c, openBlock as i, createBlock as pe, createCommentVNode as N, unref as $, createVNode as V, createElementVNode as h, toDisplayString as y, Fragment as j, renderList as oe, withKeys as Me, normalizeClass as ae, withModifiers as pt, withCtx as le, createTextVNode as ie, h as vt, onBeforeUnmount as gt, nextTick as yt, Teleport as ht, normalizeStyle as _t, mergeModels as bt, useModel as xt } from "vue";
2
- import { _ as wt } from "./empty-placeholder-B0QU467o.js";
3
- import { u as Ee, a as He, R as ue, d as kt, S as St, b as $t } from "./app-yvK__CBL.js";
4
- import { useCoreStore as ve, useI18n as he } from "@feedmepos/mf-common";
5
- import { useRouter as Ne, useRoute as Ct } from "vue-router";
6
- import { u as Je } from "./feature-CkWaZ-5K.js";
7
- import { u as Lt } from "./netsuite-COumFXC2.js";
8
- import { u as Ye, n as Rt, e as Dt } from "./useNavigationMenu-PrZg9HS7.js";
9
- import { useBreakpoints as It } from "@feedmepos/ui-library";
10
- import { F as We } from "./FmAdminBadge-DlplQOHb.js";
11
- import { i as Vt, _ as Et } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Q8Mptiv3.js";
12
- import { F as Nt } from "./decimal-Z7oJdGk8.js";
13
- import { t as Pt, a as Tt } from "./date2-2XjepIqc.js";
14
- import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
- import { u as Ut } from "./useTabStorage-BkIVScW_.js";
16
- import { _ as Ft } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C1C8aDA6.js";
17
- import { _ as At } from "./DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-5Cc08Svt.js";
18
- import { g as Oe } from "./portal-feature-catalog-yGIESKTc.js";
19
- import { u as Mt } from "./googlemap-D9vA7GsS.js";
20
- function Ot() {
21
- return {
22
- loadingHookInstalled: !1,
23
- isLoading: !1
24
- };
25
- }
26
- const me = k(Ot());
27
- function Kt() {
28
- const o = Ne();
29
- if (!me.value.loadingHookInstalled) {
30
- me.value.loadingHookInstalled = !0;
31
- const e = o.beforeEach(() => {
32
- me.value.isLoading = !0;
33
- }), t = o.afterEach(() => {
34
- me.value.isLoading = !1;
35
- });
36
- mt(() => {
37
- me.value.loadingHookInstalled = !1, e(), t();
38
- });
39
- }
40
- return {
41
- get isLoading() {
42
- return me.value.isLoading;
43
- }
44
- };
45
- }
46
- function Gt() {
47
- const { firstAccessibleRouteName: o } = Ye();
48
- return { hasAnyAccessibleInventoryRoute: R(() => o.value !== null) };
49
- }
50
- const zt = {
51
- key: 0,
52
- class: "flex flex-col items-center w-full h-full gap-24"
53
- }, jt = {
54
- key: 1,
55
- class: "flex flex-col pt-[200px] gap-32 items-center"
56
- }, Ht = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[600px]" }, Jt = { class: "fm-typo-en-title-lg-600" }, Yt = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Wt = {
57
- key: 2,
58
- class: "flex flex-col pt-[200px] gap-32 items-center"
59
- }, Xt = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[1000px]" }, qt = { class: "fm-typo-en-title-lg-600" }, Zt = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Qt = { class: "flex gap-16" }, en = { href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices" }, tn = { href: "https://feedme.ai/form" }, nn = /* @__PURE__ */ ce({
60
- __name: "InventoryView",
61
- setup(o) {
62
- const e = Ee(), t = He(), l = Lt(), a = ve(), s = Ne(), r = Kt(), u = Je(), { t: v } = he(), { hasAnyAccessibleInventoryRoute: p } = Gt();
63
- Z(
64
- [() => a.sessionUser.value, () => a.currentBusiness.value],
65
- ([O, C]) => {
66
- I(O, C);
67
- }
68
- ), Ve(async () => {
69
- await u.init(), await a.readBusinesses();
70
- const O = a.sessionUser.value, C = a.currentBusiness.value;
71
- I(O, C);
72
- });
73
- function I(O, C) {
74
- !O || !C || E();
75
- }
76
- async function E() {
77
- return await e.init(), await l.readSetting().catch((O) => {
78
- console.error("[all] error on reading netsuite store", O);
79
- }), await t.init();
80
- }
81
- const P = R(() => s.currentRoute.value.name === ue.TRANSFER_TEMPLATE ? u.enablePoTemplate : s.currentRoute.value.name === ue.INGREDIENT_GROUP ? u.enableIngredientGroup : !0), F = R(
82
- () => s.currentRoute.value.matched.some((O) => {
83
- var L;
84
- const C = O.meta, H = C == null ? void 0 : C.validationManifest;
85
- return (((L = H == null ? void 0 : H.requiredCaslPermissions) == null ? void 0 : L.length) ?? 0) > 0;
86
- })
87
- ), Q = R(() => {
88
- if (!a.sessionUser.value) return !1;
89
- if (e._locations !== null && e.locations.length === 0) return !0;
90
- if (!u.isLoaded) return !1;
91
- const H = s.currentRoute.value.name === ue.LOADING;
92
- return !p.value && (H || F.value);
93
- });
94
- return (O, C) => {
95
- const H = Y("FmSpacer"), L = Y("FmCircularProgress"), _ = Y("FmButton"), w = Y("RouterView");
96
- return i(), c("div", null, [
97
- $(r).isLoading ? (i(), c("div", zt, [
98
- V(H),
99
- h("div", null, [
100
- V(L, { size: "xl" })
101
- ]),
102
- C[0] || (C[0] = h("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
103
- V(H)
104
- ])) : Q.value ? (i(), c("div", jt, [
105
- C[1] || (C[1] = h("img", {
106
- src: wt,
107
- alt: "No permission",
108
- class: "w-[200px] h-[200px]"
109
- }, null, -1)),
110
- h("div", Ht, [
111
- h("div", Jt, y($(v)("inventory.common.noPermission.title")), 1),
112
- h("div", Yt, y($(v)("inventory.common.noPermission.description")), 1)
113
- ])
114
- ])) : P.value ? $(a).sessionUser.value ? (i(), pe(w, { key: 3 })) : N("", !0) : (i(), c("div", Wt, [
115
- h("div", Xt, [
116
- h("div", qt, y($(v)("inventory.common.proPlan.title")), 1),
117
- h("div", Zt, y($(v)("inventory.common.proPlan.subtitle")), 1)
118
- ]),
119
- h("div", Qt, [
120
- h("a", en, [
121
- V(_, {
122
- label: $(v)("inventory.common.proPlan.comparePlans"),
123
- variant: "secondary"
124
- }, null, 8, ["label"])
125
- ]),
126
- h("a", tn, [
127
- V(_, {
128
- label: $(v)("inventory.common.proPlan.callUs"),
129
- "prepend-icon": "call"
130
- }, null, 8, ["label"])
131
- ])
132
- ])
133
- ]))
134
- ]);
135
- };
136
- }
137
- }), Le = {
138
- // Template/PO item rows carry no id of their own — the embedded sku's _id is
139
- // the element identity, and kit names the element from that object's name
140
- // field, so an item change reads "Items › <sku name> › …" instead of a bare
141
- // index. Arrays where the key isn't usable (an element without sku._id, or
142
- // duplicates) fall back to identity_fields, then positional — unchanged.
143
- array_keys: { items: "sku._id" },
144
- identity_fields: ["_id", "id"],
145
- name_fields: ["name", "code"],
146
- ignored_fields: [
147
- "_id",
148
- "_rev",
149
- "_deleted",
150
- "__v",
151
- "updatedAt",
152
- "createdAt",
153
- "updatedBy",
154
- "createdBy"
155
- ],
156
- label_keys: {
157
- prefix: "inventory.changelog.label.",
158
- fields: [
159
- "abbrev",
160
- "alternatives",
161
- "amount",
162
- "code",
163
- "contains",
164
- "conversion",
165
- "convert",
166
- "costPerUnit",
167
- "customAttributes",
168
- "default",
169
- "defaultCost",
170
- "defaultRemark",
171
- "disabledMeasurements",
172
- "groups",
173
- "inventoryBindings",
174
- "isInactive",
175
- "items",
176
- "locations",
177
- "low",
178
- "measurement",
179
- "measurements",
180
- "mid",
181
- "name",
182
- "operationalGroup",
183
- "position",
184
- "precision",
185
- "priority",
186
- "recipe",
187
- "ref",
188
- "rules",
189
- "sku",
190
- "skuId",
191
- "thresholds",
192
- "trackingMeasurement",
193
- "type",
194
- "unit",
195
- "valuation",
196
- "version"
197
- ]
198
- }
199
- }, Re = {
200
- ...Le,
201
- array_keys: {
202
- measurements: "id",
203
- "unit.measurements": "id",
204
- "convert.inventoryBindings": "id",
205
- "convert.inventoryBindings.alternatives": "_id",
206
- contains: "id",
207
- "contains.alternatives": "_id"
208
- }
209
- };
210
- function on(o) {
211
- return o instanceof St && o.errorResponse.statusCode === 409;
212
- }
213
- const _e = kt((o, e) => ({
214
- /**
215
- * Commits for one record. recordId is the changelog docId, `${dbName}/${id}`.
216
- * The dbName scopes the (access-checked) backend route; only the bare id is
217
- * sent — the backend rebuilds the docId server-side.
218
- */
219
- async getRecordChangelog(t, l, a, s) {
220
- const r = t.indexOf("/");
221
- if (r < 0) return [];
222
- const u = t.slice(0, r), v = t.slice(r + 1), p = new URLSearchParams({ id: v });
223
- l != null && p.set("limit", String(l)), s && p.set("before", s), a && (p.set("explain", "1"), p.set("schema", JSON.stringify(a)));
224
- const I = `${o.inventoryBackendUrl}/${u}/changelog?${p.toString()}`;
225
- return await e.get(I);
226
- },
227
- /**
228
- * Purchase orders in a date range, each with when it last changed. The
229
- * backend joins the orders to their newest commit, so no ids travel and the
230
- * browser makes one request instead of list-then-ask-for-timestamps.
231
- */
232
- async listPurchaseOrders(t, l, a) {
233
- if (!t) return [];
234
- const s = new URLSearchParams({ start: l, end: a }), r = `${o.inventoryBackendUrl}/${t}/changelog/purchase-order?${s}`;
235
- return await e.get(r);
236
- },
237
- /**
238
- * Closing drafts created in a date range, each with when it last changed.
239
- * Closing groups come back as rows of their own — their submit/approve/
240
- * reject is recorded against the group document, not its parent.
241
- */
242
- async listClosingDrafts(t, l, a) {
243
- if (!t) return [];
244
- const s = new URLSearchParams({ start: l, end: a }), r = `${o.inventoryBackendUrl}/${t}/changelog/closing-draft?${s}`;
245
- return await e.get(r);
246
- },
247
- /**
248
- * A kit-dialect record's whole document, at HEAD or as of (and including)
249
- * commit `at`. Same dbName/id split as getRecordChangelog. Rejects with a
250
- * 409 (see isStateConflict) when the record's history predates the kit
251
- * write path — the backend passthrough for kit httpapi's GET /api/state.
252
- */
253
- async getState(t, l, a) {
254
- const s = new URLSearchParams({ id: l });
255
- a && s.set("at", a);
256
- const r = `${o.inventoryBackendUrl}/${t}/changelog/state?${s.toString()}`;
257
- return await e.get(r);
258
- },
259
- /**
260
- * The domains the browser lists generically, declared in
261
- * changelog-domains-pkg and served by the backend — a new browsable domain
262
- * becomes a tab without a portal change. Backends predating the route
263
- * yield an error the caller treats as "no extra domains".
264
- */
265
- async listDomains(t) {
266
- if (!t) return [];
267
- const l = `${o.inventoryBackendUrl}/business_${t}/changelog/domains`;
268
- return await e.get(l);
269
- },
270
- /**
271
- * One generic domain's records, each with when it last changed. Business-
272
- * scoped: the generic domains are configuration documents of the business
273
- * db, not of a location.
274
- */
275
- async listDomainRecords(t, l) {
276
- if (!t) return [];
277
- const a = `${o.inventoryBackendUrl}/business_${t}/changelog/domain/${encodeURIComponent(l)}`;
278
- return await e.get(a);
279
- },
280
- /**
281
- * One inventory module's records, each with when it last changed. Business-
282
- * scoped, so the db is `business_<id>` — the same prefixed name the record's
283
- * own changelog docId carries.
284
- */
285
- async listInventory(t, l) {
286
- if (!t) return [];
287
- const a = `${o.inventoryBackendUrl}/business_${t}/changelog/inventory?module=${l}`;
288
- return await e.get(a);
289
- }
290
- })), Se = 50;
291
- function an() {
292
- const o = _e(), e = k([]), t = k(!1), l = k(!1);
293
- let a = null, s = 0;
294
- async function r(v, p, I) {
295
- const E = ++s;
296
- if (a = null, l.value = !1, !v) {
297
- e.value = [];
298
- return;
299
- }
300
- t.value = !0;
301
- try {
302
- const P = p ?? Se, F = await o.getRecordChangelog(v, P, I);
303
- if (E !== s) return;
304
- e.value = F, p == null && (a = { recordId: v, explain: I }, l.value = F.length === P);
305
- } catch (P) {
306
- throw E === s && (e.value = []), P;
307
- } finally {
308
- E === s && (t.value = !1);
309
- }
310
- }
311
- async function u() {
312
- const v = e.value[e.value.length - 1];
313
- if (!a || !v || t.value || !l.value) return;
314
- const p = s;
315
- t.value = !0;
316
- try {
317
- const I = await o.getRecordChangelog(a.recordId, Se, a.explain, v.id);
318
- if (p !== s) return;
319
- e.value = [...e.value, ...I], l.value = I.length === Se;
320
- } finally {
321
- p === s && (t.value = !1);
322
- }
323
- }
324
- return { commits: e, isLoading: t, hasMore: l, load: r, loadMore: u };
325
- }
326
- const Xe = 1e3;
327
- function Ke(o) {
328
- const e = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d+))?/.exec(o);
329
- return e ? `${e[1]}.${(e[2] ?? "").padEnd(9, "0").slice(0, 9)}` : o;
330
- }
331
- function sn(o, e) {
332
- return [...o, ...e].sort(
333
- (t, l) => Ke(l.at).localeCompare(Ke(t.at)) || l.id.localeCompare(t.id)
334
- );
335
- }
336
- function ln() {
337
- const o = _e(), e = k([]);
338
- async function t(l) {
339
- if (e.value = [], !!l)
340
- try {
341
- e.value = await o.getRecordChangelog(
342
- l,
343
- Xe,
344
- Re
345
- );
346
- } catch (a) {
347
- console.error("changelog per-entity load failed", a);
348
- }
349
- }
350
- return { commits: e, load: t };
351
- }
352
- function qe(o) {
353
- if (!o) return null;
354
- try {
355
- const e = JSON.parse(o);
356
- return typeof (e == null ? void 0 : e.changelogLabelKey) == "string" && typeof (e == null ? void 0 : e.verb) == "string" ? {
357
- labelKey: e.changelogLabelKey,
358
- verb: e.verb,
359
- ...typeof e.name == "string" ? { name: e.name } : {}
360
- } : null;
361
- } catch {
362
- return null;
363
- }
364
- }
365
- function Ze(o) {
366
- return o.startsWith("inventory.changelog.");
367
- }
368
- const Qe = "";
369
- function De(o) {
370
- const e = o.indexOf(Qe);
371
- return e === -1 ? { raw: o, human: o } : { raw: o.slice(0, e), human: o.slice(e + 1) };
372
- }
373
- const rn = [
374
- "inventory.changelog.label.recipe",
375
- "inventory.changelog.label.sku",
376
- "inventory.changelog.label.unit"
377
- ], un = [...rn, "Recipe", "Ingredient", "Unit"];
378
- function cn(o) {
379
- const { human: e } = De(o);
380
- if (!e) return { type: "Document", name: "", field: [] };
381
- const t = e.split(" › ");
382
- return t.length >= 2 && un.includes(t[0]) ? { type: t[0], name: t[1], field: t.slice(2) } : { type: "Document", name: "", field: t };
383
- }
384
- const Ge = 800;
385
- function et(o, e, t = 2) {
386
- const l = ze(o), a = ze(e);
387
- if (!l || !a) return null;
388
- let s = 0;
389
- for (; s < l.length && s < a.length && l[s] === a[s]; ) s++;
390
- let r = 0;
391
- for (; r < l.length - s && r < a.length - s && l[l.length - 1 - r] === a[a.length - 1 - r]; )
392
- r++;
393
- const u = l.slice(s, l.length - r), v = a.slice(s, a.length - r);
394
- if (u.length > Ge || v.length > Ge) return null;
395
- const p = (I) => ({ type: "same", text: I });
396
- return fn(
397
- [...l.slice(0, s).map(p), ...dn(u, v), ...l.slice(l.length - r).map(p)],
398
- t
399
- );
400
- }
401
- function ze(o) {
402
- try {
403
- const e = JSON.parse(o);
404
- return e === null || typeof e != "object" ? null : JSON.stringify(e, null, 2).split(`
405
- `);
406
- } catch {
407
- return null;
408
- }
409
- }
410
- function dn(o, e) {
411
- const t = o.length, l = e.length, a = Array.from({ length: t + 1 }, () => new Uint32Array(l + 1));
412
- for (let v = t - 1; v >= 0; v--)
413
- for (let p = l - 1; p >= 0; p--)
414
- a[v][p] = o[v] === e[p] ? a[v + 1][p + 1] + 1 : Math.max(a[v + 1][p], a[v][p + 1]);
415
- const s = [];
416
- let r = 0, u = 0;
417
- for (; r < t && u < l; )
418
- o[r] === e[u] ? (s.push({ type: "same", text: o[r] }), r++, u++) : a[r + 1][u] >= a[r][u + 1] ? (s.push({ type: "del", text: o[r] }), r++) : (s.push({ type: "add", text: e[u] }), u++);
419
- for (; r < t; ) s.push({ type: "del", text: o[r++] });
420
- for (; u < l; ) s.push({ type: "add", text: e[u++] });
421
- return s;
422
- }
423
- function fn(o, e) {
424
- const t = o.map(() => !1);
425
- o.forEach((s, r) => {
426
- if (s.type !== "same")
427
- for (let u = Math.max(0, r - e); u <= Math.min(o.length - 1, r + e); u++)
428
- t[u] = !0;
429
- });
430
- const l = [];
431
- let a = !1;
432
- return o.forEach((s, r) => {
433
- t[r] ? (l.push(s), a = !1) : a || (l.push({ type: "skip", text: "⋯" }), a = !0);
434
- }), l;
435
- }
436
- function mn(o, e) {
437
- let t;
438
- try {
439
- t = JSON.parse(o);
440
- } catch {
441
- return o;
442
- }
443
- return t === null ? "—" : typeof t == "number" ? t.toLocaleString() : typeof t == "boolean" ? e(t ? "inventory.changelog.yes" : "inventory.changelog.no") : String(t);
444
- }
445
- function Ie(o, e, t = 0, l) {
446
- var p;
447
- const a = o.label == null ? void 0 : Ze(o.label) ? e(o.label) : o.label, s = a != null || o.value != null || o.display != null, r = !((p = o.kids) != null && p.length), u = [];
448
- s && u.push({
449
- depth: t,
450
- // A bare array index says nothing a reader needs — a leaf list entry
451
- // shows just its value. Branch nodes keep the index as their header.
452
- label: a != null && r && /^\d+$/.test(a) ? void 0 : a,
453
- text: r ? pn(o, e, l) : void 0,
454
- bookkeeping: !!o.bookkeeping
455
- });
456
- const v = s ? t + 1 : t;
457
- for (const I of o.kids ?? [])
458
- u.push(...Ie(I, e, v, l));
459
- return u;
460
- }
461
- function pn(o, e, t) {
462
- if (o.value == null) return o.display || void 0;
463
- const l = mn(o.value, e);
464
- return (t == null ? void 0 : t(l)) ?? o.display ?? l;
465
- }
466
- function $e(o, e) {
467
- return JSON.stringify(o, null, 2).split(`
468
- `).map((t) => ({ type: e, text: t }));
469
- }
470
- function vn() {
471
- const o = _e(), e = /* @__PURE__ */ new Map(), t = k(!1), l = k(null);
472
- async function a(s) {
473
- const r = e.get(s.id);
474
- if (r) {
475
- l.value = r;
476
- return;
477
- }
478
- t.value = !0;
479
- try {
480
- const u = s.doc_id.indexOf("/"), v = s.doc_id.slice(0, u), p = s.doc_id.slice(u + 1), [I, E] = await Promise.all([
481
- s.parent ? o.getState(v, p, s.parent) : Promise.resolve({}),
482
- o.getState(v, p, s.id)
483
- ]), F = { diff: s.parent ? et(JSON.stringify(I), JSON.stringify(E)) ?? [
484
- ...$e(I, "del"),
485
- ...$e(E, "add")
486
- ] : $e(E, "add"), conflict: !1 };
487
- e.set(s.id, F), l.value = F;
488
- } catch (u) {
489
- if (!on(u))
490
- throw l.value = null, u;
491
- const v = { diff: null, conflict: !0 };
492
- e.set(s.id, v), l.value = v;
493
- } finally {
494
- t.value = !1;
495
- }
496
- }
497
- return { isLoading: t, result: l, load: a };
498
- }
499
- const gn = {
500
- key: 0,
501
- class: "flex justify-center p-16"
502
- }, yn = {
503
- key: 1,
504
- class: "p-16 text-center text-gray-500"
505
- }, hn = {
506
- key: 2,
507
- class: "flex h-full min-h-0 gap-8"
508
- }, _n = { class: "w-1/3 shrink-0 overflow-y-auto border-r border-gray-200 pr-4" }, bn = ["onClick", "onKeydown"], xn = { class: "fm-typo-en-body-md-600" }, wn = { class: "text-xs text-gray-500" }, kn = {
509
- key: 0,
510
- class: "flex-1 overflow-y-auto pl-4"
511
- }, Sn = { class: "mb-12 flex flex-col gap-2 border-b border-gray-200 pb-8" }, $n = { class: "flex flex-wrap items-center gap-8" }, Cn = { class: "fm-typo-en-body-lg-600" }, Ln = {
512
- key: 0,
513
- class: "rounded-full bg-gray-100 px-8 text-xs text-gray-500"
514
- }, Rn = { class: "text-xs text-gray-500" }, Dn = { class: "mb-12" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary pl-8" }, Vn = {
515
- key: 0,
516
- class: "mb-12"
517
- }, En = {
518
- key: 1,
519
- class: "text-sm text-gray-400"
520
- }, Nn = {
521
- key: 2,
522
- class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
523
- }, Pn = {
524
- key: 0,
525
- class: "text-xs text-gray-400"
526
- }, Tn = { class: "fm-typo-en-body-md-600" }, Bn = { class: "flex flex-col gap-6" }, Un = {
527
- key: 0,
528
- class: "text-gray-700"
529
- }, Fn = { class: "min-w-[120px] shrink-0 text-gray-500" }, An = {
530
- key: 0,
531
- class: "flex w-full flex-col gap-4"
532
- }, Mn = {
533
- key: 0,
534
- class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
535
- }, On = { key: 0 }, Kn = { key: 1 }, Gn = {
536
- key: 1,
537
- class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
538
- }, zn = { key: 0 }, jn = { key: 1 }, Hn = {
539
- key: 1,
540
- class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
541
- }, Jn = {
542
- key: 2,
543
- class: "flex w-full flex-wrap items-baseline gap-4"
544
- }, Yn = {
545
- key: 0,
546
- class: "rounded bg-red-50 px-4 text-red-700"
547
- }, Wn = {
548
- key: 1,
549
- class: "text-gray-400"
550
- }, Xn = {
551
- key: 2,
552
- class: "rounded bg-green-50 px-4 text-green-700"
553
- }, qn = {
554
- key: 1,
555
- class: "text-sm text-gray-500"
556
- }, Zn = {
557
- key: 2,
558
- class: "mt-16 break-all border-t border-gray-200 pt-8 font-mono text-xs text-gray-400"
559
- }, Qn = { key: 0 }, eo = "capture baseline", to = /* @__PURE__ */ ce({
560
- __name: "ChangelogPanel",
561
- props: {
562
- commits: {},
563
- isLoading: { type: Boolean },
564
- resolveName: { type: Function }
565
- },
566
- setup(o) {
567
- const e = o, { t } = he(), l = k(null), a = R(
568
- () => e.commits.find((f) => f.id === l.value)
569
- ), s = /* @__PURE__ */ new Set(["updatedAt", "createdAt", "updatedBy", "createdBy", "_rev"]), r = R(() => {
570
- var b;
571
- return (((b = a.value) == null ? void 0 : b.changes) ?? []).filter((M) => {
572
- const { raw: A } = De(M.path);
573
- return A === "@payload" || M.from == null && M.to == null ? !1 : !A.split(".").some((X) => s.has(X));
574
- });
575
- });
576
- Z(
577
- () => e.commits,
578
- (f) => {
579
- var b;
580
- f.find((M) => M.id === l.value) || (l.value = ((b = f[0]) == null ? void 0 : b.id) ?? null);
581
- },
582
- { immediate: !0 }
583
- );
584
- const u = k(!1), { isLoading: v, result: p, load: I } = vn();
585
- Z([u, a], ([f, b]) => {
586
- p.value = null, !(!f || !b) && I(b).catch((M) => {
587
- console.error("changelog snapshot load failed", M), u.value = !1;
588
- });
589
- });
590
- function E(f) {
591
- return f ? f.slice(0, 8) : "";
592
- }
593
- function P(f) {
594
- return f ? new Date(f).toLocaleString() : "";
595
- }
596
- function F(f) {
597
- if (f == null) return "";
598
- let b;
599
- try {
600
- b = JSON.parse(f);
601
- } catch {
602
- return f;
603
- }
604
- return b === null ? "—" : typeof b == "string" ? b : typeof b == "number" ? b.toLocaleString() : typeof b == "boolean" ? t(b ? "inventory.changelog.yes" : "inventory.changelog.no") : JSON.stringify(b, null, 2);
605
- }
606
- function Q(f) {
607
- return (f.authors || []).join(", ") || t("inventory.changelog.unknownActor");
608
- }
609
- function O(f) {
610
- if (f.message === eo) return t("inventory.changelog.captureBaseline");
611
- const b = qe(f.message);
612
- if (!b) return f.message || t("inventory.changelog.noMessage");
613
- const M = C(b.labelKey);
614
- return b.name ? t(`inventory.changelog.message.${b.verb}`, { module: M, name: b.name }) : t(`inventory.changelog.message.${b.verb}NoName`, { module: M });
615
- }
616
- function C(f) {
617
- return Ze(f) ? t(f) : f;
618
- }
619
- const H = (f) => /[^a-zA-Z]/.test(f);
620
- function L(f, b) {
621
- return f == null || b == null ? null : et(f, b);
622
- }
623
- function _(f) {
624
- if (!(!f.to_value && !f.from_value))
625
- return {
626
- toTree: f.to_value ? Ie(f.to_value, t, 0, e.resolveName) : void 0,
627
- fromTree: f.from_value ? Ie(f.from_value, t, 0, e.resolveName) : void 0
628
- };
629
- }
630
- function w(f) {
631
- return f === "add" ? "bg-green-50 text-green-700" : f === "del" ? "bg-red-50 text-red-700" : f === "skip" ? "text-gray-400" : "text-gray-600";
632
- }
633
- function B(f) {
634
- return f.type === "skip" ? f.text : (f.type === "add" ? "+ " : f.type === "del" ? "- " : " ") + f.text;
635
- }
636
- const K = R(() => {
637
- const f = /* @__PURE__ */ new Map(), b = [], M = (g, m) => {
638
- let T = f.get(g);
639
- return T || (T = m(), f.set(g, T), b.push(T)), T;
640
- }, A = () => M("@doc", () => ({ header: "", lines: [] })), X = (g, m) => {
641
- var U;
642
- if (g == null) return m;
643
- let T;
644
- try {
645
- T = JSON.parse(g);
646
- } catch {
647
- T = g;
648
- }
649
- return (typeof T == "string" ? (U = e.resolveName) == null ? void 0 : U.call(e, T) : void 0) ?? m;
650
- }, J = (g, m, T) => {
651
- var U, W, ee, te;
652
- const x = _(m);
653
- x ? g.lines.push({ label: T, ...x }) : m.from != null && m.to != null ? g.lines.push({
654
- label: T,
655
- from: m.from,
656
- to: m.to,
657
- diff: L(m.from, m.to),
658
- fromDisplay: X(m.from, (U = m.display) == null ? void 0 : U.from),
659
- toDisplay: X(m.to, (W = m.display) == null ? void 0 : W.to)
660
- }) : m.to != null ? g.lines.push({ label: T, to: m.to, toDisplay: X(m.to, (ee = m.display) == null ? void 0 : ee.to) }) : g.lines.push({ label: T, from: m.from, fromDisplay: X(m.from, (te = m.display) == null ? void 0 : te.from) });
661
- }, D = (g) => {
662
- var T;
663
- const m = g.element;
664
- if (m) {
665
- const x = M(`kit:${(m.trail ?? []).join(".")}:${m.id ?? ""}`, () => ({
666
- kind: (m.trail ?? []).map(C).join(" › "),
667
- header: m.name || m.id || "",
668
- lines: []
669
- }));
670
- if ((T = g.field) != null && T.length)
671
- J(x, g, g.field.map(C).join(" › "));
672
- else {
673
- x.badge = g.to != null ? "added" : "removed";
674
- const U = _(g);
675
- U && x.lines.push(U);
676
- }
677
- return;
678
- }
679
- J(A(), g, (g.field ?? []).map(C).join(" › "));
680
- };
681
- for (const g of r.value) {
682
- const { raw: m, human: T } = De(g.path);
683
- if (g.kind === "create" && !m) {
684
- const ee = _(g);
685
- A().lines.push(
686
- ee ? { label: t("inventory.changelog.kind.created"), ...ee } : { text: t("inventory.changelog.kind.created") }
687
- );
688
- continue;
689
- }
690
- if (!g.path.includes(Qe) && (g.field || g.element)) {
691
- D(g);
692
- continue;
693
- }
694
- const x = m ? m.split(".") : [], U = T ? T.split(" › ") : [], W = x.findIndex((ee, te) => te > 0 && H(ee));
695
- if (W > 0 && U.length === x.length) {
696
- const ee = U[W], te = M(x.slice(0, W + 1).join("."), () => ({
697
- kind: U.slice(0, W).map(C).join(" › "),
698
- header: ee,
699
- lines: []
700
- })), re = U.slice(W + 1).map(C).join(" › ");
701
- if (re) J(te, g, re);
702
- else if (g.from != null && g.to != null) J(te, g, ee);
703
- else {
704
- te.badge = g.to != null ? "added" : "removed";
705
- const de = _(g);
706
- de && te.lines.push(de);
707
- }
708
- continue;
709
- }
710
- J(A(), g, U.map(C).join(" › "));
711
- }
712
- return b;
713
- });
714
- return (f, b) => {
715
- var X, J;
716
- const M = Y("FmCircularProgress"), A = Y("FmSwitch");
717
- return f.isLoading ? (i(), c("div", gn, [
718
- V(M)
719
- ])) : f.commits.length ? (i(), c("div", hn, [
720
- h("ol", _n, [
721
- (i(!0), c(j, null, oe(f.commits, (D) => (i(), c("li", {
722
- key: D.id,
723
- role: "button",
724
- tabindex: "0",
725
- class: ae([
726
- "cursor-pointer border-l-2 py-8 pl-12",
727
- D.id === l.value ? "border-fm-color-primary bg-fm-color-primary-50" : "border-gray-200 hover:bg-gray-50"
728
- ]),
729
- onClick: (g) => l.value = D.id,
730
- onKeydown: [
731
- Me((g) => l.value = D.id, ["enter"]),
732
- Me(pt((g) => l.value = D.id, ["prevent"]), ["space"])
733
- ]
734
- }, [
735
- h("div", xn, y(O(D)), 1),
736
- h("div", wn, y(Q(D)) + " · " + y(P(D.at)) + " · " + y(E(D.id)), 1)
737
- ], 42, bn))), 128))
738
- ]),
739
- a.value ? (i(), c("div", kn, [
740
- h("div", Sn, [
741
- h("div", $n, [
742
- h("div", Cn, y(O(a.value)), 1),
743
- a.value.parent ? N("", !0) : (i(), c("span", Ln, y($(t)("inventory.changelog.rootCommit")), 1))
744
- ]),
745
- h("div", Rn, y(Q(a.value)) + " · " + y(P(a.value.at)), 1)
746
- ]),
747
- h("div", Dn, [
748
- V(We, null, {
749
- default: le(() => [
750
- h("span", In, y($(t)("inventory.changelog.dataDiff")), 1),
751
- V(A, {
752
- modelValue: u.value,
753
- "onUpdate:modelValue": b[0] || (b[0] = (D) => u.value = D)
754
- }, null, 8, ["modelValue"])
755
- ]),
756
- _: 1
757
- })
758
- ]),
759
- u.value ? (i(), c("div", Vn, [
760
- $(v) ? (i(), pe(M, { key: 0 })) : (X = $(p)) != null && X.conflict ? (i(), c("div", En, y($(t)("inventory.changelog.snapshotUnavailable")), 1)) : (J = $(p)) != null && J.diff ? (i(), c("div", Nn, [
761
- (i(!0), c(j, null, oe($(p).diff, (D, g) => (i(), c("div", {
762
- key: g,
763
- class: ae(["whitespace-pre px-4", w(D.type)])
764
- }, y(B(D)), 3))), 128))
765
- ])) : N("", !0)
766
- ])) : N("", !0),
767
- (i(!0), c(j, null, oe(K.value, (D, g) => (i(), c("div", {
768
- key: g,
769
- class: "mb-12 rounded-lg border border-gray-200 p-12"
770
- }, [
771
- D.kind || D.header || D.badge ? (i(), c("div", {
772
- key: 0,
773
- class: ae(["flex flex-wrap items-baseline gap-8", D.lines.length ? "mb-8" : ""])
774
- }, [
775
- D.kind ? (i(), c("span", Pn, y(D.kind), 1)) : N("", !0),
776
- h("span", Tn, y(D.header), 1),
777
- D.badge ? (i(), c("span", {
778
- key: 1,
779
- class: ae(["rounded-full px-8 text-xs", D.badge === "added" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"])
780
- }, y(D.badge === "added" ? $(t)("inventory.changelog.added") : $(t)("inventory.changelog.kind.removed")), 3)) : N("", !0)
781
- ], 2)) : N("", !0),
782
- h("ul", Bn, [
783
- (i(!0), c(j, null, oe(D.lines, (m, T) => (i(), c("li", {
784
- key: T,
785
- class: "flex flex-wrap items-baseline gap-8 text-sm"
786
- }, [
787
- m.text ? (i(), c("span", Un, y(m.text), 1)) : (i(), c(j, { key: 1 }, [
788
- h("span", Fn, y(m.label), 1),
789
- m.toTree || m.fromTree ? (i(), c("div", An, [
790
- m.fromTree ? (i(), c("div", Mn, [
791
- (i(!0), c(j, null, oe(m.fromTree, (x, U) => (i(), c("div", {
792
- key: U,
793
- class: ae(["flex items-baseline gap-4 px-4", x.bookkeeping ? "text-gray-400" : "text-red-700"])
794
- }, [
795
- (i(!0), c(j, null, oe(x.depth, (W) => (i(), c("span", {
796
- key: W,
797
- class: "inline-block w-16"
798
- }))), 128)),
799
- x.label ? (i(), c("span", On, [
800
- ie(y(x.label), 1),
801
- x.text ? (i(), c(j, { key: 0 }, [
802
- ie(":")
803
- ], 64)) : N("", !0)
804
- ])) : N("", !0),
805
- x.text ? (i(), c("span", Kn, y(x.text), 1)) : N("", !0)
806
- ], 2))), 128))
807
- ])) : N("", !0),
808
- m.toTree ? (i(), c("div", Gn, [
809
- (i(!0), c(j, null, oe(m.toTree, (x, U) => (i(), c("div", {
810
- key: U,
811
- class: ae(["flex items-baseline gap-4 px-4", x.bookkeeping ? "text-gray-400" : "text-green-700"])
812
- }, [
813
- (i(!0), c(j, null, oe(x.depth, (W) => (i(), c("span", {
814
- key: W,
815
- class: "inline-block w-16"
816
- }))), 128)),
817
- x.label ? (i(), c("span", zn, [
818
- ie(y(x.label), 1),
819
- x.text ? (i(), c(j, { key: 0 }, [
820
- ie(":")
821
- ], 64)) : N("", !0)
822
- ])) : N("", !0),
823
- x.text ? (i(), c("span", jn, y(x.text), 1)) : N("", !0)
824
- ], 2))), 128))
825
- ])) : N("", !0)
826
- ])) : m.diff ? (i(), c("div", Hn, [
827
- (i(!0), c(j, null, oe(m.diff, (x, U) => (i(), c("div", {
828
- key: U,
829
- class: ae(["whitespace-pre px-4", w(x.type)])
830
- }, y(B(x)), 3))), 128))
831
- ])) : (i(), c("span", Jn, [
832
- m.from != null ? (i(), c("span", Yn, y(m.fromDisplay ?? F(m.from)), 1)) : N("", !0),
833
- m.from != null && m.to != null ? (i(), c("span", Wn, "→")) : N("", !0),
834
- m.to != null ? (i(), c("span", Xn, y(m.toDisplay ?? F(m.to)), 1)) : N("", !0)
835
- ]))
836
- ], 64))
837
- ]))), 128))
838
- ])
839
- ]))), 128)),
840
- K.value.length ? N("", !0) : (i(), c("div", qn, y($(t)("inventory.changelog.empty")), 1)),
841
- u.value ? (i(), c("div", Zn, [
842
- ie(y(a.value.id) + " ", 1),
843
- a.value.parent ? (i(), c("span", Qn, "← " + y(a.value.parent), 1)) : N("", !0)
844
- ])) : N("", !0)
845
- ])) : N("", !0)
846
- ])) : (i(), c("div", yn, y($(t)("inventory.changelog.empty")), 1));
847
- };
848
- }
849
- }), no = { class: "flex flex-col gap-8" }, oo = { class: "flex flex-wrap items-center gap-16" }, ao = { class: "fm-typo-en-heading-lg-600" }, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lo = { class: "flex h-full min-h-0 flex-col gap-12 p-16" }, ro = { class: "flex flex-wrap items-center gap-12" }, io = { class: "flex shrink-0 items-center gap-8" }, uo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, co = { class: "flex flex-wrap items-center gap-12" }, fo = {
850
- key: 0,
851
- class: "fm-typo-en-body-md-600"
852
- }, mo = { class: "fm-typo-en-heading-md-600" }, po = {
853
- key: 0,
854
- class: "flex justify-center py-8"
855
- }, Ce = "inventory.changelog.label.", vo = /* @__PURE__ */ ce({
856
- __name: "ChangelogDialog",
857
- props: {
858
- modelValue: { type: Boolean }
859
- },
860
- emits: ["update:modelValue"],
861
- setup(o, { emit: e }) {
862
- const t = o, l = e, a = R({
863
- get: () => t.modelValue,
864
- set: (n) => l("update:modelValue", n)
865
- }), { t: s } = he(), r = ve(), u = He(), v = Ee(), p = _e(), { breakpoints: I } = It(), E = R(() => I.value.xs || I.value.sm), P = R(() => E.value ? "98vw" : "72vw"), { commits: F, isLoading: Q, hasMore: O, load: C, loadMore: H } = an();
866
- function L() {
867
- H().catch((n) => console.error("changelog load more failed", n));
868
- }
869
- function _(n) {
870
- return n ? new Date(n).toLocaleString() : "—";
871
- }
872
- function w(n) {
873
- return [...n].sort((d, S) => (S.lastUpdate ?? "").localeCompare(d.lastUpdate ?? ""));
874
- }
875
- function B(n, d, S) {
876
- C(n, d, S).catch((G) => console.error("changelog load failed", G));
877
- }
878
- const K = k([]);
879
- async function f() {
880
- var d;
881
- const n = (d = r.currentBusiness.value) == null ? void 0 : d._id;
882
- if (n)
883
- try {
884
- K.value = await p.listDomains(n);
885
- } catch (S) {
886
- console.error("changelog domain list load failed", S), K.value = [];
887
- }
888
- }
889
- const b = R(() => [
890
- { label: s("inventory.changelog.label.purchaseOrder"), value: "purchaseOrder" },
891
- { label: s("inventory.changelog.label.closingDraft"), value: "closingDraft" },
892
- { label: s("inventory.changelog.domainInventory"), value: "inventory" },
893
- ...K.value.map((n) => ({ label: s(n.labelKey), value: n.domain }))
894
- ]), M = k(b.value[0]), A = R(() => {
895
- var n;
896
- return ((n = M.value) == null ? void 0 : n.value) ?? "purchaseOrder";
897
- }), X = R(
898
- () => K.value.some((n) => n.domain === A.value)
899
- ), J = k(!1), D = R(
900
- () => ["sku", "recipe", "unit"].map((n) => ({
901
- label: s(Ce + n),
902
- value: n
903
- }))
904
- ), g = k(D.value[0]), m = R(() => {
905
- var n;
906
- return ((n = g.value) == null ? void 0 : n.value) ?? "sku";
907
- }), T = k(""), x = k(null), U = k(!1), W = R(() => {
908
- var S;
909
- const n = (S = r.currentBusiness.value) == null ? void 0 : S._id, d = u.inventory._id;
910
- return n && d ? `business_${n}/${d}` : "";
911
- }), ee = R(() => {
912
- const n = /* @__PURE__ */ new Map(), d = u.inventory;
913
- for (const S of [d.sku, d.recipe, d.unit, d.skuGroup])
914
- for (const G of S ?? [])
915
- G._id && G.name && n.set(G._id, G.name);
916
- for (const S of d.unit ?? [])
917
- for (const G of S.measurements ?? []) {
918
- if (!G.id) continue;
919
- const q = G.abbrev || G.name;
920
- if (!q) continue;
921
- const ne = Nt.toDouble(G.conversion);
922
- n.set(G.id, ne ? `${q} (1 ${q} = ${ne} ${S.abbrev})` : q);
923
- }
924
- return n;
925
- }), te = (n) => ee.value.get(n), re = k([]), de = k(!1);
926
- async function Pe() {
927
- var d;
928
- const n = (d = r.currentBusiness.value) == null ? void 0 : d._id;
929
- if (n) {
930
- de.value = !0;
931
- try {
932
- re.value = w(
933
- await p.listInventory(n, m.value)
934
- );
935
- } catch (S) {
936
- console.error("changelog inventory list load failed", S), re.value = [];
937
- } finally {
938
- de.value = !1;
939
- }
940
- }
941
- }
942
- const tt = R(
943
- () => U.value ? re.value : re.value.filter((n) => !n.deleted)
944
- ), nt = R(() => [
945
- { accessorKey: "id", header: () => s("inventory.closing.draft.table.id"), size: 320 },
946
- {
947
- id: "name",
948
- header: () => s("inventory.common.name"),
949
- accessorFn: (n) => n.name,
950
- // Deleted records sit in the same list as live ones, so the row says which
951
- // it is; nothing else distinguishes them.
952
- cell: ({ row: n }) => n.original.deleted ? vt(
953
- "span",
954
- { "data-deleted": "" },
955
- `${n.original.name} (${s("inventory.changelog.deleted")})`
956
- ) : n.original.name
957
- },
958
- {
959
- id: "lastUpdate",
960
- header: () => s("inventory.changelog.column.lastUpdate"),
961
- size: 200,
962
- // Raw ISO is the sort key — clicking the header on formatted dates would
963
- // order them lexicographically by locale string. Formatted only to display.
964
- accessorFn: (n) => n.lastUpdate ?? "",
965
- cell: ({ getValue: n }) => _(n() || void 0)
966
- }
967
- ]), { commits: ot, load: at } = ln();
968
- function st(n) {
969
- x.value = n, J.value = !0, B(W.value, Xe, Re), n.id && at(`${W.value}/${m.value}/${n.id}`).catch(
970
- (d) => console.error("changelog per-entity load failed", d)
971
- );
972
- }
973
- function lt(n, d) {
974
- const S = qe(n.message);
975
- return S && S.labelKey === Ce + m.value && S.name === d.name ? !0 : (n.changes ?? []).some((G) => {
976
- const q = cn(G.path);
977
- return q.type === Ce + m.value && q.name === d.name;
978
- });
979
- }
980
- const rt = R(() => {
981
- const n = x.value;
982
- if (!n) return [];
983
- const d = F.value.filter((S) => lt(S, n));
984
- return sn(d, ot.value);
985
- }), be = k([]), xe = k(!1), we = k(null);
986
- async function it() {
987
- var d;
988
- const n = (d = r.currentBusiness.value) == null ? void 0 : d._id;
989
- if (n) {
990
- xe.value = !0;
991
- try {
992
- be.value = w(
993
- await p.listDomainRecords(n, A.value)
994
- );
995
- } catch (S) {
996
- console.error("changelog domain records load failed", S), be.value = [];
997
- } finally {
998
- xe.value = !1;
999
- }
1000
- }
1001
- }
1002
- function ut(n) {
1003
- var S;
1004
- const d = (S = r.currentBusiness.value) == null ? void 0 : S._id;
1005
- d && (we.value = n, J.value = !0, B(`business_${d}/${n.id}`, void 0, Le));
1006
- }
1007
- const ge = k(Vt()), ye = k([]), ke = k(!1), fe = k(null), Te = R(() => {
1008
- const n = v._currentLocation;
1009
- return n ? `${n.name} (${n.doc.profile.code ?? "--"})` : "";
1010
- }), Be = R(() => [
1011
- { accessorKey: "id", header: () => s("inventory.closing.draft.table.id"), size: 320 },
1012
- {
1013
- accessorKey: "name",
1014
- header: () => A.value === "purchaseOrder" ? s("inventory.changelog.column.seq") : s("inventory.common.name"),
1015
- size: 240
1016
- },
1017
- {
1018
- id: "lastUpdate",
1019
- header: () => s("inventory.changelog.column.lastUpdate"),
1020
- size: 200,
1021
- // Raw ISO is the sort key; see the note on the inventory table.
1022
- accessorFn: (n) => n.lastUpdate ?? "",
1023
- cell: ({ getValue: n }) => _(n() || void 0)
1024
- }
1025
- ]);
1026
- async function Ue() {
1027
- var G;
1028
- const n = (G = v._currentLocation) == null ? void 0 : G.dbName;
1029
- if (!n) return;
1030
- const d = Pt(new Date(ge.value.startDate)).toISOString(), S = Tt(new Date(ge.value.endDate)).toISOString();
1031
- ke.value = !0;
1032
- try {
1033
- ye.value = w(
1034
- A.value === "purchaseOrder" ? await p.listPurchaseOrders(n, d, S) : await p.listClosingDrafts(n, d, S)
1035
- );
1036
- } catch (q) {
1037
- console.error("changelog location list load failed", q), ye.value = [];
1038
- } finally {
1039
- ke.value = !1;
1040
- }
1041
- fe.value && !ye.value.find((q) => {
1042
- var ne;
1043
- return q.id === ((ne = fe.value) == null ? void 0 : ne.id);
1044
- }) && (fe.value = null, B(""));
1045
- }
1046
- function ct(n) {
1047
- fe.value = n, J.value = !0, B(`${v.currentLocationDBName}/${n.id}`, void 0, Le);
1048
- }
1049
- const dt = R(() => {
1050
- var n, d, S;
1051
- return A.value === "inventory" ? ((n = x.value) == null ? void 0 : n.name) ?? "" : X.value ? ((d = we.value) == null ? void 0 : d.name) ?? "" : ((S = fe.value) == null ? void 0 : S.name) ?? "";
1052
- });
1053
- function Fe() {
1054
- J.value = !1, A.value === "inventory" ? (x.value = null, U.value = !1, B(""), Pe().catch(
1055
- (n) => console.error("changelog inventory list failed", n)
1056
- )) : X.value ? (we.value = null, B(""), it().catch(
1057
- (n) => console.error("changelog domain records failed", n)
1058
- )) : (fe.value = null, B(""), Ue().catch((n) => console.error("changelog location list failed", n)));
1059
- }
1060
- return Z(a, (n) => {
1061
- n && (f().catch((d) => console.error("changelog domain list failed", d)), Fe());
1062
- }), Z(A, () => {
1063
- a.value && Fe();
1064
- }), Z(ge, () => {
1065
- a.value && A.value !== "inventory" && !X.value && Ue().catch((n) => console.error("changelog location list failed", n));
1066
- }), Z(U, (n) => {
1067
- var d;
1068
- !n && ((d = x.value) != null && d.deleted) && (x.value = null, J.value = !1);
1069
- }), Z(m, () => {
1070
- x.value = null, J.value = !1, a.value && A.value === "inventory" && Pe().catch(
1071
- (n) => console.error("changelog inventory list failed", n)
1072
- );
1073
- }), Z(W, (n) => {
1074
- x.value = null, a.value && A.value === "inventory" && B(n, void 0, Re);
1075
- }), (n, d) => {
1076
- const S = Y("FmButtonGroup"), G = Y("FmSearch"), q = Y("FmSwitch"), ne = Y("FmTable"), Ae = Y("FmDialog"), ft = Y("FmButton");
1077
- return i(), c(j, null, [
1078
- V(Ae, {
1079
- modelValue: a.value,
1080
- "onUpdate:modelValue": d[8] || (d[8] = (z) => a.value = z),
1081
- "close-button": "",
1082
- "dismiss-away": "",
1083
- "min-width": "98vw",
1084
- "max-width": "98vw",
1085
- "max-height": "94vh",
1086
- "content-class": "!p-0 h-[86vh]"
1087
- }, {
1088
- "dialog-header": le(() => [
1089
- h("div", no, [
1090
- h("div", oo, [
1091
- h("div", ao, y($(s)("inventory.changelog.title")), 1),
1092
- V(S, {
1093
- modelValue: M.value,
1094
- "onUpdate:modelValue": d[0] || (d[0] = (z) => M.value = z),
1095
- items: b.value
1096
- }, null, 8, ["modelValue", "items"])
1097
- ]),
1098
- h("div", so, y($(s)("inventory.changelog.scopeDescription")), 1)
1099
- ])
1100
- ]),
1101
- default: le(() => [
1102
- h("div", lo, [
1103
- A.value === "inventory" ? (i(), c(j, { key: 0 }, [
1104
- h("div", ro, [
1105
- V(S, {
1106
- modelValue: g.value,
1107
- "onUpdate:modelValue": d[1] || (d[1] = (z) => g.value = z),
1108
- items: D.value
1109
- }, null, 8, ["modelValue", "items"]),
1110
- V(G, {
1111
- modelValue: T.value,
1112
- "onUpdate:modelValue": d[2] || (d[2] = (z) => T.value = z),
1113
- class: "flex-1",
1114
- placeholder: $(s)("inventory.changelog.searchInventory")
1115
- }, null, 8, ["modelValue", "placeholder"]),
1116
- h("div", io, [
1117
- h("span", uo, y($(s)("inventory.changelog.includeDeleted")), 1),
1118
- V(q, {
1119
- modelValue: U.value,
1120
- "onUpdate:modelValue": d[3] || (d[3] = (z) => U.value = z)
1121
- }, null, 8, ["modelValue"])
1122
- ])
1123
- ]),
1124
- V(ne, {
1125
- class: "min-h-0 flex-1",
1126
- "row-data": tt.value,
1127
- "column-defs": nt.value,
1128
- "search-value": T.value,
1129
- loading: de.value,
1130
- "page-size": 20,
1131
- onRowClick: d[4] || (d[4] = (z) => st(z.original))
1132
- }, null, 8, ["row-data", "column-defs", "search-value", "loading"])
1133
- ], 64)) : X.value ? (i(), pe(ne, {
1134
- key: 1,
1135
- class: "min-h-0 flex-1",
1136
- "row-data": be.value,
1137
- "column-defs": Be.value,
1138
- loading: xe.value,
1139
- "page-size": 20,
1140
- onRowClick: d[5] || (d[5] = (z) => ut(z.original))
1141
- }, null, 8, ["row-data", "column-defs", "loading"])) : (i(), c(j, { key: 2 }, [
1142
- h("div", co, [
1143
- V(Et, {
1144
- modelValue: ge.value,
1145
- "onUpdate:modelValue": d[6] || (d[6] = (z) => ge.value = z)
1146
- }, null, 8, ["modelValue"]),
1147
- Te.value ? (i(), c("span", fo, y(Te.value), 1)) : N("", !0)
1148
- ]),
1149
- V(ne, {
1150
- class: "min-h-0 flex-1",
1151
- "row-data": ye.value,
1152
- "column-defs": Be.value,
1153
- loading: ke.value,
1154
- "page-size": 20,
1155
- onRowClick: d[7] || (d[7] = (z) => ct(z.original))
1156
- }, null, 8, ["row-data", "column-defs", "loading"])
1157
- ], 64))
1158
- ])
1159
- ]),
1160
- _: 1
1161
- }, 8, ["modelValue"]),
1162
- V(Ae, {
1163
- modelValue: J.value,
1164
- "onUpdate:modelValue": d[9] || (d[9] = (z) => J.value = z),
1165
- "close-button": "",
1166
- "dismiss-away": "",
1167
- "min-width": P.value,
1168
- "max-width": P.value,
1169
- "max-height": "86vh"
1170
- }, {
1171
- "dialog-header": le(() => [
1172
- h("div", mo, y(dt.value), 1)
1173
- ]),
1174
- default: le(() => [
1175
- V(to, {
1176
- commits: A.value === "inventory" ? rt.value : $(F),
1177
- "is-loading": $(Q),
1178
- "resolve-name": te
1179
- }, null, 8, ["commits", "is-loading"]),
1180
- A.value !== "inventory" && $(O) ? (i(), c("div", po, [
1181
- V(ft, {
1182
- label: $(s)("inventory.changelog.loadMore"),
1183
- variant: "secondary",
1184
- disabled: $(Q),
1185
- onClick: L
1186
- }, null, 8, ["label", "disabled"])
1187
- ])) : N("", !0)
1188
- ]),
1189
- _: 1
1190
- }, 8, ["modelValue", "min-width", "max-width"])
1191
- ], 64);
1192
- };
1193
- }
1194
- }), go = /* @__PURE__ */ Bt(vo, [["__scopeId", "data-v-ae9bd171"]]), se = 8;
1195
- function yo(o, e) {
1196
- return { x: se, y: Math.max(se, e - o - se) };
1197
- }
1198
- const ho = ["title"], je = 48, _o = 8, bo = /* @__PURE__ */ ce({
1199
- __name: "ChangelogFloatingButton",
1200
- setup(o) {
1201
- const { t: e } = he(), t = ve(), l = R(() => {
1202
- var L;
1203
- return !!((L = t.sessionUser.value) != null && L.role.isAdmin);
1204
- }), a = k(!1), s = k(null);
1205
- function r() {
1206
- var L, _;
1207
- return {
1208
- width: ((L = s.value) == null ? void 0 : L.offsetWidth) ?? je,
1209
- height: ((_ = s.value) == null ? void 0 : _.offsetHeight) ?? je
1210
- };
1211
- }
1212
- const u = k({ x: 0, y: 0 });
1213
- function v(L, _, w) {
1214
- return Math.min(Math.max(L, _), w);
1215
- }
1216
- function p() {
1217
- const { width: L, height: _ } = r(), w = Math.max(se, window.innerWidth - L - se - _o), B = Math.max(se, window.innerHeight - _ - se), K = u.value.x + L / 2;
1218
- u.value = {
1219
- x: K < window.innerWidth / 2 ? se : w,
1220
- y: v(u.value.y, se, B)
1221
- };
1222
- }
1223
- function I() {
1224
- u.value = yo(r().height, window.innerHeight);
1225
- }
1226
- Ve(() => {
1227
- I(), window.addEventListener("resize", p), window.addEventListener("orientationchange", p);
1228
- }), gt(() => {
1229
- window.removeEventListener("resize", p), window.removeEventListener("orientationchange", p);
1230
- }), Z(l, async (L) => {
1231
- L && (await yt(), I());
1232
- });
1233
- const E = k(!1);
1234
- let P = null, F = !1;
1235
- function Q(L) {
1236
- P = { x: L.clientX, y: L.clientY, px: u.value.x, py: u.value.y }, E.value = !0, F = !1, L.currentTarget.setPointerCapture(L.pointerId);
1237
- }
1238
- function O(L) {
1239
- if (!P) return;
1240
- const _ = L.clientX - P.x, w = L.clientY - P.y;
1241
- Math.abs(_) + Math.abs(w) > 3 && (F = !0);
1242
- const { width: B, height: K } = r();
1243
- u.value = {
1244
- x: v(P.px + _, 0, window.innerWidth - B),
1245
- y: v(P.py + w, 0, window.innerHeight - K)
1246
- };
1247
- }
1248
- function C() {
1249
- P = null, E.value = !1, p();
1250
- }
1251
- function H() {
1252
- P && (C(), F || (a.value = !0));
1253
- }
1254
- return (L, _) => {
1255
- const w = Y("FmIcon");
1256
- return i(), pe(ht, { to: "body" }, [
1257
- l.value ? (i(), c(j, { key: 0 }, [
1258
- h("div", {
1259
- ref_key: "wrapperRef",
1260
- ref: s,
1261
- class: ae(["fixed z-50 cursor-grab touch-none", E.value ? "" : "transition-[left,top] duration-200 ease-out"]),
1262
- style: _t({ left: `${u.value.x}px`, top: `${u.value.y}px` })
1263
- }, [
1264
- V(We, null, {
1265
- default: le(() => [
1266
- h("button", {
1267
- type: "button",
1268
- title: $(e)("inventory.changelog.title"),
1269
- class: ae(["fm-typo-en-body-sm-600 flex h-48 items-center gap-8 whitespace-nowrap rounded-full border border-gray-200 bg-white px-16 shadow-lg hover:bg-gray-50", E.value ? "cursor-grabbing" : "cursor-grab"]),
1270
- onPointerdown: Q,
1271
- onPointermove: O,
1272
- onPointerup: H,
1273
- onPointercancel: C
1274
- }, [
1275
- V(w, {
1276
- name: "history",
1277
- size: "md",
1278
- outline: ""
1279
- }),
1280
- h("span", null, y($(e)("inventory.changelog.fabLabel")), 1)
1281
- ], 42, ho)
1282
- ]),
1283
- _: 1
1284
- })
1285
- ], 6),
1286
- V(go, {
1287
- modelValue: a.value,
1288
- "onUpdate:modelValue": _[0] || (_[0] = (B) => a.value = B)
1289
- }, null, 8, ["modelValue"])
1290
- ], 64)) : N("", !0)
1291
- ]);
1292
- };
1293
- }
1294
- }), xo = { class: "flex items-center gap-8" }, wo = { class: "flex flex-col gap-12 text-fm-color-typo-secondary" }, ko = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, So = { class: "fm-typo-en-body-sm-400" }, $o = {
1295
- key: 0,
1296
- class: "fm-typo-en-body-sm-400"
1297
- }, Co = {
1298
- key: 0,
1299
- href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices",
1300
- target: "_blank",
1301
- rel: "noopener"
1302
- }, Lo = /* @__PURE__ */ ce({
1303
- __name: "PlanUpgradeDialog",
1304
- props: /* @__PURE__ */ bt({
1305
- capability: {},
1306
- result: {}
1307
- }, {
1308
- modelValue: { type: Boolean, required: !0 },
1309
- modelModifiers: {}
1310
- }),
1311
- emits: ["update:modelValue"],
1312
- setup(o) {
1313
- const e = o, t = xt(o, "modelValue"), l = R(() => {
1314
- var r;
1315
- return ((r = e.capability) == null ? void 0 : r.tier) ?? "premium";
1316
- }), a = R(() => {
1317
- var r;
1318
- return ((r = e.result) == null ? void 0 : r.stage) === "off";
1319
- }), s = R(() => a.value ? "Feature unavailable" : `Upgrade to ${l.value} plan`);
1320
- return (r, u) => {
1321
- const v = Y("FmSpacer"), p = Y("FmButton"), I = Y("FmDialog");
1322
- return i(), pe(I, {
1323
- modelValue: t.value,
1324
- "onUpdate:modelValue": u[1] || (u[1] = (E) => t.value = E),
1325
- overlay: !0,
1326
- "close-button": "",
1327
- dismissAway: "",
1328
- "max-width": "520px"
1329
- }, {
1330
- "dialog-header": le(() => [
1331
- h("div", xo, [
1332
- h("span", null, y(s.value), 1),
1333
- V(Ft, { tier: l.value }, null, 8, ["tier"])
1334
- ])
1335
- ]),
1336
- "dialog-footer": le(() => [
1337
- V(v, { class: "sm:hidden xs:hidden" }),
1338
- V(p, {
1339
- variant: "tertiary",
1340
- label: "Not now",
1341
- onClick: u[0] || (u[0] = (E) => t.value = !1)
1342
- }),
1343
- a.value ? N("", !0) : (i(), c("a", Co, [
1344
- V(p, { label: "Compare plans" })
1345
- ]))
1346
- ]),
1347
- default: le(() => {
1348
- var E, P, F;
1349
- return [
1350
- h("div", wo, [
1351
- h("p", ko, [
1352
- a.value ? (i(), c(j, { key: 0 }, [
1353
- ie(y((E = r.result) == null ? void 0 : E.reason), 1)
1354
- ], 64)) : (i(), c(j, { key: 1 }, [
1355
- ie(y((P = r.capability) == null ? void 0 : P.module) + " is available on the " + y(l.value) + " plan. ", 1)
1356
- ], 64))
1357
- ]),
1358
- h("p", So, y((F = r.capability) == null ? void 0 : F.description), 1),
1359
- a.value ? N("", !0) : (i(), c("p", $o, " Upgrade your plan to unlock this functionality for your business. "))
1360
- ])
1361
- ];
1362
- }),
1363
- _: 1
1364
- }, 8, ["modelValue"]);
1365
- };
1366
- }
1367
- });
1368
- function Ro() {
1369
- const o = Je(), e = ve(), t = Ee();
1370
- return R(() => {
1371
- var l, a;
1372
- return {
1373
- planTier: o.planTier,
1374
- businessId: (l = e.currentBusiness.value) == null ? void 0 : l._id,
1375
- locationId: (a = t._currentLocation) == null ? void 0 : a.doc._id
1376
- };
1377
- });
1378
- }
1379
- const Do = { class: "h-full flex flex-col overflow-auto py-16 gap-2" }, Io = /* @__PURE__ */ ce({
1380
- __name: "NavigationTab",
1381
- setup(o) {
1382
- const e = Ct(), t = Ne(), l = ve(), a = Ro(), s = Ut(), r = k(!1), u = k(null), v = k(null), p = k(!1), I = k(null), E = k(null), P = R(
1383
- () => {
1384
- var _, w;
1385
- return (w = Oe(((_ = I.value) == null ? void 0 : _.featureKey) ?? "")) == null ? void 0 : w.label;
1386
- }
1387
- ), { menuItems: F } = Ye();
1388
- Z([() => l.currentBusiness.value, () => e.name], ([_, w]) => {
1389
- (_ == null ? void 0 : _.menuVersion) === "v3" && (w === ue.INGREDIENTS || w === ue.RECIPE || w === ue.UNIT) && t.push({ name: ue.STOCK });
1390
- });
1391
- const Q = R({
1392
- get() {
1393
- if (e.name)
1394
- return String(e.name);
1395
- },
1396
- set(_) {
1397
- var f;
1398
- if (!_) return;
1399
- const w = String(_), B = Rt.find((b) => b.route === w), K = Dt(w, a.value);
1400
- if ((f = Oe((B == null ? void 0 : B.featureKey) ?? "")) != null && f.deprecateSoon) {
1401
- I.value = B ?? null, E.value = w, p.value = !0;
1402
- return;
1403
- }
1404
- if (B && K.disabled) {
1405
- u.value = B, v.value = K, r.value = !0;
1406
- return;
1407
- }
1408
- t.push({ name: w });
1409
- }
1410
- });
1411
- function O() {
1412
- E.value && (t.push({ name: E.value }), E.value = null);
1413
- }
1414
- const C = R(
1415
- () => {
1416
- var _;
1417
- return `NavigationTab.${(_ = l.currentBusiness.value) == null ? void 0 : _._id}`;
1418
- }
1419
- ), H = k(!1), L = R({
1420
- get() {
1421
- return H.value;
1422
- },
1423
- set(_) {
1424
- H.value = _, _ || s.setItem(C.value, "true");
1425
- }
1426
- });
1427
- return Z([() => C.value], () => {
1428
- H.value = !1, setTimeout(() => {
1429
- L.value = !s.getItem(C.value);
1430
- }, 2e3);
1431
- }), (_, w) => {
1432
- const B = Y("FmCollapsibleTabs");
1433
- return i(), c("div", Do, [
1434
- V(B, {
1435
- modelValue: Q.value,
1436
- "onUpdate:modelValue": w[0] || (w[0] = (K) => Q.value = K),
1437
- items: $(F)
1438
- }, null, 8, ["modelValue", "items"]),
1439
- V(Lo, {
1440
- modelValue: r.value,
1441
- "onUpdate:modelValue": w[1] || (w[1] = (K) => r.value = K),
1442
- capability: u.value,
1443
- result: v.value
1444
- }, null, 8, ["modelValue", "capability", "result"]),
1445
- V(At, {
1446
- modelValue: p.value,
1447
- "onUpdate:modelValue": w[2] || (w[2] = (K) => p.value = K),
1448
- "feature-name": P.value,
1449
- onProceed: O
1450
- }, null, 8, ["modelValue", "feature-name"])
1451
- ]);
1452
- };
1453
- }
1454
- });
1455
- typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
1456
- let o, e;
1457
- return { promise: new Promise((l, a) => {
1458
- o = l, e = a;
1459
- }), resolve: o, reject: e };
1460
- });
1461
- typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(o) {
1462
- return await new Promise((e) => setTimeout(e, o)), Promise.resolve(this);
1463
- });
1464
- const Vo = {
1465
- key: 0,
1466
- class: "flex h-5 items-center justify-center bg-amber-100 px-12 text-xs font-medium text-amber-800 shadow-sm"
1467
- }, qo = /* @__PURE__ */ ce({
1468
- __name: "App",
1469
- setup(o) {
1470
- const e = ve(), t = Mt(), l = $t(), a = window.location.href.includes("print-preview");
1471
- Ve(() => {
1472
- if (window.location.href.includes("print-preview")) {
1473
- e.setEmbedded(!0), document.body.classList.add("print-mode");
1474
- return;
1475
- }
1476
- e.registerSidebarComponent(Io), t.initGoogleMap(l.appApi.googleMap).catch(() => {
1477
- console.error("Google map cannot be loaded");
1478
- });
1479
- }), Z([() => e.currentCountry.value], () => {
1480
- s();
1481
- });
1482
- async function s() {
1483
- var r;
1484
- try {
1485
- await e.readBusinesses(), e.currentBusiness.value = (r = e.businesses.value) == null ? void 0 : r.find((u) => u);
1486
- } catch (u) {
1487
- console.error("error when trying to reset businesses:", u);
1488
- }
1489
- }
1490
- return (r, u) => (i(), c(j, null, [
1491
- $(l).isDev && !$(a) ? (i(), c("div", Vo, " Non-production environment ")) : N("", !0),
1492
- V(nn),
1493
- $(a) ? N("", !0) : (i(), pe(bo, { key: 1 }))
1494
- ], 64));
1495
- }
1496
- });
1497
- export {
1498
- qo as default
1499
- };