@feedmepos/mf-connect 0.1.111-prod → 0.1.112-prod

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 (125) hide show
  1. package/dist/{App-D3pYl3WL.js → App-CFJcQZEE.js} +83 -80
  2. package/dist/{Bin-DOZqpbYH.js → Bin-DaqUNsSV.js} +8 -8
  3. package/dist/{Broadcast-DZ4SP99P.js → Broadcast-CdAN6JCa.js} +11 -11
  4. package/dist/{CampaignAnalytic-cFKvCgxX.js → CampaignAnalytic-CpP7lgTX.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B0eVEubS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BQiQVQBN.js} +49 -32
  6. package/dist/Card-Bmz5p5Pq.js +1085 -0
  7. package/dist/{Collections-9QK5hbLo.js → Collections-BKND60cK.js} +9 -9
  8. package/dist/{Credit-8Ouy4O9a.js → Credit-DQ_tDm8l.js} +11 -11
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CCwpsEWf.js} +1 -1
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYxswo-Z.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bn-lauCv.js} +34 -33
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dv0q3B8m.js → EffectSheet.vue_vue_type_style_index_0_lang-wUV_beN0.js} +6 -6
  12. package/dist/{Experience-DMh4hR1S.js → Experience-BOE6jLIS.js} +12 -12
  13. package/dist/{FileSaver.min-Bx9mdUgJ.js → FileSaver.min-D0CP0E3N.js} +1 -1
  14. package/dist/{Game-CL0TZvg1.js → Game-B-8by2dp.js} +12 -12
  15. package/dist/GiftCardSetup-CdqZd1ee.js +748 -0
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Bz5kIfoM.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-BVTu4uTR.js} +7 -7
  17. package/dist/{Goals-Dz5Vp-lj.js → Goals-xFHNbwt7.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js → ImageInput.vue_vue_type_script_setup_true_lang-B5Z1AZRV.js} +1 -1
  19. package/dist/{Index-kH8aAegB.js → Index-t6veJ0lU.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CFrgC3Ka.js → LocationPicker.vue_vue_type_script_setup_true_lang-Deeanc8z.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DPIFLdBc.js → LottieAnimation.vue_vue_type_script_setup_true_lang-B8qOJYoS.js} +1 -1
  22. package/dist/{LoyaltyDashboard-BBxEoWol.js → LoyaltyDashboard-DXNBsnM5.js} +15 -15
  23. package/dist/{MainLayout-2BLwDyHQ.js → MainLayout-CmCboaEn.js} +3 -3
  24. package/dist/{Marketing-C4OnSV-c.js → Marketing-DCq9O5eb.js} +4 -4
  25. package/dist/{MarketingMaterialEdit-DFhpsI2-.js → MarketingMaterialEdit-CGLxanxm.js} +6 -6
  26. package/dist/{Member-CT9WwxP0.js → Member-BCYmEmhD.js} +7 -7
  27. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C7yznkUn.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-Djrfmj9g.js} +26 -25
  28. package/dist/{MemberImportHistory-B__BFID7.js → MemberImportHistory-D-5NAOfo.js} +7 -7
  29. package/dist/{MemberList-DgLI4wty.js → MemberList-IySTKOT_.js} +14 -14
  30. package/dist/{MemberTransactions-UFx_DZYe.js → MemberTransactions-BgQZvc5O.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BFjZA8Y6.js → MessageInput.vue_vue_type_script_setup_true_lang-N8PCSKBx.js} +3369 -3290
  32. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Df9bxbUl.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-_JNdYsBu.js} +1 -1
  33. package/dist/{Mission-CawzGzDu.js → Mission-DtaTKWE2.js} +13 -13
  34. package/dist/{Overview-CAtTlEVa.js → Overview-D-uC2-Pi.js} +4 -4
  35. package/dist/{Overview-D19oSo24.js → Overview-DVMdPa97.js} +57 -56
  36. package/dist/{Point-BPAGmKAj.js → Point-jnPIgHMZ.js} +13 -13
  37. package/dist/{Promotion-B0Uf9vjL.js → Promotion-mdQg-RSh.js} +13 -13
  38. package/dist/{Queue-CJEAFss_.js → Queue-D8YY1lbn.js} +20 -19
  39. package/dist/{Record-s6hSQG2P.js → Record-Dh-rN7a0.js} +9 -9
  40. package/dist/{Review-DhNCbAOm.js → Review-C8B-SIR8.js} +2 -2
  41. package/dist/{ReviewFacebookCallback-DeZqcpJo.js → ReviewFacebookCallback-C3eyH0pS.js} +5 -5
  42. package/dist/{ReviewGoogleCallback-D8ENWii2.js → ReviewGoogleCallback-pNF2ICvQ.js} +5 -5
  43. package/dist/{Reward-BT00QsXL.js → Reward-D7KPnzXt.js} +16 -16
  44. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaZDGhbm.js → RewardGroup.vue_vue_type_script_setup_true_lang-C87CDjxP.js} +25 -24
  45. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BvxbKSkB.js → RuleGroup.vue_vue_type_script_setup_true_lang-D1S2sLOK.js} +17 -16
  46. package/dist/{Segment-BuGhX9zg.js → Segment-Ct8JRTjV.js} +32 -31
  47. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DB718_4P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-w-UpWetC.js} +24 -23
  48. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkgXxy0C.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbEX2h2u.js} +4 -4
  49. package/dist/{Setting-BOWPp05N.js → Setting-C3Binnn_.js} +56 -56
  50. package/dist/{SettingAdvertisements-aqFErKAr.js → SettingAdvertisements-BrB-dGPs.js} +12 -12
  51. package/dist/{Settings-DekXvE-R.js → Settings-D6h2QM6X.js} +5 -5
  52. package/dist/Store-EKPfHEmY.js +2622 -0
  53. package/dist/{StoreRewards-D2pTL2oA.js → StoreRewards-B208ENOi.js} +15 -15
  54. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dy7_GFoi.js +1264 -0
  55. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C-C3RSeW.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-B2KJeL5Y.js} +2 -2
  56. package/dist/{Tier-OyE8oH2r.js → Tier-CjYiCZy_.js} +104 -103
  57. package/dist/{Title-DAl7CKL_.js → Title-BXkVolaL.js} +34 -33
  58. package/dist/Transaction-D1T3aIC3.js +45 -0
  59. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C0yHxQVr.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-flUDCSA5.js} +6 -6
  60. package/dist/{Voucher-D2QGWSxs.js → Voucher-DnQ8jNjI.js} +18 -18
  61. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bt2YB745.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Z9GDpO4z.js} +12 -12
  62. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js → ZodTextField.vue_vue_type_script_setup_true_lang-Dcw8Oi-t.js} +2 -2
  63. package/dist/{app-QxosLNkH.js → app-BtGohMqA.js} +5724 -4914
  64. package/dist/app.js +1 -1
  65. package/dist/base.export-DulNMo7e.js +75 -0
  66. package/dist/{business-CbqG6NXr.js → business-Bla8vvZH.js} +1 -1
  67. package/dist/{campaign-Rj7oDBnN.js → campaign-BIPNFBY5.js} +2 -2
  68. package/dist/{campaign-Co4Lq-Wz.js → campaign-DYqAyRCY.js} +8 -8
  69. package/dist/{campaign.enum-B7vdNYKd.js → campaign.enum-liUaxkcy.js} +1 -1
  70. package/dist/{campaign.fn-DolD3lYJ.js → campaign.fn-J7hYcX_7.js} +98 -98
  71. package/dist/{collectible.enum-BsQseg7-.js → collectible.enum-C0FfRMrW.js} +1 -1
  72. package/dist/{collection.fn-EbUIyB1X.js → collection.fn-DdDMfaFO.js} +2 -2
  73. package/dist/currency-BrVnqxQ1.js +7 -0
  74. package/dist/{effect-B_91OlcX.js → effect-gfVmfrm9.js} +1 -1
  75. package/dist/{email-addresses-DXnYZG-e.js → email-addresses-Dy8NFNBw.js} +2 -2
  76. package/dist/{helper-_uhiXya1.js → helper-CMhQctQK.js} +1 -1
  77. package/dist/{index-Df4l6y-S.js → index-B6x6s8mu.js} +1805 -2128
  78. package/dist/{index-CWUmrVo_.js → index-BOZ3oVHd.js} +2 -2
  79. package/dist/{index-DlGnYR5y.js → index-BqKrePY8.js} +3 -3
  80. package/dist/{index-CDm0BWa3.js → index-C5rRuwhC.js} +1 -1
  81. package/dist/{index-CzYxnDWP.js → index-C67-z1uf.js} +11 -6
  82. package/dist/{index-BBihP1s2.js → index-CLiJUFmJ.js} +2 -2
  83. package/dist/{index-xuFTeVrb.js → index-CUFuU2eJ.js} +10 -9
  84. package/dist/index-CZqwIQXi.js +738 -0
  85. package/dist/{index-DzBzClHP.js → index-CghtzuVO.js} +1 -1
  86. package/dist/{index-aCuOvuEC.js → index-Culx-Z9v.js} +20 -14
  87. package/dist/{index-C_1iqF1Q.js → index-D1T4Yf4t.js} +1 -1
  88. package/dist/{index-Cp7oHMm3.js → index-D6RDVy95.js} +17 -16
  89. package/dist/index-DKmtDBKS.js +53 -0
  90. package/dist/{index-BZ2b0Pk6.js → index-Dalmv1m4.js} +3 -3
  91. package/dist/{index-uuNGb1nv.js → index-DvW-3flw.js} +4 -3
  92. package/dist/{index-DuhRCI0L.js → index-dyMdi0Rt.js} +1 -1
  93. package/dist/{index-BWgc2-Qz.js → index-otcusTFM.js} +1 -1
  94. package/dist/{index-DlQJZNwD.js → index-qJOEwQ_z.js} +4 -1
  95. package/dist/{index-tbo0pMIu.js → index-v1exQSyU.js} +1 -1
  96. package/dist/{index.esm2017-B72iWwk_.js → index.esm2017-BLKRIlb9.js} +1 -1
  97. package/dist/{loading-rIhCiB_S.js → loading-BkJ3h_4U.js} +1 -1
  98. package/dist/{lodash-B6fOjfjd.js → lodash-C0Kbs8lQ.js} +1 -1
  99. package/dist/{member-import-CbHn7zss.js → member-import-trpK8l8R.js} +1 -1
  100. package/dist/{membership-DkJN7jyQ.js → membership-TV1CoyKQ.js} +3 -3
  101. package/dist/{money-ChbDx6Nq.js → money-BM-DK9iD.js} +1 -1
  102. package/dist/{number-9TEd27Ku.js → number-BclgE86R.js} +1 -1
  103. package/dist/{objectid-CGol1NeA.js → objectid-C2XvpEgx.js} +10 -10
  104. package/dist/{onboarding-BN3MKVRs.js → onboarding-BLuoXyCY.js} +3 -3
  105. package/dist/{onboardingSetup-D9xhdgS3.js → onboardingSetup-BLmLAgIV.js} +2 -2
  106. package/dist/{plugins-CCibSJZa.js → plugins-3_mD58dh.js} +3 -3
  107. package/dist/{reward-DjasF-NL.js → reward-Bo4szVCU.js} +1 -1
  108. package/dist/{rule-DqeChj0e.js → rule-Bwy5-zD7.js} +3 -3
  109. package/dist/{rule-builder-DT854ycI.js → rule-builder-Co_1uuj4.js} +1 -1
  110. package/dist/{template-BeCVA0-N.js → template-fImyGLa7.js} +7 -7
  111. package/dist/{timezone-D0nC1LDx.js → timezone-DQ7TNXmV.js} +1 -1
  112. package/dist/{transaction.fn-BkF4Ad2z.js → transaction.fn-OT7ucfCB.js} +2 -2
  113. package/dist/{trigger-CxpXoQJO.js → trigger-BJKHGcNG.js} +14 -14
  114. package/dist/{useMarketingMaterialActions-p0-fyMkm.js → useMarketingMaterialActions-BX3C1Gga.js} +3 -3
  115. package/dist/{usePagination-CrC-1v4L.js → usePagination-Qp0qoWBj.js} +1 -1
  116. package/dist/{user-CrylHgF1.js → user-BcE3fiEa.js} +1 -1
  117. package/dist/{vue-i18n-BjtkXdmG.js → vue-i18n-BQmB8Ex1.js} +230 -230
  118. package/dist/{xlsx-CJNYF7-l.js → xlsx-DYZ421PG.js} +440 -440
  119. package/dist/{zod-Dzn9S95S.js → zod-DestzeIp.js} +1 -1
  120. package/package.json +1 -1
  121. package/dist/Card-B5ni027Q.js +0 -911
  122. package/dist/Store-DpVlMuau.js +0 -1998
  123. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNDv6eiZ.js +0 -1009
  124. package/dist/Transaction-mvKzTgLx.js +0 -39
  125. package/dist/export-D0hWZSfH.js +0 -97
@@ -0,0 +1,2622 @@
1
+ import { defineComponent as Y, computed as D, resolveComponent as v, openBlock as m, createBlock as R, withCtx as I, createElementVNode as n, toDisplayString as w, createVNode as i, createCommentVNode as M, createElementBlock as T, unref as e, Fragment as z, renderList as re, ref as O, isRef as ve, reactive as lt, onMounted as Be, watch as We, toRaw as it, createTextVNode as ae, h as rt, normalizeStyle as tt, normalizeClass as $e } from "vue";
2
+ import { _ as ct } from "./tier-BJDhpH6X.js";
3
+ import { useDialog as Ye, useDialogChild as Je, components as dt } from "@feedmepos/ui-library";
4
+ import { c as G, e as Le, S as He } from "./index-BOZ3oVHd.js";
5
+ import { u as ot } from "./loading-BkJ3h_4U.js";
6
+ import { u as Xe, C as Re } from "./membership-TV1CoyKQ.js";
7
+ import { j as ut, k as mt, l as pt, m as Qe, n as ft, o as yt } from "./index-B6x6s8mu.js";
8
+ import { a as gt, c as qe } from "./object-BYyQ0PZp.js";
9
+ import { _ as pe } from "./lodash-C0Kbs8lQ.js";
10
+ import { c as Ce } from "./index-DvW-3flw.js";
11
+ import { u as he } from "./vue-i18n-BQmB8Ex1.js";
12
+ import { Z as le, g as oe, a as ne } from "./zod-DestzeIp.js";
13
+ import { z as ie, R as Ae } from "./app-BtGohMqA.js";
14
+ import { u as je } from "./app-wDQR6dpb.js";
15
+ import { _ as ge } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Dcw8Oi-t.js";
16
+ import { c as bt, p as Ue, n as vt, f as Ge } from "./plugins-3_mD58dh.js";
17
+ import { J as Ze } from "./JsonViewer-v8_C7l5N.js";
18
+ import { _ as ht } from "./index-BqKrePY8.js";
19
+ import { _ as xt } from "./ImageInput.vue_vue_type_script_setup_true_lang-B5Z1AZRV.js";
20
+ import { _ as _t } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
21
+ import { z as Ct, a as St } from "./money-BM-DK9iD.js";
22
+ import { f as Ft } from "./currency-BrVnqxQ1.js";
23
+ import { F as wt } from "./number-BclgE86R.js";
24
+ import { a as $t, t as kt } from "./helper-CMhQctQK.js";
25
+ import "./index-C5rRuwhC.js";
26
+ import "./index-CZqwIQXi.js";
27
+ import "./index-D6RDVy95.js";
28
+ import "./index-Dalmv1m4.js";
29
+ import "./index-otcusTFM.js";
30
+ import { m as Pt } from "./index-CLiJUFmJ.js";
31
+ import { m as Ee } from "./index-qJOEwQ_z.js";
32
+ import { g as Ke } from "./index-DKmtDBKS.js";
33
+ import { u as Vt } from "./business-Bla8vvZH.js";
34
+ import { useRouter as Tt } from "vue-router";
35
+ function nt(b) {
36
+ return Ce.DineroFactory(b).toUnit();
37
+ }
38
+ function at(b, a, c, g, d = [], x = []) {
39
+ const o = ht.compact(
40
+ a.map((t) => b.find((r) => r.systemCode === t.systemCode && r.taxCode === t.taxCode)).filter((t) => !!t && x.includes(t.systemCode))
41
+ ), l = o.reduce(
42
+ (t, r) => {
43
+ var p;
44
+ return Object.assign(t, {
45
+ [r.taxCode]: {
46
+ inclusive: ((p = d.find((y) => y.systemCode === r.systemCode)) == null ? void 0 : p.inclusive) || !1,
47
+ adjustment: {
48
+ level: 1,
49
+ type: {
50
+ type: "BY_MULTIPLIER",
51
+ amount: {
52
+ amount: r.rate.amount,
53
+ precision: r.rate.precision,
54
+ currency: "MYR"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ });
60
+ },
61
+ {}
62
+ ), f = Ce.Calculator.calculate({
63
+ items: {
64
+ 0: {
65
+ quantity: 1,
66
+ adjustments: {
67
+ price: {
68
+ level: 0,
69
+ type: {
70
+ type: "BY_AMOUNT",
71
+ amount: Ce.DineroFactory(c).subtract(Ce.Dinero.fromNumber({ number: g }).toObject()).toObject()
72
+ }
73
+ }
74
+ },
75
+ taxes: l
76
+ }
77
+ },
78
+ adjustments: {},
79
+ roundToNearest: 0
80
+ });
81
+ return o.map((t) => ({
82
+ setting: t,
83
+ systemCode: t.systemCode,
84
+ name: t.name,
85
+ taxCode: t.taxCode,
86
+ rate: t.rate,
87
+ total: Ce.DineroFactory({
88
+ ...f.items[0].taxes[t.taxCode].amount
89
+ }).convertPrecision(2).toObject()
90
+ }));
91
+ }
92
+ function st(b, a, c) {
93
+ return b ? b.reduce((g, d) => {
94
+ var x;
95
+ return (x = c.find((o) => o.systemCode === d.systemCode)) != null && x.inclusive || (g = Ce.DineroFactory(g.toObject()).add(d.total)), g;
96
+ }, Ce.DineroFactory(a)).toObject() : Ce.DineroFactory(a).toObject();
97
+ }
98
+ const Rt = { class: "flex justify-between items-start gap-4 w-full" }, It = { class: "fm-typo-en-body-lg-600 text-left pt-4 break-words line-clamp-2" }, Ut = { class: "flex-shrink-0 -mr-8 -mt-8" }, Et = { class: "relative h-[120px] aspect-video flex mx-auto items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, Dt = ["src"], Bt = {
99
+ key: 2,
100
+ class: "absolute top-2 left-2"
101
+ }, Nt = { class: "flex flex-col gap-8 flex-1 text-left w-full" }, Mt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ot = { class: "flex gap-8 items-center flex-wrap" }, Lt = /* @__PURE__ */ Y({
102
+ __name: "StoreBundleCard",
103
+ props: {
104
+ bundle: { type: Object, required: !0 }
105
+ },
106
+ emits: ["edit", "delete", "send"],
107
+ setup(b, { emit: a }) {
108
+ const c = b, g = a, d = D(() => {
109
+ const o = [];
110
+ return c.bundle.price.amount > 0 && o.push(
111
+ `${G.Config.getCountry().currency.symbol}${nt(c.bundle.price)}`
112
+ ), c.bundle.coinPrice && o.push(`${c.bundle.coinPrice} point(s)`), o.join(" or ");
113
+ }), x = D(() => {
114
+ var l, f;
115
+ const o = [];
116
+ if (c.bundle.titles.length > 0 && o.push(`${c.bundle.titles.length} title(s)`), c.bundle.vouchers.length > 0 && o.push(`${c.bundle.vouchers.length} voucher(s)`), c.bundle.credit.normal || (l = c.bundle.credit.free) != null && l.amount) {
117
+ const t = c.bundle.credit.normal + (((f = c.bundle.credit.free) == null ? void 0 : f.amount) ?? 0);
118
+ o.push(`${t} credit(s)`);
119
+ }
120
+ return o;
121
+ });
122
+ return (o, l) => {
123
+ const f = v("FmButton"), t = v("FmMenuItem"), r = v("FmMenu"), p = v("FmIcon"), y = v("FmChip"), $ = v("FmCard");
124
+ return m(), R($, {
125
+ variant: "outlined",
126
+ class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full"
127
+ }, {
128
+ default: I(() => [
129
+ n("div", Rt, [
130
+ n("div", It, w(b.bundle.name), 1),
131
+ n("div", Ut, [
132
+ i(r, { placement: "bottom-end" }, {
133
+ "menu-button": I(() => [
134
+ i(f, {
135
+ icon: "more_vert",
136
+ variant: "tertiary"
137
+ })
138
+ ]),
139
+ default: I(() => [
140
+ i(t, {
141
+ onClick: l[0] || (l[0] = (u) => g("edit", b.bundle)),
142
+ icon: "edit",
143
+ label: "Edit"
144
+ }),
145
+ b.bundle.stripePriceId ? M("", !0) : (m(), R(t, {
146
+ key: 0,
147
+ onClick: l[1] || (l[1] = (u) => g("send", b.bundle)),
148
+ icon: "send",
149
+ label: "Send"
150
+ })),
151
+ i(t, {
152
+ onClick: l[2] || (l[2] = (u) => g("delete", b.bundle)),
153
+ icon: "delete"
154
+ }, {
155
+ label: I(() => [...l[3] || (l[3] = [
156
+ n("div", { class: "text-fm-color-typo-error fm-typo-en-body-md-400" }, " Delete ", -1)
157
+ ])]),
158
+ _: 1
159
+ })
160
+ ]),
161
+ _: 1
162
+ })
163
+ ])
164
+ ]),
165
+ n("div", Et, [
166
+ b.bundle.image ? (m(), T("img", {
167
+ key: 1,
168
+ src: b.bundle.image,
169
+ class: "w-full h-full object-contain aspect-video"
170
+ }, null, 8, Dt)) : (m(), R(p, {
171
+ key: 0,
172
+ name: "image",
173
+ outline: !0,
174
+ size: "md",
175
+ class: "text-fm-color-neutral-gray-200"
176
+ })),
177
+ b.bundle.isFeedvibe ? (m(), T("div", Bt, [
178
+ i(y, {
179
+ label: "Feedvibe",
180
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
181
+ compact: ""
182
+ })
183
+ ])) : M("", !0)
184
+ ]),
185
+ n("div", Nt, [
186
+ n("div", Mt, w(e(d) || "Free"), 1),
187
+ n("div", Ot, [
188
+ (m(!0), T(z, null, re(e(x), (u, F) => (m(), R(y, {
189
+ key: F,
190
+ label: u
191
+ }, null, 8, ["label"]))), 128))
192
+ ])
193
+ ])
194
+ ]),
195
+ _: 1
196
+ });
197
+ };
198
+ }
199
+ }), At = /* @__PURE__ */ Y({
200
+ __name: "AddBundleCard",
201
+ emits: ["create"],
202
+ setup(b, { emit: a }) {
203
+ const { t: c } = he(), g = a;
204
+ return (d, x) => {
205
+ const o = v("FmButton"), l = v("FmCard");
206
+ return m(), R(l, {
207
+ variant: "outlined",
208
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
209
+ }, {
210
+ default: I(() => [
211
+ i(o, {
212
+ onClick: x[0] || (x[0] = (f) => g("create")),
213
+ label: e(c)("connect.store.actions.addBundle"),
214
+ icon: "add",
215
+ variant: "secondary"
216
+ }, null, 8, ["label"])
217
+ ]),
218
+ _: 1
219
+ });
220
+ };
221
+ }
222
+ }), jt = { class: "space-y-16" }, qt = { class: "flex w-full justify-between pb-16" }, Gt = { class: "flex items-center justify-end gap-8" }, Kt = /* @__PURE__ */ Y({
223
+ __name: "CategoryDialog",
224
+ props: {
225
+ action: {
226
+ type: String,
227
+ default: () => "add"
228
+ },
229
+ initialValue: {
230
+ type: String,
231
+ default: () => ""
232
+ }
233
+ },
234
+ setup(b) {
235
+ const { t: a } = he(), c = b, g = Ye(), { emitData: d, emitAction: x } = Je(), o = O(c.initialValue), l = ie.string().min(1);
236
+ function f() {
237
+ d(o.value), x("primary"), g.close();
238
+ }
239
+ function t() {
240
+ d(null), x("primary"), g.close();
241
+ }
242
+ return (r, p) => {
243
+ const y = v("FmTextField"), $ = v("FmButton");
244
+ return m(), T("div", jt, [
245
+ i(y, {
246
+ modelValue: e(o),
247
+ "onUpdate:modelValue": p[0] || (p[0] = (u) => ve(o) ? o.value = u : null),
248
+ label: e(a)("connect.store.category.label"),
249
+ rules: [e(le).toRule(e(l))]
250
+ }, null, 8, ["modelValue", "label", "rules"]),
251
+ n("div", qt, [
252
+ n("div", null, [
253
+ b.action == "edit" ? (m(), R($, {
254
+ key: 0,
255
+ onClick: t,
256
+ label: e(a)("connect.common.delete"),
257
+ variant: "destructive"
258
+ }, null, 8, ["label"])) : M("", !0)
259
+ ]),
260
+ n("div", Gt, [
261
+ i($, {
262
+ label: e(a)("connect.common.cancel"),
263
+ variant: "tertiary",
264
+ onClick: p[1] || (p[1] = (u) => e(g).close())
265
+ }, null, 8, ["label"]),
266
+ i($, {
267
+ label: b.action == "edit" ? e(a)("connect.common.edit") : e(a)("connect.common.add"),
268
+ disabled: !e(o),
269
+ onClick: f
270
+ }, null, 8, ["label", "disabled"])
271
+ ])
272
+ ])
273
+ ]);
274
+ };
275
+ }
276
+ }), Ht = { class: "space-y-16" }, zt = { class: "flex items-center justify-end gap-8 pb-16" }, Wt = /* @__PURE__ */ Y({
277
+ __name: "SelectCategoryDialog",
278
+ setup(b) {
279
+ const { emitData: a, emitAction: c } = Je(), g = Xe(), d = O(), x = D(
280
+ () => g.sortedStoreCategories.map((o, l) => ({
281
+ label: o.name,
282
+ value: l
283
+ }))
284
+ );
285
+ return (o, l) => {
286
+ const f = v("FmSelect"), t = v("FmButton");
287
+ return m(), T("div", Ht, [
288
+ l[4] || (l[4] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1)),
289
+ i(f, {
290
+ placeholder: "Select a category",
291
+ items: e(x),
292
+ modelValue: e(d),
293
+ "onUpdate:modelValue": [
294
+ l[0] || (l[0] = (r) => ve(d) ? d.value = r : null),
295
+ l[1] || (l[1] = (r) => e(a)(r))
296
+ ],
297
+ label: "Category"
298
+ }, null, 8, ["items", "modelValue"]),
299
+ n("div", zt, [
300
+ i(t, {
301
+ variant: "tertiary",
302
+ label: "Cancel",
303
+ onClick: l[2] || (l[2] = (r) => e(c)("tertiary"))
304
+ }),
305
+ i(t, {
306
+ label: "Select",
307
+ onClick: l[3] || (l[3] = (r) => e(c)("primary")),
308
+ disabled: e(d) == null
309
+ }, null, 8, ["disabled"])
310
+ ])
311
+ ]);
312
+ };
313
+ }
314
+ });
315
+ function be(b) {
316
+ return b.states.map((a) => ({ label: a, value: a }));
317
+ }
318
+ const Yt = {
319
+ [Le.F_COUNTRY.enum.MY]: {
320
+ states: [
321
+ "Johor",
322
+ "Kedah",
323
+ "Kelantan",
324
+ "Kuala Lumpur",
325
+ "Labuan",
326
+ "Melaka",
327
+ "Negeri Sembilan",
328
+ "Pahang",
329
+ "Perak",
330
+ "Perlis",
331
+ "Pulau Pinang",
332
+ "Putrajaya",
333
+ "Sabah",
334
+ "Sarawak",
335
+ "Selangor",
336
+ "Terengganu"
337
+ ],
338
+ get stateItems() {
339
+ return be(this);
340
+ }
341
+ },
342
+ [Le.F_COUNTRY.enum.SG]: {
343
+ states: [],
344
+ get stateItems() {
345
+ return be(this);
346
+ }
347
+ },
348
+ JP: {
349
+ states: [],
350
+ get stateItems() {
351
+ return be(this);
352
+ }
353
+ },
354
+ AE: {
355
+ states: [],
356
+ get stateItems() {
357
+ return be(this);
358
+ }
359
+ },
360
+ AU: {
361
+ states: [],
362
+ get stateItems() {
363
+ return be(this);
364
+ }
365
+ },
366
+ MO: {
367
+ states: [],
368
+ get stateItems() {
369
+ return be(this);
370
+ }
371
+ },
372
+ VN: {
373
+ states: [],
374
+ get stateItems() {
375
+ return be(this);
376
+ }
377
+ },
378
+ [Le.F_COUNTRY.enum.ID]: {
379
+ states: [
380
+ "Aceh",
381
+ "Bali",
382
+ "Bangka-Belitung",
383
+ "Banten",
384
+ "Bengkulu",
385
+ "Central Java",
386
+ "Central Sulawesi",
387
+ "Daerah Istimewa Yogyakarta",
388
+ "East Java",
389
+ "East Kalimantan",
390
+ "East Nusa Tenggara",
391
+ "Gorontalo",
392
+ "Jakarta Raya",
393
+ "Jambi",
394
+ "Kalimantan Tengah",
395
+ "Lampung",
396
+ "Maluku",
397
+ "Maluku Utara",
398
+ "North Sulawesi",
399
+ "North Sumatra",
400
+ "Nusa Tenggara Barat",
401
+ "Papua",
402
+ "Riau",
403
+ "Riau Islands",
404
+ "South Kalimantan",
405
+ "South Sulawesi",
406
+ "South Sumatra",
407
+ "Sulawesi Barat",
408
+ "Sulawesi Tenggara",
409
+ "West Java",
410
+ "West Kalimantan",
411
+ "West Papua",
412
+ "West Sumatra"
413
+ ],
414
+ get stateItems() {
415
+ return be(this);
416
+ }
417
+ },
418
+ [Le.F_COUNTRY.enum.TH]: {
419
+ states: [
420
+ "Bangkok",
421
+ "Amnat Charoen",
422
+ "Ang Thong",
423
+ "Bueng Kan",
424
+ "Buri Ram",
425
+ "Chachoengsao",
426
+ "Chai Nat",
427
+ "Chaiyaphum",
428
+ "Chanthaburi",
429
+ "Chiang Mai",
430
+ "Chiang Rai",
431
+ "Chonburi",
432
+ "Chumphon",
433
+ "Kalasin",
434
+ "Kamphaeng Phet",
435
+ "Kanchanaburi",
436
+ "Khon Kaen",
437
+ "Krabi",
438
+ "Lampang",
439
+ "Lamphun",
440
+ "Loei",
441
+ "Lopburi",
442
+ "Mae Hong Son",
443
+ "Maha Sarakham",
444
+ "Mukdahan",
445
+ "Nakhon Nayok",
446
+ "Nakhon Pathom",
447
+ "Nakhon Phanom",
448
+ "Nakhon Ratchasima",
449
+ "Nakhon Sawan",
450
+ "Nakhon Si Thammarat",
451
+ "Nan",
452
+ "Narathiwat",
453
+ "Nong Bua Lamphu",
454
+ "Nong Khai",
455
+ "Nonthaburi",
456
+ "Pathum Thani",
457
+ "Pattani",
458
+ "Phang Nga",
459
+ "Phatthalung",
460
+ "Phayao",
461
+ "Phetchabun",
462
+ "Phetchaburi",
463
+ "Phichit",
464
+ "Phitsanulok",
465
+ "Phra Nakhon Si Ayutthaya",
466
+ "Phrae",
467
+ "Phuket",
468
+ "Prachinburi",
469
+ "Prachuap Khiri Khan",
470
+ "Ranong",
471
+ "Ratchaburi",
472
+ "Rayong",
473
+ "Roi Et",
474
+ "Sa Kaeo",
475
+ "Sakon Nakhon",
476
+ "Samut Prakan",
477
+ "Samut Sakhon",
478
+ "Samut Songkhram",
479
+ "Saraburi",
480
+ "Satun",
481
+ "Sing Buri",
482
+ "Sisaket",
483
+ "Songkhla",
484
+ "Sukhothai",
485
+ "Suphan Buri",
486
+ "Surat Thani",
487
+ "Surin",
488
+ "Tak",
489
+ "Trang",
490
+ "Trat",
491
+ "Ubon Ratchathani",
492
+ "Udon Thani",
493
+ "Uthai Thani",
494
+ "Uttaradit",
495
+ "Yala",
496
+ "Yasothon"
497
+ ],
498
+ get stateItems() {
499
+ return be(this);
500
+ }
501
+ }
502
+ }, Ie = () => G.Config.getCountry(), De = {
503
+ get fullCurrency() {
504
+ return Ie().currency;
505
+ },
506
+ get currency() {
507
+ return Ie().currency.code;
508
+ },
509
+ get fullTax() {
510
+ return G.Country.getCountryFlattenTaxes(Ie().code);
511
+ },
512
+ get taxSystem() {
513
+ return Ie().taxSystems;
514
+ },
515
+ taxInclusion(b) {
516
+ return De.taxSystem.map((a) => ({
517
+ systemCode: a.code,
518
+ inclusive: b !== void 0 ? b : !1
519
+ }));
520
+ },
521
+ groupedTaxOptions() {
522
+ const b = G.Country.getCountryFlattenTaxes(Ie().code);
523
+ return De.taxSystem.map((a) => ({
524
+ code: a.code,
525
+ options: b.map((c) => ({ ...c, feedmeTaxCode: De.generateCode(c) })).filter((c) => c.systemCode === a.code)
526
+ }));
527
+ },
528
+ systemDefaultCode(b) {
529
+ const a = De.groupedTaxOptions().find((c) => c.code === b);
530
+ return a == null ? void 0 : a.options.find((c) => c.default);
531
+ },
532
+ generateCode(b) {
533
+ return `${b.systemCode}/${b.taxCode}`;
534
+ }
535
+ }, Z = De, Jt = /* @__PURE__ */ Y({
536
+ __name: "TaxInclusiveSetting",
537
+ props: {
538
+ modelValue: {
539
+ type: Array,
540
+ required: !0,
541
+ default: () => []
542
+ }
543
+ },
544
+ emits: ["update:model-value"],
545
+ setup(b, { emit: a }) {
546
+ const c = b, g = Z.taxSystem, d = a, x = O(c.modelValue);
547
+ function o(r, p) {
548
+ const y = pe.clone(c.modelValue), $ = y.findIndex((u) => u.systemCode === r);
549
+ $ >= 0 ? y[$].inclusive = p : y.push({
550
+ systemCode: r,
551
+ inclusive: p
552
+ }), x.value = y, d("update:model-value", y);
553
+ }
554
+ function l() {
555
+ return g.map((r) => {
556
+ const p = c.modelValue ? c.modelValue.find((y) => y.systemCode === r.code) : !1;
557
+ return {
558
+ label: r.name,
559
+ config: {
560
+ value: p ? p.inclusive : !1
561
+ },
562
+ input: (y) => {
563
+ o(r.code, y);
564
+ }
565
+ };
566
+ });
567
+ }
568
+ const f = lt(l());
569
+ function t(r, p) {
570
+ return `${r} ${p ? "Inclusive" : "Exclusive"}`;
571
+ }
572
+ return Be(() => {
573
+ c.modelValue.length || o(g[0].code, !1);
574
+ }), We(
575
+ () => c.modelValue,
576
+ (r, p) => {
577
+ r != p && !r.length && o(g[0].code, !1);
578
+ }
579
+ ), (r, p) => {
580
+ const y = v("FmSwitch");
581
+ return m(!0), T(z, null, re(e(f), ($, u) => {
582
+ var F;
583
+ return m(), T("div", { key: u }, [
584
+ i(y, {
585
+ "model-value": ((F = e(x)[u]) == null ? void 0 : F.inclusive) || !1,
586
+ "label-placement": "left",
587
+ "onUpdate:modelValue": (k) => $.input(k)
588
+ }, {
589
+ label: I(() => {
590
+ var k;
591
+ return [
592
+ n("div", null, w(t($.label, ((k = e(x)[u]) == null ? void 0 : k.inclusive) || !1)), 1)
593
+ ];
594
+ }),
595
+ _: 2
596
+ }, 1032, ["model-value", "onUpdate:modelValue"])
597
+ ]);
598
+ }), 128);
599
+ };
600
+ }
601
+ });
602
+ var Xt = { mode: "production", appMode: "mf" };
603
+ const Zt = { class: "space-y-8" }, Qt = {
604
+ key: 0,
605
+ class: "space-y-16"
606
+ }, eo = /* @__PURE__ */ Y({
607
+ __name: "StripeSetting",
608
+ props: {
609
+ modelValue: {}
610
+ },
611
+ emits: ["update:modelValue"],
612
+ setup(b, { emit: a }) {
613
+ const c = b, g = a, d = O(!1);
614
+ We(d, (o, l) => {
615
+ l != o && (!c.modelValue && o ? g("update:modelValue", {
616
+ apiKey: "",
617
+ webhookSecret: ""
618
+ }) : o || g("update:modelValue", void 0));
619
+ });
620
+ const x = D(() => {
621
+ const o = Xt.mode === "development", l = G.Config.getCountry().code.toLowerCase(), f = l != "my" ? `.${l}` : "";
622
+ return `https://marketing${o ? "-dev" : ""}${f}.feedmeapi.com/stripe/${He.getBusinessId()}/webhook`;
623
+ });
624
+ return Be(() => {
625
+ d.value = !!c.modelValue;
626
+ }), (o, l) => {
627
+ const f = v("FmSwitch"), t = v("FmTextField"), r = v("FmButton");
628
+ return m(), T("div", Zt, [
629
+ i(f, {
630
+ modelValue: e(d),
631
+ "onUpdate:modelValue": l[0] || (l[0] = (p) => ve(d) ? d.value = p : null),
632
+ value: "true",
633
+ label: "Enable Stripe"
634
+ }, null, 8, ["modelValue"]),
635
+ c.modelValue ? (m(), T("div", Qt, [
636
+ i(t, {
637
+ label: "API Key",
638
+ modelValue: c.modelValue.apiKey,
639
+ "onUpdate:modelValue": l[1] || (l[1] = (p) => c.modelValue.apiKey = p),
640
+ "helper-text": "Go to Stripe Dashboard get your API Key and paste here."
641
+ }, null, 8, ["modelValue"]),
642
+ i(t, {
643
+ label: "Webhook URL",
644
+ "model-value": e(x),
645
+ readonly: "",
646
+ "helper-text": "Copy this URL to your Stripe dashboard"
647
+ }, {
648
+ append: I(() => [
649
+ i(r, {
650
+ icon: "content_copy",
651
+ variant: "tertiary",
652
+ onClick: l[2] || (l[2] = (p) => e(bt)(e(x)))
653
+ })
654
+ ]),
655
+ _: 1
656
+ }, 8, ["model-value"]),
657
+ i(t, {
658
+ modelValue: c.modelValue.webhookSecret,
659
+ "onUpdate:modelValue": l[3] || (l[3] = (p) => c.modelValue.webhookSecret = p),
660
+ label: "Webhook Secret",
661
+ "helper-text": `Copy the webhook signing secret from your Stripe account and paste
662
+ here.`
663
+ }, null, 8, ["modelValue"])
664
+ ])) : M("", !0)
665
+ ]);
666
+ };
667
+ }
668
+ }), to = {
669
+ key: 0,
670
+ class: "space-y-16 pr-12"
671
+ }, oo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, no = {
672
+ key: 1,
673
+ class: "space-y-16"
674
+ }, ao = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, so = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, lo = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, io = { class: "space-y-4" }, ro = { class: "fm-typo-en-body-lg-400" }, co = { class: "space-y-16" }, uo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, mo = { class: "flex items-center gap-8" }, po = /* @__PURE__ */ Y({
675
+ __name: "StoreSettingSheet",
676
+ emits: ["update"],
677
+ setup(b, { expose: a, emit: c }) {
678
+ const { t: g } = he(), d = c, x = O(!1), o = O(), l = O(!1), f = ut.extend({
679
+ company: mt.extend({
680
+ name: ie.string().min(1, "Company name is required"),
681
+ regNo: ie.string().min(1, "Registration number is required"),
682
+ address: pt.extend({
683
+ line1: ie.string().min(1, "Line 1 is required"),
684
+ line2: ie.string().optional(),
685
+ state: ie.string().min(1, "State is required"),
686
+ city: ie.string().min(1, "City is required"),
687
+ postcode: ie.string().min(1, "Postcode is required"),
688
+ country: ie.string().min(1, "Country is required")
689
+ }),
690
+ phoneNo: ie.string().min(1, "Phone number is required"),
691
+ sstRegNo: ie.string().optional()
692
+ })
693
+ }), t = D(() => f.safeParse(o.value).success);
694
+ function r() {
695
+ const $ = f.safeParse(o.value);
696
+ $.success && d("update", $.data);
697
+ }
698
+ function p() {
699
+ return {
700
+ company: {
701
+ name: "",
702
+ address: {
703
+ line1: "",
704
+ line2: "",
705
+ city: "",
706
+ postcode: "",
707
+ state: "",
708
+ country: G.Config.getCountry().name
709
+ },
710
+ phoneNo: "",
711
+ regNo: "",
712
+ sstRegNo: ""
713
+ },
714
+ inclusiveTaxes: []
715
+ };
716
+ }
717
+ function y($, u) {
718
+ x.value = $, $ && (o.value = u != null && u.company ? pe.cloneDeep(u) : p());
719
+ }
720
+ return a({
721
+ showSheet: y,
722
+ data: o
723
+ }), ($, u) => {
724
+ const F = v("FmIcon"), k = v("FmMenuItem"), N = v("FmMenu"), ce = v("FmSelect"), ee = v("FmButton"), H = v("FmSideSheet");
725
+ return m(), R(H, {
726
+ "max-width": 560,
727
+ modelValue: e(x),
728
+ "onUpdate:modelValue": u[15] || (u[15] = (Q) => ve(x) ? x.value = Q : null),
729
+ header: e(g)("connect.store.setting.title")
730
+ }, {
731
+ "side-sheet-footer": I(() => [
732
+ n("div", mo, [
733
+ i(ee, {
734
+ label: e(g)("connect.common.save"),
735
+ onClick: r,
736
+ disabled: !e(t) || e(je)().isLoading,
737
+ loading: e(je)().isLoading
738
+ }, null, 8, ["label", "disabled", "loading"]),
739
+ i(ee, {
740
+ label: e(g)("connect.common.cancel"),
741
+ onClick: u[14] || (u[14] = (Q) => y(!1)),
742
+ variant: "tertiary"
743
+ }, null, 8, ["label"])
744
+ ])
745
+ ]),
746
+ default: I(() => {
747
+ var Q, de;
748
+ return [
749
+ i(Ze, { json: e(o) }, null, 8, ["json"]),
750
+ e(o) && e(o).company ? (m(), T("div", to, [
751
+ n("div", oo, w(e(g)("connect.store.setting.company.legal_info")), 1),
752
+ i(ge, {
753
+ modelValue: e(o).company.name,
754
+ "onUpdate:modelValue": u[0] || (u[0] = (V) => e(o).company.name = V),
755
+ label: e(g)("connect.store.setting.company.name"),
756
+ schema: e(le).typeAtPath(e(f), "company.name")
757
+ }, null, 8, ["modelValue", "label", "schema"]),
758
+ i(ge, {
759
+ modelValue: e(o).company.regNo,
760
+ "onUpdate:modelValue": u[1] || (u[1] = (V) => e(o).company.regNo = V),
761
+ label: e(g)("connect.store.setting.company.reg_no"),
762
+ schema: e(le).typeAtPath(e(f), "company.regNo")
763
+ }, null, 8, ["modelValue", "label", "schema"]),
764
+ e(G.Config).getCountry().taxSystems.length ? (m(), R(ge, {
765
+ key: 0,
766
+ modelValue: e(o).company.sstRegNo,
767
+ "onUpdate:modelValue": [
768
+ u[2] || (u[2] = (V) => e(o).company.sstRegNo = V),
769
+ u[3] || (u[3] = (V) => V ? null : e(o).inclusiveTaxes = [])
770
+ ],
771
+ label: e(g)("connect.store.setting.company.tax_reg_no"),
772
+ schema: e(le).typeAtPath(e(f), "company.sstRegNo")
773
+ }, null, 8, ["modelValue", "label", "schema"])) : M("", !0),
774
+ (Q = e(o).company) != null && Q.sstRegNo && e(o).inclusiveTaxes ? (m(), T("div", no, [
775
+ n("div", ao, w(e(g)("connect.store.setting.company.tax")), 1),
776
+ i(Jt, {
777
+ modelValue: e(o).inclusiveTaxes,
778
+ "onUpdate:modelValue": u[4] || (u[4] = (V) => e(o).inclusiveTaxes = V)
779
+ }, null, 8, ["modelValue"])
780
+ ])) : M("", !0),
781
+ i(ge, {
782
+ modelValue: e(o).company.phoneNo,
783
+ "onUpdate:modelValue": u[5] || (u[5] = (V) => e(o).company.phoneNo = V),
784
+ label: e(g)("connect.store.setting.company.phone"),
785
+ schema: e(le).typeAtPath(e(f), "company.phoneNo")
786
+ }, null, 8, ["modelValue", "label", "schema"]),
787
+ n("div", so, w(e(g)("connect.store.setting.company.address.title")), 1),
788
+ i(ge, {
789
+ modelValue: e(o).company.address.line1,
790
+ "onUpdate:modelValue": u[6] || (u[6] = (V) => e(o).company.address.line1 = V),
791
+ label: e(g)("connect.store.setting.company.address.line1"),
792
+ schema: e(le).typeAtPath(e(f), "company.address.line1")
793
+ }, null, 8, ["modelValue", "label", "schema"]),
794
+ i(ge, {
795
+ modelValue: e(o).company.address.line2,
796
+ "onUpdate:modelValue": u[7] || (u[7] = (V) => e(o).company.address.line2 = V),
797
+ label: e(g)("connect.store.setting.company.address.line2"),
798
+ schema: e(le).typeAtPath(e(f), "company.address.line2")
799
+ }, null, 8, ["modelValue", "label", "schema"]),
800
+ n("div", lo, [
801
+ i(ge, {
802
+ modelValue: e(o).company.address.city,
803
+ "onUpdate:modelValue": u[8] || (u[8] = (V) => e(o).company.address.city = V),
804
+ label: e(g)("connect.store.setting.company.address.city"),
805
+ schema: e(le).typeAtPath(e(f), "company.address.city")
806
+ }, null, 8, ["modelValue", "label", "schema"]),
807
+ i(ge, {
808
+ modelValue: e(o).company.address.postcode,
809
+ "onUpdate:modelValue": u[9] || (u[9] = (V) => e(o).company.address.postcode = V),
810
+ label: e(g)("connect.store.setting.company.address.postcode"),
811
+ schema: e(le).typeAtPath(e(f), "company.address.postcode")
812
+ }, null, 8, ["modelValue", "label", "schema"]),
813
+ n("div", io, [
814
+ n("div", ro, w(e(g)("connect.store.setting.company.address.state")), 1),
815
+ i(N, {
816
+ placement: "top-end",
817
+ "model-value": e(l)
818
+ }, {
819
+ "menu-button": I(() => [
820
+ i(ge, {
821
+ modelValue: e(o).company.address.state,
822
+ "onUpdate:modelValue": u[10] || (u[10] = (V) => e(o).company.address.state = V),
823
+ schema: e(le).typeAtPath(e(f), "company.address.state"),
824
+ onFocusChanged: u[11] || (u[11] = (V) => l.value = V)
825
+ }, {
826
+ append: I(() => [
827
+ i(F, {
828
+ name: e(l) ? "keyboard_arrow_up" : "keyboard_arrow_down"
829
+ }, null, 8, ["name"])
830
+ ]),
831
+ _: 1
832
+ }, 8, ["modelValue", "schema"])
833
+ ]),
834
+ default: I(() => [
835
+ (m(!0), T(z, null, re(e(Yt)[e(G.Config).getCountry().code].stateItems.filter(
836
+ (V) => {
837
+ var xe, fe;
838
+ return V.label.toLowerCase().includes(((fe = (xe = e(o)) == null ? void 0 : xe.company) == null ? void 0 : fe.address.state.toLowerCase()) ?? "");
839
+ }
840
+ ) || [], (V) => (m(), R(k, {
841
+ key: V.value,
842
+ "model-value": e(o).company.address.state === V.value,
843
+ label: V.label,
844
+ onClick: () => {
845
+ e(o).company.address.state = V.value, l.value = !1;
846
+ }
847
+ }, null, 8, ["model-value", "label", "onClick"]))), 128))
848
+ ]),
849
+ _: 1
850
+ }, 8, ["model-value"])
851
+ ]),
852
+ i(ce, {
853
+ label: e(g)("connect.store.setting.company.address.country"),
854
+ modelValue: e(o).company.address.country,
855
+ "onUpdate:modelValue": u[12] || (u[12] = (V) => e(o).company.address.country = V),
856
+ items: [
857
+ {
858
+ label: e(G.Config).getCountry().name,
859
+ value: e(G.Config).getCountry().name
860
+ }
861
+ ],
862
+ rules: [e(le).ruleAtPath(e(f), "company.address.country")]
863
+ }, null, 8, ["label", "modelValue", "items", "rules"])
864
+ ]),
865
+ n("div", co, [
866
+ n("div", uo, w(e(g)("connect.store.setting.stripe.title")), 1),
867
+ i(eo, {
868
+ "model-value": (de = e(o)) == null ? void 0 : de.stripe,
869
+ "onUpdate:modelValue": u[13] || (u[13] = (V) => e(o).stripe = V)
870
+ }, null, 8, ["model-value"])
871
+ ])
872
+ ])) : M("", !0)
873
+ ];
874
+ }),
875
+ _: 1
876
+ }, 8, ["modelValue", "header"]);
877
+ };
878
+ }
879
+ }), fo = /* @__PURE__ */ Y({
880
+ __name: "TaxVariantSetting",
881
+ props: {
882
+ modelValue: {
883
+ type: Array,
884
+ required: !0,
885
+ default: () => []
886
+ }
887
+ },
888
+ emits: ["update:modelValue"],
889
+ setup(b, { emit: a }) {
890
+ const c = b, g = a;
891
+ Be(() => {
892
+ if (o.value.length !== x.value.length) {
893
+ const t = x.value.reduce((r, p) => {
894
+ const y = Z.systemDefaultCode(p.name);
895
+ if (!y) return r;
896
+ const { systemCode: $, taxCode: u } = y;
897
+ return p.value || r.push({ systemCode: $, taxCode: u }), r;
898
+ }, []);
899
+ f(t);
900
+ }
901
+ });
902
+ function d() {
903
+ return Z.groupedTaxOptions();
904
+ }
905
+ const x = D(() => d().map((t) => ({
906
+ name: t.code,
907
+ value: (o.value || []).find(
908
+ (r) => t.options.some((p) => p.feedmeTaxCode === r)
909
+ ),
910
+ options: t.options.map((r) => ({
911
+ label: `${r.name} (${wt(r.rate)}%)`,
912
+ value: r.feedmeTaxCode
913
+ }))
914
+ }))), o = D(() => c.modelValue.map((t) => Z.generateCode(t)));
915
+ function l(t) {
916
+ const r = d().find(
917
+ (u) => u.options.some((F) => F.feedmeTaxCode === t)
918
+ ), p = r == null ? void 0 : r.options.find((u) => u.feedmeTaxCode === t);
919
+ if (!p) return;
920
+ const { systemCode: y, taxCode: $ } = p;
921
+ f([{ systemCode: y, taxCode: $ }]);
922
+ }
923
+ function f(t) {
924
+ const r = pe.clone(c.modelValue);
925
+ t.forEach((p) => {
926
+ const y = d().find(
927
+ (F) => F.options.some((k) => k.feedmeTaxCode === Z.generateCode(p))
928
+ ), $ = (y == null ? void 0 : y.options) || [], u = r.findIndex(
929
+ (F) => $.some((k) => Z.generateCode(k) === Z.generateCode(F))
930
+ );
931
+ u >= 0 ? r.splice(u, 1, p) : r.push(p);
932
+ }), g("update:modelValue", r);
933
+ }
934
+ return (t, r) => {
935
+ const p = v("FmRadio"), y = v("FmRadioGroup");
936
+ return m(!0), T(z, null, re(e(x), ($) => (m(), T("div", {
937
+ key: $.name,
938
+ class: "flex items-start"
939
+ }, [
940
+ i(y, {
941
+ modelValue: $.value,
942
+ "onUpdate:modelValue": [
943
+ (u) => $.value = u,
944
+ r[0] || (r[0] = (u) => {
945
+ l(u);
946
+ })
947
+ ]
948
+ }, {
949
+ default: I(() => [
950
+ (m(!0), T(z, null, re($.options, (u, F) => (m(), R(p, {
951
+ key: F,
952
+ value: u.value,
953
+ label: u.label
954
+ }, null, 8, ["value", "label"]))), 128))
955
+ ]),
956
+ _: 2
957
+ }, 1032, ["modelValue", "onUpdate:modelValue"])
958
+ ]))), 128);
959
+ };
960
+ }
961
+ }), ze = {
962
+ get _id() {
963
+ return (/* @__PURE__ */ new Date()).toISOString();
964
+ },
965
+ name: "",
966
+ price: G.Dinero.zero().toObject(),
967
+ originalPrice: G.Dinero.zero().toObject(),
968
+ vouchers: [],
969
+ credit: {
970
+ normal: 0,
971
+ free: {
972
+ amount: 0,
973
+ day: 0
974
+ }
975
+ },
976
+ config: {
977
+ options: {}
978
+ },
979
+ titles: [],
980
+ taxes: [],
981
+ taxTotals: [],
982
+ internal: !1,
983
+ priceWithTaxes: Ct()
984
+ }, yo = {
985
+ key: 0,
986
+ class: "space-y-24 pr-12"
987
+ }, go = { class: "space-y-8" }, bo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, vo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, ho = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, xo = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, _o = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, Co = { class: "space-y-8" }, So = { class: "flex items-center justify-between" }, Fo = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, wo = { class: "space-y-8" }, $o = { class: "flex items-center gap-8" }, ko = /* @__PURE__ */ Y({
988
+ __name: "EditBundleSheet",
989
+ emits: ["update"],
990
+ setup(b, { expose: a, emit: c }) {
991
+ const g = c, { t: d } = he(), x = Xe(), o = O(!1), l = O([]), f = O({
992
+ category: 0,
993
+ index: -1,
994
+ originalCategoryIndex: void 0
995
+ }), t = O(pe.cloneDeep(ze)), r = O(), p = Qe, y = D(() => {
996
+ const S = p.safeParse(t.value);
997
+ return S.success ? [] : S.error.errors;
998
+ }), $ = [
999
+ {
1000
+ header: "Reward title",
1001
+ accessorFn: (S) => S.collectible.name,
1002
+ enableSorting: !0
1003
+ },
1004
+ {
1005
+ id: "type",
1006
+ header: "Reward type",
1007
+ accessorFn: (S) => S.collectible.type,
1008
+ cell(S) {
1009
+ return Re[S.row.original.collectible.type].chip();
1010
+ }
1011
+ },
1012
+ {
1013
+ header: "Description",
1014
+ accessorFn: (S) => S.description,
1015
+ cell(S) {
1016
+ var P;
1017
+ const s = S.row.original;
1018
+ return s.collectible.type == "VOUCHER" || s.selectedReward == null ? s.description : rt(dt.FmStepperField, {
1019
+ "onUpdate:modelValue": (B) => {
1020
+ t.value.titles = t.value.titles.map(
1021
+ (W) => W.id == s.collectible._id ? { ...W, dayToExpire: B } : W
1022
+ );
1023
+ },
1024
+ modelValue: ((P = s.selectedReward) == null ? void 0 : P.extra) ?? 0,
1025
+ appendText: "day(s)",
1026
+ helperState: oe(y.value, "titles"),
1027
+ helperText: ne(y.value, "titles"),
1028
+ max: 9999,
1029
+ rules: [(B) => B <= 9999 || "Maximum 9999 days allowed"],
1030
+ showSteppers: !1,
1031
+ disabled: !!t.value.stripePriceId
1032
+ });
1033
+ }
1034
+ }
1035
+ ], u = O([]), F = D(() => {
1036
+ var s;
1037
+ const S = (s = t.value) != null && s.isFeedvibe ? "STORE_BUNDLE:FEEDVIBE" : "STORE_BUNDLE:DEFAULT";
1038
+ return x.bundleRewards.filter((P) => {
1039
+ var B;
1040
+ return (B = t.value) != null && B.isFeedvibe && P.type !== "VOUCHER" ? !1 : $t(P.capabilities, S);
1041
+ }).map((P) => {
1042
+ const B = k.value.find((J) => J.id == P._id), W = P.type === "VOUCHER" ? `${P.options.maxUse} use(s), ${kt(
1043
+ P.options.validityOption || {}
1044
+ )}` : "No expiry";
1045
+ return {
1046
+ collectible: P,
1047
+ description: W,
1048
+ selectedReward: B
1049
+ };
1050
+ });
1051
+ }), k = D(() => {
1052
+ var S, s;
1053
+ return [
1054
+ ...((S = t.value) == null ? void 0 : S.titles.map((P) => ({
1055
+ id: P.id,
1056
+ extra: P.dayToExpire
1057
+ }))) ?? [],
1058
+ ...((s = t.value) == null ? void 0 : s.vouchers.map((P) => ({
1059
+ id: P,
1060
+ extra: void 0
1061
+ }))) ?? []
1062
+ ];
1063
+ }), N = D(
1064
+ () => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
1065
+ );
1066
+ function ce(S) {
1067
+ t.value.subscriptionValidity = S;
1068
+ for (const s of t.value.titles)
1069
+ s.dayToExpire = S;
1070
+ t.value.credit.free && (t.value.credit.free.day = S);
1071
+ }
1072
+ function ee() {
1073
+ const S = F.value, s = t.value;
1074
+ if (!(!s || !S))
1075
+ for (let P = 0; P < S.length; P++) {
1076
+ const B = S[P];
1077
+ H.value[P] ? B.collectible.type == "TITLE" ? s.titles.findIndex(
1078
+ (L) => L.id == B.collectible._id
1079
+ ) < 0 && s.titles.push({
1080
+ id: B.collectible._id,
1081
+ dayToExpire: N.value
1082
+ }) : s.vouchers.findIndex(
1083
+ (L) => L == B.collectible._id
1084
+ ) < 0 && s.vouchers.push(B.collectible._id) : (s.titles = s.titles.filter((J) => J.id != B.collectible._id), s.vouchers = s.vouchers.filter(
1085
+ (J) => J != B.collectible._id
1086
+ ));
1087
+ }
1088
+ }
1089
+ const H = O({});
1090
+ We(H, ee, { deep: !0 });
1091
+ const Q = D(() => {
1092
+ var S, s;
1093
+ return (s = (S = x.storeOption) == null ? void 0 : S.company) == null ? void 0 : s.sstRegNo;
1094
+ }), de = D(() => {
1095
+ var S, s, P;
1096
+ return (P = (s = (S = x.storeOption) == null ? void 0 : S.inclusiveTaxes) == null ? void 0 : s[0]) != null && P.inclusive ? "Inclusive" : "Exclusive";
1097
+ }), V = D(() => {
1098
+ var S, s, P;
1099
+ return at(
1100
+ Z.fullTax,
1101
+ it(t.value.taxes),
1102
+ t.value.price,
1103
+ Number(t.value.credit.normal),
1104
+ ((S = x.storeOption) == null ? void 0 : S.inclusiveTaxes) ?? [],
1105
+ (P = (s = x.storeOption) == null ? void 0 : s.company) != null && P.sstRegNo ? Z.taxSystem.map((B) => B.code) : []
1106
+ );
1107
+ }), xe = D(() => V.value.reduce(
1108
+ (s, P) => s.add(P.total),
1109
+ St()
1110
+ ).toFormat()), fe = D(() => {
1111
+ var B;
1112
+ const S = st(
1113
+ V.value,
1114
+ t.value.price,
1115
+ ((B = x.storeOption) == null ? void 0 : B.inclusiveTaxes) ?? []
1116
+ );
1117
+ t.value.priceWithTaxes = S;
1118
+ const s = Ft(S, !1), P = Number(s.replace(/[^\d.-]/g, ""));
1119
+ return Number.isNaN(P) ? 0 : P;
1120
+ });
1121
+ function Ve() {
1122
+ t.value.taxTotals = V.value, g("update", Qe.parse(gt(t.value)));
1123
+ }
1124
+ function j() {
1125
+ return pe.cloneDeep(ze);
1126
+ }
1127
+ function Se(S, s) {
1128
+ o.value = S, S && s && (r.value = void 0, l.value = s.categories, t.value = s.bundle || j(), f.value.category = s.category, f.value.index = s.index, f.value.originalCategoryIndex = s.category, H.value = F.value.reduce((P, B, W) => (P[W] = !!B.selectedReward, P), {}));
1129
+ }
1130
+ return a({
1131
+ showSheet: Se,
1132
+ bundleImage: r,
1133
+ target: f,
1134
+ data: t
1135
+ }), (S, s) => {
1136
+ const P = v("FmSwitch"), B = v("FmHelperText"), W = v("FmTextField"), J = v("FmSelect"), L = v("FmStepperField"), _e = v("FmMenuItem"), ke = v("FmTable"), Fe = v("FmButton"), ye = v("FmSideSheet");
1137
+ return m(), R(ye, {
1138
+ "max-width": 768,
1139
+ modelValue: e(o),
1140
+ "onUpdate:modelValue": s[21] || (s[21] = (ue) => ve(o) ? o.value = ue : null),
1141
+ header: e(f).index != -1 ? e(d)("connect.store.bundle.edit.title") : e(d)("connect.store.bundle.edit.create")
1142
+ }, {
1143
+ "side-sheet-footer": I(() => [
1144
+ n("div", $o, [
1145
+ i(Fe, {
1146
+ label: e(f).index != -1 ? "Save" : "Add",
1147
+ onClick: Ve,
1148
+ disabled: e(y).length > 0,
1149
+ loading: e(je)().isLoading
1150
+ }, null, 8, ["label", "disabled", "loading"]),
1151
+ i(Fe, {
1152
+ label: "Cancel",
1153
+ onClick: s[20] || (s[20] = (ue) => Se(!1)),
1154
+ variant: "tertiary"
1155
+ })
1156
+ ])
1157
+ ]),
1158
+ default: I(() => {
1159
+ var ue, Ne, Te, Pe, Me, Oe, h, C, U, K;
1160
+ return [
1161
+ i(Ze, { json: e(t) }, null, 8, ["json"]),
1162
+ e(t) ? (m(), T("div", yo, [
1163
+ n("div", go, [
1164
+ e(G.Config).getCountry().code == "MY" && ((ue = e(x).payoutAccount) == null ? void 0 : ue.status) == "APPROVED" && ((Ne = e(x).payoutAccount) != null && Ne.enable) ? (m(), R(P, {
1165
+ key: 0,
1166
+ "onUpdate:modelValue": s[0] || (s[0] = (_) => {
1167
+ e(t).isFeedvibe = _, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], H.value = {}, e(t).hideInPos = !0, e(t).internal = !0);
1168
+ }),
1169
+ "label-placement": "right",
1170
+ "model-value": e(t).isFeedvibe || !1,
1171
+ label: "Feedvibe Campaign",
1172
+ sublabel: "Bundle will be appear for Feedvibe campaign use"
1173
+ }, null, 8, ["model-value"])) : M("", !0),
1174
+ e(t).isFeedvibe ? (m(), R(B, {
1175
+ key: 1,
1176
+ text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app. FeedVibe bundles only show up in the FeedVibe app and cannot be sold in the POS and mini program. For more information, please contact support.",
1177
+ state: "warning"
1178
+ })) : M("", !0)
1179
+ ]),
1180
+ n("div", bo, w(e(d)("connect.store.bundle.edit.basicInformation")), 1),
1181
+ i(W, {
1182
+ label: e(d)("connect.store.bundle.edit.bundleName"),
1183
+ modelValue: e(t).name,
1184
+ "onUpdate:modelValue": s[1] || (s[1] = (_) => e(t).name = _),
1185
+ "helper-state": e(oe)(e(y), "name"),
1186
+ "helper-text": e(ne)(e(y), "name")
1187
+ }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1188
+ i(J, {
1189
+ modelValue: e(f).category,
1190
+ "onUpdate:modelValue": s[2] || (s[2] = (_) => e(f).category = _),
1191
+ label: "Store Category",
1192
+ items: e(l).map((_, A) => ({ label: _, value: A }))
1193
+ }, null, 8, ["modelValue", "items"]),
1194
+ i(xt, {
1195
+ label: e(d)("connect.store.bundle.edit.bundleImage"),
1196
+ class: "w-1/2 xs:w-2/3",
1197
+ "aspect-ratio": "16/9",
1198
+ thumbnail: e(t).image ?? void 0,
1199
+ file: e(r) ?? void 0,
1200
+ "onUpdate:file": s[3] || (s[3] = (_) => {
1201
+ r.value = _;
1202
+ }),
1203
+ "helper-state": e(oe)(e(y), "image"),
1204
+ "helper-text": e(ne)(e(y), "image")
1205
+ }, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
1206
+ i(L, {
1207
+ "model-value": e(G.Dinero).fromFdoDinero(e(t).price).toUnit(),
1208
+ label: e(d)("connect.store.bundle.edit.bundlePrice"),
1209
+ min: 0,
1210
+ "max-fraction-digits": 2,
1211
+ "onUpdate:modelValue": s[4] || (s[4] = (_) => {
1212
+ e(t).price.amount = _ * 10 ** e(t).price.precision;
1213
+ }),
1214
+ "is-currency": !0,
1215
+ "show-steppers": !1,
1216
+ "helper-text": e(ne)(e(y), "price") || `${e(G.Dinero).fromNumber({ number: 1 }).toFormat(
1217
+ !0
1218
+ )} = ${e(G.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
1219
+ "helper-state": e(oe)(e(y), "price")
1220
+ }, {
1221
+ prepend: I(() => [
1222
+ ae(w(e(G.Dinero).defaultCurrency()), 1)
1223
+ ]),
1224
+ _: 1
1225
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1226
+ i(L, {
1227
+ "model-value": e(G.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
1228
+ label: e(d)("connect.store.bundle.edit.bundleValue"),
1229
+ min: 0,
1230
+ "max-fraction-digits": 2,
1231
+ "onUpdate:modelValue": s[5] || (s[5] = (_) => {
1232
+ e(t).originalPrice || (e(t).originalPrice = e(G.Dinero).zero().toObject()), e(t).originalPrice.amount = _ * 10 ** e(t).originalPrice.precision;
1233
+ }),
1234
+ "is-currency": !0,
1235
+ "show-steppers": !1,
1236
+ "helper-text": e(ne)(e(y), "originalPrice") || e(d)("connect.store.bundle.edit.originalPriceHelper"),
1237
+ "helper-state": e(oe)(e(y), "originalPrice")
1238
+ }, {
1239
+ prepend: I(() => [
1240
+ ae(w(e(G.Dinero).defaultCurrency()), 1)
1241
+ ]),
1242
+ _: 1
1243
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1244
+ e(t).isFeedvibe ? M("", !0) : (m(), R(L, {
1245
+ key: 0,
1246
+ "model-value": e(t).coinPrice ?? null,
1247
+ label: e(d)("connect.store.bundle.edit.pointNeeded"),
1248
+ min: 0,
1249
+ "onUpdate:modelValue": s[6] || (s[6] = (_) => {
1250
+ _ > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = _;
1251
+ }),
1252
+ "show-steppers": !1,
1253
+ "helper-state": e(oe)(e(y), "coinPrice"),
1254
+ "helper-text": e(ne)(e(y), "coinPrice")
1255
+ }, {
1256
+ append: I(() => [...s[22] || (s[22] = [
1257
+ ae(" point(s) ", -1)
1258
+ ])]),
1259
+ _: 1
1260
+ }, 8, ["model-value", "label", "helper-state", "helper-text"])),
1261
+ (Te = e(x).storeOption) != null && Te.stripe && !e(t).isFeedvibe ? (m(), T(z, { key: 1 }, [
1262
+ n("div", vo, w(e(d)("connect.store.bundle.edit.subscriptionSettings")), 1),
1263
+ i(W, {
1264
+ label: e(d)("connect.store.bundle.edit.stripePriceId"),
1265
+ modelValue: e(t).stripePriceId,
1266
+ "onUpdate:modelValue": s[7] || (s[7] = (_) => e(t).stripePriceId = _),
1267
+ "helper-state": e(oe)(e(y), "stripePriceId"),
1268
+ "helper-text": e(ne)(e(y), "stripePriceId")
1269
+ }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1270
+ e(t).stripePriceId ? (m(), R(L, {
1271
+ key: 0,
1272
+ "model-value": e(t).subscriptionValidity ?? null,
1273
+ min: 1,
1274
+ "onUpdate:modelValue": ce,
1275
+ label: e(d)("connect.store.bundle.edit.subscriptionValidity"),
1276
+ "show-steppers": !1,
1277
+ "helper-state": e(oe)(e(y), "subscriptionValidity"),
1278
+ "helper-text": e(ne)(e(y), "subscriptionValidity")
1279
+ }, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : M("", !0)
1280
+ ], 64)) : M("", !0),
1281
+ e(t).isFeedvibe ? M("", !0) : (m(), T(z, { key: 2 }, [
1282
+ n("div", ho, w(e(d)("connect.store.bundle.edit.credit")), 1),
1283
+ i(L, {
1284
+ modelValue: e(t).credit.normal,
1285
+ "onUpdate:modelValue": s[8] || (s[8] = (_) => e(t).credit.normal = _),
1286
+ label: e(d)("connect.store.bundle.edit.normalCredit"),
1287
+ "show-steppers": !1,
1288
+ "helper-state": e(oe)(e(y), "credit.normal"),
1289
+ "helper-text": e(ne)(e(y), "credit.normal")
1290
+ }, {
1291
+ append: I(() => [...s[23] || (s[23] = [
1292
+ ae(" credit ", -1)
1293
+ ])]),
1294
+ _: 1
1295
+ }, 8, ["modelValue", "label", "helper-state", "helper-text"]),
1296
+ i(L, {
1297
+ "model-value": ((Pe = e(t).credit.free) == null ? void 0 : Pe.amount) ?? null,
1298
+ min: 0,
1299
+ "onUpdate:modelValue": s[9] || (s[9] = (_) => {
1300
+ e(t).credit.free || (e(t).credit.free = {
1301
+ amount: 0,
1302
+ day: 1
1303
+ }), e(t).credit.free.amount = _;
1304
+ }),
1305
+ label: e(d)("connect.store.bundle.edit.freeCredit"),
1306
+ "show-steppers": !1,
1307
+ "helper-state": e(oe)(e(y), "credit.free.amount"),
1308
+ "helper-text": e(ne)(e(y), "credit.free.amount")
1309
+ }, {
1310
+ append: I(() => [...s[24] || (s[24] = [
1311
+ ae(" credit ", -1)
1312
+ ])]),
1313
+ _: 1
1314
+ }, 8, ["model-value", "label", "helper-state", "helper-text"]),
1315
+ (Me = e(t).credit.free) != null && Me.amount ? (m(), R(L, {
1316
+ key: 0,
1317
+ disabled: !!e(t).stripePriceId,
1318
+ "model-value": ((Oe = e(t).credit.free) == null ? void 0 : Oe.day) ?? null,
1319
+ min: 0,
1320
+ max: 9999,
1321
+ "onUpdate:modelValue": s[10] || (s[10] = (_) => {
1322
+ e(t).credit.free || (e(t).credit.free = {
1323
+ amount: 0,
1324
+ day: 1
1325
+ }), e(t).credit.free.day = e(N) || _;
1326
+ }),
1327
+ label: "Free credit valid for",
1328
+ "show-steppers": !1,
1329
+ "helper-state": e(oe)(e(y), "credit.free.day"),
1330
+ "helper-text": e(ne)(e(y), "credit.free.day")
1331
+ }, {
1332
+ append: I(() => [...s[25] || (s[25] = [
1333
+ ae(" day(s) ", -1)
1334
+ ])]),
1335
+ _: 1
1336
+ }, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : M("", !0)
1337
+ ], 64)),
1338
+ e(Q) ? (m(), T(z, { key: 3 }, [
1339
+ s[26] || (s[26] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1)),
1340
+ i(fo, {
1341
+ modelValue: e(t).taxes,
1342
+ "onUpdate:modelValue": s[11] || (s[11] = (_) => e(t).taxes = _)
1343
+ }, null, 8, ["modelValue"]),
1344
+ i(W, {
1345
+ label: `Tax Charged (${e(de)})`,
1346
+ "model-value": e(xe),
1347
+ disabled: ""
1348
+ }, null, 8, ["label", "model-value"])
1349
+ ], 64)) : M("", !0),
1350
+ i(L, {
1351
+ label: "Total Price",
1352
+ "model-value": e(fe),
1353
+ disabled: !0
1354
+ }, null, 8, ["model-value"]),
1355
+ n("div", xo, w(e(d)("connect.store.bundle.edit.bundleReward.title")), 1),
1356
+ n("div", _o, w(e(d)("connect.store.bundle.edit.bundleReward.description")), 1),
1357
+ n("div", Co, [
1358
+ n("div", So, [
1359
+ i(_t, {
1360
+ label: `Reward type: ${e(u).length == 0 ? "All" : e(u)[0].name}`
1361
+ }, {
1362
+ default: I(() => [
1363
+ i(_e, {
1364
+ onClick: s[12] || (s[12] = (_) => u.value = []),
1365
+ label: "All"
1366
+ }),
1367
+ i(_e, {
1368
+ onClick: s[13] || (s[13] = (_) => u.value = [
1369
+ {
1370
+ id: "type",
1371
+ value: "VOUCHER",
1372
+ name: e(Re).VOUCHER.name
1373
+ }
1374
+ ]),
1375
+ label: e(Re).VOUCHER.name
1376
+ }, null, 8, ["label"]),
1377
+ i(_e, {
1378
+ onClick: s[14] || (s[14] = (_) => u.value = [
1379
+ {
1380
+ id: "type",
1381
+ value: "TITLE",
1382
+ name: e(Re).TITLE.name
1383
+ }
1384
+ ]),
1385
+ label: e(Re).TITLE.name
1386
+ }, null, 8, ["label"])
1387
+ ]),
1388
+ _: 1
1389
+ }, 8, ["label"])
1390
+ ]),
1391
+ i(ke, {
1392
+ modelValue: e(H),
1393
+ "onUpdate:modelValue": s[15] || (s[15] = (_) => ve(H) ? H.value = _ : null),
1394
+ selection: "multiple",
1395
+ "column-filter": e(u),
1396
+ "column-defs": $,
1397
+ "row-data": e(F),
1398
+ "hide-footer": e(F).length <= 10
1399
+ }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
1400
+ i(B, {
1401
+ text: e(ne)(e(y), "titles"),
1402
+ state: e(oe)(e(y), "titles")
1403
+ }, null, 8, ["text", "state"])
1404
+ ]),
1405
+ n("div", Fo, w(e(d)("connect.store.bundle.edit.advanceSetting")), 1),
1406
+ n("div", wo, [
1407
+ e(t).isFeedvibe ? M("", !0) : (m(), T(z, { key: 0 }, [
1408
+ i(P, {
1409
+ "model-value": e(t).internal ?? !1,
1410
+ "onUpdate:modelValue": s[16] || (s[16] = (_) => e(t).internal = _),
1411
+ "label-placement": "right",
1412
+ label: e(d)("connect.store.bundle.edit.internalBundle"),
1413
+ sublabel: e(d)("connect.store.bundle.edit.internalBundleDescription")
1414
+ }, null, 8, ["model-value", "label", "sublabel"]),
1415
+ i(P, {
1416
+ "model-value": e(t).hideInPos ?? !1,
1417
+ "onUpdate:modelValue": s[17] || (s[17] = (_) => e(t).hideInPos = _),
1418
+ "label-placement": "right",
1419
+ label: e(d)("connect.store.bundle.edit.hideInPos"),
1420
+ sublabel: e(d)("connect.store.bundle.edit.hideInPosDescription")
1421
+ }, null, 8, ["model-value", "label", "sublabel"])
1422
+ ], 64)),
1423
+ i(L, {
1424
+ "model-value": ((C = (h = e(t).config) == null ? void 0 : h.options) == null ? void 0 : C.maxPerUser) || null,
1425
+ "onUpdate:modelValue": s[18] || (s[18] = (_) => e(pe).set(e(t), "config.options.maxPerUser", _)),
1426
+ label: e(d)("connect.store.bundle.edit.maxPerUser"),
1427
+ "show-steppers": !1,
1428
+ placeholder: e(d)("connect.store.bundle.edit.unlimited")
1429
+ }, null, 8, ["model-value", "label", "placeholder"]),
1430
+ i(L, {
1431
+ "model-value": ((K = (U = e(t).config) == null ? void 0 : U.options) == null ? void 0 : K.maxReceive) || null,
1432
+ "onUpdate:modelValue": s[19] || (s[19] = (_) => e(pe).set(e(t), "config.options.maxReceive", _)),
1433
+ label: e(d)("connect.store.bundle.edit.maxReceive"),
1434
+ "show-steppers": !1,
1435
+ placeholder: e(d)("connect.store.bundle.edit.unlimited")
1436
+ }, null, 8, ["model-value", "label", "placeholder"])
1437
+ ])
1438
+ ])) : M("", !0)
1439
+ ];
1440
+ }),
1441
+ _: 1
1442
+ }, 8, ["modelValue", "header"]);
1443
+ };
1444
+ }
1445
+ }), Po = { class: "flex gap-8 items-center flex-wrap" }, Vo = { class: "flex items-center gap-8" }, To = /* @__PURE__ */ Y({
1446
+ __name: "SendBundleSheet",
1447
+ emits: ["success"],
1448
+ setup(b, { expose: a, emit: c }) {
1449
+ const { minor: g } = ot, d = O(), x = O(""), o = O(""), l = O([]), f = O(!1), t = O();
1450
+ O(!0);
1451
+ function r(F) {
1452
+ f.value = !0, x.value = null, o.value = "", d.value = F.bundle;
1453
+ }
1454
+ function p() {
1455
+ f.value = !1;
1456
+ }
1457
+ async function y(F) {
1458
+ const k = await Pt.read({
1459
+ limit: 25,
1460
+ skip: 0,
1461
+ sortBy: "_id",
1462
+ search: F,
1463
+ descending: !1
1464
+ });
1465
+ l.value = k.resources.map((N) => ({
1466
+ label: `${N.name} (${N.phoneNumber})`,
1467
+ value: N._id
1468
+ })), await new Promise((N) => setTimeout(N, 100));
1469
+ }
1470
+ async function $() {
1471
+ if (!d.value || !x.value) return;
1472
+ const F = l.value.find(
1473
+ (N) => N.value === x.value
1474
+ );
1475
+ await Ue.confirm(
1476
+ `Are you sure you want to send bundle ${d.value.name} to ${F == null ? void 0 : F.label}?`,
1477
+ "Confirm",
1478
+ "Confirm",
1479
+ "Cancel"
1480
+ ) && await g(
1481
+ async () => {
1482
+ const N = {
1483
+ bundle: d.value._id,
1484
+ member: x.value,
1485
+ source: ft.enum.ADMIN,
1486
+ ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${o.value}`,
1487
+ withCoin: !1
1488
+ };
1489
+ await Ee.sendBundle(N), p();
1490
+ },
1491
+ {
1492
+ message: "Sending bundle",
1493
+ successMessage: "Bundle sent"
1494
+ }
1495
+ );
1496
+ }
1497
+ const u = D(() => {
1498
+ var k, N, ce;
1499
+ const F = [];
1500
+ return ((k = d.value) == null ? void 0 : k.price.amount) > 0 && F.push(
1501
+ `${G.Config.getCountry().currency.symbol}${nt((N = d.value) == null ? void 0 : N.price)}`
1502
+ ), (ce = d.value) != null && ce.coinPrice && F.push(`${d.value.coinPrice} point(s)`), F.join(" or ");
1503
+ });
1504
+ return a({
1505
+ showSheet: r,
1506
+ hideSheet: p
1507
+ }), Be(async () => {
1508
+ await y("");
1509
+ }), (F, k) => {
1510
+ const N = v("FmCardMedia"), ce = v("FmCardHeader"), ee = v("FmChip"), H = v("FmCardSection"), Q = v("FmCard"), de = v("FmSelect"), V = v("FmTextField"), xe = v("FmForm"), fe = v("FmButton"), Ve = v("FmSideSheet");
1511
+ return m(), R(Ve, {
1512
+ "max-width": 560,
1513
+ "dismiss-away": !0,
1514
+ header: "Send bundle to member",
1515
+ modelValue: e(f),
1516
+ "onUpdate:modelValue": [
1517
+ k[4] || (k[4] = (j) => ve(f) ? f.value = j : null),
1518
+ k[5] || (k[5] = (j) => f.value = j)
1519
+ ]
1520
+ }, {
1521
+ "side-sheet-footer": I(() => [
1522
+ n("div", Vo, [
1523
+ i(fe, {
1524
+ label: "Send",
1525
+ loading: e(je)().isLoading,
1526
+ onClick: k[2] || (k[2] = async () => {
1527
+ var j;
1528
+ return (j = e(t)) == null ? void 0 : j.validateInputs();
1529
+ })
1530
+ }, null, 8, ["loading"]),
1531
+ i(fe, {
1532
+ label: "Cancel",
1533
+ type: "button",
1534
+ variant: "tertiary",
1535
+ onClick: k[3] || (k[3] = (j) => f.value = !1)
1536
+ })
1537
+ ])
1538
+ ]),
1539
+ default: I(() => [
1540
+ i(xe, {
1541
+ class: "space-y-16",
1542
+ ref_key: "form",
1543
+ ref: t,
1544
+ onValidationSuccess: $,
1545
+ blameFormChildOnValidationFailed: ""
1546
+ }, {
1547
+ default: I(() => [
1548
+ i(Q, {
1549
+ class: "max-w-[700px]",
1550
+ horizontal: "",
1551
+ variant: "outlined"
1552
+ }, {
1553
+ default: I(() => {
1554
+ var j, Se;
1555
+ return [
1556
+ (j = e(d)) != null && j.image ? (m(), R(N, {
1557
+ key: 0,
1558
+ width: "100",
1559
+ src: (Se = e(d)) == null ? void 0 : Se.image
1560
+ }, null, 8, ["src"])) : M("", !0),
1561
+ i(H, { class: "flex flex-col gap-16 justify-between" }, {
1562
+ default: I(() => {
1563
+ var S;
1564
+ return [
1565
+ i(ce, {
1566
+ class: "p-0",
1567
+ title: (S = e(d)) == null ? void 0 : S.name,
1568
+ subtitle: e(u)
1569
+ }, null, 8, ["title", "subtitle"]),
1570
+ i(H, { class: "p-0" }, {
1571
+ default: I(() => {
1572
+ var s, P, B, W, J, L, _e, ke, Fe, ye, ue;
1573
+ return [
1574
+ n("div", Po, [
1575
+ (s = e(d)) != null && s.isFeedvibe ? (m(), R(ee, {
1576
+ key: 0,
1577
+ label: "Feedvibe"
1578
+ })) : M("", !0),
1579
+ (B = (P = e(d)) == null ? void 0 : P.titles) != null && B.length ? (m(), R(ee, {
1580
+ key: 1,
1581
+ label: `${e(d).titles.length} title(s)`
1582
+ }, null, 8, ["label"])) : M("", !0),
1583
+ (J = (W = e(d)) == null ? void 0 : W.vouchers) != null && J.length ? (m(), R(ee, {
1584
+ key: 2,
1585
+ label: `${e(d).vouchers.length} voucher(s)`
1586
+ }, null, 8, ["label"])) : M("", !0),
1587
+ (_e = (L = e(d)) == null ? void 0 : L.credit) != null && _e.normal || (ye = (Fe = (ke = e(d)) == null ? void 0 : ke.credit) == null ? void 0 : Fe.free) != null && ye.amount ? (m(), R(ee, {
1588
+ key: 3,
1589
+ label: `${(e(d).credit.normal || 0) + (((ue = e(d).credit.free) == null ? void 0 : ue.amount) || 0)} credit(s)`
1590
+ }, null, 8, ["label"])) : M("", !0)
1591
+ ])
1592
+ ];
1593
+ }),
1594
+ _: 1
1595
+ })
1596
+ ];
1597
+ }),
1598
+ _: 1
1599
+ })
1600
+ ];
1601
+ }),
1602
+ _: 1
1603
+ }),
1604
+ i(de, {
1605
+ modelValue: e(x),
1606
+ "onUpdate:modelValue": k[0] || (k[0] = (j) => ve(x) ? x.value = j : null),
1607
+ label: "Select member",
1608
+ searchable: "",
1609
+ items: e(l),
1610
+ onSearch: y,
1611
+ rules: [(j) => !!j > 0 || "Member is required"],
1612
+ "helper-text": "Type to search member"
1613
+ }, null, 8, ["modelValue", "items", "rules"]),
1614
+ i(V, {
1615
+ modelValue: e(o),
1616
+ "onUpdate:modelValue": k[1] || (k[1] = (j) => ve(o) ? o.value = j : null),
1617
+ label: "Reference (optional)",
1618
+ rules: [
1619
+ (j) => j.length < 50 || "Reference must be less than 50 characters"
1620
+ ]
1621
+ }, null, 8, ["modelValue", "rules"])
1622
+ ]),
1623
+ _: 1
1624
+ }, 512)
1625
+ ]),
1626
+ _: 1
1627
+ }, 8, ["modelValue"]);
1628
+ };
1629
+ }
1630
+ }), Ro = { class: "flex items-center gap-8" }, Io = { class: "flex-shrink-0 -mr-8 -mt-8" }, Uo = ["title"], Eo = ["src"], Do = { class: "relative flex items-center gap-6 min-w-0" }, Bo = { class: "fm-typo-en-body-sm-600 tracking-[0.08em] truncate" }, No = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Mo = {
1631
+ key: 0,
1632
+ class: "flex items-center gap-6"
1633
+ }, Oo = "linear-gradient(135deg,#FF9455,#B25300)", Lo = /* @__PURE__ */ Y({
1634
+ __name: "GiftCardProgramCard",
1635
+ props: {
1636
+ program: {},
1637
+ disabled: { type: Boolean }
1638
+ },
1639
+ emits: ["edit", "setLive", "deactivate"],
1640
+ setup(b, { emit: a }) {
1641
+ const c = b, g = a, d = D(() => yt(c.program)), x = D(() => {
1642
+ const { denominations: f, anyAmount: t } = d.value, r = [], p = [
1643
+ ...f,
1644
+ ...t ? [t.min, t.max] : []
1645
+ ];
1646
+ if (p.length) {
1647
+ const y = Math.min(...p), $ = Math.max(...p);
1648
+ r.push(y === $ ? `RM${y}` : `RM${y}–RM${$}`);
1649
+ }
1650
+ return t && r.push("Any amount"), r.join(" · ");
1651
+ }), o = D(() => {
1652
+ var f;
1653
+ return ((f = c.program.designs) == null ? void 0 : f[0]) ?? null;
1654
+ }), l = D(() => {
1655
+ const f = c.program.numberFormat, t = (f == null ? void 0 : f.prefix) ?? "GC", r = Math.max(4, Math.min(Number((f == null ? void 0 : f.length) ?? 12), 16));
1656
+ return `${t}${"•".repeat(r)}`;
1657
+ });
1658
+ return (f, t) => {
1659
+ const r = v("FmChip"), p = v("FmButton"), y = v("FmMenuItem"), $ = v("FmMenu"), u = v("FmIcon"), F = v("FmCard");
1660
+ return m(), R(F, {
1661
+ variant: "outlined",
1662
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px]"
1663
+ }, {
1664
+ default: I(() => [
1665
+ n("div", Ro, [
1666
+ i(r, {
1667
+ label: "Gift card",
1668
+ variant: "neutral",
1669
+ compact: ""
1670
+ }),
1671
+ i(r, {
1672
+ label: b.program.active ? "Live" : "Inactive",
1673
+ variant: b.program.active ? "success" : "neutral",
1674
+ compact: ""
1675
+ }, null, 8, ["label", "variant"]),
1676
+ t[4] || (t[4] = n("div", { class: "flex-1" }, null, -1)),
1677
+ n("div", Io, [
1678
+ i($, { placement: "bottom-end" }, {
1679
+ "menu-button": I(() => [
1680
+ i(p, {
1681
+ icon: "more_vert",
1682
+ variant: "tertiary"
1683
+ })
1684
+ ]),
1685
+ default: I(() => [
1686
+ i(y, {
1687
+ onClick: t[0] || (t[0] = (k) => g("edit")),
1688
+ icon: "edit",
1689
+ label: "Edit"
1690
+ }),
1691
+ b.program.active ? (m(), R(y, {
1692
+ key: 1,
1693
+ onClick: t[2] || (t[2] = (k) => g("deactivate")),
1694
+ icon: "pause_circle",
1695
+ label: "Set inactive"
1696
+ })) : (m(), R(y, {
1697
+ key: 0,
1698
+ onClick: t[1] || (t[1] = (k) => g("setLive")),
1699
+ icon: "check_circle",
1700
+ label: "Set live"
1701
+ }))
1702
+ ]),
1703
+ _: 1
1704
+ })
1705
+ ])
1706
+ ]),
1707
+ n("div", {
1708
+ class: "fm-typo-en-body-lg-600 truncate",
1709
+ title: b.program.name
1710
+ }, w(b.program.name), 9, Uo),
1711
+ n("div", {
1712
+ class: "relative h-[120px] aspect-[1.586/1] mx-auto rounded-md overflow-hidden flex flex-col p-8 text-fm-color-typo-white",
1713
+ style: tt({ background: Oo })
1714
+ }, [
1715
+ e(o) ? (m(), T("img", {
1716
+ key: 0,
1717
+ src: e(o),
1718
+ alt: "",
1719
+ class: "absolute inset-0 w-full h-full object-cover"
1720
+ }, null, 8, Eo)) : M("", !0),
1721
+ t[6] || (t[6] = n("div", { class: "relative flex items-start justify-between gap-4" }, [
1722
+ n("span", { class: "fm-typo-en-body-sm-600" }, "FeedMe"),
1723
+ n("span", { class: "fm-typo-en-body-sm-600 uppercase tracking-[0.1em] opacity-90 whitespace-nowrap" }, " Gift Card ")
1724
+ ], -1)),
1725
+ t[7] || (t[7] = n("div", { class: "flex-1" }, null, -1)),
1726
+ n("div", Do, [
1727
+ t[5] || (t[5] = n("span", { class: "w-[20px] h-[14px] rounded-sm flex-none bg-gradient-to-br from-[#F4D479] to-[#C99B3B]" }, null, -1)),
1728
+ n("span", Bo, w(e(l)), 1)
1729
+ ])
1730
+ ], 4),
1731
+ n("div", No, w(e(x)), 1),
1732
+ t[9] || (t[9] = n("div", { class: "flex-1" }, null, -1)),
1733
+ b.program.active ? (m(), T("div", Mo, [
1734
+ i(u, {
1735
+ name: "check",
1736
+ size: "sm",
1737
+ class: "text-fm-color-system-success-400"
1738
+ }),
1739
+ t[8] || (t[8] = n("span", { class: "fm-typo-en-body-sm-600 text-fm-color-system-success-400" }, " Live to customers ", -1))
1740
+ ])) : (m(), R(p, {
1741
+ key: 1,
1742
+ label: "Set live",
1743
+ variant: "secondary",
1744
+ size: "md",
1745
+ disabled: b.disabled,
1746
+ onClick: t[3] || (t[3] = (k) => g("setLive"))
1747
+ }, null, 8, ["disabled"]))
1748
+ ]),
1749
+ _: 1
1750
+ });
1751
+ };
1752
+ }
1753
+ }), Ao = { class: "rounded-lg border-1 border-fm-color-primary p-24 flex flex-col gap-16" }, jo = { class: "flex items-start gap-16" }, qo = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary" }, Go = { class: "flex flex-col gap-4" }, Ko = { class: "fm-typo-en-body-lg-600" }, Ho = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zo = { class: "rounded-md border-1 border-fm-color-neutral-gray-200" }, Wo = { class: "flex-1 min-w-0" }, Yo = { class: "fm-typo-en-body-md-600" }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xo = /* @__PURE__ */ Y({
1754
+ __name: "StoreOnboarding",
1755
+ props: {
1756
+ settingStatus: {},
1757
+ payoutStatus: {},
1758
+ requiresPayout: { type: Boolean, default: !0 }
1759
+ },
1760
+ emits: ["setupStoreSetting", "setupPayout"],
1761
+ setup(b, { emit: a }) {
1762
+ const { t: c } = he(), g = b, d = a, x = D(() => [
1763
+ {
1764
+ key: "payout",
1765
+ title: c("connect.store.onboarding.payoutTitle"),
1766
+ description: c("connect.store.onboarding.payoutDescription"),
1767
+ status: g.payoutStatus,
1768
+ action: "setupPayout"
1769
+ },
1770
+ {
1771
+ key: "setting",
1772
+ title: c("connect.store.onboarding.settingTitle"),
1773
+ description: c("connect.store.onboarding.settingDescription"),
1774
+ status: g.settingStatus,
1775
+ action: "setupStoreSetting"
1776
+ }
1777
+ ].filter((l) => l.key !== "payout" || g.requiresPayout));
1778
+ return (o, l) => {
1779
+ const f = v("FmIcon"), t = v("FmChip"), r = v("FmButton");
1780
+ return m(), T("div", Ao, [
1781
+ n("div", jo, [
1782
+ n("span", qo, [
1783
+ i(f, {
1784
+ name: "warning",
1785
+ class: "text-fm-color-typo-white"
1786
+ })
1787
+ ]),
1788
+ n("div", Go, [
1789
+ n("div", Ko, w(e(c)("connect.store.onboarding.title")), 1),
1790
+ n("div", Ho, w(e(c)("connect.store.onboarding.description")), 1)
1791
+ ])
1792
+ ]),
1793
+ n("div", zo, [
1794
+ (m(!0), T(z, null, re(e(x), (p, y) => (m(), T("div", {
1795
+ key: p.key,
1796
+ class: $e(["flex items-center gap-16 p-16", y > 0 ? "border-t-1 border-fm-color-neutral-gray-200" : ""])
1797
+ }, [
1798
+ n("span", {
1799
+ class: $e([
1800
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1801
+ p.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1802
+ ])
1803
+ }, [
1804
+ p.status === "COMPLETE" ? (m(), R(f, {
1805
+ key: 0,
1806
+ name: "check",
1807
+ size: "sm"
1808
+ })) : (m(), T(z, { key: 1 }, [
1809
+ ae(w(y + 1), 1)
1810
+ ], 64))
1811
+ ], 2),
1812
+ n("div", Wo, [
1813
+ n("div", Yo, w(p.title), 1),
1814
+ n("div", Jo, w(p.description), 1)
1815
+ ]),
1816
+ i(t, {
1817
+ label: e(c)(
1818
+ p.status === "COMPLETE" ? "connect.store.onboarding.complete" : p.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1819
+ ),
1820
+ variant: "plain",
1821
+ class: $e(
1822
+ p.status === "COMPLETE" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100"
1823
+ ),
1824
+ compact: ""
1825
+ }, null, 8, ["label", "class"]),
1826
+ p.status !== "COMPLETE" ? (m(), R(r, {
1827
+ key: 0,
1828
+ class: "flex-none",
1829
+ label: e(c)(
1830
+ p.status === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.setupNow"
1831
+ ),
1832
+ variant: "primary",
1833
+ onClick: ($) => p.action === "setupPayout" ? d("setupPayout") : d("setupStoreSetting")
1834
+ }, null, 8, ["label", "onClick"])) : M("", !0)
1835
+ ], 2))), 128))
1836
+ ])
1837
+ ]);
1838
+ };
1839
+ }
1840
+ }), Zo = { class: "rounded-lg bg-fm-color-system-success-100 p-16 flex items-start gap-16" }, Qo = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-system-success-400" }, en = { class: "flex-1 flex flex-col gap-4" }, tn = { class: "fm-typo-en-body-lg-600" }, on = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nn = /* @__PURE__ */ Y({
1841
+ __name: "StoreAllSet",
1842
+ emits: ["dismiss"],
1843
+ setup(b, { emit: a }) {
1844
+ const { t: c } = he(), g = a;
1845
+ return (d, x) => {
1846
+ const o = v("FmIcon"), l = v("FmButton");
1847
+ return m(), T("div", Zo, [
1848
+ n("span", Qo, [
1849
+ i(o, {
1850
+ name: "check_circle",
1851
+ class: "text-fm-color-typo-white"
1852
+ })
1853
+ ]),
1854
+ n("div", en, [
1855
+ n("div", tn, w(e(c)("connect.store.allSet.title")), 1),
1856
+ n("div", on, w(e(c)("connect.store.allSet.description")), 1)
1857
+ ]),
1858
+ i(l, {
1859
+ class: "flex-none",
1860
+ icon: "close",
1861
+ size: "md",
1862
+ variant: "tertiary",
1863
+ onClick: x[0] || (x[0] = (f) => g("dismiss"))
1864
+ })
1865
+ ]);
1866
+ };
1867
+ }
1868
+ }), an = { class: "space-y-16" }, sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ln = { class: "space-y-8" }, rn = { class: "h-8 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, cn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, dn = { class: "space-y-8" }, un = { class: "flex-1 min-w-0" }, mn = { class: "fm-typo-en-body-md-600" }, pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fn = { class: "flex items-center justify-end gap-8 pb-16" }, yn = /* @__PURE__ */ Y({
1869
+ __name: "StoreSetupDialog",
1870
+ props: {
1871
+ settingStatus: {},
1872
+ payoutStatus: {},
1873
+ requiresPayout: { type: Boolean, default: !0 }
1874
+ },
1875
+ setup(b) {
1876
+ const { t: a } = he(), c = b, g = Ye(), { emitData: d, emitAction: x } = Je(), o = D(() => [
1877
+ {
1878
+ key: "payout",
1879
+ title: a("connect.store.onboarding.payoutTitle"),
1880
+ description: a("connect.store.onboarding.payoutDescription"),
1881
+ status: c.payoutStatus,
1882
+ action: "setupPayout",
1883
+ actionLabel: a(
1884
+ c.payoutStatus === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.payoutAction"
1885
+ )
1886
+ },
1887
+ {
1888
+ key: "setting",
1889
+ title: a("connect.store.onboarding.settingTitle"),
1890
+ description: a("connect.store.onboarding.settingDescription"),
1891
+ status: c.settingStatus,
1892
+ action: "setupStoreSetting",
1893
+ actionLabel: a("connect.store.onboarding.settingTitle")
1894
+ }
1895
+ ].filter((p) => p.key !== "payout" || c.requiresPayout)), l = D(
1896
+ () => o.value.filter((r) => r.status === "COMPLETE").length
1897
+ ), f = D(
1898
+ () => o.value.find((r) => r.status !== "COMPLETE")
1899
+ );
1900
+ function t() {
1901
+ f.value && (d(f.value.action), x("primary"), g.close());
1902
+ }
1903
+ return (r, p) => {
1904
+ const y = v("FmIcon"), $ = v("FmChip"), u = v("FmButton");
1905
+ return m(), T("div", an, [
1906
+ n("div", sn, w(e(a)("connect.store.setupDialog.description")), 1),
1907
+ n("div", ln, [
1908
+ n("div", rn, [
1909
+ n("div", {
1910
+ class: "h-full rounded-full bg-fm-color-primary transition-all",
1911
+ style: tt({ width: `${e(l) / e(o).length * 100}%` })
1912
+ }, null, 4)
1913
+ ]),
1914
+ n("div", cn, w(e(a)("connect.store.setupDialog.progress", {
1915
+ done: e(l),
1916
+ total: e(o).length
1917
+ })), 1)
1918
+ ]),
1919
+ n("div", dn, [
1920
+ (m(!0), T(z, null, re(e(o), (F, k) => {
1921
+ var N;
1922
+ return m(), T("div", {
1923
+ key: F.key,
1924
+ class: $e([
1925
+ "rounded-md border-1 p-16 flex items-center gap-16",
1926
+ F.key === ((N = e(f)) == null ? void 0 : N.key) ? "border-fm-color-primary" : "border-fm-color-neutral-gray-200"
1927
+ ])
1928
+ }, [
1929
+ n("span", {
1930
+ class: $e([
1931
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1932
+ F.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1933
+ ])
1934
+ }, [
1935
+ F.status === "COMPLETE" ? (m(), R(y, {
1936
+ key: 0,
1937
+ name: "check",
1938
+ size: "sm"
1939
+ })) : (m(), T(z, { key: 1 }, [
1940
+ ae(w(k + 1), 1)
1941
+ ], 64))
1942
+ ], 2),
1943
+ n("div", un, [
1944
+ n("div", mn, w(F.title), 1),
1945
+ n("div", pn, w(F.description), 1)
1946
+ ]),
1947
+ i($, {
1948
+ label: e(a)(
1949
+ F.status === "COMPLETE" ? "connect.store.onboarding.complete" : F.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1950
+ ),
1951
+ variant: "plain",
1952
+ class: $e(
1953
+ F.status === "COMPLETE" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100"
1954
+ ),
1955
+ compact: ""
1956
+ }, null, 8, ["label", "class"])
1957
+ ], 2);
1958
+ }), 128))
1959
+ ]),
1960
+ n("div", fn, [
1961
+ i(u, {
1962
+ label: e(a)("connect.common.cancel"),
1963
+ variant: "tertiary",
1964
+ onClick: p[0] || (p[0] = (F) => e(g).close())
1965
+ }, null, 8, ["label"]),
1966
+ e(f) ? (m(), R(u, {
1967
+ key: 0,
1968
+ label: e(f).actionLabel,
1969
+ variant: "primary",
1970
+ onClick: t
1971
+ }, null, 8, ["label"])) : M("", !0)
1972
+ ])
1973
+ ]);
1974
+ };
1975
+ }
1976
+ });
1977
+ function gn(b, a, c = !0) {
1978
+ let g = "INCOMPLETE";
1979
+ (a == null ? void 0 : a.status) === "APPROVED" && a.enable ? g = "COMPLETE" : (a == null ? void 0 : a.status) === "PENDING" && (g = "PENDING");
1980
+ const d = c;
1981
+ return {
1982
+ settingStatus: b ? "COMPLETE" : "INCOMPLETE",
1983
+ payoutStatus: g,
1984
+ requiresPayout: d,
1985
+ complete: b && (!d || g === "COMPLETE")
1986
+ };
1987
+ }
1988
+ const bn = { class: "grid lg:grid-cols-2 gap-32 items-center" }, vn = { class: "flex flex-col gap-16" }, hn = { class: "flex flex-col gap-8" }, xn = { class: "fm-typo-en-title-md-800" }, _n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[460px]" }, Cn = { class: "flex flex-col gap-16" }, Sn = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary" }, Fn = { class: "flex flex-col gap-2" }, wn = { class: "fm-typo-en-body-md-600" }, $n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, kn = { class: "flex items-center gap-16 pt-8" }, Pn = { class: "relative rounded-lg overflow-hidden aspect-[4/3] flex items-end justify-center bg-gradient-to-br from-[#FFF3E6] to-[#FDE6D0]" }, Vn = { class: "absolute inset-0 grid place-items-center" }, Tn = { class: "relative w-[68%] max-w-[320px]" }, Rn = { class: "relative w-full aspect-[1.586/1] rounded-lg p-16 flex flex-col justify-between text-fm-color-typo-white bg-gradient-to-br from-[#C98A4B] to-[#A96A2E] rotate-[-3deg]" }, In = { class: "flex flex-col" }, Un = { class: "fm-typo-en-body-sm-400 uppercase tracking-[0.12em] opacity-90" }, En = /* @__PURE__ */ Y({
1989
+ __name: "GiftCardUpsell",
1990
+ props: {
1991
+ premium: { type: Boolean }
1992
+ },
1993
+ emits: ["upgrade", "comparePlans", "create"],
1994
+ setup(b, { emit: a }) {
1995
+ const { t: c } = he(), g = a, d = [
1996
+ {
1997
+ icon: "send",
1998
+ title: "connect.store.giftCard.benefitGiftTitle",
1999
+ description: "connect.store.giftCard.benefitGiftDescription"
2000
+ },
2001
+ {
2002
+ icon: "bar_chart",
2003
+ title: "connect.store.giftCard.benefitSalesTitle",
2004
+ description: "connect.store.giftCard.benefitSalesDescription"
2005
+ },
2006
+ {
2007
+ icon: "favorite",
2008
+ title: "connect.store.giftCard.benefitLoyaltyTitle",
2009
+ description: "connect.store.giftCard.benefitLoyaltyDescription"
2010
+ }
2011
+ ];
2012
+ return (x, o) => {
2013
+ const l = v("FmIcon"), f = v("FmButton"), t = v("FmCard");
2014
+ return m(), R(t, {
2015
+ variant: "outlined",
2016
+ class: "p-24"
2017
+ }, {
2018
+ default: I(() => [
2019
+ n("div", bn, [
2020
+ n("div", vn, [
2021
+ n("span", {
2022
+ class: $e([
2023
+ "self-start inline-flex items-center gap-4 px-8 py-4 rounded-sm fm-typo-en-body-sm-600 tracking-[0.05em]",
2024
+ b.premium ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-secondary-blueberry text-fm-color-typo-white uppercase"
2025
+ ])
2026
+ }, [
2027
+ i(l, {
2028
+ name: b.premium ? "check" : "stars",
2029
+ size: "sm"
2030
+ }, null, 8, ["name"]),
2031
+ ae(" " + w(b.premium ? e(c)("connect.store.giftCard.includedInPlan") : e(c)("connect.store.giftCard.premium")), 1)
2032
+ ], 2),
2033
+ n("div", hn, [
2034
+ n("div", xn, w(e(c)("connect.store.giftCard.upsellTitle")), 1),
2035
+ n("div", _n, w(e(c)("connect.store.giftCard.upsellDescription")), 1)
2036
+ ]),
2037
+ n("div", Cn, [
2038
+ (m(), T(z, null, re(d, (r) => n("div", {
2039
+ key: r.icon,
2040
+ class: "flex items-start gap-12"
2041
+ }, [
2042
+ n("span", Sn, [
2043
+ i(l, {
2044
+ name: r.icon
2045
+ }, null, 8, ["name"])
2046
+ ]),
2047
+ n("div", Fn, [
2048
+ n("div", wn, w(e(c)(r.title)), 1),
2049
+ n("div", $n, w(e(c)(r.description)), 1)
2050
+ ])
2051
+ ])), 64))
2052
+ ]),
2053
+ n("div", kn, [
2054
+ b.premium ? (m(), R(f, {
2055
+ key: 0,
2056
+ label: e(c)("connect.store.giftCard.createGiftCard"),
2057
+ variant: "primary",
2058
+ icon: "add",
2059
+ onClick: o[0] || (o[0] = (r) => g("create"))
2060
+ }, null, 8, ["label"])) : (m(), T(z, { key: 1 }, [
2061
+ i(f, {
2062
+ label: e(c)("connect.store.giftCard.upgrade"),
2063
+ variant: "primary",
2064
+ onClick: o[1] || (o[1] = (r) => g("upgrade"))
2065
+ }, null, 8, ["label"]),
2066
+ n("button", {
2067
+ type: "button",
2068
+ class: "inline-flex items-center gap-4 fm-typo-en-body-md-600 text-fm-color-typo-primary",
2069
+ onClick: o[2] || (o[2] = (r) => g("comparePlans"))
2070
+ }, [
2071
+ ae(w(e(c)("connect.store.giftCard.comparePlans")) + " ", 1),
2072
+ i(l, {
2073
+ name: "chevron_right",
2074
+ size: "sm"
2075
+ })
2076
+ ])
2077
+ ], 64))
2078
+ ])
2079
+ ]),
2080
+ n("div", Pn, [
2081
+ n("div", Vn, [
2082
+ n("div", Tn, [
2083
+ o[6] || (o[6] = n("div", { class: "absolute -left-[14%] top-[6%] w-full aspect-[1.586/1] rounded-lg bg-gradient-to-br from-[#3A3A3C] to-[#1C1C1E] rotate-[-8deg]" }, null, -1)),
2084
+ n("div", Rn, [
2085
+ o[5] || (o[5] = n("span", { class: "fm-typo-en-body-md-600" }, "FeedMe", -1)),
2086
+ n("div", In, [
2087
+ n("span", Un, w(e(c)("connect.store.giftCard.giftCardLabel")), 1),
2088
+ o[4] || (o[4] = n("span", { class: "fm-typo-en-title-md-800" }, "RM100", -1))
2089
+ ])
2090
+ ])
2091
+ ])
2092
+ ]),
2093
+ b.premium ? M("", !0) : (m(), T("button", {
2094
+ key: 0,
2095
+ type: "button",
2096
+ class: "relative mb-24 inline-flex items-center gap-8 px-16 py-8 rounded-full bg-fm-color-neutral-black text-fm-color-typo-white fm-typo-en-body-sm-600",
2097
+ onClick: o[3] || (o[3] = (r) => g("upgrade"))
2098
+ }, [
2099
+ i(l, {
2100
+ name: "lock",
2101
+ size: "sm"
2102
+ }),
2103
+ ae(" " + w(e(c)("connect.store.giftCard.unlockNow")), 1)
2104
+ ]))
2105
+ ])
2106
+ ])
2107
+ ]),
2108
+ _: 1
2109
+ });
2110
+ };
2111
+ }
2112
+ });
2113
+ var et = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc", voucherAppUrl: "https://voucher.feedme.cc/" };
2114
+ const Dn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[640px]" }, Bn = { class: "px-24 flex flex-col gap-y-16" }, Nn = { class: "space-y-8 py-12" }, Mn = { class: "flex gap-8 items-center" }, On = { class: "fm-typo-en-body-lg-600" }, Ln = {
2115
+ key: 1,
2116
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
2117
+ }, An = {
2118
+ key: 1,
2119
+ class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24"
2120
+ }, jn = { class: "flex gap-8 items-center" }, qn = { class: "fm-typo-en-body-lg-600" }, Gn = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, Kn = { class: "flex flex-col gap-16 text-center" }, Hn = { class: "fm-typo-en-title-sm-800" }, zn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pa = /* @__PURE__ */ Y({
2121
+ __name: "Store",
2122
+ setup(b) {
2123
+ const { t: a } = he(), c = {
2124
+ label: a("connect.store.actions.setting"),
2125
+ value: "setting",
2126
+ isPrimary: !1
2127
+ }, g = {
2128
+ label: a("connect.store.actions.manageReward"),
2129
+ value: "create_reward"
2130
+ }, d = {
2131
+ label: a("connect.store.actions.addCategory"),
2132
+ value: "create_category",
2133
+ isPrimary: !0,
2134
+ prependIcon: "add"
2135
+ }, x = O(), o = Tt(), l = Xe(), { global: f, minor: t } = ot, r = Ye(), p = D(() => l.sortedStoreCategories), y = D(() => l.sortedStoreCategories.map((h) => h.name)), $ = O(), u = O(), F = Vt(), k = O([]), N = D(() => F.isPremium), ce = D(() => {
2136
+ var h;
2137
+ return !!((h = l.storeOption) != null && h.company);
2138
+ }), ee = O(!1), H = D(
2139
+ () => gn(
2140
+ ce.value,
2141
+ l.payoutAccount,
2142
+ !ee.value || N.value
2143
+ )
2144
+ ), Q = D(() => !H.value.complete), de = O(!1);
2145
+ function V() {
2146
+ return `connect.store.allSetDismissed.${He.getBusinessId()}`;
2147
+ }
2148
+ function xe() {
2149
+ try {
2150
+ return localStorage.getItem(V()) === "1";
2151
+ } catch {
2152
+ return !1;
2153
+ }
2154
+ }
2155
+ function fe() {
2156
+ de.value = !0;
2157
+ try {
2158
+ localStorage.setItem(V(), "1");
2159
+ } catch {
2160
+ }
2161
+ }
2162
+ const Ve = {
2163
+ name: Ae["$connect-TRANSACTION"],
2164
+ query: { tab: "store" }
2165
+ };
2166
+ function j() {
2167
+ window.open(
2168
+ `${et.licensePortalUrl}business/${He.businessId}/settings`,
2169
+ "_blank"
2170
+ );
2171
+ }
2172
+ function Se() {
2173
+ window.open("https://feedme.ai/pricing", "_blank", "noopener");
2174
+ }
2175
+ async function S() {
2176
+ if (N.value)
2177
+ try {
2178
+ k.value = await Ke.readPrograms();
2179
+ } catch {
2180
+ k.value = [];
2181
+ }
2182
+ }
2183
+ function s() {
2184
+ o.push({ name: Ae["$connect-STORE_GIFT_CARD_SETUP"] });
2185
+ }
2186
+ function P(h) {
2187
+ o.push({
2188
+ name: Ae["$connect-STORE_GIFT_CARD_SETUP"],
2189
+ params: { id: String(h._id) }
2190
+ });
2191
+ }
2192
+ async function B(h) {
2193
+ await Ue.confirm(
2194
+ `Set "${h.name}" live? Only one gift card can be live at a time, so any other will be set inactive.`,
2195
+ "Set live",
2196
+ "Set live",
2197
+ "Cancel"
2198
+ ) && await t(
2199
+ async () => {
2200
+ await Ke.activateProgram(String(h._id)), await S();
2201
+ },
2202
+ { message: "Setting live", successMessage: "Gift card is live" }
2203
+ );
2204
+ }
2205
+ async function W(h) {
2206
+ await t(
2207
+ async () => {
2208
+ await Ke.deactivateProgram(String(h._id)), await S();
2209
+ },
2210
+ { message: "Updating gift card", successMessage: "Gift card set inactive" }
2211
+ );
2212
+ }
2213
+ function J() {
2214
+ r.open({
2215
+ title: a("connect.store.setupDialog.title"),
2216
+ contentComponent: yn,
2217
+ contentComponentProps: {
2218
+ settingStatus: H.value.settingStatus,
2219
+ payoutStatus: H.value.payoutStatus,
2220
+ requiresPayout: H.value.requiresPayout
2221
+ }
2222
+ }).onPrimary((h) => {
2223
+ L(h === "setupPayout" ? "payout" : "setting");
2224
+ });
2225
+ }
2226
+ async function L(h) {
2227
+ var C;
2228
+ h === "setting" ? (C = $.value) == null || C.showSheet(!0, l.storeOption) : h === "create_category" ? ye(-1) : h === "create_reward" ? await o.push({ name: Ae["$connect-STORE_REWARDS"] }) : h == "payout" && window.open(et.paymentPortalUrl, "_blank");
2229
+ }
2230
+ function _e(h, C) {
2231
+ var se;
2232
+ const U = !!((se = C.company) != null && se.sstRegNo), K = C.inclusiveTaxes ?? [], _ = Z.taxSystem.map((E) => E.code), A = U ? K.flatMap((E) => {
2233
+ console.log(E, "inclusive tax");
2234
+ const q = Z.systemDefaultCode(E.systemCode);
2235
+ return q ? [{ systemCode: E.systemCode, taxCode: q.taxCode }] : [];
2236
+ }) : [];
2237
+ return console.log([
2238
+ ["hasSstRegNo", U],
2239
+ ["defaultTaxCodes", A],
2240
+ ["inclusiveTaxes", K],
2241
+ ["taxSystemCodes", _]
2242
+ ]), h.map((E) => ({
2243
+ ...E,
2244
+ bundles: E.bundles.map((q) => {
2245
+ const { pf_vouchers: te, ...X } = q;
2246
+ if (!U)
2247
+ return {
2248
+ ...X,
2249
+ taxes: [],
2250
+ taxTotals: [],
2251
+ priceWithTaxes: { ...X.price }
2252
+ };
2253
+ const me = A, we = at(
2254
+ Z.fullTax,
2255
+ me,
2256
+ X.price,
2257
+ Number(X.credit.normal),
2258
+ K,
2259
+ _
2260
+ );
2261
+ return {
2262
+ ...X,
2263
+ taxes: me,
2264
+ taxTotals: we,
2265
+ priceWithTaxes: st(
2266
+ we,
2267
+ X.price,
2268
+ K
2269
+ )
2270
+ };
2271
+ })
2272
+ }));
2273
+ }
2274
+ async function ke(h, C, U) {
2275
+ const K = !U && !!C, _ = !!U && !C;
2276
+ let A;
2277
+ if (K) {
2278
+ const E = Z.taxSystem[0] ? Z.systemDefaultCode(Z.taxSystem[0].code) : void 0, q = E ? `${E.name} (${E.taxCode})` : a("connect.store.taxPropagation.defaultTax");
2279
+ A = a("connect.store.taxPropagation.addConfirm", {
2280
+ taxCode: q
2281
+ });
2282
+ } else _ ? A = a("connect.store.taxPropagation.removeConfirm") : A = a("connect.store.taxPropagation.updateConfirm");
2283
+ await Ue.confirm(
2284
+ A,
2285
+ a("connect.store.taxPropagation.title"),
2286
+ a("connect.store.taxPropagation.confirm"),
2287
+ a("connect.common.cancel")
2288
+ ) && await t(
2289
+ async () => {
2290
+ const E = qe(l.sortedStoreCategories), q = _e(E, h);
2291
+ await Ee.updateStoreBundle({ categories: q }), await l.readMemberStore(), await l.readMembership(), await l.readRewards();
2292
+ },
2293
+ {
2294
+ message: a("connect.store.taxPropagation.updating"),
2295
+ successMessage: a("connect.store.taxPropagation.success")
2296
+ }
2297
+ );
2298
+ }
2299
+ async function Fe(h) {
2300
+ var q, te, X, me;
2301
+ const C = ((te = (q = l.storeOption) == null ? void 0 : q.company) == null ? void 0 : te.sstRegNo) ?? "", U = pe.cloneDeep(
2302
+ ((X = l.storeOption) == null ? void 0 : X.inclusiveTaxes) ?? []
2303
+ ), K = ((me = h.company) == null ? void 0 : me.sstRegNo) ?? "";
2304
+ await t(
2305
+ async () => {
2306
+ var we;
2307
+ await Ee.updateStore(h), await l.readMemberStore(), (we = $.value) == null || we.showSheet(!1);
2308
+ },
2309
+ {
2310
+ message: a("connect.store.setting.update.message"),
2311
+ successMessage: a("connect.store.setting.update.success")
2312
+ }
2313
+ );
2314
+ const _ = C !== K, A = !pe.isEqual(
2315
+ U,
2316
+ h.inclusiveTaxes ?? []
2317
+ );
2318
+ !(_ || A) || l.sortedStoreCategories.flatMap(
2319
+ (we) => we.bundles
2320
+ ).length === 0 || await ke(h, K, C);
2321
+ }
2322
+ async function ye(h = -1) {
2323
+ var C;
2324
+ if (Q.value) {
2325
+ J();
2326
+ return;
2327
+ }
2328
+ r.open({
2329
+ title: h == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
2330
+ contentComponent: Kt,
2331
+ contentComponentProps: {
2332
+ initialValue: ((C = p.value[h]) == null ? void 0 : C.name) ?? "",
2333
+ action: h == -1 ? "add" : "edit"
2334
+ }
2335
+ }).onPrimary(async (U) => {
2336
+ U === null && !await Ue.remove(
2337
+ a("connect.store.category.remove.confirm"),
2338
+ a("connect.store.category.remove.title")
2339
+ ) || await t(
2340
+ async () => {
2341
+ const K = h == -1 ? [...p.value, { name: U, bundles: [] }] : [...p.value].map((_, A) => A == h ? { ..._, name: U } : _).filter((_) => _.name !== null);
2342
+ await Ee.updateStoreBundle({
2343
+ categories: K
2344
+ }), await l.readMemberStore();
2345
+ },
2346
+ {
2347
+ message: U === null ? a("connect.store.category.update.deleting") : h == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
2348
+ successMessage: U === null ? a("connect.store.category.update.success.deleted") : h == -1 ? a("connect.store.category.update.success.created") : a("connect.store.category.update.success.updated")
2349
+ }
2350
+ );
2351
+ });
2352
+ }
2353
+ function ue() {
2354
+ const h = qe(p.value);
2355
+ for (const C of h)
2356
+ for (const U of C.bundles)
2357
+ "pf_vouchers" in U && delete U.pf_vouchers;
2358
+ return h;
2359
+ }
2360
+ async function Ne(h) {
2361
+ var U;
2362
+ const C = (U = u.value) == null ? void 0 : U.bundleImage;
2363
+ C === null && h.image ? (await Ge.delete(h.image), h.image = null) : C && (h.image = await Ge.update(
2364
+ Ge.bundleImagePath(void 0, C),
2365
+ C
2366
+ ));
2367
+ }
2368
+ async function Te(h, C, U, K) {
2369
+ var q, te, X;
2370
+ C ?? (C = (q = u.value) == null ? void 0 : q.target.category), U ?? (U = (te = u.value) == null ? void 0 : te.target.index), K ?? (K = (X = u.value) == null ? void 0 : X.target.originalCategoryIndex);
2371
+ const _ = ue();
2372
+ C != K && K != null && (_[K].bundles.splice(U, 1), U = _[C].bundles.length);
2373
+ const A = _[C];
2374
+ if (!A) {
2375
+ vt.error("Unexpected error", 2e3);
2376
+ return;
2377
+ }
2378
+ if (h == null) {
2379
+ if (await Ue.remove(
2380
+ a("connect.store.bundle.delete.confirm"),
2381
+ a("connect.store.bundle.delete.title")
2382
+ ) == !1)
2383
+ return;
2384
+ A.bundles.splice(U, 1);
2385
+ } else
2386
+ U == -1 ? A.bundles.push(h) : A.bundles[U] = h;
2387
+ let se = "Updating", E = "updated";
2388
+ h === null ? (se = "Deleting", E = "deleted") : U === -1 && (se = "Creating", E = "created"), await t(
2389
+ async () => {
2390
+ var me;
2391
+ h != null && await Ne(h), await Ee.updateStoreBundle({
2392
+ categories: _
2393
+ }), await l.readMemberStore(), await l.readMembership(), await l.readRewards(), (me = u.value) == null || me.showSheet(!1);
2394
+ },
2395
+ {
2396
+ message: `${se} bundle`,
2397
+ successMessage: `Bundle ${E} successfully`
2398
+ }
2399
+ );
2400
+ }
2401
+ function Pe(h) {
2402
+ var C;
2403
+ if (Q.value) {
2404
+ J();
2405
+ return;
2406
+ }
2407
+ (C = u.value) == null || C.showSheet(!0, {
2408
+ ...h,
2409
+ bundle: h.bundle ? qe(h.bundle) : void 0
2410
+ });
2411
+ }
2412
+ const Me = D(() => [
2413
+ c,
2414
+ g,
2415
+ d
2416
+ ]);
2417
+ function Oe(h) {
2418
+ var C;
2419
+ (C = x.value) == null || C.showSheet({
2420
+ bundle: h
2421
+ });
2422
+ }
2423
+ return Be(async () => {
2424
+ await f(async () => {
2425
+ var h, C;
2426
+ if (await l.readMemberStore(), await l.readMembership(), await l.readRewards(), await l.readPayoutAccount(), await F.readPremium(), ee.value = !0, de.value = xe(), await S(), (h = o.currentRoute.value.query) != null && h.action) {
2427
+ switch ((C = o.currentRoute.value.query) == null ? void 0 : C.action) {
2428
+ case "update_setting":
2429
+ L("setting");
2430
+ break;
2431
+ case "create_category":
2432
+ ye(-1);
2433
+ break;
2434
+ case "create_feedvibe_bundle":
2435
+ r.open({
2436
+ title: "Select category",
2437
+ contentComponent: Wt
2438
+ }).onPrimary((U) => {
2439
+ r.close(), Pe({
2440
+ categories: y.value,
2441
+ category: U,
2442
+ index: -1,
2443
+ bundle: {
2444
+ ...pe.cloneDeep(ze),
2445
+ isFeedvibe: !0,
2446
+ price: G.Dinero.fromNumber({
2447
+ number: 10,
2448
+ precision: 2
2449
+ }).toObject()
2450
+ }
2451
+ });
2452
+ }).onTertiary(() => r.close());
2453
+ break;
2454
+ }
2455
+ o.replace({ query: {} });
2456
+ }
2457
+ });
2458
+ }), (h, C) => {
2459
+ const U = v("RouterLink"), K = v("FmPageHead"), _ = v("FmPill"), A = v("FmButton"), se = v("FmCard");
2460
+ return m(), T(z, null, [
2461
+ i(K, {
2462
+ title: e(a)("connect.store.title"),
2463
+ actions: e(Me),
2464
+ "onClick:action": L
2465
+ }, {
2466
+ description: I(() => [
2467
+ n("span", Dn, w(e(a)("connect.store.description")), 1),
2468
+ i(U, {
2469
+ to: Ve,
2470
+ class: "ml-8 fm-typo-en-link-md-600 text-fm-color-primary"
2471
+ }, {
2472
+ default: I(() => [
2473
+ ae(w(e(a)("connect.store.viewTransactions")), 1)
2474
+ ]),
2475
+ _: 1
2476
+ })
2477
+ ]),
2478
+ _: 1
2479
+ }, 8, ["title", "actions"]),
2480
+ n("div", Bn, [
2481
+ e(Q) ? (m(), R(Xo, {
2482
+ key: 0,
2483
+ class: "mt-12",
2484
+ "setting-status": e(H).settingStatus,
2485
+ "payout-status": e(H).payoutStatus,
2486
+ "requires-payout": e(H).requiresPayout,
2487
+ onSetupStoreSetting: C[0] || (C[0] = (E) => L("setting")),
2488
+ onSetupPayout: C[1] || (C[1] = (E) => L("payout"))
2489
+ }, null, 8, ["setting-status", "payout-status", "requires-payout"])) : e(de) ? M("", !0) : (m(), R(nn, {
2490
+ key: 1,
2491
+ class: "mt-12",
2492
+ onDismiss: fe
2493
+ })),
2494
+ n("div", Nn, [
2495
+ n("div", Mn, [
2496
+ n("div", On, w(e(a)("connect.store.giftCard.title")), 1),
2497
+ i(_, {
2498
+ variant: "premium",
2499
+ label: e(a)("connect.store.giftCard.new")
2500
+ }, null, 8, ["label"]),
2501
+ e(N) && e(k).length ? (m(), R(A, {
2502
+ key: 0,
2503
+ icon: "edit",
2504
+ size: "md",
2505
+ variant: "tertiary",
2506
+ onClick: C[2] || (C[2] = (E) => P(e(k)[0]))
2507
+ })) : M("", !0),
2508
+ C[4] || (C[4] = n("div", { class: "flex-1" }, null, -1)),
2509
+ e(N) && e(k).length ? (m(), T("div", Ln, w(e(a)("connect.store.giftCard.oneLiveHint")), 1)) : M("", !0)
2510
+ ]),
2511
+ !e(N) || !e(k).length ? (m(), R(En, {
2512
+ key: 0,
2513
+ premium: e(N),
2514
+ onUpgrade: j,
2515
+ onComparePlans: Se,
2516
+ onCreate: s
2517
+ }, null, 8, ["premium"])) : (m(), T("div", An, [
2518
+ (m(!0), T(z, null, re(e(k), (E) => (m(), R(Lo, {
2519
+ key: String(E._id),
2520
+ program: E,
2521
+ onEdit: (q) => P(E),
2522
+ onSetLive: (q) => B(E),
2523
+ onDeactivate: (q) => W(E)
2524
+ }, null, 8, ["program", "onEdit", "onSetLive", "onDeactivate"]))), 128)),
2525
+ i(se, {
2526
+ variant: "outlined",
2527
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
2528
+ }, {
2529
+ default: I(() => [
2530
+ i(A, {
2531
+ label: e(a)("connect.store.giftCard.addGiftCard"),
2532
+ icon: "add",
2533
+ variant: "secondary",
2534
+ onClick: s
2535
+ }, null, 8, ["label"])
2536
+ ]),
2537
+ _: 1
2538
+ })
2539
+ ]))
2540
+ ]),
2541
+ e(p) && e(p).length > 0 ? (m(), T(z, { key: 2 }, [
2542
+ (m(!0), T(z, null, re(e(p), (E, q) => (m(), T("div", {
2543
+ key: E.name,
2544
+ class: "space-y-8 py-12"
2545
+ }, [
2546
+ n("div", jn, [
2547
+ n("div", qn, w(E.name), 1),
2548
+ i(Ze, { json: E }, null, 8, ["json"]),
2549
+ i(A, {
2550
+ icon: "edit",
2551
+ size: "md",
2552
+ variant: "tertiary",
2553
+ onClick: (te) => ye(q)
2554
+ }, null, 8, ["onClick"])
2555
+ ]),
2556
+ n("div", Gn, [
2557
+ (m(!0), T(z, null, re(E.bundles, (te, X) => (m(), R(Lt, {
2558
+ bundle: te,
2559
+ key: te._id,
2560
+ onEdit: (me) => Pe({
2561
+ bundle: te,
2562
+ category: q,
2563
+ index: X,
2564
+ categories: e(y)
2565
+ }),
2566
+ onDelete: (me) => Te(null, q, X),
2567
+ onSend: Oe
2568
+ }, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
2569
+ i(At, {
2570
+ onCreate: (te) => Pe({
2571
+ category: q,
2572
+ index: -1,
2573
+ categories: e(y)
2574
+ })
2575
+ }, null, 8, ["onCreate"])
2576
+ ])
2577
+ ]))), 128)),
2578
+ i(ko, {
2579
+ ref_key: "bundleSheetRef",
2580
+ ref: u,
2581
+ onUpdate: Te
2582
+ }, null, 512)
2583
+ ], 64)) : (m(), R(se, {
2584
+ key: 3,
2585
+ variant: "outlined",
2586
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
2587
+ }, {
2588
+ default: I(() => [
2589
+ C[5] || (C[5] = n("img", {
2590
+ src: ct,
2591
+ class: "aspect-square w-[150px]"
2592
+ }, null, -1)),
2593
+ n("div", Kn, [
2594
+ n("div", Hn, w(e(a)("connect.store.bundle.title")), 1),
2595
+ n("div", zn, w(e(a)("connect.store.bundle.description")), 1)
2596
+ ]),
2597
+ i(A, {
2598
+ variant: "primary",
2599
+ label: e(a)("connect.store.actions.addCategory"),
2600
+ icon: "add",
2601
+ onClick: C[3] || (C[3] = (E) => ye(-1))
2602
+ }, null, 8, ["label"])
2603
+ ]),
2604
+ _: 1
2605
+ })),
2606
+ i(po, {
2607
+ ref_key: "settingSheetRef",
2608
+ ref: $,
2609
+ onUpdate: Fe
2610
+ }, null, 512),
2611
+ i(To, {
2612
+ ref_key: "sendBundleSheetRef",
2613
+ ref: x
2614
+ }, null, 512)
2615
+ ])
2616
+ ], 64);
2617
+ };
2618
+ }
2619
+ });
2620
+ export {
2621
+ Pa as default
2622
+ };