@feedmepos/mf-inventory-portal 0.0.5

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 (284) hide show
  1. package/README.md +31 -0
  2. package/dist/App.vue.d.ts +2 -0
  3. package/dist/ApprovalView-CTQdDgGH.js +119 -0
  4. package/dist/BindingsDialog-DvX_DRsO.js +82 -0
  5. package/dist/BindingsPicker-CQIGhTCR.js +124 -0
  6. package/dist/BindingsTable-Da4BLkvc.js +122 -0
  7. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DcixBOcX.js +97 -0
  8. package/dist/Entry.vue.d.ts +2 -0
  9. package/dist/FmMultiselectDialog.vue_vue_type_script_setup_true_lang-BXU7x6di.js +144 -0
  10. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-CD89qCIa.js +49 -0
  11. package/dist/IngredientsView-2ZKdzsgI.js +739 -0
  12. package/dist/IntegrationView-BRWYO3VE.js +1172 -0
  13. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CnsDmPTe.js +240 -0
  14. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DBK7mpQS.js +66 -0
  15. package/dist/PurchaseOrderPrintPreview-CH9gVYDg.js +152 -0
  16. package/dist/ReceiveRequestView-DQBqc3GF.js +1298 -0
  17. package/dist/RecipeView-DFG9Wkx-.js +594 -0
  18. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js +53 -0
  19. package/dist/Standalone.vue.d.ts +2 -0
  20. package/dist/StockView-DLWMp_I5.js +1733 -0
  21. package/dist/SupplierView-CZhM2ie3.js +607 -0
  22. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Ffe9bhq8.js +1027 -0
  23. package/dist/UnitView-C3XVSbJY.js +626 -0
  24. package/dist/WarehouseView-BntzAdz3.js +1139 -0
  25. package/dist/api/bill.d.ts +1364 -0
  26. package/dist/api/closing.d.ts +3 -0
  27. package/dist/api/error.d.ts +31 -0
  28. package/dist/api/food-market-hub.d.ts +38 -0
  29. package/dist/api/inventory.d.ts +176 -0
  30. package/dist/api/purchase-order.d.ts +13 -0
  31. package/dist/api/stock.d.ts +9 -0
  32. package/dist/api/supplier.d.ts +7 -0
  33. package/dist/api/type.d.ts +12 -0
  34. package/dist/api/warehouse.d.ts +7 -0
  35. package/dist/app-BzDhmCVx.js +36639 -0
  36. package/dist/app.d.ts +2 -0
  37. package/dist/app.js +5 -0
  38. package/dist/components/ChangeLocationComponent.vue.d.ts +2 -0
  39. package/dist/components/DeferableLoading.vue.d.ts +19 -0
  40. package/dist/components/DeferableLoadingProps.d.ts +4 -0
  41. package/dist/components/DeleteDialog.vue.d.ts +18 -0
  42. package/dist/components/FmCoordinateInput.vue.d.ts +24 -0
  43. package/dist/components/FmCoordinateInputProps.d.ts +23 -0
  44. package/dist/components/FmFilterableSelect.vue.d.ts +25 -0
  45. package/dist/components/FmFilterableSelectProps.d.ts +28 -0
  46. package/dist/components/FmMultiselectDialog.vue.d.ts +30 -0
  47. package/dist/components/FmMultiselectDialogProps.d.ts +16 -0
  48. package/dist/components/FmTableToolbar.vue.d.ts +49 -0
  49. package/dist/components/MultiSelectDialog.vue.d.ts +12 -0
  50. package/dist/components/MultiSelectDialogProps.d.ts +7 -0
  51. package/dist/components/NavigationTab.vue.d.ts +2 -0
  52. package/dist/components/NumberPrecisionInput.vue.d.ts +16 -0
  53. package/dist/components/NumberPrecisionInputProps.d.ts +12 -0
  54. package/dist/components/TableActionableRow.vue.d.ts +40 -0
  55. package/dist/components/UnitDisplayControl.vue.d.ts +12 -0
  56. package/dist/components/UnitDisplayControlProp.d.ts +7 -0
  57. package/dist/components/fm-components.type.d.ts +8 -0
  58. package/dist/components/form/form-mode.enum.d.ts +5 -0
  59. package/dist/components/icons/IconCommunity.vue.d.ts +2 -0
  60. package/dist/components/icons/IconDocumentation.vue.d.ts +2 -0
  61. package/dist/components/icons/IconEcosystem.vue.d.ts +2 -0
  62. package/dist/components/icons/IconSupport.vue.d.ts +2 -0
  63. package/dist/components/icons/IconTooling.vue.d.ts +2 -0
  64. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +145 -0
  65. package/dist/components/inventory-binding/InventoryBindingProps.d.ts +11 -0
  66. package/dist/components/map/CoordinateDialog.vue.d.ts +24 -0
  67. package/dist/components/map/GoogleMap.vue.d.ts +79 -0
  68. package/dist/components/map/coordinates.d.ts +6 -0
  69. package/dist/components/map/helper/coords-to-latlong.d.ts +8 -0
  70. package/dist/components/map/type.d.ts +27 -0
  71. package/dist/components/nested-multiselect/FmNestedMultiselectDialog.vue.d.ts +7 -0
  72. package/dist/components/nested-multiselect/FmNestedMultiselectDialogProps.d.ts +22 -0
  73. package/dist/components/nested-multiselect/helper/multiselect-utils.d.ts +2 -0
  74. package/dist/components/row-action.enum.d.ts +13 -0
  75. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +84 -0
  76. package/dist/components/shell/inventory/binding-ui.test.d.ts +1 -0
  77. package/dist/components/shell/inventory/binding-ui.vue.d.ts +110 -0
  78. package/dist/components/shell/inventory/utils.d.ts +5 -0
  79. package/dist/components/ui-library/FmDateRangePickerChip.vue.d.ts +36 -0
  80. package/dist/components/ui-library/FmSpecialChip.vue.d.ts +79 -0
  81. package/dist/composable/defineApi.d.ts +18 -0
  82. package/dist/composable/useBreakpoints.d.ts +7 -0
  83. package/dist/composable/useIframe.d.ts +37 -0
  84. package/dist/composable/useSearch.d.ts +5 -0
  85. package/dist/composable/useTabStorage.d.ts +2 -0
  86. package/dist/composable/useToast.d.ts +36 -0
  87. package/dist/core.d.ts +12 -0
  88. package/dist/cypress/component/FmFilterableSelect.cy.d.ts +1 -0
  89. package/dist/cypress/component/FmNestedMultiselectDialog.cy.d.ts +1 -0
  90. package/dist/cypress/component/UnitDisplayControl.cy.d.ts +1 -0
  91. package/dist/cypress/component/receive-request/KDI-15-total-price-currency.cy.d.ts +2 -0
  92. package/dist/cypress/e2e/views/MenuV3.spec.cy.d.ts +0 -0
  93. package/dist/cypress/e2e/views/MenuV4.spec.cy.d.ts +0 -0
  94. package/dist/cypress/e2e/views/Root.spec.cy.d.ts +0 -0
  95. package/dist/cypress/e2e/views/StockView.spec.cy.d.ts +0 -0
  96. package/dist/cypress/support/commands.d.ts +0 -0
  97. package/dist/cypress/support/component.d.ts +10 -0
  98. package/dist/cypress/support/e2e.d.ts +1 -0
  99. package/dist/date2-C7HiAWQG.js +209 -0
  100. package/dist/dayjs.min-Db57WhI9.js +282 -0
  101. package/dist/decimal-D3a0BwVj.js +98 -0
  102. package/dist/empty-placeholder-wf6-BWE8.js +4 -0
  103. package/dist/extensions/array.d.ts +15 -0
  104. package/dist/favicon.ico +0 -0
  105. package/dist/fuzzy-BW8ZYsDG.js +41 -0
  106. package/dist/helper/address.d.ts +2 -0
  107. package/dist/helper/component.d.ts +4 -0
  108. package/dist/helper/core/country/codes.d.ts +255 -0
  109. package/dist/helper/core/country/utils.d.ts +8 -0
  110. package/dist/helper/core/id-to-date.d.ts +1 -0
  111. package/dist/helper/core/store/type.d.ts +2 -0
  112. package/dist/helper/country.d.ts +260 -0
  113. package/dist/helper/date.spec.d.ts +1 -0
  114. package/dist/helper/date2.d.ts +20 -0
  115. package/dist/helper/decimal.d.ts +15 -0
  116. package/dist/helper/decimal.spec.d.ts +1 -0
  117. package/dist/helper/export.d.ts +12 -0
  118. package/dist/helper/form.d.ts +5 -0
  119. package/dist/helper/inventory.d.ts +1 -0
  120. package/dist/helper/iteration.d.ts +15 -0
  121. package/dist/helper/number.d.ts +27 -0
  122. package/dist/helper/number.spec.d.ts +1 -0
  123. package/dist/helper/object.d.ts +36 -0
  124. package/dist/helper/object.spec.d.ts +1 -0
  125. package/dist/helper/rules.d.ts +22 -0
  126. package/dist/helper/search.d.ts +21 -0
  127. package/dist/helper/semver.d.ts +20 -0
  128. package/dist/helper/semver.spec.d.ts +1 -0
  129. package/dist/helper/type.d.ts +8 -0
  130. package/dist/helper/url.d.ts +7 -0
  131. package/dist/helper/validate.d.ts +70 -0
  132. package/dist/helper/xlsx.util.d.ts +8 -0
  133. package/dist/helper/zod.d.ts +21 -0
  134. package/dist/id-to-date-ReZIpUDw.js +30 -0
  135. package/dist/index-D46it8Rk.js +12956 -0
  136. package/dist/init-date-range-M3Q03-Fd.js +21 -0
  137. package/dist/is-linked-ingredient-error-C6AghEwR.js +37 -0
  138. package/dist/layout/InventoryLayout.vue.d.ts +2 -0
  139. package/dist/layout/SingleColumnLayout.vue.d.ts +55 -0
  140. package/dist/layout/components/NavigationButton.vue.d.ts +22 -0
  141. package/dist/layout/layout-routes.d.ts +7 -0
  142. package/dist/layout/type.d.ts +17 -0
  143. package/dist/layout-BvUjg6JS.js +151 -0
  144. package/dist/locales/en/common.json +7 -0
  145. package/dist/main.d.ts +2 -0
  146. package/dist/router/index.d.ts +5 -0
  147. package/dist/router/name.d.ts +17 -0
  148. package/dist/router/shared.d.ts +11 -0
  149. package/dist/row-action.enum-BwQbURNh.js +28 -0
  150. package/dist/rules-DHfAMDW3.js +86 -0
  151. package/dist/stores/api.d.ts +10 -0
  152. package/dist/stores/env.d.ts +5 -0
  153. package/dist/stores/feature.d.ts +9 -0
  154. package/dist/stores/googlemap.d.ts +37 -0
  155. package/dist/stores/helper/generate-backend-urls.d.ts +8 -0
  156. package/dist/stores/inventory.d.ts +1983 -0
  157. package/dist/stores/layout.d.ts +5 -0
  158. package/dist/stores/location.d.ts +1898 -0
  159. package/dist/stores/route.d.ts +12 -0
  160. package/dist/stores/stock.d.ts +58 -0
  161. package/dist/stores/supplier.d.ts +30 -0
  162. package/dist/stores/warehouse.d.ts +88 -0
  163. package/dist/style.css +1 -0
  164. package/dist/supplier-DTiiOLtg.js +65 -0
  165. package/dist/tsconfig.app.tsbuildinfo +1 -0
  166. package/dist/use-inventory-binding-dialog-B6JO7050.js +109 -0
  167. package/dist/views/InventoryView.vue.d.ts +2 -0
  168. package/dist/views/SelectBussinessDialog.vue.d.ts +2 -0
  169. package/dist/views/approval/ApprovalView.vue.d.ts +2 -0
  170. package/dist/views/dev/ComponentPreview.vue.d.ts +2 -0
  171. package/dist/views/dev/components/CoordinateTest.vue.d.ts +2 -0
  172. package/dist/views/dev/components/DateRange.vue.d.ts +2 -0
  173. package/dist/views/dev/components/FmSelectTest.vue.d.ts +2 -0
  174. package/dist/views/dev/components/InventoryIframe.vue.d.ts +2 -0
  175. package/dist/views/dev/components/LayoutDev.vue.d.ts +2 -0
  176. package/dist/views/dev/components/MfCommontTest.vue.d.ts +2 -0
  177. package/dist/views/dev/components/NestedSelection.vue.d.ts +2 -0
  178. package/dist/views/dev/components/NumberStepper.vue.d.ts +2 -0
  179. package/dist/views/dev/components/TabStorageTest.vue.d.ts +2 -0
  180. package/dist/views/dev/helpers/debug.d.ts +22 -0
  181. package/dist/views/dev/helpers/nested-options.d.ts +60 -0
  182. package/dist/views/dev/helpers/pinia-test.d.ts +9 -0
  183. package/dist/views/home/HomeView.vue.d.ts +2 -0
  184. package/dist/views/iframe/inventory-bindings/bindings-dialog/BindingsDialog.vue.d.ts +2 -0
  185. package/dist/views/iframe/inventory-bindings/bindings-picker/BindingsPicker.vue.d.ts +2 -0
  186. package/dist/views/iframe/inventory-bindings/bindings-table/BindingsTable.vue.d.ts +2 -0
  187. package/dist/views/ingredients/IngredientsView.vue.d.ts +2 -0
  188. package/dist/views/ingredients/components/cannot-delete/CannotDelete.vue.d.ts +30 -0
  189. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +54 -0
  190. package/dist/views/ingredients/components/convert/ConvertFormProps.d.ts +8 -0
  191. package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItem.vue.d.ts +12 -0
  192. package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItemProps.d.ts +5 -0
  193. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialog.vue.d.ts +31 -0
  194. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialogProps.d.ts +9 -0
  195. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +104 -0
  196. package/dist/views/ingredients/components/ingredient-form/IngredientFormProps.d.ts +10 -0
  197. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +88 -0
  198. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +4 -0
  199. package/dist/views/ingredients/components/inventory-binding/util.d.ts +7 -0
  200. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +8 -0
  201. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +46 -0
  202. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +7 -0
  203. package/dist/views/integration/IntegrationView.vue.d.ts +2 -0
  204. package/dist/views/integration/components/ApplyAddon.vue.d.ts +379 -0
  205. package/dist/views/integration/components/ApplyProduct.vue.d.ts +303 -0
  206. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +277 -0
  207. package/dist/views/integration/components/ApplyProductDialogProps.d.ts +17 -0
  208. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +277 -0
  209. package/dist/views/integration/helper/menu.d.ts +36 -0
  210. package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +2 -0
  211. package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistory.vue.d.ts +12 -0
  212. package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistoryProps.d.ts +11 -0
  213. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +18 -0
  214. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +12 -0
  215. package/dist/views/receive-request/components/transfer-dialog/TransferDialog.vue.d.ts +22 -0
  216. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +11 -0
  217. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +450 -0
  218. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +10 -0
  219. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +369 -0
  220. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1202 -0
  221. package/dist/views/receive-request/constants/dialog-templates.d.ts +8 -0
  222. package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +4 -0
  223. package/dist/views/receive-request/constants/purchase-row-actions.d.ts +2 -0
  224. package/dist/views/receive-request/helper/format-time-from-id.d.ts +2 -0
  225. package/dist/views/receive-request/helper/format-unit-display.d.ts +6 -0
  226. package/dist/views/receive-request/helper/get-received-amount.d.ts +2 -0
  227. package/dist/views/receive-request/helper/init-date-range.d.ts +8 -0
  228. package/dist/views/receive-request/helper/print-po.d.ts +2 -0
  229. package/dist/views/receive-request/helper/status-to-background.d.ts +2 -0
  230. package/dist/views/receive-request/print-preview/PurchaseOrderPrintPreview.vue.d.ts +47 -0
  231. package/dist/views/recipe/RecipeView.vue.d.ts +2 -0
  232. package/dist/views/recipe/components/recipe-dialog/RecipeDialog.vue.d.ts +31 -0
  233. package/dist/views/recipe/components/recipe-dialog/RecipeDialogProps.d.ts +9 -0
  234. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +62 -0
  235. package/dist/views/recipe/components/recipe-form/RecipeFormProps.d.ts +10 -0
  236. package/dist/views/recipe/composables/use-recipe-form.d.ts +9 -0
  237. package/dist/views/recipe/composables/use-recipe-table.d.ts +11 -0
  238. package/dist/views/recipe/helper/export-recipe.d.ts +1 -0
  239. package/dist/views/stock/StockView.vue.d.ts +2 -0
  240. package/dist/views/stock/components/StockHistory.vue.d.ts +17 -0
  241. package/dist/views/stock/components/StockHistoryProps.d.ts +7 -0
  242. package/dist/views/stock/components/StockRecordCard.vue.d.ts +712 -0
  243. package/dist/views/stock/components/dialog/AdjustSkuDialog.vue.d.ts +22 -0
  244. package/dist/views/stock/components/dialog/AdjustSkuDialogProps.d.ts +8 -0
  245. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +164 -0
  246. package/dist/views/stock/components/dialog/AdjustedItemFormProps.d.ts +8 -0
  247. package/dist/views/stock/components/dialog/ConvertSkuDialog.vue.d.ts +22 -0
  248. package/dist/views/stock/components/dialog/ConvertSkuDialogProps.d.ts +9 -0
  249. package/dist/views/stock/components/dialog/constant/adjustment-type-options.d.ts +7 -0
  250. package/dist/views/stock/components/dialog/helper/adjust.d.ts +3 -0
  251. package/dist/views/stock/components/dialog/helper/form-adjust.d.ts +10 -0
  252. package/dist/views/stock/composables/use-stock-table.d.ts +12 -0
  253. package/dist/views/stock/helper/compute-summary-total-test.d.ts +1 -0
  254. package/dist/views/stock/helper/compute-summary-total.d.ts +1 -0
  255. package/dist/views/stock/helper/compute-summary-total.spec.d.ts +1 -0
  256. package/dist/views/stock/helper/format-date-from-id.d.ts +2 -0
  257. package/dist/views/stock/helper/on-click-export-excel.d.ts +9 -0
  258. package/dist/views/stock/helper/stock-row-action.d.ts +13 -0
  259. package/dist/views/stock/type.d.ts +9 -0
  260. package/dist/views/supplier/SupplierView.vue.d.ts +2 -0
  261. package/dist/views/supplier/components/SupplierDialog.vue.d.ts +22 -0
  262. package/dist/views/supplier/components/SupplierDialogProps.d.ts +10 -0
  263. package/dist/views/supplier/components/SupplierForm.vue.d.ts +58 -0
  264. package/dist/views/supplier/components/SupplierFormProps.d.ts +8 -0
  265. package/dist/views/supplier/composables/use-supplier-table.d.ts +22 -0
  266. package/dist/views/unit/UnitView.vue.d.ts +2 -0
  267. package/dist/views/unit/components/unit-dialog/UnitDialog.vue.d.ts +31 -0
  268. package/dist/views/unit/components/unit-dialog/UnitDialogProps.d.ts +9 -0
  269. package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +50 -0
  270. package/dist/views/unit/components/unit-form/UnitFormProps.d.ts +10 -0
  271. package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +43 -0
  272. package/dist/views/unit/components/unit-used-by/UnitUsedBy.vue.d.ts +12 -0
  273. package/dist/views/unit/components/unit-used-by/UnitUsedByProps.d.ts +3 -0
  274. package/dist/views/unit/composables/use-unit-form.d.ts +8 -0
  275. package/dist/views/unit/composables/use-unit-table.d.ts +19 -0
  276. package/dist/views/unit/type.d.ts +2 -0
  277. package/dist/views/warehouse/WarehouseView.vue.d.ts +2 -0
  278. package/dist/views/warehouse/components/WarehouseDialog.vue.d.ts +22 -0
  279. package/dist/views/warehouse/components/WarehouseDialogProps.d.ts +10 -0
  280. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +174 -0
  281. package/dist/views/warehouse/components/WarehouseFormProps.d.ts +8 -0
  282. package/dist/views/warehouse/composables/use-warehouse-table.d.ts +12 -0
  283. package/dist/xlsx-BljO4Lx2.js +15510 -0
  284. package/package.json +93 -0
@@ -0,0 +1,1172 @@
1
+ import { defineComponent as E, mergeModels as ae, useModel as de, onMounted as ue, ref as D, computed as L, resolveComponent as B, openBlock as F, createElementBlock as S, createElementVNode as c, toDisplayString as Z, createVNode as M, createBlock as j, withCtx as I, Fragment as z, renderList as G, normalizeClass as R, normalizeStyle as ce, createSlots as fe, unref as P, createCommentVNode as O, withModifiers as me, reactive as Q, watch as X, isRef as ee, Teleport as pe } from "vue";
2
+ import { E as ge } from "./empty-placeholder-wf6-BWE8.js";
3
+ import { v as ve, c as U, w as be, b as ye } from "./app-BzDhmCVx.js";
4
+ import { useDialogChild as he, useDialog as te, useProxiedModel as ne, useSnackbar as _e } from "@feedmepos/ui-library";
5
+ import { f as oe } from "./fuzzy-BW8ZYsDG.js";
6
+ import { _ as Ce } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js";
7
+ import { _ as xe } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DcixBOcX.js";
8
+ import { useCoreStore as we } from "@feedmepos/mf-common";
9
+ const He = "data:image/svg+xml,%3csvg%20width='200'%20height='101'%20viewBox='0%200%20200%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M98.9161%2038.4456V24.1772H108.527V27.1988H102.12V30.2202H107.347V32.7382H102.12V38.4456H98.9161Z'%20fill='%235D5359'/%3e%3cpath%20d='M110.382%2031.2276C110.382%2027.5345%20113.249%2024.1772%20117.127%2024.1772C121.174%2024.1772%20123.872%2027.7024%20123.872%2031.3953C123.872%2035.0884%20121.005%2038.6133%20117.127%2038.6133C113.08%2038.4456%20110.382%2034.9204%20110.382%2031.2276ZM117.127%2035.5919C119.487%2035.5919%20120.499%2033.4096%20120.499%2031.2276C120.499%2029.0452%20119.319%2027.0309%20117.127%2027.0309C114.935%2027.0309%20113.754%2029.213%20113.754%2031.2276C113.754%2033.5776%20114.935%2035.5919%20117.127%2035.5919Z'%20fill='%235D5359'/%3e%3cpath%20d='M126.232%2031.2276C126.232%2027.5345%20129.099%2024.1772%20132.977%2024.1772C137.024%2024.1772%20139.722%2027.7024%20139.722%2031.3953C139.722%2035.0884%20136.855%2038.6133%20132.977%2038.6133C128.93%2038.4456%20126.232%2034.9204%20126.232%2031.2276ZM132.977%2035.5919C135.337%2035.5919%20136.349%2033.4096%20136.349%2031.2276C136.349%2029.0452%20135.169%2027.0309%20132.977%2027.0309C130.785%2027.0309%20129.604%2029.213%20129.604%2031.2276C129.604%2033.5776%20130.785%2035.5919%20132.977%2035.5919Z'%20fill='%235D5359'/%3e%3cpath%20d='M142.926%2038.4455V24.345H148.153C152.874%2024.345%20155.235%2027.5343%20155.235%2031.3952C155.235%2035.5918%20152.368%2038.4455%20148.153%2038.4455H142.926ZM148.153%2027.0308H146.129V35.4238H148.153C150.513%2035.4238%20151.862%2033.5775%20151.862%2031.2272C151.862%2028.8773%20150.513%2027.0308%20148.153%2027.0308Z'%20fill='%235D5359'/%3e%3cpath%20d='M110.045%2057.5607V49.1676L107.009%2055.2107H105.324L102.12%2049.1676V57.5607H98.9161V43.4604H102.457L106.167%2050.8465L109.876%2043.4604H113.417V57.5607H110.045Z'%20fill='%235D5359'/%3e%3cpath%20d='M115.947%2057.5607L121.342%2043.4604H124.04L129.436%2057.5607H125.895L124.715%2054.3716H120.331L119.319%2057.5607H115.947ZM122.691%2046.9856L121.005%2052.1893H124.378L122.691%2046.9856Z'%20fill='%235D5359'/%3e%3cpath%20d='M131.965%2057.5607V43.4604H138.373C141.07%2043.4604%20142.925%2045.8105%20142.925%2048.1605C142.925%2049.8393%20142.082%2051.5179%20140.565%2052.1893L143.768%2057.393H140.059L137.192%2052.8607H135V57.393H131.965V57.5607ZM135.169%2050.175H138.204C139.047%2050.175%20139.553%2049.3356%20139.553%2048.1605C139.553%2046.9856%20138.71%2046.3142%20138.035%2046.3142H135.169V50.175Z'%20fill='%235D5359'/%3e%3cpath%20d='M146.635%2057.5607V43.4604H150.007V49.8393L155.403%2043.4604H158.776L153.548%2049.6713L159.281%2057.5607H155.74L151.693%2051.5179L150.007%2053.3642V57.5607H146.635Z'%20fill='%235D5359'/%3e%3cpath%20d='M171.422%2054.7073V57.5607H161.474V43.4604H171.253V46.3142H164.677V48.9999H170.242V51.6856H164.677V54.7073H171.422Z'%20fill='%235D5359'/%3e%3cpath%20d='M185.417%2046.3142H181.202V57.5607H177.829V46.3142H173.614V43.4604H185.417V46.3142Z'%20fill='%235D5359'/%3e%3cpath%20d='M111.057%2062.5967V76.6973H107.853V70.9898H102.12V76.6973H98.9161V62.5967H102.12V68.1361H107.853V62.5967H111.057Z'%20fill='%235D5359'/%3e%3cpath%20d='M124.04%2069.815V62.5967H127.244V69.815C127.244%2073.6758%20125.389%2076.865%20121.005%2076.865C116.453%2076.865%20114.766%2073.5078%20114.766%2069.815V62.5967H117.97V69.815C117.97%2071.997%20118.813%2074.0115%20121.005%2074.0115C123.366%2074.0115%20124.04%2071.997%20124.04%2069.815Z'%20fill='%235D5359'/%3e%3cpath%20d='M138.036%2076.6973H131.122V62.5967H139.047C141.071%2062.5967%20142.251%2064.4433%20142.251%2066.2898C142.251%2067.6327%20141.576%2068.9755%20140.228%2069.4793C141.914%2069.9827%20142.926%2071.1578%20142.926%2073.1721C142.757%2075.5221%20140.733%2076.6973%20138.036%2076.6973ZM134.326%2065.4504V68.3041H137.53C138.204%2068.3041%20138.879%2067.8004%20138.879%2066.7933C138.879%2065.7861%20138.373%2065.2827%20137.698%2065.2827H134.326V65.4504ZM138.204%2070.8221H134.494V73.8435H138.204C139.047%2073.8435%20139.722%2073.1721%20139.722%2072.3327C139.553%2071.6613%20138.879%2070.8221%20138.204%2070.8221Z'%20fill='%235D5359'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M73.4753%2051.4994C78.7281%2050.5396%2082.8911%2046.4891%2083.9954%2041.3137L84.1232%2040.7134L83.9445%2040.1256C80.5804%2029.066%2071.9945%2020.2704%2061.0373%2016.5726C57.4%2015.3451%2053.5046%2014.6804%2049.458%2014.6804C45.4112%2014.6804%2041.5158%2015.3451%2037.8784%2016.5726C26.9214%2020.2704%2018.3354%2029.066%2014.9712%2040.1256L14.7924%2040.7134L14.9206%2041.3137C16.0247%2046.4891%2020.1875%2050.5396%2025.4405%2051.4994V58.8839H14.4183C14.6758%2059.9557%2014.9818%2061.0088%2015.3337%2062.0411C20.1553%2076.1811%2033.6083%2086.3619%2049.458%2086.3619C65.3074%2086.3619%2078.7606%2076.1811%2083.5822%2062.0411C83.9342%2061.0088%2084.2399%2059.9557%2084.4974%2058.8839H73.4753V51.4994ZM41.0517%2020.5973V38.5742C41.0517%2043.1931%2044.8155%2046.9371%2049.458%2046.9371C54.1005%2046.9371%2057.8641%2043.1931%2057.8641%2038.5742V20.5973C55.1919%2019.856%2052.3732%2019.4592%2049.458%2019.4592C46.5428%2019.4592%2043.7241%2019.856%2041.0517%2020.5973ZM62.6675%2022.3673V38.5742C62.6675%2043.1931%2066.431%2046.9371%2071.0735%2046.9371C74.9051%2046.9371%2078.1425%2044.3848%2079.1528%2040.8942C76.4672%2032.6902%2070.4379%2025.9824%2062.6675%2022.3673ZM60.2658%2046.1322C57.8753%2049.5094%2053.9255%2051.7159%2049.458%2051.7159C44.9902%2051.7159%2041.0408%2049.5094%2038.65%2046.1322C36.6982%2048.8894%2033.7074%2050.8662%2030.2439%2051.4994V58.8839H68.6718V51.4994C65.2083%2050.8662%2062.2175%2048.8894%2060.2658%2046.1322ZM21.1583%2063.6628C26.1349%2074.2514%2036.9382%2081.5834%2049.458%2081.5834C61.9776%2081.5834%2072.781%2074.2514%2077.7574%2063.6628H21.1583ZM36.2482%2038.5742V22.3673C28.4779%2025.9824%2022.4486%2032.6902%2019.7631%2040.8942C20.7733%2044.3848%2024.0106%2046.9371%2027.8422%2046.9371C32.4847%2046.9371%2036.2482%2043.1931%2036.2482%2038.5742Z'%20fill='%23FFC35D'/%3e%3c/svg%3e";
10
+ function Y(_, v) {
11
+ return oe.filter(_, v).length > 0;
12
+ }
13
+ function ke(_, v) {
14
+ if (!_)
15
+ return {
16
+ label: v,
17
+ segments: [
18
+ {
19
+ isMatch: !1,
20
+ segment: v
21
+ }
22
+ ],
23
+ matched: !1
24
+ };
25
+ const [o] = oe.filter(_.toLocaleLowerCase(), [v], {
26
+ pre: "|",
27
+ post: "|"
28
+ });
29
+ if (!o)
30
+ return {
31
+ label: v,
32
+ segments: [{ segment: v, isMatch: !1 }],
33
+ matched: !1
34
+ };
35
+ const p = o.string.toString().replace(/\|\|/g, "").split("|").reduce((l, u, H) => (l.push({
36
+ segment: u,
37
+ isMatch: H % 2 !== 0
38
+ //e.g. index 1, 3, 5, ...
39
+ }), l), new Array());
40
+ return {
41
+ label: v,
42
+ segments: p,
43
+ matched: !0
44
+ };
45
+ }
46
+ function K(_) {
47
+ return Object.prototype.hasOwnProperty.call(_, "children");
48
+ }
49
+ const Fe = { class: "flex flex-col gap-12 h-[350px]" }, Me = { class: "flex items-center" }, $e = {
50
+ class: "flex-1",
51
+ "data-cy": "items-selected"
52
+ }, Ve = {
53
+ class: "flex-1",
54
+ "data-cy": "filter-field"
55
+ }, Se = ["data-cy"], Ae = { class: "flex flex-col" }, Be = { class: "fm-typo-en-body-md-400" }, Le = {
56
+ key: 1,
57
+ class: "w-full py-16 text-fm-color-typo-disabled fm-typo-en-body-md-400 text-center"
58
+ }, ie = /* @__PURE__ */ E({
59
+ __name: "FmNestedMultiselectDialog",
60
+ props: /* @__PURE__ */ ae({
61
+ modelValue: {}
62
+ }, {
63
+ modelValue: {},
64
+ modelModifiers: {}
65
+ }),
66
+ emits: ["update:modelValue"],
67
+ setup(_) {
68
+ const v = de(_, "modelValue"), o = he();
69
+ ue(() => {
70
+ o.emitData(v.value);
71
+ });
72
+ const p = D("");
73
+ function l(e) {
74
+ return Y(
75
+ p.value,
76
+ e.sublabel ? [e.label, e.sublabel] : [e.label]
77
+ );
78
+ }
79
+ function u(e) {
80
+ return l(e) ? !0 : K(e) ? e.children.some(u) : !1;
81
+ }
82
+ function H(e, i) {
83
+ if (!p.value)
84
+ return !0;
85
+ const [r, ...m] = e;
86
+ if (typeof r != "number")
87
+ return !1;
88
+ const k = i[r];
89
+ return Y(
90
+ p.value,
91
+ k.sublabel ? [k.label, k.sublabel] : [k.label]
92
+ ) ? !0 : m.length === 0 ? u(k) : K(k) ? H(m, k.children) : !1;
93
+ }
94
+ function $(e, i, r = 0, m = !1) {
95
+ if (K(e) && e.children.length) {
96
+ const { children: k, ...A } = e, N = k.flatMap(
97
+ (w, q) => $(w, [...i, q], r + 1, m || e.disabled)
98
+ );
99
+ return [
100
+ {
101
+ ...A,
102
+ keys: i,
103
+ indent: r,
104
+ collapsible: !0,
105
+ disabled: m || e.disabled
106
+ },
107
+ ...N
108
+ ];
109
+ }
110
+ return [
111
+ {
112
+ ...e,
113
+ keys: i,
114
+ indent: r,
115
+ collapsible: !1,
116
+ disabled: m || e.disabled
117
+ }
118
+ ];
119
+ }
120
+ const V = L(() => v.value.flatMap(
121
+ (e, i) => $(e, [i]).filter((r) => H(r.keys, v.value))
122
+ ));
123
+ function y(e) {
124
+ if (K(e)) {
125
+ if (u(e)) {
126
+ const i = l(e) ? e.children : e.children.filter(u);
127
+ return i.length === 0 ? !1 : i.every(y);
128
+ }
129
+ return e.children.every(y);
130
+ }
131
+ return e.active ?? !1;
132
+ }
133
+ function g(e, i) {
134
+ const [r, ...m] = e;
135
+ if (typeof r != "number")
136
+ return !1;
137
+ const k = i[r];
138
+ return m.length === 0 ? y(k ?? []) : K(k) ? g(m, k.children ?? []) : !1;
139
+ }
140
+ function x(e) {
141
+ if (K(e)) {
142
+ if (u(e)) {
143
+ const i = l(e) ? e.children : e.children.filter(u);
144
+ return i.length === 0 ? !1 : i.some(y) && !i.every(y);
145
+ }
146
+ return !1;
147
+ }
148
+ return !1;
149
+ }
150
+ function b(e, i) {
151
+ const [r, ...m] = e;
152
+ if (typeof r != "number")
153
+ return !1;
154
+ const k = i[r];
155
+ return m.length === 0 ? x(k ?? []) : K(k) ? b(m, (k == null ? void 0 : k.children) ?? []) : !1;
156
+ }
157
+ function C(e, i) {
158
+ if (e.disabled)
159
+ return e;
160
+ if (K(e)) {
161
+ if (u(e)) {
162
+ const r = l(e) ? e.children : e.children.filter(u);
163
+ return {
164
+ ...e,
165
+ children: e.children.map((m) => r.find((A) => ve(A.value, m.value)) ? C(m, i) : m)
166
+ };
167
+ }
168
+ return {
169
+ ...e,
170
+ children: e.children.map((r) => C(r, i))
171
+ };
172
+ }
173
+ return {
174
+ ...e,
175
+ active: i
176
+ };
177
+ }
178
+ function h(e, i, r) {
179
+ const [m, ...k] = e;
180
+ return typeof m != "number" ? i : k.length === 0 ? i.map((A, N) => m !== N ? A : C(A, r)) : i.map(
181
+ (A, N) => m === N && K(A) ? {
182
+ ...A,
183
+ children: h(k, A.children, r)
184
+ } : A
185
+ );
186
+ }
187
+ const s = D(new Array());
188
+ function t(e) {
189
+ const i = e.join();
190
+ return s.value.find((r) => i === r);
191
+ }
192
+ function n(e) {
193
+ const i = e.join();
194
+ t(e) ? s.value = s.value.filter((r) => r !== i) : s.value = [...s.value, i];
195
+ }
196
+ function d(e) {
197
+ const i = e.join();
198
+ return s.value.find((r) => i.startsWith(r) && i !== r);
199
+ }
200
+ const f = L(
201
+ () => V.value.filter((e) => H(e.keys, v.value) && e.active).length
202
+ );
203
+ function a(e, i, r) {
204
+ v.value = h(e, i, r), o.emitData(v.value);
205
+ }
206
+ return (e, i) => {
207
+ const r = B("FmSearch"), m = B("FmCheckbox"), k = B("FmButton"), A = B("FmListItem"), N = B("FmList");
208
+ return F(), S("div", Fe, [
209
+ c("div", Me, [
210
+ c("div", $e, Z(f.value) + " items selected", 1),
211
+ c("div", Ve, [
212
+ M(r, {
213
+ modelValue: p.value,
214
+ "onUpdate:modelValue": i[0] || (i[0] = (w) => p.value = w),
215
+ placeholder: "Filter items"
216
+ }, null, 8, ["modelValue"])
217
+ ])
218
+ ]),
219
+ V.value.length ? (F(), j(N, {
220
+ key: 0,
221
+ class: "flex-1 overflow-y-auto"
222
+ }, {
223
+ default: I(() => [
224
+ (F(!0), S(z, null, G(V.value, (w) => (F(), S("div", {
225
+ key: w.keys.join(),
226
+ class: R([
227
+ "transition-all overflow-y-clip",
228
+ d(w.keys) ? "max-h-0 opacity-0" : "max-h-[50px] opacity-100"
229
+ ]),
230
+ "data-cy": `nested-${w.keys.join("-")}-${w.label}`
231
+ }, [
232
+ M(A, {
233
+ clickable: w.selectable !== !1,
234
+ onClick: () => w.selectable === !1 || w.disabled || a(w.keys, v.value, !g(w.keys, v.value)),
235
+ style: ce({
236
+ paddingLeft: `${16 + w.indent * 16}px`,
237
+ paddingTop: "4px",
238
+ paddingBottom: "4px"
239
+ }),
240
+ disabled: w.selectable !== !1 && w.disabled
241
+ }, fe({
242
+ default: I(() => [
243
+ c("div", Ae, [
244
+ c("div", Be, [
245
+ (F(!0), S(z, null, G(P(ke)(p.value, w.label).segments, (q, re) => (F(), S("span", {
246
+ key: re,
247
+ class: R({
248
+ "font-bold": q.isMatch
249
+ })
250
+ }, Z(q.segment), 3))), 128))
251
+ ]),
252
+ w.sublabel ? (F(), S("div", {
253
+ key: 0,
254
+ class: R([
255
+ "fm-typo-en-body-sm-400",
256
+ w.disabled ? "" : "text-fm-color-typo-secondary"
257
+ ])
258
+ }, Z(w.sublabel), 3)) : O("", !0)
259
+ ])
260
+ ]),
261
+ _: 2
262
+ }, [
263
+ w.selectable !== !1 ? {
264
+ name: "prepend",
265
+ fn: I(() => [
266
+ M(m, {
267
+ disabled: w.disabled,
268
+ "model-value": g(w.keys, v.value),
269
+ value: w.keys,
270
+ indeterminate: b(w.keys, v.value)
271
+ }, null, 8, ["disabled", "model-value", "value", "indeterminate"])
272
+ ]),
273
+ key: "0"
274
+ } : void 0,
275
+ w.collapsible ? {
276
+ name: "append",
277
+ fn: I(() => [
278
+ M(k, {
279
+ "prepend-icon": t(w.keys) ? "expand_less" : "expand_more",
280
+ size: "md",
281
+ variant: "tertiary",
282
+ onClick: me(() => n(w.keys), ["stop"])
283
+ }, null, 8, ["prepend-icon", "onClick"])
284
+ ]),
285
+ key: "1"
286
+ } : void 0
287
+ ]), 1032, ["clickable", "onClick", "style", "disabled"])
288
+ ], 10, Se))), 128))
289
+ ]),
290
+ _: 1
291
+ })) : (F(), S("div", Le, " No results found "))
292
+ ]);
293
+ };
294
+ }
295
+ }), Ie = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5" }, Ke = { class: "flex items-center" }, De = /* @__PURE__ */ c("div", { class: "text-lg font-bold flex-grow" }, "Addons", -1), Ne = {
296
+ key: 0,
297
+ class: "table-auto w-full"
298
+ }, Ze = /* @__PURE__ */ c("tr", { class: "text-left" }, [
299
+ /* @__PURE__ */ c("th", { class: "min-w-64" }, "Name"),
300
+ /* @__PURE__ */ c("th", null, "Code"),
301
+ /* @__PURE__ */ c("th", { class: "w-1" }, " ")
302
+ ], -1), Pe = /* @__PURE__ */ c("tr", { class: "block h-8" }, null, -1), je = { class: "flex flex-col" }, Ue = { class: "fm-typo-en-body-md-400" }, ze = {
303
+ key: 0,
304
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
305
+ }, Oe = { class: "w-1" }, Ee = /* @__PURE__ */ E({
306
+ __name: "ApplyAddon",
307
+ props: {
308
+ groups: {
309
+ type: Array,
310
+ required: !0
311
+ },
312
+ modifiers: {
313
+ type: Array,
314
+ required: !0
315
+ },
316
+ items: {
317
+ type: Array,
318
+ required: !0
319
+ },
320
+ loading: {
321
+ type: Boolean
322
+ }
323
+ },
324
+ emits: ["update:modifiers"],
325
+ setup(_, { emit: v }) {
326
+ const o = _, p = v, l = te(), u = L(() => {
327
+ const g = o.groups.flatMap((x) => x.items.map((b) => {
328
+ const C = o.items.find((h) => h._id === b._id);
329
+ return {
330
+ ...b,
331
+ groupName: x.name,
332
+ name: b.name ?? (C == null ? void 0 : C.name) ?? "-"
333
+ };
334
+ }));
335
+ return o.modifiers.map((x) => {
336
+ const b = g.find((s) => s.selection === x.selection), C = (b == null ? void 0 : b.name) ?? "-", h = (b == null ? void 0 : b.groupName) ?? "";
337
+ return {
338
+ ...x,
339
+ name: C,
340
+ groupName: h
341
+ };
342
+ });
343
+ }), H = L(() => o.groups.flatMap((g) => g.items.map((x) => ({ ...x, groupId: g._id }))));
344
+ function $({ selection: g }) {
345
+ p(
346
+ "update:modifiers",
347
+ o.modifiers.filter((x) => x.selection !== g)
348
+ );
349
+ }
350
+ function V({ selection: g }, x) {
351
+ const b = o.modifiers.find((C) => C.selection === g);
352
+ b && (b.code = x);
353
+ }
354
+ function y() {
355
+ let g = [];
356
+ o.groups.forEach((b) => {
357
+ let C = !1;
358
+ b.items.every((h) => h._id.startsWith("item")) && (C = !0), g.push({
359
+ label: b.name,
360
+ sublabel: "Group",
361
+ value: b._id,
362
+ disabled: C,
363
+ children: b.items.reduce((h, s) => {
364
+ var d;
365
+ const t = o.items.find((f) => f._id === s._id), n = (d = t == null ? void 0 : t.variant) == null ? void 0 : d.variantCombinations.find(
366
+ (f) => f.combinationKey === (s == null ? void 0 : s.combinationKey)
367
+ );
368
+ return [
369
+ ...h,
370
+ {
371
+ label: `${s.name ?? (t == null ? void 0 : t.name)} ${n ? `(${n.name})` : ""}`,
372
+ value: `${s.selection}${n ? `/${n == null ? void 0 : n.combinationKey}` : ""}`,
373
+ disabled: C,
374
+ active: !!o.modifiers.find(({ selection: f }) => f === s.selection)
375
+ }
376
+ ];
377
+ }, [])
378
+ });
379
+ });
380
+ const x = {
381
+ modelValue: g
382
+ };
383
+ l.open({
384
+ title: "Select Addons",
385
+ contentComponent: ie,
386
+ contentComponentProps: x,
387
+ primaryActions: {
388
+ text: "Confirm",
389
+ close: !0
390
+ }
391
+ }).onPrimary((b) => {
392
+ const C = U(o.modifiers);
393
+ let h = [];
394
+ function s(t, n) {
395
+ if (n(t), K(t))
396
+ for (let d of t.children)
397
+ s(d, n);
398
+ }
399
+ b.forEach((t) => {
400
+ s(t, (n) => {
401
+ var e;
402
+ if (o.groups.find(({ _id: i }) => i === n.value)) return;
403
+ const f = H.value.find(({ selection: i }) => i === n.value), a = h.find(({ selection: i }) => n.value === i);
404
+ !K(n) && n.active && a === void 0 && h.push({
405
+ addonGroupId: (f == null ? void 0 : f.groupId) ?? "",
406
+ selection: n.value,
407
+ code: ((e = C.find(({ selection: i }) => n.value === i)) == null ? void 0 : e.code) ?? ""
408
+ });
409
+ });
410
+ }), p("update:modifiers", h);
411
+ });
412
+ }
413
+ return (g, x) => {
414
+ const b = B("FmButton"), C = B("FmTextField");
415
+ return F(), S("div", Ie, [
416
+ c("div", Ke, [
417
+ De,
418
+ M(b, {
419
+ type: "button",
420
+ variant: "plain",
421
+ size: "md",
422
+ icon: "link",
423
+ label: "Apply Addons",
424
+ onClick: x[0] || (x[0] = (h) => y())
425
+ })
426
+ ]),
427
+ c("div", null, [
428
+ u.value.length > 0 ? (F(), S("table", Ne, [
429
+ Ze,
430
+ (F(!0), S(z, null, G(u.value, (h, s) => (F(), S(z, { key: s }, [
431
+ Pe,
432
+ c("tr", null, [
433
+ c("td", null, [
434
+ c("div", je, [
435
+ c("div", Ue, Z(h.name), 1),
436
+ h.groupName ? (F(), S("div", ze, Z(h.groupName), 1)) : O("", !0)
437
+ ])
438
+ ]),
439
+ c("td", null, [
440
+ M(C, {
441
+ disabled: _.loading,
442
+ "model-value": h.code,
443
+ "onUpdate:modelValue": [(t) => h.code = t, (t) => V(h, t)],
444
+ rules: [
445
+ function(n) {
446
+ return !!n || "Required";
447
+ }
448
+ ]
449
+ }, null, 8, ["disabled", "model-value", "onUpdate:modelValue", "rules"])
450
+ ]),
451
+ c("td", Oe, [
452
+ M(b, {
453
+ disabled: _.loading,
454
+ type: "button",
455
+ variant: "tertiary",
456
+ icon: "delete",
457
+ "icon-color": "#000000",
458
+ size: "md",
459
+ onClick: (t) => $(h)
460
+ }, null, 8, ["disabled", "onClick"])
461
+ ])
462
+ ])
463
+ ], 64))), 128))
464
+ ])) : O("", !0)
465
+ ])
466
+ ]);
467
+ };
468
+ }
469
+ });
470
+ function qe(_, v = []) {
471
+ const o = v.map((l) => _.find((u) => u._id === l)).filter((l) => !!l);
472
+ return Te(o).reduce((l, u) => (l[u.combinationKey] = u.selectionName.join(" / "), l), {});
473
+ }
474
+ function Re(_, v, o) {
475
+ const p = o.reduce((u, H) => {
476
+ var g, x, b;
477
+ const $ = H.category || "", V = qe(v, (g = H.variant) == null ? void 0 : g.variantGroupIds), y = {
478
+ ...H,
479
+ codeName: [H.code, H.name].filter((C) => !!C).join(" "),
480
+ variant: {
481
+ variantGroupIds: ((x = H.variant) == null ? void 0 : x.variantGroupIds) || [],
482
+ variantCombinations: (((b = H.variant) == null ? void 0 : b.variantCombinations) || []).map((C) => {
483
+ const h = C.code, s = C.name || V[C.combinationKey || ""];
484
+ return {
485
+ ...C,
486
+ codeName: [h, s].filter((t) => !!t).join(" ").trim() || "-"
487
+ };
488
+ })
489
+ }
490
+ };
491
+ return u[$] = u[$] ? [...u[$], y] : [y], u;
492
+ }, {}), l = Object.values(p)[0];
493
+ return _.length === 0 && l ? l.map((u) => ({
494
+ id: u._id,
495
+ name: u.name ?? "",
496
+ items: p[u._id || ""] || []
497
+ })) || [] : _.map((u) => ({
498
+ id: u._id,
499
+ name: u.name ?? "",
500
+ items: p[u._id || ""] || []
501
+ }));
502
+ }
503
+ function se(_, v) {
504
+ if (_.length == 1)
505
+ return _[0];
506
+ const o = _[0], p = _.slice(1, _.length), l = se(p, v);
507
+ return o.reduce((H, $) => [...H, ...l.map((V) => v($, V))], new Array());
508
+ }
509
+ function Te(_) {
510
+ if (_.length === 0) return [];
511
+ const v = _.map(
512
+ (p) => (p.options ?? []).map(
513
+ (l) => ({
514
+ combinationKey: [`${p._id}/${l._id}`],
515
+ selectionName: [l.name ?? ""]
516
+ })
517
+ )
518
+ );
519
+ return se(v, (p, l) => ({
520
+ combinationKey: [...p.combinationKey, ...l.combinationKey],
521
+ selectionName: [...p.selectionName, ...l.selectionName]
522
+ })).map((p) => {
523
+ const l = [...p.combinationKey];
524
+ return l.sort(), {
525
+ combinationKey: l.join("/"),
526
+ active: !0,
527
+ selectionName: p.selectionName
528
+ };
529
+ });
530
+ }
531
+ const Ge = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5 mb-3" }, We = { class: "flex items-center" }, Ye = { class: "text-lg font-bold flex-grow" }, Je = {
532
+ key: 0,
533
+ class: "table-auto w-full"
534
+ }, Qe = /* @__PURE__ */ c("tr", { class: "text-left" }, [
535
+ /* @__PURE__ */ c("th", { class: "min-w-64" }, "Name"),
536
+ /* @__PURE__ */ c("th", null, "Code"),
537
+ /* @__PURE__ */ c("th", { class: "w-1" }, " ")
538
+ ], -1), Xe = /* @__PURE__ */ c("tr", { class: "block h-8" }, null, -1), et = { class: "flex flex-col" }, tt = { class: "fm-typo-en-body-md-400" }, nt = {
539
+ key: 0,
540
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
541
+ }, ot = { class: "w-1" }, W = /* @__PURE__ */ E({
542
+ __name: "ApplyProduct",
543
+ props: {
544
+ isAddon: {
545
+ type: Boolean,
546
+ default: !1
547
+ },
548
+ bindings: {
549
+ type: Array,
550
+ required: !0
551
+ },
552
+ categories: {
553
+ type: Array,
554
+ required: !0
555
+ },
556
+ variants: {
557
+ type: Object,
558
+ required: !0
559
+ },
560
+ menus: {
561
+ type: Array,
562
+ required: !0
563
+ }
564
+ },
565
+ emits: ["update:bindings"],
566
+ setup(_, { emit: v }) {
567
+ const o = _, p = v, l = te(), u = L(() => o.isAddon ? "Addons" : "Products"), H = L(() => o.isAddon ? [] : o.categories), $ = L(
568
+ () => Re(H.value, o.variants, o.menus)
569
+ ), V = L(() => {
570
+ if (o.isAddon)
571
+ return o.bindings.map((n) => {
572
+ const d = o.menus.find((a) => a._id === n.productId), f = (d == null ? void 0 : d.name) ?? "-";
573
+ return {
574
+ ...n,
575
+ name: f,
576
+ itemCode: (d == null ? void 0 : d.code) ?? "-"
577
+ };
578
+ });
579
+ const t = $.value.flatMap((n) => n.items);
580
+ return o.bindings.map((n) => {
581
+ var i;
582
+ const d = t.find((r) => r._id === n.productId), f = (d == null ? void 0 : d.name) ?? "-";
583
+ let a = (d == null ? void 0 : d.code) ?? "-", e;
584
+ if (n.combinationKey) {
585
+ const r = (((i = d == null ? void 0 : d.variant) == null ? void 0 : i.variantCombinations) || []).find(
586
+ (m) => m.combinationKey === n.combinationKey
587
+ );
588
+ e = (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.codeName) ?? "", a = (r == null ? void 0 : r.code) ?? a;
589
+ }
590
+ return {
591
+ ...n,
592
+ name: f,
593
+ itemCode: a,
594
+ variantName: e
595
+ };
596
+ });
597
+ });
598
+ function y(t) {
599
+ p(
600
+ "update:bindings",
601
+ o.bindings.filter(
602
+ (n) => n.productId !== t.productId || n.combinationKey !== t.combinationKey
603
+ )
604
+ );
605
+ }
606
+ function g({ productId: t, combinationKey: n }, d) {
607
+ const f = o.bindings.find(
608
+ (a) => a.productId === t && a.combinationKey === n
609
+ );
610
+ f && (f.code = d);
611
+ }
612
+ function x() {
613
+ return $.value.map((t) => ({
614
+ label: t.name,
615
+ sublabel: "Category",
616
+ value: t.name,
617
+ disabled: !1,
618
+ children: t.items.map((n) => {
619
+ var f;
620
+ const d = (f = n.variant) == null ? void 0 : f.variantCombinations;
621
+ return d != null && d.length ? {
622
+ label: n.name ?? "",
623
+ value: n._id,
624
+ sublabel: "Product",
625
+ children: [
626
+ {
627
+ label: n.codeName ?? "",
628
+ value: {
629
+ productId: n._id
630
+ },
631
+ active: !!o.bindings.find(
632
+ ({ productId: a, combinationKey: e }) => n._id === a && !e
633
+ )
634
+ },
635
+ ...d.map((a) => ({
636
+ label: a.codeName ?? "",
637
+ value: {
638
+ productId: n._id,
639
+ combinationKey: a.combinationKey
640
+ },
641
+ sublabel: "Variant",
642
+ active: !!o.bindings.find(
643
+ ({ productId: e, combinationKey: i }) => n._id === e && a.combinationKey === i
644
+ )
645
+ }))
646
+ ]
647
+ } : {
648
+ label: n.codeName ?? "",
649
+ value: {
650
+ productId: n._id
651
+ },
652
+ active: !!o.bindings.find(
653
+ ({ productId: a, combinationKey: e }) => n._id === a && !e
654
+ )
655
+ };
656
+ })
657
+ }));
658
+ }
659
+ function b() {
660
+ return o.menus.map((t) => ({
661
+ label: t.name,
662
+ value: { productId: t._id },
663
+ active: !!o.bindings.find(
664
+ ({ productId: n, combinationKey: d }) => t._id === n && !d
665
+ )
666
+ }));
667
+ }
668
+ function C(t) {
669
+ const n = U(o.bindings);
670
+ return t.flatMap((d) => d.children.flatMap((f) => {
671
+ var e;
672
+ if (K(f))
673
+ return f.children.filter((i) => i.active).map((i) => {
674
+ var k, A;
675
+ const { productId: r, combinationKey: m } = i.value;
676
+ return m ? {
677
+ productId: r,
678
+ combinationKey: m,
679
+ code: ((k = n.find(
680
+ ({ productId: N, combinationKey: w }) => r === N && m === w
681
+ )) == null ? void 0 : k.code) ?? ""
682
+ } : {
683
+ productId: r,
684
+ code: ((A = n.find(({ productId: N, combinationKey: w }) => r === N && !w)) == null ? void 0 : A.code) ?? ""
685
+ };
686
+ });
687
+ if (!f.active)
688
+ return [];
689
+ const { productId: a } = f.value;
690
+ return [
691
+ {
692
+ productId: a,
693
+ code: ((e = n.find(({ productId: i, combinationKey: r }) => a === i && !r)) == null ? void 0 : e.code) ?? ""
694
+ }
695
+ ];
696
+ }));
697
+ }
698
+ function h(t) {
699
+ const n = U(o.bindings);
700
+ return t.filter((d) => d.active).map(
701
+ (d) => {
702
+ var f;
703
+ return {
704
+ productId: d.value.productId,
705
+ code: ((f = n.find(({ productId: a }) => a === d.value.productId)) == null ? void 0 : f.code) ?? ""
706
+ };
707
+ }
708
+ );
709
+ }
710
+ function s() {
711
+ let t;
712
+ o.isAddon ? t = b() : t = x();
713
+ const n = {
714
+ modelValue: t
715
+ };
716
+ l.open({
717
+ title: `Select ${u.value}`,
718
+ contentComponent: ie,
719
+ contentComponentProps: n,
720
+ primaryActions: {
721
+ text: "Confirm",
722
+ close: !0
723
+ }
724
+ }).onPrimary((d) => {
725
+ let f;
726
+ o.isAddon ? f = h(d) : f = C(d), p("update:bindings", f);
727
+ });
728
+ }
729
+ return (t, n) => {
730
+ const d = B("FmButton"), f = B("FmTextField");
731
+ return F(), S("div", Ge, [
732
+ c("div", We, [
733
+ c("div", Ye, Z(u.value), 1),
734
+ M(d, {
735
+ type: "button",
736
+ variant: "plain",
737
+ size: "md",
738
+ icon: "link",
739
+ label: `Apply ${u.value}`,
740
+ onClick: n[0] || (n[0] = (a) => s())
741
+ }, null, 8, ["label"])
742
+ ]),
743
+ c("div", null, [
744
+ V.value.length > 0 ? (F(), S("table", Je, [
745
+ Qe,
746
+ (F(!0), S(z, null, G(V.value, (a, e) => (F(), S(z, { key: e }, [
747
+ Xe,
748
+ c("tr", null, [
749
+ c("td", null, [
750
+ c("div", et, [
751
+ c("div", tt, Z(a.itemCode) + " " + Z(a.name), 1),
752
+ a.variantName ? (F(), S("div", nt, Z(a.variantName), 1)) : O("", !0)
753
+ ])
754
+ ]),
755
+ c("td", null, [
756
+ M(f, {
757
+ "model-value": a.code,
758
+ "onUpdate:modelValue": [(i) => a.code = i, (i) => g(a, i)],
759
+ rules: [
760
+ function(r) {
761
+ return !!r || "Required";
762
+ }
763
+ ]
764
+ }, null, 8, ["model-value", "onUpdate:modelValue", "rules"])
765
+ ]),
766
+ c("td", ot, [
767
+ M(d, {
768
+ type: "button",
769
+ variant: "tertiary",
770
+ icon: "delete",
771
+ "icon-color": "#000000",
772
+ size: "md",
773
+ onClick: (i) => y(a)
774
+ }, null, 8, ["onClick"])
775
+ ])
776
+ ])
777
+ ], 64))), 128))
778
+ ])) : O("", !0)
779
+ ])
780
+ ]);
781
+ };
782
+ }
783
+ }), it = { class: "flex flex-col gap-8 w-full" }, st = /* @__PURE__ */ E({
784
+ __name: "ApplyProductDialog",
785
+ props: {
786
+ categories: { default: () => [] },
787
+ variants: { default: () => [] },
788
+ menus: { default: () => [] },
789
+ groups: { default: () => [] },
790
+ setting: {},
791
+ show: { type: Boolean },
792
+ loading: { type: Boolean }
793
+ },
794
+ emits: ["update:setting", "update:show", "submit"],
795
+ setup(_, { emit: v }) {
796
+ const o = _, p = v, l = Q(U(o.setting));
797
+ X([() => o.show], ([y]) => {
798
+ if (y)
799
+ for (const g of Object.keys(o.setting))
800
+ l[g] = o.setting[g];
801
+ });
802
+ const u = D(), H = ne(o, "show");
803
+ function $() {
804
+ var y, g;
805
+ (g = (y = u.value) == null ? void 0 : y.validateInputs) == null || g.call(y);
806
+ }
807
+ function V() {
808
+ p("update:setting", U(l)), p("submit");
809
+ }
810
+ return (y, g) => {
811
+ const x = B("FmChip"), b = B("FmForm"), C = B("FmButton"), h = B("FmSideSheet");
812
+ return F(), j(h, {
813
+ modelValue: P(H),
814
+ "onUpdate:modelValue": g[4] || (g[4] = (s) => ee(H) ? H.value = s : null),
815
+ header: "Update integration",
816
+ "dismiss-away": "",
817
+ "close-button": "",
818
+ "max-width": 500
819
+ }, {
820
+ default: I(() => [
821
+ c("div", it, [
822
+ c("div", null, [
823
+ M(x, { label: "Menu v3" })
824
+ ]),
825
+ M(b, {
826
+ ref_key: "formRef",
827
+ ref: u,
828
+ onValidationSuccess: g[2] || (g[2] = (s) => V())
829
+ }, {
830
+ default: I(() => [
831
+ M(W, {
832
+ bindings: l.bindings,
833
+ categories: y.categories,
834
+ variants: y.variants,
835
+ menus: y.menus,
836
+ "onUpdate:bindings": g[0] || (g[0] = (s) => l.bindings = s)
837
+ }, null, 8, ["bindings", "categories", "variants", "menus"]),
838
+ M(Ee, {
839
+ form: u.value,
840
+ modifiers: l.modifiers ?? [],
841
+ groups: y.groups ?? [],
842
+ items: y.menus ?? [],
843
+ "onUpdate:modifiers": g[1] || (g[1] = (s) => l.modifiers = s)
844
+ }, null, 8, ["form", "modifiers", "groups", "items"])
845
+ ]),
846
+ _: 1
847
+ }, 512)
848
+ ])
849
+ ]),
850
+ "side-sheet-footer": I(() => [
851
+ M(C, {
852
+ loading: y.loading,
853
+ type: "submit",
854
+ label: "Submit",
855
+ onClick: g[3] || (g[3] = (s) => $())
856
+ }, null, 8, ["loading"])
857
+ ]),
858
+ _: 1
859
+ }, 8, ["modelValue"]);
860
+ };
861
+ }
862
+ }), lt = { class: "flex flex-col gap-8 w-full" }, rt = /* @__PURE__ */ E({
863
+ __name: "ApplyProductDialogV4",
864
+ props: {
865
+ categories: { default: () => [] },
866
+ variants: { default: () => [] },
867
+ menus: { default: () => [] },
868
+ groups: { default: () => [] },
869
+ setting: {},
870
+ show: { type: Boolean },
871
+ loading: { type: Boolean }
872
+ },
873
+ emits: ["update:setting", "update:show", "submit"],
874
+ setup(_, { emit: v }) {
875
+ const o = _, p = v, l = Q(U(o.setting));
876
+ X([() => o.show], ([s]) => {
877
+ if (s)
878
+ for (const t of Object.keys(o.setting))
879
+ l[t] = o.setting[t];
880
+ });
881
+ const u = L(() => o.menus.filter((s) => (s == null ? void 0 : s.category) === null)), H = L(() => l.bindings.filter((s) => {
882
+ const t = o.menus.find((n) => n._id === s.productId);
883
+ return t ? (t == null ? void 0 : t.category) === null : !1;
884
+ })), $ = L(() => o.menus.filter((s) => (s == null ? void 0 : s.category) !== null)), V = L(() => l.bindings.filter((s) => {
885
+ const t = o.menus.find((n) => n._id === s.productId);
886
+ return t ? (t == null ? void 0 : t.category) !== null : !1;
887
+ }));
888
+ function y(s) {
889
+ l.bindings = [...H.value, ...s];
890
+ }
891
+ function g(s) {
892
+ l.bindings = [...V.value, ...s];
893
+ }
894
+ const x = D(), b = ne(o, "show");
895
+ function C() {
896
+ var s, t;
897
+ (t = (s = x.value) == null ? void 0 : s.validateInputs) == null || t.call(s);
898
+ }
899
+ function h() {
900
+ p("update:setting", U(l)), p("submit");
901
+ }
902
+ return (s, t) => {
903
+ const n = B("FmChip"), d = B("FmForm"), f = B("FmButton"), a = B("FmSideSheet");
904
+ return F(), j(a, {
905
+ modelValue: P(b),
906
+ "onUpdate:modelValue": t[4] || (t[4] = (e) => ee(b) ? b.value = e : null),
907
+ header: "Update integration",
908
+ "dismiss-away": "",
909
+ "close-button": "",
910
+ "max-width": 500
911
+ }, {
912
+ default: I(() => [
913
+ c("div", lt, [
914
+ c("div", null, [
915
+ M(n, { label: "Menu v4" })
916
+ ]),
917
+ M(d, {
918
+ ref_key: "formRef",
919
+ ref: x,
920
+ onValidationSuccess: t[2] || (t[2] = (e) => h())
921
+ }, {
922
+ default: I(() => [
923
+ M(W, {
924
+ categories: s.categories,
925
+ variants: s.variants,
926
+ bindings: V.value,
927
+ menus: $.value,
928
+ "onUpdate:bindings": t[0] || (t[0] = (e) => y(e))
929
+ }, null, 8, ["categories", "variants", "bindings", "menus"]),
930
+ M(W, {
931
+ "is-addon": !0,
932
+ categories: [],
933
+ variants: s.variants,
934
+ bindings: H.value,
935
+ menus: u.value,
936
+ "onUpdate:bindings": t[1] || (t[1] = (e) => g(e))
937
+ }, null, 8, ["variants", "bindings", "menus"])
938
+ ]),
939
+ _: 1
940
+ }, 512)
941
+ ])
942
+ ]),
943
+ "side-sheet-footer": I(() => [
944
+ M(f, {
945
+ loading: s.loading,
946
+ type: "submit",
947
+ label: "Submit",
948
+ onClick: t[3] || (t[3] = (e) => C())
949
+ }, null, 8, ["loading"])
950
+ ]),
951
+ _: 1
952
+ }, 8, ["modelValue"]);
953
+ };
954
+ }
955
+ }), T = D(0);
956
+ function le() {
957
+ T.value = window.innerWidth;
958
+ }
959
+ const J = {
960
+ sm: 640,
961
+ md: 768,
962
+ lg: 1024,
963
+ xl: 1280,
964
+ "2xl": 1536
965
+ };
966
+ le();
967
+ window.addEventListener("resize", le);
968
+ function at() {
969
+ const _ = L(() => {
970
+ const o = T.value;
971
+ return Object.entries(J).reduce(
972
+ (p, [l, u]) => (p[l] = o >= u, p),
973
+ {}
974
+ );
975
+ }), v = L(() => {
976
+ const o = T.value;
977
+ return Object.entries(J).reduce(
978
+ (p, [l, u]) => (p[l] = o <= u, p),
979
+ {}
980
+ );
981
+ });
982
+ return {
983
+ get min() {
984
+ return P(_);
985
+ },
986
+ get max() {
987
+ return P(v);
988
+ },
989
+ get width() {
990
+ return P(T);
991
+ }
992
+ };
993
+ }
994
+ const dt = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, ut = { class: "px-8 flex gap-8 items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, ct = { class: "xs:w-full sm:w-full flex gap-8 items-center overflow-x-auto no-scrollbar py-8" }, ft = /* @__PURE__ */ c("div", { class: "h-32" }, null, -1), mt = { key: 0 }, pt = {
995
+ key: 1,
996
+ class: "flex flex-col items-center my-10 gap-5"
997
+ }, gt = ["src"], vt = /* @__PURE__ */ c("div", { class: "font-bold text-lg" }, "Integration", -1), bt = /* @__PURE__ */ c("div", {
998
+ class: "text-xs text-neutral-400 text-center",
999
+ style: { "max-width": "25rem" }
1000
+ }, " Add third party extension to help you manage, optimize, and expand your work. ", -1), yt = { key: 2 }, ht = { class: "flex justify-center" }, _t = ["src"], Ct = /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2" }, [
1001
+ /* @__PURE__ */ c("div", { class: "text-lg font-bold" }, "Food Market Hub"),
1002
+ /* @__PURE__ */ c("div", { class: "text-fm-color-neutral-gray-300" }, "Setup your FMH integration here.")
1003
+ ], -1), xt = { key: 0 }, At = /* @__PURE__ */ E({
1004
+ __name: "IntegrationView",
1005
+ setup(_) {
1006
+ const v = we(), o = _e(), p = ye(), l = D(!1), u = D(), H = D(), $ = D(), V = D(), y = D(), g = L(() => {
1007
+ var f;
1008
+ return ((f = y.value) == null ? void 0 : f.enable) ?? !1;
1009
+ }), x = be(), b = L(() => {
1010
+ var f;
1011
+ return (f = v.currentBusiness.value) == null ? void 0 : f.menuVersion;
1012
+ });
1013
+ p.watchLocation(C);
1014
+ async function C(f) {
1015
+ var a, e, i, r;
1016
+ if (!f) {
1017
+ const m = {
1018
+ _id: "",
1019
+ enable: !1,
1020
+ bindings: [],
1021
+ uniqueCode: "",
1022
+ branchCode: "",
1023
+ server: {
1024
+ password: "",
1025
+ host: "",
1026
+ username: "",
1027
+ port: "",
1028
+ directory: ""
1029
+ },
1030
+ histories: [],
1031
+ modifiers: [],
1032
+ exportAsJson: !1
1033
+ };
1034
+ y.value = m;
1035
+ return;
1036
+ }
1037
+ l.value = !0;
1038
+ try {
1039
+ const m = await x.readMenu();
1040
+ u.value = ((a = m.modules) == null ? void 0 : a.item) ?? [], H.value = ((e = m.modules) == null ? void 0 : e.group) ?? [], $.value = ((i = m.modules) == null ? void 0 : i.variant) ?? [];
1041
+ const k = (((r = m.modules) == null ? void 0 : r.category) ?? []).map((A) => ({
1042
+ ...A,
1043
+ _id: A._id === void 0 ? null : A._id
1044
+ }));
1045
+ V.value = k, y.value = await x.readSetting();
1046
+ } catch (m) {
1047
+ o.open({
1048
+ title: "Something went wrong",
1049
+ message: "Cannot fetch integration info. Please try again.",
1050
+ type: "error"
1051
+ }), console.error("Error at fetching integration info", m);
1052
+ } finally {
1053
+ l.value = !1;
1054
+ }
1055
+ }
1056
+ const h = D(!1);
1057
+ async function s() {
1058
+ h.value = !0;
1059
+ }
1060
+ const t = at(), n = L(() => t.max.sm);
1061
+ async function d() {
1062
+ const f = y.value;
1063
+ if (f) {
1064
+ l.value = !0;
1065
+ try {
1066
+ await x.updateSetting(f), o.open({
1067
+ title: "Success",
1068
+ message: "Your changes has been saved",
1069
+ type: "success"
1070
+ }), h.value = !1, await C(p.currentLocation);
1071
+ return;
1072
+ } catch (a) {
1073
+ o.open({
1074
+ title: "Something went wrong",
1075
+ message: "Cannot update integration info. Please try again.",
1076
+ type: "error"
1077
+ }), console.error("Error at updating integration info", a);
1078
+ } finally {
1079
+ l.value = !1;
1080
+ }
1081
+ }
1082
+ }
1083
+ return (f, a) => {
1084
+ const e = B("FmCircularProgress"), i = B("FmCardSection"), r = B("FmCard");
1085
+ return F(), j(Ce, { title: "Integration" }, {
1086
+ default: I(() => [
1087
+ c("div", dt, [
1088
+ c("div", ut, [
1089
+ c("div", ct, [
1090
+ M(xe),
1091
+ ft
1092
+ ])
1093
+ ]),
1094
+ !P(p)._currentLocation || l.value ? (F(), S("div", mt, [
1095
+ M(e, { size: "lg" })
1096
+ ])) : g.value ? (F(), S("div", yt, [
1097
+ M(r, {
1098
+ class: R({
1099
+ "w-full": n.value,
1100
+ "w-1/2": !n.value,
1101
+ border: !0,
1102
+ "border-fm-color-neutral-gray-100": !0,
1103
+ "cursor-pointer": !0,
1104
+ "hover:border-fm-color-primary": !0
1105
+ }),
1106
+ onClick: a[0] || (a[0] = (m) => s())
1107
+ }, {
1108
+ default: I(() => [
1109
+ M(i, null, {
1110
+ default: I(() => [
1111
+ c("div", ht, [
1112
+ c("img", {
1113
+ src: P(He),
1114
+ alt: "Food Market Hub"
1115
+ }, null, 8, _t)
1116
+ ]),
1117
+ Ct
1118
+ ]),
1119
+ _: 1
1120
+ })
1121
+ ]),
1122
+ _: 1
1123
+ }, 8, ["class"])
1124
+ ])) : (F(), S("div", pt, [
1125
+ c("div", null, [
1126
+ c("img", {
1127
+ src: P(ge),
1128
+ alt: "List is empty"
1129
+ }, null, 8, gt)
1130
+ ]),
1131
+ vt,
1132
+ bt
1133
+ ]))
1134
+ ]),
1135
+ y.value ? (F(), S("div", xt, [
1136
+ (F(), j(pe, { to: "body" }, [
1137
+ b.value === "v3" ? (F(), j(st, {
1138
+ key: 0,
1139
+ menus: u.value,
1140
+ variants: $.value,
1141
+ categories: V.value,
1142
+ setting: y.value,
1143
+ "onUpdate:setting": a[1] || (a[1] = (m) => y.value = m),
1144
+ show: h.value,
1145
+ "onUpdate:show": a[2] || (a[2] = (m) => h.value = m),
1146
+ groups: H.value,
1147
+ loading: l.value,
1148
+ onSubmit: a[3] || (a[3] = (m) => d())
1149
+ }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"])) : (F(), j(rt, {
1150
+ key: 1,
1151
+ menus: u.value,
1152
+ variants: $.value,
1153
+ categories: V.value,
1154
+ setting: y.value,
1155
+ "onUpdate:setting": a[4] || (a[4] = (m) => y.value = m),
1156
+ show: h.value,
1157
+ "onUpdate:show": a[5] || (a[5] = (m) => h.value = m),
1158
+ groups: H.value,
1159
+ loading: l.value,
1160
+ onSubmit: a[6] || (a[6] = (m) => d())
1161
+ }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"]))
1162
+ ]))
1163
+ ])) : O("", !0)
1164
+ ]),
1165
+ _: 1
1166
+ });
1167
+ };
1168
+ }
1169
+ });
1170
+ export {
1171
+ At as default
1172
+ };