@feedmepos/mf-connect 0.1.98-beta.71 → 0.1.98-beta.73
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-C4XD_vWL.js} +8 -8
- package/dist/{AuditLogs-BnEeKG1C.js → AuditLogs-DpevHGsA.js} +11 -11
- package/dist/{Bin-BH9_nATR.js → Bin-FRrYZ8pV.js} +8 -8
- package/dist/{Broadcast-Gt2ZLLpZ.js → Broadcast-CoefxWt-.js} +91 -90
- package/dist/{CampaignAnalytic-BT6zTgNk.js → CampaignAnalytic-CdZjzsLr.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-nNLLEzii.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DQOLEDzY.js} +6 -6
- package/dist/{Card-dD52oor7.js → Card-BABL96V6.js} +21 -21
- package/dist/{Collections-7bwYNl3M.js → Collections-D6XuhBO1.js} +8 -8
- package/dist/{Credit-qZdlqXqR.js → Credit-D2WTeN8Z.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B0KkvFWi.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C09W9Qja.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-G2oU70Ef.js} +847 -734
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Bz1HRBMa.js → EffectSheet.vue_vue_type_style_index_0_lang-C4RByg0k.js} +6 -6
- package/dist/{Experience-CAaWgWXP.js → Experience-CUqmspwT.js} +12 -12
- package/dist/{FileSaver.min-BpfY6VnX.js → FileSaver.min-DX17A8Gj.js} +1 -1
- package/dist/{Game-fhrbFb_5.js → Game-D8IvyDdA.js} +13 -13
- package/dist/{GiftCardSetup-CTwmNKim.js → GiftCardSetup-BOSKBH8c.js} +10 -10
- package/dist/{Grab-BnPfb92x.js → Grab-CnBGt_H2.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js → ImageInput.vue_vue_type_script_setup_true_lang-BI00YCKv.js} +1 -1
- package/dist/{Index-DRwvmm_j.js → Index-BovDOTbf.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Ya4r9NNE.js → LocationPicker.vue_vue_type_script_setup_true_lang-D8auavm7.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CDwtqqLQ.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BM99IoIG.js} +1 -1
- package/dist/{LoyaltyDashboard-8jn6SIWo.js → LoyaltyDashboard-DiCQnQ76.js} +13 -13
- package/dist/{MainLayout-Bf42AcB1.js → MainLayout-Cg37dK-P.js} +3 -3
- package/dist/{Marketing-DruTMjiR.js → Marketing-DRCT9dBo.js} +4 -4
- package/dist/{MarketingMaterialEdit-moEHd_gP.js → MarketingMaterialEdit-DcE0A8_A.js} +6 -6
- package/dist/{Member-C9VTQqIm.js → Member-C8T1-ywK.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DEsVSWmv.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CTl8LtJ9.js} +23 -23
- package/dist/{MemberImportHistory-DZVwya9v.js → MemberImportHistory-CYCxxxN7.js} +7 -7
- package/dist/{MemberList-KusIfy1u.js → MemberList-Ddlnm4JX.js} +14 -14
- package/dist/{MemberTransactions-msyjdzlI.js → MemberTransactions-DwyZTeZb.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DbV-m3cC.js → MessageInput.vue_vue_type_script_setup_true_lang-BWCxGlQO.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-LdVeH7gh.js} +1 -1
- package/dist/{Mission-CUUxpBUF.js → Mission-CW0y8Bzw.js} +13 -13
- package/dist/{Overview-C9jyKXHX.js → Overview-CO4T3l6l.js} +19 -19
- package/dist/{Overview-CYKoF8Hp.js → Overview-i2XPL7Pu.js} +4 -4
- package/dist/{Point-CPpQ07yp.js → Point-CNWdfqQZ.js} +12 -12
- package/dist/{Promotion-CJ95m9Qb.js → Promotion-DAemCP79.js} +13 -13
- package/dist/{Queue-CX39ILh_.js → Queue-DI50gMny.js} +11 -11
- package/dist/{Record-6I0qyXB5.js → Record-DX3WHXku.js} +9 -9
- package/dist/{Review-DoWu2XNT.js → Review-DzSNG4Le.js} +2 -2
- package/dist/{ReviewFacebookCallback-Co-5TnI7.js → ReviewFacebookCallback-CrdRUN3t.js} +5 -5
- package/dist/{ReviewGoogleCallback-Ca7ZuMcF.js → ReviewGoogleCallback-Da28WNzU.js} +5 -5
- package/dist/{Reward-Cx_N6qBJ.js → Reward-DUQAE99I.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Cn5Yp37p.js → RewardGroup.vue_vue_type_script_setup_true_lang-BGAOPkwD.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-M0c67Dyl.js → RuleGroup.vue_vue_type_script_setup_true_lang-B9Dbe9no.js} +13 -13
- package/dist/{Segment-Bx0EW966.js → Segment-BgVf2-G2.js} +24 -24
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ahvrEUGa.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDLXF5HM.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-C7zSfZdl.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-9UiH43em.js} +4 -4
- package/dist/{Setting-DzEK3dWj.js → Setting-3jW6EbKA.js} +14 -14
- package/dist/{SettingAdvertisements-BNALbI88.js → SettingAdvertisements-C40QcuSn.js} +12 -12
- package/dist/{Settings-Cw85-xzq.js → Settings-DT9bypKs.js} +5 -5
- package/dist/{Store-BSqW1gwf.js → Store-DQyOUfEJ.js} +25 -25
- package/dist/{StoreRewards-CJXnS8Qf.js → StoreRewards-Dr_c0PbO.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C6tUwHEj.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bh5h8Lc_.js} +24 -24
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-iylphGuV.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-LquvtnTy.js} +2 -2
- package/dist/{Tier-DfitNxp2.js → Tier-DmqfEWcB.js} +25 -25
- package/dist/{Title-QCbtOvKB.js → Title-Dx6pcJfP.js} +21 -21
- package/dist/{Transaction-dOCzlidD.js → Transaction-CD6agt6m.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Be5X1C-Y.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CNjBtitb.js} +6 -6
- package/dist/{Voucher-BfoCDwjg.js → Voucher-P4dyOeUd.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-0EIYoZ0F.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Bv--fzY0.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bq_7U0NO.js} +2 -2
- package/dist/{app-BxTElIm-.js → app-CmqX1V1B.js} +1370 -1335
- package/dist/app.js +1 -1
- package/dist/{base.export-BmUK8hMh.js → base.export-guVE-B2c.js} +2 -2
- package/dist/{business-DjAiT8tR.js → business-DXmGtwPm.js} +1 -1
- package/dist/{campaign-tAmQNoq7.js → campaign-CVXbgs-y.js} +2 -2
- package/dist/{campaign-DlR3KF9m.js → campaign-D9Jufumh.js} +157 -125
- package/dist/{campaign.enum-BjwEQd11.js → campaign.enum-CXhYMbkx.js} +1 -1
- package/dist/{campaign.fn-C6kWWIQx.js → campaign.fn-DoJPn6yl.js} +23 -23
- package/dist/{collectible.enum-BrtXpT9S.js → collectible.enum-Tk6LIMMm.js} +1 -1
- package/dist/{collection.fn-CDhfM3Eq.js → collection.fn-DCVNYQau.js} +2 -2
- package/dist/{currency-10nX5QnT.js → currency-BYhkCI6F.js} +1 -1
- package/dist/{duplicateCampaign-6oMZOvfM.js → duplicateCampaign-BOVBZHFs.js} +2 -2
- package/dist/{effect-T4YzuTc5.js → effect-e6wYWgc8.js} +1 -1
- package/dist/{email-addresses-BjODnJMM.js → email-addresses-Dcd_vAeM.js} +2 -2
- package/dist/{helper-BCl5r5yZ.js → helper-DluoQ6zi.js} +1 -1
- package/dist/{index-Bz6oSli7.js → index-2QCDTrA9.js} +2 -2
- package/dist/{index-BBsK7TUw.js → index-BAs9N7bi.js} +3 -3
- package/dist/{index-C5IfNJUl.js → index-BFzBAm6P.js} +1 -1
- package/dist/{index-CnaQt4Pn.js → index-BpAhyOgv.js} +1 -1
- package/dist/{index-BxU--5J5.js → index-C-oypk0K.js} +3 -3
- package/dist/{index-BQk6zTgf.js → index-C9JY8Ru6.js} +2 -2
- package/dist/{index-DJdTDF9C.js → index-CBRWvjup.js} +7 -7
- package/dist/{index-CRvUvCMA.js → index-CDdNExzM.js} +1 -1
- package/dist/{index-BiolIgqR.js → index-ChYMoLaB.js} +1 -1
- package/dist/{index-Bht1Z11w.js → index-CiJQlOu7.js} +7 -7
- package/dist/{index-Ctja--IE.js → index-DB51l5yi.js} +1 -1
- package/dist/{index-Bd4clHfr.js → index-DIP_uzZm.js} +5 -5
- package/dist/{index-BeVWchv7.js → index-DKrJlWH3.js} +1124 -1124
- package/dist/{index-DhtKt4OL.js → index-DoiGG41P.js} +3 -3
- package/dist/{index-DeQKLilv.js → index-SQItAw7w.js} +3 -3
- package/dist/{index-D8rGhchh.js → index-SS72WJs_.js} +1 -1
- package/dist/{index-DXiJa8Cw.js → index-kPcRcSFx.js} +2 -2
- package/dist/{index-B9ZMIUMa.js → index-qkkPuNFM.js} +5 -5
- package/dist/{index.esm2017-CEOegJjn.js → index.esm2017-BLVWhb4f.js} +1 -1
- package/dist/{loading-Dx4SCvZY.js → loading-ClX4Z1ZH.js} +1 -1
- package/dist/{lodash-Dq8OKCKK.js → lodash-Cxh2BWuW.js} +1 -1
- package/dist/{member-import-DX-jn2uk.js → member-import-DKfSDn0D.js} +1 -1
- package/dist/{membership-CltAa-gH.js → membership-BBAosVNQ.js} +3 -3
- package/dist/{money-DsaAjJTI.js → money-CWzvdiFT.js} +1 -1
- package/dist/{number-DmhHKYgY.js → number-Cp7TGBzd.js} +1 -1
- package/dist/{objectid-BdNv-dZX.js → objectid-CXWfUmP_.js} +9 -9
- package/dist/{plugins-BFKVM3uC.js → plugins-BKD6oEHa.js} +3 -3
- package/dist/{reward--SjvIeyy.js → reward-CrjStT4w.js} +1 -1
- package/dist/{rule-CAKdNobZ.js → rule-CBZRptRM.js} +8 -8
- package/dist/{template-Cfxc5eM8.js → template-D4qWK9tk.js} +6 -6
- package/dist/{timezone-D2b-V5XD.js → timezone-t0WxSk3e.js} +1 -1
- package/dist/{transaction.fn-B5mLY7bz.js → transaction.fn-DZp6Drqf.js} +2 -2
- package/dist/{trigger-DvYcjRBZ.js → trigger-DN5yeimJ.js} +5 -5
- package/dist/{useMarketingMaterialActions-DtqnjMSt.js → useMarketingMaterialActions-ChkZyyRO.js} +3 -3
- package/dist/{usePagination-DKX24g31.js → usePagination-Vda9U5Dh.js} +1 -1
- package/dist/{user-fWb1NxGO.js → user-jEjTV3E6.js} +1 -1
- package/dist/{vue-i18n-wJReAVJw.js → vue-i18n-Bg_RJ_GV.js} +482 -482
- package/dist/{xlsx-Mthhu4JR.js → xlsx-unW4U5Tx.js} +440 -440
- package/dist/{zod-CVpVUgBZ.js → zod-DIsCEUuE.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
|
|
10
|
-
import {
|
|
11
|
-
import { u as
|
|
2
|
+
import { _ } from "./lodash-Cxh2BWuW.js";
|
|
3
|
+
import { S as S6, f as Zh, z as z$1 } from "./app-CmqX1V1B.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-DIsCEUuE.js";
|
|
5
|
+
import { F as FdoObjectId, z } from "./index-C-oypk0K.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-DIP_uzZm.js";
|
|
7
|
+
import { F as FdtoCollectibleConfig } from "./index-BAs9N7bi.js";
|
|
8
|
+
import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-CBRWvjup.js";
|
|
9
|
+
import { A as APP_INBOX_BODY_LIMIT, g as FdoBroadcastUrl, h as F_PUSH_DESTINATION, t as toDelivery, i as toLegacyMessage } from "./index-DKrJlWH3.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-D9Jufumh.js";
|
|
11
|
+
import { u as useMembershipStore } from "./membership-BBAosVNQ.js";
|
|
12
|
+
import { u as useBusinessStore } from "./business-DXmGtwPm.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-CXhYMbkx.js";
|
|
16
|
+
import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-BI00YCKv.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-C4RByg0k.js";
|
|
18
|
+
import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-LquvtnTy.js";
|
|
19
|
+
import { c as core, S as SvcConfig } from "./index-C9JY8Ru6.js";
|
|
20
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-BKD6oEHa.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-CNjBtitb.js";
|
|
23
|
+
import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-B9Dbe9no.js";
|
|
24
|
+
import { u as useI18n } from "./vue-i18n-Bg_RJ_GV.js";
|
|
25
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-DN5yeimJ.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-BWCxGlQO.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-2QCDTrA9.js";
|
|
29
|
+
import { m as membershipApi } from "./index-SQItAw7w.js";
|
|
30
|
+
import { m as moment } from "./index-ChYMoLaB.js";
|
|
31
|
+
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-CBZRptRM.js";
|
|
32
|
+
import { C as CountryTimezone } from "./timezone-t0WxSk3e.js";
|
|
33
|
+
import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-Bv--fzY0.js";
|
|
34
|
+
import "./index-qkkPuNFM.js";
|
|
35
|
+
import "./index-DoiGG41P.js";
|
|
36
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-Tk6LIMMm.js";
|
|
37
|
+
import { u as useLoading } from "./loading-ClX4Z1ZH.js";
|
|
38
|
+
import { i as initCollectibleConfig } from "./helper-DluoQ6zi.js";
|
|
39
|
+
import { C as CollectionUtils } from "./collection.fn-DCVNYQau.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-CVXbgs-y.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: {
|
|
@@ -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");
|
|
@@ -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,
|
|
@@ -388,7 +388,7 @@ const _hoisted_1$r = {
|
|
|
388
388
|
createVNode(v, {
|
|
389
389
|
variant: "primary",
|
|
390
390
|
label: "Confirm Selection",
|
|
391
|
-
onClick:
|
|
391
|
+
onClick: c
|
|
392
392
|
})
|
|
393
393
|
])
|
|
394
394
|
])) : createCommentVNode("", !0);
|
|
@@ -397,7 +397,7 @@ const _hoisted_1$r = {
|
|
|
397
397
|
}), _hoisted_1$q = {
|
|
398
398
|
key: 0,
|
|
399
399
|
class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
|
|
400
|
-
}, _hoisted_2$m = { class: "flex items-center justify-between" }, _hoisted_3$j = { class: "flex items-center gap-8" }, _hoisted_4$i = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$f = { class: "flex gap-8 items-center" }, _hoisted_6$b = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$a = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$
|
|
400
|
+
}, _hoisted_2$m = { class: "flex items-center justify-between" }, _hoisted_3$j = { class: "flex items-center gap-8" }, _hoisted_4$i = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$f = { class: "flex gap-8 items-center" }, _hoisted_6$b = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$a = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$9 = { class: "flex items-center gap-12" }, _hoisted_9$9 = { class: "fm-typo-en-body-md-600" }, _hoisted_10$8 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_11$6 = {
|
|
401
401
|
key: 1,
|
|
402
402
|
class: "p-24 text-center"
|
|
403
403
|
}, _hoisted_12$5 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_13$5 = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
@@ -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
435
|
function v(u) {
|
|
436
|
-
|
|
436
|
+
c.value[u] = !c.value[u];
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function f() {
|
|
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
|
-
function
|
|
450
|
-
const u = Object.entries(
|
|
449
|
+
function k() {
|
|
450
|
+
const u = Object.entries(c.value).filter(([, m]) => m).map(([m]) => m);
|
|
451
451
|
d("confirm", u);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function y() {
|
|
454
454
|
d("cancel");
|
|
455
455
|
}
|
|
456
456
|
const g = computed(() => a.value.length > 0 && a.value.every(
|
|
457
|
-
(u) =>
|
|
457
|
+
(u) => c.value[u.id]
|
|
458
458
|
));
|
|
459
459
|
return (u, m) => {
|
|
460
|
-
const C = resolveComponent("FmIcon"),
|
|
460
|
+
const C = resolveComponent("FmIcon"), x = 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, [
|
|
@@ -467,23 +467,23 @@ const _hoisted_1$r = {
|
|
|
467
467
|
}),
|
|
468
468
|
m[2] || (m[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
|
|
469
469
|
]),
|
|
470
|
-
createVNode(
|
|
470
|
+
createVNode(x, {
|
|
471
471
|
icon: "close",
|
|
472
472
|
variant: "tertiary",
|
|
473
|
-
onClick:
|
|
473
|
+
onClick: y
|
|
474
474
|
})
|
|
475
475
|
]),
|
|
476
476
|
m[3] || (m[3] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. The discount will be available for all items within the selected categories. ", -1)),
|
|
477
477
|
createElementVNode("div", _hoisted_4$i, [
|
|
478
478
|
createElementVNode("div", _hoisted_5$f, [
|
|
479
|
-
createVNode(
|
|
479
|
+
createVNode(x, {
|
|
480
480
|
icon: "select_all",
|
|
481
481
|
variant: "tertiary",
|
|
482
482
|
size: "small",
|
|
483
483
|
label: `${g.value ? "Deselect" : "Select"} All`,
|
|
484
|
-
onClick:
|
|
484
|
+
onClick: f
|
|
485
485
|
}, null, 8, ["label"]),
|
|
486
|
-
createVNode(
|
|
486
|
+
createVNode(x, {
|
|
487
487
|
icon: "sync",
|
|
488
488
|
variant: "tertiary",
|
|
489
489
|
size: "small",
|
|
@@ -503,14 +503,14 @@ 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
509
|
onClick: (O) => v(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
515
|
"onUpdate:modelValue": (O) => v(w.id),
|
|
516
516
|
onClick: m[1] || (m[1] = withModifiers(() => {
|
|
@@ -518,14 +518,14 @@ const _hoisted_1$r = {
|
|
|
518
518
|
}, null, 8, ["model-value", "value", "onUpdate:modelValue"])
|
|
519
519
|
]),
|
|
520
520
|
default: withCtx(() => [
|
|
521
|
-
createElementVNode("div", _hoisted_8$
|
|
521
|
+
createElementVNode("div", _hoisted_8$9, [
|
|
522
522
|
createVNode(C, {
|
|
523
523
|
name: "category",
|
|
524
524
|
size: "sm",
|
|
525
525
|
class: "text-fm-color-typo-secondary"
|
|
526
526
|
}),
|
|
527
527
|
createElementVNode("div", null, [
|
|
528
|
-
createElementVNode("div", _hoisted_9$
|
|
528
|
+
createElementVNode("div", _hoisted_9$9, toDisplayString(w.name), 1),
|
|
529
529
|
createElementVNode("div", _hoisted_10$8, " ID: " + toDisplayString(w.id), 1)
|
|
530
530
|
])
|
|
531
531
|
])
|
|
@@ -539,16 +539,16 @@ const _hoisted_1$r = {
|
|
|
539
539
|
]))
|
|
540
540
|
]),
|
|
541
541
|
createElementVNode("div", _hoisted_13$5, [
|
|
542
|
-
createVNode(
|
|
542
|
+
createVNode(x, {
|
|
543
543
|
variant: "secondary",
|
|
544
544
|
label: "Cancel",
|
|
545
|
-
onClick:
|
|
545
|
+
onClick: y
|
|
546
546
|
}),
|
|
547
|
-
createVNode(
|
|
547
|
+
createVNode(x, {
|
|
548
548
|
variant: "primary",
|
|
549
549
|
label: `Confirm Selection (${r.value})`,
|
|
550
550
|
disabled: r.value === 0,
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: k
|
|
552
552
|
}, null, 8, ["label", "disabled"])
|
|
553
553
|
])
|
|
554
554
|
])) : createCommentVNode("", !0);
|
|
@@ -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$
|
|
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$8 = { key: 0 }, _hoisted_9$8 = { 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,11 +581,11 @@ 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;
|
|
588
|
-
return !(!a.value.type || !((b = a.value.scope) != null && b.type) ||
|
|
588
|
+
return !(!a.value.type || !((b = a.value.scope) != null && b.type) || f(a.value.type) && (!a.value.value || a.value.value <= 0) || (a.value.scope.type === "items" || a.value.scope.type === "category") && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0));
|
|
589
589
|
});
|
|
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);
|
|
@@ -594,7 +594,7 @@ const _hoisted_1$r = {
|
|
|
594
594
|
var b;
|
|
595
595
|
return C(((b = a.value.scope) == null ? void 0 : b.type) || "order");
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function f(b) {
|
|
598
598
|
return b && !["freeItem", "delivery"].includes(b);
|
|
599
599
|
}
|
|
600
600
|
function V(b) {
|
|
@@ -602,37 +602,37 @@ const _hoisted_1$r = {
|
|
|
602
602
|
b
|
|
603
603
|
);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function k(b) {
|
|
606
606
|
return b != null && b.includes("Percentage") ? "Discount percentage" : b != null && b.includes("FixPrice") ? "Bundle fixed price" : b === "percentage" ? "Discount percentage" : "Discount amount";
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function y(b) {
|
|
609
609
|
return b != null && b.includes("Percentage") || b === "percentage" ? "10" : "5.00";
|
|
610
610
|
}
|
|
611
611
|
function g(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
|
+
(h) => h.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
|
|
@@ -686,7 +686,7 @@ const _hoisted_1$r = {
|
|
|
686
686
|
];
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function x(b) {
|
|
690
690
|
switch (b) {
|
|
691
691
|
case "order":
|
|
692
692
|
return "Applies to entire order. Available: Amount off, Percentage off, Delivery fee discount.";
|
|
@@ -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((h) => h._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((h) => h._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"), f(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"), h = resolveComponent("FmSideSheet");
|
|
764
|
+
return openBlock(), createBlock(h, {
|
|
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(
|
|
832
|
+
createElementVNode("div", _hoisted_7$9, toDisplayString(x((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
840
|
items: v()
|
|
841
841
|
}, null, 8, ["model-value", "items"])
|
|
842
842
|
]),
|
|
843
|
-
|
|
844
|
-
createElementVNode("label", _hoisted_9$
|
|
843
|
+
f(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$8, [
|
|
844
|
+
createElementVNode("label", _hoisted_9$8, toDisplayString(k(unref(a).type)), 1),
|
|
845
845
|
createVNode(P, {
|
|
846
846
|
modelValue: unref(a).value,
|
|
847
|
-
"onUpdate:modelValue":
|
|
848
|
-
placeholder:
|
|
847
|
+
"onUpdate:modelValue": B[2] || (B[2] = (L) => unref(a).value = L),
|
|
848
|
+
placeholder: y(unref(a).type),
|
|
849
849
|
suffix: g(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(),
|
|
@@ -997,10 +997,10 @@ const _hoisted_1$r = {
|
|
|
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] = (
|
|
1003
|
-
a[1] || (a[1] = (
|
|
1002
|
+
a[0] || (a[0] = (f) => isRef(c) ? c.value = f : null),
|
|
1003
|
+
a[1] || (a[1] = (f) => l(f))
|
|
1004
1004
|
]
|
|
1005
1005
|
}, {
|
|
1006
1006
|
default: withCtx(() => [
|
|
@@ -1015,17 +1015,17 @@ 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
1023
|
"model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
1024
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
1024
|
+
"onUpdate:modelValue": a[2] || (a[2] = (f) => i(
|
|
1025
1025
|
"update:model-value",
|
|
1026
1026
|
unref(RuleBuilder).setRuleToGroup(
|
|
1027
1027
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
1028
|
-
|
|
1028
|
+
f,
|
|
1029
1029
|
"&&"
|
|
1030
1030
|
)
|
|
1031
1031
|
))
|
|
@@ -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,
|
|
@@ -1275,7 +1275,7 @@ const _hoisted_1$r = {
|
|
|
1275
1275
|
]);
|
|
1276
1276
|
};
|
|
1277
1277
|
}
|
|
1278
|
-
}), _hoisted_1$l = { class: "flex flex-col gap-16" }, _hoisted_2$i = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$f = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$e = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$c = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$9 = { class: "flex items-center justify-between gap-8" }, _hoisted_7$8 = { class: "fm-typo-en-body-lg-400" }, _hoisted_8$
|
|
1278
|
+
}), _hoisted_1$l = { class: "flex flex-col gap-16" }, _hoisted_2$i = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$f = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$e = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$c = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$9 = { class: "flex items-center justify-between gap-8" }, _hoisted_7$8 = { class: "fm-typo-en-body-lg-400" }, _hoisted_8$7 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_9$7 = { class: "flex flex-col gap-8" }, _hoisted_10$6 = { class: "flex items-baseline justify-between" }, _hoisted_11$4 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$3 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_13$3 = { class: "min-w-[160px] flex-1" }, _hoisted_14$3 = { class: "min-w-[180px] flex-1" }, TITLE_LIMIT$1 = 40, PREVIEW_LIMIT = 120, MAX_BUTTONS = 2, TITLE_WARN_AT$1 = 34, PREVIEW_WARN_AT = 110, _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
1279
1279
|
__name: "AppInboxInput",
|
|
1280
1280
|
props: {
|
|
1281
1281
|
modelValue: {
|
|
@@ -1285,187 +1285,234 @@ const _hoisted_1$r = {
|
|
|
1285
1285
|
variables: {
|
|
1286
1286
|
type: Array,
|
|
1287
1287
|
default: () => [...DEFAULT_MESSAGE_VARIABLES]
|
|
1288
|
+
},
|
|
1289
|
+
/** False until the form is submitted; broadcasts validate on submit. */
|
|
1290
|
+
showValidation: {
|
|
1291
|
+
type: Boolean,
|
|
1292
|
+
default: !0
|
|
1288
1293
|
}
|
|
1289
1294
|
},
|
|
1290
1295
|
emits: ["update:model-value"],
|
|
1291
1296
|
setup(e, { emit: s }) {
|
|
1292
|
-
const { t: o } = useI18n(), d = e,
|
|
1293
|
-
function
|
|
1294
|
-
|
|
1297
|
+
const { t: o } = useI18n(), d = e, i = s;
|
|
1298
|
+
function c(V) {
|
|
1299
|
+
i("update:model-value", { ...d.modelValue, ...V });
|
|
1295
1300
|
}
|
|
1296
|
-
function
|
|
1297
|
-
return V >=
|
|
1301
|
+
function l(V, k) {
|
|
1302
|
+
return V >= k ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
1298
1303
|
}
|
|
1299
|
-
const
|
|
1304
|
+
const n = computed(() => d.modelValue.buttons ?? []), a = computed(() => {
|
|
1300
1305
|
var V;
|
|
1301
1306
|
return ((V = d.modelValue.content) == null ? void 0 : V.length) ?? 0;
|
|
1302
1307
|
});
|
|
1303
|
-
function
|
|
1304
|
-
|
|
1305
|
-
buttons:
|
|
1306
|
-
(
|
|
1308
|
+
function r(V, k) {
|
|
1309
|
+
c({
|
|
1310
|
+
buttons: n.value.map(
|
|
1311
|
+
(y, g) => g === V ? { ...y, ...k } : y
|
|
1307
1312
|
)
|
|
1308
1313
|
});
|
|
1309
1314
|
}
|
|
1310
|
-
function
|
|
1311
|
-
|
|
1315
|
+
function p() {
|
|
1316
|
+
n.value.length >= MAX_BUTTONS || c({ buttons: [...n.value, { label: "", url: "" }] });
|
|
1312
1317
|
}
|
|
1313
|
-
function
|
|
1314
|
-
|
|
1318
|
+
function v(V) {
|
|
1319
|
+
var y;
|
|
1320
|
+
if (!d.showValidation) return { label: void 0, url: void 0 };
|
|
1321
|
+
const k = (y = V.url) == null ? void 0 : y.trim();
|
|
1322
|
+
return {
|
|
1323
|
+
label: V.label.trim() ? void 0 : o("connect.campaign.appInbox.buttonLabelRequired"),
|
|
1324
|
+
url: k ? FdoBroadcastUrl.safeParse(k).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.appInbox.buttonUrlRequired")
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
function f(V) {
|
|
1328
|
+
c({ buttons: n.value.filter((k, y) => y !== V) });
|
|
1315
1329
|
}
|
|
1316
|
-
return (V,
|
|
1317
|
-
const
|
|
1330
|
+
return (V, k) => {
|
|
1331
|
+
const y = resolveComponent("FmTextField"), g = resolveComponent("FmButton");
|
|
1318
1332
|
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
1319
1333
|
createElementVNode("div", null, [
|
|
1320
1334
|
createElementVNode("div", _hoisted_2$i, [
|
|
1321
1335
|
createElementVNode("span", _hoisted_3$f, toDisplayString(unref(o)("connect.campaign.appInbox.title")), 1),
|
|
1322
1336
|
createElementVNode("span", {
|
|
1323
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1337
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.title.length, TITLE_WARN_AT$1)])
|
|
1324
1338
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT$1), 3)
|
|
1325
1339
|
]),
|
|
1326
|
-
createVNode(
|
|
1340
|
+
createVNode(y, {
|
|
1327
1341
|
"model-value": e.modelValue.title,
|
|
1328
1342
|
"max-length": TITLE_LIMIT$1,
|
|
1329
1343
|
placeholder: unref(o)("connect.campaign.appInbox.titlePlaceholder"),
|
|
1330
|
-
"onUpdate:modelValue":
|
|
1344
|
+
"onUpdate:modelValue": k[0] || (k[0] = (u) => c({ title: u }))
|
|
1331
1345
|
}, null, 8, ["model-value", "placeholder"])
|
|
1332
1346
|
]),
|
|
1333
1347
|
createElementVNode("div", null, [
|
|
1334
1348
|
createElementVNode("div", _hoisted_4$e, [
|
|
1335
1349
|
createElementVNode("span", _hoisted_5$c, toDisplayString(unref(o)("connect.campaign.appInbox.previewText")), 1),
|
|
1336
1350
|
createElementVNode("span", {
|
|
1337
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1351
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.previewText.length, PREVIEW_WARN_AT)])
|
|
1338
1352
|
}, toDisplayString(e.modelValue.previewText.length) + " / " + toDisplayString(PREVIEW_LIMIT), 3)
|
|
1339
1353
|
]),
|
|
1340
|
-
createVNode(
|
|
1354
|
+
createVNode(y, {
|
|
1341
1355
|
"model-value": e.modelValue.previewText,
|
|
1342
1356
|
"max-length": PREVIEW_LIMIT,
|
|
1343
1357
|
placeholder: unref(o)("connect.campaign.appInbox.previewTextPlaceholder"),
|
|
1344
|
-
"onUpdate:modelValue":
|
|
1358
|
+
"onUpdate:modelValue": k[1] || (k[1] = (u) => c({ previewText: u }))
|
|
1345
1359
|
}, null, 8, ["model-value", "placeholder"])
|
|
1346
1360
|
]),
|
|
1347
1361
|
createElementVNode("div", _hoisted_6$9, [
|
|
1348
1362
|
createElementVNode("div", null, [
|
|
1349
1363
|
createElementVNode("div", _hoisted_7$8, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessage")), 1),
|
|
1350
|
-
createElementVNode("div", _hoisted_8$
|
|
1364
|
+
createElementVNode("div", _hoisted_8$7, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessageDescription")), 1),
|
|
1351
1365
|
createElementVNode("div", {
|
|
1352
1366
|
class: normalizeClass([
|
|
1353
1367
|
"mt-[2px] fm-typo-en-body-sm-400",
|
|
1354
|
-
unref(
|
|
1368
|
+
unref(a) > unref(APP_INBOX_BODY_LIMIT) ? "text-fm-color-system-error-400" : "text-fm-color-typo-secondary"
|
|
1355
1369
|
])
|
|
1356
|
-
}, toDisplayString(unref(
|
|
1370
|
+
}, toDisplayString(unref(a)) + " / " + toDisplayString(unref(APP_INBOX_BODY_LIMIT)), 3)
|
|
1357
1371
|
]),
|
|
1358
1372
|
createVNode(_sfc_main$v, {
|
|
1359
1373
|
html: e.modelValue.content,
|
|
1360
1374
|
variables: e.variables,
|
|
1361
1375
|
"media-limit": 1,
|
|
1362
1376
|
"button-label": unref(o)("connect.campaign.appInbox.editBodyMessage"),
|
|
1363
|
-
"onUpdate:html":
|
|
1377
|
+
"onUpdate:html": k[2] || (k[2] = (u) => c({ content: u.html }))
|
|
1364
1378
|
}, null, 8, ["html", "variables", "button-label"])
|
|
1365
1379
|
]),
|
|
1366
|
-
createElementVNode("div", _hoisted_9$
|
|
1380
|
+
createElementVNode("div", _hoisted_9$7, [
|
|
1367
1381
|
createElementVNode("div", _hoisted_10$6, [
|
|
1368
1382
|
createElementVNode("span", _hoisted_11$4, toDisplayString(unref(o)("connect.campaign.appInbox.buttons")), 1),
|
|
1369
|
-
createElementVNode("span", _hoisted_12$3, toDisplayString(unref(
|
|
1383
|
+
createElementVNode("span", _hoisted_12$3, toDisplayString(unref(n).length) + " / " + toDisplayString(MAX_BUTTONS), 1)
|
|
1370
1384
|
]),
|
|
1371
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1372
|
-
key:
|
|
1385
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (u, m) => (openBlock(), createElementBlock("div", {
|
|
1386
|
+
key: m,
|
|
1373
1387
|
class: "flex flex-wrap items-start gap-8"
|
|
1374
1388
|
}, [
|
|
1375
1389
|
createElementVNode("div", _hoisted_13$3, [
|
|
1376
|
-
createVNode(
|
|
1377
|
-
"model-value":
|
|
1390
|
+
createVNode(y, {
|
|
1391
|
+
"model-value": u.label,
|
|
1392
|
+
"max-length": 20,
|
|
1378
1393
|
placeholder: unref(o)("connect.campaign.appInbox.buttonLabel"),
|
|
1379
|
-
"
|
|
1380
|
-
|
|
1394
|
+
"helper-state": v(u).label ? "error" : "none",
|
|
1395
|
+
"helper-text": v(u).label,
|
|
1396
|
+
"onUpdate:modelValue": (C) => r(m, { label: C })
|
|
1397
|
+
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1381
1398
|
]),
|
|
1382
1399
|
createElementVNode("div", _hoisted_14$3, [
|
|
1383
|
-
createVNode(
|
|
1384
|
-
"model-value":
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
"onUpdate:modelValue": (
|
|
1390
|
-
}, null, 8, ["model-value", "
|
|
1400
|
+
createVNode(y, {
|
|
1401
|
+
"model-value": u.url ?? "",
|
|
1402
|
+
inputmode: "url",
|
|
1403
|
+
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
1404
|
+
"helper-state": v(u).url ? "error" : "none",
|
|
1405
|
+
"helper-text": v(u).url,
|
|
1406
|
+
"onUpdate:modelValue": (C) => r(m, { url: C.trim() })
|
|
1407
|
+
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1391
1408
|
]),
|
|
1392
|
-
createVNode(
|
|
1409
|
+
createVNode(g, {
|
|
1393
1410
|
icon: "delete",
|
|
1394
1411
|
"icon-color": "neutral-gray-400",
|
|
1395
1412
|
variant: "tertiary",
|
|
1396
|
-
onClick: (
|
|
1413
|
+
onClick: (C) => f(m)
|
|
1397
1414
|
}, null, 8, ["onClick"])
|
|
1398
1415
|
]))), 128)),
|
|
1399
|
-
unref(
|
|
1416
|
+
unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(g, {
|
|
1400
1417
|
key: 0,
|
|
1401
1418
|
variant: "tertiary",
|
|
1402
1419
|
icon: "add",
|
|
1403
1420
|
label: unref(o)("connect.campaign.appInbox.addButton"),
|
|
1404
|
-
onClick:
|
|
1421
|
+
onClick: p
|
|
1405
1422
|
}, null, 8, ["label"])) : createCommentVNode("", !0)
|
|
1406
1423
|
])
|
|
1407
1424
|
]);
|
|
1408
1425
|
};
|
|
1409
1426
|
}
|
|
1410
|
-
}), _hoisted_1$k = { class: "flex flex-col gap-16" }, _hoisted_2$h = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$e = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$d = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$b = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$8 = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_7$7 = {
|
|
1427
|
+
}), _hoisted_1$k = { class: "flex flex-col gap-16" }, _hoisted_2$h = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$e = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$d = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$b = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$8 = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_7$7 = {
|
|
1428
|
+
key: 0,
|
|
1429
|
+
class: "mt-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1430
|
+
}, _hoisted_8$6 = {
|
|
1431
|
+
key: 1,
|
|
1432
|
+
class: "mt-12"
|
|
1433
|
+
}, _hoisted_9$6 = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, TITLE_LIMIT = 40, BODY_LIMIT = 120, TITLE_WARN_AT = 34, BODY_WARN_AT = 110, _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
1411
1434
|
__name: "PushInput",
|
|
1412
1435
|
props: {
|
|
1413
1436
|
modelValue: {
|
|
1414
1437
|
type: Object,
|
|
1415
1438
|
required: !0
|
|
1439
|
+
},
|
|
1440
|
+
/** False until the form is submitted; broadcasts validate on submit. */
|
|
1441
|
+
showValidation: {
|
|
1442
|
+
type: Boolean,
|
|
1443
|
+
default: !0
|
|
1416
1444
|
}
|
|
1417
1445
|
},
|
|
1418
1446
|
emits: ["update:model-value"],
|
|
1419
1447
|
setup(e, { emit: s }) {
|
|
1420
|
-
const { t: o } = useI18n(), d = e,
|
|
1421
|
-
|
|
1422
|
-
|
|
1448
|
+
const { t: o } = useI18n(), d = e, i = s, c = F_PUSH_DESTINATION.options, l = computed(() => d.modelValue.destination === "EXTERNAL"), n = computed(() => {
|
|
1449
|
+
var f;
|
|
1450
|
+
if (!d.showValidation || !l.value) return;
|
|
1451
|
+
const v = (f = d.modelValue.url) == null ? void 0 : f.trim();
|
|
1452
|
+
return v ? FdoBroadcastUrl.safeParse(v).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.push.linkUrlRequired");
|
|
1453
|
+
});
|
|
1454
|
+
function a(v) {
|
|
1455
|
+
i("update:model-value", { ...d.modelValue, ...v });
|
|
1423
1456
|
}
|
|
1424
|
-
function
|
|
1425
|
-
|
|
1457
|
+
function r(v) {
|
|
1458
|
+
a(v === "EXTERNAL" ? { destination: v } : { destination: v, url: null });
|
|
1426
1459
|
}
|
|
1427
|
-
|
|
1428
|
-
|
|
1460
|
+
function p(v, f) {
|
|
1461
|
+
return v >= f ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
1462
|
+
}
|
|
1463
|
+
return (v, f) => {
|
|
1464
|
+
const V = resolveComponent("FmTextField"), k = resolveComponent("FmTextarea"), y = resolveComponent("FmSelect");
|
|
1429
1465
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
1430
1466
|
createElementVNode("div", null, [
|
|
1431
1467
|
createElementVNode("div", _hoisted_2$h, [
|
|
1432
1468
|
createElementVNode("span", _hoisted_3$e, toDisplayString(unref(o)("connect.campaign.push.title")), 1),
|
|
1433
1469
|
createElementVNode("span", {
|
|
1434
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1470
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", p(e.modelValue.title.length, TITLE_WARN_AT)])
|
|
1435
1471
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT), 3)
|
|
1436
1472
|
]),
|
|
1437
|
-
createVNode(
|
|
1473
|
+
createVNode(V, {
|
|
1438
1474
|
"model-value": e.modelValue.title,
|
|
1439
1475
|
"max-length": TITLE_LIMIT,
|
|
1440
1476
|
placeholder: unref(o)("connect.campaign.push.titlePlaceholder"),
|
|
1441
|
-
"onUpdate:modelValue":
|
|
1477
|
+
"onUpdate:modelValue": f[0] || (f[0] = (g) => a({ title: g }))
|
|
1442
1478
|
}, null, 8, ["model-value", "placeholder"])
|
|
1443
1479
|
]),
|
|
1444
1480
|
createElementVNode("div", null, [
|
|
1445
1481
|
createElementVNode("div", _hoisted_4$d, [
|
|
1446
1482
|
createElementVNode("span", _hoisted_5$b, toDisplayString(unref(o)("connect.campaign.push.body")), 1),
|
|
1447
1483
|
createElementVNode("span", {
|
|
1448
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1484
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", p(e.modelValue.body.length, BODY_WARN_AT)])
|
|
1449
1485
|
}, toDisplayString(e.modelValue.body.length) + " / " + toDisplayString(BODY_LIMIT), 3)
|
|
1450
1486
|
]),
|
|
1451
|
-
createVNode(
|
|
1487
|
+
createVNode(k, {
|
|
1452
1488
|
"model-value": e.modelValue.body,
|
|
1453
1489
|
"max-length": BODY_LIMIT,
|
|
1454
1490
|
placeholder: unref(o)("connect.campaign.push.bodyPlaceholder"),
|
|
1455
|
-
"onUpdate:modelValue":
|
|
1491
|
+
"onUpdate:modelValue": f[1] || (f[1] = (g) => a({ body: g }))
|
|
1456
1492
|
}, null, 8, ["model-value", "placeholder"])
|
|
1457
1493
|
]),
|
|
1458
1494
|
createElementVNode("div", null, [
|
|
1459
1495
|
createElementVNode("div", _hoisted_6$8, toDisplayString(unref(o)("connect.campaign.push.link")), 1),
|
|
1460
1496
|
createVNode(y, {
|
|
1461
1497
|
"model-value": e.modelValue.destination ?? "NONE",
|
|
1462
|
-
items: unref(
|
|
1463
|
-
label: unref(o)(`connect.campaign.appInbox.destination.${
|
|
1464
|
-
value:
|
|
1498
|
+
items: unref(c).map((g) => ({
|
|
1499
|
+
label: unref(o)(`connect.campaign.appInbox.destination.${g}`),
|
|
1500
|
+
value: g
|
|
1465
1501
|
})),
|
|
1466
|
-
"onUpdate:modelValue":
|
|
1502
|
+
"onUpdate:modelValue": f[2] || (f[2] = (g) => r(g))
|
|
1467
1503
|
}, null, 8, ["model-value", "items"]),
|
|
1468
|
-
|
|
1504
|
+
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$7, toDisplayString(unref(o)("connect.campaign.push.linkHelper")), 1)),
|
|
1505
|
+
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_8$6, [
|
|
1506
|
+
createElementVNode("div", _hoisted_9$6, toDisplayString(unref(o)("connect.campaign.push.linkUrl")), 1),
|
|
1507
|
+
createVNode(V, {
|
|
1508
|
+
"model-value": e.modelValue.url ?? "",
|
|
1509
|
+
inputmode: "url",
|
|
1510
|
+
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
1511
|
+
"helper-state": unref(n) ? "error" : "none",
|
|
1512
|
+
"helper-text": unref(n),
|
|
1513
|
+
"onUpdate:modelValue": f[3] || (f[3] = (g) => a({ url: g.trim() || null }))
|
|
1514
|
+
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text"])
|
|
1515
|
+
])) : createCommentVNode("", !0)
|
|
1469
1516
|
])
|
|
1470
1517
|
]);
|
|
1471
1518
|
};
|
|
@@ -1484,41 +1531,41 @@ const _hoisted_1$r = {
|
|
|
1484
1531
|
setup(e) {
|
|
1485
1532
|
const { t: s } = useI18n();
|
|
1486
1533
|
return (o, d) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
1487
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (
|
|
1488
|
-
key:
|
|
1534
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (i) => (openBlock(), createElementBlock("div", {
|
|
1535
|
+
key: i.key,
|
|
1489
1536
|
class: "flex flex-none items-center"
|
|
1490
1537
|
}, [
|
|
1491
|
-
|
|
1538
|
+
i.connector ? (openBlock(), createElementBlock("span", _hoisted_2$g, toDisplayString(i.connector), 1)) : createCommentVNode("", !0),
|
|
1492
1539
|
createElementVNode("button", {
|
|
1493
1540
|
type: "button",
|
|
1494
1541
|
class: normalizeClass([
|
|
1495
1542
|
"min-w-[132px] flex-none rounded-[10px] border px-[14px] py-[10px] text-left transition-colors",
|
|
1496
|
-
e.modelValue ===
|
|
1543
|
+
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
1544
|
]),
|
|
1498
|
-
"aria-current": e.modelValue ===
|
|
1499
|
-
onClick: (
|
|
1545
|
+
"aria-current": e.modelValue === i.key ? "true" : void 0,
|
|
1546
|
+
onClick: (c) => o.$emit("update:model-value", i.key)
|
|
1500
1547
|
}, [
|
|
1501
1548
|
createElementVNode("span", _hoisted_4$c, [
|
|
1502
|
-
|
|
1549
|
+
i.step ? (openBlock(), createElementBlock("span", {
|
|
1503
1550
|
key: 0,
|
|
1504
1551
|
class: normalizeClass([
|
|
1505
1552
|
"flex h-[18px] w-[18px] flex-none items-center justify-center rounded-full text-[10.5px] font-semibold leading-[18px]",
|
|
1506
|
-
e.modelValue ===
|
|
1553
|
+
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
1554
|
])
|
|
1508
|
-
}, toDisplayString(
|
|
1555
|
+
}, toDisplayString(i.step), 3)) : createCommentVNode("", !0),
|
|
1509
1556
|
createElementVNode("span", {
|
|
1510
1557
|
class: normalizeClass([
|
|
1511
1558
|
"truncate text-[12.5px] font-semibold leading-[1.3]",
|
|
1512
|
-
e.modelValue ===
|
|
1559
|
+
e.modelValue === i.key ? "text-fm-color-primary" : "text-fm-color-typo-primary"
|
|
1513
1560
|
])
|
|
1514
|
-
}, toDisplayString(
|
|
1515
|
-
|
|
1561
|
+
}, toDisplayString(i.label), 3),
|
|
1562
|
+
i.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", {
|
|
1516
1563
|
key: 1,
|
|
1517
1564
|
class: "h-[7px] w-[7px] flex-none rounded-full bg-fm-color-system-error-400",
|
|
1518
1565
|
title: unref(s)("connect.campaign.broadcast.messageMissing")
|
|
1519
1566
|
}, null, 8, _hoisted_5$a))
|
|
1520
1567
|
]),
|
|
1521
|
-
createElementVNode("span", _hoisted_6$7, toDisplayString(
|
|
1568
|
+
createElementVNode("span", _hoisted_6$7, toDisplayString(i.sub), 1)
|
|
1522
1569
|
], 10, _hoisted_3$d)
|
|
1523
1570
|
]))), 128))
|
|
1524
1571
|
]));
|
|
@@ -1548,17 +1595,17 @@ const _hoisted_1$r = {
|
|
|
1548
1595
|
setup(e) {
|
|
1549
1596
|
const { t: s } = useI18n(), o = e, d = computed(
|
|
1550
1597
|
() => o.target === "PUSH" ? o.content : void 0
|
|
1551
|
-
), c = computed(
|
|
1552
|
-
() => o.target === "APP_INBOX" ? o.content : void 0
|
|
1553
1598
|
), i = computed(
|
|
1599
|
+
() => o.target === "APP_INBOX" ? o.content : void 0
|
|
1600
|
+
), c = computed(
|
|
1554
1601
|
() => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
|
|
1555
1602
|
), l = computed(() => {
|
|
1556
|
-
var v,
|
|
1557
|
-
const p = (
|
|
1603
|
+
var v, f;
|
|
1604
|
+
const p = (f = (v = c.value) == null ? void 0 : v.content) == null ? void 0 : f.trim();
|
|
1558
1605
|
return p ? o.senderPrefix ? `${o.senderPrefix}${p}` : p : s("connect.campaign.broadcast.preview.emptyText");
|
|
1559
1606
|
}), n = computed(() => {
|
|
1560
1607
|
var v;
|
|
1561
|
-
const p = ((v =
|
|
1608
|
+
const p = ((v = i.value) == null ? void 0 : v.content) ?? "";
|
|
1562
1609
|
return p.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
|
|
1563
1610
|
html,body{margin:0;font:400 12px/1.5 Inter,system-ui,sans-serif;color:#1C1C1E;word-break:break-word}
|
|
1564
1611
|
img{max-width:100%;height:auto}
|
|
@@ -1568,14 +1615,14 @@ const _hoisted_1$r = {
|
|
|
1568
1615
|
weekday: "short",
|
|
1569
1616
|
day: "2-digit",
|
|
1570
1617
|
month: "short"
|
|
1571
|
-
}),
|
|
1618
|
+
}), f = p.toLocaleTimeString(void 0, {
|
|
1572
1619
|
hour: "2-digit",
|
|
1573
1620
|
minute: "2-digit"
|
|
1574
1621
|
});
|
|
1575
|
-
return `${v} · ${
|
|
1622
|
+
return `${v} · ${f}`;
|
|
1576
1623
|
}), 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
1624
|
return (p, v) => {
|
|
1578
|
-
var
|
|
1625
|
+
var f, V, k, y, g, u, m, C, x, $, F;
|
|
1579
1626
|
return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
1580
1627
|
createElementVNode("div", _hoisted_2$f, toDisplayString(unref(s)("connect.campaign.broadcast.preview.title")), 1),
|
|
1581
1628
|
createElementVNode("div", {
|
|
@@ -1595,17 +1642,17 @@ const _hoisted_1$r = {
|
|
|
1595
1642
|
e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$b, [
|
|
1596
1643
|
createElementVNode("div", _hoisted_5$9, toDisplayString(unref(a)), 1),
|
|
1597
1644
|
createElementVNode("div", _hoisted_6$6, [
|
|
1598
|
-
createElementVNode("div", _hoisted_7$6, toDisplayString(((V = (
|
|
1599
|
-
createElementVNode("div", _hoisted_8$5, toDisplayString(((
|
|
1645
|
+
createElementVNode("div", _hoisted_7$6, toDisplayString(((V = (f = unref(d)) == null ? void 0 : f.title) == null ? void 0 : V.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
1646
|
+
createElementVNode("div", _hoisted_8$5, toDisplayString(((y = (k = unref(d)) == null ? void 0 : k.body) == null ? void 0 : y.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyBody")), 1)
|
|
1600
1647
|
])
|
|
1601
1648
|
])) : e.target === "APP_INBOX" ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
1602
1649
|
createElementVNode("div", _hoisted_10$5, toDisplayString(unref(s)("connect.campaign.broadcast.preview.inboxHeading")), 1),
|
|
1603
1650
|
createElementVNode("div", _hoisted_11$3, [
|
|
1604
|
-
createElementVNode("div", _hoisted_12$2, toDisplayString(((u = (g = unref(
|
|
1605
|
-
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (m = unref(
|
|
1606
|
-
(
|
|
1651
|
+
createElementVNode("div", _hoisted_12$2, toDisplayString(((u = (g = unref(i)) == null ? void 0 : g.title) == null ? void 0 : u.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
1652
|
+
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),
|
|
1653
|
+
(x = unref(i)) != null && x.imageUrl ? (openBlock(), createElementBlock("img", {
|
|
1607
1654
|
key: 0,
|
|
1608
|
-
src: unref(
|
|
1655
|
+
src: unref(i).imageUrl,
|
|
1609
1656
|
alt: "",
|
|
1610
1657
|
class: "mt-8 w-full rounded-[8px]"
|
|
1611
1658
|
}, null, 8, _hoisted_14$2)) : createCommentVNode("", !0),
|
|
@@ -1617,11 +1664,11 @@ const _hoisted_1$r = {
|
|
|
1617
1664
|
class: "mt-8 h-[120px] w-full border-0",
|
|
1618
1665
|
title: unref(s)("connect.campaign.broadcast.preview.bodyFrameTitle")
|
|
1619
1666
|
}, null, 8, _hoisted_15$2)) : createCommentVNode("", !0),
|
|
1620
|
-
(
|
|
1621
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1667
|
+
(F = ($ = unref(i)) == null ? void 0 : $.buttons) != null && F.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
1668
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).buttons, (N, D) => (openBlock(), createElementBlock("div", {
|
|
1622
1669
|
key: D,
|
|
1623
1670
|
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(
|
|
1671
|
+
}, toDisplayString(N.label || unref(s)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
|
|
1625
1672
|
])) : createCommentVNode("", !0)
|
|
1626
1673
|
])
|
|
1627
1674
|
])) : (openBlock(), createElementBlock("div", _hoisted_17$1, [
|
|
@@ -1651,7 +1698,7 @@ const _hoisted_1$r = {
|
|
|
1651
1698
|
emits: ["move", "remove", "add"],
|
|
1652
1699
|
setup(e) {
|
|
1653
1700
|
const { t: s } = useI18n(), o = e, d = computed(() => o.addable.length > 0);
|
|
1654
|
-
return (
|
|
1701
|
+
return (i, c) => {
|
|
1655
1702
|
const l = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"), a = resolveComponent("FmMenu");
|
|
1656
1703
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
1657
1704
|
createElementVNode("div", _hoisted_2$e, [
|
|
@@ -1667,7 +1714,7 @@ const _hoisted_1$r = {
|
|
|
1667
1714
|
createElementVNode("span", _hoisted_7$5, [
|
|
1668
1715
|
createElementVNode("span", _hoisted_8$4, toDisplayString(r.label), 1),
|
|
1669
1716
|
r.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
|
|
1670
|
-
|
|
1717
|
+
c[0] || (c[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
|
|
1671
1718
|
createTextVNode(" " + toDisplayString(unref(s)("connect.campaign.broadcast.messageMissing")), 1)
|
|
1672
1719
|
]))
|
|
1673
1720
|
])
|
|
@@ -1681,8 +1728,9 @@ const _hoisted_1$r = {
|
|
|
1681
1728
|
icon: "arrow_upward",
|
|
1682
1729
|
"icon-color": "neutral-gray-400",
|
|
1683
1730
|
variant: "tertiary",
|
|
1684
|
-
|
|
1685
|
-
|
|
1731
|
+
disabled: p === 0,
|
|
1732
|
+
onClick: (v) => i.$emit("move", r.channel, -1)
|
|
1733
|
+
}, null, 8, ["disabled", "onClick"])
|
|
1686
1734
|
], 8, _hoisted_11$2),
|
|
1687
1735
|
createElementVNode("span", {
|
|
1688
1736
|
title: unref(s)("connect.campaign.broadcast.moveDown"),
|
|
@@ -1693,7 +1741,7 @@ const _hoisted_1$r = {
|
|
|
1693
1741
|
"icon-color": "neutral-gray-400",
|
|
1694
1742
|
variant: "tertiary",
|
|
1695
1743
|
disabled: p === e.rows.length - 1,
|
|
1696
|
-
onClick: (v) =>
|
|
1744
|
+
onClick: (v) => i.$emit("move", r.channel, 1)
|
|
1697
1745
|
}, null, 8, ["disabled", "onClick"])
|
|
1698
1746
|
], 8, _hoisted_12$1),
|
|
1699
1747
|
createElementVNode("span", {
|
|
@@ -1704,7 +1752,7 @@ const _hoisted_1$r = {
|
|
|
1704
1752
|
icon: "delete",
|
|
1705
1753
|
"icon-color": "neutral-gray-400",
|
|
1706
1754
|
variant: "tertiary",
|
|
1707
|
-
onClick: (v) =>
|
|
1755
|
+
onClick: (v) => i.$emit("remove", r.channel)
|
|
1708
1756
|
}, null, 8, ["onClick"])
|
|
1709
1757
|
], 8, _hoisted_13$1)
|
|
1710
1758
|
])
|
|
@@ -1720,7 +1768,7 @@ const _hoisted_1$r = {
|
|
|
1720
1768
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (r) => (openBlock(), createBlock(n, {
|
|
1721
1769
|
key: r.channel,
|
|
1722
1770
|
label: r.label,
|
|
1723
|
-
onClick: (p) =>
|
|
1771
|
+
onClick: (p) => i.$emit("add", r.channel)
|
|
1724
1772
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
1725
1773
|
]),
|
|
1726
1774
|
_: 1
|
|
@@ -1734,15 +1782,27 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1734
1782
|
key: 0,
|
|
1735
1783
|
class: "flex items-start gap-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1736
1784
|
}, _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 = {
|
|
1785
|
+
key: 1,
|
|
1786
|
+
class: "h-[8px] w-[8px] rounded-full bg-fm-color-neutral-white"
|
|
1787
|
+
}, _hoisted_15 = {
|
|
1737
1788
|
key: 0,
|
|
1738
1789
|
class: "mt-[3px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1739
|
-
},
|
|
1790
|
+
}, _hoisted_16 = {
|
|
1740
1791
|
key: 1,
|
|
1741
1792
|
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
|
-
},
|
|
1793
|
+
}, _hoisted_17 = {
|
|
1794
|
+
key: 2,
|
|
1795
|
+
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"
|
|
1796
|
+
}, _hoisted_18 = {
|
|
1743
1797
|
key: 0,
|
|
1744
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-
|
|
1745
|
-
},
|
|
1798
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400"
|
|
1799
|
+
}, _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 = {
|
|
1800
|
+
key: 1,
|
|
1801
|
+
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"
|
|
1802
|
+
}, _hoisted_23 = {
|
|
1803
|
+
key: 3,
|
|
1804
|
+
class: "flex flex-wrap items-start gap-24"
|
|
1805
|
+
}, _hoisted_24 = { class: "min-w-0 flex-1 basis-[340px]" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1746
1806
|
__name: "BroadcastDeliveryInput",
|
|
1747
1807
|
props: {
|
|
1748
1808
|
/** Either the new delivery shape or a legacy single-channel message. */
|
|
@@ -1759,13 +1819,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1759
1819
|
default: () => [...DEFAULT_MESSAGE_VARIABLES]
|
|
1760
1820
|
},
|
|
1761
1821
|
helperText: { type: String },
|
|
1822
|
+
/**
|
|
1823
|
+
* False until the merchant tries to proceed. Broadcasts validate on submit,
|
|
1824
|
+
* so incomplete-channel markers stay hidden while the form is being filled.
|
|
1825
|
+
*/
|
|
1826
|
+
showValidation: { type: Boolean, default: !0 },
|
|
1762
1827
|
helperState: { type: String },
|
|
1763
1828
|
placeholder: { type: String }
|
|
1764
1829
|
},
|
|
1765
1830
|
emits: ["update:model-value"],
|
|
1766
1831
|
setup(e, { emit: s }) {
|
|
1767
|
-
const { t: o } = useI18n(), d = useCoreStore(),
|
|
1768
|
-
const h =
|
|
1832
|
+
const { t: o } = useI18n(), d = useCoreStore(), i = useMembershipStore(), c = e, l = s, n = ref(!1), a = ref("SMS"), r = computed(() => {
|
|
1833
|
+
const h = c.modelValue;
|
|
1769
1834
|
return h && "channels" in h ? h : toDelivery({ message: h });
|
|
1770
1835
|
});
|
|
1771
1836
|
function p(h) {
|
|
@@ -1774,7 +1839,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1774
1839
|
function v(h) {
|
|
1775
1840
|
return o(`connect.campaign.broadcast.channel.${h}`);
|
|
1776
1841
|
}
|
|
1777
|
-
const
|
|
1842
|
+
const f = {
|
|
1778
1843
|
SMS: "chat",
|
|
1779
1844
|
WHATSAPP: "chat",
|
|
1780
1845
|
EMAIL: "mail",
|
|
@@ -1782,11 +1847,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1782
1847
|
PUSH: "notifications"
|
|
1783
1848
|
};
|
|
1784
1849
|
function V(h) {
|
|
1785
|
-
return
|
|
1850
|
+
return f[h];
|
|
1786
1851
|
}
|
|
1787
|
-
const
|
|
1788
|
-
() =>
|
|
1789
|
-
(h) =>
|
|
1852
|
+
const k = computed(() => r.value.mode === "fallback"), y = computed(
|
|
1853
|
+
() => c.variables.filter(
|
|
1854
|
+
(h) => c.triggerType == "SCHEDULE" ? !h.startsWith("transaction.") : !0
|
|
1790
1855
|
)
|
|
1791
1856
|
);
|
|
1792
1857
|
function g(h) {
|
|
@@ -1797,112 +1862,127 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1797
1862
|
h !== r.value.mode && p(setMode(r.value, h));
|
|
1798
1863
|
}
|
|
1799
1864
|
const C = ref(null);
|
|
1800
|
-
function
|
|
1801
|
-
var
|
|
1802
|
-
const
|
|
1803
|
-
return
|
|
1865
|
+
function x(h) {
|
|
1866
|
+
var R;
|
|
1867
|
+
const E = (R = C.value) == null ? void 0 : R[h];
|
|
1868
|
+
return E ? new Intl.NumberFormat(void 0, {
|
|
1804
1869
|
style: "currency",
|
|
1805
|
-
currency:
|
|
1806
|
-
minimumFractionDigits:
|
|
1807
|
-
maximumFractionDigits:
|
|
1808
|
-
}).format(
|
|
1870
|
+
currency: E.currency,
|
|
1871
|
+
minimumFractionDigits: E.precision,
|
|
1872
|
+
maximumFractionDigits: E.precision
|
|
1873
|
+
}).format(E.amount / 10 ** E.precision) : null;
|
|
1809
1874
|
}
|
|
1810
1875
|
const $ = computed(
|
|
1811
1876
|
() => CHANNEL_DISPLAY_ORDER.map((h) => {
|
|
1812
|
-
const
|
|
1877
|
+
const E = r.value.channels.includes(h), R = x(h);
|
|
1813
1878
|
return {
|
|
1814
1879
|
channel: h,
|
|
1815
1880
|
label: v(h),
|
|
1816
|
-
selected:
|
|
1881
|
+
selected: E,
|
|
1817
1882
|
available: g(h),
|
|
1818
|
-
rateNote: isPaidChannel(h) ?
|
|
1819
|
-
//
|
|
1820
|
-
//
|
|
1821
|
-
|
|
1883
|
+
rateNote: isPaidChannel(h) ? R ? o("connect.campaign.broadcast.perMessage", { price: R }) : null : o("connect.campaign.broadcast.freeChannel"),
|
|
1884
|
+
// In fallback mode the grid is a radio for the primary channel, so only
|
|
1885
|
+
// the primary reads as checked; a fallback is tagged instead.
|
|
1886
|
+
checked: k.value ? r.value.channels[0] === h : E,
|
|
1887
|
+
usedAsFallback: k.value && r.value.channels.indexOf(h) > 0
|
|
1822
1888
|
};
|
|
1823
1889
|
})
|
|
1824
1890
|
);
|
|
1825
|
-
async function
|
|
1891
|
+
async function F(h) {
|
|
1826
1892
|
if (g(h)) {
|
|
1893
|
+
if (k.value) {
|
|
1894
|
+
await N(h);
|
|
1895
|
+
return;
|
|
1896
|
+
}
|
|
1827
1897
|
if (r.value.channels.includes(h)) {
|
|
1828
|
-
await
|
|
1898
|
+
await D(h);
|
|
1829
1899
|
return;
|
|
1830
1900
|
}
|
|
1831
|
-
p(addChannel(r.value, h,
|
|
1901
|
+
p(addChannel(r.value, h, y.value));
|
|
1832
1902
|
}
|
|
1833
1903
|
}
|
|
1834
|
-
async function
|
|
1835
|
-
|
|
1904
|
+
async function N(h) {
|
|
1905
|
+
const E = r.value.channels[0];
|
|
1906
|
+
E !== h && (E && hasDraft(r.value, E) && !await prompt.remove(
|
|
1907
|
+
o("connect.campaign.broadcast.replaceChannelConfirm", {
|
|
1908
|
+
channel: v(E),
|
|
1909
|
+
next: v(h)
|
|
1910
|
+
})
|
|
1911
|
+
) || (p(setPrimaryChannel(r.value, h, y.value)), a.value = h));
|
|
1912
|
+
}
|
|
1913
|
+
async function D(h) {
|
|
1914
|
+
if (hasDraft(r.value, h) && !await prompt.remove(
|
|
1836
1915
|
o("connect.campaign.broadcast.removeChannelConfirm", {
|
|
1837
1916
|
channel: v(h)
|
|
1838
1917
|
})
|
|
1839
|
-
))
|
|
1840
|
-
|
|
1841
|
-
|
|
1918
|
+
))
|
|
1919
|
+
return;
|
|
1920
|
+
const E = removeChannel(r.value, h);
|
|
1921
|
+
p(E), a.value === h && (a.value = E.channels[0] ?? "SMS");
|
|
1842
1922
|
}
|
|
1843
|
-
function
|
|
1844
|
-
p(moveChannel(r.value, h,
|
|
1923
|
+
function w(h, E) {
|
|
1924
|
+
p(moveChannel(r.value, h, E));
|
|
1845
1925
|
}
|
|
1846
|
-
const
|
|
1847
|
-
() => r.value.channels.slice(1).map((h,
|
|
1926
|
+
const O = computed(
|
|
1927
|
+
() => r.value.channels.slice(1).map((h, E) => ({
|
|
1848
1928
|
channel: h,
|
|
1849
1929
|
label: v(h),
|
|
1850
|
-
position:
|
|
1851
|
-
complete: isChannelComplete(r.value, h)
|
|
1930
|
+
position: E + 2,
|
|
1931
|
+
complete: !c.showValidation || isChannelComplete(r.value, h)
|
|
1852
1932
|
}))
|
|
1853
|
-
),
|
|
1933
|
+
), j = computed(
|
|
1854
1934
|
() => CHANNEL_DISPLAY_ORDER.filter(
|
|
1855
1935
|
(h) => !r.value.channels.includes(h) && g(h)
|
|
1856
1936
|
).map((h) => ({
|
|
1857
1937
|
channel: h,
|
|
1858
1938
|
label: v(h)
|
|
1859
1939
|
}))
|
|
1860
|
-
),
|
|
1861
|
-
() => r.value.channels.map((h,
|
|
1940
|
+
), I = computed(
|
|
1941
|
+
() => r.value.channels.map((h, E) => ({
|
|
1862
1942
|
key: h,
|
|
1863
1943
|
label: v(h),
|
|
1864
|
-
sub:
|
|
1865
|
-
complete: isChannelComplete(r.value, h),
|
|
1866
|
-
step:
|
|
1867
|
-
connector:
|
|
1944
|
+
sub: k.value ? o(E === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached") : o("connect.campaign.broadcast.tab.sendsToEligible"),
|
|
1945
|
+
complete: !c.showValidation || isChannelComplete(r.value, h),
|
|
1946
|
+
step: k.value ? E + 1 : void 0,
|
|
1947
|
+
connector: E === 0 ? void 0 : k.value ? "→" : "+"
|
|
1868
1948
|
}))
|
|
1869
1949
|
);
|
|
1870
1950
|
watchEffect(() => {
|
|
1871
|
-
const h =
|
|
1951
|
+
const h = I.value.map((E) => E.key);
|
|
1872
1952
|
h.length && !h.includes(a.value) && (a.value = h[0]);
|
|
1873
1953
|
});
|
|
1874
|
-
const
|
|
1875
|
-
const h =
|
|
1954
|
+
const H = computed(() => a.value), q = computed(() => {
|
|
1955
|
+
const h = H.value;
|
|
1876
1956
|
if (!(h === "APP_INBOX" || h === "PUSH"))
|
|
1877
1957
|
return r.value.content[h];
|
|
1878
1958
|
}), G = computed(
|
|
1879
1959
|
() => r.value.content.APP_INBOX
|
|
1880
|
-
),
|
|
1960
|
+
), Y = computed(
|
|
1881
1961
|
() => r.value.content.PUSH
|
|
1882
1962
|
);
|
|
1883
|
-
function
|
|
1963
|
+
function Z(h) {
|
|
1884
1964
|
p(setChannelContent(r.value, "APP_INBOX", h));
|
|
1885
1965
|
}
|
|
1886
|
-
function
|
|
1966
|
+
function b(h) {
|
|
1887
1967
|
p(setChannelContent(r.value, "PUSH", h));
|
|
1888
1968
|
}
|
|
1889
|
-
function
|
|
1890
|
-
p(setChannelContent(r.value, h, { ...
|
|
1969
|
+
function B(h, E) {
|
|
1970
|
+
h === "APP_INBOX" || h === "PUSH" || p(setChannelContent(r.value, h, { ...E, channel: h }));
|
|
1891
1971
|
}
|
|
1892
|
-
const
|
|
1972
|
+
const T = computed(
|
|
1893
1973
|
() => r.value.channels.filter(isPaidChannel)
|
|
1894
|
-
),
|
|
1895
|
-
var
|
|
1896
|
-
const h = ((
|
|
1974
|
+
), U = computed(() => {
|
|
1975
|
+
var E, R, M;
|
|
1976
|
+
const h = ((E = i.membership) == null ? void 0 : E.brand) || ((M = (R = d.currentBusiness) == null ? void 0 : R.value) == null ? void 0 : M.name) || "";
|
|
1897
1977
|
return getSmsMessageMetrics({ brandName: h, content: "" }).prefix;
|
|
1898
|
-
}),
|
|
1899
|
-
async function
|
|
1978
|
+
}), P = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
|
|
1979
|
+
async function A() {
|
|
1900
1980
|
try {
|
|
1901
1981
|
const h = await membershipApi.getWhatsappNumbers();
|
|
1902
1982
|
n.value = h.some(
|
|
1903
|
-
(
|
|
1904
|
-
var
|
|
1905
|
-
return (
|
|
1983
|
+
(E) => {
|
|
1984
|
+
var R;
|
|
1985
|
+
return (R = E == null ? void 0 : E.default) == null ? void 0 : R.includes("Marketing");
|
|
1906
1986
|
}
|
|
1907
1987
|
);
|
|
1908
1988
|
} catch (h) {
|
|
@@ -1910,10 +1990,10 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1910
1990
|
}
|
|
1911
1991
|
}
|
|
1912
1992
|
return onMounted(async () => {
|
|
1913
|
-
const h = r.value;
|
|
1914
|
-
h
|
|
1915
|
-
}), (h,
|
|
1916
|
-
const
|
|
1993
|
+
const h = r.value.channels[0];
|
|
1994
|
+
h && (a.value = h), campaignApi.readBroadcastCreditSummary().then((E) => C.value = E.prices).catch(() => C.value = null), await A();
|
|
1995
|
+
}), (h, E) => {
|
|
1996
|
+
const R = resolveComponent("FmIcon"), M = resolveComponent("FmCard");
|
|
1917
1997
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1918
1998
|
createElementVNode("div", _hoisted_2$d, [
|
|
1919
1999
|
createElementVNode("div", null, [
|
|
@@ -1921,19 +2001,19 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1921
2001
|
createElementVNode("div", _hoisted_4$9, toDisplayString(unref(o)("connect.campaign.broadcast.deliveryDescription")), 1)
|
|
1922
2002
|
]),
|
|
1923
2003
|
createElementVNode("div", _hoisted_5$7, [
|
|
1924
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(u, (S) => createVNode(
|
|
2004
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(u, (S) => createVNode(M, {
|
|
1925
2005
|
key: S,
|
|
1926
2006
|
variant: "outlined",
|
|
1927
2007
|
class: normalizeClass(["h-full cursor-pointer select-none p-16 space-y-8", {
|
|
1928
2008
|
"border-fm-color-primary bg-fm-color-system-warning-100": unref(r).mode === S,
|
|
1929
2009
|
"hover:bg-fm-color-opacity-sm": unref(r).mode !== S
|
|
1930
2010
|
}]),
|
|
1931
|
-
onClick: (
|
|
2011
|
+
onClick: (L) => m(S)
|
|
1932
2012
|
}, {
|
|
1933
2013
|
default: withCtx(() => [
|
|
1934
2014
|
createElementVNode("div", _hoisted_6$4, [
|
|
1935
2015
|
createElementVNode("div", _hoisted_7$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${S}.label`)), 1),
|
|
1936
|
-
unref(r).mode === S ? (openBlock(), createBlock(
|
|
2016
|
+
unref(r).mode === S ? (openBlock(), createBlock(R, {
|
|
1937
2017
|
key: 0,
|
|
1938
2018
|
name: "check_circle",
|
|
1939
2019
|
size: "md",
|
|
@@ -1946,7 +2026,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1946
2026
|
}, 1032, ["class", "onClick"])), 64))
|
|
1947
2027
|
]),
|
|
1948
2028
|
unref(r).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
1949
|
-
createVNode(
|
|
2029
|
+
createVNode(R, {
|
|
1950
2030
|
name: "info",
|
|
1951
2031
|
size: "sm",
|
|
1952
2032
|
class: "mt-[2px]"
|
|
@@ -1955,17 +2035,17 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1955
2035
|
])) : createCommentVNode("", !0)
|
|
1956
2036
|
]),
|
|
1957
2037
|
createElementVNode("div", _hoisted_10$3, [
|
|
1958
|
-
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
2038
|
+
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(k) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
1959
2039
|
createElementVNode("div", _hoisted_12, [
|
|
1960
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref($), (S) => (openBlock(), createBlock(
|
|
2040
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref($), (S) => (openBlock(), createBlock(M, {
|
|
1961
2041
|
key: S.channel,
|
|
1962
2042
|
variant: "outlined",
|
|
1963
2043
|
class: normalizeClass(["flex h-full flex-col gap-12 p-16", [
|
|
1964
|
-
S.
|
|
1965
|
-
S.available ?
|
|
2044
|
+
S.checked ? "!border-fm-color-primary bg-fm-color-system-warning-100" : "",
|
|
2045
|
+
S.available ? "cursor-pointer" : "cursor-not-allowed bg-fm-color-neutral-gray-100"
|
|
1966
2046
|
]]),
|
|
1967
2047
|
"aria-disabled": !S.available,
|
|
1968
|
-
onClick: (
|
|
2048
|
+
onClick: (L) => F(S.channel)
|
|
1969
2049
|
}, {
|
|
1970
2050
|
default: withCtx(() => [
|
|
1971
2051
|
createElementVNode("div", _hoisted_13, [
|
|
@@ -1975,97 +2055,101 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1975
2055
|
S.available ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-200 text-fm-color-neutral-gray-400"
|
|
1976
2056
|
])
|
|
1977
2057
|
}, [
|
|
1978
|
-
createVNode(
|
|
2058
|
+
createVNode(R, {
|
|
1979
2059
|
name: V(S.channel),
|
|
1980
2060
|
size: "md"
|
|
1981
2061
|
}, null, 8, ["name"])
|
|
1982
2062
|
], 2),
|
|
1983
2063
|
S.available ? (openBlock(), createElementBlock("span", {
|
|
1984
2064
|
key: 0,
|
|
1985
|
-
class: normalizeClass([
|
|
1986
|
-
|
|
1987
|
-
S.
|
|
1988
|
-
])
|
|
2065
|
+
class: normalizeClass(["flex h-[22px] w-[22px] flex-none items-center justify-center border-2 transition-colors", [
|
|
2066
|
+
unref(k) ? "rounded-full" : "rounded-[4px]",
|
|
2067
|
+
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"
|
|
2068
|
+
]])
|
|
1989
2069
|
}, [
|
|
1990
|
-
S.
|
|
2070
|
+
S.checked && !unref(k) ? (openBlock(), createBlock(R, {
|
|
1991
2071
|
key: 0,
|
|
1992
2072
|
name: "check",
|
|
1993
2073
|
size: "sm"
|
|
1994
|
-
})) : createCommentVNode("", !0)
|
|
2074
|
+
})) : S.checked ? (openBlock(), createElementBlock("span", _hoisted_14)) : createCommentVNode("", !0)
|
|
1995
2075
|
], 2)) : createCommentVNode("", !0)
|
|
1996
2076
|
]),
|
|
1997
2077
|
createElementVNode("div", null, [
|
|
1998
2078
|
createElementVNode("div", {
|
|
1999
2079
|
class: normalizeClass(["fm-typo-en-body-md-600", S.available ? "" : "text-fm-color-typo-disabled"])
|
|
2000
2080
|
}, toDisplayString(S.label), 3),
|
|
2001
|
-
S.available && S.rateNote ? (openBlock(), createElementBlock("div",
|
|
2002
|
-
S.available ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div",
|
|
2081
|
+
S.available && S.rateNote ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(S.rateNote), 1)) : createCommentVNode("", !0),
|
|
2082
|
+
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
2083
|
]),
|
|
2004
2084
|
S.available ? createCommentVNode("", !0) : (openBlock(), createElementBlock("a", {
|
|
2005
2085
|
key: 0,
|
|
2006
|
-
href:
|
|
2086
|
+
href: P,
|
|
2007
2087
|
target: "_blank",
|
|
2008
2088
|
class: "mt-auto fm-typo-en-body-sm-400 text-fm-color-secondary-blueberry underline",
|
|
2009
|
-
onClick:
|
|
2089
|
+
onClick: E[0] || (E[0] = withModifiers(() => {
|
|
2010
2090
|
}, ["stop"]))
|
|
2011
2091
|
}, toDisplayString(unref(o)("connect.campaign.messageInput.manageWhatsappChannel")), 1))
|
|
2012
2092
|
]),
|
|
2013
2093
|
_: 2
|
|
2014
2094
|
}, 1032, ["class", "aria-disabled", "onClick"]))), 128))
|
|
2015
2095
|
]),
|
|
2016
|
-
unref(r).channels.length
|
|
2017
|
-
unref(
|
|
2096
|
+
e.showValidation && !unref(r).channels.length ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
|
|
2097
|
+
unref(k) && unref(r).channels.length ? (openBlock(), createBlock(_sfc_main$h, {
|
|
2018
2098
|
key: 1,
|
|
2019
|
-
rows: unref(
|
|
2020
|
-
addable: unref(
|
|
2021
|
-
onMove:
|
|
2022
|
-
onRemove:
|
|
2023
|
-
onAdd:
|
|
2099
|
+
rows: unref(O),
|
|
2100
|
+
addable: unref(j),
|
|
2101
|
+
onMove: w,
|
|
2102
|
+
onRemove: D,
|
|
2103
|
+
onAdd: E[1] || (E[1] = (S) => p(unref(addChannel)(unref(r), S, unref(y))))
|
|
2024
2104
|
}, null, 8, ["rows", "addable"])) : createCommentVNode("", !0)
|
|
2025
2105
|
]),
|
|
2026
|
-
createElementVNode("div",
|
|
2106
|
+
createElementVNode("div", _hoisted_19, [
|
|
2027
2107
|
createElementVNode("div", null, [
|
|
2028
|
-
createElementVNode("div",
|
|
2029
|
-
createElementVNode("div",
|
|
2108
|
+
createElementVNode("div", _hoisted_20, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
|
|
2109
|
+
createElementVNode("div", _hoisted_21, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
|
|
2030
2110
|
]),
|
|
2031
|
-
unref(
|
|
2111
|
+
unref(T).length ? (openBlock(), createBlock(_sfc_main$w, {
|
|
2032
2112
|
key: 0,
|
|
2033
|
-
channels: unref(
|
|
2113
|
+
channels: unref(T)
|
|
2034
2114
|
}, null, 8, ["channels"])) : createCommentVNode("", !0),
|
|
2035
|
-
|
|
2115
|
+
unref(r).channels.length ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_22, toDisplayString(unref(o)("connect.campaign.broadcast.noChannelContent")), 1)),
|
|
2116
|
+
unref(r).channels.length ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2117
|
+
key: 2,
|
|
2036
2118
|
modelValue: unref(a),
|
|
2037
|
-
"onUpdate:modelValue":
|
|
2038
|
-
tabs: unref(
|
|
2039
|
-
}, null, 8, ["modelValue", "tabs"]),
|
|
2040
|
-
|
|
2041
|
-
createElementVNode("div",
|
|
2042
|
-
unref(a) === "PUSH" && unref(
|
|
2119
|
+
"onUpdate:modelValue": E[2] || (E[2] = (S) => isRef(a) ? a.value = S : null),
|
|
2120
|
+
tabs: unref(I)
|
|
2121
|
+
}, null, 8, ["modelValue", "tabs"])) : createCommentVNode("", !0),
|
|
2122
|
+
unref(r).channels.includes(unref(a)) ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
2123
|
+
createElementVNode("div", _hoisted_24, [
|
|
2124
|
+
unref(a) === "PUSH" && unref(Y) ? (openBlock(), createBlock(_sfc_main$k, {
|
|
2043
2125
|
key: 0,
|
|
2044
|
-
"model-value": unref(
|
|
2045
|
-
"
|
|
2046
|
-
|
|
2126
|
+
"model-value": unref(Y),
|
|
2127
|
+
"show-validation": e.showValidation,
|
|
2128
|
+
"onUpdate:modelValue": b
|
|
2129
|
+
}, null, 8, ["model-value", "show-validation"])) : unref(a) === "APP_INBOX" && unref(G) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
2047
2130
|
key: 1,
|
|
2048
2131
|
"model-value": unref(G),
|
|
2049
|
-
variables: unref(
|
|
2050
|
-
"
|
|
2051
|
-
|
|
2132
|
+
variables: unref(y),
|
|
2133
|
+
"show-validation": e.showValidation,
|
|
2134
|
+
"onUpdate:modelValue": Z
|
|
2135
|
+
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(a) !== "APP_INBOX" && unref(a) !== "PUSH" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2052
2136
|
key: unref(a),
|
|
2053
|
-
"model-value": unref(
|
|
2137
|
+
"model-value": unref(q),
|
|
2054
2138
|
"allow-email": !1,
|
|
2055
2139
|
"allow-whatsapp": !1,
|
|
2056
2140
|
"hide-credit-card": !0,
|
|
2057
2141
|
"trigger-type": e.triggerType,
|
|
2058
|
-
variables: unref(
|
|
2142
|
+
variables: unref(y),
|
|
2059
2143
|
placeholder: e.placeholder,
|
|
2060
|
-
"onUpdate:modelValue":
|
|
2144
|
+
"onUpdate:modelValue": E[3] || (E[3] = (S) => B(unref(H), S))
|
|
2061
2145
|
}, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
|
|
2062
2146
|
]),
|
|
2063
2147
|
createVNode(_sfc_main$i, {
|
|
2064
2148
|
target: unref(a),
|
|
2065
|
-
content: unref(r).content[unref(
|
|
2066
|
-
"sender-prefix": unref(
|
|
2149
|
+
content: unref(r).content[unref(H)],
|
|
2150
|
+
"sender-prefix": unref(U)
|
|
2067
2151
|
}, null, 8, ["target", "content", "sender-prefix"])
|
|
2068
|
-
])
|
|
2152
|
+
])) : createCommentVNode("", !0)
|
|
2069
2153
|
])
|
|
2070
2154
|
]);
|
|
2071
2155
|
};
|
|
@@ -2089,8 +2173,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2089
2173
|
},
|
|
2090
2174
|
emits: ["update:model-value"],
|
|
2091
2175
|
setup(e, { emit: s }) {
|
|
2092
|
-
const { t: o } = useI18n(), d = e,
|
|
2093
|
-
() => CountryTimezone[
|
|
2176
|
+
const { t: o } = useI18n(), d = e, i = s, c = useCoreStore(), l = computed(
|
|
2177
|
+
() => CountryTimezone[c.currentCountry.value || "MY"]
|
|
2094
2178
|
);
|
|
2095
2179
|
function n() {
|
|
2096
2180
|
const u = RuleBuilder.getRules(d.modelValue);
|
|
@@ -2101,11 +2185,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2101
2185
|
const a = ref(n()), r = ref(!1), p = ref(!1), v = computed(() => [
|
|
2102
2186
|
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
2103
2187
|
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
2104
|
-
]),
|
|
2188
|
+
]), f = computed(() => {
|
|
2105
2189
|
const u = RuleBuilder.getRules(d.modelValue), m = u.find(
|
|
2106
|
-
(
|
|
2190
|
+
(x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.date"
|
|
2107
2191
|
), C = u.find(
|
|
2108
|
-
(
|
|
2192
|
+
(x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.time"
|
|
2109
2193
|
);
|
|
2110
2194
|
return {
|
|
2111
2195
|
date: m ? RuleBuilder.simplify(m).equator : null,
|
|
@@ -2119,8 +2203,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2119
2203
|
d.endDate ? new Date(d.endDate) : void 0
|
|
2120
2204
|
)
|
|
2121
2205
|
);
|
|
2122
|
-
function
|
|
2123
|
-
|
|
2206
|
+
function k(u, m) {
|
|
2207
|
+
i(
|
|
2124
2208
|
"update:model-value",
|
|
2125
2209
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2126
2210
|
RuleBuilder.constructEntry("trigger.date", "_rrule", u),
|
|
@@ -2131,18 +2215,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2131
2215
|
watch(
|
|
2132
2216
|
() => d.startDate,
|
|
2133
2217
|
(u, m) => {
|
|
2134
|
-
if (!u || u === m || a.value !== "repeating" || !
|
|
2135
|
-
const C = RRule.fromString(
|
|
2218
|
+
if (!u || u === m || a.value !== "repeating" || !f.value.date) return;
|
|
2219
|
+
const C = RRule.fromString(f.value.date), x = new RRule({
|
|
2136
2220
|
...C.origOptions,
|
|
2137
2221
|
dtstart: new Date(u)
|
|
2138
2222
|
}).toString();
|
|
2139
|
-
|
|
2223
|
+
x !== f.value.date && (k(x, f.value.time), p.value = !0);
|
|
2140
2224
|
}
|
|
2141
2225
|
);
|
|
2142
|
-
function
|
|
2226
|
+
function y(u) {
|
|
2143
2227
|
const m = u.value, C = getRruleAnchorDate({
|
|
2144
2228
|
startDate: d.startDate ? new Date(d.startDate) : void 0
|
|
2145
|
-
}),
|
|
2229
|
+
}), x = m == "fixed" ? [
|
|
2146
2230
|
RuleBuilder.constructEntry(
|
|
2147
2231
|
"trigger.date",
|
|
2148
2232
|
"_isOnDate",
|
|
@@ -2165,16 +2249,16 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2165
2249
|
),
|
|
2166
2250
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
2167
2251
|
];
|
|
2168
|
-
|
|
2252
|
+
i(
|
|
2169
2253
|
"update:model-value",
|
|
2170
2254
|
RuleBuilder.setRuleToGroup(
|
|
2171
2255
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2172
|
-
|
|
2256
|
+
x
|
|
2173
2257
|
)
|
|
2174
2258
|
), a.value = m, p.value = !1;
|
|
2175
2259
|
}
|
|
2176
2260
|
function g(u) {
|
|
2177
|
-
a.value == "fixed" ?
|
|
2261
|
+
a.value == "fixed" ? i(
|
|
2178
2262
|
"update:model-value",
|
|
2179
2263
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2180
2264
|
RuleBuilder.constructEntry(
|
|
@@ -2188,33 +2272,33 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2188
2272
|
u.time
|
|
2189
2273
|
)
|
|
2190
2274
|
])
|
|
2191
|
-
) :
|
|
2275
|
+
) : k(u.date, u.time), p.value = !1;
|
|
2192
2276
|
}
|
|
2193
2277
|
return (u, m) => {
|
|
2194
|
-
const C = resolveComponent("FmButtonGroup"),
|
|
2278
|
+
const C = resolveComponent("FmButtonGroup"), x = resolveComponent("FmTimePicker"), $ = resolveComponent("FmIcon"), F = resolveComponent("FmTooltip"), N = resolveComponent("FmField"), D = resolveComponent("FmCard"), w = resolveComponent("FmPopover"), O = resolveComponent("FmDatePicker"), j = resolveComponent("FmHelperText");
|
|
2195
2279
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2196
2280
|
createVNode(C, {
|
|
2197
2281
|
items: unref(v),
|
|
2198
2282
|
"model-value": unref(v).find((I) => I.value === unref(a)) ?? null,
|
|
2199
|
-
"onUpdate:modelValue":
|
|
2283
|
+
"onUpdate:modelValue": y,
|
|
2200
2284
|
class: "mb-8"
|
|
2201
2285
|
}, null, 8, ["items", "model-value"]),
|
|
2202
2286
|
createElementVNode("div", _hoisted_1$f, [
|
|
2203
2287
|
createElementVNode("div", _hoisted_2$c, [
|
|
2204
|
-
createVNode(
|
|
2288
|
+
createVNode(x, {
|
|
2205
2289
|
label: unref(o)("connect.template.rule.schedule.notify_time"),
|
|
2206
|
-
"model-value": unref(
|
|
2207
|
-
"onUpdate:modelValue": m[0] || (m[0] = (I) => g({ date: unref(
|
|
2208
|
-
"helper-text": unref(
|
|
2209
|
-
"helper-state": unref(
|
|
2290
|
+
"model-value": unref(f).time,
|
|
2291
|
+
"onUpdate:modelValue": m[0] || (m[0] = (I) => g({ date: unref(f).date, time: I })),
|
|
2292
|
+
"helper-text": unref(f).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
|
|
2293
|
+
"helper-state": unref(f).time ? void 0 : "error"
|
|
2210
2294
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
2211
2295
|
unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
2212
2296
|
createElementVNode("div", _hoisted_4$8, [
|
|
2213
2297
|
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
2214
|
-
unref(
|
|
2298
|
+
unref(f).date ? (openBlock(), createBlock(F, {
|
|
2215
2299
|
key: 0,
|
|
2216
2300
|
"z-index": 9999,
|
|
2217
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
2301
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(f).date).options)
|
|
2218
2302
|
}, {
|
|
2219
2303
|
default: withCtx(() => [
|
|
2220
2304
|
createVNode($, {
|
|
@@ -2231,13 +2315,13 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2231
2315
|
onPopoverChanged: m[3] || (m[3] = (I) => r.value = I)
|
|
2232
2316
|
}, {
|
|
2233
2317
|
"popover-button": withCtx(() => [
|
|
2234
|
-
createVNode(
|
|
2318
|
+
createVNode(N, {
|
|
2235
2319
|
class: "cursor-pointer",
|
|
2236
|
-
"helper-text": unref(
|
|
2237
|
-
"helper-state": unref(
|
|
2320
|
+
"helper-text": unref(f).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2321
|
+
"helper-state": unref(f).date ? void 0 : "error"
|
|
2238
2322
|
}, {
|
|
2239
2323
|
default: withCtx(() => [
|
|
2240
|
-
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(
|
|
2324
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(f).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(f).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
|
|
2241
2325
|
]),
|
|
2242
2326
|
_: 1
|
|
2243
2327
|
}, 8, ["helper-text", "helper-state"])
|
|
@@ -2247,10 +2331,10 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2247
2331
|
default: withCtx(() => [
|
|
2248
2332
|
createVNode(_sfc_main$y, {
|
|
2249
2333
|
"apply-button": !0,
|
|
2250
|
-
"model-value": unref(
|
|
2334
|
+
"model-value": unref(f).date || "",
|
|
2251
2335
|
"start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
|
|
2252
2336
|
onCancel: m[1] || (m[1] = (I) => r.value = !1),
|
|
2253
|
-
"onUpdate:modelValue": m[2] || (m[2] = (I) => (g({ date: I, time: unref(
|
|
2337
|
+
"onUpdate:modelValue": m[2] || (m[2] = (I) => (g({ date: I, time: unref(f).time }), r.value = !1))
|
|
2254
2338
|
}, null, 8, ["model-value", "start-date"])
|
|
2255
2339
|
]),
|
|
2256
2340
|
_: 1
|
|
@@ -2261,18 +2345,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2261
2345
|
])) : (openBlock(), createBlock(O, {
|
|
2262
2346
|
key: 1,
|
|
2263
2347
|
label: unref(o)("connect.template.rule.schedule.notify_date"),
|
|
2264
|
-
"model-value": unref(
|
|
2265
|
-
"onUpdate:modelValue": m[4] || (m[4] = (I) => g({ date: I, time: unref(
|
|
2266
|
-
"helper-text": unref(
|
|
2267
|
-
"helper-state": unref(
|
|
2348
|
+
"model-value": unref(f).date || "",
|
|
2349
|
+
"onUpdate:modelValue": m[4] || (m[4] = (I) => g({ date: I, time: unref(f).time })),
|
|
2350
|
+
"helper-text": unref(f).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2351
|
+
"helper-state": unref(f).date ? void 0 : "error"
|
|
2268
2352
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
2269
2353
|
]),
|
|
2270
|
-
unref(
|
|
2354
|
+
unref(f).date && unref(f).time && unref(V) ? (openBlock(), createBlock(j, {
|
|
2271
2355
|
key: 0,
|
|
2272
2356
|
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
2357
|
${unref(moment)(unref(V)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(V)).fromNow()})`
|
|
2274
2358
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2275
|
-
unref(p) ? (openBlock(), createBlock(
|
|
2359
|
+
unref(p) ? (openBlock(), createBlock(j, {
|
|
2276
2360
|
key: 1,
|
|
2277
2361
|
text: "Repeating schedule was updated to stay anchored to the campaign start date.",
|
|
2278
2362
|
state: "warning"
|
|
@@ -2290,7 +2374,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2290
2374
|
},
|
|
2291
2375
|
emits: ["update:model-value"],
|
|
2292
2376
|
setup(e, { emit: s }) {
|
|
2293
|
-
const { t: o } = useI18n(), d = e,
|
|
2377
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(
|
|
2294
2378
|
() => [
|
|
2295
2379
|
{
|
|
2296
2380
|
label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -2311,15 +2395,15 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2311
2395
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
2312
2396
|
createElementVNode("div", _hoisted_2$b, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2313
2397
|
createElementVNode("div", _hoisted_3$8, [
|
|
2314
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2398
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
|
|
2315
2399
|
variant: "outlined",
|
|
2316
2400
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2317
|
-
"col-span-2": unref(
|
|
2401
|
+
"col-span-2": unref(c).length == 1,
|
|
2318
2402
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
2319
2403
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
2320
2404
|
}]),
|
|
2321
2405
|
onClick: () => {
|
|
2322
|
-
d.modelValue != r.value &&
|
|
2406
|
+
d.modelValue != r.value && i("update:model-value", r.value);
|
|
2323
2407
|
},
|
|
2324
2408
|
key: r.value
|
|
2325
2409
|
}, {
|
|
@@ -2340,28 +2424,28 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2340
2424
|
__name: "EditRewardPoolSheet",
|
|
2341
2425
|
emits: ["update:model-value"],
|
|
2342
2426
|
setup(e, { expose: s, emit: o }) {
|
|
2343
|
-
const d = useMembershipStore(), { minor:
|
|
2344
|
-
var
|
|
2345
|
-
return ((
|
|
2427
|
+
const d = useMembershipStore(), { minor: i } = useLoading, c = ref(!1), l = ref(), n = ref(), a = ref(0), r = computed(() => {
|
|
2428
|
+
var y;
|
|
2429
|
+
return ((y = d.loyaltyRewards.items.find(
|
|
2346
2430
|
(g) => {
|
|
2347
2431
|
var u;
|
|
2348
2432
|
return g.value === ((u = l.value) == null ? void 0 : u.collectible);
|
|
2349
2433
|
}
|
|
2350
|
-
)) == null ? void 0 :
|
|
2434
|
+
)) == null ? void 0 : y.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
2351
2435
|
}), p = computed(() => {
|
|
2352
|
-
const
|
|
2353
|
-
return
|
|
2436
|
+
const k = r.value.safeParse(l.value);
|
|
2437
|
+
return k.success ? [] : k.error.errors;
|
|
2354
2438
|
});
|
|
2355
|
-
function v(
|
|
2356
|
-
|
|
2439
|
+
function v(k, y, g) {
|
|
2440
|
+
k && (l.value = y, a.value = g), c.value = k;
|
|
2357
2441
|
}
|
|
2358
|
-
const
|
|
2442
|
+
const f = o;
|
|
2359
2443
|
async function V() {
|
|
2360
|
-
const
|
|
2361
|
-
|
|
2444
|
+
const k = r.value.safeParse(l.value);
|
|
2445
|
+
k.success && (await i(
|
|
2362
2446
|
async () => {
|
|
2363
|
-
|
|
2364
|
-
|
|
2447
|
+
k.data.type === "VOUCHER" && n.value && (k.data.collectibleConfig.image = await firebaseStorage.update(
|
|
2448
|
+
k.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
2365
2449
|
n.value
|
|
2366
2450
|
));
|
|
2367
2451
|
},
|
|
@@ -2369,18 +2453,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2369
2453
|
message: "Uploading reward image",
|
|
2370
2454
|
successMessage: "Reward image updated"
|
|
2371
2455
|
}
|
|
2372
|
-
),
|
|
2456
|
+
), f("update:model-value", k.data, a.value));
|
|
2373
2457
|
}
|
|
2374
2458
|
return s({
|
|
2375
2459
|
showSheet: v
|
|
2376
|
-
}), (
|
|
2460
|
+
}), (k, y) => {
|
|
2377
2461
|
const g = resolveComponent("FmSelect"), u = resolveComponent("FmStepperField"), m = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
2378
2462
|
return openBlock(), createBlock(C, {
|
|
2379
2463
|
"max-width": 560,
|
|
2380
|
-
modelValue: unref(
|
|
2464
|
+
modelValue: unref(c),
|
|
2381
2465
|
"onUpdate:modelValue": [
|
|
2382
|
-
|
|
2383
|
-
|
|
2466
|
+
y[9] || (y[9] = (x) => isRef(c) ? c.value = x : null),
|
|
2467
|
+
y[10] || (y[10] = (x) => c.value = x)
|
|
2384
2468
|
],
|
|
2385
2469
|
header: "Edit reward",
|
|
2386
2470
|
"dismiss-away": ""
|
|
@@ -2392,18 +2476,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2392
2476
|
type: "button",
|
|
2393
2477
|
disabled: unref(p).length > 0,
|
|
2394
2478
|
label: "Confirm",
|
|
2395
|
-
onClick:
|
|
2479
|
+
onClick: y[7] || (y[7] = (x) => V())
|
|
2396
2480
|
}, null, 8, ["disabled"]),
|
|
2397
2481
|
createVNode(m, {
|
|
2398
2482
|
variant: "secondary",
|
|
2399
2483
|
type: "button",
|
|
2400
2484
|
label: "Cancel",
|
|
2401
|
-
onClick:
|
|
2485
|
+
onClick: y[8] || (y[8] = (x) => c.value = !1)
|
|
2402
2486
|
})
|
|
2403
2487
|
])
|
|
2404
2488
|
]),
|
|
2405
2489
|
default: withCtx(() => {
|
|
2406
|
-
var
|
|
2490
|
+
var x, $, F;
|
|
2407
2491
|
return [
|
|
2408
2492
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
2409
2493
|
createVNode(g, {
|
|
@@ -2414,12 +2498,12 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2414
2498
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2415
2499
|
],
|
|
2416
2500
|
"model-value": unref(l).type,
|
|
2417
|
-
"onUpdate:modelValue":
|
|
2418
|
-
|
|
2501
|
+
"onUpdate:modelValue": y[0] || (y[0] = (N) => {
|
|
2502
|
+
N == "NO_REWARD" ? l.value = {
|
|
2419
2503
|
type: "NO_REWARD",
|
|
2420
2504
|
collectible: null,
|
|
2421
2505
|
weight: 1
|
|
2422
|
-
} :
|
|
2506
|
+
} : N === "VOUCHER" ? l.value = {
|
|
2423
2507
|
collectible: null,
|
|
2424
2508
|
type: "VOUCHER",
|
|
2425
2509
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -2453,25 +2537,25 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2453
2537
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
2454
2538
|
items: unref(d).loyaltyRewards.items,
|
|
2455
2539
|
"model-value": unref(l).collectible,
|
|
2456
|
-
"onUpdate:modelValue":
|
|
2540
|
+
"onUpdate:modelValue": y[1] || (y[1] = (N) => unref(l).collectible = N)
|
|
2457
2541
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2458
2542
|
createVNode(u, {
|
|
2459
2543
|
label: "Weight",
|
|
2460
2544
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
|
|
2461
2545
|
"model-value": unref(l).weight,
|
|
2462
|
-
"onUpdate:modelValue":
|
|
2546
|
+
"onUpdate:modelValue": y[2] || (y[2] = (N) => l.value = {
|
|
2463
2547
|
...unref(l),
|
|
2464
|
-
weight:
|
|
2548
|
+
weight: N
|
|
2465
2549
|
})
|
|
2466
2550
|
}, null, 8, ["rules", "model-value"]),
|
|
2467
2551
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2468
|
-
((
|
|
2469
|
-
(
|
|
2552
|
+
((x = unref(d).loyaltyRewards.items.find(
|
|
2553
|
+
(N) => {
|
|
2470
2554
|
var D;
|
|
2471
|
-
return
|
|
2555
|
+
return N.value === ((D = unref(l)) == null ? void 0 : D.collectible);
|
|
2472
2556
|
}
|
|
2473
|
-
)) == null ? void 0 :
|
|
2474
|
-
|
|
2557
|
+
)) == null ? void 0 : x.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2558
|
+
y[11] || (y[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
2475
2559
|
createVNode(_sfc_main$z, {
|
|
2476
2560
|
class: "mt-[-8px]",
|
|
2477
2561
|
rules: [
|
|
@@ -2481,39 +2565,39 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2481
2565
|
"error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
|
|
2482
2566
|
"fixed-type": !0,
|
|
2483
2567
|
"model-value": unref(l).earningOption,
|
|
2484
|
-
"onUpdate:modelValue":
|
|
2568
|
+
"onUpdate:modelValue": y[3] || (y[3] = (N) => l.value = {
|
|
2485
2569
|
...unref(l),
|
|
2486
|
-
earningOption:
|
|
2570
|
+
earningOption: N
|
|
2487
2571
|
})
|
|
2488
2572
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
2489
2573
|
], 64)) : createCommentVNode("", !0),
|
|
2490
|
-
|
|
2574
|
+
y[12] || (y[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
2491
2575
|
createVNode(_sfc_main$A, {
|
|
2492
2576
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
2493
2577
|
"for-credit": unref(l).type === "LOYALTY" && (($ = unref(d).loyaltyRewards.items.find(
|
|
2494
|
-
(
|
|
2578
|
+
(N) => {
|
|
2495
2579
|
var D;
|
|
2496
|
-
return
|
|
2580
|
+
return N.value === ((D = unref(l)) == null ? void 0 : D.collectible);
|
|
2497
2581
|
}
|
|
2498
2582
|
)) == null ? void 0 : $.raw.type) === "CREDIT",
|
|
2499
2583
|
class: "!gap-24",
|
|
2500
2584
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
|
|
2501
2585
|
"model-value": unref(l).validityOption,
|
|
2502
|
-
"onUpdate:modelValue":
|
|
2586
|
+
"onUpdate:modelValue": y[4] || (y[4] = (N) => l.value = {
|
|
2503
2587
|
...unref(l),
|
|
2504
|
-
validityOption:
|
|
2588
|
+
validityOption: N
|
|
2505
2589
|
})
|
|
2506
2590
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2507
2591
|
], 64)) : createCommentVNode("", !0),
|
|
2508
2592
|
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
|
|
2509
2593
|
key: 2,
|
|
2510
2594
|
"reward-image": unref(n),
|
|
2511
|
-
"model-value": ((
|
|
2512
|
-
"onUpdate:modelValue":
|
|
2595
|
+
"model-value": ((F = unref(l)) == null ? void 0 : F.collectibleConfig) ?? void 0,
|
|
2596
|
+
"onUpdate:modelValue": y[5] || (y[5] = (N) => l.value = {
|
|
2513
2597
|
...unref(l),
|
|
2514
|
-
collectibleConfig:
|
|
2598
|
+
collectibleConfig: N
|
|
2515
2599
|
}),
|
|
2516
|
-
"onUpdate:rewardImage":
|
|
2600
|
+
"onUpdate:rewardImage": y[6] || (y[6] = (N) => n.value = N)
|
|
2517
2601
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2518
2602
|
createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
|
|
2519
2603
|
])) : createCommentVNode("", !0)
|
|
@@ -2543,36 +2627,36 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2543
2627
|
},
|
|
2544
2628
|
emits: ["update:model-value"],
|
|
2545
2629
|
setup(e, { emit: s }) {
|
|
2546
|
-
const o = e, d = s,
|
|
2547
|
-
const
|
|
2548
|
-
return
|
|
2630
|
+
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(() => {
|
|
2631
|
+
const y = l.safeParse(n.value);
|
|
2632
|
+
return y.success ? [] : y.error.errors;
|
|
2549
2633
|
}), r = ref();
|
|
2550
|
-
function p(
|
|
2634
|
+
function p(y, g) {
|
|
2551
2635
|
var m;
|
|
2552
2636
|
const u = [...n.value];
|
|
2553
|
-
u[g] =
|
|
2637
|
+
u[g] = y, (m = r.value) == null || m.showSheet(!1), d("update:model-value", u);
|
|
2554
2638
|
}
|
|
2555
|
-
function v(
|
|
2556
|
-
const g =
|
|
2557
|
-
(C) => C._id.toString() ==
|
|
2558
|
-
), u = CollectionUtils.formattedType((g == null ? void 0 : g.name) || ""), m =
|
|
2639
|
+
function v(y) {
|
|
2640
|
+
const g = y.type == "VOUCHER" ? y.collectibleConfig : i.collectibles.find(
|
|
2641
|
+
(C) => C._id.toString() == y.collectible
|
|
2642
|
+
), u = CollectionUtils.formattedType((g == null ? void 0 : g.name) || ""), m = y.weight;
|
|
2559
2643
|
return {
|
|
2560
2644
|
label: isNullOrEmpty(u) ? "NO REWARD" : u,
|
|
2561
|
-
sublabel: `${m} (${(m / n.value.reduce((C,
|
|
2645
|
+
sublabel: `${m} (${(m / n.value.reduce((C, x) => C + x.weight, 0) * 100).toFixed(2)}%)`
|
|
2562
2646
|
};
|
|
2563
2647
|
}
|
|
2564
|
-
function y
|
|
2648
|
+
function f(y) {
|
|
2565
2649
|
var u;
|
|
2566
2650
|
const g = [...n.value];
|
|
2567
|
-
(u = r.value) == null || u.showSheet(!0, g[
|
|
2651
|
+
(u = r.value) == null || u.showSheet(!0, g[y], y);
|
|
2568
2652
|
}
|
|
2569
|
-
function V(
|
|
2653
|
+
function V(y) {
|
|
2570
2654
|
const g = [...n.value];
|
|
2571
|
-
g.splice(
|
|
2655
|
+
g.splice(y, 1), d("update:model-value", g);
|
|
2572
2656
|
}
|
|
2573
|
-
function
|
|
2574
|
-
var
|
|
2575
|
-
(
|
|
2657
|
+
function k() {
|
|
2658
|
+
var y;
|
|
2659
|
+
(y = r.value) == null || y.showSheet(
|
|
2576
2660
|
!0,
|
|
2577
2661
|
{
|
|
2578
2662
|
type: "NO_REWARD",
|
|
@@ -2582,41 +2666,41 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2582
2666
|
n.value.length
|
|
2583
2667
|
);
|
|
2584
2668
|
}
|
|
2585
|
-
return (
|
|
2669
|
+
return (y, g) => {
|
|
2586
2670
|
const u = resolveComponent("FmButton"), m = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2587
2671
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2588
|
-
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(
|
|
2672
|
+
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(c)("connect.template.configure_reward_type")), 1),
|
|
2589
2673
|
createVNode(u, {
|
|
2590
|
-
label: unref(
|
|
2591
|
-
onClick: g[0] || (g[0] = (
|
|
2674
|
+
label: unref(c)("connect.campaign.rewardPool.addReward"),
|
|
2675
|
+
onClick: g[0] || (g[0] = (x) => k()),
|
|
2592
2676
|
variant: "plain",
|
|
2593
2677
|
icon: "add"
|
|
2594
2678
|
}, null, 8, ["label"]),
|
|
2595
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (
|
|
2679
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (x, $) => (openBlock(), createBlock(m, {
|
|
2596
2680
|
key: $,
|
|
2597
2681
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2598
2682
|
variant: "outlined",
|
|
2599
|
-
onClick: (
|
|
2683
|
+
onClick: (F) => f($)
|
|
2600
2684
|
}, {
|
|
2601
2685
|
default: withCtx(() => {
|
|
2602
|
-
var
|
|
2686
|
+
var F;
|
|
2603
2687
|
return [
|
|
2604
2688
|
createElementVNode("div", null, [
|
|
2605
|
-
createElementVNode("div", _hoisted_3$7, toDisplayString(
|
|
2606
|
-
createElementVNode("div", _hoisted_4$6, toDisplayString(v(
|
|
2689
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(x.type == "LOYALTY" ? (F = x == null ? void 0 : x.earningOption) == null ? void 0 : F.amount : "") + " " + toDisplayString(v(x).label), 1),
|
|
2690
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(v(x).sublabel), 1)
|
|
2607
2691
|
]),
|
|
2608
2692
|
createVNode(u, {
|
|
2609
2693
|
icon: "delete",
|
|
2610
2694
|
variant: "tertiary",
|
|
2611
|
-
onClick: (
|
|
2695
|
+
onClick: (N) => (N.stopPropagation(), V($))
|
|
2612
2696
|
}, null, 8, ["onClick"])
|
|
2613
2697
|
];
|
|
2614
2698
|
}),
|
|
2615
2699
|
_: 2
|
|
2616
2700
|
}, 1032, ["onClick"]))), 128)),
|
|
2617
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((
|
|
2618
|
-
key:
|
|
2619
|
-
text:
|
|
2701
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(C, {
|
|
2702
|
+
key: x.message,
|
|
2703
|
+
text: x.message,
|
|
2620
2704
|
state: "error"
|
|
2621
2705
|
}, null, 8, ["text"]))), 128)),
|
|
2622
2706
|
createVNode(_sfc_main$d, {
|
|
@@ -2639,7 +2723,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2639
2723
|
},
|
|
2640
2724
|
emits: ["update:model-value"],
|
|
2641
2725
|
setup(e, { emit: s }) {
|
|
2642
|
-
const { t: o } = useI18n(), d = e,
|
|
2726
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(() => [
|
|
2643
2727
|
{
|
|
2644
2728
|
label: o("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
2645
2729
|
description: o("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -2647,33 +2731,33 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2647
2731
|
}
|
|
2648
2732
|
]);
|
|
2649
2733
|
return (l, n) => {
|
|
2650
|
-
var v,
|
|
2734
|
+
var v, f, V;
|
|
2651
2735
|
const a = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
|
|
2652
2736
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
2653
2737
|
createVNode(a, {
|
|
2654
2738
|
label: unref(o)("connect.template.promotion_game.enable"),
|
|
2655
2739
|
"model-value": !!((v = e.modelValue) != null && v.gameType),
|
|
2656
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
2740
|
+
"onUpdate:modelValue": n[0] || (n[0] = (k) => k ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
|
|
2657
2741
|
}, null, 8, ["label", "model-value"]),
|
|
2658
|
-
((
|
|
2659
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2660
|
-
var
|
|
2742
|
+
((f = e.modelValue) == null ? void 0 : f.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
2743
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (k) => {
|
|
2744
|
+
var y, g;
|
|
2661
2745
|
return openBlock(), createBlock(r, {
|
|
2662
2746
|
variant: "outlined",
|
|
2663
2747
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2664
|
-
"col-span-2": unref(
|
|
2665
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
2666
|
-
"hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.gameType) !=
|
|
2748
|
+
"col-span-2": unref(c).length == 1,
|
|
2749
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((y = e.modelValue) == null ? void 0 : y.gameType) == k.value,
|
|
2750
|
+
"hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.gameType) != k.value
|
|
2667
2751
|
}]),
|
|
2668
2752
|
onClick: () => {
|
|
2669
2753
|
var u;
|
|
2670
|
-
((u = d.modelValue) == null ? void 0 : u.gameType) !=
|
|
2754
|
+
((u = d.modelValue) == null ? void 0 : u.gameType) != k.value && i("update:model-value", { gameType: k.value });
|
|
2671
2755
|
},
|
|
2672
|
-
key:
|
|
2756
|
+
key: k.value
|
|
2673
2757
|
}, {
|
|
2674
2758
|
default: withCtx(() => [
|
|
2675
|
-
createElementVNode("div", _hoisted_3$6, toDisplayString(
|
|
2676
|
-
createElementVNode("div", _hoisted_4$5, toDisplayString(
|
|
2759
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(k.label), 1),
|
|
2760
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(k.description), 1)
|
|
2677
2761
|
]),
|
|
2678
2762
|
_: 2
|
|
2679
2763
|
}, 1032, ["class", "onClick"]);
|
|
@@ -2703,12 +2787,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2703
2787
|
},
|
|
2704
2788
|
emits: ["update:model-value"],
|
|
2705
2789
|
setup(e, { emit: s }) {
|
|
2706
|
-
const { t: o } = useI18n(), d = e,
|
|
2790
|
+
const { t: o } = useI18n(), d = e, i = s, c = ref(d.modelValue ?? {}), l = ref(
|
|
2707
2791
|
(() => {
|
|
2708
2792
|
const v = {};
|
|
2709
|
-
return
|
|
2710
|
-
const V =
|
|
2711
|
-
V && "periods" in V && Array.isArray(V.periods) ? v[
|
|
2793
|
+
return c.value.workingHour && Object.keys(c.value.workingHour).forEach((f) => {
|
|
2794
|
+
const V = c.value.workingHour[f];
|
|
2795
|
+
V && "periods" in V && Array.isArray(V.periods) ? v[f] = V.periods : Array.isArray(V) && (v[f] = V);
|
|
2712
2796
|
}), v;
|
|
2713
2797
|
})()
|
|
2714
2798
|
), n = [
|
|
@@ -2724,25 +2808,25 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2724
2808
|
startTime: "00:00",
|
|
2725
2809
|
endTime: "23:59"
|
|
2726
2810
|
}), p();
|
|
2727
|
-
}, r = (v,
|
|
2728
|
-
l.value[v] && l.value[v].length >
|
|
2811
|
+
}, r = (v, f) => {
|
|
2812
|
+
l.value[v] && l.value[v].length > f && (l.value[v].splice(f, 1), l.value[v].length === 0 && delete l.value[v], p());
|
|
2729
2813
|
}, p = () => {
|
|
2730
2814
|
const v = Object.keys(l.value).reduce(
|
|
2731
|
-
(
|
|
2815
|
+
(f, V) => (l.value[V] && l.value[V].length > 0 && (f[V] = {
|
|
2732
2816
|
periods: l.value[V]
|
|
2733
|
-
}),
|
|
2817
|
+
}), f),
|
|
2734
2818
|
{}
|
|
2735
2819
|
);
|
|
2736
|
-
|
|
2820
|
+
c.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
|
|
2737
2821
|
};
|
|
2738
|
-
return watch(
|
|
2739
|
-
const V = resolveComponent("FmSelect"),
|
|
2822
|
+
return watch(c, () => i("update:model-value", c.value), { deep: !0 }), watch(l, p, { deep: !0 }), (v, f) => {
|
|
2823
|
+
const V = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), y = resolveComponent("FmCheckbox"), g = resolveComponent("FmTimePicker"), u = resolveComponent("FmButton");
|
|
2740
2824
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
2741
2825
|
createElementVNode("div", _hoisted_2$7, [
|
|
2742
2826
|
createVNode(V, {
|
|
2743
2827
|
label: unref(o)("connect.template.eaterType"),
|
|
2744
|
-
modelValue: unref(
|
|
2745
|
-
"onUpdate:modelValue":
|
|
2828
|
+
modelValue: unref(c).eaterType,
|
|
2829
|
+
"onUpdate:modelValue": f[0] || (f[0] = (m) => unref(c).eaterType = m),
|
|
2746
2830
|
items: [
|
|
2747
2831
|
{ label: unref(o)("connect.template.allEaters"), value: "all" },
|
|
2748
2832
|
{ label: unref(o)("connect.template.newEatersOnly"), value: "new" },
|
|
@@ -2753,9 +2837,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2753
2837
|
],
|
|
2754
2838
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
|
|
2755
2839
|
}, null, 8, ["label", "modelValue", "items", "rules"]),
|
|
2756
|
-
createVNode(
|
|
2757
|
-
modelValue: unref(
|
|
2758
|
-
"onUpdate:modelValue":
|
|
2840
|
+
createVNode(k, {
|
|
2841
|
+
modelValue: unref(c).minBasketAmount,
|
|
2842
|
+
"onUpdate:modelValue": f[1] || (f[1] = (m) => unref(c).minBasketAmount = m),
|
|
2759
2843
|
"show-steppers": !1,
|
|
2760
2844
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
|
|
2761
2845
|
}, {
|
|
@@ -2769,9 +2853,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2769
2853
|
]),
|
|
2770
2854
|
_: 1
|
|
2771
2855
|
}, 8, ["modelValue", "rules"]),
|
|
2772
|
-
createVNode(
|
|
2773
|
-
modelValue: unref(
|
|
2774
|
-
"onUpdate:modelValue":
|
|
2856
|
+
createVNode(k, {
|
|
2857
|
+
modelValue: unref(c).bundleQuantity,
|
|
2858
|
+
"onUpdate:modelValue": f[2] || (f[2] = (m) => unref(c).bundleQuantity = m),
|
|
2775
2859
|
"show-steppers": !1,
|
|
2776
2860
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
|
|
2777
2861
|
}, {
|
|
@@ -2794,7 +2878,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2794
2878
|
class: "space-y-2"
|
|
2795
2879
|
}, [
|
|
2796
2880
|
createElementVNode("div", _hoisted_6$3, [
|
|
2797
|
-
createVNode(
|
|
2881
|
+
createVNode(y, {
|
|
2798
2882
|
label: m.label,
|
|
2799
2883
|
"model-value": !!(unref(l)[m.key] && unref(l)[m.key].length > 0),
|
|
2800
2884
|
"onUpdate:modelValue": (C) => {
|
|
@@ -2803,30 +2887,30 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2803
2887
|
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])
|
|
2804
2888
|
]),
|
|
2805
2889
|
unref(l)[m.key] && unref(l)[m.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
|
|
2806
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[m.key] || [], (C,
|
|
2807
|
-
key:
|
|
2890
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[m.key] || [], (C, x) => (openBlock(), createElementBlock("div", {
|
|
2891
|
+
key: x,
|
|
2808
2892
|
class: "flex items-center space-x-2 w-100"
|
|
2809
2893
|
}, [
|
|
2810
2894
|
createVNode(g, {
|
|
2811
2895
|
"model-value": C.startTime || "",
|
|
2812
2896
|
"onUpdate:modelValue": ($) => {
|
|
2813
|
-
unref(l)[m.key] && unref(l)[m.key][
|
|
2897
|
+
unref(l)[m.key] && unref(l)[m.key][x] && (unref(l)[m.key][x].startTime = $ || "", p());
|
|
2814
2898
|
}
|
|
2815
2899
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2816
|
-
|
|
2900
|
+
f[3] || (f[3] = createElementVNode("span", null, "to", -1)),
|
|
2817
2901
|
createVNode(g, {
|
|
2818
2902
|
"model-value": C.endTime || "",
|
|
2819
2903
|
"onUpdate:modelValue": ($) => {
|
|
2820
|
-
unref(l)[m.key] && unref(l)[m.key][
|
|
2904
|
+
unref(l)[m.key] && unref(l)[m.key][x] && (unref(l)[m.key][x].endTime = $ || "", p());
|
|
2821
2905
|
}
|
|
2822
2906
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2823
2907
|
createVNode(u, {
|
|
2824
2908
|
variant: "tertiary",
|
|
2825
2909
|
size: "sm",
|
|
2826
|
-
onClick: ($) => r(m.key,
|
|
2910
|
+
onClick: ($) => r(m.key, x),
|
|
2827
2911
|
icon: "close"
|
|
2828
2912
|
}, null, 8, ["onClick"]),
|
|
2829
|
-
|
|
2913
|
+
x === 0 ? (openBlock(), createBlock(u, {
|
|
2830
2914
|
key: 0,
|
|
2831
2915
|
onClick: ($) => a(m.key),
|
|
2832
2916
|
icon: "add",
|
|
@@ -2853,14 +2937,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2853
2937
|
},
|
|
2854
2938
|
emits: ["update:model-value"],
|
|
2855
2939
|
setup(e, { emit: s }) {
|
|
2856
|
-
const { t: o } = useI18n(), d = e,
|
|
2857
|
-
return watch(
|
|
2940
|
+
const { t: o } = useI18n(), d = e, i = s, c = ref(d.modelValue ?? {});
|
|
2941
|
+
return watch(c, () => i("update:model-value", c.value)), (l, n) => {
|
|
2858
2942
|
const a = resolveComponent("FmStepperField");
|
|
2859
2943
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2860
2944
|
createElementVNode("div", _hoisted_2$6, [
|
|
2861
2945
|
createVNode(a, {
|
|
2862
|
-
modelValue: unref(
|
|
2863
|
-
"onUpdate:modelValue": n[0] || (n[0] = (r) => unref(
|
|
2946
|
+
modelValue: unref(c).totalCount,
|
|
2947
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => unref(c).totalCount = r),
|
|
2864
2948
|
"show-steppers": !1,
|
|
2865
2949
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
|
|
2866
2950
|
}, {
|
|
@@ -2875,8 +2959,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2875
2959
|
_: 1
|
|
2876
2960
|
}, 8, ["modelValue", "rules"]),
|
|
2877
2961
|
createVNode(a, {
|
|
2878
|
-
modelValue: unref(
|
|
2879
|
-
"onUpdate:modelValue": n[1] || (n[1] = (r) => unref(
|
|
2962
|
+
modelValue: unref(c).totalCountPerUser,
|
|
2963
|
+
"onUpdate:modelValue": n[1] || (n[1] = (r) => unref(c).totalCountPerUser = r),
|
|
2880
2964
|
"show-steppers": !1,
|
|
2881
2965
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
|
|
2882
2966
|
}, {
|
|
@@ -2903,7 +2987,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2903
2987
|
},
|
|
2904
2988
|
emits: ["update:model-value"],
|
|
2905
2989
|
setup(e, { emit: s }) {
|
|
2906
|
-
const { t: o } = useI18n(), d = e,
|
|
2990
|
+
const { t: o } = useI18n(), d = e, i = s, c = computed(() => [
|
|
2907
2991
|
{
|
|
2908
2992
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
2909
2993
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -2920,15 +3004,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2920
3004
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
2921
3005
|
createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2922
3006
|
createElementVNode("div", _hoisted_3$4, [
|
|
2923
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3007
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
|
|
2924
3008
|
variant: "outlined",
|
|
2925
3009
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2926
|
-
"col-span-2": unref(
|
|
3010
|
+
"col-span-2": unref(c).length == 1,
|
|
2927
3011
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
2928
3012
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
2929
3013
|
}]),
|
|
2930
3014
|
onClick: () => {
|
|
2931
|
-
d.modelValue != r.value &&
|
|
3015
|
+
d.modelValue != r.value && i("update:model-value", r.value);
|
|
2932
3016
|
},
|
|
2933
3017
|
key: r.value
|
|
2934
3018
|
}, {
|
|
@@ -2958,14 +3042,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2958
3042
|
emits: ["update:model-value"],
|
|
2959
3043
|
setup(e, { emit: s }) {
|
|
2960
3044
|
const o = s;
|
|
2961
|
-
return (d,
|
|
2962
|
-
const
|
|
3045
|
+
return (d, i) => {
|
|
3046
|
+
const c = resolveComponent("FmStepperField");
|
|
2963
3047
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2964
|
-
|
|
2965
|
-
createVNode(
|
|
3048
|
+
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)),
|
|
3049
|
+
createVNode(c, {
|
|
2966
3050
|
label: "Maximum to collect",
|
|
2967
3051
|
"model-value": e.modelValue || null,
|
|
2968
|
-
"onUpdate:modelValue":
|
|
3052
|
+
"onUpdate:modelValue": i[0] || (i[0] = (l) => o("update:model-value", l)),
|
|
2969
3053
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
2970
3054
|
"helper-state": e.helperState || "none"
|
|
2971
3055
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -2982,9 +3066,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2982
3066
|
},
|
|
2983
3067
|
emits: ["update:model-value"],
|
|
2984
3068
|
setup(e, { expose: s, emit: o }) {
|
|
2985
|
-
const d = e,
|
|
3069
|
+
const d = e, i = useMembershipStore(), { minor: c } = useLoading, l = ref(!1), n = ref(), a = ref(), r = ref(0), p = computed(() => {
|
|
2986
3070
|
var u;
|
|
2987
|
-
return ((u =
|
|
3071
|
+
return ((u = i.loyaltyRewards.items.find(
|
|
2988
3072
|
(m) => {
|
|
2989
3073
|
var C;
|
|
2990
3074
|
return m.value === ((C = n.value) == null ? void 0 : C.collectible);
|
|
@@ -2994,13 +3078,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2994
3078
|
const g = p.value.safeParse(n.value);
|
|
2995
3079
|
return g.success ? [] : g.error.errors;
|
|
2996
3080
|
});
|
|
2997
|
-
function
|
|
3081
|
+
function f(g, u, m) {
|
|
2998
3082
|
g && (n.value = u, r.value = m), l.value = g;
|
|
2999
3083
|
}
|
|
3000
3084
|
const V = o;
|
|
3001
|
-
async function
|
|
3085
|
+
async function k() {
|
|
3002
3086
|
const g = p.value.safeParse(n.value);
|
|
3003
|
-
g.success && (await
|
|
3087
|
+
g.success && (await c(
|
|
3004
3088
|
async () => {
|
|
3005
3089
|
g.data.type === "VOUCHER" && a.value && (g.data.collectibleConfig.image = await firebaseStorage.update(
|
|
3006
3090
|
g.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
@@ -3013,17 +3097,17 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3013
3097
|
}
|
|
3014
3098
|
), V("update:model-value", g.data, r.value));
|
|
3015
3099
|
}
|
|
3016
|
-
const
|
|
3100
|
+
const y = ref();
|
|
3017
3101
|
return s({
|
|
3018
|
-
showSheet:
|
|
3102
|
+
showSheet: f
|
|
3019
3103
|
}), (g, u) => {
|
|
3020
|
-
const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"),
|
|
3021
|
-
return openBlock(), createBlock(
|
|
3104
|
+
const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), x = resolveComponent("FmForm"), $ = resolveComponent("FmButton"), F = resolveComponent("FmSideSheet");
|
|
3105
|
+
return openBlock(), createBlock(F, {
|
|
3022
3106
|
"max-width": 560,
|
|
3023
3107
|
modelValue: unref(l),
|
|
3024
3108
|
"onUpdate:modelValue": [
|
|
3025
|
-
u[10] || (u[10] = (
|
|
3026
|
-
u[11] || (u[11] = (
|
|
3109
|
+
u[10] || (u[10] = (N) => isRef(l) ? l.value = N : null),
|
|
3110
|
+
u[11] || (u[11] = (N) => l.value = N)
|
|
3027
3111
|
],
|
|
3028
3112
|
header: "Edit reward",
|
|
3029
3113
|
"dismiss-away": ""
|
|
@@ -3036,29 +3120,29 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3036
3120
|
label: "Confirm",
|
|
3037
3121
|
disabled: unref(v).length > 0,
|
|
3038
3122
|
onClick: u[8] || (u[8] = async () => {
|
|
3039
|
-
var
|
|
3040
|
-
return (
|
|
3123
|
+
var N;
|
|
3124
|
+
return (N = unref(y)) == null ? void 0 : N.validateInputs();
|
|
3041
3125
|
})
|
|
3042
3126
|
}, null, 8, ["disabled"]),
|
|
3043
3127
|
createVNode($, {
|
|
3044
3128
|
variant: "secondary",
|
|
3045
3129
|
type: "button",
|
|
3046
3130
|
label: "Cancel",
|
|
3047
|
-
onClick: u[9] || (u[9] = (
|
|
3131
|
+
onClick: u[9] || (u[9] = (N) => l.value = !1)
|
|
3048
3132
|
})
|
|
3049
3133
|
])
|
|
3050
3134
|
]),
|
|
3051
3135
|
default: withCtx(() => [
|
|
3052
3136
|
createVNode(JsonViewer, { json: unref(n) }, null, 8, ["json"]),
|
|
3053
|
-
unref(n) ? (openBlock(), createBlock(
|
|
3137
|
+
unref(n) ? (openBlock(), createBlock(x, {
|
|
3054
3138
|
key: 0,
|
|
3055
3139
|
class: "flex flex-col gap-y-24",
|
|
3056
3140
|
ref_key: "formRef",
|
|
3057
|
-
ref:
|
|
3058
|
-
onValidationSuccess: u[7] || (u[7] = (
|
|
3141
|
+
ref: y,
|
|
3142
|
+
onValidationSuccess: u[7] || (u[7] = (N) => k())
|
|
3059
3143
|
}, {
|
|
3060
3144
|
default: withCtx(() => {
|
|
3061
|
-
var
|
|
3145
|
+
var N, D;
|
|
3062
3146
|
return [
|
|
3063
3147
|
unref(n).type ? (openBlock(), createBlock(m, {
|
|
3064
3148
|
key: 0,
|
|
@@ -3085,7 +3169,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3085
3169
|
],
|
|
3086
3170
|
"model-value": unref(n).type,
|
|
3087
3171
|
"onUpdate:modelValue": u[1] || (u[1] = (w) => {
|
|
3088
|
-
var O,
|
|
3172
|
+
var O, j;
|
|
3089
3173
|
w === "VOUCHER" ? n.value = {
|
|
3090
3174
|
collectible: null,
|
|
3091
3175
|
type: "VOUCHER",
|
|
@@ -3101,7 +3185,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3101
3185
|
},
|
|
3102
3186
|
threshold: (O = unref(n)) == null ? void 0 : O.threshold
|
|
3103
3187
|
} : n.value = {
|
|
3104
|
-
collectible: unref(
|
|
3188
|
+
collectible: unref(i).loyaltyRewards.raw[0]._id,
|
|
3105
3189
|
type: "LOYALTY",
|
|
3106
3190
|
earningOption: {
|
|
3107
3191
|
amount: 1,
|
|
@@ -3110,7 +3194,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3110
3194
|
validityOption: {
|
|
3111
3195
|
validForDay: 7
|
|
3112
3196
|
},
|
|
3113
|
-
threshold: (
|
|
3197
|
+
threshold: (j = unref(n)) == null ? void 0 : j.threshold
|
|
3114
3198
|
};
|
|
3115
3199
|
})
|
|
3116
3200
|
}, null, 8, ["model-value"]),
|
|
@@ -3118,7 +3202,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3118
3202
|
key: 1,
|
|
3119
3203
|
label: "Loyalty type",
|
|
3120
3204
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(n).type])],
|
|
3121
|
-
items: unref(
|
|
3205
|
+
items: unref(i).loyaltyRewards.items,
|
|
3122
3206
|
"model-value": unref(n).collectible,
|
|
3123
3207
|
"onUpdate:modelValue": u[2] || (u[2] = (w) => unref(n).collectible = w)
|
|
3124
3208
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
@@ -3139,12 +3223,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3139
3223
|
createVNode(_sfc_main$A, {
|
|
3140
3224
|
class: "!gap-24",
|
|
3141
3225
|
type: unref(n).type === "LOYALTY" ? "custom" : "range",
|
|
3142
|
-
"for-credit": unref(n).type === "LOYALTY" && ((
|
|
3226
|
+
"for-credit": unref(n).type === "LOYALTY" && ((N = unref(i).loyaltyRewards.items.find(
|
|
3143
3227
|
(w) => {
|
|
3144
3228
|
var O;
|
|
3145
3229
|
return w.value === ((O = unref(n)) == null ? void 0 : O.collectible);
|
|
3146
3230
|
}
|
|
3147
|
-
)) == null ? void 0 :
|
|
3231
|
+
)) == null ? void 0 : N.raw.type) === "CREDIT",
|
|
3148
3232
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(n).type])],
|
|
3149
3233
|
"model-value": unref(n).validityOption,
|
|
3150
3234
|
"onUpdate:modelValue": u[4] || (u[4] = (w) => n.value = {
|
|
@@ -3197,7 +3281,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3197
3281
|
}
|
|
3198
3282
|
},
|
|
3199
3283
|
setup(e) {
|
|
3200
|
-
const s = e, { maxRange: o, currentRange: d, markers:
|
|
3284
|
+
const s = e, { maxRange: o, currentRange: d, markers: i } = toRefs(s), c = computed(
|
|
3201
3285
|
() => Math.min(d.value / o.value * 100, 100)
|
|
3202
3286
|
), l = (n) => n / o.value * 100;
|
|
3203
3287
|
return (n, a) => {
|
|
@@ -3209,7 +3293,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3209
3293
|
),
|
|
3210
3294
|
outline: unref(d) < p,
|
|
3211
3295
|
key: p,
|
|
3212
|
-
name: unref(
|
|
3296
|
+
name: unref(i).some((v) => v === p) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
3213
3297
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
3214
3298
|
])) : (openBlock(), createElementBlock("div", {
|
|
3215
3299
|
key: 1,
|
|
@@ -3217,9 +3301,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3217
3301
|
}, [
|
|
3218
3302
|
createElementVNode("div", {
|
|
3219
3303
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
3220
|
-
style: normalizeStyle({ width: unref(
|
|
3304
|
+
style: normalizeStyle({ width: unref(c) + "%" })
|
|
3221
3305
|
}, null, 4),
|
|
3222
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3306
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (p, v) => (openBlock(), createElementBlock("div", {
|
|
3223
3307
|
key: v,
|
|
3224
3308
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
3225
3309
|
style: normalizeStyle({ left: l(p) + "%" })
|
|
@@ -3236,16 +3320,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3236
3320
|
}
|
|
3237
3321
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
3238
3322
|
function changeKeysFactory(e) {
|
|
3239
|
-
return function s(o, d = 1,
|
|
3323
|
+
return function s(o, d = 1, i) {
|
|
3240
3324
|
if (d === 0 || !isObject(o))
|
|
3241
3325
|
return o;
|
|
3242
3326
|
if (Array.isArray(o))
|
|
3243
|
-
return o.map((l) => s(l, d - 1,
|
|
3244
|
-
const
|
|
3327
|
+
return o.map((l) => s(l, d - 1, i));
|
|
3328
|
+
const c = Object.create(Object.getPrototypeOf(o));
|
|
3245
3329
|
return Object.keys(o).forEach((l) => {
|
|
3246
|
-
const n = o[l], a = e(l,
|
|
3247
|
-
|
|
3248
|
-
}),
|
|
3330
|
+
const n = o[l], a = e(l, i), r = s(n, d - 1, i);
|
|
3331
|
+
c[a] = r;
|
|
3332
|
+
}), c;
|
|
3249
3333
|
};
|
|
3250
3334
|
}
|
|
3251
3335
|
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,7 +3346,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3262
3346
|
},
|
|
3263
3347
|
emits: ["update:model-value"],
|
|
3264
3348
|
setup(e, { emit: s }) {
|
|
3265
|
-
const { t: o } = useI18n(), d = e,
|
|
3349
|
+
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(
|
|
3266
3350
|
() => d.modelValue.sort((g, u) => g.threshold - u.threshold) ?? []
|
|
3267
3351
|
), a = computed(() => {
|
|
3268
3352
|
const g = l.safeParse(n.value);
|
|
@@ -3271,11 +3355,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3271
3355
|
function p(g, u) {
|
|
3272
3356
|
var C;
|
|
3273
3357
|
const m = [...n.value];
|
|
3274
|
-
m[u] = g, (C = r.value) == null || C.showSheet(!1),
|
|
3358
|
+
m[u] = g, (C = r.value) == null || C.showSheet(!1), i("update:model-value", m);
|
|
3275
3359
|
}
|
|
3276
3360
|
function v(g) {
|
|
3277
|
-
const u = g.type == "VOUCHER" ? g.collectibleConfig :
|
|
3278
|
-
(
|
|
3361
|
+
const u = g.type == "VOUCHER" ? g.collectibleConfig : c.collectibles.find(
|
|
3362
|
+
(x) => x._id.toString() == g.collectible
|
|
3279
3363
|
), m = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), C = g.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
3280
3364
|
threshold: g.threshold,
|
|
3281
3365
|
amount: g.earningOption.amount
|
|
@@ -3289,22 +3373,22 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3289
3373
|
sublabel: C
|
|
3290
3374
|
};
|
|
3291
3375
|
}
|
|
3292
|
-
function
|
|
3376
|
+
function f(g) {
|
|
3293
3377
|
var m;
|
|
3294
3378
|
const u = [...n.value];
|
|
3295
3379
|
(m = r.value) == null || m.showSheet(!0, u[g], g);
|
|
3296
3380
|
}
|
|
3297
3381
|
function V(g) {
|
|
3298
3382
|
const u = [...n.value];
|
|
3299
|
-
u.splice(g, 1),
|
|
3383
|
+
u.splice(g, 1), i("update:model-value", u);
|
|
3300
3384
|
}
|
|
3301
|
-
function
|
|
3385
|
+
function k() {
|
|
3302
3386
|
var g;
|
|
3303
3387
|
(g = r.value) == null || g.showSheet(
|
|
3304
3388
|
!0,
|
|
3305
3389
|
{
|
|
3306
3390
|
type: "LOYALTY",
|
|
3307
|
-
collectible:
|
|
3391
|
+
collectible: c.loyaltyRewards.items[0].value,
|
|
3308
3392
|
threshold: null,
|
|
3309
3393
|
validityOption: {
|
|
3310
3394
|
validForDay: 7
|
|
@@ -3317,29 +3401,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3317
3401
|
n.value.length
|
|
3318
3402
|
);
|
|
3319
3403
|
}
|
|
3320
|
-
function
|
|
3404
|
+
function y(g) {
|
|
3321
3405
|
var u, m;
|
|
3322
3406
|
return g.type == "VOUCHER" ? (u = g.collectibleConfig) == null ? void 0 : u.name : sentenceCase(
|
|
3323
|
-
((m =
|
|
3407
|
+
((m = c.loyaltyRewards.items.find(
|
|
3324
3408
|
(C) => C.value == g.collectible
|
|
3325
3409
|
)) == null ? void 0 : m.label) || ""
|
|
3326
3410
|
);
|
|
3327
3411
|
}
|
|
3328
3412
|
return (g, u) => {
|
|
3329
|
-
const m = resolveComponent("FmButton"), C = resolveComponent("FmCard"),
|
|
3413
|
+
const m = resolveComponent("FmButton"), C = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
|
|
3330
3414
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
3331
3415
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
|
|
3332
3416
|
createVNode(m, {
|
|
3333
3417
|
label: unref(o)("connect.template.mission_pool.add_reward"),
|
|
3334
|
-
onClick: u[0] || (u[0] = ($) =>
|
|
3418
|
+
onClick: u[0] || (u[0] = ($) => k()),
|
|
3335
3419
|
variant: "plain",
|
|
3336
3420
|
icon: "add"
|
|
3337
3421
|
}, null, 8, ["label"]),
|
|
3338
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), ($,
|
|
3339
|
-
key:
|
|
3422
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), ($, F) => (openBlock(), createBlock(C, {
|
|
3423
|
+
key: F,
|
|
3340
3424
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
3341
3425
|
variant: "outlined",
|
|
3342
|
-
onClick: (
|
|
3426
|
+
onClick: (N) => f(F)
|
|
3343
3427
|
}, {
|
|
3344
3428
|
default: withCtx(() => [
|
|
3345
3429
|
createElementVNode("div", null, [
|
|
@@ -3349,12 +3433,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3349
3433
|
createVNode(m, {
|
|
3350
3434
|
icon: "delete",
|
|
3351
3435
|
variant: "tertiary",
|
|
3352
|
-
onClick: (
|
|
3436
|
+
onClick: (N) => (N.stopPropagation(), V(F))
|
|
3353
3437
|
}, null, 8, ["onClick"])
|
|
3354
3438
|
]),
|
|
3355
3439
|
_: 2
|
|
3356
3440
|
}, 1032, ["onClick"]))), 128)),
|
|
3357
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter(($) => $.path.join(".") == ""), ($) => (openBlock(), createBlock(
|
|
3441
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter(($) => $.path.join(".") == ""), ($) => (openBlock(), createBlock(x, {
|
|
3358
3442
|
key: $.message,
|
|
3359
3443
|
text: $.message,
|
|
3360
3444
|
state: "error"
|
|
@@ -3366,11 +3450,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3366
3450
|
class: "p-24 space-y-16 w-fit"
|
|
3367
3451
|
}, {
|
|
3368
3452
|
default: withCtx(() => {
|
|
3369
|
-
var $,
|
|
3453
|
+
var $, F;
|
|
3370
3454
|
return [
|
|
3371
3455
|
createElementVNode("div", _hoisted_6$2, [
|
|
3372
3456
|
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 ? (
|
|
3457
|
+
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] ? y(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
3374
3458
|
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
3375
3459
|
])
|
|
3376
3460
|
]),
|
|
@@ -3379,7 +3463,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3379
3463
|
type: e.mission.type,
|
|
3380
3464
|
"max-range": e.mission.end,
|
|
3381
3465
|
currentRange: e.mission.end / 4,
|
|
3382
|
-
markers: e.modelValue.map((
|
|
3466
|
+
markers: e.modelValue.map((N) => N.threshold)
|
|
3383
3467
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
3384
3468
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
3385
3469
|
])
|
|
@@ -3403,10 +3487,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3403
3487
|
},
|
|
3404
3488
|
emits: ["update:model-value"],
|
|
3405
3489
|
setup(e, { emit: s }) {
|
|
3406
|
-
const { t: o } = useI18n(), d = e,
|
|
3490
|
+
const { t: o } = useI18n(), d = e, i = computed(() => {
|
|
3407
3491
|
const n = FdoMission.safeParse(d.modelValue);
|
|
3408
3492
|
return n.success ? [] : n.error.errors;
|
|
3409
|
-
}),
|
|
3493
|
+
}), c = computed(() => [
|
|
3410
3494
|
{
|
|
3411
3495
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
3412
3496
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -3426,28 +3510,28 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3426
3510
|
createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
|
|
3427
3511
|
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
3428
3512
|
createElementVNode("div", _hoisted_5$1, [
|
|
3429
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3430
|
-
var V,
|
|
3513
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (f) => {
|
|
3514
|
+
var V, k;
|
|
3431
3515
|
return openBlock(), createBlock(r, {
|
|
3432
3516
|
variant: "outlined",
|
|
3433
3517
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
3434
|
-
"col-span-2": unref(
|
|
3435
|
-
"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) ==
|
|
3436
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
3518
|
+
"col-span-2": unref(c).length == 1,
|
|
3519
|
+
"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) == f.value,
|
|
3520
|
+
"hover:bg-fm-color-opacity-sm": ((k = e.modelValue) == null ? void 0 : k.type) != f.value
|
|
3437
3521
|
}]),
|
|
3438
3522
|
onClick: () => {
|
|
3439
|
-
var
|
|
3440
|
-
((
|
|
3523
|
+
var y, g;
|
|
3524
|
+
((y = e.modelValue) == null ? void 0 : y.type) != f.value && l("update:model-value", {
|
|
3441
3525
|
...e.modelValue,
|
|
3442
|
-
type:
|
|
3526
|
+
type: f.value,
|
|
3443
3527
|
end: ((g = e.modelValue) == null ? void 0 : g.end) || 1
|
|
3444
3528
|
});
|
|
3445
3529
|
},
|
|
3446
|
-
key:
|
|
3530
|
+
key: f.value
|
|
3447
3531
|
}, {
|
|
3448
3532
|
default: withCtx(() => [
|
|
3449
|
-
createElementVNode("div", _hoisted_6$1, toDisplayString(
|
|
3450
|
-
createElementVNode("div", _hoisted_7$1, toDisplayString(
|
|
3533
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(f.label), 1),
|
|
3534
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(f.description), 1)
|
|
3451
3535
|
]),
|
|
3452
3536
|
_: 2
|
|
3453
3537
|
}, 1032, ["class", "onClick"]);
|
|
@@ -3460,16 +3544,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3460
3544
|
createVNode(p, {
|
|
3461
3545
|
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
3462
3546
|
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
3463
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
3547
|
+
"onUpdate:modelValue": a[0] || (a[0] = (f) => {
|
|
3464
3548
|
var V;
|
|
3465
3549
|
return l("update:model-value", {
|
|
3466
3550
|
...e.modelValue,
|
|
3467
3551
|
type: ((V = e.modelValue) == null ? void 0 : V.type) || "STAMP",
|
|
3468
|
-
end:
|
|
3552
|
+
end: f
|
|
3469
3553
|
});
|
|
3470
3554
|
}),
|
|
3471
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
3472
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
3555
|
+
"helper-text": unref(ZodHelper).helperText(unref(i), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
|
|
3556
|
+
"helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
|
|
3473
3557
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"])
|
|
3474
3558
|
])
|
|
3475
3559
|
]);
|
|
@@ -3478,8 +3562,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3478
3562
|
});
|
|
3479
3563
|
function useLocaleText() {
|
|
3480
3564
|
const { locale: e, t: s } = useI18n();
|
|
3481
|
-
function o(d,
|
|
3482
|
-
return d ? d[e.value] ?? d["en-US"] ?? s(
|
|
3565
|
+
function o(d, i) {
|
|
3566
|
+
return d ? d[e.value] ?? d["en-US"] ?? s(i) : s(i);
|
|
3483
3567
|
}
|
|
3484
3568
|
return { getLocaleText: o };
|
|
3485
3569
|
}
|
|
@@ -3506,24 +3590,29 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3506
3590
|
campaignType: {
|
|
3507
3591
|
type: String,
|
|
3508
3592
|
default: void 0
|
|
3593
|
+
},
|
|
3594
|
+
/** False until the form has been submitted, for fields that validate late. */
|
|
3595
|
+
showValidation: {
|
|
3596
|
+
type: Boolean,
|
|
3597
|
+
default: !0
|
|
3509
3598
|
}
|
|
3510
3599
|
},
|
|
3511
3600
|
emits: ["update:model-value", "update:file"],
|
|
3512
3601
|
setup(e, { emit: s }) {
|
|
3513
|
-
const { t: o } = useI18n(), { getLocaleText: d } = useLocaleText(),
|
|
3602
|
+
const { t: o } = useI18n(), { getLocaleText: d } = useLocaleText(), i = e, c = s;
|
|
3514
3603
|
function l(p) {
|
|
3515
|
-
switch (
|
|
3604
|
+
switch (i.field.type) {
|
|
3516
3605
|
case "timeframe":
|
|
3517
|
-
const v = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0,
|
|
3518
|
-
|
|
3606
|
+
const v = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, f = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
|
|
3607
|
+
c("update:model-value", {
|
|
3519
3608
|
type: "timeframe",
|
|
3520
3609
|
property: "__now",
|
|
3521
3610
|
start: v,
|
|
3522
|
-
end:
|
|
3611
|
+
end: f
|
|
3523
3612
|
});
|
|
3524
3613
|
break;
|
|
3525
3614
|
case "image": {
|
|
3526
|
-
|
|
3615
|
+
c(
|
|
3527
3616
|
"update:file",
|
|
3528
3617
|
p,
|
|
3529
3618
|
n.value || firebaseStorage.collectibleImagePath(void 0, p)
|
|
@@ -3531,42 +3620,42 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3531
3620
|
break;
|
|
3532
3621
|
}
|
|
3533
3622
|
default:
|
|
3534
|
-
|
|
3623
|
+
c("update:model-value", p);
|
|
3535
3624
|
break;
|
|
3536
3625
|
}
|
|
3537
3626
|
}
|
|
3538
3627
|
const n = computed(() => {
|
|
3539
|
-
switch (
|
|
3628
|
+
switch (i.field.type) {
|
|
3540
3629
|
case "timeframe": {
|
|
3541
|
-
const p =
|
|
3630
|
+
const p = i.modelValue;
|
|
3542
3631
|
return {
|
|
3543
3632
|
startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
|
|
3544
3633
|
endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
|
|
3545
3634
|
};
|
|
3546
3635
|
}
|
|
3547
3636
|
default:
|
|
3548
|
-
return
|
|
3637
|
+
return i.modelValue;
|
|
3549
3638
|
}
|
|
3550
3639
|
});
|
|
3551
3640
|
function a() {
|
|
3552
3641
|
if (!r.value.schema) return [];
|
|
3553
|
-
const p = r.value.schema.safeParse(
|
|
3642
|
+
const p = r.value.schema.safeParse(i.modelValue);
|
|
3554
3643
|
return p.success ? [] : p.error.errors;
|
|
3555
3644
|
}
|
|
3556
3645
|
const r = computed(() => ({
|
|
3557
|
-
schema:
|
|
3558
|
-
unwrapped:
|
|
3559
|
-
rules:
|
|
3560
|
-
labelMark:
|
|
3561
|
-
zodLabel:
|
|
3562
|
-
|
|
3563
|
-
d(
|
|
3646
|
+
schema: i.schema,
|
|
3647
|
+
unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
|
|
3648
|
+
rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
|
|
3649
|
+
labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
|
|
3650
|
+
zodLabel: i.schema ? ZodHelper.toInputLabel(
|
|
3651
|
+
i.schema,
|
|
3652
|
+
d(i.field.label_locale, i.field.label ?? "")
|
|
3564
3653
|
) : void 0
|
|
3565
3654
|
}));
|
|
3566
3655
|
return (p, v) => {
|
|
3567
|
-
var u, m, C,
|
|
3568
|
-
const
|
|
3569
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
3656
|
+
var u, m, C, x, $;
|
|
3657
|
+
const f = resolveComponent("FmTextField"), V = resolveComponent("FmStepperField"), k = resolveComponent("FmTextarea"), y = resolveComponent("FmHelperText"), g = resolveComponent("FmSwitch");
|
|
3658
|
+
return e.field.type === "text" ? (openBlock(), createBlock(f, {
|
|
3570
3659
|
key: 0,
|
|
3571
3660
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
3572
3661
|
"label-mark": unref(r).labelMark,
|
|
@@ -3577,7 +3666,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3577
3666
|
"helper-text": e.helperText
|
|
3578
3667
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3579
3668
|
createVNode(JsonViewer, {
|
|
3580
|
-
json: { schema: unref(r).unwrapped, props:
|
|
3669
|
+
json: { schema: unref(r).unwrapped, props: i }
|
|
3581
3670
|
}, null, 8, ["json"]),
|
|
3582
3671
|
createVNode(V, {
|
|
3583
3672
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
@@ -3588,7 +3677,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3588
3677
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
3589
3678
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
3590
3679
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
3591
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
3680
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(k, {
|
|
3592
3681
|
key: 2,
|
|
3593
3682
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
3594
3683
|
"label-mark": unref(r).labelMark,
|
|
@@ -3596,7 +3685,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3596
3685
|
"model-value": unref(n),
|
|
3597
3686
|
"onUpdate:modelValue": l,
|
|
3598
3687
|
"show-word-count": "",
|
|
3599
|
-
"max-length": ($ = (
|
|
3688
|
+
"max-length": ($ = (x = (C = (m = (u = unref(r)) == null ? void 0 : u.unwrapped) == null ? void 0 : m._def) == null ? void 0 : C.checks) == null ? void 0 : x.find((F) => F.kind == "max")) == null ? void 0 : $.value
|
|
3600
3689
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
3601
3690
|
key: 3,
|
|
3602
3691
|
"campaign-type": e.extras,
|
|
@@ -3608,7 +3697,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3608
3697
|
"model-value": unref(n),
|
|
3609
3698
|
"onUpdate:modelValue": l
|
|
3610
3699
|
}, null, 8, ["model-value"]),
|
|
3611
|
-
createVNode(
|
|
3700
|
+
createVNode(y, {
|
|
3612
3701
|
class: "!mt-[8px]",
|
|
3613
3702
|
text: unref(ZodHelper).helperText(a(), ""),
|
|
3614
3703
|
state: unref(ZodHelper).helperState(a(), "")
|
|
@@ -3660,7 +3749,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3660
3749
|
"onUpdate:modelValue": l,
|
|
3661
3750
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
3662
3751
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
3663
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3752
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
|
|
3664
3753
|
key: 0,
|
|
3665
3754
|
class: "!mt-[8px]",
|
|
3666
3755
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -3671,7 +3760,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3671
3760
|
"model-value": unref(n),
|
|
3672
3761
|
"onUpdate:modelValue": l
|
|
3673
3762
|
}, null, 8, ["model-value"]),
|
|
3674
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3763
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
|
|
3675
3764
|
key: 0,
|
|
3676
3765
|
class: "!mt-[8px]",
|
|
3677
3766
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -3680,12 +3769,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3680
3769
|
], 64)) : e.field.type === "message" ? (openBlock(), createElementBlock(Fragment, { key: 13 }, [
|
|
3681
3770
|
e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
3682
3771
|
key: 0,
|
|
3772
|
+
"show-validation": e.showValidation,
|
|
3683
3773
|
"model-value": unref(n),
|
|
3684
3774
|
"onUpdate:modelValue": l,
|
|
3685
3775
|
"helper-text": unref(ZodHelper).helperText(a(), ""),
|
|
3686
3776
|
"trigger-type": e.field.extras,
|
|
3687
3777
|
"helper-state": unref(ZodHelper).helperState(a(), "")
|
|
3688
|
-
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
|
|
3778
|
+
}, null, 8, ["show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
|
|
3689
3779
|
key: 1,
|
|
3690
3780
|
"allow-email": !0,
|
|
3691
3781
|
"allow-whatsapp": !0,
|
|
@@ -3707,7 +3797,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3707
3797
|
"model-value": unref(n),
|
|
3708
3798
|
"onUpdate:modelValue": l,
|
|
3709
3799
|
"helper-text": e.helperText || unref(ZodHelper).helperText(a(), ""),
|
|
3710
|
-
"for-credit":
|
|
3800
|
+
"for-credit": i.campaignType === "CREDIT"
|
|
3711
3801
|
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
3712
3802
|
key: 16,
|
|
3713
3803
|
"model-value": unref(n),
|
|
@@ -3742,7 +3832,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3742
3832
|
"start-date": e.extras.start,
|
|
3743
3833
|
"end-date": e.extras.end
|
|
3744
3834
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
3745
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3835
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3746
3836
|
key: 0,
|
|
3747
3837
|
class: "!mt-[8px]",
|
|
3748
3838
|
text: e.helperText,
|
|
@@ -3753,14 +3843,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3753
3843
|
"model-value": unref(n),
|
|
3754
3844
|
"onUpdate:modelValue": l
|
|
3755
3845
|
}, null, 8, ["model-value"]),
|
|
3756
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3846
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3757
3847
|
key: 0,
|
|
3758
3848
|
class: "!mt-[8px]",
|
|
3759
3849
|
text: e.helperText,
|
|
3760
3850
|
state: "error"
|
|
3761
3851
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3762
3852
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
3763
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
3853
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(y, {
|
|
3764
3854
|
key: 0,
|
|
3765
3855
|
state: "warning",
|
|
3766
3856
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
@@ -3769,7 +3859,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3769
3859
|
"model-value": unref(n),
|
|
3770
3860
|
"onUpdate:modelValue": l
|
|
3771
3861
|
}, null, 8, ["model-value"]),
|
|
3772
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3862
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3773
3863
|
key: 1,
|
|
3774
3864
|
class: "!mt-[8px]",
|
|
3775
3865
|
text: e.helperText,
|
|
@@ -3780,7 +3870,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3780
3870
|
"model-value": unref(n),
|
|
3781
3871
|
"onUpdate:modelValue": l
|
|
3782
3872
|
}, null, 8, ["model-value"]),
|
|
3783
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3873
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3784
3874
|
key: 0,
|
|
3785
3875
|
class: "!mt-[8px]",
|
|
3786
3876
|
text: e.helperText,
|
|
@@ -3791,7 +3881,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3791
3881
|
"model-value": unref(n),
|
|
3792
3882
|
"onUpdate:modelValue": l
|
|
3793
3883
|
}, null, 8, ["model-value"]),
|
|
3794
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3884
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3795
3885
|
key: 0,
|
|
3796
3886
|
class: "!mt-[8px]",
|
|
3797
3887
|
text: e.helperText,
|
|
@@ -3802,7 +3892,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3802
3892
|
"model-value": unref(n),
|
|
3803
3893
|
"onUpdate:modelValue": l
|
|
3804
3894
|
}, null, 8, ["model-value"]),
|
|
3805
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3895
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3806
3896
|
key: 0,
|
|
3807
3897
|
class: "!mt-[8px]",
|
|
3808
3898
|
text: e.helperText,
|
|
@@ -3813,13 +3903,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3813
3903
|
"model-value": unref(n),
|
|
3814
3904
|
"onUpdate:modelValue": l
|
|
3815
3905
|
}, null, 8, ["model-value"]),
|
|
3816
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3906
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3817
3907
|
key: 0,
|
|
3818
3908
|
class: "!mt-[8px]",
|
|
3819
3909
|
text: e.helperText,
|
|
3820
3910
|
state: "error"
|
|
3821
3911
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3822
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
3912
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(i.field), 1));
|
|
3823
3913
|
};
|
|
3824
3914
|
}
|
|
3825
3915
|
}), _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 +3922,25 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3832
3922
|
},
|
|
3833
3923
|
setup(e) {
|
|
3834
3924
|
const { t: s, te: o } = useI18n();
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3925
|
+
function d(i) {
|
|
3926
|
+
return o(i) || o(i, "en-US");
|
|
3927
|
+
}
|
|
3928
|
+
return (i, c) => {
|
|
3929
|
+
const l = resolveComponent("FmCard");
|
|
3930
|
+
return openBlock(), createBlock(l, {
|
|
3838
3931
|
variant: "outlined",
|
|
3839
3932
|
class: "p-16 space-y-8"
|
|
3840
3933
|
}, {
|
|
3841
3934
|
default: withCtx(() => [
|
|
3842
3935
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(s)("connect.campaign.common.summary")), 1),
|
|
3843
3936
|
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), (
|
|
3937
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (n, a) => (openBlock(), createElementBlock("div", {
|
|
3845
3938
|
class: "space-y-4",
|
|
3846
|
-
key:
|
|
3939
|
+
key: a
|
|
3847
3940
|
}, [
|
|
3848
|
-
|
|
3849
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(s)(`${
|
|
3850
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(
|
|
3941
|
+
n ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3942
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(s)(`${a}`)), 1),
|
|
3943
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(d(`${n}`) ? unref(s)(`${n}`) : n), 1)
|
|
3851
3944
|
], 64)) : createCommentVNode("", !0)
|
|
3852
3945
|
]))), 128))
|
|
3853
3946
|
]),
|
|
@@ -3877,13 +3970,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3877
3970
|
console.log(
|
|
3878
3971
|
TEMPLATES[type],
|
|
3879
3972
|
"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
|
|
3973
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((d, i) => {
|
|
3974
|
+
var c;
|
|
3882
3975
|
if (d.campaign.type === "VOUCHER" && d.campaign.code) {
|
|
3883
|
-
const l = (
|
|
3976
|
+
const l = (c = d.campaign._id) == null ? void 0 : c.toString();
|
|
3884
3977
|
useCampaignStore().campaigns.voucher.some(
|
|
3885
3978
|
(n) => n.code === d.campaign.code && n._id.toString() !== l
|
|
3886
|
-
) &&
|
|
3979
|
+
) && i.addIssue({
|
|
3887
3980
|
code: "custom",
|
|
3888
3981
|
message: "Code already exists, please use another code",
|
|
3889
3982
|
path: ["campaign", "code"]
|
|
@@ -3891,7 +3984,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3891
3984
|
}
|
|
3892
3985
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
3893
3986
|
...(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", {
|
|
3987
|
+
}), "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
3988
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
3896
3989
|
}) : t("connect.campaign.common.create_campaign_title", {
|
|
3897
3990
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
@@ -3928,6 +4021,24 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3928
4021
|
(o) => s.some((d) => o.path.join(".").includes(d))
|
|
3929
4022
|
);
|
|
3930
4023
|
}
|
|
4024
|
+
const validateOnSubmit = computed(() => campaignType.value === "BROADCAST"), submitAttempted = ref(!1), showValidation = computed(
|
|
4025
|
+
() => !validateOnSubmit.value || submitAttempted.value
|
|
4026
|
+
), visibleErrors = computed(
|
|
4027
|
+
() => showValidation.value ? errors.value : []
|
|
4028
|
+
);
|
|
4029
|
+
function hasVisibleStepErrors(e) {
|
|
4030
|
+
return showValidation.value && stepErrors(e).length > 0;
|
|
4031
|
+
}
|
|
4032
|
+
function isNextDisabled() {
|
|
4033
|
+
return validateOnSubmit.value ? !1 : currentStep.value - 1 < template.value.steps.length - 1 ? stepErrors().length > 0 : errors.value.length > 0;
|
|
4034
|
+
}
|
|
4035
|
+
function onNext() {
|
|
4036
|
+
if (stepErrors().length > 0) {
|
|
4037
|
+
submitAttempted.value = !0;
|
|
4038
|
+
return;
|
|
4039
|
+
}
|
|
4040
|
+
submitAttempted.value = !1, currentStep.value++;
|
|
4041
|
+
}
|
|
3931
4042
|
__expose({ showSheet });
|
|
3932
4043
|
function showSummaryDialog() {
|
|
3933
4044
|
Dialog.open({
|
|
@@ -3951,22 +4062,22 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3951
4062
|
return e === "campaign.message" ? "campaign.delivery" : e;
|
|
3952
4063
|
}
|
|
3953
4064
|
function onUpdateProperty(e, s) {
|
|
3954
|
-
var o, d,
|
|
4065
|
+
var o, d, i, c, l, n, a, r;
|
|
3955
4066
|
if (e === "campaign.message" && s && "channels" in s) {
|
|
3956
4067
|
_.set(data.value, "campaign.delivery", s);
|
|
3957
4068
|
const p = toLegacyMessage(s);
|
|
3958
|
-
p
|
|
4069
|
+
p ? _.set(data.value, "campaign.message", p) : delete data.value.campaign.message;
|
|
3959
4070
|
return;
|
|
3960
4071
|
}
|
|
3961
4072
|
if (_.set(data.value, e, s), e == "campaign.event.type") {
|
|
3962
|
-
const v = ((
|
|
4073
|
+
const v = ((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
4074
|
...(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
4075
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
3965
4076
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
3966
4077
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
3967
4078
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
3968
4079
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
3969
|
-
]),
|
|
4080
|
+
]), f = RuleBuilder.setRuleToGroup(
|
|
3970
4081
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
3971
4082
|
[
|
|
3972
4083
|
RuleBuilder.constructEntry(
|
|
@@ -3985,7 +4096,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3985
4096
|
_.set(
|
|
3986
4097
|
data.value,
|
|
3987
4098
|
"campaign.event.rule",
|
|
3988
|
-
RuleBuilder.setRuleToGroup(v,
|
|
4099
|
+
RuleBuilder.setRuleToGroup(v, f)
|
|
3989
4100
|
);
|
|
3990
4101
|
}
|
|
3991
4102
|
e == "campaign.notify" && s == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -4006,6 +4117,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4006
4117
|
}
|
|
4007
4118
|
}
|
|
4008
4119
|
async function onSubmit() {
|
|
4120
|
+
submitAttempted.value = !0;
|
|
4009
4121
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
4010
4122
|
if (!e.success)
|
|
4011
4123
|
return;
|
|
@@ -4016,7 +4128,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4016
4128
|
(s || s === void 0) && (sheetVisible.value = !1);
|
|
4017
4129
|
}
|
|
4018
4130
|
return (e, s) => {
|
|
4019
|
-
const o = resolveComponent("FmButton"), d = resolveComponent("FmStep"),
|
|
4131
|
+
const o = resolveComponent("FmButton"), d = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), c = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
4020
4132
|
return openBlock(), createBlock(l, {
|
|
4021
4133
|
"fullscreen-size": "lg",
|
|
4022
4134
|
modelValue: unref(sheetVisible),
|
|
@@ -4037,7 +4149,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4037
4149
|
createVNode(o, {
|
|
4038
4150
|
onClick: onSubmit,
|
|
4039
4151
|
label: unref(t)("connect.campaign.common.save"),
|
|
4040
|
-
disabled: unref(errors).length > 0
|
|
4152
|
+
disabled: !unref(validateOnSubmit) && unref(errors).length > 0
|
|
4041
4153
|
}, null, 8, ["label", "disabled"])
|
|
4042
4154
|
])
|
|
4043
4155
|
])
|
|
@@ -4072,7 +4184,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4072
4184
|
])
|
|
4073
4185
|
])
|
|
4074
4186
|
], -1)),
|
|
4075
|
-
createVNode(
|
|
4187
|
+
createVNode(c, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
4076
4188
|
])
|
|
4077
4189
|
])
|
|
4078
4190
|
])
|
|
@@ -4082,7 +4194,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4082
4194
|
name: "default",
|
|
4083
4195
|
fn: withCtx(() => [
|
|
4084
4196
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
4085
|
-
createVNode(
|
|
4197
|
+
createVNode(i, {
|
|
4086
4198
|
modelValue: unref(currentStep),
|
|
4087
4199
|
"onUpdate:modelValue": s[1] || (s[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4088
4200
|
orientation: "horizontal",
|
|
@@ -4093,7 +4205,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4093
4205
|
key: n.name,
|
|
4094
4206
|
title: unref(getLocaleText)(n.name_locale, n.name),
|
|
4095
4207
|
value: a + 1,
|
|
4096
|
-
error: () =>
|
|
4208
|
+
error: () => hasVisibleStepErrors(a),
|
|
4097
4209
|
complete: () => a + 1 <= unref(currentStep)
|
|
4098
4210
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
4099
4211
|
]),
|
|
@@ -4105,7 +4217,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4105
4217
|
variant: "tertiary",
|
|
4106
4218
|
onClick: s[2] || (s[2] = (n) => sheetVisible.value = !1)
|
|
4107
4219
|
}),
|
|
4108
|
-
createVNode(
|
|
4220
|
+
createVNode(i, {
|
|
4109
4221
|
modelValue: unref(currentStep),
|
|
4110
4222
|
"onUpdate:modelValue": s[3] || (s[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4111
4223
|
orientation: "horizontal",
|
|
@@ -4117,7 +4229,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4117
4229
|
title: unref(sheetTitle),
|
|
4118
4230
|
description: unref(getLocaleText)(n.name_locale, n.name),
|
|
4119
4231
|
value: a + 1,
|
|
4120
|
-
error: () =>
|
|
4232
|
+
error: () => hasVisibleStepErrors(a),
|
|
4121
4233
|
complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
4122
4234
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
4123
4235
|
]),
|
|
@@ -4157,9 +4269,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4157
4269
|
modelValue: valueForField(r.property),
|
|
4158
4270
|
disabled: isDisable(r),
|
|
4159
4271
|
"campaign-type": unref(campaignType),
|
|
4272
|
+
"show-validation": unref(showValidation),
|
|
4160
4273
|
"onUpdate:modelValue": (v) => onUpdateProperty(r.property, v),
|
|
4161
|
-
"onUpdate:file": async (v,
|
|
4162
|
-
const V = await onUpdateFile(v,
|
|
4274
|
+
"onUpdate:file": async (v, f) => {
|
|
4275
|
+
const V = await onUpdateFile(v, f);
|
|
4163
4276
|
onUpdateProperty(r.property, V || "");
|
|
4164
4277
|
},
|
|
4165
4278
|
schema: unref(ZodHelper).typeAtPath(
|
|
@@ -4168,15 +4281,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4168
4281
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
4169
4282
|
),
|
|
4170
4283
|
"helper-state": unref(ZodHelper).helperState(
|
|
4171
|
-
unref(
|
|
4284
|
+
unref(visibleErrors),
|
|
4172
4285
|
schemaPathForField(r.property)
|
|
4173
4286
|
),
|
|
4174
4287
|
"helper-text": unref(ZodHelper).helperText(
|
|
4175
|
-
unref(
|
|
4288
|
+
unref(visibleErrors),
|
|
4176
4289
|
schemaPathForField(r.property)
|
|
4177
4290
|
),
|
|
4178
4291
|
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"]))
|
|
4292
|
+
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
4180
4293
|
]))), 128))
|
|
4181
4294
|
]))), 128)),
|
|
4182
4295
|
createElementVNode("div", _hoisted_8, [
|
|
@@ -4187,9 +4300,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4187
4300
|
onClick: s[5] || (s[5] = (n) => currentStep.value--)
|
|
4188
4301
|
}, null, 8, ["label", "disabled"]),
|
|
4189
4302
|
createVNode(o, {
|
|
4190
|
-
disabled:
|
|
4303
|
+
disabled: isNextDisabled(),
|
|
4191
4304
|
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 ?
|
|
4305
|
+
onClick: s[6] || (s[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? onNext() : onSubmit())
|
|
4193
4306
|
}, null, 8, ["disabled", "label"])
|
|
4194
4307
|
])
|
|
4195
4308
|
]),
|