@feedmepos/mf-inventory-portal 1.8.0-dev.14 → 1.8.0-dev.16

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 (136) hide show
  1. package/dist/{App-CzQWarWw.js → App-xSsyvQV_.js} +515 -536
  2. package/dist/{ApprovalView-DMNKR7wK.js → ApprovalView-DfJ0FAiD.js} +9 -9
  3. package/dist/{BindingsDialog-CxvJTu9s.js → BindingsDialog-oAZyjgrN.js} +2 -2
  4. package/dist/{BindingsPicker-AWSDYiBa.js → BindingsPicker-CEIo7myR.js} +8 -8
  5. package/dist/{BindingsTable-JkouRY4D.js → BindingsTable-BKa-JYRR.js} +4 -4
  6. package/dist/BulkReceiveRequestPage-C6Oyg5-E.js +2839 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CKiD86iq.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BvleQo5y.js} +1 -1
  8. package/dist/{ClosingDraftView-WgUrDT0l.js → ClosingDraftView-tJrjqyAC.js} +19 -19
  9. package/dist/{ClosingHistoryView-BXaFh_Rr.js → ClosingHistoryView-CJQlK4Xc.js} +7 -7
  10. package/dist/{ClosingTemplateView-xqSkU-RJ.js → ClosingTemplateView-DYRtdK5h.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-VUlMHb_3.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DEwi7wFf.js} +1 -1
  12. package/dist/{DefaultView-d0j4MbPH.js → DefaultView-CxTBlkln.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-ksFXHv4f.js → DeliveryOrderPrintPreview-Bywdjc2U.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-C8XVdGly.js → EmailDialog.vue_vue_type_script_setup_true_lang-DcFAUTdO.js} +38 -33
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-DTBcxB8e.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C8c6rmJv.js} +11 -10
  16. package/dist/FeatureCapabilityGate-B41dULfm.js +77 -0
  17. package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-D4G6i1D6.js +189 -0
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-2cESr8tE.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CnqH115V.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-sV1ZAWmY.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-QBviJzAO.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CGGNqDIn.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqHtzo20.js} +2 -2
  21. package/dist/{FmMultiselectDialog-NvS_JqaH.js → FmMultiselectDialog-CFNZMzlC.js} +2 -2
  22. package/dist/{FmMultiselectDialog-fKCMgcn6.js → FmMultiselectDialog-M6CvNFW1.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BZYyW6iC.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BGco50Ma.js} +5 -5
  24. package/dist/{ImportView-D-DqrgHA.js → ImportView-C2GOmpuK.js} +6 -6
  25. package/dist/{IngredientsView-gZ8iZciS.js → IngredientsView-wB9kGiOK.js} +15 -15
  26. package/dist/{IntegrationExplorerView-Bz-Tz2L9.js → IntegrationExplorerView-BujwGE4q.js} +1414 -1485
  27. package/dist/{IntegrationPlatformView-WnMM86kt.js → IntegrationPlatformView-Wnvj6-BG.js} +5331 -5028
  28. package/dist/{IntegrationView-CAJJmfis.js → IntegrationView-C77rSbpn.js} +14 -14
  29. package/dist/{InventoryBindingForm-C2Tp1u_B.js → InventoryBindingForm-Bs7Duwfj.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BH8O5C0v.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DawAEeuP.js} +4 -4
  31. package/dist/{InventoryBindingSummary-BrNst2ma.js → InventoryBindingSummary-BefkYWIr.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D_5jwx36.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BpUMK6fj.js} +2 -2
  33. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
  34. package/dist/{PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-CvXURft2.js → PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js} +1 -1
  35. package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
  36. package/dist/ProductionRunDetailPage-CVx9LS-P.js +2316 -0
  37. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-C9nqRuMd.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-4aYz5NwS.js} +1626 -1712
  38. package/dist/ProductionRunPage-CuXzmWMc.js +953 -0
  39. package/dist/{PublishView-CYIc_f14.js → PublishView-Bu8J6ndy.js} +3 -3
  40. package/dist/{PurchaseOrderPrintPreview-BPrGWnuA.js → PurchaseOrderPrintPreview-DaslFe8u.js} +2 -2
  41. package/dist/{ReceiveRequestView-DeyAASZ5.js → ReceiveRequestView-CKPBpN4x.js} +13 -13
  42. package/dist/{RecipeView-Ig8TlbZH.js → RecipeView-BeZ9ljtA.js} +15 -15
  43. package/dist/{SettingsView-CC5Jmu8c.js → SettingsView-CWhMdNfn.js} +10 -9
  44. package/dist/{StockView-DHUGj4mg.js → StockView-C5IhPGxi.js} +21 -21
  45. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DnFn9Agf.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B9Rx_9b7.js} +1 -1
  46. package/dist/{SupplierView-D1Xp7HM6.js → SupplierView-BSGajl9V.js} +13 -13
  47. package/dist/{SurchargeView-DtIlho7s.js → SurchargeView-DtAszxTN.js} +7 -7
  48. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Crb3A1_I.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CfxroS8u.js} +2 -2
  49. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BG1ubC4e.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CTj_jYK1.js} +1 -1
  50. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-B_9i5LzY.js +4900 -0
  51. package/dist/{TransferTemplateView-CmWURuLd.js → TransferTemplateView-D6_AfMja.js} +19 -19
  52. package/dist/{UnitCostHistoryView-DRGW-OrJ.js → UnitCostHistoryView-kisQehVE.js} +4 -4
  53. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-B81OEVLz.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DKoPNZoW.js} +4 -4
  54. package/dist/{UnitView-zDYaqm5D.js → UnitView-jSLennZW.js} +7 -7
  55. package/dist/{WarehouseView-DBCd2vjM.js → WarehouseView-CUdWJCMq.js} +8 -8
  56. package/dist/{WastageTemplateView-Bav8IIF6.js → WastageTemplateView--B0LSwHa.js} +15 -15
  57. package/dist/api/netsuite-explorer.d.ts +1 -0
  58. package/dist/{app-PyK-6tB0.js → app-Bb5HLWTu.js} +2041 -2045
  59. package/dist/app.d.ts +6 -6
  60. package/dist/app.js +1 -1
  61. package/dist/{closing-template-VFldhdBn.js → closing-template-CgDMayoo.js} +1 -1
  62. package/dist/components/FeatureCapabilityGate.vue.d.ts +2 -0
  63. package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
  64. package/dist/components/FeaturePageGate.spec.d.ts +1 -0
  65. package/dist/components/FeaturePageGate.vue.d.ts +34 -0
  66. package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
  67. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  68. package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
  69. package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
  70. package/dist/components/PremiumUpgradePage.vue.d.ts +2 -0
  71. package/dist/{date2-yujh-zNX.js → date2-D9gB9BE-.js} +1 -1
  72. package/dist/{dayjs.min-CV_1QtOH.js → dayjs.min-CumM_kH7.js} +1 -1
  73. package/dist/{decimal-D8CtprfB.js → decimal-CVF1rRoj.js} +2 -2
  74. package/dist/{defineDeepModel-C7pf41A8.js → defineDeepModel-DE-DsQjm.js} +1 -1
  75. package/dist/{duplicate-template-C9zx63wv.js → duplicate-template-CFYtQfQn.js} +1 -1
  76. package/dist/feature-flags/vue.d.ts +22 -1
  77. package/dist/{feature-XC9N9tdn.js → feature-kti8bU8q.js} +412 -346
  78. package/dist/{format-time-from-id-Dhbt_dm1.js → format-time-from-id-CWZ5VGvM.js} +1 -1
  79. package/dist/{format-unit-display-B7Uz9FY7.js → format-unit-display-BlxdvskN.js} +12 -12
  80. package/dist/{id-to-date-BSON0a4_.js → id-to-date-BaH_1Kui.js} +1 -1
  81. package/dist/{import-export.helper-BNCatkGG.js → import-export.helper-8rKrOB0E.js} +5 -5
  82. package/dist/{index-cVQR3Kk1.js → index-B9p_OEdk.js} +1 -1
  83. package/dist/{index-C6sBGx8j.js → index-BHc3cNyz.js} +3 -3
  84. package/dist/{index-CcvB5MN8.js → index-MEUJonBr.js} +1 -1
  85. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
  86. package/dist/{lz-string-jbv5KMfI.js → lz-string-IiazGN0W.js} +1 -1
  87. package/dist/{netsuite-BmyXyxHN.js → netsuite-BeDxaeKM.js} +2 -2
  88. package/dist/netsuite-explorer-4IluitzS.js +79 -0
  89. package/dist/{predefined-templates-Y9FBS3da.js → predefined-templates-D4qVID1q.js} +1 -1
  90. package/dist/{purchase-order-template-kpccxptg.js → purchase-order-template-GTOntq3C.js} +1 -1
  91. package/dist/{recalculationUtils-CQW3lPhm.js → recalculationUtils-Dye8x2TO.js} +1 -1
  92. package/dist/{row-action.enum-COTllbyK.js → row-action.enum-CVJbq_-y.js} +1 -1
  93. package/dist/{rules-kY8blQHT.js → rules-Y3zXVj3i.js} +3 -3
  94. package/dist/{stock-CCyBIj_s.js → stock-BIjTQFsR.js} +2 -2
  95. package/dist/{stock-CbUvnTcJ.js → stock-BR8x3nlx.js} +1 -1
  96. package/dist/stores/feature.d.ts +21 -1
  97. package/dist/stores/feature.load-state.spec.d.ts +1 -0
  98. package/dist/stores/warehouse.d.ts +1 -1
  99. package/dist/style.css +1 -1
  100. package/dist/{supplier-CR1Gy8T6.js → supplier-CbdCjiIB.js} +2 -2
  101. package/dist/{surcharge-ig3dYG2X.js → surcharge-BoXLK6o0.js} +1 -1
  102. package/dist/tsconfig.app.tsbuildinfo +1 -1
  103. package/dist/{uom-rules-D8R1q-3z.js → uom-rules-C5h1AoPJ.js} +1 -1
  104. package/dist/{use-ingredient-select-dialog-DVPfhAsz.js → use-ingredient-select-dialog-D196q_qk.js} +2 -2
  105. package/dist/{use-inventory-binding-dialog-DAepuYag.js → use-inventory-binding-dialog-B4IhhCjM.js} +2 -2
  106. package/dist/{use-template-enabled-locations-CM2dKs8u.js → use-template-enabled-locations-CDKP3kTS.js} +2 -2
  107. package/dist/{use-transfer-locations-C5TquwpD.js → use-transfer-locations-DE4vxSDp.js} +2 -2
  108. package/dist/{useHrmPermission-fAyejBrQ.js → useHrmPermission-D1dkveCP.js} +1 -1
  109. package/dist/{useNavigationMenu-D_2-vpQ_.js → useNavigationMenu-N5_7da8m.js} +39 -39
  110. package/dist/{useSseClient-CbZwkJYC.js → useSseClient-CKpNaz5g.js} +1 -1
  111. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
  112. package/dist/views/integration/IntegrationPlatformView.vue.d.ts +2 -0
  113. package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
  114. package/dist/views/production-run/ProductionRunDetailPage.vue.d.ts +15 -0
  115. package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
  116. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +11 -1
  117. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
  118. package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
  119. package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
  120. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
  121. package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
  122. package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
  123. package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
  124. package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
  125. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +6 -6
  126. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
  127. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  128. package/dist/{PlanTierBadge.vue_vue_type_script_setup_true_lang-DHh9jsto.js → vue-CxSKQOrZ.js} +84 -68
  129. package/dist/{vue-i18n-DhknAI0B.js → vue-i18n-CTR_IUvd.js} +568 -568
  130. package/dist/{xlsx.util-BHPeb50D.js → xlsx.util-J9pxGRQD.js} +2 -2
  131. package/package.json +3 -3
  132. package/dist/BulkReceiveRequestView-CsToXNOy.js +0 -2657
  133. package/dist/FeatureCapabilityGate-DSNY6YtI.js +0 -74
  134. package/dist/ProductionRunDetailView-m9bXSe76.js +0 -2312
  135. package/dist/ProductionRunView-CAdxSdol.js +0 -931
  136. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-yA9fCxzS.js +0 -4847
@@ -0,0 +1,953 @@
1
+ import { defineComponent as oe, computed as m, createElementBlock as k, createCommentVNode as H, openBlock as p, withModifiers as rt, createVNode as $, unref as r, ref as _, watch as ye, onMounted as Re, onBeforeUnmount as Ie, resolveComponent as ne, Fragment as J, createElementVNode as s, createTextVNode as ge, toDisplayString as b, withCtx as B, renderList as we, normalizeClass as ae, nextTick as st, watchEffect as wt, h as Q, createBlock as X, normalizeStyle as kt } from "vue";
2
+ import { _ as Rt, a as It } from "./FeaturePageGate.vue_vue_type_script_setup_true_lang-D4G6i1D6.js";
3
+ import { F as te } from "./index-eGvSlWMU.js";
4
+ import { useRouter as $t } from "vue-router";
5
+ import { useDialog as St, useSnackbar as At, useBreakpoints as Ct } from "@feedmepos/ui-library";
6
+ import { useI18n as ie, useCoreStore as Nt } from "@feedmepos/mf-common";
7
+ import { u as Ft, _ as Pt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
8
+ import { _ as Dt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
9
+ import { F as at } from "./FmAdminBadge-DlplQOHb.js";
10
+ import { _ as Tt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqHtzo20.js";
11
+ import { p as $e, a as Mt, i as ke, _ as zt, h as Lt, b as Vt, f as Ot, c as Et, d as it, e as qt, u as Ut, g as jt, j as Wt, P as Ht, m as Bt, k as Yt, l as Qt, n as Gt, o as xe, q as tt, r as nt, s as ot, t as Kt } from "./ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-4aYz5NwS.js";
12
+ import { u as Jt, a as Xt } from "./app-Bb5HLWTu.js";
13
+ import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
+ const Zt = /* @__PURE__ */ oe({
15
+ __name: "ProductionRunActionsCell",
16
+ props: {
17
+ run: {}
18
+ },
19
+ emits: ["action"],
20
+ setup(V, { emit: o }) {
21
+ const i = V, F = o, { t: c } = ie(), R = m(
22
+ () => $e(i.run, c("inventory.production.run.list.untitled"))
23
+ ), g = {
24
+ request: 0,
25
+ prepare: 0,
26
+ complete: 0,
27
+ update: 1,
28
+ close: 1,
29
+ cancel: 2
30
+ }, f = m(
31
+ () => Mt(i.run).filter(({ action: n }) => n !== "request" || i.run.plan.items.length > 0).sort((n, d) => ke(i.run) && n.action === "close" ? -1 : ke(i.run) && d.action === "close" ? 1 : g[n.action] - g[d.action]).map(({ action: n }) => n)
32
+ );
33
+ function w(n) {
34
+ return n === "complete" && Lt(i.run) ? c("inventory.production.run.detail.pendingStock.resume") : c(`inventory.production.run.list.rowActions.${n}`);
35
+ }
36
+ const l = m(
37
+ () => f.value.map((n) => ({
38
+ id: n,
39
+ label: w(n),
40
+ destructive: n === "cancel"
41
+ }))
42
+ );
43
+ function v(n) {
44
+ F("action", n);
45
+ }
46
+ return (n, d) => f.value.length ? (p(), k("div", {
47
+ key: 0,
48
+ class: "production-run-action-interactive relative flex items-center justify-center",
49
+ onClick: d[0] || (d[0] = rt(() => {
50
+ }, ["stop"]))
51
+ }, [
52
+ $(zt, {
53
+ items: l.value,
54
+ placement: "bottom-end",
55
+ "menu-testid": "run-actions-menu",
56
+ "accessible-label": r(c)("inventory.production.run.list.actionsFor", { name: R.value }),
57
+ onSelect: v
58
+ }, null, 8, ["items", "accessible-label"])
59
+ ])) : H("", !0);
60
+ }
61
+ }), en = ["id"], tn = {
62
+ key: 0,
63
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
64
+ }, nn = {
65
+ key: 1,
66
+ class: "production-run-items-interactive relative min-w-0"
67
+ }, on = { class: "min-w-0 overflow-hidden whitespace-nowrap" }, rn = {
68
+ key: 0,
69
+ class: "shrink-0",
70
+ "aria-hidden": "true"
71
+ }, sn = ["data-hidden-count"], an = ["aria-label"], ln = { class: "fm-typo-en-body-sm-600 mb-8 text-fm-color-typo-primary" }, un = { class: "flex flex-col gap-8 border-t border-fm-color-neutral-gray-100 pt-8" }, cn = { class: "text-fm-color-typo-primary" }, dn = { class: "shrink-0 text-fm-color-typo-secondary" };
72
+ let pn = 0;
73
+ const mn = /* @__PURE__ */ oe({
74
+ __name: "ProductionRunItemsCell",
75
+ props: {
76
+ run: {},
77
+ resolveSku: {},
78
+ rowLinkFocused: { type: Boolean, default: !1 },
79
+ descriptionId: {},
80
+ wrap: { type: Boolean, default: !1 }
81
+ },
82
+ setup(V) {
83
+ const o = V, { t: i } = ie(), F = _(!1), c = m(() => F.value || o.rowLinkFocused), R = _(null), g = _(null), f = _(null), w = _(Number.POSITIVE_INFINITY), l = _(!1), v = typeof navigator < "u" && /safari/i.test(navigator.userAgent) && !/(chrome|chromium|crios|android)/i.test(navigator.userAgent), n = ++pn, d = `production-run-items-tooltip-${n}`, T = `production-run-items-description-${n}`, P = m(() => o.descriptionId ?? T), u = 44;
84
+ let h = null, x = null, O = null, Y = !1;
85
+ const I = m(
86
+ () => o.run.plan.items.map((a, S) => {
87
+ const D = o.resolveSku(a.skuId), A = Vt(a.measurement) ? a.measurement : null, j = (A == null ? void 0 : A.abbrev) ?? null, W = Ot(a.requestedAmount, j, {
88
+ precision: a.requestedAmount.precision
89
+ });
90
+ return {
91
+ key: `${a.skuId}-${S}`,
92
+ name: (D == null ? void 0 : D.name) ?? a.skuId,
93
+ quantity: j ? W : `${W} · ${i("inventory.production.run.list.itemsUnitUnresolved")}`
94
+ };
95
+ })
96
+ ), z = m(() => I.value.slice(0, w.value)), G = m(() => I.value.map(({ name: a }) => a).join(", ")), E = m(() => z.value.map(({ name: a }) => a).join(", ")), L = m(
97
+ () => o.wrap ? 0 : Math.max(0, I.value.length - z.value.length)
98
+ ), Z = m(() => L.value > 99 ? "99+" : `+${L.value}`), _e = m(
99
+ () => I.value.map(({ name: a, quantity: S }) => `${a}: ${S}`).join(", ")
100
+ );
101
+ function be() {
102
+ if (o.wrap) {
103
+ w.value = I.value.length, l.value = !1;
104
+ return;
105
+ }
106
+ const a = g.value, S = f.value;
107
+ if (!a || !S || a.clientWidth <= 0) return;
108
+ const D = Array.from(S.children).map((q) => q.offsetWidth);
109
+ if (!D.length || D.reduce((q, ue) => q + ue, 0) <= a.clientWidth) {
110
+ w.value = I.value.length, l.value = !1;
111
+ return;
112
+ }
113
+ l.value = !0;
114
+ const A = Math.max(0, a.clientWidth - u);
115
+ let j = 0, W = 0;
116
+ for (const q of D) {
117
+ if (j + q > A) break;
118
+ j += q, W++;
119
+ }
120
+ w.value = Math.min(I.value.length, Math.max(1, W + 1));
121
+ }
122
+ function K() {
123
+ Y || (Y = !0, st(() => {
124
+ Y = !1, be();
125
+ }));
126
+ }
127
+ function re() {
128
+ h && (x !== g.value && (x && h.unobserve(x), x = g.value, x && h.observe(x)), O !== f.value && (O && h.unobserve(O), O = f.value, O && h.observe(O)), K());
129
+ }
130
+ ye(
131
+ () => I.value.map(({ name: a }) => a).join("\0"),
132
+ () => {
133
+ w.value = Number.POSITIVE_INFINITY, K();
134
+ },
135
+ { flush: "post" }
136
+ ), ye(
137
+ () => o.wrap,
138
+ () => {
139
+ w.value = Number.POSITIVE_INFINITY, K();
140
+ },
141
+ { flush: "post" }
142
+ ), ye([g, f], re, { flush: "post" }), Re(() => {
143
+ typeof ResizeObserver < "u" && (h = new ResizeObserver(K), re()), K();
144
+ }), Ie(() => h == null ? void 0 : h.disconnect());
145
+ function le(a) {
146
+ var S, D;
147
+ a !== c.value && (c.value ? (S = R.value) == null || S.show() : (D = R.value) == null || D.hide());
148
+ }
149
+ return (a, S) => {
150
+ const D = ne("FmPopover");
151
+ return p(), k(J, null, [
152
+ s("span", {
153
+ id: P.value,
154
+ "data-testid": "run-items-a11y-description",
155
+ class: "sr-only"
156
+ }, [
157
+ L.value ? (p(), k(J, { key: 0 }, [
158
+ ge(b(r(i)("inventory.production.run.list.itemsHidden", { count: L.value })) + ". ", 1)
159
+ ], 64)) : H("", !0),
160
+ ge(" " + b(I.value.length ? r(i)("inventory.production.run.list.itemsLabel", { names: _e.value }) : r(i)("inventory.production.run.list.itemsNone")), 1)
161
+ ], 8, en),
162
+ I.value.length === 0 ? (p(), k("span", tn, b(r(i)("inventory.production.run.list.itemsNone")), 1)) : (p(), k("div", nn, [
163
+ $(D, {
164
+ ref_key: "popover",
165
+ ref: R,
166
+ "show-popover": c.value,
167
+ placement: "bottom-start",
168
+ onPopoverChanged: le
169
+ }, {
170
+ "popover-button": B(() => [
171
+ s("div", {
172
+ ref_key: "disclosureContainer",
173
+ ref: g,
174
+ "data-testid": "items-disclosure-container",
175
+ class: ae(["flex w-full max-w-full min-w-0 gap-4 text-left", a.wrap ? "items-start overflow-visible" : "items-center overflow-hidden"]),
176
+ onMouseenter: S[0] || (S[0] = (A) => F.value = !0),
177
+ onMouseleave: S[1] || (S[1] = (A) => F.value = !1)
178
+ }, [
179
+ s("span", {
180
+ "data-testid": "run-items-summary",
181
+ class: ae([
182
+ "fm-typo-en-body-md-400 min-w-0 flex-1 text-fm-color-typo-primary",
183
+ a.wrap ? "whitespace-normal break-words" : r(v) ? "flex overflow-hidden whitespace-nowrap" : "truncate"
184
+ ])
185
+ }, [
186
+ r(v) && !a.wrap ? (p(), k(J, { key: 0 }, [
187
+ s("span", on, b(E.value), 1),
188
+ l.value ? (p(), k("span", rn, "…")) : H("", !0)
189
+ ], 64)) : (p(), k(J, { key: 1 }, [
190
+ ge(b(G.value), 1)
191
+ ], 64))
192
+ ], 2),
193
+ L.value ? (p(), k("span", {
194
+ key: 0,
195
+ "data-testid": "run-items-overflow",
196
+ "data-hidden-count": L.value,
197
+ "data-production-info-size": "sm",
198
+ "aria-hidden": "true",
199
+ class: "inline-flex h-[20px] shrink-0 items-center justify-center whitespace-nowrap rounded-full bg-fm-color-neutral-gray-100 px-[8px] text-[12px] font-normal leading-[18px] text-fm-color-typo-primary"
200
+ }, b(Z.value), 9, sn)) : H("", !0),
201
+ s("span", {
202
+ ref_key: "measureRail",
203
+ ref: f,
204
+ "data-testid": "run-items-measure",
205
+ "aria-hidden": "true",
206
+ class: "fm-typo-en-body-md-400 pointer-events-none invisible absolute w-max whitespace-nowrap"
207
+ }, [
208
+ (p(!0), k(J, null, we(I.value, (A, j) => (p(), k("span", {
209
+ key: A.key,
210
+ "data-testid": "run-item-measure"
211
+ }, b(j ? `, ${A.name}` : A.name), 1))), 128))
212
+ ], 512)
213
+ ], 34)
214
+ ]),
215
+ default: B(() => [
216
+ s("div", {
217
+ id: d,
218
+ "data-testid": "run-items-disclosure",
219
+ role: "tooltip",
220
+ "aria-label": r(i)("inventory.production.run.list.itemsDisclosure"),
221
+ class: "pointer-events-none min-w-[288px] p-12"
222
+ }, [
223
+ s("h3", ln, b(r(i)("inventory.production.run.list.itemsCount", { count: I.value.length })), 1),
224
+ s("ul", un, [
225
+ (p(!0), k(J, null, we(I.value, (A) => (p(), k("li", {
226
+ key: A.key,
227
+ class: "fm-typo-en-body-sm-400 flex items-start justify-between gap-16"
228
+ }, [
229
+ s("span", cn, b(A.name), 1),
230
+ s("span", dn, b(A.quantity), 1)
231
+ ]))), 128))
232
+ ])
233
+ ], 8, an)
234
+ ]),
235
+ _: 1
236
+ }, 8, ["show-popover"])
237
+ ]))
238
+ ], 64);
239
+ };
240
+ }
241
+ }), vn = ["href", "aria-describedby"], fn = /* @__PURE__ */ oe({
242
+ __name: "ProductionRunNameCell",
243
+ props: {
244
+ name: {},
245
+ href: {},
246
+ descriptionId: {},
247
+ wrap: { type: Boolean, default: !1 }
248
+ },
249
+ emits: ["open", "focus", "blur"],
250
+ setup(V, { emit: o }) {
251
+ const i = V, F = o, c = _(null), R = _(!1);
252
+ let g = null, f = !1;
253
+ function w() {
254
+ const n = c.value;
255
+ R.value = !i.wrap && !!n && n.scrollWidth > n.clientWidth;
256
+ }
257
+ function l() {
258
+ f || (f = !0, st(() => {
259
+ f = !1, w();
260
+ }));
261
+ }
262
+ ye(() => [i.name, i.wrap], l, { flush: "post" }), Re(() => {
263
+ typeof ResizeObserver < "u" && c.value && (g = new ResizeObserver(l), g.observe(c.value)), l();
264
+ }), Ie(() => g == null ? void 0 : g.disconnect());
265
+ function v(n) {
266
+ n.preventDefault(), n.stopPropagation(), F("open");
267
+ }
268
+ return (n, d) => {
269
+ const T = ne("FmTooltip");
270
+ return p(), k("a", {
271
+ href: n.href,
272
+ "aria-describedby": n.descriptionId,
273
+ class: "production-run-row-link fm-typo-en-body-md-600 block min-w-0 max-w-full text-left text-fm-color-typo-primary",
274
+ onClick: v,
275
+ onFocus: d[0] || (d[0] = (P) => F("focus")),
276
+ onBlur: d[1] || (d[1] = (P) => F("blur"))
277
+ }, [
278
+ $(T, {
279
+ content: n.name,
280
+ disabled: !R.value,
281
+ placement: "top",
282
+ "z-index": 51,
283
+ "content-class": "production-run-name-tooltip-reference"
284
+ }, {
285
+ default: B(() => [
286
+ s("span", {
287
+ ref_key: "label",
288
+ ref: c,
289
+ "data-testid": "run-name-label",
290
+ class: ae(["block min-w-0", n.wrap ? "whitespace-normal break-words" : "truncate"])
291
+ }, b(n.name), 3)
292
+ ]),
293
+ _: 1
294
+ }, 8, ["content", "disabled"])
295
+ ], 40, vn);
296
+ };
297
+ }
298
+ }), yn = /* @__PURE__ */ lt(fn, [["__scopeId", "data-v-4d06048a"]]), _n = ["aria-label"], bn = { class: "min-w-0 truncate" }, hn = /* @__PURE__ */ oe({
299
+ __name: "ProductionRunSortHeader",
300
+ props: {
301
+ columnId: {},
302
+ label: {},
303
+ activeColumnId: {},
304
+ descending: { type: Boolean }
305
+ },
306
+ emits: ["toggle"],
307
+ setup(V, { emit: o }) {
308
+ const i = V, F = o, { t: c } = ie(), R = m(() => i.activeColumnId === i.columnId), g = m(
309
+ () => R.value ? c(`inventory.production.run.list.sort.${i.descending ? "descending" : "ascending"}`) : c("inventory.production.run.list.sort.unsorted")
310
+ ), f = m(
311
+ () => R.value ? i.descending ? "arrow_downward" : "arrow_upward" : "unfold_more"
312
+ ), w = m(
313
+ () => c("inventory.production.run.list.sort.label", {
314
+ column: i.label,
315
+ direction: g.value
316
+ })
317
+ ), l = _(null), v = _(null);
318
+ return Re(() => {
319
+ var n;
320
+ v.value = ((n = l.value) == null ? void 0 : n.closest("th")) ?? null;
321
+ }), wt(() => {
322
+ v.value && v.value.setAttribute(
323
+ "aria-sort",
324
+ R.value ? i.descending ? "descending" : "ascending" : "none"
325
+ );
326
+ }), Ie(() => {
327
+ var n;
328
+ return (n = v.value) == null ? void 0 : n.removeAttribute("aria-sort");
329
+ }), (n, d) => {
330
+ const T = ne("FmIcon");
331
+ return p(), k("button", {
332
+ ref_key: "button",
333
+ ref: l,
334
+ type: "button",
335
+ class: "production-run-sort-header flex h-[35px] w-full items-center gap-4 px-16 text-left fm-typo-en-body-md-600 text-fm-color-typo-secondary hover:text-fm-color-typo-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-fm-color-primary",
336
+ "aria-label": w.value,
337
+ onClick: d[0] || (d[0] = rt((P) => F("toggle", n.columnId), ["stop"]))
338
+ }, [
339
+ s("span", bn, b(n.label), 1),
340
+ $(T, {
341
+ name: f.value,
342
+ size: "sm",
343
+ "aria-hidden": "true",
344
+ class: "shrink-0"
345
+ }, null, 8, ["name"])
346
+ ], 8, _n);
347
+ };
348
+ }
349
+ });
350
+ let gn = 0;
351
+ function xn(V, o = () => null, i = () => {
352
+ }, F = () => {
353
+ }, c = () => {
354
+ }, R = () => !1, g = (f) => `/production-run/${encodeURIComponent(f._id)}`) {
355
+ var P;
356
+ const { t: f } = ie(), w = Nt(), l = ++gn, v = _(null), n = (u) => `production-run-table-${l}-items-${encodeURIComponent(u._id)}`, d = (u, h) => {
357
+ const x = F();
358
+ return Q(hn, {
359
+ columnId: u,
360
+ label: h,
361
+ activeColumnId: x == null ? void 0 : x.id,
362
+ descending: x == null ? void 0 : x.desc,
363
+ onToggle: c
364
+ });
365
+ };
366
+ return { columnDefs: [
367
+ {
368
+ id: "runNo",
369
+ header: () => d("runNo", "#"),
370
+ enableSorting: !1,
371
+ size: 80,
372
+ meta: { headerClass: "p-0" },
373
+ cell: (u) => Q(
374
+ "span",
375
+ { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" },
376
+ `${u.row.original.runNo}`
377
+ )
378
+ },
379
+ {
380
+ id: "name",
381
+ header: () => d("name", f("inventory.production.run.list.columns.name")),
382
+ enableSorting: !1,
383
+ minSize: 240,
384
+ size: 320,
385
+ maxSize: 320,
386
+ meta: { headerClass: "p-0" },
387
+ cell: (u) => Q(yn, {
388
+ name: $e(
389
+ u.row.original,
390
+ f("inventory.production.run.list.untitled")
391
+ ),
392
+ href: g(u.row.original),
393
+ descriptionId: n(u.row.original),
394
+ wrap: R(),
395
+ onOpen: () => i(u.row.original),
396
+ onFocus: () => {
397
+ v.value = u.row.original._id;
398
+ },
399
+ onBlur: () => {
400
+ v.value === u.row.original._id && (v.value = null);
401
+ }
402
+ })
403
+ },
404
+ {
405
+ id: "items",
406
+ header: () => f("inventory.production.run.list.columns.items"),
407
+ enableSorting: !1,
408
+ minSize: 220,
409
+ size: 280,
410
+ maxSize: 280,
411
+ cell: (u) => Q(mn, {
412
+ run: u.row.original,
413
+ resolveSku: o,
414
+ descriptionId: n(u.row.original),
415
+ wrap: R(),
416
+ rowLinkFocused: v.value === u.row.original._id
417
+ })
418
+ },
419
+ ...(P = w.sessionUser.value) != null && P.role.isAdmin ? [
420
+ {
421
+ id: "statusForAdmin",
422
+ header: () => Q(at, {}, () => f("inventory.production.run.list.columns.status")),
423
+ cell: (u) => u.row.original.status,
424
+ enableSorting: !1,
425
+ size: 120
426
+ }
427
+ ] : [],
428
+ {
429
+ id: "status",
430
+ header: () => d("status", f("inventory.production.run.list.columns.status")),
431
+ enableSorting: !1,
432
+ size: 120,
433
+ meta: { headerClass: "p-0" },
434
+ cell: (u) => Q(Et, { status: u.row.original.status })
435
+ },
436
+ {
437
+ id: "updatedAt",
438
+ header: () => d("updatedAt", f("inventory.production.run.list.columns.updated")),
439
+ enableSorting: !1,
440
+ minSize: 180,
441
+ size: 200,
442
+ maxSize: 200,
443
+ meta: { headerClass: "p-0" },
444
+ cell: (u) => {
445
+ const h = u.row.original, x = it(h);
446
+ return Q(
447
+ "span",
448
+ { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary whitespace-nowrap" },
449
+ qt((x == null ? void 0 : x.at) ?? h.createdAt)
450
+ );
451
+ }
452
+ },
453
+ {
454
+ id: "action",
455
+ header: "",
456
+ enableSorting: !1,
457
+ cell: (u) => Q(Zt, {
458
+ run: u.row.original,
459
+ onAction: (h) => V(h, u.row.original)
460
+ }),
461
+ size: 40,
462
+ meta: {
463
+ cellClass: "",
464
+ headerClass: ""
465
+ }
466
+ }
467
+ ] };
468
+ }
469
+ const wn = { class: "sr-only" }, kn = ["aria-label"], Rn = {
470
+ key: 0,
471
+ "data-testid": "production-run-history-scope",
472
+ class: "flex shrink-0 flex-wrap items-center justify-between gap-8"
473
+ }, In = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, $n = {
474
+ key: 1,
475
+ role: "alert",
476
+ class: "w-full fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
477
+ }, Sn = ["aria-label"], An = ["aria-label"], Cn = {
478
+ key: 2,
479
+ "data-testid": "production-run-list-empty",
480
+ class: "rounded-md border border-dashed border-fm-color-neutral-gray-200 p-48 text-center"
481
+ }, Nn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Fn = { class: "mx-auto mt-4 max-w-[25rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pn = {
482
+ key: 3,
483
+ "data-testid": "production-run-list-no-match",
484
+ class: "rounded-md border border-dashed border-fm-color-neutral-gray-200 p-40 text-center"
485
+ }, Dn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Tn = { class: "mx-auto mt-4 max-w-[25rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mn = { class: "flex flex-col gap-[8px] py-[8px]" }, zn = {
486
+ "data-testid": "production-run-mobile-run-number",
487
+ class: "flex items-center gap-[4px]"
488
+ }, Ln = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, Vn = { class: "flex min-w-0 flex-col gap-[2px]" }, On = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, En = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, qn = { class: "flex min-w-0 flex-col gap-[2px]" }, Un = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, jn = {
489
+ "data-testid": "production-run-admin-status",
490
+ class: "flex flex-col gap-[4px]"
491
+ }, Wn = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, Hn = { class: "flex flex-col gap-[2px]" }, Bn = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, Yn = { class: "flex flex-col gap-[2px]" }, Qn = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, Gn = /* @__PURE__ */ oe({
492
+ __name: "ProductionRunView",
493
+ setup(V) {
494
+ const { t: o } = ie(), i = $t(), F = St(), c = At(), R = Ut(), g = Jt(), f = Xt(), w = Ft();
495
+ jt();
496
+ const l = _([]), v = _(!1), n = _(null), d = _(null), T = _(!1), P = _(null), u = m(() => ({
497
+ loading: v.value || T.value,
498
+ loaded: !v.value && !n.value,
499
+ hasMore: d.value !== null,
500
+ error: P.value ?? n.value
501
+ })), h = _(""), x = _("all"), O = _([{ id: "updatedAt", desc: !0 }]), Y = _(!1), I = _(null), z = _(null), G = _(null);
502
+ let E = 0, L = 0;
503
+ const Z = m(
504
+ () => l.value.find((e) => e._id === z.value) ?? null
505
+ ), _e = Wt(() => Z.value), be = m(() => !!Z.value && ke(Z.value)), K = m(
506
+ () => _e.ingredientLines.value.map((e) => ({
507
+ skuId: e.skuId,
508
+ name: e.name,
509
+ unit: e.unit,
510
+ unitRef: e.unitRef,
511
+ outputSkuIds: e.outputSkuIds
512
+ }))
513
+ );
514
+ function re() {
515
+ return n.value ? a() : S();
516
+ }
517
+ function le() {
518
+ L++, G.value = null, z.value = null, I.value = null, Y.value = !1;
519
+ }
520
+ async function a() {
521
+ const e = ++E;
522
+ v.value = !0, n.value = null, d.value = null, T.value = !1, P.value = null;
523
+ try {
524
+ const t = await R.list();
525
+ if (e !== E) return;
526
+ l.value = t.items, d.value = t.nextCursor;
527
+ } catch (t) {
528
+ if (e !== E) return;
529
+ const y = xe(t);
530
+ n.value = y.message, c == null || c.open({
531
+ title: o("inventory.production.run.list.error.load"),
532
+ message: y.message,
533
+ type: "error"
534
+ });
535
+ } finally {
536
+ e === E && (v.value = !1);
537
+ }
538
+ }
539
+ async function S() {
540
+ const e = d.value;
541
+ if (!e || v.value || T.value) return;
542
+ const t = E;
543
+ T.value = !0, P.value = null;
544
+ try {
545
+ const y = await R.list({ cursor: e });
546
+ if (t !== E || e !== d.value) return;
547
+ if (y.nextCursor === e)
548
+ throw new Error(o("inventory.production.run.list.history.cursorError"));
549
+ const C = new Set(l.value.map((U) => U._id));
550
+ l.value = [...l.value, ...y.items.filter((U) => !C.has(U._id))], d.value = y.nextCursor;
551
+ } catch (y) {
552
+ t === E && (P.value = xe(y).message);
553
+ } finally {
554
+ t === E && (T.value = !1);
555
+ }
556
+ }
557
+ let D;
558
+ g.watchLocation(async () => {
559
+ var t;
560
+ const e = ((t = g._currentLocation) == null ? void 0 : t.dbName) ?? null;
561
+ if (e !== D) {
562
+ if (D = e, le(), !e) {
563
+ E++, l.value = [];
564
+ return;
565
+ }
566
+ await a();
567
+ }
568
+ });
569
+ const A = m(
570
+ () => Ht.map((e) => ({
571
+ label: o(`inventory.production.run.list.tabs.${e.key}`),
572
+ value: e.key
573
+ }))
574
+ );
575
+ function j(e) {
576
+ var t;
577
+ return ((t = it(e)) == null ? void 0 : t.at) ?? e.createdAt;
578
+ }
579
+ function W(e, t, y) {
580
+ switch (y) {
581
+ case "runNo":
582
+ return e.runNo - t.runNo;
583
+ case "name":
584
+ return nt(e).localeCompare(nt(t));
585
+ case "status":
586
+ return tt(e.status) - tt(t.status);
587
+ case "updatedAt":
588
+ return Date.parse(j(e)) - Date.parse(j(t));
589
+ default:
590
+ return 0;
591
+ }
592
+ }
593
+ const q = m(() => {
594
+ const e = l.value.filter(
595
+ (C) => Bt(C, x.value) && Yt(C, h.value, Se)
596
+ ), t = O.value[0];
597
+ if (!t)
598
+ return e.sort(
599
+ (C, U) => W(U, C, "updatedAt") || W(U, C, "runNo")
600
+ );
601
+ const y = t.desc ? -1 : 1;
602
+ return e.sort(
603
+ (C, U) => y * W(C, U, t.id) || W(U, C, "runNo")
604
+ );
605
+ }), { breakpoints: ue } = Ct(), ee = m(() => ue.value.xs || ue.value.sm), ut = m(() => ee.value ? 10 : 20), ct = m(() => ee.value ? { height: `calc(${w.tableHeight.height} - 16px)` } : w.tableHeight), dt = m(
606
+ () => ee.value ? q.value.map((e) => `${e._id}:${e._rev}`).join("|") : "desktop"
607
+ );
608
+ function pt() {
609
+ h.value = "", x.value = "all";
610
+ }
611
+ function mt(e) {
612
+ const t = O.value[0];
613
+ O.value = [
614
+ (t == null ? void 0 : t.id) === e ? { id: e, desc: !t.desc } : { id: e, desc: !1 }
615
+ ];
616
+ }
617
+ function Se(e) {
618
+ return f.skuById[e];
619
+ }
620
+ function he(e) {
621
+ i.push(ot(e._id));
622
+ }
623
+ function vt(e) {
624
+ return i.resolve(ot(e._id)).href;
625
+ }
626
+ function ft(e, t) {
627
+ const y = ++L;
628
+ if (z.value = t._id, G.value = null, e === "request") {
629
+ F.open(Kt(o)).onPrimary(() => void yt(t._id, y));
630
+ return;
631
+ }
632
+ G.value = e;
633
+ }
634
+ async function yt(e, t) {
635
+ if (!(t !== L || z.value !== e))
636
+ try {
637
+ const y = await R.request(e);
638
+ if (t !== L || z.value !== e || !Ae(y)) return;
639
+ c == null || c.open({
640
+ title: o("inventory.production.run.list.request.success"),
641
+ message: o("inventory.production.run.list.request.successMessage", {
642
+ name: $e(y, o("inventory.production.run.list.untitled"))
643
+ }),
644
+ type: "success"
645
+ }), z.value = null;
646
+ } catch (y) {
647
+ if (t !== L || z.value !== e) return;
648
+ c == null || c.open({
649
+ title: o("inventory.production.run.list.error.action", {
650
+ action: o("inventory.production.run.list.rowActions.request")
651
+ }),
652
+ message: xe(y).message,
653
+ type: "error"
654
+ });
655
+ }
656
+ }
657
+ function Ae(e) {
658
+ const t = l.value.findIndex((C) => C._id === e._id);
659
+ if (t < 0) return !1;
660
+ const y = [...l.value];
661
+ return y[t] = e, l.value = y, !0;
662
+ }
663
+ function se(e) {
664
+ z.value === e._id && Ae(e);
665
+ }
666
+ function _t(e) {
667
+ e === null && (G.value = null, z.value = null);
668
+ }
669
+ function bt() {
670
+ le(), a();
671
+ }
672
+ const { columnDefs: ht } = xn(
673
+ ft,
674
+ Se,
675
+ he,
676
+ () => O.value[0],
677
+ mt,
678
+ () => ee.value,
679
+ vt
680
+ );
681
+ function Ce(e) {
682
+ e === "refresh" && a(), e === "create" && (I.value = null, Y.value = !0);
683
+ }
684
+ const gt = m(() => [
685
+ {
686
+ label: o("inventory.common.refresh"),
687
+ value: "refresh",
688
+ prependIcon: "refresh"
689
+ },
690
+ {
691
+ label: o("inventory.production.run.list.actions.create"),
692
+ value: "create",
693
+ prependIcon: "add",
694
+ testId: "production-run-mobile-create",
695
+ isPrimary: !0
696
+ }
697
+ ]);
698
+ function xt() {
699
+ I.value = null, a();
700
+ }
701
+ return (e, t) => {
702
+ const y = ne("FmTabs"), C = ne("FmButton"), U = ne("FmTable");
703
+ return p(), X(Pt, {
704
+ title: r(o)("inventory.production.run.list.title"),
705
+ "helper-text": r(o)("inventory.production.run.list.caption"),
706
+ actions: gt.value,
707
+ "onClick:action": Ce
708
+ }, {
709
+ default: B(() => {
710
+ var Ne;
711
+ return [
712
+ s("div", {
713
+ "data-testid": "production-run-list-content",
714
+ class: ae([
715
+ "flex w-full max-h-full flex-col gap-12",
716
+ {
717
+ "p-0": ee.value,
718
+ "px-24": !ee.value
719
+ }
720
+ ])
721
+ }, [
722
+ s("h1", wn, b(r(o)("inventory.production.run.list.title")), 1),
723
+ $(Tt, {
724
+ "change-location": "",
725
+ searchable: "",
726
+ search: h.value,
727
+ "onUpdate:search": t[0] || (t[0] = (N) => h.value = N)
728
+ }, null, 8, ["search"]),
729
+ s("div", {
730
+ class: "flex min-w-0 shrink-0 flex-col gap-12",
731
+ "data-testid": "production-run-list-controls",
732
+ onVnodeMounted: t[2] || (t[2] = //@ts-ignore
733
+ (...N) => r(w).onMounted && r(w).onMounted(...N)),
734
+ onVnodeUnmounted: t[3] || (t[3] = //@ts-ignore
735
+ (...N) => r(w).onUnmounted && r(w).onUnmounted(...N))
736
+ }, [
737
+ s("nav", {
738
+ class: "min-w-0 overflow-x-auto",
739
+ "aria-label": r(o)("inventory.production.run.list.tabsLabel")
740
+ }, [
741
+ $(y, {
742
+ "model-value": x.value,
743
+ "onUpdate:modelValue": t[1] || (t[1] = (N) => x.value = N),
744
+ items: A.value
745
+ }, null, 8, ["model-value", "items"])
746
+ ], 8, kn),
747
+ !v.value && !n.value && (d.value || P.value) ? (p(), k("div", Rn, [
748
+ s("p", In, b(r(o)("inventory.production.run.list.history.scope", { count: l.value.length })), 1),
749
+ d.value ? (p(), X(C, {
750
+ key: 0,
751
+ "data-testid": "production-run-load-more",
752
+ variant: "secondary",
753
+ label: r(o)("inventory.production.run.list.history.loadMore"),
754
+ loading: T.value,
755
+ disabled: T.value,
756
+ onClick: S
757
+ }, null, 8, ["label", "loading", "disabled"])) : H("", !0),
758
+ P.value ? (p(), k("p", $n, b(P.value), 1)) : H("", !0)
759
+ ])) : H("", !0)
760
+ ], 512),
761
+ s("div", {
762
+ id: "production-run-list-panel",
763
+ role: "region",
764
+ "aria-label": r(o)("inventory.production.run.list.tabsLabel"),
765
+ class: ae(["flex min-h-0 flex-col", !v.value && !n.value && q.value.length ? "" : "overflow-y-auto"])
766
+ }, [
767
+ v.value ? (p(), k("div", {
768
+ key: 0,
769
+ "data-testid": "production-run-list-loading",
770
+ role: "status",
771
+ class: "w-full space-y-12",
772
+ "aria-busy": "true",
773
+ "aria-label": r(o)("inventory.production.run.list.loading")
774
+ }, [
775
+ (p(), k(J, null, we(6, (N) => s("div", {
776
+ key: N,
777
+ "data-testid": "production-run-list-skeleton-row",
778
+ class: "h-80 w-full animate-pulse rounded-md bg-fm-color-neutral-gray-100"
779
+ })), 64))
780
+ ], 8, An)) : n.value ? (p(), X(Rt, {
781
+ key: 1,
782
+ "data-testid": "production-run-list-error",
783
+ class: "m-16",
784
+ role: "alert",
785
+ tone: "critical",
786
+ title: r(o)("inventory.production.run.list.error.load"),
787
+ message: n.value
788
+ }, {
789
+ actions: B(() => [
790
+ $(C, {
791
+ "data-testid": "production-run-list-retry",
792
+ label: r(o)("inventory.production.run.list.error.retry"),
793
+ variant: "secondary",
794
+ onClick: a
795
+ }, null, 8, ["label"])
796
+ ]),
797
+ _: 1
798
+ }, 8, ["title", "message"])) : l.value.length === 0 ? (p(), k("div", Cn, [
799
+ s("div", Nn, b(r(o)("inventory.production.run.list.empty.noneTitle")), 1),
800
+ s("div", Fn, b(r(o)("inventory.production.run.list.empty.noneDescription")), 1),
801
+ $(C, {
802
+ "data-testid": "production-run-list-empty-create",
803
+ class: "mx-auto mt-16",
804
+ label: r(o)("inventory.production.run.list.empty.create"),
805
+ "prepend-icon": "add",
806
+ onClick: t[4] || (t[4] = (N) => Ce("create"))
807
+ }, null, 8, ["label"])
808
+ ])) : q.value.length === 0 ? (p(), k("div", Pn, [
809
+ s("div", Dn, b(r(o)("inventory.production.run.list.empty.noMatchTitle")), 1),
810
+ s("div", Tn, b(h.value.trim() ? r(o)("inventory.production.run.list.empty.searchDescription", {
811
+ query: h.value.trim()
812
+ }) : r(o)("inventory.production.run.list.empty.noMatchDescription")), 1),
813
+ $(C, {
814
+ "data-testid": "production-run-list-clear-filters",
815
+ class: "mx-auto mt-12",
816
+ label: r(o)("inventory.production.run.list.empty.clearFilters"),
817
+ "aria-label": r(o)("inventory.production.run.list.empty.clearFilters"),
818
+ variant: "tertiary",
819
+ onClick: pt
820
+ }, null, 8, ["label", "aria-label"])
821
+ ])) : (p(), X(U, {
822
+ key: dt.value,
823
+ class: "production-run-table",
824
+ style: kt(ct.value),
825
+ "column-defs": r(ht),
826
+ "row-data": q.value,
827
+ loading: v.value,
828
+ "page-size": ut.value,
829
+ "pin-header-row": !1,
830
+ onRowClick: t[5] || (t[5] = (N) => he(N.original))
831
+ }, {
832
+ "list-row": B((N) => [
833
+ $(Dt, {
834
+ "data-testid": "production-run-mobile-row",
835
+ class: "production-run-mobile-row !py-8",
836
+ row: N,
837
+ onRowClick: he
838
+ }, {
839
+ default: B((M) => {
840
+ var Fe, Pe, De, ce, Te, Me, ze, Le, de, Ve, Oe, Ee, qe, pe, Ue, je, We, He, me, Be, Ye, Qe, Ge, ve, Ke;
841
+ return [
842
+ s("div", Mn, [
843
+ s("div", zn, [
844
+ t[7] || (t[7] = s("span", { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, "#", -1)),
845
+ s("div", Ln, [
846
+ $(r(te), {
847
+ render: (De = (Pe = (Fe = M.runNo) == null ? void 0 : Fe.column) == null ? void 0 : Pe.columnDef) == null ? void 0 : De.cell,
848
+ props: (Te = (ce = M.runNo) == null ? void 0 : ce.getContext) == null ? void 0 : Te.call(ce)
849
+ }, null, 8, ["render", "props"])
850
+ ])
851
+ ]),
852
+ s("div", Vn, [
853
+ s("span", On, b(r(o)("inventory.production.run.list.columns.name")), 1),
854
+ s("div", En, [
855
+ $(r(te), {
856
+ render: (Le = (ze = (Me = M.name) == null ? void 0 : Me.column) == null ? void 0 : ze.columnDef) == null ? void 0 : Le.cell,
857
+ props: (Ve = (de = M.name) == null ? void 0 : de.getContext) == null ? void 0 : Ve.call(de)
858
+ }, null, 8, ["render", "props"])
859
+ ])
860
+ ]),
861
+ s("div", qn, [
862
+ s("span", Un, b(r(o)("inventory.production.run.list.columns.items")), 1),
863
+ $(r(te), {
864
+ render: (qe = (Ee = (Oe = M.items) == null ? void 0 : Oe.column) == null ? void 0 : Ee.columnDef) == null ? void 0 : qe.cell,
865
+ props: (Ue = (pe = M.items) == null ? void 0 : pe.getContext) == null ? void 0 : Ue.call(pe)
866
+ }, null, 8, ["render", "props"])
867
+ ]),
868
+ M.statusForAdmin ? (p(), X(at, { key: 0 }, {
869
+ default: B(() => {
870
+ var Je, Xe, Ze, fe, et;
871
+ return [
872
+ s("div", jn, [
873
+ s("span", Wn, b(r(o)("inventory.production.run.list.columns.status")), 1),
874
+ $(r(te), {
875
+ render: (Ze = (Xe = (Je = M.statusForAdmin) == null ? void 0 : Je.column) == null ? void 0 : Xe.columnDef) == null ? void 0 : Ze.cell,
876
+ props: (et = (fe = M.statusForAdmin) == null ? void 0 : fe.getContext) == null ? void 0 : et.call(fe)
877
+ }, null, 8, ["render", "props"])
878
+ ])
879
+ ];
880
+ }),
881
+ _: 2
882
+ }, 1024)) : H("", !0),
883
+ s("div", Hn, [
884
+ s("span", Bn, b(r(o)("inventory.production.run.list.columns.status")), 1),
885
+ $(r(te), {
886
+ render: (He = (We = (je = M.status) == null ? void 0 : je.column) == null ? void 0 : We.columnDef) == null ? void 0 : He.cell,
887
+ props: (Be = (me = M.status) == null ? void 0 : me.getContext) == null ? void 0 : Be.call(me)
888
+ }, null, 8, ["render", "props"])
889
+ ]),
890
+ s("div", Yn, [
891
+ s("span", Qn, b(r(o)("inventory.production.run.list.columns.updated")), 1),
892
+ $(r(te), {
893
+ render: (Ge = (Qe = (Ye = M.updatedAt) == null ? void 0 : Ye.column) == null ? void 0 : Qe.columnDef) == null ? void 0 : Ge.cell,
894
+ props: (Ke = (ve = M.updatedAt) == null ? void 0 : ve.getContext) == null ? void 0 : Ke.call(ve)
895
+ }, null, 8, ["render", "props"])
896
+ ])
897
+ ])
898
+ ];
899
+ }),
900
+ _: 2
901
+ }, 1032, ["row"])
902
+ ]),
903
+ _: 1
904
+ }, 8, ["style", "column-defs", "row-data", "loading", "page-size"]))
905
+ ], 10, Sn)
906
+ ], 2),
907
+ Y.value ? (p(), X(Qt, {
908
+ key: 0,
909
+ show: !0,
910
+ run: I.value,
911
+ "duplicate-sources": l.value,
912
+ "duplicate-source-state": u.value,
913
+ onLoadMoreDuplicateSources: re,
914
+ "onUpdate:show": t[6] || (t[6] = (N) => Y.value = N),
915
+ onSaved: xt
916
+ }, null, 8, ["run", "duplicate-sources", "duplicate-source-state"])) : H("", !0),
917
+ $(Gt, {
918
+ action: G.value,
919
+ run: Z.value,
920
+ "location-name": ((Ne = r(g)._currentLocation) == null ? void 0 : Ne.name) ?? null,
921
+ "duplicate-sources": l.value,
922
+ "duplicate-source-state": u.value,
923
+ onLoadMoreDuplicateSources: re,
924
+ "at-target": be.value,
925
+ ingredients: K.value,
926
+ "onUpdate:action": _t,
927
+ onEdited: se,
928
+ onIssued: se,
929
+ onRecorded: se,
930
+ onClosed: se,
931
+ onCancelled: se,
932
+ onReload: bt
933
+ }, null, 8, ["action", "run", "location-name", "duplicate-sources", "duplicate-source-state", "at-target", "ingredients"])
934
+ ];
935
+ }),
936
+ _: 1
937
+ }, 8, ["title", "helper-text", "actions"]);
938
+ };
939
+ }
940
+ }), Kn = /* @__PURE__ */ lt(Gn, [["__scopeId", "data-v-7dab6ed2"]]), co = /* @__PURE__ */ oe({
941
+ __name: "ProductionRunPage",
942
+ setup(V) {
943
+ return (o, i) => (p(), X(It, { "feature-key": "production-runs" }, {
944
+ default: B(() => [
945
+ $(Kn)
946
+ ]),
947
+ _: 1
948
+ }));
949
+ }
950
+ });
951
+ export {
952
+ co as default
953
+ };