@feedmepos/mf-connect 0.1.38-beta.44 → 0.1.38-beta.46
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.
- package/dist/{Analytic-DaVlIGf-.js → Analytic-BGKCj1jr.js} +13 -13
- package/dist/{App-BuWDQu4h.js → App-Rjzbi736.js} +7 -7
- package/dist/{AuditLogs-Dg-AmPCL.js → AuditLogs-Dip8piV3.js} +9 -9
- package/dist/{Bin-BLZqBirZ.js → Bin-DOvnUMsH.js} +8 -8
- package/dist/{Broadcast-CO9pC5-Y.js → Broadcast-xcZBuHpL.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BzeOFGn3.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dizv5GP_.js} +6 -6
- package/dist/{Card-DxC4SzhE.js → Card-CKjNEigS.js} +18 -18
- package/dist/{Collections-Dl24kiOy.js → Collections-x5ofCSJN.js} +74 -73
- package/dist/{Credit-Dx9iReBU.js → Credit-BWBu_w2L.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B31p-9aH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBoP1Jwt.js} +1143 -1117
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-YjvIstf7.js +348 -0
- package/dist/{Experience-CeTt_14y.js → Experience-pkdcwDSi.js} +8 -8
- package/dist/{Game-BiD0onYI.js → Game-Dna43QZe.js} +9 -9
- package/dist/{Grab-IOWWGsOE.js → Grab-C9Z_Zfe8.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js → ImageInput.vue_vue_type_script_setup_true_lang-DElYlMlB.js} +44 -43
- package/dist/{Index-D3z5IdXJ.js → Index-DRIWf1NE.js} +10 -10
- package/dist/{Marketing-b1cfAMZ3.js → Marketing-usRTwLLw.js} +7 -7
- package/dist/{Member-BSUAVJcD.js → Member-B70QVgJa.js} +10 -10
- package/dist/{MemberList-CnXn01xK.js → MemberList-JI4mBPfA.js} +25 -25
- package/dist/{MemberTransactions-C_oE-NJv.js → MemberTransactions-DYHJdzBn.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BYlfLbKK.js → MessageInput.vue_vue_type_script_setup_true_lang-Dvr2n1Qk.js} +5090 -5091
- package/dist/{Mission-BJpdXP_V.js → Mission-D8FTOnMy.js} +9 -9
- package/dist/{Overview-CW5f7sAz.js → Overview-CaxFeeVL.js} +19 -19
- package/dist/{Point-BlW29FTE.js → Point-I9wVIa2q.js} +8 -8
- package/dist/{Promotion-BLbBVMGg.js → Promotion-CWFtbYmb.js} +9 -9
- package/dist/{Queue-IKQPAf2s.js → Queue-BmjIEX84.js} +10 -10
- package/dist/{Record-BpAB2Eun.js → Record-DuvGrBry.js} +8 -8
- package/dist/{Reward-CRyvWOwo.js → Reward-BQ36_7d0.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CbL_JmWH.js → RewardGroup.vue_vue_type_script_setup_true_lang-0AbXVk_6.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BF98epZo.js → RuleGroup.vue_vue_type_script_setup_true_lang-pwHQUtHq.js} +596 -592
- package/dist/{Segment-C0lbV7EJ.js → Segment-ClGmNf-7.js} +23 -23
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-D1lUfj_I.js → SelectItems.vue_vue_type_script_setup_true_lang-CGsYilHx.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CurmIKU-.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Bbisi3wu.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BM-fztkT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CRnHuPPI.js} +3 -3
- package/dist/{Setting-BIgHzM4O.js → Setting-DtRP7-KR.js} +14 -14
- package/dist/{SettingAdvertisements-pSKo469B.js → SettingAdvertisements-9gG904yk.js} +12 -12
- package/dist/{Store-Czn9bmJY.js → Store-j8N8l1e7.js} +21 -21
- package/dist/{StoreRewards-BEgyufA-.js → StoreRewards-9o5EngS4.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DzlPKkvb.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bs54sDKB.js} +31 -29
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Dt-fITiT.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CqBeBxgc.js} +1 -1
- package/dist/{Tier-uoxXOOmb.js → Tier-N4Fwb4c2.js} +23 -23
- package/dist/{Title-QaZ_Qzwk.js → Title-BisuO_Bq.js} +20 -20
- package/dist/{Transaction-By9Q6BcR.js → Transaction-BvL-lHUW.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-ChoSRMz9.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-D3zT4NEB.js} +6 -6
- package/dist/{Voucher-DD9c1bOC.js → Voucher-BNVS0bf_.js} +12 -12
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BdAaQtUx.js +421 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B1E0-61O.js → ZodTextField.vue_vue_type_script_setup_true_lang-Db5UjYDs.js} +2 -2
- package/dist/{app-D1EzxIEG.js → app-5gFoCIZ5.js} +2285 -795
- package/dist/{app-C-L8YbbE.js → app-HOMrHaJX.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-B9L1wZ9V.js → business-DrOrg91y.js} +1 -1
- package/dist/{campaign-BR7cO_ag.js → campaign-D-0jxXgS.js} +1 -1
- package/dist/campaign-DxZjTV1c.js +233 -0
- package/dist/{campaign.enum-OFeKrvOv.js → campaign.enum-DfqdgPF7.js} +1 -1
- package/dist/{campaign.fn-B9PtQJx6.js → campaign.fn-BA9SsYlS.js} +23 -23
- package/dist/{collectible.enum-BE8Vnk8X.js → collectible.enum-CUY4edTO.js} +1 -1
- package/dist/{collection.fn-CSzvUULo.js → collection.fn-BUyLrKuP.js} +2 -2
- package/dist/{dto-DH8S9-Ib.js → dto-CdsbCKbi.js} +4 -4
- package/dist/{effect-DZGMEmET.js → effect-CHvrDcct.js} +1 -1
- package/dist/{email-addresses-Clhn0_GY.js → email-addresses-BQGuEvTh.js} +1 -1
- package/dist/{export-D2-7Mdk_.js → export-CgyLGAFe.js} +3 -3
- package/dist/{helper-A850CYX-.js → helper-CUXD11Bp.js} +1 -1
- package/dist/{index-DBkatkYW.js → index-BMpQ1Eq2.js} +1 -1
- package/dist/{index-CaRmY5ov.js → index-BTzBc44a.js} +4 -4
- package/dist/{index-Di6vuuEG.js → index-BmOfDfwV.js} +222 -217
- package/dist/{index-Fx5b3dyw.js → index-Bsz-Af4_.js} +2 -2
- package/dist/{index-CLvKSnsU.js → index-D-Qagjww.js} +3 -3
- package/dist/{index-DZ2N0Xar.js → index-DQlMaN5j.js} +1023 -1023
- package/dist/{index-ti-HnLrW.js → index-DUBEbnDX.js} +1 -1
- package/dist/{index-CZtsEfNW.js → index-DUZWoVeF.js} +1 -1
- package/dist/{index-DgS92jOx.js → index-DrRjJg2A.js} +1 -1
- package/dist/{index-aXnPGrHU.js → index-DtcXk4cG.js} +1 -1
- package/dist/{index-Ddj2NyfT.js → index-Dvy1ftAd.js} +1 -1
- package/dist/{index-DIFcHxGK.js → index-ePW_CRtd.js} +1 -1
- package/dist/{index-BIX6P8Ch.js → index-uliDTEHQ.js} +3 -3
- package/dist/{index.esm2017-CeG_Fc0h.js → index.esm2017-CJJcI6HI.js} +1 -1
- package/dist/{loading-BTmVuA3F.js → loading-O2OJnB-v.js} +1 -1
- package/dist/{membership-855TzqV2.js → membership-kVwD3i5I.js} +3 -3
- package/dist/{money-q7C-U4gP.js → money-CvRqEjZN.js} +1 -1
- package/dist/{number-D_GEDOMH.js → number-BtM53Gqu.js} +1 -1
- package/dist/{objectid-BMt_qSOq.js → objectid-BbEyb60f.js} +12 -12
- package/dist/{campaign-DBsKNNfL.js → plugins-nuoNiWZV.js} +783 -788
- package/dist/{reward-BzhG23G8.js → reward-C904TC9N.js} +1 -1
- package/dist/{rule-hkruDWXK.js → rule-B2r0vrQs.js} +3 -3
- package/dist/{rule-builder-CDKwRPm6.js → rule-builder-DxCXxYrs.js} +1 -1
- package/dist/template-C8z7oS1X.js +188 -0
- package/dist/{timezone-CczMDZJW.js → timezone-C-mgrIzx.js} +1 -1
- package/dist/trigger-DrmYFT7r.js +213 -0
- package/dist/{user-vV0mHSKf.js → user-C_PXVgnR.js} +1 -1
- package/dist/{vue-i18n-C3xXE7er.js → vue-i18n-CBY1MepG.js} +111 -111
- package/dist/{xlsx-DwllaYd7.js → xlsx-DmlvPg-W.js} +1 -1
- package/dist/{zod-Bg2FbC-D.js → zod-DlxxgJ-R.js} +32 -31
- package/package.json +1 -1
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-C7EGat91.js +0 -348
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DgCjZuxC.js +0 -419
- package/dist/plugins-DYwCm0Ql.js +0 -208
- package/dist/template-Bzs20Hr7.js +0 -190
- package/dist/trigger-C67D78R1.js +0 -144
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, unref, isRef, createTextVNode, normalizeClass, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { z } from "./app-
|
|
4
|
-
import { Z as ZodHelper } from "./zod-
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
10
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-CDKwRPm6.js";
|
|
3
|
+
import { z } from "./app-5gFoCIZ5.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-DlxxgJ-R.js";
|
|
5
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CdsbCKbi.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-kVwD3i5I.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-DrOrg91y.js";
|
|
8
|
+
import "./index-Bsz-Af4_.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DxCXxYrs.js";
|
|
11
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
12
11
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
13
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
14
|
-
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
15
|
-
import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
16
|
-
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { c as core, S as SvcConfig } from "./index-
|
|
18
|
-
import { p as prompt,
|
|
19
|
-
import { C as Cb } from "./app-
|
|
20
|
-
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-DfqdgPF7.js";
|
|
13
|
+
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-DElYlMlB.js";
|
|
14
|
+
import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-YjvIstf7.js";
|
|
15
|
+
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CqBeBxgc.js";
|
|
16
|
+
import { c as core, S as SvcConfig } from "./index-D-Qagjww.js";
|
|
17
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-nuoNiWZV.js";
|
|
18
|
+
import { C as Cb } from "./app-HOMrHaJX.js";
|
|
19
|
+
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-CGsYilHx.js";
|
|
21
20
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
22
|
-
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
24
|
-
import { u as useI18n } from "./vue-i18n-
|
|
25
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-
|
|
26
|
-
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
27
|
-
import { C as CountryTimezone, m as moment } from "./timezone-
|
|
28
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
21
|
+
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-D3zT4NEB.js";
|
|
22
|
+
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-pwHQUtHq.js";
|
|
23
|
+
import { u as useI18n } from "./vue-i18n-CBY1MepG.js";
|
|
24
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-DrmYFT7r.js";
|
|
25
|
+
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-Dvr2n1Qk.js";
|
|
26
|
+
import { C as CountryTimezone, m as moment } from "./timezone-C-mgrIzx.js";
|
|
27
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-B2r0vrQs.js";
|
|
29
28
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
30
|
-
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
31
|
-
import { T as TEMPLATES } from "./index-
|
|
32
|
-
import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-
|
|
33
|
-
import "./index-
|
|
34
|
-
import "./index-
|
|
35
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
36
|
-
import { u as useLoading } from "./loading-
|
|
37
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
38
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
29
|
+
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BdAaQtUx.js";
|
|
30
|
+
import { T as TEMPLATES } from "./index-BmOfDfwV.js";
|
|
31
|
+
import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-BTzBc44a.js";
|
|
32
|
+
import "./index-BMpQ1Eq2.js";
|
|
33
|
+
import "./index-uliDTEHQ.js";
|
|
34
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-CUY4edTO.js";
|
|
35
|
+
import { u as useLoading } from "./loading-O2OJnB-v.js";
|
|
36
|
+
import { i as initCollectibleConfig } from "./helper-CUXD11Bp.js";
|
|
37
|
+
import { C as CollectionUtils } from "./collection.fn-BUyLrKuP.js";
|
|
39
38
|
import { s as sentenceCase$1 } from "./index-CsaQJMAR.js";
|
|
40
|
-
import "./
|
|
39
|
+
import { c as getCampaignSummaryObject } from "./campaign-DxZjTV1c.js";
|
|
40
|
+
import "./index-DQlMaN5j.js";
|
|
41
41
|
import { useDialog } from "@feedmepos/ui-library";
|
|
42
|
-
import { u as useCampaignStore } from "./campaign-
|
|
42
|
+
import { u as useCampaignStore } from "./campaign-D-0jxXgS.js";
|
|
43
43
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
44
44
|
function summarizeGrabDiscount(e) {
|
|
45
45
|
if (!e)
|
|
46
46
|
return null;
|
|
47
|
-
const
|
|
48
|
-
function
|
|
49
|
-
switch (
|
|
47
|
+
const m = core.Config.getCountry().currency.symbol;
|
|
48
|
+
function a(l) {
|
|
49
|
+
switch (l.scope.type) {
|
|
50
50
|
case "order":
|
|
51
51
|
return "Bill discount";
|
|
52
52
|
case "items":
|
|
53
|
-
return
|
|
53
|
+
return l.type.startsWith("bundle") ? d(l.type) : "Item discount";
|
|
54
54
|
case "categories":
|
|
55
55
|
return "Category discount";
|
|
56
56
|
default:
|
|
57
57
|
return "Discount";
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
switch (
|
|
60
|
+
function d(l) {
|
|
61
|
+
switch (l) {
|
|
62
62
|
case "bundleSameFixPrice":
|
|
63
63
|
return "Bundle (same item) - Fixed price";
|
|
64
64
|
case "bundleDiffFixPrice":
|
|
@@ -75,40 +75,40 @@ function summarizeGrabDiscount(e) {
|
|
|
75
75
|
return "Bundle discount";
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
switch (
|
|
78
|
+
function i(l) {
|
|
79
|
+
switch (l.type) {
|
|
80
80
|
case "percentage":
|
|
81
81
|
case "bundleSamePercentage":
|
|
82
82
|
case "bundleDiffPercentage":
|
|
83
|
-
return `${
|
|
83
|
+
return `${l.value}% discount`;
|
|
84
84
|
case "net":
|
|
85
85
|
case "bundleSameNet":
|
|
86
86
|
case "bundleDiffNet":
|
|
87
|
-
return `${
|
|
87
|
+
return `${m}${l.value} discount`;
|
|
88
88
|
case "bundleSameFixPrice":
|
|
89
89
|
case "bundleDiffFixPrice":
|
|
90
|
-
return `${
|
|
90
|
+
return `${m}${l.value} fixed price`;
|
|
91
91
|
case "delivery":
|
|
92
92
|
return "Delivery fee discount";
|
|
93
93
|
case "freeItem":
|
|
94
94
|
return "Free item";
|
|
95
95
|
default:
|
|
96
|
-
return `${
|
|
96
|
+
return `${m}${l.value} discount`;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return
|
|
99
|
+
function s(l) {
|
|
100
|
+
return l.cap && l.cap > 0 ? `capped at ${m}${l.cap}` : null;
|
|
101
101
|
}
|
|
102
102
|
return {
|
|
103
|
-
type:
|
|
104
|
-
adjustment:
|
|
105
|
-
cap:
|
|
103
|
+
type: a(e),
|
|
104
|
+
adjustment: i(e),
|
|
105
|
+
cap: s(e)
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
const _hoisted_1$l = {
|
|
109
109
|
key: 0,
|
|
110
110
|
class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
|
|
111
|
-
}, _hoisted_2$h = { class: "flex items-center justify-between" }, _hoisted_3$e = { class: "flex items-center gap-8" }, _hoisted_4$
|
|
111
|
+
}, _hoisted_2$h = { class: "flex items-center justify-between" }, _hoisted_3$e = { class: "flex items-center gap-8" }, _hoisted_4$d = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 p-16" }, _hoisted_5$a = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
112
112
|
__name: "GrabItemSelectionInline",
|
|
113
113
|
props: {
|
|
114
114
|
visible: { type: Boolean },
|
|
@@ -116,63 +116,63 @@ const _hoisted_1$l = {
|
|
|
116
116
|
filterItems: { type: Function }
|
|
117
117
|
},
|
|
118
118
|
emits: ["confirm", "cancel"],
|
|
119
|
-
setup(e, { emit:
|
|
120
|
-
const
|
|
119
|
+
setup(e, { emit: m }) {
|
|
120
|
+
const a = e, d = m, i = ref();
|
|
121
121
|
watch(
|
|
122
|
-
() =>
|
|
123
|
-
(
|
|
124
|
-
var
|
|
125
|
-
!
|
|
122
|
+
() => a.visible,
|
|
123
|
+
(n) => {
|
|
124
|
+
var r, y;
|
|
125
|
+
!n && i.value && ((y = (r = i.value).setSelectedItems) == null || y.call(r, a.initialValue || []));
|
|
126
126
|
}
|
|
127
127
|
);
|
|
128
|
-
function
|
|
129
|
-
var
|
|
130
|
-
(
|
|
128
|
+
function s() {
|
|
129
|
+
var n;
|
|
130
|
+
(n = i.value) == null || n.onConfirm();
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
132
|
+
function l() {
|
|
133
|
+
d("cancel");
|
|
134
134
|
}
|
|
135
|
-
function n
|
|
136
|
-
|
|
135
|
+
function o(n) {
|
|
136
|
+
d("confirm", n);
|
|
137
137
|
}
|
|
138
|
-
return (
|
|
139
|
-
const
|
|
138
|
+
return (n, r) => {
|
|
139
|
+
const y = resolveComponent("FmIcon"), v = resolveComponent("FmButton");
|
|
140
140
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
141
141
|
createElementVNode("div", _hoisted_2$h, [
|
|
142
142
|
createElementVNode("div", _hoisted_3$e, [
|
|
143
|
-
createVNode(
|
|
143
|
+
createVNode(y, {
|
|
144
144
|
name: "restaurant",
|
|
145
145
|
size: "md"
|
|
146
146
|
}),
|
|
147
|
-
|
|
147
|
+
r[0] || (r[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
|
|
148
148
|
]),
|
|
149
|
-
createVNode(
|
|
149
|
+
createVNode(v, {
|
|
150
150
|
icon: "close",
|
|
151
151
|
variant: "tertiary",
|
|
152
|
-
onClick:
|
|
152
|
+
onClick: l
|
|
153
153
|
})
|
|
154
154
|
]),
|
|
155
|
-
|
|
156
|
-
createElementVNode("div", _hoisted_4$
|
|
155
|
+
r[1] || (r[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. For bundle discounts, select multiple items that can be bundled together. ", -1)),
|
|
156
|
+
createElementVNode("div", _hoisted_4$d, [
|
|
157
157
|
createVNode(_sfc_main$o, {
|
|
158
158
|
ref_key: "selectItemRef",
|
|
159
|
-
ref:
|
|
159
|
+
ref: i,
|
|
160
160
|
"initial-value": e.initialValue,
|
|
161
161
|
"filter-items": e.filterItems,
|
|
162
|
-
"on-complete":
|
|
162
|
+
"on-complete": o,
|
|
163
163
|
"max-height": 300
|
|
164
164
|
}, null, 8, ["initial-value", "filter-items"])
|
|
165
165
|
]),
|
|
166
|
-
createElementVNode("div", _hoisted_5$
|
|
167
|
-
createVNode(
|
|
166
|
+
createElementVNode("div", _hoisted_5$a, [
|
|
167
|
+
createVNode(v, {
|
|
168
168
|
variant: "secondary",
|
|
169
169
|
label: "Cancel",
|
|
170
|
-
onClick:
|
|
170
|
+
onClick: l
|
|
171
171
|
}),
|
|
172
|
-
createVNode(
|
|
172
|
+
createVNode(v, {
|
|
173
173
|
variant: "primary",
|
|
174
174
|
label: "Confirm Selection",
|
|
175
|
-
onClick:
|
|
175
|
+
onClick: s
|
|
176
176
|
})
|
|
177
177
|
])
|
|
178
178
|
])) : createCommentVNode("", !0);
|
|
@@ -181,7 +181,7 @@ const _hoisted_1$l = {
|
|
|
181
181
|
}), _hoisted_1$k = {
|
|
182
182
|
key: 0,
|
|
183
183
|
class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
|
|
184
|
-
}, _hoisted_2$g = { class: "flex items-center justify-between" }, _hoisted_3$d = { class: "flex items-center gap-8" }, _hoisted_4$
|
|
184
|
+
}, _hoisted_2$g = { class: "flex items-center justify-between" }, _hoisted_3$d = { class: "flex items-center gap-8" }, _hoisted_4$c = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$9 = { class: "flex gap-8 items-center" }, _hoisted_6$5 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$5 = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$4 = { class: "flex items-center gap-12" }, _hoisted_9$4 = { class: "fm-typo-en-body-md-600" }, _hoisted_10$4 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_11$2 = {
|
|
185
185
|
key: 1,
|
|
186
186
|
class: "p-24 text-center"
|
|
187
187
|
}, _hoisted_12$1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_13$1 = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
@@ -191,57 +191,57 @@ const _hoisted_1$l = {
|
|
|
191
191
|
initialValue: {}
|
|
192
192
|
},
|
|
193
193
|
emits: ["confirm", "cancel"],
|
|
194
|
-
setup(e, { emit:
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
return
|
|
194
|
+
setup(e, { emit: m }) {
|
|
195
|
+
const a = e, d = m, i = Cb(), s = ref({}), l = ref(""), o = computed(() => {
|
|
196
|
+
const c = i.menu.value;
|
|
197
|
+
return c ? c.modules.category.map((f) => ({
|
|
198
198
|
id: f._id,
|
|
199
199
|
name: f.name
|
|
200
200
|
})) : [];
|
|
201
|
-
}),
|
|
202
|
-
if (!
|
|
203
|
-
const
|
|
204
|
-
return
|
|
205
|
-
(f) => f.name.toLowerCase().includes(
|
|
201
|
+
}), n = computed(() => {
|
|
202
|
+
if (!l.value) return o.value;
|
|
203
|
+
const c = l.value.toLowerCase();
|
|
204
|
+
return o.value.filter(
|
|
205
|
+
(f) => f.name.toLowerCase().includes(c)
|
|
206
206
|
);
|
|
207
|
-
}),
|
|
208
|
-
function
|
|
209
|
-
|
|
210
|
-
(
|
|
207
|
+
}), r = computed(() => Object.values(s.value).filter(Boolean).length);
|
|
208
|
+
function y() {
|
|
209
|
+
s.value = o.value.reduce(
|
|
210
|
+
(c, f) => (c[f.id] = a.initialValue.includes(f.id), c),
|
|
211
211
|
{}
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
|
-
watch([() =>
|
|
215
|
-
|
|
214
|
+
watch([() => a.visible, () => a.initialValue], () => {
|
|
215
|
+
a.visible && y();
|
|
216
216
|
}), onMounted(async () => {
|
|
217
|
-
await
|
|
217
|
+
await i.store.getMenu(), y();
|
|
218
218
|
});
|
|
219
|
-
function
|
|
220
|
-
|
|
219
|
+
function v(c) {
|
|
220
|
+
s.value[c] = !s.value[c];
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
function h() {
|
|
223
|
+
const c = r.value === n.value.length;
|
|
224
|
+
n.value.forEach((f) => {
|
|
225
|
+
s.value[f.id] = !c;
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
Object.keys(
|
|
230
|
-
|
|
228
|
+
function x() {
|
|
229
|
+
Object.keys(s.value).forEach((c) => {
|
|
230
|
+
s.value[c] = !1;
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
const
|
|
235
|
-
|
|
233
|
+
function k() {
|
|
234
|
+
const c = Object.entries(s.value).filter(([, f]) => f).map(([f]) => f);
|
|
235
|
+
d("confirm", c);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
237
|
+
function p() {
|
|
238
|
+
d("cancel");
|
|
239
239
|
}
|
|
240
|
-
const
|
|
241
|
-
(
|
|
240
|
+
const u = computed(() => n.value.length > 0 && n.value.every(
|
|
241
|
+
(c) => s.value[c.id]
|
|
242
242
|
));
|
|
243
|
-
return (
|
|
244
|
-
const B = resolveComponent("FmIcon"),
|
|
243
|
+
return (c, f) => {
|
|
244
|
+
const B = resolveComponent("FmIcon"), b = resolveComponent("FmButton"), E = resolveComponent("FmTextField"), N = resolveComponent("FmCheckbox"), C = resolveComponent("FmListItem"), R = resolveComponent("FmList");
|
|
245
245
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
246
246
|
createElementVNode("div", _hoisted_2$g, [
|
|
247
247
|
createElementVNode("div", _hoisted_3$d, [
|
|
@@ -251,66 +251,66 @@ const _hoisted_1$l = {
|
|
|
251
251
|
}),
|
|
252
252
|
f[2] || (f[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
|
|
253
253
|
]),
|
|
254
|
-
createVNode(
|
|
254
|
+
createVNode(b, {
|
|
255
255
|
icon: "close",
|
|
256
256
|
variant: "tertiary",
|
|
257
|
-
onClick:
|
|
257
|
+
onClick: p
|
|
258
258
|
})
|
|
259
259
|
]),
|
|
260
260
|
f[3] || (f[3] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. The discount will be available for all items within the selected categories. ", -1)),
|
|
261
|
-
createElementVNode("div", _hoisted_4$
|
|
262
|
-
createElementVNode("div", _hoisted_5$
|
|
263
|
-
createVNode(
|
|
261
|
+
createElementVNode("div", _hoisted_4$c, [
|
|
262
|
+
createElementVNode("div", _hoisted_5$9, [
|
|
263
|
+
createVNode(b, {
|
|
264
264
|
icon: "select_all",
|
|
265
265
|
variant: "tertiary",
|
|
266
266
|
size: "small",
|
|
267
|
-
label: `${
|
|
268
|
-
onClick:
|
|
267
|
+
label: `${u.value ? "Deselect" : "Select"} All`,
|
|
268
|
+
onClick: h
|
|
269
269
|
}, null, 8, ["label"]),
|
|
270
|
-
createVNode(
|
|
270
|
+
createVNode(b, {
|
|
271
271
|
icon: "sync",
|
|
272
272
|
variant: "tertiary",
|
|
273
273
|
size: "small",
|
|
274
274
|
label: "Clear",
|
|
275
|
-
onClick:
|
|
275
|
+
onClick: x
|
|
276
276
|
}),
|
|
277
|
-
createElementVNode("span", _hoisted_6$5, toDisplayString(
|
|
277
|
+
createElementVNode("span", _hoisted_6$5, toDisplayString(r.value) + " selected ", 1)
|
|
278
278
|
]),
|
|
279
279
|
createVNode(E, {
|
|
280
|
-
modelValue:
|
|
281
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
280
|
+
modelValue: l.value,
|
|
281
|
+
"onUpdate:modelValue": f[0] || (f[0] = (S) => l.value = S),
|
|
282
282
|
placeholder: "Search categories",
|
|
283
283
|
"leading-icon": { name: "search", color: "" },
|
|
284
284
|
class: "flex-1 min-w-[200px]"
|
|
285
285
|
}, null, 8, ["modelValue"])
|
|
286
286
|
]),
|
|
287
|
-
createElementVNode("div", _hoisted_7$
|
|
288
|
-
|
|
287
|
+
createElementVNode("div", _hoisted_7$5, [
|
|
288
|
+
n.value.length > 0 ? (openBlock(), createBlock(R, { key: 0 }, {
|
|
289
289
|
default: withCtx(() => [
|
|
290
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
291
|
-
key:
|
|
290
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (S) => (openBlock(), createBlock(C, {
|
|
291
|
+
key: S.id,
|
|
292
292
|
clickable: !0,
|
|
293
|
-
onClick: (
|
|
293
|
+
onClick: ($) => v(S.id)
|
|
294
294
|
}, {
|
|
295
295
|
leading: withCtx(() => [
|
|
296
|
-
createVNode(
|
|
297
|
-
"model-value":
|
|
298
|
-
value:
|
|
299
|
-
"onUpdate:modelValue": (
|
|
296
|
+
createVNode(N, {
|
|
297
|
+
"model-value": s.value[S.id] || !1,
|
|
298
|
+
value: S.id,
|
|
299
|
+
"onUpdate:modelValue": ($) => v(S.id),
|
|
300
300
|
onClick: f[1] || (f[1] = withModifiers(() => {
|
|
301
301
|
}, ["stop"]))
|
|
302
302
|
}, null, 8, ["model-value", "value", "onUpdate:modelValue"])
|
|
303
303
|
]),
|
|
304
304
|
default: withCtx(() => [
|
|
305
|
-
createElementVNode("div", _hoisted_8$
|
|
305
|
+
createElementVNode("div", _hoisted_8$4, [
|
|
306
306
|
createVNode(B, {
|
|
307
307
|
name: "category",
|
|
308
308
|
size: "sm",
|
|
309
309
|
class: "text-fm-color-typo-secondary"
|
|
310
310
|
}),
|
|
311
311
|
createElementVNode("div", null, [
|
|
312
|
-
createElementVNode("div", _hoisted_9$
|
|
313
|
-
createElementVNode("div", _hoisted_10$
|
|
312
|
+
createElementVNode("div", _hoisted_9$4, toDisplayString(S.name), 1),
|
|
313
|
+
createElementVNode("div", _hoisted_10$4, " ID: " + toDisplayString(S.id), 1)
|
|
314
314
|
])
|
|
315
315
|
])
|
|
316
316
|
]),
|
|
@@ -319,20 +319,20 @@ const _hoisted_1$l = {
|
|
|
319
319
|
]),
|
|
320
320
|
_: 1
|
|
321
321
|
})) : (openBlock(), createElementBlock("div", _hoisted_11$2, [
|
|
322
|
-
createElementVNode("div", _hoisted_12$1, toDisplayString(
|
|
322
|
+
createElementVNode("div", _hoisted_12$1, toDisplayString(l.value ? "No categories found matching your search." : "No categories available."), 1)
|
|
323
323
|
]))
|
|
324
324
|
]),
|
|
325
325
|
createElementVNode("div", _hoisted_13$1, [
|
|
326
|
-
createVNode(
|
|
326
|
+
createVNode(b, {
|
|
327
327
|
variant: "secondary",
|
|
328
328
|
label: "Cancel",
|
|
329
|
-
onClick:
|
|
329
|
+
onClick: p
|
|
330
330
|
}),
|
|
331
|
-
createVNode(
|
|
331
|
+
createVNode(b, {
|
|
332
332
|
variant: "primary",
|
|
333
|
-
label: `Confirm Selection (${
|
|
334
|
-
disabled:
|
|
335
|
-
onClick:
|
|
333
|
+
label: `Confirm Selection (${r.value})`,
|
|
334
|
+
disabled: r.value === 0,
|
|
335
|
+
onClick: k
|
|
336
336
|
}, null, 8, ["label", "disabled"])
|
|
337
337
|
])
|
|
338
338
|
])) : createCommentVNode("", !0);
|
|
@@ -341,7 +341,7 @@ const _hoisted_1$l = {
|
|
|
341
341
|
}), _hoisted_1$j = { class: "space-y-8" }, _hoisted_2$f = {
|
|
342
342
|
key: 1,
|
|
343
343
|
class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
|
|
344
|
-
}, _hoisted_3$c = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$
|
|
344
|
+
}, _hoisted_3$c = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$b = { class: "text-fm-color-typo-secondary" }, _hoisted_5$8 = { key: 0 }, _hoisted_6$4 = { class: "space-y-24" }, _hoisted_7$4 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$3 = { key: 0 }, _hoisted_9$3 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$3 = { key: 1 }, _hoisted_11$1 = { key: 2 }, _hoisted_12 = { key: 0 }, _hoisted_13 = { class: "space-y-8" }, _hoisted_14 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_15 = { class: "flex items-center gap-8" }, _hoisted_16 = { class: "fm-typo-en-body-md-400" }, _hoisted_17 = { key: 3 }, _hoisted_18 = { key: 0 }, _hoisted_19 = { class: "space-y-8" }, _hoisted_20 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_21 = { class: "flex items-center gap-8" }, _hoisted_22 = { class: "fm-typo-en-body-md-400" }, _hoisted_23 = {
|
|
345
345
|
key: 0,
|
|
346
346
|
class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
|
|
347
347
|
}, _hoisted_24 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25 = { class: "space-y-4" }, _hoisted_26 = { class: "flex gap-16" }, _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
@@ -350,8 +350,8 @@ const _hoisted_1$l = {
|
|
|
350
350
|
modelValue: { type: Object }
|
|
351
351
|
},
|
|
352
352
|
emits: ["update:model-value"],
|
|
353
|
-
setup(e, { emit:
|
|
354
|
-
const
|
|
353
|
+
setup(e, { emit: m }) {
|
|
354
|
+
const a = e, d = m, i = Cb(), s = ref(!1), l = ref(!1), o = ref(!1), n = ref({
|
|
355
355
|
type: "net",
|
|
356
356
|
value: 0,
|
|
357
357
|
scope: {
|
|
@@ -359,72 +359,72 @@ const _hoisted_1$l = {
|
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
361
|
watch(
|
|
362
|
-
() =>
|
|
363
|
-
(
|
|
364
|
-
|
|
362
|
+
() => a.modelValue,
|
|
363
|
+
(g) => {
|
|
364
|
+
g && (n.value = { ...g });
|
|
365
365
|
},
|
|
366
366
|
{ immediate: !0 }
|
|
367
367
|
), onMounted(async () => {
|
|
368
|
-
await
|
|
368
|
+
await i.store.getMenu();
|
|
369
369
|
});
|
|
370
|
-
const
|
|
371
|
-
var
|
|
372
|
-
return !(!
|
|
370
|
+
const r = computed(() => {
|
|
371
|
+
var g;
|
|
372
|
+
return !(!n.value.type || !((g = n.value.scope) != null && g.type) || h(n.value.type) && (!n.value.value || n.value.value <= 0) || (n.value.scope.type === "items" || n.value.scope.type === "category") && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0));
|
|
373
373
|
});
|
|
374
|
-
async function
|
|
375
|
-
|
|
374
|
+
async function y(g) {
|
|
375
|
+
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && d("update:model-value", null);
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
var
|
|
379
|
-
return B(((
|
|
377
|
+
function v() {
|
|
378
|
+
var g;
|
|
379
|
+
return B(((g = n.value.scope) == null ? void 0 : g.type) || "order");
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
return
|
|
381
|
+
function h(g) {
|
|
382
|
+
return g && !["freeItem", "delivery"].includes(g);
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
return
|
|
386
|
-
|
|
384
|
+
function x(g) {
|
|
385
|
+
return g && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
|
|
386
|
+
g
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
return
|
|
389
|
+
function k(g) {
|
|
390
|
+
return g != null && g.includes("Percentage") ? "Discount percentage" : g != null && g.includes("FixPrice") ? "Bundle fixed price" : g === "percentage" ? "Discount percentage" : "Discount amount";
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
return
|
|
392
|
+
function p(g) {
|
|
393
|
+
return g != null && g.includes("Percentage") || g === "percentage" ? "10" : "5.00";
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
return
|
|
395
|
+
function u(g) {
|
|
396
|
+
return g != null && g.includes("Percentage") || g === "percentage" ? "%" : "$";
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
|
|
400
|
-
...
|
|
401
|
-
[
|
|
398
|
+
function c(g, V) {
|
|
399
|
+
n.value = {
|
|
400
|
+
...n.value,
|
|
401
|
+
[g]: V
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
function f(
|
|
405
|
-
var
|
|
404
|
+
function f(g, V) {
|
|
405
|
+
var D;
|
|
406
406
|
const w = {
|
|
407
|
-
...
|
|
408
|
-
[
|
|
407
|
+
...n.value.scope,
|
|
408
|
+
[g]: V
|
|
409
409
|
};
|
|
410
|
-
if (
|
|
411
|
-
...
|
|
410
|
+
if (n.value = {
|
|
411
|
+
...n.value,
|
|
412
412
|
scope: w
|
|
413
|
-
},
|
|
414
|
-
const F = B(
|
|
413
|
+
}, g === "type") {
|
|
414
|
+
const F = B(V);
|
|
415
415
|
F.some(
|
|
416
|
-
(
|
|
417
|
-
) || (
|
|
418
|
-
...
|
|
419
|
-
type: ((
|
|
416
|
+
(P) => P.value === n.value.type
|
|
417
|
+
) || (n.value = {
|
|
418
|
+
...n.value,
|
|
419
|
+
type: ((D = F[0]) == null ? void 0 : D.value) || "net",
|
|
420
420
|
// Reset value and cap when changing to incompatible type
|
|
421
421
|
value: 0,
|
|
422
422
|
cap: void 0
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
function B(
|
|
427
|
-
switch (
|
|
426
|
+
function B(g) {
|
|
427
|
+
switch (g) {
|
|
428
428
|
case "order":
|
|
429
429
|
return [
|
|
430
430
|
{ label: "Amount off", value: "net" },
|
|
@@ -470,8 +470,8 @@ const _hoisted_1$l = {
|
|
|
470
470
|
];
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
switch (
|
|
473
|
+
function b(g) {
|
|
474
|
+
switch (g) {
|
|
475
475
|
case "order":
|
|
476
476
|
return "Applies to entire order. Available: Amount off, Percentage off, Delivery fee discount.";
|
|
477
477
|
case "category":
|
|
@@ -483,95 +483,95 @@ const _hoisted_1$l = {
|
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
function E() {
|
|
486
|
-
var
|
|
487
|
-
return ((
|
|
486
|
+
var g;
|
|
487
|
+
return ((g = n.value.scope) == null ? void 0 : g.type) === "items";
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
var
|
|
491
|
-
return ((
|
|
489
|
+
function N() {
|
|
490
|
+
var g;
|
|
491
|
+
return ((g = n.value.scope) == null ? void 0 : g.type) === "category";
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function C() {
|
|
494
494
|
var w;
|
|
495
|
-
const
|
|
496
|
-
if (!
|
|
495
|
+
const g = (w = n.value.scope) == null ? void 0 : w.objectIDs;
|
|
496
|
+
if (!g || g.length === 0)
|
|
497
497
|
return "No items selected";
|
|
498
|
-
const
|
|
499
|
-
return
|
|
500
|
-
const
|
|
501
|
-
return
|
|
502
|
-
}).join(", ") :
|
|
498
|
+
const V = i.menu.value;
|
|
499
|
+
return V && g.length <= 3 ? g.map((F) => {
|
|
500
|
+
const T = V.modules.item.find((P) => P._id === F);
|
|
501
|
+
return T ? (T.name2 || T.name).trim() : `Item ${F}`;
|
|
502
|
+
}).join(", ") : g.length === 1 ? "1 item selected" : `${g.length} items selected`;
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function R() {
|
|
505
505
|
var w;
|
|
506
|
-
const
|
|
507
|
-
if (!
|
|
506
|
+
const g = (w = n.value.scope) == null ? void 0 : w.objectIDs;
|
|
507
|
+
if (!g || g.length === 0)
|
|
508
508
|
return "No categories selected";
|
|
509
|
-
const
|
|
510
|
-
return
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
}).join(", ") :
|
|
509
|
+
const V = i.menu.value;
|
|
510
|
+
return V && g.length <= 3 ? g.map((F) => {
|
|
511
|
+
const T = V.modules.category.find((P) => P._id === F);
|
|
512
|
+
return T ? T.name : `Category ${F}`;
|
|
513
|
+
}).join(", ") : g.length === 1 ? "1 category selected" : `${g.length} categories selected`;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
|
|
515
|
+
function S() {
|
|
516
|
+
l.value = !0;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
|
|
518
|
+
function $() {
|
|
519
|
+
o.value = !0;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
f("objectIDs",
|
|
521
|
+
function H(g) {
|
|
522
|
+
f("objectIDs", g), l.value = !1;
|
|
523
523
|
}
|
|
524
|
-
function j(
|
|
525
|
-
f("objectIDs",
|
|
524
|
+
function j(g) {
|
|
525
|
+
f("objectIDs", g), o.value = !1;
|
|
526
526
|
}
|
|
527
527
|
function Y() {
|
|
528
|
-
|
|
528
|
+
l.value = !1;
|
|
529
529
|
}
|
|
530
530
|
function G() {
|
|
531
|
-
|
|
531
|
+
o.value = !1;
|
|
532
532
|
}
|
|
533
|
-
const
|
|
534
|
-
var
|
|
535
|
-
const
|
|
536
|
-
return
|
|
533
|
+
const M = computed(() => {
|
|
534
|
+
var V, w, D;
|
|
535
|
+
const g = [];
|
|
536
|
+
return n.value.type || g.push("Discount type is required"), (V = n.value.scope) != null && V.type || g.push("Scope type is required"), h(n.value.type) && (!n.value.value || n.value.value <= 0) && g.push("Discount amount must be greater than 0"), ((w = n.value.scope) == null ? void 0 : w.type) === "items" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one item"), ((D = n.value.scope) == null ? void 0 : D.type) === "category" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one category"), g;
|
|
537
537
|
});
|
|
538
538
|
function Z() {
|
|
539
|
-
|
|
539
|
+
d("update:model-value", n.value), s.value = !1;
|
|
540
540
|
}
|
|
541
541
|
const q = [
|
|
542
542
|
{ label: "Bill discount", value: "order" },
|
|
543
543
|
{ label: "Item discount", value: "items" },
|
|
544
544
|
{ label: "Category discount", value: "category" }
|
|
545
545
|
];
|
|
546
|
-
return (
|
|
547
|
-
const w = resolveComponent("FmButton"),
|
|
548
|
-
return openBlock(), createBlock(
|
|
546
|
+
return (g, V) => {
|
|
547
|
+
const w = resolveComponent("FmButton"), D = resolveComponent("FmSelect"), F = resolveComponent("FmStepperField"), T = resolveComponent("FmIcon"), P = resolveComponent("FmSideSheet");
|
|
548
|
+
return openBlock(), createBlock(P, {
|
|
549
549
|
"max-width": 550,
|
|
550
550
|
header: "Apply discount",
|
|
551
|
-
modelValue: unref(
|
|
551
|
+
modelValue: unref(s),
|
|
552
552
|
"onUpdate:modelValue": [
|
|
553
|
-
|
|
554
|
-
|
|
553
|
+
V[5] || (V[5] = (O) => isRef(s) ? s.value = O : null),
|
|
554
|
+
V[6] || (V[6] = (O) => s.value = O)
|
|
555
555
|
]
|
|
556
556
|
}, {
|
|
557
557
|
"side-sheet-button": withCtx(() => {
|
|
558
|
-
var
|
|
558
|
+
var O, U, A, L;
|
|
559
559
|
return [
|
|
560
560
|
createElementVNode("div", _hoisted_1$j, [
|
|
561
|
-
|
|
561
|
+
V[7] || (V[7] = createElementVNode("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the Grab campaign discount you want to offer your customers. ", -1)),
|
|
562
562
|
e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
|
|
563
563
|
createElementVNode("div", _hoisted_3$c, [
|
|
564
|
-
createElementVNode("div", null, toDisplayString((
|
|
565
|
-
createElementVNode("div", _hoisted_4$
|
|
566
|
-
createTextVNode(toDisplayString((
|
|
567
|
-
(A = unref(summarizeGrabDiscount)(e.modelValue)) != null && A.cap ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
564
|
+
createElementVNode("div", null, toDisplayString((O = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : O.type), 1),
|
|
565
|
+
createElementVNode("div", _hoisted_4$b, [
|
|
566
|
+
createTextVNode(toDisplayString((U = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : U.adjustment) + " ", 1),
|
|
567
|
+
(A = unref(summarizeGrabDiscount)(e.modelValue)) != null && A.cap ? (openBlock(), createElementBlock("span", _hoisted_5$8, toDisplayString((L = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : L.cap), 1)) : createCommentVNode("", !0)
|
|
568
568
|
])
|
|
569
569
|
]),
|
|
570
570
|
createVNode(w, {
|
|
571
571
|
icon: "delete",
|
|
572
572
|
"icon-color": "neutral-gray-400",
|
|
573
573
|
variant: "tertiary",
|
|
574
|
-
onClick:
|
|
574
|
+
onClick: y
|
|
575
575
|
})
|
|
576
576
|
])) : (openBlock(), createBlock(w, {
|
|
577
577
|
key: 0,
|
|
@@ -590,130 +590,130 @@ const _hoisted_1$l = {
|
|
|
590
590
|
variant: "secondary",
|
|
591
591
|
label: "Cancel",
|
|
592
592
|
class: "flex-1",
|
|
593
|
-
onClick:
|
|
593
|
+
onClick: V[4] || (V[4] = (O) => s.value = !1)
|
|
594
594
|
}),
|
|
595
595
|
createVNode(w, {
|
|
596
596
|
variant: "primary",
|
|
597
|
-
label: unref(
|
|
597
|
+
label: unref(r) ? "Confirm" : "Complete Required Fields",
|
|
598
598
|
class: "flex-1",
|
|
599
|
-
disabled: !unref(
|
|
599
|
+
disabled: !unref(r),
|
|
600
600
|
onClick: Z
|
|
601
601
|
}, null, 8, ["label", "disabled"])
|
|
602
602
|
])
|
|
603
603
|
]),
|
|
604
604
|
default: withCtx(() => {
|
|
605
|
-
var
|
|
605
|
+
var O, U, A, L;
|
|
606
606
|
return [
|
|
607
607
|
createElementVNode("div", _hoisted_6$4, [
|
|
608
608
|
createElementVNode("div", null, [
|
|
609
|
-
|
|
610
|
-
createVNode(
|
|
611
|
-
"model-value": ((
|
|
612
|
-
"onUpdate:modelValue":
|
|
609
|
+
V[8] || (V[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
|
|
610
|
+
createVNode(D, {
|
|
611
|
+
"model-value": ((O = unref(n).scope) == null ? void 0 : O.type) || "order",
|
|
612
|
+
"onUpdate:modelValue": V[0] || (V[0] = (I) => f("type", I)),
|
|
613
613
|
placeholder: "Select campaign type",
|
|
614
614
|
items: q
|
|
615
615
|
}, null, 8, ["model-value"]),
|
|
616
|
-
createElementVNode("div", _hoisted_7$
|
|
616
|
+
createElementVNode("div", _hoisted_7$4, toDisplayString(b((U = unref(n).scope) == null ? void 0 : U.type)), 1)
|
|
617
617
|
]),
|
|
618
618
|
createElementVNode("div", null, [
|
|
619
|
-
|
|
620
|
-
createVNode(
|
|
621
|
-
"model-value": unref(
|
|
622
|
-
"onUpdate:modelValue":
|
|
619
|
+
V[9] || (V[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
|
|
620
|
+
createVNode(D, {
|
|
621
|
+
"model-value": unref(n).type,
|
|
622
|
+
"onUpdate:modelValue": V[1] || (V[1] = (I) => c("type", I)),
|
|
623
623
|
placeholder: "Select discount type",
|
|
624
|
-
items:
|
|
624
|
+
items: v()
|
|
625
625
|
}, null, 8, ["model-value", "items"])
|
|
626
626
|
]),
|
|
627
|
-
|
|
628
|
-
createElementVNode("label", _hoisted_9$
|
|
627
|
+
h(unref(n).type) ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
|
|
628
|
+
createElementVNode("label", _hoisted_9$3, toDisplayString(k(unref(n).type)), 1),
|
|
629
629
|
createVNode(F, {
|
|
630
|
-
modelValue: unref(
|
|
631
|
-
"onUpdate:modelValue":
|
|
632
|
-
placeholder:
|
|
633
|
-
suffix:
|
|
630
|
+
modelValue: unref(n).value,
|
|
631
|
+
"onUpdate:modelValue": V[2] || (V[2] = (I) => unref(n).value = I),
|
|
632
|
+
placeholder: p(unref(n).type),
|
|
633
|
+
suffix: u(unref(n).type),
|
|
634
634
|
type: "number"
|
|
635
635
|
}, null, 8, ["modelValue", "placeholder", "suffix"])
|
|
636
636
|
])) : createCommentVNode("", !0),
|
|
637
|
-
|
|
638
|
-
|
|
637
|
+
x(unref(n).type) ? (openBlock(), createElementBlock("div", _hoisted_10$3, [
|
|
638
|
+
V[10] || (V[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
|
|
639
639
|
createVNode(F, {
|
|
640
|
-
modelValue: unref(
|
|
641
|
-
"onUpdate:modelValue":
|
|
640
|
+
modelValue: unref(n).cap,
|
|
641
|
+
"onUpdate:modelValue": V[3] || (V[3] = (I) => unref(n).cap = I),
|
|
642
642
|
placeholder: "Maximum discount amount",
|
|
643
643
|
type: "number"
|
|
644
644
|
}, null, 8, ["modelValue"])
|
|
645
645
|
])) : createCommentVNode("", !0),
|
|
646
646
|
E() ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
|
|
647
|
-
unref(
|
|
648
|
-
|
|
647
|
+
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
648
|
+
V[12] || (V[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
|
|
649
649
|
createElementVNode("div", _hoisted_13, [
|
|
650
650
|
createElementVNode("div", _hoisted_14, [
|
|
651
651
|
createElementVNode("div", _hoisted_15, [
|
|
652
|
-
createVNode(
|
|
652
|
+
createVNode(T, {
|
|
653
653
|
name: "restaurant",
|
|
654
654
|
size: "md"
|
|
655
655
|
}),
|
|
656
|
-
createElementVNode("span", _hoisted_16, toDisplayString(
|
|
656
|
+
createElementVNode("span", _hoisted_16, toDisplayString(C()), 1)
|
|
657
657
|
]),
|
|
658
658
|
createVNode(w, {
|
|
659
659
|
variant: "secondary",
|
|
660
660
|
label: "Select Items",
|
|
661
661
|
icon: "chevron_right",
|
|
662
|
-
onClick:
|
|
662
|
+
onClick: S
|
|
663
663
|
})
|
|
664
664
|
]),
|
|
665
|
-
|
|
665
|
+
V[11] || (V[11] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. Bundle discounts require multiple items. ", -1))
|
|
666
666
|
])
|
|
667
667
|
])),
|
|
668
668
|
createVNode(_sfc_main$n, {
|
|
669
|
-
visible: unref(
|
|
670
|
-
"initial-value": ((A = unref(
|
|
671
|
-
onConfirm:
|
|
669
|
+
visible: unref(l),
|
|
670
|
+
"initial-value": ((A = unref(n).scope) == null ? void 0 : A.objectIDs) || [],
|
|
671
|
+
onConfirm: H,
|
|
672
672
|
onCancel: Y
|
|
673
673
|
}, null, 8, ["visible", "initial-value"])
|
|
674
674
|
])) : createCommentVNode("", !0),
|
|
675
|
-
|
|
676
|
-
unref(
|
|
677
|
-
|
|
675
|
+
N() ? (openBlock(), createElementBlock("div", _hoisted_17, [
|
|
676
|
+
unref(o) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18, [
|
|
677
|
+
V[14] || (V[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
|
|
678
678
|
createElementVNode("div", _hoisted_19, [
|
|
679
679
|
createElementVNode("div", _hoisted_20, [
|
|
680
680
|
createElementVNode("div", _hoisted_21, [
|
|
681
|
-
createVNode(
|
|
681
|
+
createVNode(T, {
|
|
682
682
|
name: "category",
|
|
683
683
|
size: "md"
|
|
684
684
|
}),
|
|
685
|
-
createElementVNode("span", _hoisted_22, toDisplayString(
|
|
685
|
+
createElementVNode("span", _hoisted_22, toDisplayString(R()), 1)
|
|
686
686
|
]),
|
|
687
687
|
createVNode(w, {
|
|
688
688
|
variant: "secondary",
|
|
689
689
|
label: "Select Categories",
|
|
690
690
|
icon: "chevron_right",
|
|
691
|
-
onClick:
|
|
691
|
+
onClick: $
|
|
692
692
|
})
|
|
693
693
|
]),
|
|
694
|
-
|
|
694
|
+
V[13] || (V[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
|
|
695
695
|
])
|
|
696
696
|
])),
|
|
697
697
|
createVNode(_sfc_main$m, {
|
|
698
|
-
visible: unref(
|
|
699
|
-
"initial-value": ((L = unref(
|
|
698
|
+
visible: unref(o),
|
|
699
|
+
"initial-value": ((L = unref(n).scope) == null ? void 0 : L.objectIDs) || [],
|
|
700
700
|
onConfirm: j,
|
|
701
701
|
onCancel: G
|
|
702
702
|
}, null, 8, ["visible", "initial-value"])
|
|
703
703
|
])) : createCommentVNode("", !0)
|
|
704
704
|
]),
|
|
705
|
-
unref(
|
|
705
|
+
unref(M).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
706
706
|
createElementVNode("div", _hoisted_24, [
|
|
707
|
-
createVNode(
|
|
708
|
-
|
|
707
|
+
createVNode(T, { name: "warning" }),
|
|
708
|
+
V[15] || (V[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
|
|
709
709
|
]),
|
|
710
710
|
createElementVNode("ul", _hoisted_25, [
|
|
711
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
712
|
-
key:
|
|
711
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(M), (I) => (openBlock(), createElementBlock("li", {
|
|
712
|
+
key: I,
|
|
713
713
|
class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
|
|
714
714
|
}, [
|
|
715
|
-
|
|
716
|
-
createTextVNode(" " + toDisplayString(
|
|
715
|
+
V[16] || (V[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
|
|
716
|
+
createTextVNode(" " + toDisplayString(I), 1)
|
|
717
717
|
]))), 128))
|
|
718
718
|
])
|
|
719
719
|
])) : createCommentVNode("", !0)
|
|
@@ -733,83 +733,83 @@ const _hoisted_1$l = {
|
|
|
733
733
|
}
|
|
734
734
|
},
|
|
735
735
|
emits: ["update:model-value"],
|
|
736
|
-
setup(e, { emit:
|
|
737
|
-
const { t:
|
|
738
|
-
!
|
|
736
|
+
setup(e, { emit: m }) {
|
|
737
|
+
const { t: a } = useI18n(), d = e, i = m, s = ref(
|
|
738
|
+
!d.modelValue || !d.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(d.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
739
739
|
);
|
|
740
|
-
watch(
|
|
741
|
-
var
|
|
742
|
-
if (
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
740
|
+
watch(s, async (o, n) => {
|
|
741
|
+
var r;
|
|
742
|
+
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r = d.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
|
|
743
|
+
const y = await prompt.confirm(
|
|
744
|
+
a("connect.template.rule.time.confirm_remove"),
|
|
745
|
+
a("connect.common.confirm"),
|
|
746
|
+
a("connect.common.confirm"),
|
|
747
|
+
a("connect.common.cancel")
|
|
748
748
|
);
|
|
749
|
-
|
|
749
|
+
y && i(
|
|
750
750
|
"update:model-value",
|
|
751
751
|
RuleBuilder.setRuleToGroup(
|
|
752
|
-
|
|
752
|
+
d.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
753
753
|
RuleBuilder.scaffoldGroup("g_time")
|
|
754
754
|
)
|
|
755
|
-
),
|
|
755
|
+
), s.value = y ? o : n;
|
|
756
756
|
}
|
|
757
757
|
});
|
|
758
|
-
async function o
|
|
759
|
-
var
|
|
760
|
-
if (
|
|
758
|
+
async function l(o) {
|
|
759
|
+
var n;
|
|
760
|
+
if (o == "custom" && RuleBuilder.getRules((n = d.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
761
761
|
if (!await prompt.confirm(
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
762
|
+
a("connect.template.rule.time.confirm_remove"),
|
|
763
|
+
a("connect.common.confirm"),
|
|
764
|
+
a("connect.common.confirm"),
|
|
765
|
+
a("connect.common.cancel")
|
|
766
766
|
)) {
|
|
767
|
-
|
|
767
|
+
s.value = "all_time";
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
|
-
|
|
770
|
+
i(
|
|
771
771
|
"update:model-value",
|
|
772
772
|
RuleBuilder.setRuleToGroup(
|
|
773
|
-
|
|
773
|
+
d.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
774
774
|
RuleBuilder.scaffoldGroup("g_time")
|
|
775
775
|
)
|
|
776
776
|
);
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
|
-
return (
|
|
780
|
-
var
|
|
781
|
-
const
|
|
779
|
+
return (o, n) => {
|
|
780
|
+
var v;
|
|
781
|
+
const r = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
|
|
782
782
|
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
783
|
-
createVNode(
|
|
784
|
-
modelValue: unref(
|
|
783
|
+
createVNode(y, {
|
|
784
|
+
modelValue: unref(s),
|
|
785
785
|
"onUpdate:modelValue": [
|
|
786
|
-
|
|
787
|
-
|
|
786
|
+
n[0] || (n[0] = (h) => isRef(s) ? s.value = h : null),
|
|
787
|
+
n[1] || (n[1] = (h) => l(h))
|
|
788
788
|
]
|
|
789
789
|
}, {
|
|
790
790
|
default: withCtx(() => [
|
|
791
|
-
createVNode(
|
|
792
|
-
label: unref(
|
|
791
|
+
createVNode(r, {
|
|
792
|
+
label: unref(a)("connect.template.rule.time.all_time"),
|
|
793
793
|
value: "all_time"
|
|
794
794
|
}, null, 8, ["label"]),
|
|
795
|
-
createVNode(
|
|
796
|
-
label: unref(
|
|
795
|
+
createVNode(r, {
|
|
796
|
+
label: unref(a)("connect.template.rule.time.custom"),
|
|
797
797
|
value: "custom"
|
|
798
798
|
}, null, 8, ["label"])
|
|
799
799
|
]),
|
|
800
800
|
_: 1
|
|
801
801
|
}, 8, ["modelValue"]),
|
|
802
|
-
unref(
|
|
802
|
+
unref(s) == "custom" ? (openBlock(), createBlock(_sfc_main$p, {
|
|
803
803
|
key: 0,
|
|
804
804
|
class: "!mt-[0px]",
|
|
805
805
|
"include-only": "trigger",
|
|
806
806
|
"trigger-type": "SCHEDULE",
|
|
807
|
-
"model-value": ((
|
|
808
|
-
"onUpdate:modelValue":
|
|
807
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
808
|
+
"onUpdate:modelValue": n[2] || (n[2] = (h) => i(
|
|
809
809
|
"update:model-value",
|
|
810
810
|
unref(RuleBuilder).setRuleToGroup(
|
|
811
811
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
812
|
-
|
|
812
|
+
h,
|
|
813
813
|
"&&"
|
|
814
814
|
)
|
|
815
815
|
))
|
|
@@ -825,27 +825,27 @@ const _hoisted_1$l = {
|
|
|
825
825
|
}
|
|
826
826
|
},
|
|
827
827
|
emits: ["update:model-value"],
|
|
828
|
-
setup(e, { emit:
|
|
829
|
-
const
|
|
830
|
-
const { property:
|
|
831
|
-
|
|
828
|
+
setup(e, { emit: m }) {
|
|
829
|
+
const { t: a } = useI18n(), d = e, i = m, s = computed(() => {
|
|
830
|
+
const { property: l, operator: o, equator: n } = RuleBuilder.simplify(
|
|
831
|
+
d.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
832
832
|
op: "before",
|
|
833
833
|
x: 1
|
|
834
834
|
})
|
|
835
835
|
);
|
|
836
836
|
return {
|
|
837
|
-
property:
|
|
837
|
+
property: l,
|
|
838
838
|
operator: o,
|
|
839
839
|
equator: n
|
|
840
840
|
};
|
|
841
841
|
});
|
|
842
|
-
return (
|
|
843
|
-
const n = resolveComponent("FmRadio"),
|
|
842
|
+
return (l, o) => {
|
|
843
|
+
const n = resolveComponent("FmRadio"), r = resolveComponent("FmStepperField");
|
|
844
844
|
return openBlock(), createElementBlock("div", null, [
|
|
845
845
|
createVNode(n, {
|
|
846
|
-
label: "
|
|
846
|
+
label: unref(a)("connect.template.rule.birthday.on_birthday"),
|
|
847
847
|
value: "_isRange-day",
|
|
848
|
-
"model-value": `${unref(
|
|
848
|
+
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
849
849
|
"onUpdate:modelValue": o[0] || (o[0] = () => {
|
|
850
850
|
i(
|
|
851
851
|
"update:model-value",
|
|
@@ -856,11 +856,11 @@ const _hoisted_1$l = {
|
|
|
856
856
|
})
|
|
857
857
|
);
|
|
858
858
|
})
|
|
859
|
-
}, null, 8, ["model-value"]),
|
|
859
|
+
}, null, 8, ["label", "model-value"]),
|
|
860
860
|
createVNode(n, {
|
|
861
|
-
label: "
|
|
861
|
+
label: unref(a)("connect.template.rule.birthday.days_before"),
|
|
862
862
|
value: "_isDay",
|
|
863
|
-
"model-value": unref(
|
|
863
|
+
"model-value": unref(s).operator,
|
|
864
864
|
"onUpdate:modelValue": o[1] || (o[1] = () => {
|
|
865
865
|
i(
|
|
866
866
|
"update:model-value",
|
|
@@ -871,25 +871,25 @@ const _hoisted_1$l = {
|
|
|
871
871
|
})
|
|
872
872
|
);
|
|
873
873
|
})
|
|
874
|
-
}, null, 8, ["model-value"]),
|
|
875
|
-
unref(
|
|
874
|
+
}, null, 8, ["label", "model-value"]),
|
|
875
|
+
unref(s).operator == "_isDay" ? (openBlock(), createBlock(r, {
|
|
876
876
|
key: 0,
|
|
877
|
-
label: "
|
|
877
|
+
label: unref(a)("connect.template.rule.birthday.days_before_label"),
|
|
878
878
|
"show-steppers": !1,
|
|
879
|
-
"model-value": unref(
|
|
880
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
879
|
+
"model-value": unref(s).equator.x,
|
|
880
|
+
"onUpdate:modelValue": o[2] || (o[2] = (y) => i(
|
|
881
881
|
"update:model-value",
|
|
882
882
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
883
883
|
op: "after",
|
|
884
|
-
x:
|
|
884
|
+
x: y,
|
|
885
885
|
ignoreYear: !0
|
|
886
886
|
})
|
|
887
887
|
))
|
|
888
|
-
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
888
|
+
}, null, 8, ["label", "model-value"])) : createCommentVNode("", !0),
|
|
889
889
|
createVNode(n, {
|
|
890
|
-
label: "
|
|
890
|
+
label: unref(a)("connect.template.rule.birthday.in_birthday_week"),
|
|
891
891
|
value: "_isRange-week",
|
|
892
|
-
"model-value": `${unref(
|
|
892
|
+
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
893
893
|
"onUpdate:modelValue": o[3] || (o[3] = () => {
|
|
894
894
|
i(
|
|
895
895
|
"update:model-value",
|
|
@@ -900,11 +900,11 @@ const _hoisted_1$l = {
|
|
|
900
900
|
})
|
|
901
901
|
);
|
|
902
902
|
})
|
|
903
|
-
}, null, 8, ["model-value"]),
|
|
903
|
+
}, null, 8, ["label", "model-value"]),
|
|
904
904
|
createVNode(n, {
|
|
905
|
-
label: "
|
|
905
|
+
label: unref(a)("connect.template.rule.birthday.in_birthday_month"),
|
|
906
906
|
value: "_isRange-month",
|
|
907
|
-
"model-value": `${unref(
|
|
907
|
+
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
908
908
|
"onUpdate:modelValue": o[4] || (o[4] = () => {
|
|
909
909
|
i(
|
|
910
910
|
"update:model-value",
|
|
@@ -915,11 +915,11 @@ const _hoisted_1$l = {
|
|
|
915
915
|
})
|
|
916
916
|
);
|
|
917
917
|
})
|
|
918
|
-
}, null, 8, ["model-value"])
|
|
918
|
+
}, null, 8, ["label", "model-value"])
|
|
919
919
|
]);
|
|
920
920
|
};
|
|
921
921
|
}
|
|
922
|
-
}), _hoisted_1$h = { class: "space-y-16" }, _hoisted_2$e = { class: "grid grid-cols-3 gap-16" },
|
|
922
|
+
}), _hoisted_1$h = { class: "space-y-16" }, _hoisted_2$e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$b = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$a = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
923
923
|
__name: "CampaignTriggerInput",
|
|
924
924
|
props: {
|
|
925
925
|
campaignType: {
|
|
@@ -935,31 +935,31 @@ const _hoisted_1$l = {
|
|
|
935
935
|
}
|
|
936
936
|
},
|
|
937
937
|
emits: ["update:model-value"],
|
|
938
|
-
setup(e, { emit:
|
|
939
|
-
const
|
|
940
|
-
(
|
|
941
|
-
) : TypeToTriggerOptions[
|
|
942
|
-
return (
|
|
938
|
+
setup(e, { emit: m }) {
|
|
939
|
+
const { t: a } = useI18n(), d = e, i = m, s = computed(() => d.disabled ? TypeToTriggerOptions[d.campaignType].filter(
|
|
940
|
+
(l) => l.value == d.modelValue
|
|
941
|
+
) : TypeToTriggerOptions[d.campaignType]);
|
|
942
|
+
return (l, o) => {
|
|
943
943
|
const n = resolveComponent("FmCard");
|
|
944
944
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
945
|
-
|
|
946
|
-
createElementVNode("div",
|
|
947
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
945
|
+
createElementVNode("div", _hoisted_2$e, toDisplayString(unref(a)("connect.campaign.trigger.description")), 1),
|
|
946
|
+
createElementVNode("div", _hoisted_3$b, [
|
|
947
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
|
|
948
948
|
variant: "outlined",
|
|
949
|
-
disabled:
|
|
949
|
+
disabled: d.disabled,
|
|
950
950
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
951
|
-
"col-span-3": unref(
|
|
952
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
953
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
951
|
+
"col-span-3": unref(s).length == 1,
|
|
952
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
953
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
954
954
|
}]),
|
|
955
955
|
onClick: () => {
|
|
956
|
-
|
|
956
|
+
d.modelValue != r.value && !d.disabled && i("update:model-value", r.value);
|
|
957
957
|
},
|
|
958
|
-
key:
|
|
958
|
+
key: r.name
|
|
959
959
|
}, {
|
|
960
960
|
default: withCtx(() => [
|
|
961
|
-
createElementVNode("div",
|
|
962
|
-
createElementVNode("div",
|
|
961
|
+
createElementVNode("div", _hoisted_4$a, toDisplayString(r.name), 1),
|
|
962
|
+
createElementVNode("div", _hoisted_5$7, toDisplayString(r.description), 1)
|
|
963
963
|
]),
|
|
964
964
|
_: 2
|
|
965
965
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -980,27 +980,27 @@ const _hoisted_1$l = {
|
|
|
980
980
|
}
|
|
981
981
|
},
|
|
982
982
|
emits: ["update:model-value"],
|
|
983
|
-
setup(e, { emit:
|
|
984
|
-
const
|
|
985
|
-
return (
|
|
986
|
-
const
|
|
987
|
-
return openBlock(), createBlock(
|
|
983
|
+
setup(e, { emit: m }) {
|
|
984
|
+
const a = m;
|
|
985
|
+
return (d, i) => {
|
|
986
|
+
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
|
|
987
|
+
return openBlock(), createBlock(o, {
|
|
988
988
|
label: e.label,
|
|
989
989
|
"model-value": e.modelValue || "",
|
|
990
|
-
"onUpdate:modelValue":
|
|
990
|
+
"onUpdate:modelValue": i[1] || (i[1] = (n) => a("update:model-value", n))
|
|
991
991
|
}, {
|
|
992
|
-
"trigger-button": withCtx(({ opened:
|
|
993
|
-
createVNode(
|
|
992
|
+
"trigger-button": withCtx(({ opened: n }) => [
|
|
993
|
+
createVNode(l, {
|
|
994
994
|
class: "flex items-center",
|
|
995
995
|
"prepend-icon": "calendar_month",
|
|
996
|
-
"icon-outlined": !
|
|
996
|
+
"icon-outlined": !n
|
|
997
997
|
}, {
|
|
998
998
|
append: withCtx(() => [
|
|
999
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
999
|
+
e.modelValue ? (openBlock(), createBlock(s, {
|
|
1000
1000
|
key: 0,
|
|
1001
1001
|
variant: "tertiary",
|
|
1002
1002
|
icon: "clear",
|
|
1003
|
-
onClick:
|
|
1003
|
+
onClick: i[0] || (i[0] = (r) => (r.stopPropagation(), a("update:model-value", null)))
|
|
1004
1004
|
})) : createCommentVNode("", !0)
|
|
1005
1005
|
]),
|
|
1006
1006
|
default: withCtx(() => [
|
|
@@ -1015,7 +1015,7 @@ const _hoisted_1$l = {
|
|
|
1015
1015
|
}, 8, ["label", "model-value"]);
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
|
-
}), _hoisted_1$g = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$d = { class: "flex-1 xs:w-full" }, _hoisted_3$a = { class: "flex-1 xs:w-full" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1018
|
+
}), _hoisted_1$g = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$d = { class: "flex-1 xs:w-full" }, _hoisted_3$a = { class: "mt-5 xs:hidden" }, _hoisted_4$9 = { class: "flex-1 xs:w-full" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1019
1019
|
__name: "DateRangeInput",
|
|
1020
1020
|
props: {
|
|
1021
1021
|
modelValue: {
|
|
@@ -1024,37 +1024,37 @@ const _hoisted_1$l = {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
},
|
|
1026
1026
|
emits: ["update:model-value"],
|
|
1027
|
-
setup(e, { emit:
|
|
1028
|
-
const
|
|
1029
|
-
return (i,
|
|
1030
|
-
var
|
|
1027
|
+
setup(e, { emit: m }) {
|
|
1028
|
+
const { t: a } = useI18n(), d = m;
|
|
1029
|
+
return (i, s) => {
|
|
1030
|
+
var l, o;
|
|
1031
1031
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1032
1032
|
createElementVNode("div", _hoisted_2$d, [
|
|
1033
1033
|
createVNode(_sfc_main$h, {
|
|
1034
|
-
"model-value": ((
|
|
1035
|
-
label: "
|
|
1036
|
-
"onUpdate:modelValue":
|
|
1037
|
-
var
|
|
1038
|
-
return
|
|
1034
|
+
"model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
|
|
1035
|
+
label: unref(a)("connect.common.startDate"),
|
|
1036
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => {
|
|
1037
|
+
var r;
|
|
1038
|
+
return d("update:model-value", {
|
|
1039
1039
|
startDate: n,
|
|
1040
|
-
endDate: ((
|
|
1040
|
+
endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
|
|
1041
1041
|
});
|
|
1042
1042
|
})
|
|
1043
|
-
}, null, 8, ["model-value"])
|
|
1043
|
+
}, null, 8, ["model-value", "label"])
|
|
1044
1044
|
]),
|
|
1045
|
-
|
|
1046
|
-
createElementVNode("div",
|
|
1045
|
+
createElementVNode("div", _hoisted_3$a, toDisplayString(unref(a)("connect.common.to")), 1),
|
|
1046
|
+
createElementVNode("div", _hoisted_4$9, [
|
|
1047
1047
|
createVNode(_sfc_main$h, {
|
|
1048
1048
|
"model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
|
|
1049
|
-
label: "
|
|
1050
|
-
"onUpdate:modelValue":
|
|
1051
|
-
var
|
|
1052
|
-
return
|
|
1053
|
-
startDate: ((
|
|
1049
|
+
label: unref(a)("connect.common.endDate"),
|
|
1050
|
+
"onUpdate:modelValue": s[1] || (s[1] = (n) => {
|
|
1051
|
+
var r;
|
|
1052
|
+
return d("update:model-value", {
|
|
1053
|
+
startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
|
|
1054
1054
|
endDate: n
|
|
1055
1055
|
});
|
|
1056
1056
|
})
|
|
1057
|
-
}, null, 8, ["model-value"])
|
|
1057
|
+
}, null, 8, ["model-value", "label"])
|
|
1058
1058
|
])
|
|
1059
1059
|
]);
|
|
1060
1060
|
};
|
|
@@ -1062,7 +1062,7 @@ const _hoisted_1$l = {
|
|
|
1062
1062
|
}), _hoisted_1$f = { class: "space-y-8" }, _hoisted_2$c = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$9 = {
|
|
1063
1063
|
key: 0,
|
|
1064
1064
|
class: "space-y-4"
|
|
1065
|
-
}, _hoisted_4$
|
|
1065
|
+
}, _hoisted_4$8 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$6 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
1066
1066
|
__name: "ScheduleRuleInput",
|
|
1067
1067
|
props: {
|
|
1068
1068
|
modelValue: {
|
|
@@ -1077,36 +1077,39 @@ const _hoisted_1$l = {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
},
|
|
1079
1079
|
emits: ["update:model-value"],
|
|
1080
|
-
setup(e, { emit:
|
|
1081
|
-
const
|
|
1082
|
-
() => CountryTimezone[
|
|
1080
|
+
setup(e, { emit: m }) {
|
|
1081
|
+
const { t: a } = useI18n(), d = e, i = m, s = useCoreStore(), l = computed(
|
|
1082
|
+
() => CountryTimezone[s.currentCountry.value || "MY"]
|
|
1083
1083
|
);
|
|
1084
1084
|
function o() {
|
|
1085
|
-
const
|
|
1086
|
-
return
|
|
1087
|
-
(
|
|
1085
|
+
const p = RuleBuilder.getRules(d.modelValue);
|
|
1086
|
+
return p.length == 0 ? "fixed" : p.some(
|
|
1087
|
+
(u) => isRuleEntry(u) && RuleBuilder.simplify(u).operator == "_rrule"
|
|
1088
1088
|
) ? "repeating" : "fixed";
|
|
1089
1089
|
}
|
|
1090
|
-
const n = ref(o()),
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1090
|
+
const n = ref(o()), r = ref(!1), y = computed(() => [
|
|
1091
|
+
{ label: a("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
1092
|
+
{ label: a("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
1093
|
+
]), v = computed(() => {
|
|
1094
|
+
const p = RuleBuilder.getRules(d.modelValue), u = p.find(
|
|
1095
|
+
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.date"
|
|
1096
|
+
), c = p.find(
|
|
1097
|
+
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.time"
|
|
1095
1098
|
);
|
|
1096
1099
|
return {
|
|
1097
|
-
date:
|
|
1100
|
+
date: u ? RuleBuilder.simplify(u).equator : null,
|
|
1098
1101
|
time: c ? RuleBuilder.simplify(c).equator : null
|
|
1099
1102
|
};
|
|
1100
1103
|
}), h = computed(
|
|
1101
1104
|
() => calculateNextScheduleAt(
|
|
1102
|
-
|
|
1105
|
+
d.modelValue,
|
|
1103
1106
|
/* @__PURE__ */ new Date(),
|
|
1104
|
-
|
|
1105
|
-
|
|
1107
|
+
d.startDate ? new Date(d.startDate) : void 0,
|
|
1108
|
+
d.endDate ? new Date(d.endDate) : void 0
|
|
1106
1109
|
)
|
|
1107
1110
|
);
|
|
1108
|
-
function
|
|
1109
|
-
const
|
|
1111
|
+
function x(p) {
|
|
1112
|
+
const u = p.value, c = u == "fixed" ? [
|
|
1110
1113
|
RuleBuilder.constructEntry(
|
|
1111
1114
|
"trigger.date",
|
|
1112
1115
|
"_isOnDate",
|
|
@@ -1127,21 +1130,21 @@ const _hoisted_1$l = {
|
|
|
1127
1130
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1128
1131
|
c
|
|
1129
1132
|
)
|
|
1130
|
-
), n.value =
|
|
1133
|
+
), n.value = u;
|
|
1131
1134
|
}
|
|
1132
|
-
function
|
|
1135
|
+
function k(p) {
|
|
1133
1136
|
n.value == "fixed" ? i(
|
|
1134
1137
|
"update:model-value",
|
|
1135
1138
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
1136
1139
|
RuleBuilder.constructEntry(
|
|
1137
1140
|
"trigger.date",
|
|
1138
1141
|
"_isOnDate",
|
|
1139
|
-
|
|
1142
|
+
p.date
|
|
1140
1143
|
),
|
|
1141
1144
|
RuleBuilder.constructEntry(
|
|
1142
1145
|
"trigger.time",
|
|
1143
1146
|
"_isOnTime",
|
|
1144
|
-
|
|
1147
|
+
p.time
|
|
1145
1148
|
)
|
|
1146
1149
|
])
|
|
1147
1150
|
) : i(
|
|
@@ -1150,44 +1153,44 @@ const _hoisted_1$l = {
|
|
|
1150
1153
|
RuleBuilder.constructEntry(
|
|
1151
1154
|
"trigger.date",
|
|
1152
1155
|
"_rrule",
|
|
1153
|
-
|
|
1156
|
+
p.date
|
|
1154
1157
|
),
|
|
1155
1158
|
RuleBuilder.constructEntry(
|
|
1156
1159
|
"trigger.time",
|
|
1157
1160
|
"_isOnTime",
|
|
1158
|
-
|
|
1161
|
+
p.time
|
|
1159
1162
|
)
|
|
1160
1163
|
])
|
|
1161
1164
|
);
|
|
1162
1165
|
}
|
|
1163
|
-
return (
|
|
1164
|
-
const c = resolveComponent("FmButtonGroup"),
|
|
1166
|
+
return (p, u) => {
|
|
1167
|
+
const c = resolveComponent("FmButtonGroup"), f = resolveComponent("FmTimePicker"), B = resolveComponent("FmIcon"), b = resolveComponent("FmTooltip"), E = resolveComponent("FmField"), N = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), S = resolveComponent("FmHelperText");
|
|
1165
1168
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1166
1169
|
createVNode(c, {
|
|
1167
|
-
items:
|
|
1168
|
-
"model-value":
|
|
1169
|
-
"onUpdate:modelValue":
|
|
1170
|
+
items: unref(y),
|
|
1171
|
+
"model-value": unref(y).find(($) => $.value === unref(n)) ?? null,
|
|
1172
|
+
"onUpdate:modelValue": x,
|
|
1170
1173
|
class: "mb-8"
|
|
1171
|
-
}, null, 8, ["model-value"]),
|
|
1174
|
+
}, null, 8, ["items", "model-value"]),
|
|
1172
1175
|
createElementVNode("div", _hoisted_1$f, [
|
|
1173
1176
|
createElementVNode("div", _hoisted_2$c, [
|
|
1174
|
-
createVNode(
|
|
1175
|
-
label: "
|
|
1176
|
-
"model-value": unref(
|
|
1177
|
-
"onUpdate:modelValue":
|
|
1178
|
-
"helper-text": unref(
|
|
1179
|
-
"helper-state": unref(
|
|
1180
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
1177
|
+
createVNode(f, {
|
|
1178
|
+
label: unref(a)("connect.template.rule.schedule.notify_time"),
|
|
1179
|
+
"model-value": unref(v).time,
|
|
1180
|
+
"onUpdate:modelValue": u[0] || (u[0] = ($) => k({ date: unref(v).date, time: $ })),
|
|
1181
|
+
"helper-text": unref(v).time ? void 0 : unref(a)("connect.template.rule.schedule.time_required"),
|
|
1182
|
+
"helper-state": unref(v).time ? void 0 : "error"
|
|
1183
|
+
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
1181
1184
|
unref(n) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
1182
|
-
createElementVNode("div", _hoisted_4$
|
|
1183
|
-
|
|
1184
|
-
unref(
|
|
1185
|
+
createElementVNode("div", _hoisted_4$8, [
|
|
1186
|
+
createElementVNode("div", null, toDisplayString(unref(a)("connect.template.rule.schedule.notify_date")), 1),
|
|
1187
|
+
unref(v).date ? (openBlock(), createBlock(b, {
|
|
1185
1188
|
key: 0,
|
|
1186
1189
|
"z-index": 9999,
|
|
1187
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
1190
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(v).date).options)
|
|
1188
1191
|
}, {
|
|
1189
1192
|
default: withCtx(() => [
|
|
1190
|
-
createVNode(
|
|
1193
|
+
createVNode(B, {
|
|
1191
1194
|
name: "info",
|
|
1192
1195
|
size: "sm",
|
|
1193
1196
|
outline: !0
|
|
@@ -1196,30 +1199,30 @@ const _hoisted_1$l = {
|
|
|
1196
1199
|
_: 1
|
|
1197
1200
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
1198
1201
|
]),
|
|
1199
|
-
createVNode(
|
|
1200
|
-
"show-popover": unref(
|
|
1201
|
-
onPopoverChanged:
|
|
1202
|
+
createVNode(C, {
|
|
1203
|
+
"show-popover": unref(r),
|
|
1204
|
+
onPopoverChanged: u[3] || (u[3] = ($) => r.value = $)
|
|
1202
1205
|
}, {
|
|
1203
1206
|
"popover-button": withCtx(() => [
|
|
1204
|
-
createVNode(
|
|
1207
|
+
createVNode(E, {
|
|
1205
1208
|
class: "cursor-pointer",
|
|
1206
|
-
"helper-text": unref(
|
|
1207
|
-
"helper-state": unref(
|
|
1209
|
+
"helper-text": unref(v).date ? void 0 : unref(a)("connect.template.rule.schedule.date_required"),
|
|
1210
|
+
"helper-state": unref(v).date ? void 0 : "error"
|
|
1208
1211
|
}, {
|
|
1209
1212
|
default: withCtx(() => [
|
|
1210
|
-
createElementVNode("div", _hoisted_5$
|
|
1213
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(v).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(v).date).options) : unref(a)("connect.template.rule.schedule.set_repeating_date")), 1)
|
|
1211
1214
|
]),
|
|
1212
1215
|
_: 1
|
|
1213
1216
|
}, 8, ["helper-text", "helper-state"])
|
|
1214
1217
|
]),
|
|
1215
1218
|
default: withCtx(() => [
|
|
1216
|
-
createVNode(
|
|
1219
|
+
createVNode(N, { class: "elevated p-8 w-[450px]" }, {
|
|
1217
1220
|
default: withCtx(() => [
|
|
1218
1221
|
createVNode(_sfc_main$q, {
|
|
1219
1222
|
"apply-button": !0,
|
|
1220
|
-
"model-value": unref(
|
|
1221
|
-
onCancel:
|
|
1222
|
-
"onUpdate:modelValue":
|
|
1223
|
+
"model-value": unref(v).date || "",
|
|
1224
|
+
onCancel: u[1] || (u[1] = ($) => r.value = !1),
|
|
1225
|
+
"onUpdate:modelValue": u[2] || (u[2] = ($) => (k({ date: $, time: unref(v).time }), r.value = !1))
|
|
1223
1226
|
}, null, 8, ["model-value"])
|
|
1224
1227
|
]),
|
|
1225
1228
|
_: 1
|
|
@@ -1227,25 +1230,25 @@ const _hoisted_1$l = {
|
|
|
1227
1230
|
]),
|
|
1228
1231
|
_: 1
|
|
1229
1232
|
}, 8, ["show-popover"])
|
|
1230
|
-
])) : (openBlock(), createBlock(
|
|
1233
|
+
])) : (openBlock(), createBlock(R, {
|
|
1231
1234
|
key: 1,
|
|
1232
|
-
label: "
|
|
1233
|
-
"model-value": unref(
|
|
1234
|
-
"onUpdate:modelValue":
|
|
1235
|
-
"helper-text": unref(
|
|
1236
|
-
"helper-state": unref(
|
|
1237
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
1235
|
+
label: unref(a)("connect.template.rule.schedule.notify_date"),
|
|
1236
|
+
"model-value": unref(v).date || "",
|
|
1237
|
+
"onUpdate:modelValue": u[4] || (u[4] = ($) => k({ date: $, time: unref(v).time })),
|
|
1238
|
+
"helper-text": unref(v).date ? void 0 : unref(a)("connect.template.rule.schedule.date_required"),
|
|
1239
|
+
"helper-state": unref(v).date ? void 0 : "error"
|
|
1240
|
+
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
1238
1241
|
]),
|
|
1239
|
-
unref(
|
|
1242
|
+
unref(v).date && unref(v).time && unref(h) ? (openBlock(), createBlock(S, {
|
|
1240
1243
|
key: 0,
|
|
1241
|
-
text: `${unref(moment)(unref(h)).isAfter(unref(moment)()) ? "
|
|
1242
|
-
${unref(moment)(unref(h)).format("hh:mmA")}(UTC${unref(moment).tz(unref(
|
|
1244
|
+
text: `${unref(moment)(unref(h)).isAfter(unref(moment)()) ? unref(a)("connect.template.rule.schedule.next_notification") : unref(a)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(h)).format("dddd, DD MMM YYYY")} at
|
|
1245
|
+
${unref(moment)(unref(h)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(h)).fromNow()})`
|
|
1243
1246
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1244
1247
|
])
|
|
1245
1248
|
], 64);
|
|
1246
1249
|
};
|
|
1247
1250
|
}
|
|
1248
|
-
}), _hoisted_1$e = { class: "space-y-16" }, _hoisted_2$b = { class: "grid grid-cols-2 gap-16" },
|
|
1251
|
+
}), _hoisted_1$e = { class: "space-y-16" }, _hoisted_2$b = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$8 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$7 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
1249
1252
|
__name: "GameTypeInput",
|
|
1250
1253
|
props: {
|
|
1251
1254
|
modelValue: {
|
|
@@ -1253,43 +1256,43 @@ const _hoisted_1$l = {
|
|
|
1253
1256
|
}
|
|
1254
1257
|
},
|
|
1255
1258
|
emits: ["update:model-value"],
|
|
1256
|
-
setup(e, { emit:
|
|
1257
|
-
const
|
|
1259
|
+
setup(e, { emit: m }) {
|
|
1260
|
+
const { t: a } = useI18n(), d = e, i = m, s = computed(
|
|
1258
1261
|
() => [
|
|
1259
1262
|
{
|
|
1260
|
-
label: "
|
|
1261
|
-
description: "
|
|
1263
|
+
label: a("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
1264
|
+
description: a("connect.campaign.gameType.option.FORTUNE_WHEEL.description"),
|
|
1262
1265
|
value: F_GAME_TYPE.enum.FORTUNE_WHEEL,
|
|
1263
1266
|
hidden: !1
|
|
1264
1267
|
},
|
|
1265
1268
|
{
|
|
1266
|
-
label: "
|
|
1267
|
-
description: "
|
|
1269
|
+
label: a("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.label"),
|
|
1270
|
+
description: a("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.description"),
|
|
1268
1271
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
1269
1272
|
hidden: !0
|
|
1270
1273
|
}
|
|
1271
|
-
].filter((
|
|
1274
|
+
].filter((l) => !l.hidden)
|
|
1272
1275
|
);
|
|
1273
|
-
return (
|
|
1276
|
+
return (l, o) => {
|
|
1274
1277
|
const n = resolveComponent("FmCard");
|
|
1275
1278
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
1276
|
-
|
|
1277
|
-
createElementVNode("div",
|
|
1278
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1279
|
+
createElementVNode("div", _hoisted_2$b, toDisplayString(unref(a)("connect.template.select_game")), 1),
|
|
1280
|
+
createElementVNode("div", _hoisted_3$8, [
|
|
1281
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
|
|
1279
1282
|
variant: "outlined",
|
|
1280
1283
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1281
|
-
"col-span-2": unref(
|
|
1282
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1283
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1284
|
+
"col-span-2": unref(s).length == 1,
|
|
1285
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
1286
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1284
1287
|
}]),
|
|
1285
1288
|
onClick: () => {
|
|
1286
|
-
|
|
1289
|
+
d.modelValue != r.value && i("update:model-value", r.value);
|
|
1287
1290
|
},
|
|
1288
|
-
key:
|
|
1291
|
+
key: r.value
|
|
1289
1292
|
}, {
|
|
1290
1293
|
default: withCtx(() => [
|
|
1291
|
-
createElementVNode("div",
|
|
1292
|
-
createElementVNode("div",
|
|
1294
|
+
createElementVNode("div", _hoisted_4$7, toDisplayString(r.label), 1),
|
|
1295
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(r.description), 1)
|
|
1293
1296
|
]),
|
|
1294
1297
|
_: 2
|
|
1295
1298
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1303,48 +1306,48 @@ const _hoisted_1$l = {
|
|
|
1303
1306
|
}, _hoisted_2$a = { class: "flex gap-8 items-center justify-start" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1304
1307
|
__name: "EditRewardPoolSheet",
|
|
1305
1308
|
emits: ["update:model-value"],
|
|
1306
|
-
setup(e, { expose:
|
|
1307
|
-
const
|
|
1308
|
-
var
|
|
1309
|
-
return ((
|
|
1310
|
-
(
|
|
1311
|
-
var
|
|
1312
|
-
return
|
|
1309
|
+
setup(e, { expose: m, emit: a }) {
|
|
1310
|
+
const d = useMembershipStore(), { minor: i } = useLoading, s = ref(!1), l = ref(), o = ref(), n = ref(0), r = computed(() => {
|
|
1311
|
+
var p;
|
|
1312
|
+
return ((p = d.loyaltyRewards.items.find(
|
|
1313
|
+
(u) => {
|
|
1314
|
+
var c;
|
|
1315
|
+
return u.value === ((c = l.value) == null ? void 0 : c.collectible);
|
|
1313
1316
|
}
|
|
1314
|
-
)) == null ? void 0 :
|
|
1315
|
-
}),
|
|
1316
|
-
const
|
|
1317
|
-
return
|
|
1317
|
+
)) == null ? void 0 : p.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1318
|
+
}), y = computed(() => {
|
|
1319
|
+
const k = r.value.safeParse(l.value);
|
|
1320
|
+
return k.success ? [] : k.error.errors;
|
|
1318
1321
|
});
|
|
1319
|
-
function
|
|
1320
|
-
|
|
1322
|
+
function v(k, p, u) {
|
|
1323
|
+
k && (l.value = p, n.value = u), s.value = k;
|
|
1321
1324
|
}
|
|
1322
|
-
const
|
|
1323
|
-
async function
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1325
|
+
const h = a;
|
|
1326
|
+
async function x() {
|
|
1327
|
+
const k = r.value.safeParse(l.value);
|
|
1328
|
+
k.success && (await i(
|
|
1326
1329
|
async () => {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
+
k.data.type === "VOUCHER" && o.value && (k.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1331
|
+
k.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
|
|
1332
|
+
o.value
|
|
1330
1333
|
));
|
|
1331
1334
|
},
|
|
1332
1335
|
{
|
|
1333
1336
|
message: "Uploading reward image",
|
|
1334
1337
|
successMessage: "Reward image updated"
|
|
1335
1338
|
}
|
|
1336
|
-
),
|
|
1339
|
+
), h("update:model-value", k.data, n.value));
|
|
1337
1340
|
}
|
|
1338
|
-
return
|
|
1339
|
-
showSheet:
|
|
1340
|
-
}), (
|
|
1341
|
-
const
|
|
1341
|
+
return m({
|
|
1342
|
+
showSheet: v
|
|
1343
|
+
}), (k, p) => {
|
|
1344
|
+
const u = resolveComponent("FmSelect"), c = resolveComponent("FmStepperField"), f = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1342
1345
|
return openBlock(), createBlock(B, {
|
|
1343
1346
|
"max-width": 560,
|
|
1344
|
-
modelValue: unref(
|
|
1347
|
+
modelValue: unref(s),
|
|
1345
1348
|
"onUpdate:modelValue": [
|
|
1346
|
-
|
|
1347
|
-
|
|
1349
|
+
p[9] || (p[9] = (b) => isRef(s) ? s.value = b : null),
|
|
1350
|
+
p[10] || (p[10] = (b) => s.value = b)
|
|
1348
1351
|
],
|
|
1349
1352
|
header: "Edit reward",
|
|
1350
1353
|
"dismiss-away": ""
|
|
@@ -1354,36 +1357,36 @@ const _hoisted_1$l = {
|
|
|
1354
1357
|
createVNode(f, {
|
|
1355
1358
|
variant: "primary",
|
|
1356
1359
|
type: "button",
|
|
1357
|
-
disabled: unref(
|
|
1360
|
+
disabled: unref(y).length > 0,
|
|
1358
1361
|
label: "Confirm",
|
|
1359
|
-
onClick:
|
|
1362
|
+
onClick: p[7] || (p[7] = (b) => x())
|
|
1360
1363
|
}, null, 8, ["disabled"]),
|
|
1361
1364
|
createVNode(f, {
|
|
1362
1365
|
variant: "secondary",
|
|
1363
1366
|
type: "button",
|
|
1364
1367
|
label: "Cancel",
|
|
1365
|
-
onClick:
|
|
1368
|
+
onClick: p[8] || (p[8] = (b) => s.value = !1)
|
|
1366
1369
|
})
|
|
1367
1370
|
])
|
|
1368
1371
|
]),
|
|
1369
1372
|
default: withCtx(() => {
|
|
1370
|
-
var
|
|
1373
|
+
var b, E, N;
|
|
1371
1374
|
return [
|
|
1372
|
-
unref(
|
|
1373
|
-
createVNode(
|
|
1375
|
+
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
1376
|
+
createVNode(u, {
|
|
1374
1377
|
label: "Reward Type",
|
|
1375
1378
|
items: [
|
|
1376
1379
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
1377
1380
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1378
1381
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1379
1382
|
],
|
|
1380
|
-
"model-value": unref(
|
|
1381
|
-
"onUpdate:modelValue":
|
|
1382
|
-
|
|
1383
|
+
"model-value": unref(l).type,
|
|
1384
|
+
"onUpdate:modelValue": p[0] || (p[0] = (C) => {
|
|
1385
|
+
C == "NO_REWARD" ? l.value = {
|
|
1383
1386
|
type: "NO_REWARD",
|
|
1384
1387
|
collectible: null,
|
|
1385
1388
|
weight: 1
|
|
1386
|
-
} :
|
|
1389
|
+
} : C === "VOUCHER" ? l.value = {
|
|
1387
1390
|
collectible: null,
|
|
1388
1391
|
type: "VOUCHER",
|
|
1389
1392
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1397,8 +1400,8 @@ const _hoisted_1$l = {
|
|
|
1397
1400
|
validForDay: 7
|
|
1398
1401
|
},
|
|
1399
1402
|
weight: 1
|
|
1400
|
-
} :
|
|
1401
|
-
collectible: unref(
|
|
1403
|
+
} : l.value = {
|
|
1404
|
+
collectible: unref(d).loyaltyRewards.raw[0]._id,
|
|
1402
1405
|
type: "LOYALTY",
|
|
1403
1406
|
earningOption: {
|
|
1404
1407
|
amount: 1,
|
|
@@ -1411,75 +1414,75 @@ const _hoisted_1$l = {
|
|
|
1411
1414
|
};
|
|
1412
1415
|
})
|
|
1413
1416
|
}, null, 8, ["model-value"]),
|
|
1414
|
-
unref(
|
|
1417
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(u, {
|
|
1415
1418
|
key: 0,
|
|
1416
1419
|
label: "Loyalty type",
|
|
1417
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1418
|
-
items: unref(
|
|
1419
|
-
"model-value": unref(
|
|
1420
|
-
"onUpdate:modelValue":
|
|
1420
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
1421
|
+
items: unref(d).loyaltyRewards.items,
|
|
1422
|
+
"model-value": unref(l).collectible,
|
|
1423
|
+
"onUpdate:modelValue": p[1] || (p[1] = (C) => unref(l).collectible = C)
|
|
1421
1424
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1422
|
-
createVNode(
|
|
1425
|
+
createVNode(c, {
|
|
1423
1426
|
label: "Weight",
|
|
1424
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1425
|
-
"model-value": unref(
|
|
1426
|
-
"onUpdate:modelValue":
|
|
1427
|
-
...unref(
|
|
1428
|
-
weight:
|
|
1427
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
|
|
1428
|
+
"model-value": unref(l).weight,
|
|
1429
|
+
"onUpdate:modelValue": p[2] || (p[2] = (C) => l.value = {
|
|
1430
|
+
...unref(l),
|
|
1431
|
+
weight: C
|
|
1429
1432
|
})
|
|
1430
1433
|
}, null, 8, ["rules", "model-value"]),
|
|
1431
|
-
unref(
|
|
1432
|
-
((
|
|
1433
|
-
(
|
|
1434
|
-
var
|
|
1435
|
-
return
|
|
1434
|
+
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1435
|
+
((b = unref(d).loyaltyRewards.items.find(
|
|
1436
|
+
(C) => {
|
|
1437
|
+
var R;
|
|
1438
|
+
return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
1436
1439
|
}
|
|
1437
|
-
)) == null ? void 0 :
|
|
1438
|
-
|
|
1440
|
+
)) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1441
|
+
p[11] || (p[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
1439
1442
|
createVNode(_sfc_main$r, {
|
|
1440
1443
|
class: "mt-[-8px]",
|
|
1441
1444
|
rules: [
|
|
1442
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
1445
|
+
unref(ZodHelper).ruleAtPath(unref(r), "earningOption", [unref(l).type])
|
|
1443
1446
|
],
|
|
1444
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1445
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1447
|
+
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
1448
|
+
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
1446
1449
|
"fixed-type": !0,
|
|
1447
|
-
"model-value": unref(
|
|
1448
|
-
"onUpdate:modelValue":
|
|
1449
|
-
...unref(
|
|
1450
|
-
earningOption:
|
|
1450
|
+
"model-value": unref(l).earningOption,
|
|
1451
|
+
"onUpdate:modelValue": p[3] || (p[3] = (C) => l.value = {
|
|
1452
|
+
...unref(l),
|
|
1453
|
+
earningOption: C
|
|
1451
1454
|
})
|
|
1452
1455
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1453
1456
|
], 64)) : createCommentVNode("", !0),
|
|
1454
|
-
|
|
1457
|
+
p[12] || (p[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
1455
1458
|
createVNode(_sfc_main$s, {
|
|
1456
|
-
type: unref(
|
|
1457
|
-
"for-credit": unref(
|
|
1458
|
-
(
|
|
1459
|
-
var
|
|
1460
|
-
return
|
|
1459
|
+
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1460
|
+
"for-credit": unref(l).type === "LOYALTY" && ((E = unref(d).loyaltyRewards.items.find(
|
|
1461
|
+
(C) => {
|
|
1462
|
+
var R;
|
|
1463
|
+
return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
1461
1464
|
}
|
|
1462
1465
|
)) == null ? void 0 : E.raw.type) === "CREDIT",
|
|
1463
1466
|
class: "!gap-24",
|
|
1464
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1465
|
-
"model-value": unref(
|
|
1466
|
-
"onUpdate:modelValue":
|
|
1467
|
-
...unref(
|
|
1468
|
-
validityOption:
|
|
1467
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
|
|
1468
|
+
"model-value": unref(l).validityOption,
|
|
1469
|
+
"onUpdate:modelValue": p[4] || (p[4] = (C) => l.value = {
|
|
1470
|
+
...unref(l),
|
|
1471
|
+
validityOption: C
|
|
1469
1472
|
})
|
|
1470
1473
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1471
1474
|
], 64)) : createCommentVNode("", !0),
|
|
1472
|
-
unref(
|
|
1475
|
+
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$t, {
|
|
1473
1476
|
key: 2,
|
|
1474
|
-
"reward-image": unref(
|
|
1475
|
-
"model-value": ((
|
|
1476
|
-
"onUpdate:modelValue":
|
|
1477
|
-
...unref(
|
|
1478
|
-
collectibleConfig:
|
|
1477
|
+
"reward-image": unref(o),
|
|
1478
|
+
"model-value": ((N = unref(l)) == null ? void 0 : N.collectibleConfig) ?? void 0,
|
|
1479
|
+
"onUpdate:modelValue": p[5] || (p[5] = (C) => l.value = {
|
|
1480
|
+
...unref(l),
|
|
1481
|
+
collectibleConfig: C
|
|
1479
1482
|
}),
|
|
1480
|
-
"onUpdate:rewardImage":
|
|
1483
|
+
"onUpdate:rewardImage": p[6] || (p[6] = (C) => o.value = C)
|
|
1481
1484
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1482
|
-
createVNode(JsonViewer, { json: unref(
|
|
1485
|
+
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
1483
1486
|
])) : createCommentVNode("", !0)
|
|
1484
1487
|
];
|
|
1485
1488
|
}),
|
|
@@ -1491,7 +1494,7 @@ const _hoisted_1$l = {
|
|
|
1491
1494
|
function isNullOrEmpty(e) {
|
|
1492
1495
|
return e == null || e === "";
|
|
1493
1496
|
}
|
|
1494
|
-
const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$7 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1497
|
+
const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1495
1498
|
__name: "RewardPoolInput",
|
|
1496
1499
|
props: {
|
|
1497
1500
|
modelValue: {
|
|
@@ -1506,37 +1509,37 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1506
1509
|
}
|
|
1507
1510
|
},
|
|
1508
1511
|
emits: ["update:model-value"],
|
|
1509
|
-
setup(e, { emit:
|
|
1510
|
-
const
|
|
1511
|
-
const p =
|
|
1512
|
+
setup(e, { emit: m }) {
|
|
1513
|
+
const a = e, d = m, i = useMembershipStore(), { t: s } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), n = computed(() => {
|
|
1514
|
+
const p = l.safeParse(o.value);
|
|
1512
1515
|
return p.success ? [] : p.error.errors;
|
|
1513
|
-
}),
|
|
1514
|
-
function
|
|
1515
|
-
var
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1516
|
+
}), r = ref();
|
|
1517
|
+
function y(p, u) {
|
|
1518
|
+
var f;
|
|
1519
|
+
const c = [...o.value];
|
|
1520
|
+
c[u] = p, (f = r.value) == null || f.showSheet(!1), d("update:model-value", c);
|
|
1518
1521
|
}
|
|
1519
|
-
function
|
|
1520
|
-
const
|
|
1521
|
-
(
|
|
1522
|
-
),
|
|
1522
|
+
function v(p) {
|
|
1523
|
+
const u = p.type == "VOUCHER" ? p.collectibleConfig : i.collectibles.find(
|
|
1524
|
+
(B) => B._id.toString() == p.collectible
|
|
1525
|
+
), c = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), f = p.weight;
|
|
1523
1526
|
return {
|
|
1524
|
-
label: isNullOrEmpty(
|
|
1525
|
-
sublabel: `${
|
|
1527
|
+
label: isNullOrEmpty(c) ? "NO REWARD" : c,
|
|
1528
|
+
sublabel: `${f} (${(f / o.value.reduce((B, b) => B + b.weight, 0) * 100).toFixed(2)}%)`
|
|
1526
1529
|
};
|
|
1527
1530
|
}
|
|
1528
|
-
function
|
|
1529
|
-
var
|
|
1530
|
-
const
|
|
1531
|
-
(
|
|
1531
|
+
function h(p) {
|
|
1532
|
+
var c;
|
|
1533
|
+
const u = [...o.value];
|
|
1534
|
+
(c = r.value) == null || c.showSheet(!0, u[p], p);
|
|
1532
1535
|
}
|
|
1533
|
-
function
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1536
|
+
function x(p) {
|
|
1537
|
+
const u = [...o.value];
|
|
1538
|
+
u.splice(p, 1), d("update:model-value", u);
|
|
1536
1539
|
}
|
|
1537
|
-
function
|
|
1540
|
+
function k() {
|
|
1538
1541
|
var p;
|
|
1539
|
-
(p =
|
|
1542
|
+
(p = r.value) == null || p.showSheet(
|
|
1540
1543
|
!0,
|
|
1541
1544
|
{
|
|
1542
1545
|
type: "NO_REWARD",
|
|
@@ -1546,47 +1549,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1546
1549
|
o.value.length
|
|
1547
1550
|
);
|
|
1548
1551
|
}
|
|
1549
|
-
return (p,
|
|
1550
|
-
const
|
|
1552
|
+
return (p, u) => {
|
|
1553
|
+
const c = resolveComponent("FmButton"), f = resolveComponent("FmCard"), B = resolveComponent("FmHelperText");
|
|
1551
1554
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1552
|
-
|
|
1553
|
-
createVNode(
|
|
1554
|
-
label: "
|
|
1555
|
-
onClick:
|
|
1555
|
+
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(s)("connect.template.configure_reward_type")), 1),
|
|
1556
|
+
createVNode(c, {
|
|
1557
|
+
label: unref(s)("connect.campaign.rewardPool.addReward"),
|
|
1558
|
+
onClick: u[0] || (u[0] = (b) => k()),
|
|
1556
1559
|
variant: "plain",
|
|
1557
1560
|
icon: "add"
|
|
1558
|
-
}),
|
|
1559
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (
|
|
1560
|
-
key:
|
|
1561
|
+
}, null, 8, ["label"]),
|
|
1562
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b, E) => (openBlock(), createBlock(f, {
|
|
1563
|
+
key: E,
|
|
1561
1564
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1562
1565
|
variant: "outlined",
|
|
1563
|
-
onClick: (
|
|
1566
|
+
onClick: (N) => h(E)
|
|
1564
1567
|
}, {
|
|
1565
1568
|
default: withCtx(() => {
|
|
1566
|
-
var
|
|
1569
|
+
var N;
|
|
1567
1570
|
return [
|
|
1568
1571
|
createElementVNode("div", null, [
|
|
1569
|
-
createElementVNode("div",
|
|
1570
|
-
createElementVNode("div",
|
|
1572
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(b.type == "LOYALTY" ? (N = b == null ? void 0 : b.earningOption) == null ? void 0 : N.amount : "") + " " + toDisplayString(v(b).label), 1),
|
|
1573
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(v(b).sublabel), 1)
|
|
1571
1574
|
]),
|
|
1572
|
-
createVNode(
|
|
1575
|
+
createVNode(c, {
|
|
1573
1576
|
icon: "delete",
|
|
1574
1577
|
variant: "tertiary",
|
|
1575
|
-
onClick: (
|
|
1578
|
+
onClick: (C) => (C.stopPropagation(), x(E))
|
|
1576
1579
|
}, null, 8, ["onClick"])
|
|
1577
1580
|
];
|
|
1578
1581
|
}),
|
|
1579
1582
|
_: 2
|
|
1580
1583
|
}, 1032, ["onClick"]))), 128)),
|
|
1581
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((
|
|
1582
|
-
key:
|
|
1583
|
-
text:
|
|
1584
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(B, {
|
|
1585
|
+
key: b.message,
|
|
1586
|
+
text: b.message,
|
|
1584
1587
|
state: "error"
|
|
1585
1588
|
}, null, 8, ["text"]))), 128)),
|
|
1586
1589
|
createVNode(_sfc_main$d, {
|
|
1587
1590
|
ref_key: "sheetRef",
|
|
1588
|
-
ref:
|
|
1589
|
-
"onUpdate:modelValue":
|
|
1591
|
+
ref: r,
|
|
1592
|
+
"onUpdate:modelValue": y
|
|
1590
1593
|
}, null, 512)
|
|
1591
1594
|
]);
|
|
1592
1595
|
};
|
|
@@ -1602,56 +1605,56 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1602
1605
|
}
|
|
1603
1606
|
},
|
|
1604
1607
|
emits: ["update:model-value"],
|
|
1605
|
-
setup(e, { emit:
|
|
1606
|
-
const
|
|
1608
|
+
setup(e, { emit: m }) {
|
|
1609
|
+
const { t: a } = useI18n(), d = e, i = m, s = computed(() => [
|
|
1607
1610
|
{
|
|
1608
|
-
label: "
|
|
1609
|
-
description: "
|
|
1611
|
+
label: a("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
1612
|
+
description: a("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
1610
1613
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
1611
1614
|
}
|
|
1612
1615
|
]);
|
|
1613
|
-
return (
|
|
1614
|
-
var
|
|
1615
|
-
const n = resolveComponent("FmSwitch"),
|
|
1616
|
+
return (l, o) => {
|
|
1617
|
+
var v, h, x;
|
|
1618
|
+
const n = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), y = resolveComponent("FmHelperText");
|
|
1616
1619
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1617
1620
|
createVNode(n, {
|
|
1618
|
-
label: "
|
|
1619
|
-
"model-value": !!((
|
|
1620
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1621
|
-
}, null, 8, ["model-value"]),
|
|
1622
|
-
((
|
|
1623
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1624
|
-
var p,
|
|
1625
|
-
return openBlock(), createBlock(
|
|
1621
|
+
label: unref(a)("connect.template.promotion_game.enable"),
|
|
1622
|
+
"model-value": !!((v = e.modelValue) != null && v.gameType),
|
|
1623
|
+
"onUpdate:modelValue": o[0] || (o[0] = (k) => k ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
|
|
1624
|
+
}, null, 8, ["label", "model-value"]),
|
|
1625
|
+
((h = e.modelValue) == null ? void 0 : h.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1626
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (k) => {
|
|
1627
|
+
var p, u;
|
|
1628
|
+
return openBlock(), createBlock(r, {
|
|
1626
1629
|
variant: "outlined",
|
|
1627
1630
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1628
|
-
"col-span-2": unref(
|
|
1629
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) ==
|
|
1630
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
1631
|
+
"col-span-2": unref(s).length == 1,
|
|
1632
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) == k.value,
|
|
1633
|
+
"hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != k.value
|
|
1631
1634
|
}]),
|
|
1632
1635
|
onClick: () => {
|
|
1633
|
-
var
|
|
1634
|
-
((
|
|
1636
|
+
var c;
|
|
1637
|
+
((c = d.modelValue) == null ? void 0 : c.gameType) != k.value && i("update:model-value", { gameType: k.value });
|
|
1635
1638
|
},
|
|
1636
|
-
key:
|
|
1639
|
+
key: k.value
|
|
1637
1640
|
}, {
|
|
1638
1641
|
default: withCtx(() => [
|
|
1639
|
-
createElementVNode("div", _hoisted_3$6, toDisplayString(
|
|
1640
|
-
createElementVNode("div", _hoisted_4$5, toDisplayString(
|
|
1642
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(k.label), 1),
|
|
1643
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(k.description), 1)
|
|
1641
1644
|
]),
|
|
1642
1645
|
_: 2
|
|
1643
1646
|
}, 1032, ["class", "onClick"]);
|
|
1644
1647
|
}), 128))
|
|
1645
1648
|
])) : createCommentVNode("", !0),
|
|
1646
|
-
((
|
|
1649
|
+
((x = e.modelValue) == null ? void 0 : x.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(y, {
|
|
1647
1650
|
key: 1,
|
|
1648
|
-
text: "
|
|
1651
|
+
text: unref(a)("connect.template.promotion_game.rock_paper_scissors.warning"),
|
|
1649
1652
|
state: "warning"
|
|
1650
|
-
})) : createCommentVNode("", !0)
|
|
1653
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1651
1654
|
]);
|
|
1652
1655
|
};
|
|
1653
1656
|
}
|
|
1654
|
-
}), _hoisted_1$a = { class: "space-y-8" }, _hoisted_2$7 = { class: "grid gap-16 grid-cols-2" }, _hoisted_3$5 = { class: "space-y-6" }, _hoisted_4$4 = { class: "space-y-8" }, _hoisted_5$
|
|
1657
|
+
}), _hoisted_1$a = { class: "space-y-8" }, _hoisted_2$7 = { class: "grid gap-16 grid-cols-2" }, _hoisted_3$5 = { class: "space-y-6" }, _hoisted_4$4 = { class: "space-y-8" }, _hoisted_5$4 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$3 = { class: "flex items-center space-x-3" }, _hoisted_7$3 = {
|
|
1655
1658
|
key: 0,
|
|
1656
1659
|
class: "ml-6 space-y-2"
|
|
1657
1660
|
}, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
@@ -1666,16 +1669,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1666
1669
|
}
|
|
1667
1670
|
},
|
|
1668
1671
|
emits: ["update:model-value"],
|
|
1669
|
-
setup(e, { emit:
|
|
1670
|
-
const { t:
|
|
1672
|
+
setup(e, { emit: m }) {
|
|
1673
|
+
const { t: a } = useI18n(), d = e, i = m, s = ref(d.modelValue ?? {}), l = ref(
|
|
1671
1674
|
(() => {
|
|
1672
|
-
const
|
|
1673
|
-
return
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1676
|
-
}),
|
|
1675
|
+
const v = {};
|
|
1676
|
+
return s.value.workingHour && Object.keys(s.value.workingHour).forEach((h) => {
|
|
1677
|
+
const x = s.value.workingHour[h];
|
|
1678
|
+
x && "periods" in x && Array.isArray(x.periods) ? v[h] = x.periods : Array.isArray(x) && (v[h] = x);
|
|
1679
|
+
}), v;
|
|
1677
1680
|
})()
|
|
1678
|
-
),
|
|
1681
|
+
), o = [
|
|
1679
1682
|
{ key: "mon", label: "Monday" },
|
|
1680
1683
|
{ key: "tue", label: "Tuesday" },
|
|
1681
1684
|
{ key: "wed", label: "Wednesday" },
|
|
@@ -1683,43 +1686,43 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1683
1686
|
{ key: "fri", label: "Friday" },
|
|
1684
1687
|
{ key: "sat", label: "Saturday" },
|
|
1685
1688
|
{ key: "sun", label: "Sunday" }
|
|
1686
|
-
],
|
|
1687
|
-
|
|
1689
|
+
], n = (v) => {
|
|
1690
|
+
l.value[v] || (l.value[v] = []), l.value[v].push({
|
|
1688
1691
|
startTime: "00:00",
|
|
1689
1692
|
endTime: "23:59"
|
|
1690
|
-
}),
|
|
1691
|
-
},
|
|
1692
|
-
|
|
1693
|
-
},
|
|
1694
|
-
const
|
|
1695
|
-
(
|
|
1696
|
-
periods:
|
|
1697
|
-
}),
|
|
1693
|
+
}), y();
|
|
1694
|
+
}, r = (v, h) => {
|
|
1695
|
+
l.value[v] && l.value[v].length > h && (l.value[v].splice(h, 1), l.value[v].length === 0 && delete l.value[v], y());
|
|
1696
|
+
}, y = () => {
|
|
1697
|
+
const v = Object.keys(l.value).reduce(
|
|
1698
|
+
(h, x) => (l.value[x] && l.value[x].length > 0 && (h[x] = {
|
|
1699
|
+
periods: l.value[x]
|
|
1700
|
+
}), h),
|
|
1698
1701
|
{}
|
|
1699
1702
|
);
|
|
1700
|
-
|
|
1703
|
+
s.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
|
|
1701
1704
|
};
|
|
1702
|
-
return watch(
|
|
1703
|
-
const
|
|
1705
|
+
return watch(s, () => i("update:model-value", s.value), { deep: !0 }), watch(l, y, { deep: !0 }), (v, h) => {
|
|
1706
|
+
const x = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), p = resolveComponent("FmCheckbox"), u = resolveComponent("FmTimePicker"), c = resolveComponent("FmButton");
|
|
1704
1707
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1705
1708
|
createElementVNode("div", _hoisted_2$7, [
|
|
1706
|
-
createVNode(
|
|
1707
|
-
label: unref(
|
|
1708
|
-
modelValue: unref(
|
|
1709
|
-
"onUpdate:modelValue":
|
|
1709
|
+
createVNode(x, {
|
|
1710
|
+
label: unref(a)("connect.template.eaterType"),
|
|
1711
|
+
modelValue: unref(s).eaterType,
|
|
1712
|
+
"onUpdate:modelValue": h[0] || (h[0] = (f) => unref(s).eaterType = f),
|
|
1710
1713
|
items: [
|
|
1711
|
-
{ label: unref(
|
|
1712
|
-
{ label: unref(
|
|
1714
|
+
{ label: unref(a)("connect.template.allEaters"), value: "all" },
|
|
1715
|
+
{ label: unref(a)("connect.template.newEatersOnly"), value: "new" },
|
|
1713
1716
|
{
|
|
1714
|
-
label: unref(
|
|
1717
|
+
label: unref(a)("connect.template.existingEatersOnly"),
|
|
1715
1718
|
value: "existing"
|
|
1716
1719
|
}
|
|
1717
1720
|
],
|
|
1718
1721
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
|
|
1719
1722
|
}, null, 8, ["label", "modelValue", "items", "rules"]),
|
|
1720
|
-
createVNode(
|
|
1721
|
-
modelValue: unref(
|
|
1722
|
-
"onUpdate:modelValue":
|
|
1723
|
+
createVNode(k, {
|
|
1724
|
+
modelValue: unref(s).minBasketAmount,
|
|
1725
|
+
"onUpdate:modelValue": h[1] || (h[1] = (f) => unref(s).minBasketAmount = f),
|
|
1723
1726
|
"show-steppers": !1,
|
|
1724
1727
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
|
|
1725
1728
|
}, {
|
|
@@ -1727,15 +1730,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1727
1730
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1728
1731
|
unref(ZodHelper).toInputLabel(
|
|
1729
1732
|
unref(ZodHelper).typeAtPath(e.schema, "minBasketAmount"),
|
|
1730
|
-
unref(
|
|
1733
|
+
unref(a)("connect.template.minBasketAmount")
|
|
1731
1734
|
)
|
|
1732
1735
|
)))
|
|
1733
1736
|
]),
|
|
1734
1737
|
_: 1
|
|
1735
1738
|
}, 8, ["modelValue", "rules"]),
|
|
1736
|
-
createVNode(
|
|
1737
|
-
modelValue: unref(
|
|
1738
|
-
"onUpdate:modelValue":
|
|
1739
|
+
createVNode(k, {
|
|
1740
|
+
modelValue: unref(s).bundleQuantity,
|
|
1741
|
+
"onUpdate:modelValue": h[2] || (h[2] = (f) => unref(s).bundleQuantity = f),
|
|
1739
1742
|
"show-steppers": !1,
|
|
1740
1743
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
|
|
1741
1744
|
}, {
|
|
@@ -1743,7 +1746,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1743
1746
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1744
1747
|
unref(ZodHelper).toInputLabel(
|
|
1745
1748
|
unref(ZodHelper).typeAtPath(e.schema, "bundleQuantity"),
|
|
1746
|
-
unref(
|
|
1749
|
+
unref(a)("connect.template.bundleQuantity")
|
|
1747
1750
|
)
|
|
1748
1751
|
)))
|
|
1749
1752
|
]),
|
|
@@ -1752,47 +1755,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1752
1755
|
]),
|
|
1753
1756
|
createElementVNode("div", _hoisted_3$5, [
|
|
1754
1757
|
createElementVNode("div", _hoisted_4$4, [
|
|
1755
|
-
createElementVNode("div", _hoisted_5$
|
|
1756
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(
|
|
1758
|
+
createElementVNode("div", _hoisted_5$4, toDisplayString(unref(a)("connect.template.operationHours")), 1),
|
|
1759
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(o, (f) => createElementVNode("div", {
|
|
1757
1760
|
key: f.key,
|
|
1758
1761
|
class: "space-y-2"
|
|
1759
1762
|
}, [
|
|
1760
1763
|
createElementVNode("div", _hoisted_6$3, [
|
|
1761
|
-
createVNode(
|
|
1764
|
+
createVNode(p, {
|
|
1762
1765
|
label: f.label,
|
|
1763
|
-
"model-value": !!(unref(
|
|
1766
|
+
"model-value": !!(unref(l)[f.key] && unref(l)[f.key].length > 0),
|
|
1764
1767
|
"onUpdate:modelValue": (B) => {
|
|
1765
|
-
B ?
|
|
1768
|
+
B ? n(f.key) : (unref(l)[f.key] = [], delete unref(l)[f.key], y());
|
|
1766
1769
|
}
|
|
1767
1770
|
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])
|
|
1768
1771
|
]),
|
|
1769
|
-
unref(
|
|
1770
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1771
|
-
key:
|
|
1772
|
+
unref(l)[f.key] && unref(l)[f.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
|
|
1773
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[f.key] || [], (B, b) => (openBlock(), createElementBlock("div", {
|
|
1774
|
+
key: b,
|
|
1772
1775
|
class: "flex items-center space-x-2 w-100"
|
|
1773
1776
|
}, [
|
|
1774
|
-
createVNode(
|
|
1777
|
+
createVNode(u, {
|
|
1775
1778
|
"model-value": B.startTime || "",
|
|
1776
1779
|
"onUpdate:modelValue": (E) => {
|
|
1777
|
-
unref(
|
|
1780
|
+
unref(l)[f.key] && unref(l)[f.key][b] && (unref(l)[f.key][b].startTime = E || "", y());
|
|
1778
1781
|
}
|
|
1779
1782
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1780
|
-
|
|
1781
|
-
createVNode(
|
|
1783
|
+
h[3] || (h[3] = createElementVNode("span", null, "to", -1)),
|
|
1784
|
+
createVNode(u, {
|
|
1782
1785
|
"model-value": B.endTime || "",
|
|
1783
1786
|
"onUpdate:modelValue": (E) => {
|
|
1784
|
-
unref(
|
|
1787
|
+
unref(l)[f.key] && unref(l)[f.key][b] && (unref(l)[f.key][b].endTime = E || "", y());
|
|
1785
1788
|
}
|
|
1786
1789
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1787
|
-
createVNode(
|
|
1790
|
+
createVNode(c, {
|
|
1788
1791
|
variant: "tertiary",
|
|
1789
1792
|
size: "sm",
|
|
1790
|
-
onClick: (E) =>
|
|
1793
|
+
onClick: (E) => r(f.key, b),
|
|
1791
1794
|
icon: "close"
|
|
1792
1795
|
}, null, 8, ["onClick"]),
|
|
1793
|
-
|
|
1796
|
+
b === 0 ? (openBlock(), createBlock(c, {
|
|
1794
1797
|
key: 0,
|
|
1795
|
-
onClick: (E) =>
|
|
1798
|
+
onClick: (E) => n(f.key),
|
|
1796
1799
|
icon: "add",
|
|
1797
1800
|
variant: "plain"
|
|
1798
1801
|
}, null, 8, ["onClick"])) : createCommentVNode("", !0)
|
|
@@ -1816,15 +1819,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1816
1819
|
}
|
|
1817
1820
|
},
|
|
1818
1821
|
emits: ["update:model-value"],
|
|
1819
|
-
setup(e, { emit:
|
|
1820
|
-
const { t:
|
|
1821
|
-
return watch(
|
|
1822
|
-
const
|
|
1822
|
+
setup(e, { emit: m }) {
|
|
1823
|
+
const { t: a } = useI18n(), d = e, i = m, s = ref(d.modelValue ?? {});
|
|
1824
|
+
return watch(s, () => i("update:model-value", s.value)), (l, o) => {
|
|
1825
|
+
const n = resolveComponent("FmStepperField");
|
|
1823
1826
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1824
1827
|
createElementVNode("div", _hoisted_2$6, [
|
|
1825
|
-
createVNode(
|
|
1826
|
-
modelValue: unref(
|
|
1827
|
-
"onUpdate:modelValue":
|
|
1828
|
+
createVNode(n, {
|
|
1829
|
+
modelValue: unref(s).totalCount,
|
|
1830
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => unref(s).totalCount = r),
|
|
1828
1831
|
"show-steppers": !1,
|
|
1829
1832
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
|
|
1830
1833
|
}, {
|
|
@@ -1832,15 +1835,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1832
1835
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1833
1836
|
unref(ZodHelper).toInputLabel(
|
|
1834
1837
|
unref(ZodHelper).typeAtPath(e.schema, "totalCount"),
|
|
1835
|
-
unref(
|
|
1838
|
+
unref(a)("connect.template.totalCount")
|
|
1836
1839
|
)
|
|
1837
1840
|
)))
|
|
1838
1841
|
]),
|
|
1839
1842
|
_: 1
|
|
1840
1843
|
}, 8, ["modelValue", "rules"]),
|
|
1841
|
-
createVNode(
|
|
1842
|
-
modelValue: unref(
|
|
1843
|
-
"onUpdate:modelValue":
|
|
1844
|
+
createVNode(n, {
|
|
1845
|
+
modelValue: unref(s).totalCountPerUser,
|
|
1846
|
+
"onUpdate:modelValue": o[1] || (o[1] = (r) => unref(s).totalCountPerUser = r),
|
|
1844
1847
|
"show-steppers": !1,
|
|
1845
1848
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
|
|
1846
1849
|
}, {
|
|
@@ -1848,7 +1851,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1848
1851
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1849
1852
|
unref(ZodHelper).toInputLabel(
|
|
1850
1853
|
unref(ZodHelper).typeAtPath(e.schema, "totalCountPerUser"),
|
|
1851
|
-
unref(
|
|
1854
|
+
unref(a)("connect.template.totalCountPerUser")
|
|
1852
1855
|
)
|
|
1853
1856
|
)))
|
|
1854
1857
|
]),
|
|
@@ -1858,7 +1861,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1858
1861
|
]);
|
|
1859
1862
|
};
|
|
1860
1863
|
}
|
|
1861
|
-
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "grid grid-cols-2 gap-16" },
|
|
1864
|
+
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$4 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1862
1865
|
__name: "MissionTypeInput",
|
|
1863
1866
|
props: {
|
|
1864
1867
|
modelValue: {
|
|
@@ -1866,39 +1869,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1866
1869
|
}
|
|
1867
1870
|
},
|
|
1868
1871
|
emits: ["update:model-value"],
|
|
1869
|
-
setup(e, { emit:
|
|
1870
|
-
const
|
|
1872
|
+
setup(e, { emit: m }) {
|
|
1873
|
+
const { t: a } = useI18n(), d = e, i = m, s = computed(() => [
|
|
1871
1874
|
{
|
|
1872
|
-
label: "
|
|
1873
|
-
description: "
|
|
1875
|
+
label: a("connect.campaign.mission.typeOption.STAMP.label"),
|
|
1876
|
+
description: a("connect.campaign.mission.typeOption.STAMP.description"),
|
|
1874
1877
|
value: F_MISSION_TYPE.enum.STAMP
|
|
1875
1878
|
},
|
|
1876
1879
|
{
|
|
1877
|
-
label: "
|
|
1878
|
-
description: "
|
|
1880
|
+
label: a("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
|
|
1881
|
+
description: a("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
|
|
1879
1882
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1880
1883
|
}
|
|
1881
1884
|
]);
|
|
1882
|
-
return (
|
|
1885
|
+
return (l, o) => {
|
|
1883
1886
|
const n = resolveComponent("FmCard");
|
|
1884
1887
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1885
|
-
|
|
1886
|
-
createElementVNode("div",
|
|
1887
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1888
|
+
createElementVNode("div", _hoisted_2$5, toDisplayString(unref(a)("connect.template.select_game")), 1),
|
|
1889
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
1890
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
|
|
1888
1891
|
variant: "outlined",
|
|
1889
1892
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1890
|
-
"col-span-2": unref(
|
|
1891
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1892
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1893
|
+
"col-span-2": unref(s).length == 1,
|
|
1894
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
1895
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1893
1896
|
}]),
|
|
1894
1897
|
onClick: () => {
|
|
1895
|
-
|
|
1898
|
+
d.modelValue != r.value && i("update:model-value", r.value);
|
|
1896
1899
|
},
|
|
1897
|
-
key:
|
|
1900
|
+
key: r.value
|
|
1898
1901
|
}, {
|
|
1899
1902
|
default: withCtx(() => [
|
|
1900
|
-
createElementVNode("div",
|
|
1901
|
-
createElementVNode("div",
|
|
1903
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(r.label), 1),
|
|
1904
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(r.description), 1)
|
|
1902
1905
|
]),
|
|
1903
1906
|
_: 2
|
|
1904
1907
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1920,16 +1923,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1920
1923
|
}
|
|
1921
1924
|
},
|
|
1922
1925
|
emits: ["update:model-value"],
|
|
1923
|
-
setup(e, { emit:
|
|
1924
|
-
const
|
|
1925
|
-
return (
|
|
1926
|
-
const
|
|
1926
|
+
setup(e, { emit: m }) {
|
|
1927
|
+
const a = m;
|
|
1928
|
+
return (d, i) => {
|
|
1929
|
+
const s = resolveComponent("FmStepperField");
|
|
1927
1930
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1928
|
-
|
|
1929
|
-
createVNode(
|
|
1931
|
+
i[1] || (i[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
|
|
1932
|
+
createVNode(s, {
|
|
1930
1933
|
label: "Maximum to collect",
|
|
1931
1934
|
"model-value": e.modelValue || null,
|
|
1932
|
-
"onUpdate:modelValue":
|
|
1935
|
+
"onUpdate:modelValue": i[0] || (i[0] = (l) => a("update:model-value", l)),
|
|
1933
1936
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1934
1937
|
"helper-state": e.helperState || "none"
|
|
1935
1938
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -1945,49 +1948,49 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1945
1948
|
}
|
|
1946
1949
|
},
|
|
1947
1950
|
emits: ["update:model-value"],
|
|
1948
|
-
setup(e, { expose:
|
|
1949
|
-
const
|
|
1950
|
-
var
|
|
1951
|
-
return ((
|
|
1951
|
+
setup(e, { expose: m, emit: a }) {
|
|
1952
|
+
const d = e, i = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), o = ref(), n = ref(), r = ref(0), y = computed(() => {
|
|
1953
|
+
var c;
|
|
1954
|
+
return ((c = i.loyaltyRewards.items.find(
|
|
1952
1955
|
(f) => {
|
|
1953
1956
|
var B;
|
|
1954
|
-
return f.value === ((B =
|
|
1957
|
+
return f.value === ((B = o.value) == null ? void 0 : B.collectible);
|
|
1955
1958
|
}
|
|
1956
|
-
)) == null ? void 0 :
|
|
1957
|
-
}),
|
|
1958
|
-
const
|
|
1959
|
-
return
|
|
1959
|
+
)) == null ? void 0 : c.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1960
|
+
}), v = computed(() => {
|
|
1961
|
+
const u = y.value.safeParse(o.value);
|
|
1962
|
+
return u.success ? [] : u.error.errors;
|
|
1960
1963
|
});
|
|
1961
|
-
function
|
|
1962
|
-
|
|
1964
|
+
function h(u, c, f) {
|
|
1965
|
+
u && (o.value = c, r.value = f), l.value = u;
|
|
1963
1966
|
}
|
|
1964
|
-
const
|
|
1965
|
-
async function
|
|
1966
|
-
const
|
|
1967
|
-
|
|
1967
|
+
const x = a;
|
|
1968
|
+
async function k() {
|
|
1969
|
+
const u = y.value.safeParse(o.value);
|
|
1970
|
+
u.success && (await s(
|
|
1968
1971
|
async () => {
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
+
u.data.type === "VOUCHER" && n.value && (u.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1973
|
+
u.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
1974
|
+
n.value
|
|
1972
1975
|
));
|
|
1973
1976
|
},
|
|
1974
1977
|
{
|
|
1975
1978
|
message: "Uploading reward image",
|
|
1976
1979
|
successMessage: "Reward image updated"
|
|
1977
1980
|
}
|
|
1978
|
-
),
|
|
1979
|
-
}
|
|
1980
|
-
const
|
|
1981
|
-
return
|
|
1982
|
-
showSheet:
|
|
1983
|
-
}), (
|
|
1984
|
-
const f = resolveComponent("FmStepperField"), B = resolveComponent("FmSelect"),
|
|
1985
|
-
return openBlock(), createBlock(
|
|
1981
|
+
), x("update:model-value", u.data, r.value));
|
|
1982
|
+
}
|
|
1983
|
+
const p = ref();
|
|
1984
|
+
return m({
|
|
1985
|
+
showSheet: h
|
|
1986
|
+
}), (u, c) => {
|
|
1987
|
+
const f = resolveComponent("FmStepperField"), B = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), E = resolveComponent("FmButton"), N = resolveComponent("FmSideSheet");
|
|
1988
|
+
return openBlock(), createBlock(N, {
|
|
1986
1989
|
"max-width": 560,
|
|
1987
|
-
modelValue: unref(
|
|
1990
|
+
modelValue: unref(l),
|
|
1988
1991
|
"onUpdate:modelValue": [
|
|
1989
|
-
|
|
1990
|
-
|
|
1992
|
+
c[10] || (c[10] = (C) => isRef(l) ? l.value = C : null),
|
|
1993
|
+
c[11] || (c[11] = (C) => l.value = C)
|
|
1991
1994
|
],
|
|
1992
1995
|
header: "Edit reward",
|
|
1993
1996
|
"dismiss-away": ""
|
|
@@ -1998,47 +2001,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1998
2001
|
variant: "primary",
|
|
1999
2002
|
type: "button",
|
|
2000
2003
|
label: "Confirm",
|
|
2001
|
-
disabled: unref(
|
|
2002
|
-
onClick:
|
|
2003
|
-
var
|
|
2004
|
-
return (
|
|
2004
|
+
disabled: unref(v).length > 0,
|
|
2005
|
+
onClick: c[8] || (c[8] = async () => {
|
|
2006
|
+
var C;
|
|
2007
|
+
return (C = unref(p)) == null ? void 0 : C.validateInputs();
|
|
2005
2008
|
})
|
|
2006
2009
|
}, null, 8, ["disabled"]),
|
|
2007
2010
|
createVNode(E, {
|
|
2008
2011
|
variant: "secondary",
|
|
2009
2012
|
type: "button",
|
|
2010
2013
|
label: "Cancel",
|
|
2011
|
-
onClick:
|
|
2014
|
+
onClick: c[9] || (c[9] = (C) => l.value = !1)
|
|
2012
2015
|
})
|
|
2013
2016
|
])
|
|
2014
2017
|
]),
|
|
2015
2018
|
default: withCtx(() => [
|
|
2016
|
-
createVNode(JsonViewer, { json: unref(
|
|
2017
|
-
unref(
|
|
2019
|
+
createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
|
|
2020
|
+
unref(o) ? (openBlock(), createBlock(b, {
|
|
2018
2021
|
key: 0,
|
|
2019
2022
|
class: "flex flex-col gap-y-24",
|
|
2020
2023
|
ref_key: "formRef",
|
|
2021
|
-
ref:
|
|
2022
|
-
onValidationSuccess:
|
|
2024
|
+
ref: p,
|
|
2025
|
+
onValidationSuccess: c[7] || (c[7] = (C) => k())
|
|
2023
2026
|
}, {
|
|
2024
2027
|
default: withCtx(() => {
|
|
2025
|
-
var
|
|
2028
|
+
var C, R;
|
|
2026
2029
|
return [
|
|
2027
|
-
unref(
|
|
2030
|
+
unref(o).type ? (openBlock(), createBlock(f, {
|
|
2028
2031
|
key: 0,
|
|
2029
2032
|
label: "Threshold",
|
|
2030
2033
|
rules: [
|
|
2031
2034
|
unref(ZodHelper).toRule(
|
|
2032
2035
|
unref(z).number().min(1).max(
|
|
2033
|
-
|
|
2034
|
-
`Number cannot be more than ${
|
|
2036
|
+
d.maxThreshold,
|
|
2037
|
+
`Number cannot be more than ${d.maxThreshold}`
|
|
2035
2038
|
)
|
|
2036
2039
|
)
|
|
2037
2040
|
],
|
|
2038
|
-
"model-value": unref(
|
|
2039
|
-
"onUpdate:modelValue":
|
|
2040
|
-
...unref(
|
|
2041
|
-
threshold:
|
|
2041
|
+
"model-value": unref(o).threshold,
|
|
2042
|
+
"onUpdate:modelValue": c[0] || (c[0] = (S) => o.value = {
|
|
2043
|
+
...unref(o),
|
|
2044
|
+
threshold: S
|
|
2042
2045
|
})
|
|
2043
2046
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
2044
2047
|
createVNode(B, {
|
|
@@ -2047,10 +2050,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2047
2050
|
{ label: "Voucher", value: "VOUCHER" },
|
|
2048
2051
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2049
2052
|
],
|
|
2050
|
-
"model-value": unref(
|
|
2051
|
-
"onUpdate:modelValue":
|
|
2052
|
-
var
|
|
2053
|
-
|
|
2053
|
+
"model-value": unref(o).type,
|
|
2054
|
+
"onUpdate:modelValue": c[1] || (c[1] = (S) => {
|
|
2055
|
+
var $, H;
|
|
2056
|
+
S === "VOUCHER" ? o.value = {
|
|
2054
2057
|
collectible: null,
|
|
2055
2058
|
type: "VOUCHER",
|
|
2056
2059
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -2063,9 +2066,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2063
2066
|
validityOption: {
|
|
2064
2067
|
validForDay: 7
|
|
2065
2068
|
},
|
|
2066
|
-
threshold: (
|
|
2067
|
-
} :
|
|
2068
|
-
collectible: unref(
|
|
2069
|
+
threshold: ($ = unref(o)) == null ? void 0 : $.threshold
|
|
2070
|
+
} : o.value = {
|
|
2071
|
+
collectible: unref(i).loyaltyRewards.raw[0]._id,
|
|
2069
2072
|
type: "LOYALTY",
|
|
2070
2073
|
earningOption: {
|
|
2071
2074
|
amount: 1,
|
|
@@ -2074,60 +2077,60 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2074
2077
|
validityOption: {
|
|
2075
2078
|
validForDay: 7
|
|
2076
2079
|
},
|
|
2077
|
-
threshold: (
|
|
2080
|
+
threshold: (H = unref(o)) == null ? void 0 : H.threshold
|
|
2078
2081
|
};
|
|
2079
2082
|
})
|
|
2080
2083
|
}, null, 8, ["model-value"]),
|
|
2081
|
-
unref(
|
|
2084
|
+
unref(o).type == "LOYALTY" ? (openBlock(), createBlock(B, {
|
|
2082
2085
|
key: 1,
|
|
2083
2086
|
label: "Loyalty type",
|
|
2084
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2085
|
-
items: unref(
|
|
2086
|
-
"model-value": unref(
|
|
2087
|
-
"onUpdate:modelValue":
|
|
2087
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(o).type])],
|
|
2088
|
+
items: unref(i).loyaltyRewards.items,
|
|
2089
|
+
"model-value": unref(o).collectible,
|
|
2090
|
+
"onUpdate:modelValue": c[2] || (c[2] = (S) => unref(o).collectible = S)
|
|
2088
2091
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2089
|
-
unref(
|
|
2090
|
-
|
|
2092
|
+
unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2093
|
+
c[12] || (c[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
2091
2094
|
createVNode(_sfc_main$r, {
|
|
2092
2095
|
class: "mt-[-8px]",
|
|
2093
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2094
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2095
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
2096
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(o).type])],
|
|
2097
|
+
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
2098
|
+
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
2096
2099
|
"fixed-type": !0,
|
|
2097
|
-
"model-value": unref(
|
|
2098
|
-
"onUpdate:modelValue":
|
|
2099
|
-
...unref(
|
|
2100
|
-
earningOption:
|
|
2100
|
+
"model-value": unref(o).earningOption,
|
|
2101
|
+
"onUpdate:modelValue": c[3] || (c[3] = (S) => o.value = {
|
|
2102
|
+
...unref(o),
|
|
2103
|
+
earningOption: S
|
|
2101
2104
|
})
|
|
2102
2105
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
2103
2106
|
createVNode(_sfc_main$s, {
|
|
2104
2107
|
class: "!gap-24",
|
|
2105
|
-
type: unref(
|
|
2106
|
-
"for-credit": unref(
|
|
2107
|
-
(
|
|
2108
|
-
var
|
|
2109
|
-
return
|
|
2108
|
+
type: unref(o).type === "LOYALTY" ? "custom" : "range",
|
|
2109
|
+
"for-credit": unref(o).type === "LOYALTY" && ((C = unref(i).loyaltyRewards.items.find(
|
|
2110
|
+
(S) => {
|
|
2111
|
+
var $;
|
|
2112
|
+
return S.value === (($ = unref(o)) == null ? void 0 : $.collectible);
|
|
2110
2113
|
}
|
|
2111
|
-
)) == null ? void 0 :
|
|
2112
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2113
|
-
"model-value": unref(
|
|
2114
|
-
"onUpdate:modelValue":
|
|
2115
|
-
...unref(
|
|
2116
|
-
validityOption:
|
|
2114
|
+
)) == null ? void 0 : C.raw.type) === "CREDIT",
|
|
2115
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(o).type])],
|
|
2116
|
+
"model-value": unref(o).validityOption,
|
|
2117
|
+
"onUpdate:modelValue": c[4] || (c[4] = (S) => o.value = {
|
|
2118
|
+
...unref(o),
|
|
2119
|
+
validityOption: S
|
|
2117
2120
|
})
|
|
2118
2121
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2119
2122
|
], 64)) : createCommentVNode("", !0),
|
|
2120
|
-
unref(
|
|
2123
|
+
unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$t, {
|
|
2121
2124
|
key: 3,
|
|
2122
|
-
"reward-image": unref(
|
|
2123
|
-
"model-value": ((
|
|
2124
|
-
"onUpdate:modelValue":
|
|
2125
|
-
...unref(
|
|
2126
|
-
collectibleConfig:
|
|
2125
|
+
"reward-image": unref(n),
|
|
2126
|
+
"model-value": ((R = unref(o)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
2127
|
+
"onUpdate:modelValue": c[5] || (c[5] = (S) => o.value = {
|
|
2128
|
+
...unref(o),
|
|
2129
|
+
collectibleConfig: S
|
|
2127
2130
|
}),
|
|
2128
|
-
"onUpdate:rewardImage":
|
|
2131
|
+
"onUpdate:rewardImage": c[6] || (c[6] = (S) => n.value = S)
|
|
2129
2132
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2130
|
-
createVNode(JsonViewer, { json: unref(
|
|
2133
|
+
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
2131
2134
|
];
|
|
2132
2135
|
}),
|
|
2133
2136
|
_: 1
|
|
@@ -2161,19 +2164,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2161
2164
|
}
|
|
2162
2165
|
},
|
|
2163
2166
|
setup(e) {
|
|
2164
|
-
const
|
|
2165
|
-
() => Math.min(
|
|
2166
|
-
),
|
|
2167
|
-
return (
|
|
2168
|
-
const
|
|
2167
|
+
const m = e, { maxRange: a, currentRange: d, markers: i } = toRefs(m), s = computed(
|
|
2168
|
+
() => Math.min(d.value / a.value * 100, 100)
|
|
2169
|
+
), l = (o) => o / a.value * 100;
|
|
2170
|
+
return (o, n) => {
|
|
2171
|
+
const r = resolveComponent("FmIcon");
|
|
2169
2172
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2170
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(
|
|
2173
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(r, {
|
|
2171
2174
|
class: normalizeClass(
|
|
2172
|
-
unref(
|
|
2175
|
+
unref(d) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
2173
2176
|
),
|
|
2174
|
-
outline: unref(
|
|
2175
|
-
key:
|
|
2176
|
-
name: unref(
|
|
2177
|
+
outline: unref(d) < y,
|
|
2178
|
+
key: y,
|
|
2179
|
+
name: unref(i).some((v) => v === y) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
2177
2180
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
2178
2181
|
])) : (openBlock(), createElementBlock("div", {
|
|
2179
2182
|
key: 1,
|
|
@@ -2181,18 +2184,18 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2181
2184
|
}, [
|
|
2182
2185
|
createElementVNode("div", {
|
|
2183
2186
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
2184
|
-
style: normalizeStyle({ width: unref(
|
|
2187
|
+
style: normalizeStyle({ width: unref(s) + "%" })
|
|
2185
2188
|
}, null, 4),
|
|
2186
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2187
|
-
key:
|
|
2189
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (y, v) => (openBlock(), createElementBlock("div", {
|
|
2190
|
+
key: v,
|
|
2188
2191
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
2189
|
-
style: normalizeStyle({ left:
|
|
2192
|
+
style: normalizeStyle({ left: l(y) + "%" })
|
|
2190
2193
|
}, [
|
|
2191
2194
|
createElementVNode("div", _hoisted_2$4, [
|
|
2192
2195
|
createElementVNode("div", {
|
|
2193
2196
|
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
2194
2197
|
}),
|
|
2195
|
-
|
|
2198
|
+
n[0] || (n[0] = createElementVNode("div", null, "🎁", -1))
|
|
2196
2199
|
])
|
|
2197
2200
|
], 4))), 128))
|
|
2198
2201
|
]));
|
|
@@ -2200,19 +2203,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2200
2203
|
}
|
|
2201
2204
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
2202
2205
|
function changeKeysFactory(e) {
|
|
2203
|
-
return function
|
|
2204
|
-
if (
|
|
2205
|
-
return
|
|
2206
|
-
if (Array.isArray(
|
|
2207
|
-
return
|
|
2208
|
-
const
|
|
2209
|
-
return Object.keys(
|
|
2210
|
-
const
|
|
2211
|
-
|
|
2212
|
-
}),
|
|
2206
|
+
return function m(a, d = 1, i) {
|
|
2207
|
+
if (d === 0 || !isObject(a))
|
|
2208
|
+
return a;
|
|
2209
|
+
if (Array.isArray(a))
|
|
2210
|
+
return a.map((l) => m(l, d - 1, i));
|
|
2211
|
+
const s = Object.create(Object.getPrototypeOf(a));
|
|
2212
|
+
return Object.keys(a).forEach((l) => {
|
|
2213
|
+
const o = a[l], n = e(l, i), r = m(o, d - 1, i);
|
|
2214
|
+
s[n] = r;
|
|
2215
|
+
}), s;
|
|
2213
2216
|
};
|
|
2214
2217
|
}
|
|
2215
|
-
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
2218
|
+
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$2 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2216
2219
|
__name: "MissionPoolInput",
|
|
2217
2220
|
props: {
|
|
2218
2221
|
modelValue: {
|
|
@@ -2225,43 +2228,50 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2225
2228
|
}
|
|
2226
2229
|
},
|
|
2227
2230
|
emits: ["update:model-value"],
|
|
2228
|
-
setup(e, { emit:
|
|
2229
|
-
const
|
|
2230
|
-
() =>
|
|
2231
|
+
setup(e, { emit: m }) {
|
|
2232
|
+
const { t: a } = useI18n(), d = e, i = m, s = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
|
|
2233
|
+
() => d.modelValue.sort((u, c) => u.threshold - c.threshold) ?? []
|
|
2231
2234
|
), n = computed(() => {
|
|
2232
|
-
const
|
|
2233
|
-
return
|
|
2234
|
-
}),
|
|
2235
|
-
function
|
|
2236
|
-
var
|
|
2237
|
-
const
|
|
2238
|
-
|
|
2239
|
-
}
|
|
2240
|
-
function
|
|
2241
|
-
const
|
|
2242
|
-
(
|
|
2243
|
-
),
|
|
2235
|
+
const u = l.safeParse(o.value);
|
|
2236
|
+
return u.success ? [] : u.error.errors;
|
|
2237
|
+
}), r = ref();
|
|
2238
|
+
function y(u, c) {
|
|
2239
|
+
var B;
|
|
2240
|
+
const f = [...o.value];
|
|
2241
|
+
f[c] = u, (B = r.value) == null || B.showSheet(!1), i("update:model-value", f);
|
|
2242
|
+
}
|
|
2243
|
+
function v(u) {
|
|
2244
|
+
const c = u.type == "VOUCHER" ? u.collectibleConfig : s.collectibles.find(
|
|
2245
|
+
(b) => b._id.toString() == u.collectible
|
|
2246
|
+
), f = CollectionUtils.formattedType((c == null ? void 0 : c.name) || ""), B = u.earningOption.type == "FIXED" ? a("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
2247
|
+
threshold: u.threshold,
|
|
2248
|
+
amount: u.earningOption.amount
|
|
2249
|
+
}) : a("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
2250
|
+
threshold: u.threshold,
|
|
2251
|
+
amount: u.earningOption.amount,
|
|
2252
|
+
every: u.earningOption.every
|
|
2253
|
+
});
|
|
2244
2254
|
return {
|
|
2245
|
-
label: isNullOrEmpty(
|
|
2246
|
-
sublabel:
|
|
2255
|
+
label: isNullOrEmpty(f) ? a("connect.template.mission_pool.no_reward") : f,
|
|
2256
|
+
sublabel: B
|
|
2247
2257
|
};
|
|
2248
2258
|
}
|
|
2249
|
-
function
|
|
2250
|
-
var
|
|
2251
|
-
const
|
|
2252
|
-
(
|
|
2259
|
+
function h(u) {
|
|
2260
|
+
var f;
|
|
2261
|
+
const c = [...o.value];
|
|
2262
|
+
(f = r.value) == null || f.showSheet(!0, c[u], u);
|
|
2253
2263
|
}
|
|
2254
|
-
function
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2264
|
+
function x(u) {
|
|
2265
|
+
const c = [...o.value];
|
|
2266
|
+
c.splice(u, 1), i("update:model-value", c);
|
|
2257
2267
|
}
|
|
2258
|
-
function
|
|
2259
|
-
var
|
|
2260
|
-
(
|
|
2268
|
+
function k() {
|
|
2269
|
+
var u;
|
|
2270
|
+
(u = r.value) == null || u.showSheet(
|
|
2261
2271
|
!0,
|
|
2262
2272
|
{
|
|
2263
2273
|
type: "LOYALTY",
|
|
2264
|
-
collectible:
|
|
2274
|
+
collectible: s.loyaltyRewards.items[0].value,
|
|
2265
2275
|
threshold: null,
|
|
2266
2276
|
validityOption: {
|
|
2267
2277
|
validForDay: 7
|
|
@@ -2274,71 +2284,71 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2274
2284
|
o.value.length
|
|
2275
2285
|
);
|
|
2276
2286
|
}
|
|
2277
|
-
function p(
|
|
2278
|
-
var
|
|
2279
|
-
return
|
|
2280
|
-
((
|
|
2281
|
-
(
|
|
2282
|
-
)) == null ? void 0 :
|
|
2287
|
+
function p(u) {
|
|
2288
|
+
var c, f;
|
|
2289
|
+
return u.type == "VOUCHER" ? (c = u.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
|
|
2290
|
+
((f = s.loyaltyRewards.items.find(
|
|
2291
|
+
(B) => B.value == u.collectible
|
|
2292
|
+
)) == null ? void 0 : f.label) || ""
|
|
2283
2293
|
);
|
|
2284
2294
|
}
|
|
2285
|
-
return (
|
|
2286
|
-
const
|
|
2295
|
+
return (u, c) => {
|
|
2296
|
+
const f = resolveComponent("FmButton"), B = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
2287
2297
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2288
|
-
|
|
2289
|
-
createVNode(
|
|
2290
|
-
label: "
|
|
2291
|
-
onClick:
|
|
2298
|
+
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(a)("connect.template.configure_reward_customer")), 1),
|
|
2299
|
+
createVNode(f, {
|
|
2300
|
+
label: unref(a)("connect.template.mission_pool.add_reward"),
|
|
2301
|
+
onClick: c[0] || (c[0] = (E) => k()),
|
|
2292
2302
|
variant: "plain",
|
|
2293
2303
|
icon: "add"
|
|
2294
|
-
}),
|
|
2295
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (
|
|
2296
|
-
key:
|
|
2304
|
+
}, null, 8, ["label"]),
|
|
2305
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, N) => (openBlock(), createBlock(B, {
|
|
2306
|
+
key: N,
|
|
2297
2307
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2298
2308
|
variant: "outlined",
|
|
2299
|
-
onClick: (
|
|
2309
|
+
onClick: (C) => h(N)
|
|
2300
2310
|
}, {
|
|
2301
2311
|
default: withCtx(() => [
|
|
2302
2312
|
createElementVNode("div", null, [
|
|
2303
|
-
createElementVNode("div",
|
|
2304
|
-
createElementVNode("div",
|
|
2313
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(v(E).label), 1),
|
|
2314
|
+
createElementVNode("div", _hoisted_4$2, toDisplayString(v(E).sublabel), 1)
|
|
2305
2315
|
]),
|
|
2306
|
-
createVNode(
|
|
2316
|
+
createVNode(f, {
|
|
2307
2317
|
icon: "delete",
|
|
2308
2318
|
variant: "tertiary",
|
|
2309
|
-
onClick: (
|
|
2319
|
+
onClick: (C) => (C.stopPropagation(), x(N))
|
|
2310
2320
|
}, null, 8, ["onClick"])
|
|
2311
2321
|
]),
|
|
2312
2322
|
_: 2
|
|
2313
2323
|
}, 1032, ["onClick"]))), 128)),
|
|
2314
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((
|
|
2315
|
-
key:
|
|
2316
|
-
text:
|
|
2324
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((E) => E.path.join(".") == ""), (E) => (openBlock(), createBlock(b, {
|
|
2325
|
+
key: E.message,
|
|
2326
|
+
text: E.message,
|
|
2317
2327
|
state: "error"
|
|
2318
2328
|
}, null, 8, ["text"]))), 128)),
|
|
2319
|
-
|
|
2320
|
-
(openBlock(), createBlock(
|
|
2329
|
+
createElementVNode("div", _hoisted_5$2, toDisplayString(unref(a)("connect.template.mission_pool.preview")), 1),
|
|
2330
|
+
(openBlock(), createBlock(B, {
|
|
2321
2331
|
key: 0,
|
|
2322
2332
|
variant: "outlined",
|
|
2323
2333
|
class: "p-24 space-y-16 w-fit"
|
|
2324
2334
|
}, {
|
|
2325
2335
|
default: withCtx(() => {
|
|
2326
|
-
var
|
|
2336
|
+
var E, N;
|
|
2327
2337
|
return [
|
|
2328
|
-
createElementVNode("div",
|
|
2338
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
2329
2339
|
createElementVNode("div", null, [
|
|
2330
|
-
createElementVNode("div",
|
|
2331
|
-
|
|
2340
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(a)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((E = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : E.earningOption.amount) > 1 ? (N = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : N.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? p(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
2341
|
+
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(a)("connect.template.mission_pool.earn_stamp")), 1)
|
|
2332
2342
|
])
|
|
2333
2343
|
]),
|
|
2334
|
-
createElementVNode("div",
|
|
2344
|
+
createElementVNode("div", _hoisted_9$2, [
|
|
2335
2345
|
createVNode(_sfc_main$5, {
|
|
2336
2346
|
type: e.mission.type,
|
|
2337
2347
|
"max-range": e.mission.end,
|
|
2338
2348
|
currentRange: e.mission.end / 4,
|
|
2339
|
-
markers: e.modelValue.map((
|
|
2349
|
+
markers: e.modelValue.map((C) => C.threshold)
|
|
2340
2350
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
2341
|
-
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div",
|
|
2351
|
+
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
2342
2352
|
])
|
|
2343
2353
|
];
|
|
2344
2354
|
}),
|
|
@@ -2346,93 +2356,101 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2346
2356
|
})),
|
|
2347
2357
|
createVNode(_sfc_main$6, {
|
|
2348
2358
|
ref_key: "sheetRef",
|
|
2349
|
-
ref:
|
|
2350
|
-
"onUpdate:modelValue":
|
|
2359
|
+
ref: r,
|
|
2360
|
+
"onUpdate:modelValue": y,
|
|
2351
2361
|
"max-threshold": e.mission.end
|
|
2352
2362
|
}, null, 8, ["max-threshold"])
|
|
2353
2363
|
]);
|
|
2354
2364
|
};
|
|
2355
2365
|
}
|
|
2356
|
-
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "grid grid-cols-2 gap-16" },
|
|
2366
|
+
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_10$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2357
2367
|
__name: "MissionInput",
|
|
2358
2368
|
props: {
|
|
2359
2369
|
modelValue: Object
|
|
2360
2370
|
},
|
|
2361
2371
|
emits: ["update:model-value"],
|
|
2362
|
-
setup(e, { emit:
|
|
2363
|
-
const
|
|
2364
|
-
const o = FdoMission.safeParse(
|
|
2372
|
+
setup(e, { emit: m }) {
|
|
2373
|
+
const { t: a } = useI18n(), d = e, i = computed(() => {
|
|
2374
|
+
const o = FdoMission.safeParse(d.modelValue);
|
|
2365
2375
|
return o.success ? [] : o.error.errors;
|
|
2366
|
-
}),
|
|
2376
|
+
}), s = computed(() => [
|
|
2367
2377
|
{
|
|
2368
|
-
label: "
|
|
2369
|
-
description: "
|
|
2378
|
+
label: a("connect.campaign.mission.typeOption.STAMP.label"),
|
|
2379
|
+
description: a("connect.campaign.mission.typeOption.STAMP.description"),
|
|
2370
2380
|
value: F_MISSION_TYPE.enum.STAMP
|
|
2371
2381
|
},
|
|
2372
2382
|
{
|
|
2373
|
-
label: "
|
|
2374
|
-
description: "
|
|
2383
|
+
label: a("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
|
|
2384
|
+
description: a("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
|
|
2375
2385
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
2376
2386
|
}
|
|
2377
|
-
]),
|
|
2387
|
+
]), l = m;
|
|
2378
2388
|
return (o, n) => {
|
|
2379
|
-
var
|
|
2380
|
-
const
|
|
2389
|
+
var v;
|
|
2390
|
+
const r = resolveComponent("FmCard"), y = resolveComponent("FmStepperField");
|
|
2381
2391
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2382
2392
|
createElementVNode("div", _hoisted_2$2, [
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
createElementVNode("div",
|
|
2386
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2387
|
-
var
|
|
2388
|
-
return openBlock(), createBlock(
|
|
2393
|
+
createElementVNode("div", _hoisted_3$2, toDisplayString(unref(a)("connect.campaign.mission.missionType")), 1),
|
|
2394
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)("connect.template.select_game")), 1),
|
|
2395
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
2396
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
|
|
2397
|
+
var x, k;
|
|
2398
|
+
return openBlock(), createBlock(r, {
|
|
2389
2399
|
variant: "outlined",
|
|
2390
2400
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2391
|
-
"col-span-2": unref(
|
|
2392
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
2393
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2401
|
+
"col-span-2": unref(s).length == 1,
|
|
2402
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((x = e.modelValue) == null ? void 0 : x.type) == h.value,
|
|
2403
|
+
"hover:bg-fm-color-opacity-sm": ((k = e.modelValue) == null ? void 0 : k.type) != h.value
|
|
2394
2404
|
}]),
|
|
2395
2405
|
onClick: () => {
|
|
2396
|
-
var p,
|
|
2397
|
-
((p = e.modelValue) == null ? void 0 : p.type) !=
|
|
2406
|
+
var p, u;
|
|
2407
|
+
((p = e.modelValue) == null ? void 0 : p.type) != h.value && l("update:model-value", {
|
|
2398
2408
|
...e.modelValue,
|
|
2399
|
-
type:
|
|
2400
|
-
end: ((
|
|
2409
|
+
type: h.value,
|
|
2410
|
+
end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
|
|
2401
2411
|
});
|
|
2402
2412
|
},
|
|
2403
|
-
key:
|
|
2413
|
+
key: h.value
|
|
2404
2414
|
}, {
|
|
2405
2415
|
default: withCtx(() => [
|
|
2406
|
-
createElementVNode("div",
|
|
2407
|
-
createElementVNode("div",
|
|
2416
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(h.label), 1),
|
|
2417
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(h.description), 1)
|
|
2408
2418
|
]),
|
|
2409
2419
|
_: 2
|
|
2410
2420
|
}, 1032, ["class", "onClick"]);
|
|
2411
2421
|
}), 128))
|
|
2412
2422
|
])
|
|
2413
2423
|
]),
|
|
2414
|
-
createElementVNode("div",
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
createVNode(
|
|
2418
|
-
label: "
|
|
2419
|
-
"model-value": ((
|
|
2420
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
2421
|
-
var
|
|
2422
|
-
return
|
|
2424
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
2425
|
+
createElementVNode("div", _hoisted_9$1, toDisplayString(unref(a)("connect.campaign.mission.collectionsRequired")), 1),
|
|
2426
|
+
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(a)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
2427
|
+
createVNode(y, {
|
|
2428
|
+
label: unref(a)("connect.campaign.mission.maximumToCollect"),
|
|
2429
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
2430
|
+
"onUpdate:modelValue": n[0] || (n[0] = (h) => {
|
|
2431
|
+
var x;
|
|
2432
|
+
return l("update:model-value", {
|
|
2423
2433
|
...e.modelValue,
|
|
2424
|
-
type: ((
|
|
2425
|
-
end:
|
|
2434
|
+
type: ((x = e.modelValue) == null ? void 0 : x.type) || "STAMP",
|
|
2435
|
+
end: h
|
|
2426
2436
|
});
|
|
2427
2437
|
}),
|
|
2428
|
-
"helper-text": unref(ZodHelper).helperText(unref(i), "end") || "
|
|
2438
|
+
"helper-text": unref(ZodHelper).helperText(unref(i), "end") || unref(a)("connect.campaign.mission.thresholdHelperText"),
|
|
2429
2439
|
"helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
|
|
2430
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
2440
|
+
}, null, 8, ["label", "model-value", "helper-text", "helper-state"])
|
|
2431
2441
|
])
|
|
2432
2442
|
]);
|
|
2433
2443
|
};
|
|
2434
2444
|
}
|
|
2435
|
-
})
|
|
2445
|
+
});
|
|
2446
|
+
function useLocaleText() {
|
|
2447
|
+
const { locale: e, t: m } = useI18n();
|
|
2448
|
+
function a(d, i) {
|
|
2449
|
+
return d ? d[e.value] ?? d["en-US"] ?? m(i) : m(i);
|
|
2450
|
+
}
|
|
2451
|
+
return { getLocaleText: a };
|
|
2452
|
+
}
|
|
2453
|
+
const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
2436
2454
|
__name: "TemplateInput",
|
|
2437
2455
|
props: {
|
|
2438
2456
|
field: { type: Object, required: !0 },
|
|
@@ -2458,39 +2476,39 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2458
2476
|
}
|
|
2459
2477
|
},
|
|
2460
2478
|
emits: ["update:model-value", "update:file"],
|
|
2461
|
-
setup(e, { emit:
|
|
2462
|
-
const { t:
|
|
2463
|
-
function
|
|
2479
|
+
setup(e, { emit: m }) {
|
|
2480
|
+
const { t: a } = useI18n(), { getLocaleText: d } = useLocaleText(), i = e, s = m;
|
|
2481
|
+
function l(y) {
|
|
2464
2482
|
switch (i.field.type) {
|
|
2465
2483
|
case "timeframe":
|
|
2466
|
-
const
|
|
2467
|
-
|
|
2484
|
+
const v = y.startDate ? hooks(y.startDate).startOf("day").toISOString() : void 0, h = y.endDate ? hooks(y.endDate).endOf("day").toISOString() : void 0;
|
|
2485
|
+
s("update:model-value", {
|
|
2468
2486
|
type: "timeframe",
|
|
2469
2487
|
property: "__now",
|
|
2470
|
-
start:
|
|
2471
|
-
end:
|
|
2488
|
+
start: v,
|
|
2489
|
+
end: h
|
|
2472
2490
|
});
|
|
2473
2491
|
break;
|
|
2474
2492
|
case "image": {
|
|
2475
|
-
|
|
2493
|
+
s(
|
|
2476
2494
|
"update:file",
|
|
2477
|
-
|
|
2478
|
-
o.value || firebaseStorage.collectibleImagePath(void 0,
|
|
2495
|
+
y,
|
|
2496
|
+
o.value || firebaseStorage.collectibleImagePath(void 0, y)
|
|
2479
2497
|
);
|
|
2480
2498
|
break;
|
|
2481
2499
|
}
|
|
2482
2500
|
default:
|
|
2483
|
-
|
|
2501
|
+
s("update:model-value", y);
|
|
2484
2502
|
break;
|
|
2485
2503
|
}
|
|
2486
2504
|
}
|
|
2487
2505
|
const o = computed(() => {
|
|
2488
2506
|
switch (i.field.type) {
|
|
2489
2507
|
case "timeframe": {
|
|
2490
|
-
const
|
|
2508
|
+
const y = i.modelValue;
|
|
2491
2509
|
return {
|
|
2492
|
-
startDate:
|
|
2493
|
-
endDate:
|
|
2510
|
+
startDate: y != null && y.start ? hooks(y == null ? void 0 : y.start).format("YYYY-MM-DD") : null,
|
|
2511
|
+
endDate: y != null && y.end ? hooks(y == null ? void 0 : y.end).format("YYYY-MM-DD") : null
|
|
2494
2512
|
};
|
|
2495
2513
|
}
|
|
2496
2514
|
default:
|
|
@@ -2498,61 +2516,64 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2498
2516
|
}
|
|
2499
2517
|
});
|
|
2500
2518
|
function n() {
|
|
2501
|
-
if (!
|
|
2502
|
-
const
|
|
2503
|
-
return
|
|
2519
|
+
if (!r.value.schema) return [];
|
|
2520
|
+
const y = r.value.schema.safeParse(i.modelValue);
|
|
2521
|
+
return y.success ? [] : y.error.errors;
|
|
2504
2522
|
}
|
|
2505
|
-
const
|
|
2523
|
+
const r = computed(() => ({
|
|
2506
2524
|
schema: i.schema,
|
|
2507
2525
|
unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
|
|
2508
2526
|
rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
|
|
2509
2527
|
labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
|
|
2510
|
-
zodLabel: i.schema ? ZodHelper.toInputLabel(
|
|
2528
|
+
zodLabel: i.schema ? ZodHelper.toInputLabel(
|
|
2529
|
+
i.schema,
|
|
2530
|
+
d(i.field.label_locale, i.field.label ?? "")
|
|
2531
|
+
) : void 0
|
|
2511
2532
|
}));
|
|
2512
|
-
return (
|
|
2513
|
-
var
|
|
2514
|
-
const
|
|
2515
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
2533
|
+
return (y, v) => {
|
|
2534
|
+
var c, f, B, b, E;
|
|
2535
|
+
const h = resolveComponent("FmTextField"), x = resolveComponent("FmStepperField"), k = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), u = resolveComponent("FmSwitch");
|
|
2536
|
+
return e.field.type === "text" ? (openBlock(), createBlock(h, {
|
|
2516
2537
|
key: 0,
|
|
2517
|
-
label: unref(
|
|
2518
|
-
"label-mark": unref(
|
|
2519
|
-
rules: unref(
|
|
2538
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2539
|
+
"label-mark": unref(r).labelMark,
|
|
2540
|
+
rules: unref(r).rules,
|
|
2520
2541
|
"model-value": unref(o),
|
|
2521
|
-
"onUpdate:modelValue":
|
|
2542
|
+
"onUpdate:modelValue": l,
|
|
2522
2543
|
"helper-state": e.helperText ? "error" : void 0,
|
|
2523
2544
|
"helper-text": e.helperText
|
|
2524
2545
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2525
2546
|
createVNode(JsonViewer, {
|
|
2526
|
-
json: { schema: unref(
|
|
2547
|
+
json: { schema: unref(r).unwrapped, props: i }
|
|
2527
2548
|
}, null, 8, ["json"]),
|
|
2528
|
-
createVNode(
|
|
2529
|
-
label: unref(
|
|
2530
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(
|
|
2549
|
+
createVNode(x, {
|
|
2550
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2551
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
|
|
2531
2552
|
"model-value": unref(o),
|
|
2532
|
-
rules: e.field.isRuleChildren ? [] : unref(
|
|
2533
|
-
"onUpdate:modelValue":
|
|
2553
|
+
rules: e.field.isRuleChildren ? [] : unref(r).rules,
|
|
2554
|
+
"onUpdate:modelValue": l,
|
|
2534
2555
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
2535
2556
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
2536
2557
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2537
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
2558
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(k, {
|
|
2538
2559
|
key: 2,
|
|
2539
|
-
label: unref(
|
|
2540
|
-
"label-mark": unref(
|
|
2541
|
-
rules: unref(
|
|
2560
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2561
|
+
"label-mark": unref(r).labelMark,
|
|
2562
|
+
rules: unref(r).rules,
|
|
2542
2563
|
"model-value": unref(o),
|
|
2543
|
-
"onUpdate:modelValue":
|
|
2564
|
+
"onUpdate:modelValue": l,
|
|
2544
2565
|
"show-word-count": "",
|
|
2545
|
-
"max-length": (
|
|
2566
|
+
"max-length": (E = (b = (B = (f = (c = unref(r)) == null ? void 0 : c.unwrapped) == null ? void 0 : f._def) == null ? void 0 : B.checks) == null ? void 0 : b.find((N) => N.kind == "max")) == null ? void 0 : E.value
|
|
2546
2567
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$i, {
|
|
2547
2568
|
key: 3,
|
|
2548
2569
|
"campaign-type": e.extras,
|
|
2549
2570
|
"model-value": unref(o),
|
|
2550
2571
|
disabled: e.disabled,
|
|
2551
|
-
"onUpdate:modelValue":
|
|
2572
|
+
"onUpdate:modelValue": l
|
|
2552
2573
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2553
2574
|
createVNode(_sfc_main$g, {
|
|
2554
2575
|
"model-value": unref(o),
|
|
2555
|
-
"onUpdate:modelValue":
|
|
2576
|
+
"onUpdate:modelValue": l
|
|
2556
2577
|
}, null, 8, ["model-value"]),
|
|
2557
2578
|
createVNode(p, {
|
|
2558
2579
|
class: "!mt-[8px]",
|
|
@@ -2564,63 +2585,63 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2564
2585
|
thumbnail: unref(o),
|
|
2565
2586
|
"aspect-ratio": "16 / 9",
|
|
2566
2587
|
class: "w-1/2 xs:w-2/3",
|
|
2567
|
-
"onUpdate:file":
|
|
2588
|
+
"onUpdate:file": l
|
|
2568
2589
|
}, {
|
|
2569
2590
|
label: withCtx(() => [
|
|
2570
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
2591
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
|
|
2571
2592
|
]),
|
|
2572
2593
|
_: 1
|
|
2573
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
2594
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(u, {
|
|
2574
2595
|
key: 6,
|
|
2575
|
-
label: unref(
|
|
2596
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2576
2597
|
"label-placement": "right",
|
|
2577
2598
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2578
|
-
"label-mark": unref(
|
|
2579
|
-
rules: unref(
|
|
2599
|
+
"label-mark": unref(r).labelMark,
|
|
2600
|
+
rules: unref(r).rules,
|
|
2580
2601
|
"model-value": unref(o),
|
|
2581
|
-
"onUpdate:modelValue":
|
|
2602
|
+
"onUpdate:modelValue": l
|
|
2582
2603
|
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$v, {
|
|
2583
2604
|
key: 7,
|
|
2584
2605
|
"model-value": unref(o),
|
|
2585
|
-
"onUpdate:modelValue":
|
|
2606
|
+
"onUpdate:modelValue": l,
|
|
2586
2607
|
"no-campaign": !1,
|
|
2587
|
-
schema: unref(
|
|
2608
|
+
schema: unref(r).schema,
|
|
2588
2609
|
"is-mission": e.extras === "MISSION"
|
|
2589
2610
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "grab_conditions" ? (openBlock(), createBlock(GrabConditionsInput, {
|
|
2590
2611
|
key: 8,
|
|
2591
2612
|
"model-value": unref(o),
|
|
2592
|
-
"onUpdate:modelValue":
|
|
2593
|
-
schema: unref(
|
|
2613
|
+
"onUpdate:modelValue": l,
|
|
2614
|
+
schema: unref(r).schema
|
|
2594
2615
|
}, null, 8, ["model-value", "schema"])) : e.field.type === "grab_quota" ? (openBlock(), createBlock(_sfc_main$9, {
|
|
2595
2616
|
key: 9,
|
|
2596
2617
|
"model-value": unref(o),
|
|
2597
|
-
"onUpdate:modelValue":
|
|
2598
|
-
schema: unref(
|
|
2618
|
+
"onUpdate:modelValue": l,
|
|
2619
|
+
schema: unref(r).schema
|
|
2599
2620
|
}, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$w, {
|
|
2600
2621
|
key: 10,
|
|
2601
2622
|
"model-value": unref(o),
|
|
2602
|
-
"onUpdate:modelValue":
|
|
2623
|
+
"onUpdate:modelValue": l
|
|
2603
2624
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 11 }, [
|
|
2604
2625
|
createVNode(_sfc_main$x, {
|
|
2605
2626
|
"model-value": unref(o),
|
|
2606
|
-
"onUpdate:modelValue":
|
|
2627
|
+
"onUpdate:modelValue": l,
|
|
2607
2628
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2608
2629
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2609
2630
|
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
|
|
2610
2631
|
key: 0,
|
|
2611
2632
|
class: "!mt-[8px]",
|
|
2612
|
-
text: unref(
|
|
2633
|
+
text: unref(a)("connect.campaign.common.effect_required"),
|
|
2613
2634
|
state: "error"
|
|
2614
2635
|
}, null, 8, ["text"]))
|
|
2615
2636
|
], 64)) : e.field.type == "grab_effect" ? (openBlock(), createElementBlock(Fragment, { key: 12 }, [
|
|
2616
2637
|
createVNode(GrabEffectSheet, {
|
|
2617
2638
|
"model-value": unref(o),
|
|
2618
|
-
"onUpdate:modelValue":
|
|
2639
|
+
"onUpdate:modelValue": l
|
|
2619
2640
|
}, null, 8, ["model-value"]),
|
|
2620
2641
|
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
|
|
2621
2642
|
key: 0,
|
|
2622
2643
|
class: "!mt-[8px]",
|
|
2623
|
-
text: unref(
|
|
2644
|
+
text: unref(a)("connect.campaign.common.effect_required"),
|
|
2624
2645
|
state: "error"
|
|
2625
2646
|
}, null, 8, ["text"]))
|
|
2626
2647
|
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
@@ -2628,54 +2649,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2628
2649
|
"allow-email": !0,
|
|
2629
2650
|
"allow-whatsapp": !0,
|
|
2630
2651
|
"model-value": unref(o),
|
|
2631
|
-
"onUpdate:modelValue":
|
|
2652
|
+
"onUpdate:modelValue": l,
|
|
2632
2653
|
"helper-text": unref(ZodHelper).helperText(n(), ""),
|
|
2633
2654
|
"trigger-type": e.field.extras,
|
|
2634
2655
|
"helper-state": unref(ZodHelper).helperState(n(), "")
|
|
2635
2656
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
2636
2657
|
key: 14,
|
|
2637
2658
|
"model-value": unref(o),
|
|
2638
|
-
"onUpdate:modelValue":
|
|
2659
|
+
"onUpdate:modelValue": l,
|
|
2639
2660
|
extras: e.extras,
|
|
2640
2661
|
"error-text": e.helperText
|
|
2641
2662
|
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$s, {
|
|
2642
2663
|
key: 15,
|
|
2643
2664
|
type: "custom",
|
|
2644
2665
|
"model-value": unref(o),
|
|
2645
|
-
"onUpdate:modelValue":
|
|
2666
|
+
"onUpdate:modelValue": l,
|
|
2646
2667
|
"helper-text": e.helperText || unref(ZodHelper).helperText(n(), ""),
|
|
2647
2668
|
"for-credit": i.campaignType === "CREDIT"
|
|
2648
2669
|
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
2649
2670
|
key: 16,
|
|
2650
2671
|
"model-value": unref(o),
|
|
2651
|
-
"onUpdate:modelValue":
|
|
2672
|
+
"onUpdate:modelValue": l
|
|
2652
2673
|
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
2653
2674
|
key: 17,
|
|
2654
2675
|
"model-value": unref(o),
|
|
2655
|
-
"onUpdate:modelValue":
|
|
2676
|
+
"onUpdate:modelValue": l
|
|
2656
2677
|
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
2657
2678
|
key: 18,
|
|
2658
2679
|
"model-value": unref(o),
|
|
2659
|
-
"onUpdate:modelValue":
|
|
2680
|
+
"onUpdate:modelValue": l
|
|
2660
2681
|
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
2661
2682
|
key: 19,
|
|
2662
2683
|
"model-value": unref(o),
|
|
2663
|
-
"onUpdate:modelValue":
|
|
2684
|
+
"onUpdate:modelValue": l
|
|
2664
2685
|
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
2665
2686
|
key: 20,
|
|
2666
2687
|
"model-value": unref(o),
|
|
2667
|
-
"onUpdate:modelValue":
|
|
2688
|
+
"onUpdate:modelValue": l,
|
|
2668
2689
|
"helper-text": unref(ZodHelper).helperText(n(), ""),
|
|
2669
2690
|
"helper-state": unref(ZodHelper).helperState(n(), "")
|
|
2670
2691
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
2671
2692
|
key: 21,
|
|
2672
2693
|
"model-value": unref(o),
|
|
2673
|
-
"onUpdate:modelValue":
|
|
2694
|
+
"onUpdate:modelValue": l,
|
|
2674
2695
|
mission: e.extras.mission
|
|
2675
2696
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
2676
2697
|
createVNode(_sfc_main$f, {
|
|
2677
2698
|
"model-value": unref(o),
|
|
2678
|
-
"onUpdate:modelValue":
|
|
2699
|
+
"onUpdate:modelValue": l,
|
|
2679
2700
|
"start-date": e.extras.start,
|
|
2680
2701
|
"end-date": e.extras.end
|
|
2681
2702
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
@@ -2688,7 +2709,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2688
2709
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
2689
2710
|
createVNode(_sfc_main$z, {
|
|
2690
2711
|
"model-value": unref(o),
|
|
2691
|
-
"onUpdate:modelValue":
|
|
2712
|
+
"onUpdate:modelValue": l
|
|
2692
2713
|
}, null, 8, ["model-value"]),
|
|
2693
2714
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
2694
2715
|
key: 0,
|
|
@@ -2704,7 +2725,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2704
2725
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2705
2726
|
createVNode(_sfc_main$k, {
|
|
2706
2727
|
"model-value": unref(o),
|
|
2707
|
-
"onUpdate:modelValue":
|
|
2728
|
+
"onUpdate:modelValue": l
|
|
2708
2729
|
}, null, 8, ["model-value"]),
|
|
2709
2730
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
2710
2731
|
key: 1,
|
|
@@ -2715,7 +2736,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2715
2736
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
2716
2737
|
createVNode(_sfc_main$A, {
|
|
2717
2738
|
"model-value": unref(o),
|
|
2718
|
-
"onUpdate:modelValue":
|
|
2739
|
+
"onUpdate:modelValue": l
|
|
2719
2740
|
}, null, 8, ["model-value"]),
|
|
2720
2741
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
2721
2742
|
key: 0,
|
|
@@ -2726,7 +2747,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2726
2747
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 26 }, [
|
|
2727
2748
|
createVNode(_sfc_main$B, {
|
|
2728
2749
|
"model-value": unref(o),
|
|
2729
|
-
"onUpdate:modelValue":
|
|
2750
|
+
"onUpdate:modelValue": l
|
|
2730
2751
|
}, null, 8, ["model-value"]),
|
|
2731
2752
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
2732
2753
|
key: 0,
|
|
@@ -2737,7 +2758,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2737
2758
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 27 }, [
|
|
2738
2759
|
createVNode(_sfc_main$j, {
|
|
2739
2760
|
"model-value": unref(o),
|
|
2740
|
-
"onUpdate:modelValue":
|
|
2761
|
+
"onUpdate:modelValue": l
|
|
2741
2762
|
}, null, 8, ["model-value"]),
|
|
2742
2763
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
2743
2764
|
key: 0,
|
|
@@ -2748,7 +2769,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2748
2769
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 28 }, [
|
|
2749
2770
|
createVNode(_sfc_main$b, {
|
|
2750
2771
|
"model-value": unref(o),
|
|
2751
|
-
"onUpdate:modelValue":
|
|
2772
|
+
"onUpdate:modelValue": l
|
|
2752
2773
|
}, null, 8, ["model-value"]),
|
|
2753
2774
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
2754
2775
|
key: 0,
|
|
@@ -2768,23 +2789,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2768
2789
|
}
|
|
2769
2790
|
},
|
|
2770
2791
|
setup(e) {
|
|
2771
|
-
const { t:
|
|
2772
|
-
return (
|
|
2773
|
-
const
|
|
2774
|
-
return openBlock(), createBlock(
|
|
2792
|
+
const { t: m, te: a } = useI18n();
|
|
2793
|
+
return (d, i) => {
|
|
2794
|
+
const s = resolveComponent("FmCard");
|
|
2795
|
+
return openBlock(), createBlock(s, {
|
|
2775
2796
|
variant: "outlined",
|
|
2776
2797
|
class: "p-16 space-y-8"
|
|
2777
2798
|
}, {
|
|
2778
2799
|
default: withCtx(() => [
|
|
2779
|
-
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(
|
|
2780
|
-
|
|
2781
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
2800
|
+
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
|
|
2801
|
+
i[0] || (i[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
2802
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
|
|
2782
2803
|
class: "space-y-4",
|
|
2783
|
-
key:
|
|
2804
|
+
key: o
|
|
2784
2805
|
}, [
|
|
2785
|
-
|
|
2786
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(
|
|
2787
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(
|
|
2806
|
+
l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2807
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${o}`)), 1),
|
|
2808
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(a)(`${l}`) ? unref(m)(`${l}`) : l), 1)
|
|
2788
2809
|
], 64)) : createCommentVNode("", !0)
|
|
2789
2810
|
]))), 128))
|
|
2790
2811
|
]),
|
|
@@ -2799,32 +2820,36 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2799
2820
|
__name: "EditCampaignSheet",
|
|
2800
2821
|
emits: ["submit:model-value"],
|
|
2801
2822
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2802
|
-
const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
2823
|
+
const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
2803
2824
|
TEMPLATES.VOUCHER
|
|
2804
2825
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
|
|
2805
2826
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
2806
|
-
var e,
|
|
2827
|
+
var e, m;
|
|
2807
2828
|
if (sheetVisible.value = visible, campaignType.value = type, visible == !0) {
|
|
2808
2829
|
try {
|
|
2809
2830
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
2810
2831
|
} catch {
|
|
2811
2832
|
} finally {
|
|
2812
|
-
await new Promise((
|
|
2833
|
+
await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
|
|
2813
2834
|
}
|
|
2814
2835
|
console.log(
|
|
2815
2836
|
TEMPLATES[type],
|
|
2816
2837
|
"base template"
|
|
2817
|
-
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
2818
|
-
|
|
2819
|
-
(
|
|
2820
|
-
) &&
|
|
2838
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, d) => {
|
|
2839
|
+
a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
|
|
2840
|
+
(i) => i.code === a.campaign.code && i._id.toString() !== a.campaign._id.toString()
|
|
2841
|
+
) && d.addIssue({
|
|
2821
2842
|
code: "custom",
|
|
2822
2843
|
message: "Code already exists, please use another code",
|
|
2823
2844
|
path: ["campaign", "code"]
|
|
2824
2845
|
});
|
|
2825
2846
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
2826
|
-
...(
|
|
2827
|
-
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ?
|
|
2847
|
+
...(m = template.value) == null ? void 0 : m.defaultValue
|
|
2848
|
+
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? t("connect.campaign.common.edit_campaign_title", {
|
|
2849
|
+
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
2850
|
+
}) : t("connect.campaign.common.create_campaign_title", {
|
|
2851
|
+
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
2852
|
+
});
|
|
2828
2853
|
}
|
|
2829
2854
|
}
|
|
2830
2855
|
async function hideSheet() {
|
|
@@ -2850,11 +2875,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2850
2875
|
return e.success ? [] : e.error.errors;
|
|
2851
2876
|
});
|
|
2852
2877
|
function stepErrors(e = currentStep.value - 1) {
|
|
2853
|
-
const
|
|
2854
|
-
(
|
|
2878
|
+
const m = template.value.steps[e].groups.flatMap(
|
|
2879
|
+
(a) => a.fields.map((d) => d.property)
|
|
2855
2880
|
);
|
|
2856
2881
|
return errors.value.filter(
|
|
2857
|
-
(
|
|
2882
|
+
(a) => m.some((d) => a.path.join(".").includes(d))
|
|
2858
2883
|
);
|
|
2859
2884
|
}
|
|
2860
2885
|
__expose({ showSheet });
|
|
@@ -2867,17 +2892,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2867
2892
|
}
|
|
2868
2893
|
});
|
|
2869
2894
|
}
|
|
2870
|
-
function onUpdateProperty(e,
|
|
2871
|
-
var
|
|
2872
|
-
if (_.set(data.value, e,
|
|
2873
|
-
const
|
|
2874
|
-
...(
|
|
2895
|
+
function onUpdateProperty(e, m) {
|
|
2896
|
+
var a, d, i, s, l, o, n, r;
|
|
2897
|
+
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
2898
|
+
const v = ((s = (i = (d = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : d.campaign) == null ? void 0 : i.event) == null ? void 0 : s.rule) ? _.cloneDeep({
|
|
2899
|
+
...(r = (n = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : n.event) == null ? void 0 : r.rule
|
|
2875
2900
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
2876
2901
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2877
2902
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
2878
2903
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
2879
2904
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
2880
|
-
]),
|
|
2905
|
+
]), h = RuleBuilder.setRuleToGroup(
|
|
2881
2906
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2882
2907
|
[
|
|
2883
2908
|
RuleBuilder.constructEntry(
|
|
@@ -2889,29 +2914,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2889
2914
|
],
|
|
2890
2915
|
"&&"
|
|
2891
2916
|
);
|
|
2892
|
-
if (
|
|
2893
|
-
_.set(data.value, "campaign.event.rule",
|
|
2917
|
+
if (m != "SCHEDULE") {
|
|
2918
|
+
_.set(data.value, "campaign.event.rule", v);
|
|
2894
2919
|
return;
|
|
2895
2920
|
}
|
|
2896
2921
|
_.set(
|
|
2897
2922
|
data.value,
|
|
2898
2923
|
"campaign.event.rule",
|
|
2899
|
-
RuleBuilder.setRuleToGroup(
|
|
2924
|
+
RuleBuilder.setRuleToGroup(v, h)
|
|
2900
2925
|
);
|
|
2901
2926
|
}
|
|
2902
|
-
e == "campaign.notify" &&
|
|
2927
|
+
e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
2903
2928
|
}
|
|
2904
|
-
async function onUpdateFile(e,
|
|
2905
|
-
return e ? await minor(async () => firebaseStorage.update(
|
|
2929
|
+
async function onUpdateFile(e, m) {
|
|
2930
|
+
return e ? await minor(async () => firebaseStorage.update(m, e), {
|
|
2906
2931
|
message: `${e ? "Uploading" : "Removing"} file`,
|
|
2907
2932
|
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
2908
2933
|
}) : "";
|
|
2909
2934
|
}
|
|
2910
2935
|
function isDisable(e) {
|
|
2911
|
-
var
|
|
2936
|
+
var m, a;
|
|
2912
2937
|
switch (e == null ? void 0 : e.property) {
|
|
2913
2938
|
case "campaign.event.type":
|
|
2914
|
-
return ((
|
|
2939
|
+
return ((a = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : a._id) || !1;
|
|
2915
2940
|
default:
|
|
2916
2941
|
return !1;
|
|
2917
2942
|
}
|
|
@@ -2920,32 +2945,32 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2920
2945
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
2921
2946
|
if (!e.success)
|
|
2922
2947
|
return;
|
|
2923
|
-
const
|
|
2948
|
+
const m = await emits(
|
|
2924
2949
|
"submit:model-value",
|
|
2925
2950
|
cleanPF(JSON.parse(JSON.stringify(e.data)))
|
|
2926
2951
|
);
|
|
2927
|
-
(
|
|
2952
|
+
(m || m === void 0) && (sheetVisible.value = !1);
|
|
2928
2953
|
}
|
|
2929
|
-
return (e,
|
|
2930
|
-
const
|
|
2931
|
-
return openBlock(), createBlock(
|
|
2954
|
+
return (e, m) => {
|
|
2955
|
+
const a = resolveComponent("FmButton"), d = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2956
|
+
return openBlock(), createBlock(l, {
|
|
2932
2957
|
"fullscreen-size": "lg",
|
|
2933
2958
|
modelValue: unref(sheetVisible),
|
|
2934
2959
|
"onUpdate:modelValue": [
|
|
2935
|
-
|
|
2936
|
-
|
|
2960
|
+
m[7] || (m[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
|
|
2961
|
+
m[8] || (m[8] = (o) => sheetVisible.value = o)
|
|
2937
2962
|
]
|
|
2938
2963
|
}, createSlots({
|
|
2939
2964
|
"top-sheet-header": withCtx(() => [
|
|
2940
2965
|
createElementVNode("div", _hoisted_1, [
|
|
2941
2966
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2942
2967
|
createElementVNode("div", _hoisted_2, [
|
|
2943
|
-
createVNode(
|
|
2944
|
-
onClick:
|
|
2968
|
+
createVNode(a, {
|
|
2969
|
+
onClick: m[0] || (m[0] = (o) => hideSheet()),
|
|
2945
2970
|
label: unref(t)("connect.campaign.common.cancel"),
|
|
2946
2971
|
variant: "tertiary"
|
|
2947
2972
|
}, null, 8, ["label"]),
|
|
2948
|
-
createVNode(
|
|
2973
|
+
createVNode(a, {
|
|
2949
2974
|
onClick: onSubmit,
|
|
2950
2975
|
label: unref(t)("connect.campaign.common.save"),
|
|
2951
2976
|
disabled: unref(errors).length > 0
|
|
@@ -2961,7 +2986,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2961
2986
|
createElementVNode("div", _hoisted_9, [
|
|
2962
2987
|
createElementVNode("div", _hoisted_10, [
|
|
2963
2988
|
createElementVNode("div", _hoisted_11, [
|
|
2964
|
-
|
|
2989
|
+
m[9] || (m[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
|
|
2965
2990
|
createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
|
|
2966
2991
|
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2967
2992
|
createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
@@ -2983,7 +3008,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2983
3008
|
])
|
|
2984
3009
|
])
|
|
2985
3010
|
], -1)),
|
|
2986
|
-
createVNode(
|
|
3011
|
+
createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2987
3012
|
])
|
|
2988
3013
|
])
|
|
2989
3014
|
])
|
|
@@ -2993,51 +3018,51 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2993
3018
|
name: "default",
|
|
2994
3019
|
fn: withCtx(() => [
|
|
2995
3020
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2996
|
-
createVNode(
|
|
3021
|
+
createVNode(i, {
|
|
2997
3022
|
modelValue: unref(currentStep),
|
|
2998
|
-
"onUpdate:modelValue":
|
|
3023
|
+
"onUpdate:modelValue": m[1] || (m[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
2999
3024
|
orientation: "horizontal",
|
|
3000
3025
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
3001
3026
|
}, {
|
|
3002
3027
|
default: withCtx(() => [
|
|
3003
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
3004
|
-
key:
|
|
3005
|
-
title: unref(
|
|
3006
|
-
value:
|
|
3007
|
-
error: () => stepErrors(
|
|
3008
|
-
complete: () =>
|
|
3028
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(d, {
|
|
3029
|
+
key: o.name,
|
|
3030
|
+
title: unref(getLocaleText)(o.name_locale, o.name),
|
|
3031
|
+
value: n + 1,
|
|
3032
|
+
error: () => stepErrors(n).length > 0,
|
|
3033
|
+
complete: () => n + 1 <= unref(currentStep)
|
|
3009
3034
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
3010
3035
|
]),
|
|
3011
3036
|
_: 1
|
|
3012
3037
|
}, 8, ["modelValue"]),
|
|
3013
3038
|
createElementVNode("div", _hoisted_4, [
|
|
3014
|
-
createVNode(
|
|
3039
|
+
createVNode(a, {
|
|
3015
3040
|
icon: "close",
|
|
3016
3041
|
variant: "tertiary",
|
|
3017
|
-
onClick:
|
|
3042
|
+
onClick: m[2] || (m[2] = (o) => sheetVisible.value = !1)
|
|
3018
3043
|
}),
|
|
3019
|
-
createVNode(
|
|
3044
|
+
createVNode(i, {
|
|
3020
3045
|
modelValue: unref(currentStep),
|
|
3021
|
-
"onUpdate:modelValue":
|
|
3046
|
+
"onUpdate:modelValue": m[3] || (m[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
3022
3047
|
orientation: "horizontal",
|
|
3023
3048
|
class: "flex-1"
|
|
3024
3049
|
}, {
|
|
3025
3050
|
default: withCtx(() => [
|
|
3026
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
3027
|
-
key:
|
|
3051
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(d, {
|
|
3052
|
+
key: o.name,
|
|
3028
3053
|
title: unref(sheetTitle),
|
|
3029
|
-
description: unref(
|
|
3030
|
-
value:
|
|
3031
|
-
error: () => stepErrors(
|
|
3032
|
-
complete: () =>
|
|
3054
|
+
description: unref(getLocaleText)(o.name_locale, o.name),
|
|
3055
|
+
value: n + 1,
|
|
3056
|
+
error: () => stepErrors(n).length > 0,
|
|
3057
|
+
complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
3033
3058
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
3034
3059
|
]),
|
|
3035
3060
|
_: 1
|
|
3036
3061
|
}, 8, ["modelValue"]),
|
|
3037
|
-
createVNode(
|
|
3062
|
+
createVNode(a, {
|
|
3038
3063
|
icon: "info",
|
|
3039
3064
|
variant: "tertiary",
|
|
3040
|
-
onClick:
|
|
3065
|
+
onClick: m[4] || (m[4] = () => showSummaryDialog())
|
|
3041
3066
|
})
|
|
3042
3067
|
]),
|
|
3043
3068
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -3046,55 +3071,55 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3046
3071
|
json: {
|
|
3047
3072
|
data: unref(data),
|
|
3048
3073
|
errors: unref(errors).map(
|
|
3049
|
-
(
|
|
3074
|
+
(o) => `${o.path.join(".")} - ${o.message}`
|
|
3050
3075
|
),
|
|
3051
3076
|
stepErrors: stepErrors().map(
|
|
3052
|
-
(
|
|
3077
|
+
(o) => `${o.path.join(".")} - ${o.message}`
|
|
3053
3078
|
),
|
|
3054
3079
|
schema: unref(schema)
|
|
3055
3080
|
}
|
|
3056
3081
|
}, null, 8, ["json"]),
|
|
3057
3082
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
3058
|
-
(
|
|
3059
|
-
), (
|
|
3060
|
-
key:
|
|
3083
|
+
(o) => o.fields.length && (!o.condition || (Array.isArray(o.condition) ? o.condition.every((n) => unref(_).get(unref(data), n.property) == n.value == (n.not != !0)) : unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0)))
|
|
3084
|
+
), (o, n) => (openBlock(), createElementBlock("div", {
|
|
3085
|
+
key: n,
|
|
3061
3086
|
class: "space-y-24"
|
|
3062
3087
|
}, [
|
|
3063
|
-
createElementVNode("div", _hoisted_7, toDisplayString(
|
|
3064
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3088
|
+
createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(o.name_locale, o.name ?? "")), 1),
|
|
3089
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (r, y) => (openBlock(), createElementBlock("div", { key: y }, [
|
|
3065
3090
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
3066
|
-
key:
|
|
3067
|
-
field:
|
|
3068
|
-
modelValue: unref(_).get(unref(data),
|
|
3069
|
-
disabled: isDisable(
|
|
3091
|
+
key: y,
|
|
3092
|
+
field: r,
|
|
3093
|
+
modelValue: unref(_).get(unref(data), r.property),
|
|
3094
|
+
disabled: isDisable(r),
|
|
3070
3095
|
"campaign-type": unref(campaignType),
|
|
3071
|
-
"onUpdate:modelValue": (
|
|
3072
|
-
"onUpdate:file": async (
|
|
3073
|
-
const
|
|
3074
|
-
onUpdateProperty(
|
|
3096
|
+
"onUpdate:modelValue": (v) => onUpdateProperty(r.property, v),
|
|
3097
|
+
"onUpdate:file": async (v, h) => {
|
|
3098
|
+
const x = await onUpdateFile(v, h);
|
|
3099
|
+
onUpdateProperty(r.property, x || "");
|
|
3075
3100
|
},
|
|
3076
3101
|
schema: unref(ZodHelper).typeAtPath(
|
|
3077
3102
|
unref(schema),
|
|
3078
|
-
|
|
3103
|
+
r.property,
|
|
3079
3104
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
3080
3105
|
),
|
|
3081
|
-
"helper-state": unref(ZodHelper).helperState(unref(errors),
|
|
3082
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
3083
|
-
extras:
|
|
3106
|
+
"helper-state": unref(ZodHelper).helperState(unref(errors), r.property),
|
|
3107
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), r.property),
|
|
3108
|
+
extras: r.extras != null ? r.extras == "" ? unref(data) : unref(_).get(unref(data), r.extras) : void 0
|
|
3084
3109
|
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
3085
3110
|
]))), 128))
|
|
3086
3111
|
]))), 128)),
|
|
3087
3112
|
createElementVNode("div", _hoisted_8, [
|
|
3088
|
-
createVNode(
|
|
3089
|
-
label: "
|
|
3113
|
+
createVNode(a, {
|
|
3114
|
+
label: unref(t)("connect.common.back"),
|
|
3090
3115
|
variant: "tertiary",
|
|
3091
3116
|
disabled: unref(currentStep) == 1,
|
|
3092
|
-
onClick:
|
|
3093
|
-
}, null, 8, ["disabled"]),
|
|
3094
|
-
createVNode(
|
|
3117
|
+
onClick: m[5] || (m[5] = (o) => currentStep.value--)
|
|
3118
|
+
}, null, 8, ["label", "disabled"]),
|
|
3119
|
+
createVNode(a, {
|
|
3095
3120
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
3096
|
-
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "
|
|
3097
|
-
onClick:
|
|
3121
|
+
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
|
|
3122
|
+
onClick: m[6] || (m[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
3098
3123
|
}, null, 8, ["disabled", "label"])
|
|
3099
3124
|
])
|
|
3100
3125
|
]),
|
|
@@ -3113,5 +3138,6 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3113
3138
|
});
|
|
3114
3139
|
export {
|
|
3115
3140
|
_sfc_main as _,
|
|
3116
|
-
summarizeGrabDiscount as s
|
|
3141
|
+
summarizeGrabDiscount as s,
|
|
3142
|
+
useLocaleText as u
|
|
3117
3143
|
};
|