@feedmepos/mf-settings 0.0.50-prod → 0.0.51

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.
@@ -1,49 +1,49 @@
1
- import { unref as n, defineComponent as A, openBlock as v, createElementBlock as y, ref as f, watch as $, computed as j, watchEffect as G, onBeforeUnmount as P, resolveComponent as h, createVNode as g, withCtx as W, createElementVNode as s, toDisplayString as b, Fragment as z, renderList as R, normalizeClass as Z, createBlock as q, createCommentVNode as Q } from "vue";
2
- import { useCoreStore as Y, useI18n as J, CountryOptions as K } from "@feedmepos/mf-common";
3
- import { _ as X, r as ee } from "./rules-c9fa22f8.js";
4
- import { b as w } from "./business-93826a8c.js";
1
+ import { unref as n, defineComponent as M, openBlock as g, createElementBlock as y, ref as f, computed as L, watch as G, watchEffect as P, onBeforeUnmount as W, resolveComponent as h, createVNode as v, withCtx as z, createElementVNode as s, toDisplayString as b, Fragment as R, renderList as Z, normalizeClass as q, createBlock as Q, createCommentVNode as Y } from "vue";
2
+ import { useCoreStore as J, useI18n as K, CountryOptions as X } from "@feedmepos/mf-common";
3
+ import { _ as ee, r as te } from "./rules-c9fa22f8.js";
4
+ import { b as w } from "./business-9a4e5bd7.js";
5
5
  import "./index-f1e5e565.js";
6
- import { useSnackbar as te } from "@feedmepos/ui-library";
7
- import { u as se, F as ne } from "./loading-6ee8ebc9.js";
8
- import { useRouter as oe } from "vue-router";
6
+ import { useSnackbar as se } from "@feedmepos/ui-library";
7
+ import { u as ne, F as oe } from "./loading-84215dce.js";
8
+ import { useRouter as le } from "vue-router";
9
9
  import "pinia";
10
- function L(r) {
10
+ function S(r) {
11
11
  return typeof r == "function" ? r() : n(r);
12
12
  }
13
13
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
14
- const S = () => {
14
+ const A = () => {
15
15
  };
16
- function le(r, e) {
16
+ function ie(r, e) {
17
17
  function o(...t) {
18
- return new Promise((c, u) => {
19
- Promise.resolve(r(() => e.apply(this, t), { fn: e, thisArg: this, args: t })).then(c).catch(u);
18
+ return new Promise((c, d) => {
19
+ Promise.resolve(r(() => e.apply(this, t), { fn: e, thisArg: this, args: t })).then(c).catch(d);
20
20
  });
21
21
  }
22
22
  return o;
23
23
  }
24
- function ie(r, e = {}) {
25
- let o, t, c = S;
26
- const u = (_) => {
27
- clearTimeout(_), c(), c = S;
24
+ function ae(r, e = {}) {
25
+ let o, t, c = A;
26
+ const d = (_) => {
27
+ clearTimeout(_), c(), c = A;
28
28
  };
29
29
  return (_) => {
30
- const l = L(r), i = L(e.maxWait);
31
- return o && u(o), l <= 0 || i !== void 0 && i <= 0 ? (t && (u(t), t = null), Promise.resolve(_())) : new Promise((m, C) => {
32
- c = e.rejectOnCancel ? C : m, i && !t && (t = setTimeout(() => {
33
- o && u(o), t = null, m(_());
30
+ const l = S(r), i = S(e.maxWait);
31
+ return o && d(o), l <= 0 || i !== void 0 && i <= 0 ? (t && (d(t), t = null), Promise.resolve(_())) : new Promise((p, C) => {
32
+ c = e.rejectOnCancel ? C : p, i && !t && (t = setTimeout(() => {
33
+ o && d(o), t = null, p(_());
34
34
  }, i)), o = setTimeout(() => {
35
- t && u(t), t = null, m(_());
35
+ t && d(t), t = null, p(_());
36
36
  }, l);
37
37
  });
38
38
  };
39
39
  }
40
- function ae(r, e = 200, o = {}) {
41
- return le(
42
- ie(e, o),
40
+ function re(r, e = 200, o = {}) {
41
+ return ie(
42
+ ae(e, o),
43
43
  r
44
44
  );
45
45
  }
46
- const re = `<svg width="388" height="388" viewBox="0 0 388 388" fill="none" xmlns="http://www.w3.org/2000/svg">
46
+ const ce = `<svg width="388" height="388" viewBox="0 0 388 388" fill="none" xmlns="http://www.w3.org/2000/svg">
47
47
  <path d="M239.449 0H148.553C66.5106 0 0.00195312 66.5086 0.00195312 148.551V239.447C0.00195312 321.489 66.5106 387.998 148.553 387.998H239.449C321.491 387.998 388 321.489 388 239.447V148.551C388 66.5086 321.491 0 239.449 0Z" fill="url(#paint0_linear_8849_557)" style=""/>
48
48
  <mask id="mask0_8849_557" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="388" height="388">
49
49
  <path d="M239.447 0H148.551C66.5086 0 0 66.5086 0 148.551V239.447C0 321.489 66.5086 387.998 148.551 387.998H239.447C321.49 387.998 387.998 321.489 387.998 239.447V148.551C387.998 66.5086 321.49 0 239.447 0Z" fill="white" style="fill:white;fill:white;fill-opacity:1;"/>
@@ -58,57 +58,57 @@ const re = `<svg width="388" height="388" viewBox="0 0 388 388" fill="none" xmln
58
58
  </linearGradient>
59
59
  </defs>
60
60
  </svg>
61
- `, ce = ["innerHTML"], ue = /* @__PURE__ */ A({
61
+ `, ue = ["innerHTML"], de = /* @__PURE__ */ M({
62
62
  __name: "FeedmeLogo",
63
63
  setup(r) {
64
- return (e, o) => (v(), y("div", {
64
+ return (e, o) => (g(), y("div", {
65
65
  class: "logo",
66
66
  style: { width: "54px", height: "54px" },
67
- innerHTML: n(re)
68
- }, null, 8, ce));
67
+ innerHTML: n(ce)
68
+ }, null, 8, ue));
69
69
  }
70
70
  });
71
- const de = /* @__PURE__ */ X(ue, [["__scopeId", "data-v-c0191534"]]), me = { class: "flex flex-col justify-center items-center bg-fm-color-neutral-white py-24" }, pe = { class: "space-y-32" }, _e = { class: "space-y-8" }, fe = { class: "fm-typo-en-title-lg-600" }, ge = { class: "space-y-8" }, ve = { class: "fm-typo-en-title-sm-600" }, he = { class: "flex gap-16" }, be = ["onClick"], ye = { class: "space-y-8" }, Ce = { class: "m-8 w-[33px]" }, we = ["innerHTML"], xe = { class: "fm-typo-en-body-sm-600" }, Fe = { class: "space-y-16" }, De = /* @__PURE__ */ A({
71
+ const me = /* @__PURE__ */ ee(de, [["__scopeId", "data-v-c0191534"]]), pe = { class: "flex flex-col justify-center items-center bg-fm-color-neutral-white py-24" }, _e = { class: "space-y-32" }, fe = { class: "space-y-8" }, ve = { class: "fm-typo-en-title-lg-600" }, ge = { class: "space-y-8" }, he = { class: "fm-typo-en-title-sm-600" }, be = { class: "flex gap-16" }, ye = ["onClick"], Ce = { class: "space-y-8" }, we = { class: "m-8 w-[33px]" }, xe = ["innerHTML"], Fe = { class: "fm-typo-en-body-sm-600" }, Ve = { class: "space-y-16" }, Ie = /* @__PURE__ */ M({
72
72
  __name: "CreateBusiness",
73
73
  setup(r) {
74
74
  var V;
75
- oe();
76
- const e = Y(), o = f(""), t = f(""), c = f(""), u = f(!0), x = te(), _ = se(x), { t: l } = J(), i = f(((V = e.currentCountry.value) == null ? void 0 : V.toUpperCase()) || "MY"), m = f([]);
77
- $(
75
+ le();
76
+ const e = J(), o = f(""), t = f(""), c = f(""), d = f(!0), x = se(), _ = ne(x), { t: l } = K(), i = f(((V = e.currentCountry.value) == null ? void 0 : V.toUpperCase()) || "MY"), p = f([]), C = L(() => X.filter((u) => e.enabledCountries.value.includes(u.code)));
77
+ G(
78
78
  i,
79
- (p) => {
80
- w.readBusinesses(i.value).then((d) => {
81
- m.value = d;
79
+ (u) => {
80
+ w.readBusinesses(i.value).then((m) => {
81
+ p.value = m;
82
82
  });
83
83
  },
84
84
  { immediate: !0 }
85
85
  );
86
- async function C() {
86
+ async function D() {
87
87
  try {
88
- const p = await w.readAgentByCode(t.value);
89
- c.value = p ? p.id : "";
88
+ const u = await w.readAgentByCode(t.value);
89
+ c.value = u ? u.id : "";
90
90
  } catch {
91
91
  c.value = "";
92
92
  }
93
- u.value = !!c.value;
93
+ d.value = !!c.value;
94
94
  }
95
- const M = ae(C, 500), D = j(() => !!(F.value || m.value.length > 0 || t.value && !c.value)), F = f(!1);
96
- async function I() {
95
+ const I = re(D, 500), O = L(() => !!(F.value || p.value.length > 0 || t.value && !c.value)), F = f(!1);
96
+ async function E() {
97
97
  _.minor(
98
98
  async () => {
99
- var d;
100
- const p = await w.createBusiness(
99
+ var m;
100
+ const u = await w.createBusiness(
101
101
  {
102
102
  name: o.value,
103
103
  restaurantQuota: 1,
104
104
  warehouseQuota: 0,
105
105
  internal: !1,
106
- ownerId: (d = e.sessionUser.value) == null ? void 0 : d.id,
106
+ ownerId: (m = e.sessionUser.value) == null ? void 0 : m.id,
107
107
  agentId: c.value || void 0
108
108
  },
109
109
  i.value
110
110
  );
111
- p._id && (e.setCachedBusiness(p._id), e.setCachedCountry(i.value)), setTimeout(() => {
111
+ u._id && (e.setCachedBusiness(u._id), e.setCachedCountry(i.value)), setTimeout(() => {
112
112
  window.location.href = "/";
113
113
  }, 500);
114
114
  },
@@ -117,102 +117,102 @@ const de = /* @__PURE__ */ X(ue, [["__scopeId", "data-v-c0191534"]]), me = { cla
117
117
  }
118
118
  );
119
119
  }
120
- async function E() {
120
+ async function N() {
121
121
  await e.signOut(), setTimeout(() => {
122
- window.location.href = `${ne.baseUrl}/login?fm_redirect=${encodeURIComponent(window.location.protocol + "//" + window.location.host)}`;
122
+ window.location.href = `${oe.baseUrl}/login?fm_redirect=${encodeURIComponent(window.location.protocol + "//" + window.location.host)}`;
123
123
  }, 500);
124
124
  }
125
- return G(() => {
125
+ return P(() => {
126
126
  e.hideSidebar.value || e.hideSidebarToggle(!0);
127
- }), P(() => {
127
+ }), W(() => {
128
128
  e.hideSidebarToggle(!1);
129
- }), (p, d) => {
130
- const k = h("FmTextField"), N = h("FmSnackbar"), T = h("FmButton"), O = h("FmForm");
131
- return v(), y("div", me, [
132
- g(O, {
129
+ }), (u, m) => {
130
+ const k = h("FmTextField"), $ = h("FmSnackbar"), T = h("FmButton"), j = h("FmForm");
131
+ return g(), y("div", pe, [
132
+ v(j, {
133
133
  class: "w-[540px] xs:w-full xs:px-16 space-y-24",
134
134
  "blame-form-child-on-validation-failed": "",
135
- "on-validation-success": I
135
+ "on-validation-success": E
136
136
  }, {
137
- default: W(() => {
137
+ default: z(() => {
138
138
  var B, H, U;
139
139
  return [
140
140
  s("div", null, [
141
- g(de)
141
+ v(me)
142
142
  ]),
143
- s("div", pe, [
144
- s("div", _e, [
145
- s("div", fe, b(n(l)("settings.create_business.welcome", {
143
+ s("div", _e, [
144
+ s("div", fe, [
145
+ s("div", ve, b(n(l)("settings.create_business.welcome", {
146
146
  name: (H = (B = n(e).sessionUser) == null ? void 0 : B.value) == null ? void 0 : H.displayName
147
147
  })), 1),
148
148
  s("div", null, b(n(l)("settings.create_business.subtitle")), 1)
149
149
  ]),
150
150
  s("div", null, [
151
- g(k, {
151
+ v(k, {
152
152
  label: n(l)("settings.create_business.business_name.label"),
153
153
  "label-mark": "required",
154
- rules: [n(ee)],
154
+ rules: [n(te)],
155
155
  modelValue: o.value,
156
- "onUpdate:modelValue": d[0] || (d[0] = (a) => o.value = a)
156
+ "onUpdate:modelValue": m[0] || (m[0] = (a) => o.value = a)
157
157
  }, null, 8, ["label", "rules", "modelValue"])
158
158
  ]),
159
159
  s("div", null, [
160
- g(k, {
160
+ v(k, {
161
161
  label: n(l)("settings.create_business.agent.label"),
162
162
  modelValue: t.value,
163
163
  "onUpdate:modelValue": [
164
- d[1] || (d[1] = (a) => t.value = a),
165
- n(M)
164
+ m[1] || (m[1] = (a) => t.value = a),
165
+ n(I)
166
166
  ],
167
- rules: [(a) => !a || u.value || n(l)("settings.create_business.agent.invalid")]
167
+ rules: [(a) => !a || d.value || n(l)("settings.create_business.agent.invalid")]
168
168
  }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "rules"])
169
169
  ]),
170
170
  s("div", ge, [
171
- s("div", ve, b(n(l)("settings.create_business.country.title")), 1),
172
- s("div", he, [
173
- (v(!0), y(z, null, R(n(K), (a) => (v(), y("div", {
171
+ s("div", he, b(n(l)("settings.create_business.country.title")), 1),
172
+ s("div", be, [
173
+ (g(!0), y(R, null, Z(C.value, (a) => (g(), y("div", {
174
174
  key: a.code,
175
- class: Z(["flex-1 h-[124px] flex justify-center items-center border-2 fm-corner-radius-md cursor-pointer", [
175
+ class: q(["flex-1 h-[124px] flex justify-center items-center border-2 fm-corner-radius-md cursor-pointer", [
176
176
  i.value === a.code ? "border-fm-color-primary" : "border-fm-color-neutral-gray-200",
177
177
  i.value === a.code ? "bg-fm-color-system-warning-100" : "bg-fm-color-neutral-white"
178
178
  ]]),
179
- onClick: (Ve) => i.value = a.code.toUpperCase()
179
+ onClick: (ke) => i.value = a.code.toUpperCase()
180
180
  }, [
181
- s("div", ye, [
182
- s("div", Ce, [
181
+ s("div", Ce, [
182
+ s("div", we, [
183
183
  s("span", {
184
184
  innerHTML: a.flag
185
- }, null, 8, we)
185
+ }, null, 8, xe)
186
186
  ]),
187
- s("div", xe, b(a.name), 1)
187
+ s("div", Fe, b(a.name), 1)
188
188
  ])
189
- ], 10, be))), 128))
189
+ ], 10, ye))), 128))
190
190
  ])
191
191
  ]),
192
- m.value.length > 0 ? (v(), q(N, {
192
+ p.value.length > 0 ? (g(), Q($, {
193
193
  key: 0,
194
194
  variant: "info",
195
195
  title: n(l)("settings.create_business.country.exists.title"),
196
- description: n(l)("settings.create_business.country.exists.message", { name: (U = m.value[0]) == null ? void 0 : U.name })
197
- }, null, 8, ["title", "description"])) : Q("", !0),
198
- s("div", Fe, [
196
+ description: n(l)("settings.create_business.country.exists.message", { name: (U = p.value[0]) == null ? void 0 : U.name })
197
+ }, null, 8, ["title", "description"])) : Y("", !0),
198
+ s("div", Ve, [
199
199
  s("div", null, [
200
- g(T, {
200
+ v(T, {
201
201
  label: n(l)("settings.create_business.submit"),
202
202
  variant: "primary",
203
203
  size: "lg",
204
204
  class: "w-full",
205
- disabled: D.value,
205
+ disabled: O.value,
206
206
  type: "submit"
207
207
  }, null, 8, ["label", "disabled"])
208
208
  ]),
209
209
  s("div", null, [
210
- g(T, {
210
+ v(T, {
211
211
  label: n(l)("settings.create_business.logout"),
212
212
  variant: "secondary",
213
213
  size: "lg",
214
214
  class: "w-full",
215
- onClick: E
215
+ onClick: N
216
216
  }, null, 8, ["label"])
217
217
  ])
218
218
  ])
@@ -226,5 +226,5 @@ const de = /* @__PURE__ */ X(ue, [["__scopeId", "data-v-c0191534"]]), me = { cla
226
226
  }
227
227
  });
228
228
  export {
229
- De as default
229
+ Ie as default
230
230
  };
@@ -6,7 +6,7 @@ import { l as q, c as V, d as ze, a as Sc, e as Ei, b as Yf } from "./index-f1e5
6
6
  import { c as Qg, a as zd } from "./index-1eb3cc0a.js";
7
7
  import { d as Xg, _ as hc, u as Zg, a as xg } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-977372d5.js";
8
8
  import { useSnackbar as ml, components as so, useDialogChild as ep, useDialog as Kf, useBreakpoints as tp } from "@feedmepos/ui-library";
9
- import { g as Gn, r as la, b as Fd, u as Oc } from "./loading-6ee8ebc9.js";
9
+ import { g as Gn, r as la, b as Fd, u as Oc } from "./loading-84215dce.js";
10
10
  import { useCoreStore as gl, useI18n as Tc } from "@feedmepos/mf-common";
11
11
  import { c as Hf, _ as np, a as C$ } from "./createForm-681e977a.js";
12
12
  import "pinia";
@@ -3,12 +3,12 @@ import { useCoreStore as wo, useI18n as Do } from "@feedmepos/mf-common";
3
3
  import { useDialog as Po, useSnackbar as xo, components as Ym, useBreakpoints as Xm, FmButtonVariant as qm } from "@feedmepos/ui-library";
4
4
  import { c as Ci, _ as Jm, a as Zm } from "./createForm-681e977a.js";
5
5
  import { _ as Qm, c as zm } from "./actionButton-cc6bcf01.js";
6
- import { u as Fo } from "./loading-6ee8ebc9.js";
6
+ import { u as Fo } from "./loading-84215dce.js";
7
7
  import { c as br } from "./index-f1e5e565.js";
8
8
  import { defineStore as jm } from "pinia";
9
- import { b as es } from "./business-93826a8c.js";
9
+ import { b as es } from "./business-9a4e5bd7.js";
10
10
  import "@vue/devtools-api";
11
- import { _ as eE } from "./app-bd3cfc9c.js";
11
+ import { _ as eE } from "./app-6a6102be.js";
12
12
  import "@feedmepos/mf-mdm";
13
13
  import "vue-router";
14
14
  import "@feedmepos/mf-e-invoice";
@@ -0,0 +1,27 @@
1
+ import { defineComponent as a, computed as c, resolveComponent as u, openBlock as s, createElementBlock as o, createVNode as d } from "vue";
2
+ import { useCoreStore as l, FeedMeAuth as m } from "@feedmepos/mf-common";
3
+ const i = {
4
+ key: 0,
5
+ class: "w-full h-full flex items-center justify-center"
6
+ }, p = ["src"], h = /* @__PURE__ */ a({
7
+ __name: "TemplateBuilder",
8
+ setup(f) {
9
+ const e = l(), t = c(() => {
10
+ var r;
11
+ return e.currentBusiness.value ? `https://print-template-builder.feedme.dev//#/receipt-info?businessId=${(r = e.currentBusiness.value) == null ? void 0 : r.id}&country=${e.currentCountry.value}&token=${m.token}` : "";
12
+ });
13
+ return (r, v) => {
14
+ const n = u("FmCircularProgress");
15
+ return t.value ? (s(), o("iframe", {
16
+ key: 1,
17
+ class: "w-full h-full",
18
+ src: t.value
19
+ }, null, 8, p)) : (s(), o("div", i, [
20
+ d(n, { size: "lg" })
21
+ ]));
22
+ };
23
+ }
24
+ });
25
+ export {
26
+ h as default
27
+ };
@@ -698,7 +698,7 @@ const I = /* @__PURE__ */ p({
698
698
  {
699
699
  path: "/business",
700
700
  name: "$settings-my-business",
701
- component: i(() => import("./Business-edf5bd92.js")),
701
+ component: i(() => import("./Business-189e288f.js")),
702
702
  meta: {
703
703
  i18nKey: "settings.business.title"
704
704
  }
@@ -706,7 +706,7 @@ const I = /* @__PURE__ */ p({
706
706
  {
707
707
  path: "/create-business",
708
708
  name: "$settings-create-business",
709
- component: i(() => import("./CreateBusiness-ec365db8.js")),
709
+ component: i(() => import("./CreateBusiness-2a4f54d4.js")),
710
710
  meta: {
711
711
  hideNavigation: !0
712
712
  }
@@ -714,7 +714,7 @@ const I = /* @__PURE__ */ p({
714
714
  {
715
715
  path: "/foodcourt",
716
716
  name: "$settings-food-court",
717
- component: i(() => import("./FoodCourt-652c44f9.js")),
717
+ component: i(() => import("./FoodCourt-561cd7e3.js")),
718
718
  meta: {
719
719
  i18nKey: "settings.food_court.list.title"
720
720
  }
@@ -731,7 +731,7 @@ const I = /* @__PURE__ */ p({
731
731
  {
732
732
  path: "/template-builder",
733
733
  name: "$settings-template-builder",
734
- component: i(() => import("./TemplateBuilder-3e34e9e8.js")),
734
+ component: i(() => import("./TemplateBuilder-54a34178.js")),
735
735
  meta: {
736
736
  i18nKey: "settings.templateBuilder.title"
737
737
  }
@@ -756,7 +756,7 @@ const I = /* @__PURE__ */ p({
756
756
  {
757
757
  path: "/tagging",
758
758
  name: "$settings-tagging",
759
- component: S(i(() => import("./Tagging-798e2bb7.js"))),
759
+ component: S(i(() => import("./Tagging-5ba0d4ec.js"))),
760
760
  meta: {
761
761
  i18nKey: "settings.tagging.title",
762
762
  validationManifest: {
@@ -765,7 +765,7 @@ const I = /* @__PURE__ */ p({
765
765
  hideNavigation: !0
766
766
  }
767
767
  }
768
- ], Q = i(() => import("./App-ccc37fd9.js")), Y = {
768
+ ], Q = i(() => import("./App-b3a895b0.js")), Y = {
769
769
  "en-US": {
770
770
  ...E,
771
771
  ...d["en-US"]
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "@feedmepos/mf-mdm";
2
- import { F as e, i as F, r as f } from "./app-bd3cfc9c.js";
2
+ import { F as e, i as F, r as f } from "./app-6a6102be.js";
3
3
  import "vue";
4
4
  import "@feedmepos/ui-library";
5
5
  import "vue-router";