@feedmepos/mf-connect 0.1.98-beta.4 → 0.1.98-beta.41

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 (132) hide show
  1. package/dist/{App-BGv_JihW.js → App-C6JJ9uQ8.js} +808 -665
  2. package/dist/{AuditLogs-53rnjCmD.js → AuditLogs-CAlgtDgx.js} +12 -11
  3. package/dist/{Bin-B0Q_WpuY.js → Bin-D8jwhwER.js} +8 -8
  4. package/dist/{Broadcast-PiJE1Syl.js → Broadcast-CP8DRfkT.js} +39 -36
  5. package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dz2KsBZl.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js} +7 -5
  7. package/dist/{Card-DlqMu3Sl.js → Card-QribXJwZ.js} +21 -20
  8. package/dist/{Collections-BWcBlDDR.js → Collections-X9xbt43V.js} +14 -13
  9. package/dist/Credit-QmbsW1eb.js +286 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCvH0lGA.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js} +35 -30
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-B_FyeWq4.js → EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js} +16 -16
  12. package/dist/{Experience-DacFmPYy.js → Experience-CPGMg847.js} +112 -86
  13. package/dist/{FileSaver.min-CMZKiGkX.js → FileSaver.min-CK67LsPG.js} +1 -1
  14. package/dist/Game-BrkiEFCS.js +356 -0
  15. package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
  16. package/dist/{Grab-DaBL5y3H.js → Grab-BgtDzK1B.js} +32 -31
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BaY_nQio.js → ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js} +1 -1
  18. package/dist/{Index-2UrjF35w.js → Index-KJgzalOd.js} +10 -10
  19. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BuVBZsCN.js → LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js} +1 -1
  20. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-6wUxYqWe.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js} +1 -1
  21. package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
  22. package/dist/MainLayout-DlfTKHQ-.js +143 -0
  23. package/dist/{Marketing-DEp--hFd.js → Marketing-Crx_JQpi.js} +7 -6
  24. package/dist/{MarketingMaterialEdit-BHL8Ptsu.js → MarketingMaterialEdit-BfsdcMXJ.js} +15 -14
  25. package/dist/{Member-BU1YxoEV.js → Member-C50Nrsko.js} +14 -13
  26. package/dist/{MemberList-zjvJBYf0.js → MemberList-C9uUKw1o.js} +37 -35
  27. package/dist/{MemberTransactions-BvyLV69V.js → MemberTransactions-DZ7zPOHX.js} +1 -1
  28. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-_YOM1SlS.js → MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js} +5434 -5279
  29. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  30. package/dist/Mission-D_km8zi6.js +360 -0
  31. package/dist/{Overview-BToUlbsH.js → Overview-BBieK6qQ.js} +21 -20
  32. package/dist/Overview-B_kmLOcc.js +1316 -0
  33. package/dist/Point-D0q9N7f9.js +288 -0
  34. package/dist/Promotion-DoFTy-NK.js +423 -0
  35. package/dist/{Queue-D3vUkKN9.js → Queue-Dh5sDRHW.js} +13 -12
  36. package/dist/{Record-BViEbZZ8.js → Record-0owEBKqN.js} +9 -9
  37. package/dist/Review-DV2fnpOH.js +45 -0
  38. package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
  39. package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
  40. package/dist/{Reward-CZsvsYW_.js → Reward-Co20Xrss.js} +35 -35
  41. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BASPLoRa.js → RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js} +14 -13
  42. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B90meAnV.js → RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js} +17 -15
  43. package/dist/{Segment-CN8NEg8w.js → Segment-7dQKeHWK.js} +38 -35
  44. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BGyYQST4.js → SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js} +2 -2
  45. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BxW-Kc6t.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js} +37 -36
  46. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-C9dwcEr5.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js} +4 -4
  47. package/dist/{Setting-DLPbZW11.js → Setting-Bvahxs-y.js} +14 -14
  48. package/dist/{SettingAdvertisements-BIq8gS5g.js → SettingAdvertisements-fbXLRwfb.js} +12 -12
  49. package/dist/Settings-C_HWDFN8.js +179 -0
  50. package/dist/Store-8yBKDR1b.js +2413 -0
  51. package/dist/{StoreRewards-BoEjVFk6.js → StoreRewards-DKaJvoJs.js} +15 -15
  52. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bv9ABH1K.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js} +400 -455
  53. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DNHgSfIg.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js} +2 -2
  54. package/dist/{Tier-kQ6X9h-t.js → Tier-CD-CjXC3.js} +44 -41
  55. package/dist/{Title-XosVAF2Y.js → Title-C_lcgye8.js} +49 -46
  56. package/dist/{Transaction-CO6oLPKR.js → Transaction-BvUYm-rT.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-McMR2Y7Y.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js} +6 -6
  58. package/dist/{Voucher-CogaCxx2.js → Voucher-CYaG0GLU.js} +156 -133
  59. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DjHwHFBq.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js} +12 -12
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Dor9klZ8.js → ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js} +2 -2
  61. package/dist/{app-C9UPXbDs.js → app-CE5hQ4Uq.js} +6656 -5653
  62. package/dist/app.js +1 -1
  63. package/dist/{business-CYpW6-Ls.js → business-CE_4siXc.js} +1 -1
  64. package/dist/{campaign-BtLa7KeF.js → campaign-BP6rvSpg.js} +74 -96
  65. package/dist/campaign-CXQtKpeb.js +100 -0
  66. package/dist/{campaign.enum-DiLhS5il.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  67. package/dist/{campaign.fn-CLB9gBHo.js → campaign.fn-DKnBpE1N.js} +119 -119
  68. package/dist/{collectible.enum-CmwWcfBh.js → collectible.enum-Liy2wH3s.js} +1 -1
  69. package/dist/collection.fn-Cg16QZSp.js +26 -0
  70. package/dist/{duplicateCampaign-DGhOBd5l.js → duplicateCampaign-DbtVAGsT.js} +2 -2
  71. package/dist/{effect-CY5Y6sxy.js → effect-CLI8NI4O.js} +1 -1
  72. package/dist/{email-addresses-BEnOHWj_.js → email-addresses-DlLiZ1io.js} +2 -2
  73. package/dist/{export-BgYu7SCd.js → export-6Hr34dBU.js} +3 -3
  74. package/dist/google-C3S8u0mT.js +4 -0
  75. package/dist/{helper-DTDgoyEh.js → helper-vkjFqj70.js} +1 -1
  76. package/dist/index-BIyKgw4m.js +72 -0
  77. package/dist/{index-C8ehLvXG.js → index-BLQJ-rv3.js} +1 -1
  78. package/dist/{index-CP-7qATP.js → index-BbTIqReL.js} +1 -1
  79. package/dist/index-BuMfQxMf.js +897 -0
  80. package/dist/index-C8cXXcLk.js +45 -0
  81. package/dist/{index-kS20rM5m.js → index-CSVhIZSY.js} +589 -580
  82. package/dist/{index-zF0gIg9H.js → index-CVHacTbc.js} +1 -1
  83. package/dist/index-C_H8jFYf.js +2743 -0
  84. package/dist/{index-goRooQn5.js → index-CmNsGhDf.js} +272 -368
  85. package/dist/index-CnTeeRyJ.js +53 -0
  86. package/dist/{index-Ck3PeOQ5.js → index-CzbNobLv.js} +105 -123
  87. package/dist/index-D06n1h1b.js +146 -0
  88. package/dist/{index-CNKP1_IW.js → index-D4SDAfbP.js} +8027 -10766
  89. package/dist/{index-DntoqWT_.js → index-DVnYQ3Hs.js} +1 -1
  90. package/dist/{index-BZVhi3ZG.js → index-DcjnS5Sv.js} +2 -2
  91. package/dist/{index-DtyWsBgg.js → index-Dx9h0FNH.js} +1 -1
  92. package/dist/{index-CDk0Itu1.js → index-YgP4ihQL.js} +1 -1
  93. package/dist/{index-B4IAURA_.js → index-kedErkLZ.js} +1759 -2480
  94. package/dist/{index-CLZnH782.js → index-lnQT4P3d.js} +10 -9
  95. package/dist/{index.esm2017-C79fd6cz.js → index.esm2017-Jhv2lkrq.js} +105 -105
  96. package/dist/{loading-Dfr_97Ri.js → loading-NY-FPxVY.js} +1 -1
  97. package/dist/{lodash-BX2mJOxF.js → lodash-BC_P6kLg.js} +1 -1
  98. package/dist/{membership-ncNOUJwj.js → membership-BWaK-9FY.js} +3 -3
  99. package/dist/{money-vEtTzt04.js → money-COoh4GXK.js} +1 -1
  100. package/dist/{number-BjgTlMsp.js → number-BX5OEXgq.js} +1 -1
  101. package/dist/objectid-1SUSRtmY.js +145 -0
  102. package/dist/{plugins-BVGqEmE1.js → plugins-ur-FAoye.js} +3 -3
  103. package/dist/remy-Qz_pNsUS.js +13 -0
  104. package/dist/{reward-BGTLhhzT.js → reward-DSsylZ22.js} +1 -1
  105. package/dist/{rule-BB2VX3Gy.js → rule-BM9GUd1C.js} +3 -3
  106. package/dist/rule-builder-gC9LH2AC.js +126 -0
  107. package/dist/{template-DLiHnpjK.js → template-CUV3AMFI.js} +6 -6
  108. package/dist/timezone-BFZhekOU.js +20 -0
  109. package/dist/transaction.fn-C5MlkEIC.js +64 -0
  110. package/dist/{trigger-DrKnfSoi.js → trigger-CbjiuoSo.js} +14 -14
  111. package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
  112. package/dist/{usePagination-Dgd-onzU.js → usePagination-Caah4sJr.js} +1 -1
  113. package/dist/{user-BcDUmNrZ.js → user-BZC4P_jL.js} +1 -1
  114. package/dist/{vue-i18n-DNBGmwox.js → vue-i18n-BYz7XAr_.js} +390 -390
  115. package/dist/{xlsx-BX-U0_Au.js → xlsx-Bn7BqUFA.js} +1 -1
  116. package/dist/{zod-Mx51GBPY.js → zod-DHH42rXG.js} +1 -1
  117. package/package.json +3 -3
  118. package/dist/Credit-CMfcuj5n.js +0 -260
  119. package/dist/Game-DXKnGuhR.js +0 -330
  120. package/dist/LoyaltyDashboard-DIArPp71.js +0 -1082
  121. package/dist/MainLayout-BjvTxTPG.js +0 -41
  122. package/dist/Mission-BNYk_aPM.js +0 -334
  123. package/dist/Point-B-L2326L.js +0 -262
  124. package/dist/Promotion-sMKGkL4w.js +0 -397
  125. package/dist/Review-CMBAk-Qu.js +0 -1067
  126. package/dist/ReviewFacebookCallback-BCJTFy3b.js +0 -243
  127. package/dist/ReviewGoogleCallback-DKUG075r.js +0 -208
  128. package/dist/Store-DNB3gUIR.js +0 -1996
  129. package/dist/campaign-CtoHyXVT.js +0 -219
  130. package/dist/index-P8Qh2yIP.js +0 -52
  131. package/dist/objectid-C9DiLwge.js +0 -145
  132. package/dist/useMarketingMaterialActions-B6zaDbNE.js +0 -107
@@ -0,0 +1,542 @@
1
+ import { defineComponent as Ne, computed as b, ref as i, onMounted as De, resolveComponent as _, openBlock as d, createElementBlock as m, createElementVNode as o, createVNode as a, toDisplayString as r, unref as e, withCtx as k, isRef as f, Fragment as L, renderList as I, normalizeClass as ue, createCommentVNode as h, withDirectives as Ve, withKeys as ke, vModelText as Ee, createBlock as Y, createTextVNode as me } from "vue";
2
+ import { u as Te } from "./loading-NY-FPxVY.js";
3
+ import { u as Fe } from "./app-wDQR6dpb.js";
4
+ import { n as $, f as E } from "./plugins-ur-FAoye.js";
5
+ import "./index-Dx9h0FNH.js";
6
+ import { g as Z } from "./index-CnTeeRyJ.js";
7
+ import { p as j, q as Me, G as H, r as ee } from "./index-kedErkLZ.js";
8
+ import { u as Ue } from "./vue-i18n-BYz7XAr_.js";
9
+ import { useRouter as Pe, useRoute as Oe } from "vue-router";
10
+ import { R as Se } from "./app-CE5hQ4Uq.js";
11
+ const Re = { class: "px-24 pb-40" }, Le = { class: "flex items-start gap-12 py-24" }, Ie = { class: "flex flex-col gap-4" }, $e = { class: "fm-typo-en-title-md-800 text-fm-color-typo-primary" }, He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ge = { class: "flex flex-col gap-16 max-w-[860px]" }, Be = { class: "flex gap-12" }, Xe = { class: "flex flex-col gap-4" }, je = { class: "fm-typo-en-body-lg-600" }, ze = { class: "flex gap-12" }, Ke = { class: "flex flex-col gap-4" }, qe = { class: "fm-typo-en-body-lg-600" }, Je = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe = { class: "flex flex-wrap gap-12" }, We = ["src"], Ye = { class: "flex gap-12" }, Ze = { class: "flex flex-col gap-4" }, et = { class: "fm-typo-en-body-lg-600" }, tt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ot = { class: "flex flex-col gap-8" }, nt = ["onClick"], lt = {
12
+ key: 0,
13
+ class: "w-[9px] h-[9px] rounded-full bg-fm-color-primary"
14
+ }, st = { class: "flex-1" }, at = { class: "block fm-typo-en-body-md-600" }, rt = { class: "block fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-2" }, it = {
15
+ key: 0,
16
+ class: "grid sm:grid-cols-2 gap-16"
17
+ }, dt = { class: "flex items-center gap-16 p-16 rounded-md bg-fm-color-neutral-gray-100" }, ct = { class: "flex flex-col gap-2 flex-1 min-w-0" }, ut = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, mt = { class: "fm-typo-en-body-lg-600 truncate" }, ft = { class: "flex gap-12" }, pt = { class: "flex flex-col gap-4" }, vt = { class: "fm-typo-en-body-lg-600" }, gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xt = { class: "flex flex-col gap-8" }, yt = { class: "fm-typo-en-body-md-600" }, bt = { class: "flex flex-wrap gap-8" }, _t = { class: "flex items-start gap-8" }, Ct = { class: "flex items-center rounded-md border-1 border-fm-color-neutral-gray-300 overflow-hidden" }, ht = ["placeholder"], At = {
18
+ key: 0,
19
+ class: "flex flex-wrap gap-8"
20
+ }, wt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Nt = { class: "text-fm-color-primary" }, Dt = { class: "flex items-center gap-12 p-16 rounded-md border-1 border-fm-color-neutral-gray-300" }, Vt = { class: "flex-1" }, kt = { class: "fm-typo-en-body-md-600" }, Et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tt = {
21
+ key: 1,
22
+ class: "flex gap-16"
23
+ }, Ft = {
24
+ key: 2,
25
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
26
+ }, Mt = { class: "flex gap-12" }, Ut = { class: "flex flex-col gap-4" }, Pt = { class: "fm-typo-en-body-lg-600" }, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, St = {
27
+ key: 0,
28
+ class: "flex items-start gap-12 p-16 rounded-md bg-fm-color-system-info-100"
29
+ }, Rt = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-primary" }, Lt = { class: "flex items-center gap-12" }, It = { class: "fm-typo-en-body-md-500" }, $t = { class: "flex flex-col gap-8" }, Ht = { class: "fm-typo-en-body-md-600" }, Gt = { class: "flex flex-wrap gap-8" }, Bt = { class: "flex gap-12" }, Xt = { class: "flex flex-col gap-4" }, jt = { class: "fm-typo-en-body-lg-600" }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = { class: "flex flex-wrap items-center gap-8" }, qt = {
30
+ key: 1,
31
+ class: "flex items-center gap-8 fm-typo-en-body-md-400"
32
+ }, Jt = ["href"], Qt = { class: "flex items-center justify-end gap-8 pt-8" }, io = /* @__PURE__ */ Ne({
33
+ __name: "GiftCardSetup",
34
+ setup(Wt) {
35
+ const { t: n } = Ue(), { global: fe, minor: z } = Te, pe = Pe(), ve = Oe(), T = b(() => ve.params.id || null), G = b(() => !!T.value), A = i(""), x = i([]);
36
+ let te = /* @__PURE__ */ new Set();
37
+ const oe = /* @__PURE__ */ new Set(), C = i("DEFAULT"), F = i(16), M = i(j().charset), U = i("GC"), P = i(""), ne = i(0), K = [10, 20, 30, 50, 100], c = i([]), w = i(""), y = i(!1), N = i(10), D = i(100), le = i(!1), O = i(!0), B = i(
38
+ "EMAIL_OR_PHONE"
39
+ ), v = i("NONE"), S = i(""), V = i(""), se = b(
40
+ () => C.value === "ADVANCED" ? {
41
+ ...j(),
42
+ length: Number(F.value),
43
+ charset: M.value,
44
+ prefix: U.value,
45
+ suffix: P.value
46
+ } : j()
47
+ ), ge = b(() => (ne.value, Me(se.value))), ae = b(
48
+ () => c.value.length >= H
49
+ );
50
+ function re(s) {
51
+ if (c.value.includes(s)) {
52
+ c.value = c.value.filter((t) => t !== s);
53
+ return;
54
+ }
55
+ if (ae.value) {
56
+ $.error(
57
+ n("connect.store.giftCard.maxAmounts", {
58
+ max: H
59
+ })
60
+ );
61
+ return;
62
+ }
63
+ c.value = [...c.value, s].sort((t, u) => t - u);
64
+ }
65
+ function ie() {
66
+ const s = Number(w.value);
67
+ if (!Number.isInteger(s) || s <= 0) {
68
+ $.error(n("connect.store.giftCard.invalidAmount"));
69
+ return;
70
+ }
71
+ if (s > ee) {
72
+ $.error(
73
+ n("connect.store.giftCard.amountTooLarge", { max: ee })
74
+ );
75
+ return;
76
+ }
77
+ if (c.value.includes(s)) {
78
+ w.value = "";
79
+ return;
80
+ }
81
+ if (ae.value) {
82
+ $.error(
83
+ n("connect.store.giftCard.maxAmounts", {
84
+ max: H
85
+ })
86
+ );
87
+ return;
88
+ }
89
+ c.value = [...c.value, s].sort((t, u) => t - u), w.value = "";
90
+ }
91
+ const q = b(() => c.value.length === 0 && !y.value ? n("connect.store.giftCard.errorNoAmount") : y.value && Number(N.value) > Number(D.value) ? n("connect.store.giftCard.errorRange") : null), xe = b(
92
+ () => A.value.trim() ? null : n("connect.store.giftCard.errorNoName")
93
+ ), J = b(() => xe.value ?? q.value);
94
+ async function ye(s) {
95
+ await z(
96
+ async () => {
97
+ const t = await E.update(
98
+ E.bundleImagePath(void 0, s),
99
+ s
100
+ );
101
+ x.value = [...x.value, t];
102
+ },
103
+ {
104
+ message: n("connect.store.giftCard.uploading"),
105
+ successMessage: n("connect.store.giftCard.uploaded")
106
+ }
107
+ );
108
+ }
109
+ async function be(s) {
110
+ if (x.value = x.value.filter((t) => t !== s), te.has(s)) {
111
+ oe.add(s);
112
+ return;
113
+ }
114
+ try {
115
+ await E.delete(s);
116
+ } catch {
117
+ }
118
+ }
119
+ async function _e(s) {
120
+ await z(
121
+ async () => {
122
+ V.value = await E.update(
123
+ E.bundleImagePath(void 0, s),
124
+ s
125
+ ), v.value = "DOCUMENT";
126
+ },
127
+ {
128
+ message: n("connect.store.giftCard.uploading"),
129
+ successMessage: n("connect.store.giftCard.uploaded")
130
+ }
131
+ );
132
+ }
133
+ function Ce() {
134
+ return {
135
+ name: A.value.trim(),
136
+ designs: x.value,
137
+ numberFormat: se.value,
138
+ denominations: c.value.map(Number),
139
+ anyAmount: y.value ? {
140
+ enabled: !0,
141
+ min: Number(N.value),
142
+ max: Number(D.value)
143
+ } : null,
144
+ recipientContactMethod: B.value,
145
+ allowPersonalMessage: O.value,
146
+ termsAndConditions: v.value === "TEXT" && S.value || null,
147
+ termsDocumentUrl: v.value === "DOCUMENT" && V.value || null
148
+ };
149
+ }
150
+ function he(s) {
151
+ var p, g, R;
152
+ A.value = s.name, x.value = [...s.designs ?? []], te = new Set(x.value), c.value = [...s.denominations ?? []], y.value = !!((p = s.anyAmount) != null && p.enabled), N.value = ((g = s.anyAmount) == null ? void 0 : g.min) ?? 10, D.value = ((R = s.anyAmount) == null ? void 0 : R.max) ?? 100, B.value = s.recipientContactMethod, O.value = s.allowPersonalMessage ?? !0;
153
+ const t = s.numberFormat, u = !t || t.prefix === "GC" && Number(t.length) === 16;
154
+ C.value = u ? "DEFAULT" : "ADVANCED", F.value = Number((t == null ? void 0 : t.length) ?? 16), M.value = (t == null ? void 0 : t.charset) ?? j().charset, U.value = (t == null ? void 0 : t.prefix) ?? "GC", P.value = (t == null ? void 0 : t.suffix) ?? "", s.termsDocumentUrl ? (v.value = "DOCUMENT", V.value = s.termsDocumentUrl) : s.termsAndConditions && (v.value = "TEXT", S.value = s.termsAndConditions);
155
+ }
156
+ function Q() {
157
+ pe.push({ name: Se["$connect-STORE"] });
158
+ }
159
+ async function Ae() {
160
+ if (J.value) {
161
+ $.error(J.value);
162
+ return;
163
+ }
164
+ await z(
165
+ async () => {
166
+ const s = Ce();
167
+ T.value ? await Z.updateProgram(T.value, s) : await Z.createProgram(s), await Promise.allSettled(
168
+ [...oe].map((t) => E.delete(t))
169
+ ), Q();
170
+ },
171
+ {
172
+ message: G.value ? n("connect.store.giftCard.saving") : n("connect.store.giftCard.creating"),
173
+ successMessage: G.value ? n("connect.store.giftCard.saved") : n("connect.store.giftCard.created")
174
+ }
175
+ );
176
+ }
177
+ return De(async () => {
178
+ T.value && await fe(async () => {
179
+ he(await Z.readProgram(T.value));
180
+ });
181
+ }), (s, t) => {
182
+ const u = _("FmButton"), p = _("FmTextField"), g = _("FmCard"), R = _("FmDropField"), W = _("FmChip"), de = _("FmSwitch"), ce = _("FmIcon"), we = _("FmTextarea");
183
+ return d(), m("div", Re, [
184
+ o("div", Le, [
185
+ a(u, {
186
+ icon: "arrow_back",
187
+ variant: "tertiary",
188
+ onClick: Q
189
+ }),
190
+ o("div", Ie, [
191
+ o("h1", $e, r(e(G) ? e(n)("connect.store.giftCard.editTitle") : e(n)("connect.store.giftCard.createTitle")), 1),
192
+ o("p", He, r(e(n)("connect.store.giftCard.pageSubtitle")), 1)
193
+ ])
194
+ ]),
195
+ o("div", Ge, [
196
+ a(g, {
197
+ variant: "outlined",
198
+ class: "p-24 flex flex-col gap-16"
199
+ }, {
200
+ default: k(() => [
201
+ o("div", Be, [
202
+ t[15] || (t[15] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary text-[10px] leading-[14px] font-semibold" }, " 1 ", -1)),
203
+ o("div", Xe, [
204
+ o("div", je, r(e(n)("connect.store.giftCard.name")), 1)
205
+ ])
206
+ ]),
207
+ a(p, {
208
+ modelValue: e(A),
209
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => f(A) ? A.value = l : null),
210
+ placeholder: e(n)("connect.store.giftCard.namePlaceholder")
211
+ }, null, 8, ["modelValue", "placeholder"])
212
+ ]),
213
+ _: 1
214
+ }),
215
+ a(g, {
216
+ variant: "outlined",
217
+ class: "p-24 flex flex-col gap-16"
218
+ }, {
219
+ default: k(() => [
220
+ o("div", ze, [
221
+ t[16] || (t[16] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary text-[10px] leading-[14px] font-semibold" }, " 2 ", -1)),
222
+ o("div", Ke, [
223
+ o("div", qe, r(e(n)("connect.store.giftCard.design")), 1),
224
+ o("div", Je, r(e(n)("connect.store.giftCard.designHint")), 1)
225
+ ])
226
+ ]),
227
+ o("div", Qe, [
228
+ (d(!0), m(L, null, I(e(x), (l) => (d(), m("div", {
229
+ key: l,
230
+ class: "relative w-[160px] aspect-video rounded-md overflow-hidden border-1 border-fm-color-neutral-gray-300"
231
+ }, [
232
+ o("img", {
233
+ src: l,
234
+ alt: "",
235
+ class: "w-full h-full object-cover"
236
+ }, null, 8, We),
237
+ a(u, {
238
+ icon: "close",
239
+ variant: "tertiary",
240
+ class: "absolute top-2 right-2",
241
+ onClick: (X) => be(l)
242
+ }, null, 8, ["onClick"])
243
+ ]))), 128)),
244
+ a(R, {
245
+ accept: ".png, .jpg, .jpeg, .gif",
246
+ "max-file-size": 5e6,
247
+ onFileUpload: ye
248
+ })
249
+ ])
250
+ ]),
251
+ _: 1
252
+ }),
253
+ a(g, {
254
+ variant: "outlined",
255
+ class: "p-24 flex flex-col gap-16"
256
+ }, {
257
+ default: k(() => [
258
+ o("div", Ye, [
259
+ t[17] || (t[17] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary text-[10px] leading-[14px] font-semibold" }, " 3 ", -1)),
260
+ o("div", Ze, [
261
+ o("div", et, r(e(n)("connect.store.giftCard.numberSettings")), 1),
262
+ o("div", tt, r(e(n)("connect.store.giftCard.numberSettingsHint")), 1)
263
+ ])
264
+ ]),
265
+ o("div", ot, [
266
+ (d(), m(L, null, I(["DEFAULT", "ADVANCED"], (l) => o("button", {
267
+ key: l,
268
+ type: "button",
269
+ class: ue([
270
+ "flex gap-12 items-start text-left p-16 rounded-md border-1 transition-colors",
271
+ e(C) === l ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
272
+ ]),
273
+ onClick: (X) => C.value = l
274
+ }, [
275
+ o("span", {
276
+ class: ue([
277
+ "w-[18px] h-[18px] rounded-full border-1 flex-none mt-2 grid place-items-center",
278
+ e(C) === l ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
279
+ ])
280
+ }, [
281
+ e(C) === l ? (d(), m("span", lt)) : h("", !0)
282
+ ], 2),
283
+ o("span", st, [
284
+ o("span", at, r(l === "DEFAULT" ? e(n)("connect.store.giftCard.numberDefault") : e(n)("connect.store.giftCard.numberAdvanced")), 1),
285
+ o("span", rt, r(l === "DEFAULT" ? e(n)("connect.store.giftCard.numberDefaultHint") : e(n)("connect.store.giftCard.numberAdvancedHint")), 1)
286
+ ])
287
+ ], 10, nt)), 64))
288
+ ]),
289
+ e(C) === "ADVANCED" ? (d(), m("div", it, [
290
+ a(p, {
291
+ modelValue: e(F),
292
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => f(F) ? F.value = l : null),
293
+ type: "number",
294
+ label: e(n)("connect.store.giftCard.length")
295
+ }, null, 8, ["modelValue", "label"]),
296
+ a(p, {
297
+ modelValue: e(M),
298
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => f(M) ? M.value = l : null),
299
+ label: e(n)("connect.store.giftCard.charset")
300
+ }, null, 8, ["modelValue", "label"]),
301
+ a(p, {
302
+ modelValue: e(U),
303
+ "onUpdate:modelValue": t[3] || (t[3] = (l) => f(U) ? U.value = l : null),
304
+ label: e(n)("connect.store.giftCard.prefix")
305
+ }, null, 8, ["modelValue", "label"]),
306
+ a(p, {
307
+ modelValue: e(P),
308
+ "onUpdate:modelValue": t[4] || (t[4] = (l) => f(P) ? P.value = l : null),
309
+ label: e(n)("connect.store.giftCard.suffix")
310
+ }, null, 8, ["modelValue", "label"])
311
+ ])) : h("", !0),
312
+ o("div", dt, [
313
+ o("div", ct, [
314
+ o("span", ut, r(e(n)("connect.store.giftCard.exampleNumber")), 1),
315
+ o("span", mt, r(e(ge)), 1)
316
+ ]),
317
+ a(u, {
318
+ label: e(n)("connect.store.giftCard.regenerate"),
319
+ icon: "refresh",
320
+ variant: "secondary",
321
+ onClick: t[5] || (t[5] = (l) => ne.value++)
322
+ }, null, 8, ["label"])
323
+ ])
324
+ ]),
325
+ _: 1
326
+ }),
327
+ a(g, {
328
+ variant: "outlined",
329
+ class: "p-24 flex flex-col gap-16"
330
+ }, {
331
+ default: k(() => [
332
+ o("div", ft, [
333
+ t[18] || (t[18] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary text-[10px] leading-[14px] font-semibold" }, " 4 ", -1)),
334
+ o("div", pt, [
335
+ o("div", vt, r(e(n)("connect.store.giftCard.amount")), 1),
336
+ o("div", gt, r(e(n)("connect.store.giftCard.amountHint", {
337
+ max: e(H)
338
+ })), 1)
339
+ ])
340
+ ]),
341
+ o("div", xt, [
342
+ o("div", yt, r(e(n)("connect.store.giftCard.popularAmounts")), 1),
343
+ o("div", bt, [
344
+ (d(), m(L, null, I(K, (l) => a(W, {
345
+ key: l,
346
+ label: `RM ${l}`,
347
+ selectable: "",
348
+ selected: e(c).includes(l),
349
+ onClick: (X) => re(l)
350
+ }, null, 8, ["label", "selected", "onClick"])), 64))
351
+ ])
352
+ ]),
353
+ o("div", _t, [
354
+ o("div", Ct, [
355
+ t[19] || (t[19] = o("span", { class: "px-12 py-8 bg-fm-color-neutral-gray-100 fm-typo-en-body-md-500 text-fm-color-typo-secondary" }, " RM ", -1)),
356
+ Ve(o("input", {
357
+ "onUpdate:modelValue": t[6] || (t[6] = (l) => f(w) ? w.value = l : null),
358
+ type: "number",
359
+ class: "px-12 py-8 outline-none fm-typo-en-body-md-400 w-[140px]",
360
+ placeholder: e(n)("connect.store.giftCard.custom"),
361
+ onKeyup: ke(ie, ["enter"])
362
+ }, null, 40, ht), [
363
+ [Ee, e(w)]
364
+ ])
365
+ ]),
366
+ a(u, {
367
+ label: e(n)("connect.store.giftCard.addAmount"),
368
+ variant: "secondary",
369
+ onClick: ie
370
+ }, null, 8, ["label"])
371
+ ]),
372
+ e(c).some((l) => !K.includes(l)) ? (d(), m("div", At, [
373
+ (d(!0), m(L, null, I(e(c).filter(
374
+ (l) => !K.includes(l)
375
+ ), (l) => (d(), Y(W, {
376
+ key: l,
377
+ label: `RM ${l}`,
378
+ removable: "",
379
+ onRemove: (X) => re(l)
380
+ }, null, 8, ["label", "onRemove"]))), 128))
381
+ ])) : h("", !0),
382
+ o("div", wt, [
383
+ me(r(e(n)("connect.store.giftCard.selected")) + " ", 1),
384
+ o("span", Nt, r(e(c).length), 1),
385
+ me(" / " + r(e(H)), 1)
386
+ ]),
387
+ o("div", Dt, [
388
+ a(de, {
389
+ modelValue: e(y),
390
+ "onUpdate:modelValue": t[7] || (t[7] = (l) => f(y) ? y.value = l : null)
391
+ }, null, 8, ["modelValue"]),
392
+ o("div", Vt, [
393
+ o("div", kt, r(e(n)("connect.store.giftCard.anyAmount")), 1),
394
+ o("div", Et, r(e(n)("connect.store.giftCard.anyAmountHint")), 1)
395
+ ])
396
+ ]),
397
+ e(y) ? (d(), m("div", Tt, [
398
+ a(p, {
399
+ modelValue: e(N),
400
+ "onUpdate:modelValue": t[8] || (t[8] = (l) => f(N) ? N.value = l : null),
401
+ type: "number",
402
+ label: e(n)("connect.store.giftCard.min"),
403
+ class: "flex-1"
404
+ }, null, 8, ["modelValue", "label"]),
405
+ a(p, {
406
+ modelValue: e(D),
407
+ "onUpdate:modelValue": t[9] || (t[9] = (l) => f(D) ? D.value = l : null),
408
+ type: "number",
409
+ label: e(n)("connect.store.giftCard.max"),
410
+ "helper-text": `Up to RM${e(ee)}`,
411
+ class: "flex-1"
412
+ }, null, 8, ["modelValue", "label", "helper-text"])
413
+ ])) : h("", !0),
414
+ e(q) ? (d(), m("div", Ft, r(e(q)), 1)) : h("", !0)
415
+ ]),
416
+ _: 1
417
+ }),
418
+ a(g, {
419
+ variant: "outlined",
420
+ class: "p-24 flex flex-col gap-16"
421
+ }, {
422
+ default: k(() => [
423
+ o("div", Mt, [
424
+ t[20] || (t[20] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary text-[10px] leading-[14px] font-semibold" }, " 5 ", -1)),
425
+ o("div", Ut, [
426
+ o("div", Pt, r(e(n)("connect.store.giftCard.sending")), 1),
427
+ o("div", Ot, r(e(n)("connect.store.giftCard.sendingHint")), 1)
428
+ ])
429
+ ]),
430
+ e(le) ? h("", !0) : (d(), m("div", St, [
431
+ a(ce, {
432
+ name: "info",
433
+ class: "text-fm-color-system-info-400 flex-none"
434
+ }),
435
+ o("div", Rt, r(e(n)("connect.store.giftCard.broadcastNotice")), 1),
436
+ a(u, {
437
+ icon: "close",
438
+ variant: "tertiary",
439
+ onClick: t[10] || (t[10] = (l) => le.value = !0)
440
+ })
441
+ ])),
442
+ o("div", Lt, [
443
+ a(de, {
444
+ modelValue: e(O),
445
+ "onUpdate:modelValue": t[11] || (t[11] = (l) => f(O) ? O.value = l : null)
446
+ }, null, 8, ["modelValue"]),
447
+ o("span", It, r(e(n)("connect.store.giftCard.personalMessage")), 1)
448
+ ]),
449
+ o("div", $t, [
450
+ o("div", Ht, r(e(n)("connect.store.giftCard.contactMethod")), 1),
451
+ o("div", Gt, [
452
+ (d(!0), m(L, null, I([
453
+ { value: "EMAIL", label: e(n)("connect.store.giftCard.email") },
454
+ { value: "PHONE", label: e(n)("connect.store.giftCard.phone") },
455
+ {
456
+ value: "EMAIL_OR_PHONE",
457
+ label: e(n)("connect.store.giftCard.emailOrPhone")
458
+ }
459
+ ], (l) => (d(), Y(W, {
460
+ key: l.value,
461
+ label: l.label,
462
+ selectable: "",
463
+ selected: e(B) === l.value,
464
+ onClick: (X) => B.value = l.value
465
+ }, null, 8, ["label", "selected", "onClick"]))), 128))
466
+ ])
467
+ ])
468
+ ]),
469
+ _: 1
470
+ }),
471
+ a(g, {
472
+ variant: "outlined",
473
+ class: "p-24 flex flex-col gap-16"
474
+ }, {
475
+ default: k(() => [
476
+ o("div", Bt, [
477
+ t[21] || (t[21] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary text-[10px] leading-[14px] font-semibold" }, " 6 ", -1)),
478
+ o("div", Xt, [
479
+ o("div", jt, r(e(n)("connect.store.giftCard.terms")), 1),
480
+ o("div", zt, r(e(n)("connect.store.giftCard.termsHint")), 1)
481
+ ])
482
+ ]),
483
+ o("div", Kt, [
484
+ a(u, {
485
+ label: e(n)("connect.store.giftCard.enterText"),
486
+ icon: "edit",
487
+ variant: "secondary",
488
+ onClick: t[12] || (t[12] = (l) => v.value = "TEXT")
489
+ }, null, 8, ["label"]),
490
+ a(R, {
491
+ accept: ".pdf, .doc, .docx",
492
+ "max-file-size": 5e6,
493
+ onFileUpload: _e
494
+ })
495
+ ]),
496
+ e(v) === "TEXT" ? (d(), Y(we, {
497
+ key: 0,
498
+ modelValue: e(S),
499
+ "onUpdate:modelValue": t[13] || (t[13] = (l) => f(S) ? S.value = l : null),
500
+ rows: 5,
501
+ placeholder: e(n)("connect.store.giftCard.termsPlaceholder")
502
+ }, null, 8, ["modelValue", "placeholder"])) : e(v) === "DOCUMENT" && e(V) ? (d(), m("div", qt, [
503
+ a(ce, {
504
+ name: "description",
505
+ class: "text-fm-color-typo-secondary"
506
+ }),
507
+ o("a", {
508
+ href: e(V),
509
+ target: "_blank",
510
+ rel: "noopener",
511
+ class: "text-fm-color-typo-info underline"
512
+ }, r(e(n)("connect.store.giftCard.viewDocument")), 9, Jt),
513
+ a(u, {
514
+ icon: "close",
515
+ variant: "tertiary",
516
+ onClick: t[14] || (t[14] = (l) => (V.value = "", v.value = "NONE"))
517
+ })
518
+ ])) : h("", !0)
519
+ ]),
520
+ _: 1
521
+ }),
522
+ o("div", Qt, [
523
+ a(u, {
524
+ label: e(n)("connect.common.cancel"),
525
+ variant: "tertiary",
526
+ onClick: Q
527
+ }, null, 8, ["label"]),
528
+ a(u, {
529
+ label: e(G) ? e(n)("connect.common.save") : e(n)("connect.store.giftCard.addGiftCard"),
530
+ loading: e(Fe)().isLoading,
531
+ disabled: !!e(J),
532
+ onClick: Ae
533
+ }, null, 8, ["label", "loading", "disabled"])
534
+ ])
535
+ ])
536
+ ]);
537
+ };
538
+ }
539
+ });
540
+ export {
541
+ io as default
542
+ };