@feedmepos/mf-connect 0.1.98-beta.71 → 0.1.98-beta.72
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/{App-B-Onur9k.js → App-DpYceiwG.js} +8 -8
- package/dist/{AuditLogs-BnEeKG1C.js → AuditLogs-CG98b2qE.js} +11 -11
- package/dist/{Bin-BH9_nATR.js → Bin-vdipv2fF.js} +8 -8
- package/dist/{Broadcast-Gt2ZLLpZ.js → Broadcast-ChwVqheE.js} +91 -90
- package/dist/{CampaignAnalytic-BT6zTgNk.js → CampaignAnalytic-4PHO849x.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-nNLLEzii.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DmnN4pjm.js} +6 -6
- package/dist/{Card-dD52oor7.js → Card-B6ol3PQw.js} +21 -21
- package/dist/{Collections-7bwYNl3M.js → Collections-DodNIUr1.js} +8 -8
- package/dist/{Credit-qZdlqXqR.js → Credit-CJQyAZYw.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js → DateRangeChip.vue_vue_type_script_setup_true_lang--FqHJ7Ez.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C09W9Qja.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CA31QP-A.js} +723 -659
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Bz1HRBMa.js → EffectSheet.vue_vue_type_style_index_0_lang-DkKhdp7G.js} +6 -6
- package/dist/{Experience-CAaWgWXP.js → Experience-iLAKddx_.js} +12 -12
- package/dist/{FileSaver.min-BpfY6VnX.js → FileSaver.min-w_ExQ0py.js} +1 -1
- package/dist/{Game-fhrbFb_5.js → Game-DWdUbsAg.js} +13 -13
- package/dist/{GiftCardSetup-CTwmNKim.js → GiftCardSetup-DnQ5vwxu.js} +10 -10
- package/dist/{Grab-BnPfb92x.js → Grab-CFLRHs5w.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js → ImageInput.vue_vue_type_script_setup_true_lang-uQJvjvTe.js} +1 -1
- package/dist/{Index-DRwvmm_j.js → Index-CUy4z2tS.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Ya4r9NNE.js → LocationPicker.vue_vue_type_script_setup_true_lang-hKJ41Fe_.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CDwtqqLQ.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BDmtqTVC.js} +1 -1
- package/dist/{LoyaltyDashboard-8jn6SIWo.js → LoyaltyDashboard-C5o7KriA.js} +13 -13
- package/dist/{MainLayout-Bf42AcB1.js → MainLayout-Dt0ywph3.js} +3 -3
- package/dist/{Marketing-DruTMjiR.js → Marketing-BHwxzBZ0.js} +4 -4
- package/dist/{MarketingMaterialEdit-moEHd_gP.js → MarketingMaterialEdit-B6k4ceGx.js} +6 -6
- package/dist/{Member-C9VTQqIm.js → Member-DcPZfTj6.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DEsVSWmv.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CiiBrlHY.js} +23 -23
- package/dist/{MemberImportHistory-DZVwya9v.js → MemberImportHistory-DmPMuu1g.js} +7 -7
- package/dist/{MemberList-KusIfy1u.js → MemberList-f9JejfNW.js} +14 -14
- package/dist/{MemberTransactions-msyjdzlI.js → MemberTransactions-D1YSXeX-.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DbV-m3cC.js → MessageInput.vue_vue_type_script_setup_true_lang-freeE-DP.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-m7ytg0ok.js} +1 -1
- package/dist/{Mission-CUUxpBUF.js → Mission-BaaEl5BV.js} +13 -13
- package/dist/{Overview-CYKoF8Hp.js → Overview-CviY55Gs.js} +4 -4
- package/dist/{Overview-C9jyKXHX.js → Overview-fx-0E3b8.js} +19 -19
- package/dist/{Point-CPpQ07yp.js → Point-BfqtflbC.js} +12 -12
- package/dist/{Promotion-CJ95m9Qb.js → Promotion-Be2ogRYt.js} +13 -13
- package/dist/{Queue-CX39ILh_.js → Queue-CLSUL-Cx.js} +11 -11
- package/dist/{Record-6I0qyXB5.js → Record-CpTMQT7B.js} +9 -9
- package/dist/{Review-DoWu2XNT.js → Review-DzSDx7dY.js} +2 -2
- package/dist/{ReviewFacebookCallback-Co-5TnI7.js → ReviewFacebookCallback-CvbPJADM.js} +5 -5
- package/dist/{ReviewGoogleCallback-Ca7ZuMcF.js → ReviewGoogleCallback-DJlqMbh3.js} +5 -5
- package/dist/{Reward-Cx_N6qBJ.js → Reward-DJOmd6Z5.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Cn5Yp37p.js → RewardGroup.vue_vue_type_script_setup_true_lang-DY9fYxwc.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-M0c67Dyl.js → RuleGroup.vue_vue_type_script_setup_true_lang-BgYK4hpo.js} +13 -13
- package/dist/{Segment-Bx0EW966.js → Segment-G6xmeEaq.js} +24 -24
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ahvrEUGa.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3O0biLZ.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-C7zSfZdl.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CWP5sGT7.js} +4 -4
- package/dist/{Setting-DzEK3dWj.js → Setting-CKp441AW.js} +14 -14
- package/dist/{SettingAdvertisements-BNALbI88.js → SettingAdvertisements-C4Uf-DgK.js} +12 -12
- package/dist/{Settings-Cw85-xzq.js → Settings-CTvMVwp6.js} +5 -5
- package/dist/{Store-BSqW1gwf.js → Store-Bzei6Xev.js} +25 -25
- package/dist/{StoreRewards-CJXnS8Qf.js → StoreRewards-DMQNIpF5.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C6tUwHEj.js → StoreTransactions.vue_vue_type_script_setup_true_lang-mm1jbcvo.js} +24 -24
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-iylphGuV.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BspBXIO2.js} +2 -2
- package/dist/{Tier-DfitNxp2.js → Tier-BN32RwYr.js} +25 -25
- package/dist/{Title-QCbtOvKB.js → Title-BIhgfRUI.js} +21 -21
- package/dist/{Transaction-dOCzlidD.js → Transaction-CPjA7IN9.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Be5X1C-Y.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DSutMvfk.js} +6 -6
- package/dist/{Voucher-BfoCDwjg.js → Voucher-CGJtn9bC.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-0EIYoZ0F.js → VoucherEditor.vue_vue_type_script_setup_true_lang-B-IwtPvx.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js → ZodTextField.vue_vue_type_script_setup_true_lang-Ce9xPwqA.js} +2 -2
- package/dist/{app-BxTElIm-.js → app-DAtx6aZ4.js} +182 -162
- package/dist/app.js +1 -1
- package/dist/{base.export-BmUK8hMh.js → base.export-BtRC4aWM.js} +2 -2
- package/dist/{business-DjAiT8tR.js → business-BZUIs8Ub.js} +1 -1
- package/dist/{campaign-tAmQNoq7.js → campaign-B6I6PuY4.js} +2 -2
- package/dist/{campaign-DlR3KF9m.js → campaign-DKjBjV2k.js} +138 -108
- package/dist/{campaign.enum-BjwEQd11.js → campaign.enum-BQy3e845.js} +1 -1
- package/dist/{campaign.fn-C6kWWIQx.js → campaign.fn--qVJ3jeH.js} +32 -32
- package/dist/{collectible.enum-BrtXpT9S.js → collectible.enum-vcvRFGl0.js} +1 -1
- package/dist/{collection.fn-CDhfM3Eq.js → collection.fn-C3bMPBkC.js} +2 -2
- package/dist/{currency-10nX5QnT.js → currency--R6VPInw.js} +1 -1
- package/dist/{duplicateCampaign-6oMZOvfM.js → duplicateCampaign-aIsX9cCi.js} +2 -2
- package/dist/{effect-T4YzuTc5.js → effect-CbjmtRph.js} +1 -1
- package/dist/{email-addresses-BjODnJMM.js → email-addresses-DZKMnoKf.js} +2 -2
- package/dist/{helper-BCl5r5yZ.js → helper-BGqw2-RO.js} +1 -1
- package/dist/{index-BeVWchv7.js → index-7TKoSEJ2.js} +5 -5
- package/dist/{index-BQk6zTgf.js → index-B9DM5Vuv.js} +2 -2
- package/dist/{index-DXiJa8Cw.js → index-BWlfW4Kr.js} +2 -2
- package/dist/{index-BxU--5J5.js → index-Bb4TieR_.js} +3 -3
- package/dist/{index-D8rGhchh.js → index-BbpqZrkB.js} +1 -1
- package/dist/{index-Ctja--IE.js → index-C22GPEM-.js} +1 -1
- package/dist/{index-BiolIgqR.js → index-CVYbfRGO.js} +1 -1
- package/dist/{index-C5IfNJUl.js → index-CVvSd60O.js} +1 -1
- package/dist/{index-DhtKt4OL.js → index-CXL5WAH0.js} +3 -3
- package/dist/{index-CnaQt4Pn.js → index-ClP7Xy6Q.js} +1 -1
- package/dist/{index-CRvUvCMA.js → index-D-P90w8K.js} +1 -1
- package/dist/{index-DeQKLilv.js → index-D_o9LsHU.js} +3 -3
- package/dist/{index-DJdTDF9C.js → index-DcA0B-Y5.js} +7 -7
- package/dist/{index-Bd4clHfr.js → index-FnsjvtSo.js} +5 -5
- package/dist/{index-B9ZMIUMa.js → index-LlFZ5kxi.js} +5 -5
- package/dist/{index-BBsK7TUw.js → index-LnCoUCnx.js} +3 -3
- package/dist/{index-Bz6oSli7.js → index-kkhrPH6s.js} +2 -2
- package/dist/{index-Bht1Z11w.js → index-v8Zv-2ko.js} +7 -7
- package/dist/{index.esm2017-CEOegJjn.js → index.esm2017-DO7bbE7J.js} +1 -1
- package/dist/{loading-Dx4SCvZY.js → loading-CzWOx4tE.js} +1 -1
- package/dist/{lodash-Dq8OKCKK.js → lodash-B_gr6Ayu.js} +1 -1
- package/dist/{member-import-DX-jn2uk.js → member-import-BxCrd9tq.js} +1 -1
- package/dist/{membership-CltAa-gH.js → membership-ILB4aB4h.js} +3 -3
- package/dist/{money-DsaAjJTI.js → money-CpIK1N_r.js} +1 -1
- package/dist/{number-DmhHKYgY.js → number-leVwmDCm.js} +1 -1
- package/dist/{objectid-BdNv-dZX.js → objectid-8hKuNcMN.js} +2 -2
- package/dist/{plugins-BFKVM3uC.js → plugins-DLIgnFIF.js} +3 -3
- package/dist/{reward--SjvIeyy.js → reward-DqT0zF01.js} +1 -1
- package/dist/{rule-CAKdNobZ.js → rule-DBtMGLxD.js} +8 -8
- package/dist/{template-Cfxc5eM8.js → template-CYKGCWY4.js} +6 -6
- package/dist/{timezone-D2b-V5XD.js → timezone-Brs5nrTL.js} +1 -1
- package/dist/{transaction.fn-B5mLY7bz.js → transaction.fn-0ZZcVp-j.js} +2 -2
- package/dist/{trigger-DvYcjRBZ.js → trigger-LhNre1L9.js} +5 -5
- package/dist/{useMarketingMaterialActions-DtqnjMSt.js → useMarketingMaterialActions-DbDRMmhM.js} +3 -3
- package/dist/{usePagination-DKX24g31.js → usePagination-DmZX0V64.js} +1 -1
- package/dist/{user-fWb1NxGO.js → user-CBPsvnx9.js} +1 -1
- package/dist/{vue-i18n-wJReAVJw.js → vue-i18n-BPeSHE3c.js} +157 -157
- package/dist/{xlsx-Mthhu4JR.js → xlsx-Cm3vGmLN.js} +1 -1
- package/dist/{zod-CVpVUgBZ.js → zod-GTEcy37q.js} +1 -1
- package/package.json +1 -1
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, isRef, createTextVNode, normalizeClass, watchEffect, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import { S as S6, f as Zh, z as z$1 } from "./app-
|
|
4
|
-
import { Z as ZodHelper } from "./zod-
|
|
5
|
-
import { F as FdoObjectId, z } from "./index-
|
|
6
|
-
import { e as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, f as FdtoRunnableCampaign, g as FdoCreditLoyaltyReward, h as FdtoRandomReward, i as F_MISSION_TYPE, j as FdoThresholdCreditReward, k as FdtoThresholdReward, l as FdoMission } from "./index-
|
|
7
|
-
import { F as FdtoCollectibleConfig } from "./index-
|
|
8
|
-
import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-
|
|
9
|
-
import { g as F_APP_INBOX_DESTINATION, A as APP_INBOX_BODY_LIMIT, t as toDelivery, h as toLegacyMessage } from "./index-
|
|
10
|
-
import {
|
|
11
|
-
import { u as
|
|
2
|
+
import { _ } from "./lodash-B_gr6Ayu.js";
|
|
3
|
+
import { S as S6, f as Zh, z as z$1 } from "./app-DAtx6aZ4.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-GTEcy37q.js";
|
|
5
|
+
import { F as FdoObjectId, z } from "./index-Bb4TieR_.js";
|
|
6
|
+
import { e as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, f as FdtoRunnableCampaign, g as FdoCreditLoyaltyReward, h as FdtoRandomReward, i as F_MISSION_TYPE, j as FdoThresholdCreditReward, k as FdtoThresholdReward, l as FdoMission } from "./index-FnsjvtSo.js";
|
|
7
|
+
import { F as FdtoCollectibleConfig } from "./index-LnCoUCnx.js";
|
|
8
|
+
import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-DcA0B-Y5.js";
|
|
9
|
+
import { g as F_APP_INBOX_DESTINATION, A as APP_INBOX_BODY_LIMIT, t as toDelivery, h as toLegacyMessage } from "./index-7TKoSEJ2.js";
|
|
10
|
+
import { e as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, f as isChannelComplete, h as addChannel, j as setMode, k as hasDraft, l as setPrimaryChannel, r as removeChannel, m as moveChannel, n as setChannelContent, o as getCampaignSummaryObject, p as normaliseBroadcastDelivery } from "./campaign-DKjBjV2k.js";
|
|
11
|
+
import { u as useMembershipStore } from "./membership-ILB4aB4h.js";
|
|
12
|
+
import { u as useBusinessStore } from "./business-BZUIs8Ub.js";
|
|
12
13
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
13
14
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
14
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
15
|
-
import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { b as _sfc_main$A, a as _sfc_main$D, _ as _sfc_main$F } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
17
|
-
import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { c as core, S as SvcConfig } from "./index-
|
|
19
|
-
import { p as prompt, f as firebaseStorage } from "./plugins-
|
|
15
|
+
import { f as featureVersionMapping } from "./campaign.enum-BQy3e845.js";
|
|
16
|
+
import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-uQJvjvTe.js";
|
|
17
|
+
import { b as _sfc_main$A, a as _sfc_main$D, _ as _sfc_main$F } from "./EffectSheet.vue_vue_type_style_index_0_lang-DkKhdp7G.js";
|
|
18
|
+
import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BspBXIO2.js";
|
|
19
|
+
import { c as core, S as SvcConfig } from "./index-B9DM5Vuv.js";
|
|
20
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-DLIgnFIF.js";
|
|
20
21
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
21
|
-
import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
22
|
-
import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { u as useI18n } from "./vue-i18n-
|
|
24
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-
|
|
25
|
-
import { D as DEFAULT_MESSAGE_VARIABLES, b as _sfc_main$v, g as getSmsMessageMetrics, _ as _sfc_main$w, a as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
22
|
+
import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DSutMvfk.js";
|
|
23
|
+
import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BgYK4hpo.js";
|
|
24
|
+
import { u as useI18n } from "./vue-i18n-BPeSHE3c.js";
|
|
25
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-LhNre1L9.js";
|
|
26
|
+
import { D as DEFAULT_MESSAGE_VARIABLES, b as _sfc_main$v, g as getSmsMessageMetrics, _ as _sfc_main$w, a as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-freeE-DP.js";
|
|
26
27
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
27
|
-
import { c as campaignApi } from "./index-
|
|
28
|
-
import {
|
|
29
|
-
import { m as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import "./index-
|
|
35
|
-
import "./
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import { C as CollectionUtils } from "./collection.fn-CDhfM3Eq.js";
|
|
28
|
+
import { c as campaignApi } from "./index-kkhrPH6s.js";
|
|
29
|
+
import { m as membershipApi } from "./index-D_o9LsHU.js";
|
|
30
|
+
import { m as moment } from "./index-CVYbfRGO.js";
|
|
31
|
+
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-DBtMGLxD.js";
|
|
32
|
+
import { C as CountryTimezone } from "./timezone-Brs5nrTL.js";
|
|
33
|
+
import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-B-IwtPvx.js";
|
|
34
|
+
import "./index-LlFZ5kxi.js";
|
|
35
|
+
import "./index-CXL5WAH0.js";
|
|
36
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-vcvRFGl0.js";
|
|
37
|
+
import { u as useLoading } from "./loading-CzWOx4tE.js";
|
|
38
|
+
import { i as initCollectibleConfig } from "./helper-BGqw2-RO.js";
|
|
39
|
+
import { C as CollectionUtils } from "./collection.fn-C3bMPBkC.js";
|
|
40
40
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
41
41
|
import { useDialog } from "@feedmepos/ui-library";
|
|
42
|
-
import { u as useCampaignStore } from "./campaign-
|
|
42
|
+
import { u as useCampaignStore } from "./campaign-B6I6PuY4.js";
|
|
43
43
|
import { a as cleanPF } from "./object-BYyQ0PZp.js";
|
|
44
44
|
function campaignRefinement(e, s) {
|
|
45
|
-
var
|
|
45
|
+
var i, c;
|
|
46
46
|
if (console.log(e, s), !e) return;
|
|
47
47
|
const o = e.campaign;
|
|
48
48
|
if (!o) return;
|
|
@@ -71,7 +71,7 @@ function campaignRefinement(e, s) {
|
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
case "CREDIT": {
|
|
74
|
-
const l = (
|
|
74
|
+
const l = (i = o.config) == null ? void 0 : i.validityOption;
|
|
75
75
|
(!l || ["validForDay", "validBefore"].every((a) => l[a] == null)) && s.addIssue({
|
|
76
76
|
code: "custom",
|
|
77
77
|
path: ["campaign", "config", "validityOption"],
|
|
@@ -91,7 +91,7 @@ function campaignRefinement(e, s) {
|
|
|
91
91
|
i18n: "connectZodCustom:campaign.reward_threshold_range"
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
}), (
|
|
94
|
+
}), (c = o.config) != null && c.validityOption.followFirstReceive || s.addIssue({
|
|
95
95
|
code: "custom",
|
|
96
96
|
path: ["campaign", "config", "validityOption"],
|
|
97
97
|
params: {
|
|
@@ -124,8 +124,8 @@ function campaignRefinement(e, s) {
|
|
|
124
124
|
}
|
|
125
125
|
];
|
|
126
126
|
n.length == l.length && n.every((r) => l.some((p) => {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
127
|
+
const h = RuleBuilder.simplify(p);
|
|
128
|
+
return h.property === r.property && r.operator.includes(h.operator);
|
|
129
129
|
})) || s.addIssue({
|
|
130
130
|
code: "custom",
|
|
131
131
|
path: ["campaign", "event", "rule"],
|
|
@@ -152,11 +152,11 @@ function campaignTransform(e) {
|
|
|
152
152
|
if (e.campaign.type === "VOUCHER" && "configs" in e) {
|
|
153
153
|
const d = e.configs;
|
|
154
154
|
d.extras.targetLocation = e.campaign.targetLocation;
|
|
155
|
-
const
|
|
155
|
+
const i = Math.max(
|
|
156
156
|
e.campaign.earningOption.amount,
|
|
157
157
|
d.options.maxUse ?? 1
|
|
158
158
|
);
|
|
159
|
-
e.campaign.earningOption.amount =
|
|
159
|
+
e.campaign.earningOption.amount = i, d.options.maxUse = i, e.campaign.earningOption = {
|
|
160
160
|
type: "FIXED",
|
|
161
161
|
amount: 1
|
|
162
162
|
};
|
|
@@ -291,7 +291,7 @@ function summarizeGrabDiscount(e) {
|
|
|
291
291
|
return "Bundle discount";
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function i(l) {
|
|
295
295
|
switch (l.type) {
|
|
296
296
|
case "percentage":
|
|
297
297
|
case "bundleSamePercentage":
|
|
@@ -312,13 +312,13 @@ function summarizeGrabDiscount(e) {
|
|
|
312
312
|
return `${s}${l.value} discount`;
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function c(l) {
|
|
316
316
|
return l.cap && l.cap > 0 ? `capped at ${s}${l.cap}` : null;
|
|
317
317
|
}
|
|
318
318
|
return {
|
|
319
319
|
type: o(e),
|
|
320
|
-
adjustment:
|
|
321
|
-
cap:
|
|
320
|
+
adjustment: i(e),
|
|
321
|
+
cap: c(e)
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
const _hoisted_1$r = {
|
|
@@ -333,17 +333,17 @@ const _hoisted_1$r = {
|
|
|
333
333
|
},
|
|
334
334
|
emits: ["confirm", "cancel"],
|
|
335
335
|
setup(e, { emit: s }) {
|
|
336
|
-
const o = e, d = s,
|
|
336
|
+
const o = e, d = s, i = ref();
|
|
337
337
|
watch(
|
|
338
338
|
() => o.visible,
|
|
339
339
|
(a) => {
|
|
340
340
|
var r, p;
|
|
341
|
-
!a &&
|
|
341
|
+
!a && i.value && ((p = (r = i.value).setSelectedItems) == null || p.call(r, o.initialValue || []));
|
|
342
342
|
}
|
|
343
343
|
);
|
|
344
|
-
function
|
|
344
|
+
function c() {
|
|
345
345
|
var a;
|
|
346
|
-
(a =
|
|
346
|
+
(a = i.value) == null || a.onConfirm();
|
|
347
347
|
}
|
|
348
348
|
function l() {
|
|
349
349
|
d("cancel");
|
|
@@ -352,7 +352,7 @@ const _hoisted_1$r = {
|
|
|
352
352
|
d("confirm", a);
|
|
353
353
|
}
|
|
354
354
|
return (a, r) => {
|
|
355
|
-
const p = resolveComponent("FmIcon"),
|
|
355
|
+
const p = resolveComponent("FmIcon"), h = resolveComponent("FmButton");
|
|
356
356
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
|
|
357
357
|
createElementVNode("div", _hoisted_2$n, [
|
|
358
358
|
createElementVNode("div", _hoisted_3$k, [
|
|
@@ -362,7 +362,7 @@ const _hoisted_1$r = {
|
|
|
362
362
|
}),
|
|
363
363
|
r[0] || (r[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
|
|
364
364
|
]),
|
|
365
|
-
createVNode(
|
|
365
|
+
createVNode(h, {
|
|
366
366
|
icon: "close",
|
|
367
367
|
variant: "tertiary",
|
|
368
368
|
onClick: l
|
|
@@ -372,7 +372,7 @@ const _hoisted_1$r = {
|
|
|
372
372
|
createElementVNode("div", _hoisted_4$j, [
|
|
373
373
|
createVNode(unref(S6), {
|
|
374
374
|
ref_key: "selectItemRef",
|
|
375
|
-
ref:
|
|
375
|
+
ref: i,
|
|
376
376
|
"initial-value": e.initialValue,
|
|
377
377
|
"filter-items": e.filterItems,
|
|
378
378
|
"on-complete": n,
|
|
@@ -380,15 +380,15 @@ const _hoisted_1$r = {
|
|
|
380
380
|
}, null, 8, ["initial-value", "filter-items"])
|
|
381
381
|
]),
|
|
382
382
|
createElementVNode("div", _hoisted_5$g, [
|
|
383
|
-
createVNode(
|
|
383
|
+
createVNode(h, {
|
|
384
384
|
variant: "secondary",
|
|
385
385
|
label: "Cancel",
|
|
386
386
|
onClick: l
|
|
387
387
|
}),
|
|
388
|
-
createVNode(
|
|
388
|
+
createVNode(h, {
|
|
389
389
|
variant: "primary",
|
|
390
390
|
label: "Confirm Selection",
|
|
391
|
-
onClick:
|
|
391
|
+
onClick: c
|
|
392
392
|
})
|
|
393
393
|
])
|
|
394
394
|
])) : createCommentVNode("", !0);
|
|
@@ -408,8 +408,8 @@ const _hoisted_1$r = {
|
|
|
408
408
|
},
|
|
409
409
|
emits: ["confirm", "cancel"],
|
|
410
410
|
setup(e, { emit: s }) {
|
|
411
|
-
const o = e, d = s,
|
|
412
|
-
const u =
|
|
411
|
+
const o = e, d = s, i = Zh(), c = ref({}), l = ref(""), n = computed(() => {
|
|
412
|
+
const u = i.menu.value;
|
|
413
413
|
return u ? u.modules.category.map((m) => ({
|
|
414
414
|
id: m._id,
|
|
415
415
|
name: m.name
|
|
@@ -420,9 +420,9 @@ const _hoisted_1$r = {
|
|
|
420
420
|
return n.value.filter(
|
|
421
421
|
(m) => m.name.toLowerCase().includes(u)
|
|
422
422
|
);
|
|
423
|
-
}), r = computed(() => Object.values(
|
|
423
|
+
}), r = computed(() => Object.values(c.value).filter(Boolean).length);
|
|
424
424
|
function p() {
|
|
425
|
-
|
|
425
|
+
c.value = n.value.reduce(
|
|
426
426
|
(u, m) => (u[m.id] = o.initialValue.includes(m.id), u),
|
|
427
427
|
{}
|
|
428
428
|
);
|
|
@@ -430,34 +430,34 @@ const _hoisted_1$r = {
|
|
|
430
430
|
watch([() => o.visible, () => o.initialValue], () => {
|
|
431
431
|
o.visible && p();
|
|
432
432
|
}), onMounted(async () => {
|
|
433
|
-
await
|
|
433
|
+
await i.store.getMenu(), p();
|
|
434
434
|
});
|
|
435
|
-
function
|
|
436
|
-
|
|
435
|
+
function h(u) {
|
|
436
|
+
c.value[u] = !c.value[u];
|
|
437
437
|
}
|
|
438
438
|
function y() {
|
|
439
439
|
const u = r.value === a.value.length;
|
|
440
440
|
a.value.forEach((m) => {
|
|
441
|
-
|
|
441
|
+
c.value[m.id] = !u;
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
444
|
function V() {
|
|
445
|
-
Object.keys(
|
|
446
|
-
|
|
445
|
+
Object.keys(c.value).forEach((u) => {
|
|
446
|
+
c.value[u] = !1;
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
449
|
function x() {
|
|
450
|
-
const u = Object.entries(
|
|
450
|
+
const u = Object.entries(c.value).filter(([, m]) => m).map(([m]) => m);
|
|
451
451
|
d("confirm", u);
|
|
452
452
|
}
|
|
453
453
|
function f() {
|
|
454
454
|
d("cancel");
|
|
455
455
|
}
|
|
456
|
-
const
|
|
457
|
-
(u) =>
|
|
456
|
+
const v = computed(() => a.value.length > 0 && a.value.every(
|
|
457
|
+
(u) => c.value[u.id]
|
|
458
458
|
));
|
|
459
459
|
return (u, m) => {
|
|
460
|
-
const C = resolveComponent("FmIcon"), k = resolveComponent("FmButton"), $ = resolveComponent("FmTextField"),
|
|
460
|
+
const C = resolveComponent("FmIcon"), k = resolveComponent("FmButton"), $ = resolveComponent("FmTextField"), F = resolveComponent("FmCheckbox"), N = resolveComponent("FmListItem"), D = resolveComponent("FmList");
|
|
461
461
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
|
|
462
462
|
createElementVNode("div", _hoisted_2$m, [
|
|
463
463
|
createElementVNode("div", _hoisted_3$j, [
|
|
@@ -480,7 +480,7 @@ const _hoisted_1$r = {
|
|
|
480
480
|
icon: "select_all",
|
|
481
481
|
variant: "tertiary",
|
|
482
482
|
size: "small",
|
|
483
|
-
label: `${
|
|
483
|
+
label: `${v.value ? "Deselect" : "Select"} All`,
|
|
484
484
|
onClick: y
|
|
485
485
|
}, null, 8, ["label"]),
|
|
486
486
|
createVNode(k, {
|
|
@@ -503,16 +503,16 @@ const _hoisted_1$r = {
|
|
|
503
503
|
createElementVNode("div", _hoisted_7$a, [
|
|
504
504
|
a.value.length > 0 ? (openBlock(), createBlock(D, { key: 0 }, {
|
|
505
505
|
default: withCtx(() => [
|
|
506
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (w) => (openBlock(), createBlock(
|
|
506
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (w) => (openBlock(), createBlock(N, {
|
|
507
507
|
key: w.id,
|
|
508
508
|
clickable: !0,
|
|
509
|
-
onClick: (O) =>
|
|
509
|
+
onClick: (O) => h(w.id)
|
|
510
510
|
}, {
|
|
511
511
|
leading: withCtx(() => [
|
|
512
|
-
createVNode(
|
|
513
|
-
"model-value":
|
|
512
|
+
createVNode(F, {
|
|
513
|
+
"model-value": c.value[w.id] || !1,
|
|
514
514
|
value: w.id,
|
|
515
|
-
"onUpdate:modelValue": (O) =>
|
|
515
|
+
"onUpdate:modelValue": (O) => h(w.id),
|
|
516
516
|
onClick: m[1] || (m[1] = withModifiers(() => {
|
|
517
517
|
}, ["stop"]))
|
|
518
518
|
}, null, 8, ["model-value", "value", "onUpdate:modelValue"])
|
|
@@ -557,17 +557,17 @@ const _hoisted_1$r = {
|
|
|
557
557
|
}), _hoisted_1$p = { class: "space-y-8" }, _hoisted_2$l = {
|
|
558
558
|
key: 1,
|
|
559
559
|
class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
|
|
560
|
-
}, _hoisted_3$i = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$h = { class: "text-fm-color-typo-secondary" }, _hoisted_5$e = { key: 0 }, _hoisted_6$a = { class: "space-y-24" }, _hoisted_7$9 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$7 = { key: 0 }, _hoisted_9$7 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$7 = { key: 1 }, _hoisted_11$5 = { key: 2 }, _hoisted_12$4 = { key: 0 }, _hoisted_13$4 = { class: "space-y-8" }, _hoisted_14$4 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_15$3 = { class: "flex items-center gap-8" }, _hoisted_16$2 = { class: "fm-typo-en-body-md-400" }, _hoisted_17$2 = { key: 3 }, _hoisted_18$2 = { key: 0 }, _hoisted_19$2 = { class: "space-y-8" }, _hoisted_20$2 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_21$1 = { class: "flex items-center gap-8" }, _hoisted_22 = { class: "fm-typo-en-body-md-400" }, _hoisted_23 = {
|
|
560
|
+
}, _hoisted_3$i = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$h = { class: "text-fm-color-typo-secondary" }, _hoisted_5$e = { key: 0 }, _hoisted_6$a = { class: "space-y-24" }, _hoisted_7$9 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$7 = { key: 0 }, _hoisted_9$7 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$7 = { key: 1 }, _hoisted_11$5 = { key: 2 }, _hoisted_12$4 = { key: 0 }, _hoisted_13$4 = { class: "space-y-8" }, _hoisted_14$4 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_15$3 = { class: "flex items-center gap-8" }, _hoisted_16$2 = { class: "fm-typo-en-body-md-400" }, _hoisted_17$2 = { key: 3 }, _hoisted_18$2 = { key: 0 }, _hoisted_19$2 = { class: "space-y-8" }, _hoisted_20$2 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_21$1 = { class: "flex items-center gap-8" }, _hoisted_22$1 = { class: "fm-typo-en-body-md-400" }, _hoisted_23$1 = {
|
|
561
561
|
key: 0,
|
|
562
562
|
class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
|
|
563
|
-
}, _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$r = /* @__PURE__ */ defineComponent({
|
|
563
|
+
}, _hoisted_24$1 = { 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$r = /* @__PURE__ */ defineComponent({
|
|
564
564
|
__name: "GrabEffectSheet",
|
|
565
565
|
props: {
|
|
566
566
|
modelValue: { type: Object }
|
|
567
567
|
},
|
|
568
568
|
emits: ["update:model-value"],
|
|
569
569
|
setup(e, { emit: s }) {
|
|
570
|
-
const o = e, d = s,
|
|
570
|
+
const o = e, d = s, i = Zh(), c = ref(!1), l = ref(!1), n = ref(!1), a = ref({
|
|
571
571
|
type: "net",
|
|
572
572
|
value: 0,
|
|
573
573
|
scope: {
|
|
@@ -581,7 +581,7 @@ const _hoisted_1$r = {
|
|
|
581
581
|
},
|
|
582
582
|
{ immediate: !0 }
|
|
583
583
|
), onMounted(async () => {
|
|
584
|
-
await
|
|
584
|
+
await i.store.getMenu();
|
|
585
585
|
});
|
|
586
586
|
const r = computed(() => {
|
|
587
587
|
var b;
|
|
@@ -590,7 +590,7 @@ const _hoisted_1$r = {
|
|
|
590
590
|
async function p(b) {
|
|
591
591
|
b.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && d("update:model-value", null);
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function h() {
|
|
594
594
|
var b;
|
|
595
595
|
return C(((b = a.value.scope) == null ? void 0 : b.type) || "order");
|
|
596
596
|
}
|
|
@@ -608,31 +608,31 @@ const _hoisted_1$r = {
|
|
|
608
608
|
function f(b) {
|
|
609
609
|
return b != null && b.includes("Percentage") || b === "percentage" ? "10" : "5.00";
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function v(b) {
|
|
612
612
|
return b != null && b.includes("Percentage") || b === "percentage" ? "%" : "$";
|
|
613
613
|
}
|
|
614
|
-
function u(b,
|
|
614
|
+
function u(b, B) {
|
|
615
615
|
a.value = {
|
|
616
616
|
...a.value,
|
|
617
|
-
[b]:
|
|
617
|
+
[b]: B
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
function m(b,
|
|
621
|
-
var
|
|
620
|
+
function m(b, B) {
|
|
621
|
+
var U;
|
|
622
622
|
const T = {
|
|
623
623
|
...a.value.scope,
|
|
624
|
-
[b]:
|
|
624
|
+
[b]: B
|
|
625
625
|
};
|
|
626
626
|
if (a.value = {
|
|
627
627
|
...a.value,
|
|
628
628
|
scope: T
|
|
629
629
|
}, b === "type") {
|
|
630
|
-
const P = C(
|
|
630
|
+
const P = C(B);
|
|
631
631
|
P.some(
|
|
632
|
-
(
|
|
632
|
+
(g) => g.value === a.value.type
|
|
633
633
|
) || (a.value = {
|
|
634
634
|
...a.value,
|
|
635
|
-
type: ((
|
|
635
|
+
type: ((U = P[0]) == null ? void 0 : U.value) || "net",
|
|
636
636
|
// Reset value and cap when changing to incompatible type
|
|
637
637
|
value: 0,
|
|
638
638
|
cap: void 0
|
|
@@ -702,19 +702,19 @@ const _hoisted_1$r = {
|
|
|
702
702
|
var b;
|
|
703
703
|
return ((b = a.value.scope) == null ? void 0 : b.type) === "items";
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function F() {
|
|
706
706
|
var b;
|
|
707
707
|
return ((b = a.value.scope) == null ? void 0 : b.type) === "category";
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function N() {
|
|
710
710
|
var T;
|
|
711
711
|
const b = (T = a.value.scope) == null ? void 0 : T.objectIDs;
|
|
712
712
|
if (!b || b.length === 0)
|
|
713
713
|
return "No items selected";
|
|
714
|
-
const
|
|
715
|
-
return
|
|
716
|
-
const
|
|
717
|
-
return
|
|
714
|
+
const B = i.menu.value;
|
|
715
|
+
return B && b.length <= 3 ? b.map((P) => {
|
|
716
|
+
const A = B.modules.item.find((g) => g._id === P);
|
|
717
|
+
return A ? (A.name2 || A.name).trim() : `Item ${P}`;
|
|
718
718
|
}).join(", ") : b.length === 1 ? "1 item selected" : `${b.length} items selected`;
|
|
719
719
|
}
|
|
720
720
|
function D() {
|
|
@@ -722,10 +722,10 @@ const _hoisted_1$r = {
|
|
|
722
722
|
const b = (T = a.value.scope) == null ? void 0 : T.objectIDs;
|
|
723
723
|
if (!b || b.length === 0)
|
|
724
724
|
return "No categories selected";
|
|
725
|
-
const
|
|
726
|
-
return
|
|
727
|
-
const
|
|
728
|
-
return
|
|
725
|
+
const B = i.menu.value;
|
|
726
|
+
return B && b.length <= 3 ? b.map((P) => {
|
|
727
|
+
const A = B.modules.category.find((g) => g._id === P);
|
|
728
|
+
return A ? A.name : `Category ${P}`;
|
|
729
729
|
}).join(", ") : b.length === 1 ? "1 category selected" : `${b.length} categories selected`;
|
|
730
730
|
}
|
|
731
731
|
function w() {
|
|
@@ -734,53 +734,53 @@ const _hoisted_1$r = {
|
|
|
734
734
|
function O() {
|
|
735
735
|
n.value = !0;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function j(b) {
|
|
738
738
|
m("objectIDs", b), l.value = !1;
|
|
739
739
|
}
|
|
740
740
|
function I(b) {
|
|
741
741
|
m("objectIDs", b), n.value = !1;
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function H() {
|
|
744
744
|
l.value = !1;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function q() {
|
|
747
747
|
n.value = !1;
|
|
748
748
|
}
|
|
749
|
-
const
|
|
750
|
-
var
|
|
749
|
+
const G = computed(() => {
|
|
750
|
+
var B, T, U;
|
|
751
751
|
const b = [];
|
|
752
|
-
return a.value.type || b.push("Discount type is required"), (
|
|
752
|
+
return a.value.type || b.push("Discount type is required"), (B = a.value.scope) != null && B.type || b.push("Scope type is required"), y(a.value.type) && (!a.value.value || a.value.value <= 0) && b.push("Discount amount must be greater than 0"), ((T = a.value.scope) == null ? void 0 : T.type) === "items" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one item"), ((U = a.value.scope) == null ? void 0 : U.type) === "category" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one category"), b;
|
|
753
753
|
});
|
|
754
|
-
function
|
|
755
|
-
d("update:model-value", a.value),
|
|
754
|
+
function Y() {
|
|
755
|
+
d("update:model-value", a.value), c.value = !1;
|
|
756
756
|
}
|
|
757
757
|
const Z = [
|
|
758
758
|
{ label: "Bill discount", value: "order" },
|
|
759
759
|
{ label: "Item discount", value: "items" },
|
|
760
760
|
{ label: "Category discount", value: "category" }
|
|
761
761
|
];
|
|
762
|
-
return (b,
|
|
763
|
-
const T = resolveComponent("FmButton"),
|
|
764
|
-
return openBlock(), createBlock(
|
|
762
|
+
return (b, B) => {
|
|
763
|
+
const T = resolveComponent("FmButton"), U = resolveComponent("FmSelect"), P = resolveComponent("FmStepperField"), A = resolveComponent("FmIcon"), g = resolveComponent("FmSideSheet");
|
|
764
|
+
return openBlock(), createBlock(g, {
|
|
765
765
|
"max-width": 550,
|
|
766
766
|
header: "Apply discount",
|
|
767
|
-
modelValue: unref(
|
|
767
|
+
modelValue: unref(c),
|
|
768
768
|
"onUpdate:modelValue": [
|
|
769
|
-
|
|
770
|
-
|
|
769
|
+
B[5] || (B[5] = (E) => isRef(c) ? c.value = E : null),
|
|
770
|
+
B[6] || (B[6] = (E) => c.value = E)
|
|
771
771
|
]
|
|
772
772
|
}, {
|
|
773
773
|
"side-sheet-button": withCtx(() => {
|
|
774
|
-
var
|
|
774
|
+
var E, R, M, S;
|
|
775
775
|
return [
|
|
776
776
|
createElementVNode("div", _hoisted_1$p, [
|
|
777
|
-
|
|
777
|
+
B[7] || (B[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)),
|
|
778
778
|
e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$l, [
|
|
779
779
|
createElementVNode("div", _hoisted_3$i, [
|
|
780
|
-
createElementVNode("div", null, toDisplayString((
|
|
780
|
+
createElementVNode("div", null, toDisplayString((E = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : E.type), 1),
|
|
781
781
|
createElementVNode("div", _hoisted_4$h, [
|
|
782
|
-
createTextVNode(toDisplayString((
|
|
783
|
-
(
|
|
782
|
+
createTextVNode(toDisplayString((R = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : R.adjustment) + " ", 1),
|
|
783
|
+
(M = unref(summarizeGrabDiscount)(e.modelValue)) != null && M.cap ? (openBlock(), createElementBlock("span", _hoisted_5$e, toDisplayString((S = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : S.cap), 1)) : createCommentVNode("", !0)
|
|
784
784
|
])
|
|
785
785
|
]),
|
|
786
786
|
createVNode(T, {
|
|
@@ -806,70 +806,70 @@ const _hoisted_1$r = {
|
|
|
806
806
|
variant: "secondary",
|
|
807
807
|
label: "Cancel",
|
|
808
808
|
class: "flex-1",
|
|
809
|
-
onClick:
|
|
809
|
+
onClick: B[4] || (B[4] = (E) => c.value = !1)
|
|
810
810
|
}),
|
|
811
811
|
createVNode(T, {
|
|
812
812
|
variant: "primary",
|
|
813
813
|
label: unref(r) ? "Confirm" : "Complete Required Fields",
|
|
814
814
|
class: "flex-1",
|
|
815
815
|
disabled: !unref(r),
|
|
816
|
-
onClick:
|
|
816
|
+
onClick: Y
|
|
817
817
|
}, null, 8, ["label", "disabled"])
|
|
818
818
|
])
|
|
819
819
|
]),
|
|
820
820
|
default: withCtx(() => {
|
|
821
|
-
var
|
|
821
|
+
var E, R, M, S;
|
|
822
822
|
return [
|
|
823
823
|
createElementVNode("div", _hoisted_6$a, [
|
|
824
824
|
createElementVNode("div", null, [
|
|
825
|
-
|
|
826
|
-
createVNode(
|
|
827
|
-
"model-value": ((
|
|
828
|
-
"onUpdate:modelValue":
|
|
825
|
+
B[8] || (B[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
|
|
826
|
+
createVNode(U, {
|
|
827
|
+
"model-value": ((E = unref(a).scope) == null ? void 0 : E.type) || "order",
|
|
828
|
+
"onUpdate:modelValue": B[0] || (B[0] = (L) => m("type", L)),
|
|
829
829
|
placeholder: "Select campaign type",
|
|
830
830
|
items: Z
|
|
831
831
|
}, null, 8, ["model-value"]),
|
|
832
|
-
createElementVNode("div", _hoisted_7$9, toDisplayString(k((
|
|
832
|
+
createElementVNode("div", _hoisted_7$9, toDisplayString(k((R = unref(a).scope) == null ? void 0 : R.type)), 1)
|
|
833
833
|
]),
|
|
834
834
|
createElementVNode("div", null, [
|
|
835
|
-
|
|
836
|
-
createVNode(
|
|
835
|
+
B[9] || (B[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
|
|
836
|
+
createVNode(U, {
|
|
837
837
|
"model-value": unref(a).type,
|
|
838
|
-
"onUpdate:modelValue":
|
|
838
|
+
"onUpdate:modelValue": B[1] || (B[1] = (L) => u("type", L)),
|
|
839
839
|
placeholder: "Select discount type",
|
|
840
|
-
items:
|
|
840
|
+
items: h()
|
|
841
841
|
}, null, 8, ["model-value", "items"])
|
|
842
842
|
]),
|
|
843
843
|
y(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$7, [
|
|
844
844
|
createElementVNode("label", _hoisted_9$7, toDisplayString(x(unref(a).type)), 1),
|
|
845
845
|
createVNode(P, {
|
|
846
846
|
modelValue: unref(a).value,
|
|
847
|
-
"onUpdate:modelValue":
|
|
847
|
+
"onUpdate:modelValue": B[2] || (B[2] = (L) => unref(a).value = L),
|
|
848
848
|
placeholder: f(unref(a).type),
|
|
849
|
-
suffix:
|
|
849
|
+
suffix: v(unref(a).type),
|
|
850
850
|
type: "number"
|
|
851
851
|
}, null, 8, ["modelValue", "placeholder", "suffix"])
|
|
852
852
|
])) : createCommentVNode("", !0),
|
|
853
853
|
V(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_10$7, [
|
|
854
|
-
|
|
854
|
+
B[10] || (B[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
|
|
855
855
|
createVNode(P, {
|
|
856
856
|
modelValue: unref(a).cap,
|
|
857
|
-
"onUpdate:modelValue":
|
|
857
|
+
"onUpdate:modelValue": B[3] || (B[3] = (L) => unref(a).cap = L),
|
|
858
858
|
placeholder: "Maximum discount amount",
|
|
859
859
|
type: "number"
|
|
860
860
|
}, null, 8, ["modelValue"])
|
|
861
861
|
])) : createCommentVNode("", !0),
|
|
862
862
|
$() ? (openBlock(), createElementBlock("div", _hoisted_11$5, [
|
|
863
863
|
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12$4, [
|
|
864
|
-
|
|
864
|
+
B[12] || (B[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
|
|
865
865
|
createElementVNode("div", _hoisted_13$4, [
|
|
866
866
|
createElementVNode("div", _hoisted_14$4, [
|
|
867
867
|
createElementVNode("div", _hoisted_15$3, [
|
|
868
|
-
createVNode(
|
|
868
|
+
createVNode(A, {
|
|
869
869
|
name: "restaurant",
|
|
870
870
|
size: "md"
|
|
871
871
|
}),
|
|
872
|
-
createElementVNode("span", _hoisted_16$2, toDisplayString(
|
|
872
|
+
createElementVNode("span", _hoisted_16$2, toDisplayString(N()), 1)
|
|
873
873
|
]),
|
|
874
874
|
createVNode(T, {
|
|
875
875
|
variant: "secondary",
|
|
@@ -878,27 +878,27 @@ const _hoisted_1$r = {
|
|
|
878
878
|
onClick: w
|
|
879
879
|
})
|
|
880
880
|
]),
|
|
881
|
-
|
|
881
|
+
B[11] || (B[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))
|
|
882
882
|
])
|
|
883
883
|
])),
|
|
884
884
|
createVNode(_sfc_main$t, {
|
|
885
885
|
visible: unref(l),
|
|
886
|
-
"initial-value": ((
|
|
887
|
-
onConfirm:
|
|
888
|
-
onCancel:
|
|
886
|
+
"initial-value": ((M = unref(a).scope) == null ? void 0 : M.objectIDs) || [],
|
|
887
|
+
onConfirm: j,
|
|
888
|
+
onCancel: H
|
|
889
889
|
}, null, 8, ["visible", "initial-value"])
|
|
890
890
|
])) : createCommentVNode("", !0),
|
|
891
|
-
|
|
891
|
+
F() ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
|
|
892
892
|
unref(n) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18$2, [
|
|
893
|
-
|
|
893
|
+
B[14] || (B[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
|
|
894
894
|
createElementVNode("div", _hoisted_19$2, [
|
|
895
895
|
createElementVNode("div", _hoisted_20$2, [
|
|
896
896
|
createElementVNode("div", _hoisted_21$1, [
|
|
897
|
-
createVNode(
|
|
897
|
+
createVNode(A, {
|
|
898
898
|
name: "category",
|
|
899
899
|
size: "md"
|
|
900
900
|
}),
|
|
901
|
-
createElementVNode("span", _hoisted_22, toDisplayString(D()), 1)
|
|
901
|
+
createElementVNode("span", _hoisted_22$1, toDisplayString(D()), 1)
|
|
902
902
|
]),
|
|
903
903
|
createVNode(T, {
|
|
904
904
|
variant: "secondary",
|
|
@@ -907,29 +907,29 @@ const _hoisted_1$r = {
|
|
|
907
907
|
onClick: O
|
|
908
908
|
})
|
|
909
909
|
]),
|
|
910
|
-
|
|
910
|
+
B[13] || (B[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
|
|
911
911
|
])
|
|
912
912
|
])),
|
|
913
913
|
createVNode(_sfc_main$s, {
|
|
914
914
|
visible: unref(n),
|
|
915
|
-
"initial-value": ((
|
|
915
|
+
"initial-value": ((S = unref(a).scope) == null ? void 0 : S.objectIDs) || [],
|
|
916
916
|
onConfirm: I,
|
|
917
|
-
onCancel:
|
|
917
|
+
onCancel: q
|
|
918
918
|
}, null, 8, ["visible", "initial-value"])
|
|
919
919
|
])) : createCommentVNode("", !0)
|
|
920
920
|
]),
|
|
921
|
-
unref(
|
|
922
|
-
createElementVNode("div", _hoisted_24, [
|
|
923
|
-
createVNode(
|
|
924
|
-
|
|
921
|
+
unref(G).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23$1, [
|
|
922
|
+
createElementVNode("div", _hoisted_24$1, [
|
|
923
|
+
createVNode(A, { name: "warning" }),
|
|
924
|
+
B[15] || (B[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
|
|
925
925
|
]),
|
|
926
926
|
createElementVNode("ul", _hoisted_25, [
|
|
927
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
928
|
-
key:
|
|
927
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(G), (L) => (openBlock(), createElementBlock("li", {
|
|
928
|
+
key: L,
|
|
929
929
|
class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
|
|
930
930
|
}, [
|
|
931
|
-
|
|
932
|
-
createTextVNode(" " + toDisplayString(
|
|
931
|
+
B[16] || (B[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
|
|
932
|
+
createTextVNode(" " + toDisplayString(L), 1)
|
|
933
933
|
]))), 128))
|
|
934
934
|
])
|
|
935
935
|
])) : createCommentVNode("", !0)
|
|
@@ -950,10 +950,10 @@ const _hoisted_1$r = {
|
|
|
950
950
|
},
|
|
951
951
|
emits: ["update:model-value"],
|
|
952
952
|
setup(e, { emit: s }) {
|
|
953
|
-
const { t: o } = useI18n(), d = e,
|
|
953
|
+
const { t: o } = useI18n(), d = e, i = s, c = ref(
|
|
954
954
|
!d.modelValue || !d.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(d.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
955
955
|
);
|
|
956
|
-
watch(
|
|
956
|
+
watch(c, async (n, a) => {
|
|
957
957
|
var r;
|
|
958
958
|
if (a == "custom" && n == "all_time" && RuleBuilder.getRules((r = d.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
|
|
959
959
|
const p = await prompt.confirm(
|
|
@@ -962,13 +962,13 @@ const _hoisted_1$r = {
|
|
|
962
962
|
o("connect.common.confirm"),
|
|
963
963
|
o("connect.common.cancel")
|
|
964
964
|
);
|
|
965
|
-
p &&
|
|
965
|
+
p && i(
|
|
966
966
|
"update:model-value",
|
|
967
967
|
RuleBuilder.setRuleToGroup(
|
|
968
968
|
d.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
969
969
|
RuleBuilder.scaffoldGroup("g_time")
|
|
970
970
|
)
|
|
971
|
-
),
|
|
971
|
+
), c.value = p ? n : a;
|
|
972
972
|
}
|
|
973
973
|
});
|
|
974
974
|
async function l(n) {
|
|
@@ -980,10 +980,10 @@ const _hoisted_1$r = {
|
|
|
980
980
|
o("connect.common.confirm"),
|
|
981
981
|
o("connect.common.cancel")
|
|
982
982
|
)) {
|
|
983
|
-
|
|
983
|
+
c.value = "all_time";
|
|
984
984
|
return;
|
|
985
985
|
}
|
|
986
|
-
|
|
986
|
+
i(
|
|
987
987
|
"update:model-value",
|
|
988
988
|
RuleBuilder.setRuleToGroup(
|
|
989
989
|
d.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
@@ -993,13 +993,13 @@ const _hoisted_1$r = {
|
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
995
|
return (n, a) => {
|
|
996
|
-
var
|
|
996
|
+
var h;
|
|
997
997
|
const r = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
|
|
998
998
|
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
999
999
|
createVNode(p, {
|
|
1000
|
-
modelValue: unref(
|
|
1000
|
+
modelValue: unref(c),
|
|
1001
1001
|
"onUpdate:modelValue": [
|
|
1002
|
-
a[0] || (a[0] = (y) => isRef(
|
|
1002
|
+
a[0] || (a[0] = (y) => isRef(c) ? c.value = y : null),
|
|
1003
1003
|
a[1] || (a[1] = (y) => l(y))
|
|
1004
1004
|
]
|
|
1005
1005
|
}, {
|
|
@@ -1015,13 +1015,13 @@ const _hoisted_1$r = {
|
|
|
1015
1015
|
]),
|
|
1016
1016
|
_: 1
|
|
1017
1017
|
}, 8, ["modelValue"]),
|
|
1018
|
-
unref(
|
|
1018
|
+
unref(c) == "custom" ? (openBlock(), createBlock(_sfc_main$u, {
|
|
1019
1019
|
key: 0,
|
|
1020
1020
|
class: "!mt-[0px]",
|
|
1021
1021
|
"include-only": "trigger",
|
|
1022
1022
|
"trigger-type": "SCHEDULE",
|
|
1023
|
-
"model-value": ((
|
|
1024
|
-
"onUpdate:modelValue": a[2] || (a[2] = (y) =>
|
|
1023
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
1024
|
+
"onUpdate:modelValue": a[2] || (a[2] = (y) => i(
|
|
1025
1025
|
"update:model-value",
|
|
1026
1026
|
unref(RuleBuilder).setRuleToGroup(
|
|
1027
1027
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -1042,7 +1042,7 @@ const _hoisted_1$r = {
|
|
|
1042
1042
|
},
|
|
1043
1043
|
emits: ["update:model-value"],
|
|
1044
1044
|
setup(e, { emit: s }) {
|
|
1045
|
-
const { t: o } = useI18n(), d = e,
|
|
1045
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(() => {
|
|
1046
1046
|
const { property: l, operator: n, equator: a } = RuleBuilder.simplify(
|
|
1047
1047
|
d.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
1048
1048
|
op: "before",
|
|
@@ -1061,9 +1061,9 @@ const _hoisted_1$r = {
|
|
|
1061
1061
|
createVNode(a, {
|
|
1062
1062
|
label: unref(o)("connect.template.rule.birthday.on_birthday"),
|
|
1063
1063
|
value: "_isRange-day",
|
|
1064
|
-
"model-value": `${unref(
|
|
1064
|
+
"model-value": `${unref(c).operator}-${unref(c).equator.unit}`,
|
|
1065
1065
|
"onUpdate:modelValue": n[0] || (n[0] = () => {
|
|
1066
|
-
|
|
1066
|
+
i(
|
|
1067
1067
|
"update:model-value",
|
|
1068
1068
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
1069
1069
|
op: "this",
|
|
@@ -1076,9 +1076,9 @@ const _hoisted_1$r = {
|
|
|
1076
1076
|
createVNode(a, {
|
|
1077
1077
|
label: unref(o)("connect.template.rule.birthday.days_before"),
|
|
1078
1078
|
value: "_isDay",
|
|
1079
|
-
"model-value": unref(
|
|
1079
|
+
"model-value": unref(c).operator,
|
|
1080
1080
|
"onUpdate:modelValue": n[1] || (n[1] = () => {
|
|
1081
|
-
|
|
1081
|
+
i(
|
|
1082
1082
|
"update:model-value",
|
|
1083
1083
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
1084
1084
|
op: "after",
|
|
@@ -1088,12 +1088,12 @@ const _hoisted_1$r = {
|
|
|
1088
1088
|
);
|
|
1089
1089
|
})
|
|
1090
1090
|
}, null, 8, ["label", "model-value"]),
|
|
1091
|
-
unref(
|
|
1091
|
+
unref(c).operator == "_isDay" ? (openBlock(), createBlock(r, {
|
|
1092
1092
|
key: 0,
|
|
1093
1093
|
label: unref(o)("connect.template.rule.birthday.days_before_label"),
|
|
1094
1094
|
"show-steppers": !1,
|
|
1095
|
-
"model-value": unref(
|
|
1096
|
-
"onUpdate:modelValue": n[2] || (n[2] = (p) =>
|
|
1095
|
+
"model-value": unref(c).equator.x,
|
|
1096
|
+
"onUpdate:modelValue": n[2] || (n[2] = (p) => i(
|
|
1097
1097
|
"update:model-value",
|
|
1098
1098
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
1099
1099
|
op: "after",
|
|
@@ -1105,9 +1105,9 @@ const _hoisted_1$r = {
|
|
|
1105
1105
|
createVNode(a, {
|
|
1106
1106
|
label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
|
|
1107
1107
|
value: "_isRange-week",
|
|
1108
|
-
"model-value": `${unref(
|
|
1108
|
+
"model-value": `${unref(c).operator}-${unref(c).equator.unit}`,
|
|
1109
1109
|
"onUpdate:modelValue": n[3] || (n[3] = () => {
|
|
1110
|
-
|
|
1110
|
+
i(
|
|
1111
1111
|
"update:model-value",
|
|
1112
1112
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
1113
1113
|
op: "this",
|
|
@@ -1120,9 +1120,9 @@ const _hoisted_1$r = {
|
|
|
1120
1120
|
createVNode(a, {
|
|
1121
1121
|
label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
|
|
1122
1122
|
value: "_isRange-month",
|
|
1123
|
-
"model-value": `${unref(
|
|
1123
|
+
"model-value": `${unref(c).operator}-${unref(c).equator.unit}`,
|
|
1124
1124
|
"onUpdate:modelValue": n[4] || (n[4] = () => {
|
|
1125
|
-
|
|
1125
|
+
i(
|
|
1126
1126
|
"update:model-value",
|
|
1127
1127
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
1128
1128
|
op: "this",
|
|
@@ -1152,7 +1152,7 @@ const _hoisted_1$r = {
|
|
|
1152
1152
|
},
|
|
1153
1153
|
emits: ["update:model-value"],
|
|
1154
1154
|
setup(e, { emit: s }) {
|
|
1155
|
-
const { t: o } = useI18n(), d = e,
|
|
1155
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(() => d.disabled ? TypeToTriggerOptions[d.campaignType].filter(
|
|
1156
1156
|
(l) => l.value == d.modelValue
|
|
1157
1157
|
) : TypeToTriggerOptions[d.campaignType]);
|
|
1158
1158
|
return (l, n) => {
|
|
@@ -1160,16 +1160,16 @@ const _hoisted_1$r = {
|
|
|
1160
1160
|
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
1161
1161
|
createElementVNode("div", _hoisted_2$k, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
|
|
1162
1162
|
createElementVNode("div", _hoisted_3$h, [
|
|
1163
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1163
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
|
|
1164
1164
|
variant: "outlined",
|
|
1165
1165
|
disabled: d.disabled,
|
|
1166
1166
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1167
|
-
"col-span-3": unref(
|
|
1167
|
+
"col-span-3": unref(c).length == 1,
|
|
1168
1168
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
1169
1169
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1170
1170
|
}]),
|
|
1171
1171
|
onClick: () => {
|
|
1172
|
-
d.modelValue != r.value && !d.disabled &&
|
|
1172
|
+
d.modelValue != r.value && !d.disabled && i("update:model-value", r.value);
|
|
1173
1173
|
},
|
|
1174
1174
|
key: r.name
|
|
1175
1175
|
}, {
|
|
@@ -1198,12 +1198,12 @@ const _hoisted_1$r = {
|
|
|
1198
1198
|
emits: ["update:model-value"],
|
|
1199
1199
|
setup(e, { emit: s }) {
|
|
1200
1200
|
const o = s;
|
|
1201
|
-
return (d,
|
|
1202
|
-
const
|
|
1201
|
+
return (d, i) => {
|
|
1202
|
+
const c = resolveComponent("FmButton"), l = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
|
|
1203
1203
|
return openBlock(), createBlock(n, {
|
|
1204
1204
|
label: e.label,
|
|
1205
1205
|
"model-value": e.modelValue || "",
|
|
1206
|
-
"onUpdate:modelValue":
|
|
1206
|
+
"onUpdate:modelValue": i[1] || (i[1] = (a) => o("update:model-value", a))
|
|
1207
1207
|
}, {
|
|
1208
1208
|
"trigger-button": withCtx(({ opened: a }) => [
|
|
1209
1209
|
createVNode(l, {
|
|
@@ -1212,11 +1212,11 @@ const _hoisted_1$r = {
|
|
|
1212
1212
|
"icon-outlined": !a
|
|
1213
1213
|
}, {
|
|
1214
1214
|
append: withCtx(() => [
|
|
1215
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
1215
|
+
e.modelValue ? (openBlock(), createBlock(c, {
|
|
1216
1216
|
key: 0,
|
|
1217
1217
|
variant: "tertiary",
|
|
1218
1218
|
icon: "clear",
|
|
1219
|
-
onClick:
|
|
1219
|
+
onClick: i[0] || (i[0] = (r) => (r.stopPropagation(), o("update:model-value", null)))
|
|
1220
1220
|
})) : createCommentVNode("", !0)
|
|
1221
1221
|
]),
|
|
1222
1222
|
default: withCtx(() => [
|
|
@@ -1242,14 +1242,14 @@ const _hoisted_1$r = {
|
|
|
1242
1242
|
emits: ["update:model-value"],
|
|
1243
1243
|
setup(e, { emit: s }) {
|
|
1244
1244
|
const { t: o } = useI18n(), d = s;
|
|
1245
|
-
return (
|
|
1245
|
+
return (i, c) => {
|
|
1246
1246
|
var l, n;
|
|
1247
1247
|
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
1248
1248
|
createElementVNode("div", _hoisted_2$j, [
|
|
1249
1249
|
createVNode(_sfc_main$n, {
|
|
1250
1250
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
|
|
1251
1251
|
label: unref(o)("connect.common.startDate"),
|
|
1252
|
-
"onUpdate:modelValue":
|
|
1252
|
+
"onUpdate:modelValue": c[0] || (c[0] = (a) => {
|
|
1253
1253
|
var r;
|
|
1254
1254
|
return d("update:model-value", {
|
|
1255
1255
|
startDate: a,
|
|
@@ -1263,7 +1263,7 @@ const _hoisted_1$r = {
|
|
|
1263
1263
|
createVNode(_sfc_main$n, {
|
|
1264
1264
|
"model-value": ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null,
|
|
1265
1265
|
label: unref(o)("connect.common.endDate"),
|
|
1266
|
-
"onUpdate:modelValue":
|
|
1266
|
+
"onUpdate:modelValue": c[1] || (c[1] = (a) => {
|
|
1267
1267
|
var r;
|
|
1268
1268
|
return d("update:model-value", {
|
|
1269
1269
|
startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
|
|
@@ -1289,9 +1289,9 @@ const _hoisted_1$r = {
|
|
|
1289
1289
|
},
|
|
1290
1290
|
emits: ["update:model-value"],
|
|
1291
1291
|
setup(e, { emit: s }) {
|
|
1292
|
-
const { t: o } = useI18n(), d = e,
|
|
1292
|
+
const { t: o } = useI18n(), d = e, i = s, c = F_APP_INBOX_DESTINATION.options;
|
|
1293
1293
|
function l(V) {
|
|
1294
|
-
|
|
1294
|
+
i("update:model-value", { ...d.modelValue, ...V });
|
|
1295
1295
|
}
|
|
1296
1296
|
function n(V, x) {
|
|
1297
1297
|
return V >= x ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
@@ -1303,18 +1303,18 @@ const _hoisted_1$r = {
|
|
|
1303
1303
|
function p(V, x) {
|
|
1304
1304
|
l({
|
|
1305
1305
|
buttons: a.value.map(
|
|
1306
|
-
(f,
|
|
1306
|
+
(f, v) => v === V ? { ...f, ...x } : f
|
|
1307
1307
|
)
|
|
1308
1308
|
});
|
|
1309
1309
|
}
|
|
1310
|
-
function
|
|
1310
|
+
function h() {
|
|
1311
1311
|
a.value.length >= MAX_BUTTONS || l({ buttons: [...a.value, { label: "", destination: "NONE" }] });
|
|
1312
1312
|
}
|
|
1313
1313
|
function y(V) {
|
|
1314
1314
|
l({ buttons: a.value.filter((x, f) => f !== V) });
|
|
1315
1315
|
}
|
|
1316
1316
|
return (V, x) => {
|
|
1317
|
-
const f = resolveComponent("FmTextField"),
|
|
1317
|
+
const f = resolveComponent("FmTextField"), v = resolveComponent("FmSelect"), u = resolveComponent("FmButton");
|
|
1318
1318
|
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
1319
1319
|
createElementVNode("div", null, [
|
|
1320
1320
|
createElementVNode("div", _hoisted_2$i, [
|
|
@@ -1380,9 +1380,9 @@ const _hoisted_1$r = {
|
|
|
1380
1380
|
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])
|
|
1381
1381
|
]),
|
|
1382
1382
|
createElementVNode("div", _hoisted_14$3, [
|
|
1383
|
-
createVNode(
|
|
1383
|
+
createVNode(v, {
|
|
1384
1384
|
"model-value": m.destination,
|
|
1385
|
-
items: unref(
|
|
1385
|
+
items: unref(c).map((k) => ({
|
|
1386
1386
|
label: unref(o)(`connect.campaign.appInbox.destination.${k}`),
|
|
1387
1387
|
value: k
|
|
1388
1388
|
})),
|
|
@@ -1401,7 +1401,7 @@ const _hoisted_1$r = {
|
|
|
1401
1401
|
variant: "tertiary",
|
|
1402
1402
|
icon: "add",
|
|
1403
1403
|
label: unref(o)("connect.campaign.appInbox.addButton"),
|
|
1404
|
-
onClick:
|
|
1404
|
+
onClick: h
|
|
1405
1405
|
}, null, 8, ["label"])) : createCommentVNode("", !0)
|
|
1406
1406
|
])
|
|
1407
1407
|
]);
|
|
@@ -1417,15 +1417,15 @@ const _hoisted_1$r = {
|
|
|
1417
1417
|
},
|
|
1418
1418
|
emits: ["update:model-value"],
|
|
1419
1419
|
setup(e, { emit: s }) {
|
|
1420
|
-
const { t: o } = useI18n(), d = e,
|
|
1420
|
+
const { t: o } = useI18n(), d = e, i = s, c = F_APP_INBOX_DESTINATION.options;
|
|
1421
1421
|
function l(a) {
|
|
1422
|
-
|
|
1422
|
+
i("update:model-value", { ...d.modelValue, ...a });
|
|
1423
1423
|
}
|
|
1424
1424
|
function n(a, r) {
|
|
1425
1425
|
return a >= r ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
1426
1426
|
}
|
|
1427
1427
|
return (a, r) => {
|
|
1428
|
-
const p = resolveComponent("FmTextField"),
|
|
1428
|
+
const p = resolveComponent("FmTextField"), h = resolveComponent("FmTextarea"), y = resolveComponent("FmSelect");
|
|
1429
1429
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
1430
1430
|
createElementVNode("div", null, [
|
|
1431
1431
|
createElementVNode("div", _hoisted_2$h, [
|
|
@@ -1448,7 +1448,7 @@ const _hoisted_1$r = {
|
|
|
1448
1448
|
class: normalizeClass(["fm-typo-en-body-sm-400", n(e.modelValue.body.length, BODY_WARN_AT)])
|
|
1449
1449
|
}, toDisplayString(e.modelValue.body.length) + " / " + toDisplayString(BODY_LIMIT), 3)
|
|
1450
1450
|
]),
|
|
1451
|
-
createVNode(
|
|
1451
|
+
createVNode(h, {
|
|
1452
1452
|
"model-value": e.modelValue.body,
|
|
1453
1453
|
"max-length": BODY_LIMIT,
|
|
1454
1454
|
placeholder: unref(o)("connect.campaign.push.bodyPlaceholder"),
|
|
@@ -1459,7 +1459,7 @@ const _hoisted_1$r = {
|
|
|
1459
1459
|
createElementVNode("div", _hoisted_6$8, toDisplayString(unref(o)("connect.campaign.push.link")), 1),
|
|
1460
1460
|
createVNode(y, {
|
|
1461
1461
|
"model-value": e.modelValue.destination ?? "NONE",
|
|
1462
|
-
items: unref(
|
|
1462
|
+
items: unref(c).map((V) => ({
|
|
1463
1463
|
label: unref(o)(`connect.campaign.appInbox.destination.${V}`),
|
|
1464
1464
|
value: V
|
|
1465
1465
|
})),
|
|
@@ -1484,41 +1484,41 @@ const _hoisted_1$r = {
|
|
|
1484
1484
|
setup(e) {
|
|
1485
1485
|
const { t: s } = useI18n();
|
|
1486
1486
|
return (o, d) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
1487
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (
|
|
1488
|
-
key:
|
|
1487
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (i) => (openBlock(), createElementBlock("div", {
|
|
1488
|
+
key: i.key,
|
|
1489
1489
|
class: "flex flex-none items-center"
|
|
1490
1490
|
}, [
|
|
1491
|
-
|
|
1491
|
+
i.connector ? (openBlock(), createElementBlock("span", _hoisted_2$g, toDisplayString(i.connector), 1)) : createCommentVNode("", !0),
|
|
1492
1492
|
createElementVNode("button", {
|
|
1493
1493
|
type: "button",
|
|
1494
1494
|
class: normalizeClass([
|
|
1495
1495
|
"min-w-[132px] flex-none rounded-[10px] border px-[14px] py-[10px] text-left transition-colors",
|
|
1496
|
-
e.modelValue ===
|
|
1496
|
+
e.modelValue === i.key ? "border-fm-color-primary bg-fm-color-system-warning-100" : "border-fm-color-neutral-gray-100 bg-fm-color-neutral-white hover:border-fm-color-neutral-gray-200"
|
|
1497
1497
|
]),
|
|
1498
|
-
"aria-current": e.modelValue ===
|
|
1499
|
-
onClick: (
|
|
1498
|
+
"aria-current": e.modelValue === i.key ? "true" : void 0,
|
|
1499
|
+
onClick: (c) => o.$emit("update:model-value", i.key)
|
|
1500
1500
|
}, [
|
|
1501
1501
|
createElementVNode("span", _hoisted_4$c, [
|
|
1502
|
-
|
|
1502
|
+
i.step ? (openBlock(), createElementBlock("span", {
|
|
1503
1503
|
key: 0,
|
|
1504
1504
|
class: normalizeClass([
|
|
1505
1505
|
"flex h-[18px] w-[18px] flex-none items-center justify-center rounded-full text-[10.5px] font-semibold leading-[18px]",
|
|
1506
|
-
e.modelValue ===
|
|
1506
|
+
e.modelValue === i.key ? "bg-fm-color-primary text-fm-color-typo-white" : "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
|
|
1507
1507
|
])
|
|
1508
|
-
}, toDisplayString(
|
|
1508
|
+
}, toDisplayString(i.step), 3)) : createCommentVNode("", !0),
|
|
1509
1509
|
createElementVNode("span", {
|
|
1510
1510
|
class: normalizeClass([
|
|
1511
1511
|
"truncate text-[12.5px] font-semibold leading-[1.3]",
|
|
1512
|
-
e.modelValue ===
|
|
1512
|
+
e.modelValue === i.key ? "text-fm-color-primary" : "text-fm-color-typo-primary"
|
|
1513
1513
|
])
|
|
1514
|
-
}, toDisplayString(
|
|
1515
|
-
|
|
1514
|
+
}, toDisplayString(i.label), 3),
|
|
1515
|
+
i.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", {
|
|
1516
1516
|
key: 1,
|
|
1517
1517
|
class: "h-[7px] w-[7px] flex-none rounded-full bg-fm-color-system-error-400",
|
|
1518
1518
|
title: unref(s)("connect.campaign.broadcast.messageMissing")
|
|
1519
1519
|
}, null, 8, _hoisted_5$a))
|
|
1520
1520
|
]),
|
|
1521
|
-
createElementVNode("span", _hoisted_6$7, toDisplayString(
|
|
1521
|
+
createElementVNode("span", _hoisted_6$7, toDisplayString(i.sub), 1)
|
|
1522
1522
|
], 10, _hoisted_3$d)
|
|
1523
1523
|
]))), 128))
|
|
1524
1524
|
]));
|
|
@@ -1548,23 +1548,23 @@ const _hoisted_1$r = {
|
|
|
1548
1548
|
setup(e) {
|
|
1549
1549
|
const { t: s } = useI18n(), o = e, d = computed(
|
|
1550
1550
|
() => o.target === "PUSH" ? o.content : void 0
|
|
1551
|
-
), c = computed(
|
|
1552
|
-
() => o.target === "APP_INBOX" ? o.content : void 0
|
|
1553
1551
|
), i = computed(
|
|
1552
|
+
() => o.target === "APP_INBOX" ? o.content : void 0
|
|
1553
|
+
), c = computed(
|
|
1554
1554
|
() => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
|
|
1555
1555
|
), l = computed(() => {
|
|
1556
|
-
var
|
|
1557
|
-
const p = (y = (
|
|
1556
|
+
var h, y;
|
|
1557
|
+
const p = (y = (h = c.value) == null ? void 0 : h.content) == null ? void 0 : y.trim();
|
|
1558
1558
|
return p ? o.senderPrefix ? `${o.senderPrefix}${p}` : p : s("connect.campaign.broadcast.preview.emptyText");
|
|
1559
1559
|
}), n = computed(() => {
|
|
1560
|
-
var
|
|
1561
|
-
const p = ((
|
|
1560
|
+
var h;
|
|
1561
|
+
const p = ((h = i.value) == null ? void 0 : h.content) ?? "";
|
|
1562
1562
|
return p.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
|
|
1563
1563
|
html,body{margin:0;font:400 12px/1.5 Inter,system-ui,sans-serif;color:#1C1C1E;word-break:break-word}
|
|
1564
1564
|
img{max-width:100%;height:auto}
|
|
1565
1565
|
</style>${p}` : "";
|
|
1566
1566
|
}), a = computed(() => {
|
|
1567
|
-
const p = /* @__PURE__ */ new Date(),
|
|
1567
|
+
const p = /* @__PURE__ */ new Date(), h = p.toLocaleDateString(void 0, {
|
|
1568
1568
|
weekday: "short",
|
|
1569
1569
|
day: "2-digit",
|
|
1570
1570
|
month: "short"
|
|
@@ -1572,10 +1572,10 @@ const _hoisted_1$r = {
|
|
|
1572
1572
|
hour: "2-digit",
|
|
1573
1573
|
minute: "2-digit"
|
|
1574
1574
|
});
|
|
1575
|
-
return `${
|
|
1575
|
+
return `${h} · ${y}`;
|
|
1576
1576
|
}), r = computed(() => o.target === "PUSH" ? s("connect.campaign.broadcast.preview.note.push") : o.target === "APP_INBOX" ? s("connect.campaign.broadcast.preview.note.inbox") : s("connect.campaign.broadcast.preview.note.text"));
|
|
1577
|
-
return (p,
|
|
1578
|
-
var y, V, x, f,
|
|
1577
|
+
return (p, h) => {
|
|
1578
|
+
var y, V, x, f, v, u, m, C, k, $, F;
|
|
1579
1579
|
return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
1580
1580
|
createElementVNode("div", _hoisted_2$f, toDisplayString(unref(s)("connect.campaign.broadcast.preview.title")), 1),
|
|
1581
1581
|
createElementVNode("div", {
|
|
@@ -1601,11 +1601,11 @@ const _hoisted_1$r = {
|
|
|
1601
1601
|
])) : e.target === "APP_INBOX" ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
1602
1602
|
createElementVNode("div", _hoisted_10$5, toDisplayString(unref(s)("connect.campaign.broadcast.preview.inboxHeading")), 1),
|
|
1603
1603
|
createElementVNode("div", _hoisted_11$3, [
|
|
1604
|
-
createElementVNode("div", _hoisted_12$2, toDisplayString(((u = (
|
|
1605
|
-
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (m = unref(
|
|
1606
|
-
(k = unref(
|
|
1604
|
+
createElementVNode("div", _hoisted_12$2, toDisplayString(((u = (v = unref(i)) == null ? void 0 : v.title) == null ? void 0 : u.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
1605
|
+
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (m = unref(i)) == null ? void 0 : m.previewText) == null ? void 0 : C.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyBody")), 1),
|
|
1606
|
+
(k = unref(i)) != null && k.imageUrl ? (openBlock(), createElementBlock("img", {
|
|
1607
1607
|
key: 0,
|
|
1608
|
-
src: unref(
|
|
1608
|
+
src: unref(i).imageUrl,
|
|
1609
1609
|
alt: "",
|
|
1610
1610
|
class: "mt-8 w-full rounded-[8px]"
|
|
1611
1611
|
}, null, 8, _hoisted_14$2)) : createCommentVNode("", !0),
|
|
@@ -1617,11 +1617,11 @@ const _hoisted_1$r = {
|
|
|
1617
1617
|
class: "mt-8 h-[120px] w-full border-0",
|
|
1618
1618
|
title: unref(s)("connect.campaign.broadcast.preview.bodyFrameTitle")
|
|
1619
1619
|
}, null, 8, _hoisted_15$2)) : createCommentVNode("", !0),
|
|
1620
|
-
(
|
|
1621
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1620
|
+
(F = ($ = unref(i)) == null ? void 0 : $.buttons) != null && F.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
1621
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).buttons, (N, D) => (openBlock(), createElementBlock("div", {
|
|
1622
1622
|
key: D,
|
|
1623
1623
|
class: "rounded-[8px] bg-fm-color-primary px-12 py-8 text-center fm-typo-en-body-sm-400 text-fm-color-typo-white"
|
|
1624
|
-
}, toDisplayString(
|
|
1624
|
+
}, toDisplayString(N.label || unref(s)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
|
|
1625
1625
|
])) : createCommentVNode("", !0)
|
|
1626
1626
|
])
|
|
1627
1627
|
])) : (openBlock(), createElementBlock("div", _hoisted_17$1, [
|
|
@@ -1651,7 +1651,7 @@ const _hoisted_1$r = {
|
|
|
1651
1651
|
emits: ["move", "remove", "add"],
|
|
1652
1652
|
setup(e) {
|
|
1653
1653
|
const { t: s } = useI18n(), o = e, d = computed(() => o.addable.length > 0);
|
|
1654
|
-
return (
|
|
1654
|
+
return (i, c) => {
|
|
1655
1655
|
const l = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"), a = resolveComponent("FmMenu");
|
|
1656
1656
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
1657
1657
|
createElementVNode("div", _hoisted_2$e, [
|
|
@@ -1667,7 +1667,7 @@ const _hoisted_1$r = {
|
|
|
1667
1667
|
createElementVNode("span", _hoisted_7$5, [
|
|
1668
1668
|
createElementVNode("span", _hoisted_8$4, toDisplayString(r.label), 1),
|
|
1669
1669
|
r.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
|
|
1670
|
-
|
|
1670
|
+
c[0] || (c[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
|
|
1671
1671
|
createTextVNode(" " + toDisplayString(unref(s)("connect.campaign.broadcast.messageMissing")), 1)
|
|
1672
1672
|
]))
|
|
1673
1673
|
])
|
|
@@ -1681,8 +1681,9 @@ const _hoisted_1$r = {
|
|
|
1681
1681
|
icon: "arrow_upward",
|
|
1682
1682
|
"icon-color": "neutral-gray-400",
|
|
1683
1683
|
variant: "tertiary",
|
|
1684
|
-
|
|
1685
|
-
|
|
1684
|
+
disabled: p === 0,
|
|
1685
|
+
onClick: (h) => i.$emit("move", r.channel, -1)
|
|
1686
|
+
}, null, 8, ["disabled", "onClick"])
|
|
1686
1687
|
], 8, _hoisted_11$2),
|
|
1687
1688
|
createElementVNode("span", {
|
|
1688
1689
|
title: unref(s)("connect.campaign.broadcast.moveDown"),
|
|
@@ -1693,7 +1694,7 @@ const _hoisted_1$r = {
|
|
|
1693
1694
|
"icon-color": "neutral-gray-400",
|
|
1694
1695
|
variant: "tertiary",
|
|
1695
1696
|
disabled: p === e.rows.length - 1,
|
|
1696
|
-
onClick: (
|
|
1697
|
+
onClick: (h) => i.$emit("move", r.channel, 1)
|
|
1697
1698
|
}, null, 8, ["disabled", "onClick"])
|
|
1698
1699
|
], 8, _hoisted_12$1),
|
|
1699
1700
|
createElementVNode("span", {
|
|
@@ -1704,7 +1705,7 @@ const _hoisted_1$r = {
|
|
|
1704
1705
|
icon: "delete",
|
|
1705
1706
|
"icon-color": "neutral-gray-400",
|
|
1706
1707
|
variant: "tertiary",
|
|
1707
|
-
onClick: (
|
|
1708
|
+
onClick: (h) => i.$emit("remove", r.channel)
|
|
1708
1709
|
}, null, 8, ["onClick"])
|
|
1709
1710
|
], 8, _hoisted_13$1)
|
|
1710
1711
|
])
|
|
@@ -1720,7 +1721,7 @@ const _hoisted_1$r = {
|
|
|
1720
1721
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (r) => (openBlock(), createBlock(n, {
|
|
1721
1722
|
key: r.channel,
|
|
1722
1723
|
label: r.label,
|
|
1723
|
-
onClick: (p) =>
|
|
1724
|
+
onClick: (p) => i.$emit("add", r.channel)
|
|
1724
1725
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
1725
1726
|
]),
|
|
1726
1727
|
_: 1
|
|
@@ -1734,15 +1735,27 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1734
1735
|
key: 0,
|
|
1735
1736
|
class: "flex items-start gap-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1736
1737
|
}, _hoisted_10$3 = { class: "flex flex-col gap-12" }, _hoisted_11$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_12 = { class: "grid items-stretch gap-12 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-4" }, _hoisted_13 = { class: "flex items-start justify-between gap-12" }, _hoisted_14 = {
|
|
1738
|
+
key: 1,
|
|
1739
|
+
class: "h-[8px] w-[8px] rounded-full bg-fm-color-neutral-white"
|
|
1740
|
+
}, _hoisted_15 = {
|
|
1737
1741
|
key: 0,
|
|
1738
1742
|
class: "mt-[3px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1739
|
-
},
|
|
1743
|
+
}, _hoisted_16 = {
|
|
1740
1744
|
key: 1,
|
|
1741
1745
|
class: "mt-[6px] inline-flex rounded-[6px] bg-fm-color-system-warning-100 px-8 py-[3px] fm-typo-en-body-sm-400 text-fm-color-system-warning-400"
|
|
1742
|
-
},
|
|
1746
|
+
}, _hoisted_17 = {
|
|
1747
|
+
key: 2,
|
|
1748
|
+
class: "mt-[6px] inline-flex rounded-[6px] bg-fm-color-neutral-gray-100 px-8 py-[3px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1749
|
+
}, _hoisted_18 = {
|
|
1743
1750
|
key: 0,
|
|
1744
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-
|
|
1745
|
-
},
|
|
1751
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400"
|
|
1752
|
+
}, _hoisted_19 = { class: "flex flex-col gap-[14px]" }, _hoisted_20 = { class: "fm-typo-en-body-lg-600" }, _hoisted_21 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_22 = {
|
|
1753
|
+
key: 1,
|
|
1754
|
+
class: "rounded-[8px] border border-dashed border-fm-color-neutral-gray-200 p-24 text-center fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1755
|
+
}, _hoisted_23 = {
|
|
1756
|
+
key: 3,
|
|
1757
|
+
class: "flex flex-wrap items-start gap-24"
|
|
1758
|
+
}, _hoisted_24 = { class: "min-w-0 flex-1 basis-[340px]" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1746
1759
|
__name: "BroadcastDeliveryInput",
|
|
1747
1760
|
props: {
|
|
1748
1761
|
/** Either the new delivery shape or a legacy single-channel message. */
|
|
@@ -1759,20 +1772,25 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1759
1772
|
default: () => [...DEFAULT_MESSAGE_VARIABLES]
|
|
1760
1773
|
},
|
|
1761
1774
|
helperText: { type: String },
|
|
1775
|
+
/**
|
|
1776
|
+
* False until the merchant tries to proceed. Broadcasts validate on submit,
|
|
1777
|
+
* so incomplete-channel markers stay hidden while the form is being filled.
|
|
1778
|
+
*/
|
|
1779
|
+
showValidation: { type: Boolean, default: !0 },
|
|
1762
1780
|
helperState: { type: String },
|
|
1763
1781
|
placeholder: { type: String }
|
|
1764
1782
|
},
|
|
1765
1783
|
emits: ["update:model-value"],
|
|
1766
1784
|
setup(e, { emit: s }) {
|
|
1767
|
-
const { t: o } = useI18n(), d = useCoreStore(),
|
|
1768
|
-
const
|
|
1769
|
-
return
|
|
1785
|
+
const { t: o } = useI18n(), d = useCoreStore(), i = useMembershipStore(), c = e, l = s, n = ref(!1), a = ref("SMS"), r = computed(() => {
|
|
1786
|
+
const g = c.modelValue;
|
|
1787
|
+
return g && "channels" in g ? g : toDelivery({ message: g });
|
|
1770
1788
|
});
|
|
1771
|
-
function p(
|
|
1772
|
-
l("update:model-value",
|
|
1789
|
+
function p(g) {
|
|
1790
|
+
l("update:model-value", g);
|
|
1773
1791
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return o(`connect.campaign.broadcast.channel.${
|
|
1792
|
+
function h(g) {
|
|
1793
|
+
return o(`connect.campaign.broadcast.channel.${g}`);
|
|
1776
1794
|
}
|
|
1777
1795
|
const y = {
|
|
1778
1796
|
SMS: "chat",
|
|
@@ -1781,139 +1799,154 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1781
1799
|
APP_INBOX: "inbox",
|
|
1782
1800
|
PUSH: "notifications"
|
|
1783
1801
|
};
|
|
1784
|
-
function V(
|
|
1785
|
-
return y[
|
|
1802
|
+
function V(g) {
|
|
1803
|
+
return y[g];
|
|
1786
1804
|
}
|
|
1787
1805
|
const x = computed(() => r.value.mode === "fallback"), f = computed(
|
|
1788
|
-
() =>
|
|
1789
|
-
(
|
|
1806
|
+
() => c.variables.filter(
|
|
1807
|
+
(g) => c.triggerType == "SCHEDULE" ? !g.startsWith("transaction.") : !0
|
|
1790
1808
|
)
|
|
1791
1809
|
);
|
|
1792
|
-
function g
|
|
1793
|
-
return
|
|
1810
|
+
function v(g) {
|
|
1811
|
+
return g === "WHATSAPP" ? n.value : !0;
|
|
1794
1812
|
}
|
|
1795
1813
|
const u = ["fallback", "all"];
|
|
1796
|
-
function m(
|
|
1797
|
-
|
|
1814
|
+
function m(g) {
|
|
1815
|
+
g !== r.value.mode && p(setMode(r.value, g));
|
|
1798
1816
|
}
|
|
1799
1817
|
const C = ref(null);
|
|
1800
|
-
function k(
|
|
1801
|
-
var
|
|
1802
|
-
const
|
|
1803
|
-
return
|
|
1818
|
+
function k(g) {
|
|
1819
|
+
var R;
|
|
1820
|
+
const E = (R = C.value) == null ? void 0 : R[g];
|
|
1821
|
+
return E ? new Intl.NumberFormat(void 0, {
|
|
1804
1822
|
style: "currency",
|
|
1805
|
-
currency:
|
|
1806
|
-
minimumFractionDigits:
|
|
1807
|
-
maximumFractionDigits:
|
|
1808
|
-
}).format(
|
|
1823
|
+
currency: E.currency,
|
|
1824
|
+
minimumFractionDigits: E.precision,
|
|
1825
|
+
maximumFractionDigits: E.precision
|
|
1826
|
+
}).format(E.amount / 10 ** E.precision) : null;
|
|
1809
1827
|
}
|
|
1810
1828
|
const $ = computed(
|
|
1811
|
-
() => CHANNEL_DISPLAY_ORDER.map((
|
|
1812
|
-
const
|
|
1829
|
+
() => CHANNEL_DISPLAY_ORDER.map((g) => {
|
|
1830
|
+
const E = r.value.channels.includes(g), R = k(g);
|
|
1813
1831
|
return {
|
|
1814
|
-
channel:
|
|
1815
|
-
label:
|
|
1816
|
-
selected:
|
|
1817
|
-
available: g
|
|
1818
|
-
rateNote: isPaidChannel(
|
|
1819
|
-
//
|
|
1820
|
-
//
|
|
1821
|
-
|
|
1832
|
+
channel: g,
|
|
1833
|
+
label: h(g),
|
|
1834
|
+
selected: E,
|
|
1835
|
+
available: v(g),
|
|
1836
|
+
rateNote: isPaidChannel(g) ? R ? o("connect.campaign.broadcast.perMessage", { price: R }) : null : o("connect.campaign.broadcast.freeChannel"),
|
|
1837
|
+
// In fallback mode the grid is a radio for the primary channel, so only
|
|
1838
|
+
// the primary reads as checked; a fallback is tagged instead.
|
|
1839
|
+
checked: x.value ? r.value.channels[0] === g : E,
|
|
1840
|
+
usedAsFallback: x.value && r.value.channels.indexOf(g) > 0
|
|
1822
1841
|
};
|
|
1823
1842
|
})
|
|
1824
1843
|
);
|
|
1825
|
-
async function
|
|
1826
|
-
if (g
|
|
1827
|
-
if (
|
|
1828
|
-
await
|
|
1844
|
+
async function F(g) {
|
|
1845
|
+
if (v(g)) {
|
|
1846
|
+
if (x.value) {
|
|
1847
|
+
await N(g);
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
if (r.value.channels.includes(g)) {
|
|
1851
|
+
await D(g);
|
|
1829
1852
|
return;
|
|
1830
1853
|
}
|
|
1831
|
-
p(addChannel(r.value,
|
|
1854
|
+
p(addChannel(r.value, g, f.value));
|
|
1832
1855
|
}
|
|
1833
1856
|
}
|
|
1834
|
-
async function
|
|
1835
|
-
|
|
1857
|
+
async function N(g) {
|
|
1858
|
+
const E = r.value.channels[0];
|
|
1859
|
+
E !== g && (E && hasDraft(r.value, E) && !await prompt.remove(
|
|
1860
|
+
o("connect.campaign.broadcast.replaceChannelConfirm", {
|
|
1861
|
+
channel: h(E),
|
|
1862
|
+
next: h(g)
|
|
1863
|
+
})
|
|
1864
|
+
) || (p(setPrimaryChannel(r.value, g, f.value)), a.value = g));
|
|
1865
|
+
}
|
|
1866
|
+
async function D(g) {
|
|
1867
|
+
if (hasDraft(r.value, g) && !await prompt.remove(
|
|
1836
1868
|
o("connect.campaign.broadcast.removeChannelConfirm", {
|
|
1837
|
-
channel:
|
|
1869
|
+
channel: h(g)
|
|
1838
1870
|
})
|
|
1839
|
-
))
|
|
1840
|
-
|
|
1841
|
-
|
|
1871
|
+
))
|
|
1872
|
+
return;
|
|
1873
|
+
const E = removeChannel(r.value, g);
|
|
1874
|
+
p(E), a.value === g && (a.value = E.channels[0] ?? "SMS");
|
|
1842
1875
|
}
|
|
1843
|
-
function
|
|
1844
|
-
p(moveChannel(r.value,
|
|
1876
|
+
function w(g, E) {
|
|
1877
|
+
p(moveChannel(r.value, g, E));
|
|
1845
1878
|
}
|
|
1846
|
-
const
|
|
1847
|
-
() => r.value.channels.slice(1).map((
|
|
1848
|
-
channel:
|
|
1849
|
-
label:
|
|
1850
|
-
position:
|
|
1851
|
-
complete: isChannelComplete(r.value,
|
|
1879
|
+
const O = computed(
|
|
1880
|
+
() => r.value.channels.slice(1).map((g, E) => ({
|
|
1881
|
+
channel: g,
|
|
1882
|
+
label: h(g),
|
|
1883
|
+
position: E + 2,
|
|
1884
|
+
complete: !c.showValidation || isChannelComplete(r.value, g)
|
|
1852
1885
|
}))
|
|
1853
|
-
),
|
|
1886
|
+
), j = computed(
|
|
1854
1887
|
() => CHANNEL_DISPLAY_ORDER.filter(
|
|
1855
|
-
(
|
|
1856
|
-
).map((
|
|
1857
|
-
channel:
|
|
1858
|
-
label:
|
|
1888
|
+
(g) => !r.value.channels.includes(g) && v(g)
|
|
1889
|
+
).map((g) => ({
|
|
1890
|
+
channel: g,
|
|
1891
|
+
label: h(g)
|
|
1859
1892
|
}))
|
|
1860
|
-
),
|
|
1861
|
-
() => r.value.channels.map((
|
|
1862
|
-
key:
|
|
1863
|
-
label:
|
|
1864
|
-
sub: x.value ? o(
|
|
1865
|
-
complete: isChannelComplete(r.value,
|
|
1866
|
-
step: x.value ?
|
|
1867
|
-
connector:
|
|
1893
|
+
), I = computed(
|
|
1894
|
+
() => r.value.channels.map((g, E) => ({
|
|
1895
|
+
key: g,
|
|
1896
|
+
label: h(g),
|
|
1897
|
+
sub: x.value ? o(E === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached") : o("connect.campaign.broadcast.tab.sendsToEligible"),
|
|
1898
|
+
complete: !c.showValidation || isChannelComplete(r.value, g),
|
|
1899
|
+
step: x.value ? E + 1 : void 0,
|
|
1900
|
+
connector: E === 0 ? void 0 : x.value ? "→" : "+"
|
|
1868
1901
|
}))
|
|
1869
1902
|
);
|
|
1870
1903
|
watchEffect(() => {
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1904
|
+
const g = I.value.map((E) => E.key);
|
|
1905
|
+
g.length && !g.includes(a.value) && (a.value = g[0]);
|
|
1873
1906
|
});
|
|
1874
|
-
const
|
|
1875
|
-
const
|
|
1876
|
-
if (!(
|
|
1877
|
-
return r.value.content[
|
|
1907
|
+
const H = computed(() => a.value), q = computed(() => {
|
|
1908
|
+
const g = H.value;
|
|
1909
|
+
if (!(g === "APP_INBOX" || g === "PUSH"))
|
|
1910
|
+
return r.value.content[g];
|
|
1878
1911
|
}), G = computed(
|
|
1879
1912
|
() => r.value.content.APP_INBOX
|
|
1880
|
-
),
|
|
1913
|
+
), Y = computed(
|
|
1881
1914
|
() => r.value.content.PUSH
|
|
1882
1915
|
);
|
|
1883
|
-
function
|
|
1884
|
-
p(setChannelContent(r.value, "APP_INBOX",
|
|
1916
|
+
function Z(g) {
|
|
1917
|
+
p(setChannelContent(r.value, "APP_INBOX", g));
|
|
1885
1918
|
}
|
|
1886
|
-
function
|
|
1887
|
-
p(setChannelContent(r.value, "PUSH",
|
|
1919
|
+
function b(g) {
|
|
1920
|
+
p(setChannelContent(r.value, "PUSH", g));
|
|
1888
1921
|
}
|
|
1889
|
-
function
|
|
1890
|
-
p(setChannelContent(r.value,
|
|
1922
|
+
function B(g, E) {
|
|
1923
|
+
g === "APP_INBOX" || g === "PUSH" || p(setChannelContent(r.value, g, { ...E, channel: g }));
|
|
1891
1924
|
}
|
|
1892
|
-
const
|
|
1925
|
+
const T = computed(
|
|
1893
1926
|
() => r.value.channels.filter(isPaidChannel)
|
|
1894
|
-
),
|
|
1895
|
-
var
|
|
1896
|
-
const
|
|
1897
|
-
return getSmsMessageMetrics({ brandName:
|
|
1898
|
-
}),
|
|
1899
|
-
async function
|
|
1927
|
+
), U = computed(() => {
|
|
1928
|
+
var E, R, M;
|
|
1929
|
+
const g = ((E = i.membership) == null ? void 0 : E.brand) || ((M = (R = d.currentBusiness) == null ? void 0 : R.value) == null ? void 0 : M.name) || "";
|
|
1930
|
+
return getSmsMessageMetrics({ brandName: g, content: "" }).prefix;
|
|
1931
|
+
}), P = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
|
|
1932
|
+
async function A() {
|
|
1900
1933
|
try {
|
|
1901
|
-
const
|
|
1902
|
-
n.value =
|
|
1903
|
-
(
|
|
1904
|
-
var
|
|
1905
|
-
return (
|
|
1934
|
+
const g = await membershipApi.getWhatsappNumbers();
|
|
1935
|
+
n.value = g.some(
|
|
1936
|
+
(E) => {
|
|
1937
|
+
var R;
|
|
1938
|
+
return (R = E == null ? void 0 : E.default) == null ? void 0 : R.includes("Marketing");
|
|
1906
1939
|
}
|
|
1907
1940
|
);
|
|
1908
|
-
} catch (
|
|
1909
|
-
console.error("Failed to fetch WhatsApp numbers:",
|
|
1941
|
+
} catch (g) {
|
|
1942
|
+
console.error("Failed to fetch WhatsApp numbers:", g);
|
|
1910
1943
|
}
|
|
1911
1944
|
}
|
|
1912
1945
|
return onMounted(async () => {
|
|
1913
|
-
const
|
|
1914
|
-
|
|
1915
|
-
}), (
|
|
1916
|
-
const
|
|
1946
|
+
const g = r.value.channels[0];
|
|
1947
|
+
g && (a.value = g), campaignApi.readBroadcastCreditSummary().then((E) => C.value = E.prices).catch(() => C.value = null), await A();
|
|
1948
|
+
}), (g, E) => {
|
|
1949
|
+
const R = resolveComponent("FmIcon"), M = resolveComponent("FmCard");
|
|
1917
1950
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1918
1951
|
createElementVNode("div", _hoisted_2$d, [
|
|
1919
1952
|
createElementVNode("div", null, [
|
|
@@ -1921,19 +1954,19 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1921
1954
|
createElementVNode("div", _hoisted_4$9, toDisplayString(unref(o)("connect.campaign.broadcast.deliveryDescription")), 1)
|
|
1922
1955
|
]),
|
|
1923
1956
|
createElementVNode("div", _hoisted_5$7, [
|
|
1924
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(u, (S) => createVNode(
|
|
1957
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(u, (S) => createVNode(M, {
|
|
1925
1958
|
key: S,
|
|
1926
1959
|
variant: "outlined",
|
|
1927
1960
|
class: normalizeClass(["h-full cursor-pointer select-none p-16 space-y-8", {
|
|
1928
1961
|
"border-fm-color-primary bg-fm-color-system-warning-100": unref(r).mode === S,
|
|
1929
1962
|
"hover:bg-fm-color-opacity-sm": unref(r).mode !== S
|
|
1930
1963
|
}]),
|
|
1931
|
-
onClick: (
|
|
1964
|
+
onClick: (L) => m(S)
|
|
1932
1965
|
}, {
|
|
1933
1966
|
default: withCtx(() => [
|
|
1934
1967
|
createElementVNode("div", _hoisted_6$4, [
|
|
1935
1968
|
createElementVNode("div", _hoisted_7$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${S}.label`)), 1),
|
|
1936
|
-
unref(r).mode === S ? (openBlock(), createBlock(
|
|
1969
|
+
unref(r).mode === S ? (openBlock(), createBlock(R, {
|
|
1937
1970
|
key: 0,
|
|
1938
1971
|
name: "check_circle",
|
|
1939
1972
|
size: "md",
|
|
@@ -1946,7 +1979,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1946
1979
|
}, 1032, ["class", "onClick"])), 64))
|
|
1947
1980
|
]),
|
|
1948
1981
|
unref(r).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
1949
|
-
createVNode(
|
|
1982
|
+
createVNode(R, {
|
|
1950
1983
|
name: "info",
|
|
1951
1984
|
size: "sm",
|
|
1952
1985
|
class: "mt-[2px]"
|
|
@@ -1955,17 +1988,17 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1955
1988
|
])) : createCommentVNode("", !0)
|
|
1956
1989
|
]),
|
|
1957
1990
|
createElementVNode("div", _hoisted_10$3, [
|
|
1958
|
-
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
1991
|
+
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(x) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
1959
1992
|
createElementVNode("div", _hoisted_12, [
|
|
1960
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref($), (S) => (openBlock(), createBlock(
|
|
1993
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref($), (S) => (openBlock(), createBlock(M, {
|
|
1961
1994
|
key: S.channel,
|
|
1962
1995
|
variant: "outlined",
|
|
1963
1996
|
class: normalizeClass(["flex h-full flex-col gap-12 p-16", [
|
|
1964
|
-
S.
|
|
1965
|
-
S.available ?
|
|
1997
|
+
S.checked ? "!border-fm-color-primary bg-fm-color-system-warning-100" : "",
|
|
1998
|
+
S.available ? "cursor-pointer" : "cursor-not-allowed bg-fm-color-neutral-gray-100"
|
|
1966
1999
|
]]),
|
|
1967
2000
|
"aria-disabled": !S.available,
|
|
1968
|
-
onClick: (
|
|
2001
|
+
onClick: (L) => F(S.channel)
|
|
1969
2002
|
}, {
|
|
1970
2003
|
default: withCtx(() => [
|
|
1971
2004
|
createElementVNode("div", _hoisted_13, [
|
|
@@ -1975,97 +2008,99 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1975
2008
|
S.available ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-200 text-fm-color-neutral-gray-400"
|
|
1976
2009
|
])
|
|
1977
2010
|
}, [
|
|
1978
|
-
createVNode(
|
|
2011
|
+
createVNode(R, {
|
|
1979
2012
|
name: V(S.channel),
|
|
1980
2013
|
size: "md"
|
|
1981
2014
|
}, null, 8, ["name"])
|
|
1982
2015
|
], 2),
|
|
1983
2016
|
S.available ? (openBlock(), createElementBlock("span", {
|
|
1984
2017
|
key: 0,
|
|
1985
|
-
class: normalizeClass([
|
|
1986
|
-
|
|
1987
|
-
S.
|
|
1988
|
-
])
|
|
2018
|
+
class: normalizeClass(["flex h-[22px] w-[22px] flex-none items-center justify-center border-2 transition-colors", [
|
|
2019
|
+
unref(x) ? "rounded-full" : "rounded-[4px]",
|
|
2020
|
+
S.checked ? "border-fm-color-primary bg-fm-color-primary text-fm-color-typo-white" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
|
|
2021
|
+
]])
|
|
1989
2022
|
}, [
|
|
1990
|
-
S.
|
|
2023
|
+
S.checked && !unref(x) ? (openBlock(), createBlock(R, {
|
|
1991
2024
|
key: 0,
|
|
1992
2025
|
name: "check",
|
|
1993
2026
|
size: "sm"
|
|
1994
|
-
})) : createCommentVNode("", !0)
|
|
2027
|
+
})) : S.checked ? (openBlock(), createElementBlock("span", _hoisted_14)) : createCommentVNode("", !0)
|
|
1995
2028
|
], 2)) : createCommentVNode("", !0)
|
|
1996
2029
|
]),
|
|
1997
2030
|
createElementVNode("div", null, [
|
|
1998
2031
|
createElementVNode("div", {
|
|
1999
2032
|
class: normalizeClass(["fm-typo-en-body-md-600", S.available ? "" : "text-fm-color-typo-disabled"])
|
|
2000
2033
|
}, toDisplayString(S.label), 3),
|
|
2001
|
-
S.available && S.rateNote ? (openBlock(), createElementBlock("div",
|
|
2002
|
-
S.available ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div",
|
|
2034
|
+
S.available && S.rateNote ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(S.rateNote), 1)) : createCommentVNode("", !0),
|
|
2035
|
+
S.available ? S.usedAsFallback ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(unref(o)("connect.campaign.broadcast.usedAsFallback")), 1)) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(unref(o)("connect.campaign.broadcast.notSetUp")), 1))
|
|
2003
2036
|
]),
|
|
2004
2037
|
S.available ? createCommentVNode("", !0) : (openBlock(), createElementBlock("a", {
|
|
2005
2038
|
key: 0,
|
|
2006
|
-
href:
|
|
2039
|
+
href: P,
|
|
2007
2040
|
target: "_blank",
|
|
2008
2041
|
class: "mt-auto fm-typo-en-body-sm-400 text-fm-color-secondary-blueberry underline",
|
|
2009
|
-
onClick:
|
|
2042
|
+
onClick: E[0] || (E[0] = withModifiers(() => {
|
|
2010
2043
|
}, ["stop"]))
|
|
2011
2044
|
}, toDisplayString(unref(o)("connect.campaign.messageInput.manageWhatsappChannel")), 1))
|
|
2012
2045
|
]),
|
|
2013
2046
|
_: 2
|
|
2014
2047
|
}, 1032, ["class", "aria-disabled", "onClick"]))), 128))
|
|
2015
2048
|
]),
|
|
2016
|
-
unref(r).channels.length
|
|
2017
|
-
unref(x) ? (openBlock(), createBlock(_sfc_main$h, {
|
|
2049
|
+
e.showValidation && !unref(r).channels.length ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
|
|
2050
|
+
unref(x) && unref(r).channels.length ? (openBlock(), createBlock(_sfc_main$h, {
|
|
2018
2051
|
key: 1,
|
|
2019
|
-
rows: unref(
|
|
2020
|
-
addable: unref(
|
|
2021
|
-
onMove:
|
|
2022
|
-
onRemove:
|
|
2023
|
-
onAdd:
|
|
2052
|
+
rows: unref(O),
|
|
2053
|
+
addable: unref(j),
|
|
2054
|
+
onMove: w,
|
|
2055
|
+
onRemove: D,
|
|
2056
|
+
onAdd: E[1] || (E[1] = (S) => p(unref(addChannel)(unref(r), S, unref(f))))
|
|
2024
2057
|
}, null, 8, ["rows", "addable"])) : createCommentVNode("", !0)
|
|
2025
2058
|
]),
|
|
2026
|
-
createElementVNode("div",
|
|
2059
|
+
createElementVNode("div", _hoisted_19, [
|
|
2027
2060
|
createElementVNode("div", null, [
|
|
2028
|
-
createElementVNode("div",
|
|
2029
|
-
createElementVNode("div",
|
|
2061
|
+
createElementVNode("div", _hoisted_20, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
|
|
2062
|
+
createElementVNode("div", _hoisted_21, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
|
|
2030
2063
|
]),
|
|
2031
|
-
unref(
|
|
2064
|
+
unref(T).length ? (openBlock(), createBlock(_sfc_main$w, {
|
|
2032
2065
|
key: 0,
|
|
2033
|
-
channels: unref(
|
|
2066
|
+
channels: unref(T)
|
|
2034
2067
|
}, null, 8, ["channels"])) : createCommentVNode("", !0),
|
|
2035
|
-
|
|
2068
|
+
unref(r).channels.length ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_22, toDisplayString(unref(o)("connect.campaign.broadcast.noChannelContent")), 1)),
|
|
2069
|
+
unref(r).channels.length ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2070
|
+
key: 2,
|
|
2036
2071
|
modelValue: unref(a),
|
|
2037
|
-
"onUpdate:modelValue":
|
|
2038
|
-
tabs: unref(
|
|
2039
|
-
}, null, 8, ["modelValue", "tabs"]),
|
|
2040
|
-
|
|
2041
|
-
createElementVNode("div",
|
|
2042
|
-
unref(a) === "PUSH" && unref(
|
|
2072
|
+
"onUpdate:modelValue": E[2] || (E[2] = (S) => isRef(a) ? a.value = S : null),
|
|
2073
|
+
tabs: unref(I)
|
|
2074
|
+
}, null, 8, ["modelValue", "tabs"])) : createCommentVNode("", !0),
|
|
2075
|
+
unref(r).channels.includes(unref(a)) ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
2076
|
+
createElementVNode("div", _hoisted_24, [
|
|
2077
|
+
unref(a) === "PUSH" && unref(Y) ? (openBlock(), createBlock(_sfc_main$k, {
|
|
2043
2078
|
key: 0,
|
|
2044
|
-
"model-value": unref(
|
|
2045
|
-
"onUpdate:modelValue":
|
|
2079
|
+
"model-value": unref(Y),
|
|
2080
|
+
"onUpdate:modelValue": b
|
|
2046
2081
|
}, null, 8, ["model-value"])) : unref(a) === "APP_INBOX" && unref(G) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
2047
2082
|
key: 1,
|
|
2048
2083
|
"model-value": unref(G),
|
|
2049
2084
|
variables: unref(f),
|
|
2050
|
-
"onUpdate:modelValue":
|
|
2085
|
+
"onUpdate:modelValue": Z
|
|
2051
2086
|
}, null, 8, ["model-value", "variables"])) : unref(a) !== "APP_INBOX" && unref(a) !== "PUSH" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2052
2087
|
key: unref(a),
|
|
2053
|
-
"model-value": unref(
|
|
2088
|
+
"model-value": unref(q),
|
|
2054
2089
|
"allow-email": !1,
|
|
2055
2090
|
"allow-whatsapp": !1,
|
|
2056
2091
|
"hide-credit-card": !0,
|
|
2057
2092
|
"trigger-type": e.triggerType,
|
|
2058
2093
|
variables: unref(f),
|
|
2059
2094
|
placeholder: e.placeholder,
|
|
2060
|
-
"onUpdate:modelValue":
|
|
2095
|
+
"onUpdate:modelValue": E[3] || (E[3] = (S) => B(unref(H), S))
|
|
2061
2096
|
}, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
|
|
2062
2097
|
]),
|
|
2063
2098
|
createVNode(_sfc_main$i, {
|
|
2064
2099
|
target: unref(a),
|
|
2065
|
-
content: unref(r).content[unref(
|
|
2066
|
-
"sender-prefix": unref(
|
|
2100
|
+
content: unref(r).content[unref(H)],
|
|
2101
|
+
"sender-prefix": unref(U)
|
|
2067
2102
|
}, null, 8, ["target", "content", "sender-prefix"])
|
|
2068
|
-
])
|
|
2103
|
+
])) : createCommentVNode("", !0)
|
|
2069
2104
|
])
|
|
2070
2105
|
]);
|
|
2071
2106
|
};
|
|
@@ -2089,8 +2124,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2089
2124
|
},
|
|
2090
2125
|
emits: ["update:model-value"],
|
|
2091
2126
|
setup(e, { emit: s }) {
|
|
2092
|
-
const { t: o } = useI18n(), d = e,
|
|
2093
|
-
() => CountryTimezone[
|
|
2127
|
+
const { t: o } = useI18n(), d = e, i = s, c = useCoreStore(), l = computed(
|
|
2128
|
+
() => CountryTimezone[c.currentCountry.value || "MY"]
|
|
2094
2129
|
);
|
|
2095
2130
|
function n() {
|
|
2096
2131
|
const u = RuleBuilder.getRules(d.modelValue);
|
|
@@ -2098,7 +2133,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2098
2133
|
(m) => isRuleEntry(m) && RuleBuilder.simplify(m).operator == "_rrule"
|
|
2099
2134
|
) ? "repeating" : "fixed";
|
|
2100
2135
|
}
|
|
2101
|
-
const a = ref(n()), r = ref(!1), p = ref(!1),
|
|
2136
|
+
const a = ref(n()), r = ref(!1), p = ref(!1), h = computed(() => [
|
|
2102
2137
|
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
2103
2138
|
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
2104
2139
|
]), y = computed(() => {
|
|
@@ -2120,7 +2155,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2120
2155
|
)
|
|
2121
2156
|
);
|
|
2122
2157
|
function x(u, m) {
|
|
2123
|
-
|
|
2158
|
+
i(
|
|
2124
2159
|
"update:model-value",
|
|
2125
2160
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2126
2161
|
RuleBuilder.constructEntry("trigger.date", "_rrule", u),
|
|
@@ -2165,7 +2200,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2165
2200
|
),
|
|
2166
2201
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
2167
2202
|
];
|
|
2168
|
-
|
|
2203
|
+
i(
|
|
2169
2204
|
"update:model-value",
|
|
2170
2205
|
RuleBuilder.setRuleToGroup(
|
|
2171
2206
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -2173,8 +2208,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2173
2208
|
)
|
|
2174
2209
|
), a.value = m, p.value = !1;
|
|
2175
2210
|
}
|
|
2176
|
-
function
|
|
2177
|
-
a.value == "fixed" ?
|
|
2211
|
+
function v(u) {
|
|
2212
|
+
a.value == "fixed" ? i(
|
|
2178
2213
|
"update:model-value",
|
|
2179
2214
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2180
2215
|
RuleBuilder.constructEntry(
|
|
@@ -2191,11 +2226,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2191
2226
|
) : x(u.date, u.time), p.value = !1;
|
|
2192
2227
|
}
|
|
2193
2228
|
return (u, m) => {
|
|
2194
|
-
const C = resolveComponent("FmButtonGroup"), k = resolveComponent("FmTimePicker"), $ = resolveComponent("FmIcon"),
|
|
2229
|
+
const C = resolveComponent("FmButtonGroup"), k = resolveComponent("FmTimePicker"), $ = resolveComponent("FmIcon"), F = resolveComponent("FmTooltip"), N = resolveComponent("FmField"), D = resolveComponent("FmCard"), w = resolveComponent("FmPopover"), O = resolveComponent("FmDatePicker"), j = resolveComponent("FmHelperText");
|
|
2195
2230
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2196
2231
|
createVNode(C, {
|
|
2197
|
-
items: unref(
|
|
2198
|
-
"model-value": unref(
|
|
2232
|
+
items: unref(h),
|
|
2233
|
+
"model-value": unref(h).find((I) => I.value === unref(a)) ?? null,
|
|
2199
2234
|
"onUpdate:modelValue": f,
|
|
2200
2235
|
class: "mb-8"
|
|
2201
2236
|
}, null, 8, ["items", "model-value"]),
|
|
@@ -2204,14 +2239,14 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2204
2239
|
createVNode(k, {
|
|
2205
2240
|
label: unref(o)("connect.template.rule.schedule.notify_time"),
|
|
2206
2241
|
"model-value": unref(y).time,
|
|
2207
|
-
"onUpdate:modelValue": m[0] || (m[0] = (I) =>
|
|
2242
|
+
"onUpdate:modelValue": m[0] || (m[0] = (I) => v({ date: unref(y).date, time: I })),
|
|
2208
2243
|
"helper-text": unref(y).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
|
|
2209
2244
|
"helper-state": unref(y).time ? void 0 : "error"
|
|
2210
2245
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
2211
2246
|
unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
2212
2247
|
createElementVNode("div", _hoisted_4$8, [
|
|
2213
2248
|
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
2214
|
-
unref(y).date ? (openBlock(), createBlock(
|
|
2249
|
+
unref(y).date ? (openBlock(), createBlock(F, {
|
|
2215
2250
|
key: 0,
|
|
2216
2251
|
"z-index": 9999,
|
|
2217
2252
|
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options)
|
|
@@ -2231,7 +2266,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2231
2266
|
onPopoverChanged: m[3] || (m[3] = (I) => r.value = I)
|
|
2232
2267
|
}, {
|
|
2233
2268
|
"popover-button": withCtx(() => [
|
|
2234
|
-
createVNode(
|
|
2269
|
+
createVNode(N, {
|
|
2235
2270
|
class: "cursor-pointer",
|
|
2236
2271
|
"helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2237
2272
|
"helper-state": unref(y).date ? void 0 : "error"
|
|
@@ -2250,7 +2285,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2250
2285
|
"model-value": unref(y).date || "",
|
|
2251
2286
|
"start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
|
|
2252
2287
|
onCancel: m[1] || (m[1] = (I) => r.value = !1),
|
|
2253
|
-
"onUpdate:modelValue": m[2] || (m[2] = (I) => (
|
|
2288
|
+
"onUpdate:modelValue": m[2] || (m[2] = (I) => (v({ date: I, time: unref(y).time }), r.value = !1))
|
|
2254
2289
|
}, null, 8, ["model-value", "start-date"])
|
|
2255
2290
|
]),
|
|
2256
2291
|
_: 1
|
|
@@ -2262,17 +2297,17 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2262
2297
|
key: 1,
|
|
2263
2298
|
label: unref(o)("connect.template.rule.schedule.notify_date"),
|
|
2264
2299
|
"model-value": unref(y).date || "",
|
|
2265
|
-
"onUpdate:modelValue": m[4] || (m[4] = (I) =>
|
|
2300
|
+
"onUpdate:modelValue": m[4] || (m[4] = (I) => v({ date: I, time: unref(y).time })),
|
|
2266
2301
|
"helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2267
2302
|
"helper-state": unref(y).date ? void 0 : "error"
|
|
2268
2303
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
2269
2304
|
]),
|
|
2270
|
-
unref(y).date && unref(y).time && unref(V) ? (openBlock(), createBlock(
|
|
2305
|
+
unref(y).date && unref(y).time && unref(V) ? (openBlock(), createBlock(j, {
|
|
2271
2306
|
key: 0,
|
|
2272
2307
|
text: `${unref(moment)(unref(V)).isAfter(unref(moment)()) ? unref(o)("connect.template.rule.schedule.next_notification") : unref(o)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(V)).format("dddd, DD MMM YYYY")} at
|
|
2273
2308
|
${unref(moment)(unref(V)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(V)).fromNow()})`
|
|
2274
2309
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2275
|
-
unref(p) ? (openBlock(), createBlock(
|
|
2310
|
+
unref(p) ? (openBlock(), createBlock(j, {
|
|
2276
2311
|
key: 1,
|
|
2277
2312
|
text: "Repeating schedule was updated to stay anchored to the campaign start date.",
|
|
2278
2313
|
state: "warning"
|
|
@@ -2290,7 +2325,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2290
2325
|
},
|
|
2291
2326
|
emits: ["update:model-value"],
|
|
2292
2327
|
setup(e, { emit: s }) {
|
|
2293
|
-
const { t: o } = useI18n(), d = e,
|
|
2328
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(
|
|
2294
2329
|
() => [
|
|
2295
2330
|
{
|
|
2296
2331
|
label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -2311,15 +2346,15 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2311
2346
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
2312
2347
|
createElementVNode("div", _hoisted_2$b, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2313
2348
|
createElementVNode("div", _hoisted_3$8, [
|
|
2314
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2349
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
|
|
2315
2350
|
variant: "outlined",
|
|
2316
2351
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2317
|
-
"col-span-2": unref(
|
|
2352
|
+
"col-span-2": unref(c).length == 1,
|
|
2318
2353
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
2319
2354
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
2320
2355
|
}]),
|
|
2321
2356
|
onClick: () => {
|
|
2322
|
-
d.modelValue != r.value &&
|
|
2357
|
+
d.modelValue != r.value && i("update:model-value", r.value);
|
|
2323
2358
|
},
|
|
2324
2359
|
key: r.value
|
|
2325
2360
|
}, {
|
|
@@ -2340,25 +2375,25 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2340
2375
|
__name: "EditRewardPoolSheet",
|
|
2341
2376
|
emits: ["update:model-value"],
|
|
2342
2377
|
setup(e, { expose: s, emit: o }) {
|
|
2343
|
-
const d = useMembershipStore(), { minor:
|
|
2378
|
+
const d = useMembershipStore(), { minor: i } = useLoading, c = ref(!1), l = ref(), n = ref(), a = ref(0), r = computed(() => {
|
|
2344
2379
|
var f;
|
|
2345
2380
|
return ((f = d.loyaltyRewards.items.find(
|
|
2346
|
-
(
|
|
2381
|
+
(v) => {
|
|
2347
2382
|
var u;
|
|
2348
|
-
return
|
|
2383
|
+
return v.value === ((u = l.value) == null ? void 0 : u.collectible);
|
|
2349
2384
|
}
|
|
2350
2385
|
)) == null ? void 0 : f.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
2351
2386
|
}), p = computed(() => {
|
|
2352
2387
|
const x = r.value.safeParse(l.value);
|
|
2353
2388
|
return x.success ? [] : x.error.errors;
|
|
2354
2389
|
});
|
|
2355
|
-
function
|
|
2356
|
-
x && (l.value = f, a.value =
|
|
2390
|
+
function h(x, f, v) {
|
|
2391
|
+
x && (l.value = f, a.value = v), c.value = x;
|
|
2357
2392
|
}
|
|
2358
2393
|
const y = o;
|
|
2359
2394
|
async function V() {
|
|
2360
2395
|
const x = r.value.safeParse(l.value);
|
|
2361
|
-
x.success && (await
|
|
2396
|
+
x.success && (await i(
|
|
2362
2397
|
async () => {
|
|
2363
2398
|
x.data.type === "VOUCHER" && n.value && (x.data.collectibleConfig.image = await firebaseStorage.update(
|
|
2364
2399
|
x.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
@@ -2372,15 +2407,15 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2372
2407
|
), y("update:model-value", x.data, a.value));
|
|
2373
2408
|
}
|
|
2374
2409
|
return s({
|
|
2375
|
-
showSheet:
|
|
2410
|
+
showSheet: h
|
|
2376
2411
|
}), (x, f) => {
|
|
2377
|
-
const
|
|
2412
|
+
const v = resolveComponent("FmSelect"), u = resolveComponent("FmStepperField"), m = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
2378
2413
|
return openBlock(), createBlock(C, {
|
|
2379
2414
|
"max-width": 560,
|
|
2380
|
-
modelValue: unref(
|
|
2415
|
+
modelValue: unref(c),
|
|
2381
2416
|
"onUpdate:modelValue": [
|
|
2382
|
-
f[9] || (f[9] = (k) => isRef(
|
|
2383
|
-
f[10] || (f[10] = (k) =>
|
|
2417
|
+
f[9] || (f[9] = (k) => isRef(c) ? c.value = k : null),
|
|
2418
|
+
f[10] || (f[10] = (k) => c.value = k)
|
|
2384
2419
|
],
|
|
2385
2420
|
header: "Edit reward",
|
|
2386
2421
|
"dismiss-away": ""
|
|
@@ -2398,15 +2433,15 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2398
2433
|
variant: "secondary",
|
|
2399
2434
|
type: "button",
|
|
2400
2435
|
label: "Cancel",
|
|
2401
|
-
onClick: f[8] || (f[8] = (k) =>
|
|
2436
|
+
onClick: f[8] || (f[8] = (k) => c.value = !1)
|
|
2402
2437
|
})
|
|
2403
2438
|
])
|
|
2404
2439
|
]),
|
|
2405
2440
|
default: withCtx(() => {
|
|
2406
|
-
var k, $,
|
|
2441
|
+
var k, $, F;
|
|
2407
2442
|
return [
|
|
2408
2443
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
2409
|
-
createVNode(
|
|
2444
|
+
createVNode(v, {
|
|
2410
2445
|
label: "Reward Type",
|
|
2411
2446
|
items: [
|
|
2412
2447
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -2414,12 +2449,12 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2414
2449
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2415
2450
|
],
|
|
2416
2451
|
"model-value": unref(l).type,
|
|
2417
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
2418
|
-
|
|
2452
|
+
"onUpdate:modelValue": f[0] || (f[0] = (N) => {
|
|
2453
|
+
N == "NO_REWARD" ? l.value = {
|
|
2419
2454
|
type: "NO_REWARD",
|
|
2420
2455
|
collectible: null,
|
|
2421
2456
|
weight: 1
|
|
2422
|
-
} :
|
|
2457
|
+
} : N === "VOUCHER" ? l.value = {
|
|
2423
2458
|
collectible: null,
|
|
2424
2459
|
type: "VOUCHER",
|
|
2425
2460
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -2447,28 +2482,28 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2447
2482
|
};
|
|
2448
2483
|
})
|
|
2449
2484
|
}, null, 8, ["model-value"]),
|
|
2450
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
2485
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(v, {
|
|
2451
2486
|
key: 0,
|
|
2452
2487
|
label: "Loyalty type",
|
|
2453
2488
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
2454
2489
|
items: unref(d).loyaltyRewards.items,
|
|
2455
2490
|
"model-value": unref(l).collectible,
|
|
2456
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
2491
|
+
"onUpdate:modelValue": f[1] || (f[1] = (N) => unref(l).collectible = N)
|
|
2457
2492
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2458
2493
|
createVNode(u, {
|
|
2459
2494
|
label: "Weight",
|
|
2460
2495
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
|
|
2461
2496
|
"model-value": unref(l).weight,
|
|
2462
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
2497
|
+
"onUpdate:modelValue": f[2] || (f[2] = (N) => l.value = {
|
|
2463
2498
|
...unref(l),
|
|
2464
|
-
weight:
|
|
2499
|
+
weight: N
|
|
2465
2500
|
})
|
|
2466
2501
|
}, null, 8, ["rules", "model-value"]),
|
|
2467
2502
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2468
2503
|
((k = unref(d).loyaltyRewards.items.find(
|
|
2469
|
-
(
|
|
2504
|
+
(N) => {
|
|
2470
2505
|
var D;
|
|
2471
|
-
return
|
|
2506
|
+
return N.value === ((D = unref(l)) == null ? void 0 : D.collectible);
|
|
2472
2507
|
}
|
|
2473
2508
|
)) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2474
2509
|
f[11] || (f[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
@@ -2481,9 +2516,9 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2481
2516
|
"error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
|
|
2482
2517
|
"fixed-type": !0,
|
|
2483
2518
|
"model-value": unref(l).earningOption,
|
|
2484
|
-
"onUpdate:modelValue": f[3] || (f[3] = (
|
|
2519
|
+
"onUpdate:modelValue": f[3] || (f[3] = (N) => l.value = {
|
|
2485
2520
|
...unref(l),
|
|
2486
|
-
earningOption:
|
|
2521
|
+
earningOption: N
|
|
2487
2522
|
})
|
|
2488
2523
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
2489
2524
|
], 64)) : createCommentVNode("", !0),
|
|
@@ -2491,29 +2526,29 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2491
2526
|
createVNode(_sfc_main$A, {
|
|
2492
2527
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
2493
2528
|
"for-credit": unref(l).type === "LOYALTY" && (($ = unref(d).loyaltyRewards.items.find(
|
|
2494
|
-
(
|
|
2529
|
+
(N) => {
|
|
2495
2530
|
var D;
|
|
2496
|
-
return
|
|
2531
|
+
return N.value === ((D = unref(l)) == null ? void 0 : D.collectible);
|
|
2497
2532
|
}
|
|
2498
2533
|
)) == null ? void 0 : $.raw.type) === "CREDIT",
|
|
2499
2534
|
class: "!gap-24",
|
|
2500
2535
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
|
|
2501
2536
|
"model-value": unref(l).validityOption,
|
|
2502
|
-
"onUpdate:modelValue": f[4] || (f[4] = (
|
|
2537
|
+
"onUpdate:modelValue": f[4] || (f[4] = (N) => l.value = {
|
|
2503
2538
|
...unref(l),
|
|
2504
|
-
validityOption:
|
|
2539
|
+
validityOption: N
|
|
2505
2540
|
})
|
|
2506
2541
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2507
2542
|
], 64)) : createCommentVNode("", !0),
|
|
2508
2543
|
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
|
|
2509
2544
|
key: 2,
|
|
2510
2545
|
"reward-image": unref(n),
|
|
2511
|
-
"model-value": ((
|
|
2512
|
-
"onUpdate:modelValue": f[5] || (f[5] = (
|
|
2546
|
+
"model-value": ((F = unref(l)) == null ? void 0 : F.collectibleConfig) ?? void 0,
|
|
2547
|
+
"onUpdate:modelValue": f[5] || (f[5] = (N) => l.value = {
|
|
2513
2548
|
...unref(l),
|
|
2514
|
-
collectibleConfig:
|
|
2549
|
+
collectibleConfig: N
|
|
2515
2550
|
}),
|
|
2516
|
-
"onUpdate:rewardImage": f[6] || (f[6] = (
|
|
2551
|
+
"onUpdate:rewardImage": f[6] || (f[6] = (N) => n.value = N)
|
|
2517
2552
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2518
2553
|
createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
|
|
2519
2554
|
])) : createCommentVNode("", !0)
|
|
@@ -2543,19 +2578,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2543
2578
|
},
|
|
2544
2579
|
emits: ["update:model-value"],
|
|
2545
2580
|
setup(e, { emit: s }) {
|
|
2546
|
-
const o = e, d = s,
|
|
2581
|
+
const o = e, d = s, i = useMembershipStore(), { t: c } = useI18n(), l = z$1.array(z$1.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), a = computed(() => {
|
|
2547
2582
|
const f = l.safeParse(n.value);
|
|
2548
2583
|
return f.success ? [] : f.error.errors;
|
|
2549
2584
|
}), r = ref();
|
|
2550
|
-
function p(f,
|
|
2585
|
+
function p(f, v) {
|
|
2551
2586
|
var m;
|
|
2552
2587
|
const u = [...n.value];
|
|
2553
|
-
u[
|
|
2588
|
+
u[v] = f, (m = r.value) == null || m.showSheet(!1), d("update:model-value", u);
|
|
2554
2589
|
}
|
|
2555
|
-
function
|
|
2556
|
-
const
|
|
2590
|
+
function h(f) {
|
|
2591
|
+
const v = f.type == "VOUCHER" ? f.collectibleConfig : i.collectibles.find(
|
|
2557
2592
|
(C) => C._id.toString() == f.collectible
|
|
2558
|
-
), u = CollectionUtils.formattedType((
|
|
2593
|
+
), u = CollectionUtils.formattedType((v == null ? void 0 : v.name) || ""), m = f.weight;
|
|
2559
2594
|
return {
|
|
2560
2595
|
label: isNullOrEmpty(u) ? "NO REWARD" : u,
|
|
2561
2596
|
sublabel: `${m} (${(m / n.value.reduce((C, k) => C + k.weight, 0) * 100).toFixed(2)}%)`
|
|
@@ -2563,12 +2598,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2563
2598
|
}
|
|
2564
2599
|
function y(f) {
|
|
2565
2600
|
var u;
|
|
2566
|
-
const
|
|
2567
|
-
(u = r.value) == null || u.showSheet(!0,
|
|
2601
|
+
const v = [...n.value];
|
|
2602
|
+
(u = r.value) == null || u.showSheet(!0, v[f], f);
|
|
2568
2603
|
}
|
|
2569
2604
|
function V(f) {
|
|
2570
|
-
const
|
|
2571
|
-
|
|
2605
|
+
const v = [...n.value];
|
|
2606
|
+
v.splice(f, 1), d("update:model-value", v);
|
|
2572
2607
|
}
|
|
2573
2608
|
function x() {
|
|
2574
2609
|
var f;
|
|
@@ -2582,13 +2617,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2582
2617
|
n.value.length
|
|
2583
2618
|
);
|
|
2584
2619
|
}
|
|
2585
|
-
return (f,
|
|
2620
|
+
return (f, v) => {
|
|
2586
2621
|
const u = resolveComponent("FmButton"), m = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2587
2622
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2588
|
-
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(
|
|
2623
|
+
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(c)("connect.template.configure_reward_type")), 1),
|
|
2589
2624
|
createVNode(u, {
|
|
2590
|
-
label: unref(
|
|
2591
|
-
onClick:
|
|
2625
|
+
label: unref(c)("connect.campaign.rewardPool.addReward"),
|
|
2626
|
+
onClick: v[0] || (v[0] = (k) => x()),
|
|
2592
2627
|
variant: "plain",
|
|
2593
2628
|
icon: "add"
|
|
2594
2629
|
}, null, 8, ["label"]),
|
|
@@ -2596,19 +2631,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2596
2631
|
key: $,
|
|
2597
2632
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2598
2633
|
variant: "outlined",
|
|
2599
|
-
onClick: (
|
|
2634
|
+
onClick: (F) => y($)
|
|
2600
2635
|
}, {
|
|
2601
2636
|
default: withCtx(() => {
|
|
2602
|
-
var
|
|
2637
|
+
var F;
|
|
2603
2638
|
return [
|
|
2604
2639
|
createElementVNode("div", null, [
|
|
2605
|
-
createElementVNode("div", _hoisted_3$7, toDisplayString(k.type == "LOYALTY" ? (
|
|
2606
|
-
createElementVNode("div", _hoisted_4$6, toDisplayString(
|
|
2640
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(k.type == "LOYALTY" ? (F = k == null ? void 0 : k.earningOption) == null ? void 0 : F.amount : "") + " " + toDisplayString(h(k).label), 1),
|
|
2641
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(h(k).sublabel), 1)
|
|
2607
2642
|
]),
|
|
2608
2643
|
createVNode(u, {
|
|
2609
2644
|
icon: "delete",
|
|
2610
2645
|
variant: "tertiary",
|
|
2611
|
-
onClick: (
|
|
2646
|
+
onClick: (N) => (N.stopPropagation(), V($))
|
|
2612
2647
|
}, null, 8, ["onClick"])
|
|
2613
2648
|
];
|
|
2614
2649
|
}),
|
|
@@ -2639,7 +2674,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2639
2674
|
},
|
|
2640
2675
|
emits: ["update:model-value"],
|
|
2641
2676
|
setup(e, { emit: s }) {
|
|
2642
|
-
const { t: o } = useI18n(), d = e,
|
|
2677
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(() => [
|
|
2643
2678
|
{
|
|
2644
2679
|
label: o("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
2645
2680
|
description: o("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -2647,27 +2682,27 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2647
2682
|
}
|
|
2648
2683
|
]);
|
|
2649
2684
|
return (l, n) => {
|
|
2650
|
-
var
|
|
2685
|
+
var h, y, V;
|
|
2651
2686
|
const a = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
|
|
2652
2687
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
2653
2688
|
createVNode(a, {
|
|
2654
2689
|
label: unref(o)("connect.template.promotion_game.enable"),
|
|
2655
|
-
"model-value": !!((
|
|
2656
|
-
"onUpdate:modelValue": n[0] || (n[0] = (x) => x ?
|
|
2690
|
+
"model-value": !!((h = e.modelValue) != null && h.gameType),
|
|
2691
|
+
"onUpdate:modelValue": n[0] || (n[0] = (x) => x ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
|
|
2657
2692
|
}, null, 8, ["label", "model-value"]),
|
|
2658
2693
|
((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
2659
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2660
|
-
var f,
|
|
2694
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (x) => {
|
|
2695
|
+
var f, v;
|
|
2661
2696
|
return openBlock(), createBlock(r, {
|
|
2662
2697
|
variant: "outlined",
|
|
2663
2698
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2664
|
-
"col-span-2": unref(
|
|
2699
|
+
"col-span-2": unref(c).length == 1,
|
|
2665
2700
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((f = e.modelValue) == null ? void 0 : f.gameType) == x.value,
|
|
2666
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2701
|
+
"hover:bg-fm-color-opacity-sm": ((v = e.modelValue) == null ? void 0 : v.gameType) != x.value
|
|
2667
2702
|
}]),
|
|
2668
2703
|
onClick: () => {
|
|
2669
2704
|
var u;
|
|
2670
|
-
((u = d.modelValue) == null ? void 0 : u.gameType) != x.value &&
|
|
2705
|
+
((u = d.modelValue) == null ? void 0 : u.gameType) != x.value && i("update:model-value", { gameType: x.value });
|
|
2671
2706
|
},
|
|
2672
2707
|
key: x.value
|
|
2673
2708
|
}, {
|
|
@@ -2703,13 +2738,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2703
2738
|
},
|
|
2704
2739
|
emits: ["update:model-value"],
|
|
2705
2740
|
setup(e, { emit: s }) {
|
|
2706
|
-
const { t: o } = useI18n(), d = e,
|
|
2741
|
+
const { t: o } = useI18n(), d = e, i = s, c = ref(d.modelValue ?? {}), l = ref(
|
|
2707
2742
|
(() => {
|
|
2708
|
-
const
|
|
2709
|
-
return
|
|
2710
|
-
const V =
|
|
2711
|
-
V && "periods" in V && Array.isArray(V.periods) ?
|
|
2712
|
-
}),
|
|
2743
|
+
const h = {};
|
|
2744
|
+
return c.value.workingHour && Object.keys(c.value.workingHour).forEach((y) => {
|
|
2745
|
+
const V = c.value.workingHour[y];
|
|
2746
|
+
V && "periods" in V && Array.isArray(V.periods) ? h[y] = V.periods : Array.isArray(V) && (h[y] = V);
|
|
2747
|
+
}), h;
|
|
2713
2748
|
})()
|
|
2714
2749
|
), n = [
|
|
2715
2750
|
{ key: "mon", label: "Monday" },
|
|
@@ -2719,30 +2754,30 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2719
2754
|
{ key: "fri", label: "Friday" },
|
|
2720
2755
|
{ key: "sat", label: "Saturday" },
|
|
2721
2756
|
{ key: "sun", label: "Sunday" }
|
|
2722
|
-
], a = (
|
|
2723
|
-
l.value[
|
|
2757
|
+
], a = (h) => {
|
|
2758
|
+
l.value[h] || (l.value[h] = []), l.value[h].push({
|
|
2724
2759
|
startTime: "00:00",
|
|
2725
2760
|
endTime: "23:59"
|
|
2726
2761
|
}), p();
|
|
2727
|
-
}, r = (
|
|
2728
|
-
l.value[
|
|
2762
|
+
}, r = (h, y) => {
|
|
2763
|
+
l.value[h] && l.value[h].length > y && (l.value[h].splice(y, 1), l.value[h].length === 0 && delete l.value[h], p());
|
|
2729
2764
|
}, p = () => {
|
|
2730
|
-
const
|
|
2765
|
+
const h = Object.keys(l.value).reduce(
|
|
2731
2766
|
(y, V) => (l.value[V] && l.value[V].length > 0 && (y[V] = {
|
|
2732
2767
|
periods: l.value[V]
|
|
2733
2768
|
}), y),
|
|
2734
2769
|
{}
|
|
2735
2770
|
);
|
|
2736
|
-
|
|
2771
|
+
c.value.workingHour = Object.keys(h).length > 0 ? h : void 0;
|
|
2737
2772
|
};
|
|
2738
|
-
return watch(
|
|
2739
|
-
const V = resolveComponent("FmSelect"), x = resolveComponent("FmStepperField"), f = resolveComponent("FmCheckbox"),
|
|
2773
|
+
return watch(c, () => i("update:model-value", c.value), { deep: !0 }), watch(l, p, { deep: !0 }), (h, y) => {
|
|
2774
|
+
const V = resolveComponent("FmSelect"), x = resolveComponent("FmStepperField"), f = resolveComponent("FmCheckbox"), v = resolveComponent("FmTimePicker"), u = resolveComponent("FmButton");
|
|
2740
2775
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
2741
2776
|
createElementVNode("div", _hoisted_2$7, [
|
|
2742
2777
|
createVNode(V, {
|
|
2743
2778
|
label: unref(o)("connect.template.eaterType"),
|
|
2744
|
-
modelValue: unref(
|
|
2745
|
-
"onUpdate:modelValue": y[0] || (y[0] = (m) => unref(
|
|
2779
|
+
modelValue: unref(c).eaterType,
|
|
2780
|
+
"onUpdate:modelValue": y[0] || (y[0] = (m) => unref(c).eaterType = m),
|
|
2746
2781
|
items: [
|
|
2747
2782
|
{ label: unref(o)("connect.template.allEaters"), value: "all" },
|
|
2748
2783
|
{ label: unref(o)("connect.template.newEatersOnly"), value: "new" },
|
|
@@ -2754,8 +2789,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2754
2789
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
|
|
2755
2790
|
}, null, 8, ["label", "modelValue", "items", "rules"]),
|
|
2756
2791
|
createVNode(x, {
|
|
2757
|
-
modelValue: unref(
|
|
2758
|
-
"onUpdate:modelValue": y[1] || (y[1] = (m) => unref(
|
|
2792
|
+
modelValue: unref(c).minBasketAmount,
|
|
2793
|
+
"onUpdate:modelValue": y[1] || (y[1] = (m) => unref(c).minBasketAmount = m),
|
|
2759
2794
|
"show-steppers": !1,
|
|
2760
2795
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
|
|
2761
2796
|
}, {
|
|
@@ -2770,8 +2805,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2770
2805
|
_: 1
|
|
2771
2806
|
}, 8, ["modelValue", "rules"]),
|
|
2772
2807
|
createVNode(x, {
|
|
2773
|
-
modelValue: unref(
|
|
2774
|
-
"onUpdate:modelValue": y[2] || (y[2] = (m) => unref(
|
|
2808
|
+
modelValue: unref(c).bundleQuantity,
|
|
2809
|
+
"onUpdate:modelValue": y[2] || (y[2] = (m) => unref(c).bundleQuantity = m),
|
|
2775
2810
|
"show-steppers": !1,
|
|
2776
2811
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
|
|
2777
2812
|
}, {
|
|
@@ -2807,14 +2842,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2807
2842
|
key: k,
|
|
2808
2843
|
class: "flex items-center space-x-2 w-100"
|
|
2809
2844
|
}, [
|
|
2810
|
-
createVNode(
|
|
2845
|
+
createVNode(v, {
|
|
2811
2846
|
"model-value": C.startTime || "",
|
|
2812
2847
|
"onUpdate:modelValue": ($) => {
|
|
2813
2848
|
unref(l)[m.key] && unref(l)[m.key][k] && (unref(l)[m.key][k].startTime = $ || "", p());
|
|
2814
2849
|
}
|
|
2815
2850
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2816
2851
|
y[3] || (y[3] = createElementVNode("span", null, "to", -1)),
|
|
2817
|
-
createVNode(
|
|
2852
|
+
createVNode(v, {
|
|
2818
2853
|
"model-value": C.endTime || "",
|
|
2819
2854
|
"onUpdate:modelValue": ($) => {
|
|
2820
2855
|
unref(l)[m.key] && unref(l)[m.key][k] && (unref(l)[m.key][k].endTime = $ || "", p());
|
|
@@ -2853,14 +2888,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2853
2888
|
},
|
|
2854
2889
|
emits: ["update:model-value"],
|
|
2855
2890
|
setup(e, { emit: s }) {
|
|
2856
|
-
const { t: o } = useI18n(), d = e,
|
|
2857
|
-
return watch(
|
|
2891
|
+
const { t: o } = useI18n(), d = e, i = s, c = ref(d.modelValue ?? {});
|
|
2892
|
+
return watch(c, () => i("update:model-value", c.value)), (l, n) => {
|
|
2858
2893
|
const a = resolveComponent("FmStepperField");
|
|
2859
2894
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2860
2895
|
createElementVNode("div", _hoisted_2$6, [
|
|
2861
2896
|
createVNode(a, {
|
|
2862
|
-
modelValue: unref(
|
|
2863
|
-
"onUpdate:modelValue": n[0] || (n[0] = (r) => unref(
|
|
2897
|
+
modelValue: unref(c).totalCount,
|
|
2898
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => unref(c).totalCount = r),
|
|
2864
2899
|
"show-steppers": !1,
|
|
2865
2900
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
|
|
2866
2901
|
}, {
|
|
@@ -2875,8 +2910,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2875
2910
|
_: 1
|
|
2876
2911
|
}, 8, ["modelValue", "rules"]),
|
|
2877
2912
|
createVNode(a, {
|
|
2878
|
-
modelValue: unref(
|
|
2879
|
-
"onUpdate:modelValue": n[1] || (n[1] = (r) => unref(
|
|
2913
|
+
modelValue: unref(c).totalCountPerUser,
|
|
2914
|
+
"onUpdate:modelValue": n[1] || (n[1] = (r) => unref(c).totalCountPerUser = r),
|
|
2880
2915
|
"show-steppers": !1,
|
|
2881
2916
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
|
|
2882
2917
|
}, {
|
|
@@ -2903,7 +2938,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2903
2938
|
},
|
|
2904
2939
|
emits: ["update:model-value"],
|
|
2905
2940
|
setup(e, { emit: s }) {
|
|
2906
|
-
const { t: o } = useI18n(), d = e,
|
|
2941
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(() => [
|
|
2907
2942
|
{
|
|
2908
2943
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
2909
2944
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -2920,15 +2955,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2920
2955
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
2921
2956
|
createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2922
2957
|
createElementVNode("div", _hoisted_3$4, [
|
|
2923
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2958
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
|
|
2924
2959
|
variant: "outlined",
|
|
2925
2960
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2926
|
-
"col-span-2": unref(
|
|
2961
|
+
"col-span-2": unref(c).length == 1,
|
|
2927
2962
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
2928
2963
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
2929
2964
|
}]),
|
|
2930
2965
|
onClick: () => {
|
|
2931
|
-
d.modelValue != r.value &&
|
|
2966
|
+
d.modelValue != r.value && i("update:model-value", r.value);
|
|
2932
2967
|
},
|
|
2933
2968
|
key: r.value
|
|
2934
2969
|
}, {
|
|
@@ -2958,14 +2993,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2958
2993
|
emits: ["update:model-value"],
|
|
2959
2994
|
setup(e, { emit: s }) {
|
|
2960
2995
|
const o = s;
|
|
2961
|
-
return (d,
|
|
2962
|
-
const
|
|
2996
|
+
return (d, i) => {
|
|
2997
|
+
const c = resolveComponent("FmStepperField");
|
|
2963
2998
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2964
|
-
|
|
2965
|
-
createVNode(
|
|
2999
|
+
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)),
|
|
3000
|
+
createVNode(c, {
|
|
2966
3001
|
label: "Maximum to collect",
|
|
2967
3002
|
"model-value": e.modelValue || null,
|
|
2968
|
-
"onUpdate:modelValue":
|
|
3003
|
+
"onUpdate:modelValue": i[0] || (i[0] = (l) => o("update:model-value", l)),
|
|
2969
3004
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
2970
3005
|
"helper-state": e.helperState || "none"
|
|
2971
3006
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -2982,28 +3017,28 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2982
3017
|
},
|
|
2983
3018
|
emits: ["update:model-value"],
|
|
2984
3019
|
setup(e, { expose: s, emit: o }) {
|
|
2985
|
-
const d = e,
|
|
3020
|
+
const d = e, i = useMembershipStore(), { minor: c } = useLoading, l = ref(!1), n = ref(), a = ref(), r = ref(0), p = computed(() => {
|
|
2986
3021
|
var u;
|
|
2987
|
-
return ((u =
|
|
3022
|
+
return ((u = i.loyaltyRewards.items.find(
|
|
2988
3023
|
(m) => {
|
|
2989
3024
|
var C;
|
|
2990
3025
|
return m.value === ((C = n.value) == null ? void 0 : C.collectible);
|
|
2991
3026
|
}
|
|
2992
3027
|
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
2993
|
-
}),
|
|
2994
|
-
const
|
|
2995
|
-
return
|
|
3028
|
+
}), h = computed(() => {
|
|
3029
|
+
const v = p.value.safeParse(n.value);
|
|
3030
|
+
return v.success ? [] : v.error.errors;
|
|
2996
3031
|
});
|
|
2997
|
-
function y(
|
|
2998
|
-
|
|
3032
|
+
function y(v, u, m) {
|
|
3033
|
+
v && (n.value = u, r.value = m), l.value = v;
|
|
2999
3034
|
}
|
|
3000
3035
|
const V = o;
|
|
3001
3036
|
async function x() {
|
|
3002
|
-
const
|
|
3003
|
-
|
|
3037
|
+
const v = p.value.safeParse(n.value);
|
|
3038
|
+
v.success && (await c(
|
|
3004
3039
|
async () => {
|
|
3005
|
-
|
|
3006
|
-
|
|
3040
|
+
v.data.type === "VOUCHER" && a.value && (v.data.collectibleConfig.image = await firebaseStorage.update(
|
|
3041
|
+
v.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
3007
3042
|
a.value
|
|
3008
3043
|
));
|
|
3009
3044
|
},
|
|
@@ -3011,19 +3046,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3011
3046
|
message: "Uploading reward image",
|
|
3012
3047
|
successMessage: "Reward image updated"
|
|
3013
3048
|
}
|
|
3014
|
-
), V("update:model-value",
|
|
3049
|
+
), V("update:model-value", v.data, r.value));
|
|
3015
3050
|
}
|
|
3016
3051
|
const f = ref();
|
|
3017
3052
|
return s({
|
|
3018
3053
|
showSheet: y
|
|
3019
|
-
}), (
|
|
3020
|
-
const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), $ = resolveComponent("FmButton"),
|
|
3021
|
-
return openBlock(), createBlock(
|
|
3054
|
+
}), (v, u) => {
|
|
3055
|
+
const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), $ = resolveComponent("FmButton"), F = resolveComponent("FmSideSheet");
|
|
3056
|
+
return openBlock(), createBlock(F, {
|
|
3022
3057
|
"max-width": 560,
|
|
3023
3058
|
modelValue: unref(l),
|
|
3024
3059
|
"onUpdate:modelValue": [
|
|
3025
|
-
u[10] || (u[10] = (
|
|
3026
|
-
u[11] || (u[11] = (
|
|
3060
|
+
u[10] || (u[10] = (N) => isRef(l) ? l.value = N : null),
|
|
3061
|
+
u[11] || (u[11] = (N) => l.value = N)
|
|
3027
3062
|
],
|
|
3028
3063
|
header: "Edit reward",
|
|
3029
3064
|
"dismiss-away": ""
|
|
@@ -3034,17 +3069,17 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3034
3069
|
variant: "primary",
|
|
3035
3070
|
type: "button",
|
|
3036
3071
|
label: "Confirm",
|
|
3037
|
-
disabled: unref(
|
|
3072
|
+
disabled: unref(h).length > 0,
|
|
3038
3073
|
onClick: u[8] || (u[8] = async () => {
|
|
3039
|
-
var
|
|
3040
|
-
return (
|
|
3074
|
+
var N;
|
|
3075
|
+
return (N = unref(f)) == null ? void 0 : N.validateInputs();
|
|
3041
3076
|
})
|
|
3042
3077
|
}, null, 8, ["disabled"]),
|
|
3043
3078
|
createVNode($, {
|
|
3044
3079
|
variant: "secondary",
|
|
3045
3080
|
type: "button",
|
|
3046
3081
|
label: "Cancel",
|
|
3047
|
-
onClick: u[9] || (u[9] = (
|
|
3082
|
+
onClick: u[9] || (u[9] = (N) => l.value = !1)
|
|
3048
3083
|
})
|
|
3049
3084
|
])
|
|
3050
3085
|
]),
|
|
@@ -3055,10 +3090,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3055
3090
|
class: "flex flex-col gap-y-24",
|
|
3056
3091
|
ref_key: "formRef",
|
|
3057
3092
|
ref: f,
|
|
3058
|
-
onValidationSuccess: u[7] || (u[7] = (
|
|
3093
|
+
onValidationSuccess: u[7] || (u[7] = (N) => x())
|
|
3059
3094
|
}, {
|
|
3060
3095
|
default: withCtx(() => {
|
|
3061
|
-
var
|
|
3096
|
+
var N, D;
|
|
3062
3097
|
return [
|
|
3063
3098
|
unref(n).type ? (openBlock(), createBlock(m, {
|
|
3064
3099
|
key: 0,
|
|
@@ -3085,7 +3120,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3085
3120
|
],
|
|
3086
3121
|
"model-value": unref(n).type,
|
|
3087
3122
|
"onUpdate:modelValue": u[1] || (u[1] = (w) => {
|
|
3088
|
-
var O,
|
|
3123
|
+
var O, j;
|
|
3089
3124
|
w === "VOUCHER" ? n.value = {
|
|
3090
3125
|
collectible: null,
|
|
3091
3126
|
type: "VOUCHER",
|
|
@@ -3101,7 +3136,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3101
3136
|
},
|
|
3102
3137
|
threshold: (O = unref(n)) == null ? void 0 : O.threshold
|
|
3103
3138
|
} : n.value = {
|
|
3104
|
-
collectible: unref(
|
|
3139
|
+
collectible: unref(i).loyaltyRewards.raw[0]._id,
|
|
3105
3140
|
type: "LOYALTY",
|
|
3106
3141
|
earningOption: {
|
|
3107
3142
|
amount: 1,
|
|
@@ -3110,7 +3145,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3110
3145
|
validityOption: {
|
|
3111
3146
|
validForDay: 7
|
|
3112
3147
|
},
|
|
3113
|
-
threshold: (
|
|
3148
|
+
threshold: (j = unref(n)) == null ? void 0 : j.threshold
|
|
3114
3149
|
};
|
|
3115
3150
|
})
|
|
3116
3151
|
}, null, 8, ["model-value"]),
|
|
@@ -3118,7 +3153,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3118
3153
|
key: 1,
|
|
3119
3154
|
label: "Loyalty type",
|
|
3120
3155
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(n).type])],
|
|
3121
|
-
items: unref(
|
|
3156
|
+
items: unref(i).loyaltyRewards.items,
|
|
3122
3157
|
"model-value": unref(n).collectible,
|
|
3123
3158
|
"onUpdate:modelValue": u[2] || (u[2] = (w) => unref(n).collectible = w)
|
|
3124
3159
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
@@ -3127,8 +3162,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3127
3162
|
createVNode(_sfc_main$z, {
|
|
3128
3163
|
class: "mt-[-8px]",
|
|
3129
3164
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(n).type])],
|
|
3130
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
3131
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
3165
|
+
"helper-state": unref(ZodHelper).helperState(unref(h), "earningOption"),
|
|
3166
|
+
"error-text": unref(ZodHelper).helperText(unref(h), "earningOption"),
|
|
3132
3167
|
"fixed-type": !0,
|
|
3133
3168
|
"model-value": unref(n).earningOption,
|
|
3134
3169
|
"onUpdate:modelValue": u[3] || (u[3] = (w) => n.value = {
|
|
@@ -3139,12 +3174,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3139
3174
|
createVNode(_sfc_main$A, {
|
|
3140
3175
|
class: "!gap-24",
|
|
3141
3176
|
type: unref(n).type === "LOYALTY" ? "custom" : "range",
|
|
3142
|
-
"for-credit": unref(n).type === "LOYALTY" && ((
|
|
3177
|
+
"for-credit": unref(n).type === "LOYALTY" && ((N = unref(i).loyaltyRewards.items.find(
|
|
3143
3178
|
(w) => {
|
|
3144
3179
|
var O;
|
|
3145
3180
|
return w.value === ((O = unref(n)) == null ? void 0 : O.collectible);
|
|
3146
3181
|
}
|
|
3147
|
-
)) == null ? void 0 :
|
|
3182
|
+
)) == null ? void 0 : N.raw.type) === "CREDIT",
|
|
3148
3183
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(n).type])],
|
|
3149
3184
|
"model-value": unref(n).validityOption,
|
|
3150
3185
|
"onUpdate:modelValue": u[4] || (u[4] = (w) => n.value = {
|
|
@@ -3163,7 +3198,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3163
3198
|
}),
|
|
3164
3199
|
"onUpdate:rewardImage": u[6] || (u[6] = (w) => a.value = w)
|
|
3165
3200
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
3166
|
-
createVNode(JsonViewer, { json: unref(
|
|
3201
|
+
createVNode(JsonViewer, { json: unref(h) }, null, 8, ["json"])
|
|
3167
3202
|
];
|
|
3168
3203
|
}),
|
|
3169
3204
|
_: 1
|
|
@@ -3197,7 +3232,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3197
3232
|
}
|
|
3198
3233
|
},
|
|
3199
3234
|
setup(e) {
|
|
3200
|
-
const s = e, { maxRange: o, currentRange: d, markers:
|
|
3235
|
+
const s = e, { maxRange: o, currentRange: d, markers: i } = toRefs(s), c = computed(
|
|
3201
3236
|
() => Math.min(d.value / o.value * 100, 100)
|
|
3202
3237
|
), l = (n) => n / o.value * 100;
|
|
3203
3238
|
return (n, a) => {
|
|
@@ -3209,7 +3244,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3209
3244
|
),
|
|
3210
3245
|
outline: unref(d) < p,
|
|
3211
3246
|
key: p,
|
|
3212
|
-
name: unref(
|
|
3247
|
+
name: unref(i).some((h) => h === p) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
3213
3248
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
3214
3249
|
])) : (openBlock(), createElementBlock("div", {
|
|
3215
3250
|
key: 1,
|
|
@@ -3217,10 +3252,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3217
3252
|
}, [
|
|
3218
3253
|
createElementVNode("div", {
|
|
3219
3254
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
3220
|
-
style: normalizeStyle({ width: unref(
|
|
3255
|
+
style: normalizeStyle({ width: unref(c) + "%" })
|
|
3221
3256
|
}, null, 4),
|
|
3222
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3223
|
-
key:
|
|
3257
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (p, h) => (openBlock(), createElementBlock("div", {
|
|
3258
|
+
key: h,
|
|
3224
3259
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
3225
3260
|
style: normalizeStyle({ left: l(p) + "%" })
|
|
3226
3261
|
}, [
|
|
@@ -3236,16 +3271,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3236
3271
|
}
|
|
3237
3272
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
3238
3273
|
function changeKeysFactory(e) {
|
|
3239
|
-
return function s(o, d = 1,
|
|
3274
|
+
return function s(o, d = 1, i) {
|
|
3240
3275
|
if (d === 0 || !isObject(o))
|
|
3241
3276
|
return o;
|
|
3242
3277
|
if (Array.isArray(o))
|
|
3243
|
-
return o.map((l) => s(l, d - 1,
|
|
3244
|
-
const
|
|
3278
|
+
return o.map((l) => s(l, d - 1, i));
|
|
3279
|
+
const c = Object.create(Object.getPrototypeOf(o));
|
|
3245
3280
|
return Object.keys(o).forEach((l) => {
|
|
3246
|
-
const n = o[l], a = e(l,
|
|
3247
|
-
|
|
3248
|
-
}),
|
|
3281
|
+
const n = o[l], a = e(l, i), r = s(n, d - 1, i);
|
|
3282
|
+
c[a] = r;
|
|
3283
|
+
}), c;
|
|
3249
3284
|
};
|
|
3250
3285
|
}
|
|
3251
3286
|
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({
|
|
@@ -3262,49 +3297,49 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3262
3297
|
},
|
|
3263
3298
|
emits: ["update:model-value"],
|
|
3264
3299
|
setup(e, { emit: s }) {
|
|
3265
|
-
const { t: o } = useI18n(), d = e,
|
|
3266
|
-
() => d.modelValue.sort((
|
|
3300
|
+
const { t: o } = useI18n(), d = e, i = s, c = useMembershipStore(), l = z$1.array(z$1.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), n = computed(
|
|
3301
|
+
() => d.modelValue.sort((v, u) => v.threshold - u.threshold) ?? []
|
|
3267
3302
|
), a = computed(() => {
|
|
3268
|
-
const
|
|
3269
|
-
return
|
|
3303
|
+
const v = l.safeParse(n.value);
|
|
3304
|
+
return v.success ? [] : v.error.errors;
|
|
3270
3305
|
}), r = ref();
|
|
3271
|
-
function p(
|
|
3306
|
+
function p(v, u) {
|
|
3272
3307
|
var C;
|
|
3273
3308
|
const m = [...n.value];
|
|
3274
|
-
m[u] =
|
|
3309
|
+
m[u] = v, (C = r.value) == null || C.showSheet(!1), i("update:model-value", m);
|
|
3275
3310
|
}
|
|
3276
|
-
function v
|
|
3277
|
-
const u =
|
|
3278
|
-
(k) => k._id.toString() ==
|
|
3279
|
-
), m = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), C =
|
|
3280
|
-
threshold:
|
|
3281
|
-
amount:
|
|
3311
|
+
function h(v) {
|
|
3312
|
+
const u = v.type == "VOUCHER" ? v.collectibleConfig : c.collectibles.find(
|
|
3313
|
+
(k) => k._id.toString() == v.collectible
|
|
3314
|
+
), m = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), C = v.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
3315
|
+
threshold: v.threshold,
|
|
3316
|
+
amount: v.earningOption.amount
|
|
3282
3317
|
}) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
3283
|
-
threshold:
|
|
3284
|
-
amount:
|
|
3285
|
-
every:
|
|
3318
|
+
threshold: v.threshold,
|
|
3319
|
+
amount: v.earningOption.amount,
|
|
3320
|
+
every: v.earningOption.every
|
|
3286
3321
|
});
|
|
3287
3322
|
return {
|
|
3288
3323
|
label: isNullOrEmpty(m) ? o("connect.template.mission_pool.no_reward") : m,
|
|
3289
3324
|
sublabel: C
|
|
3290
3325
|
};
|
|
3291
3326
|
}
|
|
3292
|
-
function y(
|
|
3327
|
+
function y(v) {
|
|
3293
3328
|
var m;
|
|
3294
3329
|
const u = [...n.value];
|
|
3295
|
-
(m = r.value) == null || m.showSheet(!0, u[
|
|
3330
|
+
(m = r.value) == null || m.showSheet(!0, u[v], v);
|
|
3296
3331
|
}
|
|
3297
|
-
function V(
|
|
3332
|
+
function V(v) {
|
|
3298
3333
|
const u = [...n.value];
|
|
3299
|
-
u.splice(
|
|
3334
|
+
u.splice(v, 1), i("update:model-value", u);
|
|
3300
3335
|
}
|
|
3301
3336
|
function x() {
|
|
3302
|
-
var
|
|
3303
|
-
(
|
|
3337
|
+
var v;
|
|
3338
|
+
(v = r.value) == null || v.showSheet(
|
|
3304
3339
|
!0,
|
|
3305
3340
|
{
|
|
3306
3341
|
type: "LOYALTY",
|
|
3307
|
-
collectible:
|
|
3342
|
+
collectible: c.loyaltyRewards.items[0].value,
|
|
3308
3343
|
threshold: null,
|
|
3309
3344
|
validityOption: {
|
|
3310
3345
|
validForDay: 7
|
|
@@ -3317,15 +3352,15 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3317
3352
|
n.value.length
|
|
3318
3353
|
);
|
|
3319
3354
|
}
|
|
3320
|
-
function f(
|
|
3355
|
+
function f(v) {
|
|
3321
3356
|
var u, m;
|
|
3322
|
-
return
|
|
3323
|
-
((m =
|
|
3324
|
-
(C) => C.value ==
|
|
3357
|
+
return v.type == "VOUCHER" ? (u = v.collectibleConfig) == null ? void 0 : u.name : sentenceCase(
|
|
3358
|
+
((m = c.loyaltyRewards.items.find(
|
|
3359
|
+
(C) => C.value == v.collectible
|
|
3325
3360
|
)) == null ? void 0 : m.label) || ""
|
|
3326
3361
|
);
|
|
3327
3362
|
}
|
|
3328
|
-
return (
|
|
3363
|
+
return (v, u) => {
|
|
3329
3364
|
const m = resolveComponent("FmButton"), C = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
3330
3365
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
3331
3366
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
|
|
@@ -3335,21 +3370,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3335
3370
|
variant: "plain",
|
|
3336
3371
|
icon: "add"
|
|
3337
3372
|
}, null, 8, ["label"]),
|
|
3338
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), ($,
|
|
3339
|
-
key:
|
|
3373
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), ($, F) => (openBlock(), createBlock(C, {
|
|
3374
|
+
key: F,
|
|
3340
3375
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
3341
3376
|
variant: "outlined",
|
|
3342
|
-
onClick: (
|
|
3377
|
+
onClick: (N) => y(F)
|
|
3343
3378
|
}, {
|
|
3344
3379
|
default: withCtx(() => [
|
|
3345
3380
|
createElementVNode("div", null, [
|
|
3346
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(
|
|
3347
|
-
createElementVNode("div", _hoisted_4$2, toDisplayString(
|
|
3381
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(h($).label), 1),
|
|
3382
|
+
createElementVNode("div", _hoisted_4$2, toDisplayString(h($).sublabel), 1)
|
|
3348
3383
|
]),
|
|
3349
3384
|
createVNode(m, {
|
|
3350
3385
|
icon: "delete",
|
|
3351
3386
|
variant: "tertiary",
|
|
3352
|
-
onClick: (
|
|
3387
|
+
onClick: (N) => (N.stopPropagation(), V(F))
|
|
3353
3388
|
}, null, 8, ["onClick"])
|
|
3354
3389
|
]),
|
|
3355
3390
|
_: 2
|
|
@@ -3366,11 +3401,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3366
3401
|
class: "p-24 space-y-16 w-fit"
|
|
3367
3402
|
}, {
|
|
3368
3403
|
default: withCtx(() => {
|
|
3369
|
-
var $,
|
|
3404
|
+
var $, F;
|
|
3370
3405
|
return [
|
|
3371
3406
|
createElementVNode("div", _hoisted_6$2, [
|
|
3372
3407
|
createElementVNode("div", null, [
|
|
3373
|
-
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString((($ = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : $.earningOption.amount) > 1 ? (
|
|
3408
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString((($ = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : $.earningOption.amount) > 1 ? (F = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : F.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? f(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
3374
3409
|
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
3375
3410
|
])
|
|
3376
3411
|
]),
|
|
@@ -3379,7 +3414,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3379
3414
|
type: e.mission.type,
|
|
3380
3415
|
"max-range": e.mission.end,
|
|
3381
3416
|
currentRange: e.mission.end / 4,
|
|
3382
|
-
markers: e.modelValue.map((
|
|
3417
|
+
markers: e.modelValue.map((N) => N.threshold)
|
|
3383
3418
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
3384
3419
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
3385
3420
|
])
|
|
@@ -3403,10 +3438,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3403
3438
|
},
|
|
3404
3439
|
emits: ["update:model-value"],
|
|
3405
3440
|
setup(e, { emit: s }) {
|
|
3406
|
-
const { t: o } = useI18n(), d = e,
|
|
3441
|
+
const { t: o } = useI18n(), d = e, i = computed(() => {
|
|
3407
3442
|
const n = FdoMission.safeParse(d.modelValue);
|
|
3408
3443
|
return n.success ? [] : n.error.errors;
|
|
3409
|
-
}),
|
|
3444
|
+
}), c = computed(() => [
|
|
3410
3445
|
{
|
|
3411
3446
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
3412
3447
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -3419,28 +3454,28 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3419
3454
|
}
|
|
3420
3455
|
]), l = s;
|
|
3421
3456
|
return (n, a) => {
|
|
3422
|
-
var
|
|
3457
|
+
var h;
|
|
3423
3458
|
const r = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
|
|
3424
3459
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
3425
3460
|
createElementVNode("div", _hoisted_2$2, [
|
|
3426
3461
|
createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
|
|
3427
3462
|
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
3428
3463
|
createElementVNode("div", _hoisted_5$1, [
|
|
3429
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3464
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (y) => {
|
|
3430
3465
|
var V, x;
|
|
3431
3466
|
return openBlock(), createBlock(r, {
|
|
3432
3467
|
variant: "outlined",
|
|
3433
3468
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
3434
|
-
"col-span-2": unref(
|
|
3469
|
+
"col-span-2": unref(c).length == 1,
|
|
3435
3470
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((V = e.modelValue) == null ? void 0 : V.type) == y.value,
|
|
3436
3471
|
"hover:bg-fm-color-opacity-sm": ((x = e.modelValue) == null ? void 0 : x.type) != y.value
|
|
3437
3472
|
}]),
|
|
3438
3473
|
onClick: () => {
|
|
3439
|
-
var f,
|
|
3474
|
+
var f, v;
|
|
3440
3475
|
((f = e.modelValue) == null ? void 0 : f.type) != y.value && l("update:model-value", {
|
|
3441
3476
|
...e.modelValue,
|
|
3442
3477
|
type: y.value,
|
|
3443
|
-
end: ((
|
|
3478
|
+
end: ((v = e.modelValue) == null ? void 0 : v.end) || 1
|
|
3444
3479
|
});
|
|
3445
3480
|
},
|
|
3446
3481
|
key: y.value
|
|
@@ -3459,7 +3494,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3459
3494
|
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
3460
3495
|
createVNode(p, {
|
|
3461
3496
|
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
3462
|
-
"model-value": ((
|
|
3497
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.end) || null,
|
|
3463
3498
|
"onUpdate:modelValue": a[0] || (a[0] = (y) => {
|
|
3464
3499
|
var V;
|
|
3465
3500
|
return l("update:model-value", {
|
|
@@ -3468,8 +3503,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3468
3503
|
end: y
|
|
3469
3504
|
});
|
|
3470
3505
|
}),
|
|
3471
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
3472
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
3506
|
+
"helper-text": unref(ZodHelper).helperText(unref(i), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
|
|
3507
|
+
"helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
|
|
3473
3508
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"])
|
|
3474
3509
|
])
|
|
3475
3510
|
]);
|
|
@@ -3478,8 +3513,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3478
3513
|
});
|
|
3479
3514
|
function useLocaleText() {
|
|
3480
3515
|
const { locale: e, t: s } = useI18n();
|
|
3481
|
-
function o(d,
|
|
3482
|
-
return d ? d[e.value] ?? d["en-US"] ?? s(
|
|
3516
|
+
function o(d, i) {
|
|
3517
|
+
return d ? d[e.value] ?? d["en-US"] ?? s(i) : s(i);
|
|
3483
3518
|
}
|
|
3484
3519
|
return { getLocaleText: o };
|
|
3485
3520
|
}
|
|
@@ -3506,24 +3541,29 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3506
3541
|
campaignType: {
|
|
3507
3542
|
type: String,
|
|
3508
3543
|
default: void 0
|
|
3544
|
+
},
|
|
3545
|
+
/** False until the form has been submitted, for fields that validate late. */
|
|
3546
|
+
showValidation: {
|
|
3547
|
+
type: Boolean,
|
|
3548
|
+
default: !0
|
|
3509
3549
|
}
|
|
3510
3550
|
},
|
|
3511
3551
|
emits: ["update:model-value", "update:file"],
|
|
3512
3552
|
setup(e, { emit: s }) {
|
|
3513
|
-
const { t: o } = useI18n(), { getLocaleText: d } = useLocaleText(),
|
|
3553
|
+
const { t: o } = useI18n(), { getLocaleText: d } = useLocaleText(), i = e, c = s;
|
|
3514
3554
|
function l(p) {
|
|
3515
|
-
switch (
|
|
3555
|
+
switch (i.field.type) {
|
|
3516
3556
|
case "timeframe":
|
|
3517
|
-
const
|
|
3518
|
-
|
|
3557
|
+
const h = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, y = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
|
|
3558
|
+
c("update:model-value", {
|
|
3519
3559
|
type: "timeframe",
|
|
3520
3560
|
property: "__now",
|
|
3521
|
-
start:
|
|
3561
|
+
start: h,
|
|
3522
3562
|
end: y
|
|
3523
3563
|
});
|
|
3524
3564
|
break;
|
|
3525
3565
|
case "image": {
|
|
3526
|
-
|
|
3566
|
+
c(
|
|
3527
3567
|
"update:file",
|
|
3528
3568
|
p,
|
|
3529
3569
|
n.value || firebaseStorage.collectibleImagePath(void 0, p)
|
|
@@ -3531,41 +3571,41 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3531
3571
|
break;
|
|
3532
3572
|
}
|
|
3533
3573
|
default:
|
|
3534
|
-
|
|
3574
|
+
c("update:model-value", p);
|
|
3535
3575
|
break;
|
|
3536
3576
|
}
|
|
3537
3577
|
}
|
|
3538
3578
|
const n = computed(() => {
|
|
3539
|
-
switch (
|
|
3579
|
+
switch (i.field.type) {
|
|
3540
3580
|
case "timeframe": {
|
|
3541
|
-
const p =
|
|
3581
|
+
const p = i.modelValue;
|
|
3542
3582
|
return {
|
|
3543
3583
|
startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
|
|
3544
3584
|
endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
|
|
3545
3585
|
};
|
|
3546
3586
|
}
|
|
3547
3587
|
default:
|
|
3548
|
-
return
|
|
3588
|
+
return i.modelValue;
|
|
3549
3589
|
}
|
|
3550
3590
|
});
|
|
3551
3591
|
function a() {
|
|
3552
3592
|
if (!r.value.schema) return [];
|
|
3553
|
-
const p = r.value.schema.safeParse(
|
|
3593
|
+
const p = r.value.schema.safeParse(i.modelValue);
|
|
3554
3594
|
return p.success ? [] : p.error.errors;
|
|
3555
3595
|
}
|
|
3556
3596
|
const r = computed(() => ({
|
|
3557
|
-
schema:
|
|
3558
|
-
unwrapped:
|
|
3559
|
-
rules:
|
|
3560
|
-
labelMark:
|
|
3561
|
-
zodLabel:
|
|
3562
|
-
|
|
3563
|
-
d(
|
|
3597
|
+
schema: i.schema,
|
|
3598
|
+
unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
|
|
3599
|
+
rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
|
|
3600
|
+
labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
|
|
3601
|
+
zodLabel: i.schema ? ZodHelper.toInputLabel(
|
|
3602
|
+
i.schema,
|
|
3603
|
+
d(i.field.label_locale, i.field.label ?? "")
|
|
3564
3604
|
) : void 0
|
|
3565
3605
|
}));
|
|
3566
|
-
return (p,
|
|
3606
|
+
return (p, h) => {
|
|
3567
3607
|
var u, m, C, k, $;
|
|
3568
|
-
const y = resolveComponent("FmTextField"), V = resolveComponent("FmStepperField"), x = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText"),
|
|
3608
|
+
const y = resolveComponent("FmTextField"), V = resolveComponent("FmStepperField"), x = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
|
|
3569
3609
|
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
3570
3610
|
key: 0,
|
|
3571
3611
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
@@ -3577,7 +3617,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3577
3617
|
"helper-text": e.helperText
|
|
3578
3618
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3579
3619
|
createVNode(JsonViewer, {
|
|
3580
|
-
json: { schema: unref(r).unwrapped, props:
|
|
3620
|
+
json: { schema: unref(r).unwrapped, props: i }
|
|
3581
3621
|
}, null, 8, ["json"]),
|
|
3582
3622
|
createVNode(V, {
|
|
3583
3623
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
@@ -3596,7 +3636,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3596
3636
|
"model-value": unref(n),
|
|
3597
3637
|
"onUpdate:modelValue": l,
|
|
3598
3638
|
"show-word-count": "",
|
|
3599
|
-
"max-length": ($ = (k = (C = (m = (u = unref(r)) == null ? void 0 : u.unwrapped) == null ? void 0 : m._def) == null ? void 0 : C.checks) == null ? void 0 : k.find((
|
|
3639
|
+
"max-length": ($ = (k = (C = (m = (u = unref(r)) == null ? void 0 : u.unwrapped) == null ? void 0 : m._def) == null ? void 0 : C.checks) == null ? void 0 : k.find((F) => F.kind == "max")) == null ? void 0 : $.value
|
|
3600
3640
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
3601
3641
|
key: 3,
|
|
3602
3642
|
"campaign-type": e.extras,
|
|
@@ -3624,7 +3664,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3624
3664
|
(openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
|
|
3625
3665
|
]),
|
|
3626
3666
|
_: 1
|
|
3627
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
3667
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(v, {
|
|
3628
3668
|
key: 6,
|
|
3629
3669
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
3630
3670
|
"label-placement": "right",
|
|
@@ -3680,12 +3720,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3680
3720
|
], 64)) : e.field.type === "message" ? (openBlock(), createElementBlock(Fragment, { key: 13 }, [
|
|
3681
3721
|
e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
3682
3722
|
key: 0,
|
|
3723
|
+
"show-validation": e.showValidation,
|
|
3683
3724
|
"model-value": unref(n),
|
|
3684
3725
|
"onUpdate:modelValue": l,
|
|
3685
3726
|
"helper-text": unref(ZodHelper).helperText(a(), ""),
|
|
3686
3727
|
"trigger-type": e.field.extras,
|
|
3687
3728
|
"helper-state": unref(ZodHelper).helperState(a(), "")
|
|
3688
|
-
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
|
|
3729
|
+
}, null, 8, ["show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
|
|
3689
3730
|
key: 1,
|
|
3690
3731
|
"allow-email": !0,
|
|
3691
3732
|
"allow-whatsapp": !0,
|
|
@@ -3707,7 +3748,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3707
3748
|
"model-value": unref(n),
|
|
3708
3749
|
"onUpdate:modelValue": l,
|
|
3709
3750
|
"helper-text": e.helperText || unref(ZodHelper).helperText(a(), ""),
|
|
3710
|
-
"for-credit":
|
|
3751
|
+
"for-credit": i.campaignType === "CREDIT"
|
|
3711
3752
|
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
3712
3753
|
key: 16,
|
|
3713
3754
|
"model-value": unref(n),
|
|
@@ -3819,7 +3860,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3819
3860
|
text: e.helperText,
|
|
3820
3861
|
state: "error"
|
|
3821
3862
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3822
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
3863
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(i.field), 1));
|
|
3823
3864
|
};
|
|
3824
3865
|
}
|
|
3825
3866
|
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -3832,22 +3873,25 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3832
3873
|
},
|
|
3833
3874
|
setup(e) {
|
|
3834
3875
|
const { t: s, te: o } = useI18n();
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3876
|
+
function d(i) {
|
|
3877
|
+
return o(i) || o(i, "en-US");
|
|
3878
|
+
}
|
|
3879
|
+
return (i, c) => {
|
|
3880
|
+
const l = resolveComponent("FmCard");
|
|
3881
|
+
return openBlock(), createBlock(l, {
|
|
3838
3882
|
variant: "outlined",
|
|
3839
3883
|
class: "p-16 space-y-8"
|
|
3840
3884
|
}, {
|
|
3841
3885
|
default: withCtx(() => [
|
|
3842
3886
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(s)("connect.campaign.common.summary")), 1),
|
|
3843
3887
|
c[0] || (c[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
3844
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
3888
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (n, a) => (openBlock(), createElementBlock("div", {
|
|
3845
3889
|
class: "space-y-4",
|
|
3846
|
-
key:
|
|
3890
|
+
key: a
|
|
3847
3891
|
}, [
|
|
3848
|
-
|
|
3849
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(s)(`${
|
|
3850
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(
|
|
3892
|
+
n ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3893
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(s)(`${a}`)), 1),
|
|
3894
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(d(`${n}`) ? unref(s)(`${n}`) : n), 1)
|
|
3851
3895
|
], 64)) : createCommentVNode("", !0)
|
|
3852
3896
|
]))), 128))
|
|
3853
3897
|
]),
|
|
@@ -3877,13 +3921,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3877
3921
|
console.log(
|
|
3878
3922
|
TEMPLATES[type],
|
|
3879
3923
|
"base template"
|
|
3880
|
-
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((d,
|
|
3881
|
-
var
|
|
3924
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((d, i) => {
|
|
3925
|
+
var c;
|
|
3882
3926
|
if (d.campaign.type === "VOUCHER" && d.campaign.code) {
|
|
3883
|
-
const l = (
|
|
3927
|
+
const l = (c = d.campaign._id) == null ? void 0 : c.toString();
|
|
3884
3928
|
useCampaignStore().campaigns.voucher.some(
|
|
3885
3929
|
(n) => n.code === d.campaign.code && n._id.toString() !== l
|
|
3886
|
-
) &&
|
|
3930
|
+
) && i.addIssue({
|
|
3887
3931
|
code: "custom",
|
|
3888
3932
|
message: "Code already exists, please use another code",
|
|
3889
3933
|
path: ["campaign", "code"]
|
|
@@ -3891,7 +3935,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3891
3935
|
}
|
|
3892
3936
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
3893
3937
|
...(s = template.value) == null ? void 0 : s.defaultValue
|
|
3894
|
-
}), "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 = (o = campaign == null ? void 0 : campaign.campaign) != null && o._id ? t("connect.campaign.common.edit_campaign_title", {
|
|
3938
|
+
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), type === "BROADCAST" && normaliseBroadcastDelivery(data.value.campaign), 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, submitAttempted.value = !1, sheetTitle.value = (o = campaign == null ? void 0 : campaign.campaign) != null && o._id ? t("connect.campaign.common.edit_campaign_title", {
|
|
3895
3939
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
3896
3940
|
}) : t("connect.campaign.common.create_campaign_title", {
|
|
3897
3941
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
@@ -3928,6 +3972,24 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3928
3972
|
(o) => s.some((d) => o.path.join(".").includes(d))
|
|
3929
3973
|
);
|
|
3930
3974
|
}
|
|
3975
|
+
const validateOnSubmit = computed(() => campaignType.value === "BROADCAST"), submitAttempted = ref(!1), showValidation = computed(
|
|
3976
|
+
() => !validateOnSubmit.value || submitAttempted.value
|
|
3977
|
+
), visibleErrors = computed(
|
|
3978
|
+
() => showValidation.value ? errors.value : []
|
|
3979
|
+
);
|
|
3980
|
+
function hasVisibleStepErrors(e) {
|
|
3981
|
+
return showValidation.value && stepErrors(e).length > 0;
|
|
3982
|
+
}
|
|
3983
|
+
function isNextDisabled() {
|
|
3984
|
+
return validateOnSubmit.value ? !1 : currentStep.value - 1 < template.value.steps.length - 1 ? stepErrors().length > 0 : errors.value.length > 0;
|
|
3985
|
+
}
|
|
3986
|
+
function onNext() {
|
|
3987
|
+
if (stepErrors().length > 0) {
|
|
3988
|
+
submitAttempted.value = !0;
|
|
3989
|
+
return;
|
|
3990
|
+
}
|
|
3991
|
+
submitAttempted.value = !1, currentStep.value++;
|
|
3992
|
+
}
|
|
3931
3993
|
__expose({ showSheet });
|
|
3932
3994
|
function showSummaryDialog() {
|
|
3933
3995
|
Dialog.open({
|
|
@@ -3951,15 +4013,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3951
4013
|
return e === "campaign.message" ? "campaign.delivery" : e;
|
|
3952
4014
|
}
|
|
3953
4015
|
function onUpdateProperty(e, s) {
|
|
3954
|
-
var o, d,
|
|
4016
|
+
var o, d, i, c, l, n, a, r;
|
|
3955
4017
|
if (e === "campaign.message" && s && "channels" in s) {
|
|
3956
4018
|
_.set(data.value, "campaign.delivery", s);
|
|
3957
4019
|
const p = toLegacyMessage(s);
|
|
3958
|
-
p
|
|
4020
|
+
p ? _.set(data.value, "campaign.message", p) : delete data.value.campaign.message;
|
|
3959
4021
|
return;
|
|
3960
4022
|
}
|
|
3961
4023
|
if (_.set(data.value, e, s), e == "campaign.event.type") {
|
|
3962
|
-
const
|
|
4024
|
+
const h = ((c = (i = (d = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : d.campaign) == null ? void 0 : i.event) == null ? void 0 : c.rule) ? _.cloneDeep({
|
|
3963
4025
|
...(r = (a = (n = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : n.campaign) == null ? void 0 : a.event) == null ? void 0 : r.rule
|
|
3964
4026
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
3965
4027
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -3979,13 +4041,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3979
4041
|
"&&"
|
|
3980
4042
|
);
|
|
3981
4043
|
if (s != "SCHEDULE") {
|
|
3982
|
-
_.set(data.value, "campaign.event.rule",
|
|
4044
|
+
_.set(data.value, "campaign.event.rule", h);
|
|
3983
4045
|
return;
|
|
3984
4046
|
}
|
|
3985
4047
|
_.set(
|
|
3986
4048
|
data.value,
|
|
3987
4049
|
"campaign.event.rule",
|
|
3988
|
-
RuleBuilder.setRuleToGroup(
|
|
4050
|
+
RuleBuilder.setRuleToGroup(h, y)
|
|
3989
4051
|
);
|
|
3990
4052
|
}
|
|
3991
4053
|
e == "campaign.notify" && s == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -4006,6 +4068,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4006
4068
|
}
|
|
4007
4069
|
}
|
|
4008
4070
|
async function onSubmit() {
|
|
4071
|
+
submitAttempted.value = !0;
|
|
4009
4072
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
4010
4073
|
if (!e.success)
|
|
4011
4074
|
return;
|
|
@@ -4016,7 +4079,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4016
4079
|
(s || s === void 0) && (sheetVisible.value = !1);
|
|
4017
4080
|
}
|
|
4018
4081
|
return (e, s) => {
|
|
4019
|
-
const o = resolveComponent("FmButton"), d = resolveComponent("FmStep"),
|
|
4082
|
+
const o = resolveComponent("FmButton"), d = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), c = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
4020
4083
|
return openBlock(), createBlock(l, {
|
|
4021
4084
|
"fullscreen-size": "lg",
|
|
4022
4085
|
modelValue: unref(sheetVisible),
|
|
@@ -4037,7 +4100,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4037
4100
|
createVNode(o, {
|
|
4038
4101
|
onClick: onSubmit,
|
|
4039
4102
|
label: unref(t)("connect.campaign.common.save"),
|
|
4040
|
-
disabled: unref(errors).length > 0
|
|
4103
|
+
disabled: !unref(validateOnSubmit) && unref(errors).length > 0
|
|
4041
4104
|
}, null, 8, ["label", "disabled"])
|
|
4042
4105
|
])
|
|
4043
4106
|
])
|
|
@@ -4072,7 +4135,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4072
4135
|
])
|
|
4073
4136
|
])
|
|
4074
4137
|
], -1)),
|
|
4075
|
-
createVNode(
|
|
4138
|
+
createVNode(c, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
4076
4139
|
])
|
|
4077
4140
|
])
|
|
4078
4141
|
])
|
|
@@ -4082,7 +4145,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4082
4145
|
name: "default",
|
|
4083
4146
|
fn: withCtx(() => [
|
|
4084
4147
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
4085
|
-
createVNode(
|
|
4148
|
+
createVNode(i, {
|
|
4086
4149
|
modelValue: unref(currentStep),
|
|
4087
4150
|
"onUpdate:modelValue": s[1] || (s[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4088
4151
|
orientation: "horizontal",
|
|
@@ -4093,7 +4156,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4093
4156
|
key: n.name,
|
|
4094
4157
|
title: unref(getLocaleText)(n.name_locale, n.name),
|
|
4095
4158
|
value: a + 1,
|
|
4096
|
-
error: () =>
|
|
4159
|
+
error: () => hasVisibleStepErrors(a),
|
|
4097
4160
|
complete: () => a + 1 <= unref(currentStep)
|
|
4098
4161
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
4099
4162
|
]),
|
|
@@ -4105,7 +4168,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4105
4168
|
variant: "tertiary",
|
|
4106
4169
|
onClick: s[2] || (s[2] = (n) => sheetVisible.value = !1)
|
|
4107
4170
|
}),
|
|
4108
|
-
createVNode(
|
|
4171
|
+
createVNode(i, {
|
|
4109
4172
|
modelValue: unref(currentStep),
|
|
4110
4173
|
"onUpdate:modelValue": s[3] || (s[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4111
4174
|
orientation: "horizontal",
|
|
@@ -4117,7 +4180,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4117
4180
|
title: unref(sheetTitle),
|
|
4118
4181
|
description: unref(getLocaleText)(n.name_locale, n.name),
|
|
4119
4182
|
value: a + 1,
|
|
4120
|
-
error: () =>
|
|
4183
|
+
error: () => hasVisibleStepErrors(a),
|
|
4121
4184
|
complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
4122
4185
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
4123
4186
|
]),
|
|
@@ -4157,9 +4220,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4157
4220
|
modelValue: valueForField(r.property),
|
|
4158
4221
|
disabled: isDisable(r),
|
|
4159
4222
|
"campaign-type": unref(campaignType),
|
|
4160
|
-
"
|
|
4161
|
-
"onUpdate:
|
|
4162
|
-
|
|
4223
|
+
"show-validation": unref(showValidation),
|
|
4224
|
+
"onUpdate:modelValue": (h) => onUpdateProperty(r.property, h),
|
|
4225
|
+
"onUpdate:file": async (h, y) => {
|
|
4226
|
+
const V = await onUpdateFile(h, y);
|
|
4163
4227
|
onUpdateProperty(r.property, V || "");
|
|
4164
4228
|
},
|
|
4165
4229
|
schema: unref(ZodHelper).typeAtPath(
|
|
@@ -4168,15 +4232,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4168
4232
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
4169
4233
|
),
|
|
4170
4234
|
"helper-state": unref(ZodHelper).helperState(
|
|
4171
|
-
unref(
|
|
4235
|
+
unref(visibleErrors),
|
|
4172
4236
|
schemaPathForField(r.property)
|
|
4173
4237
|
),
|
|
4174
4238
|
"helper-text": unref(ZodHelper).helperText(
|
|
4175
|
-
unref(
|
|
4239
|
+
unref(visibleErrors),
|
|
4176
4240
|
schemaPathForField(r.property)
|
|
4177
4241
|
),
|
|
4178
4242
|
extras: r.extras != null ? r.extras == "" ? unref(data) : unref(_).get(unref(data), r.extras) : void 0
|
|
4179
|
-
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
4243
|
+
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
4180
4244
|
]))), 128))
|
|
4181
4245
|
]))), 128)),
|
|
4182
4246
|
createElementVNode("div", _hoisted_8, [
|
|
@@ -4187,9 +4251,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4187
4251
|
onClick: s[5] || (s[5] = (n) => currentStep.value--)
|
|
4188
4252
|
}, null, 8, ["label", "disabled"]),
|
|
4189
4253
|
createVNode(o, {
|
|
4190
|
-
disabled:
|
|
4254
|
+
disabled: isNextDisabled(),
|
|
4191
4255
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
|
|
4192
|
-
onClick: s[6] || (s[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ?
|
|
4256
|
+
onClick: s[6] || (s[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? onNext() : onSubmit())
|
|
4193
4257
|
}, null, 8, ["disabled", "label"])
|
|
4194
4258
|
])
|
|
4195
4259
|
]),
|