@feedmepos/mf-inventory-portal 1.8.0-dev.0 → 1.8.0-dev.1

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 (129) hide show
  1. package/dist/{App-CBS1Tqpl.js → App-BXgpGzGR.js} +7 -7
  2. package/dist/{ApprovalView-BK6E_3Cw.js → ApprovalView-C8_ax05b.js} +9 -9
  3. package/dist/{BindingsDialog-BAVPQ_Eq.js → BindingsDialog-t0ZY9eh5.js} +2 -2
  4. package/dist/{BindingsPicker-bAuDX7Af.js → BindingsPicker-C0Qblmml.js} +2 -2
  5. package/dist/{BindingsTable-LGlvV0lt.js → BindingsTable-CsqUBbRA.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-CQf7FYos.js → BulkReceiveRequestView-DAG-TMox.js} +19 -19
  7. package/dist/{ClosingDraftView-DH7iYiE9.js → ClosingDraftView-CdKp4Ny6.js} +19 -19
  8. package/dist/{ClosingHistoryView-3z17ZJzK.js → ClosingHistoryView-Blyq9-BS.js} +5 -5
  9. package/dist/{ClosingTemplateView-D532GNTn.js → ClosingTemplateView-C326DL4q.js} +16 -16
  10. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CvqZGcvX.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js} +1 -1
  11. package/dist/{DefaultView-DqqXJVba.js → DefaultView-CsIMmQAY.js} +2 -2
  12. package/dist/{DeliveryOrderPrintPreview-DkHNDEKP.js → DeliveryOrderPrintPreview-eTrMvJzA.js} +2 -2
  13. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-Cyj3ka37.js → EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js} +23 -23
  14. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BCuhx2cN.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js} +1 -1
  15. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CDNqm_9N.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js} +2 -2
  16. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CB50Gqot.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js} +2 -2
  17. package/dist/{FmMultiselectDialog-7xh6h5AX.js → FmMultiselectDialog-BAw-gp5K.js} +1 -1
  18. package/dist/{FmMultiselectDialog-eH3nO3P3.js → FmMultiselectDialog-CYUxtxnS.js} +2 -2
  19. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BCIkEl75.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js} +6 -6
  20. package/dist/{ImportView-C3Fc0e_X.js → ImportView-BmotFC-3.js} +6 -6
  21. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-6naVJEke.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js} +1 -1
  22. package/dist/{IngredientGroupView-DA1buE1C.js → IngredientGroupView-qrR9ksEn.js} +5 -5
  23. package/dist/{IngredientsView-DtDtzaMt.js → IngredientsView-CZ6E7cXf.js} +15 -15
  24. package/dist/{IntegrationExplorerView-C4lYc_LH.js → IntegrationExplorerView-B15ND4Fg.js} +4 -4
  25. package/dist/{IntegrationView-Bx5VdV5l.js → IntegrationView-hkNhsqx2.js} +14 -14
  26. package/dist/{InventoryBindingForm-DKa1DwYs.js → InventoryBindingForm-SfuUF0_O.js} +1 -1
  27. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-tEKGPtHZ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js} +5 -5
  28. package/dist/{InventoryBindingSummary-CNqwcsrX.js → InventoryBindingSummary-DUcukkyJ.js} +1 -1
  29. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cbg0j7Jz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js} +1 -1
  30. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Btrg9HNc.js → PremiumBadge.vue_vue_type_script_setup_true_lang-3e3kDsbN.js} +1 -1
  31. package/dist/ProductionRunDetailView-BwgRX-14.js +2312 -0
  32. package/dist/{production-run-prepare-sheet-aQOcxgaC.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js} +11039 -3661
  33. package/dist/ProductionRunView-CZU7LY9-.js +930 -0
  34. package/dist/{PublishView-D0oSoJ5a.js → PublishView-DS2FZ66p.js} +3 -3
  35. package/dist/{PurchaseOrderPrintPreview-CE-l4mvB.js → PurchaseOrderPrintPreview-CZa0MVAs.js} +2 -2
  36. package/dist/{ReceiveRequestView-B2z8Ji0e.js → ReceiveRequestView-Bk5b3nVB.js} +14 -14
  37. package/dist/{RecipeView-DC0p9RKL.js → RecipeView-DvI6X-uN.js} +17 -17
  38. package/dist/{SettingsView-DaKfCVY5.js → SettingsView-sThYErMz.js} +4 -4
  39. package/dist/{StockView-DdweBRFv.js → StockView-Z9wGihT7.js} +21 -21
  40. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BTh5E4Tt.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js} +1 -1
  41. package/dist/{SupplierView-qqhUQ-SY.js → SupplierView-D8q6siZW.js} +12 -12
  42. package/dist/{SurchargeView-B0TYUfqY.js → SurchargeView-Db_5YFoR.js} +6 -6
  43. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-tfMHi9Yv.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js} +2 -2
  44. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dxc-jNte.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BtoP4XgE.js} +1 -1
  45. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BX36zWMb.js → TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js} +20 -20
  46. package/dist/{TransferTemplateView-CSXcAB3-.js → TransferTemplateView-DtsJzmUr.js} +20 -20
  47. package/dist/{UnitCostHistoryView-xdRSkjD7.js → UnitCostHistoryView-BqDiQ4IE.js} +4 -4
  48. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BT2v1gZv.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js} +4 -4
  49. package/dist/{UnitView-p-V_TMMo.js → UnitView-CM695-VI.js} +7 -7
  50. package/dist/{WarehouseView-BOGYcUHH.js → WarehouseView-BdidU4p6.js} +6 -6
  51. package/dist/{WastageTemplateView-CiifZMq6.js → WastageTemplateView-DdhwdXT6.js} +14 -14
  52. package/dist/api/bill.d.ts +144 -88
  53. package/dist/api/food-market-hub.d.ts +2 -2
  54. package/dist/{app-CGcDbrt8.js → app-Cb5s4jMu.js} +26822 -27077
  55. package/dist/app.js +1 -1
  56. package/dist/{closing-template-B4lQetjU.js → closing-template-DnqnpXxn.js} +1 -1
  57. package/dist/{date2-CHOcS7LX.js → date2-BPhD_1Of.js} +1 -1
  58. package/dist/{dayjs.min-DrqpmBJQ.js → dayjs.min-Zbd6-uVD.js} +1 -1
  59. package/dist/{decimal-BJ-B2ZXz.js → decimal-Df6a50Ld.js} +2 -2
  60. package/dist/{defineDeepModel-DLlTW3xL.js → defineDeepModel-Brbsikbi.js} +1 -1
  61. package/dist/{duplicate-template-Dyz7iXqd.js → duplicate-template-B9kuShaF.js} +1 -1
  62. package/dist/{feature-DtpSrELx.js → feature-Ckn5ra3z.js} +2 -2
  63. package/dist/{format-time-from-id-DBFdt14U.js → format-time-from-id-DmUjUcVj.js} +1 -1
  64. package/dist/{format-unit-display-BXCWhtXb.js → format-unit-display-CsQA0SQd.js} +12 -12
  65. package/dist/{import-export.helper-BgaADwYQ.js → import-export.helper-DCQ6oX9s.js} +6 -6
  66. package/dist/{index-CqgYx0tx.js → index-BXaIMGnI.js} +1 -1
  67. package/dist/{index-BS5wlvV_.js → index-C-mazZwS.js} +3 -3
  68. package/dist/{index-BT-a2SOP.js → index-UmM6gHJ1.js} +1 -1
  69. package/dist/{inventory-core-dart.default-DGI40oFz.js → inventory-core-dart.default-DDRxXXnt.js} +1 -1
  70. package/dist/{lz-string-CRDgHWib.js → lz-string-Bibw5D_6.js} +1 -1
  71. package/dist/{netsuite-CaILEA4R.js → netsuite-Bev0OtQT.js} +2 -2
  72. package/dist/{number-DE6ovaTs.js → number-y_W4pn_d.js} +3 -3
  73. package/dist/{predefined-templates-CTLn4dgR.js → predefined-templates-BHvUnTk_.js} +1 -1
  74. package/dist/{purchase-order-template-CE4_gQyK.js → purchase-order-template-DgOKEzhS.js} +1 -1
  75. package/dist/{recalculationUtils-DoBJhZjA.js → recalculationUtils-Dv__DzZh.js} +1 -1
  76. package/dist/router/name.d.ts +0 -1
  77. package/dist/{rules-CkaU7yFU.js → rules-CZTBvenw.js} +2 -2
  78. package/dist/{stock-WxsPiRKa.js → stock-CxCRZo_D.js} +1 -1
  79. package/dist/{stock-B3Q9e174.js → stock-XINW8JOM.js} +3 -3
  80. package/dist/stores/integration/codemax.d.ts +2 -2
  81. package/dist/stores/integration/foodmarkethub.d.ts +2 -2
  82. package/dist/stores/warehouse.d.ts +2 -1
  83. package/dist/style.css +1 -1
  84. package/dist/{supplier-DbdPWPj7.js → supplier-CkZdeMcl.js} +2 -2
  85. package/dist/{surcharge-BsvY29nN.js → surcharge-FRSFqjGl.js} +1 -1
  86. package/dist/tsconfig.app.tsbuildinfo +1 -1
  87. package/dist/{uom-rules-dxyRNetA.js → uom-rules-Cm1styDr.js} +1 -1
  88. package/dist/{use-ingredient-select-dialog-eYM-6q4s.js → use-ingredient-select-dialog-ntAqHX04.js} +2 -2
  89. package/dist/{use-inventory-binding-dialog-CCV1iieA.js → use-inventory-binding-dialog-DVIJO8Cl.js} +2 -2
  90. package/dist/{use-template-enabled-locations-C0o5r4_0.js → use-template-enabled-locations-CIZqw-Z8.js} +2 -2
  91. package/dist/{use-transfer-locations-CC35SlyA.js → use-transfer-locations-CM5vNttA.js} +2 -2
  92. package/dist/{useHrmPermission-DxzYJX4n.js → useHrmPermission-CslLuBoP.js} +1 -1
  93. package/dist/{useNavigationMenu-IKam6CEf.js → useNavigationMenu-CSinmNCY.js} +2 -2
  94. package/dist/{useSseClient-ml-_A-4u.js → useSseClient-CCV4mPzD.js} +1 -1
  95. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +4 -4
  96. package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +4 -4
  97. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +4 -4
  98. package/dist/views/integration/components/CodemaxDialog.vue.d.ts +4 -4
  99. package/dist/views/production-run/features/detail/{ProductionRunTabs.vue.d.ts → ProductionRunDetailTabs.vue.d.ts} +4 -8
  100. package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +2 -2
  101. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +4 -4
  102. package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +2 -2
  103. package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +2 -2
  104. package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +11 -11
  105. package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +2 -2
  106. package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +2 -2
  107. package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +3 -3
  108. package/dist/views/production-run/features/prepare/production-run-prepare-sheet.d.ts +0 -9
  109. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -2
  110. package/dist/views/production-run/shared/model/production-run-list.d.ts +0 -1
  111. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +10 -0
  112. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
  113. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +9 -9
  114. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
  115. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +8 -8
  116. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +2 -2
  117. package/dist/views/stock/components/StockRecordCard.vue.d.ts +72 -44
  118. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +4 -2
  119. package/dist/{vue-i18n-DYapak10.js → vue-i18n-C5j4EQhi.js} +375 -375
  120. package/dist/{xlsx.util-DrElrKDx.js → xlsx.util-B50OvX4z.js} +2 -2
  121. package/package.json +6 -6
  122. package/dist/ProductionRunDetailView-DYeSPsIY.js +0 -2284
  123. package/dist/ProductionRunPreparePrintView-DJOejqOC.js +0 -34
  124. package/dist/ProductionRunTabs.vue_vue_type_script_setup_true_lang-JKMI-vVw.js +0 -7543
  125. package/dist/ProductionRunView-Cg3aYOg9.js +0 -911
  126. package/dist/views/production-run/ProductionRunPreparePrintView.vue.d.ts +0 -2
  127. package/dist/views/production-run/features/detail/ProductionRunTabs.spec.d.ts +0 -1
  128. package/dist/views/production-run/features/prepare/production-run-prepare-sheet-cleanup.spec.d.ts +0 -1
  129. /package/dist/views/production-run/{ProductionRunPreparePrintView.spec.d.ts → features/detail/ProductionRunDetailTabs.spec.d.ts} +0 -0
@@ -0,0 +1,930 @@
1
+ import { defineComponent as ae, computed as m, createElementBlock as k, createCommentVNode as H, openBlock as p, withModifiers as ot, createVNode as C, unref as r, ref as h, watch as fe, onMounted as ke, onBeforeUnmount as Re, resolveComponent as ne, Fragment as X, createElementVNode as s, createTextVNode as _e, toDisplayString as b, withCtx as G, renderList as xe, normalizeClass as se, nextTick as rt, watchEffect as xt, h as Q, createBlock as ee, normalizeStyle as wt } from "vue";
2
+ import { _ as kt, F as te } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
3
+ import { useRouter as Rt } from "vue-router";
4
+ import { useDialog as It, useSnackbar as $t, useBreakpoints as St } from "@feedmepos/ui-library";
5
+ import { useI18n as ie, useCoreStore as At } from "@feedmepos/mf-common";
6
+ import { u as Ct, _ as Ft } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
7
+ import { F as st } from "./FmAdminBadge-DlplQOHb.js";
8
+ import { p as Ie, a as Nt, i as we, _ as Pt, h as Tt, b as Dt, f as Mt, c as zt, d as at, e as Lt, u as Vt, g as Ot, j as Et, P as qt, m as Ut, k as jt, l as Wt, n as Ht, o as Bt, q as ge, r as et, s as tt, t as nt, v as Yt } from "./ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js";
9
+ import { _ as Qt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js";
10
+ import { u as Gt, a as Kt } from "./app-Cb5s4jMu.js";
11
+ import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
+ const Jt = /* @__PURE__ */ ae({
13
+ __name: "ProductionRunActionsCell",
14
+ props: {
15
+ run: {}
16
+ },
17
+ emits: ["action"],
18
+ setup(q, { emit: o }) {
19
+ const i = q, N = o, { t: u } = ie(), R = m(
20
+ () => Ie(i.run, u("inventory.production.run.list.untitled"))
21
+ ), x = {
22
+ request: 0,
23
+ prepare: 0,
24
+ complete: 0,
25
+ update: 1,
26
+ close: 1,
27
+ cancel: 2
28
+ }, f = m(
29
+ () => Nt(i.run).filter(({ action: t }) => t !== "request" || i.run.plan.items.length > 0).sort((t, d) => we(i.run) && t.action === "close" ? -1 : we(i.run) && d.action === "close" ? 1 : x[t.action] - x[d.action]).map(({ action: t }) => t)
30
+ );
31
+ function w(t) {
32
+ return t === "complete" && Tt(i.run) ? u("inventory.production.run.detail.pendingStock.resume") : u(`inventory.production.run.list.rowActions.${t}`);
33
+ }
34
+ const c = m(
35
+ () => f.value.map((t) => ({
36
+ id: t,
37
+ label: w(t),
38
+ destructive: t === "cancel"
39
+ }))
40
+ );
41
+ function v(t) {
42
+ N("action", t);
43
+ }
44
+ return (t, d) => f.value.length ? (p(), k("div", {
45
+ key: 0,
46
+ class: "production-run-action-interactive relative flex items-center justify-center",
47
+ onClick: d[0] || (d[0] = ot(() => {
48
+ }, ["stop"]))
49
+ }, [
50
+ C(Pt, {
51
+ items: c.value,
52
+ placement: "bottom-end",
53
+ "menu-testid": "run-actions-menu",
54
+ "accessible-label": r(u)("inventory.production.run.list.actionsFor", { name: R.value }),
55
+ onSelect: v
56
+ }, null, 8, ["items", "accessible-label"])
57
+ ])) : H("", !0);
58
+ }
59
+ }), Xt = ["id"], Zt = {
60
+ key: 0,
61
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
62
+ }, en = {
63
+ key: 1,
64
+ class: "production-run-items-interactive relative min-w-0"
65
+ }, tn = { class: "min-w-0 overflow-hidden whitespace-nowrap" }, nn = {
66
+ key: 0,
67
+ class: "shrink-0",
68
+ "aria-hidden": "true"
69
+ }, on = ["data-hidden-count"], rn = ["aria-label"], sn = { class: "fm-typo-en-body-sm-600 mb-8 text-fm-color-typo-primary" }, an = { class: "flex flex-col gap-8 border-t border-fm-color-neutral-gray-100 pt-8" }, ln = { class: "text-fm-color-typo-primary" }, un = { class: "shrink-0 text-fm-color-typo-secondary" };
70
+ let cn = 0;
71
+ const dn = /* @__PURE__ */ ae({
72
+ __name: "ProductionRunItemsCell",
73
+ props: {
74
+ run: {},
75
+ resolveSku: {},
76
+ rowLinkFocused: { type: Boolean, default: !1 },
77
+ descriptionId: {},
78
+ wrap: { type: Boolean, default: !1 }
79
+ },
80
+ setup(q) {
81
+ const o = q, { t: i } = ie(), N = h(!1), u = m(() => N.value || o.rowLinkFocused), R = h(null), x = h(null), f = h(null), w = h(Number.POSITIVE_INFINITY), c = h(!1), v = typeof navigator < "u" && /safari/i.test(navigator.userAgent) && !/(chrome|chromium|crios|android)/i.test(navigator.userAgent), t = ++cn, d = `production-run-items-tooltip-${t}`, T = `production-run-items-description-${t}`, P = m(() => o.descriptionId ?? T), l = 44;
82
+ let _ = null, g = null, O = null, B = !1;
83
+ const I = m(
84
+ () => o.run.plan.items.map((a, S) => {
85
+ const D = o.resolveSku(a.skuId), $ = Dt(a.measurement) ? a.measurement : null, V = ($ == null ? void 0 : $.abbrev) ?? null, j = Mt(a.requestedAmount, V, {
86
+ precision: a.requestedAmount.precision
87
+ });
88
+ return {
89
+ key: `${a.skuId}-${S}`,
90
+ name: (D == null ? void 0 : D.name) ?? a.skuId,
91
+ quantity: V ? j : `${j} · ${i("inventory.production.run.list.itemsUnitUnresolved")}`
92
+ };
93
+ })
94
+ ), z = m(() => I.value.slice(0, w.value)), K = m(() => I.value.map(({ name: a }) => a).join(", ")), U = m(() => z.value.map(({ name: a }) => a).join(", ")), L = m(
95
+ () => o.wrap ? 0 : Math.max(0, I.value.length - z.value.length)
96
+ ), Z = m(() => L.value > 99 ? "99+" : `+${L.value}`), ye = m(
97
+ () => I.value.map(({ name: a, quantity: S }) => `${a}: ${S}`).join(", ")
98
+ );
99
+ function he() {
100
+ if (o.wrap) {
101
+ w.value = I.value.length, c.value = !1;
102
+ return;
103
+ }
104
+ const a = x.value, S = f.value;
105
+ if (!a || !S || a.clientWidth <= 0) return;
106
+ const D = Array.from(S.children).map((W) => W.offsetWidth);
107
+ if (!D.length || D.reduce((W, Y) => W + Y, 0) <= a.clientWidth) {
108
+ w.value = I.value.length, c.value = !1;
109
+ return;
110
+ }
111
+ c.value = !0;
112
+ const $ = Math.max(0, a.clientWidth - l);
113
+ let V = 0, j = 0;
114
+ for (const W of D) {
115
+ if (V + W > $) break;
116
+ V += W, j++;
117
+ }
118
+ w.value = Math.min(I.value.length, Math.max(1, j + 1));
119
+ }
120
+ function J() {
121
+ B || (B = !0, rt(() => {
122
+ B = !1, he();
123
+ }));
124
+ }
125
+ function oe() {
126
+ _ && (g !== x.value && (g && _.unobserve(g), g = x.value, g && _.observe(g)), O !== f.value && (O && _.unobserve(O), O = f.value, O && _.observe(O)), J());
127
+ }
128
+ fe(
129
+ () => I.value.map(({ name: a }) => a).join("\0"),
130
+ () => {
131
+ w.value = Number.POSITIVE_INFINITY, J();
132
+ },
133
+ { flush: "post" }
134
+ ), fe(
135
+ () => o.wrap,
136
+ () => {
137
+ w.value = Number.POSITIVE_INFINITY, J();
138
+ },
139
+ { flush: "post" }
140
+ ), fe([x, f], oe, { flush: "post" }), ke(() => {
141
+ typeof ResizeObserver < "u" && (_ = new ResizeObserver(J), oe()), J();
142
+ }), Re(() => _ == null ? void 0 : _.disconnect());
143
+ function le(a) {
144
+ var S, D;
145
+ a !== u.value && (u.value ? (S = R.value) == null || S.show() : (D = R.value) == null || D.hide());
146
+ }
147
+ return (a, S) => {
148
+ const D = ne("FmPopover");
149
+ return p(), k(X, null, [
150
+ s("span", {
151
+ id: P.value,
152
+ "data-testid": "run-items-a11y-description",
153
+ class: "sr-only"
154
+ }, [
155
+ L.value ? (p(), k(X, { key: 0 }, [
156
+ _e(b(r(i)("inventory.production.run.list.itemsHidden", { count: L.value })) + ". ", 1)
157
+ ], 64)) : H("", !0),
158
+ _e(" " + b(I.value.length ? r(i)("inventory.production.run.list.itemsLabel", { names: ye.value }) : r(i)("inventory.production.run.list.itemsNone")), 1)
159
+ ], 8, Xt),
160
+ I.value.length === 0 ? (p(), k("span", Zt, b(r(i)("inventory.production.run.list.itemsNone")), 1)) : (p(), k("div", en, [
161
+ C(D, {
162
+ ref_key: "popover",
163
+ ref: R,
164
+ "show-popover": u.value,
165
+ placement: "bottom-start",
166
+ onPopoverChanged: le
167
+ }, {
168
+ "popover-button": G(() => [
169
+ s("div", {
170
+ ref_key: "disclosureContainer",
171
+ ref: x,
172
+ "data-testid": "items-disclosure-container",
173
+ class: se(["flex w-full max-w-full min-w-0 gap-4 text-left", a.wrap ? "items-start overflow-visible" : "items-center overflow-hidden"]),
174
+ onMouseenter: S[0] || (S[0] = ($) => N.value = !0),
175
+ onMouseleave: S[1] || (S[1] = ($) => N.value = !1)
176
+ }, [
177
+ s("span", {
178
+ "data-testid": "run-items-summary",
179
+ class: se([
180
+ "fm-typo-en-body-md-400 min-w-0 flex-1 text-fm-color-typo-primary",
181
+ a.wrap ? "whitespace-normal break-words" : r(v) ? "flex overflow-hidden whitespace-nowrap" : "truncate"
182
+ ])
183
+ }, [
184
+ r(v) && !a.wrap ? (p(), k(X, { key: 0 }, [
185
+ s("span", tn, b(U.value), 1),
186
+ c.value ? (p(), k("span", nn, "…")) : H("", !0)
187
+ ], 64)) : (p(), k(X, { key: 1 }, [
188
+ _e(b(K.value), 1)
189
+ ], 64))
190
+ ], 2),
191
+ L.value ? (p(), k("span", {
192
+ key: 0,
193
+ "data-testid": "run-items-overflow",
194
+ "data-hidden-count": L.value,
195
+ "data-production-info-size": "sm",
196
+ "aria-hidden": "true",
197
+ 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"
198
+ }, b(Z.value), 9, on)) : H("", !0),
199
+ s("span", {
200
+ ref_key: "measureRail",
201
+ ref: f,
202
+ "data-testid": "run-items-measure",
203
+ "aria-hidden": "true",
204
+ class: "fm-typo-en-body-md-400 pointer-events-none invisible absolute w-max whitespace-nowrap"
205
+ }, [
206
+ (p(!0), k(X, null, xe(I.value, ($, V) => (p(), k("span", {
207
+ key: $.key,
208
+ "data-testid": "run-item-measure"
209
+ }, b(V ? `, ${$.name}` : $.name), 1))), 128))
210
+ ], 512)
211
+ ], 34)
212
+ ]),
213
+ default: G(() => [
214
+ s("div", {
215
+ id: d,
216
+ "data-testid": "run-items-disclosure",
217
+ role: "tooltip",
218
+ "aria-label": r(i)("inventory.production.run.list.itemsDisclosure"),
219
+ class: "pointer-events-none min-w-[288px] p-12"
220
+ }, [
221
+ s("h3", sn, b(r(i)("inventory.production.run.list.itemsCount", { count: I.value.length })), 1),
222
+ s("ul", an, [
223
+ (p(!0), k(X, null, xe(I.value, ($) => (p(), k("li", {
224
+ key: $.key,
225
+ class: "fm-typo-en-body-sm-400 flex items-start justify-between gap-16"
226
+ }, [
227
+ s("span", ln, b($.name), 1),
228
+ s("span", un, b($.quantity), 1)
229
+ ]))), 128))
230
+ ])
231
+ ], 8, rn)
232
+ ]),
233
+ _: 1
234
+ }, 8, ["show-popover"])
235
+ ]))
236
+ ], 64);
237
+ };
238
+ }
239
+ }), pn = ["href", "aria-describedby"], mn = /* @__PURE__ */ ae({
240
+ __name: "ProductionRunNameCell",
241
+ props: {
242
+ name: {},
243
+ href: {},
244
+ descriptionId: {},
245
+ wrap: { type: Boolean, default: !1 }
246
+ },
247
+ emits: ["open", "focus", "blur"],
248
+ setup(q, { emit: o }) {
249
+ const i = q, N = o, u = h(null), R = h(!1);
250
+ let x = null, f = !1;
251
+ function w() {
252
+ const t = u.value;
253
+ R.value = !i.wrap && !!t && t.scrollWidth > t.clientWidth;
254
+ }
255
+ function c() {
256
+ f || (f = !0, rt(() => {
257
+ f = !1, w();
258
+ }));
259
+ }
260
+ fe(() => [i.name, i.wrap], c, { flush: "post" }), ke(() => {
261
+ typeof ResizeObserver < "u" && u.value && (x = new ResizeObserver(c), x.observe(u.value)), c();
262
+ }), Re(() => x == null ? void 0 : x.disconnect());
263
+ function v(t) {
264
+ t.preventDefault(), t.stopPropagation(), N("open");
265
+ }
266
+ return (t, d) => {
267
+ const T = ne("FmTooltip");
268
+ return p(), k("a", {
269
+ href: t.href,
270
+ "aria-describedby": t.descriptionId,
271
+ 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",
272
+ onClick: v,
273
+ onFocus: d[0] || (d[0] = (P) => N("focus")),
274
+ onBlur: d[1] || (d[1] = (P) => N("blur"))
275
+ }, [
276
+ C(T, {
277
+ content: t.name,
278
+ disabled: !R.value,
279
+ placement: "top",
280
+ "z-index": 51,
281
+ "content-class": "production-run-name-tooltip-reference"
282
+ }, {
283
+ default: G(() => [
284
+ s("span", {
285
+ ref_key: "label",
286
+ ref: u,
287
+ "data-testid": "run-name-label",
288
+ class: se(["block min-w-0", t.wrap ? "whitespace-normal break-words" : "truncate"])
289
+ }, b(t.name), 3)
290
+ ]),
291
+ _: 1
292
+ }, 8, ["content", "disabled"])
293
+ ], 40, pn);
294
+ };
295
+ }
296
+ }), vn = /* @__PURE__ */ it(mn, [["__scopeId", "data-v-4d06048a"]]), fn = ["aria-label"], yn = { class: "min-w-0 truncate" }, hn = /* @__PURE__ */ ae({
297
+ __name: "ProductionRunSortHeader",
298
+ props: {
299
+ columnId: {},
300
+ label: {},
301
+ activeColumnId: {},
302
+ descending: { type: Boolean }
303
+ },
304
+ emits: ["toggle"],
305
+ setup(q, { emit: o }) {
306
+ const i = q, N = o, { t: u } = ie(), R = m(() => i.activeColumnId === i.columnId), x = m(
307
+ () => R.value ? u(`inventory.production.run.list.sort.${i.descending ? "descending" : "ascending"}`) : u("inventory.production.run.list.sort.unsorted")
308
+ ), f = m(
309
+ () => R.value ? i.descending ? "arrow_downward" : "arrow_upward" : "unfold_more"
310
+ ), w = m(
311
+ () => u("inventory.production.run.list.sort.label", {
312
+ column: i.label,
313
+ direction: x.value
314
+ })
315
+ ), c = h(null), v = h(null);
316
+ return ke(() => {
317
+ var t;
318
+ v.value = ((t = c.value) == null ? void 0 : t.closest("th")) ?? null;
319
+ }), xt(() => {
320
+ v.value && v.value.setAttribute(
321
+ "aria-sort",
322
+ R.value ? i.descending ? "descending" : "ascending" : "none"
323
+ );
324
+ }), Re(() => {
325
+ var t;
326
+ return (t = v.value) == null ? void 0 : t.removeAttribute("aria-sort");
327
+ }), (t, d) => {
328
+ const T = ne("FmIcon");
329
+ return p(), k("button", {
330
+ ref_key: "button",
331
+ ref: c,
332
+ type: "button",
333
+ 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",
334
+ "aria-label": w.value,
335
+ onClick: d[0] || (d[0] = ot((P) => N("toggle", t.columnId), ["stop"]))
336
+ }, [
337
+ s("span", yn, b(t.label), 1),
338
+ C(T, {
339
+ name: f.value,
340
+ size: "sm",
341
+ "aria-hidden": "true",
342
+ class: "shrink-0"
343
+ }, null, 8, ["name"])
344
+ ], 8, fn);
345
+ };
346
+ }
347
+ });
348
+ let bn = 0;
349
+ function _n(q, o = () => null, i = () => {
350
+ }, N = () => {
351
+ }, u = () => {
352
+ }, R = () => !1, x = (f) => `/production-run/${encodeURIComponent(f._id)}`) {
353
+ var P;
354
+ const { t: f } = ie(), w = At(), c = ++bn, v = h(null), t = (l) => `production-run-table-${c}-items-${encodeURIComponent(l._id)}`, d = (l, _) => {
355
+ const g = N();
356
+ return Q(hn, {
357
+ columnId: l,
358
+ label: _,
359
+ activeColumnId: g == null ? void 0 : g.id,
360
+ descending: g == null ? void 0 : g.desc,
361
+ onToggle: u
362
+ });
363
+ };
364
+ return { columnDefs: [
365
+ {
366
+ id: "runNo",
367
+ header: () => d("runNo", "#"),
368
+ enableSorting: !1,
369
+ size: 80,
370
+ meta: { headerClass: "p-0" },
371
+ cell: (l) => Q(
372
+ "span",
373
+ { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" },
374
+ `${l.row.original.runNo}`
375
+ )
376
+ },
377
+ {
378
+ id: "name",
379
+ header: () => d("name", f("inventory.production.run.list.columns.name")),
380
+ enableSorting: !1,
381
+ minSize: 240,
382
+ size: 320,
383
+ maxSize: 320,
384
+ meta: { headerClass: "p-0" },
385
+ cell: (l) => Q(vn, {
386
+ name: Ie(
387
+ l.row.original,
388
+ f("inventory.production.run.list.untitled")
389
+ ),
390
+ href: x(l.row.original),
391
+ descriptionId: t(l.row.original),
392
+ wrap: R(),
393
+ onOpen: () => i(l.row.original),
394
+ onFocus: () => {
395
+ v.value = l.row.original._id;
396
+ },
397
+ onBlur: () => {
398
+ v.value === l.row.original._id && (v.value = null);
399
+ }
400
+ })
401
+ },
402
+ {
403
+ id: "items",
404
+ header: () => f("inventory.production.run.list.columns.items"),
405
+ enableSorting: !1,
406
+ minSize: 220,
407
+ size: 280,
408
+ maxSize: 280,
409
+ cell: (l) => Q(dn, {
410
+ run: l.row.original,
411
+ resolveSku: o,
412
+ descriptionId: t(l.row.original),
413
+ wrap: R(),
414
+ rowLinkFocused: v.value === l.row.original._id
415
+ })
416
+ },
417
+ ...(P = w.sessionUser.value) != null && P.role.isAdmin ? [
418
+ {
419
+ id: "statusForAdmin",
420
+ header: () => Q(st, {}, () => f("inventory.production.run.list.columns.status")),
421
+ cell: (l) => l.row.original.status,
422
+ enableSorting: !1,
423
+ size: 120
424
+ }
425
+ ] : [],
426
+ {
427
+ id: "status",
428
+ header: () => d("status", f("inventory.production.run.list.columns.status")),
429
+ enableSorting: !1,
430
+ size: 120,
431
+ meta: { headerClass: "p-0" },
432
+ cell: (l) => Q(zt, { status: l.row.original.status })
433
+ },
434
+ {
435
+ id: "updatedAt",
436
+ header: () => d("updatedAt", f("inventory.production.run.list.columns.updated")),
437
+ enableSorting: !1,
438
+ minSize: 180,
439
+ size: 200,
440
+ maxSize: 200,
441
+ meta: { headerClass: "p-0" },
442
+ cell: (l) => {
443
+ const _ = l.row.original, g = at(_);
444
+ return Q(
445
+ "span",
446
+ { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary whitespace-nowrap" },
447
+ Lt((g == null ? void 0 : g.at) ?? _.createdAt)
448
+ );
449
+ }
450
+ },
451
+ {
452
+ id: "action",
453
+ header: "",
454
+ enableSorting: !1,
455
+ cell: (l) => Q(Jt, {
456
+ run: l.row.original,
457
+ onAction: (_) => q(_, l.row.original)
458
+ }),
459
+ size: 40,
460
+ meta: {
461
+ cellClass: "",
462
+ headerClass: ""
463
+ }
464
+ }
465
+ ] };
466
+ }
467
+ const gn = { class: "sr-only" }, xn = ["aria-label"], wn = {
468
+ key: 0,
469
+ "data-testid": "production-run-history-scope",
470
+ class: "flex shrink-0 flex-wrap items-center justify-between gap-8"
471
+ }, kn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Rn = {
472
+ key: 1,
473
+ role: "alert",
474
+ class: "w-full fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
475
+ }, In = ["aria-label"], $n = ["aria-label"], Sn = {
476
+ key: 2,
477
+ "data-testid": "production-run-list-empty",
478
+ class: "rounded-md border border-dashed border-fm-color-neutral-gray-200 p-48 text-center"
479
+ }, An = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Cn = { class: "mx-auto mt-4 max-w-[25rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = {
480
+ key: 3,
481
+ "data-testid": "production-run-list-no-match",
482
+ class: "rounded-md border border-dashed border-fm-color-neutral-gray-200 p-40 text-center"
483
+ }, Nn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Pn = { class: "mx-auto mt-4 max-w-[25rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tn = { class: "flex flex-col gap-[8px] py-[8px]" }, Dn = {
484
+ "data-testid": "production-run-mobile-run-number",
485
+ class: "flex items-center gap-[4px]"
486
+ }, Mn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, zn = { class: "flex min-w-0 flex-col gap-[2px]" }, Ln = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, Vn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, On = { class: "flex min-w-0 flex-col gap-[2px]" }, En = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, qn = {
487
+ "data-testid": "production-run-admin-status",
488
+ class: "flex flex-col gap-[4px]"
489
+ }, Un = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, jn = { class: "flex flex-col gap-[2px]" }, 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 = /* @__PURE__ */ ae({
490
+ __name: "ProductionRunView",
491
+ setup(q) {
492
+ const { t: o } = ie(), i = Rt(), N = It(), u = $t(), R = Vt(), x = Gt(), f = Kt(), w = Ct();
493
+ Ot();
494
+ const c = h([]), v = h(!1), t = h(null), d = h(null), T = h(!1), P = h(null), l = m(() => ({
495
+ loading: v.value || T.value,
496
+ loaded: !v.value && !t.value,
497
+ hasMore: d.value !== null,
498
+ error: P.value ?? t.value
499
+ })), _ = h(""), g = h("all"), O = h([{ id: "updatedAt", desc: !0 }]), B = h(!1), I = h(null), z = h(null), K = h(null);
500
+ let U = 0, L = 0;
501
+ const Z = m(
502
+ () => c.value.find((e) => e._id === z.value) ?? null
503
+ ), ye = Et(() => Z.value), he = m(() => !!Z.value && we(Z.value)), J = m(
504
+ () => ye.ingredientLines.value.map((e) => ({
505
+ skuId: e.skuId,
506
+ name: e.name,
507
+ unit: e.unit,
508
+ unitRef: e.unitRef,
509
+ outputSkuIds: e.outputSkuIds
510
+ }))
511
+ );
512
+ function oe() {
513
+ return t.value ? a() : S();
514
+ }
515
+ function le() {
516
+ L++, K.value = null, z.value = null, I.value = null, B.value = !1;
517
+ }
518
+ async function a() {
519
+ const e = ++U;
520
+ v.value = !0, t.value = null, d.value = null, T.value = !1, P.value = null;
521
+ try {
522
+ const n = await R.list();
523
+ if (e !== U) return;
524
+ c.value = n.items, d.value = n.nextCursor;
525
+ } catch (n) {
526
+ if (e !== U) return;
527
+ const y = ge(n);
528
+ t.value = y.message, u == null || u.open({
529
+ title: o("inventory.production.run.list.error.load"),
530
+ message: y.message,
531
+ type: "error"
532
+ });
533
+ } finally {
534
+ e === U && (v.value = !1);
535
+ }
536
+ }
537
+ async function S() {
538
+ const e = d.value;
539
+ if (!e || v.value || T.value) return;
540
+ const n = U;
541
+ T.value = !0, P.value = null;
542
+ try {
543
+ const y = await R.list({ cursor: e });
544
+ if (n !== U || e !== d.value) return;
545
+ if (y.nextCursor === e)
546
+ throw new Error(o("inventory.production.run.list.history.cursorError"));
547
+ const A = new Set(c.value.map((E) => E._id));
548
+ c.value = [...c.value, ...y.items.filter((E) => !A.has(E._id))], d.value = y.nextCursor;
549
+ } catch (y) {
550
+ n === U && (P.value = ge(y).message);
551
+ } finally {
552
+ n === U && (T.value = !1);
553
+ }
554
+ }
555
+ x.watchLocation(() => (le(), a()));
556
+ const D = m(
557
+ () => qt.map((e) => ({
558
+ label: o(`inventory.production.run.list.tabs.${e.key}`),
559
+ value: e.key
560
+ }))
561
+ );
562
+ function $(e) {
563
+ var n;
564
+ return ((n = at(e)) == null ? void 0 : n.at) ?? e.createdAt;
565
+ }
566
+ function V(e, n, y) {
567
+ switch (y) {
568
+ case "runNo":
569
+ return e.runNo - n.runNo;
570
+ case "name":
571
+ return tt(e).localeCompare(tt(n));
572
+ case "status":
573
+ return et(e.status) - et(n.status);
574
+ case "updatedAt":
575
+ return Date.parse($(e)) - Date.parse($(n));
576
+ default:
577
+ return 0;
578
+ }
579
+ }
580
+ const j = m(() => {
581
+ const e = c.value.filter(
582
+ (A) => Ut(A, g.value) && jt(A, _.value, $e)
583
+ ), n = O.value[0];
584
+ if (!n)
585
+ return e.sort(
586
+ (A, E) => V(E, A, "updatedAt") || V(E, A, "runNo")
587
+ );
588
+ const y = n.desc ? -1 : 1;
589
+ return e.sort(
590
+ (A, E) => y * V(A, E, n.id) || V(E, A, "runNo")
591
+ );
592
+ }), { breakpoints: W } = St(), Y = m(() => W.value.xs || W.value.sm), lt = m(() => Y.value ? 10 : 20), ut = m(() => Y.value ? { height: `calc(${w.tableHeight.height} - 16px)` } : w.tableHeight), ct = m(
593
+ () => Y.value ? j.value.map((e) => `${e._id}:${e._rev}`).join("|") : "desktop"
594
+ );
595
+ function dt() {
596
+ _.value = "", g.value = "all";
597
+ }
598
+ function pt(e) {
599
+ const n = O.value[0];
600
+ O.value = [
601
+ (n == null ? void 0 : n.id) === e ? { id: e, desc: !n.desc } : { id: e, desc: !1 }
602
+ ];
603
+ }
604
+ function $e(e) {
605
+ return f.skuById[e];
606
+ }
607
+ function be(e) {
608
+ i.push(nt(e._id));
609
+ }
610
+ function mt(e) {
611
+ return i.resolve(nt(e._id)).href;
612
+ }
613
+ function vt(e, n) {
614
+ const y = ++L;
615
+ if (z.value = n._id, K.value = null, e === "request") {
616
+ N.open(Yt(o)).onPrimary(() => void ft(n._id, y));
617
+ return;
618
+ }
619
+ K.value = e;
620
+ }
621
+ async function ft(e, n) {
622
+ if (!(n !== L || z.value !== e))
623
+ try {
624
+ const y = await R.request(e);
625
+ if (n !== L || z.value !== e || !Se(y)) return;
626
+ u == null || u.open({
627
+ title: o("inventory.production.run.list.request.success"),
628
+ message: o("inventory.production.run.list.request.successMessage", {
629
+ name: Ie(y, o("inventory.production.run.list.untitled"))
630
+ }),
631
+ type: "success"
632
+ }), z.value = null;
633
+ } catch (y) {
634
+ if (n !== L || z.value !== e) return;
635
+ u == null || u.open({
636
+ title: o("inventory.production.run.list.error.action", {
637
+ action: o("inventory.production.run.list.rowActions.request")
638
+ }),
639
+ message: ge(y).message,
640
+ type: "error"
641
+ });
642
+ }
643
+ }
644
+ function Se(e) {
645
+ const n = c.value.findIndex((A) => A._id === e._id);
646
+ if (n < 0) return !1;
647
+ const y = [...c.value];
648
+ return y[n] = e, c.value = y, !0;
649
+ }
650
+ function re(e) {
651
+ z.value === e._id && Se(e);
652
+ }
653
+ function yt(e) {
654
+ e === null && (K.value = null, z.value = null);
655
+ }
656
+ function ht() {
657
+ le(), a();
658
+ }
659
+ const { columnDefs: bt } = _n(
660
+ vt,
661
+ $e,
662
+ be,
663
+ () => O.value[0],
664
+ pt,
665
+ () => Y.value,
666
+ mt
667
+ );
668
+ function Ae(e) {
669
+ e === "refresh" && a(), e === "create" && (I.value = null, B.value = !0);
670
+ }
671
+ const _t = m(() => [
672
+ {
673
+ label: o("inventory.common.refresh"),
674
+ value: "refresh",
675
+ prependIcon: "refresh"
676
+ },
677
+ {
678
+ label: o("inventory.production.run.list.actions.create"),
679
+ value: "create",
680
+ prependIcon: "add",
681
+ testId: "production-run-mobile-create",
682
+ isPrimary: !0
683
+ }
684
+ ]);
685
+ function gt() {
686
+ I.value = null, a();
687
+ }
688
+ return (e, n) => {
689
+ const y = ne("FmTabs"), A = ne("FmButton"), E = ne("FmTable");
690
+ return p(), ee(Ft, {
691
+ title: r(o)("inventory.production.run.list.title"),
692
+ "helper-text": r(o)("inventory.production.run.list.caption"),
693
+ actions: _t.value,
694
+ "onClick:action": Ae
695
+ }, {
696
+ default: G(() => {
697
+ var Ce;
698
+ return [
699
+ s("div", {
700
+ "data-testid": "production-run-list-content",
701
+ class: se([
702
+ "flex w-full max-h-full flex-col gap-12",
703
+ {
704
+ "p-0": Y.value,
705
+ "px-24": !Y.value
706
+ }
707
+ ])
708
+ }, [
709
+ s("h1", gn, b(r(o)("inventory.production.run.list.title")), 1),
710
+ C(Qt, {
711
+ "change-location": "",
712
+ searchable: "",
713
+ search: _.value,
714
+ "onUpdate:search": n[0] || (n[0] = (F) => _.value = F)
715
+ }, null, 8, ["search"]),
716
+ s("div", {
717
+ class: "flex min-w-0 shrink-0 flex-col gap-12",
718
+ "data-testid": "production-run-list-controls",
719
+ onVnodeMounted: n[2] || (n[2] = //@ts-ignore
720
+ (...F) => r(w).onMounted && r(w).onMounted(...F)),
721
+ onVnodeUnmounted: n[3] || (n[3] = //@ts-ignore
722
+ (...F) => r(w).onUnmounted && r(w).onUnmounted(...F))
723
+ }, [
724
+ s("nav", {
725
+ class: "min-w-0 overflow-x-auto",
726
+ "aria-label": r(o)("inventory.production.run.list.tabsLabel")
727
+ }, [
728
+ C(y, {
729
+ "model-value": g.value,
730
+ "onUpdate:modelValue": n[1] || (n[1] = (F) => g.value = F),
731
+ items: D.value
732
+ }, null, 8, ["model-value", "items"])
733
+ ], 8, xn),
734
+ !v.value && !t.value && (d.value || P.value) ? (p(), k("div", wn, [
735
+ s("p", kn, b(r(o)("inventory.production.run.list.history.scope", { count: c.value.length })), 1),
736
+ d.value ? (p(), ee(A, {
737
+ key: 0,
738
+ "data-testid": "production-run-load-more",
739
+ variant: "secondary",
740
+ label: r(o)("inventory.production.run.list.history.loadMore"),
741
+ loading: T.value,
742
+ disabled: T.value,
743
+ onClick: S
744
+ }, null, 8, ["label", "loading", "disabled"])) : H("", !0),
745
+ P.value ? (p(), k("p", Rn, b(P.value), 1)) : H("", !0)
746
+ ])) : H("", !0)
747
+ ], 512),
748
+ s("div", {
749
+ id: "production-run-list-panel",
750
+ role: "region",
751
+ "aria-label": r(o)("inventory.production.run.list.tabsLabel"),
752
+ class: se(["flex min-h-0 flex-col", !v.value && !t.value && j.value.length ? "" : "overflow-y-auto"])
753
+ }, [
754
+ v.value ? (p(), k("div", {
755
+ key: 0,
756
+ "data-testid": "production-run-list-loading",
757
+ role: "status",
758
+ class: "w-full space-y-12",
759
+ "aria-busy": "true",
760
+ "aria-label": r(o)("inventory.production.run.list.loading")
761
+ }, [
762
+ (p(), k(X, null, xe(6, (F) => s("div", {
763
+ key: F,
764
+ "data-testid": "production-run-list-skeleton-row",
765
+ class: "h-80 w-full animate-pulse rounded-md bg-fm-color-neutral-gray-100"
766
+ })), 64))
767
+ ], 8, $n)) : t.value ? (p(), ee(Wt, {
768
+ key: 1,
769
+ "data-testid": "production-run-list-error",
770
+ class: "m-16",
771
+ role: "alert",
772
+ tone: "critical",
773
+ title: r(o)("inventory.production.run.list.error.load"),
774
+ message: t.value
775
+ }, {
776
+ actions: G(() => [
777
+ C(A, {
778
+ "data-testid": "production-run-list-retry",
779
+ label: r(o)("inventory.production.run.list.error.retry"),
780
+ variant: "secondary",
781
+ onClick: a
782
+ }, null, 8, ["label"])
783
+ ]),
784
+ _: 1
785
+ }, 8, ["title", "message"])) : c.value.length === 0 ? (p(), k("div", Sn, [
786
+ s("div", An, b(r(o)("inventory.production.run.list.empty.noneTitle")), 1),
787
+ s("div", Cn, b(r(o)("inventory.production.run.list.empty.noneDescription")), 1),
788
+ C(A, {
789
+ "data-testid": "production-run-list-empty-create",
790
+ class: "mx-auto mt-16",
791
+ label: r(o)("inventory.production.run.list.empty.create"),
792
+ "prepend-icon": "add",
793
+ onClick: n[4] || (n[4] = (F) => Ae("create"))
794
+ }, null, 8, ["label"])
795
+ ])) : j.value.length === 0 ? (p(), k("div", Fn, [
796
+ s("div", Nn, b(r(o)("inventory.production.run.list.empty.noMatchTitle")), 1),
797
+ s("div", Pn, b(_.value.trim() ? r(o)("inventory.production.run.list.empty.searchDescription", {
798
+ query: _.value.trim()
799
+ }) : r(o)("inventory.production.run.list.empty.noMatchDescription")), 1),
800
+ C(A, {
801
+ "data-testid": "production-run-list-clear-filters",
802
+ class: "mx-auto mt-12",
803
+ label: r(o)("inventory.production.run.list.empty.clearFilters"),
804
+ "aria-label": r(o)("inventory.production.run.list.empty.clearFilters"),
805
+ variant: "tertiary",
806
+ onClick: dt
807
+ }, null, 8, ["label", "aria-label"])
808
+ ])) : (p(), ee(E, {
809
+ key: ct.value,
810
+ class: "production-run-table",
811
+ style: wt(ut.value),
812
+ "column-defs": r(bt),
813
+ "row-data": j.value,
814
+ loading: v.value,
815
+ "page-size": lt.value,
816
+ "pin-header-row": !1,
817
+ onRowClick: n[5] || (n[5] = (F) => be(F.original))
818
+ }, {
819
+ "list-row": G((F) => [
820
+ C(kt, {
821
+ "data-testid": "production-run-mobile-row",
822
+ class: "production-run-mobile-row !py-8",
823
+ row: F,
824
+ onRowClick: be
825
+ }, {
826
+ default: G((M) => {
827
+ var Fe, Ne, Pe, ue, Te, De, Me, ze, ce, Le, Ve, Oe, Ee, de, qe, Ue, je, We, pe, He, Be, Ye, Qe, me, Ge;
828
+ return [
829
+ s("div", Tn, [
830
+ s("div", Dn, [
831
+ n[7] || (n[7] = s("span", { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, "#", -1)),
832
+ s("div", Mn, [
833
+ C(r(te), {
834
+ render: (Pe = (Ne = (Fe = M.runNo) == null ? void 0 : Fe.column) == null ? void 0 : Ne.columnDef) == null ? void 0 : Pe.cell,
835
+ props: (Te = (ue = M.runNo) == null ? void 0 : ue.getContext) == null ? void 0 : Te.call(ue)
836
+ }, null, 8, ["render", "props"])
837
+ ])
838
+ ]),
839
+ s("div", zn, [
840
+ s("span", Ln, b(r(o)("inventory.production.run.list.columns.name")), 1),
841
+ s("div", Vn, [
842
+ C(r(te), {
843
+ render: (ze = (Me = (De = M.name) == null ? void 0 : De.column) == null ? void 0 : Me.columnDef) == null ? void 0 : ze.cell,
844
+ props: (Le = (ce = M.name) == null ? void 0 : ce.getContext) == null ? void 0 : Le.call(ce)
845
+ }, null, 8, ["render", "props"])
846
+ ])
847
+ ]),
848
+ s("div", On, [
849
+ s("span", En, b(r(o)("inventory.production.run.list.columns.items")), 1),
850
+ C(r(te), {
851
+ render: (Ee = (Oe = (Ve = M.items) == null ? void 0 : Ve.column) == null ? void 0 : Oe.columnDef) == null ? void 0 : Ee.cell,
852
+ props: (qe = (de = M.items) == null ? void 0 : de.getContext) == null ? void 0 : qe.call(de)
853
+ }, null, 8, ["render", "props"])
854
+ ]),
855
+ M.statusForAdmin ? (p(), ee(st, { key: 0 }, {
856
+ default: G(() => {
857
+ var Ke, Je, Xe, ve, Ze;
858
+ return [
859
+ s("div", qn, [
860
+ s("span", Un, b(r(o)("inventory.production.run.list.columns.status")), 1),
861
+ C(r(te), {
862
+ render: (Xe = (Je = (Ke = M.statusForAdmin) == null ? void 0 : Ke.column) == null ? void 0 : Je.columnDef) == null ? void 0 : Xe.cell,
863
+ props: (Ze = (ve = M.statusForAdmin) == null ? void 0 : ve.getContext) == null ? void 0 : Ze.call(ve)
864
+ }, null, 8, ["render", "props"])
865
+ ])
866
+ ];
867
+ }),
868
+ _: 2
869
+ }, 1024)) : H("", !0),
870
+ s("div", jn, [
871
+ s("span", Wn, b(r(o)("inventory.production.run.list.columns.status")), 1),
872
+ C(r(te), {
873
+ render: (We = (je = (Ue = M.status) == null ? void 0 : Ue.column) == null ? void 0 : je.columnDef) == null ? void 0 : We.cell,
874
+ props: (He = (pe = M.status) == null ? void 0 : pe.getContext) == null ? void 0 : He.call(pe)
875
+ }, null, 8, ["render", "props"])
876
+ ]),
877
+ s("div", Hn, [
878
+ s("span", Bn, b(r(o)("inventory.production.run.list.columns.updated")), 1),
879
+ C(r(te), {
880
+ render: (Qe = (Ye = (Be = M.updatedAt) == null ? void 0 : Be.column) == null ? void 0 : Ye.columnDef) == null ? void 0 : Qe.cell,
881
+ props: (Ge = (me = M.updatedAt) == null ? void 0 : me.getContext) == null ? void 0 : Ge.call(me)
882
+ }, null, 8, ["render", "props"])
883
+ ])
884
+ ])
885
+ ];
886
+ }),
887
+ _: 2
888
+ }, 1032, ["row"])
889
+ ]),
890
+ _: 1
891
+ }, 8, ["style", "column-defs", "row-data", "loading", "page-size"]))
892
+ ], 10, In)
893
+ ], 2),
894
+ B.value ? (p(), ee(Ht, {
895
+ key: 0,
896
+ show: !0,
897
+ run: I.value,
898
+ "duplicate-sources": c.value,
899
+ "duplicate-source-state": l.value,
900
+ onLoadMoreDuplicateSources: oe,
901
+ "onUpdate:show": n[6] || (n[6] = (F) => B.value = F),
902
+ onSaved: gt
903
+ }, null, 8, ["run", "duplicate-sources", "duplicate-source-state"])) : H("", !0),
904
+ C(Bt, {
905
+ action: K.value,
906
+ run: Z.value,
907
+ "location-name": ((Ce = r(x)._currentLocation) == null ? void 0 : Ce.name) ?? null,
908
+ "duplicate-sources": c.value,
909
+ "duplicate-source-state": l.value,
910
+ onLoadMoreDuplicateSources: oe,
911
+ "at-target": he.value,
912
+ ingredients: J.value,
913
+ "onUpdate:action": yt,
914
+ onEdited: re,
915
+ onIssued: re,
916
+ onRecorded: re,
917
+ onClosed: re,
918
+ onCancelled: re,
919
+ onReload: ht
920
+ }, null, 8, ["action", "run", "location-name", "duplicate-sources", "duplicate-source-state", "at-target", "ingredients"])
921
+ ];
922
+ }),
923
+ _: 1
924
+ }, 8, ["title", "helper-text", "actions"]);
925
+ };
926
+ }
927
+ }), so = /* @__PURE__ */ it(Yn, [["__scopeId", "data-v-53484757"]]);
928
+ export {
929
+ so as default
930
+ };