@feedmepos/mf-inventory-portal 1.8.0-dev.7 → 1.8.0-dev.8

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 (105) hide show
  1. package/dist/App-C8i7vBxz.js +1466 -0
  2. package/dist/{ApprovalView-1Y_jh_UJ.js → ApprovalView-GHgTeCBV.js} +9 -9
  3. package/dist/{BindingsDialog-VMvTLguN.js → BindingsDialog-C4-S2CWk.js} +2 -2
  4. package/dist/{BindingsPicker-KNRM5rMU.js → BindingsPicker-C7YUArBj.js} +2 -2
  5. package/dist/{BindingsTable-CSyNlNCL.js → BindingsTable-1Zoqi4ZS.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-vOeHbWM_.js → BulkReceiveRequestView-Lakk8011.js} +19 -19
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DQuI04Yj.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DFSg0-gv.js} +1 -1
  8. package/dist/{ClosingDraftView-A2pJuhIb.js → ClosingDraftView-CnWFyWSE.js} +20 -20
  9. package/dist/ClosingHistoryView-Bkm0voU6.js +769 -0
  10. package/dist/{ClosingTemplateView-DpkNCyoB.js → ClosingTemplateView-Bz81JTsg.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DOpIDvsy.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-6s-24euf.js} +1 -1
  12. package/dist/{DefaultView-B4UuAqYu.js → DefaultView-1RRzbPB3.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-w0YcNH3F.js → DeliveryOrderPrintPreview-KcLqjOj1.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BimIEHsW.js → EmailDialog.vue_vue_type_script_setup_true_lang-r0Q0qhoK.js} +663 -661
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Cwmk3NLS.js +47 -0
  16. package/dist/FeatureCapabilityGate-C6t1VwKD.js +74 -0
  17. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang--54VR4oB.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-pzIzIWpX.js} +1 -1
  18. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B7j4ZSOe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B6cFB4vX.js} +2 -2
  19. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_o6pX9i.js} +2 -2
  20. package/dist/{FmMultiselectDialog-DMA5eR0C.js → FmMultiselectDialog-CC_Na_p1.js} +2 -2
  21. package/dist/{FmMultiselectDialog-BnZInvgp.js → FmMultiselectDialog-D0GhmOQ9.js} +2 -2
  22. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BXTUsnwN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DQlSMRoB.js} +6 -6
  23. package/dist/{ImportView-C7Hah7MM.js → ImportView-DCcdEvy4.js} +6 -6
  24. package/dist/{IngredientsView-C4-8qNGD.js → IngredientsView-B2I2OPSb.js} +518 -523
  25. package/dist/{IntegrationExplorerView-D3leld2Z.js → IntegrationExplorerView-WK1EmwLA.js} +4 -4
  26. package/dist/{IntegrationView-BhRzry3g.js → IntegrationView-CeaL92Yj.js} +15 -15
  27. package/dist/{InventoryBindingForm-ewAgZ6e-.js → InventoryBindingForm-DgtaDM0I.js} +1 -1
  28. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bpo7Yv9A.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CqDN355J.js} +5 -5
  29. package/dist/{InventoryBindingSummary-e67GzHYr.js → InventoryBindingSummary-C_W456aj.js} +1 -1
  30. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CKEzy2Uo.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BMDjCk9T.js} +1 -1
  31. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js → PlanTierBadge.vue_vue_type_script_setup_true_lang-BSR_nyHY.js} +71 -94
  32. package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-D6-lo7iI.js +79 -0
  33. package/dist/{ProductionRunDetailView-Ct7kr5Ht.js → ProductionRunDetailView-C9rxLBbL.js} +4 -4
  34. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-7u0HQH67.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-DwBY6gIb.js} +7 -7
  35. package/dist/{ProductionRunView-odWyBZGx.js → ProductionRunView-DvMdVGz1.js} +3 -3
  36. package/dist/{PublishView-BXA3k8Cp.js → PublishView-Dv-W6ntx.js} +3 -3
  37. package/dist/{PurchaseOrderPrintPreview-DRugr4BU.js → PurchaseOrderPrintPreview-D1TAnJd_.js} +2 -2
  38. package/dist/{ReceiveRequestView-CeJs9NTD.js → ReceiveRequestView-Rc_uw_Ad.js} +13 -13
  39. package/dist/{RecipeView-BH0REMB3.js → RecipeView-ByUaGc4w.js} +16 -16
  40. package/dist/SettingsView-K5wAt8oo.js +1032 -0
  41. package/dist/StockView-B3EjdjVx.js +2615 -0
  42. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ckw1_xIc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CsRLy0xI.js} +1 -1
  43. package/dist/{SupplierView-DH9u6e2M.js → SupplierView-CLVupRN0.js} +298 -296
  44. package/dist/{SurchargeView-BPVEpc0f.js → SurchargeView-CToB_z5v.js} +7 -7
  45. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BRwxKmwb.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CvqIw9q6.js} +2 -2
  46. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BpiePSmo.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BGPuaJlU.js} +1 -1
  47. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DOQGPKiv.js → TransferDetails.vue_vue_type_script_setup_true_lang-8ydaQEw-.js} +785 -769
  48. package/dist/{TransferTemplateView-CEVRsKL7.js → TransferTemplateView-BnfALwmw.js} +20 -20
  49. package/dist/{UnitCostHistoryView-06rIaX_M.js → UnitCostHistoryView-BMB2MeTh.js} +4 -4
  50. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-C2zidBrl.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Dn8Y8zfp.js} +4 -4
  51. package/dist/{UnitView-Xk_F9SYG.js → UnitView-Bl8jws6R.js} +8 -8
  52. package/dist/{WarehouseView-bmpLmpcX.js → WarehouseView-BurSM1jg.js} +8 -8
  53. package/dist/{WastageTemplateView-CWV1pFxM.js → WastageTemplateView-DRfJ9LGR.js} +15 -15
  54. package/dist/api/license.d.ts +1 -0
  55. package/dist/{app-CURawLhs.js → app-Duum3eHx.js} +16 -16
  56. package/dist/app.js +1 -1
  57. package/dist/{closing-template-q_KGB4jO.js → closing-template-BE41yfue.js} +1 -1
  58. package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
  59. package/dist/components/FeatureCapabilityGate.vue.d.ts +2 -0
  60. package/dist/{date2-3kdweNLp.js → date2-DrhO3BxU.js} +1 -1
  61. package/dist/{dayjs.min-DHE73-wM.js → dayjs.min-CQp6EpOp.js} +1 -1
  62. package/dist/{decimal-CAnQe2Ib.js → decimal-Cq0qUT4r.js} +2 -2
  63. package/dist/{defineDeepModel-CctS67Do.js → defineDeepModel-DRC39nJs.js} +1 -1
  64. package/dist/{duplicate-template-Jk2V2Ezg.js → duplicate-template-j2ymeDNH.js} +1 -1
  65. package/dist/{feature-D9n0IC0c.js → feature-C0hQza5A.js} +125 -103
  66. package/dist/feature-flags/vue.spec.d.ts +1 -0
  67. package/dist/{format-time-from-id-Bmzpbg-8.js → format-time-from-id-BmJoI3jT.js} +1 -1
  68. package/dist/{format-unit-display-CVg4Bl5L.js → format-unit-display-CRgIMXsD.js} +13 -13
  69. package/dist/{id-to-date-DPCcxufP.js → id-to-date-CuFZDvIr.js} +1 -1
  70. package/dist/{import-export.helper-bmGZwUBB.js → import-export.helper-B43zbsbj.js} +6 -6
  71. package/dist/{index-zCBA-X6R.js → index-BYDjs08n.js} +1 -1
  72. package/dist/{index-CFNNQo-7.js → index-Cwvg7EHd.js} +3 -3
  73. package/dist/{index-yt6MlAFG.js → index-DXNYZeq3.js} +1 -1
  74. package/dist/{lz-string-CqlY9MC2.js → lz-string-6DgW1cPF.js} +1 -1
  75. package/dist/{netsuite-DudeltN_.js → netsuite-BSpmyaE1.js} +2 -2
  76. package/dist/{number-BoePMDs8.js → number-5ZeFx-wN.js} +3 -3
  77. package/dist/{predefined-templates-DT32p04n.js → predefined-templates-C0jtb4T7.js} +1 -1
  78. package/dist/{purchase-order-template-LaRpWA04.js → purchase-order-template-B5Pjddfi.js} +1 -1
  79. package/dist/{recalculationUtils-BYN393eE.js → recalculationUtils-DtJWwWSj.js} +1 -1
  80. package/dist/{row-action.enum-BiP5wkT6.js → row-action.enum-BDDJNSi0.js} +1 -1
  81. package/dist/{rules-CQT0uAAo.js → rules-CinZKpvV.js} +2 -2
  82. package/dist/{stock-CVybjhUm.js → stock-1n-4iyqz.js} +3 -3
  83. package/dist/{stock-B9XerL9c.js → stock-BKMDvf5S.js} +1 -1
  84. package/dist/stores/feature.d.ts +5 -0
  85. package/dist/style.css +1 -1
  86. package/dist/{supplier-dpHijd2E.js → supplier-Cv8HRNou.js} +2 -2
  87. package/dist/{surcharge-BZ4STY5J.js → surcharge-ktE1pRyy.js} +1 -1
  88. package/dist/tsconfig.app.tsbuildinfo +1 -1
  89. package/dist/{uom-rules-Da5Lngvp.js → uom-rules-DCnXmEkb.js} +1 -1
  90. package/dist/{use-ingredient-select-dialog-C3YsT5l-.js → use-ingredient-select-dialog-CYUUVrCI.js} +2 -2
  91. package/dist/{use-inventory-binding-dialog-BSsyrcGe.js → use-inventory-binding-dialog-Dugj9i-6.js} +2 -2
  92. package/dist/{use-template-enabled-locations-BmJUzSUm.js → use-template-enabled-locations-BlZ7WAqX.js} +2 -2
  93. package/dist/{use-transfer-locations-frEk_aBH.js → use-transfer-locations-CUDFnsVH.js} +2 -2
  94. package/dist/{useHrmPermission-Cyjm0y9a.js → useHrmPermission-BOwmXi9H.js} +1 -1
  95. package/dist/{useNavigationMenu-CnTsOF9T.js → useNavigationMenu-CbNKFBwx.js} +58 -57
  96. package/dist/{useSseClient-D_7o9nuf.js → useSseClient-CdyQh47h.js} +1 -1
  97. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  98. package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +15 -0
  99. package/dist/{vue-i18n-DwAcG7yc.js → vue-i18n-dSKy66Jh.js} +169 -169
  100. package/dist/{xlsx.util-C7S-uyqm.js → xlsx.util-pjzuMquw.js} +2 -2
  101. package/package.json +5 -5
  102. package/dist/App-Bo29Nwt0.js +0 -1537
  103. package/dist/ClosingHistoryView-woRmvmYT.js +0 -761
  104. package/dist/SettingsView-Dc27wyk-.js +0 -977
  105. package/dist/StockView-DrHLzosW.js +0 -2616
@@ -1,977 +0,0 @@
1
- import { defineComponent as oe, ref as h, computed as H, watch as W, resolveComponent as E, createElementBlock as c, openBlock as o, createElementVNode as l, toDisplayString as D, Fragment as U, renderList as Y, createBlock as O, createCommentVNode as X, createVNode as m, nextTick as _e, createSlots as xe, withCtx as z, normalizeClass as ie, unref as T, withModifiers as he, h as B, Teleport as ke } from "vue";
2
- import { _ as we } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
- import { B as G, g as Fe, r as Te, s as Se, u as Ce, a as te, b as De, c as $e, d as ye, e as Be, f as Ve } from "./predefined-templates-DT32p04n.js";
4
- import { useSnackbar as Ie, components as Q } from "@feedmepos/ui-library";
5
- import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
- import { H as le, I as Oe } from "./app-CURawLhs.js";
7
- import { useCoreStore as fe, useI18n as Pe } from "@feedmepos/mf-common";
8
- import "./dayjs.min-DHE73-wM.js";
9
- import { a as Ee, I as Ue, u as Ae } from "./feature-D9n0IC0c.js";
10
- import { b as Le, a as He, D as Ne } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js";
11
- import { _ as Me } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DQuI04Yj.js";
12
- const Re = { class: "p-3" }, je = { class: "text-sm font-semibold text-gray-700 mb-4 pb-2 border-b border-gray-200" }, Ke = { class: "flex flex-col gap-3" }, qe = {
13
- key: 0,
14
- class: "flex items-center justify-between py-1"
15
- }, Ge = { class: "text-[13px] text-gray-600" }, Ye = { class: "text-[13px] text-gray-600" }, We = ["value", "rows", "placeholder", "onInput"], Je = {
16
- key: 5,
17
- class: "flex items-center justify-between py-1"
18
- }, Qe = { class: "text-[13px] text-gray-600" }, Xe = ["value", "onInput"], Ze = /* @__PURE__ */ oe({
19
- __name: "BlockConfigPanel",
20
- props: {
21
- block: {}
22
- },
23
- emits: ["update"],
24
- setup(j, { emit: k }) {
25
- const S = j, F = k;
26
- function C(u) {
27
- var _;
28
- if ((_ = u.config) != null && _.configFields && Array.isArray(u.config.configFields)) {
29
- const d = u.config.configFields.map((v) => ({ ...v })), x = new Set(d.map((v) => v.key)), s = G[u.tag], b = s ? s.initialConfigFields().filter((v) => !x.has(v.key)) : [];
30
- return [...d, ...b];
31
- }
32
- const i = G[u.tag];
33
- return i ? i.initialConfigFields() : [];
34
- }
35
- const p = h(C(S.block)), P = H(() => {
36
- const u = G[S.block.tag];
37
- return (u == null ? void 0 : u.label) ?? S.block.tag;
38
- });
39
- W(
40
- () => S.block,
41
- (u) => {
42
- p.value = C(u);
43
- },
44
- { deep: !0 }
45
- );
46
- function f(u, i) {
47
- const _ = p.value[u];
48
- _ && (_.value = i, y());
49
- }
50
- function y() {
51
- F("update", {
52
- ...S.block.config || {},
53
- configFields: p.value.map((u) => ({ ...u }))
54
- });
55
- }
56
- return (u, i) => {
57
- const _ = E("FmSwitch"), d = E("FmTextField"), x = E("FmSelect");
58
- return o(), c("div", Re, [
59
- l("div", je, D(P.value) + " Settings ", 1),
60
- l("div", Ke, [
61
- (o(!0), c(U, null, Y(p.value, (s, b) => (o(), c("div", {
62
- key: s.key
63
- }, [
64
- s.type === "toggle" ? (o(), c("div", qe, [
65
- l("label", Ge, D(s.label), 1),
66
- m(_, {
67
- "model-value": s.value,
68
- "onUpdate:modelValue": (v) => f(b, v)
69
- }, null, 8, ["model-value", "onUpdate:modelValue"])
70
- ])) : s.type === "text" ? (o(), O(d, {
71
- key: 1,
72
- label: s.label,
73
- "model-value": s.value,
74
- placeholder: s.placeholder,
75
- "onUpdate:modelValue": (v) => f(b, v)
76
- }, null, 8, ["label", "model-value", "placeholder", "onUpdate:modelValue"])) : s.type === "textarea" ? (o(), c(U, { key: 2 }, [
77
- l("div", Ye, D(s.label), 1),
78
- l("textarea", {
79
- class: "w-full font-mono text-[13px] p-2 border border-gray-300 rounded resize-y box-border focus:outline-none focus:border-blue-600",
80
- value: s.value,
81
- rows: s.rows ?? 8,
82
- placeholder: s.placeholder,
83
- onInput: (v) => f(b, v.target.value)
84
- }, null, 40, We)
85
- ], 64)) : s.type === "select" ? (o(), O(x, {
86
- key: 3,
87
- label: s.label,
88
- "model-value": s.value,
89
- items: s.options || [],
90
- "item-label": "label",
91
- "item-value": "value",
92
- "onUpdate:modelValue": (v) => f(b, v)
93
- }, null, 8, ["label", "model-value", "items", "onUpdate:modelValue"])) : s.type === "number" ? (o(), O(d, {
94
- key: 4,
95
- label: s.label,
96
- type: "number",
97
- "model-value": String(s.value),
98
- "onUpdate:modelValue": (v) => f(b, Number(v))
99
- }, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : s.type === "color" ? (o(), c("div", Je, [
100
- l("label", Qe, D(s.label), 1),
101
- l("input", {
102
- type: "color",
103
- value: s.value,
104
- class: "color-input w-9 h-7 p-0 border border-gray-300 rounded cursor-pointer bg-transparent",
105
- onInput: (v) => f(b, v.target.value)
106
- }, null, 40, Xe)
107
- ])) : X("", !0)
108
- ]))), 128))
109
- ])
110
- ]);
111
- };
112
- }
113
- }), et = /* @__PURE__ */ ze(Ze, [["__scopeId", "data-v-840687bf"]]), tt = { class: "h-full flex flex-col" }, lt = { class: "flex-1 overflow-auto p-4 bg-gray-100" }, ot = /* @__PURE__ */ oe({
114
- __name: "TemplatePreview",
115
- props: {
116
- blocks: {},
117
- previewData: {},
118
- selectedBlockId: {},
119
- templateType: {}
120
- },
121
- setup(j) {
122
- const k = j, S = h(null);
123
- let F = null;
124
- function C() {
125
- return !F && S.value && (F = S.value.attachShadow({ mode: "open" })), F;
126
- }
127
- const p = H(() => k.previewData ?? Fe(k.templateType));
128
- W(
129
- () => [k.blocks, p.value, S.value],
130
- () => {
131
- const f = C();
132
- if (f) {
133
- try {
134
- const y = Te(k.blocks, p.value), u = Se(y);
135
- f.innerHTML = `
136
- <style>
137
- :host { display: block; }
138
- .preview-scale-wrapper {
139
- transform-origin: top left;
140
- transform: scale(0.75);
141
- width: 133.33%;
142
- }
143
- .preview-content {
144
- max-width: 800px;
145
- margin: auto;
146
- padding: 30px;
147
- border: 1px solid #eee;
148
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
149
- background: white;
150
- font-size: 16px;
151
- line-height: 1.5;
152
- font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
153
- color: #555;
154
- }
155
- </style>
156
- <div class="preview-scale-wrapper">
157
- <div class="preview-content">${u}</div>
158
- </div>
159
- `;
160
- } catch (y) {
161
- f.innerHTML = `<div style="color:red;padding:20px;">Error rendering template: ${y}</div>`;
162
- }
163
- _e(() => P(k.selectedBlockId));
164
- }
165
- },
166
- { deep: !0, immediate: !0 }
167
- ), W(
168
- () => k.selectedBlockId,
169
- (f) => P(f)
170
- );
171
- function P(f) {
172
- if (!F || (F.querySelectorAll("[data-block-id].highlight").forEach((u) => {
173
- u.classList.remove("highlight");
174
- }), !f)) return;
175
- const y = F.querySelector(`[data-block-id="${f}"]`);
176
- y && (y.classList.add("highlight"), y.scrollIntoView({ behavior: "smooth", block: "nearest" }));
177
- }
178
- return (f, y) => (o(), c("div", tt, [
179
- y[0] || (y[0] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 border-b border-gray-200" }, " Live Preview ", -1)),
180
- l("div", lt, [
181
- l("div", {
182
- ref_key: "shadowHost",
183
- ref: S
184
- }, null, 512)
185
- ])
186
- ]));
187
- }
188
- }), at = { class: "flex items-center gap-2 text-base font-semibold" }, st = { key: 1 }, nt = { key: 2 }, rt = {
189
- key: 0,
190
- class: "p-6"
191
- }, it = {
192
- key: 0,
193
- class: "flex justify-center items-center h-40 text-gray-400"
194
- }, ut = {
195
- key: 1,
196
- class: "grid grid-cols-2 gap-8"
197
- }, ct = ["onClick"], dt = { class: "flex items-center justify-center w-12 h-12 rounded-xl bg-gray-100 text-gray-500 group-hover:bg-blue-100 group-hover:text-blue-600 transition-colors" }, pt = { class: "text-center" }, mt = { class: "text-sm font-semibold text-gray-700 group-hover:text-blue-700" }, vt = { class: "text-xs text-gray-400 mt-1" }, ft = {
198
- key: 0,
199
- class: "absolute top-2.5 right-2.5 text-[10px] font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full"
200
- }, gt = {
201
- key: 1,
202
- class: "absolute top-2.5 right-2.5 text-[10px] font-medium text-gray-400 bg-gray-100 px-2 py-0.5 rounded-full"
203
- }, yt = {
204
- key: 1,
205
- class: "flex justify-center items-center h-[400px] text-gray-400"
206
- }, bt = {
207
- key: 2,
208
- class: "flex h-[calc(100vh-120px)] border-t border-gray-200"
209
- }, _t = { class: "w-[280px] border-r border-gray-200 overflow-y-auto shrink-0" }, xt = { class: "px-3 pt-3 pb-2" }, ht = { class: "flex flex-col" }, kt = ["onClick"], wt = { class: "border-y border-gray-100" }, Ft = ["onDragstart", "onDragover", "onDrop", "onClick"], Tt = { class: "flex-1" }, St = { class: "flex gap-1 opacity-50 hover:opacity-100" }, Ct = {
210
- key: 0,
211
- class: "py-6 px-4 text-center text-gray-400 text-[13px]"
212
- }, Dt = {
213
- key: 0,
214
- class: "border-t border-gray-200"
215
- }, $t = {
216
- key: 1,
217
- class: "flex items-center justify-center text-gray-400 text-[13px] py-8"
218
- }, Bt = { class: "p-3 border-t border-gray-200" }, Vt = { class: "flex-1 overflow-hidden" }, It = { class: "ml-auto flex gap-2" }, zt = { class: "p-4" }, Ot = { class: "flex items-center gap-1.5 mt-3 text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2" }, Pt = { class: "p-4" }, Et = { class: "flex items-center gap-1.5 mt-3 text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2" }, Ut = /* @__PURE__ */ oe({
219
- __name: "PrintTemplateEditorDialog",
220
- props: {
221
- modelValue: { type: Boolean }
222
- },
223
- emits: ["update:modelValue", "saved"],
224
- setup(j, { emit: k }) {
225
- const S = j, F = k, C = Ce(), p = Ie(), P = fe(), f = H({
226
- get: () => S.modelValue,
227
- set: (n) => F("update:modelValue", n)
228
- }), y = h(!1), u = h(!1), i = h(te()), _ = h(null), d = h(le.Enum.purchaseOrder), x = h("Purchase Order Template"), s = h(null), b = h(!1), v = h(!1), V = h("select-type"), ae = [
229
- {
230
- label: "Purchase Order",
231
- value: le.Enum.purchaseOrder,
232
- icon: "receipt_long",
233
- description: "Customize the layout for purchase order printouts"
234
- },
235
- {
236
- label: "Transfer Order",
237
- value: le.Enum.transferOrder,
238
- icon: "swap_horiz",
239
- description: "Customize the layout for transfer order printouts"
240
- },
241
- {
242
- label: "Goods Received Note",
243
- value: le.Enum.goodsReceivedNote,
244
- icon: "fact_check",
245
- description: "Customize the layout for GRN printouts"
246
- },
247
- {
248
- label: "Delivery Order",
249
- value: le.Enum.deliveryOrder,
250
- icon: "local_shipping",
251
- description: "Customize the layout for delivery order printouts"
252
- }
253
- ], N = h(/* @__PURE__ */ new Set()), Z = H(
254
- () => i.value.find((n) => n.id === _.value) ?? null
255
- ), A = h(null), L = h(null);
256
- W(f, async (n) => {
257
- if (n) {
258
- V.value = "select-type", y.value = !0;
259
- try {
260
- const e = await C.browse();
261
- N.value = new Set(e.map((g) => g.type));
262
- } catch {
263
- } finally {
264
- y.value = !1;
265
- }
266
- }
267
- }), W(d, async () => {
268
- _.value = null, await se();
269
- });
270
- async function ue(n) {
271
- d.value = n, await se(), V.value = "editor";
272
- }
273
- function J() {
274
- return {
275
- purchaseOrder: "Purchase Order Template",
276
- transferOrder: "Transfer Order Template",
277
- goodsReceivedNote: "Goods Received Note Template",
278
- deliveryOrder: "Delivery Order Template"
279
- }[d.value] ?? "Purchase Order Template";
280
- }
281
- async function se() {
282
- y.value = !0;
283
- try {
284
- const n = await C.browse();
285
- N.value = new Set(n.map((g) => g.type));
286
- const e = n.find((g) => g.type === d.value);
287
- e ? (s.value = e._id, x.value = e.name, i.value = e.blocks.map((g) => ({ ...g }))) : (s.value = null, i.value = te(), x.value = J());
288
- } catch {
289
- i.value = te(), x.value = J();
290
- } finally {
291
- y.value = !1;
292
- }
293
- }
294
- function ce(n) {
295
- const e = {
296
- id: $e(),
297
- tag: n,
298
- config: De(n)
299
- };
300
- i.value.push(e), _.value = e.id;
301
- }
302
- function ne(n) {
303
- const e = i.value.findIndex((g) => g.id === n);
304
- e >= 0 && (i.value.splice(e, 1), _.value === n && (_.value = null));
305
- }
306
- function de(n) {
307
- const e = i.value.find((g) => g.id === _.value);
308
- if (e) {
309
- const g = n.configFields || [], ee = ye(e.tag);
310
- e.config = { configFields: g, templateHtml: ee };
311
- }
312
- }
313
- function pe(n) {
314
- A.value = n;
315
- }
316
- function me(n, e) {
317
- n.preventDefault(), L.value = e;
318
- }
319
- function ve() {
320
- L.value = null;
321
- }
322
- function t(n) {
323
- if (A.value === null || A.value === n) {
324
- A.value = null, L.value = null;
325
- return;
326
- }
327
- const e = i.value.splice(A.value, 1)[0];
328
- i.value.splice(n, 0, e), A.value = null, L.value = null;
329
- }
330
- function a() {
331
- A.value = null, L.value = null;
332
- }
333
- async function $() {
334
- var n;
335
- u.value = !0;
336
- try {
337
- const e = (n = P.currentBusiness.value) == null ? void 0 : n._id;
338
- if (!e)
339
- throw new Error("Business ID is missing. Please select a business first.");
340
- const g = i.value.map((r) => {
341
- var ge;
342
- const I = ((ge = r.config) == null ? void 0 : ge.configFields) || [], q = ye(r.tag, I);
343
- return {
344
- ...r,
345
- config: { configFields: I, templateHtml: q }
346
- };
347
- }), ee = Be(g), M = {
348
- name: x.value,
349
- type: d.value,
350
- blocks: ee,
351
- businessId: e,
352
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
353
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
354
- };
355
- let R;
356
- s.value ? R = await C.update(s.value, {
357
- _id: s.value,
358
- ...M
359
- }) : (R = await C.create(M), s.value = R._id), N.value.add(d.value), v.value = !1, p == null || p.open({
360
- title: "Success",
361
- message: "Print template saved",
362
- type: "success"
363
- }), F("saved", R), f.value = !1;
364
- } catch (e) {
365
- p == null || p.open({
366
- title: "Error",
367
- message: (e == null ? void 0 : e.message) || "Failed to save template",
368
- type: "error"
369
- });
370
- } finally {
371
- u.value = !1;
372
- }
373
- }
374
- async function K() {
375
- if (s.value) {
376
- u.value = !0;
377
- try {
378
- await C.delete(s.value), s.value = null, i.value = te(), x.value = J(), N.value.delete(d.value), b.value = !1, p == null || p.open({
379
- title: "Deleted",
380
- message: "Print template deleted. Default layout will be used.",
381
- type: "success"
382
- }), F("saved", null), f.value = !1;
383
- } catch (n) {
384
- p == null || p.open({
385
- title: "Error",
386
- message: (n == null ? void 0 : n.message) || "Failed to delete template",
387
- type: "error"
388
- });
389
- } finally {
390
- u.value = !1;
391
- }
392
- }
393
- }
394
- function w() {
395
- i.value = te(), _.value = null;
396
- }
397
- function re(n) {
398
- var e;
399
- return ((e = G[n]) == null ? void 0 : e.label) ?? n;
400
- }
401
- function be(n) {
402
- var e;
403
- return ((e = G[n]) == null ? void 0 : e.icon) ?? "widgets";
404
- }
405
- return (n, e) => {
406
- const g = E("FmIcon"), ee = E("FmTextField"), M = E("FmButton"), R = E("FmDialog");
407
- return o(), c(U, null, [
408
- m(R, {
409
- modelValue: f.value,
410
- "onUpdate:modelValue": e[4] || (e[4] = (r) => f.value = r),
411
- overlay: !0,
412
- "close-button": "",
413
- "max-width": "98vw",
414
- "max-height": "98vh"
415
- }, xe({
416
- "dialog-header": z(() => {
417
- var r;
418
- return [
419
- l("div", at, [
420
- V.value === "editor" ? (o(), c("button", {
421
- key: 0,
422
- class: "flex items-center justify-center w-7 h-7 rounded hover:bg-gray-100 transition-colors text-gray-500",
423
- onClick: e[0] || (e[0] = (I) => V.value = "select-type")
424
- }, [
425
- m(g, {
426
- name: "arrow_back",
427
- size: "sm"
428
- })
429
- ])) : X("", !0),
430
- V.value === "select-type" ? (o(), c("span", st, "Print Template Editor")) : (o(), c("span", nt, D((r = ae.find((I) => I.value === d.value)) == null ? void 0 : r.label) + " Template", 1))
431
- ])
432
- ];
433
- }),
434
- default: z(() => [
435
- V.value === "select-type" ? (o(), c("div", rt, [
436
- e[7] || (e[7] = l("p", { class: "text-sm text-gray-500 mb-5" }, " Select a template type to customize its print layout. ", -1)),
437
- y.value ? (o(), c("div", it, " Loading... ")) : (o(), c("div", ut, [
438
- (o(), c(U, null, Y(ae, (r) => l("div", {
439
- key: r.value,
440
- class: ie(["group relative flex flex-col items-center gap-3 p-6 rounded-xl border-2 border-gray-200 cursor-pointer transition-all hover:border-blue-400 hover:shadow-md", {
441
- "border-blue-500 bg-blue-50/50 shadow-md": d.value === r.value && V.value === "select-type"
442
- }]),
443
- onClick: (I) => ue(r.value)
444
- }, [
445
- l("div", dt, [
446
- m(g, {
447
- name: r.icon,
448
- size: "sm"
449
- }, null, 8, ["name"])
450
- ]),
451
- l("div", pt, [
452
- l("div", mt, D(r.label), 1),
453
- l("div", vt, D(r.description), 1)
454
- ]),
455
- N.value.has(r.value) ? (o(), c("span", ft, "Customized")) : (o(), c("span", gt, "Default"))
456
- ], 10, ct)), 64))
457
- ]))
458
- ])) : y.value ? (o(), c("div", yt, e[8] || (e[8] = [
459
- l("div", null, "Loading template...", -1)
460
- ]))) : (o(), c("div", bt, [
461
- l("div", _t, [
462
- l("div", xt, [
463
- m(ee, {
464
- modelValue: x.value,
465
- "onUpdate:modelValue": e[1] || (e[1] = (r) => x.value = r),
466
- placeholder: "Template name",
467
- label: "Template Name"
468
- }, null, 8, ["modelValue"])
469
- ]),
470
- e[9] || (e[9] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2" }, " Add Blocks ", -1)),
471
- l("div", ht, [
472
- (o(!0), c(U, null, Y(T(Oe).Values, (r) => (o(), c("div", {
473
- key: r,
474
- class: "group flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 transition-colors hover:bg-gray-100",
475
- onClick: (I) => ce(r)
476
- }, [
477
- m(g, {
478
- name: T(G)[r].icon,
479
- size: "sm"
480
- }, null, 8, ["name"]),
481
- l("span", null, D(T(G)[r].label), 1),
482
- m(g, {
483
- name: "add",
484
- size: "sm",
485
- class: "ml-auto opacity-0 text-blue-600 group-hover:opacity-100"
486
- })
487
- ], 8, kt))), 128))
488
- ]),
489
- e[10] || (e[10] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 mt-2" }, " Block Order ", -1)),
490
- l("div", wt, [
491
- (o(!0), c(U, null, Y(i.value, (r, I) => (o(), c("div", {
492
- key: r.id,
493
- class: ie(["flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 border-b border-gray-100 transition-colors hover:bg-gray-100", {
494
- "bg-blue-50 border-l-[3px] border-l-blue-600": r.id === _.value,
495
- "border-t-2 border-t-blue-600": L.value === I
496
- }]),
497
- draggable: "true",
498
- onDragstart: (q) => pe(I),
499
- onDragover: (q) => me(q, I),
500
- onDragleave: ve,
501
- onDrop: (q) => t(I),
502
- onDragend: a,
503
- onClick: (q) => _.value = r.id
504
- }, [
505
- m(g, {
506
- name: "drag_indicator",
507
- size: "sm",
508
- class: "cursor-grab text-gray-300"
509
- }),
510
- m(g, {
511
- name: be(r.tag),
512
- size: "sm"
513
- }, null, 8, ["name"]),
514
- l("span", Tt, D(re(r.tag)), 1),
515
- l("div", St, [
516
- m(g, {
517
- name: "delete",
518
- size: "sm",
519
- class: "cursor-pointer text-gray-400 hover:text-red-500",
520
- onClick: he((q) => ne(r.id), ["stop"])
521
- }, null, 8, ["onClick"])
522
- ])
523
- ], 42, Ft))), 128)),
524
- i.value.length === 0 ? (o(), c("div", Ct, " Click a block above to add it ")) : X("", !0)
525
- ]),
526
- Z.value ? (o(), c("div", Dt, [
527
- (o(), O(et, {
528
- key: Z.value.id,
529
- block: Z.value,
530
- onUpdate: de
531
- }, null, 8, ["block"]))
532
- ])) : (o(), c("div", $t, " Select a block to configure it ")),
533
- l("div", Bt, [
534
- m(M, {
535
- label: "Reset to Default",
536
- variant: "plain",
537
- size: "md",
538
- onClick: w
539
- })
540
- ])
541
- ]),
542
- l("div", Vt, [
543
- m(ot, {
544
- blocks: i.value,
545
- "selected-block-id": _.value,
546
- "template-type": d.value
547
- }, null, 8, ["blocks", "selected-block-id", "template-type"])
548
- ])
549
- ]))
550
- ]),
551
- _: 2
552
- }, [
553
- V.value === "editor" ? {
554
- name: "dialog-footer",
555
- fn: z(() => [
556
- l("div", It, [
557
- s.value ? (o(), O(M, {
558
- key: 0,
559
- label: "Delete Template",
560
- variant: "destructive",
561
- size: "md",
562
- onClick: e[2] || (e[2] = (r) => b.value = !0)
563
- })) : X("", !0),
564
- m(M, {
565
- label: "Save Template",
566
- variant: "primary",
567
- size: "md",
568
- onClick: e[3] || (e[3] = (r) => v.value = !0)
569
- })
570
- ])
571
- ]),
572
- key: "0"
573
- } : void 0
574
- ]), 1032, ["modelValue"]),
575
- m(R, {
576
- modelValue: v.value,
577
- "onUpdate:modelValue": e[5] || (e[5] = (r) => v.value = r),
578
- overlay: !0,
579
- dismissAway: !0,
580
- "close-button": "",
581
- "max-width": "400px"
582
- }, {
583
- "dialog-header": z(() => e[11] || (e[11] = [
584
- l("span", null, "Save Print Template?", -1)
585
- ])),
586
- "dialog-footer": z(() => [
587
- m(M, {
588
- class: "ml-auto",
589
- label: "Save",
590
- variant: "primary",
591
- size: "md",
592
- loading: u.value,
593
- onClick: $
594
- }, null, 8, ["loading"])
595
- ]),
596
- default: z(() => [
597
- l("div", zt, [
598
- e[13] || (e[13] = l("p", null, "Are you sure you want to save this print template?", -1)),
599
- e[14] || (e[14] = l("p", { class: "text-gray-500 text-sm mt-2" }, " This template will be used for all future prints of this type. ", -1)),
600
- l("div", Ot, [
601
- m(g, {
602
- name: "warning",
603
- size: "sm"
604
- }),
605
- e[12] || (e[12] = l("span", null, "This will affect all locations under this business.", -1))
606
- ])
607
- ])
608
- ]),
609
- _: 1
610
- }, 8, ["modelValue"]),
611
- m(R, {
612
- modelValue: b.value,
613
- "onUpdate:modelValue": e[6] || (e[6] = (r) => b.value = r),
614
- overlay: !0,
615
- dismissAway: !0,
616
- "close-button": "",
617
- "max-width": "400px"
618
- }, {
619
- "dialog-header": z(() => e[15] || (e[15] = [
620
- l("span", null, "Delete Print Template?", -1)
621
- ])),
622
- "dialog-footer": z(() => [
623
- m(M, {
624
- class: "ml-auto",
625
- label: "Delete",
626
- variant: "destructive",
627
- size: "md",
628
- loading: u.value,
629
- onClick: K
630
- }, null, 8, ["loading"])
631
- ]),
632
- default: z(() => [
633
- l("div", Pt, [
634
- e[17] || (e[17] = l("p", null, "Are you sure you want to delete this print template?", -1)),
635
- e[18] || (e[18] = l("p", { class: "text-gray-500 text-sm mt-2" }, " The default print layout will be used for all future prints. ", -1)),
636
- l("div", Et, [
637
- m(g, {
638
- name: "warning",
639
- size: "sm"
640
- }),
641
- e[16] || (e[16] = l("span", null, "This will affect all locations under this business.", -1))
642
- ])
643
- ])
644
- ]),
645
- _: 1
646
- }, 8, ["modelValue"])
647
- ], 64);
648
- };
649
- }
650
- }), At = { class: "flex min-h-0 w-full flex-col gap-12" }, Lt = { class: "flex w-full flex-wrap items-center gap-8" }, Ht = /* @__PURE__ */ oe({
651
- __name: "FeatureFlagView",
652
- setup(j) {
653
- const k = Ae(), S = fe(), F = Ee(), C = Q.FmSwitch, p = Q.FmTable, P = Q.FmMenu, f = Q.FmMenuDivider, y = Q.FmMenuHeader, u = Q.FmMenuItem, i = /* @__PURE__ */ new Set(), _ = {
654
- inventory_pos_closing_v1: "Use v2: Closing Draft and Closing Template.",
655
- inventory_pos_convert_v1: "Use Production Item instead."
656
- }, d = h([]), x = h(null), s = ["In use", "Deprecate Soon", "Deprecated"], b = h(null), v = h({}), V = h(!1), ae = {
657
- inventory_netsuite_inventory_transfer_out: ["netsuite"],
658
- inventory_portal_accept_require_fulfillment: ["mobile"],
659
- inventory_portal_must_use_transfer_template: ["mobile"],
660
- inventory_portal_po_operate_v2: ["mobile"],
661
- inventory_portal_xilnex_transfer_note: ["mobile"],
662
- inventory_pos_adjust_v1: ["mobile", "pos-v7", "pos-7.8"],
663
- inventory_pos_adjust_v2_wastage: ["mobile", "pos-v7", "pos-7.8"],
664
- inventory_pos_allow_receive_order: ["mobile", "pos-v7", "pos-7.8"],
665
- inventory_pos_closing_v1: ["mobile", "pos-v7", "pos-7.8"],
666
- inventory_pos_closing_v2: ["mobile", "pos-v7", "pos-7.8"],
667
- inventory_pos_convert_v1: ["mobile", "pos-v7", "pos-7.8"],
668
- inventory_pos_costing: ["mobile"],
669
- inventory_pos_stock_return: ["mobile"],
670
- inventory_pos_transfer_require_fulfillment: ["mobile", "pos-v7", "pos-7.8"],
671
- inventory_purchase_order_approval: ["mobile"]
672
- }, N = H(
673
- () => Object.values(Ue).map((t) => {
674
- const a = k.flags.find(($) => $.name === t);
675
- return {
676
- name: t,
677
- enabled: (a == null ? void 0 : a.enabled) ?? null,
678
- domains: ["portal", ...ae[t] ?? []],
679
- features: Le(t)
680
- };
681
- })
682
- ), Z = H(
683
- () => [...new Set(N.value.flatMap((t) => t.domains))].sort()
684
- ), A = H(
685
- () => N.value.filter(
686
- (t) => (d.value.length === 0 || d.value.some((a) => t.domains.includes(a))) && (!x.value || ne(t) === x.value)
687
- )
688
- );
689
- function L(t) {
690
- d.value = d.value.includes(t) ? d.value.filter((a) => a !== t) : [...d.value, t];
691
- }
692
- function ue() {
693
- d.value = [], x.value = null;
694
- }
695
- function J(t) {
696
- return t.domains.includes("mobile") || t.domains.some((a) => a.startsWith("pos-"));
697
- }
698
- function se(t) {
699
- return b.value && J(t) ? v.value[t.name] === !0 : t.enabled === !0;
700
- }
701
- async function ce(t) {
702
- if (!t) {
703
- v.value = {};
704
- return;
705
- }
706
- const a = t;
707
- V.value = !0;
708
- try {
709
- const { flags: $ } = await F.listForScope(a);
710
- b.value === a && (v.value = Object.fromEntries($.map((K) => [K.name, K.enabled])));
711
- } catch ($) {
712
- console.error("Unable to load feature flags for the selected scope", $), b.value === a && (v.value = {});
713
- } finally {
714
- b.value === a && (V.value = !1);
715
- }
716
- }
717
- W(
718
- () => {
719
- var t;
720
- return (t = S.currentBusiness.value) != null && t._id ? `business_${S.currentBusiness.value._id}` : null;
721
- },
722
- (t) => {
723
- b.value || (b.value = t);
724
- },
725
- { immediate: !0 }
726
- ), W(b, ce, { immediate: !0 });
727
- function ne(t) {
728
- return i.has(t.name) ? "Deprecated" : _[t.name] ? "Deprecate Soon" : "In use";
729
- }
730
- function de(t) {
731
- return t === "Deprecated" ? "bg-red-50 text-red-700" : t === "Deprecate Soon" ? "bg-fm-color-state-warning-subtle text-fm-color-state-warning-base" : "bg-green-50 text-green-700";
732
- }
733
- function pe(t) {
734
- return t.features.length === 0 ? ["Controls the availability of this inventory feature."] : t.features.length === 1 ? [t.features[0].controls] : t.features.map((a) => `${a.label}: ${a.controls}`);
735
- }
736
- function me(t) {
737
- return i.has(t.name) ? "This flag is deprecated. Use its supported replacement for new work." : _[t.name];
738
- }
739
- const ve = H(() => [
740
- {
741
- accessorKey: "name",
742
- header: "Feature flag",
743
- meta: { width: "27%" },
744
- cell: ({ row: t }) => B("div", { class: "flex flex-wrap items-center gap-2" }, [
745
- B("span", { class: "break-all font-mono text-xs text-gray-700" }, t.original.name),
746
- ...t.original.features.slice(0, 1).map(
747
- (a) => B(He, {
748
- tier: a.category === "premium" ? "premium" : "standard",
749
- category: a.category,
750
- deprecateSoon: a.deprecateSoon,
751
- informative: !0
752
- })
753
- )
754
- ])
755
- },
756
- {
757
- id: "domains",
758
- header: "Domains",
759
- meta: { width: "19%" },
760
- cell: ({ row: t }) => B(
761
- "div",
762
- { class: "flex flex-wrap gap-2" },
763
- t.original.domains.map(
764
- (a) => B(
765
- "span",
766
- {
767
- class: "rounded-full bg-fm-color-neutral-gray-100 px-2 py-0.5 text-xs font-medium text-fm-color-typo-secondary"
768
- },
769
- a
770
- )
771
- )
772
- )
773
- },
774
- {
775
- id: "description",
776
- header: "Description",
777
- meta: { width: "29%" },
778
- cell: ({ row: t }) => {
779
- const a = me(t.original);
780
- return B("div", { class: "flex flex-col gap-2 text-xs" }, [
781
- ...pe(t.original).map(
782
- ($) => B("span", { class: "text-fm-color-typo-secondary" }, $)
783
- ),
784
- ...a ? [B("span", { class: "text-fm-color-state-warning-base" }, a)] : []
785
- ]);
786
- }
787
- },
788
- {
789
- id: "status",
790
- header: "Status",
791
- meta: { width: "13%" },
792
- cell: ({ row: t }) => {
793
- const a = ne(t.original);
794
- return a === "Deprecate Soon" ? B(Ne) : B(
795
- "span",
796
- {
797
- class: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${de(a)}`
798
- },
799
- a
800
- );
801
- }
802
- },
803
- {
804
- id: "availability",
805
- header: "Availability",
806
- meta: { width: "12%" },
807
- cell: ({ row: t }) => {
808
- const a = !!b.value && J(t.original);
809
- return B("div", { class: "flex flex-col items-end gap-2" }, [
810
- B(C, { modelValue: se(t.original), disabled: !0, showIcon: !0 }),
811
- ...a && V.value ? [B("span", { class: "text-xs text-gray-500" }, "Loading location value…")] : [],
812
- ...t.original.features.some(($) => $.category === "premium") && t.original.enabled !== !0 && !a ? [B("span", { class: "text-xs text-gray-500" }, "Controlled by the Premium plan")] : []
813
- ]);
814
- }
815
- }
816
- ]);
817
- return (t, a) => {
818
- const $ = E("FmChip"), K = E("FmButton");
819
- return o(), c("div", At, [
820
- l("div", Lt, [
821
- m(Me, {
822
- "model-value": b.value,
823
- "onUpdate:modelValue": a[0] || (a[0] = (w) => b.value = w),
824
- "selection-only": "",
825
- "show-business": ""
826
- }, null, 8, ["model-value"]),
827
- (o(!0), c(U, null, Y(d.value, (w) => (o(), O($, {
828
- key: w,
829
- label: `domain in ${w}`,
830
- removable: "",
831
- onChipClosed: (re) => L(w)
832
- }, null, 8, ["label", "onChipClosed"]))), 128)),
833
- x.value ? (o(), O($, {
834
- key: 0,
835
- label: `status in ${x.value}`,
836
- removable: "",
837
- onChipClosed: a[1] || (a[1] = (w) => x.value = null)
838
- }, null, 8, ["label"])) : X("", !0),
839
- m(T(P), {
840
- "close-on-click": !1,
841
- width: 288,
842
- "max-height": 420,
843
- placement: "bottom-start"
844
- }, {
845
- "menu-button": z(() => [
846
- m(K, {
847
- label: "Filter",
848
- "prepend-icon": "add",
849
- variant: "secondary"
850
- })
851
- ]),
852
- default: z(() => [
853
- m(T(y), { label: "Domains" }),
854
- (o(!0), c(U, null, Y(Z.value, (w) => (o(), O(T(u), {
855
- key: w,
856
- label: w,
857
- selectable: "",
858
- "has-checkbox": "",
859
- "model-value": d.value.includes(w),
860
- onClick: (re) => L(w)
861
- }, null, 8, ["label", "model-value", "onClick"]))), 128)),
862
- m(T(f)),
863
- m(T(y), { label: "Status" }),
864
- (o(), c(U, null, Y(s, (w) => m(T(u), {
865
- key: w,
866
- label: w,
867
- selectable: "",
868
- "has-checkbox": "",
869
- "model-value": x.value === w,
870
- onClick: (re) => x.value = x.value === w ? null : w
871
- }, null, 8, ["label", "model-value", "onClick"])), 64))
872
- ]),
873
- _: 1
874
- }),
875
- d.value.length || x.value ? (o(), O(K, {
876
- key: 1,
877
- label: "Clear all",
878
- variant: "tertiary",
879
- onClick: ue
880
- })) : X("", !0)
881
- ]),
882
- m(T(p), {
883
- "column-defs": ve.value,
884
- "row-data": A.value,
885
- "page-size": 50,
886
- "hide-footer": "",
887
- "shrink-at": !1
888
- }, null, 8, ["column-defs", "row-data"])
889
- ]);
890
- };
891
- }
892
- }), Nt = { class: "flex w-full flex-col gap-16 p-16" }, Mt = {
893
- key: 0,
894
- class: "py-32 text-center"
895
- }, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jt = {
896
- class: "flex gap-2 border-b border-gray-200",
897
- role: "tablist"
898
- }, Kt = ["aria-selected"], qt = ["aria-selected"], Gt = { key: 0 }, Yt = { class: "flex items-center justify-between gap-12" }, Wt = { class: "fm-typo-en-heading-sm-600 text-fm-color-typo-primary" }, Jt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qt = {
899
- key: 1,
900
- class: "w-full"
901
- }, Xt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, cl = /* @__PURE__ */ oe({
902
- __name: "SettingsView",
903
- setup(j) {
904
- const { t: k } = Pe(), S = fe(), F = Ve(), C = h(!1), p = h("order"), P = H(() => {
905
- var u, i;
906
- return ((i = (u = S.sessionUser.value) == null ? void 0 : u.role) == null ? void 0 : i.isAdmin) === !0;
907
- });
908
- function f() {
909
- F.invalidate(), F.fetchTemplates();
910
- }
911
- function y() {
912
- F.fetchTemplates(), C.value = !0;
913
- }
914
- return (u, i) => {
915
- const _ = E("FmButton");
916
- return o(), O(we, {
917
- title: T(k)("inventory.settings.title")
918
- }, {
919
- default: z(() => [
920
- l("div", Nt, [
921
- P.value ? (o(), c(U, { key: 1 }, [
922
- l("div", jt, [
923
- l("button", {
924
- type: "button",
925
- role: "tab",
926
- "aria-selected": p.value === "order",
927
- class: ie([
928
- "border-b-2 px-3 py-2 text-sm font-medium",
929
- p.value === "order" ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-gray-500"
930
- ]),
931
- onClick: i[0] || (i[0] = (d) => p.value = "order")
932
- }, D(T(k)("inventory.settings.order.title")), 11, Kt),
933
- l("button", {
934
- type: "button",
935
- role: "tab",
936
- "aria-selected": p.value === "features",
937
- class: ie([
938
- "border-b-2 px-3 py-2 text-sm font-medium",
939
- p.value === "features" ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-gray-500"
940
- ]),
941
- onClick: i[1] || (i[1] = (d) => p.value = "features")
942
- }, D(T(k)("inventory.settings.features.title")), 11, qt)
943
- ]),
944
- p.value === "order" ? (o(), c("div", Gt, [
945
- l("div", Yt, [
946
- l("h2", Wt, D(T(k)("inventory.settings.order.printTemplates")), 1),
947
- m(_, {
948
- onClick: y,
949
- variant: "secondary",
950
- label: T(k)("inventory.settings.printTemplate.edit")
951
- }, null, 8, ["label"])
952
- ]),
953
- l("p", Jt, D(T(k)("inventory.settings.printTemplate.description")), 1)
954
- ])) : (o(), c("div", Qt, [
955
- l("p", Xt, D(T(k)("inventory.settings.features.description")), 1),
956
- m(Ht)
957
- ]))
958
- ], 64)) : (o(), c("div", Mt, [
959
- l("p", Rt, D(T(k)("inventory.settings.adminOnly")), 1)
960
- ]))
961
- ]),
962
- (o(), O(ke, { to: "body" }, [
963
- m(Ut, {
964
- modelValue: C.value,
965
- "onUpdate:modelValue": i[2] || (i[2] = (d) => C.value = d),
966
- onSaved: f
967
- }, null, 8, ["modelValue"])
968
- ]))
969
- ]),
970
- _: 1
971
- }, 8, ["title"]);
972
- };
973
- }
974
- });
975
- export {
976
- cl as default
977
- };