@feedmepos/mf-connect 0.1.98-beta.72 → 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-DpYceiwG.js → App-C4XD_vWL.js} +8 -8
- package/dist/{AuditLogs-CG98b2qE.js → AuditLogs-DpevHGsA.js} +11 -11
- package/dist/{Bin-vdipv2fF.js → Bin-FRrYZ8pV.js} +8 -8
- package/dist/{Broadcast-ChwVqheE.js → Broadcast-CoefxWt-.js} +11 -11
- package/dist/{CampaignAnalytic-4PHO849x.js → CampaignAnalytic-CdZjzsLr.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DmnN4pjm.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DQOLEDzY.js} +6 -6
- package/dist/{Card-B6ol3PQw.js → Card-BABL96V6.js} +21 -21
- package/dist/{Collections-DodNIUr1.js → Collections-D6XuhBO1.js} +8 -8
- package/dist/{Credit-CJQyAZYw.js → Credit-D2WTeN8Z.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang--FqHJ7Ez.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B0KkvFWi.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CA31QP-A.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-G2oU70Ef.js} +546 -497
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DkKhdp7G.js → EffectSheet.vue_vue_type_style_index_0_lang-C4RByg0k.js} +6 -6
- package/dist/{Experience-iLAKddx_.js → Experience-CUqmspwT.js} +12 -12
- package/dist/{FileSaver.min-w_ExQ0py.js → FileSaver.min-DX17A8Gj.js} +1 -1
- package/dist/{Game-DWdUbsAg.js → Game-D8IvyDdA.js} +13 -13
- package/dist/{GiftCardSetup-DnQ5vwxu.js → GiftCardSetup-BOSKBH8c.js} +10 -10
- package/dist/{Grab-CFLRHs5w.js → Grab-CnBGt_H2.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-uQJvjvTe.js → ImageInput.vue_vue_type_script_setup_true_lang-BI00YCKv.js} +1 -1
- package/dist/{Index-CUy4z2tS.js → Index-BovDOTbf.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-hKJ41Fe_.js → LocationPicker.vue_vue_type_script_setup_true_lang-D8auavm7.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BDmtqTVC.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BM99IoIG.js} +1 -1
- package/dist/{LoyaltyDashboard-C5o7KriA.js → LoyaltyDashboard-DiCQnQ76.js} +13 -13
- package/dist/{MainLayout-Dt0ywph3.js → MainLayout-Cg37dK-P.js} +3 -3
- package/dist/{Marketing-BHwxzBZ0.js → Marketing-DRCT9dBo.js} +4 -4
- package/dist/{MarketingMaterialEdit-B6k4ceGx.js → MarketingMaterialEdit-DcE0A8_A.js} +6 -6
- package/dist/{Member-DcPZfTj6.js → Member-C8T1-ywK.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CiiBrlHY.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CTl8LtJ9.js} +23 -23
- package/dist/{MemberImportHistory-DmPMuu1g.js → MemberImportHistory-CYCxxxN7.js} +7 -7
- package/dist/{MemberList-f9JejfNW.js → MemberList-Ddlnm4JX.js} +14 -14
- package/dist/{MemberTransactions-D1YSXeX-.js → MemberTransactions-DwyZTeZb.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-freeE-DP.js → MessageInput.vue_vue_type_script_setup_true_lang-BWCxGlQO.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-m7ytg0ok.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-LdVeH7gh.js} +1 -1
- package/dist/{Mission-BaaEl5BV.js → Mission-CW0y8Bzw.js} +13 -13
- package/dist/{Overview-fx-0E3b8.js → Overview-CO4T3l6l.js} +19 -19
- package/dist/{Overview-CviY55Gs.js → Overview-i2XPL7Pu.js} +4 -4
- package/dist/{Point-BfqtflbC.js → Point-CNWdfqQZ.js} +12 -12
- package/dist/{Promotion-Be2ogRYt.js → Promotion-DAemCP79.js} +13 -13
- package/dist/{Queue-CLSUL-Cx.js → Queue-DI50gMny.js} +11 -11
- package/dist/{Record-CpTMQT7B.js → Record-DX3WHXku.js} +9 -9
- package/dist/{Review-DzSDx7dY.js → Review-DzSNG4Le.js} +2 -2
- package/dist/{ReviewFacebookCallback-CvbPJADM.js → ReviewFacebookCallback-CrdRUN3t.js} +5 -5
- package/dist/{ReviewGoogleCallback-DJlqMbh3.js → ReviewGoogleCallback-Da28WNzU.js} +5 -5
- package/dist/{Reward-DJOmd6Z5.js → Reward-DUQAE99I.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DY9fYxwc.js → RewardGroup.vue_vue_type_script_setup_true_lang-BGAOPkwD.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BgYK4hpo.js → RuleGroup.vue_vue_type_script_setup_true_lang-B9Dbe9no.js} +13 -13
- package/dist/{Segment-G6xmeEaq.js → Segment-BgVf2-G2.js} +24 -24
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3O0biLZ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDLXF5HM.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CWP5sGT7.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-9UiH43em.js} +4 -4
- package/dist/{Setting-CKp441AW.js → Setting-3jW6EbKA.js} +14 -14
- package/dist/{SettingAdvertisements-C4Uf-DgK.js → SettingAdvertisements-C40QcuSn.js} +12 -12
- package/dist/{Settings-CTvMVwp6.js → Settings-DT9bypKs.js} +5 -5
- package/dist/{Store-Bzei6Xev.js → Store-DQyOUfEJ.js} +25 -25
- package/dist/{StoreRewards-DMQNIpF5.js → StoreRewards-Dr_c0PbO.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-mm1jbcvo.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bh5h8Lc_.js} +24 -24
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BspBXIO2.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-LquvtnTy.js} +2 -2
- package/dist/{Tier-BN32RwYr.js → Tier-DmqfEWcB.js} +25 -25
- package/dist/{Title-BIhgfRUI.js → Title-Dx6pcJfP.js} +21 -21
- package/dist/{Transaction-CPjA7IN9.js → Transaction-CD6agt6m.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DSutMvfk.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CNjBtitb.js} +6 -6
- package/dist/{Voucher-CGJtn9bC.js → Voucher-P4dyOeUd.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B-IwtPvx.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Bv--fzY0.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Ce9xPwqA.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bq_7U0NO.js} +2 -2
- package/dist/{app-DAtx6aZ4.js → app-CmqX1V1B.js} +1254 -1239
- package/dist/app.js +1 -1
- package/dist/{base.export-BtRC4aWM.js → base.export-guVE-B2c.js} +2 -2
- package/dist/{business-BZUIs8Ub.js → business-DXmGtwPm.js} +1 -1
- package/dist/{campaign-B6I6PuY4.js → campaign-CVXbgs-y.js} +2 -2
- package/dist/{campaign-DKjBjV2k.js → campaign-D9Jufumh.js} +103 -101
- package/dist/{campaign.enum-BQy3e845.js → campaign.enum-CXhYMbkx.js} +1 -1
- package/dist/{campaign.fn--qVJ3jeH.js → campaign.fn-DoJPn6yl.js} +27 -27
- package/dist/{collectible.enum-vcvRFGl0.js → collectible.enum-Tk6LIMMm.js} +1 -1
- package/dist/{collection.fn-C3bMPBkC.js → collection.fn-DCVNYQau.js} +2 -2
- package/dist/{currency--R6VPInw.js → currency-BYhkCI6F.js} +1 -1
- package/dist/{duplicateCampaign-aIsX9cCi.js → duplicateCampaign-BOVBZHFs.js} +2 -2
- package/dist/{effect-CbjmtRph.js → effect-e6wYWgc8.js} +1 -1
- package/dist/{email-addresses-DZKMnoKf.js → email-addresses-Dcd_vAeM.js} +2 -2
- package/dist/{helper-BGqw2-RO.js → helper-DluoQ6zi.js} +1 -1
- package/dist/{index-kkhrPH6s.js → index-2QCDTrA9.js} +2 -2
- package/dist/{index-LnCoUCnx.js → index-BAs9N7bi.js} +3 -3
- package/dist/{index-CVvSd60O.js → index-BFzBAm6P.js} +1 -1
- package/dist/{index-ClP7Xy6Q.js → index-BpAhyOgv.js} +1 -1
- package/dist/{index-Bb4TieR_.js → index-C-oypk0K.js} +3 -3
- package/dist/{index-B9DM5Vuv.js → index-C9JY8Ru6.js} +2 -2
- package/dist/{index-DcA0B-Y5.js → index-CBRWvjup.js} +7 -7
- package/dist/{index-D-P90w8K.js → index-CDdNExzM.js} +1 -1
- package/dist/{index-CVYbfRGO.js → index-ChYMoLaB.js} +1 -1
- package/dist/{index-v8Zv-2ko.js → index-CiJQlOu7.js} +7 -7
- package/dist/{index-C22GPEM-.js → index-DB51l5yi.js} +1 -1
- package/dist/{index-FnsjvtSo.js → index-DIP_uzZm.js} +5 -5
- package/dist/{index-7TKoSEJ2.js → index-DKrJlWH3.js} +1124 -1124
- package/dist/{index-CXL5WAH0.js → index-DoiGG41P.js} +3 -3
- package/dist/{index-D_o9LsHU.js → index-SQItAw7w.js} +3 -3
- package/dist/{index-BbpqZrkB.js → index-SS72WJs_.js} +1 -1
- package/dist/{index-BWlfW4Kr.js → index-kPcRcSFx.js} +2 -2
- package/dist/{index-LlFZ5kxi.js → index-qkkPuNFM.js} +5 -5
- package/dist/{index.esm2017-DO7bbE7J.js → index.esm2017-BLVWhb4f.js} +1 -1
- package/dist/{loading-CzWOx4tE.js → loading-ClX4Z1ZH.js} +1 -1
- package/dist/{lodash-B_gr6Ayu.js → lodash-Cxh2BWuW.js} +1 -1
- package/dist/{member-import-BxCrd9tq.js → member-import-DKfSDn0D.js} +1 -1
- package/dist/{membership-ILB4aB4h.js → membership-BBAosVNQ.js} +3 -3
- package/dist/{money-CpIK1N_r.js → money-CWzvdiFT.js} +1 -1
- package/dist/{number-leVwmDCm.js → number-Cp7TGBzd.js} +1 -1
- package/dist/{objectid-8hKuNcMN.js → objectid-CXWfUmP_.js} +9 -9
- package/dist/{plugins-DLIgnFIF.js → plugins-BKD6oEHa.js} +3 -3
- package/dist/{reward-DqT0zF01.js → reward-CrjStT4w.js} +1 -1
- package/dist/{rule-DBtMGLxD.js → rule-CBZRptRM.js} +8 -8
- package/dist/{template-CYKGCWY4.js → template-D4qWK9tk.js} +6 -6
- package/dist/{timezone-Brs5nrTL.js → timezone-t0WxSk3e.js} +1 -1
- package/dist/{transaction.fn-0ZZcVp-j.js → transaction.fn-DZp6Drqf.js} +2 -2
- package/dist/{trigger-LhNre1L9.js → trigger-DN5yeimJ.js} +5 -5
- package/dist/{useMarketingMaterialActions-DbDRMmhM.js → useMarketingMaterialActions-ChkZyyRO.js} +3 -3
- package/dist/{usePagination-DmZX0V64.js → usePagination-Vda9U5Dh.js} +1 -1
- package/dist/{user-CBPsvnx9.js → user-jEjTV3E6.js} +1 -1
- package/dist/{vue-i18n-BPeSHE3c.js → vue-i18n-Bg_RJ_GV.js} +474 -474
- package/dist/{xlsx-Cm3vGmLN.js → xlsx-unW4U5Tx.js} +440 -440
- package/dist/{zod-GTEcy37q.js → zod-DIsCEUuE.js} +1 -1
- package/package.json +1 -1
|
@@ -1,45 +1,45 @@
|
|
|
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 { 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-
|
|
11
|
-
import { u as useMembershipStore } from "./membership-
|
|
12
|
-
import { u as useBusinessStore } from "./business-
|
|
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";
|
|
13
13
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
14
14
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
15
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
16
|
-
import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
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-
|
|
18
|
-
import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { c as core, S as SvcConfig } from "./index-
|
|
20
|
-
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";
|
|
21
21
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
22
|
-
import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
24
|
-
import { u as useI18n } from "./vue-i18n-
|
|
25
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-
|
|
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-
|
|
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";
|
|
27
27
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
28
|
-
import { c as campaignApi } from "./index-
|
|
29
|
-
import { m as membershipApi } from "./index-
|
|
30
|
-
import { m as moment } from "./index-
|
|
31
|
-
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-
|
|
32
|
-
import { C as CountryTimezone } from "./timezone-
|
|
33
|
-
import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
34
|
-
import "./index-
|
|
35
|
-
import "./index-
|
|
36
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
37
|
-
import { u as useLoading } from "./loading-
|
|
38
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
39
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
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
45
|
var i, c;
|
|
@@ -124,8 +124,8 @@ function campaignRefinement(e, s) {
|
|
|
124
124
|
}
|
|
125
125
|
];
|
|
126
126
|
n.length == l.length && n.every((r) => l.some((p) => {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
127
|
+
const v = RuleBuilder.simplify(p);
|
|
128
|
+
return v.property === r.property && r.operator.includes(v.operator);
|
|
129
129
|
})) || s.addIssue({
|
|
130
130
|
code: "custom",
|
|
131
131
|
path: ["campaign", "event", "rule"],
|
|
@@ -352,7 +352,7 @@ const _hoisted_1$r = {
|
|
|
352
352
|
d("confirm", a);
|
|
353
353
|
}
|
|
354
354
|
return (a, r) => {
|
|
355
|
-
const p = resolveComponent("FmIcon"),
|
|
355
|
+
const p = resolveComponent("FmIcon"), v = resolveComponent("FmButton");
|
|
356
356
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
|
|
357
357
|
createElementVNode("div", _hoisted_2$n, [
|
|
358
358
|
createElementVNode("div", _hoisted_3$k, [
|
|
@@ -362,7 +362,7 @@ const _hoisted_1$r = {
|
|
|
362
362
|
}),
|
|
363
363
|
r[0] || (r[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
|
|
364
364
|
]),
|
|
365
|
-
createVNode(
|
|
365
|
+
createVNode(v, {
|
|
366
366
|
icon: "close",
|
|
367
367
|
variant: "tertiary",
|
|
368
368
|
onClick: l
|
|
@@ -380,12 +380,12 @@ const _hoisted_1$r = {
|
|
|
380
380
|
}, null, 8, ["initial-value", "filter-items"])
|
|
381
381
|
]),
|
|
382
382
|
createElementVNode("div", _hoisted_5$g, [
|
|
383
|
-
createVNode(
|
|
383
|
+
createVNode(v, {
|
|
384
384
|
variant: "secondary",
|
|
385
385
|
label: "Cancel",
|
|
386
386
|
onClick: l
|
|
387
387
|
}),
|
|
388
|
-
createVNode(
|
|
388
|
+
createVNode(v, {
|
|
389
389
|
variant: "primary",
|
|
390
390
|
label: "Confirm Selection",
|
|
391
391
|
onClick: c
|
|
@@ -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({
|
|
@@ -432,10 +432,10 @@ const _hoisted_1$r = {
|
|
|
432
432
|
}), onMounted(async () => {
|
|
433
433
|
await i.store.getMenu(), p();
|
|
434
434
|
});
|
|
435
|
-
function
|
|
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;
|
|
@@ -446,18 +446,18 @@ const _hoisted_1$r = {
|
|
|
446
446
|
c.value[u] = !1;
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function k() {
|
|
450
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
|
-
const
|
|
456
|
+
const g = computed(() => a.value.length > 0 && a.value.every(
|
|
457
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
|
-
label: `${
|
|
484
|
-
onClick:
|
|
483
|
+
label: `${g.value ? "Deselect" : "Select"} All`,
|
|
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",
|
|
@@ -506,26 +506,26 @@ const _hoisted_1$r = {
|
|
|
506
506
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (w) => (openBlock(), createBlock(N, {
|
|
507
507
|
key: w.id,
|
|
508
508
|
clickable: !0,
|
|
509
|
-
onClick: (O) =>
|
|
509
|
+
onClick: (O) => v(w.id)
|
|
510
510
|
}, {
|
|
511
511
|
leading: withCtx(() => [
|
|
512
512
|
createVNode(F, {
|
|
513
513
|
"model-value": c.value[w.id] || !1,
|
|
514
514
|
value: w.id,
|
|
515
|
-
"onUpdate:modelValue": (O) =>
|
|
515
|
+
"onUpdate:modelValue": (O) => v(w.id),
|
|
516
516
|
onClick: m[1] || (m[1] = withModifiers(() => {
|
|
517
517
|
}, ["stop"]))
|
|
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,7 +557,7 @@ 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
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({
|
|
@@ -585,16 +585,16 @@ const _hoisted_1$r = {
|
|
|
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);
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function v() {
|
|
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,13 +602,13 @@ 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
|
-
function
|
|
611
|
+
function g(b) {
|
|
612
612
|
return b != null && b.includes("Percentage") || b === "percentage" ? "%" : "$";
|
|
613
613
|
}
|
|
614
614
|
function u(b, B) {
|
|
@@ -629,7 +629,7 @@ const _hoisted_1$r = {
|
|
|
629
629
|
}, b === "type") {
|
|
630
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
635
|
type: ((U = P[0]) == null ? void 0 : U.value) || "net",
|
|
@@ -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.";
|
|
@@ -713,7 +713,7 @@ const _hoisted_1$r = {
|
|
|
713
713
|
return "No items selected";
|
|
714
714
|
const B = i.menu.value;
|
|
715
715
|
return B && b.length <= 3 ? b.map((P) => {
|
|
716
|
-
const A = B.modules.item.find((
|
|
716
|
+
const A = B.modules.item.find((h) => h._id === P);
|
|
717
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
|
}
|
|
@@ -724,7 +724,7 @@ const _hoisted_1$r = {
|
|
|
724
724
|
return "No categories selected";
|
|
725
725
|
const B = i.menu.value;
|
|
726
726
|
return B && b.length <= 3 ? b.map((P) => {
|
|
727
|
-
const A = B.modules.category.find((
|
|
727
|
+
const A = B.modules.category.find((h) => h._id === P);
|
|
728
728
|
return A ? A.name : `Category ${P}`;
|
|
729
729
|
}).join(", ") : b.length === 1 ? "1 category selected" : `${b.length} categories selected`;
|
|
730
730
|
}
|
|
@@ -749,7 +749,7 @@ const _hoisted_1$r = {
|
|
|
749
749
|
const G = computed(() => {
|
|
750
750
|
var B, T, U;
|
|
751
751
|
const b = [];
|
|
752
|
-
return a.value.type || b.push("Discount type is required"), (B = a.value.scope) != null && B.type || b.push("Scope 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
754
|
function Y() {
|
|
755
755
|
d("update:model-value", a.value), c.value = !1;
|
|
@@ -760,8 +760,8 @@ const _hoisted_1$r = {
|
|
|
760
760
|
{ label: "Category discount", value: "category" }
|
|
761
761
|
];
|
|
762
762
|
return (b, B) => {
|
|
763
|
-
const T = resolveComponent("FmButton"), U = resolveComponent("FmSelect"), P = resolveComponent("FmStepperField"), A = resolveComponent("FmIcon"),
|
|
764
|
-
return openBlock(), createBlock(
|
|
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
767
|
modelValue: unref(c),
|
|
@@ -829,7 +829,7 @@ const _hoisted_1$r = {
|
|
|
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
835
|
B[9] || (B[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
|
|
@@ -837,16 +837,16 @@ const _hoisted_1$r = {
|
|
|
837
837
|
"model-value": unref(a).type,
|
|
838
838
|
"onUpdate:modelValue": B[1] || (B[1] = (L) => u("type", L)),
|
|
839
839
|
placeholder: "Select discount type",
|
|
840
|
-
items:
|
|
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
847
|
"onUpdate:modelValue": B[2] || (B[2] = (L) => unref(a).value = L),
|
|
848
|
-
placeholder:
|
|
849
|
-
suffix:
|
|
848
|
+
placeholder: y(unref(a).type),
|
|
849
|
+
suffix: g(unref(a).type),
|
|
850
850
|
type: "number"
|
|
851
851
|
}, null, 8, ["modelValue", "placeholder", "suffix"])
|
|
852
852
|
])) : createCommentVNode("", !0),
|
|
@@ -993,14 +993,14 @@ const _hoisted_1$r = {
|
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
995
|
return (n, a) => {
|
|
996
|
-
var
|
|
996
|
+
var v;
|
|
997
997
|
const r = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
|
|
998
998
|
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
999
999
|
createVNode(p, {
|
|
1000
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(() => [
|
|
@@ -1020,12 +1020,12 @@ const _hoisted_1$r = {
|
|
|
1020
1020
|
class: "!mt-[0px]",
|
|
1021
1021
|
"include-only": "trigger",
|
|
1022
1022
|
"trigger-type": "SCHEDULE",
|
|
1023
|
-
"model-value": ((
|
|
1024
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
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] = (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
|
))
|
|
@@ -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, i = s
|
|
1293
|
-
function
|
|
1297
|
+
const { t: o } = useI18n(), d = e, i = s;
|
|
1298
|
+
function c(V) {
|
|
1294
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, i = s, c =
|
|
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(c).map((
|
|
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
|
};
|
|
@@ -1553,29 +1600,29 @@ const _hoisted_1$r = {
|
|
|
1553
1600
|
), c = computed(
|
|
1554
1601
|
() => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
|
|
1555
1602
|
), l = computed(() => {
|
|
1556
|
-
var
|
|
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
|
-
var
|
|
1561
|
-
const p = ((
|
|
1607
|
+
var 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}
|
|
1565
1612
|
</style>${p}` : "";
|
|
1566
1613
|
}), a = computed(() => {
|
|
1567
|
-
const p = /* @__PURE__ */ new Date(),
|
|
1614
|
+
const p = /* @__PURE__ */ new Date(), v = p.toLocaleDateString(void 0, {
|
|
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 `${
|
|
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
|
-
return (p,
|
|
1578
|
-
var
|
|
1624
|
+
return (p, v) => {
|
|
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,15 +1642,15 @@ 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 = (
|
|
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),
|
|
1605
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),
|
|
1606
|
-
(
|
|
1653
|
+
(x = unref(i)) != null && x.imageUrl ? (openBlock(), createElementBlock("img", {
|
|
1607
1654
|
key: 0,
|
|
1608
1655
|
src: unref(i).imageUrl,
|
|
1609
1656
|
alt: "",
|
|
@@ -1682,7 +1729,7 @@ const _hoisted_1$r = {
|
|
|
1682
1729
|
"icon-color": "neutral-gray-400",
|
|
1683
1730
|
variant: "tertiary",
|
|
1684
1731
|
disabled: p === 0,
|
|
1685
|
-
onClick: (
|
|
1732
|
+
onClick: (v) => i.$emit("move", r.channel, -1)
|
|
1686
1733
|
}, null, 8, ["disabled", "onClick"])
|
|
1687
1734
|
], 8, _hoisted_11$2),
|
|
1688
1735
|
createElementVNode("span", {
|
|
@@ -1694,7 +1741,7 @@ const _hoisted_1$r = {
|
|
|
1694
1741
|
"icon-color": "neutral-gray-400",
|
|
1695
1742
|
variant: "tertiary",
|
|
1696
1743
|
disabled: p === e.rows.length - 1,
|
|
1697
|
-
onClick: (
|
|
1744
|
+
onClick: (v) => i.$emit("move", r.channel, 1)
|
|
1698
1745
|
}, null, 8, ["disabled", "onClick"])
|
|
1699
1746
|
], 8, _hoisted_12$1),
|
|
1700
1747
|
createElementVNode("span", {
|
|
@@ -1705,7 +1752,7 @@ const _hoisted_1$r = {
|
|
|
1705
1752
|
icon: "delete",
|
|
1706
1753
|
"icon-color": "neutral-gray-400",
|
|
1707
1754
|
variant: "tertiary",
|
|
1708
|
-
onClick: (
|
|
1755
|
+
onClick: (v) => i.$emit("remove", r.channel)
|
|
1709
1756
|
}, null, 8, ["onClick"])
|
|
1710
1757
|
], 8, _hoisted_13$1)
|
|
1711
1758
|
])
|
|
@@ -1783,41 +1830,41 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1783
1830
|
emits: ["update:model-value"],
|
|
1784
1831
|
setup(e, { emit: s }) {
|
|
1785
1832
|
const { t: o } = useI18n(), d = useCoreStore(), i = useMembershipStore(), c = e, l = s, n = ref(!1), a = ref("SMS"), r = computed(() => {
|
|
1786
|
-
const
|
|
1787
|
-
return
|
|
1833
|
+
const h = c.modelValue;
|
|
1834
|
+
return h && "channels" in h ? h : toDelivery({ message: h });
|
|
1788
1835
|
});
|
|
1789
|
-
function p(
|
|
1790
|
-
l("update:model-value",
|
|
1836
|
+
function p(h) {
|
|
1837
|
+
l("update:model-value", h);
|
|
1791
1838
|
}
|
|
1792
|
-
function h
|
|
1793
|
-
return o(`connect.campaign.broadcast.channel.${
|
|
1839
|
+
function v(h) {
|
|
1840
|
+
return o(`connect.campaign.broadcast.channel.${h}`);
|
|
1794
1841
|
}
|
|
1795
|
-
const
|
|
1842
|
+
const f = {
|
|
1796
1843
|
SMS: "chat",
|
|
1797
1844
|
WHATSAPP: "chat",
|
|
1798
1845
|
EMAIL: "mail",
|
|
1799
1846
|
APP_INBOX: "inbox",
|
|
1800
1847
|
PUSH: "notifications"
|
|
1801
1848
|
};
|
|
1802
|
-
function V(
|
|
1803
|
-
return
|
|
1849
|
+
function V(h) {
|
|
1850
|
+
return f[h];
|
|
1804
1851
|
}
|
|
1805
|
-
const
|
|
1852
|
+
const k = computed(() => r.value.mode === "fallback"), y = computed(
|
|
1806
1853
|
() => c.variables.filter(
|
|
1807
|
-
(
|
|
1854
|
+
(h) => c.triggerType == "SCHEDULE" ? !h.startsWith("transaction.") : !0
|
|
1808
1855
|
)
|
|
1809
1856
|
);
|
|
1810
|
-
function
|
|
1811
|
-
return
|
|
1857
|
+
function g(h) {
|
|
1858
|
+
return h === "WHATSAPP" ? n.value : !0;
|
|
1812
1859
|
}
|
|
1813
1860
|
const u = ["fallback", "all"];
|
|
1814
|
-
function m(
|
|
1815
|
-
|
|
1861
|
+
function m(h) {
|
|
1862
|
+
h !== r.value.mode && p(setMode(r.value, h));
|
|
1816
1863
|
}
|
|
1817
1864
|
const C = ref(null);
|
|
1818
|
-
function
|
|
1865
|
+
function x(h) {
|
|
1819
1866
|
var R;
|
|
1820
|
-
const E = (R = C.value) == null ? void 0 : R[
|
|
1867
|
+
const E = (R = C.value) == null ? void 0 : R[h];
|
|
1821
1868
|
return E ? new Intl.NumberFormat(void 0, {
|
|
1822
1869
|
style: "currency",
|
|
1823
1870
|
currency: E.currency,
|
|
@@ -1826,126 +1873,126 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1826
1873
|
}).format(E.amount / 10 ** E.precision) : null;
|
|
1827
1874
|
}
|
|
1828
1875
|
const $ = computed(
|
|
1829
|
-
() => CHANNEL_DISPLAY_ORDER.map((
|
|
1830
|
-
const E = r.value.channels.includes(
|
|
1876
|
+
() => CHANNEL_DISPLAY_ORDER.map((h) => {
|
|
1877
|
+
const E = r.value.channels.includes(h), R = x(h);
|
|
1831
1878
|
return {
|
|
1832
|
-
channel:
|
|
1833
|
-
label: h
|
|
1879
|
+
channel: h,
|
|
1880
|
+
label: v(h),
|
|
1834
1881
|
selected: E,
|
|
1835
|
-
available:
|
|
1836
|
-
rateNote: isPaidChannel(
|
|
1882
|
+
available: g(h),
|
|
1883
|
+
rateNote: isPaidChannel(h) ? R ? o("connect.campaign.broadcast.perMessage", { price: R }) : null : o("connect.campaign.broadcast.freeChannel"),
|
|
1837
1884
|
// In fallback mode the grid is a radio for the primary channel, so only
|
|
1838
1885
|
// the primary reads as checked; a fallback is tagged instead.
|
|
1839
|
-
checked:
|
|
1840
|
-
usedAsFallback:
|
|
1886
|
+
checked: k.value ? r.value.channels[0] === h : E,
|
|
1887
|
+
usedAsFallback: k.value && r.value.channels.indexOf(h) > 0
|
|
1841
1888
|
};
|
|
1842
1889
|
})
|
|
1843
1890
|
);
|
|
1844
|
-
async function F(
|
|
1845
|
-
if (
|
|
1846
|
-
if (
|
|
1847
|
-
await N(
|
|
1891
|
+
async function F(h) {
|
|
1892
|
+
if (g(h)) {
|
|
1893
|
+
if (k.value) {
|
|
1894
|
+
await N(h);
|
|
1848
1895
|
return;
|
|
1849
1896
|
}
|
|
1850
|
-
if (r.value.channels.includes(
|
|
1851
|
-
await D(
|
|
1897
|
+
if (r.value.channels.includes(h)) {
|
|
1898
|
+
await D(h);
|
|
1852
1899
|
return;
|
|
1853
1900
|
}
|
|
1854
|
-
p(addChannel(r.value,
|
|
1901
|
+
p(addChannel(r.value, h, y.value));
|
|
1855
1902
|
}
|
|
1856
1903
|
}
|
|
1857
|
-
async function N(
|
|
1904
|
+
async function N(h) {
|
|
1858
1905
|
const E = r.value.channels[0];
|
|
1859
|
-
E !==
|
|
1906
|
+
E !== h && (E && hasDraft(r.value, E) && !await prompt.remove(
|
|
1860
1907
|
o("connect.campaign.broadcast.replaceChannelConfirm", {
|
|
1861
|
-
channel:
|
|
1862
|
-
next: h
|
|
1908
|
+
channel: v(E),
|
|
1909
|
+
next: v(h)
|
|
1863
1910
|
})
|
|
1864
|
-
) || (p(setPrimaryChannel(r.value,
|
|
1911
|
+
) || (p(setPrimaryChannel(r.value, h, y.value)), a.value = h));
|
|
1865
1912
|
}
|
|
1866
|
-
async function D(
|
|
1867
|
-
if (hasDraft(r.value,
|
|
1913
|
+
async function D(h) {
|
|
1914
|
+
if (hasDraft(r.value, h) && !await prompt.remove(
|
|
1868
1915
|
o("connect.campaign.broadcast.removeChannelConfirm", {
|
|
1869
|
-
channel: h
|
|
1916
|
+
channel: v(h)
|
|
1870
1917
|
})
|
|
1871
1918
|
))
|
|
1872
1919
|
return;
|
|
1873
|
-
const E = removeChannel(r.value,
|
|
1874
|
-
p(E), a.value ===
|
|
1920
|
+
const E = removeChannel(r.value, h);
|
|
1921
|
+
p(E), a.value === h && (a.value = E.channels[0] ?? "SMS");
|
|
1875
1922
|
}
|
|
1876
|
-
function w(
|
|
1877
|
-
p(moveChannel(r.value,
|
|
1923
|
+
function w(h, E) {
|
|
1924
|
+
p(moveChannel(r.value, h, E));
|
|
1878
1925
|
}
|
|
1879
1926
|
const O = computed(
|
|
1880
|
-
() => r.value.channels.slice(1).map((
|
|
1881
|
-
channel:
|
|
1882
|
-
label: h
|
|
1927
|
+
() => r.value.channels.slice(1).map((h, E) => ({
|
|
1928
|
+
channel: h,
|
|
1929
|
+
label: v(h),
|
|
1883
1930
|
position: E + 2,
|
|
1884
|
-
complete: !c.showValidation || isChannelComplete(r.value,
|
|
1931
|
+
complete: !c.showValidation || isChannelComplete(r.value, h)
|
|
1885
1932
|
}))
|
|
1886
1933
|
), j = computed(
|
|
1887
1934
|
() => CHANNEL_DISPLAY_ORDER.filter(
|
|
1888
|
-
(
|
|
1889
|
-
).map((
|
|
1890
|
-
channel:
|
|
1891
|
-
label: h
|
|
1935
|
+
(h) => !r.value.channels.includes(h) && g(h)
|
|
1936
|
+
).map((h) => ({
|
|
1937
|
+
channel: h,
|
|
1938
|
+
label: v(h)
|
|
1892
1939
|
}))
|
|
1893
1940
|
), I = computed(
|
|
1894
|
-
() => r.value.channels.map((
|
|
1895
|
-
key:
|
|
1896
|
-
label: h
|
|
1897
|
-
sub:
|
|
1898
|
-
complete: !c.showValidation || isChannelComplete(r.value,
|
|
1899
|
-
step:
|
|
1900
|
-
connector: E === 0 ? void 0 :
|
|
1941
|
+
() => r.value.channels.map((h, E) => ({
|
|
1942
|
+
key: h,
|
|
1943
|
+
label: v(h),
|
|
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 ? "→" : "+"
|
|
1901
1948
|
}))
|
|
1902
1949
|
);
|
|
1903
1950
|
watchEffect(() => {
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1951
|
+
const h = I.value.map((E) => E.key);
|
|
1952
|
+
h.length && !h.includes(a.value) && (a.value = h[0]);
|
|
1906
1953
|
});
|
|
1907
1954
|
const H = computed(() => a.value), q = computed(() => {
|
|
1908
|
-
const
|
|
1909
|
-
if (!(
|
|
1910
|
-
return r.value.content[
|
|
1955
|
+
const h = H.value;
|
|
1956
|
+
if (!(h === "APP_INBOX" || h === "PUSH"))
|
|
1957
|
+
return r.value.content[h];
|
|
1911
1958
|
}), G = computed(
|
|
1912
1959
|
() => r.value.content.APP_INBOX
|
|
1913
1960
|
), Y = computed(
|
|
1914
1961
|
() => r.value.content.PUSH
|
|
1915
1962
|
);
|
|
1916
|
-
function Z(
|
|
1917
|
-
p(setChannelContent(r.value, "APP_INBOX",
|
|
1963
|
+
function Z(h) {
|
|
1964
|
+
p(setChannelContent(r.value, "APP_INBOX", h));
|
|
1918
1965
|
}
|
|
1919
|
-
function b(
|
|
1920
|
-
p(setChannelContent(r.value, "PUSH",
|
|
1966
|
+
function b(h) {
|
|
1967
|
+
p(setChannelContent(r.value, "PUSH", h));
|
|
1921
1968
|
}
|
|
1922
|
-
function B(
|
|
1923
|
-
|
|
1969
|
+
function B(h, E) {
|
|
1970
|
+
h === "APP_INBOX" || h === "PUSH" || p(setChannelContent(r.value, h, { ...E, channel: h }));
|
|
1924
1971
|
}
|
|
1925
1972
|
const T = computed(
|
|
1926
1973
|
() => r.value.channels.filter(isPaidChannel)
|
|
1927
1974
|
), U = computed(() => {
|
|
1928
1975
|
var E, R, M;
|
|
1929
|
-
const
|
|
1930
|
-
return getSmsMessageMetrics({ brandName:
|
|
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) || "";
|
|
1977
|
+
return getSmsMessageMetrics({ brandName: h, content: "" }).prefix;
|
|
1931
1978
|
}), P = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
|
|
1932
1979
|
async function A() {
|
|
1933
1980
|
try {
|
|
1934
|
-
const
|
|
1935
|
-
n.value =
|
|
1981
|
+
const h = await membershipApi.getWhatsappNumbers();
|
|
1982
|
+
n.value = h.some(
|
|
1936
1983
|
(E) => {
|
|
1937
1984
|
var R;
|
|
1938
1985
|
return (R = E == null ? void 0 : E.default) == null ? void 0 : R.includes("Marketing");
|
|
1939
1986
|
}
|
|
1940
1987
|
);
|
|
1941
|
-
} catch (
|
|
1942
|
-
console.error("Failed to fetch WhatsApp numbers:",
|
|
1988
|
+
} catch (h) {
|
|
1989
|
+
console.error("Failed to fetch WhatsApp numbers:", h);
|
|
1943
1990
|
}
|
|
1944
1991
|
}
|
|
1945
1992
|
return onMounted(async () => {
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1948
|
-
}), (
|
|
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) => {
|
|
1949
1996
|
const R = resolveComponent("FmIcon"), M = resolveComponent("FmCard");
|
|
1950
1997
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1951
1998
|
createElementVNode("div", _hoisted_2$d, [
|
|
@@ -1988,7 +2035,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1988
2035
|
])) : createCommentVNode("", !0)
|
|
1989
2036
|
]),
|
|
1990
2037
|
createElementVNode("div", _hoisted_10$3, [
|
|
1991
|
-
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(
|
|
2038
|
+
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(k) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
1992
2039
|
createElementVNode("div", _hoisted_12, [
|
|
1993
2040
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref($), (S) => (openBlock(), createBlock(M, {
|
|
1994
2041
|
key: S.channel,
|
|
@@ -2016,11 +2063,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2016
2063
|
S.available ? (openBlock(), createElementBlock("span", {
|
|
2017
2064
|
key: 0,
|
|
2018
2065
|
class: normalizeClass(["flex h-[22px] w-[22px] flex-none items-center justify-center border-2 transition-colors", [
|
|
2019
|
-
unref(
|
|
2066
|
+
unref(k) ? "rounded-full" : "rounded-[4px]",
|
|
2020
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"
|
|
2021
2068
|
]])
|
|
2022
2069
|
}, [
|
|
2023
|
-
S.checked && !unref(
|
|
2070
|
+
S.checked && !unref(k) ? (openBlock(), createBlock(R, {
|
|
2024
2071
|
key: 0,
|
|
2025
2072
|
name: "check",
|
|
2026
2073
|
size: "sm"
|
|
@@ -2047,13 +2094,13 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2047
2094
|
}, 1032, ["class", "aria-disabled", "onClick"]))), 128))
|
|
2048
2095
|
]),
|
|
2049
2096
|
e.showValidation && !unref(r).channels.length ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
|
|
2050
|
-
unref(
|
|
2097
|
+
unref(k) && unref(r).channels.length ? (openBlock(), createBlock(_sfc_main$h, {
|
|
2051
2098
|
key: 1,
|
|
2052
2099
|
rows: unref(O),
|
|
2053
2100
|
addable: unref(j),
|
|
2054
2101
|
onMove: w,
|
|
2055
2102
|
onRemove: D,
|
|
2056
|
-
onAdd: E[1] || (E[1] = (S) => p(unref(addChannel)(unref(r), S, unref(
|
|
2103
|
+
onAdd: E[1] || (E[1] = (S) => p(unref(addChannel)(unref(r), S, unref(y))))
|
|
2057
2104
|
}, null, 8, ["rows", "addable"])) : createCommentVNode("", !0)
|
|
2058
2105
|
]),
|
|
2059
2106
|
createElementVNode("div", _hoisted_19, [
|
|
@@ -2077,20 +2124,22 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2077
2124
|
unref(a) === "PUSH" && unref(Y) ? (openBlock(), createBlock(_sfc_main$k, {
|
|
2078
2125
|
key: 0,
|
|
2079
2126
|
"model-value": unref(Y),
|
|
2127
|
+
"show-validation": e.showValidation,
|
|
2080
2128
|
"onUpdate:modelValue": b
|
|
2081
|
-
}, null, 8, ["model-value"])) : unref(a) === "APP_INBOX" && unref(G) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
2129
|
+
}, null, 8, ["model-value", "show-validation"])) : unref(a) === "APP_INBOX" && unref(G) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
2082
2130
|
key: 1,
|
|
2083
2131
|
"model-value": unref(G),
|
|
2084
|
-
variables: unref(
|
|
2132
|
+
variables: unref(y),
|
|
2133
|
+
"show-validation": e.showValidation,
|
|
2085
2134
|
"onUpdate:modelValue": Z
|
|
2086
|
-
}, null, 8, ["model-value", "variables"])) : unref(a) !== "APP_INBOX" && unref(a) !== "PUSH" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2135
|
+
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(a) !== "APP_INBOX" && unref(a) !== "PUSH" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2087
2136
|
key: unref(a),
|
|
2088
2137
|
"model-value": unref(q),
|
|
2089
2138
|
"allow-email": !1,
|
|
2090
2139
|
"allow-whatsapp": !1,
|
|
2091
2140
|
"hide-credit-card": !0,
|
|
2092
2141
|
"trigger-type": e.triggerType,
|
|
2093
|
-
variables: unref(
|
|
2142
|
+
variables: unref(y),
|
|
2094
2143
|
placeholder: e.placeholder,
|
|
2095
2144
|
"onUpdate:modelValue": E[3] || (E[3] = (S) => B(unref(H), S))
|
|
2096
2145
|
}, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
|
|
@@ -2133,14 +2182,14 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2133
2182
|
(m) => isRuleEntry(m) && RuleBuilder.simplify(m).operator == "_rrule"
|
|
2134
2183
|
) ? "repeating" : "fixed";
|
|
2135
2184
|
}
|
|
2136
|
-
const a = ref(n()), r = ref(!1), p = ref(!1),
|
|
2185
|
+
const a = ref(n()), r = ref(!1), p = ref(!1), v = computed(() => [
|
|
2137
2186
|
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
2138
2187
|
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
2139
|
-
]),
|
|
2188
|
+
]), f = computed(() => {
|
|
2140
2189
|
const u = RuleBuilder.getRules(d.modelValue), m = u.find(
|
|
2141
|
-
(
|
|
2190
|
+
(x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.date"
|
|
2142
2191
|
), C = u.find(
|
|
2143
|
-
(
|
|
2192
|
+
(x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.time"
|
|
2144
2193
|
);
|
|
2145
2194
|
return {
|
|
2146
2195
|
date: m ? RuleBuilder.simplify(m).equator : null,
|
|
@@ -2154,7 +2203,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2154
2203
|
d.endDate ? new Date(d.endDate) : void 0
|
|
2155
2204
|
)
|
|
2156
2205
|
);
|
|
2157
|
-
function
|
|
2206
|
+
function k(u, m) {
|
|
2158
2207
|
i(
|
|
2159
2208
|
"update:model-value",
|
|
2160
2209
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
@@ -2166,18 +2215,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2166
2215
|
watch(
|
|
2167
2216
|
() => d.startDate,
|
|
2168
2217
|
(u, m) => {
|
|
2169
|
-
if (!u || u === m || a.value !== "repeating" || !
|
|
2170
|
-
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({
|
|
2171
2220
|
...C.origOptions,
|
|
2172
2221
|
dtstart: new Date(u)
|
|
2173
2222
|
}).toString();
|
|
2174
|
-
|
|
2223
|
+
x !== f.value.date && (k(x, f.value.time), p.value = !0);
|
|
2175
2224
|
}
|
|
2176
2225
|
);
|
|
2177
|
-
function
|
|
2226
|
+
function y(u) {
|
|
2178
2227
|
const m = u.value, C = getRruleAnchorDate({
|
|
2179
2228
|
startDate: d.startDate ? new Date(d.startDate) : void 0
|
|
2180
|
-
}),
|
|
2229
|
+
}), x = m == "fixed" ? [
|
|
2181
2230
|
RuleBuilder.constructEntry(
|
|
2182
2231
|
"trigger.date",
|
|
2183
2232
|
"_isOnDate",
|
|
@@ -2204,11 +2253,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2204
2253
|
"update:model-value",
|
|
2205
2254
|
RuleBuilder.setRuleToGroup(
|
|
2206
2255
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2207
|
-
|
|
2256
|
+
x
|
|
2208
2257
|
)
|
|
2209
2258
|
), a.value = m, p.value = !1;
|
|
2210
2259
|
}
|
|
2211
|
-
function
|
|
2260
|
+
function g(u) {
|
|
2212
2261
|
a.value == "fixed" ? i(
|
|
2213
2262
|
"update:model-value",
|
|
2214
2263
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
@@ -2223,33 +2272,33 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2223
2272
|
u.time
|
|
2224
2273
|
)
|
|
2225
2274
|
])
|
|
2226
|
-
) :
|
|
2275
|
+
) : k(u.date, u.time), p.value = !1;
|
|
2227
2276
|
}
|
|
2228
2277
|
return (u, m) => {
|
|
2229
|
-
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");
|
|
2230
2279
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2231
2280
|
createVNode(C, {
|
|
2232
|
-
items: unref(
|
|
2233
|
-
"model-value": unref(
|
|
2234
|
-
"onUpdate:modelValue":
|
|
2281
|
+
items: unref(v),
|
|
2282
|
+
"model-value": unref(v).find((I) => I.value === unref(a)) ?? null,
|
|
2283
|
+
"onUpdate:modelValue": y,
|
|
2235
2284
|
class: "mb-8"
|
|
2236
2285
|
}, null, 8, ["items", "model-value"]),
|
|
2237
2286
|
createElementVNode("div", _hoisted_1$f, [
|
|
2238
2287
|
createElementVNode("div", _hoisted_2$c, [
|
|
2239
|
-
createVNode(
|
|
2288
|
+
createVNode(x, {
|
|
2240
2289
|
label: unref(o)("connect.template.rule.schedule.notify_time"),
|
|
2241
|
-
"model-value": unref(
|
|
2242
|
-
"onUpdate:modelValue": m[0] || (m[0] = (I) =>
|
|
2243
|
-
"helper-text": unref(
|
|
2244
|
-
"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"
|
|
2245
2294
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
2246
2295
|
unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
2247
2296
|
createElementVNode("div", _hoisted_4$8, [
|
|
2248
2297
|
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
2249
|
-
unref(
|
|
2298
|
+
unref(f).date ? (openBlock(), createBlock(F, {
|
|
2250
2299
|
key: 0,
|
|
2251
2300
|
"z-index": 9999,
|
|
2252
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
2301
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(f).date).options)
|
|
2253
2302
|
}, {
|
|
2254
2303
|
default: withCtx(() => [
|
|
2255
2304
|
createVNode($, {
|
|
@@ -2268,11 +2317,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2268
2317
|
"popover-button": withCtx(() => [
|
|
2269
2318
|
createVNode(N, {
|
|
2270
2319
|
class: "cursor-pointer",
|
|
2271
|
-
"helper-text": unref(
|
|
2272
|
-
"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"
|
|
2273
2322
|
}, {
|
|
2274
2323
|
default: withCtx(() => [
|
|
2275
|
-
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)
|
|
2276
2325
|
]),
|
|
2277
2326
|
_: 1
|
|
2278
2327
|
}, 8, ["helper-text", "helper-state"])
|
|
@@ -2282,10 +2331,10 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2282
2331
|
default: withCtx(() => [
|
|
2283
2332
|
createVNode(_sfc_main$y, {
|
|
2284
2333
|
"apply-button": !0,
|
|
2285
|
-
"model-value": unref(
|
|
2334
|
+
"model-value": unref(f).date || "",
|
|
2286
2335
|
"start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
|
|
2287
2336
|
onCancel: m[1] || (m[1] = (I) => r.value = !1),
|
|
2288
|
-
"onUpdate:modelValue": m[2] || (m[2] = (I) => (
|
|
2337
|
+
"onUpdate:modelValue": m[2] || (m[2] = (I) => (g({ date: I, time: unref(f).time }), r.value = !1))
|
|
2289
2338
|
}, null, 8, ["model-value", "start-date"])
|
|
2290
2339
|
]),
|
|
2291
2340
|
_: 1
|
|
@@ -2296,13 +2345,13 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2296
2345
|
])) : (openBlock(), createBlock(O, {
|
|
2297
2346
|
key: 1,
|
|
2298
2347
|
label: unref(o)("connect.template.rule.schedule.notify_date"),
|
|
2299
|
-
"model-value": unref(
|
|
2300
|
-
"onUpdate:modelValue": m[4] || (m[4] = (I) =>
|
|
2301
|
-
"helper-text": unref(
|
|
2302
|
-
"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"
|
|
2303
2352
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
2304
2353
|
]),
|
|
2305
|
-
unref(
|
|
2354
|
+
unref(f).date && unref(f).time && unref(V) ? (openBlock(), createBlock(j, {
|
|
2306
2355
|
key: 0,
|
|
2307
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
|
|
2308
2357
|
${unref(moment)(unref(V)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(V)).fromNow()})`
|
|
@@ -2376,27 +2425,27 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2376
2425
|
emits: ["update:model-value"],
|
|
2377
2426
|
setup(e, { expose: s, emit: o }) {
|
|
2378
2427
|
const d = useMembershipStore(), { minor: i } = useLoading, c = ref(!1), l = ref(), n = ref(), a = ref(0), r = computed(() => {
|
|
2379
|
-
var
|
|
2380
|
-
return ((
|
|
2381
|
-
(
|
|
2428
|
+
var y;
|
|
2429
|
+
return ((y = d.loyaltyRewards.items.find(
|
|
2430
|
+
(g) => {
|
|
2382
2431
|
var u;
|
|
2383
|
-
return
|
|
2432
|
+
return g.value === ((u = l.value) == null ? void 0 : u.collectible);
|
|
2384
2433
|
}
|
|
2385
|
-
)) == null ? void 0 :
|
|
2434
|
+
)) == null ? void 0 : y.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
2386
2435
|
}), p = computed(() => {
|
|
2387
|
-
const
|
|
2388
|
-
return
|
|
2436
|
+
const k = r.value.safeParse(l.value);
|
|
2437
|
+
return k.success ? [] : k.error.errors;
|
|
2389
2438
|
});
|
|
2390
|
-
function
|
|
2391
|
-
|
|
2439
|
+
function v(k, y, g) {
|
|
2440
|
+
k && (l.value = y, a.value = g), c.value = k;
|
|
2392
2441
|
}
|
|
2393
|
-
const
|
|
2442
|
+
const f = o;
|
|
2394
2443
|
async function V() {
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2444
|
+
const k = r.value.safeParse(l.value);
|
|
2445
|
+
k.success && (await i(
|
|
2397
2446
|
async () => {
|
|
2398
|
-
|
|
2399
|
-
|
|
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),
|
|
2400
2449
|
n.value
|
|
2401
2450
|
));
|
|
2402
2451
|
},
|
|
@@ -2404,18 +2453,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2404
2453
|
message: "Uploading reward image",
|
|
2405
2454
|
successMessage: "Reward image updated"
|
|
2406
2455
|
}
|
|
2407
|
-
),
|
|
2456
|
+
), f("update:model-value", k.data, a.value));
|
|
2408
2457
|
}
|
|
2409
2458
|
return s({
|
|
2410
|
-
showSheet:
|
|
2411
|
-
}), (
|
|
2412
|
-
const
|
|
2459
|
+
showSheet: v
|
|
2460
|
+
}), (k, y) => {
|
|
2461
|
+
const g = resolveComponent("FmSelect"), u = resolveComponent("FmStepperField"), m = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
2413
2462
|
return openBlock(), createBlock(C, {
|
|
2414
2463
|
"max-width": 560,
|
|
2415
2464
|
modelValue: unref(c),
|
|
2416
2465
|
"onUpdate:modelValue": [
|
|
2417
|
-
|
|
2418
|
-
|
|
2466
|
+
y[9] || (y[9] = (x) => isRef(c) ? c.value = x : null),
|
|
2467
|
+
y[10] || (y[10] = (x) => c.value = x)
|
|
2419
2468
|
],
|
|
2420
2469
|
header: "Edit reward",
|
|
2421
2470
|
"dismiss-away": ""
|
|
@@ -2427,21 +2476,21 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2427
2476
|
type: "button",
|
|
2428
2477
|
disabled: unref(p).length > 0,
|
|
2429
2478
|
label: "Confirm",
|
|
2430
|
-
onClick:
|
|
2479
|
+
onClick: y[7] || (y[7] = (x) => V())
|
|
2431
2480
|
}, null, 8, ["disabled"]),
|
|
2432
2481
|
createVNode(m, {
|
|
2433
2482
|
variant: "secondary",
|
|
2434
2483
|
type: "button",
|
|
2435
2484
|
label: "Cancel",
|
|
2436
|
-
onClick:
|
|
2485
|
+
onClick: y[8] || (y[8] = (x) => c.value = !1)
|
|
2437
2486
|
})
|
|
2438
2487
|
])
|
|
2439
2488
|
]),
|
|
2440
2489
|
default: withCtx(() => {
|
|
2441
|
-
var
|
|
2490
|
+
var x, $, F;
|
|
2442
2491
|
return [
|
|
2443
2492
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
2444
|
-
createVNode(
|
|
2493
|
+
createVNode(g, {
|
|
2445
2494
|
label: "Reward Type",
|
|
2446
2495
|
items: [
|
|
2447
2496
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -2449,7 +2498,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2449
2498
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2450
2499
|
],
|
|
2451
2500
|
"model-value": unref(l).type,
|
|
2452
|
-
"onUpdate:modelValue":
|
|
2501
|
+
"onUpdate:modelValue": y[0] || (y[0] = (N) => {
|
|
2453
2502
|
N == "NO_REWARD" ? l.value = {
|
|
2454
2503
|
type: "NO_REWARD",
|
|
2455
2504
|
collectible: null,
|
|
@@ -2482,31 +2531,31 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2482
2531
|
};
|
|
2483
2532
|
})
|
|
2484
2533
|
}, null, 8, ["model-value"]),
|
|
2485
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
2534
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(g, {
|
|
2486
2535
|
key: 0,
|
|
2487
2536
|
label: "Loyalty type",
|
|
2488
2537
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
2489
2538
|
items: unref(d).loyaltyRewards.items,
|
|
2490
2539
|
"model-value": unref(l).collectible,
|
|
2491
|
-
"onUpdate:modelValue":
|
|
2540
|
+
"onUpdate:modelValue": y[1] || (y[1] = (N) => unref(l).collectible = N)
|
|
2492
2541
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2493
2542
|
createVNode(u, {
|
|
2494
2543
|
label: "Weight",
|
|
2495
2544
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
|
|
2496
2545
|
"model-value": unref(l).weight,
|
|
2497
|
-
"onUpdate:modelValue":
|
|
2546
|
+
"onUpdate:modelValue": y[2] || (y[2] = (N) => l.value = {
|
|
2498
2547
|
...unref(l),
|
|
2499
2548
|
weight: N
|
|
2500
2549
|
})
|
|
2501
2550
|
}, null, 8, ["rules", "model-value"]),
|
|
2502
2551
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2503
|
-
((
|
|
2552
|
+
((x = unref(d).loyaltyRewards.items.find(
|
|
2504
2553
|
(N) => {
|
|
2505
2554
|
var D;
|
|
2506
2555
|
return N.value === ((D = unref(l)) == null ? void 0 : D.collectible);
|
|
2507
2556
|
}
|
|
2508
|
-
)) == null ? void 0 :
|
|
2509
|
-
|
|
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)),
|
|
2510
2559
|
createVNode(_sfc_main$z, {
|
|
2511
2560
|
class: "mt-[-8px]",
|
|
2512
2561
|
rules: [
|
|
@@ -2516,13 +2565,13 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2516
2565
|
"error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
|
|
2517
2566
|
"fixed-type": !0,
|
|
2518
2567
|
"model-value": unref(l).earningOption,
|
|
2519
|
-
"onUpdate:modelValue":
|
|
2568
|
+
"onUpdate:modelValue": y[3] || (y[3] = (N) => l.value = {
|
|
2520
2569
|
...unref(l),
|
|
2521
2570
|
earningOption: N
|
|
2522
2571
|
})
|
|
2523
2572
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
2524
2573
|
], 64)) : createCommentVNode("", !0),
|
|
2525
|
-
|
|
2574
|
+
y[12] || (y[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
2526
2575
|
createVNode(_sfc_main$A, {
|
|
2527
2576
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
2528
2577
|
"for-credit": unref(l).type === "LOYALTY" && (($ = unref(d).loyaltyRewards.items.find(
|
|
@@ -2534,7 +2583,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2534
2583
|
class: "!gap-24",
|
|
2535
2584
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
|
|
2536
2585
|
"model-value": unref(l).validityOption,
|
|
2537
|
-
"onUpdate:modelValue":
|
|
2586
|
+
"onUpdate:modelValue": y[4] || (y[4] = (N) => l.value = {
|
|
2538
2587
|
...unref(l),
|
|
2539
2588
|
validityOption: N
|
|
2540
2589
|
})
|
|
@@ -2544,11 +2593,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2544
2593
|
key: 2,
|
|
2545
2594
|
"reward-image": unref(n),
|
|
2546
2595
|
"model-value": ((F = unref(l)) == null ? void 0 : F.collectibleConfig) ?? void 0,
|
|
2547
|
-
"onUpdate:modelValue":
|
|
2596
|
+
"onUpdate:modelValue": y[5] || (y[5] = (N) => l.value = {
|
|
2548
2597
|
...unref(l),
|
|
2549
2598
|
collectibleConfig: N
|
|
2550
2599
|
}),
|
|
2551
|
-
"onUpdate:rewardImage":
|
|
2600
|
+
"onUpdate:rewardImage": y[6] || (y[6] = (N) => n.value = N)
|
|
2552
2601
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2553
2602
|
createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
|
|
2554
2603
|
])) : createCommentVNode("", !0)
|
|
@@ -2579,35 +2628,35 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2579
2628
|
emits: ["update:model-value"],
|
|
2580
2629
|
setup(e, { emit: s }) {
|
|
2581
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(() => {
|
|
2582
|
-
const
|
|
2583
|
-
return
|
|
2631
|
+
const y = l.safeParse(n.value);
|
|
2632
|
+
return y.success ? [] : y.error.errors;
|
|
2584
2633
|
}), r = ref();
|
|
2585
|
-
function p(
|
|
2634
|
+
function p(y, g) {
|
|
2586
2635
|
var m;
|
|
2587
2636
|
const u = [...n.value];
|
|
2588
|
-
u[
|
|
2637
|
+
u[g] = y, (m = r.value) == null || m.showSheet(!1), d("update:model-value", u);
|
|
2589
2638
|
}
|
|
2590
|
-
function
|
|
2591
|
-
const
|
|
2592
|
-
(C) => C._id.toString() ==
|
|
2593
|
-
), u = CollectionUtils.formattedType((
|
|
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;
|
|
2594
2643
|
return {
|
|
2595
2644
|
label: isNullOrEmpty(u) ? "NO REWARD" : u,
|
|
2596
|
-
sublabel: `${m} (${(m / n.value.reduce((C,
|
|
2645
|
+
sublabel: `${m} (${(m / n.value.reduce((C, x) => C + x.weight, 0) * 100).toFixed(2)}%)`
|
|
2597
2646
|
};
|
|
2598
2647
|
}
|
|
2599
|
-
function y
|
|
2648
|
+
function f(y) {
|
|
2600
2649
|
var u;
|
|
2601
|
-
const
|
|
2602
|
-
(u = r.value) == null || u.showSheet(!0,
|
|
2650
|
+
const g = [...n.value];
|
|
2651
|
+
(u = r.value) == null || u.showSheet(!0, g[y], y);
|
|
2603
2652
|
}
|
|
2604
|
-
function V(
|
|
2605
|
-
const
|
|
2606
|
-
|
|
2653
|
+
function V(y) {
|
|
2654
|
+
const g = [...n.value];
|
|
2655
|
+
g.splice(y, 1), d("update:model-value", g);
|
|
2607
2656
|
}
|
|
2608
|
-
function
|
|
2609
|
-
var
|
|
2610
|
-
(
|
|
2657
|
+
function k() {
|
|
2658
|
+
var y;
|
|
2659
|
+
(y = r.value) == null || y.showSheet(
|
|
2611
2660
|
!0,
|
|
2612
2661
|
{
|
|
2613
2662
|
type: "NO_REWARD",
|
|
@@ -2617,28 +2666,28 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2617
2666
|
n.value.length
|
|
2618
2667
|
);
|
|
2619
2668
|
}
|
|
2620
|
-
return (
|
|
2669
|
+
return (y, g) => {
|
|
2621
2670
|
const u = resolveComponent("FmButton"), m = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2622
2671
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2623
2672
|
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(c)("connect.template.configure_reward_type")), 1),
|
|
2624
2673
|
createVNode(u, {
|
|
2625
2674
|
label: unref(c)("connect.campaign.rewardPool.addReward"),
|
|
2626
|
-
onClick:
|
|
2675
|
+
onClick: g[0] || (g[0] = (x) => k()),
|
|
2627
2676
|
variant: "plain",
|
|
2628
2677
|
icon: "add"
|
|
2629
2678
|
}, null, 8, ["label"]),
|
|
2630
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (
|
|
2679
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (x, $) => (openBlock(), createBlock(m, {
|
|
2631
2680
|
key: $,
|
|
2632
2681
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2633
2682
|
variant: "outlined",
|
|
2634
|
-
onClick: (F) =>
|
|
2683
|
+
onClick: (F) => f($)
|
|
2635
2684
|
}, {
|
|
2636
2685
|
default: withCtx(() => {
|
|
2637
2686
|
var F;
|
|
2638
2687
|
return [
|
|
2639
2688
|
createElementVNode("div", null, [
|
|
2640
|
-
createElementVNode("div", _hoisted_3$7, toDisplayString(
|
|
2641
|
-
createElementVNode("div", _hoisted_4$6, toDisplayString(
|
|
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)
|
|
2642
2691
|
]),
|
|
2643
2692
|
createVNode(u, {
|
|
2644
2693
|
icon: "delete",
|
|
@@ -2649,9 +2698,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2649
2698
|
}),
|
|
2650
2699
|
_: 2
|
|
2651
2700
|
}, 1032, ["onClick"]))), 128)),
|
|
2652
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((
|
|
2653
|
-
key:
|
|
2654
|
-
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,
|
|
2655
2704
|
state: "error"
|
|
2656
2705
|
}, null, 8, ["text"]))), 128)),
|
|
2657
2706
|
createVNode(_sfc_main$d, {
|
|
@@ -2682,33 +2731,33 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2682
2731
|
}
|
|
2683
2732
|
]);
|
|
2684
2733
|
return (l, n) => {
|
|
2685
|
-
var
|
|
2734
|
+
var v, f, V;
|
|
2686
2735
|
const a = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
|
|
2687
2736
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
2688
2737
|
createVNode(a, {
|
|
2689
2738
|
label: unref(o)("connect.template.promotion_game.enable"),
|
|
2690
|
-
"model-value": !!((
|
|
2691
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
2739
|
+
"model-value": !!((v = e.modelValue) != null && v.gameType),
|
|
2740
|
+
"onUpdate:modelValue": n[0] || (n[0] = (k) => k ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
|
|
2692
2741
|
}, null, 8, ["label", "model-value"]),
|
|
2693
|
-
((
|
|
2694
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (
|
|
2695
|
-
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;
|
|
2696
2745
|
return openBlock(), createBlock(r, {
|
|
2697
2746
|
variant: "outlined",
|
|
2698
2747
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2699
2748
|
"col-span-2": unref(c).length == 1,
|
|
2700
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
2701
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
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
|
|
2702
2751
|
}]),
|
|
2703
2752
|
onClick: () => {
|
|
2704
2753
|
var u;
|
|
2705
|
-
((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 });
|
|
2706
2755
|
},
|
|
2707
|
-
key:
|
|
2756
|
+
key: k.value
|
|
2708
2757
|
}, {
|
|
2709
2758
|
default: withCtx(() => [
|
|
2710
|
-
createElementVNode("div", _hoisted_3$6, toDisplayString(
|
|
2711
|
-
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)
|
|
2712
2761
|
]),
|
|
2713
2762
|
_: 2
|
|
2714
2763
|
}, 1032, ["class", "onClick"]);
|
|
@@ -2740,11 +2789,11 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2740
2789
|
setup(e, { emit: s }) {
|
|
2741
2790
|
const { t: o } = useI18n(), d = e, i = s, c = ref(d.modelValue ?? {}), l = ref(
|
|
2742
2791
|
(() => {
|
|
2743
|
-
const
|
|
2744
|
-
return c.value.workingHour && Object.keys(c.value.workingHour).forEach((
|
|
2745
|
-
const V = c.value.workingHour[
|
|
2746
|
-
V && "periods" in V && Array.isArray(V.periods) ?
|
|
2747
|
-
}),
|
|
2792
|
+
const 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);
|
|
2796
|
+
}), v;
|
|
2748
2797
|
})()
|
|
2749
2798
|
), n = [
|
|
2750
2799
|
{ key: "mon", label: "Monday" },
|
|
@@ -2754,30 +2803,30 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2754
2803
|
{ key: "fri", label: "Friday" },
|
|
2755
2804
|
{ key: "sat", label: "Saturday" },
|
|
2756
2805
|
{ key: "sun", label: "Sunday" }
|
|
2757
|
-
], a = (
|
|
2758
|
-
l.value[
|
|
2806
|
+
], a = (v) => {
|
|
2807
|
+
l.value[v] || (l.value[v] = []), l.value[v].push({
|
|
2759
2808
|
startTime: "00:00",
|
|
2760
2809
|
endTime: "23:59"
|
|
2761
2810
|
}), p();
|
|
2762
|
-
}, r = (
|
|
2763
|
-
l.value[
|
|
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());
|
|
2764
2813
|
}, p = () => {
|
|
2765
|
-
const
|
|
2766
|
-
(
|
|
2814
|
+
const v = Object.keys(l.value).reduce(
|
|
2815
|
+
(f, V) => (l.value[V] && l.value[V].length > 0 && (f[V] = {
|
|
2767
2816
|
periods: l.value[V]
|
|
2768
|
-
}),
|
|
2817
|
+
}), f),
|
|
2769
2818
|
{}
|
|
2770
2819
|
);
|
|
2771
|
-
c.value.workingHour = Object.keys(
|
|
2820
|
+
c.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
|
|
2772
2821
|
};
|
|
2773
|
-
return watch(c, () => i("update:model-value", c.value), { deep: !0 }), watch(l, p, { deep: !0 }), (
|
|
2774
|
-
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");
|
|
2775
2824
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
2776
2825
|
createElementVNode("div", _hoisted_2$7, [
|
|
2777
2826
|
createVNode(V, {
|
|
2778
2827
|
label: unref(o)("connect.template.eaterType"),
|
|
2779
2828
|
modelValue: unref(c).eaterType,
|
|
2780
|
-
"onUpdate:modelValue":
|
|
2829
|
+
"onUpdate:modelValue": f[0] || (f[0] = (m) => unref(c).eaterType = m),
|
|
2781
2830
|
items: [
|
|
2782
2831
|
{ label: unref(o)("connect.template.allEaters"), value: "all" },
|
|
2783
2832
|
{ label: unref(o)("connect.template.newEatersOnly"), value: "new" },
|
|
@@ -2788,9 +2837,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2788
2837
|
],
|
|
2789
2838
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
|
|
2790
2839
|
}, null, 8, ["label", "modelValue", "items", "rules"]),
|
|
2791
|
-
createVNode(
|
|
2840
|
+
createVNode(k, {
|
|
2792
2841
|
modelValue: unref(c).minBasketAmount,
|
|
2793
|
-
"onUpdate:modelValue":
|
|
2842
|
+
"onUpdate:modelValue": f[1] || (f[1] = (m) => unref(c).minBasketAmount = m),
|
|
2794
2843
|
"show-steppers": !1,
|
|
2795
2844
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
|
|
2796
2845
|
}, {
|
|
@@ -2804,9 +2853,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2804
2853
|
]),
|
|
2805
2854
|
_: 1
|
|
2806
2855
|
}, 8, ["modelValue", "rules"]),
|
|
2807
|
-
createVNode(
|
|
2856
|
+
createVNode(k, {
|
|
2808
2857
|
modelValue: unref(c).bundleQuantity,
|
|
2809
|
-
"onUpdate:modelValue":
|
|
2858
|
+
"onUpdate:modelValue": f[2] || (f[2] = (m) => unref(c).bundleQuantity = m),
|
|
2810
2859
|
"show-steppers": !1,
|
|
2811
2860
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
|
|
2812
2861
|
}, {
|
|
@@ -2829,7 +2878,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2829
2878
|
class: "space-y-2"
|
|
2830
2879
|
}, [
|
|
2831
2880
|
createElementVNode("div", _hoisted_6$3, [
|
|
2832
|
-
createVNode(
|
|
2881
|
+
createVNode(y, {
|
|
2833
2882
|
label: m.label,
|
|
2834
2883
|
"model-value": !!(unref(l)[m.key] && unref(l)[m.key].length > 0),
|
|
2835
2884
|
"onUpdate:modelValue": (C) => {
|
|
@@ -2838,30 +2887,30 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2838
2887
|
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])
|
|
2839
2888
|
]),
|
|
2840
2889
|
unref(l)[m.key] && unref(l)[m.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
|
|
2841
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[m.key] || [], (C,
|
|
2842
|
-
key:
|
|
2890
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[m.key] || [], (C, x) => (openBlock(), createElementBlock("div", {
|
|
2891
|
+
key: x,
|
|
2843
2892
|
class: "flex items-center space-x-2 w-100"
|
|
2844
2893
|
}, [
|
|
2845
|
-
createVNode(
|
|
2894
|
+
createVNode(g, {
|
|
2846
2895
|
"model-value": C.startTime || "",
|
|
2847
2896
|
"onUpdate:modelValue": ($) => {
|
|
2848
|
-
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());
|
|
2849
2898
|
}
|
|
2850
2899
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2851
|
-
|
|
2852
|
-
createVNode(
|
|
2900
|
+
f[3] || (f[3] = createElementVNode("span", null, "to", -1)),
|
|
2901
|
+
createVNode(g, {
|
|
2853
2902
|
"model-value": C.endTime || "",
|
|
2854
2903
|
"onUpdate:modelValue": ($) => {
|
|
2855
|
-
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());
|
|
2856
2905
|
}
|
|
2857
2906
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2858
2907
|
createVNode(u, {
|
|
2859
2908
|
variant: "tertiary",
|
|
2860
2909
|
size: "sm",
|
|
2861
|
-
onClick: ($) => r(m.key,
|
|
2910
|
+
onClick: ($) => r(m.key, x),
|
|
2862
2911
|
icon: "close"
|
|
2863
2912
|
}, null, 8, ["onClick"]),
|
|
2864
|
-
|
|
2913
|
+
x === 0 ? (openBlock(), createBlock(u, {
|
|
2865
2914
|
key: 0,
|
|
2866
2915
|
onClick: ($) => a(m.key),
|
|
2867
2916
|
icon: "add",
|
|
@@ -3025,20 +3074,20 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3025
3074
|
return m.value === ((C = n.value) == null ? void 0 : C.collectible);
|
|
3026
3075
|
}
|
|
3027
3076
|
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
3028
|
-
}),
|
|
3029
|
-
const
|
|
3030
|
-
return
|
|
3077
|
+
}), v = computed(() => {
|
|
3078
|
+
const g = p.value.safeParse(n.value);
|
|
3079
|
+
return g.success ? [] : g.error.errors;
|
|
3031
3080
|
});
|
|
3032
|
-
function
|
|
3033
|
-
|
|
3081
|
+
function f(g, u, m) {
|
|
3082
|
+
g && (n.value = u, r.value = m), l.value = g;
|
|
3034
3083
|
}
|
|
3035
3084
|
const V = o;
|
|
3036
|
-
async function
|
|
3037
|
-
const
|
|
3038
|
-
|
|
3085
|
+
async function k() {
|
|
3086
|
+
const g = p.value.safeParse(n.value);
|
|
3087
|
+
g.success && (await c(
|
|
3039
3088
|
async () => {
|
|
3040
|
-
|
|
3041
|
-
|
|
3089
|
+
g.data.type === "VOUCHER" && a.value && (g.data.collectibleConfig.image = await firebaseStorage.update(
|
|
3090
|
+
g.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
3042
3091
|
a.value
|
|
3043
3092
|
));
|
|
3044
3093
|
},
|
|
@@ -3046,13 +3095,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3046
3095
|
message: "Uploading reward image",
|
|
3047
3096
|
successMessage: "Reward image updated"
|
|
3048
3097
|
}
|
|
3049
|
-
), V("update:model-value",
|
|
3098
|
+
), V("update:model-value", g.data, r.value));
|
|
3050
3099
|
}
|
|
3051
|
-
const
|
|
3100
|
+
const y = ref();
|
|
3052
3101
|
return s({
|
|
3053
|
-
showSheet:
|
|
3054
|
-
}), (
|
|
3055
|
-
const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"),
|
|
3102
|
+
showSheet: f
|
|
3103
|
+
}), (g, u) => {
|
|
3104
|
+
const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), x = resolveComponent("FmForm"), $ = resolveComponent("FmButton"), F = resolveComponent("FmSideSheet");
|
|
3056
3105
|
return openBlock(), createBlock(F, {
|
|
3057
3106
|
"max-width": 560,
|
|
3058
3107
|
modelValue: unref(l),
|
|
@@ -3069,10 +3118,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3069
3118
|
variant: "primary",
|
|
3070
3119
|
type: "button",
|
|
3071
3120
|
label: "Confirm",
|
|
3072
|
-
disabled: unref(
|
|
3121
|
+
disabled: unref(v).length > 0,
|
|
3073
3122
|
onClick: u[8] || (u[8] = async () => {
|
|
3074
3123
|
var N;
|
|
3075
|
-
return (N = unref(
|
|
3124
|
+
return (N = unref(y)) == null ? void 0 : N.validateInputs();
|
|
3076
3125
|
})
|
|
3077
3126
|
}, null, 8, ["disabled"]),
|
|
3078
3127
|
createVNode($, {
|
|
@@ -3085,12 +3134,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3085
3134
|
]),
|
|
3086
3135
|
default: withCtx(() => [
|
|
3087
3136
|
createVNode(JsonViewer, { json: unref(n) }, null, 8, ["json"]),
|
|
3088
|
-
unref(n) ? (openBlock(), createBlock(
|
|
3137
|
+
unref(n) ? (openBlock(), createBlock(x, {
|
|
3089
3138
|
key: 0,
|
|
3090
3139
|
class: "flex flex-col gap-y-24",
|
|
3091
3140
|
ref_key: "formRef",
|
|
3092
|
-
ref:
|
|
3093
|
-
onValidationSuccess: u[7] || (u[7] = (N) =>
|
|
3141
|
+
ref: y,
|
|
3142
|
+
onValidationSuccess: u[7] || (u[7] = (N) => k())
|
|
3094
3143
|
}, {
|
|
3095
3144
|
default: withCtx(() => {
|
|
3096
3145
|
var N, D;
|
|
@@ -3162,8 +3211,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3162
3211
|
createVNode(_sfc_main$z, {
|
|
3163
3212
|
class: "mt-[-8px]",
|
|
3164
3213
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(n).type])],
|
|
3165
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
3166
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
3214
|
+
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
3215
|
+
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
3167
3216
|
"fixed-type": !0,
|
|
3168
3217
|
"model-value": unref(n).earningOption,
|
|
3169
3218
|
"onUpdate:modelValue": u[3] || (u[3] = (w) => n.value = {
|
|
@@ -3198,7 +3247,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3198
3247
|
}),
|
|
3199
3248
|
"onUpdate:rewardImage": u[6] || (u[6] = (w) => a.value = w)
|
|
3200
3249
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
3201
|
-
createVNode(JsonViewer, { json: unref(
|
|
3250
|
+
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
3202
3251
|
];
|
|
3203
3252
|
}),
|
|
3204
3253
|
_: 1
|
|
@@ -3244,7 +3293,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3244
3293
|
),
|
|
3245
3294
|
outline: unref(d) < p,
|
|
3246
3295
|
key: p,
|
|
3247
|
-
name: unref(i).some((
|
|
3296
|
+
name: unref(i).some((v) => v === p) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
3248
3297
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
3249
3298
|
])) : (openBlock(), createElementBlock("div", {
|
|
3250
3299
|
key: 1,
|
|
@@ -3254,8 +3303,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3254
3303
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
3255
3304
|
style: normalizeStyle({ width: unref(c) + "%" })
|
|
3256
3305
|
}, null, 4),
|
|
3257
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (p,
|
|
3258
|
-
key:
|
|
3306
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (p, v) => (openBlock(), createElementBlock("div", {
|
|
3307
|
+
key: v,
|
|
3259
3308
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
3260
3309
|
style: normalizeStyle({ left: l(p) + "%" })
|
|
3261
3310
|
}, [
|
|
@@ -3298,44 +3347,44 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3298
3347
|
emits: ["update:model-value"],
|
|
3299
3348
|
setup(e, { emit: s }) {
|
|
3300
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(
|
|
3301
|
-
() => d.modelValue.sort((
|
|
3350
|
+
() => d.modelValue.sort((g, u) => g.threshold - u.threshold) ?? []
|
|
3302
3351
|
), a = computed(() => {
|
|
3303
|
-
const
|
|
3304
|
-
return
|
|
3352
|
+
const g = l.safeParse(n.value);
|
|
3353
|
+
return g.success ? [] : g.error.errors;
|
|
3305
3354
|
}), r = ref();
|
|
3306
|
-
function p(
|
|
3355
|
+
function p(g, u) {
|
|
3307
3356
|
var C;
|
|
3308
3357
|
const m = [...n.value];
|
|
3309
|
-
m[u] =
|
|
3358
|
+
m[u] = g, (C = r.value) == null || C.showSheet(!1), i("update:model-value", m);
|
|
3310
3359
|
}
|
|
3311
|
-
function
|
|
3312
|
-
const u =
|
|
3313
|
-
(
|
|
3314
|
-
), m = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), C =
|
|
3315
|
-
threshold:
|
|
3316
|
-
amount:
|
|
3360
|
+
function v(g) {
|
|
3361
|
+
const u = g.type == "VOUCHER" ? g.collectibleConfig : c.collectibles.find(
|
|
3362
|
+
(x) => x._id.toString() == g.collectible
|
|
3363
|
+
), m = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), C = g.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
3364
|
+
threshold: g.threshold,
|
|
3365
|
+
amount: g.earningOption.amount
|
|
3317
3366
|
}) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
3318
|
-
threshold:
|
|
3319
|
-
amount:
|
|
3320
|
-
every:
|
|
3367
|
+
threshold: g.threshold,
|
|
3368
|
+
amount: g.earningOption.amount,
|
|
3369
|
+
every: g.earningOption.every
|
|
3321
3370
|
});
|
|
3322
3371
|
return {
|
|
3323
3372
|
label: isNullOrEmpty(m) ? o("connect.template.mission_pool.no_reward") : m,
|
|
3324
3373
|
sublabel: C
|
|
3325
3374
|
};
|
|
3326
3375
|
}
|
|
3327
|
-
function
|
|
3376
|
+
function f(g) {
|
|
3328
3377
|
var m;
|
|
3329
3378
|
const u = [...n.value];
|
|
3330
|
-
(m = r.value) == null || m.showSheet(!0, u[
|
|
3379
|
+
(m = r.value) == null || m.showSheet(!0, u[g], g);
|
|
3331
3380
|
}
|
|
3332
|
-
function V(
|
|
3381
|
+
function V(g) {
|
|
3333
3382
|
const u = [...n.value];
|
|
3334
|
-
u.splice(
|
|
3383
|
+
u.splice(g, 1), i("update:model-value", u);
|
|
3335
3384
|
}
|
|
3336
|
-
function
|
|
3337
|
-
var
|
|
3338
|
-
(
|
|
3385
|
+
function k() {
|
|
3386
|
+
var g;
|
|
3387
|
+
(g = r.value) == null || g.showSheet(
|
|
3339
3388
|
!0,
|
|
3340
3389
|
{
|
|
3341
3390
|
type: "LOYALTY",
|
|
@@ -3352,21 +3401,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3352
3401
|
n.value.length
|
|
3353
3402
|
);
|
|
3354
3403
|
}
|
|
3355
|
-
function
|
|
3404
|
+
function y(g) {
|
|
3356
3405
|
var u, m;
|
|
3357
|
-
return
|
|
3406
|
+
return g.type == "VOUCHER" ? (u = g.collectibleConfig) == null ? void 0 : u.name : sentenceCase(
|
|
3358
3407
|
((m = c.loyaltyRewards.items.find(
|
|
3359
|
-
(C) => C.value ==
|
|
3408
|
+
(C) => C.value == g.collectible
|
|
3360
3409
|
)) == null ? void 0 : m.label) || ""
|
|
3361
3410
|
);
|
|
3362
3411
|
}
|
|
3363
|
-
return (
|
|
3364
|
-
const m = resolveComponent("FmButton"), C = resolveComponent("FmCard"),
|
|
3412
|
+
return (g, u) => {
|
|
3413
|
+
const m = resolveComponent("FmButton"), C = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
|
|
3365
3414
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
3366
3415
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
|
|
3367
3416
|
createVNode(m, {
|
|
3368
3417
|
label: unref(o)("connect.template.mission_pool.add_reward"),
|
|
3369
|
-
onClick: u[0] || (u[0] = ($) =>
|
|
3418
|
+
onClick: u[0] || (u[0] = ($) => k()),
|
|
3370
3419
|
variant: "plain",
|
|
3371
3420
|
icon: "add"
|
|
3372
3421
|
}, null, 8, ["label"]),
|
|
@@ -3374,12 +3423,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3374
3423
|
key: F,
|
|
3375
3424
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
3376
3425
|
variant: "outlined",
|
|
3377
|
-
onClick: (N) =>
|
|
3426
|
+
onClick: (N) => f(F)
|
|
3378
3427
|
}, {
|
|
3379
3428
|
default: withCtx(() => [
|
|
3380
3429
|
createElementVNode("div", null, [
|
|
3381
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(
|
|
3382
|
-
createElementVNode("div", _hoisted_4$2, toDisplayString(
|
|
3430
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(v($).label), 1),
|
|
3431
|
+
createElementVNode("div", _hoisted_4$2, toDisplayString(v($).sublabel), 1)
|
|
3383
3432
|
]),
|
|
3384
3433
|
createVNode(m, {
|
|
3385
3434
|
icon: "delete",
|
|
@@ -3389,7 +3438,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3389
3438
|
]),
|
|
3390
3439
|
_: 2
|
|
3391
3440
|
}, 1032, ["onClick"]))), 128)),
|
|
3392
|
-
(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, {
|
|
3393
3442
|
key: $.message,
|
|
3394
3443
|
text: $.message,
|
|
3395
3444
|
state: "error"
|
|
@@ -3405,7 +3454,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3405
3454
|
return [
|
|
3406
3455
|
createElementVNode("div", _hoisted_6$2, [
|
|
3407
3456
|
createElementVNode("div", null, [
|
|
3408
|
-
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString((($ = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : $.earningOption.amount) > 1 ? (F = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : F.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ?
|
|
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),
|
|
3409
3458
|
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
3410
3459
|
])
|
|
3411
3460
|
]),
|
|
@@ -3454,35 +3503,35 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3454
3503
|
}
|
|
3455
3504
|
]), l = s;
|
|
3456
3505
|
return (n, a) => {
|
|
3457
|
-
var
|
|
3506
|
+
var v;
|
|
3458
3507
|
const r = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
|
|
3459
3508
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
3460
3509
|
createElementVNode("div", _hoisted_2$2, [
|
|
3461
3510
|
createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
|
|
3462
3511
|
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
3463
3512
|
createElementVNode("div", _hoisted_5$1, [
|
|
3464
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (
|
|
3465
|
-
var V,
|
|
3513
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (f) => {
|
|
3514
|
+
var V, k;
|
|
3466
3515
|
return openBlock(), createBlock(r, {
|
|
3467
3516
|
variant: "outlined",
|
|
3468
3517
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
3469
3518
|
"col-span-2": unref(c).length == 1,
|
|
3470
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((V = e.modelValue) == null ? void 0 : V.type) ==
|
|
3471
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
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
|
|
3472
3521
|
}]),
|
|
3473
3522
|
onClick: () => {
|
|
3474
|
-
var
|
|
3475
|
-
((
|
|
3523
|
+
var y, g;
|
|
3524
|
+
((y = e.modelValue) == null ? void 0 : y.type) != f.value && l("update:model-value", {
|
|
3476
3525
|
...e.modelValue,
|
|
3477
|
-
type:
|
|
3478
|
-
end: ((
|
|
3526
|
+
type: f.value,
|
|
3527
|
+
end: ((g = e.modelValue) == null ? void 0 : g.end) || 1
|
|
3479
3528
|
});
|
|
3480
3529
|
},
|
|
3481
|
-
key:
|
|
3530
|
+
key: f.value
|
|
3482
3531
|
}, {
|
|
3483
3532
|
default: withCtx(() => [
|
|
3484
|
-
createElementVNode("div", _hoisted_6$1, toDisplayString(
|
|
3485
|
-
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)
|
|
3486
3535
|
]),
|
|
3487
3536
|
_: 2
|
|
3488
3537
|
}, 1032, ["class", "onClick"]);
|
|
@@ -3494,13 +3543,13 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3494
3543
|
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
3495
3544
|
createVNode(p, {
|
|
3496
3545
|
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
3497
|
-
"model-value": ((
|
|
3498
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
3546
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
3547
|
+
"onUpdate:modelValue": a[0] || (a[0] = (f) => {
|
|
3499
3548
|
var V;
|
|
3500
3549
|
return l("update:model-value", {
|
|
3501
3550
|
...e.modelValue,
|
|
3502
3551
|
type: ((V = e.modelValue) == null ? void 0 : V.type) || "STAMP",
|
|
3503
|
-
end:
|
|
3552
|
+
end: f
|
|
3504
3553
|
});
|
|
3505
3554
|
}),
|
|
3506
3555
|
"helper-text": unref(ZodHelper).helperText(unref(i), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
|
|
@@ -3554,12 +3603,12 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3554
3603
|
function l(p) {
|
|
3555
3604
|
switch (i.field.type) {
|
|
3556
3605
|
case "timeframe":
|
|
3557
|
-
const
|
|
3606
|
+
const v = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, f = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
|
|
3558
3607
|
c("update:model-value", {
|
|
3559
3608
|
type: "timeframe",
|
|
3560
3609
|
property: "__now",
|
|
3561
|
-
start:
|
|
3562
|
-
end:
|
|
3610
|
+
start: v,
|
|
3611
|
+
end: f
|
|
3563
3612
|
});
|
|
3564
3613
|
break;
|
|
3565
3614
|
case "image": {
|
|
@@ -3603,10 +3652,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3603
3652
|
d(i.field.label_locale, i.field.label ?? "")
|
|
3604
3653
|
) : void 0
|
|
3605
3654
|
}));
|
|
3606
|
-
return (p,
|
|
3607
|
-
var u, m, C,
|
|
3608
|
-
const
|
|
3609
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
3655
|
+
return (p, v) => {
|
|
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, {
|
|
3610
3659
|
key: 0,
|
|
3611
3660
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
3612
3661
|
"label-mark": unref(r).labelMark,
|
|
@@ -3628,7 +3677,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3628
3677
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
3629
3678
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
3630
3679
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
3631
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
3680
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(k, {
|
|
3632
3681
|
key: 2,
|
|
3633
3682
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
3634
3683
|
"label-mark": unref(r).labelMark,
|
|
@@ -3636,7 +3685,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3636
3685
|
"model-value": unref(n),
|
|
3637
3686
|
"onUpdate:modelValue": l,
|
|
3638
3687
|
"show-word-count": "",
|
|
3639
|
-
"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
|
|
3640
3689
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
3641
3690
|
key: 3,
|
|
3642
3691
|
"campaign-type": e.extras,
|
|
@@ -3648,7 +3697,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3648
3697
|
"model-value": unref(n),
|
|
3649
3698
|
"onUpdate:modelValue": l
|
|
3650
3699
|
}, null, 8, ["model-value"]),
|
|
3651
|
-
createVNode(
|
|
3700
|
+
createVNode(y, {
|
|
3652
3701
|
class: "!mt-[8px]",
|
|
3653
3702
|
text: unref(ZodHelper).helperText(a(), ""),
|
|
3654
3703
|
state: unref(ZodHelper).helperState(a(), "")
|
|
@@ -3664,7 +3713,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3664
3713
|
(openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
|
|
3665
3714
|
]),
|
|
3666
3715
|
_: 1
|
|
3667
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
3716
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(g, {
|
|
3668
3717
|
key: 6,
|
|
3669
3718
|
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
3670
3719
|
"label-placement": "right",
|
|
@@ -3700,7 +3749,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3700
3749
|
"onUpdate:modelValue": l,
|
|
3701
3750
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
3702
3751
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
3703
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3752
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
|
|
3704
3753
|
key: 0,
|
|
3705
3754
|
class: "!mt-[8px]",
|
|
3706
3755
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -3711,7 +3760,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3711
3760
|
"model-value": unref(n),
|
|
3712
3761
|
"onUpdate:modelValue": l
|
|
3713
3762
|
}, null, 8, ["model-value"]),
|
|
3714
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3763
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
|
|
3715
3764
|
key: 0,
|
|
3716
3765
|
class: "!mt-[8px]",
|
|
3717
3766
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -3783,7 +3832,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3783
3832
|
"start-date": e.extras.start,
|
|
3784
3833
|
"end-date": e.extras.end
|
|
3785
3834
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
3786
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3835
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3787
3836
|
key: 0,
|
|
3788
3837
|
class: "!mt-[8px]",
|
|
3789
3838
|
text: e.helperText,
|
|
@@ -3794,14 +3843,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3794
3843
|
"model-value": unref(n),
|
|
3795
3844
|
"onUpdate:modelValue": l
|
|
3796
3845
|
}, null, 8, ["model-value"]),
|
|
3797
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3846
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3798
3847
|
key: 0,
|
|
3799
3848
|
class: "!mt-[8px]",
|
|
3800
3849
|
text: e.helperText,
|
|
3801
3850
|
state: "error"
|
|
3802
3851
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3803
3852
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
3804
|
-
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, {
|
|
3805
3854
|
key: 0,
|
|
3806
3855
|
state: "warning",
|
|
3807
3856
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
@@ -3810,7 +3859,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3810
3859
|
"model-value": unref(n),
|
|
3811
3860
|
"onUpdate:modelValue": l
|
|
3812
3861
|
}, null, 8, ["model-value"]),
|
|
3813
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3862
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3814
3863
|
key: 1,
|
|
3815
3864
|
class: "!mt-[8px]",
|
|
3816
3865
|
text: e.helperText,
|
|
@@ -3821,7 +3870,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3821
3870
|
"model-value": unref(n),
|
|
3822
3871
|
"onUpdate:modelValue": l
|
|
3823
3872
|
}, null, 8, ["model-value"]),
|
|
3824
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3873
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3825
3874
|
key: 0,
|
|
3826
3875
|
class: "!mt-[8px]",
|
|
3827
3876
|
text: e.helperText,
|
|
@@ -3832,7 +3881,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3832
3881
|
"model-value": unref(n),
|
|
3833
3882
|
"onUpdate:modelValue": l
|
|
3834
3883
|
}, null, 8, ["model-value"]),
|
|
3835
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3884
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3836
3885
|
key: 0,
|
|
3837
3886
|
class: "!mt-[8px]",
|
|
3838
3887
|
text: e.helperText,
|
|
@@ -3843,7 +3892,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3843
3892
|
"model-value": unref(n),
|
|
3844
3893
|
"onUpdate:modelValue": l
|
|
3845
3894
|
}, null, 8, ["model-value"]),
|
|
3846
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3895
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3847
3896
|
key: 0,
|
|
3848
3897
|
class: "!mt-[8px]",
|
|
3849
3898
|
text: e.helperText,
|
|
@@ -3854,7 +3903,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3854
3903
|
"model-value": unref(n),
|
|
3855
3904
|
"onUpdate:modelValue": l
|
|
3856
3905
|
}, null, 8, ["model-value"]),
|
|
3857
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3906
|
+
e.helperText ? (openBlock(), createBlock(y, {
|
|
3858
3907
|
key: 0,
|
|
3859
3908
|
class: "!mt-[8px]",
|
|
3860
3909
|
text: e.helperText,
|
|
@@ -4021,14 +4070,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4021
4070
|
return;
|
|
4022
4071
|
}
|
|
4023
4072
|
if (_.set(data.value, e, s), e == "campaign.event.type") {
|
|
4024
|
-
const
|
|
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({
|
|
4025
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
|
|
4026
4075
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
4027
4076
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
4028
4077
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
4029
4078
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
4030
4079
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
4031
|
-
]),
|
|
4080
|
+
]), f = RuleBuilder.setRuleToGroup(
|
|
4032
4081
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
4033
4082
|
[
|
|
4034
4083
|
RuleBuilder.constructEntry(
|
|
@@ -4041,13 +4090,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4041
4090
|
"&&"
|
|
4042
4091
|
);
|
|
4043
4092
|
if (s != "SCHEDULE") {
|
|
4044
|
-
_.set(data.value, "campaign.event.rule",
|
|
4093
|
+
_.set(data.value, "campaign.event.rule", v);
|
|
4045
4094
|
return;
|
|
4046
4095
|
}
|
|
4047
4096
|
_.set(
|
|
4048
4097
|
data.value,
|
|
4049
4098
|
"campaign.event.rule",
|
|
4050
|
-
RuleBuilder.setRuleToGroup(
|
|
4099
|
+
RuleBuilder.setRuleToGroup(v, f)
|
|
4051
4100
|
);
|
|
4052
4101
|
}
|
|
4053
4102
|
e == "campaign.notify" && s == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -4221,9 +4270,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4221
4270
|
disabled: isDisable(r),
|
|
4222
4271
|
"campaign-type": unref(campaignType),
|
|
4223
4272
|
"show-validation": unref(showValidation),
|
|
4224
|
-
"onUpdate:modelValue": (
|
|
4225
|
-
"onUpdate:file": async (
|
|
4226
|
-
const V = await onUpdateFile(
|
|
4273
|
+
"onUpdate:modelValue": (v) => onUpdateProperty(r.property, v),
|
|
4274
|
+
"onUpdate:file": async (v, f) => {
|
|
4275
|
+
const V = await onUpdateFile(v, f);
|
|
4227
4276
|
onUpdateProperty(r.property, V || "");
|
|
4228
4277
|
},
|
|
4229
4278
|
schema: unref(ZodHelper).typeAtPath(
|